From: Andrea Amorese
Date: Mon, 22 Nov 2021 14:36:16 +0000 (+0100)
Subject: Built motion from commit 64323aab.|2.5.38
X-Git-Url: http://repos.xcallymotion.com/base//%22api/fax/attachments/%7B%7BfaxAttachment.id%7D%7D/%22?a=commitdiff_plain;h=1cd618ab5d4395e8d72dad8adc31eb15964d2ca4;p=motion2.git
Built motion from commit 64323aab.|2.5.38
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index f34fee4..020a099 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-22T12:49:48.545Z",
+ "time": "2021-11-22T14:20:52.554Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 3bf2f6b..23a943e 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-22T12:49:48.545Z",
+ "time": "2021-11-22T14:20:52.554Z",
"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 d236744..1104b22 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 _0xf227=['sequelize','exports','VIRTUAL','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]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x4b704c,_0x29d011){var _0x4c6b36=function(_0x56b21d){while(--_0x56b21d){_0x4b704c['push'](_0x4b704c['shift']());}};_0x4c6b36(++_0x29d011);}(_0xf227,0x18f));var _0x7f22=function(_0x52b74e,_0x116323){_0x52b74e=_0x52b74e-0x0;var _0x341f43=_0xf227[_0x52b74e];return _0x341f43;};'use strict';var Sequelize=require(_0x7f22('0x0'));module[_0x7f22('0x1')]={'name':{'type':Sequelize[_0x7f22('0x2')],'get':function(_0x38de14){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x7f22('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7f22('0x4'),_0x7f22('0x5'),_0x7f22('0x6'),_0x7f22('0x7'),'urlForward',_0x7f22('0x8'),'bot',_0x7f22('0x9')]],'msg':_0x7f22('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7f22('0x3')](0x1000),'comment':_0x7f22('0xb')},'data2':{'type':Sequelize[_0x7f22('0x3')](0x1000),'comment':_0x7f22('0xc')},'data3':{'type':Sequelize[_0x7f22('0x3')](0x1000),'comment':_0x7f22('0xd')},'data4':{'type':Sequelize[_0x7f22('0x3')](0x1000),'comments':_0x7f22('0xe')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x7f22('0xf')},'data6':{'type':Sequelize[_0x7f22('0x3')],'comments':_0x7f22('0x10')},'data7':{'type':Sequelize[_0x7f22('0x11')],'comments':_0x7f22('0x12')}};
\ No newline at end of file
+var _0x60ed=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x335727,_0x21b693){var _0x54692e=function(_0x55a6a2){while(--_0x55a6a2){_0x335727['push'](_0x335727['shift']());}};_0x54692e(++_0x21b693);}(_0x60ed,0x73));var _0xd60e=function(_0x2e1b45,_0x236edf){_0x2e1b45=_0x2e1b45-0x0;var _0x479a04=_0x60ed[_0x2e1b45];return _0x479a04;};'use strict';var Sequelize=require(_0xd60e('0x0'));module[_0xd60e('0x1')]={'name':{'type':Sequelize[_0xd60e('0x2')],'get':function(_0x2f38f6){return this[_0xd60e('0x3')](_0xd60e('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xd60e('0x5'),'integration','motionbar','jscripty','urlForward',_0xd60e('0x6'),_0xd60e('0x7'),_0xd60e('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xd60e('0x9')},'data1':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comment':_0xd60e('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xd60e('0xc')},'data3':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comment':_0xd60e('0xd')},'data4':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comments':_0xd60e('0xe')},'data5':{'type':Sequelize[_0xd60e('0xa')](0x1000),'comments':_0xd60e('0xf')},'data6':{'type':Sequelize[_0xd60e('0xa')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xd60e('0x10')],'comments':_0xd60e('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 056e6ea..4de386a 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 _0x21d6=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','reject','save','update','then','destroy','error','name','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','desk.js','querystring','papaparse'];(function(_0x514a51,_0x1931e4){var _0x4b39d1=function(_0x56d7dc){while(--_0x56d7dc){_0x514a51['push'](_0x514a51['shift']());}};_0x4b39d1(++_0x1931e4);}(_0x21d6,0xff));var _0x621d=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x21d6[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x621d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x621d('0x1'));var jsonpatch=require(_0x621d('0x2'));var rp=require(_0x621d('0x3'));var moment=require(_0x621d('0x4'));var BPromise=require(_0x621d('0x5'));var Mustache=require(_0x621d('0x6'));var util=require(_0x621d('0x7'));var path=require(_0x621d('0x8'));var sox=require(_0x621d('0x9'));var csv=require(_0x621d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x621d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x621d('0xc'));var toCsv=require(_0x621d('0xa'));var querystring=require(_0x621d('0xd'));var Papa=require(_0x621d('0xe'));var Redis=require(_0x621d('0xf'));var authService=require(_0x621d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x621d('0x11'));var hardwareService=require(_0x621d('0x12'));var logger=require(_0x621d('0x13'))(_0x621d('0x14'));var utils=require(_0x621d('0x15'));var config=require(_0x621d('0x16'));var licenseUtil=require(_0x621d('0x17'));var db=require(_0x621d('0x18'))['db'];function respondWithStatusCode(_0x1be5c1,_0x10f191){_0x10f191=_0x10f191||0xcc;return function(_0x428237){if(_0x428237){return _0x1be5c1[_0x621d('0x19')](_0x10f191);}return _0x1be5c1['status'](_0x10f191)[_0x621d('0x1a')]();};}function respondWithResult(_0x520795,_0x59612f){_0x59612f=_0x59612f||0xc8;return function(_0x32a060){if(_0x32a060){return _0x520795['status'](_0x59612f)['json'](_0x32a060);}};}function respondWithFilteredResult(_0x1466ed,_0x48009d){return function(_0x3de694){if(_0x3de694){var _0x1d1eee=typeof _0x48009d[_0x621d('0x1b')]==='undefined'&&typeof _0x48009d[_0x621d('0x1c')]===_0x621d('0x1d');var _0x510e95=_0x3de694[_0x621d('0x1e')];var _0x51e001=_0x1d1eee?0x0:_0x48009d[_0x621d('0x1b')];var _0x245b8b=_0x1d1eee?_0x3de694[_0x621d('0x1e')]:_0x48009d['offset']+_0x48009d['limit'];var _0x6133b5;if(_0x245b8b>=_0x510e95){_0x245b8b=_0x510e95;_0x6133b5=0xc8;}else{_0x6133b5=0xce;}_0x1466ed[_0x621d('0x1f')](_0x6133b5);return _0x1466ed[_0x621d('0x20')]('Content-Range',_0x51e001+'-'+_0x245b8b+'/'+_0x510e95)['json'](_0x3de694);}return null;};}function patchUpdates(_0x4c38bd){return function(_0x2406e9){try{jsonpatch['apply'](_0x2406e9,_0x4c38bd,!![]);}catch(_0x15eda2){return BPromise[_0x621d('0x21')](_0x15eda2);}return _0x2406e9[_0x621d('0x22')]();};}function saveUpdates(_0x11dd8f,_0x10eaa1){return function(_0x2b4786){if(_0x2b4786){return _0x2b4786[_0x621d('0x23')](_0x11dd8f)[_0x621d('0x24')](function(_0x5b64f9){return _0x5b64f9;});}return null;};}function removeEntity(_0x4d8a2f,_0x3e6c73){return function(_0x5da701){if(_0x5da701){return _0x5da701[_0x621d('0x25')]()[_0x621d('0x24')](function(){_0x4d8a2f[_0x621d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1f2f3,_0x21a19f){return function(_0x517f88){if(!_0x517f88){_0xa1f2f3['sendStatus'](0x194);}return _0x517f88;};}function handleError(_0x35a48e,_0x2a53fa){_0x2a53fa=_0x2a53fa||0x1f4;return function(_0x318d46){logger[_0x621d('0x26')](_0x318d46['stack']);if(_0x318d46[_0x621d('0x27')]){delete _0x318d46[_0x621d('0x27')];}_0x35a48e[_0x621d('0x1f')](_0x2a53fa)['send'](_0x318d46);};}exports[_0x621d('0x23')]=function(_0x509c01,_0x43f03a){if(_0x509c01[_0x621d('0x28')]['id']){delete _0x509c01[_0x621d('0x28')]['id'];}return db[_0x621d('0x29')][_0x621d('0x2a')]({'where':{'id':_0x509c01[_0x621d('0x2b')]['id']}})[_0x621d('0x24')](handleEntityNotFound(_0x43f03a,null))[_0x621d('0x24')](saveUpdates(_0x509c01[_0x621d('0x28')],null))['then'](respondWithResult(_0x43f03a,null))[_0x621d('0x2c')](handleError(_0x43f03a,null));};exports[_0x621d('0x25')]=function(_0x19c6d7,_0x3a1c6c){return db[_0x621d('0x29')][_0x621d('0x2a')]({'where':{'id':_0x19c6d7[_0x621d('0x2b')]['id']}})[_0x621d('0x24')](handleEntityNotFound(_0x3a1c6c,null))['then'](removeEntity(_0x3a1c6c,null))[_0x621d('0x2c')](handleError(_0x3a1c6c,null));};
\ No newline at end of file
+var _0x7b5f=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','end','error','stack','name','update','body','Action','find','params','destroy','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x10f77c,_0x5cc257){var _0x262e22=function(_0x5c8e00){while(--_0x5c8e00){_0x10f77c['push'](_0x10f77c['shift']());}};_0x262e22(++_0x5cc257);}(_0x7b5f,0x7e));var _0xf7b5=function(_0x4fe2dd,_0x564590){_0x4fe2dd=_0x4fe2dd-0x0;var _0x48ef25=_0x7b5f[_0x4fe2dd];return _0x48ef25;};'use strict';var emlformat=require(_0xf7b5('0x0'));var rimraf=require(_0xf7b5('0x1'));var zipdir=require(_0xf7b5('0x2'));var jsonpatch=require(_0xf7b5('0x3'));var rp=require(_0xf7b5('0x4'));var moment=require(_0xf7b5('0x5'));var BPromise=require(_0xf7b5('0x6'));var Mustache=require('mustache');var util=require(_0xf7b5('0x7'));var path=require(_0xf7b5('0x8'));var sox=require(_0xf7b5('0x9'));var csv=require(_0xf7b5('0xa'));var ejs=require(_0xf7b5('0xb'));var fs=require('fs');var fs_extra=require(_0xf7b5('0xc'));var _=require('lodash');var squel=require(_0xf7b5('0xd'));var crypto=require(_0xf7b5('0xe'));var jsforce=require(_0xf7b5('0xf'));var deskjs=require(_0xf7b5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf7b5('0x11'));var Papa=require(_0xf7b5('0x12'));var Redis=require(_0xf7b5('0x13'));var authService=require(_0xf7b5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf7b5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7b5('0x16'))(_0xf7b5('0x17'));var utils=require(_0xf7b5('0x18'));var config=require(_0xf7b5('0x19'));var licenseUtil=require(_0xf7b5('0x1a'));var db=require(_0xf7b5('0x1b'))['db'];function respondWithStatusCode(_0x14e01d,_0x590eec){_0x590eec=_0x590eec||0xcc;return function(_0x46badc){if(_0x46badc){return _0x14e01d[_0xf7b5('0x1c')](_0x590eec);}return _0x14e01d[_0xf7b5('0x1d')](_0x590eec)['end']();};}function respondWithResult(_0x8c35a9,_0x1caff9){_0x1caff9=_0x1caff9||0xc8;return function(_0x4a9ce7){if(_0x4a9ce7){return _0x8c35a9[_0xf7b5('0x1d')](_0x1caff9)[_0xf7b5('0x1e')](_0x4a9ce7);}};}function respondWithFilteredResult(_0x3a58a0,_0x44c546){return function(_0x5d1997){if(_0x5d1997){var _0x4d0a11=typeof _0x44c546[_0xf7b5('0x1f')]===_0xf7b5('0x20')&&typeof _0x44c546['limit']===_0xf7b5('0x20');var _0x278e84=_0x5d1997[_0xf7b5('0x21')];var _0x4cdf30=_0x4d0a11?0x0:_0x44c546['offset'];var _0x36094b=_0x4d0a11?_0x5d1997[_0xf7b5('0x21')]:_0x44c546[_0xf7b5('0x1f')]+_0x44c546[_0xf7b5('0x22')];var _0x1d5cee;if(_0x36094b>=_0x278e84){_0x36094b=_0x278e84;_0x1d5cee=0xc8;}else{_0x1d5cee=0xce;}_0x3a58a0[_0xf7b5('0x1d')](_0x1d5cee);return _0x3a58a0[_0xf7b5('0x23')](_0xf7b5('0x24'),_0x4cdf30+'-'+_0x36094b+'/'+_0x278e84)[_0xf7b5('0x1e')](_0x5d1997);}return null;};}function patchUpdates(_0x41147a){return function(_0x402154){try{jsonpatch[_0xf7b5('0x25')](_0x402154,_0x41147a,!![]);}catch(_0x25d17a){return BPromise[_0xf7b5('0x26')](_0x25d17a);}return _0x402154[_0xf7b5('0x27')]();};}function saveUpdates(_0xa597ea,_0xc137b0){return function(_0x31c550){if(_0x31c550){return _0x31c550['update'](_0xa597ea)[_0xf7b5('0x28')](function(_0x12aa97){return _0x12aa97;});}return null;};}function removeEntity(_0x5150cc,_0x41223d){return function(_0x50d372){if(_0x50d372){return _0x50d372['destroy']()[_0xf7b5('0x28')](function(){_0x5150cc[_0xf7b5('0x1d')](0xcc)[_0xf7b5('0x29')]();});}};}function handleEntityNotFound(_0x2f521d,_0x377028){return function(_0x33de99){if(!_0x33de99){_0x2f521d[_0xf7b5('0x1c')](0x194);}return _0x33de99;};}function handleError(_0x176447,_0x1164ab){_0x1164ab=_0x1164ab||0x1f4;return function(_0xd6a3d3){logger[_0xf7b5('0x2a')](_0xd6a3d3[_0xf7b5('0x2b')]);if(_0xd6a3d3[_0xf7b5('0x2c')]){delete _0xd6a3d3[_0xf7b5('0x2c')];}_0x176447[_0xf7b5('0x1d')](_0x1164ab)['send'](_0xd6a3d3);};}exports[_0xf7b5('0x2d')]=function(_0x4f2b64,_0x13dc92){if(_0x4f2b64[_0xf7b5('0x2e')]['id']){delete _0x4f2b64['body']['id'];}return db[_0xf7b5('0x2f')][_0xf7b5('0x30')]({'where':{'id':_0x4f2b64[_0xf7b5('0x31')]['id']}})[_0xf7b5('0x28')](handleEntityNotFound(_0x13dc92,null))[_0xf7b5('0x28')](saveUpdates(_0x4f2b64[_0xf7b5('0x2e')],null))[_0xf7b5('0x28')](respondWithResult(_0x13dc92,null))['catch'](handleError(_0x13dc92,null));};exports[_0xf7b5('0x32')]=function(_0x4c8c67,_0x31cf75){return db[_0xf7b5('0x2f')][_0xf7b5('0x30')]({'where':{'id':_0x4c8c67[_0xf7b5('0x31')]['id']}})[_0xf7b5('0x28')](handleEntityNotFound(_0x31cf75,null))[_0xf7b5('0x28')](removeEntity(_0x31cf75,null))[_0xf7b5('0x33')](handleError(_0x31cf75,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 91d3435..9e99c27 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 _0x8937=['bluebird','request-promise','../../config/environment','./action.attributes','define','../../config/logger','api','moment'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x8937,0xd5));var _0x7893=function(_0x500cb5,_0x5d31ed){_0x500cb5=_0x500cb5-0x0;var _0x2c3663=_0x8937[_0x500cb5];return _0x2c3663;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7893('0x0'))(_0x7893('0x1'));var moment=require(_0x7893('0x2'));var BPromise=require(_0x7893('0x3'));var rp=require(_0x7893('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7893('0x5'));var attributes=require(_0x7893('0x6'));module['exports']=function(_0x426003,_0x4aeef3){return _0x426003[_0x7893('0x7')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00c2=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','define','Action','tools_actions'];(function(_0x5b2096,_0x213141){var _0x198357=function(_0x5afe77){while(--_0x5afe77){_0x5b2096['push'](_0x5b2096['shift']());}};_0x198357(++_0x213141);}(_0x00c2,0x79));var _0x200c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x00c2[_0x432682];return _0x463d05;};'use strict';var _=require(_0x200c('0x0'));var util=require(_0x200c('0x1'));var logger=require('../../config/logger')(_0x200c('0x2'));var moment=require(_0x200c('0x3'));var BPromise=require(_0x200c('0x4'));var rp=require(_0x200c('0x5'));var fs=require('fs');var path=require(_0x200c('0x6'));var rimraf=require('rimraf');var config=require(_0x200c('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x22ee78,_0x4a10ff){return _0x22ee78[_0x200c('0x8')](_0x200c('0x9'),attributes,{'tableName':_0x200c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 326c654..6683f56 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 _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x42c469,_0x47e42d){_0x42c469=_0x42c469-0x0;var _0x4d0d0d=_0x7a54[_0x42c469];return _0x4d0d0d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Action,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5883a9,_0xec68fb){var _0x1dad51=function(_0x5844b5){while(--_0x5844b5){_0x5883a9['push'](_0x5883a9['shift']());}};_0x1dad51(++_0xec68fb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3a7fe5,_0x371426){_0x3a7fe5=_0x3a7fe5-0x0;var _0x18ed66=_0x7fbe[_0x3a7fe5];return _0x18ed66;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 88af9f7..a0c599f 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 _0x651b=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x4e25f8,_0xbc6a91){var _0x59b0f8=function(_0x5eb590){while(--_0x5eb590){_0x4e25f8['push'](_0x4e25f8['shift']());}};_0x59b0f8(++_0xbc6a91);}(_0x651b,0x1b2));var _0xb651=function(_0x4b9bcc,_0x1eee90){_0x4b9bcc=_0x4b9bcc-0x0;var _0x35182a=_0x651b[_0x4b9bcc];return _0x35182a;};'use strict';var multer=require(_0xb651('0x0'));var util=require('util');var path=require(_0xb651('0x1'));var timeout=require('connect-timeout');var express=require(_0xb651('0x2'));var router=express[_0xb651('0x3')]();var fs_extra=require(_0xb651('0x4'));var auth=require(_0xb651('0x5'));var interaction=require(_0xb651('0x6'));var config=require(_0xb651('0x7'));var controller=require(_0xb651('0x8'));router['put'](_0xb651('0x9'),auth[_0xb651('0xa')](),controller[_0xb651('0xb')]);router[_0xb651('0xc')](_0xb651('0x9'),auth['isAuthenticated'](),controller[_0xb651('0xd')]);module[_0xb651('0xe')]=router;
\ No newline at end of file
+var _0xba06=['isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x512120,_0x1bd7ca){var _0x20b2e3=function(_0x3ac4b6){while(--_0x3ac4b6){_0x512120['push'](_0x512120['shift']());}};_0x20b2e3(++_0x1bd7ca);}(_0xba06,0x1b8));var _0x6ba0=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xba06[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require(_0x6ba0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ba0('0x1'));var express=require(_0x6ba0('0x2'));var router=express['Router']();var fs_extra=require(_0x6ba0('0x3'));var auth=require(_0x6ba0('0x4'));var interaction=require(_0x6ba0('0x5'));var config=require(_0x6ba0('0x6'));var controller=require(_0x6ba0('0x7'));router[_0x6ba0('0x8')](_0x6ba0('0x9'),auth[_0x6ba0('0xa')](),controller[_0x6ba0('0xb')]);router[_0x6ba0('0xc')]('/:id',auth[_0x6ba0('0xa')](),controller[_0x6ba0('0xd')]);module[_0x6ba0('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 88ad75a..8a38ce0 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 _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x50fc40,_0x490b06){var _0x3e4693=function(_0x251541){while(--_0x251541){_0x50fc40['push'](_0x50fc40['shift']());}};_0x3e4693(++_0x490b06);}(_0xeda8,0x104));var _0x8eda=function(_0x2d27c4,_0xd85997){_0x2d27c4=_0x2d27c4-0x0;var _0x3388ce=_0xeda8[_0x2d27c4];return _0x3388ce;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
+var _0xc4aa=['STRING','sequelize','exports'];(function(_0x2152ba,_0x2c6738){var _0x5a97cc=function(_0x45d812){while(--_0x45d812){_0x2152ba['push'](_0x2152ba['shift']());}};_0x5a97cc(++_0x2c6738);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xc4aa[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index daef462..b8438bc 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 _0x887a=['COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','type','parentKey','foreignTable','foreignKey','parse','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','DATE(%s)','includes','condition','getFields','%s.%s\x20=\x20%s.%s','conditions','clone','output','web','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','savename','countTable','COUNT(*)','run','COUNT(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20NULL','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','CustomReports','destroy','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','preview','join','left_join','right_join','cross_join','SUM(%s)'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x887a,0x186));var _0xa887=function(_0x2a4039,_0x72762f){_0x2a4039=_0x2a4039-0x0;var _0x3f774f=_0x887a[_0x2a4039];return _0x3f774f;};'use strict';var emlformat=require(_0xa887('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa887('0x1'));var jsonpatch=require(_0xa887('0x2'));var rp=require(_0xa887('0x3'));var moment=require(_0xa887('0x4'));var BPromise=require(_0xa887('0x5'));var Mustache=require(_0xa887('0x6'));var util=require(_0xa887('0x7'));var path=require(_0xa887('0x8'));var sox=require(_0xa887('0x9'));var csv=require(_0xa887('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa887('0xb'));var _=require(_0xa887('0xc'));var squel=require('squel');var crypto=require(_0xa887('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa887('0xe'));var toCsv=require(_0xa887('0xa'));var querystring=require(_0xa887('0xf'));var Papa=require(_0xa887('0x10'));var Redis=require(_0xa887('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa887('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa887('0x13'))('api');var utils=require(_0xa887('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa887('0x15'))['db'];var dbH=require(_0xa887('0x15'))['dbH'];function respondWithStatusCode(_0x20cdcc,_0x1fbf03){_0x1fbf03=_0x1fbf03||0xcc;return function(_0x1d643b){if(_0x1d643b){return _0x20cdcc[_0xa887('0x16')](_0x1fbf03);}return _0x20cdcc[_0xa887('0x17')](_0x1fbf03)[_0xa887('0x18')]();};}function respondWithResult(_0x298d82,_0x4a3132){_0x4a3132=_0x4a3132||0xc8;return function(_0x256188){if(_0x256188){return _0x298d82['status'](_0x4a3132)[_0xa887('0x19')](_0x256188);}};}function respondWithFilteredResult(_0x3e6b17,_0x17a284){return function(_0x5d11b5){if(_0x5d11b5){var _0x121849=typeof _0x17a284[_0xa887('0x1a')]===_0xa887('0x1b')&&typeof _0x17a284[_0xa887('0x1c')]===_0xa887('0x1b');var _0x1aac3f=_0x5d11b5['count'];var _0x2fabc4=_0x121849?0x0:_0x17a284[_0xa887('0x1a')];var _0x28bc8f=_0x121849?_0x5d11b5[_0xa887('0x1d')]:_0x17a284[_0xa887('0x1a')]+_0x17a284[_0xa887('0x1c')];var _0x5a2bd9;if(_0x28bc8f>=_0x1aac3f){_0x28bc8f=_0x1aac3f;_0x5a2bd9=0xc8;}else{_0x5a2bd9=0xce;}_0x3e6b17['status'](_0x5a2bd9);return _0x3e6b17[_0xa887('0x1e')](_0xa887('0x1f'),_0x2fabc4+'-'+_0x28bc8f+'/'+_0x1aac3f)['json'](_0x5d11b5);}return null;};}function patchUpdates(_0x51a6df){return function(_0x50f865){try{jsonpatch[_0xa887('0x20')](_0x50f865,_0x51a6df,!![]);}catch(_0x181a6f){return BPromise[_0xa887('0x21')](_0x181a6f);}return _0x50f865[_0xa887('0x22')]();};}function saveUpdates(_0x1618b0,_0x4971e9){return function(_0x57cdd3){if(_0x57cdd3){return _0x57cdd3[_0xa887('0x23')](_0x1618b0)[_0xa887('0x24')](function(_0x18d08b){return _0x18d08b;});}return null;};}function removeEntity(_0x67bae,_0x2ce227){return function(_0x21bdf8){if(_0x21bdf8){return _0x21bdf8['destroy']()['then'](function(){var _0x32d9c4=_0x21bdf8[_0xa887('0x25')]({'plain':!![]});var _0x195f8b=_0xa887('0x26');return db['UserProfileResource'][_0xa887('0x27')]({'where':{'type':_0x195f8b,'resourceId':_0x32d9c4['id']}})[_0xa887('0x24')](function(){return _0x21bdf8;});})[_0xa887('0x24')](function(){_0x67bae[_0xa887('0x17')](0xcc)[_0xa887('0x18')]();});}};}function handleEntityNotFound(_0x1941f9,_0x14aeca){return function(_0x31f054){if(!_0x31f054){_0x1941f9[_0xa887('0x16')](0x194);}return _0x31f054;};}function handleError(_0x3c04d2,_0x3f0ece){_0x3f0ece=_0x3f0ece||0x1f4;return function(_0x1ea461){logger[_0xa887('0x28')](_0x1ea461['stack']);if(_0x1ea461[_0xa887('0x29')]){delete _0x1ea461['name'];}_0x3c04d2[_0xa887('0x17')](_0x3f0ece)['send'](_0x1ea461);};}exports['index']=function(_0x187919,_0x2ec197){var _0x3f8cb9={},_0x3f9b8e={},_0x5ea122={'count':0x0,'rows':[]};var _0x16d7dd=_[_0xa887('0x2a')](db[_0xa887('0x2b')][_0xa887('0x2c')],function(_0x1eda51){return{'name':_0x1eda51[_0xa887('0x2d')],'type':_0x1eda51['type']['key']};});_0x3f9b8e[_0xa887('0x2e')]=_[_0xa887('0x2a')](_0x16d7dd,_0xa887('0x29'));_0x3f9b8e['query']=_[_0xa887('0x2f')](_0x187919[_0xa887('0x30')]);_0x3f9b8e[_0xa887('0x31')]=_[_0xa887('0x32')](_0x3f9b8e[_0xa887('0x2e')],_0x3f9b8e[_0xa887('0x30')]);_0x3f8cb9['attributes']=_['intersection'](_0x3f9b8e['model'],qs[_0xa887('0x33')](_0x187919[_0xa887('0x30')]['fields']));_0x3f8cb9[_0xa887('0x34')]=_0x3f8cb9[_0xa887('0x34')][_0xa887('0x35')]?_0x3f8cb9[_0xa887('0x34')]:_0x3f9b8e[_0xa887('0x2e')];if(!_0x187919[_0xa887('0x30')][_0xa887('0x36')]('nolimit')){_0x3f8cb9[_0xa887('0x1c')]=qs[_0xa887('0x1c')](_0x187919['query']['limit']);_0x3f8cb9['offset']=qs[_0xa887('0x1a')](_0x187919[_0xa887('0x30')]['offset']);}_0x3f8cb9[_0xa887('0x37')]=qs[_0xa887('0x38')](_0x187919[_0xa887('0x30')][_0xa887('0x38')]);_0x3f8cb9['where']=qs['filters'](_['pick'](_0x187919[_0xa887('0x30')],_0x3f9b8e['filters']),_0x16d7dd);if(_0x187919['query']['filter']){_0x3f8cb9['where']=_[_0xa887('0x39')](_0x3f8cb9[_0xa887('0x3a')],{'$or':_[_0xa887('0x2a')](_0x16d7dd,function(_0x5b9f41){if(_0x5b9f41['type']!==_0xa887('0x3b')){var _0x22ea22={};_0x22ea22[_0x5b9f41[_0xa887('0x29')]]={'$like':'%'+_0x187919[_0xa887('0x30')][_0xa887('0x3c')]+'%'};return _0x22ea22;}})});}_0x3f8cb9=_['merge']({},_0x3f8cb9,_0x187919[_0xa887('0x3d')]);var _0x506f3a={'where':_0x3f8cb9[_0xa887('0x3a')]};return db['AnalyticCustomReport']['count'](_0x506f3a)[_0xa887('0x24')](function(_0x1825c3){_0x5ea122['count']=_0x1825c3;if(_0x187919[_0xa887('0x30')][_0xa887('0x3e')]){_0x3f8cb9[_0xa887('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x3f8cb9);})['then'](function(_0x5476d3){_0x5ea122[_0xa887('0x40')]=_0x5476d3;return _0x5ea122;})[_0xa887('0x24')](respondWithFilteredResult(_0x2ec197,_0x3f8cb9))[_0xa887('0x41')](handleError(_0x2ec197,null));};exports[_0xa887('0x42')]=function(_0x3b4308,_0x267dd7){var _0x194aa9={'raw':![],'where':{'id':_0x3b4308[_0xa887('0x43')]['id']}},_0x41431d={};_0x41431d[_0xa887('0x2e')]=_[_0xa887('0x2f')](db[_0xa887('0x2b')][_0xa887('0x2c')]);_0x41431d[_0xa887('0x30')]=_[_0xa887('0x2f')](_0x3b4308['query']);_0x41431d['filters']=_['intersection'](_0x41431d[_0xa887('0x2e')],_0x41431d[_0xa887('0x30')]);_0x194aa9[_0xa887('0x34')]=_[_0xa887('0x32')](_0x41431d[_0xa887('0x2e')],qs[_0xa887('0x33')](_0x3b4308[_0xa887('0x30')]['fields']));_0x194aa9[_0xa887('0x34')]=_0x194aa9[_0xa887('0x34')][_0xa887('0x35')]?_0x194aa9[_0xa887('0x34')]:_0x41431d['model'];if(_0x3b4308[_0xa887('0x30')][_0xa887('0x3e')]){_0x194aa9[_0xa887('0x3f')]=[{'all':!![]}];}_0x194aa9=_[_0xa887('0x39')]({},_0x194aa9,_0x3b4308[_0xa887('0x3d')]);return db[_0xa887('0x2b')][_0xa887('0x44')](_0x194aa9)[_0xa887('0x24')](handleEntityNotFound(_0x267dd7,null))[_0xa887('0x24')](respondWithResult(_0x267dd7,null))[_0xa887('0x41')](handleError(_0x267dd7,null));};exports[_0xa887('0x45')]=function(_0x1ff077,_0x45b302){return db['AnalyticCustomReport']['create'](_0x1ff077[_0xa887('0x46')],{})[_0xa887('0x24')](function(_0x511c7a){var _0x4dc8ac=_0x1ff077[_0xa887('0x47')][_0xa887('0x25')]({'plain':!![]});if(!_0x4dc8ac)throw new Error(_0xa887('0x48'));if(_0x4dc8ac['role']===_0xa887('0x47')){var _0x27b01f=_0x511c7a[_0xa887('0x25')]({'plain':!![]});var _0x209a37=_0xa887('0x49');return db[_0xa887('0x4a')][_0xa887('0x44')]({'where':{'name':_0x209a37,'userProfileId':_0x4dc8ac[_0xa887('0x4b')]},'raw':!![]})['then'](function(_0x25d932){if(_0x25d932&&_0x25d932[_0xa887('0x4c')]===0x0){return db[_0xa887('0x4d')]['create']({'name':_0x27b01f[_0xa887('0x29')],'resourceId':_0x27b01f['id'],'type':_0xa887('0x26'),'sectionId':_0x25d932['id']},{})[_0xa887('0x24')](function(){return _0x511c7a;});}else{return _0x511c7a;}})[_0xa887('0x41')](function(_0x447d11){logger[_0xa887('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x447d11);throw _0x447d11;});}return _0x511c7a;})[_0xa887('0x24')](respondWithResult(_0x45b302,0xc9))['catch'](handleError(_0x45b302,null));};exports[_0xa887('0x23')]=function(_0x2fe0b7,_0x5b4d39){if(_0x2fe0b7[_0xa887('0x46')]['id']){delete _0x2fe0b7[_0xa887('0x46')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x2fe0b7[_0xa887('0x43')]['id']}})[_0xa887('0x24')](handleEntityNotFound(_0x5b4d39,null))[_0xa887('0x24')](saveUpdates(_0x2fe0b7['body'],null))['then'](respondWithResult(_0x5b4d39,null))[_0xa887('0x41')](handleError(_0x5b4d39,null));};exports[_0xa887('0x27')]=function(_0x4ecef0,_0x2f8e12){return db[_0xa887('0x2b')]['find']({'where':{'id':_0x4ecef0[_0xa887('0x43')]['id']}})[_0xa887('0x24')](handleEntityNotFound(_0x2f8e12,null))[_0xa887('0x24')](removeEntity(_0x2f8e12,null))['catch'](handleError(_0x2f8e12,null));};exports[_0xa887('0x4e')]=function(_0x55a841,_0x4f0b74){var _0x4d7805=0xa;var _0x5bdb06=[_0xa887('0x4f'),_0xa887('0x50'),_0xa887('0x51'),_0xa887('0x52')];var _0x50c169={'SUM':_0xa887('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa887('0x54'),'MAX':_0xa887('0x55'),'MIN':_0xa887('0x56'),'AVG':_0xa887('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa887('0x58'),'GROUP_CONCAT DESC':_0xa887('0x59')};var _0x33db00={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xa887('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x55a0c6=function(_0x52e438){return!_['includes']([_0xa887('0x5b'),'IS\x20NOT\x20NULL',_0xa887('0x5c'),_0xa887('0x5d')],_0x52e438);};var _0x375391=function(_0x2c7eab){if(!_0x2c7eab||!_0x2c7eab['rules'][_0xa887('0x35')]){return'';}for(var _0x5eb6ca='(',_0x4f954c=0x0;_0x4f954c<_0x2c7eab['rules'][_0xa887('0x35')];_0x4f954c+=0x1){_0x4f954c>0x0&&(_0x5eb6ca+='\x20'+_0x2c7eab[_0xa887('0x5e')]+'\x20');_0x5eb6ca+=_0x2c7eab[_0xa887('0x5f')][_0x4f954c][_0xa887('0x60')]?_0x375391(_0x2c7eab[_0xa887('0x5f')][_0x4f954c][_0xa887('0x60')]):_0x2c7eab[_0xa887('0x5f')][_0x4f954c]['field']+'\x20'+_0x2c7eab[_0xa887('0x5f')][_0x4f954c]['condition']+(_0x55a0c6(_0x2c7eab[_0xa887('0x5f')][_0x4f954c]['condition'])?'\x20'+_0x2c7eab['rules'][_0x4f954c][_0xa887('0x61')]:'');}return _0x5eb6ca+')';};var _0x29e7a8={'where':{'id':_0x55a841['params']['id']}},_0x6f2f5c,_0x4a414a,_0x136b39,_0x2b8f88,_0x387367;_0x29e7a8=_[_0xa887('0x39')]({},_0x29e7a8,_0x55a841['options']);return db[_0xa887('0x2b')]['find'](_0x29e7a8)['then'](function(_0x6f2d52){if(_0x6f2d52){_0x6f2f5c=_0x6f2d52;return _0x6f2d52['getFields']();}return null;})[_0xa887('0x24')](function(_0x57c7ab){if(_0x57c7ab){if(!_0x57c7ab[_0xa887('0x35')]){throw new db[(_0xa887('0x62'))][(_0xa887('0x63'))](_0xa887('0x64'),0x193);}_0x4a414a=_0x57c7ab;return db[_0xa887('0x65')][_0xa887('0x66')]({'raw':!![]});}return null;})['then'](function(_0x5609d1){if(_0x5609d1){_0x136b39=_[_0xa887('0x67')](_0x5609d1,'id');var _0x3435b1;var _0x106fc1=squel[_0xa887('0x68')]();_0x106fc1[_0xa887('0x69')](_0x6f2f5c[_0xa887('0x6a')]);for(var _0x5a1a0a=0x0;_0x5a1a0a<_0x4a414a[_0xa887('0x35')];_0x5a1a0a+=0x1){_0x3435b1=_0x4a414a[_0x5a1a0a][_0xa887('0x6b')]?_0x136b39[_0x4a414a[_0x5a1a0a][_0xa887('0x6b')]][_0xa887('0x6c')]:_0x4a414a[_0x5a1a0a][_0xa887('0x6d')];_0x3435b1=_0x4a414a[_0x5a1a0a][_0xa887('0x6e')]?_[_0xa887('0x6f')](_0x50c169[_0x4a414a[_0x5a1a0a][_0xa887('0x6e')]],'%s',_0x3435b1):_0x3435b1;_0x3435b1=_0x4a414a[_0x5a1a0a][_0xa887('0x70')]?_[_0xa887('0x6f')](_0x33db00[_0x4a414a[_0x5a1a0a][_0xa887('0x70')]],'%s',_0x3435b1):_0x3435b1;if(_0x4a414a[_0x5a1a0a][_0xa887('0x71')]){_0x106fc1[_0xa887('0x60')](_0x3435b1);}_0x4a414a[_0x5a1a0a]['orderBy']&&_0x106fc1[_0xa887('0x37')](_0x3435b1,_0x4a414a[_0x5a1a0a][_0xa887('0x72')]===_0xa887('0x73')?![]:!![]);_0x106fc1[_0xa887('0x6d')](_0x3435b1,_0x4a414a[_0x5a1a0a][_0xa887('0x74')]||_0x3435b1);}if(_0x6f2f5c[_0xa887('0x75')]){_0x6f2f5c[_0xa887('0x75')]=JSON['parse'](_0x6f2f5c[_0xa887('0x75')]);for(var _0x552083=0x0;_0x552083<_0x6f2f5c[_0xa887('0x75')]['length'];_0x552083+=0x1){if(_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x76')]&&_['includes'](_0x5bdb06,_0x6f2f5c['joins'][_0x552083][_0xa887('0x76')])&&_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x77')]&&_0x6f2f5c['joins'][_0x552083]['foreignTable']&&_0x6f2f5c[_0xa887('0x75')][_0x552083]['foreignKey']){_0x106fc1[_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x76')]](_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x78')],null,util[_0xa887('0x70')]('%s.%s\x20=\x20%s.%s',_0x6f2f5c[_0xa887('0x6a')],_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x77')],_0x6f2f5c[_0xa887('0x75')][_0x552083]['foreignTable'],_0x6f2f5c[_0xa887('0x75')][_0x552083][_0xa887('0x79')]));}}}if(_0x6f2f5c['conditions']){_0x6f2f5c['conditions']=JSON[_0xa887('0x7a')](_0x6f2f5c['conditions']);_0x106fc1[_0xa887('0x3a')](_0x375391(_0x6f2f5c['conditions'][_0xa887('0x60')]));}_0x387367=_0x106fc1['clone']();_0x106fc1['limit'](_0x4d7805);_0x106fc1['offset'](0x0);logger[_0xa887('0x7b')](_0xa887('0x7c'),_0x106fc1[_0xa887('0x7d')]());return dbH[_0xa887('0x7e')][_0xa887('0x30')](_0x106fc1[_0xa887('0x7d')](),{'type':dbH[_0xa887('0x7e')][_0xa887('0x7f')][_0xa887('0x80')]});}})[_0xa887('0x24')](respondWithResult(_0x4f0b74,null))['catch'](handleError(_0x4f0b74,null));};function runReport(_0x578cd9,_0x244d97,_0x3bd92c){var _0x34775a=_0x244d97[_0xa887('0x29')];var _0x2d384e=0xa;var _0x4aba27=[_0xa887('0x4f'),_0xa887('0x50'),_0xa887('0x51'),_0xa887('0x52')];var _0x604e7e={'SUM':_0xa887('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa887('0x54'),'MAX':_0xa887('0x55'),'MIN':_0xa887('0x56'),'AVG':_0xa887('0x57'),'GROUP_CONCAT':_0xa887('0x81'),'GROUP_CONCAT ASC':_0xa887('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5035af={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa887('0x82'),'HOUR':_0xa887('0x5a'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x48f3cb=function(_0x1edcef){return!_[_0xa887('0x83')]([_0xa887('0x5b'),'IS\x20NOT\x20NULL',_0xa887('0x5c'),_0xa887('0x5d')],_0x1edcef);};var _0x21477a=function(_0x1e7af7){if(!_0x1e7af7||!_0x1e7af7[_0xa887('0x5f')][_0xa887('0x35')]){return'';}for(var _0x4fbf02='(',_0x4709f3=0x0;_0x4709f3<_0x1e7af7['rules'][_0xa887('0x35')];_0x4709f3+=0x1){_0x4709f3>0x0&&(_0x4fbf02+='\x20'+_0x1e7af7['operator']+'\x20');_0x4fbf02+=_0x1e7af7[_0xa887('0x5f')][_0x4709f3][_0xa887('0x60')]?_0x21477a(_0x1e7af7[_0xa887('0x5f')][_0x4709f3]['group']):_0x1e7af7[_0xa887('0x5f')][_0x4709f3][_0xa887('0x6d')]+'\x20'+_0x1e7af7[_0xa887('0x5f')][_0x4709f3][_0xa887('0x84')]+(_0x48f3cb(_0x1e7af7[_0xa887('0x5f')][_0x4709f3][_0xa887('0x84')])?'\x20'+_0x1e7af7[_0xa887('0x5f')][_0x4709f3]['value']:'');}return _0x4fbf02+')';};var _0x5531e8={'where':{'id':_0x578cd9['id']}},_0xb0d7f,_0x392907,_0x117593,_0x71e459,_0x577ffa;_0x5531e8=_[_0xa887('0x39')]({},_0x5531e8,_0x3bd92c);return db[_0xa887('0x2b')][_0xa887('0x44')](_0x5531e8)[_0xa887('0x24')](function(_0x4acccb){if(_0x4acccb){_0xb0d7f=_0x4acccb;return _0x4acccb[_0xa887('0x85')]();}return null;})['then'](function(_0x2c3c1f){if(_0x2c3c1f){if(!_0x2c3c1f[_0xa887('0x35')]){throw new db[(_0xa887('0x62'))][(_0xa887('0x63'))](_0xa887('0x64'),0x193);}_0x392907=_0x2c3c1f;return db[_0xa887('0x65')][_0xa887('0x66')]({'raw':!![]});}return null;})[_0xa887('0x24')](function(_0x30448e){if(_0x30448e){_0x117593=_[_0xa887('0x67')](_0x30448e,'id');var _0x11bf09;var _0x3e90e=squel[_0xa887('0x68')]();_0x3e90e['from'](_0xb0d7f[_0xa887('0x6a')]);for(var _0x246721=0x0;_0x246721<_0x392907[_0xa887('0x35')];_0x246721+=0x1){_0x11bf09=_0x392907[_0x246721]['MetricId']?_0x117593[_0x392907[_0x246721][_0xa887('0x6b')]][_0xa887('0x6c')]:_0x392907[_0x246721][_0xa887('0x6d')];_0x11bf09=_0x392907[_0x246721]['function']?_[_0xa887('0x6f')](_0x604e7e[_0x392907[_0x246721]['function']],'%s',_0x11bf09):_0x11bf09;_0x11bf09=_0x392907[_0x246721][_0xa887('0x70')]?_[_0xa887('0x6f')](_0x5035af[_0x392907[_0x246721][_0xa887('0x70')]],'%s',_0x11bf09):_0x11bf09;if(_0x392907[_0x246721][_0xa887('0x71')]){_0x3e90e[_0xa887('0x60')](_0x11bf09);}_0x392907[_0x246721]['orderBy']&&_0x3e90e[_0xa887('0x37')](_0x11bf09,_0x392907[_0x246721][_0xa887('0x72')]===_0xa887('0x73')?![]:!![]);_0x3e90e[_0xa887('0x6d')](_0x11bf09,_0x392907[_0x246721][_0xa887('0x74')]||_0x11bf09);}if(_0xb0d7f['joins']){_0xb0d7f[_0xa887('0x75')]=JSON[_0xa887('0x7a')](_0xb0d7f[_0xa887('0x75')]);for(var _0x31e93d=0x0;_0x31e93d<_0xb0d7f['joins'][_0xa887('0x35')];_0x31e93d+=0x1){if(_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x76')]&&_[_0xa887('0x83')](_0x4aba27,_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x76')])&&_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x77')]&&_0xb0d7f['joins'][_0x31e93d]['foreignTable']&&_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x79')]){_0x3e90e[_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x76')]](_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x78')],null,util[_0xa887('0x70')](_0xa887('0x86'),_0xb0d7f[_0xa887('0x6a')],_0xb0d7f[_0xa887('0x75')][_0x31e93d]['parentKey'],_0xb0d7f[_0xa887('0x75')][_0x31e93d][_0xa887('0x78')],_0xb0d7f['joins'][_0x31e93d][_0xa887('0x79')]));}}}if(_0xb0d7f[_0xa887('0x87')]){_0xb0d7f[_0xa887('0x87')]=JSON[_0xa887('0x7a')](_0xb0d7f[_0xa887('0x87')]);_0x3e90e[_0xa887('0x3a')](_0x21477a(_0xb0d7f['conditions']['group']));}_0x577ffa=_0x3e90e[_0xa887('0x88')]();_0x3e90e['limit'](_0x2d384e);_0x3e90e[_0xa887('0x1a')](0x0);return;}})[_0xa887('0x24')](function(){if(_0x244d97[_0xa887('0x89')]===_0xa887('0x8a')){return null;}var _0x330340=_[_0xa887('0x39')](_0x244d97,{'name':_0x244d97['fullPath']||_0x244d97[_0xa887('0x29')]||_0xb0d7f['name'],'basename':_0x34775a,'savename':util['format']('%s-%s.%s',_0x244d97[_0xa887('0x29')]||_0xb0d7f[_0xa887('0x29')],require(_0xa887('0x8b'))[_0xa887('0x8c')](0x4),_0x244d97[_0xa887('0x89')]||_0xa887('0x8d')),'reportId':_0xb0d7f['id'],'reportType':_0xa887('0x8e')});return db[_0xa887('0x8f')][_0xa887('0x45')](_0x330340,{'raw':!![]});})['then'](function(_0x7a352e){if(_0xb0d7f[_0xa887('0x6a')]===_0xa887('0x90')){_0x577ffa[_0xa887('0x3a')](_0xb0d7f[_0xa887('0x6a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x244d97[_0xa887('0x91')],_0x244d97[_0xa887('0x92')]);}else{_0x577ffa[_0xa887('0x3a')](_0xb0d7f['table']+_0xa887('0x93'),_0x244d97[_0xa887('0x91')],_0x244d97[_0xa887('0x92')]);}if(_0x7a352e){logger[_0xa887('0x94')]('Run\x20Query:',_0x577ffa[_0xa887('0x7d')]());require('child_process')[_0xa887('0x95')](path[_0xa887('0x4f')](__dirname,_0xa887('0x96'),_0x7a352e[_0xa887('0x89')]),[_0x7a352e['id'],_0x577ffa[_0xa887('0x7d')](),path['join'](__dirname,'../../files/reports',_0x7a352e[_0xa887('0x97')]),_0x34775a]);return _0x7a352e;}else{var _0x5bf7e5=squel[_0xa887('0x68')]();_0x5bf7e5[_0xa887('0x69')]('('+_0x577ffa['toString']()+')',_0xa887('0x98'));_0x5bf7e5['field'](_0xa887('0x99'),_0xa887('0x1d'));_0x577ffa[_0xa887('0x1c')](_0x244d97[_0xa887('0x1c')]||_0x2d384e);_0x577ffa[_0xa887('0x1a')](_0x244d97[_0xa887('0x1a')]||0x0);return dbH[_0xa887('0x7e')]['query'](_0x5bf7e5['toString'](),{'type':dbH[_0xa887('0x7e')][_0xa887('0x7f')]['SELECT']})['then'](function(_0x496bef){if(!_0x496bef[_0xa887('0x35')]){_0x71e459=0x0;}else{_0x71e459=_0x496bef[0x0]['count']||0x0;}return dbH[_0xa887('0x7e')][_0xa887('0x30')](_0x577ffa[_0xa887('0x7d')](),{'type':dbH['sequelize'][_0xa887('0x7f')]['SELECT']});})[_0xa887('0x24')](function(_0x115a08){return{'rows':_0x115a08||[],'count':_0x71e459};});}});}exports[_0xa887('0x9a')]=function(_0x4b629e,_0x380ce9){return runReport(_0x4b629e[_0xa887('0x43')],_0x4b629e['query'],_0x4b629e['options'])[_0xa887('0x24')](respondWithResult(_0x380ce9,null))['catch'](handleError(_0x380ce9,null));};exports['runReport']=runReport;exports[_0xa887('0x30')]=function(_0x4d1772,_0x431c92){var _0x2eddff=0xa;var _0x437ce8=[_0xa887('0x4f'),_0xa887('0x50'),_0xa887('0x51'),'cross_join'];var _0x372c42={'SUM':_0xa887('0x53'),'COUNT':_0xa887('0x9b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa887('0x55'),'MIN':'MIN(%s)','AVG':_0xa887('0x57'),'GROUP_CONCAT':_0xa887('0x81'),'GROUP_CONCAT ASC':_0xa887('0x58'),'GROUP_CONCAT DESC':_0xa887('0x59')};var _0x5094f5={'SEC_TO_TIME':_0xa887('0x9c'),'DATE':_0xa887('0x82'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45912e=function(_0x141edc){return!_[_0xa887('0x83')](['IS\x20NULL',_0xa887('0x9d'),_0xa887('0x5c'),'IS\x20NOT\x20EMPTY'],_0x141edc);};var _0xa7b7c0=function(_0x3e23df){if(!_0x3e23df||!_0x3e23df[_0xa887('0x5f')][_0xa887('0x35')]){return'';}for(var _0x157156='(',_0x1476e2=0x0;_0x1476e2<_0x3e23df[_0xa887('0x5f')][_0xa887('0x35')];_0x1476e2+=0x1){_0x1476e2>0x0&&(_0x157156+='\x20'+_0x3e23df['operator']+'\x20');_0x157156+=_0x3e23df[_0xa887('0x5f')][_0x1476e2][_0xa887('0x60')]?_0xa7b7c0(_0x3e23df[_0xa887('0x5f')][_0x1476e2]['group']):_0x3e23df['rules'][_0x1476e2][_0xa887('0x6d')]+'\x20'+_0x3e23df['rules'][_0x1476e2][_0xa887('0x84')]+(_0x45912e(_0x3e23df[_0xa887('0x5f')][_0x1476e2][_0xa887('0x84')])?'\x20'+_0x3e23df[_0xa887('0x5f')][_0x1476e2][_0xa887('0x61')]:'');}return _0x157156+')';};var _0x46f6e0={'where':{'id':_0x4d1772[_0xa887('0x43')]['id']}},_0x510892,_0x1b8947,_0x45fa69,_0x4a7010,_0x15f459;_0x46f6e0=_['merge']({},_0x46f6e0,_0x4d1772['options']);return db[_0xa887('0x2b')][_0xa887('0x44')](_0x46f6e0)['then'](function(_0xa3a61e){if(_0xa3a61e){_0x510892=_0xa3a61e;return _0xa3a61e[_0xa887('0x85')]();}return null;})[_0xa887('0x24')](function(_0x4db40d){if(_0x4db40d){if(!_0x4db40d[_0xa887('0x35')]){throw new db[(_0xa887('0x62'))][(_0xa887('0x63'))](_0xa887('0x64'),0x193);}_0x1b8947=_0x4db40d;return db[_0xa887('0x65')][_0xa887('0x66')]({'raw':!![]});}return null;})[_0xa887('0x24')](function(_0x56c213){if(_0x56c213){_0x45fa69=_[_0xa887('0x67')](_0x56c213,'id');var _0x139e3d;var _0x246143=squel[_0xa887('0x68')]();_0x246143[_0xa887('0x69')](_0x510892[_0xa887('0x6a')]);for(var _0x2a1097=0x0;_0x2a1097<_0x1b8947[_0xa887('0x35')];_0x2a1097+=0x1){_0x139e3d=_0x1b8947[_0x2a1097][_0xa887('0x6b')]?_0x45fa69[_0x1b8947[_0x2a1097]['MetricId']][_0xa887('0x6c')]:_0x1b8947[_0x2a1097][_0xa887('0x6d')];_0x139e3d=_0x1b8947[_0x2a1097][_0xa887('0x6e')]?_[_0xa887('0x6f')](_0x372c42[_0x1b8947[_0x2a1097][_0xa887('0x6e')]],'%s',_0x139e3d):_0x139e3d;_0x139e3d=_0x1b8947[_0x2a1097][_0xa887('0x70')]?_['replace'](_0x5094f5[_0x1b8947[_0x2a1097][_0xa887('0x70')]],'%s',_0x139e3d):_0x139e3d;if(_0x1b8947[_0x2a1097][_0xa887('0x71')]){_0x246143['group'](_0x139e3d);}_0x1b8947[_0x2a1097][_0xa887('0x72')]&&_0x246143['order'](_0x139e3d,_0x1b8947[_0x2a1097][_0xa887('0x72')]==='DESC'?![]:!![]);_0x246143[_0xa887('0x6d')](_0x139e3d,_0x1b8947[_0x2a1097][_0xa887('0x74')]||_0x139e3d);}if(_0x510892[_0xa887('0x75')]){_0x510892[_0xa887('0x75')]=JSON[_0xa887('0x7a')](_0x510892[_0xa887('0x75')]);for(var _0x755943=0x0;_0x755943<_0x510892[_0xa887('0x75')]['length'];_0x755943+=0x1){if(_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x76')]&&_['includes'](_0x437ce8,_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x76')])&&_0x510892['joins'][_0x755943]['parentKey']&&_0x510892['joins'][_0x755943][_0xa887('0x78')]&&_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x79')]){_0x246143[_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x76')]](_0x510892[_0xa887('0x75')][_0x755943][_0xa887('0x78')],null,util[_0xa887('0x70')](_0xa887('0x86'),_0x510892['table'],_0x510892[_0xa887('0x75')][_0x755943]['parentKey'],_0x510892['joins'][_0x755943]['foreignTable'],_0x510892['joins'][_0x755943][_0xa887('0x79')]));}}}if(_0x510892[_0xa887('0x87')]){_0x510892['conditions']=JSON[_0xa887('0x7a')](_0x510892['conditions']);_0x246143[_0xa887('0x3a')](_0xa7b7c0(_0x510892[_0xa887('0x87')][_0xa887('0x60')]));}_0x15f459=_0x246143[_0xa887('0x88')]();_0x246143[_0xa887('0x1c')](_0x2eddff);_0x246143[_0xa887('0x1a')](0x0);logger[_0xa887('0x7b')](_0xa887('0x7c'),_0x246143[_0xa887('0x7d')]());return dbH['sequelize'][_0xa887('0x30')](_0x246143[_0xa887('0x7d')](),{'type':dbH['sequelize'][_0xa887('0x7f')][_0xa887('0x80')]});}})[_0xa887('0x24')](function(){return{'sql':_0x15f459['toString']()};})[_0xa887('0x24')](respondWithResult(_0x431c92,null))[_0xa887('0x41')](handleError(_0x431c92,null));};
\ No newline at end of file
+var _0x8588=['findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parse','includes','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','SUM(%s)','SEC_TO_TIME(%s)','IS\x20NULL','groupBy','alias','foreignTable','web','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','runReport','MIN(%s)','IS\x20NOT\x20NULL','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric'];(function(_0x1b5d75,_0x2ca173){var _0x510b64=function(_0x437cc8){while(--_0x437cc8){_0x1b5d75['push'](_0x1b5d75['shift']());}};_0x510b64(++_0x2ca173);}(_0x8588,0x185));var _0x8858=function(_0x3032ee,_0xbc5fb4){_0x3032ee=_0x3032ee-0x0;var _0x322ab0=_0x8588[_0x3032ee];return _0x322ab0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8858('0x0'));var zipdir=require(_0x8858('0x1'));var jsonpatch=require(_0x8858('0x2'));var rp=require(_0x8858('0x3'));var moment=require('moment');var BPromise=require(_0x8858('0x4'));var Mustache=require(_0x8858('0x5'));var util=require(_0x8858('0x6'));var path=require('path');var sox=require(_0x8858('0x7'));var csv=require(_0x8858('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8858('0x9'));var _=require(_0x8858('0xa'));var squel=require(_0x8858('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8858('0x8'));var querystring=require('querystring');var Papa=require(_0x8858('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8858('0xd'));var as=require(_0x8858('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8858('0xf'));var utils=require(_0x8858('0x10'));var config=require(_0x8858('0x11'));var licenseUtil=require(_0x8858('0x12'));var db=require(_0x8858('0x13'))['db'];var dbH=require(_0x8858('0x13'))[_0x8858('0x14')];function respondWithStatusCode(_0x3ebff2,_0x25504b){_0x25504b=_0x25504b||0xcc;return function(_0x268387){if(_0x268387){return _0x3ebff2[_0x8858('0x15')](_0x25504b);}return _0x3ebff2[_0x8858('0x16')](_0x25504b)[_0x8858('0x17')]();};}function respondWithResult(_0x424f1d,_0x1b7b6a){_0x1b7b6a=_0x1b7b6a||0xc8;return function(_0x4a9d43){if(_0x4a9d43){return _0x424f1d[_0x8858('0x16')](_0x1b7b6a)['json'](_0x4a9d43);}};}function respondWithFilteredResult(_0x26c0bd,_0x22b356){return function(_0x1cab6a){if(_0x1cab6a){var _0x3b7d14=typeof _0x22b356[_0x8858('0x18')]===_0x8858('0x19')&&typeof _0x22b356[_0x8858('0x1a')]===_0x8858('0x19');var _0x159aab=_0x1cab6a[_0x8858('0x1b')];var _0x5b0880=_0x3b7d14?0x0:_0x22b356[_0x8858('0x18')];var _0x83f44e=_0x3b7d14?_0x1cab6a[_0x8858('0x1b')]:_0x22b356[_0x8858('0x18')]+_0x22b356[_0x8858('0x1a')];var _0x1b8208;if(_0x83f44e>=_0x159aab){_0x83f44e=_0x159aab;_0x1b8208=0xc8;}else{_0x1b8208=0xce;}_0x26c0bd[_0x8858('0x16')](_0x1b8208);return _0x26c0bd[_0x8858('0x1c')](_0x8858('0x1d'),_0x5b0880+'-'+_0x83f44e+'/'+_0x159aab)[_0x8858('0x1e')](_0x1cab6a);}return null;};}function patchUpdates(_0x2b3786){return function(_0x30f607){try{jsonpatch[_0x8858('0x1f')](_0x30f607,_0x2b3786,!![]);}catch(_0x169487){return BPromise['reject'](_0x169487);}return _0x30f607['save']();};}function saveUpdates(_0x1e7ee,_0x48e402){return function(_0x147d9b){if(_0x147d9b){return _0x147d9b[_0x8858('0x20')](_0x1e7ee)[_0x8858('0x21')](function(_0x580fcb){return _0x580fcb;});}return null;};}function removeEntity(_0x4d7267,_0x4caccb){return function(_0x1a6672){if(_0x1a6672){return _0x1a6672[_0x8858('0x22')]()[_0x8858('0x21')](function(){var _0x11e03d=_0x1a6672['get']({'plain':!![]});var _0x113e0c=_0x8858('0x23');return db[_0x8858('0x24')][_0x8858('0x22')]({'where':{'type':_0x113e0c,'resourceId':_0x11e03d['id']}})[_0x8858('0x21')](function(){return _0x1a6672;});})[_0x8858('0x21')](function(){_0x4d7267[_0x8858('0x16')](0xcc)[_0x8858('0x17')]();});}};}function handleEntityNotFound(_0x341685,_0x1520d3){return function(_0x539596){if(!_0x539596){_0x341685[_0x8858('0x15')](0x194);}return _0x539596;};}function handleError(_0x4e2459,_0x3f9191){_0x3f9191=_0x3f9191||0x1f4;return function(_0x2fa4f9){logger[_0x8858('0x25')](_0x2fa4f9[_0x8858('0x26')]);if(_0x2fa4f9[_0x8858('0x27')]){delete _0x2fa4f9['name'];}_0x4e2459[_0x8858('0x16')](_0x3f9191)['send'](_0x2fa4f9);};}exports[_0x8858('0x28')]=function(_0x48fff3,_0x642830){var _0x4f00f8={},_0x4a0ea1={},_0x2cb8d7={'count':0x0,'rows':[]};var _0x48b09b=_[_0x8858('0x29')](db[_0x8858('0x2a')][_0x8858('0x2b')],function(_0x23ef02){return{'name':_0x23ef02[_0x8858('0x2c')],'type':_0x23ef02['type'][_0x8858('0x2d')]};});_0x4a0ea1['model']=_['map'](_0x48b09b,_0x8858('0x27'));_0x4a0ea1[_0x8858('0x2e')]=_[_0x8858('0x2f')](_0x48fff3[_0x8858('0x2e')]);_0x4a0ea1['filters']=_[_0x8858('0x30')](_0x4a0ea1[_0x8858('0x31')],_0x4a0ea1[_0x8858('0x2e')]);_0x4f00f8[_0x8858('0x32')]=_[_0x8858('0x30')](_0x4a0ea1[_0x8858('0x31')],qs[_0x8858('0x33')](_0x48fff3[_0x8858('0x2e')][_0x8858('0x33')]));_0x4f00f8[_0x8858('0x32')]=_0x4f00f8[_0x8858('0x32')][_0x8858('0x34')]?_0x4f00f8[_0x8858('0x32')]:_0x4a0ea1[_0x8858('0x31')];if(!_0x48fff3[_0x8858('0x2e')][_0x8858('0x35')](_0x8858('0x36'))){_0x4f00f8['limit']=qs['limit'](_0x48fff3[_0x8858('0x2e')][_0x8858('0x1a')]);_0x4f00f8['offset']=qs[_0x8858('0x18')](_0x48fff3[_0x8858('0x2e')][_0x8858('0x18')]);}_0x4f00f8['order']=qs['sort'](_0x48fff3['query'][_0x8858('0x37')]);_0x4f00f8[_0x8858('0x38')]=qs[_0x8858('0x39')](_[_0x8858('0x3a')](_0x48fff3['query'],_0x4a0ea1[_0x8858('0x39')]),_0x48b09b);if(_0x48fff3[_0x8858('0x2e')][_0x8858('0x3b')]){_0x4f00f8[_0x8858('0x38')]=_['merge'](_0x4f00f8[_0x8858('0x38')],{'$or':_[_0x8858('0x29')](_0x48b09b,function(_0x395e07){if(_0x395e07[_0x8858('0x3c')]!==_0x8858('0x3d')){var _0x5b9049={};_0x5b9049[_0x395e07[_0x8858('0x27')]]={'$like':'%'+_0x48fff3[_0x8858('0x2e')][_0x8858('0x3b')]+'%'};return _0x5b9049;}})});}_0x4f00f8=_[_0x8858('0x3e')]({},_0x4f00f8,_0x48fff3[_0x8858('0x3f')]);var _0x1dc20b={'where':_0x4f00f8[_0x8858('0x38')]};return db[_0x8858('0x2a')][_0x8858('0x1b')](_0x1dc20b)['then'](function(_0x3e8e06){_0x2cb8d7[_0x8858('0x1b')]=_0x3e8e06;if(_0x48fff3[_0x8858('0x2e')][_0x8858('0x40')]){_0x4f00f8['include']=[{'all':!![]}];}return db[_0x8858('0x2a')]['findAll'](_0x4f00f8);})['then'](function(_0x40e7a8){_0x2cb8d7[_0x8858('0x41')]=_0x40e7a8;return _0x2cb8d7;})[_0x8858('0x21')](respondWithFilteredResult(_0x642830,_0x4f00f8))[_0x8858('0x42')](handleError(_0x642830,null));};exports[_0x8858('0x43')]=function(_0x578757,_0x1fe047){var _0x4b42b8={'raw':![],'where':{'id':_0x578757[_0x8858('0x44')]['id']}},_0x4d4be3={};_0x4d4be3[_0x8858('0x31')]=_[_0x8858('0x2f')](db[_0x8858('0x2a')][_0x8858('0x2b')]);_0x4d4be3[_0x8858('0x2e')]=_[_0x8858('0x2f')](_0x578757[_0x8858('0x2e')]);_0x4d4be3[_0x8858('0x39')]=_[_0x8858('0x30')](_0x4d4be3[_0x8858('0x31')],_0x4d4be3[_0x8858('0x2e')]);_0x4b42b8[_0x8858('0x32')]=_[_0x8858('0x30')](_0x4d4be3[_0x8858('0x31')],qs[_0x8858('0x33')](_0x578757[_0x8858('0x2e')]['fields']));_0x4b42b8[_0x8858('0x32')]=_0x4b42b8[_0x8858('0x32')]['length']?_0x4b42b8[_0x8858('0x32')]:_0x4d4be3['model'];if(_0x578757[_0x8858('0x2e')][_0x8858('0x40')]){_0x4b42b8[_0x8858('0x45')]=[{'all':!![]}];}_0x4b42b8=_['merge']({},_0x4b42b8,_0x578757[_0x8858('0x3f')]);return db['AnalyticCustomReport']['find'](_0x4b42b8)[_0x8858('0x21')](handleEntityNotFound(_0x1fe047,null))[_0x8858('0x21')](respondWithResult(_0x1fe047,null))[_0x8858('0x42')](handleError(_0x1fe047,null));};exports[_0x8858('0x46')]=function(_0x5156c1,_0x435140){return db[_0x8858('0x2a')][_0x8858('0x46')](_0x5156c1['body'],{})['then'](function(_0x4143b2){var _0x15d86f=_0x5156c1[_0x8858('0x47')][_0x8858('0x48')]({'plain':!![]});if(!_0x15d86f)throw new Error(_0x8858('0x49'));if(_0x15d86f['role']===_0x8858('0x47')){var _0x5ebd23=_0x4143b2[_0x8858('0x48')]({'plain':!![]});var _0x3a25c5=_0x8858('0x4a');return db[_0x8858('0x4b')][_0x8858('0x4c')]({'where':{'name':_0x3a25c5,'userProfileId':_0x15d86f[_0x8858('0x4d')]},'raw':!![]})[_0x8858('0x21')](function(_0x44684b){if(_0x44684b&&_0x44684b[_0x8858('0x4e')]===0x0){return db[_0x8858('0x24')][_0x8858('0x46')]({'name':_0x5ebd23[_0x8858('0x27')],'resourceId':_0x5ebd23['id'],'type':'CustomReports','sectionId':_0x44684b['id']},{})[_0x8858('0x21')](function(){return _0x4143b2;});}else{return _0x4143b2;}})[_0x8858('0x42')](function(_0x575fda){logger[_0x8858('0x25')](_0x8858('0x4f'),_0x575fda);throw _0x575fda;});}return _0x4143b2;})[_0x8858('0x21')](respondWithResult(_0x435140,0xc9))[_0x8858('0x42')](handleError(_0x435140,null));};exports[_0x8858('0x20')]=function(_0x4515cf,_0x188f2e){if(_0x4515cf[_0x8858('0x50')]['id']){delete _0x4515cf[_0x8858('0x50')]['id'];}return db[_0x8858('0x2a')][_0x8858('0x4c')]({'where':{'id':_0x4515cf[_0x8858('0x44')]['id']}})[_0x8858('0x21')](handleEntityNotFound(_0x188f2e,null))[_0x8858('0x21')](saveUpdates(_0x4515cf[_0x8858('0x50')],null))[_0x8858('0x21')](respondWithResult(_0x188f2e,null))['catch'](handleError(_0x188f2e,null));};exports[_0x8858('0x22')]=function(_0xe47b4d,_0x439e55){return db['AnalyticCustomReport'][_0x8858('0x4c')]({'where':{'id':_0xe47b4d[_0x8858('0x44')]['id']}})[_0x8858('0x21')](handleEntityNotFound(_0x439e55,null))[_0x8858('0x21')](removeEntity(_0x439e55,null))[_0x8858('0x42')](handleError(_0x439e55,null));};exports[_0x8858('0x51')]=function(_0x4a5f86,_0x33d00a){var _0x251970=0xa;var _0x21a9ec=[_0x8858('0x52'),_0x8858('0x53'),_0x8858('0x54'),'cross_join'];var _0x11dfcd={'SUM':'SUM(%s)','COUNT':_0x8858('0x55'),'COUNT DISTINCT':_0x8858('0x56'),'MAX':_0x8858('0x57'),'MIN':'MIN(%s)','AVG':_0x8858('0x58'),'GROUP_CONCAT':_0x8858('0x59'),'GROUP_CONCAT ASC':_0x8858('0x5a'),'GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x33ce08={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':_0x8858('0x5f')};var _0x28bfae=function(_0x9f66c2){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x8858('0x60'),_0x8858('0x61')],_0x9f66c2);};var _0x2abac8=function(_0x239e73){if(!_0x239e73||!_0x239e73['rules']['length']){return'';}for(var _0x59137d='(',_0x410c73=0x0;_0x410c73<_0x239e73[_0x8858('0x62')]['length'];_0x410c73+=0x1){_0x410c73>0x0&&(_0x59137d+='\x20'+_0x239e73[_0x8858('0x63')]+'\x20');_0x59137d+=_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x64')]?_0x2abac8(_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x64')]):_0x239e73['rules'][_0x410c73][_0x8858('0x65')]+'\x20'+_0x239e73['rules'][_0x410c73][_0x8858('0x66')]+(_0x28bfae(_0x239e73['rules'][_0x410c73][_0x8858('0x66')])?'\x20'+_0x239e73[_0x8858('0x62')][_0x410c73][_0x8858('0x67')]:'');}return _0x59137d+')';};var _0xab7b6={'where':{'id':_0x4a5f86['params']['id']}},_0x225a27,_0x37b71c,_0x429d4e,_0x313575,_0x46d689;_0xab7b6=_['merge']({},_0xab7b6,_0x4a5f86['options']);return db['AnalyticCustomReport'][_0x8858('0x4c')](_0xab7b6)[_0x8858('0x21')](function(_0x24593a){if(_0x24593a){_0x225a27=_0x24593a;return _0x24593a[_0x8858('0x68')]();}return null;})[_0x8858('0x21')](function(_0x21b10b){if(_0x21b10b){if(!_0x21b10b[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))][(_0x8858('0x6a'))](_0x8858('0x6b'),0x193);}_0x37b71c=_0x21b10b;return db[_0x8858('0x6c')][_0x8858('0x6d')]({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x4dbe59){if(_0x4dbe59){_0x429d4e=_[_0x8858('0x6e')](_0x4dbe59,'id');var _0x183d52;var _0x3af3c9=squel[_0x8858('0x6f')]();_0x3af3c9[_0x8858('0x70')](_0x225a27[_0x8858('0x71')]);for(var _0x3b391f=0x0;_0x3b391f<_0x37b71c['length'];_0x3b391f+=0x1){_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x72')]?_0x429d4e[_0x37b71c[_0x3b391f][_0x8858('0x72')]][_0x8858('0x73')]:_0x37b71c[_0x3b391f][_0x8858('0x65')];_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x74')]?_[_0x8858('0x75')](_0x11dfcd[_0x37b71c[_0x3b391f][_0x8858('0x74')]],'%s',_0x183d52):_0x183d52;_0x183d52=_0x37b71c[_0x3b391f][_0x8858('0x76')]?_[_0x8858('0x75')](_0x33ce08[_0x37b71c[_0x3b391f]['format']],'%s',_0x183d52):_0x183d52;if(_0x37b71c[_0x3b391f]['groupBy']){_0x3af3c9['group'](_0x183d52);}_0x37b71c[_0x3b391f][_0x8858('0x77')]&&_0x3af3c9[_0x8858('0x78')](_0x183d52,_0x37b71c[_0x3b391f]['orderBy']===_0x8858('0x79')?![]:!![]);_0x3af3c9['field'](_0x183d52,_0x37b71c[_0x3b391f]['alias']||_0x183d52);}if(_0x225a27[_0x8858('0x7a')]){_0x225a27['joins']=JSON[_0x8858('0x7b')](_0x225a27['joins']);for(var _0x11ffe5=0x0;_0x11ffe5<_0x225a27[_0x8858('0x7a')]['length'];_0x11ffe5+=0x1){if(_0x225a27['joins'][_0x11ffe5][_0x8858('0x3c')]&&_[_0x8858('0x7c')](_0x21a9ec,_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x3c')])&&_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7d')]&&_0x225a27['joins'][_0x11ffe5]['foreignTable']&&_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7e')]){_0x3af3c9[_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x3c')]](_0x225a27[_0x8858('0x7a')][_0x11ffe5]['foreignTable'],null,util[_0x8858('0x76')](_0x8858('0x7f'),_0x225a27['table'],_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7d')],_0x225a27[_0x8858('0x7a')][_0x11ffe5]['foreignTable'],_0x225a27[_0x8858('0x7a')][_0x11ffe5][_0x8858('0x7e')]));}}}if(_0x225a27['conditions']){_0x225a27[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x225a27[_0x8858('0x80')]);_0x3af3c9[_0x8858('0x38')](_0x2abac8(_0x225a27['conditions']['group']));}_0x46d689=_0x3af3c9[_0x8858('0x81')]();_0x3af3c9['limit'](_0x251970);_0x3af3c9['offset'](0x0);logger[_0x8858('0x82')](_0x8858('0x83'),_0x3af3c9[_0x8858('0x84')]());return dbH[_0x8858('0x85')]['query'](_0x3af3c9[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')]['QueryTypes'][_0x8858('0x86')]});}})[_0x8858('0x21')](respondWithResult(_0x33d00a,null))[_0x8858('0x42')](handleError(_0x33d00a,null));};function runReport(_0x35f0b1,_0x15bb94,_0x49cbd6){var _0x1a2abe=_0x15bb94['name'];var _0x11c9ba=0xa;var _0x537a3c=[_0x8858('0x52'),_0x8858('0x53'),'right_join',_0x8858('0x87')];var _0x3f37c2={'SUM':_0x8858('0x88'),'COUNT':_0x8858('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8858('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8858('0x59'),'GROUP_CONCAT ASC':_0x8858('0x5a'),'GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x8286de={'SEC_TO_TIME':_0x8858('0x89'),'DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':_0x8858('0x5f')};var _0x53da63=function(_0x10ed5f){return!_[_0x8858('0x7c')]([_0x8858('0x8a'),'IS\x20NOT\x20NULL',_0x8858('0x60'),_0x8858('0x61')],_0x10ed5f);};var _0x49b73f=function(_0x162f5d){if(!_0x162f5d||!_0x162f5d[_0x8858('0x62')][_0x8858('0x34')]){return'';}for(var _0x4c6a3b='(',_0x57ad82=0x0;_0x57ad82<_0x162f5d[_0x8858('0x62')][_0x8858('0x34')];_0x57ad82+=0x1){_0x57ad82>0x0&&(_0x4c6a3b+='\x20'+_0x162f5d[_0x8858('0x63')]+'\x20');_0x4c6a3b+=_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x64')]?_0x49b73f(_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x64')]):_0x162f5d['rules'][_0x57ad82]['field']+'\x20'+_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x66')]+(_0x53da63(_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x66')])?'\x20'+_0x162f5d[_0x8858('0x62')][_0x57ad82][_0x8858('0x67')]:'');}return _0x4c6a3b+')';};var _0xda3d62={'where':{'id':_0x35f0b1['id']}},_0x42dfe2,_0x4cc804,_0x11ff22,_0x1b0d75,_0x4661e8;_0xda3d62=_[_0x8858('0x3e')]({},_0xda3d62,_0x49cbd6);return db[_0x8858('0x2a')][_0x8858('0x4c')](_0xda3d62)[_0x8858('0x21')](function(_0x50185b){if(_0x50185b){_0x42dfe2=_0x50185b;return _0x50185b['getFields']();}return null;})[_0x8858('0x21')](function(_0x4970a2){if(_0x4970a2){if(!_0x4970a2[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))]['ValidationErrorItem'](_0x8858('0x6b'),0x193);}_0x4cc804=_0x4970a2;return db['AnalyticMetric'][_0x8858('0x6d')]({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x1853f7){if(_0x1853f7){_0x11ff22=_['keyBy'](_0x1853f7,'id');var _0x21d1e2;var _0x463303=squel[_0x8858('0x6f')]();_0x463303[_0x8858('0x70')](_0x42dfe2[_0x8858('0x71')]);for(var _0x4aac5d=0x0;_0x4aac5d<_0x4cc804[_0x8858('0x34')];_0x4aac5d+=0x1){_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x72')]?_0x11ff22[_0x4cc804[_0x4aac5d][_0x8858('0x72')]][_0x8858('0x73')]:_0x4cc804[_0x4aac5d][_0x8858('0x65')];_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x74')]?_[_0x8858('0x75')](_0x3f37c2[_0x4cc804[_0x4aac5d][_0x8858('0x74')]],'%s',_0x21d1e2):_0x21d1e2;_0x21d1e2=_0x4cc804[_0x4aac5d][_0x8858('0x76')]?_[_0x8858('0x75')](_0x8286de[_0x4cc804[_0x4aac5d][_0x8858('0x76')]],'%s',_0x21d1e2):_0x21d1e2;if(_0x4cc804[_0x4aac5d][_0x8858('0x8b')]){_0x463303[_0x8858('0x64')](_0x21d1e2);}_0x4cc804[_0x4aac5d][_0x8858('0x77')]&&_0x463303[_0x8858('0x78')](_0x21d1e2,_0x4cc804[_0x4aac5d][_0x8858('0x77')]===_0x8858('0x79')?![]:!![]);_0x463303[_0x8858('0x65')](_0x21d1e2,_0x4cc804[_0x4aac5d][_0x8858('0x8c')]||_0x21d1e2);}if(_0x42dfe2[_0x8858('0x7a')]){_0x42dfe2['joins']=JSON['parse'](_0x42dfe2['joins']);for(var _0x4283e0=0x0;_0x4283e0<_0x42dfe2[_0x8858('0x7a')][_0x8858('0x34')];_0x4283e0+=0x1){if(_0x42dfe2['joins'][_0x4283e0][_0x8858('0x3c')]&&_[_0x8858('0x7c')](_0x537a3c,_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x3c')])&&_0x42dfe2['joins'][_0x4283e0][_0x8858('0x7d')]&&_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')]&&_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x7e')]){_0x463303[_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x3c')]](_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')],null,util[_0x8858('0x76')]('%s.%s\x20=\x20%s.%s',_0x42dfe2[_0x8858('0x71')],_0x42dfe2[_0x8858('0x7a')][_0x4283e0]['parentKey'],_0x42dfe2[_0x8858('0x7a')][_0x4283e0][_0x8858('0x8d')],_0x42dfe2['joins'][_0x4283e0][_0x8858('0x7e')]));}}}if(_0x42dfe2[_0x8858('0x80')]){_0x42dfe2[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x42dfe2[_0x8858('0x80')]);_0x463303[_0x8858('0x38')](_0x49b73f(_0x42dfe2[_0x8858('0x80')]['group']));}_0x4661e8=_0x463303[_0x8858('0x81')]();_0x463303[_0x8858('0x1a')](_0x11c9ba);_0x463303['offset'](0x0);return;}})[_0x8858('0x21')](function(){if(_0x15bb94['output']===_0x8858('0x8e')){return null;}var _0x50f0be=_[_0x8858('0x3e')](_0x15bb94,{'name':_0x15bb94['fullPath']||_0x15bb94[_0x8858('0x27')]||_0x42dfe2[_0x8858('0x27')],'basename':_0x1a2abe,'savename':util['format'](_0x8858('0x8f'),_0x15bb94['name']||_0x42dfe2[_0x8858('0x27')],require(_0x8858('0x90'))[_0x8858('0x91')](0x4),_0x15bb94[_0x8858('0x92')]||_0x8858('0x93')),'reportId':_0x42dfe2['id'],'reportType':'custom'});return db[_0x8858('0x94')][_0x8858('0x46')](_0x50f0be,{'raw':!![]});})[_0x8858('0x21')](function(_0x52cc8e){if(_0x42dfe2[_0x8858('0x71')]===_0x8858('0x95')){_0x4661e8[_0x8858('0x38')](_0x42dfe2[_0x8858('0x71')]+_0x8858('0x96'),_0x15bb94[_0x8858('0x97')],_0x15bb94[_0x8858('0x98')]);}else{_0x4661e8[_0x8858('0x38')](_0x42dfe2[_0x8858('0x71')]+_0x8858('0x99'),_0x15bb94[_0x8858('0x97')],_0x15bb94['endDate']);}if(_0x52cc8e){logger[_0x8858('0x9a')](_0x8858('0x9b'),_0x4661e8[_0x8858('0x84')]());require(_0x8858('0x9c'))['fork'](path[_0x8858('0x52')](__dirname,_0x8858('0x9d'),_0x52cc8e[_0x8858('0x92')]),[_0x52cc8e['id'],_0x4661e8[_0x8858('0x84')](),path['join'](__dirname,_0x8858('0x9e'),_0x52cc8e[_0x8858('0x9f')]),_0x1a2abe]);return _0x52cc8e;}else{var _0x2f0e31=squel[_0x8858('0x6f')]();_0x2f0e31[_0x8858('0x70')]('('+_0x4661e8[_0x8858('0x84')]()+')',_0x8858('0xa0'));_0x2f0e31[_0x8858('0x65')](_0x8858('0xa1'),_0x8858('0x1b'));_0x4661e8['limit'](_0x15bb94[_0x8858('0x1a')]||_0x11c9ba);_0x4661e8[_0x8858('0x18')](_0x15bb94['offset']||0x0);return dbH[_0x8858('0x85')]['query'](_0x2f0e31[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')][_0x8858('0xa2')][_0x8858('0x86')]})[_0x8858('0x21')](function(_0x512265){if(!_0x512265['length']){_0x1b0d75=0x0;}else{_0x1b0d75=_0x512265[0x0]['count']||0x0;}return dbH['sequelize'][_0x8858('0x2e')](_0x4661e8[_0x8858('0x84')](),{'type':dbH[_0x8858('0x85')][_0x8858('0xa2')][_0x8858('0x86')]});})['then'](function(_0xc1c3c4){return{'rows':_0xc1c3c4||[],'count':_0x1b0d75};});}});}exports['run']=function(_0x3fca7b,_0x24c820){return runReport(_0x3fca7b[_0x8858('0x44')],_0x3fca7b[_0x8858('0x2e')],_0x3fca7b['options'])[_0x8858('0x21')](respondWithResult(_0x24c820,null))['catch'](handleError(_0x24c820,null));};exports[_0x8858('0xa3')]=runReport;exports[_0x8858('0x2e')]=function(_0x27d9de,_0x32e1b0){var _0x488611=0xa;var _0x169e36=[_0x8858('0x52'),_0x8858('0x53'),'right_join',_0x8858('0x87')];var _0xb165f0={'SUM':'SUM(%s)','COUNT':_0x8858('0x55'),'COUNT DISTINCT':_0x8858('0x56'),'MAX':_0x8858('0x57'),'MIN':_0x8858('0xa4'),'AVG':_0x8858('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8858('0x5b')};var _0x50e8bc={'SEC_TO_TIME':_0x8858('0x89'),'DATE':_0x8858('0x5c'),'HOUR':_0x8858('0x5d'),'ROUND':_0x8858('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1aea97=function(_0x12cae1){return!_['includes']([_0x8858('0x8a'),_0x8858('0xa5'),_0x8858('0x60'),_0x8858('0x61')],_0x12cae1);};var _0x2eb95e=function(_0x2f3a38){if(!_0x2f3a38||!_0x2f3a38[_0x8858('0x62')][_0x8858('0x34')]){return'';}for(var _0x127fcd='(',_0x50a06b=0x0;_0x50a06b<_0x2f3a38[_0x8858('0x62')][_0x8858('0x34')];_0x50a06b+=0x1){_0x50a06b>0x0&&(_0x127fcd+='\x20'+_0x2f3a38[_0x8858('0x63')]+'\x20');_0x127fcd+=_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x64')]?_0x2eb95e(_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x64')]):_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x65')]+'\x20'+_0x2f3a38['rules'][_0x50a06b][_0x8858('0x66')]+(_0x1aea97(_0x2f3a38['rules'][_0x50a06b][_0x8858('0x66')])?'\x20'+_0x2f3a38[_0x8858('0x62')][_0x50a06b][_0x8858('0x67')]:'');}return _0x127fcd+')';};var _0x94cec0={'where':{'id':_0x27d9de[_0x8858('0x44')]['id']}},_0x1ee78b,_0x587766,_0x3b65a8,_0x4c21d7,_0x5e8cd7;_0x94cec0=_[_0x8858('0x3e')]({},_0x94cec0,_0x27d9de['options']);return db['AnalyticCustomReport'][_0x8858('0x4c')](_0x94cec0)[_0x8858('0x21')](function(_0x29159a){if(_0x29159a){_0x1ee78b=_0x29159a;return _0x29159a[_0x8858('0x68')]();}return null;})[_0x8858('0x21')](function(_0x1a51fa){if(_0x1a51fa){if(!_0x1a51fa[_0x8858('0x34')]){throw new db[(_0x8858('0x69'))]['ValidationErrorItem'](_0x8858('0x6b'),0x193);}_0x587766=_0x1a51fa;return db[_0x8858('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x8858('0x21')](function(_0x3734e0){if(_0x3734e0){_0x3b65a8=_['keyBy'](_0x3734e0,'id');var _0xefc581;var _0x4dbcc8=squel[_0x8858('0x6f')]();_0x4dbcc8[_0x8858('0x70')](_0x1ee78b[_0x8858('0x71')]);for(var _0x4fbf18=0x0;_0x4fbf18<_0x587766[_0x8858('0x34')];_0x4fbf18+=0x1){_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x72')]?_0x3b65a8[_0x587766[_0x4fbf18][_0x8858('0x72')]][_0x8858('0x73')]:_0x587766[_0x4fbf18][_0x8858('0x65')];_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x74')]?_[_0x8858('0x75')](_0xb165f0[_0x587766[_0x4fbf18][_0x8858('0x74')]],'%s',_0xefc581):_0xefc581;_0xefc581=_0x587766[_0x4fbf18][_0x8858('0x76')]?_['replace'](_0x50e8bc[_0x587766[_0x4fbf18][_0x8858('0x76')]],'%s',_0xefc581):_0xefc581;if(_0x587766[_0x4fbf18][_0x8858('0x8b')]){_0x4dbcc8[_0x8858('0x64')](_0xefc581);}_0x587766[_0x4fbf18][_0x8858('0x77')]&&_0x4dbcc8[_0x8858('0x78')](_0xefc581,_0x587766[_0x4fbf18][_0x8858('0x77')]===_0x8858('0x79')?![]:!![]);_0x4dbcc8[_0x8858('0x65')](_0xefc581,_0x587766[_0x4fbf18]['alias']||_0xefc581);}if(_0x1ee78b[_0x8858('0x7a')]){_0x1ee78b[_0x8858('0x7a')]=JSON[_0x8858('0x7b')](_0x1ee78b[_0x8858('0x7a')]);for(var _0x309311=0x0;_0x309311<_0x1ee78b['joins'][_0x8858('0x34')];_0x309311+=0x1){if(_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')]&&_['includes'](_0x169e36,_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')])&&_0x1ee78b['joins'][_0x309311][_0x8858('0x7d')]&&_0x1ee78b['joins'][_0x309311][_0x8858('0x8d')]&&_0x1ee78b[_0x8858('0x7a')][_0x309311]['foreignKey']){_0x4dbcc8[_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x3c')]](_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x8d')],null,util[_0x8858('0x76')]('%s.%s\x20=\x20%s.%s',_0x1ee78b['table'],_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x7d')],_0x1ee78b[_0x8858('0x7a')][_0x309311][_0x8858('0x8d')],_0x1ee78b['joins'][_0x309311][_0x8858('0x7e')]));}}}if(_0x1ee78b[_0x8858('0x80')]){_0x1ee78b[_0x8858('0x80')]=JSON[_0x8858('0x7b')](_0x1ee78b[_0x8858('0x80')]);_0x4dbcc8[_0x8858('0x38')](_0x2eb95e(_0x1ee78b[_0x8858('0x80')]['group']));}_0x5e8cd7=_0x4dbcc8[_0x8858('0x81')]();_0x4dbcc8[_0x8858('0x1a')](_0x488611);_0x4dbcc8[_0x8858('0x18')](0x0);logger[_0x8858('0x82')]('Limited\x20Query:',_0x4dbcc8['toString']());return dbH[_0x8858('0x85')]['query'](_0x4dbcc8[_0x8858('0x84')](),{'type':dbH['sequelize'][_0x8858('0xa2')][_0x8858('0x86')]});}})[_0x8858('0x21')](function(){return{'sql':_0x5e8cd7[_0x8858('0x84')]()};})[_0x8858('0x21')](respondWithResult(_0x32e1b0,null))['catch'](handleError(_0x32e1b0,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 84837ea..ca38cfd 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 _0x3f73=['./analyticCustomReport.attributes','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x134db1,_0x255174){var _0x1b807d=function(_0xfe3ce1){while(--_0xfe3ce1){_0x134db1['push'](_0x134db1['shift']());}};_0x1b807d(++_0x255174);}(_0x3f73,0xdc));var _0x33f7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3f73[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x33f7('0x0'));var util=require('util');var logger=require(_0x33f7('0x1'))('api');var moment=require(_0x33f7('0x2'));var BPromise=require('bluebird');var rp=require(_0x33f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33f7('0x4'));var config=require('../../config/environment');var attributes=require(_0x33f7('0x5'));module['exports']=function(_0x3eccea,_0x4efecf){return _0x3eccea[_0x33f7('0x6')](_0x33f7('0x7'),attributes,{'tableName':_0x33f7('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ea5=['path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','../../config/logger','moment','bluebird','request-promise'];(function(_0x30bbd4,_0x5c703e){var _0x559cb2=function(_0x54b3fe){while(--_0x54b3fe){_0x30bbd4['push'](_0x30bbd4['shift']());}};_0x559cb2(++_0x5c703e);}(_0x9ea5,0x100));var _0x59ea=function(_0xd13772,_0x5636d1){_0xd13772=_0xd13772-0x0;var _0x2d80f1=_0x9ea5[_0xd13772];return _0x2d80f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x59ea('0x0'))('api');var moment=require(_0x59ea('0x1'));var BPromise=require(_0x59ea('0x2'));var rp=require(_0x59ea('0x3'));var fs=require('fs');var path=require(_0x59ea('0x4'));var rimraf=require(_0x59ea('0x5'));var config=require('../../config/environment');var attributes=require(_0x59ea('0x6'));module[_0x59ea('0x7')]=function(_0x49e534,_0x12fda9){return _0x49e534[_0x59ea('0x8')](_0x59ea('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index b59e84b..d189d47 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 _0x8418=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1a1872,_0x409461){var _0x5d0ad9=function(_0x524070){while(--_0x524070){_0x1a1872['push'](_0x1a1872['shift']());}};_0x5d0ad9(++_0x409461);}(_0x8418,0x6a));var _0x8841=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x8418[_0x542da8];return _0x533d7e;};'use strict';var _=require('lodash');var util=require(_0x8841('0x0'));var moment=require(_0x8841('0x1'));var BPromise=require(_0x8841('0x2'));var rs=require(_0x8841('0x3'));var fs=require('fs');var Redis=require(_0x8841('0x4'));var db=require(_0x8841('0x5'))['db'];var utils=require(_0x8841('0x6'));var logger=require(_0x8841('0x7'))(_0x8841('0x8'));var config=require(_0x8841('0x9'));var jayson=require(_0x8841('0xa'));var client=jayson['client'][_0x8841('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x175b68,_0x41eeab,_0x421ca9){return new BPromise(function(_0x2a49c7,_0x2fd58a){return client['request'](_0x175b68,_0x421ca9)[_0x8841('0xc')](function(_0xa9253){logger['info'](_0x8841('0xd'),_0x41eeab,_0x8841('0xe'));logger[_0x8841('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x41eeab,_0x8841('0xe'),JSON[_0x8841('0x10')](_0xa9253));if(_0xa9253[_0x8841('0x11')]){if(_0xa9253[_0x8841('0x11')][_0x8841('0x12')]===0x1f4){logger[_0x8841('0x11')](_0x8841('0xd'),_0x41eeab,_0xa9253[_0x8841('0x11')][_0x8841('0x13')]);return _0x2fd58a(_0xa9253['error']['message']);}logger[_0x8841('0x11')](_0x8841('0xd'),_0x41eeab,_0xa9253[_0x8841('0x11')][_0x8841('0x13')]);return _0x2a49c7(_0xa9253[_0x8841('0x11')][_0x8841('0x13')]);}else{logger['info'](_0x8841('0xd'),_0x41eeab,_0x8841('0xe'));_0x2a49c7(_0xa9253[_0x8841('0x14')][_0x8841('0x13')]);}})['catch'](function(_0x25d65e){logger['error'](_0x8841('0xd'),_0x41eeab,_0x25d65e);_0x2fd58a(_0x25d65e);});});}
\ No newline at end of file
+var _0x23aa=['debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x23aa,0x179));var _0xa23a=function(_0x53485a,_0x587f3f){_0x53485a=_0x53485a-0x0;var _0x448d36=_0x23aa[_0x53485a];return _0x448d36;};'use strict';var _=require(_0xa23a('0x0'));var util=require('util');var moment=require(_0xa23a('0x1'));var BPromise=require(_0xa23a('0x2'));var rs=require(_0xa23a('0x3'));var fs=require('fs');var Redis=require(_0xa23a('0x4'));var db=require(_0xa23a('0x5'))['db'];var utils=require(_0xa23a('0x6'));var logger=require(_0xa23a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa23a('0x8')][_0xa23a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d8f6d,_0x5400d3,_0x56cec7){return new BPromise(function(_0x3685ec,_0x4763e1){return client[_0xa23a('0xa')](_0x3d8f6d,_0x56cec7)[_0xa23a('0xb')](function(_0x262cf1){logger[_0xa23a('0xc')](_0xa23a('0xd'),_0x5400d3,'request\x20sent');logger[_0xa23a('0xe')](_0xa23a('0xf'),_0x5400d3,_0xa23a('0x10'),JSON[_0xa23a('0x11')](_0x262cf1));if(_0x262cf1[_0xa23a('0x12')]){if(_0x262cf1[_0xa23a('0x12')][_0xa23a('0x13')]===0x1f4){logger[_0xa23a('0x12')](_0xa23a('0xd'),_0x5400d3,_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);return _0x4763e1(_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5400d3,_0x262cf1[_0xa23a('0x12')][_0xa23a('0x14')]);return _0x3685ec(_0x262cf1[_0xa23a('0x12')]['message']);}else{logger[_0xa23a('0xc')](_0xa23a('0xd'),_0x5400d3,_0xa23a('0x10'));_0x3685ec(_0x262cf1[_0xa23a('0x15')][_0xa23a('0x14')]);}})[_0xa23a('0x16')](function(_0x271604){logger[_0xa23a('0x12')](_0xa23a('0xd'),_0x5400d3,_0x271604);_0x4763e1(_0x271604);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index be4c755..e94e9ae 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 _0x7909=['isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x23bd94,_0x208837){var _0xb1791b=function(_0x2f6b64){while(--_0x2f6b64){_0x23bd94['push'](_0x23bd94['shift']());}};_0xb1791b(++_0x208837);}(_0x7909,0x10a));var _0x9790=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7909[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x9790('0x0'));var util=require(_0x9790('0x1'));var path=require(_0x9790('0x2'));var timeout=require(_0x9790('0x3'));var express=require(_0x9790('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9790('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9790('0x6'));var controller=require(_0x9790('0x7'));router[_0x9790('0x8')]('/',auth[_0x9790('0x9')](),controller[_0x9790('0xa')]);router['get'](_0x9790('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9790('0x8')](_0x9790('0xc'),auth[_0x9790('0x9')](),controller[_0x9790('0xd')]);router['get'](_0x9790('0xe'),auth[_0x9790('0x9')](),controller[_0x9790('0xf')]);router[_0x9790('0x8')](_0x9790('0x10'),auth['isAuthenticated'](),controller[_0x9790('0x11')]);router[_0x9790('0x12')]('/',auth[_0x9790('0x9')](),controller[_0x9790('0x13')]);router[_0x9790('0x14')](_0x9790('0xb'),auth['isAuthenticated'](),controller[_0x9790('0x15')]);router[_0x9790('0x16')](_0x9790('0xb'),auth[_0x9790('0x9')](),controller[_0x9790('0x17')]);module[_0x9790('0x18')]=router;
\ No newline at end of file
+var _0xf523=['post','create','put','/:id','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query'];(function(_0xf962f1,_0x129190){var _0x3418c3=function(_0x32825c){while(--_0x32825c){_0xf962f1['push'](_0xf962f1['shift']());}};_0x3418c3(++_0x129190);}(_0xf523,0x196));var _0x3f52=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf523[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x3f52('0x0'));var path=require('path');var timeout=require(_0x3f52('0x1'));var express=require('express');var router=express[_0x3f52('0x2')]();var fs_extra=require(_0x3f52('0x3'));var auth=require(_0x3f52('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3f52('0x5'));var controller=require('./analyticCustomReport.controller');router[_0x3f52('0x6')]('/',auth[_0x3f52('0x7')](),controller['index']);router[_0x3f52('0x6')]('/:id',auth[_0x3f52('0x7')](),controller[_0x3f52('0x8')]);router[_0x3f52('0x6')](_0x3f52('0x9'),auth[_0x3f52('0x7')](),controller['preview']);router[_0x3f52('0x6')](_0x3f52('0xa'),auth[_0x3f52('0x7')](),controller[_0x3f52('0xb')]);router[_0x3f52('0x6')](_0x3f52('0xc'),auth[_0x3f52('0x7')](),controller[_0x3f52('0xd')]);router[_0x3f52('0xe')]('/',auth[_0x3f52('0x7')](),controller[_0x3f52('0xf')]);router[_0x3f52('0x10')](_0x3f52('0x11'),auth['isAuthenticated'](),controller[_0x3f52('0x12')]);router['delete'](_0x3f52('0x11'),auth[_0x3f52('0x7')](),controller[_0x3f52('0x13')]);module[_0x3f52('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index c71e0ad..822b93b 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 _0x98a8=['sequelize','exports','STRING','TEXT'];(function(_0x20f7d1,_0x15897f){var _0x12ba03=function(_0x1bc254){while(--_0x1bc254){_0x20f7d1['push'](_0x20f7d1['shift']());}};_0x12ba03(++_0x15897f);}(_0x98a8,0x12c));var _0x898a=function(_0x5a7720,_0x49c410){_0x5a7720=_0x5a7720-0x0;var _0x3ff48a=_0x98a8[_0x5a7720];return _0x3ff48a;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'name':{'type':Sequelize[_0x898a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x898a('0x2')]},'parent':{'type':Sequelize[_0x898a('0x2')]},'table':{'type':Sequelize[_0x898a('0x2')]},'conditions':{'type':Sequelize[_0x898a('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x21e857,_0x319366){var _0x3ed3ef=function(_0x17370c){while(--_0x17370c){_0x21e857['push'](_0x21e857['shift']());}};_0x3ed3ef(++_0x319366);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4adff1,_0x4a8cbe){_0x4adff1=_0x4adff1-0x0;var _0x318759=_0x3f8a[_0x4adff1];return _0x318759;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 79f84fc..798f0a0 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 _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x1ae283,_0x25d017){var _0xf8240b=function(_0x59c270){while(--_0x59c270){_0x1ae283['push'](_0x1ae283['shift']());}};_0xf8240b(++_0x25d017);}(_0x0295,0x1f0));var _0x5029=function(_0x3b95e2,_0x3d2dfb){_0x3b95e2=_0x3b95e2-0x0;var _0x1191c4=_0x0295[_0x3b95e2];return _0x1191c4;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
+var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6d38,0x1ef));var _0x86d3=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x6d38[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index bca4bab..913eb62 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 _0x24cb=['util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports'];(function(_0x263fbe,_0x114996){var _0x2378c3=function(_0x45b3ef){while(--_0x45b3ef){_0x263fbe['push'](_0x263fbe['shift']());}};_0x2378c3(++_0x114996);}(_0x24cb,0x1ad));var _0xb24c=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x24cb[_0x55ff3e];return _0x2709eb;};'use strict';var _=require('lodash');var util=require(_0xb24c('0x0'));var logger=require('../../config/logger')(_0xb24c('0x1'));var moment=require(_0xb24c('0x2'));var BPromise=require(_0xb24c('0x3'));var rp=require(_0xb24c('0x4'));var fs=require('fs');var path=require(_0xb24c('0x5'));var rimraf=require('rimraf');var config=require(_0xb24c('0x6'));var attributes=require(_0xb24c('0x7'));module[_0xb24c('0x8')]=function(_0x22a50b,_0x40aaf7){return _0x22a50b['define'](_0xb24c('0x9'),attributes,{'tableName':_0xb24c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda83=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x33b985,_0x4ac6e0){var _0x12f944=function(_0x307bac){while(--_0x307bac){_0x33b985['push'](_0x33b985['shift']());}};_0x12f944(++_0x4ac6e0);}(_0xda83,0x70));var _0x3da8=function(_0x2674ec,_0x58c37e){_0x2674ec=_0x2674ec-0x0;var _0x3845d5=_0xda83[_0x2674ec];return _0x3845d5;};'use strict';var _=require('lodash');var util=require(_0x3da8('0x0'));var logger=require(_0x3da8('0x1'))(_0x3da8('0x2'));var moment=require('moment');var BPromise=require(_0x3da8('0x3'));var rp=require(_0x3da8('0x4'));var fs=require('fs');var path=require(_0x3da8('0x5'));var rimraf=require(_0x3da8('0x6'));var config=require(_0x3da8('0x7'));var attributes=require(_0x3da8('0x8'));module[_0x3da8('0x9')]=function(_0x4c5000,_0xfc93f){return _0x4c5000['define'](_0x3da8('0xa'),attributes,{'tableName':_0x3da8('0xb'),'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 819546c..9a7bdae 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 _0x96f2=['rpc','jayson/promise','http','request','then','info','request\x20sent','stringify','error','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x37d3e0,_0x51d1f4){var _0x5512a3=function(_0x496e6b){while(--_0x496e6b){_0x37d3e0['push'](_0x37d3e0['shift']());}};_0x5512a3(++_0x51d1f4);}(_0x96f2,0x15d));var _0x296f=function(_0x24b1c8,_0xce9387){_0x24b1c8=_0x24b1c8-0x0;var _0x1a1419=_0x96f2[_0x24b1c8];return _0x1a1419;};'use strict';var _=require(_0x296f('0x0'));var util=require(_0x296f('0x1'));var moment=require(_0x296f('0x2'));var BPromise=require(_0x296f('0x3'));var rs=require(_0x296f('0x4'));var fs=require('fs');var Redis=require(_0x296f('0x5'));var db=require(_0x296f('0x6'))['db'];var utils=require(_0x296f('0x7'));var logger=require('../../config/logger')(_0x296f('0x8'));var config=require('../../config/environment');var jayson=require(_0x296f('0x9'));var client=jayson['client'][_0x296f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x443152,_0x2dd104,_0x51282c){return new BPromise(function(_0x460470,_0x577005){return client[_0x296f('0xb')](_0x443152,_0x51282c)[_0x296f('0xc')](function(_0x1aab71){logger[_0x296f('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2dd104,_0x296f('0xe'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2dd104,_0x296f('0xe'),JSON[_0x296f('0xf')](_0x1aab71));if(_0x1aab71[_0x296f('0x10')]){if(_0x1aab71[_0x296f('0x10')]['code']===0x1f4){logger[_0x296f('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2dd104,_0x1aab71[_0x296f('0x10')][_0x296f('0x11')]);return _0x577005(_0x1aab71[_0x296f('0x10')][_0x296f('0x11')]);}logger[_0x296f('0x10')](_0x296f('0x12'),_0x2dd104,_0x1aab71[_0x296f('0x10')][_0x296f('0x11')]);return _0x460470(_0x1aab71[_0x296f('0x10')][_0x296f('0x11')]);}else{logger['info'](_0x296f('0x12'),_0x2dd104,_0x296f('0xe'));_0x460470(_0x1aab71[_0x296f('0x13')]['message']);}})[_0x296f('0x14')](function(_0x5141b4){logger['error'](_0x296f('0x12'),_0x2dd104,_0x5141b4);_0x577005(_0x5141b4);});});}
\ No newline at end of file
+var _0x44a3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x2163f6,_0x176963){var _0x577407=function(_0x329c0c){while(--_0x329c0c){_0x2163f6['push'](_0x2163f6['shift']());}};_0x577407(++_0x176963);}(_0x44a3,0x166));var _0x344a=function(_0xd4ae3f,_0x410d0f){_0xd4ae3f=_0xd4ae3f-0x0;var _0x52e69b=_0x44a3[_0xd4ae3f];return _0x52e69b;};'use strict';var _=require(_0x344a('0x0'));var util=require('util');var moment=require(_0x344a('0x1'));var BPromise=require(_0x344a('0x2'));var rs=require(_0x344a('0x3'));var fs=require('fs');var Redis=require(_0x344a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x344a('0x5'));var logger=require(_0x344a('0x6'))(_0x344a('0x7'));var config=require(_0x344a('0x8'));var jayson=require(_0x344a('0x9'));var client=jayson[_0x344a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x369c64,_0x14ff88,_0x51fbf9){return new BPromise(function(_0x2887ba,_0x47aa59){return client[_0x344a('0xb')](_0x369c64,_0x51fbf9)[_0x344a('0xc')](function(_0x7b7261){logger[_0x344a('0xd')](_0x344a('0xe'),_0x14ff88,_0x344a('0xf'));logger[_0x344a('0x10')](_0x344a('0x11'),_0x14ff88,_0x344a('0xf'),JSON[_0x344a('0x12')](_0x7b7261));if(_0x7b7261[_0x344a('0x13')]){if(_0x7b7261[_0x344a('0x13')][_0x344a('0x14')]===0x1f4){logger[_0x344a('0x13')](_0x344a('0xe'),_0x14ff88,_0x7b7261[_0x344a('0x13')][_0x344a('0x15')]);return _0x47aa59(_0x7b7261['error'][_0x344a('0x15')]);}logger[_0x344a('0x13')](_0x344a('0xe'),_0x14ff88,_0x7b7261['error'][_0x344a('0x15')]);return _0x2887ba(_0x7b7261[_0x344a('0x13')][_0x344a('0x15')]);}else{logger[_0x344a('0xd')](_0x344a('0xe'),_0x14ff88,_0x344a('0xf'));_0x2887ba(_0x7b7261[_0x344a('0x16')][_0x344a('0x15')]);}})[_0x344a('0x17')](function(_0x102cc8){logger[_0x344a('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x14ff88,_0x102cc8);_0x47aa59(_0x102cc8);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index dfb2712..fcdfa72 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 _0x5a45=['destroy','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','put','update','delete'];(function(_0x4bb2b9,_0x459c78){var _0x40e2a2=function(_0x19a26c){while(--_0x19a26c){_0x4bb2b9['push'](_0x4bb2b9['shift']());}};_0x40e2a2(++_0x459c78);}(_0x5a45,0x143));var _0x55a4=function(_0x5bfe8c,_0x930013){_0x5bfe8c=_0x5bfe8c-0x0;var _0x56f443=_0x5a45[_0x5bfe8c];return _0x56f443;};'use strict';var multer=require('multer');var util=require(_0x55a4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x55a4('0x1'));var router=express[_0x55a4('0x2')]();var fs_extra=require(_0x55a4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x55a4('0x4'));var config=require(_0x55a4('0x5'));var controller=require(_0x55a4('0x6'));router[_0x55a4('0x7')]('/',auth[_0x55a4('0x8')](),controller[_0x55a4('0x9')]);router['get'](_0x55a4('0xa'),auth[_0x55a4('0x8')](),controller[_0x55a4('0xb')]);router[_0x55a4('0x7')](_0x55a4('0xc'),auth[_0x55a4('0x8')](),controller[_0x55a4('0xd')]);router[_0x55a4('0x7')]('/:id/run',auth[_0x55a4('0x8')](),controller[_0x55a4('0xe')]);router[_0x55a4('0x7')](_0x55a4('0xf'),auth[_0x55a4('0x8')](),controller[_0x55a4('0x10')]);router[_0x55a4('0x11')]('/',auth[_0x55a4('0x8')](),controller[_0x55a4('0x12')]);router[_0x55a4('0x13')](_0x55a4('0xa'),auth['isAuthenticated'](),controller[_0x55a4('0x14')]);router[_0x55a4('0x15')](_0x55a4('0xa'),auth[_0x55a4('0x8')](),controller[_0x55a4('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x9258=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','/:id','isAuthenticated','show','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x2f904d,_0x3302b3){var _0x175c13=function(_0x43d876){while(--_0x43d876){_0x2f904d['push'](_0x2f904d['shift']());}};_0x175c13(++_0x3302b3);}(_0x9258,0x1a0));var _0x8925=function(_0x62d6fe,_0x5a27b2){_0x62d6fe=_0x62d6fe-0x0;var _0x1b00b8=_0x9258[_0x62d6fe];return _0x1b00b8;};'use strict';var multer=require(_0x8925('0x0'));var util=require(_0x8925('0x1'));var path=require(_0x8925('0x2'));var timeout=require(_0x8925('0x3'));var express=require(_0x8925('0x4'));var router=express['Router']();var fs_extra=require(_0x8925('0x5'));var auth=require(_0x8925('0x6'));var interaction=require(_0x8925('0x7'));var config=require(_0x8925('0x8'));var controller=require(_0x8925('0x9'));router[_0x8925('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8925('0xa')](_0x8925('0xb'),auth[_0x8925('0xc')](),controller[_0x8925('0xd')]);router['get']('/:id/preview',auth[_0x8925('0xc')](),controller[_0x8925('0xe')]);router[_0x8925('0xa')](_0x8925('0xf'),auth[_0x8925('0xc')](),controller[_0x8925('0x10')]);router[_0x8925('0xa')](_0x8925('0x11'),auth[_0x8925('0xc')](),controller[_0x8925('0x12')]);router[_0x8925('0x13')]('/',auth[_0x8925('0xc')](),controller[_0x8925('0x14')]);router[_0x8925('0x15')](_0x8925('0xb'),auth['isAuthenticated'](),controller[_0x8925('0x16')]);router[_0x8925('0x17')]('/:id',auth[_0x8925('0xc')](),controller[_0x8925('0x18')]);module[_0x8925('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index dcab5ac..8a14aa2 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 _0xedb8=['xlsx','csv','DATE','Loading','manual','scheduled','UNSIGNED','sequelize','moment','exports','STRING','ENUM','pdf'];(function(_0x1c7889,_0x24cd26){var _0x2f14e5=function(_0x9ae1b1){while(--_0x9ae1b1){_0x1c7889['push'](_0x1c7889['shift']());}};_0x2f14e5(++_0x24cd26);}(_0xedb8,0x1db));var _0x8edb=function(_0x1726e1,_0x1cc1f4){_0x1726e1=_0x1726e1-0x0;var _0x44eccc=_0xedb8[_0x1726e1];return _0x44eccc;};'use strict';var Sequelize=require(_0x8edb('0x0'));var moment=require(_0x8edb('0x1'));module[_0x8edb('0x2')]={'name':{'type':Sequelize[_0x8edb('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8edb('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8edb('0x4')]('csv',_0x8edb('0x5'),_0x8edb('0x6')),'allowNull':![],'defaultValue':_0x8edb('0x7')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x8edb('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8edb('0x3')],'defaultValue':_0x8edb('0x9')},'type':{'type':Sequelize[_0x8edb('0x4')](_0x8edb('0xa'),_0x8edb('0xb')),'allowNull':![],'defaultValue':_0x8edb('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8edb('0xc')]},'reportType':{'type':Sequelize[_0x8edb('0x3')]}};
\ No newline at end of file
+var _0x5ce5=['exports','STRING','csv','pdf','xlsx','DATE','ENUM','manual','scheduled','UNSIGNED','moment'];(function(_0x1f37af,_0x238de4){var _0x243cad=function(_0x4e971f){while(--_0x4e971f){_0x1f37af['push'](_0x1f37af['shift']());}};_0x243cad(++_0x238de4);}(_0x5ce5,0x1cd));var _0x55ce=function(_0x564945,_0x5d97f7){_0x564945=_0x564945-0x0;var _0x224f00=_0x5ce5[_0x564945];return _0x224f00;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x55ce('0x0'));module[_0x55ce('0x1')]={'name':{'type':Sequelize[_0x55ce('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x55ce('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x55ce('0x3'),_0x55ce('0x4'),_0x55ce('0x5')),'allowNull':![],'defaultValue':_0x55ce('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x55ce('0x6')]},'endDate':{'type':Sequelize[_0x55ce('0x6')]},'status':{'type':Sequelize[_0x55ce('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x55ce('0x7')](_0x55ce('0x8'),_0x55ce('0x9')),'allowNull':![],'defaultValue':_0x55ce('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x55ce('0xa')]},'reportType':{'type':Sequelize[_0x55ce('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 7cd8fcc..f480949 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 _0xde88=['Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','%s.%s','basename','output','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','ExtractedReports','destroy','sendStatus','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','download','join','root','server/files/reports'];(function(_0xd341b,_0x3100ba){var _0x86bd5a=function(_0x325140){while(--_0x325140){_0xd341b['push'](_0xd341b['shift']());}};_0x86bd5a(++_0x3100ba);}(_0xde88,0x1e3));var _0x8de8=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0xde88[_0x54bac5];return _0xc15971;};'use strict';var emlformat=require(_0x8de8('0x0'));var rimraf=require(_0x8de8('0x1'));var zipdir=require(_0x8de8('0x2'));var jsonpatch=require(_0x8de8('0x3'));var rp=require(_0x8de8('0x4'));var moment=require(_0x8de8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8de8('0x6'));var util=require(_0x8de8('0x7'));var path=require(_0x8de8('0x8'));var sox=require(_0x8de8('0x9'));var csv=require(_0x8de8('0xa'));var ejs=require(_0x8de8('0xb'));var fs=require('fs');var fs_extra=require(_0x8de8('0xc'));var _=require(_0x8de8('0xd'));var squel=require(_0x8de8('0xe'));var crypto=require(_0x8de8('0xf'));var jsforce=require(_0x8de8('0x10'));var deskjs=require(_0x8de8('0x11'));var toCsv=require('to-csv');var querystring=require(_0x8de8('0x12'));var Papa=require('papaparse');var Redis=require(_0x8de8('0x13'));var authService=require(_0x8de8('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x8de8('0x15'));var hardwareService=require(_0x8de8('0x16'));var logger=require(_0x8de8('0x17'))(_0x8de8('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8de8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ad726,_0x205d6a){_0x205d6a=_0x205d6a||0xcc;return function(_0x1ecdf6){if(_0x1ecdf6){return _0x4ad726['sendStatus'](_0x205d6a);}return _0x4ad726[_0x8de8('0x1a')](_0x205d6a)[_0x8de8('0x1b')]();};}function respondWithResult(_0x1f52c1,_0x4b6ea2){_0x4b6ea2=_0x4b6ea2||0xc8;return function(_0x44227d){if(_0x44227d){return _0x1f52c1['status'](_0x4b6ea2)['json'](_0x44227d);}};}function respondWithFilteredResult(_0x915d5c,_0x40eddf){return function(_0x31d608){if(_0x31d608){var _0x419b0b=typeof _0x40eddf['offset']===_0x8de8('0x1c')&&typeof _0x40eddf[_0x8de8('0x1d')]===_0x8de8('0x1c');var _0x51dc72=_0x31d608[_0x8de8('0x1e')];var _0xd6f94a=_0x419b0b?0x0:_0x40eddf[_0x8de8('0x1f')];var _0xb986ab=_0x419b0b?_0x31d608[_0x8de8('0x1e')]:_0x40eddf['offset']+_0x40eddf[_0x8de8('0x1d')];var _0x1c0d94;if(_0xb986ab>=_0x51dc72){_0xb986ab=_0x51dc72;_0x1c0d94=0xc8;}else{_0x1c0d94=0xce;}_0x915d5c[_0x8de8('0x1a')](_0x1c0d94);return _0x915d5c[_0x8de8('0x20')]('Content-Range',_0xd6f94a+'-'+_0xb986ab+'/'+_0x51dc72)[_0x8de8('0x21')](_0x31d608);}return null;};}function patchUpdates(_0x2c3bc4){return function(_0x147792){try{jsonpatch[_0x8de8('0x22')](_0x147792,_0x2c3bc4,!![]);}catch(_0x4f1926){return BPromise['reject'](_0x4f1926);}return _0x147792[_0x8de8('0x23')]();};}function saveUpdates(_0x42fcce,_0x1eb477){return function(_0x2d150e){if(_0x2d150e){return _0x2d150e[_0x8de8('0x24')](_0x42fcce)[_0x8de8('0x25')](function(_0x3be0e7){return _0x3be0e7;});}return null;};}function removeEntity(_0x2adc40,_0x477988){return function(_0xb075e8){if(_0xb075e8){return _0xb075e8['destroy']()[_0x8de8('0x25')](function(){var _0x217cf8=_0xb075e8[_0x8de8('0x26')]({'plain':!![]});var _0x1b2dec=_0x8de8('0x27');return db['UserProfileResource'][_0x8de8('0x28')]({'where':{'type':_0x1b2dec,'resourceId':_0x217cf8['id']}})[_0x8de8('0x25')](function(){return _0xb075e8;});})['then'](function(){_0x2adc40[_0x8de8('0x1a')](0xcc)[_0x8de8('0x1b')]();});}};}function handleEntityNotFound(_0x29d8aa,_0x2a7eaf){return function(_0x747e22){if(!_0x747e22){_0x29d8aa[_0x8de8('0x29')](0x194);}return _0x747e22;};}function handleError(_0x4320d8,_0x5b778b){_0x5b778b=_0x5b778b||0x1f4;return function(_0xf5af7b){logger[_0x8de8('0x2a')](_0xf5af7b['stack']);if(_0xf5af7b[_0x8de8('0x2b')]){delete _0xf5af7b['name'];}_0x4320d8['status'](_0x5b778b)[_0x8de8('0x2c')](_0xf5af7b);};}exports[_0x8de8('0x2d')]=function(_0x25da65,_0x17905c){var _0x53cc26={},_0x31153d={},_0x5bbd90={'count':0x0,'rows':[]};var _0x4b08af=_[_0x8de8('0x2e')](db[_0x8de8('0x2f')][_0x8de8('0x30')],function(_0x40dd2c){return{'name':_0x40dd2c[_0x8de8('0x31')],'type':_0x40dd2c['type'][_0x8de8('0x32')]};});_0x31153d['model']=_['map'](_0x4b08af,_0x8de8('0x2b'));_0x31153d['query']=_['keys'](_0x25da65[_0x8de8('0x33')]);_0x31153d[_0x8de8('0x34')]=_[_0x8de8('0x35')](_0x31153d[_0x8de8('0x36')],_0x31153d[_0x8de8('0x33')]);_0x53cc26['attributes']=_['intersection'](_0x31153d['model'],qs[_0x8de8('0x37')](_0x25da65[_0x8de8('0x33')][_0x8de8('0x37')]));_0x53cc26[_0x8de8('0x38')]=_0x53cc26['attributes'][_0x8de8('0x39')]?_0x53cc26[_0x8de8('0x38')]:_0x31153d[_0x8de8('0x36')];if(!_0x25da65[_0x8de8('0x33')]['hasOwnProperty'](_0x8de8('0x3a'))){_0x53cc26[_0x8de8('0x1d')]=qs['limit'](_0x25da65[_0x8de8('0x33')][_0x8de8('0x1d')]);_0x53cc26[_0x8de8('0x1f')]=qs['offset'](_0x25da65[_0x8de8('0x33')][_0x8de8('0x1f')]);}_0x53cc26['order']=qs[_0x8de8('0x3b')](_0x25da65['query'][_0x8de8('0x3b')]);_0x53cc26[_0x8de8('0x3c')]=qs[_0x8de8('0x34')](_[_0x8de8('0x3d')](_0x25da65['query'],_0x31153d[_0x8de8('0x34')]),_0x4b08af);if(_0x25da65['query'][_0x8de8('0x3e')]){_0x53cc26[_0x8de8('0x3c')]=_['merge'](_0x53cc26['where'],{'$or':_[_0x8de8('0x2e')](_0x4b08af,function(_0xcfd118){if(_0xcfd118['type']!==_0x8de8('0x3f')){var _0x476664={};_0x476664[_0xcfd118[_0x8de8('0x2b')]]={'$like':'%'+_0x25da65['query'][_0x8de8('0x3e')]+'%'};return _0x476664;}})});}_0x53cc26=_[_0x8de8('0x40')]({},_0x53cc26,_0x25da65[_0x8de8('0x41')]);var _0x41e296={'where':_0x53cc26['where']};return db[_0x8de8('0x2f')][_0x8de8('0x1e')](_0x41e296)[_0x8de8('0x25')](function(_0x22b7c4){_0x5bbd90[_0x8de8('0x1e')]=_0x22b7c4;if(_0x25da65[_0x8de8('0x33')][_0x8de8('0x42')]){_0x53cc26[_0x8de8('0x43')]=[{'all':!![]}];}return db[_0x8de8('0x2f')][_0x8de8('0x44')](_0x53cc26);})[_0x8de8('0x25')](function(_0x16ac71){_0x5bbd90[_0x8de8('0x45')]=_0x16ac71;return _0x5bbd90;})[_0x8de8('0x25')](respondWithFilteredResult(_0x17905c,_0x53cc26))['catch'](handleError(_0x17905c,null));};exports[_0x8de8('0x46')]=function(_0x1e6c80,_0x4106b6){var _0x3a9de0={'raw':!![],'where':{'id':_0x1e6c80[_0x8de8('0x47')]['id']}},_0x2c3465={};_0x2c3465['model']=_['keys'](db['AnalyticExtractedReport']['rawAttributes']);_0x2c3465[_0x8de8('0x33')]=_[_0x8de8('0x48')](_0x1e6c80[_0x8de8('0x33')]);_0x2c3465['filters']=_[_0x8de8('0x35')](_0x2c3465['model'],_0x2c3465['query']);_0x3a9de0[_0x8de8('0x38')]=_[_0x8de8('0x35')](_0x2c3465[_0x8de8('0x36')],qs[_0x8de8('0x37')](_0x1e6c80[_0x8de8('0x33')][_0x8de8('0x37')]));_0x3a9de0[_0x8de8('0x38')]=_0x3a9de0[_0x8de8('0x38')][_0x8de8('0x39')]?_0x3a9de0['attributes']:_0x2c3465['model'];if(_0x1e6c80[_0x8de8('0x33')][_0x8de8('0x42')]){_0x3a9de0[_0x8de8('0x43')]=[{'all':!![]}];}_0x3a9de0=_['merge']({},_0x3a9de0,_0x1e6c80[_0x8de8('0x41')]);return db['AnalyticExtractedReport'][_0x8de8('0x49')](_0x3a9de0)[_0x8de8('0x25')](handleEntityNotFound(_0x4106b6,null))[_0x8de8('0x25')](respondWithResult(_0x4106b6,null))[_0x8de8('0x4a')](handleError(_0x4106b6,null));};exports['create']=function(_0x4fec72,_0x2d7eea){return db['AnalyticExtractedReport'][_0x8de8('0x4b')](_0x4fec72['body'],{})[_0x8de8('0x25')](function(_0xa2c45f){var _0x5b6650=_0x4fec72[_0x8de8('0x4c')][_0x8de8('0x26')]({'plain':!![]});if(!_0x5b6650)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b6650[_0x8de8('0x4d')]===_0x8de8('0x4c')){var _0x4da1bc=_0xa2c45f[_0x8de8('0x26')]({'plain':!![]});var _0x269e09=_0x8de8('0x27');return db[_0x8de8('0x4e')][_0x8de8('0x49')]({'where':{'name':_0x269e09,'userProfileId':_0x5b6650[_0x8de8('0x4f')]},'raw':!![]})[_0x8de8('0x25')](function(_0x2f515f){if(_0x2f515f&&_0x2f515f[_0x8de8('0x50')]===0x0){return db[_0x8de8('0x51')]['create']({'name':_0x4da1bc[_0x8de8('0x2b')],'resourceId':_0x4da1bc['id'],'type':_0x2f515f[_0x8de8('0x2b')],'sectionId':_0x2f515f['id']},{})[_0x8de8('0x25')](function(){return _0xa2c45f;});}else{return _0xa2c45f;}})[_0x8de8('0x4a')](function(_0x400f50){logger[_0x8de8('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x400f50);throw _0x400f50;});}return _0xa2c45f;})[_0x8de8('0x25')](respondWithResult(_0x2d7eea,0xc9))[_0x8de8('0x4a')](handleError(_0x2d7eea,null));};exports['update']=function(_0x572c57,_0x40184e){if(_0x572c57[_0x8de8('0x52')]['id']){delete _0x572c57['body']['id'];}return db[_0x8de8('0x2f')][_0x8de8('0x49')]({'where':{'id':_0x572c57[_0x8de8('0x47')]['id']}})['then'](handleEntityNotFound(_0x40184e,null))[_0x8de8('0x25')](saveUpdates(_0x572c57[_0x8de8('0x52')],null))[_0x8de8('0x25')](respondWithResult(_0x40184e,null))[_0x8de8('0x4a')](handleError(_0x40184e,null));};exports[_0x8de8('0x28')]=function(_0x95d6b5,_0x5011b3){return db[_0x8de8('0x2f')][_0x8de8('0x49')]({'where':{'id':_0x95d6b5[_0x8de8('0x47')]['id']}})[_0x8de8('0x25')](handleEntityNotFound(_0x5011b3,null))[_0x8de8('0x25')](removeEntity(_0x5011b3,null))[_0x8de8('0x4a')](handleError(_0x5011b3,null));};exports[_0x8de8('0x53')]=function(_0xe9de92,_0xd2908d,_0x17c900){return db[_0x8de8('0x2f')][_0x8de8('0x49')]({'where':{'id':_0xe9de92[_0x8de8('0x47')]['id']},'attributes':[_0x8de8('0x2b'),'basename','savename','output'],'raw':!![]})['then'](handleEntityNotFound(_0xd2908d,null))[_0x8de8('0x25')](function(_0x5a60a8){if(_0x5a60a8){if(!fs['existsSync'](path[_0x8de8('0x54')](config[_0x8de8('0x55')],_0x8de8('0x56'),_0x5a60a8['savename']))){throw new db[(_0x8de8('0x57'))][(_0x8de8('0x58'))](_0x8de8('0x59'));}if(_0xe9de92[_0x8de8('0x33')][_0x8de8('0x5a')]){return _0xd2908d['sendStatus'](0xc8);}return _0xd2908d['download'](path[_0x8de8('0x54')](config[_0x8de8('0x55')],'server/files/reports',_0x5a60a8[_0x8de8('0x5b')]),util['format'](_0x8de8('0x5c'),_0x5a60a8[_0x8de8('0x5d')]||_0x5a60a8['name'],_0x5a60a8[_0x8de8('0x5e')]['toLowerCase']()));}})[_0x8de8('0x4a')](handleError(_0xd2908d,null));};
\ No newline at end of file
+var _0x3124=['order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','AnalyticExtractedReport','includeAll','findAll','rows','params','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','format','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','index','map','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0xe8c799,_0x2a176f){var _0x2695b3=function(_0x37c371){while(--_0x37c371){_0xe8c799['push'](_0xe8c799['shift']());}};_0x2695b3(++_0x2a176f);}(_0x3124,0x13e));var _0x4312=function(_0x15ea49,_0x4eff65){_0x15ea49=_0x15ea49-0x0;var _0x58e4d0=_0x3124[_0x15ea49];return _0x58e4d0;};'use strict';var emlformat=require(_0x4312('0x0'));var rimraf=require(_0x4312('0x1'));var zipdir=require(_0x4312('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4312('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4312('0x4'));var util=require(_0x4312('0x5'));var path=require(_0x4312('0x6'));var sox=require(_0x4312('0x7'));var csv=require(_0x4312('0x8'));var ejs=require(_0x4312('0x9'));var fs=require('fs');var fs_extra=require(_0x4312('0xa'));var _=require(_0x4312('0xb'));var squel=require(_0x4312('0xc'));var crypto=require(_0x4312('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4312('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4312('0xf'));var Papa=require(_0x4312('0x10'));var Redis=require(_0x4312('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4312('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4312('0x13'))(_0x4312('0x14'));var utils=require(_0x4312('0x15'));var config=require(_0x4312('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b12c8,_0x5b96f2){_0x5b96f2=_0x5b96f2||0xcc;return function(_0x3700aa){if(_0x3700aa){return _0x3b12c8[_0x4312('0x17')](_0x5b96f2);}return _0x3b12c8[_0x4312('0x18')](_0x5b96f2)[_0x4312('0x19')]();};}function respondWithResult(_0x2829e7,_0x1b7b91){_0x1b7b91=_0x1b7b91||0xc8;return function(_0x48cc6d){if(_0x48cc6d){return _0x2829e7[_0x4312('0x18')](_0x1b7b91)['json'](_0x48cc6d);}};}function respondWithFilteredResult(_0x37d402,_0x517e1f){return function(_0x44b74c){if(_0x44b74c){var _0x45a0ff=typeof _0x517e1f[_0x4312('0x1a')]===_0x4312('0x1b')&&typeof _0x517e1f['limit']===_0x4312('0x1b');var _0x4574d6=_0x44b74c['count'];var _0x137ba7=_0x45a0ff?0x0:_0x517e1f[_0x4312('0x1a')];var _0x17bd83=_0x45a0ff?_0x44b74c[_0x4312('0x1c')]:_0x517e1f[_0x4312('0x1a')]+_0x517e1f[_0x4312('0x1d')];var _0xb87959;if(_0x17bd83>=_0x4574d6){_0x17bd83=_0x4574d6;_0xb87959=0xc8;}else{_0xb87959=0xce;}_0x37d402[_0x4312('0x18')](_0xb87959);return _0x37d402[_0x4312('0x1e')](_0x4312('0x1f'),_0x137ba7+'-'+_0x17bd83+'/'+_0x4574d6)['json'](_0x44b74c);}return null;};}function patchUpdates(_0x2a1549){return function(_0x3c96bc){try{jsonpatch[_0x4312('0x20')](_0x3c96bc,_0x2a1549,!![]);}catch(_0x13fd11){return BPromise['reject'](_0x13fd11);}return _0x3c96bc[_0x4312('0x21')]();};}function saveUpdates(_0x403422,_0x5e6df4){return function(_0x46b4fb){if(_0x46b4fb){return _0x46b4fb['update'](_0x403422)[_0x4312('0x22')](function(_0x2d3b55){return _0x2d3b55;});}return null;};}function removeEntity(_0x30d22b,_0x23eb4a){return function(_0x407c74){if(_0x407c74){return _0x407c74['destroy']()['then'](function(){var _0x58b63b=_0x407c74[_0x4312('0x23')]({'plain':!![]});var _0xca89b=_0x4312('0x24');return db[_0x4312('0x25')][_0x4312('0x26')]({'where':{'type':_0xca89b,'resourceId':_0x58b63b['id']}})[_0x4312('0x22')](function(){return _0x407c74;});})['then'](function(){_0x30d22b[_0x4312('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b4db7,_0x374b18){return function(_0x7fe247){if(!_0x7fe247){_0x2b4db7[_0x4312('0x17')](0x194);}return _0x7fe247;};}function handleError(_0xa17345,_0x437478){_0x437478=_0x437478||0x1f4;return function(_0x349dbc){logger[_0x4312('0x27')](_0x349dbc[_0x4312('0x28')]);if(_0x349dbc[_0x4312('0x29')]){delete _0x349dbc[_0x4312('0x29')];}_0xa17345['status'](_0x437478)['send'](_0x349dbc);};}exports[_0x4312('0x2a')]=function(_0xaf42e9,_0x2c29d4){var _0x28775a={},_0x4c6116={},_0x1cb6cb={'count':0x0,'rows':[]};var _0x4a4c67=_[_0x4312('0x2b')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x28965a){return{'name':_0x28965a[_0x4312('0x2c')],'type':_0x28965a['type']['key']};});_0x4c6116[_0x4312('0x2d')]=_[_0x4312('0x2b')](_0x4a4c67,'name');_0x4c6116[_0x4312('0x2e')]=_[_0x4312('0x2f')](_0xaf42e9[_0x4312('0x2e')]);_0x4c6116['filters']=_[_0x4312('0x30')](_0x4c6116[_0x4312('0x2d')],_0x4c6116[_0x4312('0x2e')]);_0x28775a[_0x4312('0x31')]=_['intersection'](_0x4c6116[_0x4312('0x2d')],qs[_0x4312('0x32')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x32')]));_0x28775a[_0x4312('0x31')]=_0x28775a[_0x4312('0x31')][_0x4312('0x33')]?_0x28775a[_0x4312('0x31')]:_0x4c6116['model'];if(!_0xaf42e9[_0x4312('0x2e')][_0x4312('0x34')](_0x4312('0x35'))){_0x28775a[_0x4312('0x1d')]=qs[_0x4312('0x1d')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x1d')]);_0x28775a[_0x4312('0x1a')]=qs['offset'](_0xaf42e9[_0x4312('0x2e')]['offset']);}_0x28775a[_0x4312('0x36')]=qs[_0x4312('0x37')](_0xaf42e9[_0x4312('0x2e')][_0x4312('0x37')]);_0x28775a['where']=qs[_0x4312('0x38')](_[_0x4312('0x39')](_0xaf42e9['query'],_0x4c6116[_0x4312('0x38')]),_0x4a4c67);if(_0xaf42e9[_0x4312('0x2e')][_0x4312('0x3a')]){_0x28775a[_0x4312('0x3b')]=_['merge'](_0x28775a['where'],{'$or':_[_0x4312('0x2b')](_0x4a4c67,function(_0x484217){if(_0x484217[_0x4312('0x3c')]!==_0x4312('0x3d')){var _0x1ec80e={};_0x1ec80e[_0x484217[_0x4312('0x29')]]={'$like':'%'+_0xaf42e9[_0x4312('0x2e')][_0x4312('0x3a')]+'%'};return _0x1ec80e;}})});}_0x28775a=_[_0x4312('0x3e')]({},_0x28775a,_0xaf42e9[_0x4312('0x3f')]);var _0x23716c={'where':_0x28775a[_0x4312('0x3b')]};return db[_0x4312('0x40')][_0x4312('0x1c')](_0x23716c)['then'](function(_0x4e1c32){_0x1cb6cb[_0x4312('0x1c')]=_0x4e1c32;if(_0xaf42e9[_0x4312('0x2e')][_0x4312('0x41')]){_0x28775a['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x4312('0x42')](_0x28775a);})[_0x4312('0x22')](function(_0x1e73d8){_0x1cb6cb[_0x4312('0x43')]=_0x1e73d8;return _0x1cb6cb;})['then'](respondWithFilteredResult(_0x2c29d4,_0x28775a))['catch'](handleError(_0x2c29d4,null));};exports['show']=function(_0x455a9c,_0x2cc29e){var _0x111c36={'raw':!![],'where':{'id':_0x455a9c[_0x4312('0x44')]['id']}},_0x3733e7={};_0x3733e7[_0x4312('0x2d')]=_[_0x4312('0x2f')](db[_0x4312('0x40')]['rawAttributes']);_0x3733e7[_0x4312('0x2e')]=_[_0x4312('0x2f')](_0x455a9c[_0x4312('0x2e')]);_0x3733e7[_0x4312('0x38')]=_['intersection'](_0x3733e7['model'],_0x3733e7['query']);_0x111c36[_0x4312('0x31')]=_[_0x4312('0x30')](_0x3733e7[_0x4312('0x2d')],qs[_0x4312('0x32')](_0x455a9c[_0x4312('0x2e')][_0x4312('0x32')]));_0x111c36[_0x4312('0x31')]=_0x111c36[_0x4312('0x31')]['length']?_0x111c36[_0x4312('0x31')]:_0x3733e7[_0x4312('0x2d')];if(_0x455a9c[_0x4312('0x2e')][_0x4312('0x41')]){_0x111c36[_0x4312('0x45')]=[{'all':!![]}];}_0x111c36=_['merge']({},_0x111c36,_0x455a9c[_0x4312('0x3f')]);return db['AnalyticExtractedReport']['find'](_0x111c36)['then'](handleEntityNotFound(_0x2cc29e,null))[_0x4312('0x22')](respondWithResult(_0x2cc29e,null))[_0x4312('0x46')](handleError(_0x2cc29e,null));};exports['create']=function(_0x9196f0,_0x322d59){return db['AnalyticExtractedReport'][_0x4312('0x47')](_0x9196f0['body'],{})[_0x4312('0x22')](function(_0x3aa16d){var _0x3fec3a=_0x9196f0['user'][_0x4312('0x23')]({'plain':!![]});if(!_0x3fec3a)throw new Error(_0x4312('0x48'));if(_0x3fec3a[_0x4312('0x49')]===_0x4312('0x4a')){var _0x2acbfe=_0x3aa16d[_0x4312('0x23')]({'plain':!![]});var _0x296762='ExtractedReports';return db[_0x4312('0x4b')]['find']({'where':{'name':_0x296762,'userProfileId':_0x3fec3a[_0x4312('0x4c')]},'raw':!![]})['then'](function(_0x5282f7){if(_0x5282f7&&_0x5282f7[_0x4312('0x4d')]===0x0){return db[_0x4312('0x25')][_0x4312('0x47')]({'name':_0x2acbfe[_0x4312('0x29')],'resourceId':_0x2acbfe['id'],'type':_0x5282f7[_0x4312('0x29')],'sectionId':_0x5282f7['id']},{})[_0x4312('0x22')](function(){return _0x3aa16d;});}else{return _0x3aa16d;}})[_0x4312('0x46')](function(_0x266245){logger['error'](_0x4312('0x4e'),_0x266245);throw _0x266245;});}return _0x3aa16d;})[_0x4312('0x22')](respondWithResult(_0x322d59,0xc9))['catch'](handleError(_0x322d59,null));};exports[_0x4312('0x4f')]=function(_0x4f991d,_0x4dc8f4){if(_0x4f991d[_0x4312('0x50')]['id']){delete _0x4f991d[_0x4312('0x50')]['id'];}return db[_0x4312('0x40')][_0x4312('0x51')]({'where':{'id':_0x4f991d[_0x4312('0x44')]['id']}})[_0x4312('0x22')](handleEntityNotFound(_0x4dc8f4,null))['then'](saveUpdates(_0x4f991d[_0x4312('0x50')],null))['then'](respondWithResult(_0x4dc8f4,null))[_0x4312('0x46')](handleError(_0x4dc8f4,null));};exports[_0x4312('0x26')]=function(_0x5e3622,_0x68d1ee){return db[_0x4312('0x40')][_0x4312('0x51')]({'where':{'id':_0x5e3622[_0x4312('0x44')]['id']}})['then'](handleEntityNotFound(_0x68d1ee,null))[_0x4312('0x22')](removeEntity(_0x68d1ee,null))[_0x4312('0x46')](handleError(_0x68d1ee,null));};exports[_0x4312('0x52')]=function(_0x12f9e5,_0x485bc9,_0x1e353c){return db[_0x4312('0x40')]['find']({'where':{'id':_0x12f9e5[_0x4312('0x44')]['id']},'attributes':['name',_0x4312('0x53'),_0x4312('0x54'),_0x4312('0x55')],'raw':!![]})[_0x4312('0x22')](handleEntityNotFound(_0x485bc9,null))[_0x4312('0x22')](function(_0x583699){if(_0x583699){if(!fs[_0x4312('0x56')](path[_0x4312('0x57')](config[_0x4312('0x58')],_0x4312('0x59'),_0x583699[_0x4312('0x54')]))){throw new db['Sequelize'][(_0x4312('0x5a'))](_0x4312('0x5b'));}if(_0x12f9e5['query']['exists']){return _0x485bc9[_0x4312('0x17')](0xc8);}return _0x485bc9[_0x4312('0x52')](path[_0x4312('0x57')](config[_0x4312('0x58')],'server/files/reports',_0x583699['savename']),util[_0x4312('0x5c')]('%s.%s',_0x583699['basename']||_0x583699['name'],_0x583699[_0x4312('0x55')]['toLowerCase']()));}})[_0x4312('0x46')](handleError(_0x485bc9,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index cb09877..a2cf7c4 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 _0xa01b=['../../config/logger','api','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x5a30fb,_0x206270){var _0x3b86aa=function(_0x67ea17){while(--_0x67ea17){_0x5a30fb['push'](_0x5a30fb['shift']());}};_0x3b86aa(++_0x206270);}(_0xa01b,0x1ca));var _0xba01=function(_0x3d5f84,_0x6201a5){_0x3d5f84=_0x3d5f84-0x0;var _0x56b6c1=_0xa01b[_0x3d5f84];return _0x56b6c1;};'use strict';var _=require(_0xba01('0x0'));var util=require(_0xba01('0x1'));var logger=require(_0xba01('0x2'))(_0xba01('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xba01('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba01('0x5'));module[_0xba01('0x6')]=function(_0x2d4cdc,_0x457b62){return _0x2d4cdc[_0xba01('0x7')](_0xba01('0x8'),attributes,{'tableName':_0xba01('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd1f=['analytics_extracted_reports','lodash','util','api','moment','bluebird','path','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport'];(function(_0x1fee29,_0x1aa1b5){var _0x2d2c2b=function(_0x1db2d2){while(--_0x1db2d2){_0x1fee29['push'](_0x1fee29['shift']());}};_0x2d2c2b(++_0x1aa1b5);}(_0xbd1f,0xb5));var _0xfbd1=function(_0x29d6f1,_0x4465c0){_0x29d6f1=_0x29d6f1-0x0;var _0x3cd8b8=_0xbd1f[_0x29d6f1];return _0x3cd8b8;};'use strict';var _=require(_0xfbd1('0x0'));var util=require(_0xfbd1('0x1'));var logger=require('../../config/logger')(_0xfbd1('0x2'));var moment=require(_0xfbd1('0x3'));var BPromise=require(_0xfbd1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfbd1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfbd1('0x6'));module[_0xfbd1('0x7')]=function(_0x378055,_0x3ee268){return _0x378055['define'](_0xfbd1('0x8'),attributes,{'tableName':_0xfbd1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 3070c7c..42f537b 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 _0x54bb=['info','request\x20sent','debug','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x54bb,0xb2));var _0xb54b=function(_0x20c290,_0x47e736){_0x20c290=_0x20c290-0x0;var _0x3d7b3b=_0x54bb[_0x20c290];return _0x3d7b3b;};'use strict';var _=require(_0xb54b('0x0'));var util=require(_0xb54b('0x1'));var moment=require(_0xb54b('0x2'));var BPromise=require(_0xb54b('0x3'));var rs=require(_0xb54b('0x4'));var fs=require('fs');var Redis=require(_0xb54b('0x5'));var db=require(_0xb54b('0x6'))['db'];var utils=require(_0xb54b('0x7'));var logger=require(_0xb54b('0x8'))('rpc');var config=require(_0xb54b('0x9'));var jayson=require(_0xb54b('0xa'));var client=jayson[_0xb54b('0xb')][_0xb54b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e06a2,_0x523e87,_0x13e3b0){return new BPromise(function(_0x4dc3e9,_0x56de1f){return client['request'](_0x2e06a2,_0x13e3b0)[_0xb54b('0xd')](function(_0x3a075d){logger[_0xb54b('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x523e87,_0xb54b('0xf'));logger[_0xb54b('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x523e87,_0xb54b('0xf'),JSON[_0xb54b('0x11')](_0x3a075d));if(_0x3a075d['error']){if(_0x3a075d[_0xb54b('0x12')][_0xb54b('0x13')]===0x1f4){logger[_0xb54b('0x12')](_0xb54b('0x14'),_0x523e87,_0x3a075d[_0xb54b('0x12')]['message']);return _0x56de1f(_0x3a075d[_0xb54b('0x12')][_0xb54b('0x15')]);}logger[_0xb54b('0x12')](_0xb54b('0x14'),_0x523e87,_0x3a075d[_0xb54b('0x12')][_0xb54b('0x15')]);return _0x4dc3e9(_0x3a075d[_0xb54b('0x12')][_0xb54b('0x15')]);}else{logger[_0xb54b('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x523e87,'request\x20sent');_0x4dc3e9(_0x3a075d[_0xb54b('0x16')][_0xb54b('0x15')]);}})[_0xb54b('0x17')](function(_0x59e75f){logger[_0xb54b('0x12')](_0xb54b('0x14'),_0x523e87,_0x59e75f);_0x56de1f(_0x59e75f);});});}
\ No newline at end of file
+var _0xb2af=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb2af,0xd2));var _0xfb2a=function(_0x430b76,_0x4f73b7){_0x430b76=_0x430b76-0x0;var _0x4dad15=_0xb2af[_0x430b76];return _0x4dad15;};'use strict';var _=require(_0xfb2a('0x0'));var util=require(_0xfb2a('0x1'));var moment=require(_0xfb2a('0x2'));var BPromise=require(_0xfb2a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb2a('0x4'));var db=require(_0xfb2a('0x5'))['db'];var utils=require(_0xfb2a('0x6'));var logger=require(_0xfb2a('0x7'))(_0xfb2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xfb2a('0x9'));var client=jayson[_0xfb2a('0xa')][_0xfb2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55cf25,_0x715404,_0x3e20de){return new BPromise(function(_0x1f3315,_0x55bb4e){return client[_0xfb2a('0xc')](_0x55cf25,_0x3e20de)[_0xfb2a('0xd')](function(_0x3d3333){logger[_0xfb2a('0xe')](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));logger[_0xfb2a('0x11')](_0xfb2a('0x12'),_0x715404,_0xfb2a('0x10'),JSON[_0xfb2a('0x13')](_0x3d3333));if(_0x3d3333[_0xfb2a('0x14')]){if(_0x3d3333[_0xfb2a('0x14')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x715404,_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);return _0x55bb4e(_0x3d3333[_0xfb2a('0x14')][_0xfb2a('0x15')]);}logger['error'](_0xfb2a('0xf'),_0x715404,_0x3d3333['error']['message']);return _0x1f3315(_0x3d3333[_0xfb2a('0x14')]['message']);}else{logger['info'](_0xfb2a('0xf'),_0x715404,_0xfb2a('0x10'));_0x1f3315(_0x3d3333[_0xfb2a('0x16')][_0xfb2a('0x15')]);}})[_0xfb2a('0x17')](function(_0xc85abf){logger[_0xfb2a('0x14')](_0xfb2a('0xf'),_0x715404,_0xc85abf);_0x55bb4e(_0xc85abf);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 1ae6754..e1014dd 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 _0xcdf7=['fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','/:id/download','download','post','create','put','update','delete','multer','util','connect-timeout','express','Router'];(function(_0x3b037b,_0x1be37a){var _0x4ece31=function(_0x229ef3){while(--_0x229ef3){_0x3b037b['push'](_0x3b037b['shift']());}};_0x4ece31(++_0x1be37a);}(_0xcdf7,0xf2));var _0x7cdf=function(_0x18ed30,_0x530c12){_0x18ed30=_0x18ed30-0x0;var _0x42bdd5=_0xcdf7[_0x18ed30];return _0x42bdd5;};'use strict';var multer=require(_0x7cdf('0x0'));var util=require(_0x7cdf('0x1'));var path=require('path');var timeout=require(_0x7cdf('0x2'));var express=require(_0x7cdf('0x3'));var router=express[_0x7cdf('0x4')]();var fs_extra=require(_0x7cdf('0x5'));var auth=require(_0x7cdf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7cdf('0x7'));var controller=require(_0x7cdf('0x8'));router[_0x7cdf('0x9')]('/',auth[_0x7cdf('0xa')](),controller['index']);router[_0x7cdf('0x9')](_0x7cdf('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7cdf('0x9')](_0x7cdf('0xc'),auth[_0x7cdf('0xa')](),controller[_0x7cdf('0xd')]);router[_0x7cdf('0xe')]('/',auth[_0x7cdf('0xa')](),controller[_0x7cdf('0xf')]);router[_0x7cdf('0x10')](_0x7cdf('0xb'),auth[_0x7cdf('0xa')](),controller[_0x7cdf('0x11')]);router[_0x7cdf('0x12')](_0x7cdf('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9e58=['express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','show','/:id/download','isAuthenticated','create','put','/:id','update','delete','multer','path','connect-timeout'];(function(_0x2e0dfa,_0x3f6cf3){var _0x781fe=function(_0x48be6e){while(--_0x48be6e){_0x2e0dfa['push'](_0x2e0dfa['shift']());}};_0x781fe(++_0x3f6cf3);}(_0x9e58,0x11d));var _0x89e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e58[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x89e5('0x0'));var util=require('util');var path=require(_0x89e5('0x1'));var timeout=require(_0x89e5('0x2'));var express=require(_0x89e5('0x3'));var router=express[_0x89e5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x89e5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89e5('0x6'));var controller=require(_0x89e5('0x7'));router[_0x89e5('0x8')]('/',auth['isAuthenticated'](),controller[_0x89e5('0x9')]);router[_0x89e5('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x89e5('0xa')]);router[_0x89e5('0x8')](_0x89e5('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x89e5('0xc')](),controller[_0x89e5('0xd')]);router[_0x89e5('0xe')](_0x89e5('0xf'),auth['isAuthenticated'](),controller[_0x89e5('0x10')]);router[_0x89e5('0x11')]('/:id',auth[_0x89e5('0xc')](),controller['destroy']);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 0c46c0d..10ec583 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 _0xde20=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4098c4,_0x329d52){var _0x7d233c=function(_0x182ed0){while(--_0x182ed0){_0x4098c4['push'](_0x4098c4['shift']());}};_0x7d233c(++_0x329d52);}(_0xde20,0x1f3));var _0x0de2=function(_0x1dfbd9,_0x5a52f5){_0x1dfbd9=_0x1dfbd9-0x0;var _0x5ad355=_0xde20[_0x1dfbd9];return _0x5ad355;};'use strict';var Sequelize=require(_0x0de2('0x0'));module[_0x0de2('0x1')]={'field':{'type':Sequelize[_0x0de2('0x2')]},'alias':{'type':Sequelize[_0x0de2('0x3')]},'function':{'type':Sequelize[_0x0de2('0x3')]},'format':{'type':Sequelize[_0x0de2('0x3')]},'groupBy':{'type':Sequelize[_0x0de2('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x0de2('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6516=['TEXT','STRING','BOOLEAN','sequelize'];(function(_0x22218b,_0x53d871){var _0x14e54b=function(_0x207a76){while(--_0x207a76){_0x22218b['push'](_0x22218b['shift']());}};_0x14e54b(++_0x53d871);}(_0x6516,0xcf));var _0x6651=function(_0x46f385,_0x4e9de2){_0x46f385=_0x46f385-0x0;var _0x27b7fc=_0x6516[_0x46f385];return _0x27b7fc;};'use strict';var Sequelize=require(_0x6651('0x0'));module['exports']={'field':{'type':Sequelize[_0x6651('0x1')]},'alias':{'type':Sequelize[_0x6651('0x2')]},'function':{'type':Sequelize[_0x6651('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x6651('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6651('0x2')]},'custom':{'type':Sequelize[_0x6651('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index a284751..f1c193d 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 _0x30af=['rows','catch','show','params','find','create','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','bulkCreate','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','map','AnalyticFieldReport','rawAttributes','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x30af,0x102));var _0xf30a=function(_0x24e91e,_0x38b947){_0x24e91e=_0x24e91e-0x0;var _0x51252c=_0x30af[_0x24e91e];return _0x51252c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf30a('0x0'));var rp=require(_0xf30a('0x1'));var moment=require(_0xf30a('0x2'));var BPromise=require(_0xf30a('0x3'));var Mustache=require('mustache');var util=require(_0xf30a('0x4'));var path=require(_0xf30a('0x5'));var sox=require(_0xf30a('0x6'));var csv=require(_0xf30a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf30a('0x8'));var _=require(_0xf30a('0x9'));var squel=require(_0xf30a('0xa'));var crypto=require(_0xf30a('0xb'));var jsforce=require(_0xf30a('0xc'));var deskjs=require(_0xf30a('0xd'));var toCsv=require(_0xf30a('0x7'));var querystring=require(_0xf30a('0xe'));var Papa=require('papaparse');var Redis=require(_0xf30a('0xf'));var authService=require(_0xf30a('0x10'));var qs=require(_0xf30a('0x11'));var as=require(_0xf30a('0x12'));var hardwareService=require(_0xf30a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf30a('0x14'));var config=require(_0xf30a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x557735,_0x3c2f43){_0x3c2f43=_0x3c2f43||0xcc;return function(_0x3f3832){if(_0x3f3832){return _0x557735[_0xf30a('0x16')](_0x3c2f43);}return _0x557735[_0xf30a('0x17')](_0x3c2f43)[_0xf30a('0x18')]();};}function respondWithResult(_0x93754d,_0x3d8439){_0x3d8439=_0x3d8439||0xc8;return function(_0x11161b){if(_0x11161b){return _0x93754d['status'](_0x3d8439)[_0xf30a('0x19')](_0x11161b);}};}function respondWithFilteredResult(_0x29323f,_0x1886d5){return function(_0x42806a){if(_0x42806a){var _0x236ab0=typeof _0x1886d5[_0xf30a('0x1a')]===_0xf30a('0x1b')&&typeof _0x1886d5[_0xf30a('0x1c')]===_0xf30a('0x1b');var _0x119e56=_0x42806a[_0xf30a('0x1d')];var _0x5b8a4b=_0x236ab0?0x0:_0x1886d5[_0xf30a('0x1a')];var _0x4e1a09=_0x236ab0?_0x42806a[_0xf30a('0x1d')]:_0x1886d5[_0xf30a('0x1a')]+_0x1886d5[_0xf30a('0x1c')];var _0x5b2178;if(_0x4e1a09>=_0x119e56){_0x4e1a09=_0x119e56;_0x5b2178=0xc8;}else{_0x5b2178=0xce;}_0x29323f[_0xf30a('0x17')](_0x5b2178);return _0x29323f[_0xf30a('0x1e')](_0xf30a('0x1f'),_0x5b8a4b+'-'+_0x4e1a09+'/'+_0x119e56)[_0xf30a('0x19')](_0x42806a);}return null;};}function patchUpdates(_0x396935){return function(_0x2fc04f){try{jsonpatch[_0xf30a('0x20')](_0x2fc04f,_0x396935,!![]);}catch(_0x4d6305){return BPromise[_0xf30a('0x21')](_0x4d6305);}return _0x2fc04f[_0xf30a('0x22')]();};}function saveUpdates(_0x5845c1,_0x371b03){return function(_0x1e8928){if(_0x1e8928){return _0x1e8928[_0xf30a('0x23')](_0x5845c1)[_0xf30a('0x24')](function(_0x28fe59){return _0x28fe59;});}return null;};}function removeEntity(_0x4fe5b7,_0x5e185a){return function(_0x3b7f56){if(_0x3b7f56){return _0x3b7f56[_0xf30a('0x25')]()[_0xf30a('0x24')](function(){_0x4fe5b7[_0xf30a('0x17')](0xcc)[_0xf30a('0x18')]();});}};}function handleEntityNotFound(_0x4f5f1b,_0x2957ab){return function(_0x431e68){if(!_0x431e68){_0x4f5f1b[_0xf30a('0x16')](0x194);}return _0x431e68;};}function handleError(_0x29066d,_0x51abfb){_0x51abfb=_0x51abfb||0x1f4;return function(_0x4b425f){logger[_0xf30a('0x26')](_0x4b425f['stack']);if(_0x4b425f['name']){delete _0x4b425f['name'];}_0x29066d['status'](_0x51abfb)[_0xf30a('0x27')](_0x4b425f);};}exports[_0xf30a('0x28')]=function(_0x459940,_0x354b07){var _0xc293ed={},_0x5b2846={},_0x45c883={'count':0x0,'rows':[]};var _0x42bc08=_[_0xf30a('0x29')](db[_0xf30a('0x2a')][_0xf30a('0x2b')],function(_0x335335){return{'name':_0x335335['fieldName'],'type':_0x335335[_0xf30a('0x2c')]['key']};});_0x5b2846[_0xf30a('0x2d')]=_[_0xf30a('0x29')](_0x42bc08,_0xf30a('0x2e'));_0x5b2846[_0xf30a('0x2f')]=_[_0xf30a('0x30')](_0x459940[_0xf30a('0x2f')]);_0x5b2846[_0xf30a('0x31')]=_[_0xf30a('0x32')](_0x5b2846[_0xf30a('0x2d')],_0x5b2846[_0xf30a('0x2f')]);_0xc293ed[_0xf30a('0x33')]=_['intersection'](_0x5b2846[_0xf30a('0x2d')],qs['fields'](_0x459940[_0xf30a('0x2f')][_0xf30a('0x34')]));_0xc293ed[_0xf30a('0x33')]=_0xc293ed[_0xf30a('0x33')][_0xf30a('0x35')]?_0xc293ed[_0xf30a('0x33')]:_0x5b2846[_0xf30a('0x2d')];if(!_0x459940[_0xf30a('0x2f')][_0xf30a('0x36')](_0xf30a('0x37'))){_0xc293ed[_0xf30a('0x1c')]=qs[_0xf30a('0x1c')](_0x459940[_0xf30a('0x2f')][_0xf30a('0x1c')]);_0xc293ed[_0xf30a('0x1a')]=qs[_0xf30a('0x1a')](_0x459940['query']['offset']);}_0xc293ed['order']=qs[_0xf30a('0x38')](_0x459940[_0xf30a('0x2f')]['sort']);_0xc293ed['where']=qs['filters'](_[_0xf30a('0x39')](_0x459940[_0xf30a('0x2f')],_0x5b2846[_0xf30a('0x31')]),_0x42bc08);if(_0x459940['query'][_0xf30a('0x3a')]){_0xc293ed[_0xf30a('0x3b')]=_[_0xf30a('0x3c')](_0xc293ed[_0xf30a('0x3b')],{'$or':_[_0xf30a('0x29')](_0x42bc08,function(_0x2f3814){if(_0x2f3814[_0xf30a('0x2c')]!==_0xf30a('0x3d')){var _0x3c32ea={};_0x3c32ea[_0x2f3814['name']]={'$like':'%'+_0x459940['query'][_0xf30a('0x3a')]+'%'};return _0x3c32ea;}})});}_0xc293ed=_[_0xf30a('0x3c')]({},_0xc293ed,_0x459940[_0xf30a('0x3e')]);var _0x5cf0a7={'where':_0xc293ed[_0xf30a('0x3b')]};return db[_0xf30a('0x2a')][_0xf30a('0x1d')](_0x5cf0a7)['then'](function(_0xfd5fe3){_0x45c883['count']=_0xfd5fe3;if(_0x459940[_0xf30a('0x2f')][_0xf30a('0x3f')]){_0xc293ed[_0xf30a('0x40')]=[{'all':!![]}];}return db[_0xf30a('0x2a')][_0xf30a('0x41')](_0xc293ed);})[_0xf30a('0x24')](function(_0x489892){_0x45c883[_0xf30a('0x42')]=_0x489892;return _0x45c883;})[_0xf30a('0x24')](respondWithFilteredResult(_0x354b07,_0xc293ed))[_0xf30a('0x43')](handleError(_0x354b07,null));};exports[_0xf30a('0x44')]=function(_0x435157,_0x19e963){var _0x35469c={'raw':![],'where':{'id':_0x435157[_0xf30a('0x45')]['id']}},_0x119477={};_0x119477[_0xf30a('0x2d')]=_[_0xf30a('0x30')](db['AnalyticFieldReport'][_0xf30a('0x2b')]);_0x119477[_0xf30a('0x2f')]=_['keys'](_0x435157[_0xf30a('0x2f')]);_0x119477[_0xf30a('0x31')]=_[_0xf30a('0x32')](_0x119477[_0xf30a('0x2d')],_0x119477[_0xf30a('0x2f')]);_0x35469c[_0xf30a('0x33')]=_[_0xf30a('0x32')](_0x119477['model'],qs[_0xf30a('0x34')](_0x435157['query']['fields']));_0x35469c[_0xf30a('0x33')]=_0x35469c[_0xf30a('0x33')][_0xf30a('0x35')]?_0x35469c[_0xf30a('0x33')]:_0x119477[_0xf30a('0x2d')];if(_0x435157['query'][_0xf30a('0x3f')]){_0x35469c[_0xf30a('0x40')]=[{'all':!![]}];}_0x35469c=_[_0xf30a('0x3c')]({},_0x35469c,_0x435157[_0xf30a('0x3e')]);return db['AnalyticFieldReport'][_0xf30a('0x46')](_0x35469c)[_0xf30a('0x24')](handleEntityNotFound(_0x19e963,null))['then'](respondWithResult(_0x19e963,null))[_0xf30a('0x43')](handleError(_0x19e963,null));};exports[_0xf30a('0x47')]=function(_0x32ed63,_0x117254){return db[_0xf30a('0x2a')][_0xf30a('0x47')](_0x32ed63[_0xf30a('0x48')],{})[_0xf30a('0x24')](respondWithResult(_0x117254,0xc9))[_0xf30a('0x43')](handleError(_0x117254,null));};exports['bulkCreate']=function(_0x1af356,_0x41a2d0){return db[_0xf30a('0x2a')]['bulkCreate'](_0x1af356[_0xf30a('0x48')],{'raw':![],'individualHooks':!![]})[_0xf30a('0x24')](respondWithResult(_0x41a2d0,0xc9))[_0xf30a('0x43')](handleError(_0x41a2d0,null));};exports[_0xf30a('0x23')]=function(_0x486441,_0x171624){if(_0x486441[_0xf30a('0x48')]['id']){delete _0x486441[_0xf30a('0x48')]['id'];}return db[_0xf30a('0x2a')][_0xf30a('0x46')]({'where':{'id':_0x486441[_0xf30a('0x45')]['id']}})[_0xf30a('0x24')](handleEntityNotFound(_0x171624,null))[_0xf30a('0x24')](saveUpdates(_0x486441[_0xf30a('0x48')],null))['then'](respondWithResult(_0x171624,null))[_0xf30a('0x43')](handleError(_0x171624,null));};exports[_0xf30a('0x25')]=function(_0x3a80de,_0x79ab9a){return db[_0xf30a('0x2a')]['find']({'where':{'id':_0x3a80de['params']['id']}})[_0xf30a('0x24')](handleEntityNotFound(_0x79ab9a,null))[_0xf30a('0x24')](removeEntity(_0x79ab9a,null))[_0xf30a('0x43')](handleError(_0x79ab9a,null));};exports[_0xf30a('0x49')]=function(_0xd4e359,_0x4a7602){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0xd4e359[_0xf30a('0x2f')][_0xf30a('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xf30a('0x24')](respondWithResult(_0x4a7602,0xcc))[_0xf30a('0x43')](handleError(_0x4a7602,null));};exports[_0xf30a('0x4b')]=function(_0x45d2df,_0x7992ce,_0x52f50d){return db[_0xf30a('0x4c')][_0xf30a('0x4d')]({'where':{'id':_0x45d2df[_0xf30a('0x45')]['id']}})[_0xf30a('0x24')](handleEntityNotFound(_0x7992ce,null))['then'](function(_0x4190a7){if(_0x4190a7){return db[_0xf30a('0x4e')]['transaction'](function(_0x24ee41){return db[_0xf30a('0x2a')][_0xf30a('0x25')]({'where':{'CustomReportId':_0x45d2df[_0xf30a('0x45')]['id']},'transaction':_0x24ee41})[_0xf30a('0x24')](function(_0x36a23b){var _0x4c80e8=_['map'](_0x45d2df[_0xf30a('0x48')],function(_0x4b37af){delete _0x4b37af['id'];_0x4b37af[_0xf30a('0x4f')]=_0x45d2df[_0xf30a('0x45')]['id'];return _0x4b37af;});return db[_0xf30a('0x2a')][_0xf30a('0x50')](_0x4c80e8,{'transaction':_0x24ee41});});})[_0xf30a('0x24')](function(){return db['AnalyticFieldReport'][_0xf30a('0x41')]({'where':{'CustomReportId':_0x45d2df['params']['id']}});});}})[_0xf30a('0x24')](respondWithResult(_0x7992ce,null))[_0xf30a('0x43')](handleError(_0x7992ce,null));};
\ No newline at end of file
+var _0xb6a8=['where','type','VIRTUAL','merge','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','bulkCreate','params','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter'];(function(_0x5112ae,_0x3aebce){var _0x13c388=function(_0x16a9c4){while(--_0x16a9c4){_0x5112ae['push'](_0x5112ae['shift']());}};_0x13c388(++_0x3aebce);}(_0xb6a8,0x160));var _0x8b6a=function(_0x3340f5,_0x1b62c7){_0x3340f5=_0x3340f5-0x0;var _0x447105=_0xb6a8[_0x3340f5];return _0x447105;};'use strict';var emlformat=require(_0x8b6a('0x0'));var rimraf=require(_0x8b6a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b6a('0x2'));var rp=require(_0x8b6a('0x3'));var moment=require('moment');var BPromise=require(_0x8b6a('0x4'));var Mustache=require(_0x8b6a('0x5'));var util=require(_0x8b6a('0x6'));var path=require(_0x8b6a('0x7'));var sox=require(_0x8b6a('0x8'));var csv=require(_0x8b6a('0x9'));var ejs=require(_0x8b6a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b6a('0xb'));var squel=require(_0x8b6a('0xc'));var crypto=require('crypto');var jsforce=require(_0x8b6a('0xd'));var deskjs=require(_0x8b6a('0xe'));var toCsv=require(_0x8b6a('0x9'));var querystring=require(_0x8b6a('0xf'));var Papa=require(_0x8b6a('0x10'));var Redis=require(_0x8b6a('0x11'));var authService=require(_0x8b6a('0x12'));var qs=require(_0x8b6a('0x13'));var as=require(_0x8b6a('0x14'));var hardwareService=require(_0x8b6a('0x15'));var logger=require(_0x8b6a('0x16'))(_0x8b6a('0x17'));var utils=require(_0x8b6a('0x18'));var config=require(_0x8b6a('0x19'));var licenseUtil=require(_0x8b6a('0x1a'));var db=require(_0x8b6a('0x1b'))['db'];function respondWithStatusCode(_0x4f9ab3,_0x4df8be){_0x4df8be=_0x4df8be||0xcc;return function(_0x5895a9){if(_0x5895a9){return _0x4f9ab3[_0x8b6a('0x1c')](_0x4df8be);}return _0x4f9ab3[_0x8b6a('0x1d')](_0x4df8be)[_0x8b6a('0x1e')]();};}function respondWithResult(_0x87614b,_0x4871b7){_0x4871b7=_0x4871b7||0xc8;return function(_0xb9f719){if(_0xb9f719){return _0x87614b[_0x8b6a('0x1d')](_0x4871b7)[_0x8b6a('0x1f')](_0xb9f719);}};}function respondWithFilteredResult(_0x2c232f,_0x507c7b){return function(_0x5c38ff){if(_0x5c38ff){var _0x3a88d3=typeof _0x507c7b[_0x8b6a('0x20')]===_0x8b6a('0x21')&&typeof _0x507c7b[_0x8b6a('0x22')]===_0x8b6a('0x21');var _0x5132f7=_0x5c38ff[_0x8b6a('0x23')];var _0x36f1ed=_0x3a88d3?0x0:_0x507c7b[_0x8b6a('0x20')];var _0x448069=_0x3a88d3?_0x5c38ff[_0x8b6a('0x23')]:_0x507c7b[_0x8b6a('0x20')]+_0x507c7b[_0x8b6a('0x22')];var _0xf7852c;if(_0x448069>=_0x5132f7){_0x448069=_0x5132f7;_0xf7852c=0xc8;}else{_0xf7852c=0xce;}_0x2c232f[_0x8b6a('0x1d')](_0xf7852c);return _0x2c232f['set'](_0x8b6a('0x24'),_0x36f1ed+'-'+_0x448069+'/'+_0x5132f7)[_0x8b6a('0x1f')](_0x5c38ff);}return null;};}function patchUpdates(_0x83176e){return function(_0x4e6109){try{jsonpatch[_0x8b6a('0x25')](_0x4e6109,_0x83176e,!![]);}catch(_0xa5083a){return BPromise['reject'](_0xa5083a);}return _0x4e6109[_0x8b6a('0x26')]();};}function saveUpdates(_0x233032,_0x5603d1){return function(_0x4ac68c){if(_0x4ac68c){return _0x4ac68c[_0x8b6a('0x27')](_0x233032)['then'](function(_0x3d1c7c){return _0x3d1c7c;});}return null;};}function removeEntity(_0x1a6f4a,_0x56285e){return function(_0x5b8375){if(_0x5b8375){return _0x5b8375[_0x8b6a('0x28')]()[_0x8b6a('0x29')](function(){_0x1a6f4a['status'](0xcc)[_0x8b6a('0x1e')]();});}};}function handleEntityNotFound(_0x17bd2f,_0x3805ad){return function(_0x1a80c0){if(!_0x1a80c0){_0x17bd2f[_0x8b6a('0x1c')](0x194);}return _0x1a80c0;};}function handleError(_0x18b6c5,_0x4c7878){_0x4c7878=_0x4c7878||0x1f4;return function(_0x4fec25){logger[_0x8b6a('0x2a')](_0x4fec25[_0x8b6a('0x2b')]);if(_0x4fec25[_0x8b6a('0x2c')]){delete _0x4fec25[_0x8b6a('0x2c')];}_0x18b6c5[_0x8b6a('0x1d')](_0x4c7878)['send'](_0x4fec25);};}exports['index']=function(_0x6472eb,_0x418dbf){var _0x4c1e7c={},_0x355885={},_0x182b6e={'count':0x0,'rows':[]};var _0x4a31e2=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x5a4221){return{'name':_0x5a4221['fieldName'],'type':_0x5a4221['type'][_0x8b6a('0x2d')]};});_0x355885[_0x8b6a('0x2e')]=_[_0x8b6a('0x2f')](_0x4a31e2,'name');_0x355885[_0x8b6a('0x30')]=_['keys'](_0x6472eb[_0x8b6a('0x30')]);_0x355885[_0x8b6a('0x31')]=_[_0x8b6a('0x32')](_0x355885[_0x8b6a('0x2e')],_0x355885[_0x8b6a('0x30')]);_0x4c1e7c[_0x8b6a('0x33')]=_['intersection'](_0x355885['model'],qs[_0x8b6a('0x34')](_0x6472eb['query'][_0x8b6a('0x34')]));_0x4c1e7c[_0x8b6a('0x33')]=_0x4c1e7c[_0x8b6a('0x33')][_0x8b6a('0x35')]?_0x4c1e7c[_0x8b6a('0x33')]:_0x355885['model'];if(!_0x6472eb[_0x8b6a('0x30')]['hasOwnProperty'](_0x8b6a('0x36'))){_0x4c1e7c[_0x8b6a('0x22')]=qs[_0x8b6a('0x22')](_0x6472eb[_0x8b6a('0x30')]['limit']);_0x4c1e7c[_0x8b6a('0x20')]=qs['offset'](_0x6472eb['query'][_0x8b6a('0x20')]);}_0x4c1e7c['order']=qs[_0x8b6a('0x37')](_0x6472eb['query'][_0x8b6a('0x37')]);_0x4c1e7c['where']=qs['filters'](_[_0x8b6a('0x38')](_0x6472eb['query'],_0x355885['filters']),_0x4a31e2);if(_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x39')]){_0x4c1e7c[_0x8b6a('0x3a')]=_['merge'](_0x4c1e7c[_0x8b6a('0x3a')],{'$or':_[_0x8b6a('0x2f')](_0x4a31e2,function(_0x3485b1){if(_0x3485b1[_0x8b6a('0x3b')]!==_0x8b6a('0x3c')){var _0x38f99a={};_0x38f99a[_0x3485b1[_0x8b6a('0x2c')]]={'$like':'%'+_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x39')]+'%'};return _0x38f99a;}})});}_0x4c1e7c=_[_0x8b6a('0x3d')]({},_0x4c1e7c,_0x6472eb[_0x8b6a('0x3e')]);var _0x4747f3={'where':_0x4c1e7c[_0x8b6a('0x3a')]};return db[_0x8b6a('0x3f')][_0x8b6a('0x23')](_0x4747f3)['then'](function(_0x247702){_0x182b6e[_0x8b6a('0x23')]=_0x247702;if(_0x6472eb[_0x8b6a('0x30')][_0x8b6a('0x40')]){_0x4c1e7c[_0x8b6a('0x41')]=[{'all':!![]}];}return db[_0x8b6a('0x3f')][_0x8b6a('0x42')](_0x4c1e7c);})[_0x8b6a('0x29')](function(_0x578920){_0x182b6e[_0x8b6a('0x43')]=_0x578920;return _0x182b6e;})[_0x8b6a('0x29')](respondWithFilteredResult(_0x418dbf,_0x4c1e7c))['catch'](handleError(_0x418dbf,null));};exports[_0x8b6a('0x44')]=function(_0x39470c,_0x263ed1){var _0x45122f={'raw':![],'where':{'id':_0x39470c['params']['id']}},_0x49fa6d={};_0x49fa6d[_0x8b6a('0x2e')]=_[_0x8b6a('0x45')](db['AnalyticFieldReport'][_0x8b6a('0x46')]);_0x49fa6d[_0x8b6a('0x30')]=_[_0x8b6a('0x45')](_0x39470c[_0x8b6a('0x30')]);_0x49fa6d[_0x8b6a('0x31')]=_[_0x8b6a('0x32')](_0x49fa6d[_0x8b6a('0x2e')],_0x49fa6d[_0x8b6a('0x30')]);_0x45122f[_0x8b6a('0x33')]=_[_0x8b6a('0x32')](_0x49fa6d['model'],qs['fields'](_0x39470c['query'][_0x8b6a('0x34')]));_0x45122f['attributes']=_0x45122f[_0x8b6a('0x33')]['length']?_0x45122f[_0x8b6a('0x33')]:_0x49fa6d[_0x8b6a('0x2e')];if(_0x39470c[_0x8b6a('0x30')][_0x8b6a('0x40')]){_0x45122f[_0x8b6a('0x41')]=[{'all':!![]}];}_0x45122f=_['merge']({},_0x45122f,_0x39470c['options']);return db[_0x8b6a('0x3f')][_0x8b6a('0x47')](_0x45122f)[_0x8b6a('0x29')](handleEntityNotFound(_0x263ed1,null))[_0x8b6a('0x29')](respondWithResult(_0x263ed1,null))[_0x8b6a('0x48')](handleError(_0x263ed1,null));};exports[_0x8b6a('0x49')]=function(_0x447a9d,_0x33a2e5){return db['AnalyticFieldReport'][_0x8b6a('0x49')](_0x447a9d[_0x8b6a('0x4a')],{})[_0x8b6a('0x29')](respondWithResult(_0x33a2e5,0xc9))['catch'](handleError(_0x33a2e5,null));};exports[_0x8b6a('0x4b')]=function(_0x3bbc11,_0x36ec6c){return db[_0x8b6a('0x3f')][_0x8b6a('0x4b')](_0x3bbc11[_0x8b6a('0x4a')],{'raw':![],'individualHooks':!![]})[_0x8b6a('0x29')](respondWithResult(_0x36ec6c,0xc9))[_0x8b6a('0x48')](handleError(_0x36ec6c,null));};exports['update']=function(_0x4b8f8c,_0x45e051){if(_0x4b8f8c['body']['id']){delete _0x4b8f8c[_0x8b6a('0x4a')]['id'];}return db['AnalyticFieldReport'][_0x8b6a('0x47')]({'where':{'id':_0x4b8f8c[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x45e051,null))[_0x8b6a('0x29')](saveUpdates(_0x4b8f8c[_0x8b6a('0x4a')],null))[_0x8b6a('0x29')](respondWithResult(_0x45e051,null))[_0x8b6a('0x48')](handleError(_0x45e051,null));};exports['destroy']=function(_0x420712,_0x39fba6){return db['AnalyticFieldReport'][_0x8b6a('0x47')]({'where':{'id':_0x420712[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x39fba6,null))[_0x8b6a('0x29')](removeEntity(_0x39fba6,null))[_0x8b6a('0x48')](handleError(_0x39fba6,null));};exports['bulkDestroy']=function(_0x2f0dcd,_0x45f4d4){return db[_0x8b6a('0x3f')]['destroy']({'where':{'id':_0x2f0dcd[_0x8b6a('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x8b6a('0x29')](respondWithResult(_0x45f4d4,0xcc))[_0x8b6a('0x48')](handleError(_0x45f4d4,null));};exports[_0x8b6a('0x4d')]=function(_0x489b6c,_0x2f85a7,_0x1f9804){return db[_0x8b6a('0x4e')][_0x8b6a('0x4f')]({'where':{'id':_0x489b6c[_0x8b6a('0x4c')]['id']}})[_0x8b6a('0x29')](handleEntityNotFound(_0x2f85a7,null))[_0x8b6a('0x29')](function(_0x5c1c87){if(_0x5c1c87){return db['sequelize'][_0x8b6a('0x50')](function(_0x4cd4e9){return db[_0x8b6a('0x3f')][_0x8b6a('0x28')]({'where':{'CustomReportId':_0x489b6c[_0x8b6a('0x4c')]['id']},'transaction':_0x4cd4e9})['then'](function(_0x2d0a73){var _0x59235f=_[_0x8b6a('0x2f')](_0x489b6c[_0x8b6a('0x4a')],function(_0x463380){delete _0x463380['id'];_0x463380[_0x8b6a('0x51')]=_0x489b6c[_0x8b6a('0x4c')]['id'];return _0x463380;});return db[_0x8b6a('0x3f')][_0x8b6a('0x4b')](_0x59235f,{'transaction':_0x4cd4e9});});})[_0x8b6a('0x29')](function(){return db[_0x8b6a('0x3f')]['findAll']({'where':{'CustomReportId':_0x489b6c[_0x8b6a('0x4c')]['id']}});});}})[_0x8b6a('0x29')](respondWithResult(_0x2f85a7,null))[_0x8b6a('0x48')](handleError(_0x2f85a7,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 29b84be..ab4e895 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 _0xcb5c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api'];(function(_0x92c259,_0x34d06f){var _0x5524fb=function(_0x1edd98){while(--_0x1edd98){_0x92c259['push'](_0x92c259['shift']());}};_0x5524fb(++_0x34d06f);}(_0xcb5c,0xda));var _0xccb5=function(_0x251475,_0x12d5ec){_0x251475=_0x251475-0x0;var _0x255daa=_0xcb5c[_0x251475];return _0x255daa;};'use strict';var _=require(_0xccb5('0x0'));var util=require(_0xccb5('0x1'));var logger=require('../../config/logger')(_0xccb5('0x2'));var moment=require(_0xccb5('0x3'));var BPromise=require(_0xccb5('0x4'));var rp=require(_0xccb5('0x5'));var fs=require('fs');var path=require(_0xccb5('0x6'));var rimraf=require(_0xccb5('0x7'));var config=require(_0xccb5('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0xccb5('0x9')]=function(_0x35171c,_0x53ccac){return _0x35171c[_0xccb5('0xa')](_0xccb5('0xb'),attributes,{'tableName':_0xccb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5579=['moment','request-promise','path','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api'];(function(_0x29d994,_0x74c530){var _0x304d4a=function(_0x4a2b14){while(--_0x4a2b14){_0x29d994['push'](_0x29d994['shift']());}};_0x304d4a(++_0x74c530);}(_0x5579,0x192));var _0x9557=function(_0x42f1e9,_0x5d1d83){_0x42f1e9=_0x42f1e9-0x0;var _0x56e8b6=_0x5579[_0x42f1e9];return _0x56e8b6;};'use strict';var _=require('lodash');var util=require(_0x9557('0x0'));var logger=require(_0x9557('0x1'))(_0x9557('0x2'));var moment=require(_0x9557('0x3'));var BPromise=require('bluebird');var rp=require(_0x9557('0x4'));var fs=require('fs');var path=require(_0x9557('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0xa6e2fa,_0x1d8a64){return _0xa6e2fa[_0x9557('0x6')](_0x9557('0x7'),attributes,{'tableName':_0x9557('0x8'),'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 0f2b5d2..4c429fd 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 _0x5f7a=['request','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57895d,_0xf85da7){var _0x1449f6=function(_0x608070){while(--_0x608070){_0x57895d['push'](_0x57895d['shift']());}};_0x1449f6(++_0xf85da7);}(_0x5f7a,0x186));var _0xa5f7=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x5f7a[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa5f7('0x0'));var BPromise=require(_0xa5f7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5f7('0x2'));var db=require(_0xa5f7('0x3'))['db'];var utils=require(_0xa5f7('0x4'));var logger=require(_0xa5f7('0x5'))(_0xa5f7('0x6'));var config=require(_0xa5f7('0x7'));var jayson=require(_0xa5f7('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aa6c5,_0x52c989,_0x30bdb2){return new BPromise(function(_0x213aa4,_0x209e78){return client[_0xa5f7('0x9')](_0x5aa6c5,_0x30bdb2)['then'](function(_0x438f75){logger[_0xa5f7('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x52c989,_0xa5f7('0xb'));logger['debug'](_0xa5f7('0xc'),_0x52c989,_0xa5f7('0xb'),JSON['stringify'](_0x438f75));if(_0x438f75['error']){if(_0x438f75[_0xa5f7('0xd')][_0xa5f7('0xe')]===0x1f4){logger[_0xa5f7('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x52c989,_0x438f75['error'][_0xa5f7('0xf')]);return _0x209e78(_0x438f75[_0xa5f7('0xd')][_0xa5f7('0xf')]);}logger['error'](_0xa5f7('0x10'),_0x52c989,_0x438f75[_0xa5f7('0xd')][_0xa5f7('0xf')]);return _0x213aa4(_0x438f75[_0xa5f7('0xd')][_0xa5f7('0xf')]);}else{logger[_0xa5f7('0xa')](_0xa5f7('0x10'),_0x52c989,'request\x20sent');_0x213aa4(_0x438f75[_0xa5f7('0x11')][_0xa5f7('0xf')]);}})[_0xa5f7('0x12')](function(_0x4147f5){logger['error'](_0xa5f7('0x10'),_0x52c989,_0x4147f5);_0x209e78(_0x4147f5);});});}
\ No newline at end of file
+var _0x433e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','result'];(function(_0x4cf7fe,_0x3e89ba){var _0x3d4aec=function(_0x298e60){while(--_0x298e60){_0x4cf7fe['push'](_0x4cf7fe['shift']());}};_0x3d4aec(++_0x3e89ba);}(_0x433e,0x7e));var _0xe433=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x433e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe433('0x0'));var util=require(_0xe433('0x1'));var moment=require(_0xe433('0x2'));var BPromise=require('bluebird');var rs=require(_0xe433('0x3'));var fs=require('fs');var Redis=require(_0xe433('0x4'));var db=require(_0xe433('0x5'))['db'];var utils=require(_0xe433('0x6'));var logger=require('../../config/logger')(_0xe433('0x7'));var config=require(_0xe433('0x8'));var jayson=require(_0xe433('0x9'));var client=jayson[_0xe433('0xa')][_0xe433('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35e266,_0x2dbc41,_0x188acd){return new BPromise(function(_0x5bf118,_0x599c52){return client[_0xe433('0xc')](_0x35e266,_0x188acd)['then'](function(_0x348947){logger[_0xe433('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2dbc41,'request\x20sent');logger['debug'](_0xe433('0xe'),_0x2dbc41,'request\x20sent',JSON['stringify'](_0x348947));if(_0x348947[_0xe433('0xf')]){if(_0x348947[_0xe433('0xf')][_0xe433('0x10')]===0x1f4){logger[_0xe433('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2dbc41,_0x348947[_0xe433('0xf')][_0xe433('0x11')]);return _0x599c52(_0x348947[_0xe433('0xf')][_0xe433('0x11')]);}logger[_0xe433('0xf')](_0xe433('0x12'),_0x2dbc41,_0x348947['error'][_0xe433('0x11')]);return _0x5bf118(_0x348947['error'][_0xe433('0x11')]);}else{logger[_0xe433('0xd')](_0xe433('0x12'),_0x2dbc41,_0xe433('0x13'));_0x5bf118(_0x348947[_0xe433('0x14')][_0xe433('0x11')]);}})['catch'](function(_0x145c3b){logger['error'](_0xe433('0x12'),_0x2dbc41,_0x145c3b);_0x599c52(_0x145c3b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 507c7e6..e1d55c1 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(_0x5be4d5,_0x50c2cf){var _0x3c45ee=function(_0x245fdb){while(--_0x245fdb){_0x5be4d5['push'](_0x5be4d5['shift']());}};_0x3c45ee(++_0x50c2cf);}(_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
+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(_0x206775,_0x1e32cd){var _0x257898=function(_0x58e971){while(--_0x58e971){_0x206775['push'](_0x206775['shift']());}};_0x257898(++_0x1e32cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 594131d..3a5ac17 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 _0xd4dc=['STRING','name','TEXT','sequelize'];(function(_0x18b314,_0x1129e5){var _0x4b0acb=function(_0x1caa96){while(--_0x1caa96){_0x18b314['push'](_0x18b314['shift']());}};_0x4b0acb(++_0x1129e5);}(_0xd4dc,0xff));var _0xcd4d=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xd4dc[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0xcd4d('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd4d('0x1')],'allowNull':![],'unique':_0xcd4d('0x2')},'table':{'type':Sequelize[_0xcd4d('0x1')]},'metric':{'type':Sequelize[_0xcd4d('0x3')]},'description':{'type':Sequelize[_0xcd4d('0x1')]}};
\ No newline at end of file
+var _0xbc8b=['name','STRING','TEXT','exports'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0xbc8b[_0x1428d9];return _0x438019;};'use strict';var Sequelize=require('sequelize');module[_0xbbc8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbbc8('0x1')},'table':{'type':Sequelize[_0xbbc8('0x2')]},'metric':{'type':Sequelize[_0xbbc8('0x3')]},'description':{'type':Sequelize[_0xbbc8('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 6390d8a..3142add 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 _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x1ce5ee,_0x1c1cd6){var _0x32668f=function(_0x1852eb){while(--_0x1852eb){_0x1ce5ee['push'](_0x1ce5ee['shift']());}};_0x32668f(++_0x1c1cd6);}(_0x425d,0x1e0));var _0xd425=function(_0x2d9f26,_0x10e8dd){_0x2d9f26=_0x2d9f26-0x0;var _0x5c7562=_0x425d[_0x2d9f26];return _0x5c7562;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));};
\ No newline at end of file
+var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x61bb05,_0x47421f){var _0x3ceb3e=function(_0x54b8f7){while(--_0x54b8f7){_0x61bb05['push'](_0x61bb05['shift']());}};_0x3ceb3e(++_0x47421f);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x6a9ed1,_0x185493){_0x6a9ed1=_0x6a9ed1-0x0;var _0x2d0535=_0x8d0e[_0x6a9ed1];return _0x2d0535;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 473d40f..bb2da9e 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 _0x01db=['api','moment','bluebird','path','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x01db,0x171));var _0xb01d=function(_0x46ea2e,_0x1fc30b){_0x46ea2e=_0x46ea2e-0x0;var _0x2a5669=_0x01db[_0x46ea2e];return _0x2a5669;};'use strict';var _=require(_0xb01d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb01d('0x1'));var moment=require(_0xb01d('0x2'));var BPromise=require(_0xb01d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb01d('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb01d('0x5'));module[_0xb01d('0x6')]=function(_0x30bddd,_0x30f6b5){return _0x30bddd[_0xb01d('0x7')](_0xb01d('0x8'),attributes,{'tableName':_0xb01d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x74f3=['bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0xfaef7a,_0x375c7a){var _0x3eb65f=function(_0x5143f9){while(--_0x5143f9){_0xfaef7a['push'](_0xfaef7a['shift']());}};_0x3eb65f(++_0x375c7a);}(_0x74f3,0x164));var _0x374f=function(_0xa681dc,_0x3100aa){_0xa681dc=_0xa681dc-0x0;var _0x422441=_0x74f3[_0xa681dc];return _0x422441;};'use strict';var _=require(_0x374f('0x0'));var util=require(_0x374f('0x1'));var logger=require(_0x374f('0x2'))('api');var moment=require(_0x374f('0x3'));var BPromise=require(_0x374f('0x4'));var rp=require(_0x374f('0x5'));var fs=require('fs');var path=require(_0x374f('0x6'));var rimraf=require('rimraf');var config=require(_0x374f('0x7'));var attributes=require(_0x374f('0x8'));module['exports']=function(_0x1292f2,_0x1eb333){return _0x1292f2[_0x374f('0x9')](_0x374f('0xa'),attributes,{'tableName':_0x374f('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 48e0d15..4b67397 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 _0x2d17=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x462f33,_0x45533e){var _0x1e9e7a=function(_0x5d44de){while(--_0x5d44de){_0x462f33['push'](_0x462f33['shift']());}};_0x1e9e7a(++_0x45533e);}(_0x2d17,0x195));var _0x72d1=function(_0x3cb56b,_0x12512e){_0x3cb56b=_0x3cb56b-0x0;var _0x1a6b7d=_0x2d17[_0x3cb56b];return _0x1a6b7d;};'use strict';var _=require('lodash');var util=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var utils=require(_0x72d1('0x4'));var logger=require(_0x72d1('0x5'))('rpc');var config=require(_0x72d1('0x6'));var jayson=require(_0x72d1('0x7'));var client=jayson[_0x72d1('0x8')][_0x72d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xeecf65,_0x78a459,_0x6f7b4e){return new BPromise(function(_0x2ab59c,_0x2352b9){return client[_0x72d1('0xa')](_0xeecf65,_0x6f7b4e)[_0x72d1('0xb')](function(_0x172e0e){logger['info'](_0x72d1('0xc'),_0x78a459,_0x72d1('0xd'));logger[_0x72d1('0xe')](_0x72d1('0xf'),_0x78a459,'request\x20sent',JSON[_0x72d1('0x10')](_0x172e0e));if(_0x172e0e[_0x72d1('0x11')]){if(_0x172e0e[_0x72d1('0x11')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x78a459,_0x172e0e[_0x72d1('0x11')]['message']);return _0x2352b9(_0x172e0e[_0x72d1('0x11')][_0x72d1('0x12')]);}logger[_0x72d1('0x11')](_0x72d1('0xc'),_0x78a459,_0x172e0e[_0x72d1('0x11')][_0x72d1('0x12')]);return _0x2ab59c(_0x172e0e['error'][_0x72d1('0x12')]);}else{logger[_0x72d1('0x13')](_0x72d1('0xc'),_0x78a459,_0x72d1('0xd'));_0x2ab59c(_0x172e0e['result'][_0x72d1('0x12')]);}})[_0x72d1('0x14')](function(_0x5ad95e){logger[_0x72d1('0x11')](_0x72d1('0xc'),_0x78a459,_0x5ad95e);_0x2352b9(_0x5ad95e);});});}
\ No newline at end of file
+var _0x3a85=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util'];(function(_0x441644,_0x5a8f34){var _0x4326d9=function(_0x58f63f){while(--_0x58f63f){_0x441644['push'](_0x441644['shift']());}};_0x4326d9(++_0x5a8f34);}(_0x3a85,0x1cd));var _0x53a8=function(_0x1f20ef,_0x3cf650){_0x1f20ef=_0x1f20ef-0x0;var _0x170f61=_0x3a85[_0x1f20ef];return _0x170f61;};'use strict';var _=require('lodash');var util=require(_0x53a8('0x0'));var moment=require('moment');var BPromise=require(_0x53a8('0x1'));var rs=require(_0x53a8('0x2'));var fs=require('fs');var Redis=require(_0x53a8('0x3'));var db=require(_0x53a8('0x4'))['db'];var utils=require(_0x53a8('0x5'));var logger=require(_0x53a8('0x6'))(_0x53a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x53a8('0x8')][_0x53a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a17e1,_0x222092,_0x3ee33d){return new BPromise(function(_0x4845b6,_0x3d525a){return client[_0x53a8('0xa')](_0x4a17e1,_0x3ee33d)['then'](function(_0x3f6d4a){logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x222092,_0x53a8('0xd'));logger[_0x53a8('0xe')](_0x53a8('0xf'),_0x222092,_0x53a8('0xd'),JSON[_0x53a8('0x10')](_0x3f6d4a));if(_0x3f6d4a[_0x53a8('0x11')]){if(_0x3f6d4a['error'][_0x53a8('0x12')]===0x1f4){logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x3f6d4a[_0x53a8('0x11')]['message']);return _0x3d525a(_0x3f6d4a[_0x53a8('0x11')]['message']);}logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x3f6d4a['error'][_0x53a8('0x13')]);return _0x4845b6(_0x3f6d4a[_0x53a8('0x11')]['message']);}else{logger[_0x53a8('0xb')](_0x53a8('0xc'),_0x222092,'request\x20sent');_0x4845b6(_0x3f6d4a[_0x53a8('0x14')][_0x53a8('0x13')]);}})[_0x53a8('0x15')](function(_0x4a7c8d){logger[_0x53a8('0x11')](_0x53a8('0xc'),_0x222092,_0x4a7c8d);_0x3d525a(_0x4a7c8d);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index f4b17d6..42c8a6f 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 _0x644f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','/:id','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x644f,0x177));var _0xf644=function(_0x5c3ae9,_0x450f9a){_0x5c3ae9=_0x5c3ae9-0x0;var _0x3f5950=_0x644f[_0x5c3ae9];return _0x3f5950;};'use strict';var multer=require('multer');var util=require(_0xf644('0x0'));var path=require(_0xf644('0x1'));var timeout=require(_0xf644('0x2'));var express=require(_0xf644('0x3'));var router=express[_0xf644('0x4')]();var fs_extra=require(_0xf644('0x5'));var auth=require(_0xf644('0x6'));var interaction=require(_0xf644('0x7'));var config=require(_0xf644('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xf644('0x9')](),controller[_0xf644('0xa')]);router[_0xf644('0xb')]('/:id',auth[_0xf644('0x9')](),controller[_0xf644('0xc')]);router[_0xf644('0xd')]('/',auth[_0xf644('0x9')](),controller[_0xf644('0xe')]);router['put'](_0xf644('0xf'),auth[_0xf644('0x9')](),controller[_0xf644('0x10')]);router[_0xf644('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf644('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x3e9d=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x3287e1,_0x229d40){_0x3287e1=_0x3287e1-0x0;var _0x15916f=_0x3e9d[_0x3287e1];return _0x15916f;};'use strict';var multer=require(_0xd3e9('0x0'));var util=require(_0xd3e9('0x1'));var path=require('path');var timeout=require(_0xd3e9('0x2'));var express=require(_0xd3e9('0x3'));var router=express[_0xd3e9('0x4')]();var fs_extra=require(_0xd3e9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd3e9('0x6'));var controller=require(_0xd3e9('0x7'));router[_0xd3e9('0x8')]('/',auth[_0xd3e9('0x9')](),controller['index']);router['get'](_0xd3e9('0xa'),auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xb')]);router[_0xd3e9('0xc')]('/',auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xd')]);router[_0xd3e9('0xe')]('/:id',auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xf')]);router[_0xd3e9('0x10')](_0xd3e9('0xa'),auth[_0xd3e9('0x9')](),controller[_0xd3e9('0x11')]);module[_0xd3e9('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 09a44fc..164b18f 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 _0x7187=['sequelize','exports','TEXT'];(function(_0x405779,_0x240a35){var _0x4b0a63=function(_0xf8372f){while(--_0xf8372f){_0x405779['push'](_0x405779['shift']());}};_0x4b0a63(++_0x240a35);}(_0x7187,0xc0));var _0x7718=function(_0x4f85d4,_0x1755c5){_0x4f85d4=_0x4f85d4-0x0;var _0x4556bf=_0x7187[_0x4f85d4];return _0x4556bf;};'use strict';var Sequelize=require(_0x7718('0x0'));module[_0x7718('0x1')]={'tree':{'type':Sequelize[_0x7718('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x5eed=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5eed,0x145));var _0xd5ee=function(_0x349876,_0x5675a6){_0x349876=_0x349876-0x0;var _0x228824=_0x5eed[_0x349876];return _0x228824;};'use strict';var Sequelize=require('sequelize');module[_0xd5ee('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index bf05bcd..3b4ee3e 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 _0x9590=['name','send','index','map','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','reject','update','then','destroy','error','stack'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9590,0x14c));var _0x0959=function(_0x283bc2,_0x2699d4){_0x283bc2=_0x283bc2-0x0;var _0x2927e6=_0x9590[_0x283bc2];return _0x2927e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0959('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0959('0x1'));var moment=require(_0x0959('0x2'));var BPromise=require(_0x0959('0x3'));var Mustache=require(_0x0959('0x4'));var util=require(_0x0959('0x5'));var path=require(_0x0959('0x6'));var sox=require(_0x0959('0x7'));var csv=require(_0x0959('0x8'));var ejs=require(_0x0959('0x9'));var fs=require('fs');var fs_extra=require(_0x0959('0xa'));var _=require('lodash');var squel=require(_0x0959('0xb'));var crypto=require('crypto');var jsforce=require(_0x0959('0xc'));var deskjs=require(_0x0959('0xd'));var toCsv=require(_0x0959('0x8'));var querystring=require(_0x0959('0xe'));var Papa=require('papaparse');var Redis=require(_0x0959('0xf'));var authService=require(_0x0959('0x10'));var qs=require(_0x0959('0x11'));var as=require(_0x0959('0x12'));var hardwareService=require(_0x0959('0x13'));var logger=require(_0x0959('0x14'))(_0x0959('0x15'));var utils=require('../../config/utils');var config=require(_0x0959('0x16'));var licenseUtil=require(_0x0959('0x17'));var db=require(_0x0959('0x18'))['db'];function respondWithStatusCode(_0x335fdd,_0x54e078){_0x54e078=_0x54e078||0xcc;return function(_0x4bde8d){if(_0x4bde8d){return _0x335fdd[_0x0959('0x19')](_0x54e078);}return _0x335fdd[_0x0959('0x1a')](_0x54e078)[_0x0959('0x1b')]();};}function respondWithResult(_0x511b24,_0xdf0749){_0xdf0749=_0xdf0749||0xc8;return function(_0x27721e){if(_0x27721e){return _0x511b24[_0x0959('0x1a')](_0xdf0749)[_0x0959('0x1c')](_0x27721e);}};}function respondWithFilteredResult(_0x1defa9,_0x5b5342){return function(_0x4fc96e){if(_0x4fc96e){var _0x230822=typeof _0x5b5342[_0x0959('0x1d')]===_0x0959('0x1e')&&typeof _0x5b5342['limit']===_0x0959('0x1e');var _0x1e45f4=_0x4fc96e[_0x0959('0x1f')];var _0x3ad8ce=_0x230822?0x0:_0x5b5342[_0x0959('0x1d')];var _0x256941=_0x230822?_0x4fc96e[_0x0959('0x1f')]:_0x5b5342[_0x0959('0x1d')]+_0x5b5342['limit'];var _0x365264;if(_0x256941>=_0x1e45f4){_0x256941=_0x1e45f4;_0x365264=0xc8;}else{_0x365264=0xce;}_0x1defa9[_0x0959('0x1a')](_0x365264);return _0x1defa9['set']('Content-Range',_0x3ad8ce+'-'+_0x256941+'/'+_0x1e45f4)[_0x0959('0x1c')](_0x4fc96e);}return null;};}function patchUpdates(_0x34205b){return function(_0x2f211d){try{jsonpatch['apply'](_0x2f211d,_0x34205b,!![]);}catch(_0x2cdc9e){return BPromise[_0x0959('0x20')](_0x2cdc9e);}return _0x2f211d['save']();};}function saveUpdates(_0x53e535,_0x1f4725){return function(_0x390ce9){if(_0x390ce9){return _0x390ce9[_0x0959('0x21')](_0x53e535)[_0x0959('0x22')](function(_0x2e4153){return _0x2e4153;});}return null;};}function removeEntity(_0x443f55,_0x564559){return function(_0x267623){if(_0x267623){return _0x267623[_0x0959('0x23')]()[_0x0959('0x22')](function(){_0x443f55[_0x0959('0x1a')](0xcc)[_0x0959('0x1b')]();});}};}function handleEntityNotFound(_0x108614,_0x21c104){return function(_0x5a9a92){if(!_0x5a9a92){_0x108614[_0x0959('0x19')](0x194);}return _0x5a9a92;};}function handleError(_0x14347a,_0xbd6d40){_0xbd6d40=_0xbd6d40||0x1f4;return function(_0x2a2368){logger[_0x0959('0x24')](_0x2a2368[_0x0959('0x25')]);if(_0x2a2368[_0x0959('0x26')]){delete _0x2a2368['name'];}_0x14347a['status'](_0xbd6d40)[_0x0959('0x27')](_0x2a2368);};}exports[_0x0959('0x28')]=function(_0x51a970,_0x1212f4){var _0x1cfdf0={},_0xa5f64d={},_0x45e40e={'count':0x0,'rows':[]};var _0x32c994=_[_0x0959('0x29')](db['AnalyticTreeReport']['rawAttributes'],function(_0x3cfe95){return{'name':_0x3cfe95['fieldName'],'type':_0x3cfe95[_0x0959('0x2a')]['key']};});_0xa5f64d['model']=_['map'](_0x32c994,_0x0959('0x26'));_0xa5f64d[_0x0959('0x2b')]=_[_0x0959('0x2c')](_0x51a970[_0x0959('0x2b')]);_0xa5f64d[_0x0959('0x2d')]=_[_0x0959('0x2e')](_0xa5f64d['model'],_0xa5f64d[_0x0959('0x2b')]);_0x1cfdf0[_0x0959('0x2f')]=_[_0x0959('0x2e')](_0xa5f64d[_0x0959('0x30')],qs[_0x0959('0x31')](_0x51a970[_0x0959('0x2b')]['fields']));_0x1cfdf0['attributes']=_0x1cfdf0[_0x0959('0x2f')]['length']?_0x1cfdf0['attributes']:_0xa5f64d[_0x0959('0x30')];if(!_0x51a970['query'][_0x0959('0x32')](_0x0959('0x33'))){_0x1cfdf0[_0x0959('0x34')]=qs[_0x0959('0x34')](_0x51a970['query']['limit']);_0x1cfdf0['offset']=qs['offset'](_0x51a970[_0x0959('0x2b')][_0x0959('0x1d')]);}_0x1cfdf0[_0x0959('0x35')]=qs['sort'](_0x51a970[_0x0959('0x2b')][_0x0959('0x36')]);_0x1cfdf0[_0x0959('0x37')]=qs['filters'](_[_0x0959('0x38')](_0x51a970[_0x0959('0x2b')],_0xa5f64d[_0x0959('0x2d')]),_0x32c994);if(_0x51a970[_0x0959('0x2b')][_0x0959('0x39')]){_0x1cfdf0['where']=_[_0x0959('0x3a')](_0x1cfdf0[_0x0959('0x37')],{'$or':_[_0x0959('0x29')](_0x32c994,function(_0xa031be){if(_0xa031be['type']!==_0x0959('0x3b')){var _0x36991e={};_0x36991e[_0xa031be['name']]={'$like':'%'+_0x51a970[_0x0959('0x2b')][_0x0959('0x39')]+'%'};return _0x36991e;}})});}_0x1cfdf0=_[_0x0959('0x3a')]({},_0x1cfdf0,_0x51a970[_0x0959('0x3c')]);var _0x442692={'where':_0x1cfdf0[_0x0959('0x37')]};return db[_0x0959('0x3d')][_0x0959('0x1f')](_0x442692)[_0x0959('0x22')](function(_0xf71fff){_0x45e40e[_0x0959('0x1f')]=_0xf71fff;if(_0x51a970[_0x0959('0x2b')][_0x0959('0x3e')]){_0x1cfdf0[_0x0959('0x3f')]=[{'all':!![]}];}return db[_0x0959('0x3d')][_0x0959('0x40')](_0x1cfdf0);})[_0x0959('0x22')](function(_0x176f82){_0x45e40e[_0x0959('0x41')]=_0x176f82;return _0x45e40e;})['then'](respondWithFilteredResult(_0x1212f4,_0x1cfdf0))[_0x0959('0x42')](handleError(_0x1212f4,null));};exports[_0x0959('0x43')]=function(_0x5e26de,_0x1b3e47){var _0x21c005={'raw':!![],'where':{'id':_0x5e26de[_0x0959('0x44')]['id']}},_0x2c8991={};_0x2c8991[_0x0959('0x30')]=_[_0x0959('0x2c')](db[_0x0959('0x3d')][_0x0959('0x45')]);_0x2c8991['query']=_[_0x0959('0x2c')](_0x5e26de[_0x0959('0x2b')]);_0x2c8991[_0x0959('0x2d')]=_[_0x0959('0x2e')](_0x2c8991[_0x0959('0x30')],_0x2c8991[_0x0959('0x2b')]);_0x21c005[_0x0959('0x2f')]=_[_0x0959('0x2e')](_0x2c8991[_0x0959('0x30')],qs[_0x0959('0x31')](_0x5e26de[_0x0959('0x2b')][_0x0959('0x31')]));_0x21c005['attributes']=_0x21c005['attributes'][_0x0959('0x46')]?_0x21c005[_0x0959('0x2f')]:_0x2c8991[_0x0959('0x30')];if(_0x5e26de[_0x0959('0x2b')][_0x0959('0x3e')]){_0x21c005[_0x0959('0x3f')]=[{'all':!![]}];}_0x21c005=_[_0x0959('0x3a')]({},_0x21c005,_0x5e26de[_0x0959('0x3c')]);return db[_0x0959('0x3d')][_0x0959('0x47')](_0x21c005)['then'](handleEntityNotFound(_0x1b3e47,null))[_0x0959('0x22')](respondWithResult(_0x1b3e47,null))[_0x0959('0x42')](handleError(_0x1b3e47,null));};exports[_0x0959('0x48')]=function(_0x207cad,_0x202aca){return db[_0x0959('0x3d')][_0x0959('0x48')](_0x207cad['body'],{})[_0x0959('0x22')](respondWithResult(_0x202aca,0xc9))[_0x0959('0x42')](handleError(_0x202aca,null));};exports[_0x0959('0x21')]=function(_0x34d541,_0x48324b){if(_0x34d541[_0x0959('0x49')]['id']){delete _0x34d541[_0x0959('0x49')]['id'];}return db['AnalyticTreeReport'][_0x0959('0x47')]({'where':{'id':_0x34d541['params']['id']}})[_0x0959('0x22')](handleEntityNotFound(_0x48324b,null))[_0x0959('0x22')](saveUpdates(_0x34d541['body'],null))[_0x0959('0x22')](respondWithResult(_0x48324b,null))[_0x0959('0x42')](handleError(_0x48324b,null));};exports[_0x0959('0x23')]=function(_0x210be9,_0x131f3c){return db[_0x0959('0x3d')][_0x0959('0x47')]({'where':{'id':_0x210be9[_0x0959('0x44')]['id']}})[_0x0959('0x22')](handleEntityNotFound(_0x131f3c,null))[_0x0959('0x22')](removeEntity(_0x131f3c,null))[_0x0959('0x42')](handleError(_0x131f3c,null));};
\ No newline at end of file
+var _0x62e6=['util','path','sox','fs-extra','lodash','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/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','order','sort','pick','where','merge','include','rows','catch','keys','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3adb98,_0x29935f){var _0x4dbaef=function(_0x226afb){while(--_0x226afb){_0x3adb98['push'](_0x3adb98['shift']());}};_0x4dbaef(++_0x29935f);}(_0x62e6,0xd5));var _0x662e=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0x62e6[_0x46c9cc];return _0x21b46e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x662e('0x0'));var zipdir=require(_0x662e('0x1'));var jsonpatch=require(_0x662e('0x2'));var rp=require(_0x662e('0x3'));var moment=require(_0x662e('0x4'));var BPromise=require(_0x662e('0x5'));var Mustache=require('mustache');var util=require(_0x662e('0x6'));var path=require(_0x662e('0x7'));var sox=require(_0x662e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x662e('0x9'));var _=require(_0x662e('0xa'));var squel=require('squel');var crypto=require(_0x662e('0xb'));var jsforce=require(_0x662e('0xc'));var deskjs=require(_0x662e('0xd'));var toCsv=require(_0x662e('0xe'));var querystring=require(_0x662e('0xf'));var Papa=require(_0x662e('0x10'));var Redis=require(_0x662e('0x11'));var authService=require(_0x662e('0x12'));var qs=require(_0x662e('0x13'));var as=require(_0x662e('0x14'));var hardwareService=require(_0x662e('0x15'));var logger=require(_0x662e('0x16'))(_0x662e('0x17'));var utils=require(_0x662e('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x662e('0x19'));var db=require(_0x662e('0x1a'))['db'];function respondWithStatusCode(_0x3e94ef,_0x549995){_0x549995=_0x549995||0xcc;return function(_0x1766ac){if(_0x1766ac){return _0x3e94ef['sendStatus'](_0x549995);}return _0x3e94ef[_0x662e('0x1b')](_0x549995)[_0x662e('0x1c')]();};}function respondWithResult(_0xd17212,_0x5aa8dc){_0x5aa8dc=_0x5aa8dc||0xc8;return function(_0x2db8da){if(_0x2db8da){return _0xd17212[_0x662e('0x1b')](_0x5aa8dc)[_0x662e('0x1d')](_0x2db8da);}};}function respondWithFilteredResult(_0x580848,_0x14741f){return function(_0x1ad8df){if(_0x1ad8df){var _0xa08d55=typeof _0x14741f[_0x662e('0x1e')]===_0x662e('0x1f')&&typeof _0x14741f['limit']==='undefined';var _0x3d4e8f=_0x1ad8df[_0x662e('0x20')];var _0x243128=_0xa08d55?0x0:_0x14741f[_0x662e('0x1e')];var _0x30f22b=_0xa08d55?_0x1ad8df['count']:_0x14741f[_0x662e('0x1e')]+_0x14741f[_0x662e('0x21')];var _0x59dd65;if(_0x30f22b>=_0x3d4e8f){_0x30f22b=_0x3d4e8f;_0x59dd65=0xc8;}else{_0x59dd65=0xce;}_0x580848['status'](_0x59dd65);return _0x580848[_0x662e('0x22')]('Content-Range',_0x243128+'-'+_0x30f22b+'/'+_0x3d4e8f)['json'](_0x1ad8df);}return null;};}function patchUpdates(_0x5c0741){return function(_0x2e8571){try{jsonpatch[_0x662e('0x23')](_0x2e8571,_0x5c0741,!![]);}catch(_0x1197b3){return BPromise[_0x662e('0x24')](_0x1197b3);}return _0x2e8571[_0x662e('0x25')]();};}function saveUpdates(_0x33f390,_0x2a6672){return function(_0x12da54){if(_0x12da54){return _0x12da54[_0x662e('0x26')](_0x33f390)[_0x662e('0x27')](function(_0x366900){return _0x366900;});}return null;};}function removeEntity(_0x38c02e,_0x1c1c91){return function(_0x3fb270){if(_0x3fb270){return _0x3fb270[_0x662e('0x28')]()[_0x662e('0x27')](function(){_0x38c02e[_0x662e('0x1b')](0xcc)[_0x662e('0x1c')]();});}};}function handleEntityNotFound(_0x4f4a32,_0x1c556a){return function(_0x20d0c9){if(!_0x20d0c9){_0x4f4a32[_0x662e('0x29')](0x194);}return _0x20d0c9;};}function handleError(_0x3d6447,_0x156811){_0x156811=_0x156811||0x1f4;return function(_0xff3e06){logger[_0x662e('0x2a')](_0xff3e06[_0x662e('0x2b')]);if(_0xff3e06['name']){delete _0xff3e06[_0x662e('0x2c')];}_0x3d6447[_0x662e('0x1b')](_0x156811)[_0x662e('0x2d')](_0xff3e06);};}exports[_0x662e('0x2e')]=function(_0xbe4da5,_0x541df3){var _0x486135={},_0x35de49={},_0x4320fb={'count':0x0,'rows':[]};var _0x2a3b35=_[_0x662e('0x2f')](db[_0x662e('0x30')][_0x662e('0x31')],function(_0x2f920f){return{'name':_0x2f920f[_0x662e('0x32')],'type':_0x2f920f[_0x662e('0x33')][_0x662e('0x34')]};});_0x35de49['model']=_[_0x662e('0x2f')](_0x2a3b35,'name');_0x35de49[_0x662e('0x35')]=_['keys'](_0xbe4da5['query']);_0x35de49[_0x662e('0x36')]=_[_0x662e('0x37')](_0x35de49[_0x662e('0x38')],_0x35de49[_0x662e('0x35')]);_0x486135['attributes']=_['intersection'](_0x35de49[_0x662e('0x38')],qs['fields'](_0xbe4da5[_0x662e('0x35')][_0x662e('0x39')]));_0x486135['attributes']=_0x486135[_0x662e('0x3a')]['length']?_0x486135[_0x662e('0x3a')]:_0x35de49[_0x662e('0x38')];if(!_0xbe4da5[_0x662e('0x35')]['hasOwnProperty']('nolimit')){_0x486135[_0x662e('0x21')]=qs[_0x662e('0x21')](_0xbe4da5[_0x662e('0x35')][_0x662e('0x21')]);_0x486135[_0x662e('0x1e')]=qs[_0x662e('0x1e')](_0xbe4da5[_0x662e('0x35')][_0x662e('0x1e')]);}_0x486135[_0x662e('0x3b')]=qs[_0x662e('0x3c')](_0xbe4da5['query'][_0x662e('0x3c')]);_0x486135['where']=qs[_0x662e('0x36')](_[_0x662e('0x3d')](_0xbe4da5[_0x662e('0x35')],_0x35de49[_0x662e('0x36')]),_0x2a3b35);if(_0xbe4da5[_0x662e('0x35')]['filter']){_0x486135[_0x662e('0x3e')]=_[_0x662e('0x3f')](_0x486135[_0x662e('0x3e')],{'$or':_[_0x662e('0x2f')](_0x2a3b35,function(_0xc3ba27){if(_0xc3ba27[_0x662e('0x33')]!=='VIRTUAL'){var _0x206bb8={};_0x206bb8[_0xc3ba27[_0x662e('0x2c')]]={'$like':'%'+_0xbe4da5[_0x662e('0x35')]['filter']+'%'};return _0x206bb8;}})});}_0x486135=_[_0x662e('0x3f')]({},_0x486135,_0xbe4da5['options']);var _0x5c06fe={'where':_0x486135[_0x662e('0x3e')]};return db[_0x662e('0x30')][_0x662e('0x20')](_0x5c06fe)[_0x662e('0x27')](function(_0x226f92){_0x4320fb[_0x662e('0x20')]=_0x226f92;if(_0xbe4da5[_0x662e('0x35')]['includeAll']){_0x486135[_0x662e('0x40')]=[{'all':!![]}];}return db[_0x662e('0x30')]['findAll'](_0x486135);})[_0x662e('0x27')](function(_0x319070){_0x4320fb[_0x662e('0x41')]=_0x319070;return _0x4320fb;})[_0x662e('0x27')](respondWithFilteredResult(_0x541df3,_0x486135))[_0x662e('0x42')](handleError(_0x541df3,null));};exports['show']=function(_0x5e1df7,_0x469fac){var _0x555c69={'raw':!![],'where':{'id':_0x5e1df7['params']['id']}},_0x263f4e={};_0x263f4e[_0x662e('0x38')]=_[_0x662e('0x43')](db[_0x662e('0x30')][_0x662e('0x31')]);_0x263f4e['query']=_[_0x662e('0x43')](_0x5e1df7[_0x662e('0x35')]);_0x263f4e[_0x662e('0x36')]=_[_0x662e('0x37')](_0x263f4e[_0x662e('0x38')],_0x263f4e[_0x662e('0x35')]);_0x555c69[_0x662e('0x3a')]=_[_0x662e('0x37')](_0x263f4e[_0x662e('0x38')],qs['fields'](_0x5e1df7['query'][_0x662e('0x39')]));_0x555c69[_0x662e('0x3a')]=_0x555c69[_0x662e('0x3a')]['length']?_0x555c69[_0x662e('0x3a')]:_0x263f4e[_0x662e('0x38')];if(_0x5e1df7[_0x662e('0x35')]['includeAll']){_0x555c69[_0x662e('0x40')]=[{'all':!![]}];}_0x555c69=_[_0x662e('0x3f')]({},_0x555c69,_0x5e1df7[_0x662e('0x44')]);return db['AnalyticTreeReport'][_0x662e('0x45')](_0x555c69)['then'](handleEntityNotFound(_0x469fac,null))[_0x662e('0x27')](respondWithResult(_0x469fac,null))[_0x662e('0x42')](handleError(_0x469fac,null));};exports[_0x662e('0x46')]=function(_0x575a79,_0x3338ce){return db[_0x662e('0x30')][_0x662e('0x46')](_0x575a79[_0x662e('0x47')],{})[_0x662e('0x27')](respondWithResult(_0x3338ce,0xc9))['catch'](handleError(_0x3338ce,null));};exports[_0x662e('0x26')]=function(_0x11ccf1,_0x2e8cc9){if(_0x11ccf1[_0x662e('0x47')]['id']){delete _0x11ccf1[_0x662e('0x47')]['id'];}return db[_0x662e('0x30')][_0x662e('0x45')]({'where':{'id':_0x11ccf1[_0x662e('0x48')]['id']}})[_0x662e('0x27')](handleEntityNotFound(_0x2e8cc9,null))[_0x662e('0x27')](saveUpdates(_0x11ccf1[_0x662e('0x47')],null))[_0x662e('0x27')](respondWithResult(_0x2e8cc9,null))[_0x662e('0x42')](handleError(_0x2e8cc9,null));};exports[_0x662e('0x28')]=function(_0x4e9d52,_0x60b828){return db[_0x662e('0x30')][_0x662e('0x45')]({'where':{'id':_0x4e9d52['params']['id']}})['then'](handleEntityNotFound(_0x60b828,null))['then'](removeEntity(_0x60b828,null))[_0x662e('0x42')](handleError(_0x60b828,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index e5cb447..9f7f4ec 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 _0x88b5=['./analyticTreeReport.attributes','define','analytics_report_trees','util','request-promise','path','rimraf','../../config/environment'];(function(_0x2355ea,_0x3a3090){var _0x30af6d=function(_0x3bff5f){while(--_0x3bff5f){_0x2355ea['push'](_0x2355ea['shift']());}};_0x30af6d(++_0x3a3090);}(_0x88b5,0x143));var _0x588b=function(_0x15de8c,_0x196308){_0x15de8c=_0x15de8c-0x0;var _0x1d4009=_0x88b5[_0x15de8c];return _0x1d4009;};'use strict';var _=require('lodash');var util=require(_0x588b('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x588b('0x1'));var fs=require('fs');var path=require(_0x588b('0x2'));var rimraf=require(_0x588b('0x3'));var config=require(_0x588b('0x4'));var attributes=require(_0x588b('0x5'));module['exports']=function(_0xc8aeb7,_0x20dda9){return _0xc8aeb7[_0x588b('0x6')]('AnalyticTreeReport',attributes,{'tableName':_0x588b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x471c=['./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x471c,0xad));var _0xc471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc471('0x0'));var util=require(_0xc471('0x1'));var logger=require(_0xc471('0x2'))('api');var moment=require(_0xc471('0x3'));var BPromise=require(_0xc471('0x4'));var rp=require(_0xc471('0x5'));var fs=require('fs');var path=require(_0xc471('0x6'));var rimraf=require(_0xc471('0x7'));var config=require(_0xc471('0x8'));var attributes=require(_0xc471('0x9'));module[_0xc471('0xa')]=function(_0x1ed31e,_0x4b738e){return _0x1ed31e[_0xc471('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xc471('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index e3e3de9..a5c9fae 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(_0x2066e2,_0x46279e){var _0xfc938d=function(_0x3a507c){while(--_0x3a507c){_0x2066e2['push'](_0x2066e2['shift']());}};_0xfc938d(++_0x46279e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5ca7d6,_0x192729){_0x5ca7d6=_0x5ca7d6-0x0;var _0x3bdf92=_0x7a54[_0x5ca7d6];return _0x3bdf92;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 6390487..10041f5 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 _0x6cf7=['show','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','get','isAuthenticated','index'];(function(_0x51ac09,_0x383098){var _0x3f827d=function(_0x2d8d0f){while(--_0x2d8d0f){_0x51ac09['push'](_0x51ac09['shift']());}};_0x3f827d(++_0x383098);}(_0x6cf7,0x1e7));var _0x76cf=function(_0x2f48e9,_0x1bd1b4){_0x2f48e9=_0x2f48e9-0x0;var _0x34d5bb=_0x6cf7[_0x2f48e9];return _0x34d5bb;};'use strict';var multer=require(_0x76cf('0x0'));var util=require(_0x76cf('0x1'));var path=require(_0x76cf('0x2'));var timeout=require(_0x76cf('0x3'));var express=require('express');var router=express[_0x76cf('0x4')]();var fs_extra=require(_0x76cf('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x76cf('0x6')]('/',auth[_0x76cf('0x7')](),controller[_0x76cf('0x8')]);router[_0x76cf('0x6')]('/:id',auth[_0x76cf('0x7')](),controller[_0x76cf('0x9')]);router[_0x76cf('0xa')]('/',auth['isAuthenticated'](),controller[_0x76cf('0xb')]);router[_0x76cf('0xc')](_0x76cf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x76cf('0xe')](_0x76cf('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x76cf('0xf')]=router;
\ No newline at end of file
+var _0x2478=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x21a8a4,_0x2d5e00){var _0x21cc22=function(_0x2ab59d){while(--_0x2ab59d){_0x21a8a4['push'](_0x21a8a4['shift']());}};_0x21cc22(++_0x2d5e00);}(_0x2478,0xf7));var _0x8247=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x2478[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require(_0x8247('0x0'));var util=require('util');var path=require(_0x8247('0x1'));var timeout=require(_0x8247('0x2'));var express=require(_0x8247('0x3'));var router=express[_0x8247('0x4')]();var fs_extra=require(_0x8247('0x5'));var auth=require(_0x8247('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8247('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x8247('0x8')]('/',auth[_0x8247('0x9')](),controller[_0x8247('0xa')]);router[_0x8247('0x8')](_0x8247('0xb'),auth[_0x8247('0x9')](),controller[_0x8247('0xc')]);router[_0x8247('0xd')]('/',auth[_0x8247('0x9')](),controller[_0x8247('0xe')]);router['put']('/:id',auth[_0x8247('0x9')](),controller[_0x8247('0xf')]);router['delete']('/:id',auth[_0x8247('0x9')](),controller[_0x8247('0x10')]);module[_0x8247('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 6498c6a..27ad72b 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 _0x0cd6=['exports','STRING','sequelize'];(function(_0x139c24,_0x562ba1){var _0xed1b28=function(_0x3d0f24){while(--_0x3d0f24){_0x139c24['push'](_0x139c24['shift']());}};_0xed1b28(++_0x562ba1);}(_0x0cd6,0x113));var _0x60cd=function(_0x1cec84,_0x101ec2){_0x1cec84=_0x1cec84-0x0;var _0x12b7d3=_0x0cd6[_0x1cec84];return _0x12b7d3;};'use strict';var Sequelize=require(_0x60cd('0x0'));module[_0x60cd('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x60cd('0x2')]},'type':{'type':Sequelize[_0x60cd('0x2')]}};
\ No newline at end of file
+var _0x0328=['STRING','sequelize','exports'];(function(_0x54cc03,_0xe6c22b){var _0x133344=function(_0x2063d7){while(--_0x2063d7){_0x54cc03['push'](_0x54cc03['shift']());}};_0x133344(++_0xe6c22b);}(_0x0328,0x172));var _0x8032=function(_0x31eac8,_0x2bc0f4){_0x31eac8=_0x31eac8-0x0;var _0x37bb59=_0x0328[_0x31eac8];return _0x37bb59;};'use strict';var Sequelize=require(_0x8032('0x0'));module[_0x8032('0x1')]={'name':{'type':Sequelize[_0x8032('0x2')]},'basename':{'type':Sequelize[_0x8032('0x2')]},'type':{'type':Sequelize[_0x8032('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index e5041f9..11c949b 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 _0xe795=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','fields','omit','createdAt','updatedAt','body','create','update','file','originalname','basename','filename','download','join','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xe795,0x9e));var _0x5e79=function(_0x28d109,_0x33d022){_0x28d109=_0x28d109-0x0;var _0x3d6d28=_0xe795[_0x28d109];return _0x3d6d28;};'use strict';var emlformat=require(_0x5e79('0x0'));var rimraf=require(_0x5e79('0x1'));var zipdir=require(_0x5e79('0x2'));var jsonpatch=require(_0x5e79('0x3'));var rp=require(_0x5e79('0x4'));var moment=require(_0x5e79('0x5'));var BPromise=require(_0x5e79('0x6'));var Mustache=require(_0x5e79('0x7'));var util=require(_0x5e79('0x8'));var path=require(_0x5e79('0x9'));var sox=require(_0x5e79('0xa'));var csv=require(_0x5e79('0xb'));var ejs=require(_0x5e79('0xc'));var fs=require('fs');var fs_extra=require(_0x5e79('0xd'));var _=require(_0x5e79('0xe'));var squel=require('squel');var crypto=require(_0x5e79('0xf'));var jsforce=require(_0x5e79('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5e79('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e79('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5e79('0x12'));var as=require(_0x5e79('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5e79('0x14'));var config=require(_0x5e79('0x15'));var licenseUtil=require(_0x5e79('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x435565,_0x41e1d6){_0x41e1d6=_0x41e1d6||0xcc;return function(_0x23bed6){if(_0x23bed6){return _0x435565[_0x5e79('0x17')](_0x41e1d6);}return _0x435565[_0x5e79('0x18')](_0x41e1d6)[_0x5e79('0x19')]();};}function respondWithResult(_0x37a90d,_0x1bba85){_0x1bba85=_0x1bba85||0xc8;return function(_0x1c1d68){if(_0x1c1d68){return _0x37a90d[_0x5e79('0x18')](_0x1bba85)[_0x5e79('0x1a')](_0x1c1d68);}};}function respondWithFilteredResult(_0x52e409,_0x121509){return function(_0x19f481){if(_0x19f481){var _0x375967=typeof _0x121509[_0x5e79('0x1b')]===_0x5e79('0x1c')&&typeof _0x121509[_0x5e79('0x1d')]===_0x5e79('0x1c');var _0x594c64=_0x19f481['count'];var _0x5c0d57=_0x375967?0x0:_0x121509[_0x5e79('0x1b')];var _0x32573e=_0x375967?_0x19f481[_0x5e79('0x1e')]:_0x121509[_0x5e79('0x1b')]+_0x121509[_0x5e79('0x1d')];var _0x4206ab;if(_0x32573e>=_0x594c64){_0x32573e=_0x594c64;_0x4206ab=0xc8;}else{_0x4206ab=0xce;}_0x52e409['status'](_0x4206ab);return _0x52e409[_0x5e79('0x1f')](_0x5e79('0x20'),_0x5c0d57+'-'+_0x32573e+'/'+_0x594c64)[_0x5e79('0x1a')](_0x19f481);}return null;};}function patchUpdates(_0x23fa17){return function(_0x1e9a09){try{jsonpatch[_0x5e79('0x21')](_0x1e9a09,_0x23fa17,!![]);}catch(_0x1a9beb){return BPromise['reject'](_0x1a9beb);}return _0x1e9a09[_0x5e79('0x22')]();};}function saveUpdates(_0xfb3c01,_0x40fa2d){return function(_0x3ee581){if(_0x3ee581){return _0x3ee581['update'](_0xfb3c01)[_0x5e79('0x23')](function(_0x114784){return _0x114784;});}return null;};}function removeEntity(_0x5a5dcd,_0x3c7233){return function(_0x5465ce){if(_0x5465ce){return _0x5465ce[_0x5e79('0x24')]()[_0x5e79('0x23')](function(){_0x5a5dcd[_0x5e79('0x18')](0xcc)[_0x5e79('0x19')]();});}};}function handleEntityNotFound(_0x526d47,_0x315f5f){return function(_0x13b680){if(!_0x13b680){_0x526d47[_0x5e79('0x17')](0x194);}return _0x13b680;};}function handleError(_0x30ec68,_0x59e2e3){_0x59e2e3=_0x59e2e3||0x1f4;return function(_0x36b8c9){logger[_0x5e79('0x25')](_0x36b8c9[_0x5e79('0x26')]);if(_0x36b8c9[_0x5e79('0x27')]){delete _0x36b8c9['name'];}_0x30ec68[_0x5e79('0x18')](_0x59e2e3)[_0x5e79('0x28')](_0x36b8c9);};}exports[_0x5e79('0x29')]=function(_0x304eae,_0x500b7b){var _0xe16c2a={},_0x222f39={},_0x3a2601={'count':0x0,'rows':[]};var _0x5ca9af=_[_0x5e79('0x2a')](db[_0x5e79('0x2b')][_0x5e79('0x2c')],function(_0x2409a1){return{'name':_0x2409a1['fieldName'],'type':_0x2409a1[_0x5e79('0x2d')]['key']};});_0x222f39[_0x5e79('0x2e')]=_[_0x5e79('0x2a')](_0x5ca9af,_0x5e79('0x27'));_0x222f39[_0x5e79('0x2f')]=_[_0x5e79('0x30')](_0x304eae[_0x5e79('0x2f')]);_0x222f39[_0x5e79('0x31')]=_[_0x5e79('0x32')](_0x222f39['model'],_0x222f39['query']);_0xe16c2a[_0x5e79('0x33')]=_[_0x5e79('0x32')](_0x222f39[_0x5e79('0x2e')],qs['fields'](_0x304eae[_0x5e79('0x2f')]['fields']));_0xe16c2a['attributes']=_0xe16c2a[_0x5e79('0x33')][_0x5e79('0x34')]?_0xe16c2a[_0x5e79('0x33')]:_0x222f39[_0x5e79('0x2e')];if(!_0x304eae[_0x5e79('0x2f')][_0x5e79('0x35')](_0x5e79('0x36'))){_0xe16c2a[_0x5e79('0x1d')]=qs['limit'](_0x304eae['query'][_0x5e79('0x1d')]);_0xe16c2a['offset']=qs[_0x5e79('0x1b')](_0x304eae['query']['offset']);}_0xe16c2a[_0x5e79('0x37')]=qs['sort'](_0x304eae['query'][_0x5e79('0x38')]);_0xe16c2a[_0x5e79('0x39')]=qs['filters'](_[_0x5e79('0x3a')](_0x304eae[_0x5e79('0x2f')],_0x222f39[_0x5e79('0x31')]),_0x5ca9af);if(_0x304eae[_0x5e79('0x2f')][_0x5e79('0x3b')]){_0xe16c2a[_0x5e79('0x39')]=_[_0x5e79('0x3c')](_0xe16c2a[_0x5e79('0x39')],{'$or':_[_0x5e79('0x2a')](_0x5ca9af,function(_0x2d074d){if(_0x2d074d[_0x5e79('0x2d')]!=='VIRTUAL'){var _0x5d0ff7={};_0x5d0ff7[_0x2d074d[_0x5e79('0x27')]]={'$like':'%'+_0x304eae[_0x5e79('0x2f')][_0x5e79('0x3b')]+'%'};return _0x5d0ff7;}})});}_0xe16c2a=_[_0x5e79('0x3c')]({},_0xe16c2a,_0x304eae[_0x5e79('0x3d')]);var _0x16dfd7={'where':_0xe16c2a[_0x5e79('0x39')]};return db[_0x5e79('0x2b')][_0x5e79('0x1e')](_0x16dfd7)['then'](function(_0xf02b8d){_0x3a2601[_0x5e79('0x1e')]=_0xf02b8d;if(_0x304eae[_0x5e79('0x2f')][_0x5e79('0x3e')]){_0xe16c2a[_0x5e79('0x3f')]=[{'all':!![]}];}return db[_0x5e79('0x2b')][_0x5e79('0x40')](_0xe16c2a);})['then'](function(_0x52eda7){_0x3a2601[_0x5e79('0x41')]=_0x52eda7;return _0x3a2601;})[_0x5e79('0x23')](respondWithFilteredResult(_0x500b7b,_0xe16c2a))[_0x5e79('0x42')](handleError(_0x500b7b,null));};exports[_0x5e79('0x43')]=function(_0x1d2233,_0x459415){var _0x407fb9={'raw':!![],'where':{'id':_0x1d2233[_0x5e79('0x44')]['id']}},_0x4ea6cc={};_0x4ea6cc[_0x5e79('0x2e')]=_[_0x5e79('0x30')](db[_0x5e79('0x2b')]['rawAttributes']);_0x4ea6cc['query']=_[_0x5e79('0x30')](_0x1d2233[_0x5e79('0x2f')]);_0x4ea6cc[_0x5e79('0x31')]=_[_0x5e79('0x32')](_0x4ea6cc['model'],_0x4ea6cc[_0x5e79('0x2f')]);_0x407fb9[_0x5e79('0x33')]=_[_0x5e79('0x32')](_0x4ea6cc['model'],qs['fields'](_0x1d2233['query']['fields']));_0x407fb9[_0x5e79('0x33')]=_0x407fb9[_0x5e79('0x33')]['length']?_0x407fb9[_0x5e79('0x33')]:_0x4ea6cc[_0x5e79('0x2e')];if(_0x1d2233[_0x5e79('0x2f')][_0x5e79('0x3e')]){_0x407fb9[_0x5e79('0x3f')]=[{'all':!![]}];}_0x407fb9=_[_0x5e79('0x3c')]({},_0x407fb9,_0x1d2233[_0x5e79('0x3d')]);return db[_0x5e79('0x2b')][_0x5e79('0x45')](_0x407fb9)['then'](handleEntityNotFound(_0x459415,null))['then'](respondWithResult(_0x459415,null))[_0x5e79('0x42')](handleError(_0x459415,null));};exports['clone']=function(_0x4313f6,_0xab0f00){var _0x1a776d={'where':{'id':_0x4313f6['params']['id']}},_0xa8092d={};_0xa8092d['model']=_[_0x5e79('0x30')](db['Attachment']['rawAttributes']);_0x1a776d[_0x5e79('0x33')]=_[_0x5e79('0x32')](_0xa8092d[_0x5e79('0x2e')],qs[_0x5e79('0x46')](_0x4313f6[_0x5e79('0x2f')][_0x5e79('0x46')]));_0x1a776d[_0x5e79('0x33')]=_0x1a776d['attributes'][_0x5e79('0x34')]?_0x1a776d[_0x5e79('0x33')]:_0xa8092d['model'];if(_0x4313f6[_0x5e79('0x2f')][_0x5e79('0x3e')]){_0x1a776d[_0x5e79('0x3f')]=[{'all':!![]}];}_0x1a776d=_[_0x5e79('0x3c')]({},_0x1a776d,_0x4313f6[_0x5e79('0x3d')]);return db['Attachment'][_0x5e79('0x45')](_0x1a776d)['then'](handleEntityNotFound(_0xab0f00,null))[_0x5e79('0x23')](function(_0x105e5b){if(_0x105e5b){var _0x44d670=_0x105e5b['get']({'plain':!![]});_0x44d670=qs[_0x5e79('0x47')](_0x44d670,['id',_0x5e79('0x48'),_0x5e79('0x49')]);_0x4313f6[_0x5e79('0x4a')]=_[_0x5e79('0x47')](_0x4313f6['body'],['id','createdAt','updatedAt']);return db['Attachment'][_0x5e79('0x4b')](_[_0x5e79('0x3c')](_0x44d670,_0x4313f6[_0x5e79('0x4a')]),{'include':_0x4313f6[_0x5e79('0x2f')][_0x5e79('0x3e')]?[{'all':!![]}]:undefined});}})[_0x5e79('0x23')](respondWithResult(_0xab0f00,0xc9))[_0x5e79('0x42')](handleError(_0xab0f00,null));};exports[_0x5e79('0x4c')]=function(_0x479827,_0x3b15b1){if(_0x479827[_0x5e79('0x4a')]['id']){delete _0x479827[_0x5e79('0x4a')]['id'];}return db['Attachment']['find']({'where':{'id':_0x479827[_0x5e79('0x44')]['id']}})[_0x5e79('0x23')](handleEntityNotFound(_0x3b15b1,null))[_0x5e79('0x23')](saveUpdates(_0x479827[_0x5e79('0x4a')],null))[_0x5e79('0x23')](respondWithResult(_0x3b15b1,null))[_0x5e79('0x42')](handleError(_0x3b15b1,null));};exports[_0x5e79('0x24')]=function(_0x534d76,_0x3388f0){return db[_0x5e79('0x2b')]['find']({'where':{'id':_0x534d76[_0x5e79('0x44')]['id']}})[_0x5e79('0x23')](handleEntityNotFound(_0x3388f0,null))[_0x5e79('0x23')](removeEntity(_0x3388f0,null))[_0x5e79('0x42')](handleError(_0x3388f0,null));};exports[_0x5e79('0x4b')]=function(_0x3b6aca,_0x45323f,_0x5fd723){_0x3b6aca[_0x5e79('0x4a')]['name']=_0x3b6aca[_0x5e79('0x4d')][_0x5e79('0x4e')];_0x3b6aca[_0x5e79('0x4a')][_0x5e79('0x4f')]=_0x3b6aca[_0x5e79('0x4d')][_0x5e79('0x50')];_0x3b6aca[_0x5e79('0x4a')][_0x5e79('0x2d')]=_0x3b6aca[_0x5e79('0x4d')]['mimetype'];return db[_0x5e79('0x2b')][_0x5e79('0x4b')](_0x3b6aca[_0x5e79('0x4a')])[_0x5e79('0x23')](respondWithResult(_0x45323f,0xc9))[_0x5e79('0x42')](handleError(_0x45323f,null));};exports[_0x5e79('0x51')]=function(_0x3268d4,_0x50b652,_0xea2410){return db['Attachment']['findOne']({'where':{'id':_0x3268d4[_0x5e79('0x44')]['id']},'raw':!![]})[_0x5e79('0x23')](handleEntityNotFound(_0x50b652,null))[_0x5e79('0x23')](function(_0x18413c){if(_0x18413c){var _0x12ad94=_0x18413c['ChatOfflineMessageId']!==null;var _0x2a5dcb=path[_0x5e79('0x52')](config[_0x5e79('0x53')],'server/files/attachments/');if(_0x12ad94){_0x2a5dcb=path[_0x5e79('0x52')](_0x2a5dcb,'offline-chat/');}var _0x4f0e63=path[_0x5e79('0x52')](_0x2a5dcb,_0x18413c[_0x5e79('0x4f')]);return _0x50b652[_0x5e79('0x51')](_0x4f0e63);}})[_0x5e79('0x42')](handleError(_0x50b652,null));};
\ No newline at end of file
+var _0x9299=['update','destroy','then','error','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','findAll','rows','catch','show','params','includeAll','include','find','get','omit','createdAt','updatedAt','body','create','originalname','basename','file','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save'];(function(_0x915de9,_0xabf9e5){var _0x274129=function(_0x27fd79){while(--_0x27fd79){_0x915de9['push'](_0x915de9['shift']());}};_0x274129(++_0xabf9e5);}(_0x9299,0x139));var _0x9929=function(_0x3f0e54,_0x549b1d){_0x3f0e54=_0x3f0e54-0x0;var _0x2e8036=_0x9299[_0x3f0e54];return _0x2e8036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9929('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9929('0x1'));var rp=require('request-promise');var moment=require(_0x9929('0x2'));var BPromise=require(_0x9929('0x3'));var Mustache=require(_0x9929('0x4'));var util=require(_0x9929('0x5'));var path=require(_0x9929('0x6'));var sox=require('sox');var csv=require(_0x9929('0x7'));var ejs=require(_0x9929('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9929('0x9'));var squel=require(_0x9929('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9929('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9929('0xc'));var Papa=require(_0x9929('0xd'));var Redis=require(_0x9929('0xe'));var authService=require(_0x9929('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9929('0x10'));var hardwareService=require(_0x9929('0x11'));var logger=require('../../config/logger')(_0x9929('0x12'));var utils=require(_0x9929('0x13'));var config=require(_0x9929('0x14'));var licenseUtil=require(_0x9929('0x15'));var db=require(_0x9929('0x16'))['db'];function respondWithStatusCode(_0x28a7a5,_0x1d2565){_0x1d2565=_0x1d2565||0xcc;return function(_0x45c8be){if(_0x45c8be){return _0x28a7a5[_0x9929('0x17')](_0x1d2565);}return _0x28a7a5[_0x9929('0x18')](_0x1d2565)[_0x9929('0x19')]();};}function respondWithResult(_0x39b999,_0x37ae0b){_0x37ae0b=_0x37ae0b||0xc8;return function(_0xcfc6c4){if(_0xcfc6c4){return _0x39b999[_0x9929('0x18')](_0x37ae0b)[_0x9929('0x1a')](_0xcfc6c4);}};}function respondWithFilteredResult(_0x5d41e5,_0x2266c){return function(_0x2dffb8){if(_0x2dffb8){var _0xc1300=typeof _0x2266c[_0x9929('0x1b')]===_0x9929('0x1c')&&typeof _0x2266c['limit']===_0x9929('0x1c');var _0x2ffd4b=_0x2dffb8[_0x9929('0x1d')];var _0x280c7b=_0xc1300?0x0:_0x2266c[_0x9929('0x1b')];var _0x254847=_0xc1300?_0x2dffb8[_0x9929('0x1d')]:_0x2266c[_0x9929('0x1b')]+_0x2266c[_0x9929('0x1e')];var _0x3c31fc;if(_0x254847>=_0x2ffd4b){_0x254847=_0x2ffd4b;_0x3c31fc=0xc8;}else{_0x3c31fc=0xce;}_0x5d41e5[_0x9929('0x18')](_0x3c31fc);return _0x5d41e5[_0x9929('0x1f')]('Content-Range',_0x280c7b+'-'+_0x254847+'/'+_0x2ffd4b)[_0x9929('0x1a')](_0x2dffb8);}return null;};}function patchUpdates(_0x545d05){return function(_0xb148f5){try{jsonpatch[_0x9929('0x20')](_0xb148f5,_0x545d05,!![]);}catch(_0x4446f1){return BPromise[_0x9929('0x21')](_0x4446f1);}return _0xb148f5[_0x9929('0x22')]();};}function saveUpdates(_0xf34dc6,_0x451082){return function(_0x46c830){if(_0x46c830){return _0x46c830[_0x9929('0x23')](_0xf34dc6)['then'](function(_0x36a9ee){return _0x36a9ee;});}return null;};}function removeEntity(_0x5a8dee,_0x3e3941){return function(_0x34952c){if(_0x34952c){return _0x34952c[_0x9929('0x24')]()[_0x9929('0x25')](function(){_0x5a8dee[_0x9929('0x18')](0xcc)[_0x9929('0x19')]();});}};}function handleEntityNotFound(_0x131547,_0x180b05){return function(_0x1439d9){if(!_0x1439d9){_0x131547[_0x9929('0x17')](0x194);}return _0x1439d9;};}function handleError(_0x53cc8f,_0x42e449){_0x42e449=_0x42e449||0x1f4;return function(_0x762727){logger[_0x9929('0x26')](_0x762727['stack']);if(_0x762727['name']){delete _0x762727[_0x9929('0x27')];}_0x53cc8f['status'](_0x42e449)[_0x9929('0x28')](_0x762727);};}exports[_0x9929('0x29')]=function(_0x2e878f,_0x3c3fbb){var _0x16dd9f={},_0x54cebe={},_0x5dc8a4={'count':0x0,'rows':[]};var _0x27bfcb=_[_0x9929('0x2a')](db[_0x9929('0x2b')][_0x9929('0x2c')],function(_0x2b339b){return{'name':_0x2b339b[_0x9929('0x2d')],'type':_0x2b339b[_0x9929('0x2e')][_0x9929('0x2f')]};});_0x54cebe[_0x9929('0x30')]=_['map'](_0x27bfcb,_0x9929('0x27'));_0x54cebe[_0x9929('0x31')]=_[_0x9929('0x32')](_0x2e878f[_0x9929('0x31')]);_0x54cebe['filters']=_[_0x9929('0x33')](_0x54cebe[_0x9929('0x30')],_0x54cebe[_0x9929('0x31')]);_0x16dd9f[_0x9929('0x34')]=_[_0x9929('0x33')](_0x54cebe[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2e878f[_0x9929('0x31')]['fields']));_0x16dd9f[_0x9929('0x34')]=_0x16dd9f[_0x9929('0x34')][_0x9929('0x36')]?_0x16dd9f[_0x9929('0x34')]:_0x54cebe['model'];if(!_0x2e878f[_0x9929('0x31')][_0x9929('0x37')](_0x9929('0x38'))){_0x16dd9f['limit']=qs['limit'](_0x2e878f['query'][_0x9929('0x1e')]);_0x16dd9f[_0x9929('0x1b')]=qs['offset'](_0x2e878f[_0x9929('0x31')][_0x9929('0x1b')]);}_0x16dd9f[_0x9929('0x39')]=qs[_0x9929('0x3a')](_0x2e878f[_0x9929('0x31')][_0x9929('0x3a')]);_0x16dd9f[_0x9929('0x3b')]=qs[_0x9929('0x3c')](_['pick'](_0x2e878f[_0x9929('0x31')],_0x54cebe[_0x9929('0x3c')]),_0x27bfcb);if(_0x2e878f[_0x9929('0x31')]['filter']){_0x16dd9f[_0x9929('0x3b')]=_[_0x9929('0x3d')](_0x16dd9f[_0x9929('0x3b')],{'$or':_[_0x9929('0x2a')](_0x27bfcb,function(_0x50d358){if(_0x50d358['type']!=='VIRTUAL'){var _0x59cbd6={};_0x59cbd6[_0x50d358['name']]={'$like':'%'+_0x2e878f[_0x9929('0x31')][_0x9929('0x3e')]+'%'};return _0x59cbd6;}})});}_0x16dd9f=_[_0x9929('0x3d')]({},_0x16dd9f,_0x2e878f[_0x9929('0x3f')]);var _0x3cb8fb={'where':_0x16dd9f[_0x9929('0x3b')]};return db['Attachment'][_0x9929('0x1d')](_0x3cb8fb)['then'](function(_0x1d4f33){_0x5dc8a4[_0x9929('0x1d')]=_0x1d4f33;if(_0x2e878f[_0x9929('0x31')]['includeAll']){_0x16dd9f['include']=[{'all':!![]}];}return db[_0x9929('0x2b')][_0x9929('0x40')](_0x16dd9f);})[_0x9929('0x25')](function(_0x4bddc8){_0x5dc8a4[_0x9929('0x41')]=_0x4bddc8;return _0x5dc8a4;})[_0x9929('0x25')](respondWithFilteredResult(_0x3c3fbb,_0x16dd9f))[_0x9929('0x42')](handleError(_0x3c3fbb,null));};exports[_0x9929('0x43')]=function(_0x2ea689,_0x40ae53){var _0x21d7ed={'raw':!![],'where':{'id':_0x2ea689[_0x9929('0x44')]['id']}},_0x244e03={};_0x244e03[_0x9929('0x30')]=_[_0x9929('0x32')](db['Attachment'][_0x9929('0x2c')]);_0x244e03[_0x9929('0x31')]=_[_0x9929('0x32')](_0x2ea689['query']);_0x244e03[_0x9929('0x3c')]=_[_0x9929('0x33')](_0x244e03[_0x9929('0x30')],_0x244e03[_0x9929('0x31')]);_0x21d7ed[_0x9929('0x34')]=_[_0x9929('0x33')](_0x244e03[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2ea689[_0x9929('0x31')][_0x9929('0x35')]));_0x21d7ed[_0x9929('0x34')]=_0x21d7ed[_0x9929('0x34')][_0x9929('0x36')]?_0x21d7ed[_0x9929('0x34')]:_0x244e03[_0x9929('0x30')];if(_0x2ea689[_0x9929('0x31')][_0x9929('0x45')]){_0x21d7ed[_0x9929('0x46')]=[{'all':!![]}];}_0x21d7ed=_[_0x9929('0x3d')]({},_0x21d7ed,_0x2ea689[_0x9929('0x3f')]);return db[_0x9929('0x2b')][_0x9929('0x47')](_0x21d7ed)[_0x9929('0x25')](handleEntityNotFound(_0x40ae53,null))[_0x9929('0x25')](respondWithResult(_0x40ae53,null))['catch'](handleError(_0x40ae53,null));};exports['clone']=function(_0x2c223f,_0x15a2ba){var _0x98fae1={'where':{'id':_0x2c223f[_0x9929('0x44')]['id']}},_0x2f352b={};_0x2f352b[_0x9929('0x30')]=_['keys'](db['Attachment'][_0x9929('0x2c')]);_0x98fae1[_0x9929('0x34')]=_[_0x9929('0x33')](_0x2f352b[_0x9929('0x30')],qs[_0x9929('0x35')](_0x2c223f[_0x9929('0x31')][_0x9929('0x35')]));_0x98fae1['attributes']=_0x98fae1[_0x9929('0x34')][_0x9929('0x36')]?_0x98fae1[_0x9929('0x34')]:_0x2f352b[_0x9929('0x30')];if(_0x2c223f[_0x9929('0x31')][_0x9929('0x45')]){_0x98fae1['include']=[{'all':!![]}];}_0x98fae1=_[_0x9929('0x3d')]({},_0x98fae1,_0x2c223f[_0x9929('0x3f')]);return db[_0x9929('0x2b')]['find'](_0x98fae1)[_0x9929('0x25')](handleEntityNotFound(_0x15a2ba,null))['then'](function(_0x2c8d3e){if(_0x2c8d3e){var _0x587b78=_0x2c8d3e[_0x9929('0x48')]({'plain':!![]});_0x587b78=qs[_0x9929('0x49')](_0x587b78,['id',_0x9929('0x4a'),_0x9929('0x4b')]);_0x2c223f[_0x9929('0x4c')]=_['omit'](_0x2c223f[_0x9929('0x4c')],['id',_0x9929('0x4a'),'updatedAt']);return db[_0x9929('0x2b')]['create'](_['merge'](_0x587b78,_0x2c223f['body']),{'include':_0x2c223f[_0x9929('0x31')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x9929('0x25')](respondWithResult(_0x15a2ba,0xc9))[_0x9929('0x42')](handleError(_0x15a2ba,null));};exports[_0x9929('0x23')]=function(_0x1f9974,_0x2423c3){if(_0x1f9974[_0x9929('0x4c')]['id']){delete _0x1f9974[_0x9929('0x4c')]['id'];}return db[_0x9929('0x2b')][_0x9929('0x47')]({'where':{'id':_0x1f9974[_0x9929('0x44')]['id']}})[_0x9929('0x25')](handleEntityNotFound(_0x2423c3,null))[_0x9929('0x25')](saveUpdates(_0x1f9974['body'],null))[_0x9929('0x25')](respondWithResult(_0x2423c3,null))[_0x9929('0x42')](handleError(_0x2423c3,null));};exports['destroy']=function(_0x491c75,_0x20c283){return db['Attachment']['find']({'where':{'id':_0x491c75[_0x9929('0x44')]['id']}})[_0x9929('0x25')](handleEntityNotFound(_0x20c283,null))[_0x9929('0x25')](removeEntity(_0x20c283,null))[_0x9929('0x42')](handleError(_0x20c283,null));};exports[_0x9929('0x4d')]=function(_0xcd6fa9,_0x569eaf,_0x1dd8b2){_0xcd6fa9['body'][_0x9929('0x27')]=_0xcd6fa9['file'][_0x9929('0x4e')];_0xcd6fa9[_0x9929('0x4c')][_0x9929('0x4f')]=_0xcd6fa9[_0x9929('0x50')]['filename'];_0xcd6fa9['body'][_0x9929('0x2e')]=_0xcd6fa9[_0x9929('0x50')][_0x9929('0x51')];return db[_0x9929('0x2b')]['create'](_0xcd6fa9[_0x9929('0x4c')])['then'](respondWithResult(_0x569eaf,0xc9))['catch'](handleError(_0x569eaf,null));};exports[_0x9929('0x52')]=function(_0x1330a9,_0x3a236c,_0x5a0600){return db[_0x9929('0x2b')][_0x9929('0x53')]({'where':{'id':_0x1330a9[_0x9929('0x44')]['id']},'raw':!![]})[_0x9929('0x25')](handleEntityNotFound(_0x3a236c,null))[_0x9929('0x25')](function(_0xc1b10a){if(_0xc1b10a){var _0x465201=_0xc1b10a[_0x9929('0x54')]!==null;var _0x3f031b=path[_0x9929('0x55')](config['root'],_0x9929('0x56'));if(_0x465201){_0x3f031b=path['join'](_0x3f031b,'offline-chat/');}var _0x49581f=path[_0x9929('0x55')](_0x3f031b,_0xc1b10a[_0x9929('0x4f')]);return _0x3a236c[_0x9929('0x52')](_0x49581f);}})['catch'](handleError(_0x3a236c,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index b83a0bc..fcdaa0f 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 _0x2173=['exports','define','Attachment','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./attachment.attributes'];(function(_0x5509de,_0x17aefa){var _0x44a07c=function(_0x123ad1){while(--_0x123ad1){_0x5509de['push'](_0x5509de['shift']());}};_0x44a07c(++_0x17aefa);}(_0x2173,0xea));var _0x3217=function(_0x4bc4d1,_0x3cfc27){_0x4bc4d1=_0x4bc4d1-0x0;var _0x4dc5a8=_0x2173[_0x4bc4d1];return _0x4dc5a8;};'use strict';var _=require(_0x3217('0x0'));var util=require(_0x3217('0x1'));var logger=require(_0x3217('0x2'))(_0x3217('0x3'));var moment=require(_0x3217('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3217('0x5'));var config=require(_0x3217('0x6'));var attributes=require(_0x3217('0x7'));module[_0x3217('0x8')]=function(_0xa4cd6a,_0x3e168d){return _0xa4cd6a[_0x3217('0x9')](_0x3217('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb88d=['./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3dbf5a,_0x4613fc){var _0x5e83a8=function(_0x523916){while(--_0x523916){_0x3dbf5a['push'](_0x3dbf5a['shift']());}};_0x5e83a8(++_0x4613fc);}(_0xb88d,0x101));var _0xdb88=function(_0x57e05f,_0x318b8d){_0x57e05f=_0x57e05f-0x0;var _0x435e54=_0xb88d[_0x57e05f];return _0x435e54;};'use strict';var _=require('lodash');var util=require(_0xdb88('0x0'));var logger=require(_0xdb88('0x1'))(_0xdb88('0x2'));var moment=require(_0xdb88('0x3'));var BPromise=require(_0xdb88('0x4'));var rp=require(_0xdb88('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdb88('0x6'));var attributes=require(_0xdb88('0x7'));module[_0xdb88('0x8')]=function(_0x265c6f,_0x5439c8){return _0x265c6f[_0xdb88('0x9')](_0xdb88('0xa'),attributes,{'tableName':_0xdb88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 693b129..e75caaf 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 _0xe205=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateAttachment','Attachment','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x22959f,_0x38b2ab){var _0xa24fce=function(_0x5297ef){while(--_0x5297ef){_0x22959f['push'](_0x22959f['shift']());}};_0xa24fce(++_0x38b2ab);}(_0xe205,0xa7));var _0x5e20=function(_0x1eb3b0,_0x84bc40){_0x1eb3b0=_0x1eb3b0-0x0;var _0xbecd61=_0xe205[_0x1eb3b0];return _0xbecd61;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var moment=require(_0x5e20('0x2'));var BPromise=require(_0x5e20('0x3'));var rs=require(_0x5e20('0x4'));var fs=require('fs');var Redis=require(_0x5e20('0x5'));var db=require(_0x5e20('0x6'))['db'];var utils=require(_0x5e20('0x7'));var logger=require(_0x5e20('0x8'))('rpc');var config=require(_0x5e20('0x9'));var jayson=require(_0x5e20('0xa'));var client=jayson[_0x5e20('0xb')][_0x5e20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5eca5c,_0x4cc88d,_0x3a382f){return new BPromise(function(_0x4c9332,_0x533e18){return client[_0x5e20('0xd')](_0x5eca5c,_0x3a382f)[_0x5e20('0xe')](function(_0x5c1eee){logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));logger[_0x5e20('0x12')]('Attachment,\x20%s,\x20%s,\x20%s',_0x4cc88d,_0x5e20('0x11'),JSON[_0x5e20('0x13')](_0x5c1eee));if(_0x5c1eee[_0x5e20('0x14')]){if(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x15')]===0x1f4){logger[_0x5e20('0x14')]('Attachment,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);return _0x533e18(_0x5c1eee[_0x5e20('0x14')]['message']);}logger[_0x5e20('0x14')]('Attachment,\x20%s,\x20%s',_0x4cc88d,_0x5c1eee[_0x5e20('0x14')]['message']);return _0x4c9332(_0x5c1eee[_0x5e20('0x14')][_0x5e20('0x16')]);}else{logger[_0x5e20('0xf')](_0x5e20('0x10'),_0x4cc88d,_0x5e20('0x11'));_0x4c9332(_0x5c1eee['result'][_0x5e20('0x16')]);}})[_0x5e20('0x17')](function(_0x166ffd){logger[_0x5e20('0x14')](_0x5e20('0x10'),_0x4cc88d,_0x166ffd);_0x533e18(_0x166ffd);});});}exports[_0x5e20('0x18')]=function(_0x1cc706){var _0xf3488f=this;return new Promise(function(_0x4d3e4a,_0x434686){return db[_0x5e20('0x19')]['create'](_0x1cc706[_0x5e20('0x1a')],{'raw':_0x1cc706[_0x5e20('0x1b')]?_0x1cc706[_0x5e20('0x1b')][_0x5e20('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2954fc){logger['info']('CreateAttachment',_0x1cc706);logger['debug']('CreateAttachment',_0x1cc706,JSON[_0x5e20('0x13')](_0x2954fc));_0x4d3e4a(_0x2954fc);})['catch'](function(_0x3d89e4){logger[_0x5e20('0x14')](_0x5e20('0x18'),_0x3d89e4[_0x5e20('0x16')],_0x1cc706);_0x434686(_0xf3488f[_0x5e20('0x14')](0x1f4,_0x3d89e4[_0x5e20('0x16')]));});});};
\ No newline at end of file
+var _0x89e8=['then','debug','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x89e8,0x74));var _0x889e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x89e8[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed85f,_0x38eeae,_0x54f734){return new BPromise(function(_0x2bfae4,_0x42be62){return client[_0x889e('0xb')](_0x5ed85f,_0x54f734)['then'](function(_0x21c1d9){logger[_0x889e('0xc')](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));logger['debug'](_0x889e('0xf'),_0x38eeae,_0x889e('0xe'),JSON['stringify'](_0x21c1d9));if(_0x21c1d9[_0x889e('0x10')]){if(_0x21c1d9[_0x889e('0x10')][_0x889e('0x11')]===0x1f4){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x42be62(_0x21c1d9[_0x889e('0x10')]['message']);}logger[_0x889e('0x10')](_0x889e('0xd'),_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x2bfae4(_0x21c1d9[_0x889e('0x10')]['message']);}else{logger['info'](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));_0x2bfae4(_0x21c1d9[_0x889e('0x13')][_0x889e('0x12')]);}})['catch'](function(_0x22fbf6){logger[_0x889e('0x10')]('Attachment,\x20%s,\x20%s',_0x38eeae,_0x22fbf6);_0x42be62(_0x22fbf6);});});}exports[_0x889e('0x14')]=function(_0x4f9b2c){var _0x75e219=this;return new Promise(function(_0x168fed,_0x232452){return db[_0x889e('0x15')][_0x889e('0x16')](_0x4f9b2c['body'],{'raw':_0x4f9b2c[_0x889e('0x17')]?_0x4f9b2c[_0x889e('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x889e('0x18')](function(_0x11abba){logger[_0x889e('0xc')]('CreateAttachment',_0x4f9b2c);logger[_0x889e('0x19')](_0x889e('0x14'),_0x4f9b2c,JSON[_0x889e('0x1a')](_0x11abba));_0x168fed(_0x11abba);})[_0x889e('0x1b')](function(_0x590b6f){logger['error'](_0x889e('0x14'),_0x590b6f[_0x889e('0x12')],_0x4f9b2c);_0x232452(_0x75e219[_0x889e('0x10')](0x1f4,_0x590b6f['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a056e19..1896395 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x3d3eb2,_0x37ef20){_0x3d3eb2=_0x3d3eb2-0x0;var _0x2d91e4=_0xdb28[_0x3d3eb2];return _0x2d91e4;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+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(_0x7ee7cd,_0x436001){var _0x3fe015=function(_0x1ded3c){while(--_0x1ded3c){_0x7ee7cd['push'](_0x7ee7cd['shift']());}};_0x3fe015(++_0x436001);}(_0xadb5,0xad));var _0x5adb=function(_0x5afa4a,_0x457160){_0x5afa4a=_0x5afa4a-0x0;var _0x1bfb61=_0xadb5[_0x5afa4a];return _0x1bfb61;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index f90dcb4..550d07e 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 _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
+var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 13c88c1..3459af4 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 _0x54ce=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x54ce,0x1c0));var _0xe54c=function(_0x412096,_0x419054){_0x412096=_0x412096-0x0;var _0xb19fdd=_0x54ce[_0x412096];return _0xb19fdd;};'use strict';var express=require(_0xe54c('0x0'));var router=express[_0xe54c('0x1')]();var controller=require(_0xe54c('0x2'));router[_0xe54c('0x3')]('/',controller[_0xe54c('0x4')]);module[_0xe54c('0x5')]=router;
\ No newline at end of file
+var _0x8e9e=['express','Router','post','login','exports'];(function(_0x54872b,_0x3eee62){var _0x45219b=function(_0x296ba6){while(--_0x296ba6){_0x54872b['push'](_0x54872b['shift']());}};_0x45219b(++_0x3eee62);}(_0x8e9e,0x10e));var _0xe8e9=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x8e9e[_0x2f3848];return _0x102668;};'use strict';var express=require(_0xe8e9('0x0'));var router=express[_0xe8e9('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xe8e9('0x2')]('/',controller[_0xe8e9('0x3')]);module[_0xe8e9('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 44fb2b2..d5ba1bb 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x5e2669,_0x4af8cc){_0x5e2669=_0x5e2669-0x0;var _0x37525d=_0x7a54[_0x5e2669];return _0x37525d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x296904,_0x3fd4d6){var _0x361105=function(_0x4ee20f){while(--_0x4ee20f){_0x296904['push'](_0x296904['shift']());}};_0x361105(++_0x3fd4d6);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 2556df5..b412242 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 _0x64c4=['./authGoogle.controller','../user/user.controller.js','get','login','callback','isMiddleware','setTokenCookie','exports','passport'];(function(_0x535f6a,_0x129fa3){var _0x5c54e8=function(_0x387a4f){while(--_0x387a4f){_0x535f6a['push'](_0x535f6a['shift']());}};_0x5c54e8(++_0x129fa3);}(_0x64c4,0x13a));var _0x464c=function(_0x400cf6,_0x682017){_0x400cf6=_0x400cf6-0x0;var _0x2a11cb=_0x64c4[_0x400cf6];return _0x2a11cb;};'use strict';var express=require('express');var passport=require(_0x464c('0x0'));var router=express['Router']();var controller=require(_0x464c('0x1'));var userController=require(_0x464c('0x2'));var authService=require('../../components/auth/service');router[_0x464c('0x3')]('/',controller[_0x464c('0x4')]);router[_0x464c('0x3')]('/callback',controller[_0x464c('0x5')],authService[_0x464c('0x6')],userController[_0x464c('0x4')],authService[_0x464c('0x7')]);module[_0x464c('0x8')]=router;
\ No newline at end of file
+var _0x6537=['./authGoogle.controller','../user/user.controller.js','/callback','callback','login','exports','express'];(function(_0x189347,_0x5b1eaa){var _0x5aee9a=function(_0x194c32){while(--_0x194c32){_0x189347['push'](_0x189347['shift']());}};_0x5aee9a(++_0x5b1eaa);}(_0x6537,0x1e2));var _0x7653=function(_0xe2a994,_0x40aa67){_0xe2a994=_0xe2a994-0x0;var _0x528ce0=_0x6537[_0xe2a994];return _0x528ce0;};'use strict';var express=require(_0x7653('0x0'));var passport=require('passport');var router=express['Router']();var controller=require(_0x7653('0x1'));var userController=require(_0x7653('0x2'));var authService=require('../../components/auth/service');router['get']('/',controller['login']);router['get'](_0x7653('0x3'),controller[_0x7653('0x4')],authService['isMiddleware'],userController[_0x7653('0x5')],authService['setTokenCookie']);module[_0x7653('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index f38f917..53485a7 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 _0x5af0=['status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','save','passport','passport-local','Strategy','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','user','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x4a023a,_0x108875){var _0x3af368=function(_0x2a89aa){while(--_0x2a89aa){_0x4a023a['push'](_0x4a023a['shift']());}};_0x3af368(++_0x108875);}(_0x5af0,0xda));var _0x05af=function(_0x3429a6,_0x4d26f7){_0x3429a6=_0x3429a6-0x0;var _0x580725=_0x5af0[_0x3429a6];return _0x580725;};'use strict';var util=require('util');var passport=require(_0x05af('0x0'));var LocalStrategy=require(_0x05af('0x1'))[_0x05af('0x2')];var jayson=require('jayson/promise');var _=require(_0x05af('0x3'));var rs=require(_0x05af('0x4'));var moment=require(_0x05af('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x05af('0x6'));var utils=require(_0x05af('0x7'));var client=jayson[_0x05af('0x8')][_0x05af('0x9')]({'port':0x232b});function localAuthenticate(_0x1ce43a,_0x55859f,_0x56e2e6,_0xa48be8){var _0xe37ed8,_0x1c9c60;return db['Setting'][_0x05af('0xa')]({'where':{'id':0x1},'attributes':[_0x05af('0xb'),_0x05af('0xc')],'raw':!![]})[_0x05af('0xd')](function(_0x14b5d6){_0xe37ed8=_0x14b5d6;return _0x1ce43a[_0x05af('0xa')]({'attributes':['id',_0x05af('0xe'),_0x05af('0xf'),_0x05af('0x10'),_0x05af('0x11'),_0x05af('0x12'),_0x05af('0x13'),_0x05af('0x14'),_0x05af('0x15')],'where':{'name':_0x55859f,'role':{'$or':[_0x05af('0x16'),'user',_0x05af('0x17')]}}});})[_0x05af('0xd')](function(_0x3698a5){if(!_0x3698a5||_0x3698a5&&_0x3698a5[_0x05af('0xe')]!==_0x55859f){throw new Error(_0x05af('0x18'));}else{_0x1c9c60=_0x3698a5;return _0x1c9c60;}})[_0x05af('0xd')](function(){_0x1c9c60[_0x05af('0x19')](_0x56e2e6,function(_0x4f39d6,_0x4e3d01){var _0x343364=_0x1c9c60[_0x05af('0x15')]+0x1;if(_0x4f39d6){return _0xa48be8(_0x4f39d6);}else if(!_0x4e3d01){if(_0x1c9c60[_0x05af('0x12')]){return _0xa48be8(null,![],{'message':_0x05af('0x18')});}else if(_0xe37ed8[_0x05af('0xb')]>0x0){if(_0x1c9c60[_0x05af('0x13')]){if(_0xe37ed8['blockDuration']>0x0){if(moment(_0x1c9c60[_0x05af('0x14')])[_0x05af('0x1a')](_0xe37ed8[_0x05af('0xc')],'minutes')>moment()){return _0xa48be8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x05af('0x1b')](_0x1c9c60,_0x343364,![],null)['then'](function(){return _0xa48be8(null,![],{'message':_0x05af('0x18')});});}}else{return _0xa48be8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x343364>=_0xe37ed8['allowedLoginAttempts']){return utils[_0x05af('0x1b')](_0x1c9c60,0x0,!![],moment())[_0x05af('0xd')](function(){return _0xa48be8(null,![],{'message':_0x05af('0x18')});});}else{return utils[_0x05af('0x1b')](_0x1c9c60,_0x343364,![],null)[_0x05af('0xd')](function(){return _0xa48be8(null,![],{'message':_0x05af('0x18')});});}}}else{return _0xa48be8(null,![],{'message':_0x05af('0x18')});}}else{if(_0x1c9c60[_0x05af('0x12')]){return _0xa48be8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0xe37ed8[_0x05af('0xb')]>0x0){if(_0x1c9c60[_0x05af('0x13')]){if(_0xe37ed8[_0x05af('0xc')]>0x0){if(moment(_0x1c9c60[_0x05af('0x14')])['add'](_0xe37ed8['blockDuration'],_0x05af('0x1c'))>moment()){return _0xa48be8(null,![],{'message':_0x05af('0x18')});}else{return utils[_0x05af('0x1b')](_0x1c9c60,0x0,![],null)['then'](function(){return utils[_0x05af('0x1d')](_0x1c9c60);})[_0x05af('0xd')](function(){return _0xa48be8(null,_0x1c9c60);});}}else{return _0xa48be8(null,![],{'message':_0x05af('0x18')});}}else{return utils[_0x05af('0x1b')](_0x1c9c60,0x0,![],null)[_0x05af('0xd')](function(){return utils[_0x05af('0x1d')](_0x1c9c60);})[_0x05af('0xd')](function(){return _0xa48be8(null,_0x1c9c60);})['catch'](function(_0x2c0ff3){return _0xa48be8(null,![],_0x2c0ff3);});}}else{if(_0x1c9c60[_0x05af('0x13')]){return _0xa48be8(null,![],{'message':_0x05af('0x18')});}else{return utils['getLicense'](_0x1c9c60)[_0x05af('0xd')](function(){return _0xa48be8(null,_0x1c9c60);});}}}});})[_0x05af('0x1e')](function(_0x361666){return _0xa48be8(null,![],_0x361666);});}function sendServiceMail(_0x56e651){return db[_0x05af('0x1f')][_0x05af('0x20')]({'where':{'service':!![]},'attributes':['id',_0x05af('0xe'),_0x05af('0x21')],'include':[{'model':db[_0x05af('0x22')],'as':_0x05af('0x23')}]})[_0x05af('0xd')](function(_0x210e81){if(!_0x210e81){throw new Error(_0x05af('0x24'));}var _0x203d92={'tls':{'rejectUnauthorized':![]}};if(_0x210e81[_0x05af('0x23')][_0x05af('0x25')]){_0x203d92[_0x05af('0x25')]=_0x210e81[_0x05af('0x23')][_0x05af('0x25')];}else{_0x203d92['host']=_0x210e81[_0x05af('0x23')][_0x05af('0x26')];_0x203d92[_0x05af('0x27')]=_0x210e81[_0x05af('0x23')][_0x05af('0x27')];_0x203d92[_0x05af('0x28')]=_0x210e81[_0x05af('0x23')]['secure'];}if(_0x210e81[_0x05af('0x23')][_0x05af('0x29')]){_0x203d92['auth']={'user':_0x210e81[_0x05af('0x23')][_0x05af('0x2a')],'pass':_0x210e81[_0x05af('0x23')][_0x05af('0x2b')]};}var _0x5b29dd={'account':_0x203d92,'message':_[_0x05af('0x2c')]({'from':util[_0x05af('0x2d')](_0x05af('0x2e'),_0x210e81['name'],_0x210e81[_0x05af('0x21')]||_0x210e81['Smtp']['user'])},_0x56e651)};return client[_0x05af('0x2f')](_0x05af('0x30'),_0x5b29dd);})['then'](function(_0x26c2d4){if(_0x26c2d4[_0x05af('0x31')]){throw new Error(util[_0x05af('0x2d')](_0x05af('0x32'),_0x26c2d4['error'][_0x05af('0x33')]||JSON['stringify'](_0x26c2d4[_0x05af('0x31')])));}return!![];});}function handleError(_0x289f04,_0x57d20b,_0x1ac152){return _0x289f04[_0x05af('0x34')](_0x57d20b||0x1f4)[_0x05af('0x35')]({'message':_0x1ac152?_0x1ac152['message']||_0x1ac152:''});}exports[_0x05af('0x36')]=function(_0x58f7e9,_0x293ee7,_0x41a3d0){passport[_0x05af('0x19')](_0x05af('0x37'),function(_0x57ebb0,_0x41d62e,_0x40db6a){var _0x341c0e=_0x57ebb0||_0x40db6a;if(_0x341c0e){return handleError(_0x293ee7,0x191,_0x341c0e);}if(!_0x41d62e){return handleError(_0x293ee7,0x194,{'message':_0x05af('0x38')});}else{var _0x16b176={'payload':{'id':_0x41d62e['id'],'role':_0x41d62e[_0x05af('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x05af('0x39')](_0x16b176)['then'](function(_0x4637d0){_0x293ee7[_0x05af('0x3a')]({'id':_0x41d62e['id'],'token':_0x4637d0,'statusCall':'','isAlreadyLogged':_0x41d62e[_0x05af('0x3b')]});});}})(_0x58f7e9,_0x293ee7,_0x41a3d0);};exports[_0x05af('0x3c')]=function(_0x52464b,_0x24f298,_0x3e33ea){if(!_0x52464b[_0x05af('0x3d')][_0x05af('0x21')]){return handleError(_0x24f298,0x1f4,{'message':_0x05af('0x3e')});}var _0x24eab6=rs[_0x05af('0x3f')]();_0x52464b[_0x05af('0x3d')][_0x05af('0x21')]=_0x52464b[_0x05af('0x3d')][_0x05af('0x21')][_0x05af('0x40')]()[_0x05af('0x41')]();var _0xb8dab0;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x05af('0xb'),_0x05af('0xc')],'raw':!![]})['then'](function(_0x555c56){_0xb8dab0=_0x555c56;return db[_0x05af('0x42')][_0x05af('0x20')]({'where':{'email':_0x52464b['body'][_0x05af('0x21')]}});})[_0x05af('0xd')](function(_0x359c13){if(!_0x359c13){throw new Error(_0x05af('0x43'));}if(_0x359c13[_0x05af('0x12')]){throw new Error(_0x05af('0x44'));}if(_0x359c13[_0x05af('0x13')]){if(moment(_0x359c13[_0x05af('0x14')])['add'](_0xb8dab0['blockDuration'],_0x05af('0x1c'))>moment()){throw new Error(_0x05af('0x45'));}else{_0x359c13['blocked']=![];_0x359c13[_0x05af('0x14')]=null;}}_0x359c13['resetPasswordToken']=_0x24eab6;_0x359c13[_0x05af('0x46')]=Date[_0x05af('0x47')]()+0x36ee80;return _0x359c13['save']();})[_0x05af('0xd')](function(){return sendServiceMail({'to':_0x52464b['body'][_0x05af('0x21')],'subject':_0x05af('0x48'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x05af('0x49')+_0x05af('0x4a')+_0x52464b[_0x05af('0x4b')]['host']+_0x05af('0x4c')+_0x24eab6+'\x0a\x0a'+_0x05af('0x4d')});})[_0x05af('0xd')](function(){_0x24f298[_0x05af('0x34')](0xc8)[_0x05af('0x35')]({'message':_0x05af('0x4e')});})[_0x05af('0x1e')](function(_0x5ab3d7){return handleError(_0x24f298,0x1f4,_0x5ab3d7);});};exports[_0x05af('0x4f')]=function(_0x48c826,_0x578e22,_0x379091){return db['User'][_0x05af('0x20')]({'where':{'resetPasswordToken':_0x48c826[_0x05af('0x50')][_0x05af('0x51')],'resetPasswordExpires':{'$gt':Date[_0x05af('0x47')]()}}})[_0x05af('0xd')](function(_0x143621){if(!_0x143621){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x05af('0xa')]({'attributes':['id',_0x05af('0x52'),_0x05af('0x53'),'passwordHistoryLimit']})[_0x05af('0xd')](function(_0x562f5d){if(_0x562f5d[_0x05af('0x52')])authService[_0x05af('0x54')](_0x48c826['body'][_0x05af('0xf')]);if(!_0x562f5d[_0x05af('0x53')]||!_0x143621[_0x05af('0x55')])return _0x143621;authService[_0x05af('0x56')](_0x48c826[_0x05af('0x3d')][_0x05af('0xf')],_0x143621[_0x05af('0x55')],_0x562f5d[_0x05af('0x57')]);return _0x143621;})[_0x05af('0xd')](function(){_0x143621[_0x05af('0xf')]=_0x48c826[_0x05af('0x3d')][_0x05af('0xf')];_0x143621[_0x05af('0x58')]=null;_0x143621[_0x05af('0x46')]=null;return _0x143621[_0x05af('0x59')]();});})['then'](function(){_0x578e22[_0x05af('0x34')](0xc8)[_0x05af('0x35')]({'message':'Password\x20reset!'});})[_0x05af('0x1e')](function(_0x3a7bb8){return handleError(_0x578e22,0x1f4,_0x3a7bb8);});};passport['use'](_0x05af('0x37'),new LocalStrategy({'usernameField':_0x05af('0xe'),'passwordField':_0x05af('0xf')},function(_0x333b70,_0x7d9b48,_0x2670e7){return localAuthenticate(db['User'],_0x333b70,_0x7d9b48,_0x2670e7);}));
\ No newline at end of file
+var _0x05f8=['service','Smtp','host','port','secure','authentication','auth','pass','merge','format','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','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','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','Password\x20reset!','use','passport','Strategy','lodash','../../mysqldb','../../config/utils','client','http','Setting','findOne','blockDuration','then','password','role','disabled','blocked','loginAttempts','admin','user','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05f8,0x170));var _0x805f=function(_0x5e76a0,_0x5ed0ba){_0x5e76a0=_0x5e76a0-0x0;var _0x283938=_0x05f8[_0x5e76a0];return _0x283938;};'use strict';var util=require('util');var passport=require(_0x805f('0x0'));var LocalStrategy=require('passport-local')[_0x805f('0x1')];var jayson=require('jayson/promise');var _=require(_0x805f('0x2'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x805f('0x3'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x805f('0x4'));var client=jayson[_0x805f('0x5')][_0x805f('0x6')]({'port':0x232b});function localAuthenticate(_0x471dc5,_0xe3af32,_0x27a289,_0x38423c){var _0x2e40a5,_0x387b57;return db[_0x805f('0x7')][_0x805f('0x8')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x805f('0x9')],'raw':!![]})[_0x805f('0xa')](function(_0x463e09){_0x2e40a5=_0x463e09;return _0x471dc5[_0x805f('0x8')]({'attributes':['id','name',_0x805f('0xb'),'salt',_0x805f('0xc'),_0x805f('0xd'),_0x805f('0xe'),'blockedAt',_0x805f('0xf')],'where':{'name':_0xe3af32,'role':{'$or':[_0x805f('0x10'),_0x805f('0x11'),'agent']}}});})[_0x805f('0xa')](function(_0x2b937d){if(!_0x2b937d||_0x2b937d&&_0x2b937d[_0x805f('0x12')]!==_0xe3af32){throw new Error(_0x805f('0x13'));}else{_0x387b57=_0x2b937d;return _0x387b57;}})[_0x805f('0xa')](function(){_0x387b57[_0x805f('0x14')](_0x27a289,function(_0x232b34,_0x2b3ce4){var _0x1bf1c9=_0x387b57[_0x805f('0xf')]+0x1;if(_0x232b34){return _0x38423c(_0x232b34);}else if(!_0x2b3ce4){if(_0x387b57[_0x805f('0xd')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else if(_0x2e40a5[_0x805f('0x15')]>0x0){if(_0x387b57['blocked']){if(_0x2e40a5[_0x805f('0x9')]>0x0){if(moment(_0x387b57['blockedAt'])[_0x805f('0x16')](_0x2e40a5['blockDuration'],_0x805f('0x17'))>moment()){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else{return utils[_0x805f('0x18')](_0x387b57,_0x1bf1c9,![],null)['then'](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}}else{return _0x38423c(null,![],{'message':_0x805f('0x13')});}}else{if(_0x1bf1c9>=_0x2e40a5['allowedLoginAttempts']){return utils[_0x805f('0x18')](_0x387b57,0x0,!![],moment())[_0x805f('0xa')](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}else{return utils[_0x805f('0x18')](_0x387b57,_0x1bf1c9,![],null)[_0x805f('0xa')](function(){return _0x38423c(null,![],{'message':_0x805f('0x13')});});}}}else{return _0x38423c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x387b57[_0x805f('0xd')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else if(_0x2e40a5[_0x805f('0x15')]>0x0){if(_0x387b57['blocked']){if(_0x2e40a5[_0x805f('0x9')]>0x0){if(moment(_0x387b57[_0x805f('0x19')])[_0x805f('0x16')](_0x2e40a5[_0x805f('0x9')],_0x805f('0x17'))>moment()){return _0x38423c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x805f('0x18')](_0x387b57,0x0,![],null)[_0x805f('0xa')](function(){return utils[_0x805f('0x1a')](_0x387b57);})[_0x805f('0xa')](function(){return _0x38423c(null,_0x387b57);});}}else{return _0x38423c(null,![],{'message':_0x805f('0x13')});}}else{return utils[_0x805f('0x18')](_0x387b57,0x0,![],null)['then'](function(){return utils['getLicense'](_0x387b57);})['then'](function(){return _0x38423c(null,_0x387b57);})[_0x805f('0x1b')](function(_0xb501ba){return _0x38423c(null,![],_0xb501ba);});}}else{if(_0x387b57[_0x805f('0xe')]){return _0x38423c(null,![],{'message':_0x805f('0x13')});}else{return utils[_0x805f('0x1a')](_0x387b57)[_0x805f('0xa')](function(){return _0x38423c(null,_0x387b57);});}}}});})[_0x805f('0x1b')](function(_0x40511d){return _0x38423c(null,![],_0x40511d);});}function sendServiceMail(_0x2e7eff){return db[_0x805f('0x1c')][_0x805f('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x805f('0x1e')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})['then'](function(_0x5c2b1a){if(!_0x5c2b1a){throw new Error(_0x805f('0x1f'));}var _0x4a05ab={'tls':{'rejectUnauthorized':![]}};if(_0x5c2b1a['Smtp'][_0x805f('0x20')]){_0x4a05ab['service']=_0x5c2b1a[_0x805f('0x21')]['service'];}else{_0x4a05ab[_0x805f('0x22')]=_0x5c2b1a[_0x805f('0x21')]['host'];_0x4a05ab[_0x805f('0x23')]=_0x5c2b1a[_0x805f('0x21')][_0x805f('0x23')];_0x4a05ab['secure']=_0x5c2b1a['Smtp'][_0x805f('0x24')];}if(_0x5c2b1a[_0x805f('0x21')][_0x805f('0x25')]){_0x4a05ab[_0x805f('0x26')]={'user':_0x5c2b1a[_0x805f('0x21')][_0x805f('0x11')],'pass':_0x5c2b1a[_0x805f('0x21')][_0x805f('0x27')]};}var _0x3f60ab={'account':_0x4a05ab,'message':_[_0x805f('0x28')]({'from':util[_0x805f('0x29')]('\x22%s\x22\x20<%s>',_0x5c2b1a[_0x805f('0x12')],_0x5c2b1a[_0x805f('0x1e')]||_0x5c2b1a[_0x805f('0x21')][_0x805f('0x11')])},_0x2e7eff)};return client['request'](_0x805f('0x2a'),_0x3f60ab);})['then'](function(_0x32342a){if(_0x32342a[_0x805f('0x2b')]){throw new Error(util[_0x805f('0x29')](_0x805f('0x2c'),_0x32342a['error'][_0x805f('0x2d')]||JSON[_0x805f('0x2e')](_0x32342a['error'])));}return!![];});}function handleError(_0x34378d,_0x21b6a0,_0x1130fb){return _0x34378d[_0x805f('0x2f')](_0x21b6a0||0x1f4)[_0x805f('0x30')]({'message':_0x1130fb?_0x1130fb[_0x805f('0x2d')]||_0x1130fb:''});}exports[_0x805f('0x31')]=function(_0x196889,_0x49ef8e,_0x345c27){passport[_0x805f('0x14')](_0x805f('0x32'),function(_0x57c169,_0x7507e3,_0x4024ff){var _0x1a0016=_0x57c169||_0x4024ff;if(_0x1a0016){return handleError(_0x49ef8e,0x191,_0x1a0016);}if(!_0x7507e3){return handleError(_0x49ef8e,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xbd7e55={'payload':{'id':_0x7507e3['id'],'role':_0x7507e3[_0x805f('0xc')]},'options':{'expiresIn':0x15180}};return authService[_0x805f('0x33')](_0xbd7e55)['then'](function(_0x55cd55){_0x49ef8e[_0x805f('0x34')]({'id':_0x7507e3['id'],'token':_0x55cd55,'statusCall':'','isAlreadyLogged':_0x7507e3[_0x805f('0x35')]});});}})(_0x196889,_0x49ef8e,_0x345c27);};exports[_0x805f('0x36')]=function(_0xddadc4,_0x4b9d8a,_0xed8d7f){if(!_0xddadc4['body']['email']){return handleError(_0x4b9d8a,0x1f4,{'message':_0x805f('0x37')});}var _0x418a52=rs[_0x805f('0x38')]();_0xddadc4[_0x805f('0x39')]['email']=_0xddadc4[_0x805f('0x39')][_0x805f('0x1e')]['trim']()[_0x805f('0x3a')]();var _0x1cd89d;return db[_0x805f('0x7')][_0x805f('0x8')]({'where':{'id':0x1},'attributes':[_0x805f('0x15'),_0x805f('0x9')],'raw':!![]})['then'](function(_0x1d3bda){_0x1cd89d=_0x1d3bda;return db['User']['find']({'where':{'email':_0xddadc4[_0x805f('0x39')][_0x805f('0x1e')]}});})[_0x805f('0xa')](function(_0x3b8016){if(!_0x3b8016){throw new Error(_0x805f('0x3b'));}if(_0x3b8016[_0x805f('0xd')]){throw new Error(_0x805f('0x3c'));}if(_0x3b8016[_0x805f('0xe')]){if(moment(_0x3b8016[_0x805f('0x19')])['add'](_0x1cd89d[_0x805f('0x9')],'minutes')>moment()){throw new Error(_0x805f('0x3d'));}else{_0x3b8016[_0x805f('0xe')]=![];_0x3b8016[_0x805f('0x19')]=null;}}_0x3b8016[_0x805f('0x3e')]=_0x418a52;_0x3b8016[_0x805f('0x3f')]=Date[_0x805f('0x40')]()+0x36ee80;return _0x3b8016[_0x805f('0x41')]();})[_0x805f('0xa')](function(){return sendServiceMail({'to':_0xddadc4['body'][_0x805f('0x1e')],'subject':_0x805f('0x42'),'text':_0x805f('0x43')+_0x805f('0x44')+_0x805f('0x45')+_0xddadc4['headers'][_0x805f('0x22')]+_0x805f('0x46')+_0x418a52+'\x0a\x0a'+_0x805f('0x47')});})[_0x805f('0xa')](function(){_0x4b9d8a[_0x805f('0x2f')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x36af8f){return handleError(_0x4b9d8a,0x1f4,_0x36af8f);});};exports['reset']=function(_0x265c4a,_0x4b771e,_0x403619){return db['User']['find']({'where':{'resetPasswordToken':_0x265c4a['params'][_0x805f('0x48')],'resetPasswordExpires':{'$gt':Date[_0x805f('0x40')]()}}})[_0x805f('0xa')](function(_0x5c17b0){if(!_0x5c17b0){throw new Error(_0x805f('0x49'));}return db[_0x805f('0x7')][_0x805f('0x8')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x805f('0xa')](function(_0x4845c3){if(_0x4845c3[_0x805f('0x4a')])authService['validatePasswordPattern'](_0x265c4a['body'][_0x805f('0xb')]);if(!_0x4845c3[_0x805f('0x4b')]||!_0x5c17b0['previousPasswords'])return _0x5c17b0;authService[_0x805f('0x4c')](_0x265c4a[_0x805f('0x39')]['password'],_0x5c17b0['previousPasswords'],_0x4845c3[_0x805f('0x4d')]);return _0x5c17b0;})[_0x805f('0xa')](function(){_0x5c17b0['password']=_0x265c4a[_0x805f('0x39')][_0x805f('0xb')];_0x5c17b0['resetPasswordToken']=null;_0x5c17b0[_0x805f('0x3f')]=null;return _0x5c17b0[_0x805f('0x41')]();});})[_0x805f('0xa')](function(){_0x4b771e[_0x805f('0x2f')](0xc8)[_0x805f('0x30')]({'message':_0x805f('0x4e')});})['catch'](function(_0x4a2185){return handleError(_0x4b771e,0x1f4,_0x4a2185);});};passport[_0x805f('0x4f')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':_0x805f('0xb')},function(_0x6c6216,_0x420df2,_0x4b1fa4){return localAuthenticate(db['User'],_0x6c6216,_0x420df2,_0x4b1fa4);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index a8766db..1c12ca8 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 _0x0a89=['/forgot','forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post','login'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x0a89,0x9e));var _0x90a8=function(_0x165a7e,_0xe72ff0){_0x165a7e=_0x165a7e-0x0;var _0x3a1b02=_0x0a89[_0x165a7e];return _0x3a1b02;};'use strict';var express=require('express');var router=express[_0x90a8('0x0')]();var controller=require(_0x90a8('0x1'));router[_0x90a8('0x2')]('/',controller[_0x90a8('0x3')]);router[_0x90a8('0x2')](_0x90a8('0x4'),controller[_0x90a8('0x5')]);router[_0x90a8('0x2')](_0x90a8('0x6'),controller[_0x90a8('0x7')]);module[_0x90a8('0x8')]=router;
\ No newline at end of file
+var _0x5ee2=['Router','./authLocal.controller','post','login','forgot'];(function(_0x3fb8f7,_0x5363d9){var _0x4b0e88=function(_0x56fd5a){while(--_0x56fd5a){_0x3fb8f7['push'](_0x3fb8f7['shift']());}};_0x4b0e88(++_0x5363d9);}(_0x5ee2,0x11d));var _0x25ee=function(_0x42b3d0,_0x1578a4){_0x42b3d0=_0x42b3d0-0x0;var _0x2dc411=_0x5ee2[_0x42b3d0];return _0x2dc411;};'use strict';var express=require('express');var router=express[_0x25ee('0x0')]();var controller=require(_0x25ee('0x1'));router[_0x25ee('0x2')]('/',controller[_0x25ee('0x3')]);router[_0x25ee('0x2')]('/forgot',controller[_0x25ee('0x4')]);router[_0x25ee('0x2')]('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 85b47b6..b3193ea 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 _0x6b5d=['INTEGER','sequelize','exports','STRING'];(function(_0x5366c2,_0x3eafa7){var _0xd676ba=function(_0x58e961){while(--_0x58e961){_0x5366c2['push'](_0x5366c2['shift']());}};_0xd676ba(++_0x3eafa7);}(_0x6b5d,0x111));var _0xd6b5=function(_0xccfafd,_0x5c590a){_0xccfafd=_0xccfafd-0x0;var _0x113270=_0x6b5d[_0xccfafd];return _0x113270;};'use strict';var Sequelize=require(_0xd6b5('0x0'));module[_0xd6b5('0x1')]={'name':{'type':Sequelize[_0xd6b5('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd6b5('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd6b5('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xd9dc=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x3176a4,_0x2049fd){var _0x38d9bc=function(_0x30a9aa){while(--_0x30a9aa){_0x3176a4['push'](_0x3176a4['shift']());}};_0x38d9bc(++_0x2049fd);}(_0xd9dc,0x1c1));var _0xcd9d=function(_0x19069d,_0x46921e){_0x19069d=_0x19069d-0x0;var _0x39463a=_0xd9dc[_0x19069d];return _0x39463a;};'use strict';var Sequelize=require(_0xcd9d('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd9d('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xcd9d('0x1')]},'description':{'type':Sequelize[_0xcd9d('0x1')]},'status':{'type':Sequelize[_0xcd9d('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcd9d('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 2a34ca4..cbbc1bb 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 _0x4b86=['merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','addConditions','ids','getConditions','findOne','Condition','filter','Action','addActions','omit','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','Automation','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1dc01f,_0x157a75){var _0x298041=function(_0x47fce1){while(--_0x47fce1){_0x1dc01f['push'](_0x1dc01f['shift']());}};_0x298041(++_0x157a75);}(_0x4b86,0x1df));var _0x64b8=function(_0xb03f9,_0x588391){_0xb03f9=_0xb03f9-0x0;var _0x3ec30a=_0x4b86[_0xb03f9];return _0x3ec30a;};'use strict';var emlformat=require(_0x64b8('0x0'));var rimraf=require(_0x64b8('0x1'));var zipdir=require(_0x64b8('0x2'));var jsonpatch=require(_0x64b8('0x3'));var rp=require(_0x64b8('0x4'));var moment=require(_0x64b8('0x5'));var BPromise=require(_0x64b8('0x6'));var Mustache=require(_0x64b8('0x7'));var util=require(_0x64b8('0x8'));var path=require(_0x64b8('0x9'));var sox=require('sox');var csv=require(_0x64b8('0xa'));var ejs=require(_0x64b8('0xb'));var fs=require('fs');var fs_extra=require(_0x64b8('0xc'));var _=require('lodash');var squel=require(_0x64b8('0xd'));var crypto=require(_0x64b8('0xe'));var jsforce=require(_0x64b8('0xf'));var deskjs=require(_0x64b8('0x10'));var toCsv=require(_0x64b8('0xa'));var querystring=require(_0x64b8('0x11'));var Papa=require(_0x64b8('0x12'));var Redis=require(_0x64b8('0x13'));var authService=require(_0x64b8('0x14'));var qs=require(_0x64b8('0x15'));var as=require(_0x64b8('0x16'));var hardwareService=require(_0x64b8('0x17'));var logger=require(_0x64b8('0x18'))(_0x64b8('0x19'));var utils=require(_0x64b8('0x1a'));var config=require(_0x64b8('0x1b'));var licenseUtil=require(_0x64b8('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ec240,_0x32dd93){_0x32dd93=_0x32dd93||0xcc;return function(_0x5244aa){if(_0x5244aa){return _0x5ec240[_0x64b8('0x1d')](_0x32dd93);}return _0x5ec240['status'](_0x32dd93)[_0x64b8('0x1e')]();};}function respondWithResult(_0x10493e,_0x1d17b6){_0x1d17b6=_0x1d17b6||0xc8;return function(_0xc89f09){if(_0xc89f09){return _0x10493e[_0x64b8('0x1f')](_0x1d17b6)[_0x64b8('0x20')](_0xc89f09);}};}function respondWithFilteredResult(_0x3544d8,_0xf372a0){return function(_0x28ef7f){if(_0x28ef7f){var _0x465d9b=typeof _0xf372a0[_0x64b8('0x21')]===_0x64b8('0x22')&&typeof _0xf372a0['limit']==='undefined';var _0x39273e=_0x28ef7f['count'];var _0x1fe316=_0x465d9b?0x0:_0xf372a0[_0x64b8('0x21')];var _0x5eeb7a=_0x465d9b?_0x28ef7f[_0x64b8('0x23')]:_0xf372a0[_0x64b8('0x21')]+_0xf372a0[_0x64b8('0x24')];var _0x4b52ce;if(_0x5eeb7a>=_0x39273e){_0x5eeb7a=_0x39273e;_0x4b52ce=0xc8;}else{_0x4b52ce=0xce;}_0x3544d8[_0x64b8('0x1f')](_0x4b52ce);return _0x3544d8[_0x64b8('0x25')](_0x64b8('0x26'),_0x1fe316+'-'+_0x5eeb7a+'/'+_0x39273e)[_0x64b8('0x20')](_0x28ef7f);}return null;};}function patchUpdates(_0x5b25aa){return function(_0x5e6474){try{jsonpatch[_0x64b8('0x27')](_0x5e6474,_0x5b25aa,!![]);}catch(_0x17e662){return BPromise[_0x64b8('0x28')](_0x17e662);}return _0x5e6474[_0x64b8('0x29')]();};}function saveUpdates(_0x4b5aea,_0x408566){return function(_0x53f0b4){if(_0x53f0b4){return _0x53f0b4[_0x64b8('0x2a')](_0x4b5aea)[_0x64b8('0x2b')](function(_0x4e1573){return _0x4e1573;});}return null;};}function removeEntity(_0x2ae57b,_0x5f9674){return function(_0x183dcf){if(_0x183dcf){return _0x183dcf[_0x64b8('0x2c')]()[_0x64b8('0x2b')](function(){_0x2ae57b[_0x64b8('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9cd470,_0x5a0ccb){return function(_0x191e1f){if(!_0x191e1f){_0x9cd470[_0x64b8('0x1d')](0x194);}return _0x191e1f;};}function handleError(_0x590621,_0x54fa90){_0x54fa90=_0x54fa90||0x1f4;return function(_0x2ae39f){logger['error'](_0x2ae39f[_0x64b8('0x2d')]);if(_0x2ae39f[_0x64b8('0x2e')]){delete _0x2ae39f[_0x64b8('0x2e')];}_0x590621[_0x64b8('0x1f')](_0x54fa90)['send'](_0x2ae39f);};}exports[_0x64b8('0x2f')]=function(_0x31e0ae,_0x141710){var _0x2f5408={},_0x5a2245={},_0xd75a0={'count':0x0,'rows':[]};var _0x395bf4=_['map'](db[_0x64b8('0x30')][_0x64b8('0x31')],function(_0x583d14){return{'name':_0x583d14[_0x64b8('0x32')],'type':_0x583d14[_0x64b8('0x33')][_0x64b8('0x34')]};});_0x5a2245['model']=_[_0x64b8('0x35')](_0x395bf4,_0x64b8('0x2e'));_0x5a2245[_0x64b8('0x36')]=_[_0x64b8('0x37')](_0x31e0ae[_0x64b8('0x36')]);_0x5a2245[_0x64b8('0x38')]=_['intersection'](_0x5a2245[_0x64b8('0x39')],_0x5a2245[_0x64b8('0x36')]);_0x2f5408['attributes']=_[_0x64b8('0x3a')](_0x5a2245[_0x64b8('0x39')],qs['fields'](_0x31e0ae[_0x64b8('0x36')][_0x64b8('0x3b')]));_0x2f5408[_0x64b8('0x3c')]=_0x2f5408[_0x64b8('0x3c')]['length']?_0x2f5408[_0x64b8('0x3c')]:_0x5a2245[_0x64b8('0x39')];if(!_0x31e0ae[_0x64b8('0x36')][_0x64b8('0x3d')](_0x64b8('0x3e'))){_0x2f5408['limit']=qs[_0x64b8('0x24')](_0x31e0ae['query'][_0x64b8('0x24')]);_0x2f5408[_0x64b8('0x21')]=qs['offset'](_0x31e0ae[_0x64b8('0x36')][_0x64b8('0x21')]);}_0x2f5408[_0x64b8('0x3f')]=qs[_0x64b8('0x40')](_0x31e0ae[_0x64b8('0x36')]['sort']);_0x2f5408[_0x64b8('0x41')]=qs['filters'](_[_0x64b8('0x42')](_0x31e0ae[_0x64b8('0x36')],_0x5a2245[_0x64b8('0x38')]),_0x395bf4);if(_0x31e0ae[_0x64b8('0x36')]['filter']){_0x2f5408['where']=_[_0x64b8('0x43')](_0x2f5408[_0x64b8('0x41')],{'$or':_[_0x64b8('0x35')](_0x395bf4,function(_0xb9ead){if(_0xb9ead[_0x64b8('0x33')]!==_0x64b8('0x44')){var _0x2c5465={};_0x2c5465[_0xb9ead['name']]={'$like':'%'+_0x31e0ae[_0x64b8('0x36')]['filter']+'%'};return _0x2c5465;}})});}_0x2f5408=_[_0x64b8('0x43')]({},_0x2f5408,_0x31e0ae['options']);var _0xf2c18={'where':_0x2f5408[_0x64b8('0x41')]};return db['Automation'][_0x64b8('0x23')](_0xf2c18)[_0x64b8('0x2b')](function(_0x4e3730){_0xd75a0[_0x64b8('0x23')]=_0x4e3730;if(_0x31e0ae['query'][_0x64b8('0x45')]){_0x2f5408[_0x64b8('0x46')]=[{'all':!![]}];}return db[_0x64b8('0x30')][_0x64b8('0x47')](_0x2f5408);})['then'](function(_0x5ae2d9){_0xd75a0[_0x64b8('0x48')]=_0x5ae2d9;return _0xd75a0;})[_0x64b8('0x2b')](respondWithFilteredResult(_0x141710,_0x2f5408))[_0x64b8('0x49')](handleError(_0x141710,null));};exports[_0x64b8('0x4a')]=function(_0x545976,_0x4e1538){var _0x1c6c21={'raw':![],'where':{'id':_0x545976[_0x64b8('0x4b')]['id']}},_0x57ca14={};_0x57ca14[_0x64b8('0x39')]=_[_0x64b8('0x37')](db[_0x64b8('0x30')][_0x64b8('0x31')]);_0x57ca14[_0x64b8('0x36')]=_['keys'](_0x545976['query']);_0x57ca14[_0x64b8('0x38')]=_[_0x64b8('0x3a')](_0x57ca14[_0x64b8('0x39')],_0x57ca14[_0x64b8('0x36')]);_0x1c6c21[_0x64b8('0x3c')]=_['intersection'](_0x57ca14['model'],qs['fields'](_0x545976[_0x64b8('0x36')][_0x64b8('0x3b')]));_0x1c6c21[_0x64b8('0x3c')]=_0x1c6c21[_0x64b8('0x3c')][_0x64b8('0x4c')]?_0x1c6c21[_0x64b8('0x3c')]:_0x57ca14['model'];if(_0x545976[_0x64b8('0x36')]['includeAll']){_0x1c6c21[_0x64b8('0x46')]=[{'all':!![]}];}_0x1c6c21=_[_0x64b8('0x43')]({},_0x1c6c21,_0x545976[_0x64b8('0x4d')]);return db[_0x64b8('0x30')][_0x64b8('0x4e')](_0x1c6c21)[_0x64b8('0x2b')](handleEntityNotFound(_0x4e1538,null))[_0x64b8('0x2b')](respondWithResult(_0x4e1538,null))[_0x64b8('0x49')](handleError(_0x4e1538,null));};exports[_0x64b8('0x4f')]=function(_0x4c9a44,_0x206f5e){return db[_0x64b8('0x30')][_0x64b8('0x4f')](_0x4c9a44[_0x64b8('0x50')],{})[_0x64b8('0x2b')](respondWithResult(_0x206f5e,0xc9))[_0x64b8('0x49')](handleError(_0x206f5e,null));};exports[_0x64b8('0x2a')]=function(_0x157968,_0x1e5974){if(_0x157968[_0x64b8('0x50')]['id']){delete _0x157968[_0x64b8('0x50')]['id'];}return db[_0x64b8('0x30')]['find']({'where':{'id':_0x157968[_0x64b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e5974,null))[_0x64b8('0x2b')](saveUpdates(_0x157968[_0x64b8('0x50')],null))[_0x64b8('0x2b')](respondWithResult(_0x1e5974,null))[_0x64b8('0x49')](handleError(_0x1e5974,null));};exports[_0x64b8('0x2c')]=function(_0x4555d0,_0x12d0e9){return db[_0x64b8('0x30')][_0x64b8('0x4e')]({'where':{'id':_0x4555d0[_0x64b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x12d0e9,null))[_0x64b8('0x2b')](removeEntity(_0x12d0e9,null))[_0x64b8('0x49')](handleError(_0x12d0e9,null));};exports[_0x64b8('0x51')]=function(_0x5ba30a,_0x31e960,_0x23a70b){return db['Condition']['find']({'where':{'id':_0x5ba30a[_0x64b8('0x4b')]['id']}})[_0x64b8('0x2b')](handleEntityNotFound(_0x31e960,null))[_0x64b8('0x2b')](function(_0x130d25){if(_0x130d25){return _0x130d25[_0x64b8('0x51')](_0x5ba30a[_0x64b8('0x50')][_0x64b8('0x52')],_['omit'](_0x5ba30a[_0x64b8('0x50')],[_0x64b8('0x52'),'id'])||{});}})[_0x64b8('0x2b')](respondWithResult(_0x31e960,null))[_0x64b8('0x49')](handleError(_0x31e960,null));};exports[_0x64b8('0x53')]=function(_0x1e36bf,_0x3f5f67,_0x15e622){var _0x4d5163={};var _0x16bed0={};var _0x274011;var _0x92e89c;return db['Automation'][_0x64b8('0x54')]({'where':{'id':_0x1e36bf['params']['id']}})[_0x64b8('0x2b')](handleEntityNotFound(_0x3f5f67,null))[_0x64b8('0x2b')](function(_0x4e66ca){if(_0x4e66ca){_0x274011=_0x4e66ca;_0x16bed0[_0x64b8('0x39')]=_[_0x64b8('0x37')](db[_0x64b8('0x55')][_0x64b8('0x31')]);_0x16bed0['query']=_[_0x64b8('0x37')](_0x1e36bf[_0x64b8('0x36')]);_0x16bed0[_0x64b8('0x38')]=_[_0x64b8('0x3a')](_0x16bed0[_0x64b8('0x39')],_0x16bed0[_0x64b8('0x36')]);_0x4d5163[_0x64b8('0x3c')]=_[_0x64b8('0x3a')](_0x16bed0[_0x64b8('0x39')],qs[_0x64b8('0x3b')](_0x1e36bf['query'][_0x64b8('0x3b')]));_0x4d5163[_0x64b8('0x3c')]=_0x4d5163[_0x64b8('0x3c')][_0x64b8('0x4c')]?_0x4d5163[_0x64b8('0x3c')]:_0x16bed0[_0x64b8('0x39')];_0x4d5163[_0x64b8('0x3f')]=qs['sort'](_0x1e36bf[_0x64b8('0x36')]['sort']);_0x4d5163[_0x64b8('0x41')]=qs['filters'](_[_0x64b8('0x42')](_0x1e36bf['query'],_0x16bed0[_0x64b8('0x38')]));if(_0x1e36bf[_0x64b8('0x36')][_0x64b8('0x56')]){_0x4d5163['where']=_[_0x64b8('0x43')](_0x4d5163[_0x64b8('0x41')],{'$or':_['map'](_0x4d5163['attributes'],function(_0x1d87cc){var _0x298ffb={};_0x298ffb[_0x1d87cc]={'$like':'%'+_0x1e36bf[_0x64b8('0x36')][_0x64b8('0x56')]+'%'};return _0x298ffb;})});}_0x4d5163=_[_0x64b8('0x43')]({},_0x4d5163,_0x1e36bf[_0x64b8('0x4d')]);return _0x274011[_0x64b8('0x53')](_0x4d5163);}})['then'](function(_0x16fe04){if(_0x16fe04){_0x92e89c=_0x16fe04[_0x64b8('0x4c')];if(!_0x1e36bf[_0x64b8('0x36')][_0x64b8('0x3d')]('nolimit')){_0x4d5163['limit']=qs[_0x64b8('0x24')](_0x1e36bf[_0x64b8('0x36')]['limit']);_0x4d5163[_0x64b8('0x21')]=qs[_0x64b8('0x21')](_0x1e36bf[_0x64b8('0x36')][_0x64b8('0x21')]);}return _0x274011[_0x64b8('0x53')](_0x4d5163);}})['then'](function(_0x594496){if(_0x594496){return _0x594496?{'count':_0x92e89c,'rows':_0x594496}:null;}})['then'](respondWithResult(_0x3f5f67,null))[_0x64b8('0x49')](handleError(_0x3f5f67,null));};exports['addActions']=function(_0x39ef6e,_0x229500,_0x19f4ed){return db[_0x64b8('0x57')]['find']({'where':{'id':_0x39ef6e[_0x64b8('0x4b')]['id']}})[_0x64b8('0x2b')](handleEntityNotFound(_0x229500,null))[_0x64b8('0x2b')](function(_0x155142){if(_0x155142){return _0x155142[_0x64b8('0x58')](_0x39ef6e[_0x64b8('0x50')][_0x64b8('0x52')],_[_0x64b8('0x59')](_0x39ef6e[_0x64b8('0x50')],[_0x64b8('0x52'),'id'])||{});}})[_0x64b8('0x2b')](respondWithResult(_0x229500,null))[_0x64b8('0x49')](handleError(_0x229500,null));};exports[_0x64b8('0x5a')]=function(_0x532b50,_0x145ebd,_0x53887d){var _0x37338c={};var _0xadb21f={};var _0x51d47f;var _0x163e8e;return db[_0x64b8('0x30')]['findOne']({'where':{'id':_0x532b50['params']['id']}})[_0x64b8('0x2b')](handleEntityNotFound(_0x145ebd,null))['then'](function(_0x5b6dac){if(_0x5b6dac){_0x51d47f=_0x5b6dac;_0xadb21f['model']=_[_0x64b8('0x37')](db[_0x64b8('0x57')][_0x64b8('0x31')]);_0xadb21f[_0x64b8('0x36')]=_[_0x64b8('0x37')](_0x532b50[_0x64b8('0x36')]);_0xadb21f[_0x64b8('0x38')]=_['intersection'](_0xadb21f[_0x64b8('0x39')],_0xadb21f[_0x64b8('0x36')]);_0x37338c[_0x64b8('0x3c')]=_[_0x64b8('0x3a')](_0xadb21f[_0x64b8('0x39')],qs[_0x64b8('0x3b')](_0x532b50['query'][_0x64b8('0x3b')]));_0x37338c['attributes']=_0x37338c[_0x64b8('0x3c')][_0x64b8('0x4c')]?_0x37338c[_0x64b8('0x3c')]:_0xadb21f[_0x64b8('0x39')];_0x37338c[_0x64b8('0x3f')]=qs[_0x64b8('0x40')](_0x532b50['query'][_0x64b8('0x40')]);_0x37338c[_0x64b8('0x41')]=qs['filters'](_['pick'](_0x532b50['query'],_0xadb21f['filters']));if(_0x532b50[_0x64b8('0x36')][_0x64b8('0x56')]){_0x37338c[_0x64b8('0x41')]=_[_0x64b8('0x43')](_0x37338c[_0x64b8('0x41')],{'$or':_[_0x64b8('0x35')](_0x37338c['attributes'],function(_0xff4a50){var _0x16bb61={};_0x16bb61[_0xff4a50]={'$like':'%'+_0x532b50[_0x64b8('0x36')][_0x64b8('0x56')]+'%'};return _0x16bb61;})});}_0x37338c=_[_0x64b8('0x43')]({},_0x37338c,_0x532b50['options']);return _0x51d47f[_0x64b8('0x5a')](_0x37338c);}})[_0x64b8('0x2b')](function(_0x4910d9){if(_0x4910d9){_0x163e8e=_0x4910d9['length'];if(!_0x532b50[_0x64b8('0x36')][_0x64b8('0x3d')]('nolimit')){_0x37338c[_0x64b8('0x24')]=qs[_0x64b8('0x24')](_0x532b50['query'][_0x64b8('0x24')]);_0x37338c['offset']=qs[_0x64b8('0x21')](_0x532b50[_0x64b8('0x36')][_0x64b8('0x21')]);}return _0x51d47f[_0x64b8('0x5a')](_0x37338c);}})[_0x64b8('0x2b')](function(_0x778093){if(_0x778093){return _0x778093?{'count':_0x163e8e,'rows':_0x778093}:null;}})[_0x64b8('0x2b')](respondWithResult(_0x145ebd,null))[_0x64b8('0x49')](handleError(_0x145ebd,null));};
\ No newline at end of file
+var _0x130c=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','error','stack','name','send','index','Automation','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','then','includeAll','include','rows','show','params','length','create','body','catch','find','addConditions','getConditions','findOne','Condition','order','nolimit','addActions','ids','getActions','rimraf','zip-dir'];(function(_0x1057ee,_0x3e665b){var _0x10fbac=function(_0x2b4818){while(--_0x2b4818){_0x1057ee['push'](_0x1057ee['shift']());}};_0x10fbac(++_0x3e665b);}(_0x130c,0xa2));var _0xc130=function(_0x2c9d27,_0x1b5ead){_0x2c9d27=_0x2c9d27-0x0;var _0x1b73d0=_0x130c[_0x2c9d27];return _0x1b73d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc130('0x0'));var zipdir=require(_0xc130('0x1'));var jsonpatch=require(_0xc130('0x2'));var rp=require(_0xc130('0x3'));var moment=require(_0xc130('0x4'));var BPromise=require(_0xc130('0x5'));var Mustache=require(_0xc130('0x6'));var util=require(_0xc130('0x7'));var path=require(_0xc130('0x8'));var sox=require(_0xc130('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc130('0xa'));var _=require(_0xc130('0xb'));var squel=require('squel');var crypto=require(_0xc130('0xc'));var jsforce=require(_0xc130('0xd'));var deskjs=require(_0xc130('0xe'));var toCsv=require(_0xc130('0xf'));var querystring=require('querystring');var Papa=require(_0xc130('0x10'));var Redis=require(_0xc130('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc130('0x12'));var as=require(_0xc130('0x13'));var hardwareService=require(_0xc130('0x14'));var logger=require(_0xc130('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc130('0x16'));var licenseUtil=require(_0xc130('0x17'));var db=require(_0xc130('0x18'))['db'];function respondWithStatusCode(_0x250d44,_0x5b6162){_0x5b6162=_0x5b6162||0xcc;return function(_0x125627){if(_0x125627){return _0x250d44[_0xc130('0x19')](_0x5b6162);}return _0x250d44[_0xc130('0x1a')](_0x5b6162)['end']();};}function respondWithResult(_0x2a7017,_0x57098e){_0x57098e=_0x57098e||0xc8;return function(_0x1fefd4){if(_0x1fefd4){return _0x2a7017[_0xc130('0x1a')](_0x57098e)[_0xc130('0x1b')](_0x1fefd4);}};}function respondWithFilteredResult(_0xb41905,_0x329e39){return function(_0x22e9b6){if(_0x22e9b6){var _0x2c52a9=typeof _0x329e39[_0xc130('0x1c')]===_0xc130('0x1d')&&typeof _0x329e39['limit']===_0xc130('0x1d');var _0x16afb9=_0x22e9b6[_0xc130('0x1e')];var _0x5d1d22=_0x2c52a9?0x0:_0x329e39[_0xc130('0x1c')];var _0x34da11=_0x2c52a9?_0x22e9b6[_0xc130('0x1e')]:_0x329e39[_0xc130('0x1c')]+_0x329e39[_0xc130('0x1f')];var _0x1cea72;if(_0x34da11>=_0x16afb9){_0x34da11=_0x16afb9;_0x1cea72=0xc8;}else{_0x1cea72=0xce;}_0xb41905[_0xc130('0x1a')](_0x1cea72);return _0xb41905[_0xc130('0x20')](_0xc130('0x21'),_0x5d1d22+'-'+_0x34da11+'/'+_0x16afb9)[_0xc130('0x1b')](_0x22e9b6);}return null;};}function patchUpdates(_0x4e7255){return function(_0x4a9e52){try{jsonpatch['apply'](_0x4a9e52,_0x4e7255,!![]);}catch(_0x6dfe20){return BPromise['reject'](_0x6dfe20);}return _0x4a9e52[_0xc130('0x22')]();};}function saveUpdates(_0x39e132,_0x26a4a9){return function(_0x1971c3){if(_0x1971c3){return _0x1971c3[_0xc130('0x23')](_0x39e132)['then'](function(_0x439983){return _0x439983;});}return null;};}function removeEntity(_0x24050f,_0x4b3159){return function(_0x2e8323){if(_0x2e8323){return _0x2e8323[_0xc130('0x24')]()['then'](function(){_0x24050f[_0xc130('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f9c84,_0x4f72ce){return function(_0x204f03){if(!_0x204f03){_0x1f9c84[_0xc130('0x19')](0x194);}return _0x204f03;};}function handleError(_0x7419ef,_0x638c24){_0x638c24=_0x638c24||0x1f4;return function(_0x22932e){logger[_0xc130('0x25')](_0x22932e[_0xc130('0x26')]);if(_0x22932e[_0xc130('0x27')]){delete _0x22932e[_0xc130('0x27')];}_0x7419ef['status'](_0x638c24)[_0xc130('0x28')](_0x22932e);};}exports[_0xc130('0x29')]=function(_0x4950e7,_0x383635){var _0x21f66c={},_0x209690={},_0x1107cc={'count':0x0,'rows':[]};var _0x2843e6=_['map'](db[_0xc130('0x2a')][_0xc130('0x2b')],function(_0x1e95df){return{'name':_0x1e95df['fieldName'],'type':_0x1e95df[_0xc130('0x2c')][_0xc130('0x2d')]};});_0x209690[_0xc130('0x2e')]=_['map'](_0x2843e6,_0xc130('0x27'));_0x209690[_0xc130('0x2f')]=_[_0xc130('0x30')](_0x4950e7[_0xc130('0x2f')]);_0x209690['filters']=_[_0xc130('0x31')](_0x209690[_0xc130('0x2e')],_0x209690[_0xc130('0x2f')]);_0x21f66c[_0xc130('0x32')]=_['intersection'](_0x209690[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x4950e7['query']['fields']));_0x21f66c[_0xc130('0x32')]=_0x21f66c[_0xc130('0x32')]['length']?_0x21f66c[_0xc130('0x32')]:_0x209690['model'];if(!_0x4950e7['query'][_0xc130('0x34')]('nolimit')){_0x21f66c[_0xc130('0x1f')]=qs[_0xc130('0x1f')](_0x4950e7['query'][_0xc130('0x1f')]);_0x21f66c[_0xc130('0x1c')]=qs[_0xc130('0x1c')](_0x4950e7[_0xc130('0x2f')][_0xc130('0x1c')]);}_0x21f66c['order']=qs[_0xc130('0x35')](_0x4950e7[_0xc130('0x2f')][_0xc130('0x35')]);_0x21f66c[_0xc130('0x36')]=qs[_0xc130('0x37')](_[_0xc130('0x38')](_0x4950e7['query'],_0x209690[_0xc130('0x37')]),_0x2843e6);if(_0x4950e7[_0xc130('0x2f')]['filter']){_0x21f66c[_0xc130('0x36')]=_[_0xc130('0x39')](_0x21f66c[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x2843e6,function(_0x53b22b){if(_0x53b22b['type']!==_0xc130('0x3b')){var _0xc2bb69={};_0xc2bb69[_0x53b22b[_0xc130('0x27')]]={'$like':'%'+_0x4950e7[_0xc130('0x2f')][_0xc130('0x3c')]+'%'};return _0xc2bb69;}})});}_0x21f66c=_[_0xc130('0x39')]({},_0x21f66c,_0x4950e7[_0xc130('0x3d')]);var _0x2a2f74={'where':_0x21f66c['where']};return db[_0xc130('0x2a')][_0xc130('0x1e')](_0x2a2f74)[_0xc130('0x3e')](function(_0x11e283){_0x1107cc[_0xc130('0x1e')]=_0x11e283;if(_0x4950e7[_0xc130('0x2f')][_0xc130('0x3f')]){_0x21f66c[_0xc130('0x40')]=[{'all':!![]}];}return db[_0xc130('0x2a')]['findAll'](_0x21f66c);})[_0xc130('0x3e')](function(_0x4b3caf){_0x1107cc[_0xc130('0x41')]=_0x4b3caf;return _0x1107cc;})['then'](respondWithFilteredResult(_0x383635,_0x21f66c))['catch'](handleError(_0x383635,null));};exports[_0xc130('0x42')]=function(_0x2fb2ad,_0x356bd8){var _0x2289b8={'raw':![],'where':{'id':_0x2fb2ad[_0xc130('0x43')]['id']}},_0x2fea5e={};_0x2fea5e[_0xc130('0x2e')]=_[_0xc130('0x30')](db[_0xc130('0x2a')]['rawAttributes']);_0x2fea5e['query']=_[_0xc130('0x30')](_0x2fb2ad['query']);_0x2fea5e[_0xc130('0x37')]=_[_0xc130('0x31')](_0x2fea5e[_0xc130('0x2e')],_0x2fea5e[_0xc130('0x2f')]);_0x2289b8[_0xc130('0x32')]=_['intersection'](_0x2fea5e[_0xc130('0x2e')],qs['fields'](_0x2fb2ad[_0xc130('0x2f')][_0xc130('0x33')]));_0x2289b8['attributes']=_0x2289b8[_0xc130('0x32')][_0xc130('0x44')]?_0x2289b8['attributes']:_0x2fea5e[_0xc130('0x2e')];if(_0x2fb2ad[_0xc130('0x2f')][_0xc130('0x3f')]){_0x2289b8[_0xc130('0x40')]=[{'all':!![]}];}_0x2289b8=_['merge']({},_0x2289b8,_0x2fb2ad[_0xc130('0x3d')]);return db['Automation']['find'](_0x2289b8)[_0xc130('0x3e')](handleEntityNotFound(_0x356bd8,null))['then'](respondWithResult(_0x356bd8,null))['catch'](handleError(_0x356bd8,null));};exports[_0xc130('0x45')]=function(_0x46fd0f,_0x1bee65){return db[_0xc130('0x2a')][_0xc130('0x45')](_0x46fd0f[_0xc130('0x46')],{})['then'](respondWithResult(_0x1bee65,0xc9))[_0xc130('0x47')](handleError(_0x1bee65,null));};exports[_0xc130('0x23')]=function(_0x252660,_0x9570d0){if(_0x252660[_0xc130('0x46')]['id']){delete _0x252660['body']['id'];}return db[_0xc130('0x2a')][_0xc130('0x48')]({'where':{'id':_0x252660[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x9570d0,null))['then'](saveUpdates(_0x252660[_0xc130('0x46')],null))[_0xc130('0x3e')](respondWithResult(_0x9570d0,null))[_0xc130('0x47')](handleError(_0x9570d0,null));};exports[_0xc130('0x24')]=function(_0x1fc37e,_0x2fcca7){return db[_0xc130('0x2a')]['find']({'where':{'id':_0x1fc37e[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x2fcca7,null))[_0xc130('0x3e')](removeEntity(_0x2fcca7,null))[_0xc130('0x47')](handleError(_0x2fcca7,null));};exports[_0xc130('0x49')]=function(_0x29d8e6,_0x38d577,_0x2616f9){return db['Condition']['find']({'where':{'id':_0x29d8e6[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x38d577,null))[_0xc130('0x3e')](function(_0x1f82d1){if(_0x1f82d1){return _0x1f82d1[_0xc130('0x49')](_0x29d8e6['body']['ids'],_['omit'](_0x29d8e6[_0xc130('0x46')],['ids','id'])||{});}})[_0xc130('0x3e')](respondWithResult(_0x38d577,null))['catch'](handleError(_0x38d577,null));};exports[_0xc130('0x4a')]=function(_0x5d3dea,_0x2ee647,_0x90f986){var _0x279060={};var _0x1e9e6f={};var _0x36a8ff;var _0x44ac4f;return db[_0xc130('0x2a')][_0xc130('0x4b')]({'where':{'id':_0x5d3dea[_0xc130('0x43')]['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x2ee647,null))[_0xc130('0x3e')](function(_0x224563){if(_0x224563){_0x36a8ff=_0x224563;_0x1e9e6f[_0xc130('0x2e')]=_[_0xc130('0x30')](db[_0xc130('0x4c')][_0xc130('0x2b')]);_0x1e9e6f[_0xc130('0x2f')]=_['keys'](_0x5d3dea[_0xc130('0x2f')]);_0x1e9e6f[_0xc130('0x37')]=_['intersection'](_0x1e9e6f['model'],_0x1e9e6f['query']);_0x279060[_0xc130('0x32')]=_['intersection'](_0x1e9e6f[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x5d3dea['query'][_0xc130('0x33')]));_0x279060[_0xc130('0x32')]=_0x279060[_0xc130('0x32')][_0xc130('0x44')]?_0x279060[_0xc130('0x32')]:_0x1e9e6f['model'];_0x279060[_0xc130('0x4d')]=qs[_0xc130('0x35')](_0x5d3dea[_0xc130('0x2f')][_0xc130('0x35')]);_0x279060[_0xc130('0x36')]=qs['filters'](_['pick'](_0x5d3dea[_0xc130('0x2f')],_0x1e9e6f[_0xc130('0x37')]));if(_0x5d3dea[_0xc130('0x2f')][_0xc130('0x3c')]){_0x279060['where']=_['merge'](_0x279060[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x279060[_0xc130('0x32')],function(_0x39e68c){var _0x29697b={};_0x29697b[_0x39e68c]={'$like':'%'+_0x5d3dea[_0xc130('0x2f')]['filter']+'%'};return _0x29697b;})});}_0x279060=_[_0xc130('0x39')]({},_0x279060,_0x5d3dea[_0xc130('0x3d')]);return _0x36a8ff['getConditions'](_0x279060);}})[_0xc130('0x3e')](function(_0x31e430){if(_0x31e430){_0x44ac4f=_0x31e430[_0xc130('0x44')];if(!_0x5d3dea[_0xc130('0x2f')][_0xc130('0x34')](_0xc130('0x4e'))){_0x279060[_0xc130('0x1f')]=qs[_0xc130('0x1f')](_0x5d3dea[_0xc130('0x2f')][_0xc130('0x1f')]);_0x279060[_0xc130('0x1c')]=qs['offset'](_0x5d3dea['query'][_0xc130('0x1c')]);}return _0x36a8ff[_0xc130('0x4a')](_0x279060);}})['then'](function(_0x26a379){if(_0x26a379){return _0x26a379?{'count':_0x44ac4f,'rows':_0x26a379}:null;}})['then'](respondWithResult(_0x2ee647,null))['catch'](handleError(_0x2ee647,null));};exports[_0xc130('0x4f')]=function(_0x3bc5ac,_0x292a67,_0x4daaae){return db['Action'][_0xc130('0x48')]({'where':{'id':_0x3bc5ac['params']['id']}})[_0xc130('0x3e')](handleEntityNotFound(_0x292a67,null))[_0xc130('0x3e')](function(_0x3309f9){if(_0x3309f9){return _0x3309f9[_0xc130('0x4f')](_0x3bc5ac[_0xc130('0x46')][_0xc130('0x50')],_['omit'](_0x3bc5ac['body'],[_0xc130('0x50'),'id'])||{});}})[_0xc130('0x3e')](respondWithResult(_0x292a67,null))[_0xc130('0x47')](handleError(_0x292a67,null));};exports[_0xc130('0x51')]=function(_0x2a275c,_0x27d298,_0x3df9dc){var _0x4e1c4a={};var _0x2d9dc2={};var _0x5cce9a;var _0x1c6863;return db[_0xc130('0x2a')][_0xc130('0x4b')]({'where':{'id':_0x2a275c['params']['id']}})['then'](handleEntityNotFound(_0x27d298,null))['then'](function(_0x1f2bc7){if(_0x1f2bc7){_0x5cce9a=_0x1f2bc7;_0x2d9dc2['model']=_[_0xc130('0x30')](db['Action']['rawAttributes']);_0x2d9dc2[_0xc130('0x2f')]=_[_0xc130('0x30')](_0x2a275c[_0xc130('0x2f')]);_0x2d9dc2[_0xc130('0x37')]=_['intersection'](_0x2d9dc2['model'],_0x2d9dc2['query']);_0x4e1c4a[_0xc130('0x32')]=_[_0xc130('0x31')](_0x2d9dc2[_0xc130('0x2e')],qs[_0xc130('0x33')](_0x2a275c['query'][_0xc130('0x33')]));_0x4e1c4a[_0xc130('0x32')]=_0x4e1c4a[_0xc130('0x32')]['length']?_0x4e1c4a['attributes']:_0x2d9dc2['model'];_0x4e1c4a['order']=qs['sort'](_0x2a275c[_0xc130('0x2f')][_0xc130('0x35')]);_0x4e1c4a[_0xc130('0x36')]=qs[_0xc130('0x37')](_[_0xc130('0x38')](_0x2a275c[_0xc130('0x2f')],_0x2d9dc2[_0xc130('0x37')]));if(_0x2a275c[_0xc130('0x2f')][_0xc130('0x3c')]){_0x4e1c4a[_0xc130('0x36')]=_[_0xc130('0x39')](_0x4e1c4a[_0xc130('0x36')],{'$or':_[_0xc130('0x3a')](_0x4e1c4a['attributes'],function(_0x4f4cee){var _0x993470={};_0x993470[_0x4f4cee]={'$like':'%'+_0x2a275c[_0xc130('0x2f')]['filter']+'%'};return _0x993470;})});}_0x4e1c4a=_[_0xc130('0x39')]({},_0x4e1c4a,_0x2a275c[_0xc130('0x3d')]);return _0x5cce9a['getActions'](_0x4e1c4a);}})['then'](function(_0x3742b5){if(_0x3742b5){_0x1c6863=_0x3742b5[_0xc130('0x44')];if(!_0x2a275c[_0xc130('0x2f')][_0xc130('0x34')]('nolimit')){_0x4e1c4a['limit']=qs['limit'](_0x2a275c[_0xc130('0x2f')][_0xc130('0x1f')]);_0x4e1c4a['offset']=qs[_0xc130('0x1c')](_0x2a275c[_0xc130('0x2f')][_0xc130('0x1c')]);}return _0x5cce9a['getActions'](_0x4e1c4a);}})[_0xc130('0x3e')](function(_0x1ded5e){if(_0x1ded5e){return _0x1ded5e?{'count':_0x1c6863,'rows':_0x1ded5e}:null;}})[_0xc130('0x3e')](respondWithResult(_0x27d298,null))[_0xc130('0x47')](handleError(_0x27d298,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index a5f1114..31e7cef 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 _0x12a8=['../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x199429,_0x1ead07){var _0x1d0b7d=function(_0x572d41){while(--_0x572d41){_0x199429['push'](_0x199429['shift']());}};_0x1d0b7d(++_0x1ead07);}(_0x12a8,0x95));var _0x812a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x12a8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x812a('0x0'));var util=require(_0x812a('0x1'));var logger=require(_0x812a('0x2'))(_0x812a('0x3'));var moment=require('moment');var BPromise=require(_0x812a('0x4'));var rp=require(_0x812a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x812a('0x6'));var config=require(_0x812a('0x7'));var attributes=require(_0x812a('0x8'));module[_0x812a('0x9')]=function(_0x12330d,_0x43829e){return _0x12330d[_0x812a('0xa')]('Automation',attributes,{'tableName':_0x812a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa252=['exports','define','Automation','tools_automations','util','moment','path','rimraf','./automation.attributes'];(function(_0xfb8e9c,_0x4bfaec){var _0x432968=function(_0x574cce){while(--_0x574cce){_0xfb8e9c['push'](_0xfb8e9c['shift']());}};_0x432968(++_0x4bfaec);}(_0xa252,0x1d8));var _0x2a25=function(_0x366c03,_0x137ce6){_0x366c03=_0x366c03-0x0;var _0x48c619=_0xa252[_0x366c03];return _0x48c619;};'use strict';var _=require('lodash');var util=require(_0x2a25('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2a25('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a25('0x2'));var rimraf=require(_0x2a25('0x3'));var config=require('../../config/environment');var attributes=require(_0x2a25('0x4'));module[_0x2a25('0x5')]=function(_0xa46b4c,_0xa36adb){return _0xa46b4c[_0x2a25('0x6')](_0x2a25('0x7'),attributes,{'tableName':_0x2a25('0x8'),'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 265005b..28313af 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 _0xac35=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x7ac1d6,_0x101230){var _0x52c77e=function(_0x5f2eff){while(--_0x5f2eff){_0x7ac1d6['push'](_0x7ac1d6['shift']());}};_0x52c77e(++_0x101230);}(_0xac35,0x141));var _0x5ac3=function(_0x2de56a,_0x2a0373){_0x2de56a=_0x2de56a-0x0;var _0x39cfab=_0xac35[_0x2de56a];return _0x39cfab;};'use strict';var _=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var moment=require(_0x5ac3('0x2'));var BPromise=require(_0x5ac3('0x3'));var rs=require(_0x5ac3('0x4'));var fs=require('fs');var Redis=require(_0x5ac3('0x5'));var db=require(_0x5ac3('0x6'))['db'];var utils=require(_0x5ac3('0x7'));var logger=require(_0x5ac3('0x8'))(_0x5ac3('0x9'));var config=require(_0x5ac3('0xa'));var jayson=require(_0x5ac3('0xb'));var client=jayson[_0x5ac3('0xc')][_0x5ac3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4c9a16,_0x77dc9f,_0x5e96cb){return new BPromise(function(_0x2a19b9,_0x1754d2){return client[_0x5ac3('0xe')](_0x4c9a16,_0x5e96cb)[_0x5ac3('0xf')](function(_0x378900){logger[_0x5ac3('0x10')]('Automation,\x20%s,\x20%s',_0x77dc9f,_0x5ac3('0x11'));logger['debug'](_0x5ac3('0x12'),_0x77dc9f,_0x5ac3('0x11'),JSON[_0x5ac3('0x13')](_0x378900));if(_0x378900[_0x5ac3('0x14')]){if(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x15')]===0x1f4){logger[_0x5ac3('0x14')]('Automation,\x20%s,\x20%s',_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x1754d2(_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);}logger[_0x5ac3('0x14')](_0x5ac3('0x17'),_0x77dc9f,_0x378900[_0x5ac3('0x14')][_0x5ac3('0x16')]);return _0x2a19b9(_0x378900['error']['message']);}else{logger[_0x5ac3('0x10')](_0x5ac3('0x17'),_0x77dc9f,'request\x20sent');_0x2a19b9(_0x378900[_0x5ac3('0x18')]['message']);}})[_0x5ac3('0x19')](function(_0x18cad4){logger[_0x5ac3('0x14')]('Automation,\x20%s,\x20%s',_0x77dc9f,_0x18cad4);_0x1754d2(_0x18cad4);});});}
\ No newline at end of file
+var _0x8322=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x23c2c3,_0x27ecc8){var _0x41e09f=function(_0x5e6873){while(--_0x5e6873){_0x23c2c3['push'](_0x23c2c3['shift']());}};_0x41e09f(++_0x27ecc8);}(_0x8322,0x186));var _0x2832=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0x8322[_0x242a98];return _0x580999;};'use strict';var _=require(_0x2832('0x0'));var util=require(_0x2832('0x1'));var moment=require(_0x2832('0x2'));var BPromise=require(_0x2832('0x3'));var rs=require(_0x2832('0x4'));var fs=require('fs');var Redis=require(_0x2832('0x5'));var db=require(_0x2832('0x6'))['db'];var utils=require(_0x2832('0x7'));var logger=require(_0x2832('0x8'))(_0x2832('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2832('0xa')][_0x2832('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xab2c39,_0x29a788,_0x1488df){return new BPromise(function(_0x4b0ca8,_0xb57a3c){return client[_0x2832('0xc')](_0xab2c39,_0x1488df)[_0x2832('0xd')](function(_0xb1f005){logger['info'](_0x2832('0xe'),_0x29a788,_0x2832('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x29a788,_0x2832('0xf'),JSON['stringify'](_0xb1f005));if(_0xb1f005['error']){if(_0xb1f005[_0x2832('0x10')][_0x2832('0x11')]===0x1f4){logger[_0x2832('0x10')](_0x2832('0xe'),_0x29a788,_0xb1f005['error'][_0x2832('0x12')]);return _0xb57a3c(_0xb1f005[_0x2832('0x10')]['message']);}logger[_0x2832('0x10')](_0x2832('0xe'),_0x29a788,_0xb1f005[_0x2832('0x10')][_0x2832('0x12')]);return _0x4b0ca8(_0xb1f005[_0x2832('0x10')][_0x2832('0x12')]);}else{logger[_0x2832('0x13')]('Automation,\x20%s,\x20%s',_0x29a788,_0x2832('0xf'));_0x4b0ca8(_0xb1f005[_0x2832('0x14')]['message']);}})[_0x2832('0x15')](function(_0x56d1e6){logger[_0x2832('0x10')]('Automation,\x20%s,\x20%s',_0x29a788,_0x56d1e6);_0xb57a3c(_0x56d1e6);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index b2b6188..0cc365d 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 _0xefe5=['/:id','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xefe5,0xf6));var _0x5efe=function(_0x7c15f1,_0x9aba97){_0x7c15f1=_0x7c15f1-0x0;var _0xbdb9c1=_0xefe5[_0x7c15f1];return _0xbdb9c1;};'use strict';var multer=require(_0x5efe('0x0'));var util=require('util');var path=require(_0x5efe('0x1'));var timeout=require(_0x5efe('0x2'));var express=require('express');var router=express[_0x5efe('0x3')]();var fs_extra=require(_0x5efe('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5efe('0x5'));var config=require('../../config/environment');var controller=require(_0x5efe('0x6'));router[_0x5efe('0x7')]('/',auth[_0x5efe('0x8')](),controller[_0x5efe('0x9')]);router[_0x5efe('0x7')]('/:id',auth[_0x5efe('0x8')](),controller[_0x5efe('0xa')]);router[_0x5efe('0x7')](_0x5efe('0xb'),auth[_0x5efe('0x8')](),controller[_0x5efe('0xc')]);router[_0x5efe('0x7')](_0x5efe('0xd'),auth[_0x5efe('0x8')](),controller['getActions']);router[_0x5efe('0xe')]('/',auth[_0x5efe('0x8')](),controller[_0x5efe('0xf')]);router[_0x5efe('0xe')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x5efe('0xe')](_0x5efe('0xd'),auth[_0x5efe('0x8')](),controller[_0x5efe('0x10')]);router[_0x5efe('0x11')](_0x5efe('0x12'),auth[_0x5efe('0x8')](),controller[_0x5efe('0x13')]);router[_0x5efe('0x14')](_0x5efe('0x12'),auth[_0x5efe('0x8')](),controller['destroy']);module[_0x5efe('0x15')]=router;
\ No newline at end of file
+var _0x33ed=['post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','getActions'];(function(_0x162902,_0x4b317a){var _0x1ee9b3=function(_0x57e390){while(--_0x57e390){_0x162902['push'](_0x162902['shift']());}};_0x1ee9b3(++_0x4b317a);}(_0x33ed,0x66));var _0xd33e=function(_0x644ecd,_0x397f36){_0x644ecd=_0x644ecd-0x0;var _0x1c66ce=_0x33ed[_0x644ecd];return _0x1c66ce;};'use strict';var multer=require('multer');var util=require(_0xd33e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd33e('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd33e('0x2'));var interaction=require(_0xd33e('0x3'));var config=require(_0xd33e('0x4'));var controller=require('./automation.controller');router['get']('/',auth[_0xd33e('0x5')](),controller[_0xd33e('0x6')]);router['get'](_0xd33e('0x7'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x8')]);router[_0xd33e('0x9')](_0xd33e('0xa'),auth[_0xd33e('0x5')](),controller[_0xd33e('0xb')]);router[_0xd33e('0x9')]('/:id/actions',auth[_0xd33e('0x5')](),controller[_0xd33e('0xc')]);router[_0xd33e('0xd')]('/',auth[_0xd33e('0x5')](),controller[_0xd33e('0xe')]);router[_0xd33e('0xd')](_0xd33e('0xa'),auth[_0xd33e('0x5')](),controller[_0xd33e('0xf')]);router[_0xd33e('0xd')](_0xd33e('0x10'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x11')]);router[_0xd33e('0x12')](_0xd33e('0x7'),auth['isAuthenticated'](),controller[_0xd33e('0x13')]);router[_0xd33e('0x14')](_0xd33e('0x7'),auth[_0xd33e('0x5')](),controller[_0xd33e('0x15')]);module[_0xd33e('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 8b8a0bd..d814803 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 _0xc651=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x160d40,_0x252284){var _0x33f9cf=function(_0x2f9bad){while(--_0x2f9bad){_0x160d40['push'](_0x160d40['shift']());}};_0x33f9cf(++_0x252284);}(_0xc651,0xb4));var _0x1c65=function(_0x3499d6,_0x2cb419){_0x3499d6=_0x3499d6-0x0;var _0x1afc7a=_0xc651[_0x3499d6];return _0x1afc7a;};'use strict';var Sequelize=require(_0x1c65('0x0'));module[_0x1c65('0x1')]={'name':{'type':Sequelize[_0x1c65('0x2')],'unique':_0x1c65('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1c65('0x4')](_0x1c65('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x1c65('0x2')]},'active':{'type':Sequelize[_0x1c65('0x6')],'defaultValue':0x0,'comment':_0x1c65('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1c65('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1c65('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1c65('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1c65('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'comment':_0x1c65('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1c65('0x11')},'dialTimezone':{'type':Sequelize[_0x1c65('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1c65('0x2')],'defaultValue':_0x1c65('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x1c65('0x4')](_0x1c65('0x13'),'never',_0x1c65('0x14')),'defaultValue':_0x1c65('0x13')},'dialAMDActive':{'type':Sequelize[_0x1c65('0x6')],'defaultValue':0x0,'comment':_0x1c65('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x1c65('0xa')](0x9)[_0x1c65('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1c65('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x1c65('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1c65('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1c65('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1c65('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x1c65('0xa')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1c65('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1c65('0xa')](0x9)[_0x1c65('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1c65('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1c65('0xa')](0x9)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1c65('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1c65('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1c65('0xa')](0x9)[_0x1c65('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1c65('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1c65('0x1d'),'ASC'),'defaultValue':_0x1c65('0x1d')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1c65('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c65('0x1e')},'dialCutDigit':{'type':Sequelize[_0x1c65('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1c65('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1c65('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1c65('0xa')](0x3)[_0x1c65('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1c65('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1c65('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1c65('0x29')}};
\ No newline at end of file
+var _0x9550=['Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)'];(function(_0x3206ab,_0x55af3b){var _0x17afc4=function(_0x4a3cfe){while(--_0x4a3cfe){_0x3206ab['push'](_0x3206ab['shift']());}};_0x17afc4(++_0x55af3b);}(_0x9550,0x1cc));var _0x0955=function(_0x32d226,_0x1ee2dc){_0x32d226=_0x32d226-0x0;var _0x4acf5f=_0x9550[_0x32d226];return _0x4acf5f;};'use strict';var Sequelize=require('sequelize');module[_0x0955('0x0')]={'name':{'type':Sequelize[_0x0955('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0955('0x2')](_0x0955('0x3')),'allowNull':![],'defaultValue':_0x0955('0x3')},'description':{'type':Sequelize[_0x0955('0x1')]},'active':{'type':Sequelize[_0x0955('0x4')],'defaultValue':0x0,'comment':_0x0955('0x5')},'limitCalls':{'type':Sequelize[_0x0955('0x6')](0x4)[_0x0955('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0955('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0955('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0955('0xd')},'dialTimezone':{'type':Sequelize[_0x0955('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0955('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x0955('0x2')](_0x0955('0xe'),_0x0955('0xf'),_0x0955('0x10')),'defaultValue':_0x0955('0xe')},'dialAMDActive':{'type':Sequelize[_0x0955('0x4')],'defaultValue':0x0,'comment':_0x0955('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0955('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0955('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0955('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x0955('0x6')](0x9)[_0x0955('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0955('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0955('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0955('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0955('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0955('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0955('0x17')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0955('0x18'),_0x0955('0x19')),'defaultValue':_0x0955('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0955('0x6')](0x3)[_0x0955('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0955('0x1a')},'dialCutDigit':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0955('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0955('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0955('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0955('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0955('0x6')](0x5)[_0x0955('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0955('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 525afdc..a1eb206 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 _0x1ff8=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','IvrCampaigns','then','stack','name','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileResource','findOne','CmHopper','nolimit','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','select','field','scheduledAt','CmListId','toString','ListId','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','cm_contacts','insert','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x1ff8,0x10e));var _0x81ff=function(_0x4ffafb,_0x20171a){_0x4ffafb=_0x4ffafb-0x0;var _0x4ab472=_0x1ff8[_0x4ffafb];return _0x4ab472;};'use strict';var emlformat=require(_0x81ff('0x0'));var rimraf=require(_0x81ff('0x1'));var zipdir=require(_0x81ff('0x2'));var jsonpatch=require(_0x81ff('0x3'));var rp=require(_0x81ff('0x4'));var moment=require(_0x81ff('0x5'));var BPromise=require(_0x81ff('0x6'));var Mustache=require(_0x81ff('0x7'));var util=require('util');var path=require(_0x81ff('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81ff('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x81ff('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x81ff('0xb'));var querystring=require(_0x81ff('0xc'));var Papa=require(_0x81ff('0xd'));var Redis=require(_0x81ff('0xe'));var authService=require(_0x81ff('0xf'));var qs=require(_0x81ff('0x10'));var as=require(_0x81ff('0x11'));var hardwareService=require(_0x81ff('0x12'));var logger=require(_0x81ff('0x13'))(_0x81ff('0x14'));var utils=require(_0x81ff('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x81ff('0x16'));var db=require(_0x81ff('0x17'))['db'];function respondWithStatusCode(_0x3ed67f,_0x2dd108){_0x2dd108=_0x2dd108||0xcc;return function(_0x2a10ac){if(_0x2a10ac){return _0x3ed67f[_0x81ff('0x18')](_0x2dd108);}return _0x3ed67f[_0x81ff('0x19')](_0x2dd108)[_0x81ff('0x1a')]();};}function respondWithResult(_0x1f6449,_0x12b9c1){_0x12b9c1=_0x12b9c1||0xc8;return function(_0x29f3bd){if(_0x29f3bd){return _0x1f6449[_0x81ff('0x19')](_0x12b9c1)[_0x81ff('0x1b')](_0x29f3bd);}};}function respondWithFilteredResult(_0x36f5fe,_0x1e6a52){return function(_0x337f53){if(_0x337f53){var _0x57fd94=typeof _0x1e6a52[_0x81ff('0x1c')]===_0x81ff('0x1d')&&typeof _0x1e6a52[_0x81ff('0x1e')]===_0x81ff('0x1d');var _0x47f27a=_0x337f53[_0x81ff('0x1f')];var _0x2f2545=_0x57fd94?0x0:_0x1e6a52[_0x81ff('0x1c')];var _0xdcf221=_0x57fd94?_0x337f53[_0x81ff('0x1f')]:_0x1e6a52[_0x81ff('0x1c')]+_0x1e6a52[_0x81ff('0x1e')];var _0x25dbed;if(_0xdcf221>=_0x47f27a){_0xdcf221=_0x47f27a;_0x25dbed=0xc8;}else{_0x25dbed=0xce;}_0x36f5fe[_0x81ff('0x19')](_0x25dbed);return _0x36f5fe['set'](_0x81ff('0x20'),_0x2f2545+'-'+_0xdcf221+'/'+_0x47f27a)['json'](_0x337f53);}return null;};}function patchUpdates(_0x28e86f){return function(_0x96c7e3){try{jsonpatch[_0x81ff('0x21')](_0x96c7e3,_0x28e86f,!![]);}catch(_0x516f04){return BPromise[_0x81ff('0x22')](_0x516f04);}return _0x96c7e3[_0x81ff('0x23')]();};}function saveUpdates(_0x38971b,_0x3825d7){return function(_0x443e77){if(_0x443e77){return _0x443e77[_0x81ff('0x24')](_0x38971b)['then'](function(_0x3f1bb7){return _0x3f1bb7;});}return null;};}function removeEntity(_0x58dce4,_0x9abbfc){return function(_0x587aa9){if(_0x587aa9){return _0x587aa9[_0x81ff('0x25')]()['then'](function(){var _0x32a96f=_0x587aa9[_0x81ff('0x26')]({'plain':!![]});var _0x15b93d=_0x81ff('0x27');return db['UserProfileResource'][_0x81ff('0x25')]({'where':{'type':_0x15b93d,'resourceId':_0x32a96f['id']}})['then'](function(){return _0x587aa9;});})[_0x81ff('0x28')](function(){_0x58dce4[_0x81ff('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12a997,_0x393e7a){return function(_0x2f0673){if(!_0x2f0673){_0x12a997[_0x81ff('0x18')](0x194);}return _0x2f0673;};}function handleError(_0x31e903,_0x2bd0a7){_0x2bd0a7=_0x2bd0a7||0x1f4;return function(_0x2e49be){logger['error'](_0x2e49be[_0x81ff('0x29')]);if(_0x2e49be[_0x81ff('0x2a')]){delete _0x2e49be[_0x81ff('0x2a')];}_0x31e903[_0x81ff('0x19')](_0x2bd0a7)['send'](_0x2e49be);};}exports[_0x81ff('0x2b')]=function(_0x18da8f,_0x13f6e0){var _0x19a27a={},_0x3f3b5b={},_0x3b4759={'count':0x0,'rows':[]};var _0x242601=_[_0x81ff('0x2c')](db['Campaign'][_0x81ff('0x2d')],function(_0x2f70f6){return{'name':_0x2f70f6['fieldName'],'type':_0x2f70f6['type'][_0x81ff('0x2e')]};});_0x3f3b5b[_0x81ff('0x2f')]=_[_0x81ff('0x2c')](_0x242601,'name');_0x3f3b5b[_0x81ff('0x30')]=_['keys'](_0x18da8f[_0x81ff('0x30')]);_0x3f3b5b[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x3f3b5b[_0x81ff('0x2f')],_0x3f3b5b[_0x81ff('0x30')]);_0x19a27a[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x3f3b5b[_0x81ff('0x2f')],qs[_0x81ff('0x34')](_0x18da8f[_0x81ff('0x30')][_0x81ff('0x34')]));_0x19a27a[_0x81ff('0x33')]=_0x19a27a[_0x81ff('0x33')][_0x81ff('0x35')]?_0x19a27a[_0x81ff('0x33')]:_0x3f3b5b['model'];if(!_0x18da8f[_0x81ff('0x30')][_0x81ff('0x36')]('nolimit')){_0x19a27a['limit']=qs[_0x81ff('0x1e')](_0x18da8f[_0x81ff('0x30')]['limit']);_0x19a27a['offset']=qs[_0x81ff('0x1c')](_0x18da8f[_0x81ff('0x30')][_0x81ff('0x1c')]);}_0x19a27a[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x18da8f[_0x81ff('0x30')][_0x81ff('0x38')]);_0x19a27a[_0x81ff('0x39')]=qs[_0x81ff('0x31')](_[_0x81ff('0x3a')](_0x18da8f[_0x81ff('0x30')],_0x3f3b5b[_0x81ff('0x31')]),_0x242601);if(_0x18da8f[_0x81ff('0x30')][_0x81ff('0x3b')]){_0x19a27a[_0x81ff('0x39')]=_[_0x81ff('0x3c')](_0x19a27a[_0x81ff('0x39')],{'$or':_['map'](_0x242601,function(_0x469600){if(_0x469600[_0x81ff('0x3d')]!==_0x81ff('0x3e')){var _0xac7933={};_0xac7933[_0x469600[_0x81ff('0x2a')]]={'$like':'%'+_0x18da8f['query'][_0x81ff('0x3b')]+'%'};return _0xac7933;}})});}_0x19a27a=_[_0x81ff('0x3c')]({},_0x19a27a,_0x18da8f[_0x81ff('0x3f')]);var _0x4e0a80={'where':_0x19a27a['where']};return db[_0x81ff('0x40')][_0x81ff('0x1f')](_0x4e0a80)['then'](function(_0x5a389e){_0x3b4759[_0x81ff('0x1f')]=_0x5a389e;if(_0x18da8f['query'][_0x81ff('0x41')]){_0x19a27a[_0x81ff('0x42')]=[{'all':!![]}];}return db[_0x81ff('0x40')][_0x81ff('0x43')](_0x19a27a);})[_0x81ff('0x28')](function(_0x419fed){_0x3b4759[_0x81ff('0x44')]=_0x419fed;return _0x3b4759;})[_0x81ff('0x28')](respondWithFilteredResult(_0x13f6e0,_0x19a27a))[_0x81ff('0x45')](handleError(_0x13f6e0,null));};exports[_0x81ff('0x46')]=function(_0x30b03a,_0x11f1d3){var _0xc358b1={'raw':![],'where':{'id':_0x30b03a[_0x81ff('0x47')]['id']}},_0xc97eec={};_0xc97eec[_0x81ff('0x2f')]=_['keys'](db[_0x81ff('0x40')]['rawAttributes']);_0xc97eec['query']=_[_0x81ff('0x48')](_0x30b03a[_0x81ff('0x30')]);_0xc97eec[_0x81ff('0x31')]=_['intersection'](_0xc97eec['model'],_0xc97eec['query']);_0xc358b1[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0xc97eec[_0x81ff('0x2f')],qs[_0x81ff('0x34')](_0x30b03a['query'][_0x81ff('0x34')]));_0xc358b1[_0x81ff('0x33')]=_0xc358b1[_0x81ff('0x33')][_0x81ff('0x35')]?_0xc358b1[_0x81ff('0x33')]:_0xc97eec[_0x81ff('0x2f')];if(_0x30b03a[_0x81ff('0x30')]['includeAll']){_0xc358b1[_0x81ff('0x42')]=[{'all':!![]}];}_0xc358b1=_[_0x81ff('0x3c')]({},_0xc358b1,_0x30b03a[_0x81ff('0x3f')]);return db[_0x81ff('0x40')][_0x81ff('0x49')](_0xc358b1)[_0x81ff('0x28')](handleEntityNotFound(_0x11f1d3,null))[_0x81ff('0x28')](respondWithResult(_0x11f1d3,null))['catch'](handleError(_0x11f1d3,null));};exports[_0x81ff('0x4a')]=function(_0x598fdf,_0x55b8b6){return db[_0x81ff('0x40')][_0x81ff('0x4a')](_0x598fdf[_0x81ff('0x4b')],{})[_0x81ff('0x28')](function(_0x40b78e){var _0x587b58=_0x598fdf[_0x81ff('0x4c')][_0x81ff('0x26')]({'plain':!![]});if(!_0x587b58)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x587b58[_0x81ff('0x4d')]==='user'){var _0x1f3c53=_0x40b78e[_0x81ff('0x26')]({'plain':!![]});var _0x3d12f6='IvrCampaigns';return db[_0x81ff('0x4e')][_0x81ff('0x49')]({'where':{'name':_0x3d12f6,'userProfileId':_0x587b58[_0x81ff('0x4f')]},'raw':!![]})['then'](function(_0x336062){if(_0x336062&&_0x336062[_0x81ff('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f3c53[_0x81ff('0x2a')],'resourceId':_0x1f3c53['id'],'type':_0x336062[_0x81ff('0x2a')],'sectionId':_0x336062['id']},{})[_0x81ff('0x28')](function(){return _0x40b78e;});}else{return _0x40b78e;}})['catch'](function(_0x42c534){logger[_0x81ff('0x51')](_0x81ff('0x52'),_0x42c534);throw _0x42c534;});}return _0x40b78e;})['then'](respondWithResult(_0x55b8b6,0xc9))[_0x81ff('0x45')](handleError(_0x55b8b6,null));};exports[_0x81ff('0x53')]=function(_0x216a06,_0x40d477){var _0x2bc1cb={'where':{'id':_0x216a06[_0x81ff('0x47')]['id']}},_0x43e9d5={};_0x43e9d5['model']=_['keys'](db[_0x81ff('0x40')]['rawAttributes']);_0x2bc1cb[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x43e9d5['model'],qs[_0x81ff('0x34')](_0x216a06['query'][_0x81ff('0x34')]));_0x2bc1cb[_0x81ff('0x33')]=_0x2bc1cb[_0x81ff('0x33')][_0x81ff('0x35')]?_0x2bc1cb[_0x81ff('0x33')]:_0x43e9d5[_0x81ff('0x2f')];if(_0x216a06[_0x81ff('0x30')][_0x81ff('0x41')]){_0x2bc1cb['include']=[{'all':!![]}];}_0x2bc1cb=_[_0x81ff('0x3c')]({},_0x2bc1cb,_0x216a06['options']);return db[_0x81ff('0x40')][_0x81ff('0x49')](_0x2bc1cb)[_0x81ff('0x28')](handleEntityNotFound(_0x40d477,null))[_0x81ff('0x28')](function(_0xcde352){if(_0xcde352){var _0x4c2efa=_0xcde352[_0x81ff('0x26')]({'plain':!![]});_0x4c2efa=qs[_0x81ff('0x54')](_0x4c2efa,['id',_0x81ff('0x55'),_0x81ff('0x56')]);_0x216a06[_0x81ff('0x4b')]=_[_0x81ff('0x54')](_0x216a06[_0x81ff('0x4b')],['id',_0x81ff('0x55'),_0x81ff('0x56')]);return db[_0x81ff('0x40')][_0x81ff('0x4a')](_[_0x81ff('0x3c')](_0x4c2efa,_0x216a06[_0x81ff('0x4b')]),{'include':_0x216a06[_0x81ff('0x30')][_0x81ff('0x41')]?[{'all':!![]}]:undefined})[_0x81ff('0x28')](function(_0x28a01d){var _0x2162a6=_0x216a06['user'][_0x81ff('0x26')]({'plain':!![]});if(!_0x2162a6)throw new Error(_0x81ff('0x57'));if(_0x2162a6[_0x81ff('0x4d')]===_0x81ff('0x4c')){var _0x5278cb=_0x28a01d[_0x81ff('0x26')]({'plain':!![]});var _0x2eb6c1=_0x81ff('0x27');return db['UserProfileSection'][_0x81ff('0x49')]({'where':{'name':_0x2eb6c1,'userProfileId':_0x2162a6[_0x81ff('0x4f')]},'raw':!![]})[_0x81ff('0x28')](function(_0x5f18ef){if(_0x5f18ef&&_0x5f18ef['autoAssociation']===0x0){return db[_0x81ff('0x58')]['create']({'name':_0x5278cb['name'],'resourceId':_0x5278cb['id'],'type':_0x5f18ef[_0x81ff('0x2a')],'sectionId':_0x5f18ef['id']},{})['then'](function(){return _0x28a01d;});}else{return _0x28a01d;}})[_0x81ff('0x45')](function(_0x5640ab){logger['error'](_0x81ff('0x52'),_0x5640ab);throw _0x5640ab;});}return _0x28a01d;});}})[_0x81ff('0x28')](respondWithResult(_0x40d477,0xc9))[_0x81ff('0x45')](handleError(_0x40d477,null));};exports['update']=function(_0x3f2537,_0x5e3a7a){if(_0x3f2537[_0x81ff('0x4b')]['id']){delete _0x3f2537[_0x81ff('0x4b')]['id'];}return db[_0x81ff('0x40')]['find']({'where':{'id':_0x3f2537['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x5e3a7a,null))['then'](saveUpdates(_0x3f2537['body'],null))['then'](respondWithResult(_0x5e3a7a,null))[_0x81ff('0x45')](handleError(_0x5e3a7a,null));};exports[_0x81ff('0x25')]=function(_0xb1d91c,_0xe26791){return db['Campaign']['find']({'where':{'id':_0xb1d91c[_0x81ff('0x47')]['id']}})['then'](handleEntityNotFound(_0xe26791,null))['then'](removeEntity(_0xe26791,null))[_0x81ff('0x45')](handleError(_0xe26791,null));};exports['getHoppers']=function(_0x3f6188,_0x154993,_0x1af581){var _0x116f01={'raw':!![],'where':{}};var _0x1f1a73={};var _0x17e477={'count':0x0,'rows':[]};return db[_0x81ff('0x40')][_0x81ff('0x59')]({'where':{'id':_0x3f6188['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x154993,null))[_0x81ff('0x28')](function(_0x372c53){if(_0x372c53){_0x1f1a73[_0x81ff('0x2f')]=_[_0x81ff('0x48')](db[_0x81ff('0x5a')][_0x81ff('0x2d')]);_0x1f1a73[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x3f6188[_0x81ff('0x30')]);_0x1f1a73[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x1f1a73['model'],_0x1f1a73[_0x81ff('0x30')]);_0x116f01[_0x81ff('0x33')]=_['intersection'](_0x1f1a73['model'],qs['fields'](_0x3f6188[_0x81ff('0x30')]['fields']));_0x116f01[_0x81ff('0x33')]=_0x116f01[_0x81ff('0x33')]['length']?_0x116f01['attributes']:_0x1f1a73[_0x81ff('0x2f')];if(!_0x3f6188[_0x81ff('0x30')][_0x81ff('0x36')](_0x81ff('0x5b'))){_0x116f01[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x3f6188[_0x81ff('0x30')]['limit']);_0x116f01[_0x81ff('0x1c')]=qs[_0x81ff('0x1c')](_0x3f6188[_0x81ff('0x30')][_0x81ff('0x1c')]);}_0x116f01[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x3f6188[_0x81ff('0x30')][_0x81ff('0x38')]);_0x116f01[_0x81ff('0x39')]=qs['filters'](_[_0x81ff('0x3a')](_0x3f6188['query'],_0x1f1a73[_0x81ff('0x31')]));_0x116f01[_0x81ff('0x39')]['CampaignId']=_0x372c53['id'];if(_0x3f6188[_0x81ff('0x30')]['filter']){_0x116f01[_0x81ff('0x39')]=_['merge'](_0x116f01[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x116f01[_0x81ff('0x33')],function(_0x2bb14b){var _0x30a5b2={};_0x30a5b2[_0x2bb14b]={'$like':'%'+_0x3f6188[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x30a5b2;})});}_0x116f01=_[_0x81ff('0x3c')]({},_0x116f01,_0x3f6188[_0x81ff('0x3f')]);return db['CmHopper'][_0x81ff('0x1f')]({'where':_0x116f01[_0x81ff('0x39')]})['then'](function(_0x4ff438){_0x17e477[_0x81ff('0x1f')]=_0x4ff438;if(_0x3f6188[_0x81ff('0x30')][_0x81ff('0x41')]){_0x116f01['include']=[{'all':!![]}];}return db[_0x81ff('0x5a')][_0x81ff('0x43')](_0x116f01);})[_0x81ff('0x28')](function(_0x476fbb){_0x17e477[_0x81ff('0x44')]=_0x476fbb;return _0x17e477;});}})[_0x81ff('0x28')](respondWithFilteredResult(_0x154993,_0x116f01))['catch'](handleError(_0x154993,null));};exports['getHopperHistories']=function(_0x29fb69,_0x3233eb,_0x2db057){var _0xb47fcf={'raw':!![],'where':{}};var _0xe5d091={};var _0x2dacc0={'count':0x0,'rows':[]};return db['Campaign'][_0x81ff('0x59')]({'where':{'id':_0x29fb69['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x3233eb,null))[_0x81ff('0x28')](function(_0xa4d0fe){if(_0xa4d0fe){_0xe5d091[_0x81ff('0x2f')]=_['keys'](db[_0x81ff('0x5c')][_0x81ff('0x2d')]);_0xe5d091[_0x81ff('0x30')]=_['keys'](_0x29fb69[_0x81ff('0x30')]);_0xe5d091['filters']=_['intersection'](_0xe5d091['model'],_0xe5d091['query']);_0xb47fcf['attributes']=_['intersection'](_0xe5d091[_0x81ff('0x2f')],qs[_0x81ff('0x34')](_0x29fb69[_0x81ff('0x30')][_0x81ff('0x34')]));_0xb47fcf[_0x81ff('0x33')]=_0xb47fcf[_0x81ff('0x33')][_0x81ff('0x35')]?_0xb47fcf[_0x81ff('0x33')]:_0xe5d091[_0x81ff('0x2f')];if(!_0x29fb69[_0x81ff('0x30')][_0x81ff('0x36')](_0x81ff('0x5b'))){_0xb47fcf[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x29fb69[_0x81ff('0x30')]['limit']);_0xb47fcf[_0x81ff('0x1c')]=qs[_0x81ff('0x1c')](_0x29fb69[_0x81ff('0x30')][_0x81ff('0x1c')]);}_0xb47fcf['order']=qs[_0x81ff('0x38')](_0x29fb69[_0x81ff('0x30')][_0x81ff('0x38')]);_0xb47fcf[_0x81ff('0x39')]=qs[_0x81ff('0x31')](_[_0x81ff('0x3a')](_0x29fb69[_0x81ff('0x30')],_0xe5d091[_0x81ff('0x31')]));_0xb47fcf[_0x81ff('0x39')][_0x81ff('0x5d')]=_0xa4d0fe['id'];if(_0x29fb69[_0x81ff('0x30')]['filter']){_0xb47fcf[_0x81ff('0x39')]=_['merge'](_0xb47fcf[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0xb47fcf[_0x81ff('0x33')],function(_0xeabd7){var _0x3d060d={};_0x3d060d[_0xeabd7]={'$like':'%'+_0x29fb69[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x3d060d;})});}_0xb47fcf=_['merge']({},_0xb47fcf,_0x29fb69[_0x81ff('0x3f')]);return db[_0x81ff('0x5c')][_0x81ff('0x1f')]({'where':_0xb47fcf[_0x81ff('0x39')]})[_0x81ff('0x28')](function(_0x24b915){_0x2dacc0[_0x81ff('0x1f')]=_0x24b915;if(_0x29fb69[_0x81ff('0x30')][_0x81ff('0x41')]){_0xb47fcf[_0x81ff('0x42')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xb47fcf);})[_0x81ff('0x28')](function(_0x43def8){_0x2dacc0[_0x81ff('0x44')]=_0x43def8;return _0x2dacc0;});}})['then'](respondWithFilteredResult(_0x3233eb,_0xb47fcf))[_0x81ff('0x45')](handleError(_0x3233eb,null));};exports[_0x81ff('0x5e')]=function(_0x53cd81,_0x48bdda,_0x4da769){var _0x3532a8={'raw':!![],'where':{}};var _0x51f5cf={};var _0x26adcb={'count':0x0,'rows':[]};return db['Campaign'][_0x81ff('0x59')]({'where':{'id':_0x53cd81['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x48bdda,null))[_0x81ff('0x28')](function(_0x5b0e0b){if(_0x5b0e0b){_0x51f5cf[_0x81ff('0x2f')]=_['keys'](db['CmHopperFinal'][_0x81ff('0x2d')]);_0x51f5cf[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x53cd81[_0x81ff('0x30')]);_0x51f5cf[_0x81ff('0x31')]=_['intersection'](_0x51f5cf['model'],_0x51f5cf[_0x81ff('0x30')]);_0x3532a8[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x51f5cf[_0x81ff('0x2f')],qs['fields'](_0x53cd81['query'][_0x81ff('0x34')]));_0x3532a8[_0x81ff('0x33')]=_0x3532a8['attributes'][_0x81ff('0x35')]?_0x3532a8[_0x81ff('0x33')]:_0x51f5cf[_0x81ff('0x2f')];if(!_0x53cd81[_0x81ff('0x30')][_0x81ff('0x36')](_0x81ff('0x5b'))){_0x3532a8[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x53cd81[_0x81ff('0x30')][_0x81ff('0x1e')]);_0x3532a8['offset']=qs[_0x81ff('0x1c')](_0x53cd81['query'][_0x81ff('0x1c')]);}_0x3532a8[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x53cd81['query'][_0x81ff('0x38')]);_0x3532a8['where']=qs[_0x81ff('0x31')](_[_0x81ff('0x3a')](_0x53cd81['query'],_0x51f5cf[_0x81ff('0x31')]));_0x3532a8[_0x81ff('0x39')]['CampaignId']=_0x5b0e0b['id'];if(_0x53cd81['query'][_0x81ff('0x3b')]){_0x3532a8[_0x81ff('0x39')]=_[_0x81ff('0x3c')](_0x3532a8[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x3532a8['attributes'],function(_0x157e9a){var _0x571004={};_0x571004[_0x157e9a]={'$like':'%'+_0x53cd81[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x571004;})});}_0x3532a8=_['merge']({},_0x3532a8,_0x53cd81[_0x81ff('0x3f')]);return db[_0x81ff('0x5f')]['count']({'where':_0x3532a8[_0x81ff('0x39')]})[_0x81ff('0x28')](function(_0x21518d){_0x26adcb[_0x81ff('0x1f')]=_0x21518d;if(_0x53cd81[_0x81ff('0x30')][_0x81ff('0x41')]){_0x3532a8[_0x81ff('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x81ff('0x43')](_0x3532a8);})[_0x81ff('0x28')](function(_0x5101c2){_0x26adcb[_0x81ff('0x44')]=_0x5101c2;return _0x26adcb;});}})['then'](respondWithFilteredResult(_0x48bdda,_0x3532a8))['catch'](handleError(_0x48bdda,null));};exports[_0x81ff('0x60')]=function(_0x565bb4,_0x33edac,_0x452260){var _0x5a4e69={'raw':!![],'where':{}};var _0x31fa1d={};var _0xcc7f3d={'count':0x0,'rows':[]};return db[_0x81ff('0x40')]['findOne']({'where':{'id':_0x565bb4[_0x81ff('0x47')]['id']}})['then'](handleEntityNotFound(_0x33edac,null))[_0x81ff('0x28')](function(_0xc68b65){if(_0xc68b65){_0x31fa1d[_0x81ff('0x2f')]=_[_0x81ff('0x48')](db['CmHopperBlack']['rawAttributes']);_0x31fa1d[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x565bb4[_0x81ff('0x30')]);_0x31fa1d[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x31fa1d[_0x81ff('0x2f')],_0x31fa1d[_0x81ff('0x30')]);_0x5a4e69[_0x81ff('0x33')]=_['intersection'](_0x31fa1d['model'],qs[_0x81ff('0x34')](_0x565bb4[_0x81ff('0x30')][_0x81ff('0x34')]));_0x5a4e69[_0x81ff('0x33')]=_0x5a4e69[_0x81ff('0x33')][_0x81ff('0x35')]?_0x5a4e69[_0x81ff('0x33')]:_0x31fa1d[_0x81ff('0x2f')];if(!_0x565bb4['query'][_0x81ff('0x36')](_0x81ff('0x5b'))){_0x5a4e69[_0x81ff('0x1e')]=qs['limit'](_0x565bb4[_0x81ff('0x30')]['limit']);_0x5a4e69['offset']=qs['offset'](_0x565bb4['query'][_0x81ff('0x1c')]);}_0x5a4e69[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x565bb4[_0x81ff('0x30')][_0x81ff('0x38')]);_0x5a4e69[_0x81ff('0x39')]=qs['filters'](_[_0x81ff('0x3a')](_0x565bb4[_0x81ff('0x30')],_0x31fa1d['filters']));_0x5a4e69['where'][_0x81ff('0x5d')]=_0xc68b65['id'];if(_0x565bb4['query'][_0x81ff('0x3b')]){_0x5a4e69[_0x81ff('0x39')]=_[_0x81ff('0x3c')](_0x5a4e69[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x5a4e69[_0x81ff('0x33')],function(_0x4abb98){var _0x331154={};_0x331154[_0x4abb98]={'$like':'%'+_0x565bb4[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x331154;})});}_0x5a4e69=_['merge']({},_0x5a4e69,_0x565bb4[_0x81ff('0x3f')]);return db[_0x81ff('0x61')][_0x81ff('0x1f')]({'where':_0x5a4e69['where']})[_0x81ff('0x28')](function(_0x11c6e6){_0xcc7f3d[_0x81ff('0x1f')]=_0x11c6e6;if(_0x565bb4[_0x81ff('0x30')][_0x81ff('0x41')]){_0x5a4e69[_0x81ff('0x42')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x81ff('0x43')](_0x5a4e69);})['then'](function(_0x3425c6){_0xcc7f3d['rows']=_0x3425c6;return _0xcc7f3d;});}})['then'](respondWithFilteredResult(_0x33edac,_0x5a4e69))[_0x81ff('0x45')](handleError(_0x33edac,null));};exports[_0x81ff('0x62')]=function(_0x378ee7,_0x5be860,_0x3f0201){var _0x32f280={};var _0x725863={};var _0x50a992;var _0x281c87;return db[_0x81ff('0x40')]['findOne']({'where':{'id':_0x378ee7[_0x81ff('0x47')]['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x5be860,null))[_0x81ff('0x28')](function(_0x181147){if(_0x181147){_0x50a992=_0x181147;_0x725863[_0x81ff('0x2f')]=_[_0x81ff('0x48')](db[_0x81ff('0x63')][_0x81ff('0x2d')]);_0x725863[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x378ee7[_0x81ff('0x30')]);_0x725863['filters']=_[_0x81ff('0x32')](_0x725863[_0x81ff('0x2f')],_0x725863['query']);_0x32f280[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x725863[_0x81ff('0x2f')],qs['fields'](_0x378ee7['query'][_0x81ff('0x34')]));_0x32f280[_0x81ff('0x33')]=_0x32f280['attributes'][_0x81ff('0x35')]?_0x32f280[_0x81ff('0x33')]:_0x725863[_0x81ff('0x2f')];_0x32f280[_0x81ff('0x37')]=qs[_0x81ff('0x38')](_0x378ee7['query'][_0x81ff('0x38')]);_0x32f280[_0x81ff('0x39')]=qs['filters'](_[_0x81ff('0x3a')](_0x378ee7[_0x81ff('0x30')],_0x725863[_0x81ff('0x31')]));if(_0x378ee7[_0x81ff('0x30')][_0x81ff('0x3b')]){_0x32f280['where']=_[_0x81ff('0x3c')](_0x32f280[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x32f280[_0x81ff('0x33')],function(_0x308a47){var _0x35738d={};_0x35738d[_0x308a47]={'$like':'%'+_0x378ee7[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x35738d;})});}_0x32f280=_['merge']({},_0x32f280,_0x378ee7['options']);return _0x50a992[_0x81ff('0x62')](_0x32f280);}})[_0x81ff('0x28')](function(_0x3cb63c){if(_0x3cb63c){_0x281c87=_0x3cb63c[_0x81ff('0x35')];if(!_0x378ee7[_0x81ff('0x30')][_0x81ff('0x36')]('nolimit')){_0x32f280[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x378ee7['query'][_0x81ff('0x1e')]);_0x32f280[_0x81ff('0x1c')]=qs[_0x81ff('0x1c')](_0x378ee7[_0x81ff('0x30')]['offset']);}return _0x50a992['getLists'](_0x32f280);}})[_0x81ff('0x28')](function(_0x1a6abb){if(_0x1a6abb){return _0x1a6abb?{'count':_0x281c87,'rows':_0x1a6abb}:null;}})['then'](respondWithResult(_0x5be860,null))['catch'](handleError(_0x5be860,null));};exports[_0x81ff('0x64')]=function(_0x67e35c,_0x406a3e,_0x13d2d5){var _0x44777c,_0x2a05ae;return db[_0x81ff('0x40')][_0x81ff('0x49')]({'where':{'id':_0x67e35c['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x406a3e,null))[_0x81ff('0x28')](function(_0xe8a8ff){if(_0xe8a8ff){_0x2a05ae=_0xe8a8ff;return _0xe8a8ff[_0x81ff('0x64')](_0x67e35c[_0x81ff('0x4b')][_0x81ff('0x65')],_['omit'](_0x67e35c['body'],[_0x81ff('0x65'),'id'])||{});}return null;})[_0x81ff('0x66')](function(_0x4a95e2){var _0x274ba0;_0x44777c=_0x4a95e2||[];var _0x3a22b0=[];if(_0x4a95e2){for(var _0x167ecd=0x0;_0x167ecd<_0x4a95e2[_0x81ff('0x35')];_0x167ecd+=0x1){var _0xd0cbfb=_0x4a95e2[_0x167ecd][_0x81ff('0x26')]({'plain':!![]});_0x2a05ae[_0x81ff('0x67')]=_0x67e35c[_0x81ff('0x4b')][_0x81ff('0x67')]?_0x67e35c[_0x81ff('0x4b')][_0x81ff('0x67')]:_0x2a05ae[_0x81ff('0x67')];switch(_0x2a05ae[_0x81ff('0x67')]){case _0x81ff('0x68'):_0x274ba0=squel['insert']()[_0x81ff('0x69')](_0x81ff('0x6a'))[_0x81ff('0x6b')]([_0x81ff('0x6c'),'scheduledAt',_0x81ff('0x6d'),'ListId','CampaignId',_0x81ff('0x55'),'updatedAt'],squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x6c'),_0x81ff('0x6c'))[_0x81ff('0x6f')]('NOW()',_0x81ff('0x70'))[_0x81ff('0x6f')]('id',_0x81ff('0x6d'))['field'](_0xd0cbfb[_0x81ff('0x71')][_0x81ff('0x72')](),_0x81ff('0x73'))[_0x81ff('0x6f')](_0x67e35c[_0x81ff('0x47')]['id']['toString'](),'CampaignId')[_0x81ff('0x6f')]('NOW()',_0x81ff('0x55'))['field'](_0x81ff('0x74'),_0x81ff('0x56'))['from']('cm_contacts')[_0x81ff('0x39')](_0x81ff('0x75'))[_0x81ff('0x39')](_0x81ff('0x76'),_0xd0cbfb[_0x81ff('0x71')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x81ff('0x39')](_0x81ff('0x77'),squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x78'))['from'](_0x81ff('0x79'))['where'](_0x81ff('0x7a'),_0x67e35c[_0x81ff('0x47')]['id']['toString']()))[_0x81ff('0x39')](_0x81ff('0x77'),squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x7b'))[_0x81ff('0x7c')]('cm_hopper')[_0x81ff('0x39')]('CampaignId\x20=\x20?',_0x67e35c[_0x81ff('0x47')]['id'][_0x81ff('0x72')]())))['toString']();break;case _0x81ff('0x7d'):_0x274ba0=squel['insert']()[_0x81ff('0x69')](_0x81ff('0x6a'))['fromQuery']([_0x81ff('0x6c'),_0x81ff('0x70'),'ContactId','ListId',_0x81ff('0x5d'),'createdAt',_0x81ff('0x56')],squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')]('phone',_0x81ff('0x6c'))[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x70'))['field']('id',_0x81ff('0x6d'))[_0x81ff('0x6f')](_0xd0cbfb[_0x81ff('0x71')][_0x81ff('0x72')](),'ListId')[_0x81ff('0x6f')](_0x67e35c['params']['id'][_0x81ff('0x72')](),_0x81ff('0x5d'))[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x55'))[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x56'))[_0x81ff('0x7c')](_0x81ff('0x7e'))[_0x81ff('0x39')](_0x81ff('0x75'))['where']('ListId\x20=\x20?',_0xd0cbfb[_0x81ff('0x71')][_0x81ff('0x72')]())[_0x81ff('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x81ff('0x39')](_0x81ff('0x77'),squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x7b'))[_0x81ff('0x7c')]('cm_hopper')[_0x81ff('0x39')](_0x81ff('0x7a'),_0x67e35c[_0x81ff('0x47')]['id'][_0x81ff('0x72')]())))[_0x81ff('0x72')]();break;default:_0x274ba0=squel[_0x81ff('0x7f')]()['into'](_0x81ff('0x6a'))['fromQuery']([_0x81ff('0x6c'),_0x81ff('0x70'),'ContactId',_0x81ff('0x73'),'CampaignId','createdAt',_0x81ff('0x56')],squel['select']()['field'](_0x81ff('0x6c'),'phone')[_0x81ff('0x6f')]('NOW()','scheduledAt')[_0x81ff('0x6f')]('id',_0x81ff('0x6d'))[_0x81ff('0x6f')](_0xd0cbfb[_0x81ff('0x71')][_0x81ff('0x72')](),_0x81ff('0x73'))[_0x81ff('0x6f')](_0x67e35c[_0x81ff('0x47')]['id'][_0x81ff('0x72')](),'CampaignId')[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x55'))[_0x81ff('0x6f')]('NOW()',_0x81ff('0x56'))['from'](_0x81ff('0x7e'))['where']('deletedAt\x20IS\x20NULL')[_0x81ff('0x39')](_0x81ff('0x76'),_0xd0cbfb[_0x81ff('0x71')]['toString']())['where'](_0x81ff('0x80')))[_0x81ff('0x72')]();}_0x3a22b0[_0x81ff('0x81')](db[_0x81ff('0x82')][_0x81ff('0x30')](_0x274ba0));}return BPromise[_0x81ff('0x83')](_0x3a22b0);}})[_0x81ff('0x28')](function(){return _0x44777c;})['then'](respondWithResult(_0x406a3e,null))[_0x81ff('0x45')](handleError(_0x406a3e,null));};exports['removeLists']=function(_0x4d1592,_0x3e13f2,_0x413f40){return db[_0x81ff('0x40')][_0x81ff('0x49')]({'where':{'id':_0x4d1592[_0x81ff('0x47')]['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x3e13f2,null))[_0x81ff('0x28')](function(_0x454dce){if(_0x454dce){return _0x454dce[_0x81ff('0x84')](_0x4d1592[_0x81ff('0x30')][_0x81ff('0x65')]);}})[_0x81ff('0x28')](function(_0x1afcf2){if(_0x1afcf2){return db[_0x81ff('0x5a')][_0x81ff('0x25')]({'where':{'ListId':_0x4d1592['query']['ids'],'CampaignId':_0x4d1592[_0x81ff('0x47')]['id']}})[_0x81ff('0x28')](function(){return _0x1afcf2;});}})['then'](respondWithStatusCode(_0x3e13f2,null))['catch'](handleError(_0x3e13f2,null));};exports[_0x81ff('0x85')]=function(_0x1be4aa,_0x72af27,_0x5978ce){var _0x1e9b90={};var _0x48490a={};var _0x118168;var _0xa59037;return db[_0x81ff('0x40')]['findOne']({'where':{'id':_0x1be4aa[_0x81ff('0x47')]['id']}})['then'](handleEntityNotFound(_0x72af27,null))['then'](function(_0x49846d){if(_0x49846d){_0x118168=_0x49846d;_0x48490a[_0x81ff('0x2f')]=_[_0x81ff('0x48')](db[_0x81ff('0x63')]['rawAttributes']);_0x48490a[_0x81ff('0x30')]=_[_0x81ff('0x48')](_0x1be4aa[_0x81ff('0x30')]);_0x48490a[_0x81ff('0x31')]=_[_0x81ff('0x32')](_0x48490a[_0x81ff('0x2f')],_0x48490a['query']);_0x1e9b90[_0x81ff('0x33')]=_[_0x81ff('0x32')](_0x48490a[_0x81ff('0x2f')],qs[_0x81ff('0x34')](_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x34')]));_0x1e9b90[_0x81ff('0x33')]=_0x1e9b90[_0x81ff('0x33')][_0x81ff('0x35')]?_0x1e9b90[_0x81ff('0x33')]:_0x48490a[_0x81ff('0x2f')];_0x1e9b90['order']=qs[_0x81ff('0x38')](_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x38')]);_0x1e9b90[_0x81ff('0x39')]=qs[_0x81ff('0x31')](_[_0x81ff('0x3a')](_0x1be4aa['query'],_0x48490a[_0x81ff('0x31')]));if(_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x3b')]){_0x1e9b90[_0x81ff('0x39')]=_[_0x81ff('0x3c')](_0x1e9b90[_0x81ff('0x39')],{'$or':_[_0x81ff('0x2c')](_0x1e9b90[_0x81ff('0x33')],function(_0xf82452){var _0x2640ef={};_0x2640ef[_0xf82452]={'$like':'%'+_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x3b')]+'%'};return _0x2640ef;})});}_0x1e9b90=_[_0x81ff('0x3c')]({},_0x1e9b90,_0x1be4aa['options']);return _0x118168[_0x81ff('0x85')](_0x1e9b90);}})['then'](function(_0x12e5ab){if(_0x12e5ab){_0xa59037=_0x12e5ab[_0x81ff('0x35')];if(!_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x36')](_0x81ff('0x5b'))){_0x1e9b90[_0x81ff('0x1e')]=qs[_0x81ff('0x1e')](_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x1e')]);_0x1e9b90[_0x81ff('0x1c')]=qs['offset'](_0x1be4aa[_0x81ff('0x30')][_0x81ff('0x1c')]);}return _0x118168[_0x81ff('0x85')](_0x1e9b90);}})['then'](function(_0x272adf){if(_0x272adf){return _0x272adf?{'count':_0xa59037,'rows':_0x272adf}:null;}})[_0x81ff('0x28')](respondWithResult(_0x72af27,null))[_0x81ff('0x45')](handleError(_0x72af27,null));};exports[_0x81ff('0x86')]=function(_0x568a56,_0x535b22,_0x4c457d){var _0x5b0ae5,_0x4a4a72;return db['Campaign'][_0x81ff('0x49')]({'where':{'id':_0x568a56[_0x81ff('0x47')]['id']}})['then'](handleEntityNotFound(_0x535b22,null))[_0x81ff('0x28')](function(_0x48d0a6){if(_0x48d0a6){_0x4a4a72=_0x48d0a6;return _0x48d0a6['addBlackLists'](_0x568a56[_0x81ff('0x4b')][_0x81ff('0x65')],_[_0x81ff('0x54')](_0x568a56[_0x81ff('0x4b')],['ids','id'])||{});}return null;})[_0x81ff('0x66')](function(_0x133406){var _0x447b5f;_0x5b0ae5=_0x133406||[];var _0x130cbd=[];if(_0x133406){for(var _0x311345=0x0;_0x311345<_0x133406[_0x81ff('0x35')];_0x311345+=0x1){var _0x21d154=_0x133406[_0x311345][_0x81ff('0x26')]({'plain':!![]});_0x447b5f=squel[_0x81ff('0x7f')]()['into']('cm_hopper_black')[_0x81ff('0x6b')]([_0x81ff('0x6c'),_0x81ff('0x6d'),_0x81ff('0x73'),'CampaignId',_0x81ff('0x55'),_0x81ff('0x56')],squel[_0x81ff('0x6e')]()[_0x81ff('0x6f')](_0x81ff('0x6c'),_0x81ff('0x6c'))[_0x81ff('0x6f')]('id',_0x81ff('0x6d'))[_0x81ff('0x6f')](_0x21d154[_0x81ff('0x71')][_0x81ff('0x72')](),_0x81ff('0x73'))[_0x81ff('0x6f')](_0x568a56[_0x81ff('0x47')]['id'][_0x81ff('0x72')](),'CampaignId')['field'](_0x81ff('0x74'),_0x81ff('0x55'))[_0x81ff('0x6f')](_0x81ff('0x74'),_0x81ff('0x56'))[_0x81ff('0x7c')](_0x81ff('0x7e'))['where'](_0x81ff('0x75'))[_0x81ff('0x39')](_0x81ff('0x76'),_0x21d154[_0x81ff('0x71')][_0x81ff('0x72')]())[_0x81ff('0x39')](_0x81ff('0x80')))['toString']();_0x130cbd[_0x81ff('0x81')](db[_0x81ff('0x82')][_0x81ff('0x30')](_0x447b5f));}return BPromise['all'](_0x130cbd);}})['then'](function(){return _0x5b0ae5;})[_0x81ff('0x28')](respondWithResult(_0x535b22,null))[_0x81ff('0x45')](handleError(_0x535b22,null));};exports[_0x81ff('0x87')]=function(_0x59df34,_0x60a55a,_0x33ddf9){return db[_0x81ff('0x40')][_0x81ff('0x49')]({'where':{'id':_0x59df34['params']['id']}})[_0x81ff('0x28')](handleEntityNotFound(_0x60a55a,null))[_0x81ff('0x28')](function(_0x3647cd){if(_0x3647cd){return _0x3647cd['removeBlackLists'](_0x59df34['query']['ids']);}})[_0x81ff('0x28')](function(_0x9b562){if(_0x9b562){return db['CmHopperBlack'][_0x81ff('0x25')]({'where':{'ListId':_0x59df34[_0x81ff('0x30')][_0x81ff('0x65')],'CampaignId':_0x59df34[_0x81ff('0x47')]['id']}})['then'](function(){return _0x9b562;});}})[_0x81ff('0x28')](respondWithStatusCode(_0x60a55a,null))[_0x81ff('0x45')](handleError(_0x60a55a,null));};
\ No newline at end of file
+var _0xd8d0=['userProfileId','getHoppers','findOne','CmHopper','CampaignId','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','scheduledAt','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','sequelize','all','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','destroy','end','name','send','index','map','Campaign','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','IvrCampaigns','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','createdAt','updatedAt','role'];(function(_0xa9671b,_0x11378d){var _0x205591=function(_0x5dc88d){while(--_0x5dc88d){_0xa9671b['push'](_0xa9671b['shift']());}};_0x205591(++_0x11378d);}(_0xd8d0,0x1c0));var _0x0d8d=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xd8d0[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x0d8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d8d('0x1'));var jsonpatch=require(_0x0d8d('0x2'));var rp=require(_0x0d8d('0x3'));var moment=require(_0x0d8d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0d8d('0x5'));var path=require(_0x0d8d('0x6'));var sox=require('sox');var csv=require(_0x0d8d('0x7'));var ejs=require(_0x0d8d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0d8d('0x9'));var squel=require(_0x0d8d('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d8d('0xb'));var deskjs=require(_0x0d8d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0d8d('0xd'));var Papa=require(_0x0d8d('0xe'));var Redis=require(_0x0d8d('0xf'));var authService=require(_0x0d8d('0x10'));var qs=require(_0x0d8d('0x11'));var as=require(_0x0d8d('0x12'));var hardwareService=require(_0x0d8d('0x13'));var logger=require(_0x0d8d('0x14'))(_0x0d8d('0x15'));var utils=require(_0x0d8d('0x16'));var config=require(_0x0d8d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25973a,_0x11864a){_0x11864a=_0x11864a||0xcc;return function(_0x4d53b3){if(_0x4d53b3){return _0x25973a[_0x0d8d('0x18')](_0x11864a);}return _0x25973a[_0x0d8d('0x19')](_0x11864a)['end']();};}function respondWithResult(_0x4e6be5,_0x3f8e82){_0x3f8e82=_0x3f8e82||0xc8;return function(_0x4a1502){if(_0x4a1502){return _0x4e6be5['status'](_0x3f8e82)['json'](_0x4a1502);}};}function respondWithFilteredResult(_0x56c18b,_0x20d7c2){return function(_0x405f36){if(_0x405f36){var _0x2ae99d=typeof _0x20d7c2[_0x0d8d('0x1a')]===_0x0d8d('0x1b')&&typeof _0x20d7c2[_0x0d8d('0x1c')]==='undefined';var _0x56d582=_0x405f36[_0x0d8d('0x1d')];var _0x3a74e6=_0x2ae99d?0x0:_0x20d7c2[_0x0d8d('0x1a')];var _0x56c07e=_0x2ae99d?_0x405f36['count']:_0x20d7c2[_0x0d8d('0x1a')]+_0x20d7c2[_0x0d8d('0x1c')];var _0x106c7e;if(_0x56c07e>=_0x56d582){_0x56c07e=_0x56d582;_0x106c7e=0xc8;}else{_0x106c7e=0xce;}_0x56c18b[_0x0d8d('0x19')](_0x106c7e);return _0x56c18b[_0x0d8d('0x1e')](_0x0d8d('0x1f'),_0x3a74e6+'-'+_0x56c07e+'/'+_0x56d582)[_0x0d8d('0x20')](_0x405f36);}return null;};}function patchUpdates(_0x2379f9){return function(_0x2f6bcc){try{jsonpatch[_0x0d8d('0x21')](_0x2f6bcc,_0x2379f9,!![]);}catch(_0x511cba){return BPromise[_0x0d8d('0x22')](_0x511cba);}return _0x2f6bcc[_0x0d8d('0x23')]();};}function saveUpdates(_0x4106fa,_0x3bcd44){return function(_0x199c84){if(_0x199c84){return _0x199c84[_0x0d8d('0x24')](_0x4106fa)[_0x0d8d('0x25')](function(_0xa28bcb){return _0xa28bcb;});}return null;};}function removeEntity(_0x1940ff,_0x266b4e){return function(_0x47c1d9){if(_0x47c1d9){return _0x47c1d9['destroy']()[_0x0d8d('0x25')](function(){var _0x343e47=_0x47c1d9[_0x0d8d('0x26')]({'plain':!![]});var _0xce2cdd='IvrCampaigns';return db[_0x0d8d('0x27')][_0x0d8d('0x28')]({'where':{'type':_0xce2cdd,'resourceId':_0x343e47['id']}})[_0x0d8d('0x25')](function(){return _0x47c1d9;});})[_0x0d8d('0x25')](function(){_0x1940ff['status'](0xcc)[_0x0d8d('0x29')]();});}};}function handleEntityNotFound(_0x5ea510,_0xf984c4){return function(_0x5d297e){if(!_0x5d297e){_0x5ea510[_0x0d8d('0x18')](0x194);}return _0x5d297e;};}function handleError(_0x5adb10,_0x2febe5){_0x2febe5=_0x2febe5||0x1f4;return function(_0x4610b5){logger['error'](_0x4610b5['stack']);if(_0x4610b5[_0x0d8d('0x2a')]){delete _0x4610b5['name'];}_0x5adb10[_0x0d8d('0x19')](_0x2febe5)[_0x0d8d('0x2b')](_0x4610b5);};}exports[_0x0d8d('0x2c')]=function(_0x52cfb3,_0x5c8b6c){var _0x4413bc={},_0x32ca9a={},_0x3ecaff={'count':0x0,'rows':[]};var _0x87de94=_[_0x0d8d('0x2d')](db[_0x0d8d('0x2e')]['rawAttributes'],function(_0x297435){return{'name':_0x297435[_0x0d8d('0x2f')],'type':_0x297435[_0x0d8d('0x30')]['key']};});_0x32ca9a[_0x0d8d('0x31')]=_[_0x0d8d('0x2d')](_0x87de94,_0x0d8d('0x2a'));_0x32ca9a[_0x0d8d('0x32')]=_['keys'](_0x52cfb3[_0x0d8d('0x32')]);_0x32ca9a[_0x0d8d('0x33')]=_['intersection'](_0x32ca9a[_0x0d8d('0x31')],_0x32ca9a[_0x0d8d('0x32')]);_0x4413bc[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x32ca9a[_0x0d8d('0x31')],qs['fields'](_0x52cfb3['query'][_0x0d8d('0x36')]));_0x4413bc[_0x0d8d('0x34')]=_0x4413bc['attributes'][_0x0d8d('0x37')]?_0x4413bc[_0x0d8d('0x34')]:_0x32ca9a['model'];if(!_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x4413bc[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x4413bc[_0x0d8d('0x1a')]=qs['offset'](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x4413bc[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x4413bc['where']=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0x52cfb3['query'],_0x32ca9a[_0x0d8d('0x33')]),_0x87de94);if(_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x4413bc[_0x0d8d('0x3e')]=_['merge'](_0x4413bc[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x87de94,function(_0x289fc7){if(_0x289fc7[_0x0d8d('0x30')]!==_0x0d8d('0x3f')){var _0x21da3e={};_0x21da3e[_0x289fc7[_0x0d8d('0x2a')]]={'$like':'%'+_0x52cfb3[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x21da3e;}})});}_0x4413bc=_[_0x0d8d('0x40')]({},_0x4413bc,_0x52cfb3[_0x0d8d('0x41')]);var _0x29a2d7={'where':_0x4413bc[_0x0d8d('0x3e')]};return db[_0x0d8d('0x2e')]['count'](_0x29a2d7)[_0x0d8d('0x25')](function(_0x81152c){_0x3ecaff['count']=_0x81152c;if(_0x52cfb3['query']['includeAll']){_0x4413bc[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x2e')][_0x0d8d('0x43')](_0x4413bc);})[_0x0d8d('0x25')](function(_0x309cb6){_0x3ecaff['rows']=_0x309cb6;return _0x3ecaff;})[_0x0d8d('0x25')](respondWithFilteredResult(_0x5c8b6c,_0x4413bc))[_0x0d8d('0x44')](handleError(_0x5c8b6c,null));};exports[_0x0d8d('0x45')]=function(_0x597404,_0x3b5d27){var _0x47cf5b={'raw':![],'where':{'id':_0x597404[_0x0d8d('0x46')]['id']}},_0x4bbaaa={};_0x4bbaaa[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x2e')]['rawAttributes']);_0x4bbaaa[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x597404['query']);_0x4bbaaa[_0x0d8d('0x33')]=_['intersection'](_0x4bbaaa[_0x0d8d('0x31')],_0x4bbaaa[_0x0d8d('0x32')]);_0x47cf5b[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x4bbaaa[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0x597404[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x47cf5b[_0x0d8d('0x34')]=_0x47cf5b[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x47cf5b[_0x0d8d('0x34')]:_0x4bbaaa['model'];if(_0x597404['query'][_0x0d8d('0x48')]){_0x47cf5b[_0x0d8d('0x42')]=[{'all':!![]}];}_0x47cf5b=_['merge']({},_0x47cf5b,_0x597404[_0x0d8d('0x41')]);return db[_0x0d8d('0x2e')]['find'](_0x47cf5b)[_0x0d8d('0x25')](handleEntityNotFound(_0x3b5d27,null))['then'](respondWithResult(_0x3b5d27,null))['catch'](handleError(_0x3b5d27,null));};exports[_0x0d8d('0x49')]=function(_0x378ceb,_0x30b125){return db[_0x0d8d('0x2e')][_0x0d8d('0x49')](_0x378ceb[_0x0d8d('0x4a')],{})[_0x0d8d('0x25')](function(_0xa3ccbc){var _0xeef66e=_0x378ceb['user'][_0x0d8d('0x26')]({'plain':!![]});if(!_0xeef66e)throw new Error(_0x0d8d('0x4b'));if(_0xeef66e['role']===_0x0d8d('0x4c')){var _0x4c6fe8=_0xa3ccbc[_0x0d8d('0x26')]({'plain':!![]});var _0x2eeccc=_0x0d8d('0x4d');return db[_0x0d8d('0x4e')][_0x0d8d('0x4f')]({'where':{'name':_0x2eeccc,'userProfileId':_0xeef66e['userProfileId']},'raw':!![]})['then'](function(_0x3e9a46){if(_0x3e9a46&&_0x3e9a46[_0x0d8d('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c6fe8[_0x0d8d('0x2a')],'resourceId':_0x4c6fe8['id'],'type':_0x3e9a46[_0x0d8d('0x2a')],'sectionId':_0x3e9a46['id']},{})[_0x0d8d('0x25')](function(){return _0xa3ccbc;});}else{return _0xa3ccbc;}})[_0x0d8d('0x44')](function(_0x5fb565){logger[_0x0d8d('0x51')](_0x0d8d('0x52'),_0x5fb565);throw _0x5fb565;});}return _0xa3ccbc;})[_0x0d8d('0x25')](respondWithResult(_0x30b125,0xc9))[_0x0d8d('0x44')](handleError(_0x30b125,null));};exports['clone']=function(_0x4266a3,_0x2bfada){var _0x1b0ec8={'where':{'id':_0x4266a3[_0x0d8d('0x46')]['id']}},_0x10434c={};_0x10434c[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x2e')][_0x0d8d('0x53')]);_0x1b0ec8[_0x0d8d('0x34')]=_['intersection'](_0x10434c['model'],qs[_0x0d8d('0x36')](_0x4266a3[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x1b0ec8['attributes']=_0x1b0ec8[_0x0d8d('0x34')]['length']?_0x1b0ec8[_0x0d8d('0x34')]:_0x10434c[_0x0d8d('0x31')];if(_0x4266a3['query'][_0x0d8d('0x48')]){_0x1b0ec8[_0x0d8d('0x42')]=[{'all':!![]}];}_0x1b0ec8=_[_0x0d8d('0x40')]({},_0x1b0ec8,_0x4266a3['options']);return db['Campaign'][_0x0d8d('0x4f')](_0x1b0ec8)[_0x0d8d('0x25')](handleEntityNotFound(_0x2bfada,null))[_0x0d8d('0x25')](function(_0x63d94c){if(_0x63d94c){var _0x2956d4=_0x63d94c[_0x0d8d('0x26')]({'plain':!![]});_0x2956d4=qs[_0x0d8d('0x54')](_0x2956d4,['id',_0x0d8d('0x55'),_0x0d8d('0x56')]);_0x4266a3['body']=_[_0x0d8d('0x54')](_0x4266a3[_0x0d8d('0x4a')],['id',_0x0d8d('0x55'),_0x0d8d('0x56')]);return db['Campaign'][_0x0d8d('0x49')](_['merge'](_0x2956d4,_0x4266a3['body']),{'include':_0x4266a3[_0x0d8d('0x32')][_0x0d8d('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x1113bc){var _0x22afb9=_0x4266a3[_0x0d8d('0x4c')][_0x0d8d('0x26')]({'plain':!![]});if(!_0x22afb9)throw new Error(_0x0d8d('0x4b'));if(_0x22afb9[_0x0d8d('0x57')]===_0x0d8d('0x4c')){var _0x4582af=_0x1113bc[_0x0d8d('0x26')]({'plain':!![]});var _0x548f29=_0x0d8d('0x4d');return db[_0x0d8d('0x4e')][_0x0d8d('0x4f')]({'where':{'name':_0x548f29,'userProfileId':_0x22afb9[_0x0d8d('0x58')]},'raw':!![]})[_0x0d8d('0x25')](function(_0x4745da){if(_0x4745da&&_0x4745da[_0x0d8d('0x50')]===0x0){return db[_0x0d8d('0x27')][_0x0d8d('0x49')]({'name':_0x4582af[_0x0d8d('0x2a')],'resourceId':_0x4582af['id'],'type':_0x4745da[_0x0d8d('0x2a')],'sectionId':_0x4745da['id']},{})[_0x0d8d('0x25')](function(){return _0x1113bc;});}else{return _0x1113bc;}})[_0x0d8d('0x44')](function(_0x4ba180){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ba180);throw _0x4ba180;});}return _0x1113bc;});}})[_0x0d8d('0x25')](respondWithResult(_0x2bfada,0xc9))[_0x0d8d('0x44')](handleError(_0x2bfada,null));};exports[_0x0d8d('0x24')]=function(_0x302fc2,_0x2822c7){if(_0x302fc2['body']['id']){delete _0x302fc2[_0x0d8d('0x4a')]['id'];}return db['Campaign'][_0x0d8d('0x4f')]({'where':{'id':_0x302fc2['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x2822c7,null))[_0x0d8d('0x25')](saveUpdates(_0x302fc2[_0x0d8d('0x4a')],null))[_0x0d8d('0x25')](respondWithResult(_0x2822c7,null))[_0x0d8d('0x44')](handleError(_0x2822c7,null));};exports[_0x0d8d('0x28')]=function(_0x77845e,_0x3a3f2f){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0x77845e['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x3a3f2f,null))[_0x0d8d('0x25')](removeEntity(_0x3a3f2f,null))[_0x0d8d('0x44')](handleError(_0x3a3f2f,null));};exports[_0x0d8d('0x59')]=function(_0x574a88,_0x32ba3c,_0x187b05){var _0xd46635={'raw':!![],'where':{}};var _0x28e9d9={};var _0x5ccbc3={'count':0x0,'rows':[]};return db['Campaign'][_0x0d8d('0x5a')]({'where':{'id':_0x574a88['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x32ba3c,null))[_0x0d8d('0x25')](function(_0x28ae7b){if(_0x28ae7b){_0x28e9d9[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x5b')][_0x0d8d('0x53')]);_0x28e9d9[_0x0d8d('0x32')]=_['keys'](_0x574a88[_0x0d8d('0x32')]);_0x28e9d9['filters']=_[_0x0d8d('0x35')](_0x28e9d9[_0x0d8d('0x31')],_0x28e9d9[_0x0d8d('0x32')]);_0xd46635[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x28e9d9['model'],qs[_0x0d8d('0x36')](_0x574a88[_0x0d8d('0x32')]['fields']));_0xd46635[_0x0d8d('0x34')]=_0xd46635[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0xd46635['attributes']:_0x28e9d9[_0x0d8d('0x31')];if(!_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0xd46635['limit']=qs[_0x0d8d('0x1c')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0xd46635['offset']=qs[_0x0d8d('0x1a')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0xd46635[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0xd46635[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0x574a88[_0x0d8d('0x32')],_0x28e9d9['filters']));_0xd46635[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x28ae7b['id'];if(_0x574a88[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0xd46635[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0xd46635['where'],{'$or':_[_0x0d8d('0x2d')](_0xd46635[_0x0d8d('0x34')],function(_0x565c87){var _0x36d28a={};_0x36d28a[_0x565c87]={'$like':'%'+_0x574a88[_0x0d8d('0x32')]['filter']+'%'};return _0x36d28a;})});}_0xd46635=_[_0x0d8d('0x40')]({},_0xd46635,_0x574a88[_0x0d8d('0x41')]);return db[_0x0d8d('0x5b')][_0x0d8d('0x1d')]({'where':_0xd46635[_0x0d8d('0x3e')]})[_0x0d8d('0x25')](function(_0x179741){_0x5ccbc3[_0x0d8d('0x1d')]=_0x179741;if(_0x574a88['query'][_0x0d8d('0x48')]){_0xd46635[_0x0d8d('0x42')]=[{'all':!![]}];}return db['CmHopper'][_0x0d8d('0x43')](_0xd46635);})['then'](function(_0xc37307){_0x5ccbc3[_0x0d8d('0x5d')]=_0xc37307;return _0x5ccbc3;});}})[_0x0d8d('0x25')](respondWithFilteredResult(_0x32ba3c,_0xd46635))[_0x0d8d('0x44')](handleError(_0x32ba3c,null));};exports['getHopperHistories']=function(_0xf2899d,_0x497bcb,_0x2f4473){var _0x47b719={'raw':!![],'where':{}};var _0xcbcec7={};var _0x35886e={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0xf2899d[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x497bcb,null))[_0x0d8d('0x25')](function(_0xa61073){if(_0xa61073){_0xcbcec7['model']=_['keys'](db['CmHopperHistory']['rawAttributes']);_0xcbcec7['query']=_[_0x0d8d('0x47')](_0xf2899d['query']);_0xcbcec7[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0xcbcec7['model'],_0xcbcec7[_0x0d8d('0x32')]);_0x47b719['attributes']=_['intersection'](_0xcbcec7['model'],qs[_0x0d8d('0x36')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x47b719['attributes']=_0x47b719[_0x0d8d('0x34')]['length']?_0x47b719[_0x0d8d('0x34')]:_0xcbcec7[_0x0d8d('0x31')];if(!_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x47b719['limit']=qs['limit'](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x47b719['offset']=qs[_0x0d8d('0x1a')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x47b719[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x47b719[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_['pick'](_0xf2899d[_0x0d8d('0x32')],_0xcbcec7['filters']));_0x47b719[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0xa61073['id'];if(_0xf2899d['query'][_0x0d8d('0x3d')]){_0x47b719[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x47b719[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x47b719['attributes'],function(_0x7e2fa1){var _0x43a4dd={};_0x43a4dd[_0x7e2fa1]={'$like':'%'+_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x43a4dd;})});}_0x47b719=_[_0x0d8d('0x40')]({},_0x47b719,_0xf2899d[_0x0d8d('0x41')]);return db[_0x0d8d('0x5e')][_0x0d8d('0x1d')]({'where':_0x47b719['where']})[_0x0d8d('0x25')](function(_0x25b485){_0x35886e[_0x0d8d('0x1d')]=_0x25b485;if(_0xf2899d[_0x0d8d('0x32')][_0x0d8d('0x48')]){_0x47b719[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x5e')]['findAll'](_0x47b719);})['then'](function(_0x50bf26){_0x35886e[_0x0d8d('0x5d')]=_0x50bf26;return _0x35886e;});}})['then'](respondWithFilteredResult(_0x497bcb,_0x47b719))[_0x0d8d('0x44')](handleError(_0x497bcb,null));};exports[_0x0d8d('0x5f')]=function(_0xf50d6c,_0x48f451,_0x29efba){var _0x14e2c={'raw':!![],'where':{}};var _0x356192={};var _0x2d3994={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0xf50d6c[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x48f451,null))['then'](function(_0x4b96cf){if(_0x4b96cf){_0x356192[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x60')][_0x0d8d('0x53')]);_0x356192['query']=_[_0x0d8d('0x47')](_0xf50d6c[_0x0d8d('0x32')]);_0x356192[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x356192[_0x0d8d('0x31')],_0x356192[_0x0d8d('0x32')]);_0x14e2c[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x356192[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x36')]));_0x14e2c[_0x0d8d('0x34')]=_0x14e2c[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x14e2c[_0x0d8d('0x34')]:_0x356192[_0x0d8d('0x31')];if(!_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x14e2c[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x14e2c[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x14e2c[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0xf50d6c['query']['sort']);_0x14e2c['where']=qs[_0x0d8d('0x33')](_[_0x0d8d('0x3c')](_0xf50d6c['query'],_0x356192[_0x0d8d('0x33')]));_0x14e2c[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x4b96cf['id'];if(_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x14e2c[_0x0d8d('0x3e')]=_['merge'](_0x14e2c[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x14e2c[_0x0d8d('0x34')],function(_0x2ff75e){var _0x671d02={};_0x671d02[_0x2ff75e]={'$like':'%'+_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x671d02;})});}_0x14e2c=_[_0x0d8d('0x40')]({},_0x14e2c,_0xf50d6c[_0x0d8d('0x41')]);return db[_0x0d8d('0x60')][_0x0d8d('0x1d')]({'where':_0x14e2c[_0x0d8d('0x3e')]})[_0x0d8d('0x25')](function(_0x3caed1){_0x2d3994[_0x0d8d('0x1d')]=_0x3caed1;if(_0xf50d6c[_0x0d8d('0x32')][_0x0d8d('0x48')]){_0x14e2c[_0x0d8d('0x42')]=[{'all':!![]}];}return db[_0x0d8d('0x60')][_0x0d8d('0x43')](_0x14e2c);})['then'](function(_0x2572b2){_0x2d3994['rows']=_0x2572b2;return _0x2d3994;});}})['then'](respondWithFilteredResult(_0x48f451,_0x14e2c))[_0x0d8d('0x44')](handleError(_0x48f451,null));};exports['getHopperBlacks']=function(_0x855fc3,_0x4d772e,_0x46c756){var _0x32b03a={'raw':!![],'where':{}};var _0xade583={};var _0x1064cd={'count':0x0,'rows':[]};return db[_0x0d8d('0x2e')]['findOne']({'where':{'id':_0x855fc3[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x4d772e,null))['then'](function(_0x51c637){if(_0x51c637){_0xade583[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x61')][_0x0d8d('0x53')]);_0xade583['query']=_[_0x0d8d('0x47')](_0x855fc3['query']);_0xade583[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0xade583[_0x0d8d('0x31')],_0xade583['query']);_0x32b03a[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0xade583['model'],qs[_0x0d8d('0x36')](_0x855fc3[_0x0d8d('0x32')]['fields']));_0x32b03a['attributes']=_0x32b03a[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x32b03a[_0x0d8d('0x34')]:_0xade583[_0x0d8d('0x31')];if(!_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x38')]('nolimit')){_0x32b03a[_0x0d8d('0x1c')]=qs[_0x0d8d('0x1c')](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x32b03a[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}_0x32b03a[_0x0d8d('0x3a')]=qs['sort'](_0x855fc3[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x32b03a[_0x0d8d('0x3e')]=qs['filters'](_[_0x0d8d('0x3c')](_0x855fc3[_0x0d8d('0x32')],_0xade583[_0x0d8d('0x33')]));_0x32b03a[_0x0d8d('0x3e')][_0x0d8d('0x5c')]=_0x51c637['id'];if(_0x855fc3[_0x0d8d('0x32')]['filter']){_0x32b03a['where']=_[_0x0d8d('0x40')](_0x32b03a[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x32b03a[_0x0d8d('0x34')],function(_0x5ec140){var _0x4ab10f={};_0x4ab10f[_0x5ec140]={'$like':'%'+_0x855fc3['query'][_0x0d8d('0x3d')]+'%'};return _0x4ab10f;})});}_0x32b03a=_[_0x0d8d('0x40')]({},_0x32b03a,_0x855fc3[_0x0d8d('0x41')]);return db['CmHopperBlack']['count']({'where':_0x32b03a['where']})['then'](function(_0x585652){_0x1064cd[_0x0d8d('0x1d')]=_0x585652;if(_0x855fc3['query'][_0x0d8d('0x48')]){_0x32b03a['include']=[{'all':!![]}];}return db[_0x0d8d('0x61')]['findAll'](_0x32b03a);})[_0x0d8d('0x25')](function(_0x333fb5){_0x1064cd['rows']=_0x333fb5;return _0x1064cd;});}})[_0x0d8d('0x25')](respondWithFilteredResult(_0x4d772e,_0x32b03a))[_0x0d8d('0x44')](handleError(_0x4d772e,null));};exports[_0x0d8d('0x62')]=function(_0x161c4f,_0x23f0e1,_0x411eab){var _0x1111ad={};var _0x3ced3e={};var _0x1ed82a;var _0x478c33;return db[_0x0d8d('0x2e')][_0x0d8d('0x5a')]({'where':{'id':_0x161c4f[_0x0d8d('0x46')]['id']}})['then'](handleEntityNotFound(_0x23f0e1,null))[_0x0d8d('0x25')](function(_0x432049){if(_0x432049){_0x1ed82a=_0x432049;_0x3ced3e[_0x0d8d('0x31')]=_['keys'](db[_0x0d8d('0x63')][_0x0d8d('0x53')]);_0x3ced3e[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x161c4f[_0x0d8d('0x32')]);_0x3ced3e[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x3ced3e[_0x0d8d('0x31')],_0x3ced3e[_0x0d8d('0x32')]);_0x1111ad[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x3ced3e[_0x0d8d('0x31')],qs[_0x0d8d('0x36')](_0x161c4f['query'][_0x0d8d('0x36')]));_0x1111ad[_0x0d8d('0x34')]=_0x1111ad[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x1111ad[_0x0d8d('0x34')]:_0x3ced3e[_0x0d8d('0x31')];_0x1111ad[_0x0d8d('0x3a')]=qs[_0x0d8d('0x3b')](_0x161c4f['query'][_0x0d8d('0x3b')]);_0x1111ad[_0x0d8d('0x3e')]=qs[_0x0d8d('0x33')](_['pick'](_0x161c4f[_0x0d8d('0x32')],_0x3ced3e['filters']));if(_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x3d')]){_0x1111ad[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x1111ad['where'],{'$or':_[_0x0d8d('0x2d')](_0x1111ad[_0x0d8d('0x34')],function(_0x5f1f92){var _0x11c4fc={};_0x11c4fc[_0x5f1f92]={'$like':'%'+_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x11c4fc;})});}_0x1111ad=_[_0x0d8d('0x40')]({},_0x1111ad,_0x161c4f['options']);return _0x1ed82a[_0x0d8d('0x62')](_0x1111ad);}})[_0x0d8d('0x25')](function(_0x5d2257){if(_0x5d2257){_0x478c33=_0x5d2257[_0x0d8d('0x37')];if(!_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x38')](_0x0d8d('0x39'))){_0x1111ad['limit']=qs[_0x0d8d('0x1c')](_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x1c')]);_0x1111ad[_0x0d8d('0x1a')]=qs[_0x0d8d('0x1a')](_0x161c4f[_0x0d8d('0x32')][_0x0d8d('0x1a')]);}return _0x1ed82a[_0x0d8d('0x62')](_0x1111ad);}})[_0x0d8d('0x25')](function(_0x3e9c5a){if(_0x3e9c5a){return _0x3e9c5a?{'count':_0x478c33,'rows':_0x3e9c5a}:null;}})['then'](respondWithResult(_0x23f0e1,null))['catch'](handleError(_0x23f0e1,null));};exports['addLists']=function(_0xcc84de,_0x45392c,_0x4b0934){var _0x31cdbe,_0x1fc834;return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xcc84de[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x45392c,null))[_0x0d8d('0x25')](function(_0x1722cb){if(_0x1722cb){_0x1fc834=_0x1722cb;return _0x1722cb[_0x0d8d('0x64')](_0xcc84de[_0x0d8d('0x4a')][_0x0d8d('0x65')],_[_0x0d8d('0x54')](_0xcc84de[_0x0d8d('0x4a')],[_0x0d8d('0x65'),'id'])||{});}return null;})[_0x0d8d('0x66')](function(_0x39a865){var _0x8b1514;_0x31cdbe=_0x39a865||[];var _0x17d30a=[];if(_0x39a865){for(var _0x1fa1ce=0x0;_0x1fa1ce<_0x39a865['length'];_0x1fa1ce+=0x1){var _0x2d473c=_0x39a865[_0x1fa1ce][_0x0d8d('0x26')]({'plain':!![]});_0x1fc834[_0x0d8d('0x67')]=_0xcc84de[_0x0d8d('0x4a')]['dialCheckDuplicateType']?_0xcc84de[_0x0d8d('0x4a')][_0x0d8d('0x67')]:_0x1fc834[_0x0d8d('0x67')];switch(_0x1fc834[_0x0d8d('0x67')]){case _0x0d8d('0x68'):_0x8b1514=squel['insert']()[_0x0d8d('0x69')](_0x0d8d('0x6a'))[_0x0d8d('0x6b')]([_0x0d8d('0x6c'),'scheduledAt',_0x0d8d('0x6d'),_0x0d8d('0x6e'),_0x0d8d('0x5c'),'createdAt','updatedAt'],squel[_0x0d8d('0x6f')]()['field'](_0x0d8d('0x6c'),_0x0d8d('0x6c'))['field']('NOW()',_0x0d8d('0x70'))[_0x0d8d('0x71')]('id','ContactId')[_0x0d8d('0x71')](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),_0x0d8d('0x6e'))['field'](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))[_0x0d8d('0x3e')](_0x0d8d('0x78'),_0x2d473c[_0x0d8d('0x72')]['toString']())[_0x0d8d('0x3e')](_0x0d8d('0x79'))[_0x0d8d('0x3e')](_0x0d8d('0x7a'),squel['select']()[_0x0d8d('0x71')]('COALESCE(calleridnum,\x27\x27)')[_0x0d8d('0x75')](_0x0d8d('0x7b'))['where'](_0x0d8d('0x7c'),_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')]()))[_0x0d8d('0x3e')](_0x0d8d('0x7a'),squel[_0x0d8d('0x6f')]()['field'](_0x0d8d('0x7d'))[_0x0d8d('0x75')](_0x0d8d('0x6a'))[_0x0d8d('0x3e')](_0x0d8d('0x7c'),_0xcc84de['params']['id']['toString']())))[_0x0d8d('0x73')]();break;case _0x0d8d('0x7e'):_0x8b1514=squel[_0x0d8d('0x7f')]()[_0x0d8d('0x69')](_0x0d8d('0x6a'))[_0x0d8d('0x6b')]([_0x0d8d('0x6c'),'scheduledAt','ContactId','ListId',_0x0d8d('0x5c'),_0x0d8d('0x55'),_0x0d8d('0x56')],squel[_0x0d8d('0x6f')]()[_0x0d8d('0x71')](_0x0d8d('0x6c'),'phone')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x70'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))['field'](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),_0x0d8d('0x6e'))[_0x0d8d('0x71')](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')]('NOW()','createdAt')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))['where'](_0x0d8d('0x78'),_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')]())['where'](_0x0d8d('0x79'))['where'](_0x0d8d('0x7a'),squel['select']()[_0x0d8d('0x71')](_0x0d8d('0x7d'))['from'](_0x0d8d('0x6a'))['where'](_0x0d8d('0x7c'),_0xcc84de['params']['id']['toString']())))['toString']();break;default:_0x8b1514=squel['insert']()['into'](_0x0d8d('0x6a'))[_0x0d8d('0x6b')](['phone',_0x0d8d('0x70'),_0x0d8d('0x6d'),_0x0d8d('0x6e'),'CampaignId',_0x0d8d('0x55'),_0x0d8d('0x56')],squel['select']()[_0x0d8d('0x71')]('phone','phone')[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x70'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))['field'](_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')](),'ListId')[_0x0d8d('0x71')](_0xcc84de[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),'updatedAt')[_0x0d8d('0x75')](_0x0d8d('0x76'))[_0x0d8d('0x3e')](_0x0d8d('0x77'))[_0x0d8d('0x3e')]('ListId\x20=\x20?',_0x2d473c[_0x0d8d('0x72')][_0x0d8d('0x73')]())[_0x0d8d('0x3e')](_0x0d8d('0x79')))['toString']();}_0x17d30a['push'](db[_0x0d8d('0x80')][_0x0d8d('0x32')](_0x8b1514));}return BPromise[_0x0d8d('0x81')](_0x17d30a);}})['then'](function(){return _0x31cdbe;})[_0x0d8d('0x25')](respondWithResult(_0x45392c,null))['catch'](handleError(_0x45392c,null));};exports[_0x0d8d('0x82')]=function(_0x2e453e,_0x357e32,_0x3bcb31){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0x2e453e[_0x0d8d('0x46')]['id']}})['then'](handleEntityNotFound(_0x357e32,null))[_0x0d8d('0x25')](function(_0x1b1564){if(_0x1b1564){return _0x1b1564[_0x0d8d('0x82')](_0x2e453e[_0x0d8d('0x32')][_0x0d8d('0x65')]);}})[_0x0d8d('0x25')](function(_0x328fb1){if(_0x328fb1){return db['CmHopper'][_0x0d8d('0x28')]({'where':{'ListId':_0x2e453e['query'][_0x0d8d('0x65')],'CampaignId':_0x2e453e[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](function(){return _0x328fb1;});}})[_0x0d8d('0x25')](respondWithStatusCode(_0x357e32,null))[_0x0d8d('0x44')](handleError(_0x357e32,null));};exports['getBlackLists']=function(_0x52d9a6,_0x602a8d,_0x347cf6){var _0x1abddb={};var _0x24fa1e={};var _0x79b4d4;var _0x89e5f7;return db['Campaign'][_0x0d8d('0x5a')]({'where':{'id':_0x52d9a6[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x602a8d,null))[_0x0d8d('0x25')](function(_0x2a079b){if(_0x2a079b){_0x79b4d4=_0x2a079b;_0x24fa1e[_0x0d8d('0x31')]=_[_0x0d8d('0x47')](db[_0x0d8d('0x63')][_0x0d8d('0x53')]);_0x24fa1e[_0x0d8d('0x32')]=_[_0x0d8d('0x47')](_0x52d9a6[_0x0d8d('0x32')]);_0x24fa1e[_0x0d8d('0x33')]=_[_0x0d8d('0x35')](_0x24fa1e['model'],_0x24fa1e[_0x0d8d('0x32')]);_0x1abddb[_0x0d8d('0x34')]=_[_0x0d8d('0x35')](_0x24fa1e['model'],qs['fields'](_0x52d9a6[_0x0d8d('0x32')]['fields']));_0x1abddb['attributes']=_0x1abddb[_0x0d8d('0x34')][_0x0d8d('0x37')]?_0x1abddb[_0x0d8d('0x34')]:_0x24fa1e[_0x0d8d('0x31')];_0x1abddb['order']=qs[_0x0d8d('0x3b')](_0x52d9a6[_0x0d8d('0x32')][_0x0d8d('0x3b')]);_0x1abddb[_0x0d8d('0x3e')]=qs['filters'](_['pick'](_0x52d9a6['query'],_0x24fa1e[_0x0d8d('0x33')]));if(_0x52d9a6[_0x0d8d('0x32')]['filter']){_0x1abddb[_0x0d8d('0x3e')]=_[_0x0d8d('0x40')](_0x1abddb[_0x0d8d('0x3e')],{'$or':_[_0x0d8d('0x2d')](_0x1abddb[_0x0d8d('0x34')],function(_0x3182bb){var _0x396564={};_0x396564[_0x3182bb]={'$like':'%'+_0x52d9a6[_0x0d8d('0x32')][_0x0d8d('0x3d')]+'%'};return _0x396564;})});}_0x1abddb=_[_0x0d8d('0x40')]({},_0x1abddb,_0x52d9a6['options']);return _0x79b4d4['getBlackLists'](_0x1abddb);}})['then'](function(_0x1524cd){if(_0x1524cd){_0x89e5f7=_0x1524cd['length'];if(!_0x52d9a6[_0x0d8d('0x32')]['hasOwnProperty'](_0x0d8d('0x39'))){_0x1abddb[_0x0d8d('0x1c')]=qs['limit'](_0x52d9a6['query'][_0x0d8d('0x1c')]);_0x1abddb[_0x0d8d('0x1a')]=qs['offset'](_0x52d9a6['query']['offset']);}return _0x79b4d4[_0x0d8d('0x83')](_0x1abddb);}})['then'](function(_0x21d3fd){if(_0x21d3fd){return _0x21d3fd?{'count':_0x89e5f7,'rows':_0x21d3fd}:null;}})['then'](respondWithResult(_0x602a8d,null))[_0x0d8d('0x44')](handleError(_0x602a8d,null));};exports['addBlackLists']=function(_0xa9dd3f,_0x7fd298,_0x17db23){var _0x5f5e0a,_0x1dcf0e;return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xa9dd3f[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x7fd298,null))[_0x0d8d('0x25')](function(_0x4ccf74){if(_0x4ccf74){_0x1dcf0e=_0x4ccf74;return _0x4ccf74['addBlackLists'](_0xa9dd3f['body']['ids'],_[_0x0d8d('0x54')](_0xa9dd3f[_0x0d8d('0x4a')],[_0x0d8d('0x65'),'id'])||{});}return null;})['spread'](function(_0x524774){var _0x33521d;_0x5f5e0a=_0x524774||[];var _0x5c2add=[];if(_0x524774){for(var _0x16d123=0x0;_0x16d123<_0x524774[_0x0d8d('0x37')];_0x16d123+=0x1){var _0x188a1e=_0x524774[_0x16d123]['get']({'plain':!![]});_0x33521d=squel[_0x0d8d('0x7f')]()[_0x0d8d('0x69')](_0x0d8d('0x84'))['fromQuery']([_0x0d8d('0x6c'),_0x0d8d('0x6d'),_0x0d8d('0x6e'),'CampaignId','createdAt',_0x0d8d('0x56')],squel[_0x0d8d('0x6f')]()[_0x0d8d('0x71')]('phone',_0x0d8d('0x6c'))[_0x0d8d('0x71')]('id',_0x0d8d('0x6d'))[_0x0d8d('0x71')](_0x188a1e['CmListId'][_0x0d8d('0x73')](),_0x0d8d('0x6e'))[_0x0d8d('0x71')](_0xa9dd3f[_0x0d8d('0x46')]['id'][_0x0d8d('0x73')](),_0x0d8d('0x5c'))[_0x0d8d('0x71')]('NOW()',_0x0d8d('0x55'))[_0x0d8d('0x71')](_0x0d8d('0x74'),_0x0d8d('0x56'))['from'](_0x0d8d('0x76'))[_0x0d8d('0x3e')]('deletedAt\x20IS\x20NULL')[_0x0d8d('0x3e')](_0x0d8d('0x78'),_0x188a1e[_0x0d8d('0x72')][_0x0d8d('0x73')]())[_0x0d8d('0x3e')](_0x0d8d('0x79')))['toString']();_0x5c2add['push'](db[_0x0d8d('0x80')][_0x0d8d('0x32')](_0x33521d));}return BPromise[_0x0d8d('0x81')](_0x5c2add);}})[_0x0d8d('0x25')](function(){return _0x5f5e0a;})[_0x0d8d('0x25')](respondWithResult(_0x7fd298,null))['catch'](handleError(_0x7fd298,null));};exports[_0x0d8d('0x85')]=function(_0xaba573,_0x48eaac,_0x1dfb48){return db[_0x0d8d('0x2e')][_0x0d8d('0x4f')]({'where':{'id':_0xaba573['params']['id']}})[_0x0d8d('0x25')](handleEntityNotFound(_0x48eaac,null))[_0x0d8d('0x25')](function(_0x480f5a){if(_0x480f5a){return _0x480f5a['removeBlackLists'](_0xaba573['query']['ids']);}})[_0x0d8d('0x25')](function(_0x4b34c8){if(_0x4b34c8){return db[_0x0d8d('0x61')][_0x0d8d('0x28')]({'where':{'ListId':_0xaba573[_0x0d8d('0x32')][_0x0d8d('0x65')],'CampaignId':_0xaba573[_0x0d8d('0x46')]['id']}})[_0x0d8d('0x25')](function(){return _0x4b34c8;});}})[_0x0d8d('0x25')](respondWithStatusCode(_0x48eaac,null))['catch'](handleError(_0x48eaac,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 58f1e08..2b6e6cc 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(_0x531e85,_0x4c5f38){var _0x197b70=function(_0x3feb49){while(--_0x3feb49){_0x531e85['push'](_0x531e85['shift']());}};_0x197b70(++_0x4c5f38);}(_0x7a54,0x106));var _0x47a5=function(_0xc8c0,_0x419e14){_0xc8c0=_0xc8c0-0x0;var _0x287333=_0x7a54[_0xc8c0];return _0x287333;};'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(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 cb3510c..52417b7 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 _0x8b29=['GetCampaign','findAll','options','raw','where','attributes','map','include','model','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5393e2,_0x34ec81){var _0x26bc87=function(_0x4cecd8){while(--_0x4cecd8){_0x5393e2['push'](_0x5393e2['shift']());}};_0x26bc87(++_0x34ec81);}(_0x8b29,0xbe));var _0x98b2=function(_0xf00138,_0x3cf18a){_0xf00138=_0xf00138-0x0;var _0x338a3c=_0x8b29[_0xf00138];return _0x338a3c;};'use strict';var _=require(_0x98b2('0x0'));var util=require('util');var moment=require(_0x98b2('0x1'));var BPromise=require(_0x98b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x98b2('0x3'))['db'];var utils=require(_0x98b2('0x4'));var logger=require('../../config/logger')(_0x98b2('0x5'));var config=require('../../config/environment');var jayson=require(_0x98b2('0x6'));var client=jayson[_0x98b2('0x7')][_0x98b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e7ef5,_0x221cee,_0x2cd0cb){return new BPromise(function(_0x417ca6,_0x388827){return client[_0x98b2('0x9')](_0x3e7ef5,_0x2cd0cb)[_0x98b2('0xa')](function(_0x501b51){logger['info'](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));logger[_0x98b2('0xd')](_0x98b2('0xe'),_0x221cee,_0x98b2('0xc'),JSON[_0x98b2('0xf')](_0x501b51));if(_0x501b51['error']){if(_0x501b51[_0x98b2('0x10')][_0x98b2('0x11')]===0x1f4){logger['error'](_0x98b2('0xb'),_0x221cee,_0x501b51[_0x98b2('0x10')][_0x98b2('0x12')]);return _0x388827(_0x501b51['error']['message']);}logger[_0x98b2('0x10')]('Campaign,\x20%s,\x20%s',_0x221cee,_0x501b51[_0x98b2('0x10')]['message']);return _0x417ca6(_0x501b51['error']['message']);}else{logger[_0x98b2('0x13')](_0x98b2('0xb'),_0x221cee,_0x98b2('0xc'));_0x417ca6(_0x501b51['result']['message']);}})['catch'](function(_0x389d22){logger[_0x98b2('0x10')](_0x98b2('0xb'),_0x221cee,_0x389d22);_0x388827(_0x389d22);});});}exports[_0x98b2('0x14')]=function(_0x4b9f2c){var _0x1cd8c6=this;return new Promise(function(_0x588837,_0x989082){return db['Campaign'][_0x98b2('0x15')]({'raw':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x17')]===undefined?!![]:![]:!![],'where':_0x4b9f2c['options']?_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x18')]||null:null,'attributes':_0x4b9f2c['options']?_0x4b9f2c['options'][_0x98b2('0x19')]||null:null,'limit':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c['options']['limit']||null:null,'include':_0x4b9f2c[_0x98b2('0x16')]?_0x4b9f2c[_0x98b2('0x16')]['include']?_[_0x98b2('0x1a')](_0x4b9f2c[_0x98b2('0x16')][_0x98b2('0x1b')],function(_0x4f33d8){return{'model':db[_0x4f33d8[_0x98b2('0x1c')]],'as':_0x4f33d8['as'],'attributes':_0x4f33d8['attributes'],'include':_0x4f33d8[_0x98b2('0x1b')]?_['map'](_0x4f33d8['include'],function(_0x7b6ebc){return{'model':db[_0x7b6ebc[_0x98b2('0x1c')]],'as':_0x7b6ebc['as'],'attributes':_0x7b6ebc[_0x98b2('0x19')],'include':_0x7b6ebc['include']?_['map'](_0x7b6ebc['include'],function(_0x11c6aa){return{'model':db[_0x11c6aa[_0x98b2('0x1c')]],'as':_0x11c6aa['as'],'attributes':_0x11c6aa['attributes']};}):[]};}):[]};}):[]:[]})[_0x98b2('0xa')](function(_0x28db65){logger[_0x98b2('0x13')]('GetCampaign',_0x4b9f2c);logger[_0x98b2('0xd')](_0x98b2('0x14'),_0x4b9f2c,JSON[_0x98b2('0xf')](_0x28db65));_0x588837(_0x28db65);})[_0x98b2('0x1d')](function(_0x25393d){logger['error'](_0x98b2('0x14'),_0x25393d['message'],_0x4b9f2c);_0x989082(_0x1cd8c6[_0x98b2('0x10')](0x1f4,_0x25393d[_0x98b2('0x12')]));});});};
\ No newline at end of file
+var _0x9ff4=['options','raw','where','attributes','limit','include','model','map','then','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetCampaign','Campaign','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ff4,0x196));var _0x49ff=function(_0x51c1f0,_0x4b8675){_0x51c1f0=_0x51c1f0-0x0;var _0xa8547b=_0x9ff4[_0x51c1f0];return _0xa8547b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x49ff('0x0'));var rs=require(_0x49ff('0x1'));var fs=require('fs');var Redis=require(_0x49ff('0x2'));var db=require(_0x49ff('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x49ff('0x4'))(_0x49ff('0x5'));var config=require(_0x49ff('0x6'));var jayson=require(_0x49ff('0x7'));var client=jayson[_0x49ff('0x8')][_0x49ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe967d3,_0xd87903,_0x50f784){return new BPromise(function(_0x5478a6,_0x304f83){return client[_0x49ff('0xa')](_0xe967d3,_0x50f784)['then'](function(_0x4e845a){logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));logger[_0x49ff('0xe')](_0x49ff('0xf'),_0xd87903,_0x49ff('0xd'),JSON[_0x49ff('0x10')](_0x4e845a));if(_0x4e845a[_0x49ff('0x11')]){if(_0x4e845a['error']['code']===0x1f4){logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a[_0x49ff('0x11')]['message']);return _0x304f83(_0x4e845a[_0x49ff('0x11')]['message']);}logger['error'](_0x49ff('0xc'),_0xd87903,_0x4e845a['error'][_0x49ff('0x12')]);return _0x5478a6(_0x4e845a[_0x49ff('0x11')][_0x49ff('0x12')]);}else{logger[_0x49ff('0xb')](_0x49ff('0xc'),_0xd87903,_0x49ff('0xd'));_0x5478a6(_0x4e845a[_0x49ff('0x13')][_0x49ff('0x12')]);}})['catch'](function(_0x29fb22){logger['error'](_0x49ff('0xc'),_0xd87903,_0x29fb22);_0x304f83(_0x29fb22);});});}exports[_0x49ff('0x14')]=function(_0x1a0f17){var _0x29c5d9=this;return new Promise(function(_0x255229,_0x90480f){return db[_0x49ff('0x15')][_0x49ff('0x16')]({'raw':_0x1a0f17[_0x49ff('0x17')]?_0x1a0f17['options'][_0x49ff('0x18')]===undefined?!![]:![]:!![],'where':_0x1a0f17['options']?_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x19')]||null:null,'attributes':_0x1a0f17['options']?_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x1a')]||null:null,'limit':_0x1a0f17['options']?_0x1a0f17['options'][_0x49ff('0x1b')]||null:null,'include':_0x1a0f17[_0x49ff('0x17')]?_0x1a0f17['options'][_0x49ff('0x1c')]?_['map'](_0x1a0f17[_0x49ff('0x17')][_0x49ff('0x1c')],function(_0xb1088){return{'model':db[_0xb1088[_0x49ff('0x1d')]],'as':_0xb1088['as'],'attributes':_0xb1088[_0x49ff('0x1a')],'include':_0xb1088[_0x49ff('0x1c')]?_[_0x49ff('0x1e')](_0xb1088[_0x49ff('0x1c')],function(_0x3c214b){return{'model':db[_0x3c214b[_0x49ff('0x1d')]],'as':_0x3c214b['as'],'attributes':_0x3c214b[_0x49ff('0x1a')],'include':_0x3c214b[_0x49ff('0x1c')]?_[_0x49ff('0x1e')](_0x3c214b['include'],function(_0x203853){return{'model':db[_0x203853[_0x49ff('0x1d')]],'as':_0x203853['as'],'attributes':_0x203853['attributes']};}):[]};}):[]};}):[]:[]})[_0x49ff('0x1f')](function(_0x1f651a){logger[_0x49ff('0xb')]('GetCampaign',_0x1a0f17);logger[_0x49ff('0xe')](_0x49ff('0x14'),_0x1a0f17,JSON[_0x49ff('0x10')](_0x1f651a));_0x255229(_0x1f651a);})[_0x49ff('0x20')](function(_0xf380ba){logger[_0x49ff('0x11')](_0x49ff('0x14'),_0xf380ba[_0x49ff('0x12')],_0x1a0f17);_0x90480f(_0x29c5d9[_0x49ff('0x11')](0x1f4,_0xf380ba[_0x49ff('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 734d7c6..9f960ca 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 _0x3620=['/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','update','delete','/:id','removeLists','removeBlackLists','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks'];(function(_0x1e3682,_0x33bbb7){var _0x2a6f34=function(_0x35128b){while(--_0x35128b){_0x1e3682['push'](_0x1e3682['shift']());}};_0x2a6f34(++_0x33bbb7);}(_0x3620,0xcf));var _0x0362=function(_0x1c2e66,_0x93bc1f){_0x1c2e66=_0x1c2e66-0x0;var _0x1a655e=_0x3620[_0x1c2e66];return _0x1a655e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0362('0x0'));var express=require(_0x0362('0x1'));var router=express[_0x0362('0x2')]();var fs_extra=require(_0x0362('0x3'));var auth=require(_0x0362('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0362('0x5'));var controller=require(_0x0362('0x6'));router[_0x0362('0x7')]('/',auth[_0x0362('0x8')](),controller[_0x0362('0x9')]);router[_0x0362('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0362('0x7')](_0x0362('0xa'),auth['isAuthenticated'](),controller['getHoppers']);router[_0x0362('0x7')](_0x0362('0xb'),auth[_0x0362('0x8')](),controller[_0x0362('0xc')]);router[_0x0362('0x7')](_0x0362('0xd'),auth[_0x0362('0x8')](),controller[_0x0362('0xe')]);router[_0x0362('0x7')](_0x0362('0xf'),auth['isAuthenticated'](),controller[_0x0362('0x10')]);router[_0x0362('0x7')](_0x0362('0x11'),auth[_0x0362('0x8')](),controller[_0x0362('0x12')]);router[_0x0362('0x7')](_0x0362('0x13'),auth[_0x0362('0x8')](),controller[_0x0362('0x14')]);router[_0x0362('0x15')]('/',auth[_0x0362('0x8')](),controller['create']);router[_0x0362('0x15')](_0x0362('0x16'),auth[_0x0362('0x8')](),controller[_0x0362('0x17')]);router['post']('/:id/lists',auth[_0x0362('0x8')](),controller[_0x0362('0x18')]);router['post'](_0x0362('0x13'),auth['isAuthenticated'](),controller[_0x0362('0x19')]);router['put']('/:id',auth[_0x0362('0x8')](),controller[_0x0362('0x1a')]);router[_0x0362('0x1b')](_0x0362('0x1c'),auth[_0x0362('0x8')](),controller['destroy']);router[_0x0362('0x1b')]('/:id/lists',auth[_0x0362('0x8')](),controller[_0x0362('0x1d')]);router[_0x0362('0x1b')]('/:id/blacklists',auth[_0x0362('0x8')](),controller[_0x0362('0x1e')]);module[_0x0362('0x1f')]=router;
\ No newline at end of file
+var _0x0f24=['removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0f24,0xac));var _0x40f2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f24[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x40f2('0x0'));var path=require(_0x40f2('0x1'));var timeout=require(_0x40f2('0x2'));var express=require(_0x40f2('0x3'));var router=express[_0x40f2('0x4')]();var fs_extra=require(_0x40f2('0x5'));var auth=require(_0x40f2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x40f2('0x7'));var controller=require('./campaign.controller');router['get']('/',auth[_0x40f2('0x8')](),controller[_0x40f2('0x9')]);router[_0x40f2('0xa')](_0x40f2('0xb'),auth['isAuthenticated'](),controller[_0x40f2('0xc')]);router[_0x40f2('0xa')](_0x40f2('0xd'),auth['isAuthenticated'](),controller[_0x40f2('0xe')]);router[_0x40f2('0xa')](_0x40f2('0xf'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x10')]);router[_0x40f2('0xa')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x40f2('0x11')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x40f2('0xa')](_0x40f2('0x12'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x13')]);router[_0x40f2('0xa')](_0x40f2('0x14'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x15')]);router[_0x40f2('0x16')]('/',auth[_0x40f2('0x8')](),controller[_0x40f2('0x17')]);router[_0x40f2('0x16')](_0x40f2('0x18'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x19')]);router[_0x40f2('0x16')](_0x40f2('0x12'),auth['isAuthenticated'](),controller[_0x40f2('0x1a')]);router[_0x40f2('0x16')](_0x40f2('0x14'),auth['isAuthenticated'](),controller[_0x40f2('0x1b')]);router[_0x40f2('0x1c')](_0x40f2('0xb'),auth[_0x40f2('0x8')](),controller[_0x40f2('0x1d')]);router[_0x40f2('0x1e')](_0x40f2('0xb'),auth['isAuthenticated'](),controller[_0x40f2('0x1f')]);router[_0x40f2('0x1e')]('/:id/lists',auth[_0x40f2('0x8')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0x40f2('0x8')](),controller[_0x40f2('0x20')]);module[_0x40f2('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 3a2b52f..643da8e 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 _0xd0aa=['exports','STRING','VIRTUAL','getDataValue','key'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xd0aa,0xff));var _0xad0a=function(_0x3e90b0,_0x583071){_0x3e90b0=_0x3e90b0-0x0;var _0xe5bc46=_0xd0aa[_0x3e90b0];return _0xe5bc46;};'use strict';var Sequelize=require('sequelize');module[_0xad0a('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xad0a('0x1')]},'name':{'type':Sequelize[_0xad0a('0x2')],'get':function(){return this[_0xad0a('0x3')](_0xad0a('0x4'));}}};
\ No newline at end of file
+var _0x3198=['sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x3f2f56,_0x27e1b8){var _0x26a4a7=function(_0x3d993d){while(--_0x3d993d){_0x3f2f56['push'](_0x3f2f56['shift']());}};_0x26a4a7(++_0x27e1b8);}(_0x3198,0x1f4));var _0x8319=function(_0x42d74c,_0x7be041){_0x42d74c=_0x42d74c-0x0;var _0xb1f9f9=_0x3198[_0x42d74c];return _0xb1f9f9;};'use strict';var Sequelize=require(_0x8319('0x0'));module[_0x8319('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8319('0x2')]},'name':{'type':Sequelize[_0x8319('0x3')],'get':function(){return this[_0x8319('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 4c50be1..9bf55cc 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 _0xe7ed=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.'];(function(_0x6e07d2,_0x21d2df){var _0x4b6bb2=function(_0x51eb0c){while(--_0x51eb0c){_0x6e07d2['push'](_0x6e07d2['shift']());}};_0x4b6bb2(++_0x21d2df);}(_0xe7ed,0xb6));var _0xde7e=function(_0x259bcb,_0x3d6dbe){_0x259bcb=_0x259bcb-0x0;var _0x14d4e5=_0xe7ed[_0x259bcb];return _0x14d4e5;};'use strict';var emlformat=require(_0xde7e('0x0'));var rimraf=require(_0xde7e('0x1'));var zipdir=require(_0xde7e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xde7e('0x3'));var BPromise=require(_0xde7e('0x4'));var Mustache=require(_0xde7e('0x5'));var util=require('util');var path=require(_0xde7e('0x6'));var sox=require(_0xde7e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde7e('0x8'));var _=require(_0xde7e('0x9'));var squel=require(_0xde7e('0xa'));var crypto=require('crypto');var jsforce=require(_0xde7e('0xb'));var deskjs=require(_0xde7e('0xc'));var toCsv=require(_0xde7e('0xd'));var querystring=require(_0xde7e('0xe'));var Papa=require(_0xde7e('0xf'));var Redis=require(_0xde7e('0x10'));var authService=require(_0xde7e('0x11'));var qs=require(_0xde7e('0x12'));var as=require(_0xde7e('0x13'));var hardwareService=require(_0xde7e('0x14'));var logger=require(_0xde7e('0x15'))(_0xde7e('0x16'));var utils=require('../../config/utils');var config=require(_0xde7e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2109a6,_0x52ed60){_0x52ed60=_0x52ed60||0xcc;return function(_0x3b8e6b){if(_0x3b8e6b){return _0x2109a6[_0xde7e('0x18')](_0x52ed60);}return _0x2109a6[_0xde7e('0x19')](_0x52ed60)[_0xde7e('0x1a')]();};}function respondWithResult(_0x62d978,_0x4e17ad){_0x4e17ad=_0x4e17ad||0xc8;return function(_0x526025){if(_0x526025){return _0x62d978[_0xde7e('0x19')](_0x4e17ad)[_0xde7e('0x1b')](_0x526025);}};}function respondWithFilteredResult(_0x45ec9d,_0x524bb6){return function(_0x3962c3){if(_0x3962c3){var _0x550094=typeof _0x524bb6[_0xde7e('0x1c')]===_0xde7e('0x1d')&&typeof _0x524bb6[_0xde7e('0x1e')]==='undefined';var _0x591acb=_0x3962c3[_0xde7e('0x1f')];var _0x359a7c=_0x550094?0x0:_0x524bb6[_0xde7e('0x1c')];var _0x60d64a=_0x550094?_0x3962c3[_0xde7e('0x1f')]:_0x524bb6[_0xde7e('0x1c')]+_0x524bb6[_0xde7e('0x1e')];var _0x29dd29;if(_0x60d64a>=_0x591acb){_0x60d64a=_0x591acb;_0x29dd29=0xc8;}else{_0x29dd29=0xce;}_0x45ec9d[_0xde7e('0x19')](_0x29dd29);return _0x45ec9d['set']('Content-Range',_0x359a7c+'-'+_0x60d64a+'/'+_0x591acb)['json'](_0x3962c3);}return null;};}function patchUpdates(_0xb8db81){return function(_0x2d7227){try{jsonpatch[_0xde7e('0x20')](_0x2d7227,_0xb8db81,!![]);}catch(_0x48cf97){return BPromise[_0xde7e('0x21')](_0x48cf97);}return _0x2d7227[_0xde7e('0x22')]();};}function saveUpdates(_0xae673e,_0x3d889d){return function(_0x2c0ee1){if(_0x2c0ee1){return _0x2c0ee1[_0xde7e('0x23')](_0xae673e)[_0xde7e('0x24')](function(_0x31cd9b){return _0x31cd9b;});}return null;};}function removeEntity(_0x1b2fe3,_0xa6afd3){return function(_0x163c31){if(_0x163c31){return _0x163c31[_0xde7e('0x25')]()['then'](function(){var _0xf1d9b2=_0x163c31['get']({'plain':!![]});var _0x386662=_0xde7e('0x26');return db[_0xde7e('0x27')][_0xde7e('0x25')]({'where':{'type':_0x386662,'resourceId':_0xf1d9b2['id']}})[_0xde7e('0x24')](function(){return _0x163c31;});})['then'](function(){_0x1b2fe3[_0xde7e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a91ea,_0x11b991){return function(_0x53008d){if(!_0x53008d){_0x5a91ea[_0xde7e('0x18')](0x194);}return _0x53008d;};}function handleError(_0x1a8031,_0x142ecd){_0x142ecd=_0x142ecd||0x1f4;return function(_0x3e2223){logger[_0xde7e('0x28')](_0x3e2223[_0xde7e('0x29')]);if(_0x3e2223['name']){delete _0x3e2223[_0xde7e('0x2a')];}_0x1a8031['status'](_0x142ecd)[_0xde7e('0x2b')](_0x3e2223);};}exports[_0xde7e('0x2c')]=function(_0x1e4376,_0x346a6f){var _0x3e090c={},_0x57850a={},_0x51c6ed={'count':0x0,'rows':[]};var _0x6725de=_[_0xde7e('0x2d')](db[_0xde7e('0x2e')][_0xde7e('0x2f')],function(_0x4f3500){return{'name':_0x4f3500['fieldName'],'type':_0x4f3500['type']['key']};});_0x57850a[_0xde7e('0x30')]=_[_0xde7e('0x2d')](_0x6725de,_0xde7e('0x2a'));_0x57850a[_0xde7e('0x31')]=_[_0xde7e('0x32')](_0x1e4376[_0xde7e('0x31')]);_0x57850a[_0xde7e('0x33')]=_[_0xde7e('0x34')](_0x57850a['model'],_0x57850a[_0xde7e('0x31')]);_0x3e090c['attributes']=_[_0xde7e('0x34')](_0x57850a['model'],qs[_0xde7e('0x35')](_0x1e4376[_0xde7e('0x31')]['fields']));_0x3e090c['attributes']=_0x3e090c[_0xde7e('0x36')][_0xde7e('0x37')]?_0x3e090c['attributes']:_0x57850a['model'];if(!_0x1e4376['query'][_0xde7e('0x38')](_0xde7e('0x39'))){_0x3e090c[_0xde7e('0x1e')]=qs[_0xde7e('0x1e')](_0x1e4376[_0xde7e('0x31')][_0xde7e('0x1e')]);_0x3e090c[_0xde7e('0x1c')]=qs[_0xde7e('0x1c')](_0x1e4376['query'][_0xde7e('0x1c')]);}_0x3e090c[_0xde7e('0x3a')]=qs[_0xde7e('0x3b')](_0x1e4376[_0xde7e('0x31')][_0xde7e('0x3b')]);_0x3e090c[_0xde7e('0x3c')]=qs[_0xde7e('0x33')](_[_0xde7e('0x3d')](_0x1e4376[_0xde7e('0x31')],_0x57850a[_0xde7e('0x33')]),_0x6725de);if(_0x1e4376['query'][_0xde7e('0x3e')]){_0x3e090c[_0xde7e('0x3c')]=_[_0xde7e('0x3f')](_0x3e090c[_0xde7e('0x3c')],{'$or':[{'key':{'$like':'%'+_0x1e4376[_0xde7e('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x1e4376[_0xde7e('0x31')][_0xde7e('0x3e')]+'%'}}]});}_0x3e090c=_['merge']({},_0x3e090c,_0x1e4376[_0xde7e('0x40')]);var _0x40a23e={'where':_0x3e090c[_0xde7e('0x3c')]};return db[_0xde7e('0x2e')][_0xde7e('0x1f')](_0x40a23e)[_0xde7e('0x24')](function(_0x21da83){_0x51c6ed[_0xde7e('0x1f')]=_0x21da83;if(_0x1e4376['query'][_0xde7e('0x41')]){_0x3e090c[_0xde7e('0x42')]=[{'all':!![]}];}return db[_0xde7e('0x2e')][_0xde7e('0x43')](_0x3e090c);})['then'](function(_0x3ea782){_0x51c6ed[_0xde7e('0x44')]=_0x3ea782;return _0x51c6ed;})[_0xde7e('0x24')](respondWithFilteredResult(_0x346a6f,_0x3e090c))[_0xde7e('0x45')](handleError(_0x346a6f,null));};exports[_0xde7e('0x46')]=function(_0x3c2c64,_0x2303a7){var _0x5c66b1={'raw':!![],'where':{'id':_0x3c2c64[_0xde7e('0x47')]['id']}},_0x13262d={};_0x13262d[_0xde7e('0x30')]=_[_0xde7e('0x32')](db[_0xde7e('0x2e')][_0xde7e('0x2f')]);_0x13262d[_0xde7e('0x31')]=_[_0xde7e('0x32')](_0x3c2c64[_0xde7e('0x31')]);_0x13262d[_0xde7e('0x33')]=_[_0xde7e('0x34')](_0x13262d[_0xde7e('0x30')],_0x13262d[_0xde7e('0x31')]);_0x5c66b1[_0xde7e('0x36')]=_[_0xde7e('0x34')](_0x13262d['model'],qs[_0xde7e('0x35')](_0x3c2c64[_0xde7e('0x31')][_0xde7e('0x35')]));_0x5c66b1[_0xde7e('0x36')]=_0x5c66b1['attributes'][_0xde7e('0x37')]?_0x5c66b1[_0xde7e('0x36')]:_0x13262d[_0xde7e('0x30')];if(_0x3c2c64[_0xde7e('0x31')][_0xde7e('0x41')]){_0x5c66b1[_0xde7e('0x42')]=[{'all':!![]}];}_0x5c66b1=_['merge']({},_0x5c66b1,_0x3c2c64[_0xde7e('0x40')]);return db['CannedAnswer']['find'](_0x5c66b1)[_0xde7e('0x24')](handleEntityNotFound(_0x2303a7,null))[_0xde7e('0x24')](respondWithResult(_0x2303a7,null))[_0xde7e('0x45')](handleError(_0x2303a7,null));};exports['update']=function(_0x5bfa69,_0x5986dd){if(_0x5bfa69[_0xde7e('0x48')]['id']){delete _0x5bfa69[_0xde7e('0x48')]['id'];}return db[_0xde7e('0x2e')][_0xde7e('0x49')]({'where':{'id':_0x5bfa69[_0xde7e('0x47')]['id']}})[_0xde7e('0x24')](handleEntityNotFound(_0x5986dd,null))[_0xde7e('0x24')](saveUpdates(_0x5bfa69['body'],null))[_0xde7e('0x24')](respondWithResult(_0x5986dd,null))[_0xde7e('0x45')](handleError(_0x5986dd,null));};exports['destroy']=function(_0x546fb1,_0x20323e){return db[_0xde7e('0x2e')]['find']({'where':{'id':_0x546fb1['params']['id']}})[_0xde7e('0x24')](handleEntityNotFound(_0x20323e,null))[_0xde7e('0x24')](removeEntity(_0x20323e,null))['catch'](handleError(_0x20323e,null));};exports[_0xde7e('0x4a')]=function(_0x20c011,_0x321491){var _0x570bee={'key':_0x20c011[_0xde7e('0x48')]['key']};if(_0x20c011[_0xde7e('0x48')][_0xde7e('0x4b')]){_0x570bee[_0xde7e('0x4b')]=_0x20c011[_0xde7e('0x48')]['MailAccountId'];}else if(_0x20c011[_0xde7e('0x48')]['SmsAccountId']){_0x570bee[_0xde7e('0x4c')]=_0x20c011['body']['SmsAccountId'];}else if(_0x20c011[_0xde7e('0x48')][_0xde7e('0x4d')]){_0x570bee['OpenchannelAccountId']=_0x20c011['body']['OpenchannelAccountId'];}else if(_0x20c011['body']['ChatWebsiteId']){_0x570bee[_0xde7e('0x4e')]=_0x20c011[_0xde7e('0x48')][_0xde7e('0x4e')];}return db[_0xde7e('0x2e')][_0xde7e('0x49')]({'where':_0x570bee})[_0xde7e('0x24')](function(_0x772409){if(_0x772409){throw new db[(_0xde7e('0x4f'))][(_0xde7e('0x50'))](_0xde7e('0x51'));}return db[_0xde7e('0x2e')][_0xde7e('0x4a')](_0x20c011[_0xde7e('0x48')]);})[_0xde7e('0x24')](function(_0x4cf632){var _0x398762=_0x20c011[_0xde7e('0x52')]['get']({'plain':!![]});if(!_0x398762)throw new Error(_0xde7e('0x53'));if(_0x398762[_0xde7e('0x54')]===_0xde7e('0x52')){var _0x3b14ce=_0x4cf632[_0xde7e('0x55')]({'plain':!![]});return db['UserProfileSection'][_0xde7e('0x49')]({'where':{'name':_0xde7e('0x26'),'userProfileId':_0x398762[_0xde7e('0x56')]},'raw':!![]})[_0xde7e('0x24')](function(_0x115798){if(_0x115798&&_0x115798['autoAssociation']===0x0){return db[_0xde7e('0x27')]['create']({'name':_0x3b14ce[_0xde7e('0x2a')],'resourceId':_0x3b14ce['id'],'type':_0x115798[_0xde7e('0x2a')],'sectionId':_0x115798['id']},{})['then'](function(){return _0x4cf632;});}else{return _0x4cf632;}})[_0xde7e('0x45')](function(_0x396ac2){logger[_0xde7e('0x28')](_0xde7e('0x57'),_0x396ac2);throw _0x396ac2;});}return _0x4cf632;})[_0xde7e('0x24')](respondWithResult(_0x321491,0xc9))[_0xde7e('0x45')](handleError(_0x321491,null));};
\ No newline at end of file
+var _0x9bcf=['name','index','map','CannedAnswer','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','intersection','length','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack'];(function(_0x9d3f71,_0x2111e0){var _0x4e692c=function(_0x48508f){while(--_0x48508f){_0x9d3f71['push'](_0x9d3f71['shift']());}};_0x4e692c(++_0x2111e0);}(_0x9bcf,0x12d));var _0xf9bc=function(_0x3bfdcd,_0x3e260e){_0x3bfdcd=_0x3bfdcd-0x0;var _0x1089ae=_0x9bcf[_0x3bfdcd];return _0x1089ae;};'use strict';var emlformat=require(_0xf9bc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf9bc('0x1'));var moment=require(_0xf9bc('0x2'));var BPromise=require(_0xf9bc('0x3'));var Mustache=require('mustache');var util=require(_0xf9bc('0x4'));var path=require(_0xf9bc('0x5'));var sox=require('sox');var csv=require(_0xf9bc('0x6'));var ejs=require(_0xf9bc('0x7'));var fs=require('fs');var fs_extra=require(_0xf9bc('0x8'));var _=require(_0xf9bc('0x9'));var squel=require(_0xf9bc('0xa'));var crypto=require(_0xf9bc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf9bc('0x6'));var querystring=require(_0xf9bc('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9bc('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xf9bc('0xe'));var hardwareService=require(_0xf9bc('0xf'));var logger=require(_0xf9bc('0x10'))(_0xf9bc('0x11'));var utils=require(_0xf9bc('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf9bc('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1458b8,_0x557256){_0x557256=_0x557256||0xcc;return function(_0x536dbe){if(_0x536dbe){return _0x1458b8[_0xf9bc('0x14')](_0x557256);}return _0x1458b8[_0xf9bc('0x15')](_0x557256)['end']();};}function respondWithResult(_0x1d5813,_0x50788d){_0x50788d=_0x50788d||0xc8;return function(_0x170d8e){if(_0x170d8e){return _0x1d5813['status'](_0x50788d)[_0xf9bc('0x16')](_0x170d8e);}};}function respondWithFilteredResult(_0x5cae6b,_0x205606){return function(_0x271167){if(_0x271167){var _0x24f081=typeof _0x205606[_0xf9bc('0x17')]===_0xf9bc('0x18')&&typeof _0x205606[_0xf9bc('0x19')]===_0xf9bc('0x18');var _0x3ddefb=_0x271167['count'];var _0x17963e=_0x24f081?0x0:_0x205606[_0xf9bc('0x17')];var _0x1e68f6=_0x24f081?_0x271167[_0xf9bc('0x1a')]:_0x205606[_0xf9bc('0x17')]+_0x205606[_0xf9bc('0x19')];var _0x5859b7;if(_0x1e68f6>=_0x3ddefb){_0x1e68f6=_0x3ddefb;_0x5859b7=0xc8;}else{_0x5859b7=0xce;}_0x5cae6b['status'](_0x5859b7);return _0x5cae6b[_0xf9bc('0x1b')](_0xf9bc('0x1c'),_0x17963e+'-'+_0x1e68f6+'/'+_0x3ddefb)[_0xf9bc('0x16')](_0x271167);}return null;};}function patchUpdates(_0x58985e){return function(_0x60a3ce){try{jsonpatch[_0xf9bc('0x1d')](_0x60a3ce,_0x58985e,!![]);}catch(_0xb2fdc8){return BPromise['reject'](_0xb2fdc8);}return _0x60a3ce[_0xf9bc('0x1e')]();};}function saveUpdates(_0xa934bc,_0x5d353b){return function(_0x271bfc){if(_0x271bfc){return _0x271bfc[_0xf9bc('0x1f')](_0xa934bc)[_0xf9bc('0x20')](function(_0x369990){return _0x369990;});}return null;};}function removeEntity(_0x4effce,_0x2ecec0){return function(_0x36d60b){if(_0x36d60b){return _0x36d60b[_0xf9bc('0x21')]()[_0xf9bc('0x20')](function(){var _0x421cdf=_0x36d60b[_0xf9bc('0x22')]({'plain':!![]});var _0x5d07b9='CannedAnswers';return db[_0xf9bc('0x23')][_0xf9bc('0x21')]({'where':{'type':_0x5d07b9,'resourceId':_0x421cdf['id']}})[_0xf9bc('0x20')](function(){return _0x36d60b;});})[_0xf9bc('0x20')](function(){_0x4effce['status'](0xcc)[_0xf9bc('0x24')]();});}};}function handleEntityNotFound(_0x3512a2,_0xaafe5a){return function(_0x3b7fb7){if(!_0x3b7fb7){_0x3512a2[_0xf9bc('0x14')](0x194);}return _0x3b7fb7;};}function handleError(_0x847e2d,_0x30dc11){_0x30dc11=_0x30dc11||0x1f4;return function(_0x27df31){logger[_0xf9bc('0x25')](_0x27df31[_0xf9bc('0x26')]);if(_0x27df31[_0xf9bc('0x27')]){delete _0x27df31[_0xf9bc('0x27')];}_0x847e2d[_0xf9bc('0x15')](_0x30dc11)['send'](_0x27df31);};}exports[_0xf9bc('0x28')]=function(_0x591276,_0x41773a){var _0x3c286c={},_0x5598d5={},_0x2a53a8={'count':0x0,'rows':[]};var _0x4b5f4a=_[_0xf9bc('0x29')](db[_0xf9bc('0x2a')][_0xf9bc('0x2b')],function(_0x741ba6){return{'name':_0x741ba6[_0xf9bc('0x2c')],'type':_0x741ba6[_0xf9bc('0x2d')]['key']};});_0x5598d5['model']=_[_0xf9bc('0x29')](_0x4b5f4a,'name');_0x5598d5[_0xf9bc('0x2e')]=_[_0xf9bc('0x2f')](_0x591276[_0xf9bc('0x2e')]);_0x5598d5[_0xf9bc('0x30')]=_['intersection'](_0x5598d5[_0xf9bc('0x31')],_0x5598d5[_0xf9bc('0x2e')]);_0x3c286c['attributes']=_['intersection'](_0x5598d5[_0xf9bc('0x31')],qs[_0xf9bc('0x32')](_0x591276[_0xf9bc('0x2e')]['fields']));_0x3c286c['attributes']=_0x3c286c[_0xf9bc('0x33')]['length']?_0x3c286c[_0xf9bc('0x33')]:_0x5598d5['model'];if(!_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x34')]('nolimit')){_0x3c286c[_0xf9bc('0x19')]=qs[_0xf9bc('0x19')](_0x591276[_0xf9bc('0x2e')]['limit']);_0x3c286c['offset']=qs[_0xf9bc('0x17')](_0x591276['query'][_0xf9bc('0x17')]);}_0x3c286c[_0xf9bc('0x35')]=qs[_0xf9bc('0x36')](_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x36')]);_0x3c286c['where']=qs[_0xf9bc('0x30')](_['pick'](_0x591276[_0xf9bc('0x2e')],_0x5598d5['filters']),_0x4b5f4a);if(_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]){_0x3c286c[_0xf9bc('0x38')]=_[_0xf9bc('0x39')](_0x3c286c['where'],{'$or':[{'key':{'$like':'%'+_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]+'%'}},{'value':{'$like':'%'+_0x591276[_0xf9bc('0x2e')][_0xf9bc('0x37')]+'%'}}]});}_0x3c286c=_[_0xf9bc('0x39')]({},_0x3c286c,_0x591276[_0xf9bc('0x3a')]);var _0x9396af={'where':_0x3c286c[_0xf9bc('0x38')]};return db[_0xf9bc('0x2a')]['count'](_0x9396af)['then'](function(_0x2c7640){_0x2a53a8[_0xf9bc('0x1a')]=_0x2c7640;if(_0x591276['query'][_0xf9bc('0x3b')]){_0x3c286c['include']=[{'all':!![]}];}return db[_0xf9bc('0x2a')][_0xf9bc('0x3c')](_0x3c286c);})[_0xf9bc('0x20')](function(_0x3d4ec7){_0x2a53a8[_0xf9bc('0x3d')]=_0x3d4ec7;return _0x2a53a8;})[_0xf9bc('0x20')](respondWithFilteredResult(_0x41773a,_0x3c286c))[_0xf9bc('0x3e')](handleError(_0x41773a,null));};exports[_0xf9bc('0x3f')]=function(_0x44e473,_0x5ec570){var _0x4295c0={'raw':!![],'where':{'id':_0x44e473[_0xf9bc('0x40')]['id']}},_0x359d78={};_0x359d78[_0xf9bc('0x31')]=_[_0xf9bc('0x2f')](db['CannedAnswer'][_0xf9bc('0x2b')]);_0x359d78[_0xf9bc('0x2e')]=_[_0xf9bc('0x2f')](_0x44e473[_0xf9bc('0x2e')]);_0x359d78[_0xf9bc('0x30')]=_[_0xf9bc('0x41')](_0x359d78[_0xf9bc('0x31')],_0x359d78[_0xf9bc('0x2e')]);_0x4295c0[_0xf9bc('0x33')]=_[_0xf9bc('0x41')](_0x359d78[_0xf9bc('0x31')],qs[_0xf9bc('0x32')](_0x44e473[_0xf9bc('0x2e')][_0xf9bc('0x32')]));_0x4295c0[_0xf9bc('0x33')]=_0x4295c0[_0xf9bc('0x33')][_0xf9bc('0x42')]?_0x4295c0['attributes']:_0x359d78[_0xf9bc('0x31')];if(_0x44e473['query']['includeAll']){_0x4295c0[_0xf9bc('0x43')]=[{'all':!![]}];}_0x4295c0=_[_0xf9bc('0x39')]({},_0x4295c0,_0x44e473[_0xf9bc('0x3a')]);return db[_0xf9bc('0x2a')][_0xf9bc('0x44')](_0x4295c0)['then'](handleEntityNotFound(_0x5ec570,null))[_0xf9bc('0x20')](respondWithResult(_0x5ec570,null))[_0xf9bc('0x3e')](handleError(_0x5ec570,null));};exports[_0xf9bc('0x1f')]=function(_0x11e849,_0x3810eb){if(_0x11e849[_0xf9bc('0x45')]['id']){delete _0x11e849[_0xf9bc('0x45')]['id'];}return db[_0xf9bc('0x2a')][_0xf9bc('0x44')]({'where':{'id':_0x11e849[_0xf9bc('0x40')]['id']}})[_0xf9bc('0x20')](handleEntityNotFound(_0x3810eb,null))[_0xf9bc('0x20')](saveUpdates(_0x11e849['body'],null))[_0xf9bc('0x20')](respondWithResult(_0x3810eb,null))[_0xf9bc('0x3e')](handleError(_0x3810eb,null));};exports[_0xf9bc('0x21')]=function(_0x3e58cc,_0x234b42){return db[_0xf9bc('0x2a')][_0xf9bc('0x44')]({'where':{'id':_0x3e58cc[_0xf9bc('0x40')]['id']}})['then'](handleEntityNotFound(_0x234b42,null))['then'](removeEntity(_0x234b42,null))['catch'](handleError(_0x234b42,null));};exports[_0xf9bc('0x46')]=function(_0x23d929,_0x28b021){var _0xd1cd58={'key':_0x23d929[_0xf9bc('0x45')]['key']};if(_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x47')]){_0xd1cd58[_0xf9bc('0x47')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x47')];}else if(_0x23d929['body'][_0xf9bc('0x48')]){_0xd1cd58[_0xf9bc('0x48')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x48')];}else if(_0x23d929['body']['OpenchannelAccountId']){_0xd1cd58[_0xf9bc('0x49')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x49')];}else if(_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x4a')]){_0xd1cd58[_0xf9bc('0x4a')]=_0x23d929[_0xf9bc('0x45')][_0xf9bc('0x4a')];}return db[_0xf9bc('0x2a')]['find']({'where':_0xd1cd58})[_0xf9bc('0x20')](function(_0x3f792b){if(_0x3f792b){throw new db[(_0xf9bc('0x4b'))][(_0xf9bc('0x4c'))](_0xf9bc('0x4d'));}return db[_0xf9bc('0x2a')][_0xf9bc('0x46')](_0x23d929['body']);})[_0xf9bc('0x20')](function(_0x4c5ab5){var _0x1e6712=_0x23d929['user']['get']({'plain':!![]});if(!_0x1e6712)throw new Error(_0xf9bc('0x4e'));if(_0x1e6712[_0xf9bc('0x4f')]===_0xf9bc('0x50')){var _0x47d6db=_0x4c5ab5[_0xf9bc('0x22')]({'plain':!![]});return db[_0xf9bc('0x51')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x1e6712[_0xf9bc('0x52')]},'raw':!![]})[_0xf9bc('0x20')](function(_0x30e40b){if(_0x30e40b&&_0x30e40b[_0xf9bc('0x53')]===0x0){return db[_0xf9bc('0x23')][_0xf9bc('0x46')]({'name':_0x47d6db[_0xf9bc('0x27')],'resourceId':_0x47d6db['id'],'type':_0x30e40b[_0xf9bc('0x27')],'sectionId':_0x30e40b['id']},{})[_0xf9bc('0x20')](function(){return _0x4c5ab5;});}else{return _0x4c5ab5;}})['catch'](function(_0x575573){logger[_0xf9bc('0x25')](_0xf9bc('0x54'),_0x575573);throw _0x575573;});}return _0x4c5ab5;})[_0xf9bc('0x20')](respondWithResult(_0x28b021,0xc9))[_0xf9bc('0x3e')](handleError(_0x28b021,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 193a1ce..59104bc 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 _0x9a48=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0x9a48,0xc3));var _0x89a4=function(_0x22d7bb,_0x4c158e){_0x22d7bb=_0x22d7bb-0x0;var _0x40a737=_0x9a48[_0x22d7bb];return _0x40a737;};'use strict';var _=require(_0x89a4('0x0'));var util=require(_0x89a4('0x1'));var logger=require(_0x89a4('0x2'))(_0x89a4('0x3'));var moment=require('moment');var BPromise=require(_0x89a4('0x4'));var rp=require(_0x89a4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x89a4('0x6'));var config=require(_0x89a4('0x7'));var attributes=require(_0x89a4('0x8'));module[_0x89a4('0x9')]=function(_0x298135,_0x58c536){return _0x298135['define'](_0x89a4('0xa'),attributes,{'tableName':_0x89a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x89a4('0xc')});};
\ No newline at end of file
+var _0xca0a=['../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','lodash','api','moment','request-promise','path'];(function(_0x592774,_0x19f692){var _0x2ba6fb=function(_0x5f5849){while(--_0x5f5849){_0x592774['push'](_0x592774['shift']());}};_0x2ba6fb(++_0x19f692);}(_0xca0a,0xf5));var _0xaca0=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xca0a[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xaca0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaca0('0x1'));var moment=require(_0xaca0('0x2'));var BPromise=require('bluebird');var rp=require(_0xaca0('0x3'));var fs=require('fs');var path=require(_0xaca0('0x4'));var rimraf=require('rimraf');var config=require(_0xaca0('0x5'));var attributes=require(_0xaca0('0x6'));module[_0xaca0('0x7')]=function(_0x56541f,_0x1f8510){return _0x56541f['define'](_0xaca0('0x8'),attributes,{'tableName':_0xaca0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 5c774a4..1e9757c 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(_0x3e1cdd,_0x4388c5){var _0x2318a3=function(_0x230693){while(--_0x230693){_0x3e1cdd['push'](_0x3e1cdd['shift']());}};_0x2318a3(++_0x4388c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x59a7b7,_0x4d5f8d){var _0x167fc1=function(_0x58ac5a){while(--_0x58ac5a){_0x59a7b7['push'](_0x59a7b7['shift']());}};_0x167fc1(++_0x4d5f8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 a659972..4e70c9a 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 _0xb407=['delete','/:id','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','show','create','put','update'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xb407,0x122));var _0x7b40=function(_0x49927a,_0x41f965){_0x49927a=_0x49927a-0x0;var _0x3692cb=_0xb407[_0x49927a];return _0x3692cb;};'use strict';var multer=require(_0x7b40('0x0'));var util=require(_0x7b40('0x1'));var path=require('path');var timeout=require(_0x7b40('0x2'));var express=require(_0x7b40('0x3'));var router=express['Router']();var fs_extra=require(_0x7b40('0x4'));var auth=require(_0x7b40('0x5'));var interaction=require(_0x7b40('0x6'));var config=require(_0x7b40('0x7'));var controller=require(_0x7b40('0x8'));router['get']('/',auth[_0x7b40('0x9')](),controller[_0x7b40('0xa')]);router[_0x7b40('0xb')]('/:id',auth[_0x7b40('0x9')](),controller[_0x7b40('0xc')]);router['post']('/',auth[_0x7b40('0x9')](),controller[_0x7b40('0xd')]);router[_0x7b40('0xe')]('/:id',auth[_0x7b40('0x9')](),controller[_0x7b40('0xf')]);router[_0x7b40('0x10')](_0x7b40('0x11'),auth[_0x7b40('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xe1dd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','/:id','destroy','exports'];(function(_0xfc4ee7,_0x89427a){var _0x22dd89=function(_0xe01e3b){while(--_0xe01e3b){_0xfc4ee7['push'](_0xfc4ee7['shift']());}};_0x22dd89(++_0x89427a);}(_0xe1dd,0x1c2));var _0xde1d=function(_0x287bd5,_0x47a4eb){_0x287bd5=_0x287bd5-0x0;var _0x4b1605=_0xe1dd[_0x287bd5];return _0x4b1605;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xde1d('0x0'));var timeout=require(_0xde1d('0x1'));var express=require(_0xde1d('0x2'));var router=express[_0xde1d('0x3')]();var fs_extra=require(_0xde1d('0x4'));var auth=require(_0xde1d('0x5'));var interaction=require(_0xde1d('0x6'));var config=require(_0xde1d('0x7'));var controller=require('./cannedAnswer.controller');router[_0xde1d('0x8')]('/',auth[_0xde1d('0x9')](),controller[_0xde1d('0xa')]);router[_0xde1d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xde1d('0xb')]('/',auth[_0xde1d('0x9')](),controller[_0xde1d('0xc')]);router[_0xde1d('0xd')]('/:id',auth[_0xde1d('0x9')](),controller[_0xde1d('0xe')]);router['delete'](_0xde1d('0xf'),auth[_0xde1d('0x9')](),controller[_0xde1d('0x10')]);module[_0xde1d('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index b0044e3..4973b82 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 _0x475d=['sequelize','exports','STRING','INTEGER'];(function(_0x1884c3,_0x3db8ba){var _0x2ccfb6=function(_0xf87f32){while(--_0xf87f32){_0x1884c3['push'](_0x1884c3['shift']());}};_0x2ccfb6(++_0x3db8ba);}(_0x475d,0x110));var _0xd475=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x475d[_0x912d27];return _0x31b918;};'use strict';var Sequelize=require(_0xd475('0x0'));module[_0xd475('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xd475('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xd475('0x2')]},'channel':{'type':Sequelize[_0xd475('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd475('0x2')]},'lastdata':{'type':Sequelize[_0xd475('0x2')]},'duration':{'type':Sequelize[_0xd475('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd475('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd475('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xd475('0x2')]},'uniqueid':{'type':Sequelize[_0xd475('0x2')]},'linkedid':{'type':Sequelize[_0xd475('0x2')]},'sequence':{'type':Sequelize[_0xd475('0x2')]},'peeraccount':{'type':Sequelize[_0xd475('0x2')]},'type':{'type':Sequelize[_0xd475('0x2')]},'tag':{'type':Sequelize[_0xd475('0x2')]}};
\ No newline at end of file
+var _0x7b37=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x1d1a9c,_0x2274db){var _0x3e0c65=function(_0x2c41c5){while(--_0x2c41c5){_0x1d1a9c['push'](_0x1d1a9c['shift']());}};_0x3e0c65(++_0x2274db);}(_0x7b37,0xd9));var _0x77b3=function(_0x4112f5,_0x304bfe){_0x4112f5=_0x4112f5-0x0;var _0x44b7e6=_0x7b37[_0x4112f5];return _0x44b7e6;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x77b3('0x2')},'clid':{'type':Sequelize[_0x77b3('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x77b3('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x77b3('0x3')]},'dstchannel':{'type':Sequelize[_0x77b3('0x3')]},'lastapp':{'type':Sequelize[_0x77b3('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x77b3('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x77b3('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x77b3('0x3')]},'linkedid':{'type':Sequelize[_0x77b3('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x77b3('0x3')]},'type':{'type':Sequelize[_0x77b3('0x3')]},'tag':{'type':Sequelize[_0x77b3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 3f03c44..eca32d4 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 _0x24ca=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','error','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','name','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','update','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x28ddbc,_0x22c1ac){var _0x320180=function(_0x196fdb){while(--_0x196fdb){_0x28ddbc['push'](_0x28ddbc['shift']());}};_0x320180(++_0x22c1ac);}(_0x24ca,0x8c));var _0xa24c=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x24ca[_0x506d2f];return _0x101255;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa24c('0x1'));var rp=require('request-promise');var moment=require(_0xa24c('0x2'));var BPromise=require(_0xa24c('0x3'));var Mustache=require(_0xa24c('0x4'));var util=require('util');var path=require(_0xa24c('0x5'));var sox=require(_0xa24c('0x6'));var csv=require(_0xa24c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa24c('0x8'));var crypto=require(_0xa24c('0x9'));var jsforce=require(_0xa24c('0xa'));var deskjs=require(_0xa24c('0xb'));var toCsv=require(_0xa24c('0x7'));var querystring=require(_0xa24c('0xc'));var Papa=require('papaparse');var Redis=require(_0xa24c('0xd'));var authService=require(_0xa24c('0xe'));var qs=require(_0xa24c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa24c('0x10'))(_0xa24c('0x11'));var utils=require(_0xa24c('0x12'));var config=require(_0xa24c('0x13'));var licenseUtil=require(_0xa24c('0x14'));var db=require(_0xa24c('0x15'))['db'];function respondWithStatusCode(_0x566313,_0x5bb631){_0x5bb631=_0x5bb631||0xcc;return function(_0x4907f6){if(_0x4907f6){return _0x566313[_0xa24c('0x16')](_0x5bb631);}return _0x566313[_0xa24c('0x17')](_0x5bb631)[_0xa24c('0x18')]();};}function respondWithResult(_0x9fe9e3,_0x4351a8){_0x4351a8=_0x4351a8||0xc8;return function(_0x4971af){if(_0x4971af){return _0x9fe9e3[_0xa24c('0x17')](_0x4351a8)['json'](_0x4971af);}};}function respondWithFilteredResult(_0x493bcb,_0x588acf){return function(_0x2e8dc9){if(_0x2e8dc9){var _0x2a4270=typeof _0x588acf[_0xa24c('0x19')]===_0xa24c('0x1a')&&typeof _0x588acf[_0xa24c('0x1b')]===_0xa24c('0x1a');var _0x2197da=_0x2e8dc9[_0xa24c('0x1c')];var _0x14f0aa=_0x2a4270?0x0:_0x588acf[_0xa24c('0x19')];var _0x1970fc=_0x2a4270?_0x2e8dc9[_0xa24c('0x1c')]:_0x588acf[_0xa24c('0x19')]+_0x588acf[_0xa24c('0x1b')];var _0x5276b6;if(_0x1970fc>=_0x2197da){_0x1970fc=_0x2197da;_0x5276b6=0xc8;}else{_0x5276b6=0xce;}_0x493bcb[_0xa24c('0x17')](_0x5276b6);return _0x493bcb['set'](_0xa24c('0x1d'),_0x14f0aa+'-'+_0x1970fc+'/'+_0x2197da)[_0xa24c('0x1e')](_0x2e8dc9);}return null;};}function patchUpdates(_0x8c3949){return function(_0x37e20e){try{jsonpatch[_0xa24c('0x1f')](_0x37e20e,_0x8c3949,!![]);}catch(_0x416dea){return BPromise[_0xa24c('0x20')](_0x416dea);}return _0x37e20e[_0xa24c('0x21')]();};}function saveUpdates(_0xba710,_0x2ec5ad){return function(_0x2b471a){if(_0x2b471a){return _0x2b471a['update'](_0xba710)['then'](function(_0x10fa25){return _0x10fa25;});}return null;};}function removeEntity(_0xdd32a8,_0x316a68){return function(_0x1a04ff){if(_0x1a04ff){return _0x1a04ff[_0xa24c('0x22')]()[_0xa24c('0x23')](function(){_0xdd32a8[_0xa24c('0x17')](0xcc)[_0xa24c('0x18')]();});}};}function handleEntityNotFound(_0x304d6c,_0x4dc3dc){return function(_0x2290e1){if(!_0x2290e1){_0x304d6c['sendStatus'](0x194);}return _0x2290e1;};}function handleError(_0x1f347b,_0x256fbc){_0x256fbc=_0x256fbc||0x1f4;return function(_0x471421){logger[_0xa24c('0x24')](_0x471421['stack']);if(_0x471421['name']){delete _0x471421['name'];}_0x1f347b['status'](_0x256fbc)[_0xa24c('0x25')](_0x471421);};}exports[_0xa24c('0x26')]=function(_0xab6197,_0x1cdee4){var _0x37cbd3={},_0x5361d4={},_0x5c8113={'count':0x0,'rows':[]};var _0x33c208=_[_0xa24c('0x27')](db[_0xa24c('0x28')][_0xa24c('0x29')],function(_0x4566dc){return{'name':_0x4566dc[_0xa24c('0x2a')],'type':_0x4566dc[_0xa24c('0x2b')][_0xa24c('0x2c')]};});_0x5361d4[_0xa24c('0x2d')]=_[_0xa24c('0x27')](_0x33c208,'name');_0x5361d4[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0xab6197['query']);_0x5361d4[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],_0x5361d4[_0xa24c('0x2e')]);_0x37cbd3[_0xa24c('0x32')]=_[_0xa24c('0x31')](_0x5361d4[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x33')]));_0x37cbd3['attributes']=_0x37cbd3['attributes']['length']?_0x37cbd3[_0xa24c('0x32')]:_0x5361d4['model'];if(!_0xab6197[_0xa24c('0x2e')][_0xa24c('0x34')](_0xa24c('0x35'))){_0x37cbd3['limit']=qs[_0xa24c('0x1b')](_0xab6197[_0xa24c('0x2e')][_0xa24c('0x1b')]);_0x37cbd3['offset']=qs[_0xa24c('0x19')](_0xab6197[_0xa24c('0x2e')]['offset']);}_0x37cbd3[_0xa24c('0x36')]=qs[_0xa24c('0x37')](_0xab6197[_0xa24c('0x2e')]['sort']);_0x37cbd3[_0xa24c('0x38')]=qs[_0xa24c('0x30')](_[_0xa24c('0x39')](_0xab6197[_0xa24c('0x2e')],_0x5361d4[_0xa24c('0x30')]),_0x33c208);if(_0xab6197['query'][_0xa24c('0x3a')]){_0x37cbd3[_0xa24c('0x38')]=_['merge'](_0x37cbd3[_0xa24c('0x38')],{'$or':_[_0xa24c('0x27')](_0x33c208,function(_0x2417d9){if(_0x2417d9['type']!=='VIRTUAL'){var _0x1f7535={};_0x1f7535[_0x2417d9[_0xa24c('0x3b')]]={'$like':'%'+_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3a')]+'%'};return _0x1f7535;}})});}_0x37cbd3=_[_0xa24c('0x3c')]({},_0x37cbd3,_0xab6197[_0xa24c('0x3d')]);var _0x54ea40={'where':_0x37cbd3[_0xa24c('0x38')]};return db[_0xa24c('0x28')][_0xa24c('0x1c')](_0x54ea40)[_0xa24c('0x23')](function(_0x5f3cd4){_0x5c8113[_0xa24c('0x1c')]=_0x5f3cd4;if(_0xab6197[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x37cbd3[_0xa24c('0x3f')]=[{'all':!![]}];}return db[_0xa24c('0x28')][_0xa24c('0x40')](_0x37cbd3);})[_0xa24c('0x23')](function(_0x54939b){_0x5c8113['rows']=_0x54939b;return _0x5c8113;})[_0xa24c('0x23')](respondWithFilteredResult(_0x1cdee4,_0x37cbd3))['catch'](handleError(_0x1cdee4,null));};exports[_0xa24c('0x41')]=function(_0x4fae76,_0x32e151){var _0x214627={'raw':!![],'where':{'id':_0x4fae76[_0xa24c('0x42')]['id']}},_0x37372d={};_0x37372d[_0xa24c('0x2d')]=_[_0xa24c('0x2f')](db[_0xa24c('0x28')][_0xa24c('0x29')]);_0x37372d[_0xa24c('0x2e')]=_[_0xa24c('0x2f')](_0x4fae76[_0xa24c('0x2e')]);_0x37372d[_0xa24c('0x30')]=_[_0xa24c('0x31')](_0x37372d[_0xa24c('0x2d')],_0x37372d[_0xa24c('0x2e')]);_0x214627[_0xa24c('0x32')]=_['intersection'](_0x37372d[_0xa24c('0x2d')],qs[_0xa24c('0x33')](_0x4fae76[_0xa24c('0x2e')]['fields']));_0x214627[_0xa24c('0x32')]=_0x214627[_0xa24c('0x32')][_0xa24c('0x43')]?_0x214627[_0xa24c('0x32')]:_0x37372d['model'];if(_0x4fae76[_0xa24c('0x2e')][_0xa24c('0x3e')]){_0x214627[_0xa24c('0x3f')]=[{'all':!![]}];}_0x214627=_[_0xa24c('0x3c')]({},_0x214627,_0x4fae76[_0xa24c('0x3d')]);return db[_0xa24c('0x28')][_0xa24c('0x44')](_0x214627)[_0xa24c('0x23')](handleEntityNotFound(_0x32e151,null))[_0xa24c('0x23')](respondWithResult(_0x32e151,null))[_0xa24c('0x45')](handleError(_0x32e151,null));};exports[_0xa24c('0x46')]=function(_0xeac74f,_0x261c41){return db['Cdr'][_0xa24c('0x46')](_0xeac74f['body'],{})[_0xa24c('0x23')](respondWithResult(_0x261c41,0xc9))[_0xa24c('0x45')](handleError(_0x261c41,null));};exports[_0xa24c('0x47')]=function(_0x1641b8,_0xd4761e){if(_0x1641b8[_0xa24c('0x48')]['id']){delete _0x1641b8[_0xa24c('0x48')]['id'];}return db[_0xa24c('0x28')][_0xa24c('0x44')]({'where':{'id':_0x1641b8[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0xd4761e,null))[_0xa24c('0x23')](saveUpdates(_0x1641b8[_0xa24c('0x48')],null))['then'](respondWithResult(_0xd4761e,null))[_0xa24c('0x45')](handleError(_0xd4761e,null));};exports[_0xa24c('0x22')]=function(_0x3875fb,_0x456181){return db['Cdr'][_0xa24c('0x44')]({'where':{'id':_0x3875fb[_0xa24c('0x42')]['id']}})[_0xa24c('0x23')](handleEntityNotFound(_0x456181,null))['then'](removeEntity(_0x456181,null))['catch'](handleError(_0x456181,null));};exports[_0xa24c('0x49')]=function(_0x1c8980,_0x4992ee){return db[_0xa24c('0x28')][_0xa24c('0x49')]()['then'](respondWithResult(_0x4992ee,null))[_0xa24c('0x45')](handleError(_0x4992ee,null));};
\ No newline at end of file
+var _0xae30=['offset','apply','reject','end','sendStatus','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','then','rows','catch','show','params','includeAll','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','limit','count'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0xae30,0x10a));var _0x0ae3=function(_0x2c2f35,_0x20cda1){_0x2c2f35=_0x2c2f35-0x0;var _0x543b7e=_0xae30[_0x2c2f35];return _0x543b7e;};'use strict';var emlformat=require(_0x0ae3('0x0'));var rimraf=require(_0x0ae3('0x1'));var zipdir=require(_0x0ae3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var BPromise=require(_0x0ae3('0x5'));var Mustache=require(_0x0ae3('0x6'));var util=require('util');var path=require(_0x0ae3('0x7'));var sox=require(_0x0ae3('0x8'));var csv=require(_0x0ae3('0x9'));var ejs=require(_0x0ae3('0xa'));var fs=require('fs');var fs_extra=require(_0x0ae3('0xb'));var _=require(_0x0ae3('0xc'));var squel=require(_0x0ae3('0xd'));var crypto=require(_0x0ae3('0xe'));var jsforce=require(_0x0ae3('0xf'));var deskjs=require(_0x0ae3('0x10'));var toCsv=require(_0x0ae3('0x9'));var querystring=require(_0x0ae3('0x11'));var Papa=require(_0x0ae3('0x12'));var Redis=require('ioredis');var authService=require(_0x0ae3('0x13'));var qs=require(_0x0ae3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ae3('0x15'))(_0x0ae3('0x16'));var utils=require(_0x0ae3('0x17'));var config=require(_0x0ae3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245ac0,_0x45242d){_0x45242d=_0x45242d||0xcc;return function(_0x50cee6){if(_0x50cee6){return _0x245ac0['sendStatus'](_0x45242d);}return _0x245ac0[_0x0ae3('0x19')](_0x45242d)['end']();};}function respondWithResult(_0x1b1e46,_0x450000){_0x450000=_0x450000||0xc8;return function(_0x1a6c69){if(_0x1a6c69){return _0x1b1e46[_0x0ae3('0x19')](_0x450000)[_0x0ae3('0x1a')](_0x1a6c69);}};}function respondWithFilteredResult(_0x1600bc,_0x28b547){return function(_0x5af348){if(_0x5af348){var _0x17f280=typeof _0x28b547['offset']===_0x0ae3('0x1b')&&typeof _0x28b547[_0x0ae3('0x1c')]===_0x0ae3('0x1b');var _0x59d0de=_0x5af348[_0x0ae3('0x1d')];var _0x40edc6=_0x17f280?0x0:_0x28b547[_0x0ae3('0x1e')];var _0x1bf406=_0x17f280?_0x5af348[_0x0ae3('0x1d')]:_0x28b547['offset']+_0x28b547[_0x0ae3('0x1c')];var _0x4b8949;if(_0x1bf406>=_0x59d0de){_0x1bf406=_0x59d0de;_0x4b8949=0xc8;}else{_0x4b8949=0xce;}_0x1600bc['status'](_0x4b8949);return _0x1600bc['set']('Content-Range',_0x40edc6+'-'+_0x1bf406+'/'+_0x59d0de)['json'](_0x5af348);}return null;};}function patchUpdates(_0x4e8135){return function(_0x4d1385){try{jsonpatch[_0x0ae3('0x1f')](_0x4d1385,_0x4e8135,!![]);}catch(_0x1fd946){return BPromise[_0x0ae3('0x20')](_0x1fd946);}return _0x4d1385['save']();};}function saveUpdates(_0x1cdd85,_0x5ecc45){return function(_0xfcf4a8){if(_0xfcf4a8){return _0xfcf4a8['update'](_0x1cdd85)['then'](function(_0x5ab18d){return _0x5ab18d;});}return null;};}function removeEntity(_0x281adf,_0x3b49a0){return function(_0x51e7d1){if(_0x51e7d1){return _0x51e7d1['destroy']()['then'](function(){_0x281adf[_0x0ae3('0x19')](0xcc)[_0x0ae3('0x21')]();});}};}function handleEntityNotFound(_0x5a76e5,_0x36ce4e){return function(_0x1613c3){if(!_0x1613c3){_0x5a76e5[_0x0ae3('0x22')](0x194);}return _0x1613c3;};}function handleError(_0x5b0117,_0x2f8134){_0x2f8134=_0x2f8134||0x1f4;return function(_0x1f9cde){logger[_0x0ae3('0x23')](_0x1f9cde['stack']);if(_0x1f9cde[_0x0ae3('0x24')]){delete _0x1f9cde[_0x0ae3('0x24')];}_0x5b0117[_0x0ae3('0x19')](_0x2f8134)['send'](_0x1f9cde);};}exports[_0x0ae3('0x25')]=function(_0x247623,_0xf0e310){var _0x152876={},_0x1f8f61={},_0x10a7bd={'count':0x0,'rows':[]};var _0x5e8979=_[_0x0ae3('0x26')](db[_0x0ae3('0x27')][_0x0ae3('0x28')],function(_0x4032f4){return{'name':_0x4032f4[_0x0ae3('0x29')],'type':_0x4032f4[_0x0ae3('0x2a')][_0x0ae3('0x2b')]};});_0x1f8f61[_0x0ae3('0x2c')]=_['map'](_0x5e8979,_0x0ae3('0x24'));_0x1f8f61[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x247623[_0x0ae3('0x2d')]);_0x1f8f61['filters']=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],_0x1f8f61[_0x0ae3('0x2d')]);_0x152876[_0x0ae3('0x30')]=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],qs['fields'](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x31')]));_0x152876[_0x0ae3('0x30')]=_0x152876[_0x0ae3('0x30')][_0x0ae3('0x32')]?_0x152876[_0x0ae3('0x30')]:_0x1f8f61[_0x0ae3('0x2c')];if(!_0x247623['query']['hasOwnProperty'](_0x0ae3('0x33'))){_0x152876[_0x0ae3('0x1c')]=qs[_0x0ae3('0x1c')](_0x247623['query']['limit']);_0x152876[_0x0ae3('0x1e')]=qs[_0x0ae3('0x1e')](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x1e')]);}_0x152876[_0x0ae3('0x34')]=qs[_0x0ae3('0x35')](_0x247623[_0x0ae3('0x2d')]['sort']);_0x152876[_0x0ae3('0x36')]=qs[_0x0ae3('0x37')](_[_0x0ae3('0x38')](_0x247623['query'],_0x1f8f61['filters']),_0x5e8979);if(_0x247623['query'][_0x0ae3('0x39')]){_0x152876[_0x0ae3('0x36')]=_['merge'](_0x152876[_0x0ae3('0x36')],{'$or':_[_0x0ae3('0x26')](_0x5e8979,function(_0x3ee862){if(_0x3ee862['type']!==_0x0ae3('0x3a')){var _0x5dd8d7={};_0x5dd8d7[_0x3ee862[_0x0ae3('0x24')]]={'$like':'%'+_0x247623[_0x0ae3('0x2d')]['filter']+'%'};return _0x5dd8d7;}})});}_0x152876=_[_0x0ae3('0x3b')]({},_0x152876,_0x247623[_0x0ae3('0x3c')]);var _0xfa6c7f={'where':_0x152876[_0x0ae3('0x36')]};return db[_0x0ae3('0x27')]['count'](_0xfa6c7f)['then'](function(_0x2e95e5){_0x10a7bd[_0x0ae3('0x1d')]=_0x2e95e5;if(_0x247623['query']['includeAll']){_0x152876['include']=[{'all':!![]}];}return db['Cdr'][_0x0ae3('0x3d')](_0x152876);})[_0x0ae3('0x3e')](function(_0x325153){_0x10a7bd[_0x0ae3('0x3f')]=_0x325153;return _0x10a7bd;})[_0x0ae3('0x3e')](respondWithFilteredResult(_0xf0e310,_0x152876))[_0x0ae3('0x40')](handleError(_0xf0e310,null));};exports[_0x0ae3('0x41')]=function(_0x3166af,_0x2cfc16){var _0x1230c9={'raw':!![],'where':{'id':_0x3166af[_0x0ae3('0x42')]['id']}},_0x5a0e74={};_0x5a0e74[_0x0ae3('0x2c')]=_['keys'](db[_0x0ae3('0x27')][_0x0ae3('0x28')]);_0x5a0e74[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x3166af[_0x0ae3('0x2d')]);_0x5a0e74['filters']=_[_0x0ae3('0x2f')](_0x5a0e74[_0x0ae3('0x2c')],_0x5a0e74[_0x0ae3('0x2d')]);_0x1230c9[_0x0ae3('0x30')]=_['intersection'](_0x5a0e74[_0x0ae3('0x2c')],qs[_0x0ae3('0x31')](_0x3166af['query'][_0x0ae3('0x31')]));_0x1230c9[_0x0ae3('0x30')]=_0x1230c9['attributes']['length']?_0x1230c9[_0x0ae3('0x30')]:_0x5a0e74[_0x0ae3('0x2c')];if(_0x3166af[_0x0ae3('0x2d')][_0x0ae3('0x43')]){_0x1230c9[_0x0ae3('0x44')]=[{'all':!![]}];}_0x1230c9=_['merge']({},_0x1230c9,_0x3166af['options']);return db[_0x0ae3('0x27')]['find'](_0x1230c9)[_0x0ae3('0x3e')](handleEntityNotFound(_0x2cfc16,null))[_0x0ae3('0x3e')](respondWithResult(_0x2cfc16,null))['catch'](handleError(_0x2cfc16,null));};exports[_0x0ae3('0x45')]=function(_0x3e4bfb,_0x53e018){return db[_0x0ae3('0x27')][_0x0ae3('0x45')](_0x3e4bfb[_0x0ae3('0x46')],{})[_0x0ae3('0x3e')](respondWithResult(_0x53e018,0xc9))[_0x0ae3('0x40')](handleError(_0x53e018,null));};exports['update']=function(_0x3ad6b3,_0x53393b){if(_0x3ad6b3[_0x0ae3('0x46')]['id']){delete _0x3ad6b3[_0x0ae3('0x46')]['id'];}return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x3ad6b3[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x53393b,null))[_0x0ae3('0x3e')](saveUpdates(_0x3ad6b3[_0x0ae3('0x46')],null))['then'](respondWithResult(_0x53393b,null))[_0x0ae3('0x40')](handleError(_0x53393b,null));};exports[_0x0ae3('0x48')]=function(_0x29479f,_0x12ea03){return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x29479f[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x12ea03,null))[_0x0ae3('0x3e')](removeEntity(_0x12ea03,null))[_0x0ae3('0x40')](handleError(_0x12ea03,null));};exports[_0x0ae3('0x49')]=function(_0x572166,_0x256dc5){return db['Cdr'][_0x0ae3('0x49')]()[_0x0ae3('0x3e')](respondWithResult(_0x256dc5,null))[_0x0ae3('0x40')](handleError(_0x256dc5,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index b16b715..42fb32d 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(_0x2e9c7d,_0x379775){var _0x440303=function(_0x2433fa){while(--_0x2433fa){_0x2e9c7d['push'](_0x2e9c7d['shift']());}};_0x440303(++_0x379775);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x5c45b6,_0x186363){var _0x7e295f=function(_0x129495){while(--_0x129495){_0x5c45b6['push'](_0x5c45b6['shift']());}};_0x7e295f(++_0x186363);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 6c1fb5c..d921ef0 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 _0x1bd9=['Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2708b1,_0x57728c){var _0x4446a2=function(_0x5ea1f9){while(--_0x5ea1f9){_0x2708b1['push'](_0x2708b1['shift']());}};_0x4446a2(++_0x57728c);}(_0x1bd9,0xe1));var _0x91bd=function(_0xb134ee,_0x367cfa){_0xb134ee=_0xb134ee-0x0;var _0x846ff=_0x1bd9[_0xb134ee];return _0x846ff;};'use strict';var _=require('lodash');var util=require(_0x91bd('0x0'));var moment=require(_0x91bd('0x1'));var BPromise=require(_0x91bd('0x2'));var rs=require(_0x91bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x91bd('0x5'))(_0x91bd('0x6'));var config=require(_0x91bd('0x7'));var jayson=require(_0x91bd('0x8'));var client=jayson[_0x91bd('0x9')][_0x91bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39c3b1,_0x2b6e54,_0x5e0ed4){return new BPromise(function(_0x24a08d,_0x2277ad){return client[_0x91bd('0xb')](_0x39c3b1,_0x5e0ed4)[_0x91bd('0xc')](function(_0x36c517){logger[_0x91bd('0xd')](_0x91bd('0xe'),_0x2b6e54,_0x91bd('0xf'));logger[_0x91bd('0x10')](_0x91bd('0x11'),_0x2b6e54,'request\x20sent',JSON[_0x91bd('0x12')](_0x36c517));if(_0x36c517[_0x91bd('0x13')]){if(_0x36c517[_0x91bd('0x13')]['code']===0x1f4){logger[_0x91bd('0x13')](_0x91bd('0xe'),_0x2b6e54,_0x36c517[_0x91bd('0x13')][_0x91bd('0x14')]);return _0x2277ad(_0x36c517[_0x91bd('0x13')][_0x91bd('0x14')]);}logger[_0x91bd('0x13')](_0x91bd('0xe'),_0x2b6e54,_0x36c517[_0x91bd('0x13')][_0x91bd('0x14')]);return _0x24a08d(_0x36c517['error'][_0x91bd('0x14')]);}else{logger[_0x91bd('0xd')]('Cdr,\x20%s,\x20%s',_0x2b6e54,_0x91bd('0xf'));_0x24a08d(_0x36c517['result'][_0x91bd('0x14')]);}})[_0x91bd('0x15')](function(_0x28f598){logger[_0x91bd('0x13')](_0x91bd('0xe'),_0x2b6e54,_0x28f598);_0x2277ad(_0x28f598);});});}
\ No newline at end of file
+var _0x57ca=['info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ca,0x14a));var _0xa57c=function(_0x25af68,_0x4d205a){_0x25af68=_0x25af68-0x0;var _0x3b3491=_0x57ca[_0x25af68];return _0x3b3491;};'use strict';var _=require(_0xa57c('0x0'));var util=require(_0xa57c('0x1'));var moment=require('moment');var BPromise=require(_0xa57c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa57c('0x3'))['db'];var utils=require(_0xa57c('0x4'));var logger=require(_0xa57c('0x5'))('rpc');var config=require(_0xa57c('0x6'));var jayson=require(_0xa57c('0x7'));var client=jayson['client'][_0xa57c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c82f4,_0x10711c,_0x1bd548){return new BPromise(function(_0x4a5264,_0x16e8fb){return client['request'](_0x1c82f4,_0x1bd548)[_0xa57c('0x9')](function(_0x4ca7ad){logger[_0xa57c('0xa')](_0xa57c('0xb'),_0x10711c,'request\x20sent');logger[_0xa57c('0xc')](_0xa57c('0xd'),_0x10711c,_0xa57c('0xe'),JSON[_0xa57c('0xf')](_0x4ca7ad));if(_0x4ca7ad[_0xa57c('0x10')]){if(_0x4ca7ad[_0xa57c('0x10')]['code']===0x1f4){logger['error'](_0xa57c('0xb'),_0x10711c,_0x4ca7ad['error'][_0xa57c('0x11')]);return _0x16e8fb(_0x4ca7ad[_0xa57c('0x10')][_0xa57c('0x11')]);}logger[_0xa57c('0x10')](_0xa57c('0xb'),_0x10711c,_0x4ca7ad[_0xa57c('0x10')][_0xa57c('0x11')]);return _0x4a5264(_0x4ca7ad[_0xa57c('0x10')]['message']);}else{logger[_0xa57c('0xa')](_0xa57c('0xb'),_0x10711c,'request\x20sent');_0x4a5264(_0x4ca7ad[_0xa57c('0x12')][_0xa57c('0x11')]);}})[_0xa57c('0x13')](function(_0x7a939a){logger['error'](_0xa57c('0xb'),_0x10711c,_0x7a939a);_0x16e8fb(_0x7a939a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index c24ef64..f4900a1 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 _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(_0x435a26,_0x2c35c2){var _0x2f604a=function(_0x3c9ec9){while(--_0x3c9ec9){_0x435a26['push'](_0x435a26['shift']());}};_0x2f604a(++_0x2c35c2);}(_0xb10b,0x12a));var _0xbb10=function(_0x35dadd,_0x3ed50f){_0x35dadd=_0x35dadd-0x0;var _0x2728ed=_0xb10b[_0x35dadd];return _0x2728ed;};'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
+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(_0x20a573,_0x3328b4){var _0x399adf=function(_0x2196a1){while(--_0x2196a1){_0x20a573['push'](_0x20a573['shift']());}};_0x399adf(++_0x3328b4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index d7fdd7f..b58f327 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 _0xde83=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x369a41,_0x5ed95c){var _0x16807d=function(_0x189d9f){while(--_0x189d9f){_0x369a41['push'](_0x369a41['shift']());}};_0x16807d(++_0x5ed95c);}(_0xde83,0x1e1));var _0x3de8=function(_0x51b661,_0x566ef8){_0x51b661=_0x51b661-0x0;var _0x5d1971=_0xde83[_0x51b661];return _0x5d1971;};'use strict';var Sequelize=require(_0x3de8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3de8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3de8('0x2')],'allowNull':![],'defaultValue':_0x3de8('0x3')},'appdata':{'type':Sequelize[_0x3de8('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3de8('0x2')],'defaultValue':_0x3de8('0x5')}};
\ No newline at end of file
+var _0xca11=['exports','STRING','noop','*,*,*,*'];(function(_0x2f7f56,_0x389de3){var _0x49a05b=function(_0x3a89d6){while(--_0x3a89d6){_0x2f7f56['push'](_0x2f7f56['shift']());}};_0x49a05b(++_0x389de3);}(_0xca11,0x150));var _0x1ca1=function(_0x2fa703,_0x4fcbdc){_0x2fa703=_0x2fa703-0x0;var _0x3789ab=_0xca11[_0x2fa703];return _0x3789ab;};'use strict';var Sequelize=require('sequelize');module[_0x1ca1('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1ca1('0x1')],'allowNull':![],'defaultValue':_0x1ca1('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1ca1('0x1')]},'interval':{'type':Sequelize[_0x1ca1('0x1')],'defaultValue':_0x1ca1('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 4a021fb..171dbc8 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 _0x9c2c=['send','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','ChatApplication','find','catch','body','eml-format','rimraf','moment','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name'];(function(_0x496c76,_0x2a0695){var _0x2a9b1e=function(_0x440b20){while(--_0x440b20){_0x496c76['push'](_0x496c76['shift']());}};_0x2a9b1e(++_0x2a0695);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc9c2('0x0'));var rimraf=require(_0xc9c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc9c2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc9c2('0x3'));var util=require(_0xc9c2('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xc9c2('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9c2('0x6'));var _=require(_0xc9c2('0x7'));var squel=require(_0xc9c2('0x8'));var crypto=require(_0xc9c2('0x9'));var jsforce=require(_0xc9c2('0xa'));var deskjs=require(_0xc9c2('0xb'));var toCsv=require(_0xc9c2('0x5'));var querystring=require(_0xc9c2('0xc'));var Papa=require(_0xc9c2('0xd'));var Redis=require('ioredis');var authService=require(_0xc9c2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc9c2('0xf'));var hardwareService=require(_0xc9c2('0x10'));var logger=require(_0xc9c2('0x11'))(_0xc9c2('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc9c2('0x13'));var db=require(_0xc9c2('0x14'))['db'];function respondWithStatusCode(_0x568f69,_0x7ec780){_0x7ec780=_0x7ec780||0xcc;return function(_0x1f08a7){if(_0x1f08a7){return _0x568f69[_0xc9c2('0x15')](_0x7ec780);}return _0x568f69[_0xc9c2('0x16')](_0x7ec780)[_0xc9c2('0x17')]();};}function respondWithResult(_0x3b0058,_0x33b288){_0x33b288=_0x33b288||0xc8;return function(_0x132702){if(_0x132702){return _0x3b0058[_0xc9c2('0x16')](_0x33b288)[_0xc9c2('0x18')](_0x132702);}};}function respondWithFilteredResult(_0xf94209,_0x383667){return function(_0x480d7c){if(_0x480d7c){var _0x27840d=typeof _0x383667[_0xc9c2('0x19')]===_0xc9c2('0x1a')&&typeof _0x383667[_0xc9c2('0x1b')]===_0xc9c2('0x1a');var _0x49413b=_0x480d7c[_0xc9c2('0x1c')];var _0x37c027=_0x27840d?0x0:_0x383667[_0xc9c2('0x19')];var _0x4e4ded=_0x27840d?_0x480d7c[_0xc9c2('0x1c')]:_0x383667[_0xc9c2('0x19')]+_0x383667[_0xc9c2('0x1b')];var _0x484ca3;if(_0x4e4ded>=_0x49413b){_0x4e4ded=_0x49413b;_0x484ca3=0xc8;}else{_0x484ca3=0xce;}_0xf94209[_0xc9c2('0x16')](_0x484ca3);return _0xf94209[_0xc9c2('0x1d')]('Content-Range',_0x37c027+'-'+_0x4e4ded+'/'+_0x49413b)['json'](_0x480d7c);}return null;};}function patchUpdates(_0x37e3){return function(_0x50f280){try{jsonpatch[_0xc9c2('0x1e')](_0x50f280,_0x37e3,!![]);}catch(_0x140c8a){return BPromise[_0xc9c2('0x1f')](_0x140c8a);}return _0x50f280[_0xc9c2('0x20')]();};}function saveUpdates(_0x3e1774,_0x53c460){return function(_0x1fbac4){if(_0x1fbac4){return _0x1fbac4[_0xc9c2('0x21')](_0x3e1774)[_0xc9c2('0x22')](function(_0x11cc07){return _0x11cc07;});}return null;};}function removeEntity(_0x32c372,_0x385030){return function(_0x56e515){if(_0x56e515){return _0x56e515[_0xc9c2('0x23')]()[_0xc9c2('0x22')](function(){_0x32c372['status'](0xcc)[_0xc9c2('0x17')]();});}};}function handleEntityNotFound(_0x4b3b97,_0xa18b32){return function(_0xd803e9){if(!_0xd803e9){_0x4b3b97[_0xc9c2('0x15')](0x194);}return _0xd803e9;};}function handleError(_0x2222e4,_0x484d55){_0x484d55=_0x484d55||0x1f4;return function(_0x2073ef){logger['error'](_0x2073ef[_0xc9c2('0x24')]);if(_0x2073ef[_0xc9c2('0x25')]){delete _0x2073ef[_0xc9c2('0x25')];}_0x2222e4[_0xc9c2('0x16')](_0x484d55)[_0xc9c2('0x26')](_0x2073ef);};}exports['show']=function(_0x3cedb5,_0xe2f93b){var _0x40033a={'raw':!![],'where':{'id':_0x3cedb5[_0xc9c2('0x27')]['id']}},_0x1554ae={};_0x1554ae[_0xc9c2('0x28')]=_[_0xc9c2('0x29')](db['ChatApplication'][_0xc9c2('0x2a')]);_0x1554ae['query']=_[_0xc9c2('0x29')](_0x3cedb5[_0xc9c2('0x2b')]);_0x1554ae['filters']=_[_0xc9c2('0x2c')](_0x1554ae[_0xc9c2('0x28')],_0x1554ae[_0xc9c2('0x2b')]);_0x40033a[_0xc9c2('0x2d')]=_['intersection'](_0x1554ae[_0xc9c2('0x28')],qs[_0xc9c2('0x2e')](_0x3cedb5['query']['fields']));_0x40033a[_0xc9c2('0x2d')]=_0x40033a[_0xc9c2('0x2d')][_0xc9c2('0x2f')]?_0x40033a['attributes']:_0x1554ae['model'];if(_0x3cedb5[_0xc9c2('0x2b')][_0xc9c2('0x30')]){_0x40033a['include']=[{'all':!![]}];}_0x40033a=_[_0xc9c2('0x31')]({},_0x40033a,_0x3cedb5['options']);return db[_0xc9c2('0x32')][_0xc9c2('0x33')](_0x40033a)[_0xc9c2('0x22')](handleEntityNotFound(_0xe2f93b,null))[_0xc9c2('0x22')](respondWithResult(_0xe2f93b,null))[_0xc9c2('0x34')](handleError(_0xe2f93b,null));};exports[_0xc9c2('0x21')]=function(_0x2f26c5,_0x1cd2f3){if(_0x2f26c5[_0xc9c2('0x35')]['id']){delete _0x2f26c5['body']['id'];}return db[_0xc9c2('0x32')]['find']({'where':{'id':_0x2f26c5[_0xc9c2('0x27')]['id']}})[_0xc9c2('0x22')](handleEntityNotFound(_0x1cd2f3,null))['then'](saveUpdates(_0x2f26c5[_0xc9c2('0x35')],null))[_0xc9c2('0x22')](respondWithResult(_0x1cd2f3,null))['catch'](handleError(_0x1cd2f3,null));};exports[_0xc9c2('0x23')]=function(_0x22a935,_0x264fd7){return db['ChatApplication'][_0xc9c2('0x33')]({'where':{'id':_0x22a935['params']['id']}})[_0xc9c2('0x22')](handleEntityNotFound(_0x264fd7,null))[_0xc9c2('0x22')](removeEntity(_0x264fd7,null))['catch'](handleError(_0x264fd7,null));};
\ No newline at end of file
+var _0xdca3=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','ChatApplication','find','body','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdca3,0x64));var _0x3dca=function(_0x2a9772,_0x22c9c6){_0x2a9772=_0x2a9772-0x0;var _0x51f364=_0xdca3[_0x2a9772];return _0x51f364;};'use strict';var emlformat=require(_0x3dca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dca('0x1'));var jsonpatch=require(_0x3dca('0x2'));var rp=require(_0x3dca('0x3'));var moment=require(_0x3dca('0x4'));var BPromise=require(_0x3dca('0x5'));var Mustache=require(_0x3dca('0x6'));var util=require(_0x3dca('0x7'));var path=require(_0x3dca('0x8'));var sox=require(_0x3dca('0x9'));var csv=require(_0x3dca('0xa'));var ejs=require(_0x3dca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3dca('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3dca('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3dca('0xa'));var querystring=require(_0x3dca('0xe'));var Papa=require(_0x3dca('0xf'));var Redis=require(_0x3dca('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3dca('0x11'));var as=require(_0x3dca('0x12'));var hardwareService=require(_0x3dca('0x13'));var logger=require(_0x3dca('0x14'))(_0x3dca('0x15'));var utils=require(_0x3dca('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x3dca('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bfeda,_0x24c6c9){_0x24c6c9=_0x24c6c9||0xcc;return function(_0x11f54e){if(_0x11f54e){return _0x5bfeda[_0x3dca('0x18')](_0x24c6c9);}return _0x5bfeda[_0x3dca('0x19')](_0x24c6c9)[_0x3dca('0x1a')]();};}function respondWithResult(_0x344892,_0xa4149a){_0xa4149a=_0xa4149a||0xc8;return function(_0xf1350d){if(_0xf1350d){return _0x344892[_0x3dca('0x19')](_0xa4149a)[_0x3dca('0x1b')](_0xf1350d);}};}function respondWithFilteredResult(_0x3d1154,_0x911042){return function(_0x1b5906){if(_0x1b5906){var _0x5dc428=typeof _0x911042['offset']===_0x3dca('0x1c')&&typeof _0x911042[_0x3dca('0x1d')]===_0x3dca('0x1c');var _0x1a4ee=_0x1b5906[_0x3dca('0x1e')];var _0x8c046c=_0x5dc428?0x0:_0x911042['offset'];var _0x3a16b4=_0x5dc428?_0x1b5906[_0x3dca('0x1e')]:_0x911042[_0x3dca('0x1f')]+_0x911042[_0x3dca('0x1d')];var _0x4a3cd1;if(_0x3a16b4>=_0x1a4ee){_0x3a16b4=_0x1a4ee;_0x4a3cd1=0xc8;}else{_0x4a3cd1=0xce;}_0x3d1154[_0x3dca('0x19')](_0x4a3cd1);return _0x3d1154[_0x3dca('0x20')](_0x3dca('0x21'),_0x8c046c+'-'+_0x3a16b4+'/'+_0x1a4ee)['json'](_0x1b5906);}return null;};}function patchUpdates(_0x501201){return function(_0x4399ba){try{jsonpatch['apply'](_0x4399ba,_0x501201,!![]);}catch(_0x5f1ad3){return BPromise[_0x3dca('0x22')](_0x5f1ad3);}return _0x4399ba['save']();};}function saveUpdates(_0x4316b7,_0x592459){return function(_0x5b0dee){if(_0x5b0dee){return _0x5b0dee[_0x3dca('0x23')](_0x4316b7)[_0x3dca('0x24')](function(_0x439b6a){return _0x439b6a;});}return null;};}function removeEntity(_0x25f8e7,_0x59be49){return function(_0x18a452){if(_0x18a452){return _0x18a452[_0x3dca('0x25')]()[_0x3dca('0x24')](function(){_0x25f8e7['status'](0xcc)[_0x3dca('0x1a')]();});}};}function handleEntityNotFound(_0x3148ce,_0x4c2dd2){return function(_0x26a21b){if(!_0x26a21b){_0x3148ce[_0x3dca('0x18')](0x194);}return _0x26a21b;};}function handleError(_0x372b1e,_0x2580f6){_0x2580f6=_0x2580f6||0x1f4;return function(_0x3fd367){logger[_0x3dca('0x26')](_0x3fd367[_0x3dca('0x27')]);if(_0x3fd367[_0x3dca('0x28')]){delete _0x3fd367[_0x3dca('0x28')];}_0x372b1e[_0x3dca('0x19')](_0x2580f6)[_0x3dca('0x29')](_0x3fd367);};}exports[_0x3dca('0x2a')]=function(_0xa14500,_0x12560e){var _0x3d13f9={'raw':!![],'where':{'id':_0xa14500[_0x3dca('0x2b')]['id']}},_0x377c6e={};_0x377c6e[_0x3dca('0x2c')]=_[_0x3dca('0x2d')](db['ChatApplication'][_0x3dca('0x2e')]);_0x377c6e[_0x3dca('0x2f')]=_[_0x3dca('0x2d')](_0xa14500[_0x3dca('0x2f')]);_0x377c6e[_0x3dca('0x30')]=_[_0x3dca('0x31')](_0x377c6e[_0x3dca('0x2c')],_0x377c6e['query']);_0x3d13f9['attributes']=_['intersection'](_0x377c6e[_0x3dca('0x2c')],qs['fields'](_0xa14500[_0x3dca('0x2f')][_0x3dca('0x32')]));_0x3d13f9[_0x3dca('0x33')]=_0x3d13f9[_0x3dca('0x33')][_0x3dca('0x34')]?_0x3d13f9[_0x3dca('0x33')]:_0x377c6e[_0x3dca('0x2c')];if(_0xa14500[_0x3dca('0x2f')][_0x3dca('0x35')]){_0x3d13f9[_0x3dca('0x36')]=[{'all':!![]}];}_0x3d13f9=_[_0x3dca('0x37')]({},_0x3d13f9,_0xa14500['options']);return db[_0x3dca('0x38')][_0x3dca('0x39')](_0x3d13f9)[_0x3dca('0x24')](handleEntityNotFound(_0x12560e,null))[_0x3dca('0x24')](respondWithResult(_0x12560e,null))['catch'](handleError(_0x12560e,null));};exports[_0x3dca('0x23')]=function(_0x4fb281,_0x5713d9){if(_0x4fb281[_0x3dca('0x3a')]['id']){delete _0x4fb281[_0x3dca('0x3a')]['id'];}return db[_0x3dca('0x38')][_0x3dca('0x39')]({'where':{'id':_0x4fb281[_0x3dca('0x2b')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x5713d9,null))['then'](saveUpdates(_0x4fb281[_0x3dca('0x3a')],null))[_0x3dca('0x24')](respondWithResult(_0x5713d9,null))[_0x3dca('0x3b')](handleError(_0x5713d9,null));};exports[_0x3dca('0x25')]=function(_0x430dc3,_0x4147d6){return db['ChatApplication'][_0x3dca('0x39')]({'where':{'id':_0x430dc3[_0x3dca('0x2b')]['id']}})[_0x3dca('0x24')](handleEntityNotFound(_0x4147d6,null))[_0x3dca('0x24')](removeEntity(_0x4147d6,null))[_0x3dca('0x3b')](handleError(_0x4147d6,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index c39bd73..e2f1188 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 _0xffdf=['./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','../../config/environment'];(function(_0x2be1ab,_0x2fe1fc){var _0x4c616d=function(_0x16dfc8){while(--_0x16dfc8){_0x2be1ab['push'](_0x2be1ab['shift']());}};_0x4c616d(++_0x2fe1fc);}(_0xffdf,0x7e));var _0xfffd=function(_0x723d04,_0x45db46){_0x723d04=_0x723d04-0x0;var _0x51a640=_0xffdf[_0x723d04];return _0x51a640;};'use strict';var _=require(_0xfffd('0x0'));var util=require(_0xfffd('0x1'));var logger=require(_0xfffd('0x2'))('api');var moment=require(_0xfffd('0x3'));var BPromise=require(_0xfffd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfffd('0x5'));var attributes=require(_0xfffd('0x6'));module['exports']=function(_0x5d58c0,_0x38d2c4){return _0x5d58c0['define'](_0xfffd('0x7'),attributes,{'tableName':_0xfffd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfffd('0x9'),'collate':_0xfffd('0xa')});};
\ No newline at end of file
+var _0x625b=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','lodash','util','../../config/logger','api','moment'];(function(_0x216b8a,_0x459a11){var _0x344626=function(_0x27c690){while(--_0x27c690){_0x216b8a['push'](_0x216b8a['shift']());}};_0x344626(++_0x459a11);}(_0x625b,0x121));var _0xb625=function(_0x5a3d77,_0x1e1898){_0x5a3d77=_0x5a3d77-0x0;var _0x40e312=_0x625b[_0x5a3d77];return _0x40e312;};'use strict';var _=require(_0xb625('0x0'));var util=require(_0xb625('0x1'));var logger=require(_0xb625('0x2'))(_0xb625('0x3'));var moment=require(_0xb625('0x4'));var BPromise=require(_0xb625('0x5'));var rp=require(_0xb625('0x6'));var fs=require('fs');var path=require(_0xb625('0x7'));var rimraf=require(_0xb625('0x8'));var config=require(_0xb625('0x9'));var attributes=require(_0xb625('0xa'));module[_0xb625('0xb')]=function(_0x98fac0,_0x1a67d9){return _0x98fac0[_0xb625('0xc')](_0xb625('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index c6dc634..1fa8952 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 _0x0cfe=['rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','randomstring','../../mysqldb','../../config/utils'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x0cfe,0x1ca));var _0xe0cf=function(_0x527cae,_0x476036){_0x527cae=_0x527cae-0x0;var _0x10bd2c=_0x0cfe[_0x527cae];return _0x10bd2c;};'use strict';var _=require(_0xe0cf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe0cf('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0cf('0x2'))['db'];var utils=require(_0xe0cf('0x3'));var logger=require('../../config/logger')(_0xe0cf('0x4'));var config=require(_0xe0cf('0x5'));var jayson=require(_0xe0cf('0x6'));var client=jayson['client'][_0xe0cf('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x596389,_0x1a62c8,_0x143d66){return new BPromise(function(_0x25d89e,_0x51503a){return client[_0xe0cf('0x8')](_0x596389,_0x143d66)[_0xe0cf('0x9')](function(_0x156dec){logger[_0xe0cf('0xa')]('ChatApplication,\x20%s,\x20%s',_0x1a62c8,'request\x20sent');logger[_0xe0cf('0xb')](_0xe0cf('0xc'),_0x1a62c8,_0xe0cf('0xd'),JSON[_0xe0cf('0xe')](_0x156dec));if(_0x156dec[_0xe0cf('0xf')]){if(_0x156dec[_0xe0cf('0xf')][_0xe0cf('0x10')]===0x1f4){logger[_0xe0cf('0xf')]('ChatApplication,\x20%s,\x20%s',_0x1a62c8,_0x156dec['error'][_0xe0cf('0x11')]);return _0x51503a(_0x156dec[_0xe0cf('0xf')][_0xe0cf('0x11')]);}logger[_0xe0cf('0xf')](_0xe0cf('0x12'),_0x1a62c8,_0x156dec[_0xe0cf('0xf')][_0xe0cf('0x11')]);return _0x25d89e(_0x156dec[_0xe0cf('0xf')]['message']);}else{logger[_0xe0cf('0xa')](_0xe0cf('0x12'),_0x1a62c8,_0xe0cf('0xd'));_0x25d89e(_0x156dec[_0xe0cf('0x13')][_0xe0cf('0x11')]);}})[_0xe0cf('0x14')](function(_0x1bbbf3){logger[_0xe0cf('0xf')](_0xe0cf('0x12'),_0x1a62c8,_0x1bbbf3);_0x51503a(_0x1bbbf3);});});}
\ No newline at end of file
+var _0x2047=['rpc','../../config/environment','jayson/promise','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1019d9,_0x24c81f){var _0x403e4e=function(_0x5ab52e){while(--_0x5ab52e){_0x1019d9['push'](_0x1019d9['shift']());}};_0x403e4e(++_0x24c81f);}(_0x2047,0x81));var _0x7204=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2047[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0x7204('0x0'));var util=require(_0x7204('0x1'));var moment=require(_0x7204('0x2'));var BPromise=require(_0x7204('0x3'));var rs=require(_0x7204('0x4'));var fs=require('fs');var Redis=require(_0x7204('0x5'));var db=require(_0x7204('0x6'))['db'];var utils=require(_0x7204('0x7'));var logger=require(_0x7204('0x8'))(_0x7204('0x9'));var config=require(_0x7204('0xa'));var jayson=require(_0x7204('0xb'));var client=jayson['client'][_0x7204('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10545a,_0x2e8875,_0x44dbc9){return new BPromise(function(_0x4ca6c5,_0x473399){return client[_0x7204('0xd')](_0x10545a,_0x44dbc9)['then'](function(_0x2fa61a){logger[_0x7204('0xe')](_0x7204('0xf'),_0x2e8875,_0x7204('0x10'));logger[_0x7204('0x11')](_0x7204('0x12'),_0x2e8875,_0x7204('0x10'),JSON['stringify'](_0x2fa61a));if(_0x2fa61a[_0x7204('0x13')]){if(_0x2fa61a[_0x7204('0x13')][_0x7204('0x14')]===0x1f4){logger['error'](_0x7204('0xf'),_0x2e8875,_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);return _0x473399(_0x2fa61a['error'][_0x7204('0x15')]);}logger[_0x7204('0x13')](_0x7204('0xf'),_0x2e8875,_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);return _0x4ca6c5(_0x2fa61a[_0x7204('0x13')][_0x7204('0x15')]);}else{logger[_0x7204('0xe')](_0x7204('0xf'),_0x2e8875,'request\x20sent');_0x4ca6c5(_0x2fa61a['result'][_0x7204('0x15')]);}})[_0x7204('0x16')](function(_0x382e6e){logger[_0x7204('0x13')](_0x7204('0xf'),_0x2e8875,_0x382e6e);_0x473399(_0x382e6e);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 39edaa0..3d20ea2 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 _0x9569=['delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','/:id','isAuthenticated','show'];(function(_0x14f635,_0x170c15){var _0x306f19=function(_0x4fa66e){while(--_0x4fa66e){_0x14f635['push'](_0x14f635['shift']());}};_0x306f19(++_0x170c15);}(_0x9569,0x17c));var _0x9956=function(_0x56605b,_0x2409fb){_0x56605b=_0x56605b-0x0;var _0x175447=_0x9569[_0x56605b];return _0x175447;};'use strict';var multer=require(_0x9956('0x0'));var util=require(_0x9956('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9956('0x2'));var router=express['Router']();var fs_extra=require(_0x9956('0x3'));var auth=require(_0x9956('0x4'));var interaction=require(_0x9956('0x5'));var config=require('../../config/environment');var controller=require(_0x9956('0x6'));router['get'](_0x9956('0x7'),auth[_0x9956('0x8')](),controller[_0x9956('0x9')]);router['put'](_0x9956('0x7'),auth[_0x9956('0x8')](),controller['update']);router[_0x9956('0xa')](_0x9956('0x7'),auth[_0x9956('0x8')](),controller[_0x9956('0xb')]);module[_0x9956('0xc')]=router;
\ No newline at end of file
+var _0x97d0=['./chatApplication.controller','/:id','isAuthenticated','show','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45bfa1,_0x479201){var _0x32c4ae=function(_0x49ba26){while(--_0x49ba26){_0x45bfa1['push'](_0x45bfa1['shift']());}};_0x32c4ae(++_0x479201);}(_0x97d0,0xb7));var _0x097d=function(_0x1c6f0e,_0x16838a){_0x1c6f0e=_0x1c6f0e-0x0;var _0x34b778=_0x97d0[_0x1c6f0e];return _0x34b778;};'use strict';var multer=require(_0x097d('0x0'));var util=require(_0x097d('0x1'));var path=require('path');var timeout=require(_0x097d('0x2'));var express=require(_0x097d('0x3'));var router=express[_0x097d('0x4')]();var fs_extra=require(_0x097d('0x5'));var auth=require(_0x097d('0x6'));var interaction=require(_0x097d('0x7'));var config=require(_0x097d('0x8'));var controller=require(_0x097d('0x9'));router['get'](_0x097d('0xa'),auth[_0x097d('0xb')](),controller[_0x097d('0xc')]);router[_0x097d('0xd')]('/:id',auth[_0x097d('0xb')](),controller[_0x097d('0xe')]);router['delete'](_0x097d('0xa'),auth[_0x097d('0xb')](),controller[_0x097d('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 87450ad..c54fed1 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 _0x84cd=['BOOLEAN','sequelize','STRING'];(function(_0x601a66,_0x395e65){var _0x3d610b=function(_0x43adcc){while(--_0x43adcc){_0x601a66['push'](_0x601a66['shift']());}};_0x3d610b(++_0x395e65);}(_0x84cd,0xb2));var _0xd84c=function(_0x29b9bf,_0x59e269){_0x29b9bf=_0x29b9bf-0x0;var _0x99908a=_0x84cd[_0x29b9bf];return _0x99908a;};'use strict';var Sequelize=require(_0xd84c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd84c('0x1')]},'write':{'type':Sequelize[_0xd84c('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x4c6a=['sequelize','exports','STRING'];(function(_0x12d812,_0x496bb7){var _0x3711ab=function(_0x3259da){while(--_0x3259da){_0x12d812['push'](_0x12d812['shift']());}};_0x3711ab(++_0x496bb7);}(_0x4c6a,0xb4));var _0xa4c6=function(_0x428042,_0x52a4f2){_0x428042=_0x428042-0x0;var _0x81c7b9=_0x4c6a[_0x428042];return _0x81c7b9;};'use strict';var Sequelize=require(_0xa4c6('0x0'));module[_0xa4c6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa4c6('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 198036e..19ef54e 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 _0xcfbf=['../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','count','includeAll','include','catch','show','params','ChatGroup','keys','find','create','body','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5ac81b,_0x4acfe7){var _0x29ba2a=function(_0x14e49f){while(--_0x14e49f){_0x5ac81b['push'](_0x5ac81b['shift']());}};_0x29ba2a(++_0x4acfe7);}(_0xcfbf,0x103));var _0xfcfb=function(_0x47e890,_0x3b99d5){_0x47e890=_0x47e890-0x0;var _0x434f6d=_0xcfbf[_0x47e890];return _0x434f6d;};'use strict';var emlformat=require(_0xfcfb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfcfb('0x1'));var jsonpatch=require(_0xfcfb('0x2'));var rp=require('request-promise');var moment=require(_0xfcfb('0x3'));var BPromise=require(_0xfcfb('0x4'));var Mustache=require(_0xfcfb('0x5'));var util=require(_0xfcfb('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xfcfb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcfb('0x8'));var _=require(_0xfcfb('0x9'));var squel=require(_0xfcfb('0xa'));var crypto=require('crypto');var jsforce=require(_0xfcfb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfcfb('0x7'));var querystring=require(_0xfcfb('0xc'));var Papa=require(_0xfcfb('0xd'));var Redis=require(_0xfcfb('0xe'));var authService=require(_0xfcfb('0xf'));var qs=require(_0xfcfb('0x10'));var as=require(_0xfcfb('0x11'));var hardwareService=require(_0xfcfb('0x12'));var logger=require(_0xfcfb('0x13'))(_0xfcfb('0x14'));var utils=require(_0xfcfb('0x15'));var config=require(_0xfcfb('0x16'));var licenseUtil=require(_0xfcfb('0x17'));var db=require(_0xfcfb('0x18'))['db'];config[_0xfcfb('0x19')]=_['defaults'](config[_0xfcfb('0x19')],{'host':_0xfcfb('0x1a'),'port':0x18eb});var socket=require(_0xfcfb('0x1b'))(new Redis(config[_0xfcfb('0x19')]));require('./chatGroup.socket')[_0xfcfb('0x1c')](socket);function respondWithStatusCode(_0x235f3f,_0x573c9a){_0x573c9a=_0x573c9a||0xcc;return function(_0x390aea){if(_0x390aea){return _0x235f3f[_0xfcfb('0x1d')](_0x573c9a);}return _0x235f3f[_0xfcfb('0x1e')](_0x573c9a)[_0xfcfb('0x1f')]();};}function respondWithResult(_0x41a374,_0x68ca66){_0x68ca66=_0x68ca66||0xc8;return function(_0x229d4){if(_0x229d4){return _0x41a374['status'](_0x68ca66)['json'](_0x229d4);}};}function respondWithFilteredResult(_0x2362b9,_0x2cf5be){return function(_0x46b4eb){if(_0x46b4eb){var _0x43b86c=typeof _0x2cf5be[_0xfcfb('0x20')]===_0xfcfb('0x21')&&typeof _0x2cf5be[_0xfcfb('0x22')]===_0xfcfb('0x21');var _0x37a2d8=_0x46b4eb['count'];var _0x5c3f9a=_0x43b86c?0x0:_0x2cf5be[_0xfcfb('0x20')];var _0x8e63b3=_0x43b86c?_0x46b4eb['count']:_0x2cf5be[_0xfcfb('0x20')]+_0x2cf5be[_0xfcfb('0x22')];var _0x145fd4;if(_0x8e63b3>=_0x37a2d8){_0x8e63b3=_0x37a2d8;_0x145fd4=0xc8;}else{_0x145fd4=0xce;}_0x2362b9[_0xfcfb('0x1e')](_0x145fd4);return _0x2362b9[_0xfcfb('0x23')](_0xfcfb('0x24'),_0x5c3f9a+'-'+_0x8e63b3+'/'+_0x37a2d8)[_0xfcfb('0x25')](_0x46b4eb);}return null;};}function patchUpdates(_0x2c0d34){return function(_0xca1434){try{jsonpatch[_0xfcfb('0x26')](_0xca1434,_0x2c0d34,!![]);}catch(_0x24a1a0){return BPromise[_0xfcfb('0x27')](_0x24a1a0);}return _0xca1434['save']();};}function saveUpdates(_0x4535fc,_0x468361){return function(_0x430860){if(_0x430860){return _0x430860[_0xfcfb('0x28')](_0x4535fc)[_0xfcfb('0x29')](function(_0x323fd9){return _0x323fd9;});}return null;};}function removeEntity(_0x4ae15d,_0x50b83c){return function(_0x283deb){if(_0x283deb){return _0x283deb[_0xfcfb('0x2a')]()['then'](function(){_0x4ae15d[_0xfcfb('0x1e')](0xcc)[_0xfcfb('0x1f')]();});}};}function handleEntityNotFound(_0x25bbe5,_0x59fd5f){return function(_0x3758fe){if(!_0x3758fe){_0x25bbe5[_0xfcfb('0x1d')](0x194);}return _0x3758fe;};}function handleError(_0x32fbd2,_0x1aa784){_0x1aa784=_0x1aa784||0x1f4;return function(_0x582894){logger[_0xfcfb('0x2b')](_0x582894[_0xfcfb('0x2c')]);if(_0x582894[_0xfcfb('0x2d')]){delete _0x582894[_0xfcfb('0x2d')];}_0x32fbd2[_0xfcfb('0x1e')](_0x1aa784)['send'](_0x582894);};}exports[_0xfcfb('0x2e')]=function(_0x576b62,_0x42b465){var _0x3aea16={},_0x4039f3={},_0x4aa693={'count':0x0,'rows':[]};var _0x52ef60=_[_0xfcfb('0x2f')](db['ChatGroup']['rawAttributes'],function(_0x39e208){return{'name':_0x39e208['fieldName'],'type':_0x39e208[_0xfcfb('0x30')][_0xfcfb('0x31')]};});_0x4039f3[_0xfcfb('0x32')]=_[_0xfcfb('0x2f')](_0x52ef60,_0xfcfb('0x2d'));_0x4039f3[_0xfcfb('0x33')]=_['keys'](_0x576b62['query']);_0x4039f3[_0xfcfb('0x34')]=_[_0xfcfb('0x35')](_0x4039f3[_0xfcfb('0x32')],_0x4039f3[_0xfcfb('0x33')]);_0x3aea16[_0xfcfb('0x36')]=_[_0xfcfb('0x35')](_0x4039f3[_0xfcfb('0x32')],qs[_0xfcfb('0x37')](_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x37')]));_0x3aea16[_0xfcfb('0x36')]=_0x3aea16[_0xfcfb('0x36')][_0xfcfb('0x38')]?_0x3aea16[_0xfcfb('0x36')]:_0x4039f3[_0xfcfb('0x32')];if(!_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x39')]('nolimit')){_0x3aea16[_0xfcfb('0x22')]=qs[_0xfcfb('0x22')](_0x576b62['query'][_0xfcfb('0x22')]);_0x3aea16[_0xfcfb('0x20')]=qs[_0xfcfb('0x20')](_0x576b62['query']['offset']);}_0x3aea16[_0xfcfb('0x3a')]=qs[_0xfcfb('0x3b')](_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x3b')]);_0x3aea16['where']=qs['filters'](_[_0xfcfb('0x3c')](_0x576b62[_0xfcfb('0x33')],_0x4039f3[_0xfcfb('0x34')]),_0x52ef60);if(_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x3d')]){_0x3aea16[_0xfcfb('0x3e')]=_[_0xfcfb('0x3f')](_0x3aea16[_0xfcfb('0x3e')],{'$or':_[_0xfcfb('0x2f')](_0x52ef60,function(_0x3562ba){if(_0x3562ba[_0xfcfb('0x30')]!=='VIRTUAL'){var _0x28b5c0={};_0x28b5c0[_0x3562ba[_0xfcfb('0x2d')]]={'$like':'%'+_0x576b62[_0xfcfb('0x33')][_0xfcfb('0x3d')]+'%'};return _0x28b5c0;}})});}_0x3aea16=_['merge']({},_0x3aea16,_0x576b62[_0xfcfb('0x40')]);var _0x4dd59c={'where':_0x3aea16[_0xfcfb('0x3e')]};return db['ChatGroup']['count'](_0x4dd59c)[_0xfcfb('0x29')](function(_0x6b4e49){_0x4aa693[_0xfcfb('0x41')]=_0x6b4e49;if(_0x576b62['query'][_0xfcfb('0x42')]){_0x3aea16[_0xfcfb('0x43')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x3aea16);})[_0xfcfb('0x29')](function(_0x3bb809){_0x4aa693['rows']=_0x3bb809;return _0x4aa693;})['then'](respondWithFilteredResult(_0x42b465,_0x3aea16))[_0xfcfb('0x44')](handleError(_0x42b465,null));};exports[_0xfcfb('0x45')]=function(_0x35b2ff,_0x5b5002){var _0x301ef2={'raw':!![],'where':{'id':_0x35b2ff[_0xfcfb('0x46')]['id']}},_0x38a88e={};_0x38a88e[_0xfcfb('0x32')]=_['keys'](db[_0xfcfb('0x47')]['rawAttributes']);_0x38a88e[_0xfcfb('0x33')]=_[_0xfcfb('0x48')](_0x35b2ff[_0xfcfb('0x33')]);_0x38a88e[_0xfcfb('0x34')]=_['intersection'](_0x38a88e[_0xfcfb('0x32')],_0x38a88e[_0xfcfb('0x33')]);_0x301ef2[_0xfcfb('0x36')]=_['intersection'](_0x38a88e[_0xfcfb('0x32')],qs[_0xfcfb('0x37')](_0x35b2ff[_0xfcfb('0x33')]['fields']));_0x301ef2['attributes']=_0x301ef2[_0xfcfb('0x36')]['length']?_0x301ef2[_0xfcfb('0x36')]:_0x38a88e['model'];if(_0x35b2ff['query'][_0xfcfb('0x42')]){_0x301ef2['include']=[{'all':!![]}];}_0x301ef2=_[_0xfcfb('0x3f')]({},_0x301ef2,_0x35b2ff['options']);return db[_0xfcfb('0x47')][_0xfcfb('0x49')](_0x301ef2)['then'](handleEntityNotFound(_0x5b5002,null))['then'](respondWithResult(_0x5b5002,null))['catch'](handleError(_0x5b5002,null));};exports[_0xfcfb('0x4a')]=function(_0x51c722,_0x95dd22){return db[_0xfcfb('0x47')][_0xfcfb('0x4a')](_0x51c722[_0xfcfb('0x4b')],{})[_0xfcfb('0x29')](respondWithResult(_0x95dd22,0xc9))[_0xfcfb('0x44')](handleError(_0x95dd22,null));};exports[_0xfcfb('0x28')]=function(_0x5f2678,_0x58d6bc){if(_0x5f2678['body']['id']){delete _0x5f2678['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x5f2678[_0xfcfb('0x46')]['id']}})[_0xfcfb('0x29')](handleEntityNotFound(_0x58d6bc,null))[_0xfcfb('0x29')](saveUpdates(_0x5f2678[_0xfcfb('0x4b')],null))[_0xfcfb('0x29')](respondWithResult(_0x58d6bc,null))[_0xfcfb('0x44')](handleError(_0x58d6bc,null));};exports['destroy']=function(_0x5e1d8e,_0x324776){return db[_0xfcfb('0x47')][_0xfcfb('0x49')]({'where':{'id':_0x5e1d8e[_0xfcfb('0x46')]['id']}})['then'](handleEntityNotFound(_0x324776,null))[_0xfcfb('0x29')](removeEntity(_0x324776,null))[_0xfcfb('0x44')](handleError(_0x324776,null));};exports[_0xfcfb('0x4c')]=function(_0x3415b6,_0x5666b1){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x5666b1,null))[_0xfcfb('0x44')](handleError(_0x5666b1,null));};exports[_0xfcfb('0x4d')]=function(_0x1bdc10,_0xfc342d,_0x4ccfe4){return db[_0xfcfb('0x4e')][_0xfcfb('0x41')]({'where':{'ChatGroupId':_0x1bdc10[_0xfcfb('0x46')]['id'],'ToId':_0x1bdc10['user']['id'],'read':![]}})['then'](function(_0x515092){return{'id':_['toInteger'](_0x1bdc10['params']['id']),'count':_0x515092};})[_0xfcfb('0x29')](respondWithResult(_0xfc342d,null))[_0xfcfb('0x44')](handleError(_0xfc342d,null));};exports[_0xfcfb('0x4f')]=function(_0x2920db,_0x4d15e6,_0x39a76e){return db['ChatGroup'][_0xfcfb('0x49')]({'where':{'id':_0x2920db[_0xfcfb('0x46')]['id']}})[_0xfcfb('0x29')](handleEntityNotFound(_0x4d15e6,null))[_0xfcfb('0x29')](function(_0x38fd47){if(_0x38fd47){return _0x38fd47['addMembers'](_0x2920db[_0xfcfb('0x4b')][_0xfcfb('0x50')],_[_0xfcfb('0x51')](_0x2920db['body'],[_0xfcfb('0x50'),'id'])||{});}})['then'](respondWithResult(_0x4d15e6,null))[_0xfcfb('0x44')](handleError(_0x4d15e6,null));};exports[_0xfcfb('0x52')]=function(_0x179a95,_0x456530,_0x35dab7){var _0x3cad54={};var _0x12fa7d={};var _0x2b5897;var _0x66296;return db[_0xfcfb('0x47')][_0xfcfb('0x53')]({'where':{'id':_0x179a95[_0xfcfb('0x46')]['id']}})[_0xfcfb('0x29')](handleEntityNotFound(_0x456530,null))[_0xfcfb('0x29')](function(_0x4312d0){if(_0x4312d0){_0x2b5897=_0x4312d0;_0x12fa7d[_0xfcfb('0x32')]=_[_0xfcfb('0x48')](db[_0xfcfb('0x54')][_0xfcfb('0x55')]);_0x12fa7d[_0xfcfb('0x33')]=_[_0xfcfb('0x48')](_0x179a95[_0xfcfb('0x33')]);_0x12fa7d[_0xfcfb('0x34')]=_[_0xfcfb('0x35')](_0x12fa7d['model'],_0x12fa7d[_0xfcfb('0x33')]);_0x3cad54[_0xfcfb('0x36')]=_[_0xfcfb('0x35')](_0x12fa7d[_0xfcfb('0x32')],qs[_0xfcfb('0x37')](_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x37')]));_0x3cad54[_0xfcfb('0x36')]=_0x3cad54[_0xfcfb('0x36')][_0xfcfb('0x38')]?_0x3cad54[_0xfcfb('0x36')]:_0x12fa7d[_0xfcfb('0x32')];_0x3cad54[_0xfcfb('0x3a')]=qs['sort'](_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x3b')]);_0x3cad54[_0xfcfb('0x3e')]=qs[_0xfcfb('0x34')](_[_0xfcfb('0x3c')](_0x179a95[_0xfcfb('0x33')],_0x12fa7d[_0xfcfb('0x34')]));if(_0x179a95[_0xfcfb('0x33')]['filter']){_0x3cad54['where']=_[_0xfcfb('0x3f')](_0x3cad54['where'],{'$or':_[_0xfcfb('0x2f')](_0x3cad54['attributes'],function(_0x1fe158){var _0x195a90={};_0x195a90[_0x1fe158]={'$like':'%'+_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x3d')]+'%'};return _0x195a90;})});}_0x3cad54=_[_0xfcfb('0x3f')]({},_0x3cad54,_0x179a95[_0xfcfb('0x40')]);return _0x2b5897['getMembers'](_0x3cad54);}})['then'](function(_0xd1d913){if(_0xd1d913){_0x66296=_0xd1d913[_0xfcfb('0x38')];if(!_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x39')]('nolimit')){_0x3cad54[_0xfcfb('0x22')]=qs['limit'](_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x22')]);_0x3cad54[_0xfcfb('0x20')]=qs[_0xfcfb('0x20')](_0x179a95[_0xfcfb('0x33')][_0xfcfb('0x20')]);}return _0x2b5897[_0xfcfb('0x52')](_0x3cad54);}})[_0xfcfb('0x29')](function(_0x42a66d){if(_0x42a66d){return _0x42a66d?{'count':_0x66296,'rows':_0x42a66d}:null;}})[_0xfcfb('0x29')](respondWithResult(_0x456530,null))['catch'](handleError(_0x456530,null));};exports[_0xfcfb('0x56')]=function(_0x39dc14,_0x1995ff,_0x3c3150){return db[_0xfcfb('0x47')][_0xfcfb('0x49')]({'where':{'id':_0x39dc14[_0xfcfb('0x46')]['id']}})['then'](handleEntityNotFound(_0x1995ff,null))[_0xfcfb('0x29')](function(_0x44e3cd){if(_0x44e3cd){return _0x44e3cd[_0xfcfb('0x56')](_0x39dc14['query'][_0xfcfb('0x50')]);}})[_0xfcfb('0x29')](respondWithStatusCode(_0x1995ff,null))['catch'](handleError(_0x1995ff,null));};exports['addMessage']=function(_0x530f91,_0x1a4096,_0x4822c7){if(_0x530f91[_0xfcfb('0x4b')]['id']){delete _0x530f91[_0xfcfb('0x4b')]['id'];}return db[_0xfcfb('0x47')][_0xfcfb('0x49')]({'where':{'id':_0x530f91[_0xfcfb('0x46')]['id']}})[_0xfcfb('0x29')](handleEntityNotFound(_0x1a4096,null))['then'](function(_0x4bdafa){if(_0x4bdafa){_0x530f91['body'][_0xfcfb('0x57')]=_0x4bdafa['id'];return db[_0xfcfb('0x4e')][_0xfcfb('0x4a')](_0x530f91[_0xfcfb('0x4b')]);}})[_0xfcfb('0x29')](respondWithResult(_0x1a4096,null))[_0xfcfb('0x44')](handleError(_0x1a4096,null));};exports[_0xfcfb('0x58')]=function(_0x418527,_0x22d014,_0x25a028){var _0x73539c={};var _0x36000f={};var _0x3c0fa4;var _0x5681e8;return db[_0xfcfb('0x47')][_0xfcfb('0x53')]({'where':{'id':_0x418527[_0xfcfb('0x46')]['id']}})['then'](handleEntityNotFound(_0x22d014,null))[_0xfcfb('0x29')](function(_0x2fba42){if(_0x2fba42){_0x3c0fa4=_0x2fba42;_0x36000f[_0xfcfb('0x32')]=_[_0xfcfb('0x48')](db['ChatInternalMessage'][_0xfcfb('0x55')]);_0x36000f['query']=_[_0xfcfb('0x48')](_0x418527[_0xfcfb('0x33')]);_0x36000f[_0xfcfb('0x34')]=_[_0xfcfb('0x35')](_0x36000f['model'],_0x36000f[_0xfcfb('0x33')]);_0x73539c[_0xfcfb('0x36')]=_[_0xfcfb('0x35')](_0x36000f[_0xfcfb('0x32')],qs[_0xfcfb('0x37')](_0x418527[_0xfcfb('0x33')]['fields']));_0x73539c[_0xfcfb('0x36')]=_0x73539c[_0xfcfb('0x36')][_0xfcfb('0x38')]?_0x73539c[_0xfcfb('0x36')]:_0x36000f[_0xfcfb('0x32')];_0x73539c[_0xfcfb('0x3a')]=qs['sort'](_0x418527['query']['sort']);_0x73539c[_0xfcfb('0x3e')]=qs[_0xfcfb('0x34')](_[_0xfcfb('0x3c')](_0x418527[_0xfcfb('0x33')],_0x36000f[_0xfcfb('0x34')]));if(_0x418527[_0xfcfb('0x33')][_0xfcfb('0x3d')]){_0x73539c[_0xfcfb('0x3e')]=_[_0xfcfb('0x3f')](_0x73539c[_0xfcfb('0x3e')],{'$or':_[_0xfcfb('0x2f')](_0x73539c[_0xfcfb('0x36')],function(_0x1e505d){var _0xe79db8={};_0xe79db8[_0x1e505d]={'$like':'%'+_0x418527['query'][_0xfcfb('0x3d')]+'%'};return _0xe79db8;})});}if(_0x418527['query'][_0xfcfb('0x59')]){var _0x1816c3=_0x418527['query']['$gte'][_0xfcfb('0x5a')](',');var _0x2e6c44={};_0x2e6c44[_0x1816c3[0x0]]={'$gte':moment(_0x1816c3[0x1])[_0xfcfb('0x5b')](_0xfcfb('0x5c'))};_0x73539c['where']=_[_0xfcfb('0x3f')](_0x73539c['where'],_0x2e6c44);}_0x73539c=_['merge']({},_0x73539c,_0x418527[_0xfcfb('0x40')]);return _0x3c0fa4[_0xfcfb('0x58')](_0x73539c);}})[_0xfcfb('0x29')](function(_0x42ee48){if(_0x42ee48){_0x5681e8=_0x42ee48['length'];if(!_0x418527[_0xfcfb('0x33')]['hasOwnProperty'](_0xfcfb('0x5d'))){_0x73539c[_0xfcfb('0x22')]=qs[_0xfcfb('0x22')](_0x418527[_0xfcfb('0x33')][_0xfcfb('0x22')]);_0x73539c[_0xfcfb('0x20')]=qs['offset'](_0x418527[_0xfcfb('0x33')][_0xfcfb('0x20')]);}return _0x3c0fa4[_0xfcfb('0x58')](_0x73539c);}})['then'](function(_0x15904b){if(_0x15904b){return _0x15904b?{'count':_0x5681e8,'rows':_0x15904b}:null;}})[_0xfcfb('0x29')](respondWithResult(_0x22d014,null))[_0xfcfb('0x44')](handleError(_0x22d014,null));};
\ No newline at end of file
+var _0x8f64=['error','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','omit','ids','getMembers','findOne','User','filter','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','./chatGroup.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x2ec3b9,_0x30d14a){var _0x30a43f=function(_0x51bd25){while(--_0x51bd25){_0x2ec3b9['push'](_0x2ec3b9['shift']());}};_0x30a43f(++_0x30d14a);}(_0x8f64,0x1be));var _0x48f6=function(_0x30e1ab,_0x1caf0f){_0x30e1ab=_0x30e1ab-0x0;var _0x40deaa=_0x8f64[_0x30e1ab];return _0x40deaa;};'use strict';var emlformat=require(_0x48f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x48f6('0x1'));var jsonpatch=require(_0x48f6('0x2'));var rp=require(_0x48f6('0x3'));var moment=require(_0x48f6('0x4'));var BPromise=require(_0x48f6('0x5'));var Mustache=require(_0x48f6('0x6'));var util=require(_0x48f6('0x7'));var path=require(_0x48f6('0x8'));var sox=require(_0x48f6('0x9'));var csv=require(_0x48f6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48f6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x48f6('0xc'));var jsforce=require(_0x48f6('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x48f6('0xe'));var Papa=require(_0x48f6('0xf'));var Redis=require(_0x48f6('0x10'));var authService=require(_0x48f6('0x11'));var qs=require(_0x48f6('0x12'));var as=require(_0x48f6('0x13'));var hardwareService=require(_0x48f6('0x14'));var logger=require('../../config/logger')(_0x48f6('0x15'));var utils=require(_0x48f6('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x48f6('0x17'))['db'];config[_0x48f6('0x18')]=_['defaults'](config[_0x48f6('0x18')],{'host':_0x48f6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x48f6('0x18')]));require(_0x48f6('0x1a'))[_0x48f6('0x1b')](socket);function respondWithStatusCode(_0x34f926,_0x2086b2){_0x2086b2=_0x2086b2||0xcc;return function(_0x69e8fb){if(_0x69e8fb){return _0x34f926['sendStatus'](_0x2086b2);}return _0x34f926[_0x48f6('0x1c')](_0x2086b2)[_0x48f6('0x1d')]();};}function respondWithResult(_0x569d24,_0x31a2d8){_0x31a2d8=_0x31a2d8||0xc8;return function(_0x179596){if(_0x179596){return _0x569d24['status'](_0x31a2d8)['json'](_0x179596);}};}function respondWithFilteredResult(_0x39bfaf,_0x17b2b6){return function(_0x5ce8c4){if(_0x5ce8c4){var _0x3d4e3c=typeof _0x17b2b6[_0x48f6('0x1e')]===_0x48f6('0x1f')&&typeof _0x17b2b6[_0x48f6('0x20')]==='undefined';var _0x235ee2=_0x5ce8c4[_0x48f6('0x21')];var _0x50671a=_0x3d4e3c?0x0:_0x17b2b6[_0x48f6('0x1e')];var _0x411d7b=_0x3d4e3c?_0x5ce8c4[_0x48f6('0x21')]:_0x17b2b6['offset']+_0x17b2b6[_0x48f6('0x20')];var _0x560131;if(_0x411d7b>=_0x235ee2){_0x411d7b=_0x235ee2;_0x560131=0xc8;}else{_0x560131=0xce;}_0x39bfaf[_0x48f6('0x1c')](_0x560131);return _0x39bfaf[_0x48f6('0x22')](_0x48f6('0x23'),_0x50671a+'-'+_0x411d7b+'/'+_0x235ee2)[_0x48f6('0x24')](_0x5ce8c4);}return null;};}function patchUpdates(_0x9b356b){return function(_0x1805b7){try{jsonpatch[_0x48f6('0x25')](_0x1805b7,_0x9b356b,!![]);}catch(_0x3ec460){return BPromise[_0x48f6('0x26')](_0x3ec460);}return _0x1805b7[_0x48f6('0x27')]();};}function saveUpdates(_0x596d43,_0x3627b9){return function(_0xb9b66a){if(_0xb9b66a){return _0xb9b66a[_0x48f6('0x28')](_0x596d43)[_0x48f6('0x29')](function(_0x2381ba){return _0x2381ba;});}return null;};}function removeEntity(_0x3064c2,_0x40b064){return function(_0x2e70cd){if(_0x2e70cd){return _0x2e70cd[_0x48f6('0x2a')]()[_0x48f6('0x29')](function(){_0x3064c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a93b9,_0x2bcf42){return function(_0x513d15){if(!_0x513d15){_0x3a93b9[_0x48f6('0x2b')](0x194);}return _0x513d15;};}function handleError(_0x5b8a0d,_0x11d062){_0x11d062=_0x11d062||0x1f4;return function(_0x567354){logger[_0x48f6('0x2c')](_0x567354['stack']);if(_0x567354[_0x48f6('0x2d')]){delete _0x567354[_0x48f6('0x2d')];}_0x5b8a0d['status'](_0x11d062)[_0x48f6('0x2e')](_0x567354);};}exports[_0x48f6('0x2f')]=function(_0x2cc040,_0x3ad2fd){var _0x42c76b={},_0xcd82a6={},_0x30024f={'count':0x0,'rows':[]};var _0x359ecf=_[_0x48f6('0x30')](db[_0x48f6('0x31')][_0x48f6('0x32')],function(_0x58f5fa){return{'name':_0x58f5fa[_0x48f6('0x33')],'type':_0x58f5fa['type'][_0x48f6('0x34')]};});_0xcd82a6[_0x48f6('0x35')]=_[_0x48f6('0x30')](_0x359ecf,_0x48f6('0x2d'));_0xcd82a6['query']=_[_0x48f6('0x36')](_0x2cc040[_0x48f6('0x37')]);_0xcd82a6['filters']=_[_0x48f6('0x38')](_0xcd82a6['model'],_0xcd82a6[_0x48f6('0x37')]);_0x42c76b['attributes']=_[_0x48f6('0x38')](_0xcd82a6['model'],qs[_0x48f6('0x39')](_0x2cc040[_0x48f6('0x37')]['fields']));_0x42c76b[_0x48f6('0x3a')]=_0x42c76b['attributes'][_0x48f6('0x3b')]?_0x42c76b['attributes']:_0xcd82a6['model'];if(!_0x2cc040[_0x48f6('0x37')]['hasOwnProperty'](_0x48f6('0x3c'))){_0x42c76b[_0x48f6('0x20')]=qs[_0x48f6('0x20')](_0x2cc040[_0x48f6('0x37')][_0x48f6('0x20')]);_0x42c76b[_0x48f6('0x1e')]=qs['offset'](_0x2cc040[_0x48f6('0x37')][_0x48f6('0x1e')]);}_0x42c76b[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0x2cc040['query'][_0x48f6('0x3e')]);_0x42c76b[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0x2cc040[_0x48f6('0x37')],_0xcd82a6['filters']),_0x359ecf);if(_0x2cc040['query']['filter']){_0x42c76b[_0x48f6('0x3f')]=_[_0x48f6('0x42')](_0x42c76b[_0x48f6('0x3f')],{'$or':_['map'](_0x359ecf,function(_0x4ea97a){if(_0x4ea97a[_0x48f6('0x43')]!==_0x48f6('0x44')){var _0x4aa905={};_0x4aa905[_0x4ea97a['name']]={'$like':'%'+_0x2cc040[_0x48f6('0x37')]['filter']+'%'};return _0x4aa905;}})});}_0x42c76b=_[_0x48f6('0x42')]({},_0x42c76b,_0x2cc040[_0x48f6('0x45')]);var _0x531915={'where':_0x42c76b[_0x48f6('0x3f')]};return db['ChatGroup']['count'](_0x531915)['then'](function(_0x5741cf){_0x30024f[_0x48f6('0x21')]=_0x5741cf;if(_0x2cc040[_0x48f6('0x37')]['includeAll']){_0x42c76b[_0x48f6('0x46')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x42c76b);})[_0x48f6('0x29')](function(_0x6c7651){_0x30024f[_0x48f6('0x47')]=_0x6c7651;return _0x30024f;})['then'](respondWithFilteredResult(_0x3ad2fd,_0x42c76b))[_0x48f6('0x48')](handleError(_0x3ad2fd,null));};exports[_0x48f6('0x49')]=function(_0x1d5d8a,_0x3f2b63){var _0x4e2a8c={'raw':!![],'where':{'id':_0x1d5d8a[_0x48f6('0x4a')]['id']}},_0x43a52a={};_0x43a52a[_0x48f6('0x35')]=_[_0x48f6('0x36')](db[_0x48f6('0x31')][_0x48f6('0x32')]);_0x43a52a[_0x48f6('0x37')]=_[_0x48f6('0x36')](_0x1d5d8a[_0x48f6('0x37')]);_0x43a52a['filters']=_[_0x48f6('0x38')](_0x43a52a[_0x48f6('0x35')],_0x43a52a[_0x48f6('0x37')]);_0x4e2a8c[_0x48f6('0x3a')]=_[_0x48f6('0x38')](_0x43a52a[_0x48f6('0x35')],qs[_0x48f6('0x39')](_0x1d5d8a[_0x48f6('0x37')]['fields']));_0x4e2a8c['attributes']=_0x4e2a8c[_0x48f6('0x3a')][_0x48f6('0x3b')]?_0x4e2a8c[_0x48f6('0x3a')]:_0x43a52a[_0x48f6('0x35')];if(_0x1d5d8a['query'][_0x48f6('0x4b')]){_0x4e2a8c[_0x48f6('0x46')]=[{'all':!![]}];}_0x4e2a8c=_['merge']({},_0x4e2a8c,_0x1d5d8a['options']);return db[_0x48f6('0x31')][_0x48f6('0x4c')](_0x4e2a8c)[_0x48f6('0x29')](handleEntityNotFound(_0x3f2b63,null))[_0x48f6('0x29')](respondWithResult(_0x3f2b63,null))[_0x48f6('0x48')](handleError(_0x3f2b63,null));};exports[_0x48f6('0x4d')]=function(_0x43655b,_0x322013){return db['ChatGroup'][_0x48f6('0x4d')](_0x43655b[_0x48f6('0x4e')],{})[_0x48f6('0x29')](respondWithResult(_0x322013,0xc9))[_0x48f6('0x48')](handleError(_0x322013,null));};exports[_0x48f6('0x28')]=function(_0x61d642,_0x31ff62){if(_0x61d642[_0x48f6('0x4e')]['id']){delete _0x61d642['body']['id'];}return db['ChatGroup'][_0x48f6('0x4c')]({'where':{'id':_0x61d642[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x31ff62,null))[_0x48f6('0x29')](saveUpdates(_0x61d642[_0x48f6('0x4e')],null))[_0x48f6('0x29')](respondWithResult(_0x31ff62,null))[_0x48f6('0x48')](handleError(_0x31ff62,null));};exports['destroy']=function(_0x4af4f8,_0x285e32){return db['ChatGroup']['find']({'where':{'id':_0x4af4f8[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x285e32,null))[_0x48f6('0x29')](removeEntity(_0x285e32,null))['catch'](handleError(_0x285e32,null));};exports[_0x48f6('0x4f')]=function(_0x4949b7,_0x1bfa35){return db['ChatGroup']['describe']()['then'](respondWithResult(_0x1bfa35,null))[_0x48f6('0x48')](handleError(_0x1bfa35,null));};exports[_0x48f6('0x50')]=function(_0x558407,_0x408012,_0x4ffb60){return db[_0x48f6('0x51')][_0x48f6('0x21')]({'where':{'ChatGroupId':_0x558407['params']['id'],'ToId':_0x558407[_0x48f6('0x52')]['id'],'read':![]}})[_0x48f6('0x29')](function(_0x2cae28){return{'id':_[_0x48f6('0x53')](_0x558407[_0x48f6('0x4a')]['id']),'count':_0x2cae28};})[_0x48f6('0x29')](respondWithResult(_0x408012,null))['catch'](handleError(_0x408012,null));};exports['addMembers']=function(_0x448d71,_0x2927e3,_0x5ef4b1){return db['ChatGroup'][_0x48f6('0x4c')]({'where':{'id':_0x448d71['params']['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x2927e3,null))['then'](function(_0x1c2b86){if(_0x1c2b86){return _0x1c2b86['addMembers'](_0x448d71[_0x48f6('0x4e')]['ids'],_[_0x48f6('0x54')](_0x448d71[_0x48f6('0x4e')],[_0x48f6('0x55'),'id'])||{});}})[_0x48f6('0x29')](respondWithResult(_0x2927e3,null))[_0x48f6('0x48')](handleError(_0x2927e3,null));};exports[_0x48f6('0x56')]=function(_0xb678bf,_0x5e3eb9,_0x586d5a){var _0x5ecebb={};var _0x47a882={};var _0x45daee;var _0x150d78;return db[_0x48f6('0x31')][_0x48f6('0x57')]({'where':{'id':_0xb678bf[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x5e3eb9,null))['then'](function(_0x202a96){if(_0x202a96){_0x45daee=_0x202a96;_0x47a882['model']=_['keys'](db[_0x48f6('0x58')][_0x48f6('0x32')]);_0x47a882[_0x48f6('0x37')]=_[_0x48f6('0x36')](_0xb678bf['query']);_0x47a882[_0x48f6('0x40')]=_[_0x48f6('0x38')](_0x47a882['model'],_0x47a882[_0x48f6('0x37')]);_0x5ecebb[_0x48f6('0x3a')]=_[_0x48f6('0x38')](_0x47a882[_0x48f6('0x35')],qs[_0x48f6('0x39')](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x39')]));_0x5ecebb[_0x48f6('0x3a')]=_0x5ecebb['attributes']['length']?_0x5ecebb['attributes']:_0x47a882['model'];_0x5ecebb[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0xb678bf['query'][_0x48f6('0x3e')]);_0x5ecebb[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0xb678bf[_0x48f6('0x37')],_0x47a882[_0x48f6('0x40')]));if(_0xb678bf[_0x48f6('0x37')][_0x48f6('0x59')]){_0x5ecebb['where']=_['merge'](_0x5ecebb[_0x48f6('0x3f')],{'$or':_['map'](_0x5ecebb[_0x48f6('0x3a')],function(_0x2a38ce){var _0x559527={};_0x559527[_0x2a38ce]={'$like':'%'+_0xb678bf['query']['filter']+'%'};return _0x559527;})});}_0x5ecebb=_[_0x48f6('0x42')]({},_0x5ecebb,_0xb678bf[_0x48f6('0x45')]);return _0x45daee[_0x48f6('0x56')](_0x5ecebb);}})[_0x48f6('0x29')](function(_0x1ec7f1){if(_0x1ec7f1){_0x150d78=_0x1ec7f1[_0x48f6('0x3b')];if(!_0xb678bf[_0x48f6('0x37')][_0x48f6('0x5a')](_0x48f6('0x3c'))){_0x5ecebb[_0x48f6('0x20')]=qs[_0x48f6('0x20')](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x20')]);_0x5ecebb['offset']=qs['offset'](_0xb678bf[_0x48f6('0x37')][_0x48f6('0x1e')]);}return _0x45daee[_0x48f6('0x56')](_0x5ecebb);}})[_0x48f6('0x29')](function(_0x59af26){if(_0x59af26){return _0x59af26?{'count':_0x150d78,'rows':_0x59af26}:null;}})[_0x48f6('0x29')](respondWithResult(_0x5e3eb9,null))['catch'](handleError(_0x5e3eb9,null));};exports[_0x48f6('0x5b')]=function(_0x1ad747,_0x1fe954,_0x4e1678){return db[_0x48f6('0x31')][_0x48f6('0x4c')]({'where':{'id':_0x1ad747[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x1fe954,null))['then'](function(_0x27dae5){if(_0x27dae5){return _0x27dae5[_0x48f6('0x5b')](_0x1ad747[_0x48f6('0x37')][_0x48f6('0x55')]);}})['then'](respondWithStatusCode(_0x1fe954,null))[_0x48f6('0x48')](handleError(_0x1fe954,null));};exports[_0x48f6('0x5c')]=function(_0x1b6e36,_0x549231,_0x43eb0c){if(_0x1b6e36[_0x48f6('0x4e')]['id']){delete _0x1b6e36[_0x48f6('0x4e')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1b6e36[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0x549231,null))[_0x48f6('0x29')](function(_0x328819){if(_0x328819){_0x1b6e36['body'][_0x48f6('0x5d')]=_0x328819['id'];return db[_0x48f6('0x51')][_0x48f6('0x4d')](_0x1b6e36[_0x48f6('0x4e')]);}})[_0x48f6('0x29')](respondWithResult(_0x549231,null))[_0x48f6('0x48')](handleError(_0x549231,null));};exports[_0x48f6('0x5e')]=function(_0x3e780d,_0xb0e0fb,_0x5e3eb0){var _0x241e96={};var _0x57dbd7={};var _0x19d731;var _0x3a9fb8;return db[_0x48f6('0x31')][_0x48f6('0x57')]({'where':{'id':_0x3e780d[_0x48f6('0x4a')]['id']}})[_0x48f6('0x29')](handleEntityNotFound(_0xb0e0fb,null))[_0x48f6('0x29')](function(_0x16f551){if(_0x16f551){_0x19d731=_0x16f551;_0x57dbd7[_0x48f6('0x35')]=_[_0x48f6('0x36')](db[_0x48f6('0x51')][_0x48f6('0x32')]);_0x57dbd7[_0x48f6('0x37')]=_['keys'](_0x3e780d['query']);_0x57dbd7[_0x48f6('0x40')]=_[_0x48f6('0x38')](_0x57dbd7[_0x48f6('0x35')],_0x57dbd7[_0x48f6('0x37')]);_0x241e96['attributes']=_[_0x48f6('0x38')](_0x57dbd7[_0x48f6('0x35')],qs['fields'](_0x3e780d[_0x48f6('0x37')]['fields']));_0x241e96['attributes']=_0x241e96[_0x48f6('0x3a')][_0x48f6('0x3b')]?_0x241e96['attributes']:_0x57dbd7['model'];_0x241e96[_0x48f6('0x3d')]=qs[_0x48f6('0x3e')](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x3e')]);_0x241e96[_0x48f6('0x3f')]=qs[_0x48f6('0x40')](_[_0x48f6('0x41')](_0x3e780d[_0x48f6('0x37')],_0x57dbd7['filters']));if(_0x3e780d[_0x48f6('0x37')][_0x48f6('0x59')]){_0x241e96['where']=_[_0x48f6('0x42')](_0x241e96[_0x48f6('0x3f')],{'$or':_[_0x48f6('0x30')](_0x241e96['attributes'],function(_0x2b933d){var _0x1b046c={};_0x1b046c[_0x2b933d]={'$like':'%'+_0x3e780d[_0x48f6('0x37')]['filter']+'%'};return _0x1b046c;})});}if(_0x3e780d[_0x48f6('0x37')]['$gte']){var _0x488a63=_0x3e780d[_0x48f6('0x37')][_0x48f6('0x5f')][_0x48f6('0x60')](',');var _0x414381={};_0x414381[_0x488a63[0x0]]={'$gte':moment(_0x488a63[0x1])[_0x48f6('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x241e96[_0x48f6('0x3f')]=_[_0x48f6('0x42')](_0x241e96[_0x48f6('0x3f')],_0x414381);}_0x241e96=_[_0x48f6('0x42')]({},_0x241e96,_0x3e780d[_0x48f6('0x45')]);return _0x19d731[_0x48f6('0x5e')](_0x241e96);}})[_0x48f6('0x29')](function(_0x337ab1){if(_0x337ab1){_0x3a9fb8=_0x337ab1[_0x48f6('0x3b')];if(!_0x3e780d[_0x48f6('0x37')][_0x48f6('0x5a')](_0x48f6('0x3c'))){_0x241e96[_0x48f6('0x20')]=qs['limit'](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x20')]);_0x241e96[_0x48f6('0x1e')]=qs[_0x48f6('0x1e')](_0x3e780d[_0x48f6('0x37')][_0x48f6('0x1e')]);}return _0x19d731['getMessages'](_0x241e96);}})['then'](function(_0x37e995){if(_0x37e995){return _0x37e995?{'count':_0x3a9fb8,'rows':_0x37e995}:null;}})['then'](respondWithResult(_0xb0e0fb,null))['catch'](handleError(_0xb0e0fb,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 3b4dde2..7ddbd26 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 _0xae24=['update','remove','emit','hasOwnProperty','hook','exports','ChatGroup','setMaxListeners','save'];(function(_0x47e3ef,_0x551b2c){var _0x502417=function(_0x500211){while(--_0x500211){_0x47e3ef['push'](_0x47e3ef['shift']());}};_0x502417(++_0x551b2c);}(_0xae24,0x180));var _0x4ae2=function(_0xb877b3,_0x1b5983){_0xb877b3=_0xb877b3-0x0;var _0x4ee4df=_0xae24[_0xb877b3];return _0x4ee4df;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db'][_0x4ae2('0x0')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4ae2('0x1')](0x0);var events={'afterCreate':_0x4ae2('0x2'),'afterUpdate':_0x4ae2('0x3'),'afterDestroy':_0x4ae2('0x4')};function emitEvent(_0x239088){return function(_0x3987a2,_0x53713e,_0x1d88d0){ChatGroupEvents[_0x4ae2('0x5')](_0x239088+':'+_0x3987a2['id'],_0x3987a2);ChatGroupEvents['emit'](_0x239088,_0x3987a2);_0x1d88d0(null);};}for(var e in events){if(events[_0x4ae2('0x6')](e)){var event=events[e];ChatGroup[_0x4ae2('0x7')](e,emitEvent(event));}}module[_0x4ae2('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xbca0=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5a68ac,_0x55cf4f){var _0xe7d5db=function(_0x53ebe2){while(--_0x53ebe2){_0x5a68ac['push'](_0x5a68ac['shift']());}};_0xe7d5db(++_0x55cf4f);}(_0xbca0,0x8b));var _0x0bca=function(_0x12f9e9,_0x2c05b7){_0x12f9e9=_0x12f9e9-0x0;var _0x31cae9=_0xbca0[_0x12f9e9];return _0x31cae9;};'use strict';var EventEmitter=require(_0x0bca('0x0'));var ChatGroup=require(_0x0bca('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bca('0x2'),'afterDestroy':_0x0bca('0x3')};function emitEvent(_0x3ce28e){return function(_0x1a6cb5,_0x595711,_0x494f51){ChatGroupEvents[_0x0bca('0x4')](_0x3ce28e+':'+_0x1a6cb5['id'],_0x1a6cb5);ChatGroupEvents[_0x0bca('0x4')](_0x3ce28e,_0x1a6cb5);_0x494f51(null);};}for(var e in events){if(events[_0x0bca('0x5')](e)){var event=events[e];ChatGroup[_0x0bca('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index ad35c9e..4b28c8d 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 _0x90f8=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x21f16b,_0x286e51){var _0xcf99d9=function(_0xaee82){while(--_0xaee82){_0x21f16b['push'](_0x21f16b['shift']());}};_0xcf99d9(++_0x286e51);}(_0x90f8,0x1b2));var _0x890f=function(_0x201ac7,_0x5a0ffd){_0x201ac7=_0x201ac7-0x0;var _0xddd62b=_0x90f8[_0x201ac7];return _0xddd62b;};'use strict';var _=require(_0x890f('0x0'));var util=require(_0x890f('0x1'));var logger=require('../../config/logger')(_0x890f('0x2'));var moment=require(_0x890f('0x3'));var BPromise=require(_0x890f('0x4'));var rp=require(_0x890f('0x5'));var fs=require('fs');var path=require(_0x890f('0x6'));var rimraf=require(_0x890f('0x7'));var config=require(_0x890f('0x8'));var attributes=require(_0x890f('0x9'));module[_0x890f('0xa')]=function(_0x33700d,_0x51d3c6){return _0x33700d[_0x890f('0xb')](_0x890f('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cfa=['define','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f096e,_0x30d3c3){var _0x4a33ce=function(_0x107ba6){while(--_0x107ba6){_0x4f096e['push'](_0x4f096e['shift']());}};_0x4a33ce(++_0x30d3c3);}(_0x5cfa,0xd9));var _0xa5cf=function(_0x2de4cb,_0xe3bc3b){_0x2de4cb=_0x2de4cb-0x0;var _0x668608=_0x5cfa[_0x2de4cb];return _0x668608;};'use strict';var _=require('lodash');var util=require(_0xa5cf('0x0'));var logger=require(_0xa5cf('0x1'))('api');var moment=require(_0xa5cf('0x2'));var BPromise=require(_0xa5cf('0x3'));var rp=require(_0xa5cf('0x4'));var fs=require('fs');var path=require(_0xa5cf('0x5'));var rimraf=require(_0xa5cf('0x6'));var config=require(_0xa5cf('0x7'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x1261ec,_0x26d544){return _0x1261ec[_0xa5cf('0x8')]('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 16bc65f..f856622 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 _0xc01b=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xc01b,0x65));var _0xbc01=function(_0x120caa,_0x5e4c35){_0x120caa=_0x120caa-0x0;var _0x128aaa=_0xc01b[_0x120caa];return _0x128aaa;};'use strict';var _=require(_0xbc01('0x0'));var util=require(_0xbc01('0x1'));var moment=require(_0xbc01('0x2'));var BPromise=require(_0xbc01('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc01('0x4'));var db=require(_0xbc01('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xbc01('0x6'));var jayson=require(_0xbc01('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xbc01('0x8')]=_[_0xbc01('0x9')](config[_0xbc01('0x8')],{'host':_0xbc01('0xa'),'port':0x18eb});var socket=require(_0xbc01('0xb'))(new Redis(config[_0xbc01('0x8')]));require(_0xbc01('0xc'))['register'](socket);function respondWithRpcPromise(_0x46f01c,_0x3cc11e,_0x3b7f4d){return new BPromise(function(_0x1d84e8,_0xa0d0b1){return client[_0xbc01('0xd')](_0x46f01c,_0x3b7f4d)[_0xbc01('0xe')](function(_0x28067a){logger[_0xbc01('0xf')](_0xbc01('0x10'),_0x3cc11e,_0xbc01('0x11'));logger[_0xbc01('0x12')](_0xbc01('0x13'),_0x3cc11e,_0xbc01('0x11'),JSON['stringify'](_0x28067a));if(_0x28067a[_0xbc01('0x14')]){if(_0x28067a[_0xbc01('0x14')][_0xbc01('0x15')]===0x1f4){logger['error'](_0xbc01('0x10'),_0x3cc11e,_0x28067a[_0xbc01('0x14')]['message']);return _0xa0d0b1(_0x28067a[_0xbc01('0x14')][_0xbc01('0x16')]);}logger[_0xbc01('0x14')](_0xbc01('0x10'),_0x3cc11e,_0x28067a['error']['message']);return _0x1d84e8(_0x28067a[_0xbc01('0x14')][_0xbc01('0x16')]);}else{logger['info'](_0xbc01('0x10'),_0x3cc11e,'request\x20sent');_0x1d84e8(_0x28067a[_0xbc01('0x17')][_0xbc01('0x16')]);}})[_0xbc01('0x18')](function(_0x1e79d0){logger['error'](_0xbc01('0x10'),_0x3cc11e,_0x1e79d0);_0xa0d0b1(_0x1e79d0);});});}
\ No newline at end of file
+var _0xd0a4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0xb1c41,_0x1bfbc6){var _0x3478a4=function(_0x3f9273){while(--_0x3f9273){_0xb1c41['push'](_0xb1c41['shift']());}};_0x3478a4(++_0x1bfbc6);}(_0xd0a4,0x13e));var _0x4d0a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4d0a('0x0'));var util=require(_0x4d0a('0x1'));var moment=require(_0x4d0a('0x2'));var BPromise=require(_0x4d0a('0x3'));var rs=require(_0x4d0a('0x4'));var fs=require('fs');var Redis=require(_0x4d0a('0x5'));var db=require(_0x4d0a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d0a('0x7'))(_0x4d0a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4d0a('0x9')]({'port':0x232a});config[_0x4d0a('0xa')]=_['defaults'](config[_0x4d0a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d0a('0xa')]));require(_0x4d0a('0xb'))[_0x4d0a('0xc')](socket);function respondWithRpcPromise(_0x4adc33,_0x10b7c7,_0x1b05da){return new BPromise(function(_0x29d5ff,_0x3be4ea){return client[_0x4d0a('0xd')](_0x4adc33,_0x1b05da)[_0x4d0a('0xe')](function(_0x1b7c41){logger[_0x4d0a('0xf')](_0x4d0a('0x10'),_0x10b7c7,_0x4d0a('0x11'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x10b7c7,_0x4d0a('0x11'),JSON[_0x4d0a('0x12')](_0x1b7c41));if(_0x1b7c41[_0x4d0a('0x13')]){if(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x14')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x1b7c41[_0x4d0a('0x13')]['message']);return _0x3be4ea(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);}logger[_0x4d0a('0x13')](_0x4d0a('0x10'),_0x10b7c7,_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);return _0x29d5ff(_0x1b7c41[_0x4d0a('0x13')][_0x4d0a('0x15')]);}else{logger[_0x4d0a('0xf')]('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x4d0a('0x11'));_0x29d5ff(_0x1b7c41['result']['message']);}})[_0x4d0a('0x16')](function(_0x3aa85b){logger[_0x4d0a('0x13')]('ChatGroup,\x20%s,\x20%s',_0x10b7c7,_0x3aa85b);_0x3be4ea(_0x3aa85b);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 884bbf8..186569a 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 _0x4f7c=['save','remove','update','emit','removeListener','length','chatGroup:','./chatGroup.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f7c,0x1e7));var _0xc4f7=function(_0x5e4f9f,_0x18b477){_0x5e4f9f=_0x5e4f9f-0x0;var _0x3d131c=_0x4f7c[_0x5e4f9f];return _0x3d131c;};'use strict';var ChatGroupEvents=require(_0xc4f7('0x0'));var events=[_0xc4f7('0x1'),_0xc4f7('0x2'),_0xc4f7('0x3')];function createListener(_0xa3d370,_0x434313){return function(_0x56e1b5){_0x434313[_0xc4f7('0x4')](_0xa3d370,_0x56e1b5);};}function removeListener(_0x482463,_0x372e07){return function(){ChatGroupEvents[_0xc4f7('0x5')](_0x482463,_0x372e07);};}exports['register']=function(_0x41b917){for(var _0x522da1=0x0,_0x37e1f5=events[_0xc4f7('0x6')];_0x522da1<_0x37e1f5;_0x522da1++){var _0xc70ba7=events[_0x522da1];var _0x2d6301=createListener(_0xc4f7('0x7')+_0xc70ba7,_0x41b917);ChatGroupEvents['on'](_0xc70ba7,_0x2d6301);}};
\ No newline at end of file
+var _0x4326=['remove','removeListener','length'];(function(_0x53b3b3,_0x2f3a6f){var _0x3bdc9f=function(_0x5282bd){while(--_0x5282bd){_0x53b3b3['push'](_0x53b3b3['shift']());}};_0x3bdc9f(++_0x2f3a6f);}(_0x4326,0x15c));var _0x6432=function(_0x36b088,_0x1871a6){_0x36b088=_0x36b088-0x0;var _0x233f74=_0x4326[_0x36b088];return _0x233f74;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x6432('0x0'),'update'];function createListener(_0x2bcce7,_0x5d54a3){return function(_0x1fd123){_0x5d54a3['emit'](_0x2bcce7,_0x1fd123);};}function removeListener(_0x2d397c,_0x535e2f){return function(){ChatGroupEvents[_0x6432('0x1')](_0x2d397c,_0x535e2f);};}exports['register']=function(_0x11f4f0){for(var _0x5a3312=0x0,_0x471104=events[_0x6432('0x2')];_0x5a3312<_0x471104;_0x5a3312++){var _0xb252a8=events[_0x5a3312];var _0x54039b=createListener('chatGroup:'+_0xb252a8,_0x11f4f0);ChatGroupEvents['on'](_0xb252a8,_0x54039b);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 0559497..59554d5 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 _0x1e1f=['removeMembers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe','getUnread','getMembers','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','update','delete','/:id','destroy'];(function(_0x5c5095,_0x4e7925){var _0x5d67fb=function(_0x4a1f27){while(--_0x4a1f27){_0x5c5095['push'](_0x5c5095['shift']());}};_0x5d67fb(++_0x4e7925);}(_0x1e1f,0x18a));var _0xf1e1=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1e1f[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0xf1e1('0x0'));var util=require('util');var path=require(_0xf1e1('0x1'));var timeout=require(_0xf1e1('0x2'));var express=require(_0xf1e1('0x3'));var router=express[_0xf1e1('0x4')]();var fs_extra=require(_0xf1e1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf1e1('0x6'));var config=require(_0xf1e1('0x7'));var controller=require(_0xf1e1('0x8'));router[_0xf1e1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf1e1('0x9')](_0xf1e1('0xa'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0xc')]);router[_0xf1e1('0x9')]('/:id',auth[_0xf1e1('0xb')](),controller['show']);router[_0xf1e1('0x9')]('/:id/unread',auth['isAuthenticated'](),controller[_0xf1e1('0xd')]);router[_0xf1e1('0x9')]('/:id/members',auth[_0xf1e1('0xb')](),controller[_0xf1e1('0xe')]);router[_0xf1e1('0x9')](_0xf1e1('0xf'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x10')]);router[_0xf1e1('0x11')]('/',auth[_0xf1e1('0xb')](),controller['create']);router[_0xf1e1('0x11')](_0xf1e1('0x12'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x13')]);router['post'](_0xf1e1('0xf'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x14')]);router[_0xf1e1('0x15')]('/:id',auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x16')]);router[_0xf1e1('0x17')](_0xf1e1('0x18'),auth['isAuthenticated'](),controller[_0xf1e1('0x19')]);router[_0xf1e1('0x17')](_0xf1e1('0x12'),auth[_0xf1e1('0xb')](),controller[_0xf1e1('0x1a')]);module[_0xf1e1('0x1b')]=router;
\ No newline at end of file
+var _0xe7fb=['destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','put','update','delete'];(function(_0x458c6e,_0x228cf1){var _0x3f38ad=function(_0x2c2b49){while(--_0x2c2b49){_0x458c6e['push'](_0x458c6e['shift']());}};_0x3f38ad(++_0x228cf1);}(_0xe7fb,0xb1));var _0xbe7f=function(_0x45a082,_0x3a5f85){_0x45a082=_0x45a082-0x0;var _0x71276=_0xe7fb[_0x45a082];return _0x71276;};'use strict';var multer=require(_0xbe7f('0x0'));var util=require(_0xbe7f('0x1'));var path=require(_0xbe7f('0x2'));var timeout=require(_0xbe7f('0x3'));var express=require(_0xbe7f('0x4'));var router=express[_0xbe7f('0x5')]();var fs_extra=require(_0xbe7f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbe7f('0x7'));var config=require('../../config/environment');var controller=require(_0xbe7f('0x8'));router['get']('/',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0xa')]);router[_0xbe7f('0xb')](_0xbe7f('0xc'),auth[_0xbe7f('0x9')](),controller['describe']);router[_0xbe7f('0xb')](_0xbe7f('0xd'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0xe')]);router[_0xbe7f('0xb')](_0xbe7f('0xf'),auth['isAuthenticated'](),controller[_0xbe7f('0x10')]);router[_0xbe7f('0xb')](_0xbe7f('0x11'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x12')]);router['get'](_0xbe7f('0x13'),auth[_0xbe7f('0x9')](),controller['getMessages']);router[_0xbe7f('0x14')]('/',auth['isAuthenticated'](),controller[_0xbe7f('0x15')]);router[_0xbe7f('0x14')]('/:id/members',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x16')]);router['post'](_0xbe7f('0x13'),auth[_0xbe7f('0x9')](),controller['addMessage']);router[_0xbe7f('0x17')]('/:id',auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x18')]);router[_0xbe7f('0x19')](_0xbe7f('0xd'),auth[_0xbe7f('0x9')](),controller[_0xbe7f('0x1a')]);router[_0xbe7f('0x19')](_0xbe7f('0x11'),auth['isAuthenticated'](),controller[_0xbe7f('0x1b')]);module[_0xbe7f('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 9fd7cbd..9dd61a1 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 _0xceb0=['out','BOOLEAN','ENUM','thumb','star','TEXT','DATE','STRING','long'];(function(_0xb0f253,_0x476cc1){var _0x25dbbe=function(_0x52a034){while(--_0x52a034){_0xb0f253['push'](_0xb0f253['shift']());}};_0x25dbbe(++_0x476cc1);}(_0xceb0,0x173));var _0x0ceb=function(_0x1f0a82,_0x5e5880){_0x1f0a82=_0x1f0a82-0x0;var _0x432397=_0xceb0[_0x1f0a82];return _0x432397;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x0ceb('0x0')]('star',_0x0ceb('0x1')),'defaultValue':_0x0ceb('0x2')},'ratingMessage':{'type':Sequelize[_0x0ceb('0x3')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0ceb('0x4')]},'disposition':{'type':Sequelize[_0x0ceb('0x5')]},'secondDisposition':{'type':Sequelize[_0x0ceb('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0ceb('0x5')]},'browserName':{'type':Sequelize[_0x0ceb('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x0ceb('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x0ceb('0x5')]},'deviceVendor':{'type':Sequelize[_0x0ceb('0x5')]},'deviceType':{'type':Sequelize[_0x0ceb('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x0ceb('0x3')](_0x0ceb('0x6'))},'read1stAt':{'type':Sequelize[_0x0ceb('0x4')]},'lastMsgAt':{'type':Sequelize[_0x0ceb('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0ceb('0x0')]('in',_0x0ceb('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x0ceb('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x0ceb('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x0ceb('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x57f8=['out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long'];(function(_0x142900,_0x2c1ea4){var _0x1c5a43=function(_0xce427f){while(--_0xce427f){_0x142900['push'](_0x142900['shift']());}};_0x1c5a43(++_0x2c1ea4);}(_0x57f8,0x198));var _0x857f=function(_0x1fa469,_0x5e19b1){_0x1fa469=_0x1fa469-0x0;var _0x22cc36=_0x57f8[_0x1fa469];return _0x22cc36;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'closed':{'type':Sequelize[_0x857f('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x857f('0x2')]},'ratingType':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x4'),_0x857f('0x5')),'defaultValue':_0x857f('0x4')},'ratingMessage':{'type':Sequelize[_0x857f('0x6')]},'pathTranscript':{'type':Sequelize[_0x857f('0x6')]},'mailTranscript':{'type':Sequelize[_0x857f('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x857f('0x8')]},'disposition':{'type':Sequelize[_0x857f('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x857f('0x7')]},'note':{'type':Sequelize[_0x857f('0x7')]},'browserName':{'type':Sequelize[_0x857f('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x857f('0x7')]},'osVersion':{'type':Sequelize[_0x857f('0x7')]},'deviceModel':{'type':Sequelize[_0x857f('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x857f('0x7')]},'referer':{'type':Sequelize[_0x857f('0x6')]},'customerIp':{'type':Sequelize[_0x857f('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x857f('0x9'))},'read1stAt':{'type':Sequelize[_0x857f('0x8')]},'lastMsgAt':{'type':Sequelize[_0x857f('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x857f('0x3')]('in',_0x857f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x857f('0x7')]},'customerPort':{'type':Sequelize[_0x857f('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x857f('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 4bedfc8..2b22916 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 _0x2e7c=['\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','toString','sequelize','keyBy','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','rows','show','params','rawAttributes','include','merge','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','contact','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','join_url','out','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','filename','mimetype','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','%s%d','customer','agentIdentifier','website_alias','System','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','nolimit','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','getMyMessages','hasOwnProperty','includeAgent','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','Owner','get','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','basename','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','render','body','agent','interaction','account','map','fullname','TagIds','Tags','split','talking','unmanaged','abandoned','closed','waiting','UserId','disposition','total','ChatInteraction','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','order','sort','filters','select','field','color','tools_tags','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL'];(function(_0x35452,_0x56058a){var _0x5deb02=function(_0x937500){while(--_0x937500){_0x35452['push'](_0x35452['shift']());}};_0x5deb02(++_0x56058a);}(_0x2e7c,0xae));var _0xc2e7=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x2e7c[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0xc2e7('0x0'));var rimraf=require(_0xc2e7('0x1'));var zipdir=require(_0xc2e7('0x2'));var jsonpatch=require(_0xc2e7('0x3'));var rp=require(_0xc2e7('0x4'));var moment=require(_0xc2e7('0x5'));var BPromise=require(_0xc2e7('0x6'));var Mustache=require('mustache');var util=require(_0xc2e7('0x7'));var path=require(_0xc2e7('0x8'));var sox=require(_0xc2e7('0x9'));var csv=require(_0xc2e7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2e7('0xb'));var squel=require('squel');var crypto=require(_0xc2e7('0xc'));var jsforce=require(_0xc2e7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc2e7('0xa'));var querystring=require(_0xc2e7('0xe'));var Papa=require(_0xc2e7('0xf'));var Redis=require(_0xc2e7('0x10'));var authService=require(_0xc2e7('0x11'));var qs=require(_0xc2e7('0x12'));var as=require(_0xc2e7('0x13'));var pdf=require(_0xc2e7('0x14'));var hardwareService=require(_0xc2e7('0x15'));var logger=require(_0xc2e7('0x16'))(_0xc2e7('0x17'));var utils=require(_0xc2e7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc2e7('0x19'));var db=require(_0xc2e7('0x1a'))['db'];config[_0xc2e7('0x1b')]=_['defaults'](config[_0xc2e7('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xc2e7('0x1c'))(new Redis(config[_0xc2e7('0x1b')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xc2e7('0x1d'));var client=jayson[_0xc2e7('0x1e')][_0xc2e7('0x1f')]({'port':0x232b});var client9004=jayson[_0xc2e7('0x1e')][_0xc2e7('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x587887,_0x7e7349,_0x1c60ab,_0x3a863d){return new BPromise(function(_0x43b1af,_0x40cd3e){var _0xc2b79f=_0x3a863d||client;return _0xc2b79f[_0xc2e7('0x20')](_0x587887,_0x1c60ab)[_0xc2e7('0x21')](function(_0x40b8cf){logger[_0xc2e7('0x22')](_0xc2e7('0x23'),_0x7e7349,_0xc2e7('0x24'));logger[_0xc2e7('0x25')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x7e7349,_0xc2e7('0x24'),JSON[_0xc2e7('0x26')](_0x40b8cf));if(_0x40b8cf[_0xc2e7('0x27')]){if(_0x40b8cf[_0xc2e7('0x27')][_0xc2e7('0x28')]===0x1f4){logger[_0xc2e7('0x27')](_0xc2e7('0x23'),_0x7e7349,_0x40b8cf[_0xc2e7('0x27')][_0xc2e7('0x29')]);return _0x40cd3e(_0x40b8cf[_0xc2e7('0x27')]['message']);}logger[_0xc2e7('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x7e7349,_0x40b8cf[_0xc2e7('0x27')][_0xc2e7('0x29')]);return _0x43b1af(_0x40b8cf[_0xc2e7('0x27')]['message']);}else{logger[_0xc2e7('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x7e7349,_0xc2e7('0x24'));_0x43b1af(_0x40b8cf['result']['message']);}})[_0xc2e7('0x2a')](function(_0x110fd6){logger['error'](_0xc2e7('0x23'),_0x7e7349,_0x110fd6);_0x40cd3e(_0x110fd6);});});}function respondWithStatusCode(_0x49aff3,_0x3e9056){_0x3e9056=_0x3e9056||0xcc;return function(_0x5b9455){if(_0x5b9455){return _0x49aff3[_0xc2e7('0x2b')](_0x3e9056);}return _0x49aff3[_0xc2e7('0x2c')](_0x3e9056)[_0xc2e7('0x2d')]();};}function respondWithResult(_0x2d840b,_0x6a74a2){_0x6a74a2=_0x6a74a2||0xc8;return function(_0x3e12fa){if(_0x3e12fa){return _0x2d840b[_0xc2e7('0x2c')](_0x6a74a2)['json'](_0x3e12fa);}};}function respondWithFilteredResult(_0x376783,_0x1e8fcc){return function(_0x333aa9){if(_0x333aa9){var _0x3ce008=typeof _0x1e8fcc[_0xc2e7('0x2e')]===_0xc2e7('0x2f')&&typeof _0x1e8fcc['limit']===_0xc2e7('0x2f');var _0x1d5c48=_0x333aa9[_0xc2e7('0x30')];var _0x3755e5=_0x3ce008?0x0:_0x1e8fcc[_0xc2e7('0x2e')];var _0x3e86a3=_0x3ce008?_0x333aa9[_0xc2e7('0x30')]:_0x1e8fcc[_0xc2e7('0x2e')]+_0x1e8fcc[_0xc2e7('0x31')];var _0x53c520;if(_0x3e86a3>=_0x1d5c48){_0x3e86a3=_0x1d5c48;_0x53c520=0xc8;}else{_0x53c520=0xce;}_0x376783['status'](_0x53c520);return _0x376783[_0xc2e7('0x32')](_0xc2e7('0x33'),_0x3755e5+'-'+_0x3e86a3+'/'+_0x1d5c48)[_0xc2e7('0x34')](_0x333aa9);}return null;};}function patchUpdates(_0x4ee5cd){return function(_0x2ecc09){try{jsonpatch[_0xc2e7('0x35')](_0x2ecc09,_0x4ee5cd,!![]);}catch(_0x4603d9){return BPromise[_0xc2e7('0x36')](_0x4603d9);}return _0x2ecc09[_0xc2e7('0x37')]();};}function saveUpdates(_0x21570b,_0x28497b){return function(_0x507b83){if(_0x507b83){return _0x507b83[_0xc2e7('0x38')](_0x21570b)[_0xc2e7('0x21')](function(_0x5735a1){return _0x5735a1;});}return null;};}function removeEntity(_0x137794,_0x43d2e5){return function(_0x4222aa){if(_0x4222aa){return _0x4222aa[_0xc2e7('0x39')]()[_0xc2e7('0x21')](function(){_0x137794[_0xc2e7('0x2c')](0xcc)[_0xc2e7('0x2d')]();});}};}function handleEntityNotFound(_0x67b807,_0x50aa65){return function(_0x42621a){if(!_0x42621a){_0x67b807[_0xc2e7('0x2b')](0x194);}return _0x42621a;};}function handleError(_0x4dee8e,_0x13a667){_0x13a667=_0x13a667||0x1f4;return function(_0x7b0bfb){logger[_0xc2e7('0x27')](_0x7b0bfb['stack']);if(_0x7b0bfb[_0xc2e7('0x3a')]){delete _0x7b0bfb[_0xc2e7('0x3a')];}_0x4dee8e[_0xc2e7('0x2c')](_0x13a667)['send'](_0x7b0bfb);};}function getMustacheRender(_0x366a50,_0x4d96ca){return Mustache[_0xc2e7('0x3b')](_0x366a50,_['merge'](_0x4d96ca[_0xc2e7('0x3c')],{'contact':_0x4d96ca['contact'],'message':_0x4d96ca[_0xc2e7('0x29')],'agent':_0x4d96ca[_0xc2e7('0x3d')],'interaction':_0x4d96ca[_0xc2e7('0x3e')],'account':_0x4d96ca[_0xc2e7('0x3f')]}))||'';}function getInteractionUsers(_0x24930a,_0x28b03e){return new BPromise(function(_0x5a231c,_0x2386d0){try{if(_0x28b03e[_0x24930a['id']]){_0x24930a['Users']=_[_0xc2e7('0x40')](_0x28b03e[_0x24930a['id']],function(_0xdd3645){return{'id':_0xdd3645['id'],'fullname':_0xdd3645[_0xc2e7('0x41')]};});}}catch(_0x290bae){_0x2386d0(_0x290bae);}_0x5a231c(_0x24930a);});}function getInteractionTags(_0x6f1d0f,_0x346c69){return new BPromise(function(_0x332572,_0x40adb3){try{if(_0x6f1d0f[_0xc2e7('0x42')]){_0x6f1d0f[_0xc2e7('0x43')]=[];_0x6f1d0f['TagIds'][_0xc2e7('0x44')](',')['forEach'](function(_0x436ea5){_0x6f1d0f[_0xc2e7('0x43')]['push'](_0x346c69[_0x436ea5]);});}delete _0x6f1d0f['TagIds'];}catch(_0x2cdd17){_0x40adb3(_0x2cdd17);}_0x332572(_0x6f1d0f);});}function updateChatInteraction(_0x3f5d3e,_0xa3eb2b,_0x3d1596){return new BPromise(function(_0x3c143f,_0x1b806f){return getInteractionUsers(_0x3f5d3e,_0x3d1596)[_0xc2e7('0x21')](function(_0x216418){return getInteractionTags(_0x216418,_0xa3eb2b);})['then'](function(_0x47d3ec){return getStateInteraction(_0x47d3ec);})[_0xc2e7('0x21')](function(_0x58ddcd){_0x3c143f(_0x58ddcd);})['catch'](function(_0x411f0c){_0x1b806f(_0x411f0c);});});}function getStateInteraction(_0x4a87e4){return new BPromise(function(_0x422c66){_0x4a87e4['waiting']=0x0;_0x4a87e4[_0xc2e7('0x45')]=0x0;_0x4a87e4['answered']=0x0;_0x4a87e4[_0xc2e7('0x46')]=0x0;_0x4a87e4[_0xc2e7('0x47')]=0x0;_0x4a87e4['total']=0x0;if(!_0x4a87e4[_0xc2e7('0x48')]&&!_0x4a87e4['UserId']){_0x4a87e4[_0xc2e7('0x49')]+=0x1;}if(!_0x4a87e4[_0xc2e7('0x48')]&&_0x4a87e4[_0xc2e7('0x4a')]){_0x4a87e4[_0xc2e7('0x45')]+=0x1;if(_0x4a87e4[_0xc2e7('0x49')]){_0x4a87e4[_0xc2e7('0x49')]-=0x1;}}if(_0x4a87e4[_0xc2e7('0x48')]&&_0x4a87e4[_0xc2e7('0x4b')]===_0xc2e7('0x47')){_0x4a87e4[_0xc2e7('0x47')]+=0x1;if(_0x4a87e4[_0xc2e7('0x49')]){_0x4a87e4[_0xc2e7('0x49')]-=0x1;}}else if(_0x4a87e4[_0xc2e7('0x48')]&&!_0x4a87e4[_0xc2e7('0x4a')]&&_0x4a87e4[_0xc2e7('0x4b')]){_0x4a87e4[_0xc2e7('0x46')]+=0x1;if(_0x4a87e4['waiting']){_0x4a87e4[_0xc2e7('0x49')]-=0x1;}}else if(_0x4a87e4['closed']&&_0x4a87e4[_0xc2e7('0x4a')]){_0x4a87e4['answered']+=0x1;if(_0x4a87e4[_0xc2e7('0x45')]){_0x4a87e4['talking']-=0x1;}}_0x4a87e4[_0xc2e7('0x4c')]+=0x1;_0x422c66(_0x4a87e4);});}exports['index']=function(_0x4a5184,_0x4009ce){var _0x197f8f={},_0x2d49e3={},_0x2e8f58={'count':0x0,'rows':[]};var _0x2862b7=_[_0xc2e7('0x40')](db[_0xc2e7('0x4d')]['rawAttributes'],function(_0x4b8fb6){return{'name':_0x4b8fb6[_0xc2e7('0x4e')],'type':_0x4b8fb6[_0xc2e7('0x4f')][_0xc2e7('0x50')]};});_0x2d49e3['model']=_[_0xc2e7('0x40')](_0x2862b7,_0xc2e7('0x3a'));_0x2d49e3[_0xc2e7('0x51')]=_[_0xc2e7('0x52')](_0x4a5184[_0xc2e7('0x51')]);_0x2d49e3['filters']=_[_0xc2e7('0x53')](_0x2d49e3['model'],_0x2d49e3[_0xc2e7('0x51')]);_0x197f8f[_0xc2e7('0x54')]=_[_0xc2e7('0x53')](_0x2d49e3[_0xc2e7('0x55')],qs[_0xc2e7('0x56')](_0x4a5184['query'][_0xc2e7('0x56')]));_0x197f8f[_0xc2e7('0x54')]=_0x197f8f['attributes'][_0xc2e7('0x57')]?_0x197f8f[_0xc2e7('0x54')]:_0x2d49e3[_0xc2e7('0x55')];if(!_0x4a5184[_0xc2e7('0x51')]['hasOwnProperty']('nolimit')){_0x197f8f['limit']=qs[_0xc2e7('0x31')](_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x31')]);_0x197f8f['offset']=qs['offset'](_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x2e')]);}_0x197f8f[_0xc2e7('0x58')]=qs[_0xc2e7('0x59')](_0x4a5184['query'][_0xc2e7('0x59')]);_0x197f8f['where']=qs[_0xc2e7('0x5a')](_['pick'](_0x4a5184[_0xc2e7('0x51')],_0x2d49e3[_0xc2e7('0x5a')]),_0x2862b7);var _0x342521=[];var _0x28440d=squel[_0xc2e7('0x5b')]()[_0xc2e7('0x5c')]('id')[_0xc2e7('0x5c')](_0xc2e7('0x3a'))[_0xc2e7('0x5c')](_0xc2e7('0x5d'))['from'](_0xc2e7('0x5e'));var _0x448b1b=squel[_0xc2e7('0x5b')]()[_0xc2e7('0x5c')](_0xc2e7('0x5f'))['field']('u.fullname')[_0xc2e7('0x5c')](_0xc2e7('0x60'))[_0xc2e7('0x61')](_0xc2e7('0x62'),'ui')[_0xc2e7('0x63')](_0xc2e7('0x64'),'u',_0xc2e7('0x65'));var _0x38fb47=squel[_0xc2e7('0x5b')]()[_0xc2e7('0x61')](_0xc2e7('0x66'),'i')[_0xc2e7('0x63')](_0xc2e7('0x67'),'c',_0xc2e7('0x68'))['left_join'](_0xc2e7('0x64'),'o','o.id\x20=\x20i.UserId')[_0xc2e7('0x63')]('chat_websites','a',_0xc2e7('0x69'))[_0xc2e7('0x63')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0xc2e7('0x63')](_0xc2e7('0x6a'),'it',_0xc2e7('0x6b'))[_0xc2e7('0x63')](_0xc2e7('0x5e'),'t',_0xc2e7('0x6c'));var _0x35610f=squel['expr']();var _0x26aa2b=[];var _0x2b11ae=squel[_0xc2e7('0x6d')]();var _0xfa1590;if(_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x6e')]){_0xfa1590=as[_0xc2e7('0x6f')](_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x6e')]);var _0x97ea4a=_0xfa1590[_0xc2e7('0x70')];for(var _0x3d7192=0x0;_0x3d7192<_0xfa1590['conditions'][_0xc2e7('0x57')];_0x3d7192++){var _0x5e0e84=_0xfa1590[_0xc2e7('0x71')][_0x3d7192];var _0x4c3442='i';var _0x16c990=_[_0xc2e7('0x72')](_0x2862b7,[_0xc2e7('0x3a'),_0x5e0e84['field']]);if(!_0x16c990){switch(_0x5e0e84['field']){case'unreadMessages':if(_0x5e0e84[_0xc2e7('0x73')]==0x1){_0x38fb47[_0xc2e7('0x74')]('`'+_0x5e0e84[_0xc2e7('0x5c')]+_0xc2e7('0x75'));}else{_0x38fb47[_0xc2e7('0x74')]('`'+_0x5e0e84['field']+_0xc2e7('0x76'));}break;case _0xc2e7('0x77'):if(_0x5e0e84[_0xc2e7('0x78')]===_0xc2e7('0x79')){if(_0x5e0e84[_0xc2e7('0x73')][_0xc2e7('0x44')]('\x20')[_0xc2e7('0x57')]>0x1){_0x35610f[_0x97ea4a]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc2e7('0x7a')](_0x5e0e84[_0xc2e7('0x73')]),null);}else{var _0x4b2542='%'+_0x5e0e84['value']+'%';_0x35610f[_0x97ea4a](_0xc2e7('0x7b'),_0x4b2542,_0x4b2542,_0x4b2542);}}else{_0x16c990=_[_0xc2e7('0x72')](_0x2862b7,[_0xc2e7('0x3a'),_0xc2e7('0x7c')]);_0x5e0e84[_0xc2e7('0x5c')]='ContactId';_0xdc00e4=as[_0xc2e7('0x7d')](_0x4c3442,_0x16c990[_0xc2e7('0x4f')],_0x5e0e84);_0x35610f[_0x97ea4a](_0xdc00e4[_0xc2e7('0x7e')],_0xdc00e4['value']['start'],_0xdc00e4['value'][_0xc2e7('0x2d')]);}break;case'Tag':var _0x359af8=_0x5e0e84[_0xc2e7('0x73')][_0xc2e7('0x44')](',')[_0xc2e7('0x40')](function(_0x4e6a98){return Number(_0x4e6a98);});_0x359af8[_0xc2e7('0x7f')](function(_0x3fc532){_0x2b11ae['or'](_0xc2e7('0x80'),'%,'+_0x3fc532+',%');});_0x26aa2b=_[_0xc2e7('0x81')](_0x26aa2b,_0x359af8);break;case _0xc2e7('0x82'):if(_0x5e0e84[_0xc2e7('0x78')]==='$substring'){_0x35610f[_0x97ea4a](_0xc2e7('0x83'),'%'+_0x5e0e84[_0xc2e7('0x73')]+'%',null);}else{_0x16c990=_[_0xc2e7('0x72')](_0x2862b7,[_0xc2e7('0x3a'),_0xc2e7('0x4a')]);_0x5e0e84[_0xc2e7('0x5c')]=_0xc2e7('0x4a');_0xdc00e4=as['buildExpression'](_0x4c3442,_0x16c990[_0xc2e7('0x4f')],_0x5e0e84);_0x35610f[_0x97ea4a](_0xdc00e4[_0xc2e7('0x7e')],_0xdc00e4[_0xc2e7('0x73')][_0xc2e7('0x84')],_0xdc00e4[_0xc2e7('0x73')][_0xc2e7('0x2d')]);}break;case'body':_0xdc00e4=as[_0xc2e7('0x7d')]('me',null,_0x5e0e84);_0x35610f[_0x97ea4a](_0xdc00e4['text'],_0xdc00e4['value'][_0xc2e7('0x84')],_0xdc00e4['value'][_0xc2e7('0x2d')]);break;}}else{var _0xdc00e4=as['buildExpression'](_0x4c3442,_0x16c990[_0xc2e7('0x4f')],_0x5e0e84);_0x35610f[_0x97ea4a](_0xdc00e4[_0xc2e7('0x7e')],_0xdc00e4[_0xc2e7('0x73')][_0xc2e7('0x84')],_0xdc00e4[_0xc2e7('0x73')][_0xc2e7('0x2d')]);}}}else{var _0x37ed4f=_(_0x4a5184[_0xc2e7('0x51')])['keys']()[_0xc2e7('0x40')](function(_0x1cb1fb){return _['some'](_0x2862b7,['name',_0x1cb1fb])?_0x1cb1fb:undefined;})['compact']()[_0xc2e7('0x73')]();if(!_[_0xc2e7('0x85')](_0x37ed4f)){_0x37ed4f[_0xc2e7('0x7f')](function(_0x2a984c){if(_0x2a984c===_0xc2e7('0x86')){_0x38fb47[_0xc2e7('0x87')](_0xc2e7('0x88'),[][_0xc2e7('0x89')](_0x4a5184[_0xc2e7('0x51')][_0x2a984c]));}else if(_0x2a984c===_0xc2e7('0x8a')){var _0x5beb2c=JSON[_0xc2e7('0x8b')](_0x4a5184['query'][_0x2a984c])[_0xc2e7('0x8c')];var _0x364ec5=JSON[_0xc2e7('0x8b')](_0x4a5184[_0xc2e7('0x51')][_0x2a984c])[_0xc2e7('0x8d')];_0x38fb47['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5beb2c,_0x364ec5);}else{if(_0x4a5184[_0xc2e7('0x51')][_0x2a984c]==='null'){_0x38fb47[_0xc2e7('0x87')]('i.'+_0x2a984c+_0xc2e7('0x8e'));}else{_0x38fb47[_0xc2e7('0x87')]('i.'+_0x2a984c+_0xc2e7('0x8f'),_0x4a5184[_0xc2e7('0x51')][_0x2a984c]);}}});}if(_0x4a5184['query'][_0xc2e7('0x90')]){if(_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x90')]==0x1){_0x38fb47[_0xc2e7('0x74')](_0xc2e7('0x91'));}else{_0x38fb47[_0xc2e7('0x74')](_0xc2e7('0x92'));}}if(_0x4a5184[_0xc2e7('0x51')]['tag']){_0x26aa2b=_['isArray'](_0x4a5184[_0xc2e7('0x51')]['tag'])?_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x93')]:new Array(_0x4a5184[_0xc2e7('0x51')]['tag']);_0x26aa2b[_0xc2e7('0x7f')](function(_0x3f73da){_0x2b11ae['or'](_0xc2e7('0x80'),'%,'+_0x3f73da+',%');});}if(_0x4a5184[_0xc2e7('0x51')]['filter']){var _0x9856b0=_0x4a5184['query'][_0xc2e7('0x94')][_0xc2e7('0x95')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xc2e7('0x96')](_0x9856b0)){_0x35610f['or'](_0xc2e7('0x97'),_0x9856b0+'%');}else{_0x35610f['or'](_0xc2e7('0x98'),qs[_0xc2e7('0x7a')](_0x9856b0))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9856b0+'%');}}}_0x38fb47[_0xc2e7('0x87')](_0x35610f);_0x38fb47[_0xc2e7('0x99')](_0xc2e7('0x9a'));var _0x4e4cfd={'type':db['Sequelize'][_0xc2e7('0x9b')][_0xc2e7('0x9c')],'raw':!![]};var _0x58bc7a=_0x38fb47['clone']();_0x58bc7a[_0xc2e7('0x5c')]('i.id');_0x58bc7a['field'](_0xc2e7('0x9d'),'unreadMessages');if(_0x197f8f['order']){_0x197f8f[_0xc2e7('0x58')][_0xc2e7('0x7f')](function(_0x172e08){var _0xe1e7a=_0x172e08[0x0]===_0xc2e7('0x9e')?_0x172e08[0x0]:'i.'+_0x172e08[0x0];_0x38fb47['order'](_0xe1e7a,_0x172e08[0x1]===_0xc2e7('0x9f')?![]:!![]);});}if(!_[_0xc2e7('0x85')](_0x26aa2b)){_0x38fb47[_0xc2e7('0x74')](_0x2b11ae);_0x58bc7a[_0xc2e7('0x87')](_0xc2e7('0xa0'),_0x26aa2b);}BPromise[_0xc2e7('0xa1')]()[_0xc2e7('0x21')](function(){if(!_0xfa1590){if(_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x86')])return;_0x58bc7a[_0xc2e7('0x87')](_0xc2e7('0xa2'));_0x38fb47[_0xc2e7('0x87')](_0xc2e7('0xa2'));return;}if(_0x4a5184[_0xc2e7('0xa3')][_0xc2e7('0xa4')]!==_0xc2e7('0x3d'))return;return _0x4a5184['user']['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xc2e7('0x21')](function(_0x2d554f){if(_[_0xc2e7('0x85')](_0x2d554f)){_0x58bc7a['where'](_0xc2e7('0xa5'));_0x38fb47['where']('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x58bc7a[_0xc2e7('0x87')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x2d554f,'id'));_0x38fb47[_0xc2e7('0x87')](_0xc2e7('0x88'),_['map'](_0x2d554f,'id'));}});})[_0xc2e7('0x21')](function(){if(_0x4a5184[_0xc2e7('0xa3')][_0xc2e7('0xa4')]===_0xc2e7('0x3d')&&!_0xfa1590&&!_0x4a5184['query'][_0xc2e7('0x86')])return[];return db['sequelize'][_0xc2e7('0x51')](_0x58bc7a[_0xc2e7('0xa6')](),_0x4e4cfd);})['then'](function(_0x35323e){_0x2e8f58[_0xc2e7('0x30')]=_0x35323e[_0xc2e7('0x57')];if(_0x2e8f58['count']===0x0)return[];return db[_0xc2e7('0xa7')]['query'](_0x28440d[_0xc2e7('0xa6')](),_0x4e4cfd)[_0xc2e7('0x21')](function(_0x2b622b){_0x342521=_[_0xc2e7('0xa8')](_0x2b622b,'id');_0x4e4cfd=_['merge'](_0x4e4cfd,{'model':db[_0xc2e7('0x4d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a5184[_0xc2e7('0x51')][_0xc2e7('0x56')]){_0x197f8f['attributes'][_0xc2e7('0x7f')](function(_0x308884){_0x38fb47['field']('i.'+_0x308884);});}else{_0x38fb47['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc2e7('0xa9'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xaa'),_0xc2e7('0xab'));_0x38fb47['field'](_0xc2e7('0xac'),_0xc2e7('0xad'));_0x38fb47['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xc2e7('0x9e'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xae'));_0x38fb47[_0xc2e7('0x5c')]('c.firstName',_0xc2e7('0xaf'));_0x38fb47['field']('c.lastName',_0xc2e7('0xb0'));_0x38fb47['field'](_0xc2e7('0xb1'),_0xc2e7('0xb2'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xb3'),_0xc2e7('0xb4'));_0x38fb47['field'](_0xc2e7('0xb5'),'Contact.mobile');_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xb6'),_0xc2e7('0xb7'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xb8'),_0xc2e7('0xb9'));_0x38fb47[_0xc2e7('0x5c')](_0xc2e7('0xba'),'Owner.internal');_0x38fb47['field'](_0xc2e7('0xbb'),'TagIds');}if(_0x197f8f['limit'])_0x38fb47[_0xc2e7('0x31')](_0x197f8f[_0xc2e7('0x31')]);if(_0x197f8f['offset'])_0x38fb47[_0xc2e7('0x2e')](_0x197f8f[_0xc2e7('0x2e')]);return db[_0xc2e7('0xa7')][_0xc2e7('0x51')](_0x38fb47[_0xc2e7('0xa6')](),_0x4e4cfd);})[_0xc2e7('0x21')](function(_0x433a7d){if(_0x433a7d[_0xc2e7('0x57')]>0x0)_0x448b1b[_0xc2e7('0x87')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x433a7d,'id'));return db[_0xc2e7('0xa7')][_0xc2e7('0x51')](_0x448b1b[_0xc2e7('0xa6')](),_0x4e4cfd)['then'](function(_0x2027d4){var _0x303970=_[_0xc2e7('0xbc')](_0x2027d4,'ChatInteractionId');var _0x2d1d75=[];_0x433a7d[_0xc2e7('0x7f')](function(_0x40b8eb){_0x2d1d75[_0xc2e7('0xbd')](updateChatInteraction(_0x40b8eb,_0x342521,_0x303970));});return BPromise[_0xc2e7('0xbe')](_0x2d1d75);});});})[_0xc2e7('0x21')](function(_0x3be5b3){_0x2e8f58[_0xc2e7('0xbf')]=_0x3be5b3;return _0x2e8f58;})[_0xc2e7('0x21')](respondWithFilteredResult(_0x4009ce,_0x197f8f))['catch'](handleError(_0x4009ce,null));};exports[_0xc2e7('0xc0')]=function(_0x4bf10b,_0x57d2ee){var _0x323000={'raw':![],'where':{'id':_0x4bf10b[_0xc2e7('0xc1')]['id']}},_0x2c569e={};_0x2c569e['model']=_[_0xc2e7('0x52')](db['ChatInteraction'][_0xc2e7('0xc2')]);_0x2c569e[_0xc2e7('0x51')]=_[_0xc2e7('0x52')](_0x4bf10b['query']);_0x2c569e['filters']=_[_0xc2e7('0x53')](_0x2c569e[_0xc2e7('0x55')],_0x2c569e[_0xc2e7('0x51')]);_0x323000['attributes']=_['intersection'](_0x2c569e[_0xc2e7('0x55')],qs['fields'](_0x4bf10b[_0xc2e7('0x51')][_0xc2e7('0x56')]));_0x323000['attributes']=_0x323000[_0xc2e7('0x54')]['length']?_0x323000['attributes']:_0x2c569e['model'];if(_0x4bf10b['query']['includeAll']){_0x323000[_0xc2e7('0xc3')]=[{'all':!![]}];}_0x323000=_[_0xc2e7('0xc4')]({},_0x323000,_0x4bf10b['options']);return db[_0xc2e7('0x4d')][_0xc2e7('0x72')](_0x323000)[_0xc2e7('0x21')](handleEntityNotFound(_0x57d2ee,null))[_0xc2e7('0x21')](respondWithResult(_0x57d2ee,null))[_0xc2e7('0x2a')](handleError(_0x57d2ee,null));};exports[_0xc2e7('0xc5')]=function(_0x1ab6ce,_0x5350d5){return db[_0xc2e7('0x4d')][_0xc2e7('0xc5')](_0x1ab6ce['body'],{})[_0xc2e7('0x21')](respondWithResult(_0x5350d5,0xc9))[_0xc2e7('0x2a')](handleError(_0x5350d5,null));};exports[_0xc2e7('0x38')]=function(_0x198e9f,_0x5ce258){if(_0x198e9f['body']['id']){delete _0x198e9f[_0xc2e7('0x3c')]['id'];}return db[_0xc2e7('0x4d')]['find']({'where':{'id':_0x198e9f[_0xc2e7('0xc1')]['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x5ce258,null))['then'](saveUpdates(_0x198e9f['body'],null))[_0xc2e7('0x21')](respondWithResult(_0x5ce258,null))[_0xc2e7('0x2a')](handleError(_0x5ce258,null));};exports['destroy']=function(_0x3cc5b0,_0x4faa88){return db[_0xc2e7('0x4d')]['find']({'where':{'id':_0x3cc5b0[_0xc2e7('0xc1')]['id']}})['then'](handleEntityNotFound(_0x4faa88,null))[_0xc2e7('0x21')](removeEntity(_0x4faa88,null))['catch'](handleError(_0x4faa88,null));};exports[_0xc2e7('0xc6')]=function(_0x12ece6,_0x51ad5d){return db['ChatInteraction'][_0xc2e7('0xc6')]()[_0xc2e7('0x21')](respondWithResult(_0x51ad5d,null))[_0xc2e7('0x2a')](handleError(_0x51ad5d,null));};exports[_0xc2e7('0xc7')]=function(_0x3e3d8b,_0xd5e987){var _0x11b6ab=_0x3e3d8b[_0xc2e7('0xc1')]['id'];var _0x143f4b;var _0x5c6c80;var _0x39dad5;return db[_0xc2e7('0x4d')][_0xc2e7('0xc8')]({'where':{'id':_0x11b6ab}})[_0xc2e7('0x21')](function(_0x3fefd1){_0x143f4b=_0x3fefd1;return db[_0xc2e7('0xc9')]['findOne']({'where':{'id':_0x3fefd1[_0xc2e7('0x86')]},'attributes':['id','vidaooApiKey',_0xc2e7('0xca'),_0xc2e7('0xcb'),_0xc2e7('0xcc'),_0xc2e7('0xcd')],'raw':!![]});})[_0xc2e7('0x21')](function(_0x5dfa71){if(_0x5dfa71&&_0x5dfa71['vidaooApiKey']&&_0x5dfa71[_0xc2e7('0xca')]){_0x5c6c80=_0x5dfa71;var _0x1f4c64={'interaction':{'id':_0x11b6ab},'agent':{'id':_0x3e3d8b[_0xc2e7('0xa3')]['id'],'name':_0x3e3d8b['user'][_0xc2e7('0x3a')],'fullname':_0x3e3d8b[_0xc2e7('0xa3')]['fullname'],'email':_0x3e3d8b[_0xc2e7('0xa3')][_0xc2e7('0xce')]},'contact':_0x3e3d8b[_0xc2e7('0x3c')][_0xc2e7('0xcf')],'account':_0x3e3d8b[_0xc2e7('0x3c')][_0xc2e7('0x3f')]};var _0x2aa285={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5dfa71['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3e3d8b[_0xc2e7('0xa3')][_0xc2e7('0xce')]],'buttons':null,'topic':_0x5c6c80[_0xc2e7('0xcb')],'note':_[_0xc2e7('0xd0')](_0x5c6c80[_0xc2e7('0xcc')])?null:getMustacheRender(_0x5c6c80[_0xc2e7('0xcc')],_0x1f4c64),'metadata':null},'redirect':_0xc2e7('0xd1'),'json':!![]};try{if(!_['isNull'](_0x5c6c80['vidaooMetadata'])){var _0x39a244=getMustacheRender(_0x5c6c80[_0xc2e7('0xcd')],_0x1f4c64);var _0x1cec17=JSON[_0xc2e7('0x8b')](_0x39a244);_0x2aa285['body'][_0xc2e7('0xd2')]=_0x1cec17;}}catch(_0x2d277a){throw new db['Sequelize'][(_0xc2e7('0xd3'))](_0xc2e7('0xd4'));}return rp(_0x2aa285);}else{throw new db[(_0xc2e7('0xd5'))][(_0xc2e7('0xd3'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x141623){_0x39dad5=_0x141623;if(_0x39dad5['id']){var _0x9e815f={'body':_0x39dad5[_0xc2e7('0xd6')],'ChatWebsiteId':_0x5c6c80['id'],'ChatInteractionId':_0x143f4b['id'],'direction':_0xc2e7('0xd7'),'UserId':_0x3e3d8b[_0xc2e7('0xa3')]['id']};return db['ChatMessage'][_0xc2e7('0xc5')](_0x9e815f,{});}else{throw new db['Sequelize']['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x143f4b[_0xc2e7('0xd8')]({'vidaooSessionId':_0x39dad5['id']});})[_0xc2e7('0x21')](respondWithResult(_0xd5e987,null))[_0xc2e7('0x2a')](handleError(_0xd5e987,null));};exports[_0xc2e7('0xd9')]=function(_0x44f558,_0xcaf494){if(_0x44f558[_0xc2e7('0x3c')]['id']){delete _0x44f558[_0xc2e7('0x3c')]['id'];}return db['ChatInteraction'][_0xc2e7('0x72')]({'where':{'id':_0x44f558[_0xc2e7('0xc1')]['id']},'include':[{'model':db[_0xc2e7('0xda')],'as':'Contact'}]})[_0xc2e7('0x21')](handleEntityNotFound(_0xcaf494,null))['then'](saveUpdates(_0x44f558[_0xc2e7('0x3c')],null))['then'](respondWithResult(_0xcaf494,null))[_0xc2e7('0x2a')](handleError(_0xcaf494,null));};exports[_0xc2e7('0xdb')]=function(_0x4b0594,_0x45f669,_0x4a0978){if(_0x4b0594[_0xc2e7('0x3c')]['id']){delete _0x4b0594['body']['id'];}return db[_0xc2e7('0x4d')]['find']({'where':{'id':_0x4b0594['params']['id']}})[_0xc2e7('0x21')](function(_0x2dca60){if(!_0x2dca60){logger[_0xc2e7('0x27')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xc2e7('0xdb'),0x194,_0xc2e7('0xdc'));_0x45f669[_0xc2e7('0x2b')](0x194);}else{if(_0x2dca60[_0xc2e7('0x4a')]){throw new db[(_0xc2e7('0xd5'))][(_0xc2e7('0xd3'))](_0xc2e7('0xdd'));}}return _0x2dca60;})[_0xc2e7('0x21')](function(_0xb1a8b1){if(_0xb1a8b1){return _0xb1a8b1['update']({'closed':_0x4b0594[_0xc2e7('0x3c')][_0xc2e7('0x48')],'disposition':_0x4b0594[_0xc2e7('0x3c')][_0xc2e7('0x4b')]})[_0xc2e7('0x21')](function(_0x1c378c){return _0x1c378c;});}})[_0xc2e7('0x21')](function(_0x264993){return respondWithRpcPromise(_0xc2e7('0xde'),'abandon',_0x4b0594[_0xc2e7('0x3c')],client9004);})[_0xc2e7('0x21')](respondWithResult(_0x45f669,null))['catch'](handleError(_0x45f669,null));};exports[_0xc2e7('0xdf')]=function(_0x15f25a,_0x290811,_0x58a530){_0x15f25a[_0xc2e7('0x3c')][_0xc2e7('0x3a')]=_0x15f25a['file']['originalname'];_0x15f25a[_0xc2e7('0x3c')]['basename']=_0x15f25a['file'][_0xc2e7('0xe0')];_0x15f25a[_0xc2e7('0x3c')][_0xc2e7('0x4f')]=_0x15f25a['file'][_0xc2e7('0xe1')];return db[_0xc2e7('0xe2')]['create'](_0x15f25a[_0xc2e7('0x3c')])[_0xc2e7('0x21')](respondWithResult(_0x290811,0xc9))[_0xc2e7('0x2a')](handleError(_0x290811,null));};exports[_0xc2e7('0xe3')]=function(_0x164a02,_0x5dc164,_0x1fe1bb){return db[_0xc2e7('0x4d')][_0xc2e7('0xc8')]({'where':{'id':_0x164a02[_0xc2e7('0xc1')]['id']},'raw':!![]})[_0xc2e7('0x21')](handleEntityNotFound(_0x5dc164,null))[_0xc2e7('0x21')](function(_0x25f0e7){if(_0x25f0e7){if(_0x25f0e7[_0xc2e7('0x48')]){return _0x5dc164[_0xc2e7('0x2c')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xc2e7('0xe2')]['findOne']({'where':{'id':_0x164a02[_0xc2e7('0x51')][_0xc2e7('0xe4')]},'raw':!![]})[_0xc2e7('0x21')](handleEntityNotFound(_0x5dc164,null));}})['then'](function(_0x27aeca){if(_0x27aeca){var _0x512a58=_0x27aeca[_0xc2e7('0xe5')]!==null;var _0x10c2f6=path[_0xc2e7('0xe6')](config['root'],_0xc2e7('0xe7'));if(_0x512a58){_0x10c2f6=path[_0xc2e7('0xe6')](_0x10c2f6,_0xc2e7('0xe8'));}var _0x4090d7=path[_0xc2e7('0xe6')](_0x10c2f6,_0x27aeca['basename']);return _0x5dc164[_0xc2e7('0xe9')](_0x4090d7);}})[_0xc2e7('0x2a')](handleError(_0x5dc164,null));};exports[_0xc2e7('0xea')]=function(_0x21a156,_0x2bb514){var _0x1f60fa=null;var _0x5d49b3=null;var _0x32fb1e=null;var _0x99afd0=null;if(_0x21a156[_0xc2e7('0x3c')]['id']){delete _0x21a156[_0xc2e7('0x3c')]['id'];}if(_0x21a156[_0xc2e7('0x3c')][_0xc2e7('0xeb')]){_0x99afd0=path[_0xc2e7('0xe6')](config[_0xc2e7('0xec')],_0xc2e7('0xed'),util[_0xc2e7('0xee')]('transcript-%s.txt',Date[_0xc2e7('0xef')]()));_0x21a156[_0xc2e7('0x3c')][_0xc2e7('0xf0')]=_0x99afd0;}return db[_0xc2e7('0x4d')][_0xc2e7('0x72')]({'where':{'id':_0x21a156['params']['id']},'include':[{'model':db[_0xc2e7('0xf1')],'as':'Messages','include':[{'model':db['User'],'as':'User'}]}]})[_0xc2e7('0x21')](handleEntityNotFound(_0x2bb514,null))[_0xc2e7('0x21')](saveUpdates(_0x21a156['body'],null))[_0xc2e7('0x21')](function(_0x304158){if(_0x304158){_0x1f60fa=_0x304158;return db[_0xc2e7('0xc9')][_0xc2e7('0x72')]({'where':{'id':_0x1f60fa['ChatWebsiteId']}});}})[_0xc2e7('0x21')](function(_0x5decd2){if(_0x5decd2){_0x32fb1e=_0x5decd2;return db[_0xc2e7('0xda')][_0xc2e7('0x72')]({'where':{'id':_0x1f60fa[_0xc2e7('0x7c')]}});}})[_0xc2e7('0x21')](function(_0xd47c1b){if(_0xd47c1b){_0x5d49b3=_0xd47c1b;if(_0x99afd0){var _0x1ee8f9=null;for(var _0xceff97=0x1;_0xceff97<_0x1f60fa[_0xc2e7('0xf2')][_0xc2e7('0x57')];++_0xceff97){_0x1ee8f9=_0x1f60fa[_0xc2e7('0xf2')][_0xceff97];var _0x44d418=_0x1ee8f9[_0xc2e7('0x4a')]?util[_0xc2e7('0xee')](_0xc2e7('0xf3'),_0x32fb1e['agentAlias'],_0x1ee8f9['UserId']):'System';var _0x1432ee=_0x21a156[_0xc2e7('0x3c')][_0xc2e7('0xf4')]||util[_0xc2e7('0xee')](_0xc2e7('0xf3'),'Visitor',_0x1ee8f9[_0xc2e7('0x7c')]);switch(_0x32fb1e[_0xc2e7('0xf5')]){case _0xc2e7('0xf6'):_0x44d418=_0x1ee8f9['UserId']?util['format']('%s%d',_0x32fb1e['agentAlias'],_0x1ee8f9['UserId']):_0xc2e7('0xf7');break;case'agent_alias':_0x44d418=_0x1ee8f9['UserId']?_0x1ee8f9[_0xc2e7('0x82')][_0xc2e7('0xf8')]||_0x1ee8f9[_0xc2e7('0x82')]['fullname']:_0xc2e7('0xf7');break;case _0xc2e7('0xf9'):_0x44d418=_0x1ee8f9[_0xc2e7('0x4a')]?_0x1ee8f9[_0xc2e7('0x82')][_0xc2e7('0x41')]:_0xc2e7('0xf7');break;default:_0x44d418=_0x1ee8f9[_0xc2e7('0x4a')]?util[_0xc2e7('0xee')](_0xc2e7('0xf3'),_0x32fb1e[_0xc2e7('0xfa')],_0x1ee8f9['UserId']):'System';}var _0x10f28e=util[_0xc2e7('0xee')](_0xc2e7('0xfb'),moment(_0x1ee8f9[_0xc2e7('0x8a')])[_0xc2e7('0xee')](_0xc2e7('0xfc')),_0x1ee8f9[_0xc2e7('0xfd')]==='in'?_0x1432ee:_0x44d418,_0x1ee8f9[_0xc2e7('0x3c')]);if(!_0x1ee8f9[_0xc2e7('0xfe')]){fs[_0xc2e7('0xff')](_0x99afd0,_0x10f28e);}}return db[_0xc2e7('0x100')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc2e7('0x101')],'as':_0xc2e7('0x102'),'raw':!![]}]});}}})['then'](function(_0x1bb095){if(_0x1bb095&&_0x1bb095['Smtp']&&_0x21a156[_0xc2e7('0x3c')]){var _0x2e0a31={'tls':{'rejectUnauthorized':![]}};if(_0x1bb095[_0xc2e7('0x102')]['service']){_0x2e0a31[_0xc2e7('0x103')]=_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0x103')];}else{_0x2e0a31[_0xc2e7('0x104')]=_0x1bb095['Smtp'][_0xc2e7('0x104')];_0x2e0a31['port']=_0x1bb095[_0xc2e7('0x102')]['port'];_0x2e0a31[_0xc2e7('0x105')]=_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0x105')];}if(_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0x106')]){_0x2e0a31[_0xc2e7('0x107')]={'user':_0x1bb095['Smtp'][_0xc2e7('0xa3')],'pass':_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0x108')]};}return respondWithRpcPromise('SendMail',_0xc2e7('0x109'),{'account':_0x2e0a31,'message':{'from':util[_0xc2e7('0xee')](_0xc2e7('0x10a'),_0x1bb095[_0xc2e7('0x3a')],_0x1bb095[_0xc2e7('0xce')]||_0x1bb095[_0xc2e7('0x102')][_0xc2e7('0xa3')]),'to':_0x21a156[_0xc2e7('0x3c')][_0xc2e7('0xeb')],'subject':'Mail\x20Transcript','text':util[_0xc2e7('0xee')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x21a156['body'][_0xc2e7('0xeb')]),'attachments':[{'path':_0x99afd0}]}})[_0xc2e7('0x21')](function(){return _0x1f60fa;})['catch'](function(_0x433b9a){console[_0xc2e7('0x27')](_0x433b9a);});}else{return _0x1f60fa;}})['then'](respondWithStatusCode(_0x2bb514,0xc8))['catch'](handleError(_0x2bb514,null));};exports[_0xc2e7('0x10b')]=function(_0x37a427,_0x1f9062,_0x3bfd12){return db[_0xc2e7('0xf1')][_0xc2e7('0x72')]({'where':{'id':_0x37a427[_0xc2e7('0xc1')]['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x1f9062,null))[_0xc2e7('0x21')](function(_0x459460){if(_0x459460){return _0x459460[_0xc2e7('0x10b')](_0x37a427[_0xc2e7('0x3c')]['ids'],_[_0xc2e7('0x10c')](_0x37a427[_0xc2e7('0x3c')],[_0xc2e7('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x1f9062,null))[_0xc2e7('0x2a')](handleError(_0x1f9062,null));};exports['getMessages']=function(_0x1c70f5,_0x4b0ae4,_0x448cac){var _0x134f25={'raw':![],'where':{}};var _0x1f48d3={};var _0x1f74d6={'count':0x0,'rows':[]};return db[_0xc2e7('0x4d')]['findOne']({'where':{'id':_0x1c70f5['params']['id']}})['then'](handleEntityNotFound(_0x4b0ae4,null))[_0xc2e7('0x21')](function(_0x5c79e4){if(_0x5c79e4){_0x1f48d3[_0xc2e7('0x55')]=_[_0xc2e7('0x52')](db[_0xc2e7('0xf1')][_0xc2e7('0xc2')]);_0x1f48d3[_0xc2e7('0x51')]=_[_0xc2e7('0x52')](_0x1c70f5[_0xc2e7('0x51')]);_0x1f48d3[_0xc2e7('0x5a')]=_[_0xc2e7('0x53')](_0x1f48d3['model'],_0x1f48d3[_0xc2e7('0x51')]);_0x134f25['attributes']=_[_0xc2e7('0x53')](_0x1f48d3['model'],qs['fields'](_0x1c70f5['query'][_0xc2e7('0x56')]));_0x134f25['attributes']=_0x134f25[_0xc2e7('0x54')][_0xc2e7('0x57')]?_0x134f25['attributes']:_0x1f48d3['model'];if(!_0x1c70f5['query']['hasOwnProperty'](_0xc2e7('0x10e'))){_0x134f25[_0xc2e7('0x31')]=qs[_0xc2e7('0x31')](_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x31')]);_0x134f25[_0xc2e7('0x2e')]=qs[_0xc2e7('0x2e')](_0x1c70f5['query'][_0xc2e7('0x2e')]);}_0x134f25['order']=qs[_0xc2e7('0x59')](_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x59')]);_0x134f25[_0xc2e7('0x87')]=qs[_0xc2e7('0x5a')](_[_0xc2e7('0x10f')](_0x1c70f5[_0xc2e7('0x51')],_0x1f48d3[_0xc2e7('0x5a')]));_0x134f25['where'][_0xc2e7('0x110')]=_0x5c79e4['id'];if(_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x94')]){_0x134f25[_0xc2e7('0x87')]=_[_0xc2e7('0xc4')](_0x134f25[_0xc2e7('0x87')],{'$or':_[_0xc2e7('0x40')](_0x134f25[_0xc2e7('0x54')],function(_0x3e1d95){var _0x4ab1ac={};_0x4ab1ac[_0x3e1d95]={'$like':'%'+_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x94')]+'%'};return _0x4ab1ac;})});}if(_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x8c')]){var _0x783f52=_0x1c70f5['query'][_0xc2e7('0x8c')][_0xc2e7('0x44')](',');var _0x5a15be={};_0x5a15be[_0x783f52[0x0]]={'$gte':moment(_0x783f52[0x1])[_0xc2e7('0xee')](_0xc2e7('0x111'))};_0x134f25[_0xc2e7('0x87')]=_[_0xc2e7('0xc4')](_0x134f25[_0xc2e7('0x87')],_0x5a15be);}_0x134f25=_['merge']({},_0x134f25,_0x1c70f5[_0xc2e7('0x112')]);return db[_0xc2e7('0xf1')][_0xc2e7('0x30')]({'where':_0x134f25['where']})[_0xc2e7('0x21')](function(_0x69f86){_0x1f74d6[_0xc2e7('0x30')]=_0x69f86;if(_0x1c70f5[_0xc2e7('0x51')][_0xc2e7('0x113')]){_0x134f25[_0xc2e7('0xc3')]=[{'all':!![]}];}return db['ChatMessage'][_0xc2e7('0x114')](_0x134f25);})[_0xc2e7('0x21')](function(_0x5844d0){_0x1f74d6['rows']=_0x5844d0;return _0x1f74d6;});}})[_0xc2e7('0x21')](respondWithFilteredResult(_0x4b0ae4,_0x134f25))['catch'](handleError(_0x4b0ae4,null));};exports[_0xc2e7('0x115')]=function(_0x13aaa5,_0x2b4ae8,_0x3d188b){var _0xb4dda3={'where':{}},_0x3850dd={},_0x43824b={'count':0x0,'rows':[]};return db[_0xc2e7('0x4d')][_0xc2e7('0xc8')]({'where':{'id':_0x13aaa5['params']['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x2b4ae8,null))[_0xc2e7('0x21')](function(_0x3313a0){if(_0x3313a0){_0x3850dd[_0xc2e7('0x55')]=_['keys'](db[_0xc2e7('0xf1')]['rawAttributes']);_0x3850dd['query']=_[_0xc2e7('0x52')](_0x13aaa5[_0xc2e7('0x51')]);_0x3850dd[_0xc2e7('0x5a')]=_[_0xc2e7('0x53')](_0x3850dd[_0xc2e7('0x55')],_0x3850dd['query']);_0xb4dda3['attributes']=_[_0xc2e7('0x53')](_0x3850dd[_0xc2e7('0x55')],qs[_0xc2e7('0x56')](_0x13aaa5['query']['fields']));_0xb4dda3[_0xc2e7('0x54')]=_0xb4dda3[_0xc2e7('0x54')][_0xc2e7('0x57')]?_0xb4dda3['attributes']:_0x3850dd[_0xc2e7('0x55')];if(!_0x13aaa5['query'][_0xc2e7('0x116')]('nolimit')){_0xb4dda3[_0xc2e7('0x31')]=qs['limit'](_0x13aaa5['query'][_0xc2e7('0x31')]);_0xb4dda3[_0xc2e7('0x2e')]=qs['offset'](_0x13aaa5[_0xc2e7('0x51')]['offset']);}_0xb4dda3[_0xc2e7('0x58')]=qs[_0xc2e7('0x59')](_0x13aaa5[_0xc2e7('0x51')][_0xc2e7('0x59')]);_0xb4dda3['where']=qs[_0xc2e7('0x5a')](_[_0xc2e7('0x10f')](_0x13aaa5[_0xc2e7('0x51')],_0x3850dd[_0xc2e7('0x5a')]));_0xb4dda3[_0xc2e7('0x87')][_0xc2e7('0x110')]=_0x3313a0['id'];if(_0x13aaa5['query'][_0xc2e7('0x94')]){_0xb4dda3[_0xc2e7('0x87')]=_['merge'](_0xb4dda3['where'],{'$or':_['map'](_0xb4dda3['attributes'],function(_0x302033){var _0xd4f640={};_0xd4f640[_0x302033]={'$like':'%'+_0x13aaa5[_0xc2e7('0x51')]['filter']+'%'};return _0xd4f640;})});}_0xb4dda3[_0xc2e7('0x87')][_0xc2e7('0xfe')]=![];if(_0x13aaa5['query']['id']){_0xb4dda3[_0xc2e7('0x87')]['id']={'$gt':_0x13aaa5[_0xc2e7('0x51')]['id']};}_0xb4dda3=_[_0xc2e7('0xc4')]({},_0xb4dda3,_0x13aaa5[_0xc2e7('0x112')]);return db[_0xc2e7('0xf1')]['count']({'where':_0xb4dda3[_0xc2e7('0x87')]})[_0xc2e7('0x21')](function(_0xd231ce){_0x43824b['count']=_0xd231ce;_0xb4dda3[_0xc2e7('0xc3')]=[];if(_0x13aaa5['query'][_0xc2e7('0x117')]){_0xb4dda3[_0xc2e7('0xc3')]['push']({'model':db[_0xc2e7('0x82')],'as':_0xc2e7('0x82'),'attributes':['id',_0xc2e7('0x41'),_0xc2e7('0xf8')]});}if(_0x13aaa5['query']['includeAll']){_0xb4dda3['include']=[{'all':!![]}];}return db[_0xc2e7('0xf1')][_0xc2e7('0x114')](_0xb4dda3);})[_0xc2e7('0x21')](function(_0x30eccc){_0x43824b[_0xc2e7('0xbf')]=_0x30eccc;return _0x43824b;});}})[_0xc2e7('0x21')](respondWithFilteredResult(_0x2b4ae8,_0xb4dda3))[_0xc2e7('0x2a')](handleError(_0x2b4ae8,null));};exports[_0xc2e7('0x118')]=function(_0x11649a,_0x164307,_0x4d71dc){return db[_0xc2e7('0x4d')][_0xc2e7('0x72')]({'where':{'id':_0x11649a[_0xc2e7('0xc1')]['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x164307,null))[_0xc2e7('0x21')](function(_0x26c874){if(_0x26c874){return _0x26c874[_0xc2e7('0x119')](_0x11649a[_0xc2e7('0x3c')][_0xc2e7('0x10d')],_[_0xc2e7('0x10c')](_0x11649a[_0xc2e7('0x3c')],[_0xc2e7('0x10d'),'id'])||{})[_0xc2e7('0x11a')](function(){return db['Tag']['findAll']({'attributes':['id',_0xc2e7('0x3a'),_0xc2e7('0x5d')],'where':{'id':_0x11649a['body'][_0xc2e7('0x10d')]}});})[_0xc2e7('0x21')](function(_0x1de34b){socket[_0xc2e7('0x11b')](_0xc2e7('0x11c'),{'id':Number(_0x11649a[_0xc2e7('0xc1')]['id']),'tags':_0x1de34b||[]});return{'id':Number(_0x11649a[_0xc2e7('0xc1')]['id']),'tags':_0x1de34b||[]};});}})['then'](respondWithResult(_0x164307,null))['catch'](handleError(_0x164307,null));};exports[_0xc2e7('0x11d')]=function(_0x1199eb,_0x44e23b,_0x22b0e2){return db['ChatInteraction'][_0xc2e7('0x72')]({'where':{'id':_0x1199eb['params']['id']}})[_0xc2e7('0x21')](handleEntityNotFound(_0x44e23b,null))['then'](function(_0x28d258){if(_0x28d258){return _0x28d258[_0xc2e7('0x11d')](_0x1199eb[_0xc2e7('0x51')][_0xc2e7('0x10d')]);}})['then'](respondWithStatusCode(_0x44e23b,null))['catch'](handleError(_0x44e23b,null));};exports['download']=function(_0x154e18,_0xdd7db4){var _0x1011f8=moment()[_0xc2e7('0x11e')]()[_0xc2e7('0xa6')]();var _0x549847=path[_0xc2e7('0xe6')](config[_0xc2e7('0xec')],_0xc2e7('0x11f'),_0xc2e7('0x120'),_0xc2e7('0x121'));var _0x384ac7=path[_0xc2e7('0xe6')](config['root'],_0xc2e7('0x11f'),_0xc2e7('0x120'),_0xc2e7('0x122'));var _0x2e2b92=path[_0xc2e7('0xe6')](_0x549847,_0x1011f8);var _0x43996d=util[_0xc2e7('0xee')](_0xc2e7('0x123'),_0x154e18[_0xc2e7('0xc1')]['id'],_0x1011f8);var _0x3501c9=path[_0xc2e7('0xe6')](_0x549847,_0x43996d);var _0x2cf0f8=[];_0x2cf0f8[_0xc2e7('0xbd')]({'model':db['User'],'as':_0xc2e7('0x82'),'attributes':['id',_0xc2e7('0x41')],'raw':!![]});_0x2cf0f8[_0xc2e7('0xbd')]({'model':db[_0xc2e7('0xda')],'as':'Contact','attributes':['id','firstName',_0xc2e7('0x124')],'raw':!![]});if(_0x154e18['query'][_0xc2e7('0x122')]){_0x2cf0f8[_0xc2e7('0xbd')]({'model':db[_0xc2e7('0xe2')],'as':'Attachment','raw':!![]});}var _0x47201b=[{'model':db[_0xc2e7('0xf1')],'as':_0xc2e7('0xf2'),'attributes':['id',_0xc2e7('0x3c'),_0xc2e7('0x8a'),'direction',_0xc2e7('0xfe'),_0xc2e7('0x90')],'include':_0x2cf0f8}];_0x47201b[_0xc2e7('0xbd')]({'model':db[_0xc2e7('0xc9')],'as':'Account','attributes':['id','name']});_0x47201b[_0xc2e7('0xbd')]({'model':db[_0xc2e7('0x82')],'as':_0xc2e7('0x125'),'attributes':['id',_0xc2e7('0x41')]});return db['ChatInteraction'][_0xc2e7('0x72')]({'where':{'id':_0x154e18['params']['id']},'include':_0x47201b})['then'](handleEntityNotFound(_0xdd7db4,null))[_0xc2e7('0x21')](function(_0x5a8c42){if(_0x5a8c42){var _0x2bbb2e=_0x5a8c42[_0xc2e7('0x126')]({'plain':!![]});fs[_0xc2e7('0x127')](_0x2e2b92);var _0x597a66={'channel':_0xc2e7('0x128'),'account':_0x2bbb2e[_0xc2e7('0x129')]['name'],'agent':_0x2bbb2e[_0xc2e7('0x125')]?_0x2bbb2e[_0xc2e7('0x125')][_0xc2e7('0x41')]:_0xc2e7('0x12a'),'createdAt':moment(_0x2bbb2e[_0xc2e7('0x8a')])[_0xc2e7('0xee')](_0xc2e7('0x111'))['toString'](),'closedAt':_0x2bbb2e[_0xc2e7('0x48')]?moment(_0x2bbb2e[_0xc2e7('0x12b')])['format'](_0xc2e7('0x111'))['toString']():'','disposition':_0x2bbb2e[_0xc2e7('0x4b')],'chatInfo':{'browser':_0x2bbb2e[_0xc2e7('0x12c')],'os':_0x2bbb2e[_0xc2e7('0x12d')],'referer':_0x2bbb2e['referer'],'customerIp':_0x2bbb2e[_0xc2e7('0x12e')],'customerPort':_0x2bbb2e[_0xc2e7('0x12f')]?_0x2bbb2e[_0xc2e7('0x12f')]:_0xc2e7('0x12a')},'messages':_(_0x2bbb2e['Messages'])[_0xc2e7('0x130')]()[_0xc2e7('0x94')]({'secret':![]})[_0xc2e7('0x40')](function(_0x20c684){if(_0x20c684['Attachment']){var _0x5f3ef4=path[_0xc2e7('0xe6')](_0x384ac7,_0x20c684['Attachment'][_0xc2e7('0x131')]);if(fs[_0xc2e7('0x132')](_0x5f3ef4)){fs[_0xc2e7('0x133')](_0x5f3ef4)[_0xc2e7('0x134')](fs[_0xc2e7('0x135')](path[_0xc2e7('0xe6')](_0x2e2b92,_0x20c684['Attachment'][_0xc2e7('0x131')])));}}return{'date':moment(_0x20c684[_0xc2e7('0x8a')])[_0xc2e7('0xee')](_0xc2e7('0x111'))[_0xc2e7('0xa6')](),'sender':_0x20c684[_0xc2e7('0xfd')]===_0xc2e7('0xd7')?_0x20c684['User']?_0x20c684['User'][_0xc2e7('0x41')]:_0xc2e7('0xf7'):_0x20c684[_0xc2e7('0x77')]['firstName']+(_0x20c684[_0xc2e7('0x77')][_0xc2e7('0x124')]?'\x20'+_0x20c684[_0xc2e7('0x77')]['lastName']:''),'body':_0x20c684[_0xc2e7('0xe2')]?_0x20c684[_0xc2e7('0xe2')][_0xc2e7('0x131')]:_0x20c684['body'],'direction':_0x20c684[_0xc2e7('0xfd')]==='out'?'A':'C','secret':_0x20c684[_0xc2e7('0xfe')],'read':_0x20c684[_0xc2e7('0x90')],'attachment':_0x20c684[_0xc2e7('0xe2')]};})[_0xc2e7('0x73')]()};return ejs[_0xc2e7('0x136')](path[_0xc2e7('0xe6')](config[_0xc2e7('0xec')],'server',_0xc2e7('0x137'),_0xc2e7('0x138')),{'interaction':_0x597a66})[_0xc2e7('0x21')](function(_0xf840e2){var _0xc48871=path[_0xc2e7('0xe6')](_0x2e2b92,'transcript-'+_0x2bbb2e['id']+'-'+_0x1011f8+_0xc2e7('0x139'));var _0x3eb7dc={'path':_0xc48871,'channel':_0xc2e7('0x128'),'interactionId':_0x2bbb2e['id']};return pdf['createPdfFromHTML'](_0xf840e2,_0x3eb7dc);})['then'](function(){return new BPromise(function(_0x51f802,_0x1ae2ec){zipdir(_0x2e2b92,{'saveTo':_0x3501c9},function(_0x1b05f8,_0x364d96){if(_0x1b05f8)return _0x1ae2ec(_0x1b05f8);return _0x51f802(_0x364d96);});})[_0xc2e7('0x21')](function(){return new BPromise(function(_0x3aa354,_0x5f4188){rimraf(_0x2e2b92,function(_0x213cad){if(_0x213cad)_0x5f4188(_0x213cad);return _0x3aa354();});});})['then'](function(){return _0xdd7db4['download'](_0x3501c9,_0x43996d,function(_0x2089e3){if(_0x2089e3){console[_0xc2e7('0x13a')](_0xc2e7('0x13b'),_0x2089e3);}else{fs[_0xc2e7('0x13c')](_0x3501c9);}});});});}else{return _0xdd7db4[_0xc2e7('0x2b')](0xc8);}})[_0xc2e7('0x2a')](handleError(_0xdd7db4,null));};
\ No newline at end of file
+var _0xdd25=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','json','offset','undefined','limit','count','set','reject','save','update','name','send','merge','body','contact','interaction','Users','map','fullname','TagIds','Tags','split','forEach','talking','answered','unmanaged','abandoned','total','closed','UserId','waiting','index','ChatInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','expr','search','sqlOperator','length','find','unreadMessages','value','having','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','show','params','includeAll','include','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','download','close','server/files/chat/upload/','transcript-%s.txt','pathTranscript','User','CmContact','Messages','%s%d','System','format','Visitor','website_alias','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Owner','mkdirSync','Chat','Account','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf'];(function(_0x3543e7,_0x501fcf){var _0x42df23=function(_0x467049){while(--_0x467049){_0x3543e7['push'](_0x3543e7['shift']());}};_0x42df23(++_0x501fcf);}(_0xdd25,0x13a));var _0x5dd2=function(_0xdca105,_0x1f91ce){_0xdca105=_0xdca105-0x0;var _0x34a61c=_0xdd25[_0xdca105];return _0x34a61c;};'use strict';var emlformat=require(_0x5dd2('0x0'));var rimraf=require(_0x5dd2('0x1'));var zipdir=require(_0x5dd2('0x2'));var jsonpatch=require(_0x5dd2('0x3'));var rp=require(_0x5dd2('0x4'));var moment=require(_0x5dd2('0x5'));var BPromise=require(_0x5dd2('0x6'));var Mustache=require(_0x5dd2('0x7'));var util=require(_0x5dd2('0x8'));var path=require(_0x5dd2('0x9'));var sox=require(_0x5dd2('0xa'));var csv=require(_0x5dd2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5dd2('0xc'));var squel=require(_0x5dd2('0xd'));var crypto=require(_0x5dd2('0xe'));var jsforce=require(_0x5dd2('0xf'));var deskjs=require(_0x5dd2('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5dd2('0x11'));var Redis=require(_0x5dd2('0x12'));var authService=require(_0x5dd2('0x13'));var qs=require(_0x5dd2('0x14'));var as=require(_0x5dd2('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x5dd2('0x16'));var logger=require(_0x5dd2('0x17'))('api');var utils=require(_0x5dd2('0x18'));var config=require(_0x5dd2('0x19'));var licenseUtil=require(_0x5dd2('0x1a'));var db=require('../../mysqldb')['db'];config[_0x5dd2('0x1b')]=_[_0x5dd2('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5dd2('0x1b')]));require(_0x5dd2('0x1d'))['register'](socket);var jayson=require(_0x5dd2('0x1e'));var client=jayson[_0x5dd2('0x1f')][_0x5dd2('0x20')]({'port':0x232b});var client9004=jayson[_0x5dd2('0x1f')][_0x5dd2('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x31c324,_0x124288,_0x126f76,_0x4d96f3){return new BPromise(function(_0xff930b,_0x307367){var _0x46339f=_0x4d96f3||client;return _0x46339f[_0x5dd2('0x21')](_0x31c324,_0x126f76)[_0x5dd2('0x22')](function(_0x1bddde){logger[_0x5dd2('0x23')](_0x5dd2('0x24'),_0x124288,_0x5dd2('0x25'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x124288,_0x5dd2('0x25'),JSON[_0x5dd2('0x26')](_0x1bddde));if(_0x1bddde[_0x5dd2('0x27')]){if(_0x1bddde[_0x5dd2('0x27')]['code']===0x1f4){logger[_0x5dd2('0x27')](_0x5dd2('0x24'),_0x124288,_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);return _0x307367(_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);}logger['error'](_0x5dd2('0x24'),_0x124288,_0x1bddde[_0x5dd2('0x27')]['message']);return _0xff930b(_0x1bddde[_0x5dd2('0x27')][_0x5dd2('0x28')]);}else{logger[_0x5dd2('0x23')](_0x5dd2('0x24'),_0x124288,_0x5dd2('0x25'));_0xff930b(_0x1bddde[_0x5dd2('0x29')][_0x5dd2('0x28')]);}})[_0x5dd2('0x2a')](function(_0x2df995){logger[_0x5dd2('0x27')](_0x5dd2('0x24'),_0x124288,_0x2df995);_0x307367(_0x2df995);});});}function respondWithStatusCode(_0x7d7c7f,_0x171d82){_0x171d82=_0x171d82||0xcc;return function(_0x374971){if(_0x374971){return _0x7d7c7f['sendStatus'](_0x171d82);}return _0x7d7c7f['status'](_0x171d82)[_0x5dd2('0x2b')]();};}function respondWithResult(_0x50236c,_0x3f6c82){_0x3f6c82=_0x3f6c82||0xc8;return function(_0x3f3b1b){if(_0x3f3b1b){return _0x50236c[_0x5dd2('0x2c')](_0x3f6c82)[_0x5dd2('0x2d')](_0x3f3b1b);}};}function respondWithFilteredResult(_0x3e09de,_0x252db4){return function(_0x48e367){if(_0x48e367){var _0x4be3bc=typeof _0x252db4[_0x5dd2('0x2e')]===_0x5dd2('0x2f')&&typeof _0x252db4[_0x5dd2('0x30')]===_0x5dd2('0x2f');var _0x3cc4ec=_0x48e367[_0x5dd2('0x31')];var _0x5e87da=_0x4be3bc?0x0:_0x252db4[_0x5dd2('0x2e')];var _0x338884=_0x4be3bc?_0x48e367['count']:_0x252db4[_0x5dd2('0x2e')]+_0x252db4[_0x5dd2('0x30')];var _0x491081;if(_0x338884>=_0x3cc4ec){_0x338884=_0x3cc4ec;_0x491081=0xc8;}else{_0x491081=0xce;}_0x3e09de['status'](_0x491081);return _0x3e09de[_0x5dd2('0x32')]('Content-Range',_0x5e87da+'-'+_0x338884+'/'+_0x3cc4ec)[_0x5dd2('0x2d')](_0x48e367);}return null;};}function patchUpdates(_0x2341c7){return function(_0x3156e7){try{jsonpatch['apply'](_0x3156e7,_0x2341c7,!![]);}catch(_0x4923b3){return BPromise[_0x5dd2('0x33')](_0x4923b3);}return _0x3156e7[_0x5dd2('0x34')]();};}function saveUpdates(_0x26df28,_0x4c5496){return function(_0x8e2131){if(_0x8e2131){return _0x8e2131[_0x5dd2('0x35')](_0x26df28)[_0x5dd2('0x22')](function(_0x4188ff){return _0x4188ff;});}return null;};}function removeEntity(_0x3ccf40,_0xe11ba6){return function(_0x2c0545){if(_0x2c0545){return _0x2c0545['destroy']()[_0x5dd2('0x22')](function(){_0x3ccf40[_0x5dd2('0x2c')](0xcc)[_0x5dd2('0x2b')]();});}};}function handleEntityNotFound(_0x393adc,_0x307996){return function(_0x1c4522){if(!_0x1c4522){_0x393adc['sendStatus'](0x194);}return _0x1c4522;};}function handleError(_0xb9dfad,_0x3a9ff){_0x3a9ff=_0x3a9ff||0x1f4;return function(_0x380d33){logger[_0x5dd2('0x27')](_0x380d33['stack']);if(_0x380d33['name']){delete _0x380d33[_0x5dd2('0x36')];}_0xb9dfad[_0x5dd2('0x2c')](_0x3a9ff)[_0x5dd2('0x37')](_0x380d33);};}function getMustacheRender(_0x1c2700,_0xc6b25b){return Mustache['render'](_0x1c2700,_[_0x5dd2('0x38')](_0xc6b25b[_0x5dd2('0x39')],{'contact':_0xc6b25b[_0x5dd2('0x3a')],'message':_0xc6b25b[_0x5dd2('0x28')],'agent':_0xc6b25b['agent'],'interaction':_0xc6b25b[_0x5dd2('0x3b')],'account':_0xc6b25b['account']}))||'';}function getInteractionUsers(_0x1405a8,_0x16f73d){return new BPromise(function(_0x11e34c,_0xb18576){try{if(_0x16f73d[_0x1405a8['id']]){_0x1405a8[_0x5dd2('0x3c')]=_[_0x5dd2('0x3d')](_0x16f73d[_0x1405a8['id']],function(_0x489700){return{'id':_0x489700['id'],'fullname':_0x489700[_0x5dd2('0x3e')]};});}}catch(_0x5e4fb1){_0xb18576(_0x5e4fb1);}_0x11e34c(_0x1405a8);});}function getInteractionTags(_0x488c64,_0x108d77){return new BPromise(function(_0x11e5e7,_0x29fef5){try{if(_0x488c64[_0x5dd2('0x3f')]){_0x488c64[_0x5dd2('0x40')]=[];_0x488c64[_0x5dd2('0x3f')][_0x5dd2('0x41')](',')[_0x5dd2('0x42')](function(_0x13e89f){_0x488c64[_0x5dd2('0x40')]['push'](_0x108d77[_0x13e89f]);});}delete _0x488c64[_0x5dd2('0x3f')];}catch(_0xe163ed){_0x29fef5(_0xe163ed);}_0x11e5e7(_0x488c64);});}function updateChatInteraction(_0x298ea3,_0xc3aa2c,_0x19ccff){return new BPromise(function(_0x15adaf,_0x151b57){return getInteractionUsers(_0x298ea3,_0x19ccff)[_0x5dd2('0x22')](function(_0x1decdf){return getInteractionTags(_0x1decdf,_0xc3aa2c);})[_0x5dd2('0x22')](function(_0x1f970b){return getStateInteraction(_0x1f970b);})['then'](function(_0x58318b){_0x15adaf(_0x58318b);})[_0x5dd2('0x2a')](function(_0x24c163){_0x151b57(_0x24c163);});});}function getStateInteraction(_0x1e85b1){return new BPromise(function(_0x37e5ca){_0x1e85b1['waiting']=0x0;_0x1e85b1[_0x5dd2('0x43')]=0x0;_0x1e85b1[_0x5dd2('0x44')]=0x0;_0x1e85b1[_0x5dd2('0x45')]=0x0;_0x1e85b1[_0x5dd2('0x46')]=0x0;_0x1e85b1[_0x5dd2('0x47')]=0x0;if(!_0x1e85b1[_0x5dd2('0x48')]&&!_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1['waiting']+=0x1;}if(!_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1[_0x5dd2('0x43')]+=0x1;if(_0x1e85b1[_0x5dd2('0x4a')]){_0x1e85b1[_0x5dd2('0x4a')]-=0x1;}}if(_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1['disposition']===_0x5dd2('0x46')){_0x1e85b1['abandoned']+=0x1;if(_0x1e85b1['waiting']){_0x1e85b1['waiting']-=0x1;}}else if(_0x1e85b1[_0x5dd2('0x48')]&&!_0x1e85b1[_0x5dd2('0x49')]&&_0x1e85b1['disposition']){_0x1e85b1[_0x5dd2('0x45')]+=0x1;if(_0x1e85b1[_0x5dd2('0x4a')]){_0x1e85b1['waiting']-=0x1;}}else if(_0x1e85b1[_0x5dd2('0x48')]&&_0x1e85b1[_0x5dd2('0x49')]){_0x1e85b1[_0x5dd2('0x44')]+=0x1;if(_0x1e85b1[_0x5dd2('0x43')]){_0x1e85b1[_0x5dd2('0x43')]-=0x1;}}_0x1e85b1[_0x5dd2('0x47')]+=0x1;_0x37e5ca(_0x1e85b1);});}exports[_0x5dd2('0x4b')]=function(_0x370a41,_0x312f96){var _0x10fe4b={},_0x5653e3={},_0x178848={'count':0x0,'rows':[]};var _0x1d4334=_[_0x5dd2('0x3d')](db[_0x5dd2('0x4c')][_0x5dd2('0x4d')],function(_0x4e6159){return{'name':_0x4e6159[_0x5dd2('0x4e')],'type':_0x4e6159[_0x5dd2('0x4f')]['key']};});_0x5653e3[_0x5dd2('0x50')]=_[_0x5dd2('0x3d')](_0x1d4334,_0x5dd2('0x36'));_0x5653e3[_0x5dd2('0x51')]=_[_0x5dd2('0x52')](_0x370a41[_0x5dd2('0x51')]);_0x5653e3[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x5653e3[_0x5dd2('0x50')],_0x5653e3['query']);_0x10fe4b[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x5653e3[_0x5dd2('0x50')],qs['fields'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x10fe4b['attributes']=_0x10fe4b[_0x5dd2('0x55')]['length']?_0x10fe4b['attributes']:_0x5653e3[_0x5dd2('0x50')];if(!_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x10fe4b[_0x5dd2('0x30')]=qs['limit'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x30')]);_0x10fe4b[_0x5dd2('0x2e')]=qs[_0x5dd2('0x2e')](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x10fe4b[_0x5dd2('0x59')]=qs[_0x5dd2('0x5a')](_0x370a41[_0x5dd2('0x51')]['sort']);_0x10fe4b['where']=qs['filters'](_[_0x5dd2('0x5b')](_0x370a41[_0x5dd2('0x51')],_0x5653e3[_0x5dd2('0x53')]),_0x1d4334);var _0x199c07=[];var _0x273092=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5d')]('id')[_0x5dd2('0x5d')]('name')[_0x5dd2('0x5d')](_0x5dd2('0x5e'))[_0x5dd2('0x5f')](_0x5dd2('0x60'));var _0x3fd77d=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5d')]('u.id')['field']('u.fullname')['field'](_0x5dd2('0x61'))[_0x5dd2('0x5f')](_0x5dd2('0x62'),'ui')[_0x5dd2('0x63')](_0x5dd2('0x64'),'u',_0x5dd2('0x65'));var _0x55e347=squel[_0x5dd2('0x5c')]()[_0x5dd2('0x5f')](_0x5dd2('0x66'),'i')[_0x5dd2('0x63')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x5dd2('0x63')](_0x5dd2('0x64'),'o',_0x5dd2('0x67'))[_0x5dd2('0x63')]('chat_websites','a',_0x5dd2('0x68'))[_0x5dd2('0x63')](_0x5dd2('0x69'),'me',_0x5dd2('0x6a'))[_0x5dd2('0x63')](_0x5dd2('0x6b'),'it',_0x5dd2('0x6c'))[_0x5dd2('0x63')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3a7ac8=squel[_0x5dd2('0x6d')]();var _0x3a5abd=[];var _0x35524a=squel['expr']();var _0x3e9b35;if(_0x370a41[_0x5dd2('0x51')]['search']){_0x3e9b35=as['parseSearch'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x6e')]);var _0x218f94=_0x3e9b35[_0x5dd2('0x6f')];for(var _0x2ca3d3=0x0;_0x2ca3d3<_0x3e9b35['conditions'][_0x5dd2('0x70')];_0x2ca3d3++){var _0x4e0a74=_0x3e9b35['conditions'][_0x2ca3d3];var _0x5b8301='i';var _0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x4e0a74['field']]);if(!_0x2d8229){switch(_0x4e0a74['field']){case _0x5dd2('0x72'):if(_0x4e0a74[_0x5dd2('0x73')]==0x1){_0x55e347[_0x5dd2('0x74')]('`'+_0x4e0a74[_0x5dd2('0x5d')]+'`\x20=\x200');}else{_0x55e347['having']('`'+_0x4e0a74[_0x5dd2('0x5d')]+'`\x20>\x200');}break;case _0x5dd2('0x75'):if(_0x4e0a74['operator']===_0x5dd2('0x76')){if(_0x4e0a74[_0x5dd2('0x73')][_0x5dd2('0x41')]('\x20')['length']>0x1){_0x3a7ac8[_0x218f94](_0x5dd2('0x77'),qs[_0x5dd2('0x78')](_0x4e0a74[_0x5dd2('0x73')]),null);}else{var _0x5af19c='%'+_0x4e0a74[_0x5dd2('0x73')]+'%';_0x3a7ac8[_0x218f94]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5af19c,_0x5af19c,_0x5af19c);}}else{_0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x5dd2('0x79')]);_0x4e0a74[_0x5dd2('0x5d')]=_0x5dd2('0x79');_0x297ba2=as['buildExpression'](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);}break;case _0x5dd2('0x7c'):var _0x3ee73b=_0x4e0a74['value'][_0x5dd2('0x41')](',')[_0x5dd2('0x3d')](function(_0x568143){return Number(_0x568143);});_0x3ee73b['forEach'](function(_0x225568){_0x35524a['or'](_0x5dd2('0x7d'),'%,'+_0x225568+',%');});_0x3a5abd=_[_0x5dd2('0x7e')](_0x3a5abd,_0x3ee73b);break;case'User':if(_0x4e0a74['operator']===_0x5dd2('0x76')){_0x3a7ac8[_0x218f94](_0x5dd2('0x7f'),'%'+_0x4e0a74[_0x5dd2('0x73')]+'%',null);}else{_0x2d8229=_[_0x5dd2('0x71')](_0x1d4334,[_0x5dd2('0x36'),_0x5dd2('0x49')]);_0x4e0a74['field']=_0x5dd2('0x49');_0x297ba2=as[_0x5dd2('0x80')](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);}break;case _0x5dd2('0x39'):_0x297ba2=as['buildExpression']('me',null,_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2[_0x5dd2('0x7a')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x2b')]);break;}}else{var _0x297ba2=as[_0x5dd2('0x80')](_0x5b8301,_0x2d8229[_0x5dd2('0x4f')],_0x4e0a74);_0x3a7ac8[_0x218f94](_0x297ba2['text'],_0x297ba2[_0x5dd2('0x73')][_0x5dd2('0x7b')],_0x297ba2[_0x5dd2('0x73')]['end']);}}}else{var _0x264a8e=_(_0x370a41[_0x5dd2('0x51')])[_0x5dd2('0x52')]()['map'](function(_0x409702){return _[_0x5dd2('0x81')](_0x1d4334,[_0x5dd2('0x36'),_0x409702])?_0x409702:undefined;})[_0x5dd2('0x82')]()[_0x5dd2('0x73')]();if(!_[_0x5dd2('0x83')](_0x264a8e)){_0x264a8e[_0x5dd2('0x42')](function(_0x445034){if(_0x445034===_0x5dd2('0x84')){_0x55e347[_0x5dd2('0x85')](_0x5dd2('0x86'),[][_0x5dd2('0x87')](_0x370a41[_0x5dd2('0x51')][_0x445034]));}else if(_0x445034===_0x5dd2('0x88')){var _0x30ef10=JSON[_0x5dd2('0x89')](_0x370a41[_0x5dd2('0x51')][_0x445034])[_0x5dd2('0x8a')];var _0x228089=JSON[_0x5dd2('0x89')](_0x370a41[_0x5dd2('0x51')][_0x445034])['$lte'];_0x55e347[_0x5dd2('0x85')](_0x5dd2('0x8b'),_0x30ef10,_0x228089);}else{if(_0x370a41[_0x5dd2('0x51')][_0x445034]===_0x5dd2('0x8c')){_0x55e347[_0x5dd2('0x85')]('i.'+_0x445034+_0x5dd2('0x8d'));}else{_0x55e347['where']('i.'+_0x445034+_0x5dd2('0x8e'),_0x370a41[_0x5dd2('0x51')][_0x445034]);}}});}if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x8f')]){if(_0x370a41['query'][_0x5dd2('0x8f')]==0x1){_0x55e347[_0x5dd2('0x74')](_0x5dd2('0x90'));}else{_0x55e347[_0x5dd2('0x74')]('`unreadMessages`\x20>\x200');}}if(_0x370a41[_0x5dd2('0x51')]['tag']){_0x3a5abd=_['isArray'](_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x91')])?_0x370a41['query'][_0x5dd2('0x91')]:new Array(_0x370a41[_0x5dd2('0x51')]['tag']);_0x3a5abd[_0x5dd2('0x42')](function(_0x48b7b8){_0x35524a['or'](_0x5dd2('0x7d'),'%,'+_0x48b7b8+',%');});}if(_0x370a41['query'][_0x5dd2('0x92')]){var _0x16ca90=_0x370a41[_0x5dd2('0x51')]['filter'][_0x5dd2('0x93')]('\x5c','\x5c\x5c')[_0x5dd2('0x93')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x16ca90)){_0x3a7ac8['or'](_0x5dd2('0x94'),_0x16ca90+'%');}else{_0x3a7ac8['or'](_0x5dd2('0x95'),qs['getFullTextValue'](_0x16ca90))['or'](_0x5dd2('0x96'),_0x16ca90+'%');}}}_0x55e347['where'](_0x3a7ac8);_0x55e347[_0x5dd2('0x97')](_0x5dd2('0x98'));var _0x13b469={'type':db[_0x5dd2('0x99')][_0x5dd2('0x9a')]['SELECT'],'raw':!![]};var _0x893d45=_0x55e347[_0x5dd2('0x9b')]();_0x893d45[_0x5dd2('0x5d')](_0x5dd2('0x98'));_0x893d45['field'](_0x5dd2('0x9c'),_0x5dd2('0x72'));if(_0x10fe4b[_0x5dd2('0x59')]){_0x10fe4b[_0x5dd2('0x59')][_0x5dd2('0x42')](function(_0x397f2d){var _0x14c34e=_0x397f2d[0x0]===_0x5dd2('0x9d')?_0x397f2d[0x0]:'i.'+_0x397f2d[0x0];_0x55e347[_0x5dd2('0x59')](_0x14c34e,_0x397f2d[0x1]===_0x5dd2('0x9e')?![]:!![]);});}if(!_[_0x5dd2('0x83')](_0x3a5abd)){_0x55e347[_0x5dd2('0x74')](_0x35524a);_0x893d45['where'](_0x5dd2('0x9f'),_0x3a5abd);}BPromise['resolve']()[_0x5dd2('0x22')](function(){if(!_0x3e9b35){if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x84')])return;_0x893d45[_0x5dd2('0x85')](_0x5dd2('0xa0'));_0x55e347['where'](_0x5dd2('0xa0'));return;}if(_0x370a41[_0x5dd2('0xa1')][_0x5dd2('0xa2')]!==_0x5dd2('0xa3'))return;return _0x370a41['user'][_0x5dd2('0xa4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x31a1ac){if(_['isEmpty'](_0x31a1ac)){_0x893d45[_0x5dd2('0x85')]('i.ChatWebsiteId\x20IS\x20NULL');_0x55e347[_0x5dd2('0x85')](_0x5dd2('0xa5'));}else{_0x893d45[_0x5dd2('0x85')](_0x5dd2('0x86'),_[_0x5dd2('0x3d')](_0x31a1ac,'id'));_0x55e347['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x5dd2('0x3d')](_0x31a1ac,'id'));}});})['then'](function(){if(_0x370a41[_0x5dd2('0xa1')]['role']===_0x5dd2('0xa3')&&!_0x3e9b35&&!_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x84')])return[];return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x893d45[_0x5dd2('0xa7')](),_0x13b469);})['then'](function(_0x100158){_0x178848[_0x5dd2('0x31')]=_0x100158[_0x5dd2('0x70')];if(_0x178848[_0x5dd2('0x31')]===0x0)return[];return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x273092[_0x5dd2('0xa7')](),_0x13b469)[_0x5dd2('0x22')](function(_0x40a821){_0x199c07=_['keyBy'](_0x40a821,'id');_0x13b469=_[_0x5dd2('0x38')](_0x13b469,{'model':db[_0x5dd2('0x4c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x370a41[_0x5dd2('0x51')][_0x5dd2('0x56')]){_0x10fe4b[_0x5dd2('0x55')]['forEach'](function(_0x58b3d1){_0x55e347['field']('i.'+_0x58b3d1);});}else{_0x55e347[_0x5dd2('0x5d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5dd2('0x72'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xa8'),_0x5dd2('0xa9'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xaa'),_0x5dd2('0xab'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xac'),_0x5dd2('0x9d'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xad'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xae'),_0x5dd2('0xaf'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb0'),_0x5dd2('0xb1'));_0x55e347[_0x5dd2('0x5d')]('c.email','Contact.email');_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb2'),_0x5dd2('0xb3'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xb4'),_0x5dd2('0xb5'));_0x55e347['field'](_0x5dd2('0xb6'),_0x5dd2('0xb7'));_0x55e347['field'](_0x5dd2('0xb8'),_0x5dd2('0xb9'));_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xba'),'Owner.internal');_0x55e347[_0x5dd2('0x5d')](_0x5dd2('0xbb'),_0x5dd2('0x3f'));}if(_0x10fe4b['limit'])_0x55e347['limit'](_0x10fe4b['limit']);if(_0x10fe4b[_0x5dd2('0x2e')])_0x55e347[_0x5dd2('0x2e')](_0x10fe4b[_0x5dd2('0x2e')]);return db[_0x5dd2('0xa6')][_0x5dd2('0x51')](_0x55e347[_0x5dd2('0xa7')](),_0x13b469);})[_0x5dd2('0x22')](function(_0x2bbcf3){if(_0x2bbcf3[_0x5dd2('0x70')]>0x0)_0x3fd77d[_0x5dd2('0x85')](_0x5dd2('0xbc'),_[_0x5dd2('0x3d')](_0x2bbcf3,'id'));return db[_0x5dd2('0xa6')]['query'](_0x3fd77d[_0x5dd2('0xa7')](),_0x13b469)[_0x5dd2('0x22')](function(_0x50bf84){var _0x55e0c2=_['groupBy'](_0x50bf84,_0x5dd2('0xbd'));var _0x461162=[];_0x2bbcf3[_0x5dd2('0x42')](function(_0x9303e9){_0x461162[_0x5dd2('0xbe')](updateChatInteraction(_0x9303e9,_0x199c07,_0x55e0c2));});return BPromise[_0x5dd2('0xbf')](_0x461162);});});})[_0x5dd2('0x22')](function(_0x1be4ba){_0x178848[_0x5dd2('0xc0')]=_0x1be4ba;return _0x178848;})[_0x5dd2('0x22')](respondWithFilteredResult(_0x312f96,_0x10fe4b))[_0x5dd2('0x2a')](handleError(_0x312f96,null));};exports[_0x5dd2('0xc1')]=function(_0x8b320a,_0x248b5c){var _0x50448d={'raw':![],'where':{'id':_0x8b320a[_0x5dd2('0xc2')]['id']}},_0x2304bf={};_0x2304bf[_0x5dd2('0x50')]=_[_0x5dd2('0x52')](db[_0x5dd2('0x4c')][_0x5dd2('0x4d')]);_0x2304bf['query']=_[_0x5dd2('0x52')](_0x8b320a['query']);_0x2304bf[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x2304bf['model'],_0x2304bf[_0x5dd2('0x51')]);_0x50448d[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x2304bf[_0x5dd2('0x50')],qs['fields'](_0x8b320a[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x50448d[_0x5dd2('0x55')]=_0x50448d[_0x5dd2('0x55')]['length']?_0x50448d[_0x5dd2('0x55')]:_0x2304bf[_0x5dd2('0x50')];if(_0x8b320a[_0x5dd2('0x51')][_0x5dd2('0xc3')]){_0x50448d[_0x5dd2('0xc4')]=[{'all':!![]}];}_0x50448d=_[_0x5dd2('0x38')]({},_0x50448d,_0x8b320a['options']);return db[_0x5dd2('0x4c')][_0x5dd2('0x71')](_0x50448d)[_0x5dd2('0x22')](handleEntityNotFound(_0x248b5c,null))[_0x5dd2('0x22')](respondWithResult(_0x248b5c,null))[_0x5dd2('0x2a')](handleError(_0x248b5c,null));};exports['create']=function(_0x3d970e,_0x1e05e0){return db[_0x5dd2('0x4c')]['create'](_0x3d970e[_0x5dd2('0x39')],{})[_0x5dd2('0x22')](respondWithResult(_0x1e05e0,0xc9))[_0x5dd2('0x2a')](handleError(_0x1e05e0,null));};exports[_0x5dd2('0x35')]=function(_0x7dd3f3,_0x27ad08){if(_0x7dd3f3[_0x5dd2('0x39')]['id']){delete _0x7dd3f3[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x7dd3f3[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x27ad08,null))[_0x5dd2('0x22')](saveUpdates(_0x7dd3f3[_0x5dd2('0x39')],null))['then'](respondWithResult(_0x27ad08,null))[_0x5dd2('0x2a')](handleError(_0x27ad08,null));};exports[_0x5dd2('0xc5')]=function(_0x4f1f41,_0x3667bb){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x4f1f41[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3667bb,null))[_0x5dd2('0x22')](removeEntity(_0x3667bb,null))['catch'](handleError(_0x3667bb,null));};exports[_0x5dd2('0xc6')]=function(_0x1f5324,_0x76d7f3){return db[_0x5dd2('0x4c')]['describe']()['then'](respondWithResult(_0x76d7f3,null))[_0x5dd2('0x2a')](handleError(_0x76d7f3,null));};exports[_0x5dd2('0xc7')]=function(_0x4511e6,_0x2d2756){var _0x5b5211=_0x4511e6[_0x5dd2('0xc2')]['id'];var _0xcea6;var _0x2395e2;var _0x216a7a;return db[_0x5dd2('0x4c')][_0x5dd2('0xc8')]({'where':{'id':_0x5b5211}})[_0x5dd2('0x22')](function(_0x34dd3d){_0xcea6=_0x34dd3d;return db[_0x5dd2('0xc9')]['findOne']({'where':{'id':_0x34dd3d['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x5dd2('0xca'),_0x5dd2('0xcb'),'vidaooNote',_0x5dd2('0xcc')],'raw':!![]});})[_0x5dd2('0x22')](function(_0x42edcc){if(_0x42edcc&&_0x42edcc[_0x5dd2('0xcd')]&&_0x42edcc[_0x5dd2('0xca')]){_0x2395e2=_0x42edcc;var _0x57b07a={'interaction':{'id':_0x5b5211},'agent':{'id':_0x4511e6[_0x5dd2('0xa1')]['id'],'name':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0x36')],'fullname':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0x3e')],'email':_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0xce')]},'contact':_0x4511e6[_0x5dd2('0x39')][_0x5dd2('0x3a')],'account':_0x4511e6['body']['account']};var _0x90345={'rejectUnauthorized':![],'method':'POST','url':_0x5dd2('0xcf'),'headers':{'X-APIKEY':_0x42edcc[_0x5dd2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4511e6[_0x5dd2('0xa1')][_0x5dd2('0xce')]],'buttons':null,'topic':_0x2395e2['vidaooTopic'],'note':_[_0x5dd2('0xd0')](_0x2395e2['vidaooNote'])?null:getMustacheRender(_0x2395e2[_0x5dd2('0xd1')],_0x57b07a),'metadata':null},'redirect':_0x5dd2('0xd2'),'json':!![]};try{if(!_['isNull'](_0x2395e2[_0x5dd2('0xcc')])){var _0x18cf98=getMustacheRender(_0x2395e2[_0x5dd2('0xcc')],_0x57b07a);var _0x2898b2=JSON['parse'](_0x18cf98);_0x90345['body']['metadata']=_0x2898b2;}}catch(_0x321249){throw new db['Sequelize'][(_0x5dd2('0xd3'))](_0x5dd2('0xd4'));}return rp(_0x90345);}else{throw new db[(_0x5dd2('0x99'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x5dd2('0x22')](function(_0x29ebe2){_0x216a7a=_0x29ebe2;if(_0x216a7a['id']){var _0x5b1485={'body':_0x216a7a['join_url'],'ChatWebsiteId':_0x2395e2['id'],'ChatInteractionId':_0xcea6['id'],'direction':_0x5dd2('0xd5'),'UserId':_0x4511e6[_0x5dd2('0xa1')]['id']};return db[_0x5dd2('0xd6')][_0x5dd2('0xd7')](_0x5b1485,{});}else{throw new db[(_0x5dd2('0x99'))]['ValidationError'](_0x5dd2('0xd8'));}})[_0x5dd2('0x22')](function(){return _0xcea6[_0x5dd2('0xd9')]({'vidaooSessionId':_0x216a7a['id']});})[_0x5dd2('0x22')](respondWithResult(_0x2d2756,null))[_0x5dd2('0x2a')](handleError(_0x2d2756,null));};exports[_0x5dd2('0xda')]=function(_0x3f53ee,_0x2c81e5){if(_0x3f53ee[_0x5dd2('0x39')]['id']){delete _0x3f53ee[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x3f53ee[_0x5dd2('0xc2')]['id']},'include':[{'model':db['CmContact'],'as':_0x5dd2('0x75')}]})['then'](handleEntityNotFound(_0x2c81e5,null))['then'](saveUpdates(_0x3f53ee[_0x5dd2('0x39')],null))[_0x5dd2('0x22')](respondWithResult(_0x2c81e5,null))[_0x5dd2('0x2a')](handleError(_0x2c81e5,null));};exports[_0x5dd2('0xdb')]=function(_0x3c42fb,_0x504c61,_0x896c39){if(_0x3c42fb[_0x5dd2('0x39')]['id']){delete _0x3c42fb[_0x5dd2('0x39')]['id'];}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x3c42fb['params']['id']}})[_0x5dd2('0x22')](function(_0x178911){if(!_0x178911){logger[_0x5dd2('0x27')](_0x5dd2('0xdc'),_0x5dd2('0xdb'),0x194,_0x5dd2('0xdd'));_0x504c61[_0x5dd2('0xde')](0x194);}else{if(_0x178911['UserId']){throw new db[(_0x5dd2('0x99'))][(_0x5dd2('0xd3'))](_0x5dd2('0xdf'));}}return _0x178911;})['then'](function(_0x4c0e71){if(_0x4c0e71){return _0x4c0e71['update']({'closed':_0x3c42fb[_0x5dd2('0x39')]['closed'],'disposition':_0x3c42fb[_0x5dd2('0x39')][_0x5dd2('0xe0')]})[_0x5dd2('0x22')](function(_0x1e8e35){return _0x1e8e35;});}})[_0x5dd2('0x22')](function(_0x54053d){return respondWithRpcPromise(_0x5dd2('0xe1'),_0x5dd2('0xdb'),_0x3c42fb[_0x5dd2('0x39')],client9004);})[_0x5dd2('0x22')](respondWithResult(_0x504c61,null))[_0x5dd2('0x2a')](handleError(_0x504c61,null));};exports[_0x5dd2('0xe2')]=function(_0x2825fe,_0x3219cf,_0x5b4028){_0x2825fe[_0x5dd2('0x39')]['name']=_0x2825fe[_0x5dd2('0xe3')]['originalname'];_0x2825fe[_0x5dd2('0x39')][_0x5dd2('0xe4')]=_0x2825fe[_0x5dd2('0xe3')][_0x5dd2('0xe5')];_0x2825fe[_0x5dd2('0x39')][_0x5dd2('0x4f')]=_0x2825fe['file'][_0x5dd2('0xe6')];return db['Attachment']['create'](_0x2825fe['body'])[_0x5dd2('0x22')](respondWithResult(_0x3219cf,0xc9))[_0x5dd2('0x2a')](handleError(_0x3219cf,null));};exports['attachmentDownload']=function(_0x135bea,_0xe8fb54,_0x2b26cd){return db[_0x5dd2('0x4c')][_0x5dd2('0xc8')]({'where':{'id':_0x135bea[_0x5dd2('0xc2')]['id']},'raw':!![]})[_0x5dd2('0x22')](handleEntityNotFound(_0xe8fb54,null))[_0x5dd2('0x22')](function(_0x73a02e){if(_0x73a02e){if(_0x73a02e[_0x5dd2('0x48')]){return _0xe8fb54[_0x5dd2('0x2c')](0x193)[_0x5dd2('0x2d')]({'status':0x193,'message':_0x5dd2('0xe7')});}return db[_0x5dd2('0xe8')][_0x5dd2('0xc8')]({'where':{'id':_0x135bea['query'][_0x5dd2('0xe9')]},'raw':!![]})[_0x5dd2('0x22')](handleEntityNotFound(_0xe8fb54,null));}})[_0x5dd2('0x22')](function(_0x346cd4){if(_0x346cd4){var _0x53918e=_0x346cd4['ChatOfflineMessageId']!==null;var _0x3288c1=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0xec'));if(_0x53918e){_0x3288c1=path[_0x5dd2('0xea')](_0x3288c1,_0x5dd2('0xed'));}var _0x3f4ff1=path[_0x5dd2('0xea')](_0x3288c1,_0x346cd4[_0x5dd2('0xe4')]);return _0xe8fb54[_0x5dd2('0xee')](_0x3f4ff1);}})[_0x5dd2('0x2a')](handleError(_0xe8fb54,null));};exports[_0x5dd2('0xef')]=function(_0x2f6749,_0x4c5b2e){var _0x3be791=null;var _0x32b2a2=null;var _0x1875bd=null;var _0x57bd4a=null;if(_0x2f6749[_0x5dd2('0x39')]['id']){delete _0x2f6749['body']['id'];}if(_0x2f6749[_0x5dd2('0x39')]['mailTranscript']){_0x57bd4a=path[_0x5dd2('0xea')](config['root'],_0x5dd2('0xf0'),util['format'](_0x5dd2('0xf1'),Date['now']()));_0x2f6749['body'][_0x5dd2('0xf2')]=_0x57bd4a;}return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2f6749['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0xf3')}]}]})['then'](handleEntityNotFound(_0x4c5b2e,null))['then'](saveUpdates(_0x2f6749[_0x5dd2('0x39')],null))['then'](function(_0x12ac41){if(_0x12ac41){_0x3be791=_0x12ac41;return db[_0x5dd2('0xc9')][_0x5dd2('0x71')]({'where':{'id':_0x3be791[_0x5dd2('0x84')]}});}})[_0x5dd2('0x22')](function(_0x5d8bfc){if(_0x5d8bfc){_0x1875bd=_0x5d8bfc;return db[_0x5dd2('0xf4')]['find']({'where':{'id':_0x3be791['ContactId']}});}})[_0x5dd2('0x22')](function(_0x1a6eb6){if(_0x1a6eb6){_0x32b2a2=_0x1a6eb6;if(_0x57bd4a){var _0x1108f3=null;for(var _0x27e05c=0x1;_0x27e05c<_0x3be791[_0x5dd2('0xf5')][_0x5dd2('0x70')];++_0x27e05c){_0x1108f3=_0x3be791[_0x5dd2('0xf5')][_0x27e05c];var _0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?util['format'](_0x5dd2('0xf6'),_0x1875bd['agentAlias'],_0x1108f3[_0x5dd2('0x49')]):_0x5dd2('0xf7');var _0x3a598c=_0x2f6749[_0x5dd2('0x39')]['customer']||util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x5dd2('0xf9'),_0x1108f3[_0x5dd2('0x79')]);switch(_0x1875bd['agentIdentifier']){case _0x5dd2('0xfa'):_0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x1875bd[_0x5dd2('0xfb')],_0x1108f3[_0x5dd2('0x49')]):'System';break;case _0x5dd2('0xfc'):_0x4ef7b5=_0x1108f3[_0x5dd2('0x49')]?_0x1108f3[_0x5dd2('0xf3')][_0x5dd2('0xfd')]||_0x1108f3['User'][_0x5dd2('0x3e')]:_0x5dd2('0xf7');break;case'agent_fullname':_0x4ef7b5=_0x1108f3['UserId']?_0x1108f3['User']['fullname']:_0x5dd2('0xf7');break;default:_0x4ef7b5=_0x1108f3['UserId']?util[_0x5dd2('0xf8')](_0x5dd2('0xf6'),_0x1875bd[_0x5dd2('0xfb')],_0x1108f3[_0x5dd2('0x49')]):_0x5dd2('0xf7');}var _0xa24829=util['format'](_0x5dd2('0xfe'),moment(_0x1108f3[_0x5dd2('0x88')])[_0x5dd2('0xf8')](_0x5dd2('0xff')),_0x1108f3[_0x5dd2('0x100')]==='in'?_0x3a598c:_0x4ef7b5,_0x1108f3[_0x5dd2('0x39')]);if(!_0x1108f3[_0x5dd2('0x101')]){fs['appendFileSync'](_0x57bd4a,_0xa24829);}}return db[_0x5dd2('0x102')][_0x5dd2('0xc8')]({'where':{'service':!![]},'include':[{'model':db[_0x5dd2('0x103')],'as':_0x5dd2('0x104'),'raw':!![]}]});}}})[_0x5dd2('0x22')](function(_0x27a8bf){if(_0x27a8bf&&_0x27a8bf['Smtp']&&_0x2f6749['body']){var _0x13bf01={'tls':{'rejectUnauthorized':![]}};if(_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x105')]){_0x13bf01[_0x5dd2('0x105')]=_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x105')];}else{_0x13bf01[_0x5dd2('0x106')]=_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x106')];_0x13bf01[_0x5dd2('0x107')]=_0x27a8bf[_0x5dd2('0x104')]['port'];_0x13bf01['secure']=_0x27a8bf['Smtp'][_0x5dd2('0x108')];}if(_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x109')]){_0x13bf01['auth']={'user':_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0xa1')],'pass':_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0x10a')]};}return respondWithRpcPromise(_0x5dd2('0x10b'),_0x5dd2('0x10c'),{'account':_0x13bf01,'message':{'from':util[_0x5dd2('0xf8')](_0x5dd2('0x10d'),_0x27a8bf['name'],_0x27a8bf[_0x5dd2('0xce')]||_0x27a8bf[_0x5dd2('0x104')][_0x5dd2('0xa1')]),'to':_0x2f6749['body'][_0x5dd2('0x10e')],'subject':_0x5dd2('0x10f'),'text':util[_0x5dd2('0xf8')](_0x5dd2('0x110'),_0x2f6749[_0x5dd2('0x39')]['mailTranscript']),'attachments':[{'path':_0x57bd4a}]}})[_0x5dd2('0x22')](function(){return _0x3be791;})[_0x5dd2('0x2a')](function(_0x47b58b){console[_0x5dd2('0x27')](_0x47b58b);});}else{return _0x3be791;}})[_0x5dd2('0x22')](respondWithStatusCode(_0x4c5b2e,0xc8))['catch'](handleError(_0x4c5b2e,null));};exports[_0x5dd2('0x111')]=function(_0x24f937,_0x3c3403,_0x5da91c){return db[_0x5dd2('0xd6')][_0x5dd2('0x71')]({'where':{'id':_0x24f937[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3c3403,null))[_0x5dd2('0x22')](function(_0x40afcc){if(_0x40afcc){return _0x40afcc[_0x5dd2('0x111')](_0x24f937[_0x5dd2('0x39')][_0x5dd2('0x112')],_[_0x5dd2('0x113')](_0x24f937[_0x5dd2('0x39')],[_0x5dd2('0x112'),'id'])||{});}})[_0x5dd2('0x22')](respondWithResult(_0x3c3403,null))[_0x5dd2('0x2a')](handleError(_0x3c3403,null));};exports[_0x5dd2('0x114')]=function(_0x2917a3,_0x12879a,_0x548792){var _0x52b1ec={'raw':![],'where':{}};var _0x2a7e97={};var _0x2ec2b3={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dd2('0xc8')]({'where':{'id':_0x2917a3[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x12879a,null))['then'](function(_0x49544c){if(_0x49544c){_0x2a7e97[_0x5dd2('0x50')]=_[_0x5dd2('0x52')](db[_0x5dd2('0xd6')]['rawAttributes']);_0x2a7e97[_0x5dd2('0x51')]=_[_0x5dd2('0x52')](_0x2917a3[_0x5dd2('0x51')]);_0x2a7e97[_0x5dd2('0x53')]=_['intersection'](_0x2a7e97['model'],_0x2a7e97['query']);_0x52b1ec[_0x5dd2('0x55')]=_['intersection'](_0x2a7e97['model'],qs[_0x5dd2('0x56')](_0x2917a3['query'][_0x5dd2('0x56')]));_0x52b1ec[_0x5dd2('0x55')]=_0x52b1ec[_0x5dd2('0x55')]['length']?_0x52b1ec[_0x5dd2('0x55')]:_0x2a7e97['model'];if(!_0x2917a3['query'][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x52b1ec[_0x5dd2('0x30')]=qs[_0x5dd2('0x30')](_0x2917a3[_0x5dd2('0x51')]['limit']);_0x52b1ec[_0x5dd2('0x2e')]=qs[_0x5dd2('0x2e')](_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x52b1ec[_0x5dd2('0x59')]=qs[_0x5dd2('0x5a')](_0x2917a3[_0x5dd2('0x51')]['sort']);_0x52b1ec[_0x5dd2('0x85')]=qs['filters'](_[_0x5dd2('0x5b')](_0x2917a3['query'],_0x2a7e97[_0x5dd2('0x53')]));_0x52b1ec[_0x5dd2('0x85')][_0x5dd2('0xbd')]=_0x49544c['id'];if(_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x92')]){_0x52b1ec[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x52b1ec[_0x5dd2('0x85')],{'$or':_[_0x5dd2('0x3d')](_0x52b1ec['attributes'],function(_0x2b8efe){var _0x50bb6b={};_0x50bb6b[_0x2b8efe]={'$like':'%'+_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x92')]+'%'};return _0x50bb6b;})});}if(_0x2917a3[_0x5dd2('0x51')][_0x5dd2('0x8a')]){var _0x25d352=_0x2917a3[_0x5dd2('0x51')]['$gte'][_0x5dd2('0x41')](',');var _0xec3c15={};_0xec3c15[_0x25d352[0x0]]={'$gte':moment(_0x25d352[0x1])[_0x5dd2('0xf8')](_0x5dd2('0x115'))};_0x52b1ec[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x52b1ec[_0x5dd2('0x85')],_0xec3c15);}_0x52b1ec=_[_0x5dd2('0x38')]({},_0x52b1ec,_0x2917a3[_0x5dd2('0x116')]);return db[_0x5dd2('0xd6')][_0x5dd2('0x31')]({'where':_0x52b1ec[_0x5dd2('0x85')]})['then'](function(_0x590f8e){_0x2ec2b3[_0x5dd2('0x31')]=_0x590f8e;if(_0x2917a3[_0x5dd2('0x51')]['includeAll']){_0x52b1ec['include']=[{'all':!![]}];}return db[_0x5dd2('0xd6')]['findAll'](_0x52b1ec);})[_0x5dd2('0x22')](function(_0x440924){_0x2ec2b3[_0x5dd2('0xc0')]=_0x440924;return _0x2ec2b3;});}})['then'](respondWithFilteredResult(_0x12879a,_0x52b1ec))[_0x5dd2('0x2a')](handleError(_0x12879a,null));};exports[_0x5dd2('0x117')]=function(_0x3a3633,_0x12f6ec,_0x52c8b1){var _0x14914b={'where':{}},_0x5d6514={},_0x393065={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5dd2('0xc8')]({'where':{'id':_0x3a3633[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x12f6ec,null))[_0x5dd2('0x22')](function(_0xf869b9){if(_0xf869b9){_0x5d6514['model']=_['keys'](db[_0x5dd2('0xd6')]['rawAttributes']);_0x5d6514['query']=_[_0x5dd2('0x52')](_0x3a3633[_0x5dd2('0x51')]);_0x5d6514[_0x5dd2('0x53')]=_[_0x5dd2('0x54')](_0x5d6514[_0x5dd2('0x50')],_0x5d6514['query']);_0x14914b[_0x5dd2('0x55')]=_[_0x5dd2('0x54')](_0x5d6514[_0x5dd2('0x50')],qs[_0x5dd2('0x56')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x56')]));_0x14914b[_0x5dd2('0x55')]=_0x14914b[_0x5dd2('0x55')]['length']?_0x14914b['attributes']:_0x5d6514[_0x5dd2('0x50')];if(!_0x3a3633['query'][_0x5dd2('0x57')](_0x5dd2('0x58'))){_0x14914b[_0x5dd2('0x30')]=qs['limit'](_0x3a3633[_0x5dd2('0x51')]['limit']);_0x14914b['offset']=qs[_0x5dd2('0x2e')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x2e')]);}_0x14914b['order']=qs[_0x5dd2('0x5a')](_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x5a')]);_0x14914b[_0x5dd2('0x85')]=qs[_0x5dd2('0x53')](_[_0x5dd2('0x5b')](_0x3a3633[_0x5dd2('0x51')],_0x5d6514[_0x5dd2('0x53')]));_0x14914b[_0x5dd2('0x85')][_0x5dd2('0xbd')]=_0xf869b9['id'];if(_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x92')]){_0x14914b[_0x5dd2('0x85')]=_[_0x5dd2('0x38')](_0x14914b['where'],{'$or':_[_0x5dd2('0x3d')](_0x14914b[_0x5dd2('0x55')],function(_0x46d372){var _0x5d4ff6={};_0x5d4ff6[_0x46d372]={'$like':'%'+_0x3a3633[_0x5dd2('0x51')][_0x5dd2('0x92')]+'%'};return _0x5d4ff6;})});}_0x14914b[_0x5dd2('0x85')]['secret']=![];if(_0x3a3633[_0x5dd2('0x51')]['id']){_0x14914b['where']['id']={'$gt':_0x3a3633[_0x5dd2('0x51')]['id']};}_0x14914b=_[_0x5dd2('0x38')]({},_0x14914b,_0x3a3633[_0x5dd2('0x116')]);return db[_0x5dd2('0xd6')][_0x5dd2('0x31')]({'where':_0x14914b['where']})[_0x5dd2('0x22')](function(_0x750e94){_0x393065[_0x5dd2('0x31')]=_0x750e94;_0x14914b[_0x5dd2('0xc4')]=[];if(_0x3a3633['query'][_0x5dd2('0x118')]){_0x14914b['include'][_0x5dd2('0xbe')]({'model':db['User'],'as':_0x5dd2('0xf3'),'attributes':['id',_0x5dd2('0x3e'),_0x5dd2('0xfd')]});}if(_0x3a3633['query'][_0x5dd2('0xc3')]){_0x14914b['include']=[{'all':!![]}];}return db[_0x5dd2('0xd6')][_0x5dd2('0x119')](_0x14914b);})[_0x5dd2('0x22')](function(_0x1d8ee4){_0x393065[_0x5dd2('0xc0')]=_0x1d8ee4;return _0x393065;});}})[_0x5dd2('0x22')](respondWithFilteredResult(_0x12f6ec,_0x14914b))['catch'](handleError(_0x12f6ec,null));};exports[_0x5dd2('0x11a')]=function(_0x2acb5d,_0x3c306c,_0x3c1864){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2acb5d[_0x5dd2('0xc2')]['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x3c306c,null))[_0x5dd2('0x22')](function(_0x3520b9){if(_0x3520b9){return _0x3520b9[_0x5dd2('0x11b')](_0x2acb5d['body']['ids'],_[_0x5dd2('0x113')](_0x2acb5d[_0x5dd2('0x39')],[_0x5dd2('0x112'),'id'])||{})[_0x5dd2('0x11c')](function(){return db[_0x5dd2('0x7c')][_0x5dd2('0x119')]({'attributes':['id',_0x5dd2('0x36'),_0x5dd2('0x5e')],'where':{'id':_0x2acb5d[_0x5dd2('0x39')][_0x5dd2('0x112')]}});})[_0x5dd2('0x22')](function(_0x5e4a53){socket[_0x5dd2('0x11d')]('chatInteractionTags:save',{'id':Number(_0x2acb5d['params']['id']),'tags':_0x5e4a53||[]});return{'id':Number(_0x2acb5d['params']['id']),'tags':_0x5e4a53||[]};});}})['then'](respondWithResult(_0x3c306c,null))['catch'](handleError(_0x3c306c,null));};exports['removeTags']=function(_0x2c64b4,_0x563b70,_0x1f62d4){return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x2c64b4['params']['id']}})[_0x5dd2('0x22')](handleEntityNotFound(_0x563b70,null))[_0x5dd2('0x22')](function(_0x5bf732){if(_0x5bf732){return _0x5bf732[_0x5dd2('0x11e')](_0x2c64b4['query'][_0x5dd2('0x112')]);}})[_0x5dd2('0x22')](respondWithStatusCode(_0x563b70,null))[_0x5dd2('0x2a')](handleError(_0x563b70,null));};exports[_0x5dd2('0xee')]=function(_0x296593,_0x42ffe8){var _0x49a7fe=moment()[_0x5dd2('0x11f')]()[_0x5dd2('0xa7')]();var _0x3c80b1=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),_0x5dd2('0x121'),_0x5dd2('0x122'));var _0xde7b58=path[_0x5dd2('0xea')](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),'files',_0x5dd2('0x123'));var _0x214f31=path['join'](_0x3c80b1,_0x49a7fe);var _0x5e3baa=util[_0x5dd2('0xf8')](_0x5dd2('0x124'),_0x296593[_0x5dd2('0xc2')]['id'],_0x49a7fe);var _0x329b77=path['join'](_0x3c80b1,_0x5e3baa);var _0x58149d=[];_0x58149d[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0xf3'),'attributes':['id',_0x5dd2('0x3e')],'raw':!![]});_0x58149d[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf4')],'as':_0x5dd2('0x75'),'attributes':['id',_0x5dd2('0x125'),_0x5dd2('0x126')],'raw':!![]});if(_0x296593['query'][_0x5dd2('0x123')]){_0x58149d['push']({'model':db[_0x5dd2('0xe8')],'as':'Attachment','raw':!![]});}var _0x1b6456=[{'model':db[_0x5dd2('0xd6')],'as':_0x5dd2('0xf5'),'attributes':['id',_0x5dd2('0x39'),_0x5dd2('0x88'),_0x5dd2('0x100'),'secret','read'],'include':_0x58149d}];_0x1b6456[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xc9')],'as':'Account','attributes':['id',_0x5dd2('0x36')]});_0x1b6456[_0x5dd2('0xbe')]({'model':db[_0x5dd2('0xf3')],'as':_0x5dd2('0x127'),'attributes':['id',_0x5dd2('0x3e')]});return db[_0x5dd2('0x4c')][_0x5dd2('0x71')]({'where':{'id':_0x296593[_0x5dd2('0xc2')]['id']},'include':_0x1b6456})[_0x5dd2('0x22')](handleEntityNotFound(_0x42ffe8,null))[_0x5dd2('0x22')](function(_0x5dd43f){if(_0x5dd43f){var _0x3adb02=_0x5dd43f['get']({'plain':!![]});fs[_0x5dd2('0x128')](_0x214f31);var _0x5ee73d={'channel':_0x5dd2('0x129'),'account':_0x3adb02[_0x5dd2('0x12a')]['name'],'agent':_0x3adb02['Owner']?_0x3adb02['Owner'][_0x5dd2('0x3e')]:'N.A.','createdAt':moment(_0x3adb02['createdAt'])['format'](_0x5dd2('0x115'))[_0x5dd2('0xa7')](),'closedAt':_0x3adb02[_0x5dd2('0x48')]?moment(_0x3adb02[_0x5dd2('0x12b')])[_0x5dd2('0xf8')](_0x5dd2('0x115'))['toString']():'','disposition':_0x3adb02['disposition'],'chatInfo':{'browser':_0x3adb02[_0x5dd2('0x12c')],'os':_0x3adb02[_0x5dd2('0x12d')],'referer':_0x3adb02['referer'],'customerIp':_0x3adb02[_0x5dd2('0x12e')],'customerPort':_0x3adb02[_0x5dd2('0x12f')]?_0x3adb02['customerPort']:'N.A.'},'messages':_(_0x3adb02[_0x5dd2('0xf5')])[_0x5dd2('0x130')]()[_0x5dd2('0x92')]({'secret':![]})[_0x5dd2('0x3d')](function(_0x4ba4cd){if(_0x4ba4cd[_0x5dd2('0xe8')]){var _0x4d2d3f=path[_0x5dd2('0xea')](_0xde7b58,_0x4ba4cd[_0x5dd2('0xe8')]['basename']);if(fs[_0x5dd2('0x131')](_0x4d2d3f)){fs[_0x5dd2('0x132')](_0x4d2d3f)[_0x5dd2('0x133')](fs['createWriteStream'](path['join'](_0x214f31,_0x4ba4cd['Attachment']['basename'])));}}return{'date':moment(_0x4ba4cd[_0x5dd2('0x88')])[_0x5dd2('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5dd2('0xa7')](),'sender':_0x4ba4cd[_0x5dd2('0x100')]==='out'?_0x4ba4cd[_0x5dd2('0xf3')]?_0x4ba4cd[_0x5dd2('0xf3')]['fullname']:_0x5dd2('0xf7'):_0x4ba4cd[_0x5dd2('0x75')]['firstName']+(_0x4ba4cd[_0x5dd2('0x75')]['lastName']?'\x20'+_0x4ba4cd['Contact']['lastName']:''),'body':_0x4ba4cd[_0x5dd2('0xe8')]?_0x4ba4cd[_0x5dd2('0xe8')][_0x5dd2('0xe4')]:_0x4ba4cd[_0x5dd2('0x39')],'direction':_0x4ba4cd[_0x5dd2('0x100')]===_0x5dd2('0xd5')?'A':'C','secret':_0x4ba4cd[_0x5dd2('0x101')],'read':_0x4ba4cd[_0x5dd2('0x8f')],'attachment':_0x4ba4cd[_0x5dd2('0xe8')]};})[_0x5dd2('0x73')]()};return ejs[_0x5dd2('0x134')](path['join'](config[_0x5dd2('0xeb')],_0x5dd2('0x120'),'views',_0x5dd2('0x135')),{'interaction':_0x5ee73d})[_0x5dd2('0x22')](function(_0x442117){var _0x4b5a4d=path[_0x5dd2('0xea')](_0x214f31,_0x5dd2('0x136')+_0x3adb02['id']+'-'+_0x49a7fe+_0x5dd2('0x137'));var _0x4dc376={'path':_0x4b5a4d,'channel':_0x5dd2('0x129'),'interactionId':_0x3adb02['id']};return pdf[_0x5dd2('0x138')](_0x442117,_0x4dc376);})[_0x5dd2('0x22')](function(){return new BPromise(function(_0x2b011b,_0xcc8314){zipdir(_0x214f31,{'saveTo':_0x329b77},function(_0xadd498,_0x406d2a){if(_0xadd498)return _0xcc8314(_0xadd498);return _0x2b011b(_0x406d2a);});})[_0x5dd2('0x22')](function(){return new BPromise(function(_0x479e35,_0x2ae2de){rimraf(_0x214f31,function(_0x9ae52e){if(_0x9ae52e)_0x2ae2de(_0x9ae52e);return _0x479e35();});});})[_0x5dd2('0x22')](function(){return _0x42ffe8[_0x5dd2('0xee')](_0x329b77,_0x5e3baa,function(_0x2505a7){if(_0x2505a7){console[_0x5dd2('0x139')](_0x5dd2('0x13a'),_0x2505a7);}else{fs[_0x5dd2('0x13b')](_0x329b77);}});});});}else{return _0x42ffe8['sendStatus'](0xc8);}})[_0x5dd2('0x2a')](handleError(_0x42ffe8,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 927a395..ecacff4 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 _0x24b4=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','remove','map','then','setDataValue','emit','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x24b4,0xb9));var _0x424b=function(_0x2f69f0,_0x143ea2){_0x2f69f0=_0x2f69f0-0x0;var _0x4317bd=_0x24b4[_0x2f69f0];return _0x4317bd;};'use strict';var EventEmitter=require(_0x424b('0x0'));var ChatInteraction=require(_0x424b('0x1'))['db'][_0x424b('0x2')];var ChatMessage=require(_0x424b('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x424b('0x3')](0x0);var events={'afterCreate':_0x424b('0x4'),'afterUpdate':'update','afterDestroy':_0x424b('0x5')};function emitEvent(_0x2c5503){return function(_0x2c9a1c,_0x15ed6d,_0xed75a5){_0x2c9a1c['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x32a1bc){_0x2c9a1c['setDataValue']('Users',_0x32a1bc[_0x424b('0x6')](function(_0x14ecc5){return{'id':_0x14ecc5['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2c9a1c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x424b('0x7')](function(_0x3b07ff){_0x2c9a1c[_0x424b('0x8')]('unreadMessages',_0x3b07ff['length']);ChatInteractionEvents[_0x424b('0x9')](_0x2c5503+':'+_0x2c9a1c['id'],_0x2c9a1c);ChatInteractionEvents['emit'](_0x2c5503,_0x2c9a1c);_0xed75a5(null);})[_0x424b('0xa')](_0xed75a5(null));};}for(var e in events){if(events[_0x424b('0xb')](e)){var event=events[e];ChatInteraction[_0x424b('0xc')](e,emitEvent(event));}}module[_0x424b('0xd')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xffcd=['then','setDataValue','Users','map','findAll','unreadMessages','emit','hook','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3cb004,_0x25d5d1){var _0x343ec2=function(_0xb9ac0e){while(--_0xb9ac0e){_0x3cb004['push'](_0x3cb004['shift']());}};_0x343ec2(++_0x25d5d1);}(_0xffcd,0x138));var _0xdffc=function(_0x1d0ad7,_0x440ad3){_0x1d0ad7=_0x1d0ad7-0x0;var _0x21425d=_0xffcd[_0x1d0ad7];return _0x21425d;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xdffc('0x0'))['db'][_0xdffc('0x1')];var ChatMessage=require(_0xdffc('0x0'))['db'][_0xdffc('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdffc('0x3')](0x0);var events={'afterCreate':_0xdffc('0x4'),'afterUpdate':_0xdffc('0x5'),'afterDestroy':_0xdffc('0x6')};function emitEvent(_0x5677e8){return function(_0x12ecd0,_0x44bef5,_0x18e814){_0x12ecd0[_0xdffc('0x7')]({'attributes':['id'],'raw':!![]})[_0xdffc('0x8')](function(_0x555665){_0x12ecd0[_0xdffc('0x9')](_0xdffc('0xa'),_0x555665[_0xdffc('0xb')](function(_0xa549c7){return{'id':_0xa549c7['id']};}));return ChatMessage[_0xdffc('0xc')]({'where':{'ChatInteractionId':_0x12ecd0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdffc('0x8')](function(_0x5c8347){_0x12ecd0['setDataValue'](_0xdffc('0xd'),_0x5c8347['length']);ChatInteractionEvents[_0xdffc('0xe')](_0x5677e8+':'+_0x12ecd0['id'],_0x12ecd0);ChatInteractionEvents[_0xdffc('0xe')](_0x5677e8,_0x12ecd0);_0x18e814(null);})['catch'](_0x18e814(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdffc('0xf')](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 8ea5e8b..735e34f 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 _0xa430=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x41b626,_0x2e1659){var _0x4ec324=function(_0x7d48f6){while(--_0x7d48f6){_0x41b626['push'](_0x41b626['shift']());}};_0x4ec324(++_0x2e1659);}(_0xa430,0x1d6));var _0x0a43=function(_0x2a4c5f,_0x808752){_0x2a4c5f=_0x2a4c5f-0x0;var _0x508e16=_0xa430[_0x2a4c5f];return _0x508e16;};'use strict';var _=require(_0x0a43('0x0'));var util=require(_0x0a43('0x1'));var logger=require(_0x0a43('0x2'))('api');var moment=require(_0x0a43('0x3'));var BPromise=require(_0x0a43('0x4'));var rp=require(_0x0a43('0x5'));var fs=require('fs');var path=require(_0x0a43('0x6'));var rimraf=require(_0x0a43('0x7'));var config=require(_0x0a43('0x8'));var attributes=require(_0x0a43('0x9'));module[_0x0a43('0xa')]=function(_0x5147b3,_0x1aefd1){return _0x5147b3[_0x0a43('0xb')](_0x0a43('0xc'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x280f7a,_0x2cf8e0,_0x235f56){if(_0x280f7a[_0x0a43('0xd')](_0x0a43('0xe'))){_0x280f7a[_0x0a43('0xf')]=moment()[_0x0a43('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x235f56(null,_0x280f7a);}},'charset':_0x0a43('0x11'),'collate':_0x0a43('0x12')});};
\ No newline at end of file
+var _0x24ea=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x24ea,0x99));var _0xa24e=function(_0x341cbf,_0x52be4a){_0x341cbf=_0x341cbf-0x0;var _0x3ebf74=_0x24ea[_0x341cbf];return _0x3ebf74;};'use strict';var _=require(_0xa24e('0x0'));var util=require(_0xa24e('0x1'));var logger=require(_0xa24e('0x2'))(_0xa24e('0x3'));var moment=require(_0xa24e('0x4'));var BPromise=require(_0xa24e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa24e('0x6'));var rimraf=require(_0xa24e('0x7'));var config=require(_0xa24e('0x8'));var attributes=require(_0xa24e('0x9'));module[_0xa24e('0xa')]=function(_0x6f4b70,_0x9bfe6b){return _0x6f4b70[_0xa24e('0xb')](_0xa24e('0xc'),attributes,{'tableName':_0xa24e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39392c,_0x74a671,_0x31f826){if(_0x39392c[_0xa24e('0xe')](_0xa24e('0xf'))){_0x39392c[_0xa24e('0x10')]=moment()[_0xa24e('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31f826(null,_0x39392c);}},'charset':_0xa24e('0x12'),'collate':_0xa24e('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index f97505a..cff61d4 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 _0xd613=['message','info','result','UpdateChatInteraction','update','body','options','raw','where','attributes','limit','then','debug','stringify','catch','AddTagsToChatInteraction','ChatInteraction','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4aba0e,_0x3cca89){var _0x240301=function(_0x376410){while(--_0x376410){_0x4aba0e['push'](_0x4aba0e['shift']());}};_0x240301(++_0x3cca89);}(_0xd613,0x112));var _0x3d61=function(_0x4dbbef,_0xd6961d){_0x4dbbef=_0x4dbbef-0x0;var _0x4e0602=_0xd613[_0x4dbbef];return _0x4e0602;};'use strict';var _=require(_0x3d61('0x0'));var util=require(_0x3d61('0x1'));var moment=require('moment');var BPromise=require(_0x3d61('0x2'));var rs=require(_0x3d61('0x3'));var fs=require('fs');var Redis=require(_0x3d61('0x4'));var db=require(_0x3d61('0x5'))['db'];var utils=require(_0x3d61('0x6'));var logger=require('../../config/logger')(_0x3d61('0x7'));var config=require(_0x3d61('0x8'));var jayson=require(_0x3d61('0x9'));var client=jayson[_0x3d61('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x3d61('0xb')],{'host':_0x3d61('0xc'),'port':0x18eb});var socket=require(_0x3d61('0xd'))(new Redis(config[_0x3d61('0xb')]));require(_0x3d61('0xe'))['register'](socket);function respondWithRpcPromise(_0x1bcf66,_0x490bb1,_0x4553e0){return new BPromise(function(_0x4de632,_0x54444a){return client['request'](_0x1bcf66,_0x4553e0)['then'](function(_0x3c2a7c){logger['info'](_0x3d61('0xf'),_0x490bb1,'request\x20sent');logger['debug'](_0x3d61('0x10'),_0x490bb1,_0x3d61('0x11'),JSON['stringify'](_0x3c2a7c));if(_0x3c2a7c[_0x3d61('0x12')]){if(_0x3c2a7c['error'][_0x3d61('0x13')]===0x1f4){logger[_0x3d61('0x12')](_0x3d61('0xf'),_0x490bb1,_0x3c2a7c['error']['message']);return _0x54444a(_0x3c2a7c[_0x3d61('0x12')][_0x3d61('0x14')]);}logger['error'](_0x3d61('0xf'),_0x490bb1,_0x3c2a7c[_0x3d61('0x12')][_0x3d61('0x14')]);return _0x4de632(_0x3c2a7c[_0x3d61('0x12')][_0x3d61('0x14')]);}else{logger[_0x3d61('0x15')](_0x3d61('0xf'),_0x490bb1,_0x3d61('0x11'));_0x4de632(_0x3c2a7c[_0x3d61('0x16')]['message']);}})['catch'](function(_0x5181cc){logger['error'](_0x3d61('0xf'),_0x490bb1,_0x5181cc);_0x54444a(_0x5181cc);});});}exports[_0x3d61('0x17')]=function(_0x5a641c){var _0x556e30=this;return new Promise(function(_0x1a536e,_0x227b74){return db['ChatInteraction'][_0x3d61('0x18')](_0x5a641c[_0x3d61('0x19')],{'raw':_0x5a641c[_0x3d61('0x1a')]?_0x5a641c[_0x3d61('0x1a')][_0x3d61('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a641c[_0x3d61('0x1a')]?_0x5a641c[_0x3d61('0x1a')][_0x3d61('0x1c')]||null:null,'attributes':_0x5a641c[_0x3d61('0x1a')]?_0x5a641c[_0x3d61('0x1a')][_0x3d61('0x1d')]||null:null,'limit':_0x5a641c[_0x3d61('0x1a')]?_0x5a641c['options'][_0x3d61('0x1e')]||null:null})[_0x3d61('0x1f')](function(_0x5a712e){logger[_0x3d61('0x15')]('UpdateChatInteraction',_0x5a641c);logger[_0x3d61('0x20')](_0x3d61('0x17'),_0x5a641c,JSON[_0x3d61('0x21')](_0x5a712e));_0x1a536e(_0x5a712e);})[_0x3d61('0x22')](function(_0x4abb4c){logger[_0x3d61('0x12')](_0x3d61('0x17'),_0x4abb4c[_0x3d61('0x14')],_0x5a641c);_0x227b74(_0x556e30['error'](0x1f4,_0x4abb4c[_0x3d61('0x14')]));});});};exports[_0x3d61('0x23')]=function(_0x43d9c6){return new Promise(function(_0x49060e,_0x4a4128){return db[_0x3d61('0x24')]['find']({'where':_0x43d9c6['options']?_0x43d9c6[_0x3d61('0x1a')][_0x3d61('0x1c')]||null:null})['then'](function(_0x4d7b8d){if(_0x4d7b8d){return _0x4d7b8d[_0x3d61('0x25')](_0x43d9c6[_0x3d61('0x19')]['ids'],_[_0x3d61('0x26')](_0x43d9c6[_0x3d61('0x19')],[_0x3d61('0x27'),'id'])||{});}})[_0x3d61('0x28')](function(_0x1593ea){logger['info']('AddTags',_0x43d9c6);logger[_0x3d61('0x20')](_0x3d61('0x29'),_0x43d9c6,JSON[_0x3d61('0x21')](_0x1593ea));_0x49060e(_0x1593ea);})[_0x3d61('0x22')](function(_0x107eaf){logger['error'](_0x3d61('0x29'),_0x107eaf[_0x3d61('0x14')],_0x43d9c6);_0x4a4128(_this[_0x3d61('0x12')](0x1f4,_0x107eaf[_0x3d61('0x14')]));});});};
\ No newline at end of file
+var _0x1109=['request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','body','options','raw','where','attributes','then','UpdateChatInteraction','debug','AddTagsToChatInteraction','ChatInteraction','addTags','ids','AddTags','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x8276f3,_0x21ad5a){var _0x5330a8=function(_0x29c418){while(--_0x29c418){_0x8276f3['push'](_0x8276f3['shift']());}};_0x5330a8(++_0x21ad5a);}(_0x1109,0x140));var _0x9110=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x1109[_0x424357];return _0x29c68e;};'use strict';var _=require(_0x9110('0x0'));var util=require(_0x9110('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9110('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9110('0x3'));var logger=require(_0x9110('0x4'))(_0x9110('0x5'));var config=require(_0x9110('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9110('0x7')][_0x9110('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x9110('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x9110('0xa'))(new Redis(config[_0x9110('0x9')]));require(_0x9110('0xb'))[_0x9110('0xc')](socket);function respondWithRpcPromise(_0xeda9e2,_0x54ed1f,_0x229203){return new BPromise(function(_0x57925d,_0x4e53a7){return client[_0x9110('0xd')](_0xeda9e2,_0x229203)['then'](function(_0x1200ce){logger[_0x9110('0xe')](_0x9110('0xf'),_0x54ed1f,'request\x20sent');logger['debug'](_0x9110('0x10'),_0x54ed1f,'request\x20sent',JSON[_0x9110('0x11')](_0x1200ce));if(_0x1200ce['error']){if(_0x1200ce[_0x9110('0x12')][_0x9110('0x13')]===0x1f4){logger[_0x9110('0x12')](_0x9110('0xf'),_0x54ed1f,_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);return _0x4e53a7(_0x1200ce['error'][_0x9110('0x14')]);}logger[_0x9110('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x54ed1f,_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);return _0x57925d(_0x1200ce[_0x9110('0x12')][_0x9110('0x14')]);}else{logger[_0x9110('0xe')](_0x9110('0xf'),_0x54ed1f,_0x9110('0x15'));_0x57925d(_0x1200ce[_0x9110('0x16')][_0x9110('0x14')]);}})[_0x9110('0x17')](function(_0x356d1a){logger[_0x9110('0x12')](_0x9110('0xf'),_0x54ed1f,_0x356d1a);_0x4e53a7(_0x356d1a);});});}exports['UpdateChatInteraction']=function(_0x517551){var _0x992e95=this;return new Promise(function(_0x565247,_0x475449){return db['ChatInteraction']['update'](_0x517551[_0x9110('0x18')],{'raw':_0x517551['options']?_0x517551[_0x9110('0x19')][_0x9110('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x517551[_0x9110('0x19')]?_0x517551['options'][_0x9110('0x1b')]||null:null,'attributes':_0x517551['options']?_0x517551[_0x9110('0x19')][_0x9110('0x1c')]||null:null,'limit':_0x517551[_0x9110('0x19')]?_0x517551['options']['limit']||null:null})[_0x9110('0x1d')](function(_0x24476b){logger[_0x9110('0xe')](_0x9110('0x1e'),_0x517551);logger[_0x9110('0x1f')](_0x9110('0x1e'),_0x517551,JSON['stringify'](_0x24476b));_0x565247(_0x24476b);})[_0x9110('0x17')](function(_0x45376c){logger[_0x9110('0x12')](_0x9110('0x1e'),_0x45376c[_0x9110('0x14')],_0x517551);_0x475449(_0x992e95[_0x9110('0x12')](0x1f4,_0x45376c[_0x9110('0x14')]));});});};exports[_0x9110('0x20')]=function(_0x4fae06){return new Promise(function(_0x5f7adf,_0x1bb905){return db[_0x9110('0x21')]['find']({'where':_0x4fae06[_0x9110('0x19')]?_0x4fae06[_0x9110('0x19')]['where']||null:null})[_0x9110('0x1d')](function(_0x497f61){if(_0x497f61){return _0x497f61[_0x9110('0x22')](_0x4fae06['body']['ids'],_['omit'](_0x4fae06['body'],[_0x9110('0x23'),'id'])||{});}})['spread'](function(_0x5164c2){logger[_0x9110('0xe')](_0x9110('0x24'),_0x4fae06);logger[_0x9110('0x1f')](_0x9110('0x24'),_0x4fae06,JSON[_0x9110('0x11')](_0x5164c2));_0x5f7adf(_0x5164c2);})[_0x9110('0x17')](function(_0x5d99dd){logger[_0x9110('0x12')]('AddTags',_0x5d99dd[_0x9110('0x14')],_0x4fae06);_0x1bb905(_this[_0x9110('0x12')](0x1f4,_0x5d99dd[_0x9110('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index d740cbe..c329d26 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 _0xaf8f=['remove','update','emit','register'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xaf8f,0x104));var _0xfaf8=function(_0x1e3dee,_0x28dcff){_0x1e3dee=_0x1e3dee-0x0;var _0x3a743d=_0xaf8f[_0x1e3dee];return _0x3a743d;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xfaf8('0x0'),_0xfaf8('0x1')];function createListener(_0x311104,_0x1badb5){return function(_0x3f8f4b){_0x1badb5[_0xfaf8('0x2')](_0x311104,_0x3f8f4b);};}function removeListener(_0x4af539,_0x53f296){return function(){ChatInteractionEvents['removeListener'](_0x4af539,_0x53f296);};}exports[_0xfaf8('0x3')]=function(_0x8afbc6){for(var _0x17e017=0x0,_0x55d36e=events['length'];_0x17e017<_0x55d36e;_0x17e017++){var _0x462705=events[_0x17e017];var _0x4ba245=createListener('chatInteraction:'+_0x462705,_0x8afbc6);ChatInteractionEvents['on'](_0x462705,_0x4ba245);}};
\ No newline at end of file
+var _0x498a=['save','update','emit','register','./chatInteraction.events'];(function(_0x3b557a,_0x2decdc){var _0x53fdbb=function(_0x49b177){while(--_0x49b177){_0x3b557a['push'](_0x3b557a['shift']());}};_0x53fdbb(++_0x2decdc);}(_0x498a,0x1bc));var _0xa498=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x498a[_0x5b644e];return _0x49c6bf;};'use strict';var ChatInteractionEvents=require(_0xa498('0x0'));var events=[_0xa498('0x1'),'remove',_0xa498('0x2')];function createListener(_0x4e3bd6,_0x4c8a4c){return function(_0x3967e6){_0x4c8a4c[_0xa498('0x3')](_0x4e3bd6,_0x3967e6);};}function removeListener(_0x459775,_0x2adfef){return function(){ChatInteractionEvents['removeListener'](_0x459775,_0x2adfef);};}exports[_0xa498('0x4')]=function(_0x4a8acb){for(var _0x7d2d8b=0x0,_0x346d01=events['length'];_0x7d2d8b<_0x346d01;_0x7d2d8b++){var _0xe38dd=events[_0x7d2d8b];var _0x703b=createListener('chatInteraction:'+_0xe38dd,_0x4a8acb);ChatInteractionEvents['on'](_0xe38dd,_0x703b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 100e498..9dacbfa 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 _0xe4e3=['fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1d3a5a,_0x21277d){var _0x2632e4=function(_0x48658e){while(--_0x48658e){_0x1d3a5a['push'](_0x1d3a5a['shift']());}};_0x2632e4(++_0x21277d);}(_0xe4e3,0x6e));var _0x3e4e=function(_0x19ff08,_0x595454){_0x19ff08=_0x19ff08-0x0;var _0x1a0f1c=_0xe4e3[_0x19ff08];return _0x1a0f1c;};'use strict';var multer=require(_0x3e4e('0x0'));var util=require(_0x3e4e('0x1'));var path=require(_0x3e4e('0x2'));var timeout=require(_0x3e4e('0x3'));var express=require(_0x3e4e('0x4'));var router=express[_0x3e4e('0x5')]();var fs_extra=require(_0x3e4e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3e4e('0x7'));var config=require(_0x3e4e('0x8'));var controller=require(_0x3e4e('0x9'));router[_0x3e4e('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e4e('0xb')]);router[_0x3e4e('0xa')](_0x3e4e('0xc'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0xe')]);router[_0x3e4e('0xa')](_0x3e4e('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x3e4e('0x10')]);router['get'](_0x3e4e('0x11'),auth[_0x3e4e('0x12')](),controller[_0x3e4e('0x13')]);router[_0x3e4e('0xa')](_0x3e4e('0x14'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x15')]);router[_0x3e4e('0xa')]('/:id/my_messages',auth[_0x3e4e('0x12')](),controller[_0x3e4e('0x16')]);router[_0x3e4e('0xa')](_0x3e4e('0x17'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x18')]);router[_0x3e4e('0x19')]('/',auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x1a')]);router['post'](_0x3e4e('0x1b'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x1c')]);var upload=multer({'storage':multer[_0x3e4e('0x1d')]({'destination':function(_0xd8c6ce,_0x2c9b59,_0x34e22e){_0x34e22e(null,path[_0x3e4e('0x1e')](config[_0x3e4e('0x1f')],_0x3e4e('0x20')));},'filename':function(_0x546ba9,_0x469aa5,_0x2615f8){_0x2615f8(null,util[_0x3e4e('0x21')]('%s-%s',Date[_0x3e4e('0x22')](),_0x469aa5[_0x3e4e('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3e4e('0x19')](_0x3e4e('0x24'),upload[_0x3e4e('0x25')](_0x3e4e('0x26')),controller[_0x3e4e('0x27')]);router[_0x3e4e('0x19')](_0x3e4e('0x14'),auth[_0x3e4e('0x12')](),controller[_0x3e4e('0x28')]);router[_0x3e4e('0x19')](_0x3e4e('0x29'),auth[_0x3e4e('0xd')](),interaction['tracked'](_0x3e4e('0x2a'),_0x3e4e('0x2b')),controller[_0x3e4e('0x2c')]);router[_0x3e4e('0x2d')]('/:id',auth[_0x3e4e('0xd')](),interaction[_0x3e4e('0x2e')](_0x3e4e('0x2a'),'chatinteraction:update'),controller[_0x3e4e('0x2f')]);router[_0x3e4e('0x2d')](_0x3e4e('0x30'),controller[_0x3e4e('0x31')]);router[_0x3e4e('0x2d')](_0x3e4e('0x32'),auth[_0x3e4e('0x12')](),controller[_0x3e4e('0x33')]);router[_0x3e4e('0x2d')](_0x3e4e('0x34'),controller['close']);router[_0x3e4e('0x35')](_0x3e4e('0xf'),auth['isAuthenticated'](),interaction[_0x3e4e('0x2e')](_0x3e4e('0x2a'),_0x3e4e('0x36')),controller[_0x3e4e('0x37')]);router[_0x3e4e('0x35')](_0x3e4e('0x29'),auth[_0x3e4e('0xd')](),controller[_0x3e4e('0x38')]);module[_0x3e4e('0x39')]=router;
\ No newline at end of file
+var _0xc815=['file','attachmentUpload','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','/:id/attachment_upload','single'];(function(_0x360f8e,_0x1c2b20){var _0x23589e=function(_0x2c0a71){while(--_0x2c0a71){_0x360f8e['push'](_0x360f8e['shift']());}};_0x23589e(++_0x1c2b20);}(_0xc815,0x1a7));var _0x5c81=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xc815[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0x5c81('0x0'));var util=require(_0x5c81('0x1'));var path=require('path');var timeout=require(_0x5c81('0x2'));var express=require(_0x5c81('0x3'));var router=express[_0x5c81('0x4')]();var fs_extra=require(_0x5c81('0x5'));var auth=require(_0x5c81('0x6'));var interaction=require(_0x5c81('0x7'));var config=require(_0x5c81('0x8'));var controller=require(_0x5c81('0x9'));router[_0x5c81('0xa')]('/',auth[_0x5c81('0xb')](),controller['index']);router['get'](_0x5c81('0xc'),auth[_0x5c81('0xb')](),controller[_0x5c81('0xd')]);router['get'](_0x5c81('0xe'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x10')]);router[_0x5c81('0xa')](_0x5c81('0x11'),auth[_0x5c81('0xf')](),controller['attachmentDownload']);router[_0x5c81('0xa')](_0x5c81('0x12'),auth[_0x5c81('0xb')](),controller['getMessages']);router[_0x5c81('0xa')](_0x5c81('0x13'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x14')]);router[_0x5c81('0xa')](_0x5c81('0x15'),auth[_0x5c81('0xb')](),controller[_0x5c81('0x16')]);router[_0x5c81('0x17')]('/',auth[_0x5c81('0xb')](),controller[_0x5c81('0x18')]);router[_0x5c81('0x17')](_0x5c81('0x19'),auth[_0x5c81('0xb')](),controller[_0x5c81('0x1a')]);var upload=multer({'storage':multer[_0x5c81('0x1b')]({'destination':function(_0x4355fd,_0x228247,_0xc8dfdb){_0xc8dfdb(null,path[_0x5c81('0x1c')](config[_0x5c81('0x1d')],_0x5c81('0x1e')));},'filename':function(_0x3c0242,_0x583391,_0x4baafc){_0x4baafc(null,util[_0x5c81('0x1f')](_0x5c81('0x20'),Date[_0x5c81('0x21')](),_0x583391['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5c81('0x17')](_0x5c81('0x22'),upload[_0x5c81('0x23')](_0x5c81('0x24')),controller[_0x5c81('0x25')]);router['post'](_0x5c81('0x12'),auth[_0x5c81('0xf')](),controller['addMessage']);router[_0x5c81('0x17')]('/:id/tags',auth[_0x5c81('0xb')](),interaction[_0x5c81('0x26')](_0x5c81('0x27'),_0x5c81('0x28')),controller['addTags']);router[_0x5c81('0x29')](_0x5c81('0xe'),auth[_0x5c81('0xb')](),interaction['tracked'](_0x5c81('0x27'),_0x5c81('0x2a')),controller['update']);router[_0x5c81('0x29')]('/:id/custom_update',controller['customUpdate']);router[_0x5c81('0x29')](_0x5c81('0x2b'),auth[_0x5c81('0xf')](),controller[_0x5c81('0x2c')]);router['put'](_0x5c81('0x2d'),controller[_0x5c81('0x2e')]);router[_0x5c81('0x2f')](_0x5c81('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x5c81('0x27'),_0x5c81('0x30')),controller[_0x5c81('0x31')]);router[_0x5c81('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0x5c81('0x32')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index db90d85..36769ac 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 _0x5c48=['sequelize','exports','TEXT','BOOLEAN','INTEGER'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x5c48,0x82));var _0x85c4=function(_0x4d0c8a,_0x8cccb5){_0x4d0c8a=_0x4d0c8a-0x0;var _0x3e756d=_0x5c48[_0x4d0c8a];return _0x3e756d;};'use strict';var Sequelize=require(_0x85c4('0x0'));module[_0x85c4('0x1')]={'body':{'type':Sequelize[_0x85c4('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x85c4('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x85c4('0x4')]}};
\ No newline at end of file
+var _0x6f59=['TEXT','sequelize','exports'];(function(_0x392c8d,_0x4f947a){var _0x53adda=function(_0x1a55fa){while(--_0x1a55fa){_0x392c8d['push'](_0x392c8d['shift']());}};_0x53adda(++_0x4f947a);}(_0x6f59,0x145));var _0x96f5=function(_0x16585a,_0x5b0829){_0x16585a=_0x16585a-0x0;var _0x447482=_0x6f59[_0x16585a];return _0x447482;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 48e02e3..b0f7d01 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 _0xbe35=['describe','get','messages','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','sort','-online','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','findAll','isEmpty','resourceId','push','ToId','read','all','request-promise','moment','bluebird','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','ChatInternalMessage','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','destroy'];(function(_0x390fef,_0x420500){var _0x5ebfe8=function(_0x3237b6){while(--_0x3237b6){_0x390fef['push'](_0x390fef['shift']());}};_0x5ebfe8(++_0x420500);}(_0xbe35,0xf1));var _0x5be3=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xbe35[_0x5cb1af];return _0x8d7940;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5be3('0x0'));var moment=require(_0x5be3('0x1'));var BPromise=require(_0x5be3('0x2'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5be3('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5be3('0x4'));var squel=require('squel');var crypto=require(_0x5be3('0x5'));var jsforce=require(_0x5be3('0x6'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5be3('0x7'));var Papa=require(_0x5be3('0x8'));var Redis=require(_0x5be3('0x9'));var authService=require(_0x5be3('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x5be3('0xb'));var hardwareService=require(_0x5be3('0xc'));var logger=require('../../config/logger')(_0x5be3('0xd'));var utils=require(_0x5be3('0xe'));var config=require(_0x5be3('0xf'));var licenseUtil=require(_0x5be3('0x10'));var db=require(_0x5be3('0x11'))['db'];config[_0x5be3('0x12')]=_['defaults'](config[_0x5be3('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5be3('0x12')]));require(_0x5be3('0x13'))[_0x5be3('0x14')](socket);function respondWithStatusCode(_0x238f7b,_0x58f164){_0x58f164=_0x58f164||0xcc;return function(_0x17576e){if(_0x17576e){return _0x238f7b[_0x5be3('0x15')](_0x58f164);}return _0x238f7b[_0x5be3('0x16')](_0x58f164)[_0x5be3('0x17')]();};}function respondWithResult(_0x28cf2e,_0x3f123a){_0x3f123a=_0x3f123a||0xc8;return function(_0x40ced0){if(_0x40ced0){return _0x28cf2e[_0x5be3('0x16')](_0x3f123a)[_0x5be3('0x18')](_0x40ced0);}};}function respondWithFilteredResult(_0x33d397,_0x4985bb){return function(_0x376156){if(_0x376156){var _0x1d1522=typeof _0x4985bb[_0x5be3('0x19')]===_0x5be3('0x1a')&&typeof _0x4985bb[_0x5be3('0x1b')]==='undefined';var _0xfbf28e=_0x376156[_0x5be3('0x1c')];var _0x2d67a2=_0x1d1522?0x0:_0x4985bb[_0x5be3('0x19')];var _0x56fa76=_0x1d1522?_0x376156['count']:_0x4985bb['offset']+_0x4985bb[_0x5be3('0x1b')];var _0x548eff;if(_0x56fa76>=_0xfbf28e){_0x56fa76=_0xfbf28e;_0x548eff=0xc8;}else{_0x548eff=0xce;}_0x33d397[_0x5be3('0x16')](_0x548eff);return _0x33d397[_0x5be3('0x1d')]('Content-Range',_0x2d67a2+'-'+_0x56fa76+'/'+_0xfbf28e)[_0x5be3('0x18')](_0x376156);}return null;};}function patchUpdates(_0x55fb74){return function(_0x55c82a){try{jsonpatch[_0x5be3('0x1e')](_0x55c82a,_0x55fb74,!![]);}catch(_0xa1a9c6){return BPromise[_0x5be3('0x1f')](_0xa1a9c6);}return _0x55c82a[_0x5be3('0x20')]();};}function saveUpdates(_0x335940,_0x337a3f){return function(_0x141823){if(_0x141823){return _0x141823[_0x5be3('0x21')](_0x335940)[_0x5be3('0x22')](function(_0x4d70bb){return _0x4d70bb;});}return null;};}function removeEntity(_0x2a6085,_0x18f485){return function(_0x5e2124){if(_0x5e2124){return _0x5e2124['destroy']()[_0x5be3('0x22')](function(){_0x2a6085[_0x5be3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493064,_0x31e68c){return function(_0x5eda45){if(!_0x5eda45){_0x493064[_0x5be3('0x15')](0x194);}return _0x5eda45;};}function handleError(_0x598b63,_0x1ce540){_0x1ce540=_0x1ce540||0x1f4;return function(_0x4c061f){logger['error'](_0x4c061f[_0x5be3('0x23')]);if(_0x4c061f[_0x5be3('0x24')]){delete _0x4c061f[_0x5be3('0x24')];}_0x598b63['status'](_0x1ce540)[_0x5be3('0x25')](_0x4c061f);};}exports[_0x5be3('0x26')]=function(_0x171d85,_0x4bf6bf){var _0x3fe359={},_0x16fecb={},_0x359231={'count':0x0,'rows':[]};var _0x559663=_[_0x5be3('0x27')](db[_0x5be3('0x28')][_0x5be3('0x29')],function(_0x49d007){return{'name':_0x49d007['fieldName'],'type':_0x49d007['type']['key']};});_0x16fecb[_0x5be3('0x2a')]=_['map'](_0x559663,_0x5be3('0x24'));_0x16fecb[_0x5be3('0x2b')]=_[_0x5be3('0x2c')](_0x171d85[_0x5be3('0x2b')]);_0x16fecb['filters']=_[_0x5be3('0x2d')](_0x16fecb[_0x5be3('0x2a')],_0x16fecb[_0x5be3('0x2b')]);_0x3fe359[_0x5be3('0x2e')]=_[_0x5be3('0x2d')](_0x16fecb['model'],qs['fields'](_0x171d85[_0x5be3('0x2b')][_0x5be3('0x2f')]));_0x3fe359[_0x5be3('0x2e')]=_0x3fe359['attributes'][_0x5be3('0x30')]?_0x3fe359[_0x5be3('0x2e')]:_0x16fecb[_0x5be3('0x2a')];if(!_0x171d85[_0x5be3('0x2b')][_0x5be3('0x31')](_0x5be3('0x32'))){_0x3fe359[_0x5be3('0x1b')]=qs[_0x5be3('0x1b')](_0x171d85['query'][_0x5be3('0x1b')]);_0x3fe359[_0x5be3('0x19')]=qs[_0x5be3('0x19')](_0x171d85[_0x5be3('0x2b')][_0x5be3('0x19')]);}_0x3fe359[_0x5be3('0x33')]=qs['sort'](_0x171d85[_0x5be3('0x2b')]['sort']);_0x3fe359[_0x5be3('0x34')]=qs['filters'](_[_0x5be3('0x35')](_0x171d85[_0x5be3('0x2b')],_0x16fecb[_0x5be3('0x36')]),_0x559663);if(_0x171d85[_0x5be3('0x2b')][_0x5be3('0x37')]){_0x3fe359[_0x5be3('0x34')]=_[_0x5be3('0x38')](_0x3fe359[_0x5be3('0x34')],{'$or':_[_0x5be3('0x27')](_0x559663,function(_0x2422f7){if(_0x2422f7['type']!==_0x5be3('0x39')){var _0x2d4b6c={};_0x2d4b6c[_0x2422f7[_0x5be3('0x24')]]={'$like':'%'+_0x171d85[_0x5be3('0x2b')][_0x5be3('0x37')]+'%'};return _0x2d4b6c;}})});}_0x3fe359=_[_0x5be3('0x38')]({},_0x3fe359,_0x171d85[_0x5be3('0x3a')]);var _0xa34a77={'where':_0x3fe359[_0x5be3('0x34')]};return db[_0x5be3('0x28')]['count'](_0xa34a77)[_0x5be3('0x22')](function(_0x56f9b6){_0x359231['count']=_0x56f9b6;if(_0x171d85[_0x5be3('0x2b')]['includeAll']){_0x3fe359[_0x5be3('0x3b')]=[{'all':!![]}];}return db['ChatInternalMessage']['findAll'](_0x3fe359);})[_0x5be3('0x22')](function(_0x55438c){_0x359231[_0x5be3('0x3c')]=_0x55438c;return _0x359231;})[_0x5be3('0x22')](respondWithFilteredResult(_0x4bf6bf,_0x3fe359))[_0x5be3('0x3d')](handleError(_0x4bf6bf,null));};exports[_0x5be3('0x3e')]=function(_0x110fab,_0x357a7a){var _0x3e0db0={'raw':!![],'where':{'id':_0x110fab['params']['id']}},_0x21368a={};_0x21368a['model']=_['keys'](db['ChatInternalMessage'][_0x5be3('0x29')]);_0x21368a['query']=_['keys'](_0x110fab[_0x5be3('0x2b')]);_0x21368a[_0x5be3('0x36')]=_[_0x5be3('0x2d')](_0x21368a[_0x5be3('0x2a')],_0x21368a[_0x5be3('0x2b')]);_0x3e0db0['attributes']=_[_0x5be3('0x2d')](_0x21368a[_0x5be3('0x2a')],qs['fields'](_0x110fab[_0x5be3('0x2b')][_0x5be3('0x2f')]));_0x3e0db0[_0x5be3('0x2e')]=_0x3e0db0[_0x5be3('0x2e')][_0x5be3('0x30')]?_0x3e0db0[_0x5be3('0x2e')]:_0x21368a[_0x5be3('0x2a')];if(_0x110fab['query'][_0x5be3('0x3f')]){_0x3e0db0[_0x5be3('0x3b')]=[{'all':!![]}];}_0x3e0db0=_[_0x5be3('0x38')]({},_0x3e0db0,_0x110fab[_0x5be3('0x3a')]);return db['ChatInternalMessage'][_0x5be3('0x40')](_0x3e0db0)[_0x5be3('0x22')](handleEntityNotFound(_0x357a7a,null))['then'](respondWithResult(_0x357a7a,null))[_0x5be3('0x3d')](handleError(_0x357a7a,null));};exports['create']=function(_0x2ddf76,_0x144649){return db[_0x5be3('0x28')][_0x5be3('0x41')](_0x2ddf76[_0x5be3('0x42')],{})['then'](respondWithResult(_0x144649,0xc9))[_0x5be3('0x3d')](handleError(_0x144649,null));};exports[_0x5be3('0x21')]=function(_0x51ee01,_0x1b9e1b){if(_0x51ee01[_0x5be3('0x42')]['id']){delete _0x51ee01[_0x5be3('0x42')]['id'];}return db[_0x5be3('0x28')][_0x5be3('0x40')]({'where':{'id':_0x51ee01['params']['id']}})[_0x5be3('0x22')](handleEntityNotFound(_0x1b9e1b,null))[_0x5be3('0x22')](saveUpdates(_0x51ee01[_0x5be3('0x42')],null))[_0x5be3('0x22')](respondWithResult(_0x1b9e1b,null))[_0x5be3('0x3d')](handleError(_0x1b9e1b,null));};exports[_0x5be3('0x43')]=function(_0xcd73c9,_0x1bc429){return db[_0x5be3('0x28')]['find']({'where':{'id':_0xcd73c9['params']['id']}})[_0x5be3('0x22')](handleEntityNotFound(_0x1bc429,null))[_0x5be3('0x22')](removeEntity(_0x1bc429,null))['catch'](handleError(_0x1bc429,null));};exports['describe']=function(_0x3c0162,_0x2711fa){return db[_0x5be3('0x28')][_0x5be3('0x44')]()[_0x5be3('0x22')](respondWithResult(_0x2711fa,null))['catch'](handleError(_0x2711fa,null));};function wrapUser(_0xb841f){return function(_0x5d9773){var _0x509d65=_0xb841f[_0x5be3('0x45')]({'plain':!![]});_0x509d65[_0x5be3('0x46')]=[];if(_0x5d9773){_0x509d65[_0x5be3('0x47')]=_0x5d9773[_0x5be3('0x48')];_0x509d65[_0x5be3('0x49')]=_0x5d9773;}else{_0x509d65[_0x5be3('0x47')]=moment(0x0)['format'](_0x5be3('0x4a'));_0x509d65[_0x5be3('0x49')]={};}return _0x509d65;};}exports[_0x5be3('0x4b')]=function(_0xbee6c2,_0x52a8f9,_0x29618e){var _0x371930=[];return db[_0x5be3('0x4c')]['findAll']({'where':{'role':[_0x5be3('0x4d'),_0x5be3('0x4e'),_0x5be3('0x4f')]},'attributes':['id',_0x5be3('0x50'),_0x5be3('0x24'),_0x5be3('0x51'),_0x5be3('0x52'),_0x5be3('0x53'),_0x5be3('0x54'),_0x5be3('0x55'),_0x5be3('0x56'),'showWebBar'],'order':qs[_0x5be3('0x57')](_0x5be3('0x58')),'include':[{'model':db['VoiceQueue'],'as':_0x5be3('0x59'),'attributes':['id',_0x5be3('0x24'),_0x5be3('0x5a')],'through':{'attributes':[]}}]})[_0x5be3('0x22')](function(_0xbc2156){if(_0xbc2156){var _0x1d814e=_0xbee6c2[_0x5be3('0x4f')]['get']({'plain':!![]});if(!_0x1d814e)throw new Error(_0x5be3('0x5b'));if(_0x1d814e['role']===_0x5be3('0x4f')){return db[_0x5be3('0x5c')][_0x5be3('0x40')]({'where':{'name':'Agents','userProfileId':_0x1d814e[_0x5be3('0x5d')]},'raw':!![]})[_0x5be3('0x22')](function(_0x1fd16a){if(_0x1fd16a){if(_0x1fd16a[_0x5be3('0x5e')]===0x0){return db[_0x5be3('0x5f')][_0x5be3('0x60')]({'where':{'sectionId':_0x1fd16a['id']},'raw':!![]})[_0x5be3('0x22')](function(_0x392b93){var _0x1e266f=[];if(_[_0x5be3('0x61')](_0x392b93)){_0x1e266f=_['filter'](_0xbc2156,function(_0x1dd5e9){if(_0x1dd5e9[_0x5be3('0x51')]!==_0x5be3('0x4d')){return _0x1dd5e9;}});return _0x1e266f;}else{for(var _0x26d664=0x0;_0x26d664<_0xbc2156[_0x5be3('0x30')];_0x26d664++){var _0x17c6e1=_0xbc2156[_0x26d664];if(_0x17c6e1[_0x5be3('0x51')]===_0x5be3('0x4d')){var _0x479e47=_[_0x5be3('0x40')](_0x392b93,function(_0x36f4c6){return _0x36f4c6[_0x5be3('0x62')]===_0x17c6e1['id'];});if(_0x479e47)_0x1e266f['push'](_0x17c6e1);}else{_0x1e266f[_0x5be3('0x63')](_0x17c6e1);}}return _0x1e266f;}});}else{return _0xbc2156;}}else{var _0x54f05e=_['filter'](_0xbc2156,function(_0x3e2c77){if(_0x3e2c77[_0x5be3('0x51')]!=='agent'){return _0x3e2c77;}});return _0x54f05e;}});}else{return _0xbc2156;}}})[_0x5be3('0x22')](function(_0x28c236){var _0x2aa5dc=[];if(_0x28c236){_0x371930=_0x28c236;for(var _0x5bb945=0x0;_0x5bb945<_0x28c236[_0x5be3('0x30')];_0x5bb945+=0x1){_0x371930[_0x5bb945][_0x5be3('0x46')]=[];_0x2aa5dc[_0x5be3('0x63')](db[_0x5be3('0x28')][_0x5be3('0x40')]({'where':{'FromId':[_0xbee6c2[_0x5be3('0x4f')]['id'],_0x28c236[_0x5bb945]['id']],'ToId':[_0xbee6c2['user']['id'],_0x28c236[_0x5bb945]['id']],'ChatGroupId':null},'attributes':['id',_0x5be3('0x48'),'FromId',_0x5be3('0x64'),_0x5be3('0x65'),'body'],'order':qs[_0x5be3('0x57')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x28c236[_0x5bb945])));}return BPromise[_0x5be3('0x66')](_0x2aa5dc);}return[];})['then'](function(_0x4e2ac1){return{'rows':_0x4e2ac1,'count':_0x4e2ac1[_0x5be3('0x30')]};})[_0x5be3('0x22')](respondWithResult(_0x52a8f9,null))[_0x5be3('0x3d')](handleError(_0x52a8f9,null));};
\ No newline at end of file
+var _0x0ccd=['get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','online','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','ChatInternalMessage','includeAll','findAll','show','keys','include','options','find','catch','create','body','params','describe'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x0ccd,0x90));var _0xd0cc=function(_0x5bff9e,_0x39ea3a){_0x5bff9e=_0x5bff9e-0x0;var _0x7f42ef=_0x0ccd[_0x5bff9e];return _0x7f42ef;};'use strict';var emlformat=require(_0xd0cc('0x0'));var rimraf=require(_0xd0cc('0x1'));var zipdir=require(_0xd0cc('0x2'));var jsonpatch=require(_0xd0cc('0x3'));var rp=require(_0xd0cc('0x4'));var moment=require(_0xd0cc('0x5'));var BPromise=require(_0xd0cc('0x6'));var Mustache=require(_0xd0cc('0x7'));var util=require(_0xd0cc('0x8'));var path=require(_0xd0cc('0x9'));var sox=require(_0xd0cc('0xa'));var csv=require(_0xd0cc('0xb'));var ejs=require(_0xd0cc('0xc'));var fs=require('fs');var fs_extra=require(_0xd0cc('0xd'));var _=require(_0xd0cc('0xe'));var squel=require(_0xd0cc('0xf'));var crypto=require(_0xd0cc('0x10'));var jsforce=require(_0xd0cc('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xd0cc('0xb'));var querystring=require(_0xd0cc('0x12'));var Papa=require(_0xd0cc('0x13'));var Redis=require(_0xd0cc('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xd0cc('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0cc('0x16'));var logger=require(_0xd0cc('0x17'))(_0xd0cc('0x18'));var utils=require(_0xd0cc('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xd0cc('0x1a')](config[_0xd0cc('0x1b')],{'host':_0xd0cc('0x1c'),'port':0x18eb});var socket=require(_0xd0cc('0x1d'))(new Redis(config[_0xd0cc('0x1b')]));require(_0xd0cc('0x1e'))[_0xd0cc('0x1f')](socket);function respondWithStatusCode(_0x289d8c,_0x222a66){_0x222a66=_0x222a66||0xcc;return function(_0x277c0d){if(_0x277c0d){return _0x289d8c[_0xd0cc('0x20')](_0x222a66);}return _0x289d8c[_0xd0cc('0x21')](_0x222a66)[_0xd0cc('0x22')]();};}function respondWithResult(_0x39f14c,_0x377284){_0x377284=_0x377284||0xc8;return function(_0x496c32){if(_0x496c32){return _0x39f14c[_0xd0cc('0x21')](_0x377284)[_0xd0cc('0x23')](_0x496c32);}};}function respondWithFilteredResult(_0x209806,_0x37e2a0){return function(_0x4dc4aa){if(_0x4dc4aa){var _0x407a75=typeof _0x37e2a0[_0xd0cc('0x24')]===_0xd0cc('0x25')&&typeof _0x37e2a0[_0xd0cc('0x26')]==='undefined';var _0x3ebf21=_0x4dc4aa[_0xd0cc('0x27')];var _0x5bbfa9=_0x407a75?0x0:_0x37e2a0[_0xd0cc('0x24')];var _0x43eeb7=_0x407a75?_0x4dc4aa[_0xd0cc('0x27')]:_0x37e2a0[_0xd0cc('0x24')]+_0x37e2a0[_0xd0cc('0x26')];var _0x173a65;if(_0x43eeb7>=_0x3ebf21){_0x43eeb7=_0x3ebf21;_0x173a65=0xc8;}else{_0x173a65=0xce;}_0x209806[_0xd0cc('0x21')](_0x173a65);return _0x209806[_0xd0cc('0x28')]('Content-Range',_0x5bbfa9+'-'+_0x43eeb7+'/'+_0x3ebf21)[_0xd0cc('0x23')](_0x4dc4aa);}return null;};}function patchUpdates(_0x434d98){return function(_0x32bacd){try{jsonpatch[_0xd0cc('0x29')](_0x32bacd,_0x434d98,!![]);}catch(_0x55ec1a){return BPromise['reject'](_0x55ec1a);}return _0x32bacd[_0xd0cc('0x2a')]();};}function saveUpdates(_0x1549f0,_0x299940){return function(_0x71d8ad){if(_0x71d8ad){return _0x71d8ad[_0xd0cc('0x2b')](_0x1549f0)[_0xd0cc('0x2c')](function(_0x3d6af8){return _0x3d6af8;});}return null;};}function removeEntity(_0x3e7cd5,_0x385bdc){return function(_0x2e0c40){if(_0x2e0c40){return _0x2e0c40[_0xd0cc('0x2d')]()[_0xd0cc('0x2c')](function(){_0x3e7cd5[_0xd0cc('0x21')](0xcc)[_0xd0cc('0x22')]();});}};}function handleEntityNotFound(_0x52316f,_0x1a37a7){return function(_0x534d87){if(!_0x534d87){_0x52316f[_0xd0cc('0x20')](0x194);}return _0x534d87;};}function handleError(_0x23d5ca,_0x59b1b1){_0x59b1b1=_0x59b1b1||0x1f4;return function(_0x148904){logger[_0xd0cc('0x2e')](_0x148904[_0xd0cc('0x2f')]);if(_0x148904[_0xd0cc('0x30')]){delete _0x148904['name'];}_0x23d5ca['status'](_0x59b1b1)['send'](_0x148904);};}exports[_0xd0cc('0x31')]=function(_0x33c4c9,_0x49ff7b){var _0x531204={},_0x5e9a18={},_0x308acf={'count':0x0,'rows':[]};var _0x434e43=_[_0xd0cc('0x32')](db['ChatInternalMessage'][_0xd0cc('0x33')],function(_0x57adcb){return{'name':_0x57adcb[_0xd0cc('0x34')],'type':_0x57adcb[_0xd0cc('0x35')]['key']};});_0x5e9a18[_0xd0cc('0x36')]=_['map'](_0x434e43,_0xd0cc('0x30'));_0x5e9a18[_0xd0cc('0x37')]=_['keys'](_0x33c4c9['query']);_0x5e9a18[_0xd0cc('0x38')]=_[_0xd0cc('0x39')](_0x5e9a18[_0xd0cc('0x36')],_0x5e9a18[_0xd0cc('0x37')]);_0x531204[_0xd0cc('0x3a')]=_[_0xd0cc('0x39')](_0x5e9a18[_0xd0cc('0x36')],qs[_0xd0cc('0x3b')](_0x33c4c9[_0xd0cc('0x37')]['fields']));_0x531204[_0xd0cc('0x3a')]=_0x531204[_0xd0cc('0x3a')][_0xd0cc('0x3c')]?_0x531204[_0xd0cc('0x3a')]:_0x5e9a18[_0xd0cc('0x36')];if(!_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x3d')](_0xd0cc('0x3e'))){_0x531204[_0xd0cc('0x26')]=qs[_0xd0cc('0x26')](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x26')]);_0x531204[_0xd0cc('0x24')]=qs['offset'](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x24')]);}_0x531204['order']=qs[_0xd0cc('0x3f')](_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x3f')]);_0x531204[_0xd0cc('0x40')]=qs[_0xd0cc('0x38')](_[_0xd0cc('0x41')](_0x33c4c9[_0xd0cc('0x37')],_0x5e9a18[_0xd0cc('0x38')]),_0x434e43);if(_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x42')]){_0x531204[_0xd0cc('0x40')]=_[_0xd0cc('0x43')](_0x531204[_0xd0cc('0x40')],{'$or':_['map'](_0x434e43,function(_0xf72fd0){if(_0xf72fd0[_0xd0cc('0x35')]!==_0xd0cc('0x44')){var _0x5cd6d4={};_0x5cd6d4[_0xf72fd0[_0xd0cc('0x30')]]={'$like':'%'+_0x33c4c9[_0xd0cc('0x37')]['filter']+'%'};return _0x5cd6d4;}})});}_0x531204=_[_0xd0cc('0x43')]({},_0x531204,_0x33c4c9['options']);var _0x3c2205={'where':_0x531204[_0xd0cc('0x40')]};return db[_0xd0cc('0x45')]['count'](_0x3c2205)[_0xd0cc('0x2c')](function(_0x3fbd75){_0x308acf[_0xd0cc('0x27')]=_0x3fbd75;if(_0x33c4c9[_0xd0cc('0x37')][_0xd0cc('0x46')]){_0x531204['include']=[{'all':!![]}];}return db[_0xd0cc('0x45')][_0xd0cc('0x47')](_0x531204);})[_0xd0cc('0x2c')](function(_0x2c5e4a){_0x308acf['rows']=_0x2c5e4a;return _0x308acf;})[_0xd0cc('0x2c')](respondWithFilteredResult(_0x49ff7b,_0x531204))['catch'](handleError(_0x49ff7b,null));};exports[_0xd0cc('0x48')]=function(_0x496667,_0x27fafe){var _0x18a397={'raw':!![],'where':{'id':_0x496667['params']['id']}},_0x2d2788={};_0x2d2788[_0xd0cc('0x36')]=_[_0xd0cc('0x49')](db['ChatInternalMessage']['rawAttributes']);_0x2d2788[_0xd0cc('0x37')]=_[_0xd0cc('0x49')](_0x496667['query']);_0x2d2788[_0xd0cc('0x38')]=_[_0xd0cc('0x39')](_0x2d2788[_0xd0cc('0x36')],_0x2d2788[_0xd0cc('0x37')]);_0x18a397['attributes']=_[_0xd0cc('0x39')](_0x2d2788[_0xd0cc('0x36')],qs['fields'](_0x496667[_0xd0cc('0x37')][_0xd0cc('0x3b')]));_0x18a397['attributes']=_0x18a397['attributes']['length']?_0x18a397[_0xd0cc('0x3a')]:_0x2d2788['model'];if(_0x496667[_0xd0cc('0x37')][_0xd0cc('0x46')]){_0x18a397[_0xd0cc('0x4a')]=[{'all':!![]}];}_0x18a397=_[_0xd0cc('0x43')]({},_0x18a397,_0x496667[_0xd0cc('0x4b')]);return db[_0xd0cc('0x45')][_0xd0cc('0x4c')](_0x18a397)[_0xd0cc('0x2c')](handleEntityNotFound(_0x27fafe,null))['then'](respondWithResult(_0x27fafe,null))[_0xd0cc('0x4d')](handleError(_0x27fafe,null));};exports[_0xd0cc('0x4e')]=function(_0x25e8dc,_0x528806){return db[_0xd0cc('0x45')][_0xd0cc('0x4e')](_0x25e8dc[_0xd0cc('0x4f')],{})[_0xd0cc('0x2c')](respondWithResult(_0x528806,0xc9))[_0xd0cc('0x4d')](handleError(_0x528806,null));};exports[_0xd0cc('0x2b')]=function(_0x89861,_0x1469b4){if(_0x89861[_0xd0cc('0x4f')]['id']){delete _0x89861['body']['id'];}return db[_0xd0cc('0x45')][_0xd0cc('0x4c')]({'where':{'id':_0x89861[_0xd0cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1469b4,null))[_0xd0cc('0x2c')](saveUpdates(_0x89861[_0xd0cc('0x4f')],null))[_0xd0cc('0x2c')](respondWithResult(_0x1469b4,null))[_0xd0cc('0x4d')](handleError(_0x1469b4,null));};exports[_0xd0cc('0x2d')]=function(_0x2ebe0f,_0x4dccc4){return db[_0xd0cc('0x45')]['find']({'where':{'id':_0x2ebe0f[_0xd0cc('0x50')]['id']}})[_0xd0cc('0x2c')](handleEntityNotFound(_0x4dccc4,null))[_0xd0cc('0x2c')](removeEntity(_0x4dccc4,null))[_0xd0cc('0x4d')](handleError(_0x4dccc4,null));};exports[_0xd0cc('0x51')]=function(_0x1a5f99,_0x567ff4){return db['ChatInternalMessage'][_0xd0cc('0x51')]()['then'](respondWithResult(_0x567ff4,null))['catch'](handleError(_0x567ff4,null));};function wrapUser(_0x918966){return function(_0x57eef6){var _0x9e5866=_0x918966[_0xd0cc('0x52')]({'plain':!![]});_0x9e5866[_0xd0cc('0x53')]=[];if(_0x57eef6){_0x9e5866[_0xd0cc('0x54')]=_0x57eef6['createdAt'];_0x9e5866[_0xd0cc('0x55')]=_0x57eef6;}else{_0x9e5866['lastMessageAt']=moment(0x0)['format'](_0xd0cc('0x56'));_0x9e5866[_0xd0cc('0x55')]={};}return _0x9e5866;};}exports[_0xd0cc('0x57')]=function(_0x7430ac,_0x4a3e07,_0x3a3390){var _0x1e2d88=[];return db[_0xd0cc('0x58')][_0xd0cc('0x47')]({'where':{'role':['agent',_0xd0cc('0x59'),_0xd0cc('0x5a')]},'attributes':['id',_0xd0cc('0x5b'),_0xd0cc('0x30'),_0xd0cc('0x5c'),_0xd0cc('0x5d'),'internal',_0xd0cc('0x5e'),'lastLoginAt','allowmessenger',_0xd0cc('0x5f')],'order':qs['sort'](_0xd0cc('0x60')),'include':[{'model':db[_0xd0cc('0x61')],'as':'VoiceQueues','attributes':['id',_0xd0cc('0x30'),_0xd0cc('0x35')],'through':{'attributes':[]}}]})[_0xd0cc('0x2c')](function(_0x4d2628){if(_0x4d2628){var _0x236358=_0x7430ac['user']['get']({'plain':!![]});if(!_0x236358)throw new Error(_0xd0cc('0x62'));if(_0x236358['role']===_0xd0cc('0x5a')){return db[_0xd0cc('0x63')][_0xd0cc('0x4c')]({'where':{'name':_0xd0cc('0x64'),'userProfileId':_0x236358[_0xd0cc('0x65')]},'raw':!![]})['then'](function(_0x2e9b0d){if(_0x2e9b0d){if(_0x2e9b0d[_0xd0cc('0x66')]===0x0){return db[_0xd0cc('0x67')][_0xd0cc('0x47')]({'where':{'sectionId':_0x2e9b0d['id']},'raw':!![]})[_0xd0cc('0x2c')](function(_0x3d8190){var _0x31d75c=[];if(_[_0xd0cc('0x68')](_0x3d8190)){_0x31d75c=_[_0xd0cc('0x42')](_0x4d2628,function(_0x170468){if(_0x170468[_0xd0cc('0x5c')]!==_0xd0cc('0x69')){return _0x170468;}});return _0x31d75c;}else{for(var _0x21355f=0x0;_0x21355f<_0x4d2628['length'];_0x21355f++){var _0xda4b34=_0x4d2628[_0x21355f];if(_0xda4b34['role']===_0xd0cc('0x69')){var _0x15abec=_[_0xd0cc('0x4c')](_0x3d8190,function(_0x16a24d){return _0x16a24d[_0xd0cc('0x6a')]===_0xda4b34['id'];});if(_0x15abec)_0x31d75c[_0xd0cc('0x6b')](_0xda4b34);}else{_0x31d75c[_0xd0cc('0x6b')](_0xda4b34);}}return _0x31d75c;}});}else{return _0x4d2628;}}else{var _0x566504=_[_0xd0cc('0x42')](_0x4d2628,function(_0x3d225f){if(_0x3d225f[_0xd0cc('0x5c')]!==_0xd0cc('0x69')){return _0x3d225f;}});return _0x566504;}});}else{return _0x4d2628;}}})[_0xd0cc('0x2c')](function(_0x36df6e){var _0x212a7=[];if(_0x36df6e){_0x1e2d88=_0x36df6e;for(var _0x319403=0x0;_0x319403<_0x36df6e['length'];_0x319403+=0x1){_0x1e2d88[_0x319403]['messages']=[];_0x212a7['push'](db[_0xd0cc('0x45')][_0xd0cc('0x4c')]({'where':{'FromId':[_0x7430ac[_0xd0cc('0x5a')]['id'],_0x36df6e[_0x319403]['id']],'ToId':[_0x7430ac[_0xd0cc('0x5a')]['id'],_0x36df6e[_0x319403]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0xd0cc('0x6c'),_0xd0cc('0x6d'),_0xd0cc('0x6e'),'body'],'order':qs[_0xd0cc('0x3f')](_0xd0cc('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd0cc('0x2c')](wrapUser(_0x36df6e[_0x319403])));}return BPromise[_0xd0cc('0x70')](_0x212a7);}return[];})[_0xd0cc('0x2c')](function(_0x2be743){return{'rows':_0x2be743,'count':_0x2be743[_0xd0cc('0x3c')]};})[_0xd0cc('0x2c')](respondWithResult(_0x4a3e07,null))[_0xd0cc('0x4d')](handleError(_0x4a3e07,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index eb3a332..5fe660a 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 _0xdcc1=['exports','events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x34b678,_0x13b7fa){var _0x463d62=function(_0x45271b){while(--_0x45271b){_0x34b678['push'](_0x34b678['shift']());}};_0x463d62(++_0x13b7fa);}(_0xdcc1,0x15f));var _0x1dcc=function(_0x138847,_0x45327e){_0x138847=_0x138847-0x0;var _0x295bad=_0xdcc1[_0x138847];return _0x295bad;};'use strict';var EventEmitter=require(_0x1dcc('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x1dcc('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1dcc('0x2')](0x0);var events={'afterCreate':_0x1dcc('0x3'),'afterUpdate':_0x1dcc('0x4'),'afterDestroy':_0x1dcc('0x5')};function emitEvent(_0x3fe5ef){return function(_0x4186f6,_0x1cc4ce,_0x31f70c){ChatInternalMessageEvents[_0x1dcc('0x6')](_0x3fe5ef+':'+_0x4186f6['id'],_0x4186f6);ChatInternalMessageEvents[_0x1dcc('0x6')](_0x3fe5ef,_0x4186f6);_0x31f70c(null);};}for(var e in events){if(events[_0x1dcc('0x7')](e)){var event=events[e];ChatInternalMessage[_0x1dcc('0x8')](e,emitEvent(event));}}module[_0x1dcc('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xf701=['emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage','setMaxListeners','update'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0xf701,0x15a));var _0x1f70=function(_0x441637,_0x3b0a6d){_0x441637=_0x441637-0x0;var _0x413474=_0xf701[_0x441637];return _0x413474;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x1f70('0x0'))['db'][_0x1f70('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1f70('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1f70('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1f9505){return function(_0x35eb5f,_0x5937bf,_0x4a0b68){ChatInternalMessageEvents[_0x1f70('0x4')](_0x1f9505+':'+_0x35eb5f['id'],_0x35eb5f);ChatInternalMessageEvents[_0x1f70('0x4')](_0x1f9505,_0x35eb5f);_0x4a0b68(null);};}for(var e in events){if(events[_0x1f70('0x5')](e)){var event=events[e];ChatInternalMessage[_0x1f70('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 4aa950c..ed83b10 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 _0x9e67=['moment','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e67,0x13e));var _0x79e6=function(_0x5916ae,_0x3b8e58){_0x5916ae=_0x5916ae-0x0;var _0x134540=_0x9e67[_0x5916ae];return _0x134540;};'use strict';var _=require(_0x79e6('0x0'));var util=require(_0x79e6('0x1'));var logger=require(_0x79e6('0x2'))(_0x79e6('0x3'));var moment=require(_0x79e6('0x4'));var BPromise=require(_0x79e6('0x5'));var rp=require(_0x79e6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x79e6('0x7'));var attributes=require(_0x79e6('0x8'));module[_0x79e6('0x9')]=function(_0x53233f,_0x32d6c5){return _0x53233f[_0x79e6('0xa')](_0x79e6('0xb'),attributes,{'tableName':_0x79e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x79e6('0xd')});};
\ No newline at end of file
+var _0x600f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x220a04,_0x43e822){var _0xb558fa=function(_0x1f1f2f){while(--_0x1f1f2f){_0x220a04['push'](_0x220a04['shift']());}};_0xb558fa(++_0x43e822);}(_0x600f,0x11c));var _0xf600=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0x600f[_0x4cc280];return _0x16ed24;};'use strict';var _=require('lodash');var util=require(_0xf600('0x0'));var logger=require(_0xf600('0x1'))(_0xf600('0x2'));var moment=require(_0xf600('0x3'));var BPromise=require(_0xf600('0x4'));var rp=require(_0xf600('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf600('0x6'));var config=require(_0xf600('0x7'));var attributes=require(_0xf600('0x8'));module['exports']=function(_0xa8e17e,_0x262955){return _0xa8e17e['define'](_0xf600('0x9'),attributes,{'tableName':_0xf600('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf600('0xb'),'collate':_0xf600('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index fbebdad..70f696b 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 _0x521c=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','request','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x521c,0x6b));var _0xc521=function(_0x2c403b,_0x280192){_0x2c403b=_0x2c403b-0x0;var _0x2b6f8c=_0x521c[_0x2c403b];return _0x2b6f8c;};'use strict';var _=require('lodash');var util=require(_0xc521('0x0'));var moment=require(_0xc521('0x1'));var BPromise=require(_0xc521('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc521('0x3'));var db=require(_0xc521('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc521('0x5'));var config=require(_0xc521('0x6'));var jayson=require(_0xc521('0x7'));var client=jayson[_0xc521('0x8')][_0xc521('0x9')]({'port':0x232a});config[_0xc521('0xa')]=_[_0xc521('0xb')](config['redis'],{'host':_0xc521('0xc'),'port':0x18eb});var socket=require(_0xc521('0xd'))(new Redis(config[_0xc521('0xa')]));require(_0xc521('0xe'))['register'](socket);function respondWithRpcPromise(_0x4ac6a2,_0x3ed24a,_0x15e427){return new BPromise(function(_0x375ea1,_0x2935a7){return client[_0xc521('0xf')](_0x4ac6a2,_0x15e427)['then'](function(_0x265769){logger[_0xc521('0x10')](_0xc521('0x11'),_0x3ed24a,'request\x20sent');logger[_0xc521('0x12')](_0xc521('0x13'),_0x3ed24a,_0xc521('0x14'),JSON[_0xc521('0x15')](_0x265769));if(_0x265769[_0xc521('0x16')]){if(_0x265769[_0xc521('0x16')]['code']===0x1f4){logger[_0xc521('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x3ed24a,_0x265769[_0xc521('0x16')][_0xc521('0x17')]);return _0x2935a7(_0x265769[_0xc521('0x16')][_0xc521('0x17')]);}logger[_0xc521('0x16')](_0xc521('0x11'),_0x3ed24a,_0x265769[_0xc521('0x16')]['message']);return _0x375ea1(_0x265769[_0xc521('0x16')][_0xc521('0x17')]);}else{logger[_0xc521('0x10')](_0xc521('0x11'),_0x3ed24a,_0xc521('0x14'));_0x375ea1(_0x265769[_0xc521('0x18')][_0xc521('0x17')]);}})[_0xc521('0x19')](function(_0x885082){logger[_0xc521('0x16')](_0xc521('0x11'),_0x3ed24a,_0x885082);_0x2935a7(_0x885082);});});}
\ No newline at end of file
+var _0xd0b1=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd0b1,0x16e));var _0x1d0b=function(_0xe8a9c6,_0x315a90){_0xe8a9c6=_0xe8a9c6-0x0;var _0x3d150c=_0xd0b1[_0xe8a9c6];return _0x3d150c;};'use strict';var _=require(_0x1d0b('0x0'));var util=require(_0x1d0b('0x1'));var moment=require('moment');var BPromise=require(_0x1d0b('0x2'));var rs=require(_0x1d0b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d0b('0x4'))['db'];var utils=require(_0x1d0b('0x5'));var logger=require(_0x1d0b('0x6'))(_0x1d0b('0x7'));var config=require(_0x1d0b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1d0b('0x9')][_0x1d0b('0xa')]({'port':0x232a});config[_0x1d0b('0xb')]=_[_0x1d0b('0xc')](config[_0x1d0b('0xb')],{'host':_0x1d0b('0xd'),'port':0x18eb});var socket=require(_0x1d0b('0xe'))(new Redis(config['redis']));require(_0x1d0b('0xf'))[_0x1d0b('0x10')](socket);function respondWithRpcPromise(_0x3a5369,_0x4b136e,_0x1b520a){return new BPromise(function(_0x5ef099,_0x196c3b){return client[_0x1d0b('0x11')](_0x3a5369,_0x1b520a)['then'](function(_0x529c76){logger[_0x1d0b('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x1d0b('0x13'));logger[_0x1d0b('0x14')](_0x1d0b('0x15'),_0x4b136e,_0x1d0b('0x13'),JSON[_0x1d0b('0x16')](_0x529c76));if(_0x529c76['error']){if(_0x529c76[_0x1d0b('0x17')]['code']===0x1f4){logger[_0x1d0b('0x17')](_0x1d0b('0x18'),_0x4b136e,_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);return _0x196c3b(_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);}logger[_0x1d0b('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x529c76[_0x1d0b('0x17')][_0x1d0b('0x19')]);return _0x5ef099(_0x529c76['error'][_0x1d0b('0x19')]);}else{logger[_0x1d0b('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4b136e,_0x1d0b('0x13'));_0x5ef099(_0x529c76[_0x1d0b('0x1a')]['message']);}})[_0x1d0b('0x1b')](function(_0x1f874){logger[_0x1d0b('0x17')](_0x1d0b('0x18'),_0x4b136e,_0x1f874);_0x196c3b(_0x1f874);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 01151b2..4dbdfe1 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 _0xb3f8=['update','emit','removeListener','register','length','./chatInternalMessage.events','remove'];(function(_0x3c5d2b,_0x2ddb64){var _0x4269ec=function(_0x2de4e1){while(--_0x2de4e1){_0x3c5d2b['push'](_0x3c5d2b['shift']());}};_0x4269ec(++_0x2ddb64);}(_0xb3f8,0x83));var _0x8b3f=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0xb3f8[_0x4206f5];return _0xa29cf3;};'use strict';var ChatInternalMessageEvents=require(_0x8b3f('0x0'));var events=['save',_0x8b3f('0x1'),_0x8b3f('0x2')];function createListener(_0x5c8bf4,_0x5ed22a){return function(_0x39b8d3){_0x5ed22a[_0x8b3f('0x3')](_0x5c8bf4,_0x39b8d3);};}function removeListener(_0x2ea4fa,_0x2d4e26){return function(){ChatInternalMessageEvents[_0x8b3f('0x4')](_0x2ea4fa,_0x2d4e26);};}exports[_0x8b3f('0x5')]=function(_0x481d7e){for(var _0x522529=0x0,_0x29d849=events[_0x8b3f('0x6')];_0x522529<_0x29d849;_0x522529++){var _0xa09de8=events[_0x522529];var _0x5058da=createListener('chatInternalMessage:'+_0xa09de8,_0x481d7e);ChatInternalMessageEvents['on'](_0xa09de8,_0x5058da);}};
\ No newline at end of file
+var _0x4cd2=['removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x3eddb3,_0x4c7b89){var _0x2c7497=function(_0x17dfb9){while(--_0x17dfb9){_0x3eddb3['push'](_0x3eddb3['shift']());}};_0x2c7497(++_0x4c7b89);}(_0x4cd2,0x193));var _0x24cd=function(_0x412cee,_0x3bd66a){_0x412cee=_0x412cee-0x0;var _0x553f36=_0x4cd2[_0x412cee];return _0x553f36;};'use strict';var ChatInternalMessageEvents=require(_0x24cd('0x0'));var events=[_0x24cd('0x1'),_0x24cd('0x2'),_0x24cd('0x3')];function createListener(_0xf41b1e,_0x330cb0){return function(_0x46474b){_0x330cb0[_0x24cd('0x4')](_0xf41b1e,_0x46474b);};}function removeListener(_0x533a33,_0x3739e0){return function(){ChatInternalMessageEvents[_0x24cd('0x5')](_0x533a33,_0x3739e0);};}exports['register']=function(_0xe1ccf8){for(var _0xb6ae30=0x0,_0x41bc6d=events[_0x24cd('0x6')];_0xb6ae30<_0x41bc6d;_0xb6ae30++){var _0x53cbe3=events[_0xb6ae30];var _0x546488=createListener(_0x24cd('0x7')+_0x53cbe3,_0xe1ccf8);ChatInternalMessageEvents['on'](_0x53cbe3,_0x546488);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 201138c..604adc5 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 _0xa5d1=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','getUsers','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xa5d1,0x181));var _0x1a5d=function(_0x5de780,_0xe3c39a){_0x5de780=_0x5de780-0x0;var _0x13514c=_0xa5d1[_0x5de780];return _0x13514c;};'use strict';var multer=require(_0x1a5d('0x0'));var util=require(_0x1a5d('0x1'));var path=require(_0x1a5d('0x2'));var timeout=require(_0x1a5d('0x3'));var express=require(_0x1a5d('0x4'));var router=express[_0x1a5d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1a5d('0x6'));var interaction=require(_0x1a5d('0x7'));var config=require(_0x1a5d('0x8'));var controller=require(_0x1a5d('0x9'));router[_0x1a5d('0xa')]('/',auth[_0x1a5d('0xb')](),controller[_0x1a5d('0xc')]);router[_0x1a5d('0xa')]('/describe',auth[_0x1a5d('0xb')](),controller[_0x1a5d('0xd')]);router[_0x1a5d('0xa')]('/users',auth[_0x1a5d('0xb')](),controller[_0x1a5d('0xe')]);router[_0x1a5d('0xa')](_0x1a5d('0xf'),auth[_0x1a5d('0xb')](),controller[_0x1a5d('0x10')]);router[_0x1a5d('0x11')]('/',auth[_0x1a5d('0xb')](),controller[_0x1a5d('0x12')]);router[_0x1a5d('0x13')](_0x1a5d('0xf'),controller['update']);router[_0x1a5d('0x14')](_0x1a5d('0xf'),auth[_0x1a5d('0xb')](),controller[_0x1a5d('0x15')]);module[_0x1a5d('0x16')]=router;
\ No newline at end of file
+var _0x1c24=['/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x17d703,_0x2266eb){var _0x4fd652=function(_0x4147ad){while(--_0x4147ad){_0x17d703['push'](_0x17d703['shift']());}};_0x4fd652(++_0x2266eb);}(_0x1c24,0x1ac));var _0x41c2=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1c24[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require(_0x41c2('0x0'));var util=require(_0x41c2('0x1'));var path=require('path');var timeout=require(_0x41c2('0x2'));var express=require(_0x41c2('0x3'));var router=express[_0x41c2('0x4')]();var fs_extra=require(_0x41c2('0x5'));var auth=require(_0x41c2('0x6'));var interaction=require(_0x41c2('0x7'));var config=require(_0x41c2('0x8'));var controller=require(_0x41c2('0x9'));router[_0x41c2('0xa')]('/',auth[_0x41c2('0xb')](),controller['index']);router[_0x41c2('0xa')]('/describe',auth[_0x41c2('0xb')](),controller['describe']);router['get'](_0x41c2('0xc'),auth[_0x41c2('0xb')](),controller[_0x41c2('0xd')]);router[_0x41c2('0xa')](_0x41c2('0xe'),auth[_0x41c2('0xb')](),controller[_0x41c2('0xf')]);router[_0x41c2('0x10')]('/',auth[_0x41c2('0xb')](),controller[_0x41c2('0x11')]);router[_0x41c2('0x12')](_0x41c2('0xe'),controller[_0x41c2('0x13')]);router[_0x41c2('0x14')](_0x41c2('0xe'),auth[_0x41c2('0xb')](),controller[_0x41c2('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index d22216d..96f1fd7 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 _0xdd4f=['DATE','TEXT','sequelize','BOOLEAN','out'];(function(_0x3f5293,_0xf86f3){var _0x14366c=function(_0x4412ff){while(--_0x4412ff){_0x3f5293['push'](_0x3f5293['shift']());}};_0x14366c(++_0xf86f3);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x3e4c49,_0x1fdf6f){_0x3e4c49=_0x3e4c49-0x0;var _0x45f354=_0xdd4f[_0x3e4c49];return _0x45f354;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfdd4('0x2')),'defaultValue':_0xfdd4('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfdd4('0x3')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfdd4('0x4')]}};
\ No newline at end of file
+var _0x97e6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0xab36ea,_0xb838df){var _0x27e12d=function(_0x3d31ed){while(--_0x3d31ed){_0xab36ea['push'](_0xab36ea['shift']());}};_0x27e12d(++_0xb838df);}(_0x97e6,0x159));var _0x697e=function(_0x2812c2,_0x2b382d){_0x2812c2=_0x2812c2-0x0;var _0x218ac9=_0x97e6[_0x2812c2];return _0x218ac9;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'body':{'type':Sequelize[_0x697e('0x1')](_0x697e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x697e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x697e('0x4')]('in',_0x697e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x697e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x697e('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 43d28db..625bb7a 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 _0x0344=['pick','filter','merge','VIRTUAL','options','ChatMessage','rows','show','params','includeAll','find','create','body','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteraction','ChatInteractionId','isNil','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','email','interface','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where'];(function(_0x38decd,_0x9ac4e3){var _0x11a3d9=function(_0x29500b){while(--_0x29500b){_0x38decd['push'](_0x38decd['shift']());}};_0x11a3d9(++_0x9ac4e3);}(_0x0344,0x14b));var _0x4034=function(_0x310d4a,_0x272aa0){_0x310d4a=_0x310d4a-0x0;var _0xa9e651=_0x0344[_0x310d4a];return _0xa9e651;};'use strict';var emlformat=require(_0x4034('0x0'));var rimraf=require(_0x4034('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4034('0x2'));var rp=require(_0x4034('0x3'));var moment=require(_0x4034('0x4'));var BPromise=require(_0x4034('0x5'));var Mustache=require('mustache');var util=require(_0x4034('0x6'));var path=require('path');var sox=require(_0x4034('0x7'));var csv=require(_0x4034('0x8'));var ejs=require(_0x4034('0x9'));var fs=require('fs');var fs_extra=require(_0x4034('0xa'));var _=require(_0x4034('0xb'));var squel=require(_0x4034('0xc'));var crypto=require('crypto');var jsforce=require(_0x4034('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4034('0x8'));var querystring=require(_0x4034('0xe'));var Papa=require(_0x4034('0xf'));var Redis=require(_0x4034('0x10'));var authService=require(_0x4034('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4034('0x12'));var hardwareService=require(_0x4034('0x13'));var logger=require(_0x4034('0x14'))(_0x4034('0x15'));var utils=require(_0x4034('0x16'));var config=require(_0x4034('0x17'));var licenseUtil=require(_0x4034('0x18'));var db=require(_0x4034('0x19'))['db'];config[_0x4034('0x1a')]=_[_0x4034('0x1b')](config[_0x4034('0x1a')],{'host':_0x4034('0x1c'),'port':0x18eb});var socket=require(_0x4034('0x1d'))(new Redis(config[_0x4034('0x1a')]));require(_0x4034('0x1e'))[_0x4034('0x1f')](socket);var jayson=require(_0x4034('0x20'));var client=jayson[_0x4034('0x21')][_0x4034('0x22')]({'port':0x232c});var client9002=jayson[_0x4034('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5197c0,_0x1feeb2,_0xdc75b4,_0x152ece){return new BPromise(function(_0x380d82,_0x559ade){var _0x18e70d=_0x152ece||client;return _0x18e70d[_0x4034('0x23')](_0x5197c0,_0xdc75b4)[_0x4034('0x24')](function(_0x35d057){logger['info'](_0x4034('0x25'),_0x1feeb2,_0x4034('0x26'));logger[_0x4034('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1feeb2,'request\x20sent',JSON[_0x4034('0x28')](_0x35d057));if(_0x35d057[_0x4034('0x29')]){if(_0x35d057[_0x4034('0x29')][_0x4034('0x2a')]===0x1f4){logger[_0x4034('0x29')](_0x4034('0x25'),_0x1feeb2,_0x35d057[_0x4034('0x29')][_0x4034('0x2b')]);return _0x559ade(_0x35d057[_0x4034('0x29')][_0x4034('0x2b')]);}logger[_0x4034('0x29')](_0x4034('0x25'),_0x1feeb2,_0x35d057[_0x4034('0x29')][_0x4034('0x2b')]);return _0x380d82(_0x35d057['error'][_0x4034('0x2b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x1feeb2,_0x4034('0x26'));_0x380d82(_0x35d057[_0x4034('0x2c')][_0x4034('0x2b')]);}})[_0x4034('0x2d')](function(_0x19dcf7){logger['error'](_0x4034('0x25'),_0x1feeb2,_0x19dcf7);_0x559ade(_0x19dcf7);});});}function respondWithStatusCode(_0x599b31,_0x43e156){_0x43e156=_0x43e156||0xcc;return function(_0x25cb8a){if(_0x25cb8a){return _0x599b31[_0x4034('0x2e')](_0x43e156);}return _0x599b31['status'](_0x43e156)[_0x4034('0x2f')]();};}function respondWithResult(_0x12bbe0,_0x2973d8){_0x2973d8=_0x2973d8||0xc8;return function(_0x4e26cc){if(_0x4e26cc){return _0x12bbe0[_0x4034('0x30')](_0x2973d8)[_0x4034('0x31')](_0x4e26cc);}};}function respondWithFilteredResult(_0x1604f8,_0x4f027c){return function(_0x55ba21){if(_0x55ba21){var _0x35edc5=typeof _0x4f027c[_0x4034('0x32')]===_0x4034('0x33')&&typeof _0x4f027c['limit']===_0x4034('0x33');var _0x239191=_0x55ba21['count'];var _0x3ef446=_0x35edc5?0x0:_0x4f027c[_0x4034('0x32')];var _0x11b90e=_0x35edc5?_0x55ba21[_0x4034('0x34')]:_0x4f027c[_0x4034('0x32')]+_0x4f027c[_0x4034('0x35')];var _0x55336b;if(_0x11b90e>=_0x239191){_0x11b90e=_0x239191;_0x55336b=0xc8;}else{_0x55336b=0xce;}_0x1604f8[_0x4034('0x30')](_0x55336b);return _0x1604f8[_0x4034('0x36')](_0x4034('0x37'),_0x3ef446+'-'+_0x11b90e+'/'+_0x239191)['json'](_0x55ba21);}return null;};}function patchUpdates(_0x59b2fe){return function(_0xb2bf07){try{jsonpatch[_0x4034('0x38')](_0xb2bf07,_0x59b2fe,!![]);}catch(_0x4bbef0){return BPromise[_0x4034('0x39')](_0x4bbef0);}return _0xb2bf07[_0x4034('0x3a')]();};}function saveUpdates(_0x4783c5,_0x50bf3e){return function(_0x5efbf9){if(_0x5efbf9){return _0x5efbf9[_0x4034('0x3b')](_0x4783c5)[_0x4034('0x24')](function(_0x597941){return _0x597941;});}return null;};}function removeEntity(_0x1034c8,_0x52754b){return function(_0x7a9fb8){if(_0x7a9fb8){return _0x7a9fb8[_0x4034('0x3c')]()[_0x4034('0x24')](function(){_0x1034c8[_0x4034('0x30')](0xcc)[_0x4034('0x2f')]();});}};}function handleEntityNotFound(_0x46c9e3,_0x531e5b){return function(_0x4ebf79){if(!_0x4ebf79){_0x46c9e3['sendStatus'](0x194);}return _0x4ebf79;};}function handleError(_0x41803c,_0x57ebd1){_0x57ebd1=_0x57ebd1||0x1f4;return function(_0x25803e){logger[_0x4034('0x29')](_0x25803e[_0x4034('0x3d')]);if(_0x25803e[_0x4034('0x3e')]){delete _0x25803e[_0x4034('0x3e')];}_0x41803c[_0x4034('0x30')](_0x57ebd1)[_0x4034('0x3f')](_0x25803e);};}exports[_0x4034('0x40')]=function(_0x6893f,_0x37b4cd){var _0x165c6f={},_0x55ba16={},_0x4b880b={'count':0x0,'rows':[]};var _0x56c994=_[_0x4034('0x41')](db['ChatMessage'][_0x4034('0x42')],function(_0x254bdb){return{'name':_0x254bdb[_0x4034('0x43')],'type':_0x254bdb[_0x4034('0x44')][_0x4034('0x45')]};});_0x55ba16['model']=_[_0x4034('0x41')](_0x56c994,_0x4034('0x3e'));_0x55ba16[_0x4034('0x46')]=_[_0x4034('0x47')](_0x6893f[_0x4034('0x46')]);_0x55ba16[_0x4034('0x48')]=_[_0x4034('0x49')](_0x55ba16[_0x4034('0x4a')],_0x55ba16[_0x4034('0x46')]);_0x165c6f[_0x4034('0x4b')]=_[_0x4034('0x49')](_0x55ba16[_0x4034('0x4a')],qs[_0x4034('0x4c')](_0x6893f[_0x4034('0x46')][_0x4034('0x4c')]));_0x165c6f['attributes']=_0x165c6f[_0x4034('0x4b')]['length']?_0x165c6f[_0x4034('0x4b')]:_0x55ba16[_0x4034('0x4a')];if(!_0x6893f[_0x4034('0x46')]['hasOwnProperty'](_0x4034('0x4d'))){_0x165c6f[_0x4034('0x35')]=qs['limit'](_0x6893f[_0x4034('0x46')][_0x4034('0x35')]);_0x165c6f[_0x4034('0x32')]=qs[_0x4034('0x32')](_0x6893f[_0x4034('0x46')][_0x4034('0x32')]);}_0x165c6f['order']=qs[_0x4034('0x4e')](_0x6893f[_0x4034('0x46')][_0x4034('0x4e')]);_0x165c6f[_0x4034('0x4f')]=qs[_0x4034('0x48')](_[_0x4034('0x50')](_0x6893f[_0x4034('0x46')],_0x55ba16[_0x4034('0x48')]),_0x56c994);if(_0x6893f[_0x4034('0x46')][_0x4034('0x51')]){_0x165c6f[_0x4034('0x4f')]=_[_0x4034('0x52')](_0x165c6f[_0x4034('0x4f')],{'$or':_[_0x4034('0x41')](_0x56c994,function(_0x1637bc){if(_0x1637bc['type']!==_0x4034('0x53')){var _0x1e7293={};_0x1e7293[_0x1637bc[_0x4034('0x3e')]]={'$like':'%'+_0x6893f[_0x4034('0x46')][_0x4034('0x51')]+'%'};return _0x1e7293;}})});}_0x165c6f=_[_0x4034('0x52')]({},_0x165c6f,_0x6893f[_0x4034('0x54')]);var _0x4a1b14={'where':_0x165c6f[_0x4034('0x4f')]};return db[_0x4034('0x55')][_0x4034('0x34')](_0x4a1b14)['then'](function(_0xa93fed){_0x4b880b[_0x4034('0x34')]=_0xa93fed;if(_0x6893f[_0x4034('0x46')]['includeAll']){_0x165c6f['include']=[{'all':!![]}];}return db[_0x4034('0x55')]['findAll'](_0x165c6f);})['then'](function(_0x52f43b){_0x4b880b[_0x4034('0x56')]=_0x52f43b;return _0x4b880b;})[_0x4034('0x24')](respondWithFilteredResult(_0x37b4cd,_0x165c6f))[_0x4034('0x2d')](handleError(_0x37b4cd,null));};exports[_0x4034('0x57')]=function(_0x3a59a8,_0x34ce2b){var _0x520005={'raw':!![],'where':{'id':_0x3a59a8[_0x4034('0x58')]['id']}},_0x15fd76={};_0x15fd76[_0x4034('0x4a')]=_['keys'](db[_0x4034('0x55')][_0x4034('0x42')]);_0x15fd76['query']=_[_0x4034('0x47')](_0x3a59a8['query']);_0x15fd76[_0x4034('0x48')]=_['intersection'](_0x15fd76[_0x4034('0x4a')],_0x15fd76[_0x4034('0x46')]);_0x520005['attributes']=_[_0x4034('0x49')](_0x15fd76[_0x4034('0x4a')],qs['fields'](_0x3a59a8[_0x4034('0x46')]['fields']));_0x520005['attributes']=_0x520005[_0x4034('0x4b')]['length']?_0x520005[_0x4034('0x4b')]:_0x15fd76[_0x4034('0x4a')];if(_0x3a59a8[_0x4034('0x46')][_0x4034('0x59')]){_0x520005['include']=[{'all':!![]}];}_0x520005=_[_0x4034('0x52')]({},_0x520005,_0x3a59a8['options']);return db[_0x4034('0x55')][_0x4034('0x5a')](_0x520005)[_0x4034('0x24')](handleEntityNotFound(_0x34ce2b,null))[_0x4034('0x24')](respondWithResult(_0x34ce2b,null))[_0x4034('0x2d')](handleError(_0x34ce2b,null));};exports['create']=function(_0x279797,_0x1fce51){return db[_0x4034('0x55')][_0x4034('0x5b')](_0x279797[_0x4034('0x5c')],{})[_0x4034('0x24')](respondWithResult(_0x1fce51,0xc9))['catch'](handleError(_0x1fce51,null));};exports[_0x4034('0x3b')]=function(_0x505982,_0x437c61){if(_0x505982['body']['id']){delete _0x505982[_0x4034('0x5c')]['id'];}return db[_0x4034('0x55')][_0x4034('0x5a')]({'where':{'id':_0x505982[_0x4034('0x58')]['id']}})[_0x4034('0x24')](handleEntityNotFound(_0x437c61,null))[_0x4034('0x24')](saveUpdates(_0x505982['body'],null))['then'](respondWithResult(_0x437c61,null))['catch'](handleError(_0x437c61,null));};exports['destroy']=function(_0x442145,_0x35aee5){return db['ChatMessage'][_0x4034('0x5a')]({'where':{'id':_0x442145[_0x4034('0x58')]['id']}})[_0x4034('0x24')](handleEntityNotFound(_0x35aee5,null))[_0x4034('0x24')](removeEntity(_0x35aee5,null))[_0x4034('0x2d')](handleError(_0x35aee5,null));};exports[_0x4034('0x5d')]=function(_0x1cc3de,_0x45f36e){return db[_0x4034('0x55')][_0x4034('0x5d')]()[_0x4034('0x24')](respondWithResult(_0x45f36e,null))['catch'](handleError(_0x45f36e,null));};var interaction_log=require(_0x4034('0x14'))('chat-interactions');exports[_0x4034('0x5e')]=function(_0x2f4992,_0x166e46,_0xaf61c6){var _0x55207d={'agent':{},'channel':'chat'};if(_0x2f4992[_0x4034('0x5c')]['id']){delete _0x2f4992[_0x4034('0x5c')]['id'];}_0x2f4992[_0x4034('0x5c')][_0x4034('0x5f')]=!![];_0x2f4992[_0x4034('0x5c')]['readAt']=moment()[_0x4034('0x60')](_0x4034('0x61'));_0x2f4992[_0x4034('0x5c')][_0x4034('0x62')]=_0x2f4992['body'][_0x4034('0x62')]||_0x2f4992['user']['id'];_0x55207d['agent']['id']=_0x2f4992[_0x4034('0x5c')][_0x4034('0x62')];return db[_0x4034('0x55')][_0x4034('0x5a')]({'where':{'id':_0x2f4992[_0x4034('0x58')]['id'],'UserId':null}})[_0x4034('0x24')](handleEntityNotFound(_0x166e46,null))['then'](saveUpdates(_0x2f4992[_0x4034('0x5c')],null))[_0x4034('0x24')](function(_0x424f77){if(_0x424f77){_0x55207d[_0x4034('0x2b')]=_0x424f77[_0x4034('0x63')]({'plain':!![]});return db[_0x4034('0x64')]['find']({'where':{'id':_0x424f77[_0x4034('0x65')]}});}return null;})[_0x4034('0x24')](handleEntityNotFound(_0x166e46,null))[_0x4034('0x24')](function(_0xe190e1){if(_0xe190e1){return _0xe190e1[_0x4034('0x3b')]({'UserId':_0x2f4992[_0x4034('0x5c')][_0x4034('0x62')],'read1stAt':_[_0x4034('0x66')](_0xe190e1['read1stAt'])?moment()[_0x4034('0x60')](_0x4034('0x61')):undefined});}return null;})['then'](function(_0x392138){if(_0x392138){_0x55207d[_0x4034('0x67')]=_0x392138['get']({'plain':!![]});interaction_log[_0x4034('0x68')](_0x4034('0x69'),_0x2f4992[_0x4034('0x6a')]['id'],_0x2f4992[_0x4034('0x6a')]['name'],_0x2f4992[_0x4034('0x6a')][_0x4034('0x6b')],_0x55207d[_0x4034('0x67')]['id'],_0x2f4992[_0x4034('0x5c')]?JSON[_0x4034('0x28')](_0x2f4992[_0x4034('0x5c')]):_0x4034('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x4034('0x6d'),_0x55207d);}return null;})[_0x4034('0x24')](function(_0x2c3bca){var _0x238044=_0x4034('0x6e')+_0x2c3bca['message'][_0x4034('0x6f')];return db[_0x4034('0x70')][_0x4034('0x46')](_0x238044,{'type':db[_0x4034('0x71')][_0x4034('0x72')][_0x4034('0x73')],'raw':!![]})[_0x4034('0x24')](function(_0x4fc2f1){return _0x4fc2f1;});})['then'](function(_0x2eda65){if(_0x2eda65){_0x55207d[_0x4034('0x2b')][_0x4034('0x74')]=_0x2eda65[0x0];if(!_0x2f4992['body'][_0x4034('0x62')])return;return db[_0x4034('0x75')][_0x4034('0x5a')]({'where':{'id':_0x2f4992[_0x4034('0x5c')][_0x4034('0x62')],'role':_0x4034('0x76')},'attributes':['id',_0x4034('0x3e'),_0x4034('0x77'),'email',_0x4034('0x78')],'raw':!![]});}return null;})['then'](function(_0xba6ee6){if(!_0xba6ee6)return null;_0x55207d[_0x4034('0x2b')][_0x4034('0x76')]=_0xba6ee6;return _0x55207d;})[_0x4034('0x24')](function(_0x480987){if(_0x480987){if(_0x2f4992['body']['manual']){_0x55207d[_0x4034('0x2b')]['interface']=util[_0x4034('0x60')](_0x4034('0x79'),_0x2f4992[_0x4034('0x6a')]['name']);_0x55207d[_0x4034('0x2b')][_0x4034('0x7a')]=_0x55207d[_0x4034('0x7a')];_0x55207d[_0x4034('0x2b')][_0x4034('0x7b')]=_0x55207d[_0x4034('0x7a')];_0x55207d[_0x4034('0x2b')][_0x4034('0x7c')]=_0x4034('0x5e');return respondWithRpcPromise(_0x4034('0x7d'),_0x4034('0x7d'),{'event':_0x4034('0x7e'),'message':_[_0x4034('0x52')](_0x55207d[_0x4034('0x2b')],JSON[_0x4034('0x7f')](_0x55207d['interaction'][_0x4034('0x80')]))},client9002)['then'](function(){return _0x55207d;});}return _0x55207d;}return null;})['then'](respondWithResult(_0x166e46,null))[_0x4034('0x2d')](handleError(_0x166e46,null));};var interaction_log=require(_0x4034('0x14'))(_0x4034('0x81'));exports[_0x4034('0x39')]=function(_0x5c174a,_0x5a8f39,_0x34eea4){var _0x5c5d48={'agent':{},'channel':_0x4034('0x82')};if(_0x5c174a[_0x4034('0x5c')]['id']){delete _0x5c174a[_0x4034('0x5c')]['id'];}_0x5c174a[_0x4034('0x5c')]['UserId']=_0x5c174a[_0x4034('0x5c')]['UserId']||_0x5c174a['user']['id'];_0x5c5d48[_0x4034('0x76')]['id']=_0x5c174a[_0x4034('0x5c')][_0x4034('0x62')];return db['ChatMessage']['find']({'where':{'id':_0x5c174a[_0x4034('0x58')]['id'],'UserId':null}})[_0x4034('0x24')](handleEntityNotFound(_0x5a8f39,null))['then'](function(_0xb5cf2b){if(_0xb5cf2b){_0x5c5d48[_0x4034('0x2b')]=_0xb5cf2b[_0x4034('0x63')]({'plain':!![]});return db[_0x4034('0x64')][_0x4034('0x5a')]({'where':{'id':_0xb5cf2b[_0x4034('0x65')]}});}return null;})[_0x4034('0x24')](handleEntityNotFound(_0x5a8f39,null))[_0x4034('0x24')](function(_0x2c0cbf){if(_0x2c0cbf){_0x5c5d48[_0x4034('0x67')]=_0x2c0cbf['get']({'plain':!![]});interaction_log['info'](_0x4034('0x83'),_0x5c174a[_0x4034('0x6a')]['id'],_0x5c174a[_0x4034('0x6a')]['name'],_0x5c174a[_0x4034('0x6a')]['role'],_0x5c5d48[_0x4034('0x67')]['id'],_0x5c174a[_0x4034('0x5c')]?JSON[_0x4034('0x28')](_0x5c174a[_0x4034('0x5c')]):'null');return respondWithRpcPromise(_0x4034('0x84'),_0x4034('0x85'),_0x5c5d48);}return null;})['then'](function(_0x577581){var _0x870706=_0x4034('0x6e')+_0x577581[_0x4034('0x2b')][_0x4034('0x6f')];return db['sequelize'][_0x4034('0x46')](_0x870706,{'type':db[_0x4034('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0x4034('0x24')](function(_0x9b9d74){return _0x9b9d74;});})[_0x4034('0x24')](function(_0x540a26){if(_0x540a26){_0x5c5d48[_0x4034('0x2b')][_0x4034('0x74')]=_0x540a26[0x0];if(!_0x5c174a[_0x4034('0x5c')][_0x4034('0x62')])return;return db[_0x4034('0x75')]['find']({'where':{'id':_0x5c174a[_0x4034('0x5c')][_0x4034('0x62')],'role':_0x4034('0x76')},'attributes':['id',_0x4034('0x3e'),_0x4034('0x77'),_0x4034('0x86'),_0x4034('0x78')],'raw':!![]});}return null;})[_0x4034('0x24')](function(_0x4192bf){if(!_0x4192bf)return null;_0x5c5d48[_0x4034('0x2b')]['agent']=_0x4192bf;return _0x5c5d48;})[_0x4034('0x24')](function(_0x395598){if(_0x395598){_0x395598[_0x4034('0x2b')][_0x4034('0x87')]=util[_0x4034('0x60')](_0x4034('0x79'),_0x5c174a[_0x4034('0x6a')]['name']);_0x395598[_0x4034('0x2b')]['channel']=_0x5c5d48[_0x4034('0x7a')];_0x395598[_0x4034('0x2b')][_0x4034('0x7b')]=_0x5c5d48[_0x4034('0x7a')];_0x395598[_0x4034('0x2b')][_0x4034('0x7c')]=_0x4034('0x39');respondWithRpcPromise(_0x4034('0x7d'),_0x4034('0x7d'),{'event':_0x4034('0x88'),'message':_[_0x4034('0x52')](_0x5c5d48[_0x4034('0x2b')],JSON[_0x4034('0x7f')](_0x5c5d48[_0x4034('0x67')][_0x4034('0x80')]))},client9002);return _0x5c5d48;}return null;})['then'](respondWithResult(_0x5a8f39,null))[_0x4034('0x2d')](handleError(_0x5a8f39,null));};
\ No newline at end of file
+var _0x5b34=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatMessage','include','rows','show','params','length','includeAll','create','body','find','describe','../../config/logger','chat','read','UserId','user','agent','get','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','fullname','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','name','send','map','rawAttributes','fieldName','key','model','keys','query','intersection'];(function(_0x3f85b0,_0x88efeb){var _0x2489e2=function(_0x26397a){while(--_0x26397a){_0x3f85b0['push'](_0x3f85b0['shift']());}};_0x2489e2(++_0x88efeb);}(_0x5b34,0x13a));var _0x45b3=function(_0x5056f8,_0x37ec78){_0x5056f8=_0x5056f8-0x0;var _0x3f4532=_0x5b34[_0x5056f8];return _0x3f4532;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x45b3('0x0'));var zipdir=require(_0x45b3('0x1'));var jsonpatch=require(_0x45b3('0x2'));var rp=require(_0x45b3('0x3'));var moment=require('moment');var BPromise=require(_0x45b3('0x4'));var Mustache=require(_0x45b3('0x5'));var util=require('util');var path=require(_0x45b3('0x6'));var sox=require(_0x45b3('0x7'));var csv=require(_0x45b3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x45b3('0x9'));var _=require(_0x45b3('0xa'));var squel=require(_0x45b3('0xb'));var crypto=require(_0x45b3('0xc'));var jsforce=require(_0x45b3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x45b3('0x8'));var querystring=require(_0x45b3('0xe'));var Papa=require('papaparse');var Redis=require(_0x45b3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x45b3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x45b3('0x11'));var logger=require('../../config/logger')(_0x45b3('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x45b3('0x13'));var db=require(_0x45b3('0x14'))['db'];config[_0x45b3('0x15')]=_[_0x45b3('0x16')](config[_0x45b3('0x15')],{'host':_0x45b3('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x45b3('0x15')]));require(_0x45b3('0x18'))[_0x45b3('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36d0e7,_0x382c1d,_0x39e20c,_0x2f6ec8){return new BPromise(function(_0x92e3f3,_0xfdaacc){var _0x14d495=_0x2f6ec8||client;return _0x14d495[_0x45b3('0x1a')](_0x36d0e7,_0x39e20c)[_0x45b3('0x1b')](function(_0x5dd6e7){logger[_0x45b3('0x1c')](_0x45b3('0x1d'),_0x382c1d,_0x45b3('0x1e'));logger[_0x45b3('0x1f')](_0x45b3('0x20'),_0x382c1d,_0x45b3('0x1e'),JSON[_0x45b3('0x21')](_0x5dd6e7));if(_0x5dd6e7[_0x45b3('0x22')]){if(_0x5dd6e7[_0x45b3('0x22')][_0x45b3('0x23')]===0x1f4){logger[_0x45b3('0x22')](_0x45b3('0x1d'),_0x382c1d,_0x5dd6e7['error'][_0x45b3('0x24')]);return _0xfdaacc(_0x5dd6e7[_0x45b3('0x22')][_0x45b3('0x24')]);}logger[_0x45b3('0x22')]('ChatMessage,\x20%s,\x20%s',_0x382c1d,_0x5dd6e7['error'][_0x45b3('0x24')]);return _0x92e3f3(_0x5dd6e7[_0x45b3('0x22')]['message']);}else{logger[_0x45b3('0x1c')](_0x45b3('0x1d'),_0x382c1d,_0x45b3('0x1e'));_0x92e3f3(_0x5dd6e7[_0x45b3('0x25')]['message']);}})[_0x45b3('0x26')](function(_0x461486){logger[_0x45b3('0x22')](_0x45b3('0x1d'),_0x382c1d,_0x461486);_0xfdaacc(_0x461486);});});}function respondWithStatusCode(_0x5d6aae,_0x1eff45){_0x1eff45=_0x1eff45||0xcc;return function(_0x2c4d7a){if(_0x2c4d7a){return _0x5d6aae['sendStatus'](_0x1eff45);}return _0x5d6aae[_0x45b3('0x27')](_0x1eff45)['end']();};}function respondWithResult(_0x4de542,_0x3d7d41){_0x3d7d41=_0x3d7d41||0xc8;return function(_0x17be4c){if(_0x17be4c){return _0x4de542[_0x45b3('0x27')](_0x3d7d41)['json'](_0x17be4c);}};}function respondWithFilteredResult(_0x33ad21,_0x1ebce2){return function(_0x4534db){if(_0x4534db){var _0x2ab7d4=typeof _0x1ebce2[_0x45b3('0x28')]===_0x45b3('0x29')&&typeof _0x1ebce2[_0x45b3('0x2a')]==='undefined';var _0x35e866=_0x4534db[_0x45b3('0x2b')];var _0x1857c9=_0x2ab7d4?0x0:_0x1ebce2[_0x45b3('0x28')];var _0xde9172=_0x2ab7d4?_0x4534db['count']:_0x1ebce2[_0x45b3('0x28')]+_0x1ebce2[_0x45b3('0x2a')];var _0x2fc0fe;if(_0xde9172>=_0x35e866){_0xde9172=_0x35e866;_0x2fc0fe=0xc8;}else{_0x2fc0fe=0xce;}_0x33ad21[_0x45b3('0x27')](_0x2fc0fe);return _0x33ad21[_0x45b3('0x2c')](_0x45b3('0x2d'),_0x1857c9+'-'+_0xde9172+'/'+_0x35e866)[_0x45b3('0x2e')](_0x4534db);}return null;};}function patchUpdates(_0x29b553){return function(_0x18e8a4){try{jsonpatch[_0x45b3('0x2f')](_0x18e8a4,_0x29b553,!![]);}catch(_0x1069eb){return BPromise[_0x45b3('0x30')](_0x1069eb);}return _0x18e8a4[_0x45b3('0x31')]();};}function saveUpdates(_0xe91204,_0x4e9581){return function(_0x51bce1){if(_0x51bce1){return _0x51bce1[_0x45b3('0x32')](_0xe91204)[_0x45b3('0x1b')](function(_0x1f0d79){return _0x1f0d79;});}return null;};}function removeEntity(_0x15362f,_0x1ba5e3){return function(_0x36eb3f){if(_0x36eb3f){return _0x36eb3f[_0x45b3('0x33')]()[_0x45b3('0x1b')](function(){_0x15362f[_0x45b3('0x27')](0xcc)[_0x45b3('0x34')]();});}};}function handleEntityNotFound(_0x55a4ac,_0x263f7a){return function(_0x68ebe8){if(!_0x68ebe8){_0x55a4ac[_0x45b3('0x35')](0x194);}return _0x68ebe8;};}function handleError(_0x4005fc,_0x2d09e4){_0x2d09e4=_0x2d09e4||0x1f4;return function(_0x41778d){logger[_0x45b3('0x22')](_0x41778d['stack']);if(_0x41778d['name']){delete _0x41778d[_0x45b3('0x36')];}_0x4005fc[_0x45b3('0x27')](_0x2d09e4)[_0x45b3('0x37')](_0x41778d);};}exports['index']=function(_0x22b376,_0x247491){var _0xc776a2={},_0x208c4d={},_0x21dadc={'count':0x0,'rows':[]};var _0x5b4855=_[_0x45b3('0x38')](db['ChatMessage'][_0x45b3('0x39')],function(_0x4de599){return{'name':_0x4de599[_0x45b3('0x3a')],'type':_0x4de599['type'][_0x45b3('0x3b')]};});_0x208c4d[_0x45b3('0x3c')]=_[_0x45b3('0x38')](_0x5b4855,_0x45b3('0x36'));_0x208c4d['query']=_[_0x45b3('0x3d')](_0x22b376[_0x45b3('0x3e')]);_0x208c4d['filters']=_[_0x45b3('0x3f')](_0x208c4d[_0x45b3('0x3c')],_0x208c4d['query']);_0xc776a2[_0x45b3('0x40')]=_['intersection'](_0x208c4d[_0x45b3('0x3c')],qs[_0x45b3('0x41')](_0x22b376['query'][_0x45b3('0x41')]));_0xc776a2[_0x45b3('0x40')]=_0xc776a2[_0x45b3('0x40')]['length']?_0xc776a2[_0x45b3('0x40')]:_0x208c4d[_0x45b3('0x3c')];if(!_0x22b376['query'][_0x45b3('0x42')](_0x45b3('0x43'))){_0xc776a2[_0x45b3('0x2a')]=qs[_0x45b3('0x2a')](_0x22b376[_0x45b3('0x3e')][_0x45b3('0x2a')]);_0xc776a2[_0x45b3('0x28')]=qs[_0x45b3('0x28')](_0x22b376[_0x45b3('0x3e')][_0x45b3('0x28')]);}_0xc776a2[_0x45b3('0x44')]=qs[_0x45b3('0x45')](_0x22b376[_0x45b3('0x3e')]['sort']);_0xc776a2[_0x45b3('0x46')]=qs['filters'](_[_0x45b3('0x47')](_0x22b376['query'],_0x208c4d['filters']),_0x5b4855);if(_0x22b376[_0x45b3('0x3e')][_0x45b3('0x48')]){_0xc776a2['where']=_[_0x45b3('0x49')](_0xc776a2[_0x45b3('0x46')],{'$or':_[_0x45b3('0x38')](_0x5b4855,function(_0x5c9483){if(_0x5c9483[_0x45b3('0x4a')]!==_0x45b3('0x4b')){var _0x35bd60={};_0x35bd60[_0x5c9483[_0x45b3('0x36')]]={'$like':'%'+_0x22b376['query'][_0x45b3('0x48')]+'%'};return _0x35bd60;}})});}_0xc776a2=_['merge']({},_0xc776a2,_0x22b376[_0x45b3('0x4c')]);var _0x5a75cf={'where':_0xc776a2['where']};return db[_0x45b3('0x4d')][_0x45b3('0x2b')](_0x5a75cf)[_0x45b3('0x1b')](function(_0x3a4647){_0x21dadc['count']=_0x3a4647;if(_0x22b376[_0x45b3('0x3e')]['includeAll']){_0xc776a2[_0x45b3('0x4e')]=[{'all':!![]}];}return db[_0x45b3('0x4d')]['findAll'](_0xc776a2);})['then'](function(_0x1943fc){_0x21dadc[_0x45b3('0x4f')]=_0x1943fc;return _0x21dadc;})[_0x45b3('0x1b')](respondWithFilteredResult(_0x247491,_0xc776a2))[_0x45b3('0x26')](handleError(_0x247491,null));};exports[_0x45b3('0x50')]=function(_0x1ebae4,_0x21ff7c){var _0x15abb7={'raw':!![],'where':{'id':_0x1ebae4[_0x45b3('0x51')]['id']}},_0x5ebf38={};_0x5ebf38[_0x45b3('0x3c')]=_[_0x45b3('0x3d')](db[_0x45b3('0x4d')][_0x45b3('0x39')]);_0x5ebf38[_0x45b3('0x3e')]=_[_0x45b3('0x3d')](_0x1ebae4[_0x45b3('0x3e')]);_0x5ebf38['filters']=_[_0x45b3('0x3f')](_0x5ebf38[_0x45b3('0x3c')],_0x5ebf38[_0x45b3('0x3e')]);_0x15abb7[_0x45b3('0x40')]=_[_0x45b3('0x3f')](_0x5ebf38[_0x45b3('0x3c')],qs[_0x45b3('0x41')](_0x1ebae4['query'][_0x45b3('0x41')]));_0x15abb7[_0x45b3('0x40')]=_0x15abb7['attributes'][_0x45b3('0x52')]?_0x15abb7[_0x45b3('0x40')]:_0x5ebf38[_0x45b3('0x3c')];if(_0x1ebae4[_0x45b3('0x3e')][_0x45b3('0x53')]){_0x15abb7[_0x45b3('0x4e')]=[{'all':!![]}];}_0x15abb7=_[_0x45b3('0x49')]({},_0x15abb7,_0x1ebae4[_0x45b3('0x4c')]);return db['ChatMessage']['find'](_0x15abb7)[_0x45b3('0x1b')](handleEntityNotFound(_0x21ff7c,null))[_0x45b3('0x1b')](respondWithResult(_0x21ff7c,null))['catch'](handleError(_0x21ff7c,null));};exports[_0x45b3('0x54')]=function(_0x4f1494,_0x41aab1){return db[_0x45b3('0x4d')][_0x45b3('0x54')](_0x4f1494[_0x45b3('0x55')],{})['then'](respondWithResult(_0x41aab1,0xc9))[_0x45b3('0x26')](handleError(_0x41aab1,null));};exports[_0x45b3('0x32')]=function(_0x20b227,_0xff5b69){if(_0x20b227[_0x45b3('0x55')]['id']){delete _0x20b227[_0x45b3('0x55')]['id'];}return db[_0x45b3('0x4d')][_0x45b3('0x56')]({'where':{'id':_0x20b227[_0x45b3('0x51')]['id']}})['then'](handleEntityNotFound(_0xff5b69,null))[_0x45b3('0x1b')](saveUpdates(_0x20b227['body'],null))[_0x45b3('0x1b')](respondWithResult(_0xff5b69,null))[_0x45b3('0x26')](handleError(_0xff5b69,null));};exports[_0x45b3('0x33')]=function(_0x4b8a6c,_0x577353){return db[_0x45b3('0x4d')]['find']({'where':{'id':_0x4b8a6c[_0x45b3('0x51')]['id']}})[_0x45b3('0x1b')](handleEntityNotFound(_0x577353,null))['then'](removeEntity(_0x577353,null))[_0x45b3('0x26')](handleError(_0x577353,null));};exports[_0x45b3('0x57')]=function(_0x17bef8,_0x19efa4){return db[_0x45b3('0x4d')]['describe']()['then'](respondWithResult(_0x19efa4,null))[_0x45b3('0x26')](handleError(_0x19efa4,null));};var interaction_log=require(_0x45b3('0x58'))('chat-interactions');exports['accept']=function(_0x217569,_0x52e395,_0x27dfa5){var _0xaa77b0={'agent':{},'channel':_0x45b3('0x59')};if(_0x217569[_0x45b3('0x55')]['id']){delete _0x217569[_0x45b3('0x55')]['id'];}_0x217569['body'][_0x45b3('0x5a')]=!![];_0x217569[_0x45b3('0x55')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')]=_0x217569['body'][_0x45b3('0x5b')]||_0x217569[_0x45b3('0x5c')]['id'];_0xaa77b0[_0x45b3('0x5d')]['id']=_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')];return db[_0x45b3('0x4d')][_0x45b3('0x56')]({'where':{'id':_0x217569[_0x45b3('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x52e395,null))[_0x45b3('0x1b')](saveUpdates(_0x217569[_0x45b3('0x55')],null))['then'](function(_0x322010){if(_0x322010){_0xaa77b0[_0x45b3('0x24')]=_0x322010[_0x45b3('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x45b3('0x56')]({'where':{'id':_0x322010['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x52e395,null))['then'](function(_0x4cbbb3){if(_0x4cbbb3){return _0x4cbbb3[_0x45b3('0x32')]({'UserId':_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')],'read1stAt':_['isNil'](_0x4cbbb3['read1stAt'])?moment()[_0x45b3('0x5f')](_0x45b3('0x60')):undefined});}return null;})['then'](function(_0x290f72){if(_0x290f72){_0xaa77b0[_0x45b3('0x61')]=_0x290f72['get']({'plain':!![]});interaction_log['info'](_0x45b3('0x62'),_0x217569[_0x45b3('0x5c')]['id'],_0x217569[_0x45b3('0x5c')][_0x45b3('0x36')],_0x217569['user'][_0x45b3('0x63')],_0xaa77b0[_0x45b3('0x61')]['id'],_0x217569[_0x45b3('0x55')]?JSON[_0x45b3('0x21')](_0x217569[_0x45b3('0x55')]):_0x45b3('0x64'));return respondWithRpcPromise(_0x45b3('0x65'),'acceptMessage',_0xaa77b0);}return null;})[_0x45b3('0x1b')](function(_0x1f0533){var _0x3bba4d=_0x45b3('0x66')+_0x1f0533['message'][_0x45b3('0x67')];return db[_0x45b3('0x68')]['query'](_0x3bba4d,{'type':db[_0x45b3('0x69')][_0x45b3('0x6a')][_0x45b3('0x6b')],'raw':!![]})[_0x45b3('0x1b')](function(_0x2af102){return _0x2af102;});})['then'](function(_0x4c3948){if(_0x4c3948){_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x6c')]=_0x4c3948[0x0];if(!_0x217569['body'][_0x45b3('0x5b')])return;return db[_0x45b3('0x6d')][_0x45b3('0x56')]({'where':{'id':_0x217569[_0x45b3('0x55')][_0x45b3('0x5b')],'role':_0x45b3('0x5d')},'attributes':['id','name','fullname',_0x45b3('0x6e'),_0x45b3('0x6f')],'raw':!![]});}return null;})[_0x45b3('0x1b')](function(_0x3d03ea){if(!_0x3d03ea)return null;_0xaa77b0['message'][_0x45b3('0x5d')]=_0x3d03ea;return _0xaa77b0;})[_0x45b3('0x1b')](function(_0x41cb61){if(_0x41cb61){if(_0x217569['body'][_0x45b3('0x70')]){_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x71')]=util[_0x45b3('0x5f')]('SIP/%s',_0x217569[_0x45b3('0x5c')][_0x45b3('0x36')]);_0xaa77b0['message'][_0x45b3('0x72')]=_0xaa77b0[_0x45b3('0x72')];_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x73')]=_0xaa77b0['channel'];_0xaa77b0[_0x45b3('0x24')][_0x45b3('0x74')]=_0x45b3('0x75');return respondWithRpcPromise(_0x45b3('0x76'),_0x45b3('0x76'),{'event':_0x45b3('0x77'),'message':_[_0x45b3('0x49')](_0xaa77b0['message'],JSON[_0x45b3('0x78')](_0xaa77b0[_0x45b3('0x61')][_0x45b3('0x79')]))},client9002)[_0x45b3('0x1b')](function(){return _0xaa77b0;});}return _0xaa77b0;}return null;})[_0x45b3('0x1b')](respondWithResult(_0x52e395,null))[_0x45b3('0x26')](handleError(_0x52e395,null));};var interaction_log=require(_0x45b3('0x58'))(_0x45b3('0x7a'));exports[_0x45b3('0x30')]=function(_0x1658f1,_0x512d14,_0xc61ef0){var _0x5aa96b={'agent':{},'channel':_0x45b3('0x59')};if(_0x1658f1[_0x45b3('0x55')]['id']){delete _0x1658f1[_0x45b3('0x55')]['id'];}_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')]=_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')]||_0x1658f1['user']['id'];_0x5aa96b['agent']['id']=_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')];return db[_0x45b3('0x4d')]['find']({'where':{'id':_0x1658f1[_0x45b3('0x51')]['id'],'UserId':null}})[_0x45b3('0x1b')](handleEntityNotFound(_0x512d14,null))[_0x45b3('0x1b')](function(_0x3b4ca3){if(_0x3b4ca3){_0x5aa96b[_0x45b3('0x24')]=_0x3b4ca3[_0x45b3('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x45b3('0x56')]({'where':{'id':_0x3b4ca3[_0x45b3('0x7b')]}});}return null;})[_0x45b3('0x1b')](handleEntityNotFound(_0x512d14,null))[_0x45b3('0x1b')](function(_0x32ec45){if(_0x32ec45){_0x5aa96b[_0x45b3('0x61')]=_0x32ec45[_0x45b3('0x5e')]({'plain':!![]});interaction_log[_0x45b3('0x1c')](_0x45b3('0x7c'),_0x1658f1['user']['id'],_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x36')],_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x63')],_0x5aa96b[_0x45b3('0x61')]['id'],_0x1658f1[_0x45b3('0x55')]?JSON[_0x45b3('0x21')](_0x1658f1['body']):_0x45b3('0x64'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5aa96b);}return null;})[_0x45b3('0x1b')](function(_0x50daf5){var _0x2f3e1e=_0x45b3('0x66')+_0x50daf5[_0x45b3('0x24')][_0x45b3('0x67')];return db[_0x45b3('0x68')]['query'](_0x2f3e1e,{'type':db[_0x45b3('0x69')][_0x45b3('0x6a')][_0x45b3('0x6b')],'raw':!![]})[_0x45b3('0x1b')](function(_0x4aa05a){return _0x4aa05a;});})[_0x45b3('0x1b')](function(_0x21af2e){if(_0x21af2e){_0x5aa96b['message'][_0x45b3('0x6c')]=_0x21af2e[0x0];if(!_0x1658f1[_0x45b3('0x55')][_0x45b3('0x5b')])return;return db[_0x45b3('0x6d')][_0x45b3('0x56')]({'where':{'id':_0x1658f1['body'][_0x45b3('0x5b')],'role':_0x45b3('0x5d')},'attributes':['id',_0x45b3('0x36'),_0x45b3('0x7d'),'email',_0x45b3('0x6f')],'raw':!![]});}return null;})[_0x45b3('0x1b')](function(_0x520298){if(!_0x520298)return null;_0x5aa96b[_0x45b3('0x24')][_0x45b3('0x5d')]=_0x520298;return _0x5aa96b;})[_0x45b3('0x1b')](function(_0xf9d58b){if(_0xf9d58b){_0xf9d58b[_0x45b3('0x24')]['interface']=util['format']('SIP/%s',_0x1658f1[_0x45b3('0x5c')][_0x45b3('0x36')]);_0xf9d58b['message']['channel']=_0x5aa96b[_0x45b3('0x72')];_0xf9d58b['message']['motionChannel']=_0x5aa96b[_0x45b3('0x72')];_0xf9d58b[_0x45b3('0x24')][_0x45b3('0x74')]='reject';respondWithRpcPromise('EventManager',_0x45b3('0x76'),{'event':'rejectmessage','message':_[_0x45b3('0x49')](_0x5aa96b[_0x45b3('0x24')],JSON[_0x45b3('0x78')](_0x5aa96b['interaction'][_0x45b3('0x79')]))},client9002);return _0x5aa96b;}return null;})['then'](respondWithResult(_0x512d14,null))[_0x45b3('0x26')](handleError(_0x512d14,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 0b37ab4..727f5f0 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 _0xa328=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x4745d9,_0x411b00){var _0x38f2ac=function(_0x436be3){while(--_0x436be3){_0x4745d9['push'](_0x4745d9['shift']());}};_0x38f2ac(++_0x411b00);}(_0xa328,0x17b));var _0x8a32=function(_0x173465,_0x3e4f73){_0x173465=_0x173465-0x0;var _0x5d3808=_0xa328[_0x173465];return _0x5d3808;};'use strict';var EventEmitter=require(_0x8a32('0x0'));var ChatMessage=require(_0x8a32('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8a32('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a32('0x3'),'afterDestroy':_0x8a32('0x4')};function emitEvent(_0x400f09){return function(_0x332807,_0x3d455f,_0x41d4de){ChatMessageEvents['emit'](_0x400f09+':'+_0x332807['id'],_0x332807);ChatMessageEvents[_0x8a32('0x5')](_0x400f09,_0x332807);_0x41d4de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x8a32('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x4f69=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hook'];(function(_0x27650e,_0x278f7a){var _0x28fe08=function(_0x476eee){while(--_0x476eee){_0x27650e['push'](_0x27650e['shift']());}};_0x28fe08(++_0x278f7a);}(_0x4f69,0x91));var _0x94f6=function(_0x3dc85,_0x4f2d39){_0x3dc85=_0x3dc85-0x0;var _0x3e938e=_0x4f69[_0x3dc85];return _0x3e938e;};'use strict';var EventEmitter=require(_0x94f6('0x0'));var ChatMessage=require(_0x94f6('0x1'))['db'][_0x94f6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x94f6('0x3')](0x0);var events={'afterCreate':_0x94f6('0x4'),'afterUpdate':_0x94f6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1277f8){return function(_0x2f96d3,_0x44c6bf,_0x252df9){ChatMessageEvents[_0x94f6('0x6')](_0x1277f8+':'+_0x2f96d3['id'],_0x2f96d3);ChatMessageEvents[_0x94f6('0x6')](_0x1277f8,_0x2f96d3);_0x252df9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x94f6('0x7')](e,emitEvent(event));}}module[_0x94f6('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index ef66af2..d1e586c 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 _0xc99c=['../../config/environment','exports','define','chat_messages','fti_chat_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path'];(function(_0xffd8b0,_0x12c51f){var _0x301ba0=function(_0x103c05){while(--_0x103c05){_0xffd8b0['push'](_0xffd8b0['shift']());}};_0x301ba0(++_0x12c51f);}(_0xc99c,0x166));var _0xcc99=function(_0x54f0e5,_0x243493){_0x54f0e5=_0x54f0e5-0x0;var _0x34f19c=_0xc99c[_0x54f0e5];return _0x34f19c;};'use strict';var _=require('lodash');var util=require(_0xcc99('0x0'));var logger=require('../../config/logger')(_0xcc99('0x1'));var moment=require(_0xcc99('0x2'));var BPromise=require(_0xcc99('0x3'));var rp=require(_0xcc99('0x4'));var fs=require('fs');var path=require(_0xcc99('0x5'));var rimraf=require('rimraf');var config=require(_0xcc99('0x6'));var attributes=require('./chatMessage.attributes');module[_0xcc99('0x7')]=function(_0x1b1941,_0x912de3){return _0x1b1941[_0xcc99('0x8')]('ChatMessage',attributes,{'tableName':_0xcc99('0x9'),'paranoid':![],'indexes':[{'name':_0xcc99('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2753a6,_0x2472a7,_0x2b9945){var _0x336c8e=_0x1b1941[_0xcc99('0xb')];var _0x2313ce=_0x2753a6[_0xcc99('0xc')]({'plain':!![]});if(_0x2313ce[_0xcc99('0xd')]['toLowerCase']()==='in'||_0x2313ce[_0xcc99('0xd')][_0xcc99('0xe')]()===_0xcc99('0xf')&&!_0x2313ce[_0xcc99('0x10')]&&!_[_0xcc99('0x11')](_0x2313ce[_0xcc99('0x12')])){_0x336c8e['ChatInteraction'][_0xcc99('0x13')]({'where':{'id':_0x2313ce[_0xcc99('0x14')]}})[_0xcc99('0x15')](function(_0x5170cd){if(_0x5170cd){_0x5170cd['update']({'lastMsgAt':_0x2313ce[_0xcc99('0x16')],'lastMsgDirection':_0x2313ce[_0xcc99('0xd')][_0xcc99('0xe')]()});}})[_0xcc99('0x17')](function(_0x5900af){console[_0xcc99('0x18')](_0x5900af);});}_0x2b9945();}},'charset':'utf8mb4','collate':_0xcc99('0x19')});};
\ No newline at end of file
+var _0xb15c=['direction','toLowerCase','out','secret','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb15c,0x15e));var _0xcb15=function(_0x973c93,_0x394bd6){_0x973c93=_0x973c93-0x0;var _0xbadd17=_0xb15c[_0x973c93];return _0xbadd17;};'use strict';var _=require('lodash');var util=require(_0xcb15('0x0'));var logger=require('../../config/logger')(_0xcb15('0x1'));var moment=require(_0xcb15('0x2'));var BPromise=require(_0xcb15('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb15('0x4'));module['exports']=function(_0x2db3a3,_0x33ddc1){return _0x2db3a3[_0xcb15('0x5')](_0xcb15('0x6'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xcb15('0x7'),'fields':[_0xcb15('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49e226,_0x27bcce,_0x2b696c){var _0x38a96c=_0x2db3a3['models'];var _0x51b482=_0x49e226[_0xcb15('0x9')]({'plain':!![]});if(_0x51b482[_0xcb15('0xa')][_0xcb15('0xb')]()==='in'||_0x51b482[_0xcb15('0xa')]['toLowerCase']()===_0xcb15('0xc')&&!_0x51b482[_0xcb15('0xd')]&&!_['isNil'](_0x51b482[_0xcb15('0xe')])){_0x38a96c[_0xcb15('0xf')]['findOne']({'where':{'id':_0x51b482[_0xcb15('0x10')]}})[_0xcb15('0x11')](function(_0xd2daab){if(_0xd2daab){_0xd2daab[_0xcb15('0x12')]({'lastMsgAt':_0x51b482[_0xcb15('0x13')],'lastMsgDirection':_0x51b482[_0xcb15('0xa')]['toLowerCase']()});}})[_0xcb15('0x14')](function(_0x15ad37){console[_0xcb15('0x15')](_0x15ad37);});}_0x2b696c();}},'charset':_0xcb15('0x16'),'collate':_0xcb15('0x17')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 62f5123..4f51240 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 _0x6bb0=['stringify','error','code','message','info','result','CreateChatMessage','ChatMessage','create','options','raw','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x50798b,_0x22ccf8){var _0x4b1d26=function(_0x26107f){while(--_0x26107f){_0x50798b['push'](_0x50798b['shift']());}};_0x4b1d26(++_0x22ccf8);}(_0x6bb0,0x6f));var _0x06bb=function(_0x5012a0,_0x25c11b){_0x5012a0=_0x5012a0-0x0;var _0x37839d=_0x6bb0[_0x5012a0];return _0x37839d;};'use strict';var _=require(_0x06bb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06bb('0x1'));var db=require(_0x06bb('0x2'))['db'];var utils=require(_0x06bb('0x3'));var logger=require(_0x06bb('0x4'))(_0x06bb('0x5'));var config=require(_0x06bb('0x6'));var jayson=require(_0x06bb('0x7'));var client=jayson[_0x06bb('0x8')][_0x06bb('0x9')]({'port':0x232a});config[_0x06bb('0xa')]=_[_0x06bb('0xb')](config['redis'],{'host':_0x06bb('0xc'),'port':0x18eb});var socket=require(_0x06bb('0xd'))(new Redis(config[_0x06bb('0xa')]));require(_0x06bb('0xe'))[_0x06bb('0xf')](socket);function respondWithRpcPromise(_0x50459a,_0xdc19b0,_0x2eafd2){return new BPromise(function(_0x27d805,_0x306f37){return client[_0x06bb('0x10')](_0x50459a,_0x2eafd2)[_0x06bb('0x11')](function(_0x457d2f){logger['info'](_0x06bb('0x12'),_0xdc19b0,_0x06bb('0x13'));logger[_0x06bb('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xdc19b0,_0x06bb('0x13'),JSON[_0x06bb('0x15')](_0x457d2f));if(_0x457d2f['error']){if(_0x457d2f[_0x06bb('0x16')][_0x06bb('0x17')]===0x1f4){logger[_0x06bb('0x16')]('ChatMessage,\x20%s,\x20%s',_0xdc19b0,_0x457d2f[_0x06bb('0x16')][_0x06bb('0x18')]);return _0x306f37(_0x457d2f[_0x06bb('0x16')]['message']);}logger[_0x06bb('0x16')](_0x06bb('0x12'),_0xdc19b0,_0x457d2f[_0x06bb('0x16')][_0x06bb('0x18')]);return _0x27d805(_0x457d2f['error'][_0x06bb('0x18')]);}else{logger[_0x06bb('0x19')]('ChatMessage,\x20%s,\x20%s',_0xdc19b0,'request\x20sent');_0x27d805(_0x457d2f[_0x06bb('0x1a')][_0x06bb('0x18')]);}})['catch'](function(_0x422043){logger[_0x06bb('0x16')](_0x06bb('0x12'),_0xdc19b0,_0x422043);_0x306f37(_0x422043);});});}exports[_0x06bb('0x1b')]=function(_0x4e0014){var _0x2306cf=this;return new Promise(function(_0x3c1d54,_0x527523){return db[_0x06bb('0x1c')][_0x06bb('0x1d')](_0x4e0014['body'],{'raw':_0x4e0014[_0x06bb('0x1e')]?_0x4e0014[_0x06bb('0x1e')][_0x06bb('0x1f')]===undefined?!![]:![]:!![]})[_0x06bb('0x11')](function(_0xcacf9a){logger[_0x06bb('0x19')](_0x06bb('0x1b'),_0x4e0014);logger[_0x06bb('0x14')](_0x06bb('0x1b'),_0x4e0014,JSON['stringify'](_0xcacf9a));_0x3c1d54(_0xcacf9a);})[_0x06bb('0x20')](function(_0x5d2e78){logger[_0x06bb('0x16')](_0x06bb('0x1b'),_0x5d2e78[_0x06bb('0x18')],_0x4e0014);_0x527523(_0x2306cf[_0x06bb('0x16')](0x1f4,_0x5d2e78['message']));});});};
\ No newline at end of file
+var _0x7344=['localhost','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3f66bb,_0x14961e){var _0x28f493=function(_0x5482a5){while(--_0x5482a5){_0x3f66bb['push'](_0x3f66bb['shift']());}};_0x28f493(++_0x14961e);}(_0x7344,0xbd));var _0x4734=function(_0x45d0ac,_0x2ca746){_0x45d0ac=_0x45d0ac-0x0;var _0x445ee0=_0x7344[_0x45d0ac];return _0x445ee0;};'use strict';var _=require(_0x4734('0x0'));var util=require(_0x4734('0x1'));var moment=require(_0x4734('0x2'));var BPromise=require(_0x4734('0x3'));var rs=require(_0x4734('0x4'));var fs=require('fs');var Redis=require(_0x4734('0x5'));var db=require(_0x4734('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4734('0x7'))(_0x4734('0x8'));var config=require(_0x4734('0x9'));var jayson=require(_0x4734('0xa'));var client=jayson[_0x4734('0xb')][_0x4734('0xc')]({'port':0x232a});config[_0x4734('0xd')]=_[_0x4734('0xe')](config[_0x4734('0xd')],{'host':_0x4734('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4734('0xd')]));require(_0x4734('0x10'))['register'](socket);function respondWithRpcPromise(_0x214341,_0x65d939,_0x3211a3){return new BPromise(function(_0x23d59b,_0x19eff1){return client['request'](_0x214341,_0x3211a3)[_0x4734('0x11')](function(_0x479842){logger['info'](_0x4734('0x12'),_0x65d939,_0x4734('0x13'));logger[_0x4734('0x14')](_0x4734('0x15'),_0x65d939,'request\x20sent',JSON[_0x4734('0x16')](_0x479842));if(_0x479842[_0x4734('0x17')]){if(_0x479842[_0x4734('0x17')][_0x4734('0x18')]===0x1f4){logger['error'](_0x4734('0x12'),_0x65d939,_0x479842[_0x4734('0x17')][_0x4734('0x19')]);return _0x19eff1(_0x479842['error'][_0x4734('0x19')]);}logger[_0x4734('0x17')](_0x4734('0x12'),_0x65d939,_0x479842['error'][_0x4734('0x19')]);return _0x23d59b(_0x479842['error']['message']);}else{logger[_0x4734('0x1a')](_0x4734('0x12'),_0x65d939,'request\x20sent');_0x23d59b(_0x479842['result'][_0x4734('0x19')]);}})[_0x4734('0x1b')](function(_0x3a9b89){logger[_0x4734('0x17')](_0x4734('0x12'),_0x65d939,_0x3a9b89);_0x19eff1(_0x3a9b89);});});}exports[_0x4734('0x1c')]=function(_0x59d61b){var _0x12dbf2=this;return new Promise(function(_0x58a9f9,_0x425f4a){return db[_0x4734('0x1d')][_0x4734('0x1e')](_0x59d61b[_0x4734('0x1f')],{'raw':_0x59d61b[_0x4734('0x20')]?_0x59d61b[_0x4734('0x20')][_0x4734('0x21')]===undefined?!![]:![]:!![]})[_0x4734('0x11')](function(_0x51bebd){logger['info'](_0x4734('0x1c'),_0x59d61b);logger[_0x4734('0x14')](_0x4734('0x1c'),_0x59d61b,JSON[_0x4734('0x16')](_0x51bebd));_0x58a9f9(_0x51bebd);})['catch'](function(_0x5cd07f){logger[_0x4734('0x17')]('CreateChatMessage',_0x5cd07f[_0x4734('0x19')],_0x59d61b);_0x425f4a(_0x12dbf2['error'](0x1f4,_0x5cd07f[_0x4734('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 645f769..36f10d3 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 _0xf9d5=['length','chatMessage:','save','remove','emit','removeListener'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf9d5,0x122));var _0x5f9d=function(_0x8a3327,_0xcec090){_0x8a3327=_0x8a3327-0x0;var _0x444e06=_0xf9d5[_0x8a3327];return _0x444e06;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5f9d('0x0'),_0x5f9d('0x1'),'update'];function createListener(_0x1b4d74,_0xe4b9ee){return function(_0x21d986){_0xe4b9ee[_0x5f9d('0x2')](_0x1b4d74,_0x21d986);};}function removeListener(_0x25fa8c,_0xdd68fd){return function(){ChatMessageEvents[_0x5f9d('0x3')](_0x25fa8c,_0xdd68fd);};}exports['register']=function(_0x1fc74c){for(var _0x59027b=0x0,_0x24999e=events[_0x5f9d('0x4')];_0x59027b<_0x24999e;_0x59027b++){var _0x4fb9f7=events[_0x59027b];var _0x3420b2=createListener(_0x5f9d('0x5')+_0x4fb9f7,_0x1fc74c);ChatMessageEvents['on'](_0x4fb9f7,_0x3420b2);}};
\ No newline at end of file
+var _0x919e=['save','remove','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x2f42f4,_0x5bddce){var _0x3c1c51=function(_0x292f14){while(--_0x292f14){_0x2f42f4['push'](_0x2f42f4['shift']());}};_0x3c1c51(++_0x5bddce);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xe919('0x0'));var events=[_0xe919('0x1'),_0xe919('0x2'),'update'];function createListener(_0x115b01,_0x55cc54){return function(_0x4f9fcd){_0x55cc54[_0xe919('0x3')](_0x115b01,_0x4f9fcd);};}function removeListener(_0x3a1192,_0x2bf552){return function(){ChatMessageEvents[_0xe919('0x4')](_0x3a1192,_0x2bf552);};}exports[_0xe919('0x5')]=function(_0x5a27ad){for(var _0x1225a5=0x0,_0x493b47=events[_0xe919('0x6')];_0x1225a5<_0x493b47;_0x1225a5++){var _0x2ceb41=events[_0x1225a5];var _0x57c3fe=createListener(_0xe919('0x7')+_0x2ceb41,_0x5a27ad);ChatMessageEvents['on'](_0x2ceb41,_0x57c3fe);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index eae6bc8..5311fd4 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 _0xedc9=['get','isAuthenticated','/describe','/:id','show','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller'];(function(_0x11a6a5,_0x5bba23){var _0x4250de=function(_0x5df2b1){while(--_0x5df2b1){_0x11a6a5['push'](_0x11a6a5['shift']());}};_0x4250de(++_0x5bba23);}(_0xedc9,0x148));var _0x9edc=function(_0x593f03,_0x4af84a){_0x593f03=_0x593f03-0x0;var _0x178299=_0xedc9[_0x593f03];return _0x178299;};'use strict';var multer=require(_0x9edc('0x0'));var util=require(_0x9edc('0x1'));var path=require('path');var timeout=require(_0x9edc('0x2'));var express=require(_0x9edc('0x3'));var router=express['Router']();var fs_extra=require(_0x9edc('0x4'));var auth=require(_0x9edc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9edc('0x6'));var controller=require(_0x9edc('0x7'));router[_0x9edc('0x8')]('/',auth[_0x9edc('0x9')](),controller['index']);router[_0x9edc('0x8')](_0x9edc('0xa'),auth[_0x9edc('0x9')](),controller['describe']);router[_0x9edc('0x8')](_0x9edc('0xb'),auth[_0x9edc('0x9')](),controller[_0x9edc('0xc')]);router['post']('/',auth[_0x9edc('0x9')](),interaction[_0x9edc('0xd')]('chat',_0x9edc('0xe')),controller[_0x9edc('0xf')]);router[_0x9edc('0x10')](_0x9edc('0xb'),controller[_0x9edc('0x11')]);router[_0x9edc('0x10')](_0x9edc('0x12'),auth[_0x9edc('0x9')](),controller[_0x9edc('0x13')]);router[_0x9edc('0x10')](_0x9edc('0x14'),auth['isAuthenticated'](),controller[_0x9edc('0x15')]);router[_0x9edc('0x16')](_0x9edc('0xb'),auth[_0x9edc('0x9')](),controller['destroy']);module[_0x9edc('0x17')]=router;
\ No newline at end of file
+var _0xef09=['show','post','chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xc74264,_0x5a41e9){var _0x238107=function(_0x49ad5c){while(--_0x49ad5c){_0xc74264['push'](_0xc74264['shift']());}};_0x238107(++_0x5a41e9);}(_0xef09,0x11a));var _0x9ef0=function(_0x1962c2,_0x5a098e){_0x1962c2=_0x1962c2-0x0;var _0x50aa8e=_0xef09[_0x1962c2];return _0x50aa8e;};'use strict';var multer=require('multer');var util=require(_0x9ef0('0x0'));var path=require(_0x9ef0('0x1'));var timeout=require(_0x9ef0('0x2'));var express=require(_0x9ef0('0x3'));var router=express[_0x9ef0('0x4')]();var fs_extra=require(_0x9ef0('0x5'));var auth=require(_0x9ef0('0x6'));var interaction=require(_0x9ef0('0x7'));var config=require(_0x9ef0('0x8'));var controller=require('./chatMessage.controller');router[_0x9ef0('0x9')]('/',auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xb')]);router[_0x9ef0('0x9')](_0x9ef0('0xc'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xd')]);router[_0x9ef0('0x9')](_0x9ef0('0xe'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0xf')]);router[_0x9ef0('0x10')]('/',auth[_0x9ef0('0xa')](),interaction['tracked'](_0x9ef0('0x11'),_0x9ef0('0x12')),controller[_0x9ef0('0x13')]);router[_0x9ef0('0x14')](_0x9ef0('0xe'),controller['update']);router[_0x9ef0('0x14')](_0x9ef0('0x15'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x16')]);router[_0x9ef0('0x14')](_0x9ef0('0x17'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x18')]);router[_0x9ef0('0x19')](_0x9ef0('0xe'),auth[_0x9ef0('0xa')](),controller[_0x9ef0('0x1a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 8892f3f..18c8bc2 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 _0x688d=['medium','sequelize','exports','TEXT'];(function(_0xbfec58,_0x5f4153){var _0x3dc84d=function(_0x498ef6){while(--_0x498ef6){_0xbfec58['push'](_0xbfec58['shift']());}};_0x3dc84d(++_0x5f4153);}(_0x688d,0xf5));var _0xd688=function(_0xe87bbd,_0x5aba00){_0xe87bbd=_0xe87bbd-0x0;var _0x25e94f=_0x688d[_0xe87bbd];return _0x25e94f;};'use strict';var Sequelize=require(_0xd688('0x0'));module[_0xd688('0x1')]={'body':{'type':Sequelize[_0xd688('0x2')](_0xd688('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xa65d=['sequelize','TEXT','medium'];(function(_0x3380bc,_0x11e0fb){var _0x540ca2=function(_0x5ef409){while(--_0x5ef409){_0x3380bc['push'](_0x3380bc['shift']());}};_0x540ca2(++_0x11e0fb);}(_0xa65d,0x111));var _0xda65=function(_0x110116,_0x26fcdc){_0x110116=_0x110116-0x0;var _0x579093=_0xa65d[_0x110116];return _0x579093;};'use strict';var Sequelize=require(_0xda65('0x0'));module['exports']={'body':{'type':Sequelize[_0xda65('0x1')](_0xda65('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index da23403..a479286 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(_0x63b7c7,_0x328135){var _0x1ef37b=function(_0x1fd2fb){while(--_0x1fd2fb){_0x63b7c7['push'](_0x63b7c7['shift']());}};_0x1ef37b(++_0x328135);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+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(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0x32b568,_0x353b10){_0x32b568=_0x32b568-0x0;var _0x20425d=_0x7a54[_0x32b568];return _0x20425d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 1fd37ad..d8de5cc 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 _0xcff1=['utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0xe73b25,_0x176e45){var _0x6c7f68=function(_0x27d1b8){while(--_0x27d1b8){_0xe73b25['push'](_0xe73b25['shift']());}};_0x6c7f68(++_0x176e45);}(_0xcff1,0x144));var _0x1cff=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xcff1[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cff('0x0'))(_0x1cff('0x1'));var moment=require(_0x1cff('0x2'));var BPromise=require(_0x1cff('0x3'));var rp=require(_0x1cff('0x4'));var fs=require('fs');var path=require(_0x1cff('0x5'));var rimraf=require(_0x1cff('0x6'));var config=require('../../config/environment');var attributes=require(_0x1cff('0x7'));module[_0x1cff('0x8')]=function(_0x2babf7,_0x51daa7){return _0x2babf7[_0x1cff('0x9')](_0x1cff('0xa'),attributes,{'tableName':_0x1cff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1cff('0xc'),'collate':_0x1cff('0xd')});};
\ No newline at end of file
+var _0x3615=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x53102a,_0x55ecb6){var _0x96f568=function(_0x4d0abe){while(--_0x4d0abe){_0x53102a['push'](_0x53102a['shift']());}};_0x96f568(++_0x55ecb6);}(_0x3615,0x1e0));var _0x5361=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x3615[_0xd09668];return _0x68726;};'use strict';var _=require(_0x5361('0x0'));var util=require(_0x5361('0x1'));var logger=require(_0x5361('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5361('0x3'));var rp=require(_0x5361('0x4'));var fs=require('fs');var path=require(_0x5361('0x5'));var rimraf=require(_0x5361('0x6'));var config=require(_0x5361('0x7'));var attributes=require(_0x5361('0x8'));module[_0x5361('0x9')]=function(_0x170aa3,_0x400914){return _0x170aa3[_0x5361('0xa')](_0x5361('0xb'),attributes,{'tableName':_0x5361('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5361('0xd'),'collate':_0x5361('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7318708..26728e1 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 _0x044c=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x044c,0x1d1));var _0xc044=function(_0x3e9081,_0x6ab6f3){_0x3e9081=_0x3e9081-0x0;var _0x2b98fd=_0x044c[_0x3e9081];return _0x2b98fd;};'use strict';var _=require(_0xc044('0x0'));var util=require(_0xc044('0x1'));var moment=require(_0xc044('0x2'));var BPromise=require(_0xc044('0x3'));var rs=require(_0xc044('0x4'));var fs=require('fs');var Redis=require(_0xc044('0x5'));var db=require(_0xc044('0x6'))['db'];var utils=require(_0xc044('0x7'));var logger=require(_0xc044('0x8'))(_0xc044('0x9'));var config=require(_0xc044('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xc044('0xb')][_0xc044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f1194,_0x590b63,_0x2c2613){return new BPromise(function(_0x1179b7,_0x1c5169){return client[_0xc044('0xd')](_0x1f1194,_0x2c2613)[_0xc044('0xe')](function(_0x837648){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x590b63,_0xc044('0xf'));logger[_0xc044('0x10')](_0xc044('0x11'),_0x590b63,_0xc044('0xf'),JSON[_0xc044('0x12')](_0x837648));if(_0x837648['error']){if(_0x837648[_0xc044('0x13')][_0xc044('0x14')]===0x1f4){logger[_0xc044('0x13')](_0xc044('0x15'),_0x590b63,_0x837648[_0xc044('0x13')][_0xc044('0x16')]);return _0x1c5169(_0x837648['error'][_0xc044('0x16')]);}logger[_0xc044('0x13')](_0xc044('0x15'),_0x590b63,_0x837648[_0xc044('0x13')][_0xc044('0x16')]);return _0x1179b7(_0x837648[_0xc044('0x13')][_0xc044('0x16')]);}else{logger[_0xc044('0x17')]('ChatOfflineMessage,\x20%s,\x20%s',_0x590b63,_0xc044('0xf'));_0x1179b7(_0x837648['result']['message']);}})['catch'](function(_0x5c38c4){logger[_0xc044('0x13')](_0xc044('0x15'),_0x590b63,_0x5c38c4);_0x1c5169(_0x5c38c4);});});}
\ No newline at end of file
+var _0xa454=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request\x20sent','debug'];(function(_0x8924f7,_0x2d690a){var _0x512b8e=function(_0x283696){while(--_0x283696){_0x8924f7['push'](_0x8924f7['shift']());}};_0x512b8e(++_0x2d690a);}(_0xa454,0xa3));var _0x4a45=function(_0x4b4092,_0x378b29){_0x4b4092=_0x4b4092-0x0;var _0xd447f9=_0xa454[_0x4b4092];return _0xd447f9;};'use strict';var _=require(_0x4a45('0x0'));var util=require(_0x4a45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4a45('0x2'));var fs=require('fs');var Redis=require(_0x4a45('0x3'));var db=require(_0x4a45('0x4'))['db'];var utils=require(_0x4a45('0x5'));var logger=require('../../config/logger')(_0x4a45('0x6'));var config=require(_0x4a45('0x7'));var jayson=require(_0x4a45('0x8'));var client=jayson[_0x4a45('0x9')][_0x4a45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f2635,_0x5ca8c1,_0x518106){return new BPromise(function(_0x1ad34c,_0x3a43fa){return client['request'](_0x4f2635,_0x518106)['then'](function(_0x2ba9e9){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5ca8c1,_0x4a45('0xb'));logger[_0x4a45('0xc')](_0x4a45('0xd'),_0x5ca8c1,_0x4a45('0xb'),JSON[_0x4a45('0xe')](_0x2ba9e9));if(_0x2ba9e9[_0x4a45('0xf')]){if(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x10')]===0x1f4){logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);return _0x3a43fa(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);}logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x2ba9e9['error'][_0x4a45('0x12')]);return _0x1ad34c(_0x2ba9e9[_0x4a45('0xf')][_0x4a45('0x12')]);}else{logger[_0x4a45('0x13')](_0x4a45('0x11'),_0x5ca8c1,_0x4a45('0xb'));_0x1ad34c(_0x2ba9e9[_0x4a45('0x14')][_0x4a45('0x12')]);}})[_0x4a45('0x15')](function(_0x4b8932){logger[_0x4a45('0xf')](_0x4a45('0x11'),_0x5ca8c1,_0x4b8932);_0x3a43fa(_0x4b8932);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 919cfed..b86dc53 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 _0x855f=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util','path'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x855f,0x1eb));var _0xf855=function(_0x3f71ad,_0x22f6cd){_0x3f71ad=_0x3f71ad-0x0;var _0x2eef6d=_0x855f[_0x3f71ad];return _0x2eef6d;};'use strict';var multer=require(_0xf855('0x0'));var util=require(_0xf855('0x1'));var path=require(_0xf855('0x2'));var timeout=require('connect-timeout');var express=require(_0xf855('0x3'));var router=express['Router']();var fs_extra=require(_0xf855('0x4'));var auth=require(_0xf855('0x5'));var interaction=require(_0xf855('0x6'));var config=require(_0xf855('0x7'));var controller=require(_0xf855('0x8'));router[_0xf855('0x9')]('/',auth[_0xf855('0xa')](),controller[_0xf855('0xb')]);router['get']('/describe',auth[_0xf855('0xa')](),controller['describe']);router['get'](_0xf855('0xc'),auth[_0xf855('0xa')](),controller[_0xf855('0xd')]);router[_0xf855('0xe')]('/',auth[_0xf855('0xa')](),controller[_0xf855('0xf')]);router['put'](_0xf855('0xc'),auth['isAuthenticated'](),controller[_0xf855('0x10')]);router[_0xf855('0x11')]('/:id',auth[_0xf855('0xa')](),controller['destroy']);module[_0xf855('0x12')]=router;
\ No newline at end of file
+var _0x6d3c=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','destroy','exports'];(function(_0x11511e,_0x59e6c1){var _0x441f30=function(_0x335835){while(--_0x335835){_0x11511e['push'](_0x11511e['shift']());}};_0x441f30(++_0x59e6c1);}(_0x6d3c,0x1d4));var _0xc6d3=function(_0x4891d7,_0x2b3472){_0x4891d7=_0x4891d7-0x0;var _0x4bd2a1=_0x6d3c[_0x4891d7];return _0x4bd2a1;};'use strict';var multer=require(_0xc6d3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc6d3('0x1'));var express=require('express');var router=express[_0xc6d3('0x2')]();var fs_extra=require(_0xc6d3('0x3'));var auth=require(_0xc6d3('0x4'));var interaction=require(_0xc6d3('0x5'));var config=require(_0xc6d3('0x6'));var controller=require(_0xc6d3('0x7'));router[_0xc6d3('0x8')]('/',auth[_0xc6d3('0x9')](),controller[_0xc6d3('0xa')]);router[_0xc6d3('0x8')](_0xc6d3('0xb'),auth[_0xc6d3('0x9')](),controller[_0xc6d3('0xc')]);router[_0xc6d3('0x8')](_0xc6d3('0xd'),auth['isAuthenticated'](),controller[_0xc6d3('0xe')]);router[_0xc6d3('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc6d3('0xd'),auth[_0xc6d3('0x9')](),controller['update']);router['delete'](_0xc6d3('0xd'),auth[_0xc6d3('0x9')](),controller[_0xc6d3('0x10')]);module[_0xc6d3('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index f7dea12..0b52c6f 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 _0xca38=['ENUM','mouseOver','timeout','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xca38,0x8f));var _0x8ca3=function(_0x110a73,_0x1fe4b1){_0x110a73=_0x110a73-0x0;var _0x7ab3c7=_0xca38[_0x110a73];return _0x7ab3c7;};'use strict';var Sequelize=require('sequelize');module[_0x8ca3('0x0')]={'name':{'type':Sequelize[_0x8ca3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8ca3('0x2')](_0x8ca3('0x3'),_0x8ca3('0x4')),'defaultValue':_0x8ca3('0x3')},'selector':{'type':Sequelize[_0x8ca3('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xcff2=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x529afe,_0x36883a){var _0xf42175=function(_0x3b9a94){while(--_0x3b9a94){_0x529afe['push'](_0x529afe['shift']());}};_0xf42175(++_0x36883a);}(_0xcff2,0x117));var _0x2cff=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xcff2[_0x1406ae];return _0x23a076;};'use strict';var Sequelize=require(_0x2cff('0x0'));module[_0x2cff('0x1')]={'name':{'type':Sequelize[_0x2cff('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2cff('0x3')](_0x2cff('0x4'),_0x2cff('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2cff('0x2')]},'timeout':{'type':Sequelize[_0x2cff('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index eefb8c8..a31ac2d 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 _0xaa7c=['find','catch','create','body','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x3d2ab6,_0x1eeeb3){_0x3d2ab6=_0x3d2ab6-0x0;var _0x576d30=_0xaa7c[_0x3d2ab6];return _0x576d30;};'use strict';var emlformat=require(_0xcaa7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcaa7('0x1'));var BPromise=require(_0xcaa7('0x2'));var Mustache=require('mustache');var util=require(_0xcaa7('0x3'));var path=require(_0xcaa7('0x4'));var sox=require(_0xcaa7('0x5'));var csv=require(_0xcaa7('0x6'));var ejs=require(_0xcaa7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcaa7('0x9'));var deskjs=require(_0xcaa7('0xa'));var toCsv=require(_0xcaa7('0x6'));var querystring=require('querystring');var Papa=require(_0xcaa7('0xb'));var Redis=require(_0xcaa7('0xc'));var authService=require(_0xcaa7('0xd'));var qs=require(_0xcaa7('0xe'));var as=require(_0xcaa7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaa7('0x10'))(_0xcaa7('0x11'));var utils=require(_0xcaa7('0x12'));var config=require(_0xcaa7('0x13'));var licenseUtil=require(_0xcaa7('0x14'));var db=require(_0xcaa7('0x15'))['db'];function respondWithStatusCode(_0x563f57,_0x24d3b0){_0x24d3b0=_0x24d3b0||0xcc;return function(_0x128cfb){if(_0x128cfb){return _0x563f57[_0xcaa7('0x16')](_0x24d3b0);}return _0x563f57[_0xcaa7('0x17')](_0x24d3b0)[_0xcaa7('0x18')]();};}function respondWithResult(_0x2eb4ff,_0x299490){_0x299490=_0x299490||0xc8;return function(_0x4a1d5a){if(_0x4a1d5a){return _0x2eb4ff['status'](_0x299490)[_0xcaa7('0x19')](_0x4a1d5a);}};}function respondWithFilteredResult(_0x1c1286,_0x1155fb){return function(_0x1b2c4f){if(_0x1b2c4f){var _0x49a218=typeof _0x1155fb[_0xcaa7('0x1a')]===_0xcaa7('0x1b')&&typeof _0x1155fb[_0xcaa7('0x1c')]===_0xcaa7('0x1b');var _0x46d9b4=_0x1b2c4f[_0xcaa7('0x1d')];var _0x20ede0=_0x49a218?0x0:_0x1155fb['offset'];var _0x53e1cb=_0x49a218?_0x1b2c4f[_0xcaa7('0x1d')]:_0x1155fb[_0xcaa7('0x1a')]+_0x1155fb[_0xcaa7('0x1c')];var _0x3bc53b;if(_0x53e1cb>=_0x46d9b4){_0x53e1cb=_0x46d9b4;_0x3bc53b=0xc8;}else{_0x3bc53b=0xce;}_0x1c1286[_0xcaa7('0x17')](_0x3bc53b);return _0x1c1286[_0xcaa7('0x1e')](_0xcaa7('0x1f'),_0x20ede0+'-'+_0x53e1cb+'/'+_0x46d9b4)['json'](_0x1b2c4f);}return null;};}function patchUpdates(_0x89e8a0){return function(_0x3650ac){try{jsonpatch[_0xcaa7('0x20')](_0x3650ac,_0x89e8a0,!![]);}catch(_0x11cbbf){return BPromise[_0xcaa7('0x21')](_0x11cbbf);}return _0x3650ac[_0xcaa7('0x22')]();};}function saveUpdates(_0x3119d5,_0x4259b7){return function(_0x2a9a79){if(_0x2a9a79){return _0x2a9a79[_0xcaa7('0x23')](_0x3119d5)[_0xcaa7('0x24')](function(_0x140c5a){return _0x140c5a;});}return null;};}function removeEntity(_0x24a18c,_0x56ee3a){return function(_0x97a507){if(_0x97a507){return _0x97a507[_0xcaa7('0x25')]()['then'](function(){_0x24a18c[_0xcaa7('0x17')](0xcc)[_0xcaa7('0x18')]();});}};}function handleEntityNotFound(_0x146e6f,_0x10b638){return function(_0x58384f){if(!_0x58384f){_0x146e6f['sendStatus'](0x194);}return _0x58384f;};}function handleError(_0x3c0b15,_0x3e1f78){_0x3e1f78=_0x3e1f78||0x1f4;return function(_0x3369f2){logger[_0xcaa7('0x26')](_0x3369f2[_0xcaa7('0x27')]);if(_0x3369f2['name']){delete _0x3369f2[_0xcaa7('0x28')];}_0x3c0b15['status'](_0x3e1f78)['send'](_0x3369f2);};}exports[_0xcaa7('0x29')]=function(_0x492362,_0x34a30d){var _0x623f17={'raw':!![],'where':{'id':_0x492362[_0xcaa7('0x2a')]['id']}},_0x748bda={};_0x748bda[_0xcaa7('0x2b')]=_[_0xcaa7('0x2c')](db[_0xcaa7('0x2d')][_0xcaa7('0x2e')]);_0x748bda['query']=_[_0xcaa7('0x2c')](_0x492362[_0xcaa7('0x2f')]);_0x748bda[_0xcaa7('0x30')]=_[_0xcaa7('0x31')](_0x748bda[_0xcaa7('0x2b')],_0x748bda['query']);_0x623f17[_0xcaa7('0x32')]=_[_0xcaa7('0x31')](_0x748bda[_0xcaa7('0x2b')],qs[_0xcaa7('0x33')](_0x492362[_0xcaa7('0x2f')]['fields']));_0x623f17[_0xcaa7('0x32')]=_0x623f17['attributes'][_0xcaa7('0x34')]?_0x623f17[_0xcaa7('0x32')]:_0x748bda[_0xcaa7('0x2b')];if(_0x492362['query'][_0xcaa7('0x35')]){_0x623f17[_0xcaa7('0x36')]=[{'all':!![]}];}_0x623f17=_[_0xcaa7('0x37')]({},_0x623f17,_0x492362[_0xcaa7('0x38')]);return db[_0xcaa7('0x2d')][_0xcaa7('0x39')](_0x623f17)['then'](handleEntityNotFound(_0x34a30d,null))[_0xcaa7('0x24')](respondWithResult(_0x34a30d,null))[_0xcaa7('0x3a')](handleError(_0x34a30d,null));};exports['create']=function(_0x455f6e,_0x43b8de){return db[_0xcaa7('0x2d')][_0xcaa7('0x3b')](_0x455f6e['body'],{})[_0xcaa7('0x24')](respondWithResult(_0x43b8de,0xc9))[_0xcaa7('0x3a')](handleError(_0x43b8de,null));};exports[_0xcaa7('0x23')]=function(_0x25bc49,_0x321e12){if(_0x25bc49[_0xcaa7('0x3c')]['id']){delete _0x25bc49[_0xcaa7('0x3c')]['id'];}return db[_0xcaa7('0x2d')][_0xcaa7('0x39')]({'where':{'id':_0x25bc49[_0xcaa7('0x2a')]['id']}})[_0xcaa7('0x24')](handleEntityNotFound(_0x321e12,null))[_0xcaa7('0x24')](saveUpdates(_0x25bc49['body'],null))[_0xcaa7('0x24')](respondWithResult(_0x321e12,null))[_0xcaa7('0x3a')](handleError(_0x321e12,null));};exports[_0xcaa7('0x25')]=function(_0x2e4262,_0x5f1028){return db['ChatProactiveAction'][_0xcaa7('0x39')]({'where':{'id':_0x2e4262[_0xcaa7('0x2a')]['id']}})[_0xcaa7('0x24')](handleEntityNotFound(_0x5f1028,null))['then'](removeEntity(_0x5f1028,null))[_0xcaa7('0x3a')](handleError(_0x5f1028,null));};
\ No newline at end of file
+var _0x56a6=['util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','stack','name','send','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','model','fields','merge','options','find','create','body','catch','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x3ee4c6,_0xb63080){var _0x26956d=function(_0x5aac2d){while(--_0x5aac2d){_0x3ee4c6['push'](_0x3ee4c6['shift']());}};_0x26956d(++_0xb63080);}(_0x56a6,0x17b));var _0x656a=function(_0x4895b5,_0x8ac595){_0x4895b5=_0x4895b5-0x0;var _0x1da8da=_0x56a6[_0x4895b5];return _0x1da8da;};'use strict';var emlformat=require(_0x656a('0x0'));var rimraf=require(_0x656a('0x1'));var zipdir=require(_0x656a('0x2'));var jsonpatch=require(_0x656a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x656a('0x4'));var Mustache=require(_0x656a('0x5'));var util=require(_0x656a('0x6'));var path=require('path');var sox=require(_0x656a('0x7'));var csv=require(_0x656a('0x8'));var ejs=require(_0x656a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x656a('0xa'));var squel=require(_0x656a('0xb'));var crypto=require(_0x656a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x656a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x656a('0xe'));var Redis=require(_0x656a('0xf'));var authService=require(_0x656a('0x10'));var qs=require(_0x656a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x656a('0x12'));var logger=require(_0x656a('0x13'))(_0x656a('0x14'));var utils=require(_0x656a('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16312b,_0x32a319){_0x32a319=_0x32a319||0xcc;return function(_0x2ab2d7){if(_0x2ab2d7){return _0x16312b[_0x656a('0x16')](_0x32a319);}return _0x16312b[_0x656a('0x17')](_0x32a319)['end']();};}function respondWithResult(_0x30e0ab,_0x2721cd){_0x2721cd=_0x2721cd||0xc8;return function(_0x36b24e){if(_0x36b24e){return _0x30e0ab[_0x656a('0x17')](_0x2721cd)[_0x656a('0x18')](_0x36b24e);}};}function respondWithFilteredResult(_0x29f176,_0x55ed){return function(_0x3c8d71){if(_0x3c8d71){var _0x552b5b=typeof _0x55ed[_0x656a('0x19')]===_0x656a('0x1a')&&typeof _0x55ed[_0x656a('0x1b')]===_0x656a('0x1a');var _0x3bade4=_0x3c8d71[_0x656a('0x1c')];var _0x28cd04=_0x552b5b?0x0:_0x55ed[_0x656a('0x19')];var _0x2f186f=_0x552b5b?_0x3c8d71['count']:_0x55ed[_0x656a('0x19')]+_0x55ed[_0x656a('0x1b')];var _0x36e416;if(_0x2f186f>=_0x3bade4){_0x2f186f=_0x3bade4;_0x36e416=0xc8;}else{_0x36e416=0xce;}_0x29f176[_0x656a('0x17')](_0x36e416);return _0x29f176[_0x656a('0x1d')](_0x656a('0x1e'),_0x28cd04+'-'+_0x2f186f+'/'+_0x3bade4)[_0x656a('0x18')](_0x3c8d71);}return null;};}function patchUpdates(_0x1cecf4){return function(_0x53661e){try{jsonpatch[_0x656a('0x1f')](_0x53661e,_0x1cecf4,!![]);}catch(_0x50be0e){return BPromise['reject'](_0x50be0e);}return _0x53661e['save']();};}function saveUpdates(_0x53c0b6,_0x124f76){return function(_0x404fa6){if(_0x404fa6){return _0x404fa6['update'](_0x53c0b6)[_0x656a('0x20')](function(_0x326a75){return _0x326a75;});}return null;};}function removeEntity(_0x39d148,_0x519ef3){return function(_0x37565e){if(_0x37565e){return _0x37565e[_0x656a('0x21')]()[_0x656a('0x20')](function(){_0x39d148[_0x656a('0x17')](0xcc)[_0x656a('0x22')]();});}};}function handleEntityNotFound(_0xc2860f,_0xa9ec33){return function(_0x15271f){if(!_0x15271f){_0xc2860f['sendStatus'](0x194);}return _0x15271f;};}function handleError(_0x988ef0,_0x4c79cd){_0x4c79cd=_0x4c79cd||0x1f4;return function(_0x223d67){logger['error'](_0x223d67[_0x656a('0x23')]);if(_0x223d67['name']){delete _0x223d67[_0x656a('0x24')];}_0x988ef0['status'](_0x4c79cd)[_0x656a('0x25')](_0x223d67);};}exports['show']=function(_0x55abd2,_0x47bcc0){var _0x2a00ba={'raw':!![],'where':{'id':_0x55abd2[_0x656a('0x26')]['id']}},_0x49a723={};_0x49a723['model']=_[_0x656a('0x27')](db[_0x656a('0x28')][_0x656a('0x29')]);_0x49a723[_0x656a('0x2a')]=_['keys'](_0x55abd2['query']);_0x49a723[_0x656a('0x2b')]=_[_0x656a('0x2c')](_0x49a723['model'],_0x49a723[_0x656a('0x2a')]);_0x2a00ba[_0x656a('0x2d')]=_[_0x656a('0x2c')](_0x49a723[_0x656a('0x2e')],qs['fields'](_0x55abd2['query'][_0x656a('0x2f')]));_0x2a00ba[_0x656a('0x2d')]=_0x2a00ba['attributes']['length']?_0x2a00ba[_0x656a('0x2d')]:_0x49a723[_0x656a('0x2e')];if(_0x55abd2[_0x656a('0x2a')]['includeAll']){_0x2a00ba['include']=[{'all':!![]}];}_0x2a00ba=_[_0x656a('0x30')]({},_0x2a00ba,_0x55abd2[_0x656a('0x31')]);return db[_0x656a('0x28')][_0x656a('0x32')](_0x2a00ba)[_0x656a('0x20')](handleEntityNotFound(_0x47bcc0,null))[_0x656a('0x20')](respondWithResult(_0x47bcc0,null))['catch'](handleError(_0x47bcc0,null));};exports['create']=function(_0x375b4b,_0x401b45){return db['ChatProactiveAction'][_0x656a('0x33')](_0x375b4b[_0x656a('0x34')],{})['then'](respondWithResult(_0x401b45,0xc9))[_0x656a('0x35')](handleError(_0x401b45,null));};exports[_0x656a('0x36')]=function(_0x14d074,_0x37847e){if(_0x14d074[_0x656a('0x34')]['id']){delete _0x14d074[_0x656a('0x34')]['id'];}return db[_0x656a('0x28')][_0x656a('0x32')]({'where':{'id':_0x14d074[_0x656a('0x26')]['id']}})['then'](handleEntityNotFound(_0x37847e,null))['then'](saveUpdates(_0x14d074['body'],null))[_0x656a('0x20')](respondWithResult(_0x37847e,null))['catch'](handleError(_0x37847e,null));};exports[_0x656a('0x21')]=function(_0x3c2481,_0x12b2de){return db[_0x656a('0x28')]['find']({'where':{'id':_0x3c2481[_0x656a('0x26')]['id']}})[_0x656a('0x20')](handleEntityNotFound(_0x12b2de,null))[_0x656a('0x20')](removeEntity(_0x12b2de,null))[_0x656a('0x35')](handleError(_0x12b2de,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 3f6066f..bb99a64 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 _0xb0e7=['exports','ChatProactiveAction','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x480cca,_0x33709f){var _0x22bcdb=function(_0x15ab17){while(--_0x15ab17){_0x480cca['push'](_0x480cca['shift']());}};_0x22bcdb(++_0x33709f);}(_0xb0e7,0x1c4));var _0x7b0e=function(_0x40e8b4,_0x5b9d81){_0x40e8b4=_0x40e8b4-0x0;var _0x335a50=_0xb0e7[_0x40e8b4];return _0x335a50;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7b0e('0x0'));var moment=require(_0x7b0e('0x1'));var BPromise=require(_0x7b0e('0x2'));var rp=require(_0x7b0e('0x3'));var fs=require('fs');var path=require(_0x7b0e('0x4'));var rimraf=require(_0x7b0e('0x5'));var config=require(_0x7b0e('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x7b0e('0x7')]=function(_0x31fa01,_0x53081a){return _0x31fa01['define'](_0x7b0e('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5781=['../../config/logger','moment','bluebird','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util'];(function(_0x177b20,_0x4b396d){var _0x53d1e8=function(_0x5f91f2){while(--_0x5f91f2){_0x177b20['push'](_0x177b20['shift']());}};_0x53d1e8(++_0x4b396d);}(_0x5781,0x120));var _0x1578=function(_0xc8a63e,_0x5463f2){_0xc8a63e=_0xc8a63e-0x0;var _0x38f889=_0x5781[_0xc8a63e];return _0x38f889;};'use strict';var _=require(_0x1578('0x0'));var util=require(_0x1578('0x1'));var logger=require(_0x1578('0x2'))('api');var moment=require(_0x1578('0x3'));var BPromise=require(_0x1578('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1578('0x5'));var attributes=require(_0x1578('0x6'));module[_0x1578('0x7')]=function(_0x2bcde7,_0x3baacb){return _0x2bcde7[_0x1578('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x1578('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 4a8cb94..0c0e2c2 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 _0xb6d2=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4f3b3c,_0x4257c4){var _0x25c181=function(_0x5de512){while(--_0x5de512){_0x4f3b3c['push'](_0x4f3b3c['shift']());}};_0x25c181(++_0x4257c4);}(_0xb6d2,0x9d));var _0x2b6d=function(_0x48dfae,_0xffdc40){_0x48dfae=_0x48dfae-0x0;var _0x2f379d=_0xb6d2[_0x48dfae];return _0x2f379d;};'use strict';var _=require(_0x2b6d('0x0'));var util=require(_0x2b6d('0x1'));var moment=require('moment');var BPromise=require(_0x2b6d('0x2'));var rs=require(_0x2b6d('0x3'));var fs=require('fs');var Redis=require(_0x2b6d('0x4'));var db=require(_0x2b6d('0x5'))['db'];var utils=require(_0x2b6d('0x6'));var logger=require(_0x2b6d('0x7'))(_0x2b6d('0x8'));var config=require(_0x2b6d('0x9'));var jayson=require(_0x2b6d('0xa'));var client=jayson['client'][_0x2b6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55240b,_0x45ee54,_0x4cf5bb){return new BPromise(function(_0x2feecc,_0x4dd3a3){return client['request'](_0x55240b,_0x4cf5bb)[_0x2b6d('0xc')](function(_0x4b8f51){logger[_0x2b6d('0xd')](_0x2b6d('0xe'),_0x45ee54,_0x2b6d('0xf'));logger[_0x2b6d('0x10')](_0x2b6d('0x11'),_0x45ee54,_0x2b6d('0xf'),JSON[_0x2b6d('0x12')](_0x4b8f51));if(_0x4b8f51['error']){if(_0x4b8f51[_0x2b6d('0x13')]['code']===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x45ee54,_0x4b8f51[_0x2b6d('0x13')][_0x2b6d('0x14')]);return _0x4dd3a3(_0x4b8f51[_0x2b6d('0x13')]['message']);}logger[_0x2b6d('0x13')](_0x2b6d('0xe'),_0x45ee54,_0x4b8f51[_0x2b6d('0x13')][_0x2b6d('0x14')]);return _0x2feecc(_0x4b8f51[_0x2b6d('0x13')][_0x2b6d('0x14')]);}else{logger[_0x2b6d('0xd')](_0x2b6d('0xe'),_0x45ee54,_0x2b6d('0xf'));_0x2feecc(_0x4b8f51[_0x2b6d('0x15')][_0x2b6d('0x14')]);}})['catch'](function(_0x3992e7){logger[_0x2b6d('0x13')](_0x2b6d('0xe'),_0x45ee54,_0x3992e7);_0x4dd3a3(_0x3992e7);});});}
\ No newline at end of file
+var _0x98bf=['message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x34c300,_0x45abcc){var _0x272bb0=function(_0x5ca010){while(--_0x5ca010){_0x34c300['push'](_0x34c300['shift']());}};_0x272bb0(++_0x45abcc);}(_0x98bf,0x163));var _0xf98b=function(_0x1eead3,_0x18f32b){_0x1eead3=_0x1eead3-0x0;var _0x12a236=_0x98bf[_0x1eead3];return _0x12a236;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf98b('0x0'));var BPromise=require(_0xf98b('0x1'));var rs=require(_0xf98b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf98b('0x3'));var logger=require(_0xf98b('0x4'))(_0xf98b('0x5'));var config=require(_0xf98b('0x6'));var jayson=require(_0xf98b('0x7'));var client=jayson[_0xf98b('0x8')][_0xf98b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x10d0bf,_0x8f6a93,_0x24bac3){return new BPromise(function(_0x2223d8,_0x362444){return client[_0xf98b('0xa')](_0x10d0bf,_0x24bac3)[_0xf98b('0xb')](function(_0x480cc0){logger[_0xf98b('0xc')](_0xf98b('0xd'),_0x8f6a93,_0xf98b('0xe'));logger[_0xf98b('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x8f6a93,_0xf98b('0xe'),JSON[_0xf98b('0x10')](_0x480cc0));if(_0x480cc0['error']){if(_0x480cc0[_0xf98b('0x11')][_0xf98b('0x12')]===0x1f4){logger[_0xf98b('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8f6a93,_0x480cc0[_0xf98b('0x11')][_0xf98b('0x13')]);return _0x362444(_0x480cc0[_0xf98b('0x11')]['message']);}logger[_0xf98b('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8f6a93,_0x480cc0['error']['message']);return _0x2223d8(_0x480cc0['error'][_0xf98b('0x13')]);}else{logger['info'](_0xf98b('0xd'),_0x8f6a93,_0xf98b('0xe'));_0x2223d8(_0x480cc0[_0xf98b('0x14')][_0xf98b('0x13')]);}})[_0xf98b('0x15')](function(_0x9253a9){logger[_0xf98b('0x11')](_0xf98b('0xd'),_0x8f6a93,_0x9253a9);_0x362444(_0x9253a9);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index b74fe00..f4e16d1 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 _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0xadde0d,_0x542e43){var _0x3654e2=function(_0x35330c){while(--_0x35330c){_0xadde0d['push'](_0xadde0d['shift']());}};_0x3654e2(++_0x542e43);}(_0xf494,0x1c6));var _0x4f49=function(_0x2d2005,_0x4949db){_0x2d2005=_0x2d2005-0x0;var _0x45df97=_0xf494[_0x2d2005];return _0x45df97;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router;
\ No newline at end of file
+var _0xf2ca=['show','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x49382a,_0x55219c){var _0x25733f=function(_0x5eb8f9){while(--_0x5eb8f9){_0x49382a['push'](_0x49382a['shift']());}};_0x25733f(++_0x55219c);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xf2ca[_0x3f993e];return _0x39c135;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var fs_extra=require(_0xaf2c('0x5'));var auth=require(_0xaf2c('0x6'));var interaction=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xaf2c('0x9')](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xc')]);router['post']('/',auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xd')]);router['put'](_0xaf2c('0xa'),auth['isAuthenticated'](),controller[_0xaf2c('0xe')]);router['delete'](_0xaf2c('0xa'),auth[_0xaf2c('0xb')](),controller[_0xaf2c('0xf')]);module[_0xaf2c('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 8faeac0..7af76cc 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 _0xc351=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1a786f,_0x56b6d8){var _0x12c96a=function(_0x1f86f0){while(--_0x1f86f0){_0x1a786f['push'](_0x1a786f['shift']());}};_0x12c96a(++_0x56b6d8);}(_0xc351,0xa8));var _0x1c35=function(_0x4a01f5,_0x2afa35){_0x4a01f5=_0x4a01f5-0x0;var _0x27e20e=_0xc351[_0x4a01f5];return _0x27e20e;};'use strict';var Sequelize=require('sequelize');module[_0x1c35('0x0')]={'name':{'type':Sequelize[_0x1c35('0x1')],'unique':_0x1c35('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1c35('0x1')]},'timeout':{'type':Sequelize[_0x1c35('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1c35('0x4')](_0x1c35('0x5'),_0x1c35('0x6'),_0x1c35('0x7'))}};
\ No newline at end of file
+var _0xac7a=['sequelize','STRING','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xac7a,0x198));var _0xaac7=function(_0x42e350,_0x1c5490){_0x42e350=_0x42e350-0x0;var _0x36cd7b=_0xac7a[_0x42e350];return _0x36cd7b;};'use strict';var Sequelize=require(_0xaac7('0x0'));module['exports']={'name':{'type':Sequelize[_0xaac7('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaac7('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaac7('0x3')](_0xaac7('0x4'),'beepall',_0xaac7('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f79bb60..3861bbb 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 _0xffcb=['stringify','error','message','result','catch','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','then','stack','name','index','map','ChatQueue','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','findAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','keys','pick','UserChatQueue','User','UserId','agent','updatedAt','createdAt','%s/%s','SIP','chatPause','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','Team','select','field','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','zip-dir','request-promise','moment','bluebird','mustache','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x48ca37,_0x5519d7){var _0x3fc45c=function(_0x399324){while(--_0x399324){_0x48ca37['push'](_0x48ca37['shift']());}};_0x3fc45c(++_0x5519d7);}(_0xffcb,0x107));var _0xbffc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xffcb[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbffc('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbffc('0x1'));var moment=require(_0xbffc('0x2'));var BPromise=require(_0xbffc('0x3'));var Mustache=require(_0xbffc('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbffc('0x5'));var csv=require(_0xbffc('0x6'));var ejs=require(_0xbffc('0x7'));var fs=require('fs');var fs_extra=require(_0xbffc('0x8'));var _=require(_0xbffc('0x9'));var squel=require(_0xbffc('0xa'));var crypto=require(_0xbffc('0xb'));var jsforce=require(_0xbffc('0xc'));var deskjs=require(_0xbffc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbffc('0xe'));var Papa=require(_0xbffc('0xf'));var Redis=require(_0xbffc('0x10'));var authService=require(_0xbffc('0x11'));var qs=require(_0xbffc('0x12'));var as=require(_0xbffc('0x13'));var hardwareService=require(_0xbffc('0x14'));var logger=require(_0xbffc('0x15'))('api');var utils=require(_0xbffc('0x16'));var config=require(_0xbffc('0x17'));var licenseUtil=require(_0xbffc('0x18'));var db=require('../../mysqldb')['db'];config[_0xbffc('0x19')]=_['defaults'](config[_0xbffc('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbffc('0x1a'))(new Redis(config['redis']));require(_0xbffc('0x1b'))[_0xbffc('0x1c')](socket);var jayson=require(_0xbffc('0x1d'));var client=jayson[_0xbffc('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1999bf,_0x1aa4bc,_0x500f66,_0x52f7f7){return new BPromise(function(_0x454b17,_0xdd1e64){var _0x416414=_0x52f7f7||client;return _0x416414[_0xbffc('0x1f')](_0x1999bf,_0x500f66)['then'](function(_0x439dd5){logger[_0xbffc('0x20')](_0xbffc('0x21'),_0x1aa4bc,_0xbffc('0x22'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1aa4bc,_0xbffc('0x22'),JSON[_0xbffc('0x23')](_0x439dd5));if(_0x439dd5[_0xbffc('0x24')]){if(_0x439dd5[_0xbffc('0x24')]['code']===0x1f4){logger['error'](_0xbffc('0x21'),_0x1aa4bc,_0x439dd5['error'][_0xbffc('0x25')]);return _0xdd1e64(_0x439dd5[_0xbffc('0x24')][_0xbffc('0x25')]);}logger[_0xbffc('0x24')](_0xbffc('0x21'),_0x1aa4bc,_0x439dd5[_0xbffc('0x24')][_0xbffc('0x25')]);return _0x454b17(_0x439dd5[_0xbffc('0x24')][_0xbffc('0x25')]);}else{logger[_0xbffc('0x20')](_0xbffc('0x21'),_0x1aa4bc,_0xbffc('0x22'));_0x454b17(_0x439dd5[_0xbffc('0x26')]['message']);}})[_0xbffc('0x27')](function(_0x158a48){logger[_0xbffc('0x24')](_0xbffc('0x21'),_0x1aa4bc,_0x158a48);_0xdd1e64(_0x158a48);});});}function respondWithStatusCode(_0x411268,_0x49a705){_0x49a705=_0x49a705||0xcc;return function(_0x224bec){if(_0x224bec){return _0x411268[_0xbffc('0x28')](_0x49a705);}return _0x411268[_0xbffc('0x29')](_0x49a705)[_0xbffc('0x2a')]();};}function respondWithResult(_0x5e9c55,_0x49384a){_0x49384a=_0x49384a||0xc8;return function(_0x2061d0){if(_0x2061d0){return _0x5e9c55[_0xbffc('0x29')](_0x49384a)[_0xbffc('0x2b')](_0x2061d0);}};}function respondWithFilteredResult(_0x459bd1,_0x444daa){return function(_0x59cc92){if(_0x59cc92){var _0x4b8ac6=typeof _0x444daa['offset']==='undefined'&&typeof _0x444daa[_0xbffc('0x2c')]==='undefined';var _0x16450c=_0x59cc92['count'];var _0x354d78=_0x4b8ac6?0x0:_0x444daa['offset'];var _0x37f222=_0x4b8ac6?_0x59cc92[_0xbffc('0x2d')]:_0x444daa[_0xbffc('0x2e')]+_0x444daa['limit'];var _0x445d51;if(_0x37f222>=_0x16450c){_0x37f222=_0x16450c;_0x445d51=0xc8;}else{_0x445d51=0xce;}_0x459bd1[_0xbffc('0x29')](_0x445d51);return _0x459bd1[_0xbffc('0x2f')](_0xbffc('0x30'),_0x354d78+'-'+_0x37f222+'/'+_0x16450c)[_0xbffc('0x2b')](_0x59cc92);}return null;};}function patchUpdates(_0x3dbc16){return function(_0x37c5f6){try{jsonpatch[_0xbffc('0x31')](_0x37c5f6,_0x3dbc16,!![]);}catch(_0x10d876){return BPromise['reject'](_0x10d876);}return _0x37c5f6[_0xbffc('0x32')]();};}function saveUpdates(_0x170541,_0x15b6a3){return function(_0x4e768d){if(_0x4e768d){return _0x4e768d[_0xbffc('0x33')](_0x170541)['then'](function(_0x4d54b5){return _0x4d54b5;});}return null;};}function removeEntity(_0x1a136f,_0xf6a31c){return function(_0x32985c){if(_0x32985c){return _0x32985c[_0xbffc('0x34')]()['then'](function(){var _0x4d87d8=_0x32985c[_0xbffc('0x35')]({'plain':!![]});var _0x189883='ChatQueues';return db[_0xbffc('0x36')][_0xbffc('0x34')]({'where':{'type':_0x189883,'resourceId':_0x4d87d8['id']}})[_0xbffc('0x37')](function(){return _0x32985c;});})[_0xbffc('0x37')](function(){_0x1a136f[_0xbffc('0x29')](0xcc)[_0xbffc('0x2a')]();});}};}function handleEntityNotFound(_0x574d31,_0x16eb5e){return function(_0x3b4e96){if(!_0x3b4e96){_0x574d31[_0xbffc('0x28')](0x194);}return _0x3b4e96;};}function handleError(_0x2ccb9d,_0x2fb110){_0x2fb110=_0x2fb110||0x1f4;return function(_0x148de3){logger['error'](_0x148de3[_0xbffc('0x38')]);if(_0x148de3[_0xbffc('0x39')]){delete _0x148de3[_0xbffc('0x39')];}_0x2ccb9d[_0xbffc('0x29')](_0x2fb110)['send'](_0x148de3);};}exports[_0xbffc('0x3a')]=function(_0x187181,_0x558916){var _0x426e19={},_0x31f2c3={},_0x3a87a4={'count':0x0,'rows':[]};var _0x278362=_[_0xbffc('0x3b')](db[_0xbffc('0x3c')][_0xbffc('0x3d')],function(_0x2b2c53){return{'name':_0x2b2c53['fieldName'],'type':_0x2b2c53[_0xbffc('0x3e')][_0xbffc('0x3f')]};});_0x31f2c3[_0xbffc('0x40')]=_['map'](_0x278362,_0xbffc('0x39'));_0x31f2c3['query']=_['keys'](_0x187181[_0xbffc('0x41')]);_0x31f2c3[_0xbffc('0x42')]=_[_0xbffc('0x43')](_0x31f2c3['model'],_0x31f2c3[_0xbffc('0x41')]);_0x426e19['attributes']=_[_0xbffc('0x43')](_0x31f2c3['model'],qs[_0xbffc('0x44')](_0x187181[_0xbffc('0x41')]['fields']));_0x426e19[_0xbffc('0x45')]=_0x426e19[_0xbffc('0x45')][_0xbffc('0x46')]?_0x426e19[_0xbffc('0x45')]:_0x31f2c3[_0xbffc('0x40')];if(!_0x187181[_0xbffc('0x41')][_0xbffc('0x47')](_0xbffc('0x48'))){_0x426e19[_0xbffc('0x2c')]=qs[_0xbffc('0x2c')](_0x187181[_0xbffc('0x41')][_0xbffc('0x2c')]);_0x426e19[_0xbffc('0x2e')]=qs[_0xbffc('0x2e')](_0x187181[_0xbffc('0x41')][_0xbffc('0x2e')]);}_0x426e19[_0xbffc('0x49')]=qs[_0xbffc('0x4a')](_0x187181[_0xbffc('0x41')][_0xbffc('0x4a')]);_0x426e19['where']=qs[_0xbffc('0x42')](_['pick'](_0x187181['query'],_0x31f2c3['filters']),_0x278362);if(_0x187181['query'][_0xbffc('0x4b')]){_0x426e19[_0xbffc('0x4c')]=_['merge'](_0x426e19['where'],{'$or':_['map'](_0x278362,function(_0x4d0e91){if(_0x4d0e91[_0xbffc('0x3e')]!==_0xbffc('0x4d')){var _0x2a41a3={};_0x2a41a3[_0x4d0e91[_0xbffc('0x39')]]={'$like':'%'+_0x187181['query'][_0xbffc('0x4b')]+'%'};return _0x2a41a3;}})});}_0x426e19=_[_0xbffc('0x4e')]({},_0x426e19,_0x187181[_0xbffc('0x4f')]);var _0x375e36={'where':_0x426e19[_0xbffc('0x4c')]};return db['ChatQueue']['count'](_0x375e36)[_0xbffc('0x37')](function(_0x35a80a){_0x3a87a4[_0xbffc('0x2d')]=_0x35a80a;if(_0x187181[_0xbffc('0x41')]['includeAll']){_0x426e19['include']=[{'all':!![]}];}return db[_0xbffc('0x3c')][_0xbffc('0x50')](_0x426e19);})[_0xbffc('0x37')](function(_0x22b037){_0x3a87a4[_0xbffc('0x51')]=_0x22b037;return _0x3a87a4;})[_0xbffc('0x37')](respondWithFilteredResult(_0x558916,_0x426e19))[_0xbffc('0x27')](handleError(_0x558916,null));};exports[_0xbffc('0x52')]=function(_0x4bcc8f,_0x48db90){var _0x43b1a0={'raw':!![],'where':{'id':_0x4bcc8f[_0xbffc('0x53')]['id']}},_0x328c14={};_0x328c14[_0xbffc('0x40')]=_['keys'](db[_0xbffc('0x3c')][_0xbffc('0x3d')]);_0x328c14[_0xbffc('0x41')]=_['keys'](_0x4bcc8f[_0xbffc('0x41')]);_0x328c14['filters']=_[_0xbffc('0x43')](_0x328c14[_0xbffc('0x40')],_0x328c14[_0xbffc('0x41')]);_0x43b1a0['attributes']=_[_0xbffc('0x43')](_0x328c14[_0xbffc('0x40')],qs[_0xbffc('0x44')](_0x4bcc8f[_0xbffc('0x41')][_0xbffc('0x44')]));_0x43b1a0[_0xbffc('0x45')]=_0x43b1a0[_0xbffc('0x45')][_0xbffc('0x46')]?_0x43b1a0['attributes']:_0x328c14[_0xbffc('0x40')];if(_0x4bcc8f['query']['includeAll']){_0x43b1a0[_0xbffc('0x54')]=[{'all':!![]}];}_0x43b1a0=_[_0xbffc('0x4e')]({},_0x43b1a0,_0x4bcc8f[_0xbffc('0x4f')]);return db[_0xbffc('0x3c')][_0xbffc('0x55')](_0x43b1a0)['then'](handleEntityNotFound(_0x48db90,null))[_0xbffc('0x37')](respondWithResult(_0x48db90,null))[_0xbffc('0x27')](handleError(_0x48db90,null));};exports[_0xbffc('0x56')]=function(_0x33baf0,_0x18a9e8){return db['ChatQueue'][_0xbffc('0x56')](_0x33baf0[_0xbffc('0x57')],{})['then'](function(_0x26f181){var _0x1e9447=_0x33baf0[_0xbffc('0x58')]['get']({'plain':!![]});if(!_0x1e9447)throw new Error(_0xbffc('0x59'));if(_0x1e9447[_0xbffc('0x5a')]===_0xbffc('0x58')){var _0xb2e52c=_0x26f181[_0xbffc('0x35')]({'plain':!![]});var _0x598405=_0xbffc('0x5b');return db['UserProfileSection'][_0xbffc('0x55')]({'where':{'name':_0x598405,'userProfileId':_0x1e9447[_0xbffc('0x5c')]},'raw':!![]})[_0xbffc('0x37')](function(_0xd903){if(_0xd903&&_0xd903['autoAssociation']===0x0){return db[_0xbffc('0x36')]['create']({'name':_0xb2e52c[_0xbffc('0x39')],'resourceId':_0xb2e52c['id'],'type':_0xd903[_0xbffc('0x39')],'sectionId':_0xd903['id']},{})[_0xbffc('0x37')](function(){return _0x26f181;});}else{return _0x26f181;}})['catch'](function(_0x55ce55){logger[_0xbffc('0x24')](_0xbffc('0x5d'),_0x55ce55);throw _0x55ce55;});}return _0x26f181;})[_0xbffc('0x37')](respondWithResult(_0x18a9e8,0xc9))[_0xbffc('0x27')](handleError(_0x18a9e8,null));};exports[_0xbffc('0x33')]=function(_0xa19353,_0x384aab){if(_0xa19353['body']['id']){delete _0xa19353['body']['id'];}return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0xa19353[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x384aab,null))['then'](saveUpdates(_0xa19353[_0xbffc('0x57')],null))['then'](respondWithResult(_0x384aab,null))[_0xbffc('0x27')](handleError(_0x384aab,null));};exports[_0xbffc('0x34')]=function(_0x1544e0,_0x16ff7e){return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x1544e0[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x16ff7e,null))['then'](removeEntity(_0x16ff7e,null))[_0xbffc('0x27')](handleError(_0x16ff7e,null));};exports['describe']=function(_0x16407b,_0x4f8f83){return db[_0xbffc('0x3c')][_0xbffc('0x5e')]()[_0xbffc('0x37')](respondWithResult(_0x4f8f83,null))[_0xbffc('0x27')](handleError(_0x4f8f83,null));};exports[_0xbffc('0x5f')]=function(_0x49283c,_0x7d7531,_0x5755cd){var _0x38408e={'raw':!![],'where':{}},_0x20f232={},_0x5303ea;return db['ChatQueue'][_0xbffc('0x60')]({'where':{'id':_0x49283c['params']['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x7d7531,null))[_0xbffc('0x37')](function(_0x480c6b){if(_0x480c6b){_0x5303ea=_0x480c6b[_0xbffc('0x35')]({'plain':!![]});_0x20f232[_0xbffc('0x40')]=_[_0xbffc('0x61')](db['UserChatQueue'][_0xbffc('0x3d')]);_0x20f232[_0xbffc('0x41')]=_[_0xbffc('0x61')](_0x49283c[_0xbffc('0x41')]);_0x20f232[_0xbffc('0x42')]=_['intersection'](_0x20f232['model'],_0x20f232[_0xbffc('0x41')]);_0x38408e[_0xbffc('0x45')]=_[_0xbffc('0x43')](_0x20f232[_0xbffc('0x40')],qs[_0xbffc('0x44')](_0x49283c[_0xbffc('0x41')][_0xbffc('0x44')]));_0x38408e[_0xbffc('0x45')]=_0x38408e['attributes']['length']?_0x38408e[_0xbffc('0x45')]:_0x20f232[_0xbffc('0x40')];if(!_0x49283c['query']['hasOwnProperty']('nolimit')){_0x38408e[_0xbffc('0x2c')]=qs[_0xbffc('0x2c')](_0x49283c[_0xbffc('0x41')]['limit']);_0x38408e[_0xbffc('0x2e')]=qs[_0xbffc('0x2e')](_0x49283c[_0xbffc('0x41')][_0xbffc('0x2e')]);}_0x38408e[_0xbffc('0x49')]=qs[_0xbffc('0x4a')](_0x49283c[_0xbffc('0x41')][_0xbffc('0x4a')]);_0x38408e[_0xbffc('0x4c')]=qs['filters'](_[_0xbffc('0x62')](_0x49283c[_0xbffc('0x41')],_0x20f232['filters']));_0x38408e['where']['ChatQueueId']=_0x480c6b['id'];if(_0x49283c[_0xbffc('0x41')][_0xbffc('0x4b')]){_0x38408e['where']=_[_0xbffc('0x4e')](_0x38408e['where'],{'$or':_['map'](_0x38408e[_0xbffc('0x45')],function(_0xfa3a58){var _0x222a3c={};_0x222a3c[_0xfa3a58]={'$like':'%'+_0x49283c[_0xbffc('0x41')][_0xbffc('0x4b')]+'%'};return _0x222a3c;})});}_0x38408e=_['merge']({},_0x38408e,_0x49283c[_0xbffc('0x4f')]);return db[_0xbffc('0x63')]['findAll'](_0x38408e);}})['then'](function(_0x41e1ec){if(_0x41e1ec){return db[_0xbffc('0x64')]['findAndCountAll']({'where':{'id':_[_0xbffc('0x3b')](_0x41e1ec,_0xbffc('0x65')),'role':_0xbffc('0x66')},'attributes':['id',_0xbffc('0x39'),'chatPause',_0xbffc('0x67'),_0xbffc('0x68')]});}})[_0xbffc('0x37')](function(_0x3b8064){if(_0x3b8064){return{'count':_0x3b8064[_0xbffc('0x2d')],'rows':_[_0xbffc('0x3b')](_0x3b8064[_0xbffc('0x51')],function(_0x4f5b61){return{'membername':_0x4f5b61[_0xbffc('0x39')],'UserId':_0x4f5b61['id'],'queue_name':_0x5303ea['name'],'ChatQueueId':_0x5303ea['id'],'interface':util['format'](_0xbffc('0x69'),_0xbffc('0x6a'),_0x4f5b61['name']),'penalty':0x0,'paused':_0x4f5b61[_0xbffc('0x6b')],'createdAt':_0x4f5b61[_0xbffc('0x68')],'updatedAt':_0x4f5b61[_0xbffc('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x7d7531,_0x38408e))[_0xbffc('0x27')](handleError(_0x7d7531,null));};exports['getTeams']=function(_0xec59b0,_0x32d288,_0x2d94ba){var _0x15bc6c={};var _0x1e3ebb={};var _0x5cb2a7;var _0xc05232;return db['ChatQueue']['findOne']({'where':{'id':_0xec59b0[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x32d288,null))[_0xbffc('0x37')](function(_0x454f08){if(_0x454f08){_0x5cb2a7=_0x454f08;_0x1e3ebb[_0xbffc('0x40')]=_[_0xbffc('0x61')](db['Team']['rawAttributes']);_0x1e3ebb['query']=_[_0xbffc('0x61')](_0xec59b0[_0xbffc('0x41')]);_0x1e3ebb[_0xbffc('0x42')]=_[_0xbffc('0x43')](_0x1e3ebb[_0xbffc('0x40')],_0x1e3ebb[_0xbffc('0x41')]);_0x15bc6c['attributes']=_[_0xbffc('0x43')](_0x1e3ebb['model'],qs[_0xbffc('0x44')](_0xec59b0[_0xbffc('0x41')]['fields']));_0x15bc6c[_0xbffc('0x45')]=_0x15bc6c[_0xbffc('0x45')][_0xbffc('0x46')]?_0x15bc6c[_0xbffc('0x45')]:_0x1e3ebb[_0xbffc('0x40')];_0x15bc6c[_0xbffc('0x49')]=qs[_0xbffc('0x4a')](_0xec59b0['query'][_0xbffc('0x4a')]);_0x15bc6c[_0xbffc('0x4c')]=qs[_0xbffc('0x42')](_['pick'](_0xec59b0[_0xbffc('0x41')],_0x1e3ebb[_0xbffc('0x42')]));if(_0xec59b0['query']['filter']){_0x15bc6c[_0xbffc('0x4c')]=_['merge'](_0x15bc6c[_0xbffc('0x4c')],{'$or':_['map'](_0x15bc6c[_0xbffc('0x45')],function(_0xe4cdf9){var _0x1869b4={};_0x1869b4[_0xe4cdf9]={'$like':'%'+_0xec59b0['query'][_0xbffc('0x4b')]+'%'};return _0x1869b4;})});}_0x15bc6c=_[_0xbffc('0x4e')]({},_0x15bc6c,_0xec59b0['options']);return _0x5cb2a7[_0xbffc('0x6c')](_0x15bc6c);}})[_0xbffc('0x37')](function(_0x10875b){if(_0x10875b){_0xc05232=_0x10875b[_0xbffc('0x46')];if(!_0xec59b0[_0xbffc('0x41')][_0xbffc('0x47')](_0xbffc('0x48'))){_0x15bc6c[_0xbffc('0x2c')]=qs[_0xbffc('0x2c')](_0xec59b0['query'][_0xbffc('0x2c')]);_0x15bc6c[_0xbffc('0x2e')]=qs[_0xbffc('0x2e')](_0xec59b0['query'][_0xbffc('0x2e')]);}return _0x5cb2a7[_0xbffc('0x6c')](_0x15bc6c);}})['then'](function(_0x745f40){if(_0x745f40){return _0x745f40?{'count':_0xc05232,'rows':_0x745f40}:null;}})[_0xbffc('0x37')](respondWithResult(_0x32d288,null))['catch'](handleError(_0x32d288,null));};exports[_0xbffc('0x6d')]=function(_0x31d8ff,_0x43be62,_0x4d7d2c){var _0x4bbf25=_0x31d8ff['body'][_0xbffc('0x6e')];return db['Team']['findAll']({'where':{'id':_0x4bbf25},'attributes':['id'],'include':[{'model':db[_0xbffc('0x64')],'as':_0xbffc('0x6f'),'attributes':['id',_0xbffc('0x39'),_0xbffc('0x70'),_0xbffc('0x71'),_0xbffc('0x72')],'raw':!![]}]})[_0xbffc('0x37')](function(_0x3baffc){if(_0x3baffc){var _0x22bfb6=_[_0xbffc('0x73')](_0x3baffc,function(_0x5ccf95){var _0x3161fc=_0x5ccf95[_0xbffc('0x35')]({'plain':!![]});return _0x3161fc['Agents'];});return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x31d8ff['params']['id']}})[_0xbffc('0x37')](function(_0x3775f5){return db[_0xbffc('0x74')][_0xbffc('0x75')](function(_0x2a6b2a){return _0x3775f5['addTeams'](_0x4bbf25,{'transaction':_0x2a6b2a})[_0xbffc('0x37')](function(){return BPromise[_0xbffc('0x76')](_0x22bfb6,function(_0x2d0432){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x2d0432['id'],'ChatQueueId':_0x31d8ff[_0xbffc('0x53')]['id']},'transaction':_0x2a6b2a});});})[_0xbffc('0x37')](function(){_0x22bfb6[_0xbffc('0x77')](function(_0x19148f){socket[_0xbffc('0x78')]('userChatQueue:save',{'UserId':_0x19148f['id'],'ChatQueueId':_0x3775f5['id']});});});});});}})[_0xbffc('0x37')](respondWithStatusCode(_0x43be62,null))[_0xbffc('0x27')](handleError(_0x43be62,null));};exports[_0xbffc('0x79')]=function(_0x1de61e,_0x1624ce,_0x460e46){return db[_0xbffc('0x7a')]['findAll']({'where':{'id':_0x1de61e[_0xbffc('0x41')][_0xbffc('0x6e')]},'attributes':['id'],'include':[{'model':db[_0xbffc('0x64')],'as':_0xbffc('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xbffc('0x37')](handleEntityNotFound(_0x1624ce,null))[_0xbffc('0x37')](function(_0x1d80d0){var _0x23cbb6=_[_0xbffc('0x3b')](_0x1d80d0,'id');var _0x179341=[];var _0x370c6c=[];var _0x5d5144=squel[_0xbffc('0x7b')]();_0x5d5144[_0xbffc('0x7c')]('tq.TeamId')[_0xbffc('0x7d')](_0xbffc('0x7e'),'tq')[_0xbffc('0x7f')]('user_has_teams','ut',_0xbffc('0x80'))[_0xbffc('0x4c')](_0xbffc('0x81'),_0x1de61e[_0xbffc('0x53')]['id']);for(var _0x53a088=0x0;_0x53a088<_0x1d80d0['length'];_0x53a088+=0x1){let _0x529ffd=_0x1d80d0[_0x53a088];for(var _0x4adb35=0x0;_0x4adb35<_0x529ffd['Agents']['length'];_0x4adb35+=0x1){let _0x3efa82=_0x529ffd[_0xbffc('0x6f')][_0x4adb35];var _0x5c131a=_0x5d5144[_0xbffc('0x82')]();_0x5c131a[_0xbffc('0x4c')](_0xbffc('0x83'),_0x3efa82['id']);_0x370c6c[_0xbffc('0x84')](db[_0xbffc('0x74')][_0xbffc('0x41')](_0x5c131a['toString'](),{'type':db['sequelize'][_0xbffc('0x85')][_0xbffc('0x86')]})[_0xbffc('0x37')](function(_0xc0df87){if(_0xc0df87[_0xbffc('0x46')]===0x1){return _0x3efa82['id'];}else{var _0x58fee6=_[_0xbffc('0x87')](_[_0xbffc('0x3b')](_0xc0df87,_0xbffc('0x88')),function(_0xeed923){return _['includes'](_0x23cbb6,_0xeed923);});if(_0x58fee6){return _0x3efa82['id'];}}}));}}return BPromise[_0xbffc('0x89')](_0x370c6c)[_0xbffc('0x37')](function(_0x33ef07){_0x179341=_(_0x179341)[_0xbffc('0x8a')](_0x33ef07)[_0xbffc('0x8b')]()[_0xbffc('0x8c')]();return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x1de61e[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](function(_0x5f0b49){return db['sequelize']['transaction'](function(_0x579429){return _0x5f0b49[_0xbffc('0x79')](_0x1de61e[_0xbffc('0x41')][_0xbffc('0x6e')],{'transaction':_0x579429})[_0xbffc('0x37')](function(){if(!_['isEmpty'](_0x179341)){return _0x5f0b49[_0xbffc('0x8d')](_0x179341,{'transaction':_0x579429});}})[_0xbffc('0x37')](function(){_0x179341[_0xbffc('0x77')](function(_0x158b72){socket[_0xbffc('0x78')](_0xbffc('0x8e'),{'UserId':_0x158b72,'ChatQueueId':_0x5f0b49['id']});});});});});});})[_0xbffc('0x37')](respondWithStatusCode(_0x1624ce,null))[_0xbffc('0x27')](handleError(_0x1624ce,null));};exports[_0xbffc('0x8f')]=function(_0x4666a8,_0x165874,_0x496fde){return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x4666a8[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x165874,null))[_0xbffc('0x37')](function(_0x4bb134){if(_0x4bb134){return _0x4bb134[_0xbffc('0x8f')](_0x4666a8[_0xbffc('0x57')][_0xbffc('0x6e')],_[_0xbffc('0x90')](_0x4666a8[_0xbffc('0x57')],[_0xbffc('0x6e'),'id'])||{})[_0xbffc('0x91')](function(_0x43e8a8){for(var _0x3c1023=0x0;_0x3c1023<_0x4666a8['body'][_0xbffc('0x6e')][_0xbffc('0x46')];_0x3c1023+=0x1){socket[_0xbffc('0x78')](_0xbffc('0x92'),{'UserId':Number(_0x4666a8[_0xbffc('0x57')][_0xbffc('0x6e')][_0x3c1023]),'ChatQueueId':Number(_0x4666a8[_0xbffc('0x53')]['id'])});}return _0x43e8a8;});}})[_0xbffc('0x37')](respondWithResult(_0x165874,null))[_0xbffc('0x27')](handleError(_0x165874,null));};exports[_0xbffc('0x8d')]=function(_0x515d05,_0x1ffc7b,_0x28b0d4){return db[_0xbffc('0x3c')][_0xbffc('0x55')]({'where':{'id':_0x515d05[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x1ffc7b,null))[_0xbffc('0x37')](function(_0x38cde3){if(_0x38cde3){return _0x38cde3[_0xbffc('0x8d')](_0x515d05['query'][_0xbffc('0x6e')])[_0xbffc('0x37')](function(){if(_[_0xbffc('0x93')](_0x515d05['query'][_0xbffc('0x6e')])){for(var _0x31bd54=0x0;_0x31bd54<_0x515d05[_0xbffc('0x41')][_0xbffc('0x6e')][_0xbffc('0x46')];_0x31bd54+=0x1){socket['emit'](_0xbffc('0x8e'),{'UserId':Number(_0x515d05[_0xbffc('0x41')][_0xbffc('0x6e')][_0x31bd54]),'ChatQueueId':Number(_0x515d05[_0xbffc('0x53')]['id'])});}}else{socket[_0xbffc('0x78')](_0xbffc('0x8e'),{'UserId':Number(_0x515d05[_0xbffc('0x41')][_0xbffc('0x6e')]),'ChatQueueId':Number(_0x515d05[_0xbffc('0x53')]['id'])});}});}})[_0xbffc('0x37')](respondWithStatusCode(_0x1ffc7b,null))[_0xbffc('0x27')](handleError(_0x1ffc7b,null));};exports[_0xbffc('0x94')]=function(_0x115bd1,_0x4bf44e,_0x5e3d76){var _0x39f16e={};var _0x30b52f={};var _0x278ab9;var _0x4ed986;return db[_0xbffc('0x3c')][_0xbffc('0x60')]({'where':{'id':_0x115bd1[_0xbffc('0x53')]['id']}})[_0xbffc('0x37')](handleEntityNotFound(_0x4bf44e,null))[_0xbffc('0x37')](function(_0x1d02af){if(_0x1d02af){_0x278ab9=_0x1d02af;_0x30b52f[_0xbffc('0x40')]=_['keys'](db[_0xbffc('0x64')][_0xbffc('0x3d')]);_0x30b52f[_0xbffc('0x41')]=_['keys'](_0x115bd1[_0xbffc('0x41')]);_0x30b52f[_0xbffc('0x42')]=_[_0xbffc('0x43')](_0x30b52f['model'],_0x30b52f['query']);_0x39f16e[_0xbffc('0x45')]=_[_0xbffc('0x43')](_0x30b52f[_0xbffc('0x40')],qs[_0xbffc('0x44')](_0x115bd1['query'][_0xbffc('0x44')]));_0x39f16e[_0xbffc('0x45')]=_0x39f16e[_0xbffc('0x45')]['length']?_0x39f16e[_0xbffc('0x45')]:_0x30b52f[_0xbffc('0x40')];_0x39f16e[_0xbffc('0x49')]=qs[_0xbffc('0x4a')](_0x115bd1[_0xbffc('0x41')]['sort']);_0x39f16e[_0xbffc('0x4c')]=qs[_0xbffc('0x42')](_[_0xbffc('0x62')](_0x115bd1[_0xbffc('0x41')],_0x30b52f[_0xbffc('0x42')]));if(_0x115bd1[_0xbffc('0x41')][_0xbffc('0x4b')]){_0x39f16e['where']=_[_0xbffc('0x4e')](_0x39f16e['where'],{'$or':_[_0xbffc('0x3b')](_0x39f16e['attributes'],function(_0x59e71f){var _0x364f8f={};_0x364f8f[_0x59e71f]={'$like':'%'+_0x115bd1[_0xbffc('0x41')][_0xbffc('0x4b')]+'%'};return _0x364f8f;})});}_0x39f16e=_[_0xbffc('0x4e')]({},_0x39f16e,_0x115bd1['options']);return _0x278ab9[_0xbffc('0x94')](_0x39f16e);}})[_0xbffc('0x37')](function(_0x52ec04){if(_0x52ec04){_0x4ed986=_0x52ec04[_0xbffc('0x46')];if(!_0x115bd1[_0xbffc('0x41')]['hasOwnProperty'](_0xbffc('0x48'))){_0x39f16e['limit']=qs[_0xbffc('0x2c')](_0x115bd1['query'][_0xbffc('0x2c')]);_0x39f16e[_0xbffc('0x2e')]=qs[_0xbffc('0x2e')](_0x115bd1[_0xbffc('0x41')][_0xbffc('0x2e')]);}return _0x278ab9[_0xbffc('0x94')](_0x39f16e);}})['then'](function(_0x14bc4a){if(_0x14bc4a){return _0x14bc4a?{'count':_0x4ed986,'rows':_0x14bc4a}:null;}})[_0xbffc('0x37')](respondWithResult(_0x4bf44e,null))[_0xbffc('0x27')](handleError(_0x4bf44e,null));};
\ No newline at end of file
+var _0x1aa0=['each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','all','union','compact','value','transaction','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','findOne','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','redis','register','jayson/promise','client','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','offset','count','limit','set','Content-Range','json','reject','save','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','UserChatQueue','ChatQueueId','User','agent','chatPause','updatedAt','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize'];(function(_0x27ede2,_0x41b067){var _0x4a174d=function(_0x16f954){while(--_0x16f954){_0x27ede2['push'](_0x27ede2['shift']());}};_0x4a174d(++_0x41b067);}(_0x1aa0,0x141));var _0x01aa=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x1aa0[_0x2bc3f4];return _0x14ac53;};'use strict';var emlformat=require(_0x01aa('0x0'));var rimraf=require(_0x01aa('0x1'));var zipdir=require(_0x01aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x01aa('0x3'));var BPromise=require(_0x01aa('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x01aa('0x5'));var sox=require(_0x01aa('0x6'));var csv=require(_0x01aa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01aa('0x8'));var _=require(_0x01aa('0x9'));var squel=require('squel');var crypto=require(_0x01aa('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x01aa('0xb'));var toCsv=require(_0x01aa('0x7'));var querystring=require('querystring');var Papa=require(_0x01aa('0xc'));var Redis=require('ioredis');var authService=require(_0x01aa('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x01aa('0xe'));var hardwareService=require(_0x01aa('0xf'));var logger=require(_0x01aa('0x10'))(_0x01aa('0x11'));var utils=require(_0x01aa('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01aa('0x13'))['db'];config['redis']=_[_0x01aa('0x14')](config['redis'],{'host':_0x01aa('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01aa('0x16')]));require('./chatQueue.socket')[_0x01aa('0x17')](socket);var jayson=require(_0x01aa('0x18'));var client=jayson[_0x01aa('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f091c,_0x116167,_0x4dc23b,_0x18fc88){return new BPromise(function(_0x4d5256,_0x2df5cc){var _0x121bf5=_0x18fc88||client;return _0x121bf5['request'](_0x5f091c,_0x4dc23b)[_0x01aa('0x1a')](function(_0x384b3d){logger[_0x01aa('0x1b')](_0x01aa('0x1c'),_0x116167,_0x01aa('0x1d'));logger['debug'](_0x01aa('0x1e'),_0x116167,'request\x20sent',JSON[_0x01aa('0x1f')](_0x384b3d));if(_0x384b3d[_0x01aa('0x20')]){if(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x21')]===0x1f4){logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);return _0x2df5cc(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);}logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x384b3d['error']['message']);return _0x4d5256(_0x384b3d[_0x01aa('0x20')][_0x01aa('0x22')]);}else{logger['info'](_0x01aa('0x1c'),_0x116167,_0x01aa('0x1d'));_0x4d5256(_0x384b3d[_0x01aa('0x23')][_0x01aa('0x22')]);}})['catch'](function(_0x286020){logger[_0x01aa('0x20')](_0x01aa('0x1c'),_0x116167,_0x286020);_0x2df5cc(_0x286020);});});}function respondWithStatusCode(_0x522819,_0x4ff459){_0x4ff459=_0x4ff459||0xcc;return function(_0x56f48b){if(_0x56f48b){return _0x522819[_0x01aa('0x24')](_0x4ff459);}return _0x522819['status'](_0x4ff459)[_0x01aa('0x25')]();};}function respondWithResult(_0x170fe3,_0x50a51c){_0x50a51c=_0x50a51c||0xc8;return function(_0x500a0e){if(_0x500a0e){return _0x170fe3[_0x01aa('0x26')](_0x50a51c)['json'](_0x500a0e);}};}function respondWithFilteredResult(_0x4abc2b,_0x255922){return function(_0x437015){if(_0x437015){var _0x161ce1=typeof _0x255922[_0x01aa('0x27')]==='undefined'&&typeof _0x255922['limit']==='undefined';var _0x2606d3=_0x437015[_0x01aa('0x28')];var _0x24611d=_0x161ce1?0x0:_0x255922[_0x01aa('0x27')];var _0x1e01e1=_0x161ce1?_0x437015[_0x01aa('0x28')]:_0x255922[_0x01aa('0x27')]+_0x255922[_0x01aa('0x29')];var _0x268ba7;if(_0x1e01e1>=_0x2606d3){_0x1e01e1=_0x2606d3;_0x268ba7=0xc8;}else{_0x268ba7=0xce;}_0x4abc2b[_0x01aa('0x26')](_0x268ba7);return _0x4abc2b[_0x01aa('0x2a')](_0x01aa('0x2b'),_0x24611d+'-'+_0x1e01e1+'/'+_0x2606d3)[_0x01aa('0x2c')](_0x437015);}return null;};}function patchUpdates(_0x15a0e6){return function(_0x59158e){try{jsonpatch['apply'](_0x59158e,_0x15a0e6,!![]);}catch(_0x4fc34e){return BPromise[_0x01aa('0x2d')](_0x4fc34e);}return _0x59158e[_0x01aa('0x2e')]();};}function saveUpdates(_0xa94747,_0x484cb0){return function(_0x20d46d){if(_0x20d46d){return _0x20d46d['update'](_0xa94747)[_0x01aa('0x1a')](function(_0x22bd21){return _0x22bd21;});}return null;};}function removeEntity(_0x2975e3,_0x5aabfe){return function(_0x24a457){if(_0x24a457){return _0x24a457[_0x01aa('0x2f')]()['then'](function(){var _0x4e55db=_0x24a457[_0x01aa('0x30')]({'plain':!![]});var _0xbf2c83=_0x01aa('0x31');return db[_0x01aa('0x32')][_0x01aa('0x2f')]({'where':{'type':_0xbf2c83,'resourceId':_0x4e55db['id']}})[_0x01aa('0x1a')](function(){return _0x24a457;});})[_0x01aa('0x1a')](function(){_0x2975e3[_0x01aa('0x26')](0xcc)[_0x01aa('0x25')]();});}};}function handleEntityNotFound(_0x314da5,_0x2d1e78){return function(_0x348807){if(!_0x348807){_0x314da5[_0x01aa('0x24')](0x194);}return _0x348807;};}function handleError(_0x566583,_0x53c837){_0x53c837=_0x53c837||0x1f4;return function(_0x52075b){logger[_0x01aa('0x20')](_0x52075b[_0x01aa('0x33')]);if(_0x52075b[_0x01aa('0x34')]){delete _0x52075b['name'];}_0x566583[_0x01aa('0x26')](_0x53c837)[_0x01aa('0x35')](_0x52075b);};}exports[_0x01aa('0x36')]=function(_0x23bd68,_0x29412c){var _0x1be690={},_0x389a94={},_0x3f1fcd={'count':0x0,'rows':[]};var _0xf6e691=_[_0x01aa('0x37')](db[_0x01aa('0x38')][_0x01aa('0x39')],function(_0x4994ca){return{'name':_0x4994ca['fieldName'],'type':_0x4994ca[_0x01aa('0x3a')][_0x01aa('0x3b')]};});_0x389a94[_0x01aa('0x3c')]=_[_0x01aa('0x37')](_0xf6e691,'name');_0x389a94[_0x01aa('0x3d')]=_[_0x01aa('0x3e')](_0x23bd68['query']);_0x389a94[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x389a94[_0x01aa('0x3c')],_0x389a94[_0x01aa('0x3d')]);_0x1be690['attributes']=_[_0x01aa('0x40')](_0x389a94[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x1be690['attributes']=_0x1be690[_0x01aa('0x42')][_0x01aa('0x43')]?_0x1be690[_0x01aa('0x42')]:_0x389a94[_0x01aa('0x3c')];if(!_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x1be690[_0x01aa('0x29')]=qs[_0x01aa('0x29')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x1be690[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x27')]);}_0x1be690[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x47')]);_0x1be690[_0x01aa('0x48')]=qs['filters'](_[_0x01aa('0x49')](_0x23bd68[_0x01aa('0x3d')],_0x389a94[_0x01aa('0x3f')]),_0xf6e691);if(_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x1be690[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x1be690[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0xf6e691,function(_0x55c300){if(_0x55c300[_0x01aa('0x3a')]!==_0x01aa('0x4c')){var _0x53e329={};_0x53e329[_0x55c300['name']]={'$like':'%'+_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4a')]+'%'};return _0x53e329;}})});}_0x1be690=_[_0x01aa('0x4b')]({},_0x1be690,_0x23bd68[_0x01aa('0x4d')]);var _0x4eb380={'where':_0x1be690[_0x01aa('0x48')]};return db[_0x01aa('0x38')][_0x01aa('0x28')](_0x4eb380)['then'](function(_0x431fd1){_0x3f1fcd[_0x01aa('0x28')]=_0x431fd1;if(_0x23bd68[_0x01aa('0x3d')][_0x01aa('0x4e')]){_0x1be690[_0x01aa('0x4f')]=[{'all':!![]}];}return db[_0x01aa('0x38')][_0x01aa('0x50')](_0x1be690);})[_0x01aa('0x1a')](function(_0x16d6e8){_0x3f1fcd[_0x01aa('0x51')]=_0x16d6e8;return _0x3f1fcd;})[_0x01aa('0x1a')](respondWithFilteredResult(_0x29412c,_0x1be690))[_0x01aa('0x52')](handleError(_0x29412c,null));};exports['show']=function(_0x4540a5,_0x1237de){var _0x47634f={'raw':!![],'where':{'id':_0x4540a5['params']['id']}},_0x24a294={};_0x24a294[_0x01aa('0x3c')]=_[_0x01aa('0x3e')](db[_0x01aa('0x38')][_0x01aa('0x39')]);_0x24a294['query']=_[_0x01aa('0x3e')](_0x4540a5[_0x01aa('0x3d')]);_0x24a294[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x24a294[_0x01aa('0x3c')],_0x24a294[_0x01aa('0x3d')]);_0x47634f[_0x01aa('0x42')]=_[_0x01aa('0x40')](_0x24a294[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x4540a5[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x47634f[_0x01aa('0x42')]=_0x47634f[_0x01aa('0x42')][_0x01aa('0x43')]?_0x47634f[_0x01aa('0x42')]:_0x24a294[_0x01aa('0x3c')];if(_0x4540a5[_0x01aa('0x3d')][_0x01aa('0x4e')]){_0x47634f[_0x01aa('0x4f')]=[{'all':!![]}];}_0x47634f=_[_0x01aa('0x4b')]({},_0x47634f,_0x4540a5[_0x01aa('0x4d')]);return db[_0x01aa('0x38')][_0x01aa('0x53')](_0x47634f)[_0x01aa('0x1a')](handleEntityNotFound(_0x1237de,null))['then'](respondWithResult(_0x1237de,null))[_0x01aa('0x52')](handleError(_0x1237de,null));};exports[_0x01aa('0x54')]=function(_0xb12ecd,_0x2ae64e){return db[_0x01aa('0x38')]['create'](_0xb12ecd[_0x01aa('0x55')],{})[_0x01aa('0x1a')](function(_0xa68aa2){var _0x45dd44=_0xb12ecd['user'][_0x01aa('0x30')]({'plain':!![]});if(!_0x45dd44)throw new Error(_0x01aa('0x56'));if(_0x45dd44['role']===_0x01aa('0x57')){var _0x58c0f0=_0xa68aa2[_0x01aa('0x30')]({'plain':!![]});var _0x4875b5=_0x01aa('0x31');return db['UserProfileSection'][_0x01aa('0x53')]({'where':{'name':_0x4875b5,'userProfileId':_0x45dd44['userProfileId']},'raw':!![]})[_0x01aa('0x1a')](function(_0x53f412){if(_0x53f412&&_0x53f412[_0x01aa('0x58')]===0x0){return db[_0x01aa('0x32')]['create']({'name':_0x58c0f0[_0x01aa('0x34')],'resourceId':_0x58c0f0['id'],'type':_0x53f412['name'],'sectionId':_0x53f412['id']},{})['then'](function(){return _0xa68aa2;});}else{return _0xa68aa2;}})[_0x01aa('0x52')](function(_0x15b01e){logger[_0x01aa('0x20')](_0x01aa('0x59'),_0x15b01e);throw _0x15b01e;});}return _0xa68aa2;})[_0x01aa('0x1a')](respondWithResult(_0x2ae64e,0xc9))['catch'](handleError(_0x2ae64e,null));};exports[_0x01aa('0x5a')]=function(_0x5706bc,_0x3bfad4){if(_0x5706bc['body']['id']){delete _0x5706bc[_0x01aa('0x55')]['id'];}return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x5706bc[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3bfad4,null))[_0x01aa('0x1a')](saveUpdates(_0x5706bc[_0x01aa('0x55')],null))['then'](respondWithResult(_0x3bfad4,null))[_0x01aa('0x52')](handleError(_0x3bfad4,null));};exports[_0x01aa('0x2f')]=function(_0x1da9f6,_0x59a992){return db['ChatQueue']['find']({'where':{'id':_0x1da9f6[_0x01aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x59a992,null))[_0x01aa('0x1a')](removeEntity(_0x59a992,null))['catch'](handleError(_0x59a992,null));};exports[_0x01aa('0x5c')]=function(_0x487ce6,_0x10a3a0){return db[_0x01aa('0x38')]['describe']()[_0x01aa('0x1a')](respondWithResult(_0x10a3a0,null))[_0x01aa('0x52')](handleError(_0x10a3a0,null));};exports['getMembers']=function(_0x4cf2d3,_0x413680,_0x784692){var _0x166ff9={'raw':!![],'where':{}},_0x2f74b8={},_0x1c45b7;return db['ChatQueue']['findOne']({'where':{'id':_0x4cf2d3['params']['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x413680,null))[_0x01aa('0x1a')](function(_0x3c0934){if(_0x3c0934){_0x1c45b7=_0x3c0934['get']({'plain':!![]});_0x2f74b8[_0x01aa('0x3c')]=_[_0x01aa('0x3e')](db[_0x01aa('0x5d')]['rawAttributes']);_0x2f74b8[_0x01aa('0x3d')]=_['keys'](_0x4cf2d3[_0x01aa('0x3d')]);_0x2f74b8[_0x01aa('0x3f')]=_[_0x01aa('0x40')](_0x2f74b8[_0x01aa('0x3c')],_0x2f74b8[_0x01aa('0x3d')]);_0x166ff9[_0x01aa('0x42')]=_[_0x01aa('0x40')](_0x2f74b8[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x166ff9[_0x01aa('0x42')]=_0x166ff9['attributes'][_0x01aa('0x43')]?_0x166ff9[_0x01aa('0x42')]:_0x2f74b8[_0x01aa('0x3c')];if(!_0x4cf2d3[_0x01aa('0x3d')]['hasOwnProperty']('nolimit')){_0x166ff9[_0x01aa('0x29')]=qs['limit'](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x166ff9[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x4cf2d3['query'][_0x01aa('0x27')]);}_0x166ff9[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x47')]);_0x166ff9[_0x01aa('0x48')]=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x4cf2d3[_0x01aa('0x3d')],_0x2f74b8[_0x01aa('0x3f')]));_0x166ff9[_0x01aa('0x48')][_0x01aa('0x5e')]=_0x3c0934['id'];if(_0x4cf2d3[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x166ff9[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x166ff9[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0x166ff9[_0x01aa('0x42')],function(_0x41f337){var _0x59f009={};_0x59f009[_0x41f337]={'$like':'%'+_0x4cf2d3['query'][_0x01aa('0x4a')]+'%'};return _0x59f009;})});}_0x166ff9=_[_0x01aa('0x4b')]({},_0x166ff9,_0x4cf2d3[_0x01aa('0x4d')]);return db[_0x01aa('0x5d')][_0x01aa('0x50')](_0x166ff9);}})[_0x01aa('0x1a')](function(_0x1041df){if(_0x1041df){return db[_0x01aa('0x5f')]['findAndCountAll']({'where':{'id':_[_0x01aa('0x37')](_0x1041df,'UserId'),'role':_0x01aa('0x60')},'attributes':['id','name',_0x01aa('0x61'),_0x01aa('0x62'),'createdAt']});}})['then'](function(_0x4cf2fa){if(_0x4cf2fa){return{'count':_0x4cf2fa[_0x01aa('0x28')],'rows':_[_0x01aa('0x37')](_0x4cf2fa[_0x01aa('0x51')],function(_0x5491ad){return{'membername':_0x5491ad['name'],'UserId':_0x5491ad['id'],'queue_name':_0x1c45b7[_0x01aa('0x34')],'ChatQueueId':_0x1c45b7['id'],'interface':util['format'](_0x01aa('0x63'),_0x01aa('0x64'),_0x5491ad[_0x01aa('0x34')]),'penalty':0x0,'paused':_0x5491ad[_0x01aa('0x61')],'createdAt':_0x5491ad[_0x01aa('0x65')],'updatedAt':_0x5491ad[_0x01aa('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x01aa('0x1a')](respondWithFilteredResult(_0x413680,_0x166ff9))[_0x01aa('0x52')](handleError(_0x413680,null));};exports['getTeams']=function(_0x1ddda5,_0x44a119,_0x19449c){var _0x3e6662={};var _0x28b5fb={};var _0x416834;var _0x3d59b9;return db[_0x01aa('0x38')]['findOne']({'where':{'id':_0x1ddda5[_0x01aa('0x5b')]['id']}})['then'](handleEntityNotFound(_0x44a119,null))[_0x01aa('0x1a')](function(_0x288554){if(_0x288554){_0x416834=_0x288554;_0x28b5fb['model']=_[_0x01aa('0x3e')](db[_0x01aa('0x66')][_0x01aa('0x39')]);_0x28b5fb['query']=_[_0x01aa('0x3e')](_0x1ddda5[_0x01aa('0x3d')]);_0x28b5fb['filters']=_[_0x01aa('0x40')](_0x28b5fb['model'],_0x28b5fb[_0x01aa('0x3d')]);_0x3e6662['attributes']=_[_0x01aa('0x40')](_0x28b5fb[_0x01aa('0x3c')],qs[_0x01aa('0x41')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x3e6662[_0x01aa('0x42')]=_0x3e6662['attributes']['length']?_0x3e6662['attributes']:_0x28b5fb[_0x01aa('0x3c')];_0x3e6662[_0x01aa('0x46')]=qs[_0x01aa('0x47')](_0x1ddda5[_0x01aa('0x3d')]['sort']);_0x3e6662[_0x01aa('0x48')]=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x1ddda5['query'],_0x28b5fb[_0x01aa('0x3f')]));if(_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x3e6662[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x3e6662['where'],{'$or':_[_0x01aa('0x37')](_0x3e6662['attributes'],function(_0x4a62c1){var _0x38635e={};_0x38635e[_0x4a62c1]={'$like':'%'+_0x1ddda5['query'][_0x01aa('0x4a')]+'%'};return _0x38635e;})});}_0x3e6662=_[_0x01aa('0x4b')]({},_0x3e6662,_0x1ddda5[_0x01aa('0x4d')]);return _0x416834[_0x01aa('0x67')](_0x3e6662);}})[_0x01aa('0x1a')](function(_0xd18522){if(_0xd18522){_0x3d59b9=_0xd18522[_0x01aa('0x43')];if(!_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x3e6662[_0x01aa('0x29')]=qs[_0x01aa('0x29')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x29')]);_0x3e6662[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x1ddda5[_0x01aa('0x3d')][_0x01aa('0x27')]);}return _0x416834[_0x01aa('0x67')](_0x3e6662);}})[_0x01aa('0x1a')](function(_0x34bb05){if(_0x34bb05){return _0x34bb05?{'count':_0x3d59b9,'rows':_0x34bb05}:null;}})[_0x01aa('0x1a')](respondWithResult(_0x44a119,null))[_0x01aa('0x52')](handleError(_0x44a119,null));};exports[_0x01aa('0x68')]=function(_0x363b53,_0x14544d,_0x287ab0){var _0x4705f3=_0x363b53[_0x01aa('0x55')][_0x01aa('0x69')];return db[_0x01aa('0x66')][_0x01aa('0x50')]({'where':{'id':_0x4705f3},'attributes':['id'],'include':[{'model':db[_0x01aa('0x5f')],'as':_0x01aa('0x6a'),'attributes':['id','name','online',_0x01aa('0x6b'),_0x01aa('0x6c')],'raw':!![]}]})[_0x01aa('0x1a')](function(_0x4b0400){if(_0x4b0400){var _0x410c99=_[_0x01aa('0x6d')](_0x4b0400,function(_0x32ff60){var _0xa5f0e0=_0x32ff60[_0x01aa('0x30')]({'plain':!![]});return _0xa5f0e0[_0x01aa('0x6a')];});return db['ChatQueue']['find']({'where':{'id':_0x363b53[_0x01aa('0x5b')]['id']}})['then'](function(_0x4ee739){return db[_0x01aa('0x6e')]['transaction'](function(_0x7a9583){return _0x4ee739['addTeams'](_0x4705f3,{'transaction':_0x7a9583})[_0x01aa('0x1a')](function(){return BPromise[_0x01aa('0x6f')](_0x410c99,function(_0x10b13c){return db['UserChatQueue'][_0x01aa('0x70')]({'where':{'UserId':_0x10b13c['id'],'ChatQueueId':_0x363b53[_0x01aa('0x5b')]['id']},'transaction':_0x7a9583});});})[_0x01aa('0x1a')](function(){_0x410c99[_0x01aa('0x71')](function(_0x4e1c43){socket[_0x01aa('0x72')]('userChatQueue:save',{'UserId':_0x4e1c43['id'],'ChatQueueId':_0x4ee739['id']});});});});});}})[_0x01aa('0x1a')](respondWithStatusCode(_0x14544d,null))[_0x01aa('0x52')](handleError(_0x14544d,null));};exports[_0x01aa('0x73')]=function(_0x4bfcd3,_0x3ea135,_0x2d8c57){return db[_0x01aa('0x66')][_0x01aa('0x50')]({'where':{'id':_0x4bfcd3['query'][_0x01aa('0x69')]},'attributes':['id'],'include':[{'model':db[_0x01aa('0x5f')],'as':_0x01aa('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x01aa('0x1a')](handleEntityNotFound(_0x3ea135,null))[_0x01aa('0x1a')](function(_0x2cdd18){var _0x23cc54=_[_0x01aa('0x37')](_0x2cdd18,'id');var _0x3b66=[];var _0x4b60b8=[];var _0x964d8d=squel[_0x01aa('0x74')]();_0x964d8d[_0x01aa('0x75')](_0x01aa('0x76'))[_0x01aa('0x77')](_0x01aa('0x78'),'tq')[_0x01aa('0x79')](_0x01aa('0x7a'),'ut',_0x01aa('0x7b'))[_0x01aa('0x48')](_0x01aa('0x7c'),_0x4bfcd3[_0x01aa('0x5b')]['id']);for(var _0x5c7d22=0x0;_0x5c7d22<_0x2cdd18[_0x01aa('0x43')];_0x5c7d22+=0x1){let _0xdf8b96=_0x2cdd18[_0x5c7d22];for(var _0x45ea04=0x0;_0x45ea04<_0xdf8b96['Agents'][_0x01aa('0x43')];_0x45ea04+=0x1){let _0x4a1eba=_0xdf8b96[_0x01aa('0x6a')][_0x45ea04];var _0x150d43=_0x964d8d[_0x01aa('0x7d')]();_0x150d43[_0x01aa('0x48')](_0x01aa('0x7e'),_0x4a1eba['id']);_0x4b60b8[_0x01aa('0x7f')](db[_0x01aa('0x6e')][_0x01aa('0x3d')](_0x150d43[_0x01aa('0x80')](),{'type':db[_0x01aa('0x6e')]['QueryTypes'][_0x01aa('0x81')]})[_0x01aa('0x1a')](function(_0x3fb0dd){if(_0x3fb0dd[_0x01aa('0x43')]===0x1){return _0x4a1eba['id'];}else{var _0x485bc3=_['every'](_[_0x01aa('0x37')](_0x3fb0dd,_0x01aa('0x82')),function(_0x2a6ab8){return _['includes'](_0x23cc54,_0x2a6ab8);});if(_0x485bc3){return _0x4a1eba['id'];}}}));}}return BPromise[_0x01aa('0x83')](_0x4b60b8)[_0x01aa('0x1a')](function(_0x1d67a7){_0x3b66=_(_0x3b66)[_0x01aa('0x84')](_0x1d67a7)[_0x01aa('0x85')]()[_0x01aa('0x86')]();return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x4bfcd3['params']['id']}})[_0x01aa('0x1a')](function(_0x17fb27){return db[_0x01aa('0x6e')][_0x01aa('0x87')](function(_0x448d18){return _0x17fb27['removeTeams'](_0x4bfcd3[_0x01aa('0x3d')][_0x01aa('0x69')],{'transaction':_0x448d18})[_0x01aa('0x1a')](function(){if(!_['isEmpty'](_0x3b66)){return _0x17fb27['removeAgents'](_0x3b66,{'transaction':_0x448d18});}})['then'](function(){_0x3b66['forEach'](function(_0x5eb2de){socket['emit']('userChatQueue:remove',{'UserId':_0x5eb2de,'ChatQueueId':_0x17fb27['id']});});});});});});})[_0x01aa('0x1a')](respondWithStatusCode(_0x3ea135,null))[_0x01aa('0x52')](handleError(_0x3ea135,null));};exports[_0x01aa('0x88')]=function(_0x3b3f06,_0x33b3cb,_0x3ca2ea){return db[_0x01aa('0x38')][_0x01aa('0x53')]({'where':{'id':_0x3b3f06['params']['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x33b3cb,null))[_0x01aa('0x1a')](function(_0x5b6df7){if(_0x5b6df7){return _0x5b6df7[_0x01aa('0x88')](_0x3b3f06[_0x01aa('0x55')]['ids'],_[_0x01aa('0x89')](_0x3b3f06[_0x01aa('0x55')],[_0x01aa('0x69'),'id'])||{})[_0x01aa('0x8a')](function(_0xb62470){for(var _0x5800e0=0x0;_0x5800e0<_0x3b3f06[_0x01aa('0x55')][_0x01aa('0x69')][_0x01aa('0x43')];_0x5800e0+=0x1){socket[_0x01aa('0x72')]('userChatQueue:save',{'UserId':Number(_0x3b3f06[_0x01aa('0x55')][_0x01aa('0x69')][_0x5800e0]),'ChatQueueId':Number(_0x3b3f06[_0x01aa('0x5b')]['id'])});}return _0xb62470;});}})['then'](respondWithResult(_0x33b3cb,null))[_0x01aa('0x52')](handleError(_0x33b3cb,null));};exports[_0x01aa('0x8b')]=function(_0xb48995,_0x3bd998,_0x4f75f0){return db[_0x01aa('0x38')]['find']({'where':{'id':_0xb48995[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3bd998,null))[_0x01aa('0x1a')](function(_0x173c71){if(_0x173c71){return _0x173c71[_0x01aa('0x8b')](_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')])['then'](function(){if(_[_0x01aa('0x8c')](_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')])){for(var _0x5a55ba=0x0;_0x5a55ba<_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')]['length'];_0x5a55ba+=0x1){socket[_0x01aa('0x72')](_0x01aa('0x8d'),{'UserId':Number(_0xb48995[_0x01aa('0x3d')][_0x01aa('0x69')][_0x5a55ba]),'ChatQueueId':Number(_0xb48995[_0x01aa('0x5b')]['id'])});}}else{socket[_0x01aa('0x72')](_0x01aa('0x8d'),{'UserId':Number(_0xb48995[_0x01aa('0x3d')]['ids']),'ChatQueueId':Number(_0xb48995[_0x01aa('0x5b')]['id'])});}});}})[_0x01aa('0x1a')](respondWithStatusCode(_0x3bd998,null))[_0x01aa('0x52')](handleError(_0x3bd998,null));};exports['getAgents']=function(_0x51572c,_0x3aa29f,_0x12710f){var _0x1650c8={};var _0x3d5634={};var _0x23abc6;var _0x4484b7;return db[_0x01aa('0x38')][_0x01aa('0x8e')]({'where':{'id':_0x51572c[_0x01aa('0x5b')]['id']}})[_0x01aa('0x1a')](handleEntityNotFound(_0x3aa29f,null))['then'](function(_0x2b0fe5){if(_0x2b0fe5){_0x23abc6=_0x2b0fe5;_0x3d5634[_0x01aa('0x3c')]=_['keys'](db[_0x01aa('0x5f')][_0x01aa('0x39')]);_0x3d5634['query']=_[_0x01aa('0x3e')](_0x51572c[_0x01aa('0x3d')]);_0x3d5634['filters']=_[_0x01aa('0x40')](_0x3d5634[_0x01aa('0x3c')],_0x3d5634[_0x01aa('0x3d')]);_0x1650c8['attributes']=_[_0x01aa('0x40')](_0x3d5634[_0x01aa('0x3c')],qs['fields'](_0x51572c[_0x01aa('0x3d')][_0x01aa('0x41')]));_0x1650c8['attributes']=_0x1650c8[_0x01aa('0x42')][_0x01aa('0x43')]?_0x1650c8[_0x01aa('0x42')]:_0x3d5634['model'];_0x1650c8[_0x01aa('0x46')]=qs['sort'](_0x51572c['query'][_0x01aa('0x47')]);_0x1650c8['where']=qs[_0x01aa('0x3f')](_[_0x01aa('0x49')](_0x51572c[_0x01aa('0x3d')],_0x3d5634[_0x01aa('0x3f')]));if(_0x51572c[_0x01aa('0x3d')][_0x01aa('0x4a')]){_0x1650c8[_0x01aa('0x48')]=_[_0x01aa('0x4b')](_0x1650c8[_0x01aa('0x48')],{'$or':_[_0x01aa('0x37')](_0x1650c8['attributes'],function(_0x95893a){var _0x1cbe1f={};_0x1cbe1f[_0x95893a]={'$like':'%'+_0x51572c[_0x01aa('0x3d')][_0x01aa('0x4a')]+'%'};return _0x1cbe1f;})});}_0x1650c8=_['merge']({},_0x1650c8,_0x51572c[_0x01aa('0x4d')]);return _0x23abc6[_0x01aa('0x8f')](_0x1650c8);}})['then'](function(_0x7e781){if(_0x7e781){_0x4484b7=_0x7e781[_0x01aa('0x43')];if(!_0x51572c[_0x01aa('0x3d')][_0x01aa('0x44')](_0x01aa('0x45'))){_0x1650c8['limit']=qs[_0x01aa('0x29')](_0x51572c['query']['limit']);_0x1650c8[_0x01aa('0x27')]=qs[_0x01aa('0x27')](_0x51572c[_0x01aa('0x3d')][_0x01aa('0x27')]);}return _0x23abc6[_0x01aa('0x8f')](_0x1650c8);}})[_0x01aa('0x1a')](function(_0x62c57b){if(_0x62c57b){return _0x62c57b?{'count':_0x4484b7,'rows':_0x62c57b}:null;}})['then'](respondWithResult(_0x3aa29f,null))[_0x01aa('0x52')](handleError(_0x3aa29f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 2535fae..ddcca7e 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 _0x5ffc=['save','update','remove','emit','hook','exports','events','ChatQueue','setMaxListeners'];(function(_0x505211,_0xf16511){var _0x346a67=function(_0x25e539){while(--_0x25e539){_0x505211['push'](_0x505211['shift']());}};_0x346a67(++_0xf16511);}(_0x5ffc,0x16e));var _0xc5ff=function(_0x590ef3,_0x3b2dd2){_0x590ef3=_0x590ef3-0x0;var _0x4502be=_0x5ffc[_0x590ef3];return _0x4502be;};'use strict';var EventEmitter=require(_0xc5ff('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xc5ff('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc5ff('0x2')](0x0);var events={'afterCreate':_0xc5ff('0x3'),'afterUpdate':_0xc5ff('0x4'),'afterDestroy':_0xc5ff('0x5')};function emitEvent(_0x239431){return function(_0x18f072,_0x327947,_0x5902dc){ChatQueueEvents[_0xc5ff('0x6')](_0x239431+':'+_0x18f072['id'],_0x18f072);ChatQueueEvents[_0xc5ff('0x6')](_0x239431,_0x18f072);_0x5902dc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc5ff('0x7')](e,emitEvent(event));}}module[_0xc5ff('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x4085=['emit','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x3cf1b1,_0x445a0a){var _0x347602=function(_0x19c0a1){while(--_0x19c0a1){_0x3cf1b1['push'](_0x3cf1b1['shift']());}};_0x347602(++_0x445a0a);}(_0x4085,0x199));var _0x5408=function(_0x18dce0,_0x338691){_0x18dce0=_0x18dce0-0x0;var _0x71da89=_0x4085[_0x18dce0];return _0x71da89;};'use strict';var EventEmitter=require(_0x5408('0x0'));var ChatQueue=require(_0x5408('0x1'))['db'][_0x5408('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5408('0x3')](0x0);var events={'afterCreate':_0x5408('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x444a73){return function(_0x554074,_0x13a8e9,_0x3337ea){ChatQueueEvents[_0x5408('0x5')](_0x444a73+':'+_0x554074['id'],_0x554074);ChatQueueEvents[_0x5408('0x5')](_0x444a73,_0x554074);_0x3337ea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 3303cb8..0b39542 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 _0x1f44=['ChatQueue','chat_queues','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x295431,_0x275830){var _0xe571d9=function(_0x31a5d8){while(--_0x31a5d8){_0x295431['push'](_0x295431['shift']());}};_0xe571d9(++_0x275830);}(_0x1f44,0x14c));var _0x41f4=function(_0x123e0b,_0x2ad94c){_0x123e0b=_0x123e0b-0x0;var _0x3248cb=_0x1f44[_0x123e0b];return _0x3248cb;};'use strict';var _=require(_0x41f4('0x0'));var util=require(_0x41f4('0x1'));var logger=require(_0x41f4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x41f4('0x3'));var rp=require(_0x41f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x41f4('0x5'));var attributes=require(_0x41f4('0x6'));module[_0x41f4('0x7')]=function(_0x19b755,_0x59cfe0){return _0x19b755[_0x41f4('0x8')](_0x41f4('0x9'),attributes,{'tableName':_0x41f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x99e6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash'];(function(_0x35c8f5,_0x399f44){var _0xb5c718=function(_0x50450c){while(--_0x50450c){_0x35c8f5['push'](_0x35c8f5['shift']());}};_0xb5c718(++_0x399f44);}(_0x99e6,0x86));var _0x699e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x99e6[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x699e('0x0'));var util=require(_0x699e('0x1'));var logger=require(_0x699e('0x2'))(_0x699e('0x3'));var moment=require(_0x699e('0x4'));var BPromise=require(_0x699e('0x5'));var rp=require(_0x699e('0x6'));var fs=require('fs');var path=require(_0x699e('0x7'));var rimraf=require(_0x699e('0x8'));var config=require(_0x699e('0x9'));var attributes=require(_0x699e('0xa'));module[_0x699e('0xb')]=function(_0x955609,_0x22dfff){return _0x955609[_0x699e('0xc')](_0x699e('0xd'),attributes,{'tableName':_0x699e('0xe'),'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 fa3ccd9..a7efcf9 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 _0x30d6=['ChatQueue','options','raw','attributes','limit','map','include','model','GetChatQueue','stringify','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x2a24d6,_0x719138){var _0x46d4c2=function(_0x4b72ab){while(--_0x4b72ab){_0x2a24d6['push'](_0x2a24d6['shift']());}};_0x46d4c2(++_0x719138);}(_0x30d6,0x1b0));var _0x630d=function(_0x3c5a41,_0x558b2c){_0x3c5a41=_0x3c5a41-0x0;var _0x5389f5=_0x30d6[_0x3c5a41];return _0x5389f5;};'use strict';var _=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var moment=require('moment');var BPromise=require(_0x630d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x630d('0x3'));var db=require(_0x630d('0x4'))['db'];var utils=require(_0x630d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x630d('0x6'));var jayson=require(_0x630d('0x7'));var client=jayson[_0x630d('0x8')]['http']({'port':0x232a});config[_0x630d('0x9')]=_[_0x630d('0xa')](config[_0x630d('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x630d('0x9')]));require(_0x630d('0xb'))[_0x630d('0xc')](socket);function respondWithRpcPromise(_0x382760,_0x4d4f13,_0xc5bc63){return new BPromise(function(_0x43ea98,_0x2f88fb){return client[_0x630d('0xd')](_0x382760,_0xc5bc63)[_0x630d('0xe')](function(_0x4294d0){logger[_0x630d('0xf')](_0x630d('0x10'),_0x4d4f13,_0x630d('0x11'));logger[_0x630d('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'),JSON['stringify'](_0x4294d0));if(_0x4294d0[_0x630d('0x13')]){if(_0x4294d0[_0x630d('0x13')]['code']===0x1f4){logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);return _0x2f88fb(_0x4294d0[_0x630d('0x13')][_0x630d('0x14')]);}logger[_0x630d('0x13')](_0x630d('0x10'),_0x4d4f13,_0x4294d0['error'][_0x630d('0x14')]);return _0x43ea98(_0x4294d0['error'][_0x630d('0x14')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4d4f13,_0x630d('0x11'));_0x43ea98(_0x4294d0[_0x630d('0x15')]['message']);}})[_0x630d('0x16')](function(_0x18e685){logger['error'](_0x630d('0x10'),_0x4d4f13,_0x18e685);_0x2f88fb(_0x18e685);});});}exports['GetChatQueue']=function(_0x4df27f){var _0x456b07=this;return new Promise(function(_0x53498b,_0x2d960f){return db[_0x630d('0x17')]['findAll']({'raw':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x4df27f[_0x630d('0x18')]?_0x4df27f['options']['where']||null:null,'attributes':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'limit':_0x4df27f['options']?_0x4df27f[_0x630d('0x18')][_0x630d('0x1b')]||null:null,'include':_0x4df27f[_0x630d('0x18')]?_0x4df27f[_0x630d('0x18')]['include']?_[_0x630d('0x1c')](_0x4df27f[_0x630d('0x18')][_0x630d('0x1d')],function(_0x2ba2c9){return{'model':db[_0x2ba2c9[_0x630d('0x1e')]],'as':_0x2ba2c9['as'],'attributes':_0x2ba2c9[_0x630d('0x1a')],'include':_0x2ba2c9[_0x630d('0x1d')]?_['map'](_0x2ba2c9[_0x630d('0x1d')],function(_0x5c5d36){return{'model':db[_0x5c5d36[_0x630d('0x1e')]],'as':_0x5c5d36['as'],'attributes':_0x5c5d36['attributes'],'include':_0x5c5d36['include']?_[_0x630d('0x1c')](_0x5c5d36[_0x630d('0x1d')],function(_0x3d62dd){return{'model':db[_0x3d62dd['model']],'as':_0x3d62dd['as'],'attributes':_0x3d62dd[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2bed85){logger[_0x630d('0xf')](_0x630d('0x1f'),_0x4df27f);logger[_0x630d('0x12')](_0x630d('0x1f'),_0x4df27f,JSON[_0x630d('0x20')](_0x2bed85));_0x53498b(_0x2bed85);})[_0x630d('0x16')](function(_0x2d6d26){logger[_0x630d('0x13')](_0x630d('0x1f'),_0x2d6d26['message'],_0x4df27f);_0x2d960f(_0x456b07[_0x630d('0x13')](0x1f4,_0x2d6d26[_0x630d('0x14')]));});});};exports[_0x630d('0x21')]=function(_0x789005){var _0x25cf85=this;return new Promise(function(_0x18c8a2,_0x58e392){return db[_0x630d('0x17')][_0x630d('0x22')]({'raw':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x19')]===undefined?!![]:![]:!![],'where':_0x789005['options']?_0x789005[_0x630d('0x18')]['where']||null:null,'attributes':_0x789005[_0x630d('0x18')]?_0x789005[_0x630d('0x18')][_0x630d('0x1a')]||null:null,'include':_0x789005[_0x630d('0x18')]?_0x789005['options'][_0x630d('0x1d')]?_['map'](_0x789005[_0x630d('0x18')][_0x630d('0x1d')],function(_0x63c194){return{'model':db[_0x63c194[_0x630d('0x1e')]],'as':_0x63c194['as'],'attributes':_0x63c194['attributes'],'include':_0x63c194[_0x630d('0x1d')]?_[_0x630d('0x1c')](_0x63c194['include'],function(_0xa10a79){return{'model':db[_0xa10a79[_0x630d('0x1e')]],'as':_0xa10a79['as'],'attributes':_0xa10a79[_0x630d('0x1a')],'include':_0xa10a79['include']?_[_0x630d('0x1c')](_0xa10a79[_0x630d('0x1d')],function(_0x22ae2c){return{'model':db[_0x22ae2c['model']],'as':_0x22ae2c['as'],'attributes':_0x22ae2c[_0x630d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x630d('0xe')](function(_0x598a60){logger[_0x630d('0xf')](_0x630d('0x21'),_0x789005);logger[_0x630d('0x12')](_0x630d('0x21'),_0x789005,JSON[_0x630d('0x20')](_0x598a60));_0x18c8a2(_0x598a60);})[_0x630d('0x16')](function(_0x4609ce){logger[_0x630d('0x13')](_0x630d('0x21'),_0x4609ce['message'],_0x789005);_0x58e392(_0x25cf85[_0x630d('0x13')](0x1f4,_0x4609ce['message']));});});};
\ No newline at end of file
+var _0xf29d=['include','map','model','ShowChatQueue','where','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','defaults','redis','localhost','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit'];(function(_0x51f3d6,_0x572b62){var _0x2f0dfa=function(_0x102852){while(--_0x102852){_0x51f3d6['push'](_0x51f3d6['shift']());}};_0x2f0dfa(++_0x572b62);}(_0xf29d,0xc4));var _0xdf29=function(_0x1406c3,_0x1390de){_0x1406c3=_0x1406c3-0x0;var _0x3a9f8f=_0xf29d[_0x1406c3];return _0x3a9f8f;};'use strict';var _=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var moment=require('moment');var BPromise=require(_0xdf29('0x2'));var rs=require(_0xdf29('0x3'));var fs=require('fs');var Redis=require(_0xdf29('0x4'));var db=require(_0xdf29('0x5'))['db'];var utils=require(_0xdf29('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdf29('0x7'));var client=jayson[_0xdf29('0x8')][_0xdf29('0x9')]({'port':0x232a});config['redis']=_[_0xdf29('0xa')](config[_0xdf29('0xb')],{'host':_0xdf29('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf29('0xb')]));require(_0xdf29('0xd'))[_0xdf29('0xe')](socket);function respondWithRpcPromise(_0x298dbb,_0x517d89,_0x5503f0){return new BPromise(function(_0x3e1865,_0x14b4ec){return client['request'](_0x298dbb,_0x5503f0)[_0xdf29('0xf')](function(_0x26b212){logger[_0xdf29('0x10')](_0xdf29('0x11'),_0x517d89,_0xdf29('0x12'));logger['debug'](_0xdf29('0x13'),_0x517d89,'request\x20sent',JSON[_0xdf29('0x14')](_0x26b212));if(_0x26b212[_0xdf29('0x15')]){if(_0x26b212[_0xdf29('0x15')]['code']===0x1f4){logger[_0xdf29('0x15')](_0xdf29('0x11'),_0x517d89,_0x26b212['error'][_0xdf29('0x16')]);return _0x14b4ec(_0x26b212[_0xdf29('0x15')][_0xdf29('0x16')]);}logger['error'](_0xdf29('0x11'),_0x517d89,_0x26b212['error']['message']);return _0x3e1865(_0x26b212[_0xdf29('0x15')][_0xdf29('0x16')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x517d89,_0xdf29('0x12'));_0x3e1865(_0x26b212[_0xdf29('0x17')]['message']);}})[_0xdf29('0x18')](function(_0xf56cfa){logger[_0xdf29('0x15')](_0xdf29('0x11'),_0x517d89,_0xf56cfa);_0x14b4ec(_0xf56cfa);});});}exports[_0xdf29('0x19')]=function(_0x407f30){var _0x3cc6d7=this;return new Promise(function(_0x2f1f7d,_0x15501e){return db[_0xdf29('0x1a')][_0xdf29('0x1b')]({'raw':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1d')]===undefined?!![]:![]:!![],'where':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')]['where']||null:null,'attributes':_0x407f30['options']?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1e')]||null:null,'limit':_0x407f30[_0xdf29('0x1c')]?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x1f')]||null:null,'include':_0x407f30['options']?_0x407f30[_0xdf29('0x1c')][_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x407f30[_0xdf29('0x1c')]['include'],function(_0x29d3a1){return{'model':db[_0x29d3a1['model']],'as':_0x29d3a1['as'],'attributes':_0x29d3a1['attributes'],'include':_0x29d3a1['include']?_['map'](_0x29d3a1['include'],function(_0x3ba001){return{'model':db[_0x3ba001['model']],'as':_0x3ba001['as'],'attributes':_0x3ba001[_0xdf29('0x1e')],'include':_0x3ba001['include']?_['map'](_0x3ba001['include'],function(_0x3f5a96){return{'model':db[_0x3f5a96[_0xdf29('0x22')]],'as':_0x3f5a96['as'],'attributes':_0x3f5a96[_0xdf29('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf29('0xf')](function(_0x37ca23){logger[_0xdf29('0x10')]('GetChatQueue',_0x407f30);logger['debug'](_0xdf29('0x19'),_0x407f30,JSON[_0xdf29('0x14')](_0x37ca23));_0x2f1f7d(_0x37ca23);})[_0xdf29('0x18')](function(_0x240777){logger[_0xdf29('0x15')](_0xdf29('0x19'),_0x240777[_0xdf29('0x16')],_0x407f30);_0x15501e(_0x3cc6d7[_0xdf29('0x15')](0x1f4,_0x240777[_0xdf29('0x16')]));});});};exports[_0xdf29('0x23')]=function(_0x1bb3ce){var _0x38ad0d=this;return new Promise(function(_0x15141e,_0x1a4c24){return db[_0xdf29('0x1a')]['find']({'raw':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')][_0xdf29('0x24')]||null:null,'attributes':_0x1bb3ce['options']?_0x1bb3ce[_0xdf29('0x1c')][_0xdf29('0x1e')]||null:null,'include':_0x1bb3ce[_0xdf29('0x1c')]?_0x1bb3ce[_0xdf29('0x1c')]['include']?_[_0xdf29('0x21')](_0x1bb3ce[_0xdf29('0x1c')]['include'],function(_0x36eac3){return{'model':db[_0x36eac3['model']],'as':_0x36eac3['as'],'attributes':_0x36eac3[_0xdf29('0x1e')],'include':_0x36eac3[_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x36eac3[_0xdf29('0x20')],function(_0x174c9e){return{'model':db[_0x174c9e[_0xdf29('0x22')]],'as':_0x174c9e['as'],'attributes':_0x174c9e[_0xdf29('0x1e')],'include':_0x174c9e[_0xdf29('0x20')]?_[_0xdf29('0x21')](_0x174c9e['include'],function(_0x1868ef){return{'model':db[_0x1868ef[_0xdf29('0x22')]],'as':_0x1868ef['as'],'attributes':_0x1868ef[_0xdf29('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdf29('0xf')](function(_0x1bab4f){logger[_0xdf29('0x10')](_0xdf29('0x23'),_0x1bb3ce);logger[_0xdf29('0x25')]('ShowChatQueue',_0x1bb3ce,JSON['stringify'](_0x1bab4f));_0x15141e(_0x1bab4f);})[_0xdf29('0x18')](function(_0x53e82b){logger[_0xdf29('0x15')](_0xdf29('0x23'),_0x53e82b[_0xdf29('0x16')],_0x1bb3ce);_0x1a4c24(_0x38ad0d[_0xdf29('0x15')](0x1f4,_0x53e82b[_0xdf29('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index ef197be..ea0a0bd 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 _0x668b=['./chatQueue.events','save','update','removeListener','length'];(function(_0x5b1a5a,_0x53b1f2){var _0x5ad202=function(_0x189146){while(--_0x189146){_0x5b1a5a['push'](_0x5b1a5a['shift']());}};_0x5ad202(++_0x53b1f2);}(_0x668b,0x140));var _0xb668=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0x668b[_0x1c0991];return _0x5034de;};'use strict';var ChatQueueEvents=require(_0xb668('0x0'));var events=[_0xb668('0x1'),'remove',_0xb668('0x2')];function createListener(_0x2c30c1,_0x49a53b){return function(_0x336ba4){_0x49a53b['emit'](_0x2c30c1,_0x336ba4);};}function removeListener(_0x2fab11,_0x4092a6){return function(){ChatQueueEvents[_0xb668('0x3')](_0x2fab11,_0x4092a6);};}exports['register']=function(_0x9b99a8){for(var _0x296fa9=0x0,_0x3be92e=events[_0xb668('0x4')];_0x296fa9<_0x3be92e;_0x296fa9++){var _0x20b749=events[_0x296fa9];var _0x3f01bc=createListener('chatQueue:'+_0x20b749,_0x9b99a8);ChatQueueEvents['on'](_0x20b749,_0x3f01bc);}};
\ No newline at end of file
+var _0x2dae=['remove','update','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x493876,_0x17ac7c){var _0xa96f38=function(_0x38d42d){while(--_0x38d42d){_0x493876['push'](_0x493876['shift']());}};_0xa96f38(++_0x17ac7c);}(_0x2dae,0xc3));var _0xe2da=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0x2dae[_0x1e175d];return _0x3a3ce5;};'use strict';var ChatQueueEvents=require(_0xe2da('0x0'));var events=['save',_0xe2da('0x1'),_0xe2da('0x2')];function createListener(_0xcd0055,_0x167432){return function(_0x99b46f){_0x167432['emit'](_0xcd0055,_0x99b46f);};}function removeListener(_0x25b9f2,_0x439b5d){return function(){ChatQueueEvents[_0xe2da('0x3')](_0x25b9f2,_0x439b5d);};}exports[_0xe2da('0x4')]=function(_0x523c60){for(var _0x3e3e25=0x0,_0x89c70b=events[_0xe2da('0x5')];_0x3e3e25<_0x89c70b;_0x3e3e25++){var _0x2efbd8=events[_0x3e3e25];var _0x238da3=createListener(_0xe2da('0x6')+_0x2efbd8,_0x523c60);ChatQueueEvents['on'](_0x2efbd8,_0x238da3);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 3fc6504..88e590e 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x26f31c,_0x55689a){var _0x2a27d1=function(_0x2b6fe9){while(--_0x2b6fe9){_0x26f31c['push'](_0x26f31c['shift']());}};_0x2a27d1(++_0x55689a);}(_0x814b,0x1a2));var _0xb814=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x814b[_0x4e9d3c];return _0x2d0825;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x11ce7c,_0x11906f){var _0x21fc8b=function(_0x47bb26){while(--_0x47bb26){_0x11ce7c['push'](_0x11ce7c['shift']());}};_0x21fc8b(++_0x11906f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index e93a85e..4be8d87 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 _0xbe67=['exports','STRING','DATE','moment','sequelize'];(function(_0xcf0d77,_0x2195aa){var _0x13b05f=function(_0x2e798b){while(--_0x2e798b){_0xcf0d77['push'](_0xcf0d77['shift']());}};_0x13b05f(++_0x2195aa);}(_0xbe67,0x1d4));var _0x7be6=function(_0x21294c,_0x8ba24e){_0x21294c=_0x21294c-0x0;var _0x8f9f88=_0xbe67[_0x21294c];return _0x8f9f88;};'use strict';var moment=require(_0x7be6('0x0'));var Sequelize=require(_0x7be6('0x1'));module[_0x7be6('0x2')]={'uniqueid':{'type':Sequelize[_0x7be6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7be6('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7be6('0x4')]},'exitAt':{'type':Sequelize[_0x7be6('0x4')]},'reason':{'type':Sequelize[_0x7be6('0x3')]}};
\ No newline at end of file
+var _0x2e0a=['exports','STRING','DATE','moment','sequelize'];(function(_0x4a9961,_0x261ff8){var _0x3211b5=function(_0x123840){while(--_0x123840){_0x4a9961['push'](_0x4a9961['shift']());}};_0x3211b5(++_0x261ff8);}(_0x2e0a,0xa3));var _0xa2e0=function(_0x55a496,_0x12a0a3){_0x55a496=_0x55a496-0x0;var _0x57fb12=_0x2e0a[_0x55a496];return _0x57fb12;};'use strict';var moment=require(_0xa2e0('0x0'));var Sequelize=require(_0xa2e0('0x1'));module[_0xa2e0('0x2')]={'uniqueid':{'type':Sequelize[_0xa2e0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa2e0('0x3')]},'joinAt':{'type':Sequelize[_0xa2e0('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa2e0('0x4')]},'exitAt':{'type':Sequelize[_0xa2e0('0x4')]},'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 8519c87..6d1cd2f 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 _0x9120=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','nolimit','limit','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','length','merge','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9120,0x1b3));var _0x0912=function(_0x157db2,_0x1a0008){_0x157db2=_0x157db2-0x0;var _0x4d008a=_0x9120[_0x157db2];return _0x4d008a;};'use strict';var emlformat=require(_0x0912('0x0'));var rimraf=require(_0x0912('0x1'));var zipdir=require(_0x0912('0x2'));var jsonpatch=require(_0x0912('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0912('0x4'));var Mustache=require(_0x0912('0x5'));var util=require(_0x0912('0x6'));var path=require(_0x0912('0x7'));var sox=require(_0x0912('0x8'));var csv=require(_0x0912('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0912('0xa'));var _=require(_0x0912('0xb'));var squel=require(_0x0912('0xc'));var crypto=require('crypto');var jsforce=require(_0x0912('0xd'));var deskjs=require(_0x0912('0xe'));var toCsv=require(_0x0912('0x9'));var querystring=require(_0x0912('0xf'));var Papa=require(_0x0912('0x10'));var Redis=require('ioredis');var authService=require(_0x0912('0x11'));var qs=require(_0x0912('0x12'));var as=require(_0x0912('0x13'));var hardwareService=require(_0x0912('0x14'));var logger=require('../../config/logger')(_0x0912('0x15'));var utils=require('../../config/utils');var config=require(_0x0912('0x16'));var licenseUtil=require(_0x0912('0x17'));var db=require(_0x0912('0x18'))['db'];function respondWithStatusCode(_0xc7af62,_0x22752b){_0x22752b=_0x22752b||0xcc;return function(_0x10faac){if(_0x10faac){return _0xc7af62[_0x0912('0x19')](_0x22752b);}return _0xc7af62[_0x0912('0x1a')](_0x22752b)[_0x0912('0x1b')]();};}function respondWithResult(_0x102468,_0x17f22d){_0x17f22d=_0x17f22d||0xc8;return function(_0x350d6b){if(_0x350d6b){return _0x102468[_0x0912('0x1a')](_0x17f22d)[_0x0912('0x1c')](_0x350d6b);}};}function respondWithFilteredResult(_0x247612,_0x5eb1c9){return function(_0x4d00fd){if(_0x4d00fd){var _0x1ed3e8=typeof _0x5eb1c9['offset']===_0x0912('0x1d')&&typeof _0x5eb1c9['limit']===_0x0912('0x1d');var _0x49b581=_0x4d00fd[_0x0912('0x1e')];var _0x5eace1=_0x1ed3e8?0x0:_0x5eb1c9[_0x0912('0x1f')];var _0x5357db=_0x1ed3e8?_0x4d00fd[_0x0912('0x1e')]:_0x5eb1c9['offset']+_0x5eb1c9['limit'];var _0x3377af;if(_0x5357db>=_0x49b581){_0x5357db=_0x49b581;_0x3377af=0xc8;}else{_0x3377af=0xce;}_0x247612['status'](_0x3377af);return _0x247612[_0x0912('0x20')](_0x0912('0x21'),_0x5eace1+'-'+_0x5357db+'/'+_0x49b581)['json'](_0x4d00fd);}return null;};}function patchUpdates(_0x106008){return function(_0xb1af32){try{jsonpatch[_0x0912('0x22')](_0xb1af32,_0x106008,!![]);}catch(_0x5927d2){return BPromise['reject'](_0x5927d2);}return _0xb1af32[_0x0912('0x23')]();};}function saveUpdates(_0x626428,_0x1f04a1){return function(_0x30b7cc){if(_0x30b7cc){return _0x30b7cc[_0x0912('0x24')](_0x626428)[_0x0912('0x25')](function(_0x6c4902){return _0x6c4902;});}return null;};}function removeEntity(_0x2a3e70,_0xca7f8b){return function(_0x572d12){if(_0x572d12){return _0x572d12[_0x0912('0x26')]()[_0x0912('0x25')](function(){_0x2a3e70[_0x0912('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a938e,_0x21d65b){return function(_0x53d673){if(!_0x53d673){_0x4a938e['sendStatus'](0x194);}return _0x53d673;};}function handleError(_0x39462e,_0x39e96b){_0x39e96b=_0x39e96b||0x1f4;return function(_0x4d45d2){logger[_0x0912('0x27')](_0x4d45d2[_0x0912('0x28')]);if(_0x4d45d2[_0x0912('0x29')]){delete _0x4d45d2[_0x0912('0x29')];}_0x39462e[_0x0912('0x1a')](_0x39e96b)['send'](_0x4d45d2);};}exports[_0x0912('0x2a')]=function(_0x1d6c87,_0x4ac024){var _0x2b1653={},_0x3428a9={},_0x2ce714={'count':0x0,'rows':[]};var _0x5b3956=_[_0x0912('0x2b')](db[_0x0912('0x2c')][_0x0912('0x2d')],function(_0x176529){return{'name':_0x176529['fieldName'],'type':_0x176529[_0x0912('0x2e')][_0x0912('0x2f')]};});_0x3428a9[_0x0912('0x30')]=_[_0x0912('0x2b')](_0x5b3956,_0x0912('0x29'));_0x3428a9[_0x0912('0x31')]=_['keys'](_0x1d6c87['query']);_0x3428a9[_0x0912('0x32')]=_[_0x0912('0x33')](_0x3428a9['model'],_0x3428a9['query']);_0x2b1653[_0x0912('0x34')]=_[_0x0912('0x33')](_0x3428a9[_0x0912('0x30')],qs[_0x0912('0x35')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x35')]));_0x2b1653[_0x0912('0x34')]=_0x2b1653[_0x0912('0x34')]['length']?_0x2b1653['attributes']:_0x3428a9[_0x0912('0x30')];if(!_0x1d6c87[_0x0912('0x31')]['hasOwnProperty'](_0x0912('0x36'))){_0x2b1653[_0x0912('0x37')]=qs[_0x0912('0x37')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x37')]);_0x2b1653[_0x0912('0x1f')]=qs[_0x0912('0x1f')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x1f')]);}_0x2b1653['order']=qs[_0x0912('0x38')](_0x1d6c87[_0x0912('0x31')][_0x0912('0x38')]);_0x2b1653[_0x0912('0x39')]=qs[_0x0912('0x32')](_[_0x0912('0x3a')](_0x1d6c87[_0x0912('0x31')],_0x3428a9['filters']),_0x5b3956);if(_0x1d6c87[_0x0912('0x31')]['filter']){_0x2b1653['where']=_['merge'](_0x2b1653[_0x0912('0x39')],{'$or':_[_0x0912('0x2b')](_0x5b3956,function(_0x5db5f9){if(_0x5db5f9[_0x0912('0x2e')]!==_0x0912('0x3b')){var _0xfdf81c={};_0xfdf81c[_0x5db5f9['name']]={'$like':'%'+_0x1d6c87[_0x0912('0x31')][_0x0912('0x3c')]+'%'};return _0xfdf81c;}})});}_0x2b1653=_['merge']({},_0x2b1653,_0x1d6c87[_0x0912('0x3d')]);var _0x40de57={'where':_0x2b1653[_0x0912('0x39')]};return db[_0x0912('0x2c')][_0x0912('0x1e')](_0x40de57)[_0x0912('0x25')](function(_0x4eb359){_0x2ce714[_0x0912('0x1e')]=_0x4eb359;if(_0x1d6c87[_0x0912('0x31')][_0x0912('0x3e')]){_0x2b1653[_0x0912('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0912('0x40')](_0x2b1653);})[_0x0912('0x25')](function(_0x10040b){_0x2ce714['rows']=_0x10040b;return _0x2ce714;})[_0x0912('0x25')](respondWithFilteredResult(_0x4ac024,_0x2b1653))[_0x0912('0x41')](handleError(_0x4ac024,null));};exports[_0x0912('0x42')]=function(_0x19839e,_0x1c5158){var _0x320f98={'raw':!![],'where':{'id':_0x19839e[_0x0912('0x43')]['id']}},_0x15e23b={};_0x15e23b['model']=_[_0x0912('0x44')](db['ChatQueueReport'][_0x0912('0x2d')]);_0x15e23b[_0x0912('0x31')]=_[_0x0912('0x44')](_0x19839e[_0x0912('0x31')]);_0x15e23b[_0x0912('0x32')]=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],_0x15e23b[_0x0912('0x31')]);_0x320f98['attributes']=_[_0x0912('0x33')](_0x15e23b[_0x0912('0x30')],qs[_0x0912('0x35')](_0x19839e['query'][_0x0912('0x35')]));_0x320f98[_0x0912('0x34')]=_0x320f98[_0x0912('0x34')][_0x0912('0x45')]?_0x320f98[_0x0912('0x34')]:_0x15e23b[_0x0912('0x30')];if(_0x19839e[_0x0912('0x31')][_0x0912('0x3e')]){_0x320f98[_0x0912('0x3f')]=[{'all':!![]}];}_0x320f98=_[_0x0912('0x46')]({},_0x320f98,_0x19839e[_0x0912('0x3d')]);return db[_0x0912('0x2c')][_0x0912('0x47')](_0x320f98)[_0x0912('0x25')](handleEntityNotFound(_0x1c5158,null))[_0x0912('0x25')](respondWithResult(_0x1c5158,null))[_0x0912('0x41')](handleError(_0x1c5158,null));};exports[_0x0912('0x48')]=function(_0x255ee5,_0x3b0548){return db[_0x0912('0x2c')][_0x0912('0x48')](_0x255ee5[_0x0912('0x49')],{})[_0x0912('0x25')](respondWithResult(_0x3b0548,0xc9))['catch'](handleError(_0x3b0548,null));};exports[_0x0912('0x24')]=function(_0x3b94cc,_0x591c83){if(_0x3b94cc[_0x0912('0x49')]['id']){delete _0x3b94cc[_0x0912('0x49')]['id'];}return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x3b94cc[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x591c83,null))['then'](saveUpdates(_0x3b94cc[_0x0912('0x49')],null))[_0x0912('0x25')](respondWithResult(_0x591c83,null))[_0x0912('0x41')](handleError(_0x591c83,null));};exports['destroy']=function(_0x11364e,_0x3ce4bf){return db[_0x0912('0x2c')][_0x0912('0x47')]({'where':{'id':_0x11364e[_0x0912('0x43')]['id']}})[_0x0912('0x25')](handleEntityNotFound(_0x3ce4bf,null))[_0x0912('0x25')](removeEntity(_0x3ce4bf,null))[_0x0912('0x41')](handleError(_0x3ce4bf,null));};exports['describe']=function(_0x91bb1a,_0x360313){return db[_0x0912('0x2c')][_0x0912('0x4a')]()[_0x0912('0x25')](respondWithResult(_0x360313,null))['catch'](handleError(_0x360313,null));};
\ No newline at end of file
+var _0x814b=['undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','ChatQueueReport','includeAll','include','findAll','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4bdd47,_0x24dd3e){var _0x2e7cf6=function(_0x5b7a5a){while(--_0x5b7a5a){_0x4bdd47['push'](_0x4bdd47['shift']());}};_0x2e7cf6(++_0x24dd3e);}(_0x814b,0x1a2));var _0xb814=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0x814b[_0x451735];return _0x41d1e2;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['ChatQueueReport'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['create']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')](_0x338e80[_0xb814('0x49')],{})[_0xb814('0x28')](respondWithResult(_0x55234d,0xc9))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x2cc806,_0x45480e){if(_0x2cc806[_0xb814('0x49')]['id']){delete _0x2cc806[_0xb814('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x2cc806[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45480e,null))[_0xb814('0x28')](saveUpdates(_0x2cc806[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x45480e,null))[_0xb814('0x45')](handleError(_0x45480e,null));};exports[_0xb814('0x29')]=function(_0x4a4f9a,_0x26fd0b){return db[_0xb814('0x41')][_0xb814('0x47')]({'where':{'id':_0x4a4f9a['params']['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x26fd0b,null))['then'](removeEntity(_0x26fd0b,null))[_0xb814('0x45')](handleError(_0x26fd0b,null));};exports['describe']=function(_0x403872,_0x3cf8f8){return db['ChatQueueReport'][_0xb814('0x4a')]()[_0xb814('0x28')](respondWithResult(_0x3cf8f8,null))[_0xb814('0x45')](handleError(_0x3cf8f8,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 8d29d12..3967553 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x505bfb,_0xe48938){var _0x3bca12=function(_0x1fb16f){while(--_0x1fb16f){_0x505bfb['push'](_0x505bfb['shift']());}};_0x3bca12(++_0xe48938);}(_0xb7e7,0x121));var _0x7b7e=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xb7e7[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x30321d,_0x1a6b9c){var _0x411788=function(_0x1f8756){while(--_0x1f8756){_0x30321d['push'](_0x30321d['shift']());}};_0x411788(++_0x1a6b9c);}(_0x757a,0xde));var _0xa757=function(_0x4c4c4b,_0x27b4c0){_0x4c4c4b=_0x4c4c4b-0x0;var _0x4ecc32=_0x757a[_0x4c4c4b];return _0x4ecc32;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 83366cc..f893ed6 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 _0x4b1b=['result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','then','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message'];(function(_0x4b8856,_0x530d7a){var _0x97f799=function(_0x40d345){while(--_0x40d345){_0x4b8856['push'](_0x4b8856['shift']());}};_0x97f799(++_0x530d7a);}(_0x4b1b,0x17f));var _0xb4b1=function(_0x35e51a,_0xb84938){_0x35e51a=_0x35e51a-0x0;var _0x5214d1=_0x4b1b[_0x35e51a];return _0x5214d1;};'use strict';var _=require(_0xb4b1('0x0'));var util=require(_0xb4b1('0x1'));var moment=require(_0xb4b1('0x2'));var BPromise=require(_0xb4b1('0x3'));var rs=require(_0xb4b1('0x4'));var fs=require('fs');var Redis=require(_0xb4b1('0x5'));var db=require(_0xb4b1('0x6'))['db'];var utils=require(_0xb4b1('0x7'));var logger=require(_0xb4b1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb4b1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d6283,_0x34272c,_0xfeb13a){return new BPromise(function(_0x2903d3,_0x289b18){return client[_0xb4b1('0xa')](_0x7d6283,_0xfeb13a)['then'](function(_0x3a7811){logger[_0xb4b1('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x34272c,_0xb4b1('0xc'));logger[_0xb4b1('0xd')](_0xb4b1('0xe'),_0x34272c,_0xb4b1('0xc'),JSON[_0xb4b1('0xf')](_0x3a7811));if(_0x3a7811['error']){if(_0x3a7811[_0xb4b1('0x10')][_0xb4b1('0x11')]===0x1f4){logger[_0xb4b1('0x10')](_0xb4b1('0x12'),_0x34272c,_0x3a7811[_0xb4b1('0x10')][_0xb4b1('0x13')]);return _0x289b18(_0x3a7811[_0xb4b1('0x10')][_0xb4b1('0x13')]);}logger[_0xb4b1('0x10')](_0xb4b1('0x12'),_0x34272c,_0x3a7811['error'][_0xb4b1('0x13')]);return _0x2903d3(_0x3a7811[_0xb4b1('0x10')][_0xb4b1('0x13')]);}else{logger['info'](_0xb4b1('0x12'),_0x34272c,_0xb4b1('0xc'));_0x2903d3(_0x3a7811[_0xb4b1('0x14')][_0xb4b1('0x13')]);}})[_0xb4b1('0x15')](function(_0x3a3c42){logger['error'](_0xb4b1('0x12'),_0x34272c,_0x3a3c42);_0x289b18(_0x3a3c42);});});}exports[_0xb4b1('0x16')]=function(_0x25b284){var _0x544f52=this;return new Promise(function(_0x30f27d,_0x36075d){return db[_0xb4b1('0x17')][_0xb4b1('0x18')](_0x25b284[_0xb4b1('0x19')],{'raw':_0x25b284[_0xb4b1('0x1a')]?_0x25b284[_0xb4b1('0x1a')][_0xb4b1('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3112e3){logger[_0xb4b1('0xb')]('CreateChatQueueReport',_0x25b284);logger[_0xb4b1('0xd')]('CreateChatQueueReport',_0x25b284,JSON['stringify'](_0x3112e3));_0x30f27d(_0x3112e3);})[_0xb4b1('0x15')](function(_0x274b85){logger[_0xb4b1('0x10')](_0xb4b1('0x16'),_0x274b85[_0xb4b1('0x13')],_0x25b284);_0x36075d(_0x544f52[_0xb4b1('0x10')](0x1f4,_0x274b85[_0xb4b1('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x50b0a6){var _0x38897e=this;return new Promise(function(_0x3d0965,_0x22b8e8){return db['ChatQueueReport'][_0xb4b1('0x1c')](_0x50b0a6[_0xb4b1('0x19')],{'raw':_0x50b0a6[_0xb4b1('0x1a')]?_0x50b0a6[_0xb4b1('0x1a')][_0xb4b1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50b0a6[_0xb4b1('0x1a')]?_0x50b0a6['options']['where']||null:null,'attributes':_0x50b0a6['options']?_0x50b0a6['options']['attributes']||null:null,'limit':_0x50b0a6[_0xb4b1('0x1a')]?_0x50b0a6[_0xb4b1('0x1a')]['limit']||null:null})[_0xb4b1('0x1d')](function(_0x4c639f){logger[_0xb4b1('0xb')](_0xb4b1('0x1e'),_0x50b0a6);logger[_0xb4b1('0xd')](_0xb4b1('0x1e'),_0x50b0a6,JSON[_0xb4b1('0xf')](_0x4c639f));_0x3d0965(_0x4c639f);})[_0xb4b1('0x15')](function(_0x28321f){logger[_0xb4b1('0x10')](_0xb4b1('0x1e'),_0x28321f['message'],_0x50b0a6);_0x22b8e8(_0x38897e[_0xb4b1('0x10')](0x1f4,_0x28321f[_0xb4b1('0x13')]));});});};
\ No newline at end of file
+var _0xd0eb=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd0eb,0x11b));var _0xbd0e=function(_0x36909d,_0x2795f1){_0x36909d=_0x36909d-0x0;var _0x1fd29d=_0xd0eb[_0x36909d];return _0x1fd29d;};'use strict';var _=require(_0xbd0e('0x0'));var util=require(_0xbd0e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbd0e('0x2'));var fs=require('fs');var Redis=require(_0xbd0e('0x3'));var db=require(_0xbd0e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd0e('0x5'))('rpc');var config=require(_0xbd0e('0x6'));var jayson=require(_0xbd0e('0x7'));var client=jayson[_0xbd0e('0x8')][_0xbd0e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fb2a5,_0x5837e4,_0x301345){return new BPromise(function(_0x2aa462,_0x23051c){return client[_0xbd0e('0xa')](_0x4fb2a5,_0x301345)['then'](function(_0x300daa){logger[_0xbd0e('0xb')](_0xbd0e('0xc'),_0x5837e4,_0xbd0e('0xd'));logger[_0xbd0e('0xe')](_0xbd0e('0xf'),_0x5837e4,'request\x20sent',JSON[_0xbd0e('0x10')](_0x300daa));if(_0x300daa[_0xbd0e('0x11')]){if(_0x300daa[_0xbd0e('0x11')][_0xbd0e('0x12')]===0x1f4){logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x300daa[_0xbd0e('0x11')][_0xbd0e('0x13')]);return _0x23051c(_0x300daa['error'][_0xbd0e('0x13')]);}logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x300daa['error']['message']);return _0x2aa462(_0x300daa['error'][_0xbd0e('0x13')]);}else{logger[_0xbd0e('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x5837e4,_0xbd0e('0xd'));_0x2aa462(_0x300daa[_0xbd0e('0x14')][_0xbd0e('0x13')]);}})[_0xbd0e('0x15')](function(_0x583422){logger[_0xbd0e('0x11')](_0xbd0e('0xc'),_0x5837e4,_0x583422);_0x23051c(_0x583422);});});}exports[_0xbd0e('0x16')]=function(_0x16ecf2){var _0x53e1c3=this;return new Promise(function(_0xd93d7c,_0x48ec26){return db[_0xbd0e('0x17')][_0xbd0e('0x18')](_0x16ecf2[_0xbd0e('0x19')],{'raw':_0x16ecf2[_0xbd0e('0x1a')]?_0x16ecf2[_0xbd0e('0x1a')][_0xbd0e('0x1b')]===undefined?!![]:![]:!![]})[_0xbd0e('0x1c')](function(_0xf8790){logger[_0xbd0e('0xb')](_0xbd0e('0x16'),_0x16ecf2);logger['debug'](_0xbd0e('0x16'),_0x16ecf2,JSON[_0xbd0e('0x10')](_0xf8790));_0xd93d7c(_0xf8790);})[_0xbd0e('0x15')](function(_0x571a7b){logger[_0xbd0e('0x11')]('CreateChatQueueReport',_0x571a7b[_0xbd0e('0x13')],_0x16ecf2);_0x48ec26(_0x53e1c3[_0xbd0e('0x11')](0x1f4,_0x571a7b[_0xbd0e('0x13')]));});});};exports[_0xbd0e('0x1d')]=function(_0x166d8a){var _0x493b67=this;return new Promise(function(_0x18bd27,_0x377907){return db[_0xbd0e('0x17')][_0xbd0e('0x1e')](_0x166d8a['body'],{'raw':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a[_0xbd0e('0x1a')][_0xbd0e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a[_0xbd0e('0x1a')]['where']||null:null,'attributes':_0x166d8a[_0xbd0e('0x1a')]?_0x166d8a['options'][_0xbd0e('0x1f')]||null:null,'limit':_0x166d8a['options']?_0x166d8a['options'][_0xbd0e('0x20')]||null:null})[_0xbd0e('0x1c')](function(_0x3cf29c){logger[_0xbd0e('0xb')](_0xbd0e('0x1d'),_0x166d8a);logger[_0xbd0e('0xe')](_0xbd0e('0x1d'),_0x166d8a,JSON[_0xbd0e('0x10')](_0x3cf29c));_0x18bd27(_0x3cf29c);})[_0xbd0e('0x15')](function(_0x502cac){logger['error'](_0xbd0e('0x1d'),_0x502cac[_0xbd0e('0x13')],_0x166d8a);_0x377907(_0x493b67['error'](0x1f4,_0x502cac['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a27854e..d516564 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 _0x6328=['post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x4c7201,_0x149744){var _0x2e4329=function(_0x3424f8){while(--_0x3424f8){_0x4c7201['push'](_0x4c7201['shift']());}};_0x2e4329(++_0x149744);}(_0x6328,0x1d3));var _0x8632=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0x6328[_0x2dc7c9];return _0x3e6536;};'use strict';var multer=require(_0x8632('0x0'));var util=require(_0x8632('0x1'));var path=require(_0x8632('0x2'));var timeout=require(_0x8632('0x3'));var express=require('express');var router=express[_0x8632('0x4')]();var fs_extra=require(_0x8632('0x5'));var auth=require(_0x8632('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8632('0x7'));var controller=require(_0x8632('0x8'));router['get']('/',auth[_0x8632('0x9')](),controller[_0x8632('0xa')]);router[_0x8632('0xb')](_0x8632('0xc'),auth[_0x8632('0x9')](),controller[_0x8632('0xd')]);router[_0x8632('0xb')](_0x8632('0xe'),auth[_0x8632('0x9')](),controller[_0x8632('0xf')]);router[_0x8632('0x10')]('/',auth[_0x8632('0x9')](),controller['create']);router[_0x8632('0x11')](_0x8632('0xe'),auth[_0x8632('0x9')](),controller[_0x8632('0x12')]);router['delete'](_0x8632('0xe'),auth['isAuthenticated'](),controller[_0x8632('0x13')]);module[_0x8632('0x14')]=router;
\ No newline at end of file
+var _0xbf76=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create'];(function(_0x2ee360,_0x48442d){var _0x47d4ff=function(_0x2afdcc){while(--_0x2afdcc){_0x2ee360['push'](_0x2ee360['shift']());}};_0x47d4ff(++_0x48442d);}(_0xbf76,0x14f));var _0x6bf7=function(_0x5c91f1,_0x5d27ef){_0x5c91f1=_0x5c91f1-0x0;var _0x4b4652=_0xbf76[_0x5c91f1];return _0x4b4652;};'use strict';var multer=require(_0x6bf7('0x0'));var util=require(_0x6bf7('0x1'));var path=require(_0x6bf7('0x2'));var timeout=require(_0x6bf7('0x3'));var express=require(_0x6bf7('0x4'));var router=express[_0x6bf7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6bf7('0x6'));var config=require('../../config/environment');var controller=require(_0x6bf7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6bf7('0x8')]);router[_0x6bf7('0x9')](_0x6bf7('0xa'),auth['isAuthenticated'](),controller[_0x6bf7('0xb')]);router[_0x6bf7('0x9')](_0x6bf7('0xc'),auth[_0x6bf7('0xd')](),controller[_0x6bf7('0xe')]);router[_0x6bf7('0xf')]('/',auth[_0x6bf7('0xd')](),controller[_0x6bf7('0x10')]);router[_0x6bf7('0x11')](_0x6bf7('0xc'),auth['isAuthenticated'](),controller[_0x6bf7('0x12')]);router[_0x6bf7('0x13')](_0x6bf7('0xc'),auth[_0x6bf7('0xd')](),controller[_0x6bf7('0x14')]);module[_0x6bf7('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 d89f213..7a83fee 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x154abc,_0x4d10d5){var _0x4d702=function(_0x2f9e56){while(--_0x2f9e56){_0x154abc['push'](_0x154abc['shift']());}};_0x4d702(++_0x4d10d5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x33f1f1,_0x3f2a10){_0x33f1f1=_0x33f1f1-0x0;var _0x3052d4=_0xf3cd[_0x33f1f1];return _0x3052d4;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x3d2ea4,_0xbbfa1d){var _0x2c4a59=function(_0x1ee70f){while(--_0x1ee70f){_0x3d2ea4['push'](_0x3d2ea4['shift']());}};_0x2c4a59(++_0xbbfa1d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index cacfd59..68a384a 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 _0xf632=['includeAll','find','create','catch','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','error','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','merge','filter','options','include','findAll','rows','show','params','length'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0xf632,0x1c2));var _0x2f63=function(_0x2e3457,_0x550d7c){_0x2e3457=_0x2e3457-0x0;var _0x59d404=_0xf632[_0x2e3457];return _0x59d404;};'use strict';var emlformat=require(_0x2f63('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f63('0x1'));var rp=require(_0x2f63('0x2'));var moment=require(_0x2f63('0x3'));var BPromise=require(_0x2f63('0x4'));var Mustache=require(_0x2f63('0x5'));var util=require(_0x2f63('0x6'));var path=require(_0x2f63('0x7'));var sox=require(_0x2f63('0x8'));var csv=require(_0x2f63('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f63('0xa'));var _=require(_0x2f63('0xb'));var squel=require(_0x2f63('0xc'));var crypto=require('crypto');var jsforce=require(_0x2f63('0xd'));var deskjs=require(_0x2f63('0xe'));var toCsv=require(_0x2f63('0x9'));var querystring=require(_0x2f63('0xf'));var Papa=require('papaparse');var Redis=require(_0x2f63('0x10'));var authService=require(_0x2f63('0x11'));var qs=require(_0x2f63('0x12'));var as=require(_0x2f63('0x13'));var hardwareService=require(_0x2f63('0x14'));var logger=require(_0x2f63('0x15'))(_0x2f63('0x16'));var utils=require(_0x2f63('0x17'));var config=require(_0x2f63('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f63('0x19'))['db'];function respondWithStatusCode(_0x4887a9,_0x177421){_0x177421=_0x177421||0xcc;return function(_0x4f6dc1){if(_0x4f6dc1){return _0x4887a9[_0x2f63('0x1a')](_0x177421);}return _0x4887a9[_0x2f63('0x1b')](_0x177421)[_0x2f63('0x1c')]();};}function respondWithResult(_0x5860b9,_0x521ae9){_0x521ae9=_0x521ae9||0xc8;return function(_0xb1e2e6){if(_0xb1e2e6){return _0x5860b9['status'](_0x521ae9)[_0x2f63('0x1d')](_0xb1e2e6);}};}function respondWithFilteredResult(_0x5bb716,_0x3d88a8){return function(_0x3da9b6){if(_0x3da9b6){var _0x4a9aad=typeof _0x3d88a8[_0x2f63('0x1e')]===_0x2f63('0x1f')&&typeof _0x3d88a8['limit']===_0x2f63('0x1f');var _0xa2ebc3=_0x3da9b6['count'];var _0x1fa5e9=_0x4a9aad?0x0:_0x3d88a8[_0x2f63('0x1e')];var _0x16a83b=_0x4a9aad?_0x3da9b6[_0x2f63('0x20')]:_0x3d88a8[_0x2f63('0x1e')]+_0x3d88a8[_0x2f63('0x21')];var _0x2d3c02;if(_0x16a83b>=_0xa2ebc3){_0x16a83b=_0xa2ebc3;_0x2d3c02=0xc8;}else{_0x2d3c02=0xce;}_0x5bb716[_0x2f63('0x1b')](_0x2d3c02);return _0x5bb716[_0x2f63('0x22')](_0x2f63('0x23'),_0x1fa5e9+'-'+_0x16a83b+'/'+_0xa2ebc3)[_0x2f63('0x1d')](_0x3da9b6);}return null;};}function patchUpdates(_0x2f94f5){return function(_0x4804e3){try{jsonpatch[_0x2f63('0x24')](_0x4804e3,_0x2f94f5,!![]);}catch(_0x14c0cf){return BPromise[_0x2f63('0x25')](_0x14c0cf);}return _0x4804e3['save']();};}function saveUpdates(_0x20aeec,_0xa78b9a){return function(_0x52af76){if(_0x52af76){return _0x52af76[_0x2f63('0x26')](_0x20aeec)['then'](function(_0xe62e72){return _0xe62e72;});}return null;};}function removeEntity(_0x110417,_0x3ee8e2){return function(_0x54dda4){if(_0x54dda4){return _0x54dda4['destroy']()[_0x2f63('0x27')](function(){_0x110417[_0x2f63('0x1b')](0xcc)[_0x2f63('0x1c')]();});}};}function handleEntityNotFound(_0x1b75f3,_0x38b626){return function(_0x46794e){if(!_0x46794e){_0x1b75f3[_0x2f63('0x1a')](0x194);}return _0x46794e;};}function handleError(_0x3358fa,_0x2298e5){_0x2298e5=_0x2298e5||0x1f4;return function(_0x3eb1f4){logger[_0x2f63('0x28')](_0x3eb1f4['stack']);if(_0x3eb1f4[_0x2f63('0x29')]){delete _0x3eb1f4['name'];}_0x3358fa[_0x2f63('0x1b')](_0x2298e5)[_0x2f63('0x2a')](_0x3eb1f4);};}exports[_0x2f63('0x2b')]=function(_0xf63465,_0x25a3db){var _0x27c5b1={},_0x46004a={},_0x13de37={'count':0x0,'rows':[]};var _0x4666bd=_[_0x2f63('0x2c')](db[_0x2f63('0x2d')][_0x2f63('0x2e')],function(_0x53faad){return{'name':_0x53faad['fieldName'],'type':_0x53faad[_0x2f63('0x2f')][_0x2f63('0x30')]};});_0x46004a[_0x2f63('0x31')]=_[_0x2f63('0x2c')](_0x4666bd,_0x2f63('0x29'));_0x46004a[_0x2f63('0x32')]=_[_0x2f63('0x33')](_0xf63465[_0x2f63('0x32')]);_0x46004a[_0x2f63('0x34')]=_[_0x2f63('0x35')](_0x46004a[_0x2f63('0x31')],_0x46004a[_0x2f63('0x32')]);_0x27c5b1[_0x2f63('0x36')]=_[_0x2f63('0x35')](_0x46004a[_0x2f63('0x31')],qs[_0x2f63('0x37')](_0xf63465[_0x2f63('0x32')][_0x2f63('0x37')]));_0x27c5b1[_0x2f63('0x36')]=_0x27c5b1['attributes']['length']?_0x27c5b1[_0x2f63('0x36')]:_0x46004a['model'];if(!_0xf63465[_0x2f63('0x32')][_0x2f63('0x38')]('nolimit')){_0x27c5b1[_0x2f63('0x21')]=qs[_0x2f63('0x21')](_0xf63465['query'][_0x2f63('0x21')]);_0x27c5b1[_0x2f63('0x1e')]=qs[_0x2f63('0x1e')](_0xf63465[_0x2f63('0x32')][_0x2f63('0x1e')]);}_0x27c5b1[_0x2f63('0x39')]=qs['sort'](_0xf63465[_0x2f63('0x32')]['sort']);_0x27c5b1['where']=qs[_0x2f63('0x34')](_['pick'](_0xf63465[_0x2f63('0x32')],_0x46004a['filters']),_0x4666bd);if(_0xf63465[_0x2f63('0x32')]['filter']){_0x27c5b1[_0x2f63('0x3a')]=_[_0x2f63('0x3b')](_0x27c5b1[_0x2f63('0x3a')],{'$or':_[_0x2f63('0x2c')](_0x4666bd,function(_0x30419e){if(_0x30419e['type']!=='VIRTUAL'){var _0xf97f1b={};_0xf97f1b[_0x30419e['name']]={'$like':'%'+_0xf63465['query'][_0x2f63('0x3c')]+'%'};return _0xf97f1b;}})});}_0x27c5b1=_['merge']({},_0x27c5b1,_0xf63465[_0x2f63('0x3d')]);var _0x374a45={'where':_0x27c5b1[_0x2f63('0x3a')]};return db[_0x2f63('0x2d')][_0x2f63('0x20')](_0x374a45)['then'](function(_0x398c2c){_0x13de37['count']=_0x398c2c;if(_0xf63465['query']['includeAll']){_0x27c5b1[_0x2f63('0x3e')]=[{'all':!![]}];}return db[_0x2f63('0x2d')][_0x2f63('0x3f')](_0x27c5b1);})[_0x2f63('0x27')](function(_0x4870c7){_0x13de37[_0x2f63('0x40')]=_0x4870c7;return _0x13de37;})['then'](respondWithFilteredResult(_0x25a3db,_0x27c5b1))['catch'](handleError(_0x25a3db,null));};exports[_0x2f63('0x41')]=function(_0x3c2b87,_0x349bbc){var _0x466558={'raw':!![],'where':{'id':_0x3c2b87[_0x2f63('0x42')]['id']}},_0x134d43={};_0x134d43[_0x2f63('0x31')]=_[_0x2f63('0x33')](db[_0x2f63('0x2d')]['rawAttributes']);_0x134d43[_0x2f63('0x32')]=_[_0x2f63('0x33')](_0x3c2b87[_0x2f63('0x32')]);_0x134d43[_0x2f63('0x34')]=_['intersection'](_0x134d43['model'],_0x134d43['query']);_0x466558[_0x2f63('0x36')]=_[_0x2f63('0x35')](_0x134d43['model'],qs[_0x2f63('0x37')](_0x3c2b87[_0x2f63('0x32')][_0x2f63('0x37')]));_0x466558[_0x2f63('0x36')]=_0x466558[_0x2f63('0x36')][_0x2f63('0x43')]?_0x466558[_0x2f63('0x36')]:_0x134d43[_0x2f63('0x31')];if(_0x3c2b87['query'][_0x2f63('0x44')]){_0x466558['include']=[{'all':!![]}];}_0x466558=_['merge']({},_0x466558,_0x3c2b87[_0x2f63('0x3d')]);return db['ChatTransferReport'][_0x2f63('0x45')](_0x466558)[_0x2f63('0x27')](handleEntityNotFound(_0x349bbc,null))['then'](respondWithResult(_0x349bbc,null))['catch'](handleError(_0x349bbc,null));};exports[_0x2f63('0x46')]=function(_0xac2b5f,_0x4d13e8){return db['ChatTransferReport']['create'](_0xac2b5f['body'],{})[_0x2f63('0x27')](respondWithResult(_0x4d13e8,0xc9))[_0x2f63('0x47')](handleError(_0x4d13e8,null));};exports[_0x2f63('0x26')]=function(_0x453ce3,_0x7033f0){if(_0x453ce3[_0x2f63('0x48')]['id']){delete _0x453ce3[_0x2f63('0x48')]['id'];}return db['ChatTransferReport'][_0x2f63('0x45')]({'where':{'id':_0x453ce3[_0x2f63('0x42')]['id']}})['then'](handleEntityNotFound(_0x7033f0,null))[_0x2f63('0x27')](saveUpdates(_0x453ce3['body'],null))[_0x2f63('0x27')](respondWithResult(_0x7033f0,null))[_0x2f63('0x47')](handleError(_0x7033f0,null));};exports['destroy']=function(_0x21adc9,_0x4f7af7){return db[_0x2f63('0x2d')][_0x2f63('0x45')]({'where':{'id':_0x21adc9[_0x2f63('0x42')]['id']}})[_0x2f63('0x27')](handleEntityNotFound(_0x4f7af7,null))[_0x2f63('0x27')](removeEntity(_0x4f7af7,null))['catch'](handleError(_0x4f7af7,null));};exports[_0x2f63('0x49')]=function(_0x3768a6,_0xed7d4){return db[_0x2f63('0x2d')][_0x2f63('0x49')]()[_0x2f63('0x27')](respondWithResult(_0xed7d4,null))[_0x2f63('0x47')](handleError(_0xed7d4,null));};
\ No newline at end of file
+var _0xfa8f=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','json','apply','reject','save','update','then','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','show','model','length','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0xfa8f,0x15e));var _0xffa8=function(_0x517b20,_0x1155af){_0x517b20=_0x517b20-0x0;var _0x2b083b=_0xfa8f[_0x517b20];return _0x2b083b;};'use strict';var emlformat=require(_0xffa8('0x0'));var rimraf=require(_0xffa8('0x1'));var zipdir=require(_0xffa8('0x2'));var jsonpatch=require(_0xffa8('0x3'));var rp=require('request-promise');var moment=require(_0xffa8('0x4'));var BPromise=require(_0xffa8('0x5'));var Mustache=require(_0xffa8('0x6'));var util=require(_0xffa8('0x7'));var path=require('path');var sox=require(_0xffa8('0x8'));var csv=require(_0xffa8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffa8('0xa'));var squel=require(_0xffa8('0xb'));var crypto=require(_0xffa8('0xc'));var jsforce=require(_0xffa8('0xd'));var deskjs=require(_0xffa8('0xe'));var toCsv=require(_0xffa8('0x9'));var querystring=require('querystring');var Papa=require(_0xffa8('0xf'));var Redis=require('ioredis');var authService=require(_0xffa8('0x10'));var qs=require(_0xffa8('0x11'));var as=require(_0xffa8('0x12'));var hardwareService=require(_0xffa8('0x13'));var logger=require(_0xffa8('0x14'))(_0xffa8('0x15'));var utils=require(_0xffa8('0x16'));var config=require(_0xffa8('0x17'));var licenseUtil=require(_0xffa8('0x18'));var db=require(_0xffa8('0x19'))['db'];function respondWithStatusCode(_0x1c6a89,_0x57ee43){_0x57ee43=_0x57ee43||0xcc;return function(_0x544574){if(_0x544574){return _0x1c6a89[_0xffa8('0x1a')](_0x57ee43);}return _0x1c6a89[_0xffa8('0x1b')](_0x57ee43)[_0xffa8('0x1c')]();};}function respondWithResult(_0x58e67e,_0x17e355){_0x17e355=_0x17e355||0xc8;return function(_0x5d9b49){if(_0x5d9b49){return _0x58e67e[_0xffa8('0x1b')](_0x17e355)['json'](_0x5d9b49);}};}function respondWithFilteredResult(_0x546f5c,_0x2a60f6){return function(_0xd1b092){if(_0xd1b092){var _0x38039e=typeof _0x2a60f6['offset']===_0xffa8('0x1d')&&typeof _0x2a60f6[_0xffa8('0x1e')]===_0xffa8('0x1d');var _0x52b6b5=_0xd1b092[_0xffa8('0x1f')];var _0x3e11b0=_0x38039e?0x0:_0x2a60f6[_0xffa8('0x20')];var _0x329559=_0x38039e?_0xd1b092[_0xffa8('0x1f')]:_0x2a60f6[_0xffa8('0x20')]+_0x2a60f6[_0xffa8('0x1e')];var _0xa0ec7;if(_0x329559>=_0x52b6b5){_0x329559=_0x52b6b5;_0xa0ec7=0xc8;}else{_0xa0ec7=0xce;}_0x546f5c[_0xffa8('0x1b')](_0xa0ec7);return _0x546f5c['set']('Content-Range',_0x3e11b0+'-'+_0x329559+'/'+_0x52b6b5)[_0xffa8('0x21')](_0xd1b092);}return null;};}function patchUpdates(_0x13d3d3){return function(_0x5dce53){try{jsonpatch[_0xffa8('0x22')](_0x5dce53,_0x13d3d3,!![]);}catch(_0x738e0e){return BPromise[_0xffa8('0x23')](_0x738e0e);}return _0x5dce53[_0xffa8('0x24')]();};}function saveUpdates(_0x2be6d4,_0x214ff7){return function(_0x499427){if(_0x499427){return _0x499427[_0xffa8('0x25')](_0x2be6d4)[_0xffa8('0x26')](function(_0x16b0f7){return _0x16b0f7;});}return null;};}function removeEntity(_0x48d7be,_0x3aef02){return function(_0x23ae48){if(_0x23ae48){return _0x23ae48['destroy']()[_0xffa8('0x26')](function(){_0x48d7be[_0xffa8('0x1b')](0xcc)[_0xffa8('0x1c')]();});}};}function handleEntityNotFound(_0x56d140,_0xa666){return function(_0x3fa102){if(!_0x3fa102){_0x56d140['sendStatus'](0x194);}return _0x3fa102;};}function handleError(_0x5e0fe2,_0x51a250){_0x51a250=_0x51a250||0x1f4;return function(_0x291282){logger['error'](_0x291282[_0xffa8('0x27')]);if(_0x291282[_0xffa8('0x28')]){delete _0x291282[_0xffa8('0x28')];}_0x5e0fe2['status'](_0x51a250)[_0xffa8('0x29')](_0x291282);};}exports[_0xffa8('0x2a')]=function(_0x216d4a,_0x45f0b4){var _0x55e1c0={},_0x5a97ec={},_0xc957fa={'count':0x0,'rows':[]};var _0x3a3745=_[_0xffa8('0x2b')](db[_0xffa8('0x2c')][_0xffa8('0x2d')],function(_0x1fe2c9){return{'name':_0x1fe2c9[_0xffa8('0x2e')],'type':_0x1fe2c9[_0xffa8('0x2f')][_0xffa8('0x30')]};});_0x5a97ec['model']=_['map'](_0x3a3745,_0xffa8('0x28'));_0x5a97ec[_0xffa8('0x31')]=_[_0xffa8('0x32')](_0x216d4a[_0xffa8('0x31')]);_0x5a97ec['filters']=_[_0xffa8('0x33')](_0x5a97ec['model'],_0x5a97ec['query']);_0x55e1c0[_0xffa8('0x34')]=_[_0xffa8('0x33')](_0x5a97ec['model'],qs[_0xffa8('0x35')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x35')]));_0x55e1c0[_0xffa8('0x34')]=_0x55e1c0[_0xffa8('0x34')]['length']?_0x55e1c0[_0xffa8('0x34')]:_0x5a97ec['model'];if(!_0x216d4a[_0xffa8('0x31')]['hasOwnProperty'](_0xffa8('0x36'))){_0x55e1c0[_0xffa8('0x1e')]=qs[_0xffa8('0x1e')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x1e')]);_0x55e1c0[_0xffa8('0x20')]=qs['offset'](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x20')]);}_0x55e1c0['order']=qs[_0xffa8('0x37')](_0x216d4a[_0xffa8('0x31')][_0xffa8('0x37')]);_0x55e1c0[_0xffa8('0x38')]=qs[_0xffa8('0x39')](_[_0xffa8('0x3a')](_0x216d4a[_0xffa8('0x31')],_0x5a97ec['filters']),_0x3a3745);if(_0x216d4a[_0xffa8('0x31')][_0xffa8('0x3b')]){_0x55e1c0[_0xffa8('0x38')]=_['merge'](_0x55e1c0[_0xffa8('0x38')],{'$or':_[_0xffa8('0x2b')](_0x3a3745,function(_0x2413c2){if(_0x2413c2['type']!=='VIRTUAL'){var _0x543492={};_0x543492[_0x2413c2[_0xffa8('0x28')]]={'$like':'%'+_0x216d4a['query']['filter']+'%'};return _0x543492;}})});}_0x55e1c0=_[_0xffa8('0x3c')]({},_0x55e1c0,_0x216d4a[_0xffa8('0x3d')]);var _0x513a44={'where':_0x55e1c0[_0xffa8('0x38')]};return db['ChatTransferReport']['count'](_0x513a44)['then'](function(_0x9a4b94){_0xc957fa[_0xffa8('0x1f')]=_0x9a4b94;if(_0x216d4a[_0xffa8('0x31')][_0xffa8('0x3e')]){_0x55e1c0['include']=[{'all':!![]}];}return db[_0xffa8('0x2c')][_0xffa8('0x3f')](_0x55e1c0);})[_0xffa8('0x26')](function(_0x2ce7ce){_0xc957fa['rows']=_0x2ce7ce;return _0xc957fa;})[_0xffa8('0x26')](respondWithFilteredResult(_0x45f0b4,_0x55e1c0))['catch'](handleError(_0x45f0b4,null));};exports[_0xffa8('0x40')]=function(_0x3546aa,_0x462c4e){var _0xb29e4a={'raw':!![],'where':{'id':_0x3546aa['params']['id']}},_0x3aa9ab={};_0x3aa9ab[_0xffa8('0x41')]=_[_0xffa8('0x32')](db[_0xffa8('0x2c')]['rawAttributes']);_0x3aa9ab[_0xffa8('0x31')]=_[_0xffa8('0x32')](_0x3546aa[_0xffa8('0x31')]);_0x3aa9ab['filters']=_['intersection'](_0x3aa9ab[_0xffa8('0x41')],_0x3aa9ab[_0xffa8('0x31')]);_0xb29e4a['attributes']=_[_0xffa8('0x33')](_0x3aa9ab['model'],qs[_0xffa8('0x35')](_0x3546aa['query'][_0xffa8('0x35')]));_0xb29e4a[_0xffa8('0x34')]=_0xb29e4a['attributes'][_0xffa8('0x42')]?_0xb29e4a[_0xffa8('0x34')]:_0x3aa9ab[_0xffa8('0x41')];if(_0x3546aa[_0xffa8('0x31')][_0xffa8('0x3e')]){_0xb29e4a[_0xffa8('0x43')]=[{'all':!![]}];}_0xb29e4a=_[_0xffa8('0x3c')]({},_0xb29e4a,_0x3546aa['options']);return db[_0xffa8('0x2c')][_0xffa8('0x44')](_0xb29e4a)[_0xffa8('0x26')](handleEntityNotFound(_0x462c4e,null))['then'](respondWithResult(_0x462c4e,null))[_0xffa8('0x45')](handleError(_0x462c4e,null));};exports[_0xffa8('0x46')]=function(_0x3d856d,_0x3ff3ef){return db[_0xffa8('0x2c')][_0xffa8('0x46')](_0x3d856d[_0xffa8('0x47')],{})[_0xffa8('0x26')](respondWithResult(_0x3ff3ef,0xc9))[_0xffa8('0x45')](handleError(_0x3ff3ef,null));};exports[_0xffa8('0x25')]=function(_0x203d77,_0x470047){if(_0x203d77['body']['id']){delete _0x203d77['body']['id'];}return db[_0xffa8('0x2c')][_0xffa8('0x44')]({'where':{'id':_0x203d77['params']['id']}})['then'](handleEntityNotFound(_0x470047,null))[_0xffa8('0x26')](saveUpdates(_0x203d77[_0xffa8('0x47')],null))[_0xffa8('0x26')](respondWithResult(_0x470047,null))[_0xffa8('0x45')](handleError(_0x470047,null));};exports['destroy']=function(_0x45886a,_0x386312){return db[_0xffa8('0x2c')][_0xffa8('0x44')]({'where':{'id':_0x45886a[_0xffa8('0x48')]['id']}})[_0xffa8('0x26')](handleEntityNotFound(_0x386312,null))[_0xffa8('0x26')](removeEntity(_0x386312,null))[_0xffa8('0x45')](handleError(_0x386312,null));};exports['describe']=function(_0x337745,_0x331a3c){return db[_0xffa8('0x2c')][_0xffa8('0x49')]()['then'](respondWithResult(_0x331a3c,null))[_0xffa8('0x45')](handleError(_0x331a3c,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index b005438..dc859ec 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 _0xd7a8=['path','../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x26a619,_0x1d78eb){var _0x2a0102=function(_0x2bc7a0){while(--_0x2bc7a0){_0x26a619['push'](_0x26a619['shift']());}};_0x2a0102(++_0x1d78eb);}(_0xd7a8,0x10e));var _0x8d7a=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xd7a8[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x8d7a('0x0'));var util=require('util');var logger=require(_0x8d7a('0x1'))(_0x8d7a('0x2'));var moment=require(_0x8d7a('0x3'));var BPromise=require(_0x8d7a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d7a('0x5'));var rimraf=require('rimraf');var config=require(_0x8d7a('0x6'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x2a5b42,_0x3e175f){return _0x2a5b42[_0x8d7a('0x7')](_0x8d7a('0x8'),attributes,{'tableName':_0x8d7a('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8d7a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd87f=['lodash','util','api','moment','request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x3ea698,_0x2dd8a7){var _0x19a411=function(_0x2ea112){while(--_0x2ea112){_0x3ea698['push'](_0x3ea698['shift']());}};_0x19a411(++_0x2dd8a7);}(_0xd87f,0x12c));var _0xfd87=function(_0x4f4965,_0x2de5c5){_0x4f4965=_0x4f4965-0x0;var _0x19e5d9=_0xd87f[_0x4f4965];return _0x19e5d9;};'use strict';var _=require(_0xfd87('0x0'));var util=require(_0xfd87('0x1'));var logger=require('../../config/logger')(_0xfd87('0x2'));var moment=require(_0xfd87('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd87('0x4'));var fs=require('fs');var path=require(_0xfd87('0x5'));var rimraf=require(_0xfd87('0x6'));var config=require('../../config/environment');var attributes=require(_0xfd87('0x7'));module[_0xfd87('0x8')]=function(_0xd42ae0,_0x5e4003){return _0xd42ae0[_0xfd87('0x9')](_0xfd87('0xa'),attributes,{'tableName':_0xfd87('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 86a03e2..a22c861 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 _0x5363=['then','request\x20sent','debug','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x3eb98e,_0x379d16){var _0x257c52=function(_0x58b67a){while(--_0x58b67a){_0x3eb98e['push'](_0x3eb98e['shift']());}};_0x257c52(++_0x379d16);}(_0x5363,0x6c));var _0x3536=function(_0x42266a,_0x3b878c){_0x42266a=_0x42266a-0x0;var _0x5e2346=_0x5363[_0x42266a];return _0x5e2346;};'use strict';var _=require(_0x3536('0x0'));var util=require('util');var moment=require(_0x3536('0x1'));var BPromise=require(_0x3536('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3536('0x3'));var db=require(_0x3536('0x4'))['db'];var utils=require(_0x3536('0x5'));var logger=require(_0x3536('0x6'))(_0x3536('0x7'));var config=require(_0x3536('0x8'));var jayson=require(_0x3536('0x9'));var client=jayson[_0x3536('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2395f1,_0x59b1c4,_0x55188e){return new BPromise(function(_0x369bfe,_0x866c7f){return client[_0x3536('0xb')](_0x2395f1,_0x55188e)[_0x3536('0xc')](function(_0x378394){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x59b1c4,_0x3536('0xd'));logger[_0x3536('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x59b1c4,_0x3536('0xd'),JSON['stringify'](_0x378394));if(_0x378394[_0x3536('0xf')]){if(_0x378394[_0x3536('0xf')][_0x3536('0x10')]===0x1f4){logger['error'](_0x3536('0x11'),_0x59b1c4,_0x378394['error'][_0x3536('0x12')]);return _0x866c7f(_0x378394[_0x3536('0xf')][_0x3536('0x12')]);}logger[_0x3536('0xf')](_0x3536('0x11'),_0x59b1c4,_0x378394[_0x3536('0xf')][_0x3536('0x12')]);return _0x369bfe(_0x378394['error'][_0x3536('0x12')]);}else{logger[_0x3536('0x13')](_0x3536('0x11'),_0x59b1c4,_0x3536('0xd'));_0x369bfe(_0x378394['result']['message']);}})['catch'](function(_0x1ce9b7){logger[_0x3536('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x59b1c4,_0x1ce9b7);_0x866c7f(_0x1ce9b7);});});}
\ No newline at end of file
+var _0xb92c=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash'];(function(_0x48f60a,_0x5914b7){var _0x13829b=function(_0x3f1da5){while(--_0x3f1da5){_0x48f60a['push'](_0x48f60a['shift']());}};_0x13829b(++_0x5914b7);}(_0xb92c,0x175));var _0xcb92=function(_0x2e99a6,_0x423933){_0x2e99a6=_0x2e99a6-0x0;var _0x3cf5b4=_0xb92c[_0x2e99a6];return _0x3cf5b4;};'use strict';var _=require(_0xcb92('0x0'));var util=require(_0xcb92('0x1'));var moment=require(_0xcb92('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb92('0x3'));var db=require(_0xcb92('0x4'))['db'];var utils=require(_0xcb92('0x5'));var logger=require('../../config/logger')(_0xcb92('0x6'));var config=require(_0xcb92('0x7'));var jayson=require(_0xcb92('0x8'));var client=jayson[_0xcb92('0x9')][_0xcb92('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf0b2b1,_0x36b0f0,_0x167288){return new BPromise(function(_0x1da49a,_0x84d276){return client[_0xcb92('0xb')](_0xf0b2b1,_0x167288)[_0xcb92('0xc')](function(_0x416217){logger['info'](_0xcb92('0xd'),_0x36b0f0,_0xcb92('0xe'));logger[_0xcb92('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x36b0f0,_0xcb92('0xe'),JSON[_0xcb92('0x10')](_0x416217));if(_0x416217['error']){if(_0x416217[_0xcb92('0x11')][_0xcb92('0x12')]===0x1f4){logger[_0xcb92('0x11')](_0xcb92('0xd'),_0x36b0f0,_0x416217[_0xcb92('0x11')][_0xcb92('0x13')]);return _0x84d276(_0x416217[_0xcb92('0x11')][_0xcb92('0x13')]);}logger[_0xcb92('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x36b0f0,_0x416217[_0xcb92('0x11')]['message']);return _0x1da49a(_0x416217[_0xcb92('0x11')]['message']);}else{logger[_0xcb92('0x14')](_0xcb92('0xd'),_0x36b0f0,_0xcb92('0xe'));_0x1da49a(_0x416217[_0xcb92('0x15')][_0xcb92('0x13')]);}})['catch'](function(_0x103839){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x36b0f0,_0x103839);_0x84d276(_0x103839);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 6377b7b..6b6951e 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 _0x007b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','put','update','delete','destroy','util'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x007b,0xbd));var _0xb007=function(_0x10e4a9,_0x2bb443){_0x10e4a9=_0x10e4a9-0x0;var _0x24c782=_0x007b[_0x10e4a9];return _0x24c782;};'use strict';var multer=require('multer');var util=require(_0xb007('0x0'));var path=require(_0xb007('0x1'));var timeout=require(_0xb007('0x2'));var express=require(_0xb007('0x3'));var router=express[_0xb007('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb007('0x5'));var interaction=require(_0xb007('0x6'));var config=require('../../config/environment');var controller=require(_0xb007('0x7'));router['get']('/',auth[_0xb007('0x8')](),controller[_0xb007('0x9')]);router[_0xb007('0xa')](_0xb007('0xb'),auth[_0xb007('0x8')](),controller[_0xb007('0xc')]);router[_0xb007('0xa')](_0xb007('0xd'),auth[_0xb007('0x8')](),controller['show']);router[_0xb007('0xe')]('/',auth[_0xb007('0x8')](),controller['create']);router[_0xb007('0xf')](_0xb007('0xd'),auth[_0xb007('0x8')](),controller[_0xb007('0x10')]);router[_0xb007('0x11')](_0xb007('0xd'),auth['isAuthenticated'](),controller[_0xb007('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x0aeb=['../../components/interaction/service','./chatTransferReport.controller','get','index','/describe','describe','isAuthenticated','show','post','put','/:id','delete','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bb24b,_0x3af77a){var _0x34c437=function(_0x218a3a){while(--_0x218a3a){_0x3bb24b['push'](_0x3bb24b['shift']());}};_0x34c437(++_0x3af77a);}(_0x0aeb,0x94));var _0xb0ae=function(_0xa01255,_0x38166e){_0xa01255=_0xa01255-0x0;var _0xa06916=_0x0aeb[_0xa01255];return _0xa06916;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb0ae('0x0'));var express=require(_0xb0ae('0x1'));var router=express[_0xb0ae('0x2')]();var fs_extra=require(_0xb0ae('0x3'));var auth=require(_0xb0ae('0x4'));var interaction=require(_0xb0ae('0x5'));var config=require('../../config/environment');var controller=require(_0xb0ae('0x6'));router[_0xb0ae('0x7')]('/',auth['isAuthenticated'](),controller[_0xb0ae('0x8')]);router['get'](_0xb0ae('0x9'),auth['isAuthenticated'](),controller[_0xb0ae('0xa')]);router['get']('/:id',auth[_0xb0ae('0xb')](),controller[_0xb0ae('0xc')]);router[_0xb0ae('0xd')]('/',auth[_0xb0ae('0xb')](),controller['create']);router[_0xb0ae('0xe')](_0xb0ae('0xf'),auth[_0xb0ae('0xb')](),controller['update']);router[_0xb0ae('0x10')]('/:id',auth[_0xb0ae('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 2f92ea8..b2c70e6 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 _0x423b=['mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','squared','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','text','input','onlineForm','getDataValue','Comments','Leave\x20your\x20comments','parse','setDataValue','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0x423b,0xd3));var _0xb423=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0x423b[_0x44946b];return _0x249bc4;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xb423('0x0'));module[_0xb423('0x1')]={'name':{'type':Sequelize[_0xb423('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xb423('0x2')],'allowNull':![],'unique':_0xb423('0x3')},'description':{'type':Sequelize[_0xb423('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x4')},'mapKeyOffline':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x5')},'customerAlias':{'type':Sequelize[_0xb423('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xb423('0x2')],'allowNull':![],'defaultValue':_0xb423('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb423('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb423('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb423('0x2')]},'animation':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb423('0x9')]('rounded',_0xb423('0xa')),'defaultValue':_0xb423('0xb')},'header_online':{'type':Sequelize[_0xb423('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0xe')},'download_transcript':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb423('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x13')},'placeholderMessage':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x14')},'closingMessage':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0xd')},'skipMessageButton':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x16')},'conditionAgreement':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x17')},'ratingType':{'type':Sequelize[_0xb423('0x9')]('star',_0xb423('0x18')),'defaultValue':_0xb423('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb423('0x10')],'defaultValue':function(){return JSON[_0xb423('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':_0xb423('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xb423('0x1c'),'props':{'title':_0xb423('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb423('0x4'),'type':_0xb423('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xb423('0x1d'))?JSON['parse'](this[_0xb423('0x1e')](_0xb423('0x1d'))):{};},'set':function(_0x4d127a){return this['setDataValue'](_0xb423('0x1d'),JSON['stringify'](_0x4d127a));}},'offlineForm':{'type':Sequelize[_0xb423('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xb423('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb423('0x4'),'type':_0xb423('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xb423('0x1f')},'props':{'title':'Comments','helpText':_0xb423('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xb423('0x21')](this[_0xb423('0x1e')]('offlineForm')):{};},'set':function(_0x55b934){return this[_0xb423('0x22')](_0xb423('0x23'),JSON[_0xb423('0x1a')](_0x55b934));}},'token':{'type':Sequelize[_0xb423('0x2')],'defaultValue':function(){return rs[_0xb423('0x24')]();}},'autoclose':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb423('0x2')]},'forwardOffline':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb423('0x2')]},'waitingTitle':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x27')},'offlineMessageBody':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xb423('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x29')},'skipUnmanaged':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x16')},'sendUnmanaged':{'type':Sequelize[_0xb423('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb423('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb423('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb423('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x2b')},'verticalAlignment':{'type':Sequelize[_0xb423('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0xb423('0x2c')},'messagesAlignment':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x2d')},'defaultTitle':{'type':Sequelize[_0xb423('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb423('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb423('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb423('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb423('0x2')],'defaultValue':_0xb423('0x2e')},'systemAvatar':{'type':Sequelize[_0xb423('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb423('0x7')],'comment':_0xb423('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xb423('0x8')],'defaultValue':![],'comment':_0xb423('0x30'),'set':function(_0x930a2f){if(!_0x930a2f)this[_0xb423('0x22')]('mandatoryDispositionPauseId',null);this[_0xb423('0x22')](_0xb423('0x31'),_0x930a2f);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb423('0x32')},'vidaooNote':{'type':Sequelize[_0xb423('0x2')],'defaultValue':function(){return _0xb423('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb423('0x10')]}};
\ No newline at end of file
+var _0x854f=['#fafafa','System','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Send','Skip','Feedback','star','thumb','input','getDataValue','onlineForm','setDataValue','stringify','Comments','Leave\x20your\x20comments','offlineForm','generate','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:','bottom_right','CHAT','alternate'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x854f,0x188));var _0xf854=function(_0x1b859a,_0x1ab2d4){_0x1b859a=_0x1b859a-0x0;var _0x5ce5cd=_0x854f[_0x1b859a];return _0x5ce5cd;};'use strict';var Sequelize=require(_0xf854('0x0'));var rs=require(_0xf854('0x1'));module['exports']={'name':{'type':Sequelize[_0xf854('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xf854('0x2')]},'mapKey':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x3')},'mapKeyOffline':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x3')},'key':{'type':Sequelize[_0xf854('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x4')},'customerAlias':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf854('0x2')]},'animation':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf854('0x9')](_0xf854('0xa'),_0xf854('0xb')),'defaultValue':_0xf854('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0xc')},'start_chat_button':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0xe')},'download_transcript':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf854('0xf')]},'closingQuestion':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x13')},'skipMessageButton':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x14')},'conditionAgreement':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x15')},'ratingType':{'type':Sequelize[_0xf854('0x9')](_0xf854('0x16'),_0xf854('0x17')),'defaultValue':_0xf854('0x16')},'ratingStarsNumber':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf854('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xf854('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf854('0x3'),'type':_0xf854('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf854('0x19')](_0xf854('0x1a'))?JSON['parse'](this['getDataValue'](_0xf854('0x1a'))):{};},'set':function(_0x1f0e81){return this[_0xf854('0x1b')](_0xf854('0x1a'),JSON[_0xf854('0x1c')](_0x1f0e81));}},'offlineForm':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf854('0x18'),'props':{'title':_0xf854('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xf854('0x3'),'type':_0xf854('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf854('0x1d')},'props':{'title':_0xf854('0x1d'),'helpText':_0xf854('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xf854('0x19')](_0xf854('0x1f'))?JSON['parse'](this[_0xf854('0x19')](_0xf854('0x1f'))):{};},'set':function(_0x56a3c5){return this['setDataValue'](_0xf854('0x1f'),JSON[_0xf854('0x1c')](_0x56a3c5));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf854('0x20')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf854('0x2')]},'forwardOffline':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf854('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf854('0x21')},'waitingMessage':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf854('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x14')},'sendUnmanaged':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf854('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf854('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf854('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf854('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x23')},'verticalAlignment':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x24')},'messagesAlignment':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x25')},'defaultTitle':{'type':Sequelize[_0xf854('0x2')]},'customerAvatar':{'type':Sequelize[_0xf854('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf854('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf854('0x2')],'allowNull':![],'defaultValue':_0xf854('0x26'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf854('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf854('0x2')],'defaultValue':_0xf854('0x27')},'systemAvatar':{'type':Sequelize[_0xf854('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb520a2){if(!_0xb520a2)this[_0xf854('0x1b')](_0xf854('0x28'),null);this[_0xf854('0x1b')](_0xf854('0x29'),_0xb520a2);}},'vidaooEscalation':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf854('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf854('0x2')],'defaultValue':function(){return _0xf854('0x2a');}},'vidaooMetadata':{'type':Sequelize[_0xf854('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf854('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index ed6151e..aa198aa 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 _0xd9cc=['getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','asc','contact','customerIp','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mimetype','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','MailAccountId','NotifyMailAccount','notifyMail','remove','addInteraction','omit','getInteractions','User','Owner','internal','Tags','color','tag','Command','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','get','ChatWebsites','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','addDisposition','Disposition','getDispositions','findOne','ChatWebsiteId','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','systemAvatar','root','sitepic','../../config/license/util','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0xd9cc,0xb4));var _0xcd9c=function(_0x112a0a,_0x3fc551){_0x112a0a=_0x112a0a-0x0;var _0x54b93f=_0xd9cc[_0x112a0a];return _0x54b93f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xcd9c('0x0'));var util=require(_0xcd9c('0x1'));var path=require(_0xcd9c('0x2'));var ejs=require(_0xcd9c('0x3'));var fs=require('fs');var fs_extra=require(_0xcd9c('0x4'));var _=require(_0xcd9c('0x5'));var querystring=require(_0xcd9c('0x6'));var Redis=require(_0xcd9c('0x7'));var qs=require(_0xcd9c('0x8'));var logger=require(_0xcd9c('0x9'))(_0xcd9c('0xa'));var config=require(_0xcd9c('0xb'));var db=require(_0xcd9c('0xc'))['db'];config[_0xcd9c('0xd')]=_['defaults'](config[_0xcd9c('0xd')],{'host':_0xcd9c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcd9c('0xf'))[_0xcd9c('0x10')](socket);var jayson=require(_0xcd9c('0x11'));var client=jayson[_0xcd9c('0x12')][_0xcd9c('0x13')]({'port':0x232c});var client9002=jayson['client'][_0xcd9c('0x13')]({'port':0x232a});var client9003=jayson[_0xcd9c('0x12')][_0xcd9c('0x13')]({'port':0x232b});var client9001=jayson[_0xcd9c('0x12')][_0xcd9c('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x25068d,_0x43d41e,_0x3975cc,_0x37f330){return new BPromise(function(_0x2d0364,_0x4b0466){var _0xc694da=_0x37f330||client;return _0xc694da[_0xcd9c('0x14')](_0x25068d,_0x3975cc)[_0xcd9c('0x15')](function(_0x576494){logger[_0xcd9c('0x16')](_0xcd9c('0x17'),_0x43d41e,_0xcd9c('0x18'));logger[_0xcd9c('0x19')](_0xcd9c('0x1a'),_0x43d41e,_0xcd9c('0x18'),JSON['stringify'](_0x576494));if(_0x576494[_0xcd9c('0x1b')]){if(_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1c')]===0x1f4){logger[_0xcd9c('0x1b')](_0xcd9c('0x17'),_0x43d41e,_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1d')]);return _0x4b0466(_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1d')]);}logger[_0xcd9c('0x1b')](_0xcd9c('0x17'),_0x43d41e,_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1d')]);return _0x2d0364(_0x576494[_0xcd9c('0x1b')][_0xcd9c('0x1d')]);}else{logger[_0xcd9c('0x16')](_0xcd9c('0x17'),_0x43d41e,_0xcd9c('0x18'));_0x2d0364(_0x576494['result'][_0xcd9c('0x1d')]);}})[_0xcd9c('0x1e')](function(_0x3d3e68){logger[_0xcd9c('0x1b')](_0xcd9c('0x17'),_0x43d41e,_0x3d3e68);_0x4b0466(_0x3d3e68);});});}function respondWithStatusCode(_0x114d05,_0x2e2dc5){_0x2e2dc5=_0x2e2dc5||0xcc;return function(_0xa6522d){if(_0xa6522d){return _0x114d05[_0xcd9c('0x1f')](_0x2e2dc5);}return _0x114d05[_0xcd9c('0x20')](_0x2e2dc5)[_0xcd9c('0x21')]();};}function respondWithResult(_0x5122d5,_0x13b9ac){_0x13b9ac=_0x13b9ac||0xc8;return function(_0x1f6e06){if(_0x1f6e06){return _0x5122d5[_0xcd9c('0x20')](_0x13b9ac)[_0xcd9c('0x22')](_0x1f6e06);}};}function respondWithFilteredResult(_0x27849f,_0x31c8fc){return function(_0x1d5e0a){if(_0x1d5e0a){var _0x19b4d2=typeof _0x31c8fc[_0xcd9c('0x23')]===_0xcd9c('0x24')&&typeof _0x31c8fc[_0xcd9c('0x25')]==='undefined';var _0x2f54b3=_0x1d5e0a[_0xcd9c('0x26')];var _0x4a597a=_0x19b4d2?0x0:_0x31c8fc[_0xcd9c('0x23')];var _0x11a3e8=_0x19b4d2?_0x1d5e0a[_0xcd9c('0x26')]:_0x31c8fc[_0xcd9c('0x23')]+_0x31c8fc[_0xcd9c('0x25')];var _0x14aed7;if(_0x11a3e8>=_0x2f54b3){_0x11a3e8=_0x2f54b3;_0x14aed7=0xc8;}else{_0x14aed7=0xce;}_0x27849f[_0xcd9c('0x20')](_0x14aed7);return _0x27849f[_0xcd9c('0x27')](_0xcd9c('0x28'),_0x4a597a+'-'+_0x11a3e8+'/'+_0x2f54b3)[_0xcd9c('0x22')](_0x1d5e0a);}return null;};}function saveUpdates(_0x97bdb3){return function(_0x5f02aa){if(_0x5f02aa){return _0x5f02aa['update'](_0x97bdb3)['then'](function(_0x2a0681){return _0x2a0681;});}return null;};}function removeEntity(_0x304dc9){return function(_0x3e84f9){if(_0x3e84f9){return _0x3e84f9['destroy']()['then'](function(){var _0x322afe=_0x3e84f9[_0xcd9c('0x29')]({'plain':!![]});var _0x5b27e0=_0xcd9c('0x2a');return db[_0xcd9c('0x2b')][_0xcd9c('0x2c')]({'where':{'type':_0x5b27e0,'resourceId':_0x322afe['id']}})[_0xcd9c('0x15')](function(){return _0x3e84f9;});})[_0xcd9c('0x15')](function(){_0x304dc9[_0xcd9c('0x20')](0xcc)[_0xcd9c('0x21')]();});}};}function handleEntityNotFound(_0x139e0a){return function(_0x5817b2){if(!_0x5817b2){_0x139e0a[_0xcd9c('0x1f')](0x194);}return _0x5817b2;};}function handleError(_0x30e214,_0x239dc4){_0x239dc4=_0x239dc4||0x1f4;return function(_0x580442){logger['error'](_0x580442[_0xcd9c('0x2d')]);if(_0x580442[_0xcd9c('0x2e')]){delete _0x580442[_0xcd9c('0x2e')];}_0x30e214[_0xcd9c('0x20')](_0x239dc4)['send'](_0x580442);};}exports[_0xcd9c('0x2f')]=function(_0x5d42d8,_0x1cf9f6){var _0x1b1ccf={'include':[{'model':db[_0xcd9c('0x30')],'as':_0xcd9c('0x31')}]},_0x2b4c02={},_0x1fb78d={'count':0x0,'rows':[]};var _0x2f486e=_[_0xcd9c('0x32')](db[_0xcd9c('0x33')][_0xcd9c('0x34')],function(_0x21cd5f){return{'name':_0x21cd5f[_0xcd9c('0x35')],'type':_0x21cd5f['type']['key']};});_0x2b4c02[_0xcd9c('0x36')]=_['map'](_0x2f486e,_0xcd9c('0x2e'));_0x2b4c02['query']=_[_0xcd9c('0x37')](_0x5d42d8[_0xcd9c('0x38')]);_0x2b4c02['filters']=_[_0xcd9c('0x39')](_0x2b4c02[_0xcd9c('0x36')],_0x2b4c02[_0xcd9c('0x38')]);_0x1b1ccf[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x2b4c02['model'],qs[_0xcd9c('0x3b')](_0x5d42d8[_0xcd9c('0x38')]['fields']));_0x1b1ccf[_0xcd9c('0x3a')]=_0x1b1ccf[_0xcd9c('0x3a')]['length']?_0x1b1ccf[_0xcd9c('0x3a')]:_0x2b4c02[_0xcd9c('0x36')];if(!_0x5d42d8['query'][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x1b1ccf[_0xcd9c('0x25')]=qs['limit'](_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x1b1ccf[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x23')]);}_0x1b1ccf[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x3f')]);_0x1b1ccf[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x5d42d8[_0xcd9c('0x38')],_0x2b4c02[_0xcd9c('0x41')]),_0x2f486e);if(_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x43')]){_0x1b1ccf['where']=_[_0xcd9c('0x44')](_0x1b1ccf['where'],{'$or':_[_0xcd9c('0x32')](_0x2f486e,function(_0x2ff86c){if(_0x2ff86c[_0xcd9c('0x45')]!==_0xcd9c('0x46')){var _0x29ccb2={};_0x29ccb2[_0x2ff86c[_0xcd9c('0x2e')]]={'$like':'%'+_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x29ccb2;}})});}_0x1b1ccf=_[_0xcd9c('0x44')]({},_0x1b1ccf,_0x5d42d8[_0xcd9c('0x47')]);var _0x20bde7={'where':_0x1b1ccf[_0xcd9c('0x40')]};return db[_0xcd9c('0x33')]['count'](_0x20bde7)[_0xcd9c('0x15')](function(_0x527bed){_0x1fb78d['count']=_0x527bed;if(_0x5d42d8[_0xcd9c('0x38')][_0xcd9c('0x48')]){_0x1b1ccf[_0xcd9c('0x49')]=[{'all':!![]}];}return db[_0xcd9c('0x33')]['findAll'](_0x1b1ccf);})['then'](function(_0x786dc5){_0x1fb78d[_0xcd9c('0x4a')]=_0x786dc5;return _0x1fb78d;})['then'](respondWithFilteredResult(_0x1cf9f6,_0x1b1ccf))[_0xcd9c('0x1e')](handleError(_0x1cf9f6,null));};exports[_0xcd9c('0x4b')]=function(_0x7ad590,_0x83352){var _0x585aad={'raw':![],'where':{'id':_0x7ad590[_0xcd9c('0x4c')]['id']},'include':[{'model':db['Pause'],'as':_0xcd9c('0x31')}]},_0x908b3b={};_0x908b3b[_0xcd9c('0x36')]=_['keys'](db[_0xcd9c('0x33')][_0xcd9c('0x34')]);_0x908b3b[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x7ad590['query']);_0x908b3b['filters']=_[_0xcd9c('0x39')](_0x908b3b[_0xcd9c('0x36')],_0x908b3b[_0xcd9c('0x38')]);_0x585aad['attributes']=_[_0xcd9c('0x39')](_0x908b3b[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x7ad590[_0xcd9c('0x38')][_0xcd9c('0x3b')]));_0x585aad[_0xcd9c('0x3a')]=_0x585aad[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0x585aad[_0xcd9c('0x3a')]:_0x908b3b[_0xcd9c('0x36')];if(_0x7ad590['query'][_0xcd9c('0x48')]){_0x585aad[_0xcd9c('0x49')]=[{'all':!![]}];}_0x585aad=_[_0xcd9c('0x44')]({},_0x585aad,_0x7ad590[_0xcd9c('0x47')]);return db[_0xcd9c('0x33')]['find'](_0x585aad)[_0xcd9c('0x15')](handleEntityNotFound(_0x83352,null))[_0xcd9c('0x15')](respondWithResult(_0x83352,null))[_0xcd9c('0x1e')](handleError(_0x83352,null));};exports['create']=function(_0x5e854f,_0x174f07){return db['ChatWebsite'][_0xcd9c('0x4e')](_0x5e854f['body'],{})[_0xcd9c('0x15')](function(_0x19b5a6){var _0x33c6cf=_0x5e854f[_0xcd9c('0x4f')][_0xcd9c('0x29')]({'plain':!![]});if(!_0x33c6cf)throw new Error(_0xcd9c('0x50'));if(_0x33c6cf[_0xcd9c('0x51')]==='user'){var _0x2227b5=_0x19b5a6[_0xcd9c('0x29')]({'plain':!![]});var _0x3a198d=_0xcd9c('0x2a');return db[_0xcd9c('0x52')]['find']({'where':{'name':_0x3a198d,'userProfileId':_0x33c6cf[_0xcd9c('0x53')]},'raw':!![]})[_0xcd9c('0x15')](function(_0x4b65c8){if(_0x4b65c8&&_0x4b65c8['autoAssociation']===0x0){return db[_0xcd9c('0x2b')][_0xcd9c('0x4e')]({'name':_0x2227b5[_0xcd9c('0x2e')],'resourceId':_0x2227b5['id'],'type':_0x4b65c8['name'],'sectionId':_0x4b65c8['id']},{})[_0xcd9c('0x15')](function(){return _0x19b5a6;});}else{return _0x19b5a6;}})[_0xcd9c('0x1e')](function(_0x3ad0f2){logger[_0xcd9c('0x1b')](_0xcd9c('0x54'),_0x3ad0f2);throw _0x3ad0f2;});}return _0x19b5a6;})[_0xcd9c('0x15')](respondWithResult(_0x174f07,0xc9))[_0xcd9c('0x1e')](handleError(_0x174f07,null));};exports['update']=function(_0x3f2a77,_0x24df20){if(_0x3f2a77[_0xcd9c('0x55')]['id']){delete _0x3f2a77['body']['id'];}return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x3f2a77[_0xcd9c('0x4c')]['id']},'include':[{'model':db[_0xcd9c('0x30')],'as':'mandatoryDispositionPause'}]})[_0xcd9c('0x15')](handleEntityNotFound(_0x24df20,null))['then'](saveUpdates(_0x3f2a77[_0xcd9c('0x55')],null))[_0xcd9c('0x15')](respondWithResult(_0x24df20,null))[_0xcd9c('0x1e')](handleError(_0x24df20,null));};exports[_0xcd9c('0x2c')]=function(_0xb46d32,_0x62a914){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0xb46d32['params']['id']}})['then'](handleEntityNotFound(_0x62a914,null))['then'](removeEntity(_0x62a914,null))['catch'](handleError(_0x62a914,null));};exports['describe']=function(_0x2b42c6,_0x5b4bd3){return db[_0xcd9c('0x33')][_0xcd9c('0x57')]()[_0xcd9c('0x15')](respondWithResult(_0x5b4bd3,null))[_0xcd9c('0x1e')](handleError(_0x5b4bd3,null));};exports[_0xcd9c('0x58')]=function(_0x11103d,_0x1fdd5a){if(_0x11103d[_0xcd9c('0x55')]['id']){delete _0x11103d[_0xcd9c('0x55')]['id'];}return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x11103d[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x1fdd5a,null))[_0xcd9c('0x15')](function(_0x2e0f77){if(_0x2e0f77){_0x11103d[_0xcd9c('0x55')]['ChatWebsiteId']=_0x2e0f77['id'];return db[_0xcd9c('0x59')]['create'](_0x11103d[_0xcd9c('0x55')]);}})[_0xcd9c('0x15')](respondWithResult(_0x1fdd5a,null))[_0xcd9c('0x1e')](handleError(_0x1fdd5a,null));};exports[_0xcd9c('0x5a')]=function(_0x3a16fc,_0x1308b4){var _0x2fd7a6={'raw':![],'where':{}};var _0x13df84={};var _0x47e4dc={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xcd9c('0x5b')]({'where':{'id':_0x3a16fc[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x1308b4,null))['then'](function(_0x4610bc){if(_0x4610bc){_0x13df84[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0x59')]['rawAttributes']);_0x13df84[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x3a16fc[_0xcd9c('0x38')]);_0x13df84[_0xcd9c('0x41')]=_['intersection'](_0x13df84[_0xcd9c('0x36')],_0x13df84[_0xcd9c('0x38')]);_0x2fd7a6[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x13df84[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x3a16fc[_0xcd9c('0x38')][_0xcd9c('0x3b')]));_0x2fd7a6[_0xcd9c('0x3a')]=_0x2fd7a6[_0xcd9c('0x3a')]['length']?_0x2fd7a6[_0xcd9c('0x3a')]:_0x13df84[_0xcd9c('0x36')];if(!_0x3a16fc[_0xcd9c('0x38')][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x2fd7a6[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x3a16fc[_0xcd9c('0x38')]['limit']);_0x2fd7a6[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x3a16fc[_0xcd9c('0x38')][_0xcd9c('0x23')]);}_0x2fd7a6['order']=qs[_0xcd9c('0x3f')](_0x3a16fc[_0xcd9c('0x38')][_0xcd9c('0x3f')]);_0x2fd7a6[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_['pick'](_0x3a16fc[_0xcd9c('0x38')],_0x13df84[_0xcd9c('0x41')]));_0x2fd7a6[_0xcd9c('0x40')][_0xcd9c('0x5c')]=_0x4610bc['id'];if(_0x3a16fc['query'][_0xcd9c('0x43')]){_0x2fd7a6[_0xcd9c('0x40')]=_['merge'](_0x2fd7a6[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x2fd7a6['attributes'],function(_0x5c85b5){var _0x59bb5a={};_0x59bb5a[_0x5c85b5]={'$like':'%'+_0x3a16fc[_0xcd9c('0x38')]['filter']+'%'};return _0x59bb5a;})});}_0x2fd7a6=_[_0xcd9c('0x44')]({},_0x2fd7a6,_0x3a16fc[_0xcd9c('0x47')]);return db[_0xcd9c('0x59')][_0xcd9c('0x26')]({'where':_0x2fd7a6[_0xcd9c('0x40')]})['then'](function(_0x50ae42){_0x47e4dc[_0xcd9c('0x26')]=_0x50ae42;if(_0x3a16fc[_0xcd9c('0x38')]['includeAll']){_0x2fd7a6[_0xcd9c('0x49')]=[{'all':!![]}];}return db['Disposition'][_0xcd9c('0x5d')](_0x2fd7a6);})[_0xcd9c('0x15')](function(_0x2dd973){_0x47e4dc[_0xcd9c('0x4a')]=_0x2dd973;return _0x47e4dc;});}})[_0xcd9c('0x15')](respondWithFilteredResult(_0x1308b4,_0x2fd7a6))['catch'](handleError(_0x1308b4,null));};exports['removeDispositions']=function(_0x3e99b1,_0x39ff89){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x3e99b1[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x39ff89,null))[_0xcd9c('0x15')](function(_0x4babbb){if(_0x4babbb){return _0x4babbb[_0xcd9c('0x5e')](_0x3e99b1[_0xcd9c('0x38')][_0xcd9c('0x5f')]);}})[_0xcd9c('0x15')](respondWithStatusCode(_0x39ff89,null))[_0xcd9c('0x1e')](handleError(_0x39ff89,null));};exports[_0xcd9c('0x60')]=function(_0x26028b,_0x12b632){if(_0x26028b['body']['id']){delete _0x26028b['body']['id'];}return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x26028b[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x12b632,null))['then'](function(_0x525a45){if(_0x525a45){_0x26028b['body'][_0xcd9c('0x5c')]=_0x525a45['id'];return db[_0xcd9c('0x61')][_0xcd9c('0x4e')](_0x26028b[_0xcd9c('0x55')]);}})[_0xcd9c('0x15')](respondWithResult(_0x12b632,null))[_0xcd9c('0x1e')](handleError(_0x12b632,null));};exports['getAnswers']=function(_0x59c642,_0x4f44ad){var _0x436eef={'raw':![],'where':{}};var _0x27a6b1={};var _0x2dc01c={'count':0x0,'rows':[]};return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x59c642[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x4f44ad,null))[_0xcd9c('0x15')](function(_0x2f51a4){if(_0x2f51a4){_0x27a6b1[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0x61')][_0xcd9c('0x34')]);_0x27a6b1[_0xcd9c('0x38')]=_['keys'](_0x59c642['query']);_0x27a6b1[_0xcd9c('0x41')]=_['intersection'](_0x27a6b1['model'],_0x27a6b1[_0xcd9c('0x38')]);_0x436eef[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x27a6b1[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x3b')]));_0x436eef[_0xcd9c('0x3a')]=_0x436eef[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0x436eef[_0xcd9c('0x3a')]:_0x27a6b1[_0xcd9c('0x36')];if(!_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x436eef[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x436eef[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x23')]);}_0x436eef[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x59c642['query'][_0xcd9c('0x3f')]);_0x436eef[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x59c642[_0xcd9c('0x38')],_0x27a6b1[_0xcd9c('0x41')]));_0x436eef[_0xcd9c('0x40')]['ChatWebsiteId']=_0x2f51a4['id'];if(_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x43')]){_0x436eef[_0xcd9c('0x40')]=_[_0xcd9c('0x44')](_0x436eef['where'],{'$or':_['map'](_0x436eef[_0xcd9c('0x3a')],function(_0x2f49cf){var _0x5d04b2={};_0x5d04b2[_0x2f49cf]={'$like':'%'+_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x5d04b2;})});}_0x436eef=_[_0xcd9c('0x44')]({},_0x436eef,_0x59c642[_0xcd9c('0x47')]);return db[_0xcd9c('0x61')][_0xcd9c('0x26')]({'where':_0x436eef[_0xcd9c('0x40')]})[_0xcd9c('0x15')](function(_0x447b82){_0x2dc01c[_0xcd9c('0x26')]=_0x447b82;if(_0x59c642[_0xcd9c('0x38')][_0xcd9c('0x48')]){_0x436eef[_0xcd9c('0x49')]=[{'all':!![]}];}return db[_0xcd9c('0x61')][_0xcd9c('0x5d')](_0x436eef);})[_0xcd9c('0x15')](function(_0x2031ff){_0x2dc01c['rows']=_0x2031ff;return _0x2dc01c;});}})['then'](respondWithFilteredResult(_0x4f44ad,_0x436eef))['catch'](handleError(_0x4f44ad,null));};exports[_0xcd9c('0x62')]=function(_0x1c8802,_0x4acefc){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x1c8802[_0xcd9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4acefc,null))['then'](function(_0x51e038){if(_0x51e038){return _0x51e038[_0xcd9c('0x62')](_0x1c8802[_0xcd9c('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x4acefc,null))['catch'](handleError(_0x4acefc,null));};exports[_0xcd9c('0x63')]=function(_0x2852d6,_0x25bf3c){_0x2852d6[_0xcd9c('0x55')]['sitepic']=_0x2852d6[_0xcd9c('0x64')][_0xcd9c('0x65')];return db['ChatWebsite']['find']({'where':{'id':_0x2852d6[_0xcd9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x25bf3c,null))['then'](saveUpdates(_0x2852d6[_0xcd9c('0x55')],null))[_0xcd9c('0x15')](respondWithResult(_0x25bf3c,null))[_0xcd9c('0x1e')](handleError(_0x25bf3c,null));};exports[_0xcd9c('0x66')]=function(_0x403c73,_0x152283){_0x403c73['body'][_0xcd9c('0x67')]=_0x403c73[_0xcd9c('0x64')]['filename'];return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x403c73['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x152283,null))[_0xcd9c('0x15')](saveUpdates(_0x403c73[_0xcd9c('0x55')],null))['then'](respondWithResult(_0x152283,null))[_0xcd9c('0x1e')](handleError(_0x152283,null));};exports[_0xcd9c('0x68')]=function(_0x21388d,_0x5df1ff){_0x21388d[_0xcd9c('0x55')]['customerAvatar']=_0x21388d[_0xcd9c('0x64')][_0xcd9c('0x65')];return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x21388d['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x5df1ff,null))['then'](saveUpdates(_0x21388d[_0xcd9c('0x55')],null))[_0xcd9c('0x15')](respondWithResult(_0x5df1ff,null))[_0xcd9c('0x1e')](handleError(_0x5df1ff,null));};exports['addSystemAvatar']=function(_0x2f47d5,_0x3279a3){_0x2f47d5[_0xcd9c('0x55')][_0xcd9c('0x69')]=_0x2f47d5[_0xcd9c('0x64')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x2f47d5[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x3279a3,null))[_0xcd9c('0x15')](saveUpdates(_0x2f47d5['body'],null))[_0xcd9c('0x15')](respondWithResult(_0x3279a3,null))['catch'](handleError(_0x3279a3,null));};exports['getLogo']=function(_0xa9137f,_0x1b0c52){var _0x52da76=path['join'](config[_0xcd9c('0x6a')],'server/files/images/logos/default_logo.svg');var _0x44e1df={'where':{'id':_0xa9137f[_0xcd9c('0x4c')]['id']},'attributes':['id',_0xcd9c('0x6b')],'raw':!![]};var _0x5cf774=![];return require(_0xcd9c('0x6c'))['getLicense']()[_0xcd9c('0x15')](function(_0x2eb0aa){if(_0x2eb0aa){_0x5cf774=_0x2eb0aa[_0xcd9c('0x6d')];}})['then'](function(){return db['ChatWebsite'][_0xcd9c('0x56')](_0x44e1df);})[_0xcd9c('0x15')](handleEntityNotFound(_0x1b0c52,null))['then'](function(_0x4bb72b){if(_0x4bb72b){if(!_['isNil'](_0x4bb72b[_0xcd9c('0x6b')])){if(fs[_0xcd9c('0x6e')](path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x70'),_0x4bb72b['sitepic']))&&_0x5cf774){_0x52da76=path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x70'),_0x4bb72b[_0xcd9c('0x6b')]);}}return _0x1b0c52[_0xcd9c('0x71')](_0x52da76);}})[_0xcd9c('0x1e')](handleError(_0x1b0c52,null));};exports[_0xcd9c('0x72')]=function(_0x259c56,_0x1cb905){var _0x30064e=path['join'](config[_0xcd9c('0x6a')],_0xcd9c('0x73'));var _0x76801b={'where':{'id':_0x259c56[_0xcd9c('0x4c')]['id']},'attributes':['id',_0xcd9c('0x67')],'raw':!![]};return db[_0xcd9c('0x33')][_0xcd9c('0x56')](_0x76801b)[_0xcd9c('0x15')](handleEntityNotFound(_0x1cb905,null))[_0xcd9c('0x15')](function(_0x24e307){if(_0x24e307){if(!_[_0xcd9c('0x74')](_0x24e307['agentAvatar'])){if(fs[_0xcd9c('0x6e')](path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x75'),_0x24e307[_0xcd9c('0x67')]))){_0x30064e=path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x75'),_0x24e307['agentAvatar']);}}return _0x1cb905[_0xcd9c('0x71')](_0x30064e);}})[_0xcd9c('0x1e')](handleError(_0x1cb905,null));};exports[_0xcd9c('0x76')]=function(_0x36a7e3,_0x3e6659){var _0x3ddc46=path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x77'));var _0x115ee0={'where':{'id':_0x36a7e3[_0xcd9c('0x4c')]['id']},'attributes':['id',_0xcd9c('0x78'),_0xcd9c('0x79')],'raw':!![]};return db['ChatWebsite'][_0xcd9c('0x56')](_0x115ee0)[_0xcd9c('0x15')](handleEntityNotFound(_0x3e6659,null))[_0xcd9c('0x15')](function(_0x18aabf){if(_0x18aabf){if(!_[_0xcd9c('0x74')](_0x18aabf[_0xcd9c('0x78')])){if(fs[_0xcd9c('0x6e')](path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x75'),_0x18aabf[_0xcd9c('0x78')]))&&_0x18aabf[_0xcd9c('0x79')]){_0x3ddc46=path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x75'),_0x18aabf['customerAvatar']);}}return _0x3e6659[_0xcd9c('0x71')](_0x3ddc46);}})['catch'](handleError(_0x3e6659,null));};exports[_0xcd9c('0x7a')]=function(_0x126cd5,_0x53b44c){var _0x22bf31=path['join'](config[_0xcd9c('0x6a')],_0xcd9c('0x7b'));var _0x463f9e={'where':{'id':_0x126cd5[_0xcd9c('0x4c')]['id']},'attributes':['id',_0xcd9c('0x69')],'raw':!![]};return db[_0xcd9c('0x33')][_0xcd9c('0x56')](_0x463f9e)[_0xcd9c('0x15')](handleEntityNotFound(_0x53b44c,null))[_0xcd9c('0x15')](function(_0x350b0d){if(_0x350b0d){if(!_[_0xcd9c('0x74')](_0x350b0d[_0xcd9c('0x69')])){if(fs[_0xcd9c('0x6e')](path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0x75'),_0x350b0d['systemAvatar']))){_0x22bf31=path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x75'),_0x350b0d[_0xcd9c('0x69')]);}}return _0x53b44c[_0xcd9c('0x71')](_0x22bf31);}})[_0xcd9c('0x1e')](handleError(_0x53b44c,null));};exports[_0xcd9c('0x7c')]=function(_0x4a5eab,_0x46b140){var _0x5c3b65=require('user-agent-parser');var _0x490acf=new _0x5c3b65();var _0x3d5f46=_0x490acf['setUA'](_0x4a5eab[_0xcd9c('0x7d')][_0xcd9c('0x7e')])[_0xcd9c('0x7f')]();var _0x3a12f7={'body':_0x4a5eab[_0xcd9c('0x55')],'channel':_0xcd9c('0x80')};var _0x1c958c=[];var _0x196837=[];var _0x55dd0b={};var _0x11081a=![];return db[_0xcd9c('0x81')]['describe']()[_0xcd9c('0x15')](function(_0x301e44){if(!_0x301e44){throw new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))]('no\x20available\x20attributes');}_0x1c958c=_[_0xcd9c('0x84')](_[_0xcd9c('0x37')](_0x301e44),['createdAt',_0xcd9c('0x85')]);_0x196837=_[_0xcd9c('0x84')](_['keys'](_0x301e44),['createdAt',_0xcd9c('0x85'),_0xcd9c('0x86'),_0xcd9c('0x87')]);if(_0x4a5eab[_0xcd9c('0x55')]['id']){delete _0x4a5eab[_0xcd9c('0x55')]['id'];}if(_[_0xcd9c('0x74')](_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x88')])){throw new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))]('from\x20is\x20mandatory');}if(_[_0xcd9c('0x74')](_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x55')])||_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x55')]===''){throw new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))](_0xcd9c('0x89'));}if(_[_0xcd9c('0x74')](_0x4a5eab['body'][_0xcd9c('0x8a')])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x196837);}if(!_[_0xcd9c('0x8b')](_0x196837,_0x4a5eab['body'][_0xcd9c('0x8a')])){throw new db['Sequelize'][(_0xcd9c('0x83'))](_0xcd9c('0x8c')+_0x196837);}_0x55dd0b[_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x8a')]]=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x88')];})[_0xcd9c('0x15')](function(){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x4a5eab[_0xcd9c('0x4c')]['id']},'include':[{'model':db[_0xcd9c('0x8d')],'as':_0xcd9c('0x8e'),'include':[{'model':db[_0xcd9c('0x81')],'as':_0xcd9c('0x8f'),'where':_0x55dd0b,'limit':0x1,'order':[['updatedAt',_0xcd9c('0x90')]]}]},{'model':db[_0xcd9c('0x91')],'as':_0xcd9c('0x92')}]});})[_0xcd9c('0x15')](handleEntityNotFound(_0x46b140,null))[_0xcd9c('0x15')](function(_0x1958f4){if(_0x1958f4&&_0x1958f4[_0xcd9c('0x8e')]){_0x3a12f7[_0xcd9c('0x93')]=_0x1958f4;_0x3a12f7['applications']=_0x1958f4[_0xcd9c('0x92')];_0x3a12f7[_0xcd9c('0x94')]=_0x1958f4[_0xcd9c('0x8e')];_0x3a12f7[_0xcd9c('0x95')]=_[_0xcd9c('0x96')](_0x3a12f7['applications'],['priority'],[_0xcd9c('0x97')]);if(_0x3a12f7['account']['Applications']){delete _0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0x92')];}if(_0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0x8e')]&&_0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0x8e')][_0xcd9c('0x8f')][_0xcd9c('0x4d')]){return _0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0x8e')][_0xcd9c('0x8f')][0x0];}var _0x25cfcd=_['defaults'](_0x4a5eab[_0xcd9c('0x55')],{'firstName':_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x88')],'ListId':_0x1958f4[_0xcd9c('0x87')]});_0x25cfcd[_0x4a5eab[_0xcd9c('0x55')]['mapKey']]=_0x4a5eab[_0xcd9c('0x55')]['from'];return db[_0xcd9c('0x81')][_0xcd9c('0x4e')](_0x25cfcd,{'fields':_0x1c958c,'raw':!![]});}})['then'](handleEntityNotFound(_0x46b140,null))[_0xcd9c('0x15')](function(_0x32548a){_0x3a12f7[_0xcd9c('0x98')]=_0x32548a;var _0x59723e=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x99')];if(_0x4a5eab[_0xcd9c('0x7d')]['cf-connecting-ip']){_0x59723e=_0x4a5eab[_0xcd9c('0x7d')]['cf-connecting-ip'];}else if(_0x4a5eab[_0xcd9c('0x7d')][_0xcd9c('0x9a')]){_0x59723e=_[_0xcd9c('0x9b')](_0x4a5eab[_0xcd9c('0x7d')][_0xcd9c('0x9a')]['split'](','));}if(_0x32548a){var _0x12aa50={'ContactId':_0x32548a['id'],'ChatWebsiteId':_0x4a5eab[_0xcd9c('0x4c')]['id'],'from':(_0x32548a[_0xcd9c('0x9c')]||'')+'\x20'+(_0x32548a[_0xcd9c('0x9d')]||''),'customerIp':_0x59723e,'customerPort':_0x4a5eab[_0xcd9c('0x7d')][_0xcd9c('0x9e')]?_0x4a5eab[_0xcd9c('0x7d')]['x-real-port']:null,'referer':_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0x9f')],'browserName':_0x3d5f46['browser'][_0xcd9c('0x2e')]&&_0x3d5f46[_0xcd9c('0xa0')][_0xcd9c('0xa1')]?util[_0xcd9c('0xa2')](_0xcd9c('0xa3'),_0x3d5f46[_0xcd9c('0xa0')][_0xcd9c('0x2e')],_0x3d5f46[_0xcd9c('0xa0')][_0xcd9c('0xa1')]):'unknown','browserVersion':_0x3d5f46[_0xcd9c('0xa0')][_0xcd9c('0xa1')]||_0xcd9c('0xa4'),'osName':util[_0xcd9c('0xa2')](_0xcd9c('0xa3'),_0x3d5f46['os'][_0xcd9c('0x2e')],_0x3d5f46['os'][_0xcd9c('0xa1')]),'osVersion':_0x3d5f46['os'][_0xcd9c('0xa1')],'deviceModel':_0x3d5f46[_0xcd9c('0xa5')]['model']&&_0x3d5f46['device'][_0xcd9c('0xa6')]?util[_0xcd9c('0xa2')](_0xcd9c('0xa7'),_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0x36')],_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0xa6')],_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0x45')]):null,'deviceVendor':_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0xa6')],'deviceType':_0x3d5f46[_0xcd9c('0xa5')][_0xcd9c('0x45')],'formData':JSON['stringify'](_0x4a5eab[_0xcd9c('0x55')])};var _0x217881={'ChatWebsiteId':_0x4a5eab[_0xcd9c('0x4c')]['id'],'closed':![]};if(_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xa8')]){_0x217881['threadId']=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xa8')];return db[_0xcd9c('0xa9')]['find']({'where':_0x217881})['then'](function(_0x2eb92b){if(_0x2eb92b){return[_0x2eb92b,![]];}_0x12aa50[_0xcd9c('0xa8')]=_0x4a5eab[_0xcd9c('0x55')]['threadId'];_0x12aa50[_0xcd9c('0xaa')]=_0x4a5eab['body']['externalUrl'];return db['ChatInteraction'][_0xcd9c('0x4e')](_0x12aa50)['then'](function(_0x1be6af){return[_0x1be6af,!![]];});});}_0x217881[_0xcd9c('0xab')]=_0x32548a['id'];if(_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xac')]&&_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xac')]['id']){_0x217881['id']=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xac')]['id'];return db[_0xcd9c('0xa9')]['find']({'where':_0x217881})[_0xcd9c('0x15')](function(_0x3b67cb){if(_0x3b67cb){return[_0x3b67cb,![]];}return db[_0xcd9c('0xa9')][_0xcd9c('0x4e')](_0x12aa50)[_0xcd9c('0x15')](function(_0x13fe26){return[_0x13fe26,!![]];});});}return db[_0xcd9c('0xa9')][_0xcd9c('0x4e')](_0x12aa50)['then'](function(_0x3f23e7){return[_0x3f23e7,!![]];});}})[_0xcd9c('0xad')](function(_0x12fbca,_0x184cfe){if(_0x12fbca){_0x11081a=_0x184cfe;if(!_0x184cfe){var _0x19f6b2={'from':(_0x3a12f7[_0xcd9c('0x98')][_0xcd9c('0x9c')]||'')+'\x20'+(_0x3a12f7['contact']['lastName']||'')};if(_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xa8')]&&_0x4a5eab[_0xcd9c('0x55')]['messageId']&&_0x4a5eab['body']['threadId']!=_0x4a5eab['body'][_0xcd9c('0xae')]){_0x19f6b2['threadId']=_0x4a5eab[_0xcd9c('0x55')][_0xcd9c('0xae')];}return _0x12fbca[_0xcd9c('0xaf')](_0x19f6b2);}else{return _0x12fbca;}}})[_0xcd9c('0x15')](function(_0x42301f){_0x3a12f7[_0xcd9c('0xac')]=_0x42301f[_0xcd9c('0x29')]({'plain':!![]});_0x3a12f7[_0xcd9c('0xac')][_0xcd9c('0xb0')]=_0x11081a;if(_0x3a12f7[_0xcd9c('0xac')][_0xcd9c('0xb0')]){if(_0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0xb1')]){_0x3a12f7[_0xcd9c('0x95')][_0xcd9c('0xb2')]({'id':0x0,'priority':_0x3a12f7['applications']['length']+0x1,'app':_0xcd9c('0xb3'),'appdata':_0xcd9c('0xb4'),'interval':_0xcd9c('0xb5')});}}return db['ChatMessage'][_0xcd9c('0x4e')]({'body':_0x4a5eab[_0xcd9c('0x55')]['body'],'ChatWebsiteId':_0x4a5eab['params']['id'],'ChatInteractionId':_0x42301f['id'],'direction':'in','ContactId':_0x3a12f7['contact']['id'],'AttachmentId':_0x4a5eab[_0xcd9c('0x55')]['AttachmentId']});})[_0xcd9c('0x15')](function(_0x17c436){_0x3a12f7['message']=_0x17c436;if(_0x3a12f7['interaction']['UserId']){return db['User'][_0xcd9c('0x56')]({'attributes':['id',_0xcd9c('0x2e')],'where':{'id':_0x3a12f7[_0xcd9c('0xac')][_0xcd9c('0xb6')]}})['then'](function(_0x4fe0c1){if(_0x4fe0c1){_0x3a12f7[_0xcd9c('0x95')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4fe0c1[_0xcd9c('0x2e')]+','+(_0x3a12f7[_0xcd9c('0x93')][_0xcd9c('0xb7')]||0xa),'interval':_0xcd9c('0xb5')});_0x3a12f7[_0xcd9c('0xb8')]=!![];}return respondWithRpcPromise(_0xcd9c('0xb9'),_0xcd9c('0xba'),_0x3a12f7);});}return respondWithRpcPromise(_0xcd9c('0xb9'),_0xcd9c('0xba'),_0x3a12f7);})['then'](function(_0x383e33){respondWithRpcPromise(_0xcd9c('0xbb'),_0xcd9c('0xbb'),{'event':_0xcd9c('0x7c'),'message':_0x383e33},client9002);return _0x383e33;})[_0xcd9c('0x15')](respondWithResult(_0x46b140,null))[_0xcd9c('0x1e')](handleError(_0x46b140,null));};exports[_0xcd9c('0xbc')]=function(_0x1f9b1e,_0x124240){var _0x34c10e,_0x266f0e,_0x294735;var _0x1ea727=[];var _0x5b6382={};var _0x4fb6ef=_0x1f9b1e[_0xcd9c('0xbd')]||[];var _0x470a0c=[];var _0x659b54;return db[_0xcd9c('0x81')][_0xcd9c('0x57')]()[_0xcd9c('0x15')](function(_0x161601){if(!_0x161601){throw new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))](_0xcd9c('0xbe'));}_0x1ea727=_[_0xcd9c('0x84')](_[_0xcd9c('0x37')](_0x161601),['createdAt',_0xcd9c('0x85'),_0xcd9c('0x86'),_0xcd9c('0x87')]);if(_0x1f9b1e[_0xcd9c('0x55')]['id']){delete _0x1f9b1e[_0xcd9c('0x55')]['id'];}if(_[_0xcd9c('0x74')](_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x88')])){throw _0x124240['status'](0x1f4)[_0xcd9c('0xbf')](new db['Sequelize']['ValidationError']('from\x20is\x20mandatory'));}if(_[_0xcd9c('0x74')](_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x55')])||_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x55')]===''){throw _0x124240[_0xcd9c('0x20')](0x1f4)[_0xcd9c('0xbf')](new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))](_0xcd9c('0x89')));}if(_[_0xcd9c('0x74')](_0x1f9b1e['body'][_0xcd9c('0xc0')])){throw _0x124240['status'](0x1f4)[_0xcd9c('0xbf')](new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))](_0xcd9c('0xc1')+_0x1ea727));}if(!_[_0xcd9c('0x8b')](_0x1ea727,_0x1f9b1e['body']['mapKeyOffline'])){throw _0x124240[_0xcd9c('0x20')](0x1f4)['send'](new db[(_0xcd9c('0x82'))][(_0xcd9c('0x83'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ea727));}_0x5b6382[_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0xc0')]]=_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x88')];})[_0xcd9c('0x15')](function(){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x1f9b1e[_0xcd9c('0x4c')]['id']},'include':[{'model':db[_0xcd9c('0x8d')],'as':_0xcd9c('0x8e')},{'model':db[_0xcd9c('0xc2')],'as':'MailAccount'}]});})[_0xcd9c('0x15')](handleEntityNotFound(_0x124240,null))[_0xcd9c('0x15')](function(_0x382c9c){if(_0x382c9c&&_0x382c9c['List']){_0x266f0e=_0x382c9c;var _0x505f83=_[_0xcd9c('0xc3')](_0x1f9b1e[_0xcd9c('0x55')],{'firstName':_0x1f9b1e[_0xcd9c('0x55')]['from'],'phone':_0x1f9b1e['body']['from'],'ListId':_0x382c9c[_0xcd9c('0x87')]});_0x505f83[_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0xc0')]]=_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x88')];return db[_0xcd9c('0x81')][_0xcd9c('0xc4')]({'where':_0x5b6382,'defaults':_0x505f83});}})[_0xcd9c('0xad')](function(_0x205afb){if(_0x205afb){_0x294735=_0x205afb;var _0x274e12=fs[_0xcd9c('0xc5')](path['join'](config[_0xcd9c('0x6a')],_0xcd9c('0xc6')),_0xcd9c('0xc7'));var _0x5f4127=ejs[_0xcd9c('0xc8')](_0x274e12,{'body':_[_0xcd9c('0xc9')](_0x1f9b1e[_0xcd9c('0x55')][_0xcd9c('0x55')]),'bodyTitle':_0x266f0e['offlineMessageBody']});return db[_0xcd9c('0xca')]['create']({'body':_0x5f4127,'ContactId':_0x205afb['id'],'ChatWebsiteId':_0x266f0e['id']});}})['then'](function(_0x3c2d1a){_0x659b54=_0x3c2d1a;if(_0x4fb6ef['length']){var _0x4ae774=_0x4fb6ef[_0xcd9c('0x32')](function(_0x587b48){return{'name':_0x587b48[_0xcd9c('0xcb')],'basename':_0x587b48['filename'],'type':_0x587b48['mimetype'],'ChatOfflineMessageId':_0x3c2d1a['id']};});_0x470a0c=_0x4ae774['map'](_0x5434ab=>{var _0x18f6a9={'filename':_0x5434ab[_0xcd9c('0x2e')],'path':path[_0xcd9c('0x6f')](config[_0xcd9c('0x6a')],_0xcd9c('0xcc'),_0xcd9c('0xbd'),_0xcd9c('0xcd'),_0xcd9c('0xce'),_0x5434ab[_0xcd9c('0xcf')])};return _0x18f6a9;});if(!_0x266f0e[_0xcd9c('0xd0')]){return db[_0xcd9c('0xd1')][_0xcd9c('0xd2')](function(_0x2ce876){return db[_0xcd9c('0xd3')][_0xcd9c('0xd4')](_0x4ae774,{'transaction':_0x2ce876});});}}})[_0xcd9c('0x15')](function(){if(_0x659b54){_0x34c10e=_0x659b54;return db['MailAccount'][_0xcd9c('0x5b')]({'where':{'active':!![]},'include':[{'model':db[_0xcd9c('0xd5')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x76fdbc){if(_0x76fdbc&&_0x76fdbc[_0xcd9c('0xd6')]&&_0x266f0e[_0xcd9c('0xd7')]&&_0x266f0e['forwardOfflineAddress']){var _0xfed480={'tls':{'rejectUnauthorized':![]}};if(_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xd8')]){_0xfed480[_0xcd9c('0xd8')]=_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xd8')];}else{_0xfed480[_0xcd9c('0xd9')]=_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xd9')];_0xfed480[_0xcd9c('0xda')]=_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xda')];_0xfed480[_0xcd9c('0xdb')]=_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xdb')];}if(_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xdc')]){_0xfed480[_0xcd9c('0xdd')]={'user':_0x76fdbc['Smtp'][_0xcd9c('0x4f')],'pass':_0x76fdbc[_0xcd9c('0xd6')][_0xcd9c('0xde')]};}return respondWithRpcPromise(_0xcd9c('0xdf'),_0xcd9c('0xe0'),{'account':_0xfed480,'message':{'from':util[_0xcd9c('0xa2')](_0xcd9c('0xe1'),_0x76fdbc[_0xcd9c('0x2e')],_0x76fdbc[_0xcd9c('0xe2')]||_0x76fdbc['Smtp']['user']),'to':_0x266f0e['forwardOfflineAddress'],'subject':_0x266f0e['offlineMessageSubject'],'html':_0x34c10e[_0xcd9c('0x55')],'attachments':_0x470a0c}},client9003)[_0xcd9c('0x15')](function(){return _0x34c10e;})[_0xcd9c('0x1e')](function(_0xb69db5){console[_0xcd9c('0x1b')](_0xb69db5);});}})[_0xcd9c('0x15')](function(){if(_0x266f0e&&_0x266f0e['openNewInteraction']&&_0x266f0e['MailAccountId']){var _0x2a7dd1=[];if(_0x4fb6ef[_0xcd9c('0x4d')]){_0x2a7dd1=_0x4fb6ef[_0xcd9c('0x32')](function(_0x3e18d7){return{'name':_0x3e18d7[_0xcd9c('0xcb')],'basename':_0x3e18d7['filename'],'type':_0x3e18d7[_0xcd9c('0xe3')],'ChatOfflineMessageId':_0x659b54['id']};});}var _0x2c5982;if(!_[_0xcd9c('0x74')](_0x266f0e[_0xcd9c('0xe4')])){var _0x3f6140=_['map'](_0x1f9b1e[_0xcd9c('0x55')],function(_0x365fee){return _0x365fee;});var _0x3f8590=_[_0xcd9c('0xe5')](_0x3f6140)[0x0];var _0x84dfc9=_[_0xcd9c('0xe6')](_0x3f8590,function(_0x1ed0d1){return _0x1ed0d1;});_0x2c5982=_0x84dfc9[0x1][_0x266f0e[_0xcd9c('0xe4')]];}var _0x160a5f={'from':_0x294735['email'],'firstName':_0x294735[_0xcd9c('0x9c')],'lastName':_0x294735[_0xcd9c('0x9d')],'mapKey':_0xcd9c('0xe2'),'message':{'from':_0x294735['email'],'to':_0x266f0e['MailAccount'][_0xcd9c('0xe2')],'cc':'','subject':_[_0xcd9c('0x74')](_0x2c5982)?_0x266f0e[_0xcd9c('0xe7')]:_0x2c5982,'messageId':'','sentAt':new Date(),'attach':_0x2a7dd1[_0xcd9c('0x4d')],'attachments':_0x2a7dd1,'originChannel':'Chat','ChatWebsiteId':_0x266f0e['id'],'ChatOfflineMessageId':_0x34c10e['id'],'originTo':_0x266f0e['MailAccount']['email']},'body':_0x34c10e[_0xcd9c('0x55')]};var _0x1032cc={'account':{'id':_0x266f0e[_0xcd9c('0xe8')]},'body':_0x160a5f,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xcd9c('0xe9'),_0xcd9c('0xea'),_0x1032cc,client9001)[_0xcd9c('0x15')](function(){return _0x34c10e;})['catch'](function(_0x3bbc76){console['error'](_0x3bbc76);});}return;})[_0xcd9c('0x15')](function(){if(_0x34c10e){return _0x34c10e;}})[_0xcd9c('0x15')](respondWithResult(_0x124240,null))[_0xcd9c('0x1e')](function(_0x247304){console[_0xcd9c('0x1b')](_0xcd9c('0x1e'),_0x247304);for(var _0x4e74fd of _0x4fb6ef){var _0x1ed10f=path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0xcc'),'files',_0xcd9c('0xcd'),_0xcd9c('0xce'),_0x4e74fd['filename']);fs_extra[_0xcd9c('0xeb')](_0x1ed10f)[_0xcd9c('0x1e')](function(_0x3e4ab7){console[_0xcd9c('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x1ed10f,_0x3e4ab7);});}});};exports[_0xcd9c('0xec')]=function(_0x1f262e,_0x5771f7){return db['ChatInteraction'][_0xcd9c('0x56')]({'where':{'id':_0x1f262e[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x5771f7,null))[_0xcd9c('0x15')](function(_0x37a492){if(_0x37a492){return _0x37a492[_0xcd9c('0xec')](_0x1f262e[_0xcd9c('0x55')]['ids'],_[_0xcd9c('0xed')](_0x1f262e['body'],['ids','id'])||{});}})[_0xcd9c('0x15')](respondWithResult(_0x5771f7,null))[_0xcd9c('0x1e')](handleError(_0x5771f7,null));};exports[_0xcd9c('0xee')]=function(_0x25e5b9,_0x5d1d0c){var _0x550fd3={'raw':![],'where':{}};var _0x10af07={};var _0x1f5bf2={'count':0x0,'rows':[]};return db[_0xcd9c('0x33')]['findOne']({'where':{'id':_0x25e5b9['params']['id']}})['then'](handleEntityNotFound(_0x5d1d0c,null))[_0xcd9c('0x15')](function(_0x15c977){if(_0x15c977){_0x10af07[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db['ChatInteraction'][_0xcd9c('0x34')]);_0x10af07[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x25e5b9['query']);_0x10af07[_0xcd9c('0x41')]=_[_0xcd9c('0x39')](_0x10af07['model'],_0x10af07['query']);_0x550fd3[_0xcd9c('0x3a')]=_['intersection'](_0x10af07[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x25e5b9['query']['fields']));_0x550fd3['attributes']=_0x550fd3[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0x550fd3[_0xcd9c('0x3a')]:_0x10af07[_0xcd9c('0x36')];if(!_0x25e5b9['query'][_0xcd9c('0x3c')]('nolimit')){_0x550fd3['limit']=qs['limit'](_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x550fd3[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x25e5b9['query'][_0xcd9c('0x23')]);}_0x550fd3[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0x3f')]);_0x550fd3['where']=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x25e5b9[_0xcd9c('0x38')],_0x10af07['filters']));_0x550fd3[_0xcd9c('0x40')][_0xcd9c('0x5c')]=_0x15c977['id'];if(_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0x43')]){_0x550fd3[_0xcd9c('0x40')]=_['merge'](_0x550fd3[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x550fd3['attributes'],function(_0x51040d){var _0x268fb2={};_0x268fb2[_0x51040d]={'$like':'%'+_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x268fb2;})});}_0x550fd3=_[_0xcd9c('0x44')]({},_0x550fd3,_0x25e5b9[_0xcd9c('0x47')]);return db[_0xcd9c('0xa9')][_0xcd9c('0x26')]({'where':_0x550fd3[_0xcd9c('0x40')]})[_0xcd9c('0x15')](function(_0x45fc86){_0x1f5bf2[_0xcd9c('0x26')]=_0x45fc86;if(_0x25e5b9['query'][_0xcd9c('0x48')]){_0x550fd3['include']=[{'model':db[_0xcd9c('0x81')],'as':'Contact','required':![]},{'model':db[_0xcd9c('0xef')],'as':_0xcd9c('0xf0'),'attributes':[_0xcd9c('0x2e'),'fullname',_0xcd9c('0xf1')],'required':![]},{'model':db['Tag'],'as':_0xcd9c('0xf2'),'attributes':['id',_0xcd9c('0x2e'),_0xcd9c('0xf3')],'where':_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0xf4')]?{'id':_0x25e5b9[_0xcd9c('0x38')]['tag']}:undefined,'required':_0x25e5b9[_0xcd9c('0x38')][_0xcd9c('0xf4')]?!![]:![]}];}return db[_0xcd9c('0xa9')][_0xcd9c('0x5d')](_0x550fd3);})[_0xcd9c('0x15')](function(_0x59513c){_0x1f5bf2['rows']=_0x59513c;return _0x1f5bf2;});}})[_0xcd9c('0x15')](respondWithFilteredResult(_0x5d1d0c,_0x550fd3))[_0xcd9c('0x1e')](handleError(_0x5d1d0c,null));};function iftimePromise(_0x464770,_0x2fd730){return respondWithRpcPromise(_0xcd9c('0xf5'),'getSnippet',{'command':_0x2fd730['timezone']?util[_0xcd9c('0xa2')](_0xcd9c('0xf6'),_0x464770['interval'],_0x2fd730[_0xcd9c('0xf7')]):util[_0xcd9c('0xa2')](_0xcd9c('0xf8'),_0x464770[_0xcd9c('0xf9')])},client9002)[_0xcd9c('0x15')](function(_0x4ae860){var _0x4f3c27=_0x4ae860&&_0x4ae860[_0xcd9c('0xfa')]('true')>=0x0?!![]:![];logger[_0xcd9c('0x16')](_0xcd9c('0xfb'),_0x2fd730['id'],_0x464770['id'],_0x464770[_0xcd9c('0xf9')],_0x4f3c27?_0xcd9c('0xfc'):'OFFLINE',_0x2fd730[_0xcd9c('0xf7')]?_0x2fd730[_0xcd9c('0xf7')]:_0xcd9c('0xfd'));return _0x4f3c27;})['catch'](function(_0x29c79a){logger[_0xcd9c('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2fd730['id'],_0x464770['id'],_0x464770[_0xcd9c('0xf9')],util[_0xcd9c('0xfe')](_0x29c79a,{'showHidden':![],'depth':null}),_0x2fd730[_0xcd9c('0xf7')]?_0x2fd730[_0xcd9c('0xf7')]:_0xcd9c('0xfd'));return![];});}exports[_0xcd9c('0xff')]=function(_0x49cecc,_0x541cc3){var _0x4b12ad=0x0;var _0xebaa80=0x0;var _0x573cff=![];var _0x3bb141;var _0x2f19a5;return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x49cecc[_0xcd9c('0x4c')]['id']},'include':[{'model':db[_0xcd9c('0x100')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xcd9c('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xcd9c('0x15')](handleEntityNotFound(_0x541cc3,null))['then'](function(_0x5827e0){if(_0x5827e0){_0x3bb141=_0x5827e0;return _0x5827e0[_0xcd9c('0x102')]({'raw':!![]});}})[_0xcd9c('0x15')](function(_0x5a0132){if(_0x3bb141){if(_0x5a0132){_0x2f19a5=_0x5a0132;}}return require(_0xcd9c('0x6c'))['getLicense']();})['then'](function(_0x1367f2){if(_0x1367f2){_0xebaa80=_0x1367f2[_0xcd9c('0x103')];_0x573cff=_0x1367f2[_0xcd9c('0x6d')];}})[_0xcd9c('0x15')](function(){return db[_0xcd9c('0xa9')][_0xcd9c('0x26')]({'where':{'closed':![]}});})['then'](function(_0x40df52){_0x4b12ad=_0x40df52;if(_0xebaa80&&_0x40df52>_0xebaa80){return db['License'][_0xcd9c('0x5b')]({'where':{'id':0x1}})[_0xcd9c('0x15')](function(_0x52c0e5){if(_0x52c0e5){_0x52c0e5['increment'](_0xcd9c('0x104'));}});}})[_0xcd9c('0x15')](function(){if(_0x3bb141[_0xcd9c('0x100')]&&_0x3bb141[_0xcd9c('0x100')][_0xcd9c('0x101')]){var _0xe93b59=[];for(var _0x4fcfa4=0x0;_0x4fcfa4<_0x3bb141[_0xcd9c('0x100')][_0xcd9c('0x101')][_0xcd9c('0x4d')];_0x4fcfa4++){var _0x42bb7e=_0x3bb141[_0xcd9c('0x100')][_0xcd9c('0x101')][_0x4fcfa4]['get']({'plain':!![]});_0xe93b59[_0xcd9c('0xb2')](iftimePromise(_0x42bb7e,_0x3bb141));}return BPromise['all'](_0xe93b59)[_0xcd9c('0x15')](function(_0x2dc0d4){return _[_0xcd9c('0x105')](_0x2dc0d4);});}else{return!![];}})[_0xcd9c('0x15')](function(_0x3827fb){var _0x8b1dc6=fs[_0xcd9c('0xc5')](path[_0xcd9c('0x6f')](config['root'],_0xcd9c('0x106')),_0xcd9c('0xc7'));var _0x5c5ee6={'remote':_0x3bb141[_0xcd9c('0x107')],'query':querystring['stringify'](_[_0xcd9c('0x44')](_0x3bb141[_0xcd9c('0x29')]({'plain':!![]}),{'customerIp':_0x49cecc[_0xcd9c('0x7d')]['x-forwarded-for']||_0x49cecc['headers'][_0xcd9c('0x108')]||_0x49cecc[_0xcd9c('0x109')][_0xcd9c('0x10a')]||_0x49cecc['ip'],'referer':_0x49cecc['headers'][_0xcd9c('0x9f')],'openedInteractions':_0x4b12ad,'maxInteractions':_0xebaa80,'virtual':_0x573cff['virtual'],'online':_0x3827fb,'custom':_0x573cff}))[_0xcd9c('0x10b')](/'/g,'\x5c\x27')};_0x541cc3[_0xcd9c('0xbf')](ejs[_0xcd9c('0xc8')](Mustache[_0xcd9c('0xc8')](_0x8b1dc6,_0x5c5ee6),{'proactiveActions':_0x2f19a5,'alignment':_0x3bb141[_0xcd9c('0x10c')],'verticalAlignment':_0x3bb141[_0xcd9c('0x10d')],'div_color':_0x3bb141['color'],'labelText':_0x3bb141[_0xcd9c('0x10e')],'text_color':_0x3bb141[_0xcd9c('0x10f')],'button_color':_0x3bb141[_0xcd9c('0x110')],'background_color':_0x3bb141[_0xcd9c('0x111')]}));})[_0xcd9c('0x1e')](handleError(_0x541cc3,null));};exports[_0xcd9c('0x112')]=function(_0x54405a,_0x9fe5fa){var _0x2e6eec=_0x54405a[_0xcd9c('0x4c')]['id'];var _0x5f943e=_0x54405a[_0xcd9c('0x55')];var _0x14395f=0xc8;var _0x4b4e0e=null;return db[_0xcd9c('0xd1')][_0xcd9c('0xd2')]({'isolationLevel':db['sequelize'][_0xcd9c('0x113')][_0xcd9c('0x114')][_0xcd9c('0x115')]},function(_0x4c5472){return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x2e6eec},'transaction':_0x4c5472})[_0xcd9c('0x15')](function(_0x4aec7d){if(_0x4aec7d){return db[_0xcd9c('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x2e6eec},'transaction':_0x4c5472})[_0xcd9c('0x15')](function(){var _0x1821df=_['map'](_0x5f943e,function(_0x8d384){_0x8d384['ChatWebsiteId']=_0x2e6eec;return _0x8d384;});return db[_0xcd9c('0x91')][_0xcd9c('0xd4')](_0x1821df,{'transaction':_0x4c5472});});}else{_0x14395f=0x194;_0x4b4e0e=[];}});})[_0xcd9c('0x15')](function(){if(_0x14395f!==0x194){return db[_0xcd9c('0x91')][_0xcd9c('0x116')]({'where':{'ChatWebsiteId':_0x2e6eec},'order':_0xcd9c('0x117')})[_0xcd9c('0x15')](function(_0x407307){_0x4b4e0e=_0x407307;});}})['catch'](function(_0x55cdcf){_0x14395f=0x1f4;logger['error'](_0x55cdcf[_0xcd9c('0x2d')]);if(_0x55cdcf[_0xcd9c('0x2e')]){delete _0x55cdcf['name'];}_0x4b4e0e=_0x55cdcf;})[_0xcd9c('0x118')](function(){if(_0x4b4e0e===null){_0x9fe5fa[_0xcd9c('0x1f')](_0x14395f);}else{if(_0x14395f===0x1f4){_0x9fe5fa['status'](_0x14395f)[_0xcd9c('0xbf')](_0x4b4e0e);}else{_0x9fe5fa[_0xcd9c('0x20')](_0x14395f)[_0xcd9c('0x22')](_0x4b4e0e);}}});};exports[_0xcd9c('0x119')]=function(_0x45e434,_0x5badca){var _0xfad1f1={};var _0x2de06e={};var _0x737a11;var _0x155312;return db['ChatWebsite'][_0xcd9c('0x5b')]({'where':{'id':_0x45e434['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x5badca,null))['then'](function(_0x13f498){if(_0x13f498){_0x737a11=_0x13f498;_0x2de06e[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0x91')]['rawAttributes']);_0x2de06e[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x45e434[_0xcd9c('0x38')]);_0x2de06e[_0xcd9c('0x41')]=_[_0xcd9c('0x39')](_0x2de06e[_0xcd9c('0x36')],_0x2de06e[_0xcd9c('0x38')]);_0xfad1f1[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x2de06e[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x45e434['query'][_0xcd9c('0x3b')]));_0xfad1f1['attributes']=_0xfad1f1[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0xfad1f1[_0xcd9c('0x3a')]:_0x2de06e['model'];_0xfad1f1[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x45e434[_0xcd9c('0x38')]['sort']);_0xfad1f1['where']=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x45e434[_0xcd9c('0x38')],_0x2de06e[_0xcd9c('0x41')]));if(_0x45e434['query'][_0xcd9c('0x43')]){_0xfad1f1[_0xcd9c('0x40')]=_[_0xcd9c('0x44')](_0xfad1f1[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0xfad1f1[_0xcd9c('0x3a')],function(_0x5707b3){var _0x4e3e15={};_0x4e3e15[_0x5707b3]={'$like':'%'+_0x45e434[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x4e3e15;})});}_0xfad1f1=_[_0xcd9c('0x44')]({},_0xfad1f1,_0x45e434['options']);return _0x737a11[_0xcd9c('0x119')](_0xfad1f1);}})[_0xcd9c('0x15')](function(_0xd92738){if(_0xd92738){_0x155312=_0xd92738[_0xcd9c('0x4d')];if(!_0x45e434['query'][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0xfad1f1['limit']=qs[_0xcd9c('0x25')](_0x45e434['query'][_0xcd9c('0x25')]);_0xfad1f1[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x45e434[_0xcd9c('0x38')][_0xcd9c('0x23')]);}return _0x737a11[_0xcd9c('0x119')](_0xfad1f1);}})[_0xcd9c('0x15')](function(_0xcd82d9){if(_0xcd82d9){return _0xcd82d9?{'count':_0x155312,'rows':_0xcd82d9}:null;}})[_0xcd9c('0x15')](respondWithResult(_0x5badca,null))['catch'](handleError(_0x5badca,null));};exports[_0xcd9c('0x11a')]=function(_0xaf29fb,_0x16e382){return db[_0xcd9c('0x11b')][_0xcd9c('0x56')]({'where':{'id':_0xaf29fb[_0xcd9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16e382,null))[_0xcd9c('0x15')](function(_0x78497b){if(_0x78497b){return _0x78497b['addProactiveActions'](_0xaf29fb[_0xcd9c('0x55')]['ids'],_['omit'](_0xaf29fb[_0xcd9c('0x55')],[_0xcd9c('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x16e382,null))[_0xcd9c('0x1e')](handleError(_0x16e382,null));};exports['getProactiveActions']=function(_0x158cfe,_0x270877){var _0x2d1f97={};var _0x5f3c70={};var _0x5ca369;var _0x143687;return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x158cfe[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x270877,null))['then'](function(_0x46d19f){if(_0x46d19f){_0x5ca369=_0x46d19f;_0x5f3c70[_0xcd9c('0x36')]=_['keys'](db[_0xcd9c('0x11c')][_0xcd9c('0x34')]);_0x5f3c70['query']=_[_0xcd9c('0x37')](_0x158cfe['query']);_0x5f3c70[_0xcd9c('0x41')]=_[_0xcd9c('0x39')](_0x5f3c70[_0xcd9c('0x36')],_0x5f3c70[_0xcd9c('0x38')]);_0x2d1f97[_0xcd9c('0x3a')]=_['intersection'](_0x5f3c70[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x158cfe[_0xcd9c('0x38')][_0xcd9c('0x3b')]));_0x2d1f97['attributes']=_0x2d1f97['attributes'][_0xcd9c('0x4d')]?_0x2d1f97[_0xcd9c('0x3a')]:_0x5f3c70[_0xcd9c('0x36')];_0x2d1f97[_0xcd9c('0x3e')]=qs['sort'](_0x158cfe['query'][_0xcd9c('0x3f')]);_0x2d1f97[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x158cfe[_0xcd9c('0x38')],_0x5f3c70[_0xcd9c('0x41')]));if(_0x158cfe[_0xcd9c('0x38')]['filter']){_0x2d1f97[_0xcd9c('0x40')]=_['merge'](_0x2d1f97[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x2d1f97[_0xcd9c('0x3a')],function(_0x1d0f94){var _0x29a17f={};_0x29a17f[_0x1d0f94]={'$like':'%'+_0x158cfe[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x29a17f;})});}_0x2d1f97=_[_0xcd9c('0x44')]({},_0x2d1f97,_0x158cfe['options']);return _0x5ca369[_0xcd9c('0x102')](_0x2d1f97);}})[_0xcd9c('0x15')](function(_0x27e663){if(_0x27e663){_0x143687=_0x27e663[_0xcd9c('0x4d')];if(!_0x158cfe[_0xcd9c('0x38')][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x2d1f97[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x158cfe[_0xcd9c('0x38')]['limit']);_0x2d1f97[_0xcd9c('0x23')]=qs['offset'](_0x158cfe['query'][_0xcd9c('0x23')]);}return _0x5ca369[_0xcd9c('0x102')](_0x2d1f97);}})[_0xcd9c('0x15')](function(_0x367dfa){if(_0x367dfa){return _0x367dfa?{'count':_0x143687,'rows':_0x367dfa}:null;}})[_0xcd9c('0x15')](respondWithResult(_0x270877,null))[_0xcd9c('0x1e')](handleError(_0x270877,null));};exports[_0xcd9c('0x11d')]=function(_0x1dd11c,_0x422fe6){var _0xe618fd=_0x1dd11c[_0xcd9c('0x38')][_0xcd9c('0x11e')]===_0xcd9c('0x11f')?_0xcd9c('0x120'):'onlineForm';return db[_0xcd9c('0x33')]['find']({'attributes':['id',_0xe618fd],'where':{'id':_0x1dd11c[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x422fe6,null))[_0xcd9c('0x15')](function(_0x42f53c){if(_0x42f53c){var _0x1e5341=_0x42f53c[_0xe618fd];var _0x18eff5=_0x1e5341&&_0x1e5341[_0xcd9c('0x121')]?_0x1e5341['items']:[];_0x422fe6[_0xcd9c('0xbf')]({'fromKey':_['isNil'](_0x1e5341[_0xcd9c('0x122')])?undefined:_0x1e5341['fromKey'],'count':_0x18eff5[_0xcd9c('0x4d')],'rows':_0x18eff5});}})[_0xcd9c('0x1e')](handleError(_0x422fe6,null));};exports[_0xcd9c('0x123')]=function(_0x48c0b1,_0x46caa9){var _0x4905f0={'raw':![],'where':{}};var _0x120644={};var _0x127c7a={'count':0x0,'rows':[]};return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x48c0b1[_0xcd9c('0x4c')]['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x46caa9,null))[_0xcd9c('0x15')](function(_0x28d664){if(_0x28d664){_0x120644[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0xca')]['rawAttributes']);_0x120644['query']=_[_0xcd9c('0x37')](_0x48c0b1['query']);_0x120644[_0xcd9c('0x41')]=_[_0xcd9c('0x39')](_0x120644[_0xcd9c('0x36')],_0x120644[_0xcd9c('0x38')]);_0x4905f0[_0xcd9c('0x3a')]=_['intersection'](_0x120644[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x48c0b1['query']['fields']));_0x4905f0[_0xcd9c('0x3a')]=_0x4905f0[_0xcd9c('0x3a')]['length']?_0x4905f0[_0xcd9c('0x3a')]:_0x120644[_0xcd9c('0x36')];if(!_0x48c0b1['query'][_0xcd9c('0x3c')]('nolimit')){_0x4905f0[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x48c0b1[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x4905f0[_0xcd9c('0x23')]=qs[_0xcd9c('0x23')](_0x48c0b1[_0xcd9c('0x38')][_0xcd9c('0x23')]);}_0x4905f0[_0xcd9c('0x3e')]=qs[_0xcd9c('0x3f')](_0x48c0b1[_0xcd9c('0x38')]['sort']);_0x4905f0[_0xcd9c('0x40')]=qs[_0xcd9c('0x41')](_[_0xcd9c('0x42')](_0x48c0b1[_0xcd9c('0x38')],_0x120644[_0xcd9c('0x41')]));_0x4905f0[_0xcd9c('0x40')][_0xcd9c('0x5c')]=_0x28d664['id'];if(_0x48c0b1['query'][_0xcd9c('0x43')]){_0x4905f0[_0xcd9c('0x40')]=_[_0xcd9c('0x44')](_0x4905f0[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x4905f0['attributes'],function(_0x3f0fd2){var _0xf10f25={};_0xf10f25[_0x3f0fd2]={'$like':'%'+_0x48c0b1['query']['filter']+'%'};return _0xf10f25;})});}_0x4905f0=_[_0xcd9c('0x44')]({},_0x4905f0,_0x48c0b1[_0xcd9c('0x47')]);return db[_0xcd9c('0xca')][_0xcd9c('0x26')]({'where':_0x4905f0[_0xcd9c('0x40')]})[_0xcd9c('0x15')](function(_0xf8e8ba){_0x127c7a[_0xcd9c('0x26')]=_0xf8e8ba;if(_0x48c0b1[_0xcd9c('0x38')][_0xcd9c('0x48')]){_0x4905f0[_0xcd9c('0x49')]=[{'all':!![]}];}else{_0x4905f0[_0xcd9c('0x49')]=[{'model':db[_0xcd9c('0x81')],'as':'Contact','required':![]},{'model':db[_0xcd9c('0xd3')],'as':_0xcd9c('0x124'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x4905f0);})[_0xcd9c('0x15')](function(_0x203af4){_0x127c7a['rows']=_0x203af4;return _0x127c7a;});}})[_0xcd9c('0x15')](respondWithFilteredResult(_0x46caa9,_0x4905f0))[_0xcd9c('0x1e')](handleError(_0x46caa9,null));};exports['addAgents']=function(_0x5bca0b,_0x3fdd58){return db[_0xcd9c('0x33')][_0xcd9c('0x56')]({'where':{'id':_0x5bca0b[_0xcd9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3fdd58,null))['then'](function(_0x15a4e8){if(_0x15a4e8){return _0x15a4e8['addAgents'](_0x5bca0b[_0xcd9c('0x55')]['ids'],_['omit'](_0x5bca0b[_0xcd9c('0x55')],['ids','id'])||{})[_0xcd9c('0xad')](function(_0x5a5939){for(var _0x5a2280=0x0;_0x5a2280<_0x5bca0b['body'][_0xcd9c('0x5f')][_0xcd9c('0x4d')];_0x5a2280+=0x1){socket[_0xcd9c('0x125')](_0xcd9c('0x126'),{'UserId':Number(_0x5bca0b[_0xcd9c('0x55')][_0xcd9c('0x5f')][_0x5a2280]),'ChatWebsiteId':Number(_0x5bca0b[_0xcd9c('0x4c')]['id'])});}return _0x5a5939;});}})[_0xcd9c('0x15')](respondWithResult(_0x3fdd58,null))[_0xcd9c('0x1e')](handleError(_0x3fdd58,null));};exports[_0xcd9c('0x127')]=function(_0x178cc5,_0x3a27b0){return db[_0xcd9c('0x33')]['find']({'where':{'id':_0x178cc5['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x3a27b0,null))[_0xcd9c('0x15')](function(_0x3aac5a){if(_0x3aac5a){return _0x3aac5a[_0xcd9c('0x127')](_0x178cc5[_0xcd9c('0x38')][_0xcd9c('0x5f')])['then'](function(){if(_['isArray'](_0x178cc5[_0xcd9c('0x38')][_0xcd9c('0x5f')])){for(var _0x32b820=0x0;_0x32b820<_0x178cc5[_0xcd9c('0x38')][_0xcd9c('0x5f')][_0xcd9c('0x4d')];_0x32b820+=0x1){socket['emit'](_0xcd9c('0x128'),{'UserId':Number(_0x178cc5['query'][_0xcd9c('0x5f')][_0x32b820]),'ChatWebsiteId':Number(_0x178cc5['params']['id'])});}}else{socket[_0xcd9c('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x178cc5[_0xcd9c('0x38')]['ids']),'ChatWebsiteId':Number(_0x178cc5[_0xcd9c('0x4c')]['id'])});}});}})[_0xcd9c('0x15')](respondWithStatusCode(_0x3a27b0,null))['catch'](handleError(_0x3a27b0,null));};exports['getAgents']=function(_0x9b1e13,_0x3ba639){var _0x419065={};var _0x166b3a={};var _0x2d7413;var _0x50ace4;return db[_0xcd9c('0x33')][_0xcd9c('0x5b')]({'where':{'id':_0x9b1e13['params']['id']}})[_0xcd9c('0x15')](handleEntityNotFound(_0x3ba639,null))['then'](function(_0x4f3d84){if(_0x4f3d84){_0x2d7413=_0x4f3d84;_0x166b3a[_0xcd9c('0x36')]=_[_0xcd9c('0x37')](db[_0xcd9c('0xef')]['rawAttributes']);_0x166b3a[_0xcd9c('0x38')]=_[_0xcd9c('0x37')](_0x9b1e13[_0xcd9c('0x38')]);_0x166b3a[_0xcd9c('0x41')]=_['intersection'](_0x166b3a['model'],_0x166b3a[_0xcd9c('0x38')]);_0x419065[_0xcd9c('0x3a')]=_[_0xcd9c('0x39')](_0x166b3a[_0xcd9c('0x36')],qs[_0xcd9c('0x3b')](_0x9b1e13[_0xcd9c('0x38')]['fields']));_0x419065[_0xcd9c('0x3a')]=_0x419065[_0xcd9c('0x3a')][_0xcd9c('0x4d')]?_0x419065[_0xcd9c('0x3a')]:_0x166b3a[_0xcd9c('0x36')];_0x419065['order']=qs[_0xcd9c('0x3f')](_0x9b1e13[_0xcd9c('0x38')]['sort']);_0x419065[_0xcd9c('0x40')]=qs['filters'](_[_0xcd9c('0x42')](_0x9b1e13[_0xcd9c('0x38')],_0x166b3a['filters']));if(_0x9b1e13[_0xcd9c('0x38')][_0xcd9c('0x43')]){_0x419065[_0xcd9c('0x40')]=_[_0xcd9c('0x44')](_0x419065[_0xcd9c('0x40')],{'$or':_[_0xcd9c('0x32')](_0x419065[_0xcd9c('0x3a')],function(_0x17d7c7){var _0x3b36e3={};_0x3b36e3[_0x17d7c7]={'$like':'%'+_0x9b1e13[_0xcd9c('0x38')][_0xcd9c('0x43')]+'%'};return _0x3b36e3;})});}_0x419065=_[_0xcd9c('0x44')]({},_0x419065,_0x9b1e13[_0xcd9c('0x47')]);return _0x2d7413[_0xcd9c('0x129')](_0x419065);}})[_0xcd9c('0x15')](function(_0x52491e){if(_0x52491e){_0x50ace4=_0x52491e[_0xcd9c('0x4d')];if(!_0x9b1e13['query'][_0xcd9c('0x3c')](_0xcd9c('0x3d'))){_0x419065[_0xcd9c('0x25')]=qs[_0xcd9c('0x25')](_0x9b1e13[_0xcd9c('0x38')][_0xcd9c('0x25')]);_0x419065[_0xcd9c('0x23')]=qs['offset'](_0x9b1e13[_0xcd9c('0x38')][_0xcd9c('0x23')]);}return _0x2d7413[_0xcd9c('0x129')](_0x419065);}})[_0xcd9c('0x15')](function(_0x312b00){if(_0x312b00){return _0x312b00?{'count':_0x50ace4,'rows':_0x312b00}:null;}})['then'](respondWithResult(_0x3ba639,null))[_0xcd9c('0x1e')](handleError(_0x3ba639,null));};
\ No newline at end of file
+var _0xeb60=['Applications','contact','customerIp','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','offline-chat','sequelize','transaction','MailServerOut','forwardOffline','Smtp','service','host','port','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','interval','inspect','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','utf8','remote','referer','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','sendStatus','json','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','offset','undefined','count','limit','set','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','ChatWebsite','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','show','Pause','rawAttributes','find','create','body','user','role','userProfileId','params','describe','ChatWebsiteId','Disposition','findOne','includeAll','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','order','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','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','List','Contacts','DESC','ChatApplication','applications','list','orderBy','priority','asc','account'];(function(_0x4d471b,_0x281167){var _0x54fd9b=function(_0x4d85b0){while(--_0x4d85b0){_0x4d471b['push'](_0x4d471b['shift']());}};_0x54fd9b(++_0x281167);}(_0xeb60,0x91));var _0x0eb6=function(_0x2c667e,_0x33d24b){_0x2c667e=_0x2c667e-0x0;var _0xf74e6f=_0xeb60[_0x2c667e];return _0xf74e6f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x0eb6('0x0'));var util=require(_0x0eb6('0x1'));var path=require(_0x0eb6('0x2'));var ejs=require(_0x0eb6('0x3'));var fs=require('fs');var fs_extra=require(_0x0eb6('0x4'));var _=require('lodash');var querystring=require(_0x0eb6('0x5'));var Redis=require('ioredis');var qs=require(_0x0eb6('0x6'));var logger=require(_0x0eb6('0x7'))(_0x0eb6('0x8'));var config=require(_0x0eb6('0x9'));var db=require(_0x0eb6('0xa'))['db'];config[_0x0eb6('0xb')]=_[_0x0eb6('0xc')](config[_0x0eb6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0eb6('0xd'))(new Redis(config['redis']));require(_0x0eb6('0xe'))[_0x0eb6('0xf')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x0eb6('0x10')]({'port':0x232c});var client9002=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x232a});var client9003=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x232b});var client9001=jayson[_0x0eb6('0x11')][_0x0eb6('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x271dbe,_0x20ee06,_0x1f869a,_0x3a7dff){return new BPromise(function(_0x28e97f,_0x334598){var _0x20dfaa=_0x3a7dff||client;return _0x20dfaa[_0x0eb6('0x12')](_0x271dbe,_0x1f869a)[_0x0eb6('0x13')](function(_0xae6eb4){logger[_0x0eb6('0x14')](_0x0eb6('0x15'),_0x20ee06,_0x0eb6('0x16'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x20ee06,_0x0eb6('0x16'),JSON[_0x0eb6('0x17')](_0xae6eb4));if(_0xae6eb4[_0x0eb6('0x18')]){if(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x19')]===0x1f4){logger[_0x0eb6('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x20ee06,_0xae6eb4['error'][_0x0eb6('0x1a')]);return _0x334598(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);}logger[_0x0eb6('0x18')](_0x0eb6('0x15'),_0x20ee06,_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);return _0x28e97f(_0xae6eb4[_0x0eb6('0x18')][_0x0eb6('0x1a')]);}else{logger[_0x0eb6('0x14')](_0x0eb6('0x15'),_0x20ee06,_0x0eb6('0x16'));_0x28e97f(_0xae6eb4[_0x0eb6('0x1b')][_0x0eb6('0x1a')]);}})[_0x0eb6('0x1c')](function(_0x5aa9fe){logger[_0x0eb6('0x18')](_0x0eb6('0x15'),_0x20ee06,_0x5aa9fe);_0x334598(_0x5aa9fe);});});}function respondWithStatusCode(_0xed0d89,_0x157f0a){_0x157f0a=_0x157f0a||0xcc;return function(_0x7e665f){if(_0x7e665f){return _0xed0d89['sendStatus'](_0x157f0a);}return _0xed0d89['status'](_0x157f0a)[_0x0eb6('0x1d')]();};}function respondWithResult(_0x24fb08,_0x15d0c5){_0x15d0c5=_0x15d0c5||0xc8;return function(_0xb46291){if(_0xb46291){return _0x24fb08[_0x0eb6('0x1e')](_0x15d0c5)['json'](_0xb46291);}};}function respondWithFilteredResult(_0xe61e9a,_0xd4175d){return function(_0x2ab0c8){if(_0x2ab0c8){var _0x22b41c=typeof _0xd4175d[_0x0eb6('0x1f')]===_0x0eb6('0x20')&&typeof _0xd4175d['limit']===_0x0eb6('0x20');var _0x450321=_0x2ab0c8[_0x0eb6('0x21')];var _0x432f7e=_0x22b41c?0x0:_0xd4175d[_0x0eb6('0x1f')];var _0x4999ec=_0x22b41c?_0x2ab0c8[_0x0eb6('0x21')]:_0xd4175d[_0x0eb6('0x1f')]+_0xd4175d[_0x0eb6('0x22')];var _0x3c40bd;if(_0x4999ec>=_0x450321){_0x4999ec=_0x450321;_0x3c40bd=0xc8;}else{_0x3c40bd=0xce;}_0xe61e9a[_0x0eb6('0x1e')](_0x3c40bd);return _0xe61e9a[_0x0eb6('0x23')]('Content-Range',_0x432f7e+'-'+_0x4999ec+'/'+_0x450321)['json'](_0x2ab0c8);}return null;};}function saveUpdates(_0x11bec4){return function(_0x240384){if(_0x240384){return _0x240384[_0x0eb6('0x24')](_0x11bec4)['then'](function(_0x563b52){return _0x563b52;});}return null;};}function removeEntity(_0x3cee47){return function(_0xd9e3e6){if(_0xd9e3e6){return _0xd9e3e6[_0x0eb6('0x25')]()[_0x0eb6('0x13')](function(){var _0x410f4b=_0xd9e3e6[_0x0eb6('0x26')]({'plain':!![]});var _0x3791b9=_0x0eb6('0x27');return db[_0x0eb6('0x28')][_0x0eb6('0x25')]({'where':{'type':_0x3791b9,'resourceId':_0x410f4b['id']}})[_0x0eb6('0x13')](function(){return _0xd9e3e6;});})[_0x0eb6('0x13')](function(){_0x3cee47[_0x0eb6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dec85){return function(_0x4808d9){if(!_0x4808d9){_0x1dec85['sendStatus'](0x194);}return _0x4808d9;};}function handleError(_0x38a084,_0x52da8){_0x52da8=_0x52da8||0x1f4;return function(_0x5a23c2){logger[_0x0eb6('0x18')](_0x5a23c2[_0x0eb6('0x29')]);if(_0x5a23c2[_0x0eb6('0x2a')]){delete _0x5a23c2[_0x0eb6('0x2a')];}_0x38a084[_0x0eb6('0x1e')](_0x52da8)[_0x0eb6('0x2b')](_0x5a23c2);};}exports[_0x0eb6('0x2c')]=function(_0xc9b02f,_0x442d09){var _0x1aee95={'include':[{'model':db['Pause'],'as':_0x0eb6('0x2d')}]},_0x16f0da={},_0x2d78ce={'count':0x0,'rows':[]};var _0x1fea21=_['map'](db[_0x0eb6('0x2e')]['rawAttributes'],function(_0x408df9){return{'name':_0x408df9['fieldName'],'type':_0x408df9[_0x0eb6('0x2f')][_0x0eb6('0x30')]};});_0x16f0da[_0x0eb6('0x31')]=_[_0x0eb6('0x32')](_0x1fea21,_0x0eb6('0x2a'));_0x16f0da[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0xc9b02f[_0x0eb6('0x33')]);_0x16f0da[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x16f0da[_0x0eb6('0x31')],_0x16f0da[_0x0eb6('0x33')]);_0x1aee95[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x16f0da[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0xc9b02f[_0x0eb6('0x33')]['fields']));_0x1aee95[_0x0eb6('0x37')]=_0x1aee95[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x1aee95[_0x0eb6('0x37')]:_0x16f0da['model'];if(!_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x1aee95[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1aee95[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0xc9b02f['query']['offset']);}_0x1aee95['order']=qs[_0x0eb6('0x3c')](_0xc9b02f['query'][_0x0eb6('0x3c')]);_0x1aee95['where']=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0xc9b02f[_0x0eb6('0x33')],_0x16f0da[_0x0eb6('0x35')]),_0x1fea21);if(_0xc9b02f[_0x0eb6('0x33')][_0x0eb6('0x3e')]){_0x1aee95[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x1aee95['where'],{'$or':_['map'](_0x1fea21,function(_0x1c4a49){if(_0x1c4a49[_0x0eb6('0x2f')]!=='VIRTUAL'){var _0xaa87b3={};_0xaa87b3[_0x1c4a49[_0x0eb6('0x2a')]]={'$like':'%'+_0xc9b02f[_0x0eb6('0x33')]['filter']+'%'};return _0xaa87b3;}})});}_0x1aee95=_[_0x0eb6('0x40')]({},_0x1aee95,_0xc9b02f[_0x0eb6('0x41')]);var _0x2b6b1f={'where':_0x1aee95[_0x0eb6('0x3f')]};return db[_0x0eb6('0x2e')][_0x0eb6('0x21')](_0x2b6b1f)[_0x0eb6('0x13')](function(_0x29130b){_0x2d78ce[_0x0eb6('0x21')]=_0x29130b;if(_0xc9b02f[_0x0eb6('0x33')]['includeAll']){_0x1aee95[_0x0eb6('0x42')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x1aee95);})[_0x0eb6('0x13')](function(_0x658ab8){_0x2d78ce['rows']=_0x658ab8;return _0x2d78ce;})[_0x0eb6('0x13')](respondWithFilteredResult(_0x442d09,_0x1aee95))[_0x0eb6('0x1c')](handleError(_0x442d09,null));};exports[_0x0eb6('0x43')]=function(_0x1ec909,_0x524878){var _0x2ee996={'raw':![],'where':{'id':_0x1ec909['params']['id']},'include':[{'model':db[_0x0eb6('0x44')],'as':_0x0eb6('0x2d')}]},_0x103415={};_0x103415[_0x0eb6('0x31')]=_[_0x0eb6('0x34')](db[_0x0eb6('0x2e')][_0x0eb6('0x45')]);_0x103415[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x1ec909[_0x0eb6('0x33')]);_0x103415['filters']=_[_0x0eb6('0x36')](_0x103415[_0x0eb6('0x31')],_0x103415['query']);_0x2ee996['attributes']=_[_0x0eb6('0x36')](_0x103415['model'],qs[_0x0eb6('0x38')](_0x1ec909[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x2ee996[_0x0eb6('0x37')]=_0x2ee996[_0x0eb6('0x37')]['length']?_0x2ee996[_0x0eb6('0x37')]:_0x103415[_0x0eb6('0x31')];if(_0x1ec909[_0x0eb6('0x33')]['includeAll']){_0x2ee996[_0x0eb6('0x42')]=[{'all':!![]}];}_0x2ee996=_[_0x0eb6('0x40')]({},_0x2ee996,_0x1ec909[_0x0eb6('0x41')]);return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x2ee996)[_0x0eb6('0x13')](handleEntityNotFound(_0x524878,null))['then'](respondWithResult(_0x524878,null))[_0x0eb6('0x1c')](handleError(_0x524878,null));};exports[_0x0eb6('0x47')]=function(_0x2ba18f,_0x329f2e){return db[_0x0eb6('0x2e')][_0x0eb6('0x47')](_0x2ba18f[_0x0eb6('0x48')],{})[_0x0eb6('0x13')](function(_0x2a58a6){var _0x20edfc=_0x2ba18f[_0x0eb6('0x49')][_0x0eb6('0x26')]({'plain':!![]});if(!_0x20edfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20edfc[_0x0eb6('0x4a')]===_0x0eb6('0x49')){var _0x1807c4=_0x2a58a6[_0x0eb6('0x26')]({'plain':!![]});var _0x152e26=_0x0eb6('0x27');return db['UserProfileSection'][_0x0eb6('0x46')]({'where':{'name':_0x152e26,'userProfileId':_0x20edfc[_0x0eb6('0x4b')]},'raw':!![]})[_0x0eb6('0x13')](function(_0x2864b1){if(_0x2864b1&&_0x2864b1['autoAssociation']===0x0){return db[_0x0eb6('0x28')]['create']({'name':_0x1807c4['name'],'resourceId':_0x1807c4['id'],'type':_0x2864b1['name'],'sectionId':_0x2864b1['id']},{})[_0x0eb6('0x13')](function(){return _0x2a58a6;});}else{return _0x2a58a6;}})[_0x0eb6('0x1c')](function(_0xd69927){logger[_0x0eb6('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd69927);throw _0xd69927;});}return _0x2a58a6;})['then'](respondWithResult(_0x329f2e,0xc9))[_0x0eb6('0x1c')](handleError(_0x329f2e,null));};exports[_0x0eb6('0x24')]=function(_0x2768fc,_0x16c07b){if(_0x2768fc[_0x0eb6('0x48')]['id']){delete _0x2768fc[_0x0eb6('0x48')]['id'];}return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x2768fc[_0x0eb6('0x4c')]['id']},'include':[{'model':db[_0x0eb6('0x44')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x16c07b,null))[_0x0eb6('0x13')](saveUpdates(_0x2768fc[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x16c07b,null))[_0x0eb6('0x1c')](handleError(_0x16c07b,null));};exports[_0x0eb6('0x25')]=function(_0x584bd4,_0x21d1f7){return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x584bd4[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x21d1f7,null))[_0x0eb6('0x13')](removeEntity(_0x21d1f7,null))[_0x0eb6('0x1c')](handleError(_0x21d1f7,null));};exports[_0x0eb6('0x4d')]=function(_0x176de5,_0x15cc0d){return db[_0x0eb6('0x2e')][_0x0eb6('0x4d')]()[_0x0eb6('0x13')](respondWithResult(_0x15cc0d,null))['catch'](handleError(_0x15cc0d,null));};exports['addDisposition']=function(_0x4b068e,_0x59af17){if(_0x4b068e[_0x0eb6('0x48')]['id']){delete _0x4b068e['body']['id'];}return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x4b068e[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x59af17,null))[_0x0eb6('0x13')](function(_0x18a646){if(_0x18a646){_0x4b068e['body'][_0x0eb6('0x4e')]=_0x18a646['id'];return db[_0x0eb6('0x4f')][_0x0eb6('0x47')](_0x4b068e[_0x0eb6('0x48')]);}})[_0x0eb6('0x13')](respondWithResult(_0x59af17,null))['catch'](handleError(_0x59af17,null));};exports['getDispositions']=function(_0x4ee7de,_0x1199e1){var _0x3ba92e={'raw':![],'where':{}};var _0x170069={};var _0x43f3eb={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x4ee7de[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1199e1,null))[_0x0eb6('0x13')](function(_0x72094d){if(_0x72094d){_0x170069[_0x0eb6('0x31')]=_['keys'](db[_0x0eb6('0x4f')][_0x0eb6('0x45')]);_0x170069['query']=_[_0x0eb6('0x34')](_0x4ee7de[_0x0eb6('0x33')]);_0x170069[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x170069[_0x0eb6('0x31')],_0x170069['query']);_0x3ba92e['attributes']=_[_0x0eb6('0x36')](_0x170069[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x4ee7de[_0x0eb6('0x33')]['fields']));_0x3ba92e['attributes']=_0x3ba92e['attributes'][_0x0eb6('0x39')]?_0x3ba92e[_0x0eb6('0x37')]:_0x170069[_0x0eb6('0x31')];if(!_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x3a')]('nolimit')){_0x3ba92e['limit']=qs[_0x0eb6('0x22')](_0x4ee7de['query'][_0x0eb6('0x22')]);_0x3ba92e['offset']=qs['offset'](_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x3ba92e['order']=qs['sort'](_0x4ee7de[_0x0eb6('0x33')]['sort']);_0x3ba92e[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_['pick'](_0x4ee7de[_0x0eb6('0x33')],_0x170069['filters']));_0x3ba92e[_0x0eb6('0x3f')]['ChatWebsiteId']=_0x72094d['id'];if(_0x4ee7de['query'][_0x0eb6('0x3e')]){_0x3ba92e[_0x0eb6('0x3f')]=_['merge'](_0x3ba92e[_0x0eb6('0x3f')],{'$or':_['map'](_0x3ba92e[_0x0eb6('0x37')],function(_0x4ed1c8){var _0x12f43a={};_0x12f43a[_0x4ed1c8]={'$like':'%'+_0x4ee7de['query']['filter']+'%'};return _0x12f43a;})});}_0x3ba92e=_[_0x0eb6('0x40')]({},_0x3ba92e,_0x4ee7de[_0x0eb6('0x41')]);return db[_0x0eb6('0x4f')][_0x0eb6('0x21')]({'where':_0x3ba92e[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x15ed2a){_0x43f3eb[_0x0eb6('0x21')]=_0x15ed2a;if(_0x4ee7de[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x3ba92e[_0x0eb6('0x42')]=[{'all':!![]}];}return db['Disposition'][_0x0eb6('0x52')](_0x3ba92e);})[_0x0eb6('0x13')](function(_0x59ccc4){_0x43f3eb[_0x0eb6('0x53')]=_0x59ccc4;return _0x43f3eb;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x1199e1,_0x3ba92e))['catch'](handleError(_0x1199e1,null));};exports[_0x0eb6('0x54')]=function(_0x103ab6,_0x204983){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x103ab6['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x204983,null))['then'](function(_0x34c865){if(_0x34c865){return _0x34c865[_0x0eb6('0x54')](_0x103ab6['query'][_0x0eb6('0x55')]);}})[_0x0eb6('0x13')](respondWithStatusCode(_0x204983,null))[_0x0eb6('0x1c')](handleError(_0x204983,null));};exports[_0x0eb6('0x56')]=function(_0x58ad1a,_0x1e1439){if(_0x58ad1a[_0x0eb6('0x48')]['id']){delete _0x58ad1a['body']['id'];}return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x58ad1a['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1e1439,null))[_0x0eb6('0x13')](function(_0x880a43){if(_0x880a43){_0x58ad1a[_0x0eb6('0x48')][_0x0eb6('0x4e')]=_0x880a43['id'];return db[_0x0eb6('0x57')][_0x0eb6('0x47')](_0x58ad1a[_0x0eb6('0x48')]);}})[_0x0eb6('0x13')](respondWithResult(_0x1e1439,null))['catch'](handleError(_0x1e1439,null));};exports['getAnswers']=function(_0x407b5c,_0x4907a0){var _0x2e057c={'raw':![],'where':{}};var _0x4c5e38={};var _0x1e8fc7={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x407b5c[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x4907a0,null))['then'](function(_0x529e4f){if(_0x529e4f){_0x4c5e38['model']=_[_0x0eb6('0x34')](db[_0x0eb6('0x57')][_0x0eb6('0x45')]);_0x4c5e38[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x407b5c[_0x0eb6('0x33')]);_0x4c5e38[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x4c5e38[_0x0eb6('0x31')],_0x4c5e38[_0x0eb6('0x33')]);_0x2e057c[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x4c5e38[_0x0eb6('0x31')],qs['fields'](_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x2e057c['attributes']=_0x2e057c[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x2e057c[_0x0eb6('0x37')]:_0x4c5e38[_0x0eb6('0x31')];if(!_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x2e057c[_0x0eb6('0x22')]=qs['limit'](_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x2e057c[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x407b5c[_0x0eb6('0x33')]['offset']);}_0x2e057c[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x407b5c['query'][_0x0eb6('0x3c')]);_0x2e057c['where']=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x407b5c[_0x0eb6('0x33')],_0x4c5e38[_0x0eb6('0x35')]));_0x2e057c['where'][_0x0eb6('0x4e')]=_0x529e4f['id'];if(_0x407b5c['query'][_0x0eb6('0x3e')]){_0x2e057c['where']=_[_0x0eb6('0x40')](_0x2e057c['where'],{'$or':_[_0x0eb6('0x32')](_0x2e057c[_0x0eb6('0x37')],function(_0x1c5b54){var _0x3033ed={};_0x3033ed[_0x1c5b54]={'$like':'%'+_0x407b5c['query']['filter']+'%'};return _0x3033ed;})});}_0x2e057c=_['merge']({},_0x2e057c,_0x407b5c[_0x0eb6('0x41')]);return db['CannedAnswer'][_0x0eb6('0x21')]({'where':_0x2e057c[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x3515d2){_0x1e8fc7[_0x0eb6('0x21')]=_0x3515d2;if(_0x407b5c[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x2e057c[_0x0eb6('0x42')]=[{'all':!![]}];}return db[_0x0eb6('0x57')]['findAll'](_0x2e057c);})[_0x0eb6('0x13')](function(_0x3f8c9f){_0x1e8fc7[_0x0eb6('0x53')]=_0x3f8c9f;return _0x1e8fc7;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x4907a0,_0x2e057c))['catch'](handleError(_0x4907a0,null));};exports[_0x0eb6('0x59')]=function(_0x547bcd,_0x2b663a){return db[_0x0eb6('0x2e')]['find']({'where':{'id':_0x547bcd[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2b663a,null))['then'](function(_0x395341){if(_0x395341){return _0x395341[_0x0eb6('0x59')](_0x547bcd[_0x0eb6('0x33')][_0x0eb6('0x55')]);}})[_0x0eb6('0x13')](respondWithStatusCode(_0x2b663a,null))[_0x0eb6('0x1c')](handleError(_0x2b663a,null));};exports[_0x0eb6('0x5a')]=function(_0x518da9,_0x534a34){_0x518da9['body'][_0x0eb6('0x5b')]=_0x518da9[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x518da9[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x534a34,null))[_0x0eb6('0x13')](saveUpdates(_0x518da9[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x534a34,null))[_0x0eb6('0x1c')](handleError(_0x534a34,null));};exports['addAvatar']=function(_0x31b16f,_0x209eb7){_0x31b16f['body'][_0x0eb6('0x5e')]=_0x31b16f[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db['ChatWebsite'][_0x0eb6('0x46')]({'where':{'id':_0x31b16f['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x209eb7,null))['then'](saveUpdates(_0x31b16f[_0x0eb6('0x48')],null))['then'](respondWithResult(_0x209eb7,null))['catch'](handleError(_0x209eb7,null));};exports[_0x0eb6('0x5f')]=function(_0x16cd1d,_0x49d1cd){_0x16cd1d['body'][_0x0eb6('0x60')]=_0x16cd1d['file']['filename'];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x16cd1d[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x49d1cd,null))[_0x0eb6('0x13')](saveUpdates(_0x16cd1d[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x49d1cd,null))['catch'](handleError(_0x49d1cd,null));};exports[_0x0eb6('0x61')]=function(_0x46be2f,_0x3b8677){_0x46be2f[_0x0eb6('0x48')]['systemAvatar']=_0x46be2f[_0x0eb6('0x5c')][_0x0eb6('0x5d')];return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x46be2f[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b8677,null))[_0x0eb6('0x13')](saveUpdates(_0x46be2f[_0x0eb6('0x48')],null))[_0x0eb6('0x13')](respondWithResult(_0x3b8677,null))[_0x0eb6('0x1c')](handleError(_0x3b8677,null));};exports[_0x0eb6('0x62')]=function(_0x340963,_0x5115aa){var _0x43b76d=path['join'](config[_0x0eb6('0x63')],_0x0eb6('0x64'));var _0x1c4370={'where':{'id':_0x340963['params']['id']},'attributes':['id',_0x0eb6('0x5b')],'raw':!![]};var _0x262a44=![];return require(_0x0eb6('0x65'))[_0x0eb6('0x66')]()[_0x0eb6('0x13')](function(_0xddc839){if(_0xddc839){_0x262a44=_0xddc839[_0x0eb6('0x67')];}})['then'](function(){return db[_0x0eb6('0x2e')]['find'](_0x1c4370);})[_0x0eb6('0x13')](handleEntityNotFound(_0x5115aa,null))['then'](function(_0x1e1205){if(_0x1e1205){if(!_['isNil'](_0x1e1205[_0x0eb6('0x5b')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6a'),_0x1e1205[_0x0eb6('0x5b')]))&&_0x262a44){_0x43b76d=path['join'](config[_0x0eb6('0x63')],'server/files/images/logos/',_0x1e1205[_0x0eb6('0x5b')]);}}return _0x5115aa[_0x0eb6('0x6b')](_0x43b76d);}})[_0x0eb6('0x1c')](handleError(_0x5115aa,null));};exports[_0x0eb6('0x6c')]=function(_0x26755a,_0x341e23){var _0x259adf=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6d'));var _0x2259c8={'where':{'id':_0x26755a[_0x0eb6('0x4c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x2259c8)[_0x0eb6('0x13')](handleEntityNotFound(_0x341e23,null))['then'](function(_0x3fe773){if(_0x3fe773){if(!_[_0x0eb6('0x6e')](_0x3fe773['agentAvatar'])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6f'),_0x3fe773['agentAvatar']))){_0x259adf=path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6f'),_0x3fe773[_0x0eb6('0x5e')]);}}return _0x341e23[_0x0eb6('0x6b')](_0x259adf);}})[_0x0eb6('0x1c')](handleError(_0x341e23,null));};exports[_0x0eb6('0x70')]=function(_0x20f149,_0xe248b8){var _0x56990a=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x71'));var _0x1bc55f={'where':{'id':_0x20f149[_0x0eb6('0x4c')]['id']},'attributes':['id',_0x0eb6('0x60'),_0x0eb6('0x72')],'raw':!![]};return db[_0x0eb6('0x2e')][_0x0eb6('0x46')](_0x1bc55f)['then'](handleEntityNotFound(_0xe248b8,null))[_0x0eb6('0x13')](function(_0x2b5971){if(_0x2b5971){if(!_[_0x0eb6('0x6e')](_0x2b5971[_0x0eb6('0x60')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],_0x0eb6('0x6f'),_0x2b5971[_0x0eb6('0x60')]))&&_0x2b5971['showCustomerAvatar']){_0x56990a=path['join'](config['root'],_0x0eb6('0x6f'),_0x2b5971[_0x0eb6('0x60')]);}}return _0xe248b8[_0x0eb6('0x6b')](_0x56990a);}})[_0x0eb6('0x1c')](handleError(_0xe248b8,null));};exports[_0x0eb6('0x73')]=function(_0x3849bd,_0xe774ca){var _0x583a29=path['join'](config['root'],_0x0eb6('0x74'));var _0x330531={'where':{'id':_0x3849bd[_0x0eb6('0x4c')]['id']},'attributes':['id',_0x0eb6('0x75')],'raw':!![]};return db['ChatWebsite'][_0x0eb6('0x46')](_0x330531)[_0x0eb6('0x13')](handleEntityNotFound(_0xe774ca,null))[_0x0eb6('0x13')](function(_0x4b69dc){if(_0x4b69dc){if(!_[_0x0eb6('0x6e')](_0x4b69dc[_0x0eb6('0x75')])){if(fs[_0x0eb6('0x68')](path[_0x0eb6('0x69')](config[_0x0eb6('0x63')],'server/files/images/avatars/',_0x4b69dc[_0x0eb6('0x75')]))){_0x583a29=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x6f'),_0x4b69dc[_0x0eb6('0x75')]);}}return _0xe774ca[_0x0eb6('0x6b')](_0x583a29);}})['catch'](handleError(_0xe774ca,null));};exports[_0x0eb6('0x76')]=function(_0x5dab6e,_0x2827c0){var _0x5787a3=require(_0x0eb6('0x77'));var _0x1db7c6=new _0x5787a3();var _0x3aeeb6=_0x1db7c6[_0x0eb6('0x78')](_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x7a')])[_0x0eb6('0x7b')]();var _0x120843={'body':_0x5dab6e['body'],'channel':_0x0eb6('0x7c')};var _0x1551ce=[];var _0x2f46ac=[];var _0x3e856e={};var _0x40582c=![];return db[_0x0eb6('0x7d')][_0x0eb6('0x4d')]()[_0x0eb6('0x13')](function(_0x4d8e29){if(!_0x4d8e29){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x7f'));}_0x1551ce=_[_0x0eb6('0x80')](_[_0x0eb6('0x34')](_0x4d8e29),[_0x0eb6('0x81'),'updatedAt']);_0x2f46ac=_['difference'](_[_0x0eb6('0x34')](_0x4d8e29),[_0x0eb6('0x81'),_0x0eb6('0x82'),_0x0eb6('0x83'),_0x0eb6('0x84')]);if(_0x5dab6e[_0x0eb6('0x48')]['id']){delete _0x5dab6e[_0x0eb6('0x48')]['id'];}if(_['isNil'](_0x5dab6e['body'][_0x0eb6('0x85')])){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x87'));}if(_[_0x0eb6('0x6e')](_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x48')])||_0x5dab6e[_0x0eb6('0x48')]['body']===''){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x88'));}if(_[_0x0eb6('0x6e')](_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x89')])){throw new db['Sequelize'][(_0x0eb6('0x7e'))](_0x0eb6('0x8a')+_0x2f46ac);}if(!_[_0x0eb6('0x8b')](_0x2f46ac,_0x5dab6e['body']['mapKey'])){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x8c')+_0x2f46ac);}_0x3e856e[_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x89')]]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x85')];})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x5dab6e[_0x0eb6('0x4c')]['id']},'include':[{'model':db['CmList'],'as':_0x0eb6('0x8d'),'include':[{'model':db['CmContact'],'as':_0x0eb6('0x8e'),'where':_0x3e856e,'limit':0x1,'order':[[_0x0eb6('0x82'),_0x0eb6('0x8f')]]}]},{'model':db[_0x0eb6('0x90')],'as':'Applications'}]});})[_0x0eb6('0x13')](handleEntityNotFound(_0x2827c0,null))[_0x0eb6('0x13')](function(_0x93e277){if(_0x93e277&&_0x93e277[_0x0eb6('0x8d')]){_0x120843['account']=_0x93e277;_0x120843[_0x0eb6('0x91')]=_0x93e277['Applications'];_0x120843[_0x0eb6('0x92')]=_0x93e277[_0x0eb6('0x8d')];_0x120843[_0x0eb6('0x91')]=_[_0x0eb6('0x93')](_0x120843[_0x0eb6('0x91')],[_0x0eb6('0x94')],[_0x0eb6('0x95')]);if(_0x120843[_0x0eb6('0x96')][_0x0eb6('0x97')]){delete _0x120843[_0x0eb6('0x96')]['Applications'];}if(_0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')]&&_0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')][_0x0eb6('0x8e')][_0x0eb6('0x39')]){return _0x120843[_0x0eb6('0x96')][_0x0eb6('0x8d')][_0x0eb6('0x8e')][0x0];}var _0x1906af=_[_0x0eb6('0xc')](_0x5dab6e['body'],{'firstName':_0x5dab6e[_0x0eb6('0x48')]['from'],'ListId':_0x93e277[_0x0eb6('0x84')]});_0x1906af[_0x5dab6e[_0x0eb6('0x48')]['mapKey']]=_0x5dab6e[_0x0eb6('0x48')]['from'];return db['CmContact'][_0x0eb6('0x47')](_0x1906af,{'fields':_0x1551ce,'raw':!![]});}})['then'](handleEntityNotFound(_0x2827c0,null))[_0x0eb6('0x13')](function(_0x38d771){_0x120843[_0x0eb6('0x98')]=_0x38d771;var _0x2c92ea=_0x5dab6e['body'][_0x0eb6('0x99')];if(_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9a')]){_0x2c92ea=_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9a')];}else if(_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9b')]){_0x2c92ea=_['first'](_0x5dab6e[_0x0eb6('0x79')]['x-forwarded-for']['split'](','));}if(_0x38d771){var _0x506aee={'ContactId':_0x38d771['id'],'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'from':(_0x38d771[_0x0eb6('0x9c')]||'')+'\x20'+(_0x38d771[_0x0eb6('0x9d')]||''),'customerIp':_0x2c92ea,'customerPort':_0x5dab6e[_0x0eb6('0x79')]['x-real-port']?_0x5dab6e[_0x0eb6('0x79')][_0x0eb6('0x9e')]:null,'referer':_0x5dab6e[_0x0eb6('0x48')]['referer'],'browserName':_0x3aeeb6[_0x0eb6('0x9f')][_0x0eb6('0x2a')]&&_0x3aeeb6[_0x0eb6('0x9f')][_0x0eb6('0xa0')]?util['format']('%s\x20%s',_0x3aeeb6['browser']['name'],_0x3aeeb6['browser'][_0x0eb6('0xa0')]):_0x0eb6('0xa1'),'browserVersion':_0x3aeeb6[_0x0eb6('0x9f')]['version']||_0x0eb6('0xa1'),'osName':util[_0x0eb6('0xa2')](_0x0eb6('0xa3'),_0x3aeeb6['os']['name'],_0x3aeeb6['os'][_0x0eb6('0xa0')]),'osVersion':_0x3aeeb6['os'][_0x0eb6('0xa0')],'deviceModel':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x31')]&&_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0xa5')]?util[_0x0eb6('0xa2')](_0x0eb6('0xa6'),_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x31')],_0x3aeeb6[_0x0eb6('0xa4')]['vendor'],_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x2f')]):null,'deviceVendor':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0xa5')],'deviceType':_0x3aeeb6[_0x0eb6('0xa4')][_0x0eb6('0x2f')],'formData':JSON['stringify'](_0x5dab6e['body'])};var _0xbcbee3={'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'closed':![]};if(_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')]){_0xbcbee3['threadId']=_0x5dab6e['body'][_0x0eb6('0xa7')];return db['ChatInteraction'][_0x0eb6('0x46')]({'where':_0xbcbee3})[_0x0eb6('0x13')](function(_0x2228dc){if(_0x2228dc){return[_0x2228dc,![]];}_0x506aee[_0x0eb6('0xa7')]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')];_0x506aee[_0x0eb6('0xa8')]=_0x5dab6e['body'][_0x0eb6('0xa8')];return db[_0x0eb6('0xa9')][_0x0eb6('0x47')](_0x506aee)[_0x0eb6('0x13')](function(_0x316c96){return[_0x316c96,!![]];});});}_0xbcbee3[_0x0eb6('0xaa')]=_0x38d771['id'];if(_0x5dab6e[_0x0eb6('0x48')]['interaction']&&_0x5dab6e['body'][_0x0eb6('0xab')]['id']){_0xbcbee3['id']=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xab')]['id'];return db[_0x0eb6('0xa9')][_0x0eb6('0x46')]({'where':_0xbcbee3})[_0x0eb6('0x13')](function(_0x2066e2){if(_0x2066e2){return[_0x2066e2,![]];}return db['ChatInteraction'][_0x0eb6('0x47')](_0x506aee)[_0x0eb6('0x13')](function(_0x15becb){return[_0x15becb,!![]];});});}return db['ChatInteraction']['create'](_0x506aee)[_0x0eb6('0x13')](function(_0xe73e24){return[_0xe73e24,!![]];});}})['spread'](function(_0x15317d,_0x8e72cf){if(_0x15317d){_0x40582c=_0x8e72cf;if(!_0x8e72cf){var _0x418d2e={'from':(_0x120843['contact'][_0x0eb6('0x9c')]||'')+'\x20'+(_0x120843[_0x0eb6('0x98')]['lastName']||'')};if(_0x5dab6e[_0x0eb6('0x48')]['threadId']&&_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')]&&_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xa7')]!=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')]){_0x418d2e[_0x0eb6('0xa7')]=_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xac')];}return _0x15317d[_0x0eb6('0x24')](_0x418d2e);}else{return _0x15317d;}}})[_0x0eb6('0x13')](function(_0x457671){_0x120843[_0x0eb6('0xab')]=_0x457671[_0x0eb6('0x26')]({'plain':!![]});_0x120843[_0x0eb6('0xab')][_0x0eb6('0xad')]=_0x40582c;if(_0x120843['interaction'][_0x0eb6('0xad')]){if(_0x120843['account']['autoclose']){_0x120843[_0x0eb6('0x91')]['push']({'id':0x0,'priority':_0x120843['applications'][_0x0eb6('0x39')]+0x1,'app':_0x0eb6('0xae'),'appdata':_0x0eb6('0xaf'),'interval':_0x0eb6('0xb0')});}}return db[_0x0eb6('0xb1')][_0x0eb6('0x47')]({'body':_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0x48')],'ChatWebsiteId':_0x5dab6e[_0x0eb6('0x4c')]['id'],'ChatInteractionId':_0x457671['id'],'direction':'in','ContactId':_0x120843[_0x0eb6('0x98')]['id'],'AttachmentId':_0x5dab6e[_0x0eb6('0x48')][_0x0eb6('0xb2')]});})[_0x0eb6('0x13')](function(_0x14b7f6){_0x120843[_0x0eb6('0x1a')]=_0x14b7f6;if(_0x120843[_0x0eb6('0xab')][_0x0eb6('0xb3')]){return db[_0x0eb6('0xb4')][_0x0eb6('0x46')]({'attributes':['id',_0x0eb6('0x2a')],'where':{'id':_0x120843['interaction']['UserId']}})[_0x0eb6('0x13')](function(_0x5df035){if(_0x5df035){_0x120843['applications'][_0x0eb6('0xb5')]({'id':0x0,'priority':0x0,'app':_0x0eb6('0xb6'),'appdata':_0x5df035[_0x0eb6('0x2a')]+','+(_0x120843[_0x0eb6('0x96')]['waitForTheAssignedAgent']||0xa),'interval':_0x0eb6('0xb0')});_0x120843['forcedOwnership']=!![];}return respondWithRpcPromise(_0x0eb6('0xb7'),_0x0eb6('0xb8'),_0x120843);});}return respondWithRpcPromise('Start',_0x0eb6('0xb8'),_0x120843);})[_0x0eb6('0x13')](function(_0xfaa49){respondWithRpcPromise(_0x0eb6('0xb9'),'EventManager',{'event':_0x0eb6('0x76'),'message':_0xfaa49},client9002);return _0xfaa49;})[_0x0eb6('0x13')](respondWithResult(_0x2827c0,null))[_0x0eb6('0x1c')](handleError(_0x2827c0,null));};exports[_0x0eb6('0xba')]=function(_0x51f686,_0x24055a){var _0x52f407,_0x29ffab,_0x3562c4;var _0x3513fc=[];var _0x2135a8={};var _0x312322=_0x51f686[_0x0eb6('0xbb')]||[];var _0xf4aae4=[];var _0x178968;return db[_0x0eb6('0x7d')][_0x0eb6('0x4d')]()['then'](function(_0x188494){if(!_0x188494){throw new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x7f'));}_0x3513fc=_['difference'](_[_0x0eb6('0x34')](_0x188494),[_0x0eb6('0x81'),'updatedAt',_0x0eb6('0x83'),_0x0eb6('0x84')]);if(_0x51f686['body']['id']){delete _0x51f686['body']['id'];}if(_[_0x0eb6('0x6e')](_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')])){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)['send'](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x87')));}if(_['isNil'](_0x51f686[_0x0eb6('0x48')]['body'])||_0x51f686[_0x0eb6('0x48')]['body']===''){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)[_0x0eb6('0x2b')](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0x88')));}if(_[_0x0eb6('0x6e')](_0x51f686['body'][_0x0eb6('0xbc')])){throw _0x24055a['status'](0x1f4)[_0x0eb6('0x2b')](new db['Sequelize']['ValidationError'](_0x0eb6('0xbd')+_0x3513fc));}if(!_['includes'](_0x3513fc,_0x51f686[_0x0eb6('0x48')][_0x0eb6('0xbc')])){throw _0x24055a[_0x0eb6('0x1e')](0x1f4)[_0x0eb6('0x2b')](new db[(_0x0eb6('0x86'))][(_0x0eb6('0x7e'))](_0x0eb6('0xbe')+_0x3513fc));}_0x2135a8[_0x51f686['body'][_0x0eb6('0xbc')]]=_0x51f686['body'][_0x0eb6('0x85')];})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x51f686[_0x0eb6('0x4c')]['id']},'include':[{'model':db[_0x0eb6('0xbf')],'as':_0x0eb6('0x8d')},{'model':db['MailAccount'],'as':_0x0eb6('0xc0')}]});})[_0x0eb6('0x13')](handleEntityNotFound(_0x24055a,null))[_0x0eb6('0x13')](function(_0xa641cb){if(_0xa641cb&&_0xa641cb[_0x0eb6('0x8d')]){_0x29ffab=_0xa641cb;var _0xd5b127=_[_0x0eb6('0xc')](_0x51f686[_0x0eb6('0x48')],{'firstName':_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')],'phone':_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')],'ListId':_0xa641cb[_0x0eb6('0x84')]});_0xd5b127[_0x51f686[_0x0eb6('0x48')]['mapKeyOffline']]=_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x85')];return db[_0x0eb6('0x7d')][_0x0eb6('0xc1')]({'where':_0x2135a8,'defaults':_0xd5b127});}})['spread'](function(_0x2055e5){if(_0x2055e5){_0x3562c4=_0x2055e5;var _0x185fcf=fs[_0x0eb6('0xc2')](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xc3')),'utf8');var _0x19f990=ejs[_0x0eb6('0xc4')](_0x185fcf,{'body':_[_0x0eb6('0xc5')](_0x51f686[_0x0eb6('0x48')][_0x0eb6('0x48')]),'bodyTitle':_0x29ffab[_0x0eb6('0xc6')]});return db[_0x0eb6('0xc7')][_0x0eb6('0x47')]({'body':_0x19f990,'ContactId':_0x2055e5['id'],'ChatWebsiteId':_0x29ffab['id']});}})[_0x0eb6('0x13')](function(_0x48428d){_0x178968=_0x48428d;if(_0x312322['length']){var _0x5bbe6a=_0x312322[_0x0eb6('0x32')](function(_0x27af42){return{'name':_0x27af42[_0x0eb6('0xc8')],'basename':_0x27af42[_0x0eb6('0x5d')],'type':_0x27af42[_0x0eb6('0xc9')],'ChatOfflineMessageId':_0x48428d['id']};});_0xf4aae4=_0x5bbe6a['map'](_0x486d83=>{var _0x473995={'filename':_0x486d83[_0x0eb6('0x2a')],'path':path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xca'),_0x0eb6('0xbb'),'attachments',_0x0eb6('0xcb'),_0x486d83['basename'])};return _0x473995;});if(!_0x29ffab['openNewInteraction']){return db[_0x0eb6('0xcc')][_0x0eb6('0xcd')](function(_0x5d3667){return db['Attachment']['bulkCreate'](_0x5bbe6a,{'transaction':_0x5d3667});});}}})['then'](function(){if(_0x178968){_0x52f407=_0x178968;return db[_0x0eb6('0xc0')][_0x0eb6('0x50')]({'where':{'active':!![]},'include':[{'model':db[_0x0eb6('0xce')],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x220def){if(_0x220def&&_0x220def['Smtp']&&_0x29ffab[_0x0eb6('0xcf')]&&_0x29ffab['forwardOfflineAddress']){var _0x2a476d={'tls':{'rejectUnauthorized':![]}};if(_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd1')]){_0x2a476d[_0x0eb6('0xd1')]=_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd1')];}else{_0x2a476d[_0x0eb6('0xd2')]=_0x220def[_0x0eb6('0xd0')]['host'];_0x2a476d['port']=_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd3')];_0x2a476d['secure']=_0x220def[_0x0eb6('0xd0')]['secure'];}if(_0x220def[_0x0eb6('0xd0')][_0x0eb6('0xd4')]){_0x2a476d['auth']={'user':_0x220def[_0x0eb6('0xd0')]['user'],'pass':_0x220def['Smtp'][_0x0eb6('0xd5')]};}return respondWithRpcPromise(_0x0eb6('0xd6'),_0x0eb6('0xd7'),{'account':_0x2a476d,'message':{'from':util[_0x0eb6('0xa2')](_0x0eb6('0xd8'),_0x220def[_0x0eb6('0x2a')],_0x220def[_0x0eb6('0xd9')]||_0x220def[_0x0eb6('0xd0')][_0x0eb6('0x49')]),'to':_0x29ffab[_0x0eb6('0xda')],'subject':_0x29ffab[_0x0eb6('0xdb')],'html':_0x52f407['body'],'attachments':_0xf4aae4}},client9003)[_0x0eb6('0x13')](function(){return _0x52f407;})['catch'](function(_0x54f5e5){console[_0x0eb6('0x18')](_0x54f5e5);});}})[_0x0eb6('0x13')](function(){if(_0x29ffab&&_0x29ffab[_0x0eb6('0xdc')]&&_0x29ffab[_0x0eb6('0xdd')]){var _0x4c9be1=[];if(_0x312322[_0x0eb6('0x39')]){_0x4c9be1=_0x312322['map'](function(_0x32e415){return{'name':_0x32e415[_0x0eb6('0xc8')],'basename':_0x32e415[_0x0eb6('0x5d')],'type':_0x32e415[_0x0eb6('0xc9')],'ChatOfflineMessageId':_0x178968['id']};});}var _0x441674;if(!_[_0x0eb6('0x6e')](_0x29ffab['subjectOffline'])){var _0x12bd3a=_[_0x0eb6('0x32')](_0x51f686[_0x0eb6('0x48')],function(_0x45e5a5){return _0x45e5a5;});var _0x498978=_[_0x0eb6('0xde')](_0x12bd3a)[0x0];var _0x13ff17=_[_0x0eb6('0xdf')](_0x498978,function(_0x6eda9){return _0x6eda9;});_0x441674=_0x13ff17[0x1][_0x29ffab[_0x0eb6('0xe0')]];}var _0x4590fb={'from':_0x3562c4[_0x0eb6('0xd9')],'firstName':_0x3562c4[_0x0eb6('0x9c')],'lastName':_0x3562c4['lastName'],'mapKey':'email','message':{'from':_0x3562c4['email'],'to':_0x29ffab['MailAccount'][_0x0eb6('0xd9')],'cc':'','subject':_['isNil'](_0x441674)?_0x29ffab['offlineMessageSubject']:_0x441674,'messageId':'','sentAt':new Date(),'attach':_0x4c9be1[_0x0eb6('0x39')],'attachments':_0x4c9be1,'originChannel':_0x0eb6('0xe1'),'ChatWebsiteId':_0x29ffab['id'],'ChatOfflineMessageId':_0x52f407['id'],'originTo':_0x29ffab[_0x0eb6('0xc0')][_0x0eb6('0xd9')]},'body':_0x52f407[_0x0eb6('0x48')]};var _0x23a36f={'account':{'id':_0x29ffab[_0x0eb6('0xdd')]},'body':_0x4590fb,'log':_0x0eb6('0xe2')};return respondWithRpcPromise(_0x0eb6('0xe2'),_0x0eb6('0xe3'),_0x23a36f,client9001)[_0x0eb6('0x13')](function(){return _0x52f407;})[_0x0eb6('0x1c')](function(_0x35f11d){console[_0x0eb6('0x18')](_0x35f11d);});}return;})[_0x0eb6('0x13')](function(){if(_0x52f407){return _0x52f407;}})[_0x0eb6('0x13')](respondWithResult(_0x24055a,null))[_0x0eb6('0x1c')](function(_0x1b06be){console[_0x0eb6('0x18')](_0x0eb6('0x1c'),_0x1b06be);for(var _0x399acc of _0x312322){var _0x2703bb=path[_0x0eb6('0x69')](config['root'],_0x0eb6('0xca'),'files',_0x0eb6('0xe4'),'offline-chat',_0x399acc[_0x0eb6('0x5d')]);fs_extra[_0x0eb6('0xe5')](_0x2703bb)[_0x0eb6('0x1c')](function(_0x19bded){console[_0x0eb6('0x18')](_0x0eb6('0xe6'),_0x2703bb,_0x19bded);});}});};exports[_0x0eb6('0xe7')]=function(_0x1f46d8,_0x250f62){return db[_0x0eb6('0xa9')][_0x0eb6('0x46')]({'where':{'id':_0x1f46d8[_0x0eb6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x250f62,null))[_0x0eb6('0x13')](function(_0x3b6e2c){if(_0x3b6e2c){return _0x3b6e2c[_0x0eb6('0xe7')](_0x1f46d8['body'][_0x0eb6('0x55')],_['omit'](_0x1f46d8[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{});}})[_0x0eb6('0x13')](respondWithResult(_0x250f62,null))[_0x0eb6('0x1c')](handleError(_0x250f62,null));};exports['getInteractions']=function(_0x39e8e5,_0x599b9d){var _0x4dc738={'raw':![],'where':{}};var _0x3a7803={};var _0x2961b4={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')]['findOne']({'where':{'id':_0x39e8e5['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x599b9d,null))[_0x0eb6('0x13')](function(_0x8689ac){if(_0x8689ac){_0x3a7803['model']=_[_0x0eb6('0x34')](db['ChatInteraction'][_0x0eb6('0x45')]);_0x3a7803[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x39e8e5[_0x0eb6('0x33')]);_0x3a7803[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x3a7803[_0x0eb6('0x31')],_0x3a7803[_0x0eb6('0x33')]);_0x4dc738[_0x0eb6('0x37')]=_['intersection'](_0x3a7803[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x39e8e5[_0x0eb6('0x33')]['fields']));_0x4dc738[_0x0eb6('0x37')]=_0x4dc738[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x4dc738['attributes']:_0x3a7803[_0x0eb6('0x31')];if(!_0x39e8e5['query']['hasOwnProperty'](_0x0eb6('0x3b'))){_0x4dc738[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x39e8e5['query'][_0x0eb6('0x22')]);_0x4dc738[_0x0eb6('0x1f')]=qs['offset'](_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x4dc738['order']=qs[_0x0eb6('0x3c')](_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x4dc738[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x39e8e5['query'],_0x3a7803[_0x0eb6('0x35')]));_0x4dc738[_0x0eb6('0x3f')]['ChatWebsiteId']=_0x8689ac['id'];if(_0x39e8e5[_0x0eb6('0x33')]['filter']){_0x4dc738[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x4dc738[_0x0eb6('0x3f')],{'$or':_[_0x0eb6('0x32')](_0x4dc738['attributes'],function(_0xde4714){var _0x13246a={};_0x13246a[_0xde4714]={'$like':'%'+_0x39e8e5[_0x0eb6('0x33')]['filter']+'%'};return _0x13246a;})});}_0x4dc738=_['merge']({},_0x4dc738,_0x39e8e5[_0x0eb6('0x41')]);return db['ChatInteraction']['count']({'where':_0x4dc738[_0x0eb6('0x3f')]})[_0x0eb6('0x13')](function(_0x52b8e0){_0x2961b4[_0x0eb6('0x21')]=_0x52b8e0;if(_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x4dc738['include']=[{'model':db[_0x0eb6('0x7d')],'as':'Contact','required':![]},{'model':db[_0x0eb6('0xb4')],'as':'Owner','attributes':[_0x0eb6('0x2a'),'fullname',_0x0eb6('0xe8')],'required':![]},{'model':db[_0x0eb6('0xe9')],'as':_0x0eb6('0xea'),'attributes':['id','name',_0x0eb6('0xeb')],'where':_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0xec')]?{'id':_0x39e8e5['query'][_0x0eb6('0xec')]}:undefined,'required':_0x39e8e5[_0x0eb6('0x33')][_0x0eb6('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0x0eb6('0x52')](_0x4dc738);})['then'](function(_0xfe3c7a){_0x2961b4[_0x0eb6('0x53')]=_0xfe3c7a;return _0x2961b4;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x599b9d,_0x4dc738))['catch'](handleError(_0x599b9d,null));};function iftimePromise(_0x54204c,_0x5b5881){return respondWithRpcPromise(_0x0eb6('0xed'),_0x0eb6('0xee'),{'command':_0x5b5881['timezone']?util['format'](_0x0eb6('0xef'),_0x54204c['interval'],_0x5b5881['timezone']):util[_0x0eb6('0xa2')]('iftime\x20%s',_0x54204c['interval'])},client9002)[_0x0eb6('0x13')](function(_0x517da7){var _0x3bf1ea=_0x517da7&&_0x517da7[_0x0eb6('0xf0')](_0x0eb6('0xf1'))>=0x0?!![]:![];logger[_0x0eb6('0x14')](_0x0eb6('0xf2'),_0x5b5881['id'],_0x54204c['id'],_0x54204c['interval'],_0x3bf1ea?_0x0eb6('0xf3'):_0x0eb6('0xf4'),_0x5b5881[_0x0eb6('0xf5')]?_0x5b5881[_0x0eb6('0xf5')]:_0x0eb6('0xf6'));return _0x3bf1ea;})[_0x0eb6('0x1c')](function(_0xed400){logger[_0x0eb6('0x18')](_0x0eb6('0xf2'),_0x5b5881['id'],_0x54204c['id'],_0x54204c[_0x0eb6('0xf7')],util[_0x0eb6('0xf8')](_0xed400,{'showHidden':![],'depth':null}),_0x5b5881['timezone']?_0x5b5881['timezone']:_0x0eb6('0xf6'));return![];});}exports['getSnippet']=function(_0x3a140e,_0x54b58a){var _0x552d99=0x0;var _0x3349e0=0x0;var _0x5165fc=![];var _0x65a91e;var _0x488941;return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'where':{'id':_0x3a140e[_0x0eb6('0x4c')]['id']},'include':[{'model':db['Interval'],'as':_0x0eb6('0xf9'),'include':[{'model':db[_0x0eb6('0xf9')],'as':_0x0eb6('0xfa'),'attributes':['id',_0x0eb6('0xf7')],'raw':!![]}]}]})[_0x0eb6('0x13')](handleEntityNotFound(_0x54b58a,null))[_0x0eb6('0x13')](function(_0x43a456){if(_0x43a456){_0x65a91e=_0x43a456;return _0x43a456[_0x0eb6('0xfb')]({'raw':!![]});}})[_0x0eb6('0x13')](function(_0xd4161b){if(_0x65a91e){if(_0xd4161b){_0x488941=_0xd4161b;}}return require(_0x0eb6('0x65'))[_0x0eb6('0x66')]();})[_0x0eb6('0x13')](function(_0x29c06c){if(_0x29c06c){_0x3349e0=_0x29c06c[_0x0eb6('0xfc')];_0x5165fc=_0x29c06c[_0x0eb6('0x67')];}})[_0x0eb6('0x13')](function(){return db[_0x0eb6('0xa9')][_0x0eb6('0x21')]({'where':{'closed':![]}});})[_0x0eb6('0x13')](function(_0x34c650){_0x552d99=_0x34c650;if(_0x3349e0&&_0x34c650>_0x3349e0){return db['License'][_0x0eb6('0x50')]({'where':{'id':0x1}})['then'](function(_0x185bf1){if(_0x185bf1){_0x185bf1[_0x0eb6('0xfd')](_0x0eb6('0xfe'));}});}})['then'](function(){if(_0x65a91e[_0x0eb6('0xf9')]&&_0x65a91e[_0x0eb6('0xf9')][_0x0eb6('0xfa')]){var _0x18c2ed=[];for(var _0x4c7e2f=0x0;_0x4c7e2f<_0x65a91e[_0x0eb6('0xf9')][_0x0eb6('0xfa')][_0x0eb6('0x39')];_0x4c7e2f++){var _0x270a3f=_0x65a91e[_0x0eb6('0xf9')]['Intervals'][_0x4c7e2f][_0x0eb6('0x26')]({'plain':!![]});_0x18c2ed[_0x0eb6('0xff')](iftimePromise(_0x270a3f,_0x65a91e));}return BPromise[_0x0eb6('0x100')](_0x18c2ed)[_0x0eb6('0x13')](function(_0x327d88){return _[_0x0eb6('0x101')](_0x327d88);});}else{return!![];}})[_0x0eb6('0x13')](function(_0x5a9888){var _0x47189b=fs['readFileSync'](path[_0x0eb6('0x69')](config['root'],_0x0eb6('0x102')),_0x0eb6('0x103'));var _0x2f43e5={'remote':_0x65a91e[_0x0eb6('0x104')],'query':querystring[_0x0eb6('0x17')](_[_0x0eb6('0x40')](_0x65a91e[_0x0eb6('0x26')]({'plain':!![]}),{'customerIp':_0x3a140e[_0x0eb6('0x79')][_0x0eb6('0x9b')]||_0x3a140e[_0x0eb6('0x79')]['x-real-ip']||_0x3a140e['connection']['remoteAddress']||_0x3a140e['ip'],'referer':_0x3a140e['headers'][_0x0eb6('0x105')],'openedInteractions':_0x552d99,'maxInteractions':_0x3349e0,'virtual':_0x5165fc[_0x0eb6('0xfc')],'online':_0x5a9888,'custom':_0x5165fc}))['replace'](/'/g,'\x5c\x27')};_0x54b58a[_0x0eb6('0x2b')](ejs[_0x0eb6('0xc4')](Mustache['render'](_0x47189b,_0x2f43e5),{'proactiveActions':_0x488941,'alignment':_0x65a91e[_0x0eb6('0x106')],'verticalAlignment':_0x65a91e[_0x0eb6('0x107')],'div_color':_0x65a91e[_0x0eb6('0xeb')],'labelText':_0x65a91e['labelText'],'text_color':_0x65a91e[_0x0eb6('0x108')],'button_color':_0x65a91e[_0x0eb6('0x109')],'background_color':_0x65a91e[_0x0eb6('0x10a')]}));})[_0x0eb6('0x1c')](handleError(_0x54b58a,null));};exports[_0x0eb6('0x10b')]=function(_0xc64b06,_0x3e1c5a){var _0x5d2c58=_0xc64b06[_0x0eb6('0x4c')]['id'];var _0x445d5a=_0xc64b06[_0x0eb6('0x48')];var _0x39c4fc=0xc8;var _0xfe5cdf=null;return db['sequelize'][_0x0eb6('0xcd')]({'isolationLevel':db[_0x0eb6('0xcc')][_0x0eb6('0x10c')][_0x0eb6('0x10d')][_0x0eb6('0x10e')]},function(_0xc7d897){return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x5d2c58},'transaction':_0xc7d897})[_0x0eb6('0x13')](function(_0x4b7405){if(_0x4b7405){return db[_0x0eb6('0x90')][_0x0eb6('0x25')]({'where':{'ChatWebsiteId':_0x5d2c58},'transaction':_0xc7d897})[_0x0eb6('0x13')](function(){var _0x1d079a=_['map'](_0x445d5a,function(_0x4ecf7d){_0x4ecf7d['ChatWebsiteId']=_0x5d2c58;return _0x4ecf7d;});return db[_0x0eb6('0x90')][_0x0eb6('0x10f')](_0x1d079a,{'transaction':_0xc7d897});});}else{_0x39c4fc=0x194;_0xfe5cdf=[];}});})[_0x0eb6('0x13')](function(){if(_0x39c4fc!==0x194){return db[_0x0eb6('0x90')][_0x0eb6('0x110')]({'where':{'ChatWebsiteId':_0x5d2c58},'order':_0x0eb6('0x94')})['then'](function(_0x13ec7e){_0xfe5cdf=_0x13ec7e;});}})[_0x0eb6('0x1c')](function(_0x31f0d8){_0x39c4fc=0x1f4;logger[_0x0eb6('0x18')](_0x31f0d8[_0x0eb6('0x29')]);if(_0x31f0d8[_0x0eb6('0x2a')]){delete _0x31f0d8[_0x0eb6('0x2a')];}_0xfe5cdf=_0x31f0d8;})[_0x0eb6('0x111')](function(){if(_0xfe5cdf===null){_0x3e1c5a[_0x0eb6('0x112')](_0x39c4fc);}else{if(_0x39c4fc===0x1f4){_0x3e1c5a['status'](_0x39c4fc)['send'](_0xfe5cdf);}else{_0x3e1c5a[_0x0eb6('0x1e')](_0x39c4fc)[_0x0eb6('0x113')](_0xfe5cdf);}}});};exports[_0x0eb6('0x114')]=function(_0x5e7645,_0x4c2e8e){var _0x1a2c5b={};var _0x4ee294={};var _0x1fea5d;var _0x1909e9;return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x5e7645['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x4c2e8e,null))[_0x0eb6('0x13')](function(_0x3ffa36){if(_0x3ffa36){_0x1fea5d=_0x3ffa36;_0x4ee294['model']=_['keys'](db[_0x0eb6('0x90')][_0x0eb6('0x45')]);_0x4ee294[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x5e7645[_0x0eb6('0x33')]);_0x4ee294[_0x0eb6('0x35')]=_['intersection'](_0x4ee294[_0x0eb6('0x31')],_0x4ee294[_0x0eb6('0x33')]);_0x1a2c5b[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x4ee294[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x1a2c5b[_0x0eb6('0x37')]=_0x1a2c5b[_0x0eb6('0x37')]['length']?_0x1a2c5b[_0x0eb6('0x37')]:_0x4ee294[_0x0eb6('0x31')];_0x1a2c5b['order']=qs[_0x0eb6('0x3c')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x1a2c5b[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x5e7645[_0x0eb6('0x33')],_0x4ee294['filters']));if(_0x5e7645['query']['filter']){_0x1a2c5b[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x1a2c5b[_0x0eb6('0x3f')],{'$or':_[_0x0eb6('0x32')](_0x1a2c5b[_0x0eb6('0x37')],function(_0x306db1){var _0x528cca={};_0x528cca[_0x306db1]={'$like':'%'+_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x528cca;})});}_0x1a2c5b=_[_0x0eb6('0x40')]({},_0x1a2c5b,_0x5e7645[_0x0eb6('0x41')]);return _0x1fea5d['getApplications'](_0x1a2c5b);}})[_0x0eb6('0x13')](function(_0x3869ef){if(_0x3869ef){_0x1909e9=_0x3869ef[_0x0eb6('0x39')];if(!_0x5e7645['query']['hasOwnProperty'](_0x0eb6('0x3b'))){_0x1a2c5b['limit']=qs[_0x0eb6('0x22')](_0x5e7645[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1a2c5b[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x5e7645[_0x0eb6('0x33')]['offset']);}return _0x1fea5d['getApplications'](_0x1a2c5b);}})[_0x0eb6('0x13')](function(_0x5c4171){if(_0x5c4171){return _0x5c4171?{'count':_0x1909e9,'rows':_0x5c4171}:null;}})['then'](respondWithResult(_0x4c2e8e,null))[_0x0eb6('0x1c')](handleError(_0x4c2e8e,null));};exports[_0x0eb6('0x115')]=function(_0x54df33,_0x50a73c){return db[_0x0eb6('0x116')]['find']({'where':{'id':_0x54df33['params']['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x50a73c,null))[_0x0eb6('0x13')](function(_0x4ad502){if(_0x4ad502){return _0x4ad502[_0x0eb6('0x115')](_0x54df33[_0x0eb6('0x48')]['ids'],_[_0x0eb6('0x117')](_0x54df33[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{});}})['then'](respondWithResult(_0x50a73c,null))[_0x0eb6('0x1c')](handleError(_0x50a73c,null));};exports['getProactiveActions']=function(_0x49a403,_0x2a33ff){var _0x3a5c26={};var _0x3a4e03={};var _0x1b1838;var _0x491555;return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x49a403[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x2a33ff,null))[_0x0eb6('0x13')](function(_0x13a0aa){if(_0x13a0aa){_0x1b1838=_0x13a0aa;_0x3a4e03[_0x0eb6('0x31')]=_[_0x0eb6('0x34')](db[_0x0eb6('0x118')][_0x0eb6('0x45')]);_0x3a4e03[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x49a403[_0x0eb6('0x33')]);_0x3a4e03[_0x0eb6('0x35')]=_['intersection'](_0x3a4e03[_0x0eb6('0x31')],_0x3a4e03[_0x0eb6('0x33')]);_0x3a5c26[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x3a4e03[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x49a403['query'][_0x0eb6('0x38')]));_0x3a5c26[_0x0eb6('0x37')]=_0x3a5c26[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x3a5c26[_0x0eb6('0x37')]:_0x3a4e03['model'];_0x3a5c26[_0x0eb6('0x58')]=qs['sort'](_0x49a403[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x3a5c26[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x49a403['query'],_0x3a4e03['filters']));if(_0x49a403['query']['filter']){_0x3a5c26[_0x0eb6('0x3f')]=_['merge'](_0x3a5c26['where'],{'$or':_['map'](_0x3a5c26[_0x0eb6('0x37')],function(_0xf971f5){var _0x243fac={};_0x243fac[_0xf971f5]={'$like':'%'+_0x49a403[_0x0eb6('0x33')]['filter']+'%'};return _0x243fac;})});}_0x3a5c26=_[_0x0eb6('0x40')]({},_0x3a5c26,_0x49a403[_0x0eb6('0x41')]);return _0x1b1838[_0x0eb6('0xfb')](_0x3a5c26);}})[_0x0eb6('0x13')](function(_0x5ad5d0){if(_0x5ad5d0){_0x491555=_0x5ad5d0[_0x0eb6('0x39')];if(!_0x49a403[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x3a5c26[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x49a403['query']['limit']);_0x3a5c26[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x49a403[_0x0eb6('0x33')]['offset']);}return _0x1b1838['getProactiveActions'](_0x3a5c26);}})[_0x0eb6('0x13')](function(_0x528914){if(_0x528914){return _0x528914?{'count':_0x491555,'rows':_0x528914}:null;}})[_0x0eb6('0x13')](respondWithResult(_0x2a33ff,null))[_0x0eb6('0x1c')](handleError(_0x2a33ff,null));};exports[_0x0eb6('0x119')]=function(_0x283a1d,_0x1a3824){var _0x423581=_0x283a1d['query']['online']===_0x0eb6('0x11a')?_0x0eb6('0x11b'):'onlineForm';return db[_0x0eb6('0x2e')][_0x0eb6('0x46')]({'attributes':['id',_0x423581],'where':{'id':_0x283a1d[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x1a3824,null))[_0x0eb6('0x13')](function(_0x3ce015){if(_0x3ce015){var _0x121d55=_0x3ce015[_0x423581];var _0x10518e=_0x121d55&&_0x121d55[_0x0eb6('0x11c')]?_0x121d55[_0x0eb6('0x11c')]:[];_0x1a3824[_0x0eb6('0x2b')]({'fromKey':_['isNil'](_0x121d55[_0x0eb6('0x11d')])?undefined:_0x121d55['fromKey'],'count':_0x10518e[_0x0eb6('0x39')],'rows':_0x10518e});}})[_0x0eb6('0x1c')](handleError(_0x1a3824,null));};exports[_0x0eb6('0x11e')]=function(_0x219d95,_0x31322e){var _0x1c6ff9={'raw':![],'where':{}};var _0x5804b6={};var _0x1d8923={'count':0x0,'rows':[]};return db[_0x0eb6('0x2e')][_0x0eb6('0x50')]({'where':{'id':_0x219d95[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x31322e,null))[_0x0eb6('0x13')](function(_0x478b75){if(_0x478b75){_0x5804b6['model']=_['keys'](db[_0x0eb6('0xc7')]['rawAttributes']);_0x5804b6[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x219d95[_0x0eb6('0x33')]);_0x5804b6[_0x0eb6('0x35')]=_[_0x0eb6('0x36')](_0x5804b6[_0x0eb6('0x31')],_0x5804b6[_0x0eb6('0x33')]);_0x1c6ff9[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x5804b6[_0x0eb6('0x31')],qs[_0x0eb6('0x38')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x38')]));_0x1c6ff9[_0x0eb6('0x37')]=_0x1c6ff9[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x1c6ff9[_0x0eb6('0x37')]:_0x5804b6['model'];if(!_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x1c6ff9[_0x0eb6('0x22')]=qs[_0x0eb6('0x22')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x1c6ff9['offset']=qs[_0x0eb6('0x1f')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x1f')]);}_0x1c6ff9[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x1c6ff9[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x219d95[_0x0eb6('0x33')],_0x5804b6['filters']));_0x1c6ff9[_0x0eb6('0x3f')][_0x0eb6('0x4e')]=_0x478b75['id'];if(_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3e')]){_0x1c6ff9['where']=_[_0x0eb6('0x40')](_0x1c6ff9['where'],{'$or':_[_0x0eb6('0x32')](_0x1c6ff9['attributes'],function(_0x21347c){var _0x1c04b1={};_0x1c04b1[_0x21347c]={'$like':'%'+_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x1c04b1;})});}_0x1c6ff9=_[_0x0eb6('0x40')]({},_0x1c6ff9,_0x219d95[_0x0eb6('0x41')]);return db[_0x0eb6('0xc7')]['count']({'where':_0x1c6ff9[_0x0eb6('0x3f')]})['then'](function(_0x7abfc9){_0x1d8923[_0x0eb6('0x21')]=_0x7abfc9;if(_0x219d95[_0x0eb6('0x33')][_0x0eb6('0x51')]){_0x1c6ff9['include']=[{'all':!![]}];}else{_0x1c6ff9['include']=[{'model':db[_0x0eb6('0x7d')],'as':'Contact','required':![]},{'model':db[_0x0eb6('0x11f')],'as':_0x0eb6('0x120'),'required':![]}];}return db[_0x0eb6('0xc7')][_0x0eb6('0x52')](_0x1c6ff9);})['then'](function(_0x3df815){_0x1d8923[_0x0eb6('0x53')]=_0x3df815;return _0x1d8923;});}})[_0x0eb6('0x13')](respondWithFilteredResult(_0x31322e,_0x1c6ff9))[_0x0eb6('0x1c')](handleError(_0x31322e,null));};exports[_0x0eb6('0x121')]=function(_0x3c8734,_0x251738){return db[_0x0eb6('0x2e')]['find']({'where':{'id':_0x3c8734[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x251738,null))[_0x0eb6('0x13')](function(_0xc4976e){if(_0xc4976e){return _0xc4976e[_0x0eb6('0x121')](_0x3c8734[_0x0eb6('0x48')]['ids'],_[_0x0eb6('0x117')](_0x3c8734[_0x0eb6('0x48')],[_0x0eb6('0x55'),'id'])||{})[_0x0eb6('0x122')](function(_0x3fee27){for(var _0x2f6c37=0x0;_0x2f6c37<_0x3c8734[_0x0eb6('0x48')][_0x0eb6('0x55')][_0x0eb6('0x39')];_0x2f6c37+=0x1){socket[_0x0eb6('0x123')](_0x0eb6('0x124'),{'UserId':Number(_0x3c8734['body'][_0x0eb6('0x55')][_0x2f6c37]),'ChatWebsiteId':Number(_0x3c8734[_0x0eb6('0x4c')]['id'])});}return _0x3fee27;});}})[_0x0eb6('0x13')](respondWithResult(_0x251738,null))[_0x0eb6('0x1c')](handleError(_0x251738,null));};exports[_0x0eb6('0x125')]=function(_0x4887a6,_0x28eaf2){return db['ChatWebsite']['find']({'where':{'id':_0x4887a6[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x28eaf2,null))['then'](function(_0x341ea3){if(_0x341ea3){return _0x341ea3[_0x0eb6('0x125')](_0x4887a6[_0x0eb6('0x33')][_0x0eb6('0x55')])[_0x0eb6('0x13')](function(){if(_['isArray'](_0x4887a6[_0x0eb6('0x33')]['ids'])){for(var _0x20cb9e=0x0;_0x20cb9e<_0x4887a6[_0x0eb6('0x33')][_0x0eb6('0x55')][_0x0eb6('0x39')];_0x20cb9e+=0x1){socket[_0x0eb6('0x123')](_0x0eb6('0x126'),{'UserId':Number(_0x4887a6['query']['ids'][_0x20cb9e]),'ChatWebsiteId':Number(_0x4887a6[_0x0eb6('0x4c')]['id'])});}}else{socket['emit'](_0x0eb6('0x126'),{'UserId':Number(_0x4887a6[_0x0eb6('0x33')]['ids']),'ChatWebsiteId':Number(_0x4887a6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x28eaf2,null))['catch'](handleError(_0x28eaf2,null));};exports[_0x0eb6('0x127')]=function(_0x4d6562,_0x3e1bea){var _0x58c4fa={};var _0x253b26={};var _0x13418a;var _0x53f113;return db['ChatWebsite'][_0x0eb6('0x50')]({'where':{'id':_0x4d6562[_0x0eb6('0x4c')]['id']}})[_0x0eb6('0x13')](handleEntityNotFound(_0x3e1bea,null))[_0x0eb6('0x13')](function(_0x5d48cf){if(_0x5d48cf){_0x13418a=_0x5d48cf;_0x253b26[_0x0eb6('0x31')]=_['keys'](db[_0x0eb6('0xb4')][_0x0eb6('0x45')]);_0x253b26[_0x0eb6('0x33')]=_[_0x0eb6('0x34')](_0x4d6562[_0x0eb6('0x33')]);_0x253b26[_0x0eb6('0x35')]=_['intersection'](_0x253b26['model'],_0x253b26[_0x0eb6('0x33')]);_0x58c4fa[_0x0eb6('0x37')]=_[_0x0eb6('0x36')](_0x253b26['model'],qs['fields'](_0x4d6562['query'][_0x0eb6('0x38')]));_0x58c4fa[_0x0eb6('0x37')]=_0x58c4fa[_0x0eb6('0x37')][_0x0eb6('0x39')]?_0x58c4fa['attributes']:_0x253b26[_0x0eb6('0x31')];_0x58c4fa[_0x0eb6('0x58')]=qs[_0x0eb6('0x3c')](_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3c')]);_0x58c4fa[_0x0eb6('0x3f')]=qs[_0x0eb6('0x35')](_[_0x0eb6('0x3d')](_0x4d6562['query'],_0x253b26['filters']));if(_0x4d6562[_0x0eb6('0x33')]['filter']){_0x58c4fa[_0x0eb6('0x3f')]=_[_0x0eb6('0x40')](_0x58c4fa[_0x0eb6('0x3f')],{'$or':_['map'](_0x58c4fa[_0x0eb6('0x37')],function(_0x17897f){var _0x2f08d3={};_0x2f08d3[_0x17897f]={'$like':'%'+_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3e')]+'%'};return _0x2f08d3;})});}_0x58c4fa=_[_0x0eb6('0x40')]({},_0x58c4fa,_0x4d6562['options']);return _0x13418a[_0x0eb6('0x127')](_0x58c4fa);}})[_0x0eb6('0x13')](function(_0x44b9e7){if(_0x44b9e7){_0x53f113=_0x44b9e7[_0x0eb6('0x39')];if(!_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x3a')](_0x0eb6('0x3b'))){_0x58c4fa['limit']=qs[_0x0eb6('0x22')](_0x4d6562[_0x0eb6('0x33')][_0x0eb6('0x22')]);_0x58c4fa[_0x0eb6('0x1f')]=qs[_0x0eb6('0x1f')](_0x4d6562['query'][_0x0eb6('0x1f')]);}return _0x13418a[_0x0eb6('0x127')](_0x58c4fa);}})[_0x0eb6('0x13')](function(_0x1380ec){if(_0x1380ec){return _0x1380ec?{'count':_0x53f113,'rows':_0x1380ec}:null;}})['then'](respondWithResult(_0x3e1bea,null))[_0x0eb6('0x1c')](handleError(_0x3e1bea,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 1c8cdc8..81726b2 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 _0x447b=['update','remove','emit','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x51a945,_0x2d809c){var _0x50f0bd=function(_0x87fba5){while(--_0x87fba5){_0x51a945['push'](_0x51a945['shift']());}};_0x50f0bd(++_0x2d809c);}(_0x447b,0xe4));var _0xb447=function(_0x5139f6,_0x33c8b7){_0x5139f6=_0x5139f6-0x0;var _0x36b77f=_0x447b[_0x5139f6];return _0x36b77f;};'use strict';var EventEmitter=require(_0xb447('0x0'));var ChatWebsite=require(_0xb447('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb447('0x2')](0x0);var events={'afterCreate':_0xb447('0x3'),'afterUpdate':_0xb447('0x4'),'afterDestroy':_0xb447('0x5')};function emitEvent(_0xf3dd0a){return function(_0xf8a88b,_0x161c5d,_0x4161c2){ChatWebsiteEvents[_0xb447('0x6')](_0xf3dd0a+':'+_0xf8a88b['id'],_0xf8a88b);ChatWebsiteEvents[_0xb447('0x6')](_0xf3dd0a,_0xf8a88b);_0x4161c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xb447('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x6b4e=['emit','hasOwnProperty','hook','exports','../../mysqldb','remove'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x2c4eb4,_0x42bc84){_0x2c4eb4=_0x2c4eb4-0x0;var _0x2f711c=_0x6b4e[_0x2c4eb4];return _0x2f711c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xe6b4('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe6b4('0x1')};function emitEvent(_0x3be9b1){return function(_0x1aedc5,_0x344db1,_0x436fc0){ChatWebsiteEvents[_0xe6b4('0x2')](_0x3be9b1+':'+_0x1aedc5['id'],_0x1aedc5);ChatWebsiteEvents['emit'](_0x3be9b1,_0x1aedc5);_0x436fc0(null);};}for(var e in events){if(events[_0xe6b4('0x3')](e)){var event=events[e];ChatWebsite[_0xe6b4('0x4')](e,emitEvent(event));}}module[_0xe6b4('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index e8c0ad0..0f1256a 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 _0xd032=['ChatWebsite','chat_websites','util','../../config/logger','request-promise','rimraf','./chatWebsite.attributes','exports','define'];(function(_0x33e4f4,_0x17055c){var _0xf5684c=function(_0x5152df){while(--_0x5152df){_0x33e4f4['push'](_0x33e4f4['shift']());}};_0xf5684c(++_0x17055c);}(_0xd032,0x146));var _0x2d03=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xd032[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var util=require(_0x2d03('0x0'));var logger=require(_0x2d03('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d03('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d03('0x3'));var config=require('../../config/environment');var attributes=require(_0x2d03('0x4'));module[_0x2d03('0x5')]=function(_0x28eca2,_0x31b93e){return _0x28eca2[_0x2d03('0x6')](_0x2d03('0x7'),attributes,{'tableName':_0x2d03('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe07e=['path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api','moment','request-promise'];(function(_0x579dca,_0x31321c){var _0x200848=function(_0x17d9e3){while(--_0x17d9e3){_0x579dca['push'](_0x579dca['shift']());}};_0x200848(++_0x31321c);}(_0xe07e,0x127));var _0xee07=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xe07e[_0x2b45b5];return _0x1d9c06;};'use strict';var _=require('lodash');var util=require(_0xee07('0x0'));var logger=require(_0xee07('0x1'))(_0xee07('0x2'));var moment=require(_0xee07('0x3'));var BPromise=require('bluebird');var rp=require(_0xee07('0x4'));var fs=require('fs');var path=require(_0xee07('0x5'));var rimraf=require('rimraf');var config=require(_0xee07('0x6'));var attributes=require(_0xee07('0x7'));module[_0xee07('0x8')]=function(_0x3f8c95,_0x915313){return _0x3f8c95[_0xee07('0x9')](_0xee07('0xa'),attributes,{'tableName':_0xee07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 6d2b0b1..fd31c58 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 _0x9975=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','request','then','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatWebsite,\x20%s,\x20%s','message','info'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x9975,0x65));var _0x5997=function(_0x347f2b,_0x449c7f){_0x347f2b=_0x347f2b-0x0;var _0x12e3e7=_0x9975[_0x347f2b];return _0x12e3e7;};'use strict';var _=require(_0x5997('0x0'));var util=require(_0x5997('0x1'));var moment=require(_0x5997('0x2'));var BPromise=require(_0x5997('0x3'));var rs=require(_0x5997('0x4'));var fs=require('fs');var Redis=require(_0x5997('0x5'));var db=require(_0x5997('0x6'))['db'];var utils=require(_0x5997('0x7'));var logger=require('../../config/logger')(_0x5997('0x8'));var config=require('../../config/environment');var jayson=require(_0x5997('0x9'));var client=jayson[_0x5997('0xa')][_0x5997('0xb')]({'port':0x232a});config[_0x5997('0xc')]=_[_0x5997('0xd')](config[_0x5997('0xc')],{'host':_0x5997('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5997('0xc')]));require(_0x5997('0xf'))['register'](socket);function respondWithRpcPromise(_0x5c769a,_0x5a47ed,_0x24ed9e){return new BPromise(function(_0x1e88ed,_0xf5a6ba){return client[_0x5997('0x10')](_0x5c769a,_0x24ed9e)[_0x5997('0x11')](function(_0x5accb7){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5a47ed,'request\x20sent');logger['debug'](_0x5997('0x12'),_0x5a47ed,_0x5997('0x13'),JSON['stringify'](_0x5accb7));if(_0x5accb7[_0x5997('0x14')]){if(_0x5accb7[_0x5997('0x14')]['code']===0x1f4){logger[_0x5997('0x14')](_0x5997('0x15'),_0x5a47ed,_0x5accb7['error']['message']);return _0xf5a6ba(_0x5accb7[_0x5997('0x14')][_0x5997('0x16')]);}logger[_0x5997('0x14')](_0x5997('0x15'),_0x5a47ed,_0x5accb7[_0x5997('0x14')]['message']);return _0x1e88ed(_0x5accb7[_0x5997('0x14')][_0x5997('0x16')]);}else{logger[_0x5997('0x17')](_0x5997('0x15'),_0x5a47ed,_0x5997('0x13'));_0x1e88ed(_0x5accb7[_0x5997('0x18')]['message']);}})['catch'](function(_0x3b998a){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5a47ed,_0x3b998a);_0xf5a6ba(_0x3b998a);});});}
\ No newline at end of file
+var _0x4567=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1c1f82,_0x5ec1b8){var _0x58e07f=function(_0x4e4cf4){while(--_0x4e4cf4){_0x1c1f82['push'](_0x1c1f82['shift']());}};_0x58e07f(++_0x5ec1b8);}(_0x4567,0x1b2));var _0x7456=function(_0x14a340,_0xb96778){_0x14a340=_0x14a340-0x0;var _0x48d1f0=_0x4567[_0x14a340];return _0x48d1f0;};'use strict';var _=require(_0x7456('0x0'));var util=require(_0x7456('0x1'));var moment=require('moment');var BPromise=require(_0x7456('0x2'));var rs=require(_0x7456('0x3'));var fs=require('fs');var Redis=require(_0x7456('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7456('0x5'));var logger=require(_0x7456('0x6'))(_0x7456('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7456('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7456('0x9')],{'host':_0x7456('0xa'),'port':0x18eb});var socket=require(_0x7456('0xb'))(new Redis(config['redis']));require(_0x7456('0xc'))['register'](socket);function respondWithRpcPromise(_0xfe7422,_0x2a388a,_0x2beff8){return new BPromise(function(_0x2e7ef3,_0x7b7129){return client[_0x7456('0xd')](_0xfe7422,_0x2beff8)['then'](function(_0x2d0b6d){logger[_0x7456('0xe')](_0x7456('0xf'),_0x2a388a,_0x7456('0x10'));logger[_0x7456('0x11')](_0x7456('0x12'),_0x2a388a,_0x7456('0x10'),JSON['stringify'](_0x2d0b6d));if(_0x2d0b6d[_0x7456('0x13')]){if(_0x2d0b6d['error'][_0x7456('0x14')]===0x1f4){logger['error'](_0x7456('0xf'),_0x2a388a,_0x2d0b6d[_0x7456('0x13')]['message']);return _0x7b7129(_0x2d0b6d[_0x7456('0x13')][_0x7456('0x15')]);}logger[_0x7456('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2a388a,_0x2d0b6d['error']['message']);return _0x2e7ef3(_0x2d0b6d[_0x7456('0x13')]['message']);}else{logger[_0x7456('0xe')](_0x7456('0xf'),_0x2a388a,_0x7456('0x10'));_0x2e7ef3(_0x2d0b6d[_0x7456('0x16')][_0x7456('0x15')]);}})[_0x7456('0x17')](function(_0x80f93){logger[_0x7456('0x13')](_0x7456('0xf'),_0x2a388a,_0x80f93);_0x7b7129(_0x80f93);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 60e85db..fa5fa82 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 _0x152d=['./chatWebsite.events','save','remove','emit','removeListener','length','chatWebsite:'];(function(_0x2882a0,_0x42711b){var _0x5ecb65=function(_0x44633b){while(--_0x44633b){_0x2882a0['push'](_0x2882a0['shift']());}};_0x5ecb65(++_0x42711b);}(_0x152d,0x11f));var _0xd152=function(_0x270c3c,_0x4f3db9){_0x270c3c=_0x270c3c-0x0;var _0x39c75e=_0x152d[_0x270c3c];return _0x39c75e;};'use strict';var ChatWebsiteEvents=require(_0xd152('0x0'));var events=[_0xd152('0x1'),_0xd152('0x2'),'update'];function createListener(_0x50907a,_0x4a11a9){return function(_0x20111b){_0x4a11a9[_0xd152('0x3')](_0x50907a,_0x20111b);};}function removeListener(_0x2014d0,_0x36afb4){return function(){ChatWebsiteEvents[_0xd152('0x4')](_0x2014d0,_0x36afb4);};}exports['register']=function(_0x5fe8c4){for(var _0x43bab9=0x0,_0x37ca66=events[_0xd152('0x5')];_0x43bab9<_0x37ca66;_0x43bab9++){var _0x19a7e4=events[_0x43bab9];var _0x5b8e49=createListener(_0xd152('0x6')+_0x19a7e4,_0x5fe8c4);ChatWebsiteEvents['on'](_0x19a7e4,_0x5b8e49);}};
\ No newline at end of file
+var _0x8686=['removeListener','register','length','./chatWebsite.events','save','remove','update','emit'];(function(_0x5af522,_0x2b3022){var _0x2eec5f=function(_0xd2780f){while(--_0xd2780f){_0x5af522['push'](_0x5af522['shift']());}};_0x2eec5f(++_0x2b3022);}(_0x8686,0x7b));var _0x6868=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x8686[_0x2afbb0];return _0x411ff2;};'use strict';var ChatWebsiteEvents=require(_0x6868('0x0'));var events=[_0x6868('0x1'),_0x6868('0x2'),_0x6868('0x3')];function createListener(_0x38f9df,_0x4bfb5e){return function(_0x4bdb37){_0x4bfb5e[_0x6868('0x4')](_0x38f9df,_0x4bdb37);};}function removeListener(_0x556b13,_0x383aab){return function(){ChatWebsiteEvents[_0x6868('0x5')](_0x556b13,_0x383aab);};}exports[_0x6868('0x6')]=function(_0x3fcd8c){for(var _0x200737=0x0,_0x53da50=events[_0x6868('0x7')];_0x200737<_0x53da50;_0x200737++){var _0x58298b=events[_0x200737];var _0x9556e1=createListener('chatWebsite:'+_0x58298b,_0x3fcd8c);ChatWebsiteEvents['on'](_0x58298b,_0x9556e1);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 7d3259f..1b17ffd 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 _0xe83c=['notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','create','post','/:id/canned_answers','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','addAvatar','server/files/images/avatars/','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify'];(function(_0x34ee23,_0x524647){var _0x226c2a=function(_0x37c737){while(--_0x37c737){_0x34ee23['push'](_0x34ee23['shift']());}};_0x226c2a(++_0x524647);}(_0xe83c,0x181));var _0xce83=function(_0x2f35a2,_0x9c1ac){_0x2f35a2=_0x2f35a2-0x0;var _0x503004=_0xe83c[_0x2f35a2];return _0x503004;};'use strict';var multer=require('multer');var util=require(_0xce83('0x0'));var path=require(_0xce83('0x1'));var timeout=require(_0xce83('0x2'));var express=require(_0xce83('0x3'));var router=express[_0xce83('0x4')]();var fs_extra=require(_0xce83('0x5'));var auth=require(_0xce83('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xce83('0x7'));var controller=require('./chatWebsite.controller');router[_0xce83('0x8')]('/',auth[_0xce83('0x9')](),controller[_0xce83('0xa')]);router[_0xce83('0x8')]('/describe',auth[_0xce83('0x9')](),controller[_0xce83('0xb')]);router[_0xce83('0x8')](_0xce83('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xce83('0x8')](_0xce83('0xd'),auth[_0xce83('0x9')](),controller['getDispositions']);router[_0xce83('0x8')]('/:id/canned_answers',auth[_0xce83('0x9')](),controller[_0xce83('0xe')]);router[_0xce83('0x8')](_0xce83('0xf'),controller[_0xce83('0x10')]);router['get'](_0xce83('0x11'),controller[_0xce83('0x12')]);router[_0xce83('0x8')](_0xce83('0x13'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller[_0xce83('0x14')]);router[_0xce83('0x8')](_0xce83('0x15'),auth[_0xce83('0x9')](),controller[_0xce83('0x16')]);router[_0xce83('0x8')](_0xce83('0x17'),controller[_0xce83('0x18')]);router[_0xce83('0x8')](_0xce83('0x19'),auth[_0xce83('0x9')](),controller[_0xce83('0x1a')]);router['get'](_0xce83('0x1b'),auth[_0xce83('0x9')](),controller[_0xce83('0x1c')]);router['get'](_0xce83('0x1d'),controller[_0xce83('0x1e')]);router[_0xce83('0x8')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xce83('0x1f')]);router[_0xce83('0x8')](_0xce83('0x20'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0xce83('0x9')](),controller[_0xce83('0x21')]);router[_0xce83('0x22')]('/:id/dispositions',auth[_0xce83('0x9')](),controller['addDisposition']);router['post'](_0xce83('0x23'),auth[_0xce83('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0xd18ce9,_0x348b97,_0x2a8d2a){_0x2a8d2a(null,path[_0xce83('0x25')](config[_0xce83('0x26')],_0xce83('0x27')));},'filename':function(_0x3fdc9d,_0x5bf3c6,_0x3dc64a){_0x3dc64a(null,util[_0xce83('0x28')](_0xce83('0x29'),Date[_0xce83('0x2a')](),_0x5bf3c6[_0xce83('0x2b')]));}})});router['post'](_0xce83('0xf'),upload['single'](_0xce83('0x2c')),controller[_0xce83('0x2d')]);var upload=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0x4f6070,_0x40355c,_0x327b9a){_0x327b9a(null,path['join'](config[_0xce83('0x26')],'server/files/images/avatars/'));},'filename':function(_0x359d40,_0x1df26b,_0x443d2c){_0x443d2c(null,util[_0xce83('0x28')](_0xce83('0x29'),Date[_0xce83('0x2a')](),_0x1df26b['originalname']));}})});router[_0xce83('0x22')](_0xce83('0x11'),upload['single']('file'),controller[_0xce83('0x2e')]);var upload=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0x5ed628,_0x5d7173,_0x564659){_0x564659(null,path['join'](config[_0xce83('0x26')],_0xce83('0x2f')));},'filename':function(_0x38ba57,_0x114c8a,_0x5ec511){_0x5ec511(null,util['format'](_0xce83('0x29'),Date['now'](),_0x114c8a[_0xce83('0x2b')]));}})});router[_0xce83('0x22')](_0xce83('0x13'),upload[_0xce83('0x30')](_0xce83('0x2c')),controller[_0xce83('0x31')]);var upload=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0x10153b,_0x389166,_0xbaf38c){_0xbaf38c(null,path['join'](config[_0xce83('0x26')],_0xce83('0x2f')));},'filename':function(_0x40efef,_0x1d8301,_0x3a283f){_0x3a283f(null,util[_0xce83('0x28')](_0xce83('0x29'),Date[_0xce83('0x2a')](),_0x1d8301[_0xce83('0x2b')]));}})});router[_0xce83('0x22')](_0xce83('0x32'),upload[_0xce83('0x30')](_0xce83('0x2c')),controller[_0xce83('0x33')]);router[_0xce83('0x22')](_0xce83('0x34'),controller[_0xce83('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xce83('0x24')]({'destination':function(_0x44a5ad,_0x3970f9,_0x3921dd){const _0x204e62=path[_0xce83('0x25')](config['root'],_0xce83('0x36'),_0xce83('0x37'),_0xce83('0x38'));fs_extra['ensureDir'](_0x204e62,function(){_0x3921dd(null,_0x204e62);});},'filename':function(_0x4d5b3e,_0x41d3a6,_0xe129f2){const _0x129cb6=_0x41d3a6[_0xce83('0x2b')][_0xce83('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3fecae=path[_0xce83('0x3a')](_0x129cb6);const _0x17804b=Date['now']()+'-'+_0x129cb6[_0xce83('0x39')](_0x3fecae,'')+_0x3fecae;_0xe129f2(null,_0x17804b);}})});router[_0xce83('0x22')](_0xce83('0x3b'),offlineUploadMulter[_0xce83('0x3c')](),controller[_0xce83('0x3d')]);router[_0xce83('0x22')](_0xce83('0x15'),auth[_0xce83('0x9')](),controller[_0xce83('0x3e')]);router['post'](_0xce83('0x19'),auth[_0xce83('0x9')](),controller[_0xce83('0x3f')]);router['post']('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xce83('0x40')]);router['post'](_0xce83('0x20'),auth[_0xce83('0x9')](),controller[_0xce83('0x41')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xce83('0x42')]);router['delete'](_0xce83('0xc'),auth[_0xce83('0x9')](),controller[_0xce83('0x43')]);router[_0xce83('0x44')](_0xce83('0xd'),auth[_0xce83('0x9')](),controller[_0xce83('0x45')]);router[_0xce83('0x44')]('/:id/canned_answers',auth[_0xce83('0x9')](),controller[_0xce83('0x46')]);router[_0xce83('0x44')](_0xce83('0x20'),auth[_0xce83('0x9')](),controller[_0xce83('0x47')]);module[_0xce83('0x48')]=router;
\ No newline at end of file
+var _0xce61=['/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','join','format','now','originalname','addLogo','diskStorage','root','server/files/images/avatars/','/:id/avatar','single','addAvatar','%s-%s','file','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0xce61,0xd6));var _0x1ce6=function(_0x21a3a6,_0x30957e){_0x21a3a6=_0x21a3a6-0x0;var _0x17c8a3=_0xce61[_0x21a3a6];return _0x17c8a3;};'use strict';var multer=require(_0x1ce6('0x0'));var util=require(_0x1ce6('0x1'));var path=require(_0x1ce6('0x2'));var timeout=require(_0x1ce6('0x3'));var express=require(_0x1ce6('0x4'));var router=express[_0x1ce6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1ce6('0x6'));var interaction=require(_0x1ce6('0x7'));var config=require(_0x1ce6('0x8'));var controller=require(_0x1ce6('0x9'));router[_0x1ce6('0xa')]('/',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xc')]);router[_0x1ce6('0xa')](_0x1ce6('0xd'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xe')]);router[_0x1ce6('0xa')]('/:id',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0xf')]);router['get'](_0x1ce6('0x10'),auth['isAuthenticated'](),controller[_0x1ce6('0x11')]);router[_0x1ce6('0xa')]('/:id/canned_answers',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x12')]);router['get'](_0x1ce6('0x13'),controller[_0x1ce6('0x14')]);router['get']('/:id/avatar',controller[_0x1ce6('0x15')]);router[_0x1ce6('0xa')](_0x1ce6('0x16'),controller[_0x1ce6('0x17')]);router[_0x1ce6('0xa')](_0x1ce6('0x18'),controller[_0x1ce6('0x19')]);router['get'](_0x1ce6('0x1a'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x1b')]);router['get'](_0x1ce6('0x1c'),controller[_0x1ce6('0x1d')]);router[_0x1ce6('0xa')](_0x1ce6('0x1e'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x1f')]);router[_0x1ce6('0xa')](_0x1ce6('0x20'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x21')]);router[_0x1ce6('0xa')](_0x1ce6('0x22'),controller[_0x1ce6('0x23')]);router['get'](_0x1ce6('0x24'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x25')]);router[_0x1ce6('0xa')](_0x1ce6('0x26'),auth['isAuthenticated'](),controller[_0x1ce6('0x27')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1ce6('0x28')]);router[_0x1ce6('0x29')](_0x1ce6('0x10'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x2a')]);router[_0x1ce6('0x29')](_0x1ce6('0x2b'),auth['isAuthenticated'](),controller[_0x1ce6('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1dc9b9,_0xc47d96,_0x2d7fa9){_0x2d7fa9(null,path[_0x1ce6('0x2d')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1f5c53,_0x2cf7e0,_0x69d5af){_0x69d5af(null,util[_0x1ce6('0x2e')]('%s-%s',Date[_0x1ce6('0x2f')](),_0x2cf7e0[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x13'),upload['single']('file'),controller[_0x1ce6('0x31')]);var upload=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x11c296,_0x4a58b5,_0x10c741){_0x10c741(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],_0x1ce6('0x34')));},'filename':function(_0x875683,_0x300fd4,_0x165607){_0x165607(null,util[_0x1ce6('0x2e')]('%s-%s',Date[_0x1ce6('0x2f')](),_0x300fd4[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x35'),upload[_0x1ce6('0x36')]('file'),controller[_0x1ce6('0x37')]);var upload=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x34faf4,_0x1a7815,_0x33954a){_0x33954a(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],'server/files/images/avatars/'));},'filename':function(_0x11dde5,_0x268a4e,_0x297fec){_0x297fec(null,util[_0x1ce6('0x2e')](_0x1ce6('0x38'),Date[_0x1ce6('0x2f')](),_0x268a4e[_0x1ce6('0x30')]));}})});router['post'](_0x1ce6('0x16'),upload[_0x1ce6('0x36')](_0x1ce6('0x39')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a5612,_0x562ac7,_0x5e7001){_0x5e7001(null,path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],_0x1ce6('0x34')));},'filename':function(_0x55cc98,_0x3bb436,_0x866d13){_0x866d13(null,util['format'](_0x1ce6('0x38'),Date['now'](),_0x3bb436[_0x1ce6('0x30')]));}})});router[_0x1ce6('0x29')](_0x1ce6('0x18'),upload[_0x1ce6('0x36')](_0x1ce6('0x39')),controller[_0x1ce6('0x3a')]);router[_0x1ce6('0x29')](_0x1ce6('0x3b'),controller[_0x1ce6('0x3c')]);const offlineUploadMulter=multer({'storage':multer[_0x1ce6('0x32')]({'destination':function(_0x472342,_0x570535,_0x3d99d1){const _0x418178=path[_0x1ce6('0x2d')](config[_0x1ce6('0x33')],'server/files',_0x1ce6('0x3d'),_0x1ce6('0x3e'));fs_extra[_0x1ce6('0x3f')](_0x418178,function(){_0x3d99d1(null,_0x418178);});},'filename':function(_0x4874b3,_0x383bbf,_0xb4da77){const _0x520b2f=_0x383bbf['originalname'][_0x1ce6('0x40')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x70b620=path[_0x1ce6('0x41')](_0x520b2f);const _0x19ae90=Date[_0x1ce6('0x2f')]()+'-'+_0x520b2f['replace'](_0x70b620,'')+_0x70b620;_0xb4da77(null,_0x19ae90);}})});router[_0x1ce6('0x29')](_0x1ce6('0x42'),offlineUploadMulter[_0x1ce6('0x43')](),controller[_0x1ce6('0x44')]);router[_0x1ce6('0x29')](_0x1ce6('0x1a'),auth['isAuthenticated'](),controller[_0x1ce6('0x45')]);router[_0x1ce6('0x29')](_0x1ce6('0x1e'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x46')]);router[_0x1ce6('0x29')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x1ce6('0x47')]);router[_0x1ce6('0x29')](_0x1ce6('0x26'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x48')]);router[_0x1ce6('0x49')]('/:id',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4a')]);router[_0x1ce6('0x4b')](_0x1ce6('0x4c'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4d')]);router[_0x1ce6('0x4b')]('/:id/dispositions',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4e')]);router['delete']('/:id/canned_answers',auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x4f')]);router[_0x1ce6('0x4b')](_0x1ce6('0x26'),auth[_0x1ce6('0xb')](),controller[_0x1ce6('0x50')]);module[_0x1ce6('0x51')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 1a5481d..dea8542 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 _0x2eda=['Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365'];(function(_0x3578ac,_0x31e6fa){var _0x21f362=function(_0x5c6ce6){while(--_0x5c6ce6){_0x3578ac['push'](_0x3578ac['shift']());}};_0x21f362(++_0x31e6fa);}(_0x2eda,0x1f1));var _0xa2ed=function(_0x57e812,_0x4ad10f){_0x57e812=_0x57e812-0x0;var _0x17e557=_0x2eda[_0x57e812];return _0x17e557;};'use strict';var Sequelize=require(_0xa2ed('0x0'));module[_0xa2ed('0x1')]={'name':{'type':Sequelize[_0xa2ed('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa2ed('0x3')](_0xa2ed('0x4'),'Google',_0xa2ed('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xa2ed('0x3')](_0xa2ed('0x6'),_0xa2ed('0x7'))},'data1':{'type':Sequelize[_0xa2ed('0x2')],'comment':_0xa2ed('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xa2ed('0x2')],'comment':_0xa2ed('0x9')},'data4':{'type':Sequelize['STRING'],'comment':_0xa2ed('0xa')},'data5':{'type':Sequelize[_0xa2ed('0xb')],'comment':_0xa2ed('0xc')},'data6':{'type':Sequelize[_0xa2ed('0xb')],'comment':_0xa2ed('0xd')}};
\ No newline at end of file
+var _0xb61a=['Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM'];(function(_0x2a6073,_0x5c42d3){var _0x6b34dc=function(_0x35bf07){while(--_0x35bf07){_0x2a6073['push'](_0x2a6073['shift']());}};_0x6b34dc(++_0x5c42d3);}(_0xb61a,0x165));var _0xab61=function(_0x3695a8,_0x364266){_0x3695a8=_0x3695a8-0x0;var _0x463e61=_0xb61a[_0x3695a8];return _0x463e61;};'use strict';var Sequelize=require(_0xab61('0x0'));module['exports']={'name':{'type':Sequelize[_0xab61('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xab61('0x2')]('AmazonAWS','Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xab61('0x2')]('Outlook365',_0xab61('0x3'))},'data1':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xab61('0x1')],'comment':_0xab61('0x4')},'data3':{'type':Sequelize['STRING'],'comment':_0xab61('0x5')},'data4':{'type':Sequelize[_0xab61('0x1')],'comment':_0xab61('0x6')},'data5':{'type':Sequelize['TEXT'],'comment':_0xab61('0x7')},'data6':{'type':Sequelize[_0xab61('0x8')],'comment':_0xab61('0x9')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index ee6d1ee..6a6933a 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 _0x8ed5=['ascii','Unable\x20to\x20validate\x20id_token','del','data5','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','moment','ioredis','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','stack','name','send','index','map','CloudProvider','rawAttributes','fieldName','key','filters','intersection','model','query','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','keys','fields','length','include','find','create','body','params','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','hex','client_id','data1','response_type','join','redirect_uri','data4','form_post','scope','type','state','prompt','value','oauth2Claims','decode','payload','issuer','aud','audience','nonce','isAfter','unix','exp','refresh_token','data6','data3','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','POST','oauth2MicrosoftAuthorize','parse'];(function(_0x13d1a2,_0x5f4d55){var _0x50175a=function(_0x5839fc){while(--_0x5839fc){_0x13d1a2['push'](_0x13d1a2['shift']());}};_0x50175a(++_0x5f4d55);}(_0x8ed5,0x15f));var _0x58ed=function(_0x5352b2,_0x5bf778){_0x5352b2=_0x5352b2-0x0;var _0x4a63c4=_0x8ed5[_0x5352b2];return _0x4a63c4;};'use strict';var rp=require('request-promise');var _=require(_0x58ed('0x0'));var moment=require(_0x58ed('0x1'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var Redis=require(_0x58ed('0x2'));var qs=require('../../components/parsers/qs');var config=require(_0x58ed('0x3'));var logger=require('../../config/logger')('api');var db=require(_0x58ed('0x4'))['db'];config[_0x58ed('0x5')]=_['defaults'](config[_0x58ed('0x5')],{'host':_0x58ed('0x6'),'port':0x18eb});var socket=require(_0x58ed('0x7'))(new Redis(config[_0x58ed('0x5')]));var redis=new Redis(config[_0x58ed('0x5')]);var MICROSOFT_AUTH_URL=_0x58ed('0x8');var AZURE_AUTH_SCOPES={'Outlook365':[_0x58ed('0x9'),_0x58ed('0xa'),'email',_0x58ed('0xb'),_0x58ed('0xc'),_0x58ed('0xd'),_0x58ed('0xe')],'Dynamics365':[_0x58ed('0x9'),_0x58ed('0xb')]};var AZURE_TOKEN_SCOPES={'Outlook365':_0x58ed('0xc'),'Dynamics365':''};var MICROSOFT_AUTH_ENDPOINT=_0x58ed('0xf');var MICROSOFT_TOKEN_ENDPOINT='/token';function respondWithStatusCode(_0x46836e,_0x50690c){_0x50690c=_0x50690c||0xcc;return function(_0x1ba269){if(_0x1ba269){return _0x46836e[_0x58ed('0x10')](_0x50690c);}return _0x46836e[_0x58ed('0x11')](_0x50690c)[_0x58ed('0x12')]();};}function respondWithResult(_0x418b59,_0x4c86b3){_0x4c86b3=_0x4c86b3||0xc8;return function(_0x394d02){if(_0x394d02){return _0x418b59[_0x58ed('0x11')](_0x4c86b3)[_0x58ed('0x13')](_0x394d02);}};}function respondWithFilteredResult(_0x284068,_0x57a867){return function(_0x58dc4e){if(_0x58dc4e){var _0x5ce1be=typeof _0x57a867[_0x58ed('0x14')]==='undefined'&&typeof _0x57a867[_0x58ed('0x15')]===_0x58ed('0x16');var _0x50aae4=_0x58dc4e['count'];var _0x1886b2=_0x5ce1be?0x0:_0x57a867['offset'];var _0x5be03e=_0x5ce1be?_0x58dc4e[_0x58ed('0x17')]:_0x57a867[_0x58ed('0x14')]+_0x57a867['limit'];var _0x4ef9f6;if(_0x5be03e>=_0x50aae4){_0x5be03e=_0x50aae4;_0x4ef9f6=0xc8;}else{_0x4ef9f6=0xce;}_0x284068['status'](_0x4ef9f6);return _0x284068['set'](_0x58ed('0x18'),_0x1886b2+'-'+_0x5be03e+'/'+_0x50aae4)['json'](_0x58dc4e);}return null;};}function saveUpdates(_0xcd808a){return function(_0x1d681f){if(_0x1d681f){return _0x1d681f[_0x58ed('0x19')](_0xcd808a)[_0x58ed('0x1a')](function(_0x52678a){return _0x52678a;});}return null;};}function removeEntity(_0x2ef447){return function(_0x3e80c0){if(_0x3e80c0){return _0x3e80c0[_0x58ed('0x1b')]()[_0x58ed('0x1a')](function(){_0x2ef447['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x192963){return function(_0x33e7bd){if(!_0x33e7bd){_0x192963[_0x58ed('0x10')](0x194);}return _0x33e7bd;};}function handleError(_0x95cbba,_0x515932){_0x515932=_0x515932||0x1f4;return function(_0x286090){logger['error'](_0x286090[_0x58ed('0x1c')]);if(_0x286090[_0x58ed('0x1d')]){delete _0x286090['name'];}_0x95cbba[_0x58ed('0x11')](_0x515932)[_0x58ed('0x1e')](_0x286090);};}exports[_0x58ed('0x1f')]=function(_0x38d109,_0xb4a585){var _0x2f1cd9={},_0x5421a7={},_0x1ae646={'count':0x0,'rows':[]};var _0x525397=_[_0x58ed('0x20')](db[_0x58ed('0x21')][_0x58ed('0x22')],function(_0x340796){return{'name':_0x340796[_0x58ed('0x23')],'type':_0x340796['type'][_0x58ed('0x24')]};});_0x5421a7['model']=_[_0x58ed('0x20')](_0x525397,_0x58ed('0x1d'));_0x5421a7['query']=_['keys'](_0x38d109['query']);_0x5421a7[_0x58ed('0x25')]=_[_0x58ed('0x26')](_0x5421a7[_0x58ed('0x27')],_0x5421a7[_0x58ed('0x28')]);_0x2f1cd9[_0x58ed('0x29')]=_[_0x58ed('0x26')](_0x5421a7['model'],qs['fields'](_0x38d109[_0x58ed('0x28')]['fields']));_0x2f1cd9[_0x58ed('0x29')]=_0x2f1cd9[_0x58ed('0x29')]['length']?_0x2f1cd9[_0x58ed('0x29')]:_0x5421a7['model'];if(!_0x38d109['query'][_0x58ed('0x2a')](_0x58ed('0x2b'))){_0x2f1cd9['limit']=qs['limit'](_0x38d109[_0x58ed('0x28')][_0x58ed('0x15')]);_0x2f1cd9[_0x58ed('0x14')]=qs['offset'](_0x38d109[_0x58ed('0x28')][_0x58ed('0x14')]);}_0x2f1cd9[_0x58ed('0x2c')]=qs['sort'](_0x38d109[_0x58ed('0x28')][_0x58ed('0x2d')]);_0x2f1cd9[_0x58ed('0x2e')]=qs[_0x58ed('0x25')](_[_0x58ed('0x2f')](_0x38d109[_0x58ed('0x28')],_0x5421a7[_0x58ed('0x25')]),_0x525397);if(_0x38d109['query'][_0x58ed('0x30')]){_0x2f1cd9['where']=_[_0x58ed('0x31')](_0x2f1cd9['where'],{'$or':_[_0x58ed('0x20')](_0x525397,function(_0x1dbc12){if(_0x1dbc12['type']!==_0x58ed('0x32')){var _0x2c4a34={};_0x2c4a34[_0x1dbc12[_0x58ed('0x1d')]]={'$like':'%'+_0x38d109[_0x58ed('0x28')]['filter']+'%'};return _0x2c4a34;}})});}_0x2f1cd9=_[_0x58ed('0x31')]({},_0x2f1cd9,_0x38d109[_0x58ed('0x33')]);var _0x23a85a={'where':_0x2f1cd9['where']};return db[_0x58ed('0x21')][_0x58ed('0x17')](_0x23a85a)[_0x58ed('0x1a')](function(_0x556f05){_0x1ae646['count']=_0x556f05;if(_0x38d109[_0x58ed('0x28')][_0x58ed('0x34')]){_0x2f1cd9['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x2f1cd9);})[_0x58ed('0x1a')](function(_0x2c36ad){_0x1ae646['rows']=_0x2c36ad;return _0x1ae646;})['then'](respondWithFilteredResult(_0xb4a585,_0x2f1cd9))[_0x58ed('0x35')](handleError(_0xb4a585,null));};exports[_0x58ed('0x36')]=function(_0x5c5de1,_0x4055e3){var _0x23d0ca={'raw':!![],'where':{'id':_0x5c5de1['params']['id']}},_0x4d55cd={};_0x4d55cd[_0x58ed('0x27')]=_['keys'](db[_0x58ed('0x21')][_0x58ed('0x22')]);_0x4d55cd[_0x58ed('0x28')]=_[_0x58ed('0x37')](_0x5c5de1[_0x58ed('0x28')]);_0x4d55cd[_0x58ed('0x25')]=_['intersection'](_0x4d55cd[_0x58ed('0x27')],_0x4d55cd['query']);_0x23d0ca[_0x58ed('0x29')]=_[_0x58ed('0x26')](_0x4d55cd['model'],qs['fields'](_0x5c5de1[_0x58ed('0x28')][_0x58ed('0x38')]));_0x23d0ca[_0x58ed('0x29')]=_0x23d0ca[_0x58ed('0x29')][_0x58ed('0x39')]?_0x23d0ca[_0x58ed('0x29')]:_0x4d55cd['model'];if(_0x5c5de1[_0x58ed('0x28')][_0x58ed('0x34')]){_0x23d0ca[_0x58ed('0x3a')]=[{'all':!![]}];}_0x23d0ca=_['merge']({},_0x23d0ca,_0x5c5de1[_0x58ed('0x33')]);return db[_0x58ed('0x21')][_0x58ed('0x3b')](_0x23d0ca)[_0x58ed('0x1a')](handleEntityNotFound(_0x4055e3,null))['then'](respondWithResult(_0x4055e3,null))[_0x58ed('0x35')](handleError(_0x4055e3,null));};exports[_0x58ed('0x3c')]=function(_0x4e46b3,_0x53f917){return db['CloudProvider']['create'](_0x4e46b3[_0x58ed('0x3d')],{})['then'](respondWithResult(_0x53f917,0xc9))['catch'](handleError(_0x53f917,null));};exports[_0x58ed('0x19')]=function(_0x2b76c2,_0x3b5878){if(_0x2b76c2[_0x58ed('0x3d')]['id']){delete _0x2b76c2[_0x58ed('0x3d')]['id'];}return db[_0x58ed('0x21')][_0x58ed('0x3b')]({'where':{'id':_0x2b76c2['params']['id']}})[_0x58ed('0x1a')](handleEntityNotFound(_0x3b5878,null))['then'](saveUpdates(_0x2b76c2[_0x58ed('0x3d')],null))[_0x58ed('0x1a')](respondWithResult(_0x3b5878,null))[_0x58ed('0x35')](handleError(_0x3b5878,null));};exports['destroy']=function(_0x538ad0,_0x113c87){return db['CloudProvider'][_0x58ed('0x3b')]({'where':{'id':_0x538ad0[_0x58ed('0x3e')]['id']}})[_0x58ed('0x1a')](handleEntityNotFound(_0x113c87,null))['then'](removeEntity(_0x113c87,null))['catch'](handleError(_0x113c87,null));};function generateMicrosoftAuthorizationUrl(_0x598df7,_0x27271e){var _0x3ec8f9=MICROSOFT_AUTH_URL[_0x58ed('0x3f')](_0x58ed('0x40'),_0x598df7[_0x58ed('0x41')]);var _0x1a5bb8=[_0x58ed('0x42'),_0x58ed('0x43')];var _0x762dea=Buffer[_0x58ed('0x44')](JSON[_0x58ed('0x45')]({'id':_0x27271e}))[_0x58ed('0x46')](_0x58ed('0x47'));var _0x3ae1b1=crypto['randomBytes'](0x10)['toString'](_0x58ed('0x48'));var _0x14081e=[{'key':_0x58ed('0x49'),'value':_0x598df7[_0x58ed('0x4a')]},{'key':_0x58ed('0x4b'),'value':encodeURIComponent(_0x1a5bb8[_0x58ed('0x4c')]('\x20'))},{'key':_0x58ed('0x4d'),'value':_0x598df7[_0x58ed('0x4e')]},{'key':'response_mode','value':_0x58ed('0x4f')},{'key':_0x58ed('0x50'),'value':encodeURIComponent(AZURE_AUTH_SCOPES[_0x598df7[_0x58ed('0x51')]][_0x58ed('0x4c')]('\x20'))},{'key':_0x58ed('0x52'),'value':_0x762dea},{'key':'nonce','value':_0x3ae1b1},{'key':_0x58ed('0x53'),'value':'login'}];var _0x40e71b=_0x3ec8f9+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x58ed('0x20')](_0x14081e,function(_0x1b9049){return _0x1b9049[_0x58ed('0x24')]+'='+_0x1b9049[_0x58ed('0x54')];})[_0x58ed('0x4c')]('&');_0x598df7[_0x58ed('0x55')]={'issuer':_0x3ec8f9[_0x58ed('0x3f')]('oauth2/',''),'audience':_0x598df7[_0x58ed('0x4a')],'state':_0x762dea,'nonce':_0x3ae1b1};redis['set'](_0x762dea,JSON['stringify'](_0x598df7));return _0x40e71b;}function isValidIdToken(_0x2ea79c,_0x24eff0){try{var _0x92f594=jwt[_0x58ed('0x56')](_0x2ea79c,{'complete':!![]});var _0xaf59bd=_0x92f594[_0x58ed('0x57')];if(_0xaf59bd['iss']!==_0x24eff0[_0x58ed('0x58')])return![];if(_0xaf59bd[_0x58ed('0x59')]!==_0x24eff0[_0x58ed('0x5a')])return![];if(_0xaf59bd[_0x58ed('0x5b')]!==_0x24eff0[_0x58ed('0x5b')])return![];if(moment()[_0x58ed('0x5c')](moment[_0x58ed('0x5d')](_0xaf59bd[_0x58ed('0x5e')])))return![];return!![];}catch(_0x4dded7){throw _0x4dded7;}}function refreshOauth2MicrosoftAccessToken(_0x5b21f1){var _0x1ac215={'grant_type':_0x58ed('0x5f'),'refresh_token':_0x5b21f1[_0x58ed('0x60')],'scope':AZURE_TOKEN_SCOPES[_0x5b21f1['type']],'redirect_uri':_0x5b21f1['data4'],'client_id':_0x5b21f1[_0x58ed('0x4a')],'client_secret':_0x5b21f1[_0x58ed('0x61')]};var _0x1ad8fb={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x58ed('0x3f')](_0x58ed('0x40'),_0x5b21f1[_0x58ed('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1ac215,'json':!![]};return rp(_0x1ad8fb)[_0x58ed('0x1a')](function(_0x461f41){return db[_0x58ed('0x21')][_0x58ed('0x19')]({'data5':_0x461f41[_0x58ed('0x62')],'data6':_0x461f41['refresh_token']},{'where':{'id':_0x5b21f1['id']}});})[_0x58ed('0x35')](function(_0x4c825f){logger[_0x58ed('0x63')](_0x58ed('0x64'),_0x5b21f1['id'],_0x4c825f);});}function getOauth2MicrosoftAccessToken(_0x295824,_0x331961){var _0x1c16fb={'grant_type':_0x58ed('0x65'),'code':_0x295824,'scope':AZURE_TOKEN_SCOPES[_0x331961[_0x58ed('0x51')]],'redirect_uri':_0x331961[_0x58ed('0x4e')],'client_id':_0x331961[_0x58ed('0x4a')],'client_secret':_0x331961[_0x58ed('0x61')]};var _0x58089c={'method':_0x58ed('0x66'),'uri':MICROSOFT_AUTH_URL[_0x58ed('0x3f')](_0x58ed('0x40'),_0x331961[_0x58ed('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1c16fb,'json':!![]};return rp(_0x58089c);}exports[_0x58ed('0x67')]=function(_0x588e2a,_0x17141b){return db[_0x58ed('0x21')]['findOne']({'where':{'id':_0x588e2a[_0x58ed('0x3e')]['id']},'raw':!![]})[_0x58ed('0x1a')](function(_0x176efa){if(!_0x176efa)return _0x17141b[_0x58ed('0x10')](0x194);return{'url':generateMicrosoftAuthorizationUrl(_0x176efa,_0x588e2a['user']['id'])};})[_0x58ed('0x1a')](respondWithResult(_0x17141b,null))[_0x58ed('0x35')](handleError(_0x17141b,null));};exports['oauth2MicrosoftCallback']=function(_0x67b4a8,_0x4c1b96){var _0x3a1746=_0x67b4a8[_0x58ed('0x3d')];var _0x24c5f5;var _0x48d75e;if(_0x3a1746[_0x58ed('0x63')])throw _0x3a1746;redis['get'](_0x3a1746[_0x58ed('0x52')])[_0x58ed('0x1a')](function(_0x5bae66){if(!_0x5bae66)throw new Error('Invalid\x20state\x20parameter');_0x24c5f5=JSON[_0x58ed('0x68')](_0x5bae66);var _0x4268f8=Buffer[_0x58ed('0x44')](_0x3a1746[_0x58ed('0x52')],'base64')[_0x58ed('0x46')](_0x58ed('0x69'));_0x48d75e=JSON[_0x58ed('0x68')](_0x4268f8);if(!isValidIdToken(_0x3a1746[_0x58ed('0x43')],_0x24c5f5[_0x58ed('0x55')]))throw new Error(_0x58ed('0x6a'));redis[_0x58ed('0x6b')](_0x3a1746[_0x58ed('0x52')]);return getOauth2MicrosoftAccessToken(_0x3a1746['code'],_0x24c5f5);})[_0x58ed('0x1a')](function(_0x3cba08){_0x24c5f5['data5']=_0x3cba08[_0x58ed('0x62')];_0x24c5f5[_0x58ed('0x60')]=_0x3cba08[_0x58ed('0x5f')];return db[_0x58ed('0x21')][_0x58ed('0x19')]({'data5':_0x24c5f5[_0x58ed('0x6c')],'data6':_0x24c5f5[_0x58ed('0x60')]},{'where':{'id':_0x24c5f5['id']}});})[_0x58ed('0x1a')](function(){setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,_0x24c5f5),0xfa*0x3e8);socket['emit']('microsoftAuthorization:success',{'id':_0x48d75e['id']});return;})['then'](respondWithStatusCode(_0x4c1b96,null))[_0x58ed('0x35')](function(_0x5c46cb){if(_0x48d75e){socket[_0x58ed('0x6d')](_0x58ed('0x6e'),{'id':_0x48d75e['id']});}if(!_0x24c5f5){logger[_0x58ed('0x63')](_0x58ed('0x6f'),_0x5c46cb);return _0x4c1b96[_0x58ed('0x11')](0x1f4)[_0x58ed('0x1e')](_0x5c46cb[_0x58ed('0x70')]);}logger['error'](_0x58ed('0x71'),_0x24c5f5['id'],_0x5c46cb);});};
\ No newline at end of file
+var _0x079b=['openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','stack','name','send','map','CloudProvider','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','merge','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','hex','client_id','response_type','join','redirect_uri','data4','response_mode','form_post','scope','nonce','prompt','login','oauth2Claims','oauth2/','data1','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','refresh_token','data6','POST','access_token','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','authorization_code','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','ascii','del','data5','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','request-promise','lodash','moment','crypto','jsonwebtoken','../../config/environment','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x079b,0x165));var _0xb079=function(_0x391e9c,_0x3b4958){_0x391e9c=_0x391e9c-0x0;var _0x1807da=_0x079b[_0x391e9c];return _0x1807da;};'use strict';var rp=require(_0xb079('0x0'));var _=require(_0xb079('0x1'));var moment=require(_0xb079('0x2'));var crypto=require(_0xb079('0x3'));var jwt=require(_0xb079('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var config=require(_0xb079('0x5'));var logger=require(_0xb079('0x6'))('api');var db=require(_0xb079('0x7'))['db'];config[_0xb079('0x8')]=_['defaults'](config[_0xb079('0x8')],{'host':_0xb079('0x9'),'port':0x18eb});var socket=require(_0xb079('0xa'))(new Redis(config[_0xb079('0x8')]));var redis=new Redis(config[_0xb079('0x8')]);var MICROSOFT_AUTH_URL=_0xb079('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xb079('0xc'),_0xb079('0xd'),_0xb079('0xe'),'offline_access',_0xb079('0xf'),_0xb079('0x10'),_0xb079('0x11')],'Dynamics365':['openid',_0xb079('0x12')]};var AZURE_TOKEN_SCOPES={'Outlook365':_0xb079('0xf'),'Dynamics365':''};var MICROSOFT_AUTH_ENDPOINT=_0xb079('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';function respondWithStatusCode(_0x74e4a8,_0x575290){_0x575290=_0x575290||0xcc;return function(_0x3544f5){if(_0x3544f5){return _0x74e4a8[_0xb079('0x14')](_0x575290);}return _0x74e4a8['status'](_0x575290)[_0xb079('0x15')]();};}function respondWithResult(_0x56419c,_0x3c675e){_0x3c675e=_0x3c675e||0xc8;return function(_0x4ddc5f){if(_0x4ddc5f){return _0x56419c[_0xb079('0x16')](_0x3c675e)[_0xb079('0x17')](_0x4ddc5f);}};}function respondWithFilteredResult(_0x117ec5,_0x2b7d6f){return function(_0x4845ec){if(_0x4845ec){var _0x422110=typeof _0x2b7d6f[_0xb079('0x18')]===_0xb079('0x19')&&typeof _0x2b7d6f['limit']==='undefined';var _0x4872eb=_0x4845ec[_0xb079('0x1a')];var _0x13dd18=_0x422110?0x0:_0x2b7d6f[_0xb079('0x18')];var _0x2406db=_0x422110?_0x4845ec['count']:_0x2b7d6f[_0xb079('0x18')]+_0x2b7d6f[_0xb079('0x1b')];var _0x336629;if(_0x2406db>=_0x4872eb){_0x2406db=_0x4872eb;_0x336629=0xc8;}else{_0x336629=0xce;}_0x117ec5[_0xb079('0x16')](_0x336629);return _0x117ec5[_0xb079('0x1c')](_0xb079('0x1d'),_0x13dd18+'-'+_0x2406db+'/'+_0x4872eb)['json'](_0x4845ec);}return null;};}function saveUpdates(_0xd55d08){return function(_0x9a535b){if(_0x9a535b){return _0x9a535b['update'](_0xd55d08)[_0xb079('0x1e')](function(_0x53059a){return _0x53059a;});}return null;};}function removeEntity(_0x6b7eb4){return function(_0x42cb57){if(_0x42cb57){return _0x42cb57[_0xb079('0x1f')]()[_0xb079('0x1e')](function(){_0x6b7eb4[_0xb079('0x16')](0xcc)[_0xb079('0x15')]();});}};}function handleEntityNotFound(_0xfe9698){return function(_0x309b26){if(!_0x309b26){_0xfe9698[_0xb079('0x14')](0x194);}return _0x309b26;};}function handleError(_0x2a837f,_0x27d885){_0x27d885=_0x27d885||0x1f4;return function(_0x465625){logger[_0xb079('0x20')](_0x465625[_0xb079('0x21')]);if(_0x465625[_0xb079('0x22')]){delete _0x465625[_0xb079('0x22')];}_0x2a837f[_0xb079('0x16')](_0x27d885)[_0xb079('0x23')](_0x465625);};}exports['index']=function(_0x13f0cf,_0x3041e5){var _0x5ef466={},_0x43eae2={},_0x57f45a={'count':0x0,'rows':[]};var _0x4d627c=_[_0xb079('0x24')](db[_0xb079('0x25')][_0xb079('0x26')],function(_0xd68eda){return{'name':_0xd68eda[_0xb079('0x27')],'type':_0xd68eda['type'][_0xb079('0x28')]};});_0x43eae2['model']=_[_0xb079('0x24')](_0x4d627c,_0xb079('0x22'));_0x43eae2[_0xb079('0x29')]=_[_0xb079('0x2a')](_0x13f0cf['query']);_0x43eae2[_0xb079('0x2b')]=_['intersection'](_0x43eae2[_0xb079('0x2c')],_0x43eae2[_0xb079('0x29')]);_0x5ef466[_0xb079('0x2d')]=_[_0xb079('0x2e')](_0x43eae2[_0xb079('0x2c')],qs[_0xb079('0x2f')](_0x13f0cf[_0xb079('0x29')][_0xb079('0x2f')]));_0x5ef466['attributes']=_0x5ef466['attributes'][_0xb079('0x30')]?_0x5ef466[_0xb079('0x2d')]:_0x43eae2[_0xb079('0x2c')];if(!_0x13f0cf[_0xb079('0x29')][_0xb079('0x31')]('nolimit')){_0x5ef466['limit']=qs[_0xb079('0x1b')](_0x13f0cf[_0xb079('0x29')]['limit']);_0x5ef466[_0xb079('0x18')]=qs[_0xb079('0x18')](_0x13f0cf['query']['offset']);}_0x5ef466[_0xb079('0x32')]=qs[_0xb079('0x33')](_0x13f0cf[_0xb079('0x29')][_0xb079('0x33')]);_0x5ef466['where']=qs[_0xb079('0x2b')](_[_0xb079('0x34')](_0x13f0cf[_0xb079('0x29')],_0x43eae2[_0xb079('0x2b')]),_0x4d627c);if(_0x13f0cf[_0xb079('0x29')]['filter']){_0x5ef466['where']=_[_0xb079('0x35')](_0x5ef466[_0xb079('0x36')],{'$or':_[_0xb079('0x24')](_0x4d627c,function(_0x41256a){if(_0x41256a[_0xb079('0x37')]!==_0xb079('0x38')){var _0x213112={};_0x213112[_0x41256a[_0xb079('0x22')]]={'$like':'%'+_0x13f0cf[_0xb079('0x29')][_0xb079('0x39')]+'%'};return _0x213112;}})});}_0x5ef466=_['merge']({},_0x5ef466,_0x13f0cf[_0xb079('0x3a')]);var _0x230108={'where':_0x5ef466[_0xb079('0x36')]};return db[_0xb079('0x25')][_0xb079('0x1a')](_0x230108)[_0xb079('0x1e')](function(_0x430deb){_0x57f45a[_0xb079('0x1a')]=_0x430deb;if(_0x13f0cf[_0xb079('0x29')][_0xb079('0x3b')]){_0x5ef466[_0xb079('0x3c')]=[{'all':!![]}];}return db[_0xb079('0x25')][_0xb079('0x3d')](_0x5ef466);})[_0xb079('0x1e')](function(_0xbaf9d7){_0x57f45a[_0xb079('0x3e')]=_0xbaf9d7;return _0x57f45a;})[_0xb079('0x1e')](respondWithFilteredResult(_0x3041e5,_0x5ef466))[_0xb079('0x3f')](handleError(_0x3041e5,null));};exports[_0xb079('0x40')]=function(_0x447365,_0xc5e1a5){var _0x335b90={'raw':!![],'where':{'id':_0x447365[_0xb079('0x41')]['id']}},_0x314233={};_0x314233[_0xb079('0x2c')]=_[_0xb079('0x2a')](db[_0xb079('0x25')][_0xb079('0x26')]);_0x314233[_0xb079('0x29')]=_['keys'](_0x447365['query']);_0x314233[_0xb079('0x2b')]=_[_0xb079('0x2e')](_0x314233['model'],_0x314233[_0xb079('0x29')]);_0x335b90[_0xb079('0x2d')]=_['intersection'](_0x314233[_0xb079('0x2c')],qs[_0xb079('0x2f')](_0x447365['query']['fields']));_0x335b90[_0xb079('0x2d')]=_0x335b90['attributes'][_0xb079('0x30')]?_0x335b90[_0xb079('0x2d')]:_0x314233[_0xb079('0x2c')];if(_0x447365[_0xb079('0x29')]['includeAll']){_0x335b90[_0xb079('0x3c')]=[{'all':!![]}];}_0x335b90=_[_0xb079('0x35')]({},_0x335b90,_0x447365[_0xb079('0x3a')]);return db[_0xb079('0x25')][_0xb079('0x42')](_0x335b90)['then'](handleEntityNotFound(_0xc5e1a5,null))[_0xb079('0x1e')](respondWithResult(_0xc5e1a5,null))[_0xb079('0x3f')](handleError(_0xc5e1a5,null));};exports['create']=function(_0x214489,_0x432e1d){return db['CloudProvider'][_0xb079('0x43')](_0x214489[_0xb079('0x44')],{})[_0xb079('0x1e')](respondWithResult(_0x432e1d,0xc9))['catch'](handleError(_0x432e1d,null));};exports[_0xb079('0x45')]=function(_0x5f3257,_0x7b3bc4){if(_0x5f3257['body']['id']){delete _0x5f3257[_0xb079('0x44')]['id'];}return db[_0xb079('0x25')]['find']({'where':{'id':_0x5f3257[_0xb079('0x41')]['id']}})[_0xb079('0x1e')](handleEntityNotFound(_0x7b3bc4,null))['then'](saveUpdates(_0x5f3257[_0xb079('0x44')],null))['then'](respondWithResult(_0x7b3bc4,null))[_0xb079('0x3f')](handleError(_0x7b3bc4,null));};exports['destroy']=function(_0x478e1f,_0x4a1e60){return db[_0xb079('0x25')][_0xb079('0x42')]({'where':{'id':_0x478e1f[_0xb079('0x41')]['id']}})[_0xb079('0x1e')](handleEntityNotFound(_0x4a1e60,null))[_0xb079('0x1e')](removeEntity(_0x4a1e60,null))[_0xb079('0x3f')](handleError(_0x4a1e60,null));};function generateMicrosoftAuthorizationUrl(_0x566d1c,_0x317df4){var _0x2a1236=MICROSOFT_AUTH_URL[_0xb079('0x46')](_0xb079('0x47'),_0x566d1c[_0xb079('0x48')]);var _0x460123=[_0xb079('0x49'),_0xb079('0x4a')];var _0x349120=Buffer['from'](JSON[_0xb079('0x4b')]({'id':_0x317df4}))[_0xb079('0x4c')](_0xb079('0x4d'));var _0x27efcd=crypto['randomBytes'](0x10)[_0xb079('0x4c')](_0xb079('0x4e'));var _0x43b784=[{'key':_0xb079('0x4f'),'value':_0x566d1c['data1']},{'key':_0xb079('0x50'),'value':encodeURIComponent(_0x460123[_0xb079('0x51')]('\x20'))},{'key':_0xb079('0x52'),'value':_0x566d1c[_0xb079('0x53')]},{'key':_0xb079('0x54'),'value':_0xb079('0x55')},{'key':_0xb079('0x56'),'value':encodeURIComponent(AZURE_AUTH_SCOPES[_0x566d1c[_0xb079('0x37')]][_0xb079('0x51')]('\x20'))},{'key':'state','value':_0x349120},{'key':_0xb079('0x57'),'value':_0x27efcd},{'key':_0xb079('0x58'),'value':_0xb079('0x59')}];var _0x55decc=_0x2a1236+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xb079('0x24')](_0x43b784,function(_0x417caf){return _0x417caf[_0xb079('0x28')]+'='+_0x417caf['value'];})['join']('&');_0x566d1c[_0xb079('0x5a')]={'issuer':_0x2a1236[_0xb079('0x46')](_0xb079('0x5b'),''),'audience':_0x566d1c[_0xb079('0x5c')],'state':_0x349120,'nonce':_0x27efcd};redis[_0xb079('0x1c')](_0x349120,JSON[_0xb079('0x4b')](_0x566d1c));return _0x55decc;}function isValidIdToken(_0x423e58,_0x412a31){try{var _0x4e3eac=jwt[_0xb079('0x5d')](_0x423e58,{'complete':!![]});var _0x8c53bd=_0x4e3eac[_0xb079('0x5e')];if(_0x8c53bd[_0xb079('0x5f')]!==_0x412a31[_0xb079('0x60')])return![];if(_0x8c53bd[_0xb079('0x61')]!==_0x412a31[_0xb079('0x62')])return![];if(_0x8c53bd[_0xb079('0x57')]!==_0x412a31['nonce'])return![];if(moment()[_0xb079('0x63')](moment[_0xb079('0x64')](_0x8c53bd[_0xb079('0x65')])))return![];return!![];}catch(_0x199d88){throw _0x199d88;}}function refreshOauth2MicrosoftAccessToken(_0x26fd76){var _0x472201={'grant_type':_0xb079('0x66'),'refresh_token':_0x26fd76[_0xb079('0x67')],'scope':AZURE_TOKEN_SCOPES[_0x26fd76['type']],'redirect_uri':_0x26fd76[_0xb079('0x53')],'client_id':_0x26fd76[_0xb079('0x5c')],'client_secret':_0x26fd76['data3']};var _0x295492={'method':_0xb079('0x68'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb079('0x47'),_0x26fd76['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x472201,'json':!![]};return rp(_0x295492)[_0xb079('0x1e')](function(_0x52eae0){return db[_0xb079('0x25')][_0xb079('0x45')]({'data5':_0x52eae0[_0xb079('0x69')],'data6':_0x52eae0[_0xb079('0x66')]},{'where':{'id':_0x26fd76['id']}});})[_0xb079('0x3f')](function(_0x916fb7){logger[_0xb079('0x20')](_0xb079('0x6a'),_0x26fd76['id'],_0x916fb7);});}function getOauth2MicrosoftAccessToken(_0x192fde,_0x41e3a9){var _0x4b2cbd={'grant_type':_0xb079('0x6b'),'code':_0x192fde,'scope':AZURE_TOKEN_SCOPES[_0x41e3a9[_0xb079('0x37')]],'redirect_uri':_0x41e3a9[_0xb079('0x53')],'client_id':_0x41e3a9[_0xb079('0x5c')],'client_secret':_0x41e3a9['data3']};var _0x3f2ec6={'method':_0xb079('0x68'),'uri':MICROSOFT_AUTH_URL[_0xb079('0x46')](_0xb079('0x47'),_0x41e3a9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4b2cbd,'json':!![]};return rp(_0x3f2ec6);}exports[_0xb079('0x6c')]=function(_0xd0ca2e,_0x335089){return db['CloudProvider']['findOne']({'where':{'id':_0xd0ca2e[_0xb079('0x41')]['id']},'raw':!![]})[_0xb079('0x1e')](function(_0x14e54f){if(!_0x14e54f)return _0x335089[_0xb079('0x14')](0x194);return{'url':generateMicrosoftAuthorizationUrl(_0x14e54f,_0xd0ca2e[_0xb079('0x6d')]['id'])};})[_0xb079('0x1e')](respondWithResult(_0x335089,null))[_0xb079('0x3f')](handleError(_0x335089,null));};exports[_0xb079('0x6e')]=function(_0x15ee26,_0x59ca30){var _0x2bfa0f=_0x15ee26[_0xb079('0x44')];var _0x1d9b24;var _0x254a42;if(_0x2bfa0f['error'])throw _0x2bfa0f;redis['get'](_0x2bfa0f[_0xb079('0x6f')])[_0xb079('0x1e')](function(_0x155501){if(!_0x155501)throw new Error(_0xb079('0x70'));_0x1d9b24=JSON[_0xb079('0x71')](_0x155501);var _0x318c0c=Buffer[_0xb079('0x72')](_0x2bfa0f['state'],'base64')[_0xb079('0x4c')](_0xb079('0x73'));_0x254a42=JSON['parse'](_0x318c0c);if(!isValidIdToken(_0x2bfa0f[_0xb079('0x4a')],_0x1d9b24[_0xb079('0x5a')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xb079('0x74')](_0x2bfa0f['state']);return getOauth2MicrosoftAccessToken(_0x2bfa0f[_0xb079('0x49')],_0x1d9b24);})['then'](function(_0x25db05){_0x1d9b24[_0xb079('0x75')]=_0x25db05[_0xb079('0x69')];_0x1d9b24[_0xb079('0x67')]=_0x25db05['refresh_token'];return db[_0xb079('0x25')]['update']({'data5':_0x1d9b24[_0xb079('0x75')],'data6':_0x1d9b24[_0xb079('0x67')]},{'where':{'id':_0x1d9b24['id']}});})[_0xb079('0x1e')](function(){setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,_0x1d9b24),0xfa*0x3e8);socket[_0xb079('0x76')](_0xb079('0x77'),{'id':_0x254a42['id']});return;})[_0xb079('0x1e')](respondWithStatusCode(_0x59ca30,null))[_0xb079('0x3f')](function(_0x72e08f){if(_0x254a42){socket[_0xb079('0x76')](_0xb079('0x78'),{'id':_0x254a42['id']});}if(!_0x1d9b24){logger[_0xb079('0x20')](_0xb079('0x79'),_0x72e08f);return _0x59ca30[_0xb079('0x16')](0x1f4)[_0xb079('0x23')](_0x72e08f['message']);}logger[_0xb079('0x20')](_0xb079('0x7a'),_0x1d9b24['id'],_0x72e08f);});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 5803ec7..3b7be31 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 _0x0d6a=['bluebird','request-promise','path','../../config/environment','exports','CloudProvider','lodash','util','../../config/logger','moment'];(function(_0x79d88c,_0x48b19d){var _0x5116a5=function(_0x2597c7){while(--_0x2597c7){_0x79d88c['push'](_0x79d88c['shift']());}};_0x5116a5(++_0x48b19d);}(_0x0d6a,0xa6));var _0xa0d6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x0d6a[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0xa0d6('0x0'));var util=require(_0xa0d6('0x1'));var logger=require(_0xa0d6('0x2'))('api');var moment=require(_0xa0d6('0x3'));var BPromise=require(_0xa0d6('0x4'));var rp=require(_0xa0d6('0x5'));var fs=require('fs');var path=require(_0xa0d6('0x6'));var rimraf=require('rimraf');var config=require(_0xa0d6('0x7'));var attributes=require('./cloudProvider.attributes');module[_0xa0d6('0x8')]=function(_0x1313bf,_0x36f6cd){return _0x1313bf['define'](_0xa0d6('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf644=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CloudProvider','lodash','util','../../config/logger'];(function(_0x56086c,_0x4506c1){var _0x393b7e=function(_0x549c17){while(--_0x549c17){_0x56086c['push'](_0x56086c['shift']());}};_0x393b7e(++_0x4506c1);}(_0xf644,0xf9));var _0x4f64=function(_0x567026,_0x44fdee){_0x567026=_0x567026-0x0;var _0x324935=_0xf644[_0x567026];return _0x324935;};'use strict';var _=require(_0x4f64('0x0'));var util=require(_0x4f64('0x1'));var logger=require(_0x4f64('0x2'))(_0x4f64('0x3'));var moment=require('moment');var BPromise=require(_0x4f64('0x4'));var rp=require(_0x4f64('0x5'));var fs=require('fs');var path=require(_0x4f64('0x6'));var rimraf=require(_0x4f64('0x7'));var config=require(_0x4f64('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x4f64('0x9')]=function(_0x1aa313,_0x136071){return _0x1aa313[_0x4f64('0xa')](_0x4f64('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index d30aa02..1853777 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 _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(_0x5ec1e6,_0x4b2896){var _0x7324fb=function(_0x1ab168){while(--_0x1ab168){_0x5ec1e6['push'](_0x5ec1e6['shift']());}};_0x7324fb(++_0x4b2896);}(_0x2581,0xcb));var _0x1258=function(_0x5c29d9,_0x4a49df){_0x5c29d9=_0x5c29d9-0x0;var _0x1c77ba=_0x2581[_0x5c29d9];return _0x1c77ba;};'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
+var _0x5430=['ioredis','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5430,0x10c));var _0x0543=function(_0x51744a,_0x5ae592){_0x51744a=_0x51744a-0x0;var _0x24316a=_0x5430[_0x51744a];return _0x24316a;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x319568,_0x46bca7,_0x5ac352){return new BPromise(function(_0x372974,_0x7b8280){return client[_0x0543('0xa')](_0x319568,_0x5ac352)[_0x0543('0xb')](function(_0x2fb723){logger[_0x0543('0xc')]('CloudProvider,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'));logger[_0x0543('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x46bca7,_0x0543('0xd'),JSON[_0x0543('0xf')](_0x2fb723));if(_0x2fb723[_0x0543('0x10')]){if(_0x2fb723[_0x0543('0x10')][_0x0543('0x11')]===0x1f4){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x7b8280(_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);}logger[_0x0543('0x10')]('CloudProvider,\x20%s,\x20%s',_0x46bca7,_0x2fb723[_0x0543('0x10')][_0x0543('0x13')]);return _0x372974(_0x2fb723['error']['message']);}else{logger[_0x0543('0xc')](_0x0543('0x12'),_0x46bca7,_0x0543('0xd'));_0x372974(_0x2fb723[_0x0543('0x14')][_0x0543('0x13')]);}})['catch'](function(_0xe69a3d){logger[_0x0543('0x10')](_0x0543('0x12'),_0x46bca7,_0xe69a3d);_0x7b8280(_0xe69a3d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 506fb3d..ce3d33b 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(_0xe21f43,_0x394110){var _0x364719=function(_0x8497cf){while(--_0x8497cf){_0xe21f43['push'](_0xe21f43['shift']());}};_0x364719(++_0x394110);}(_0xadb5,0xad));var _0x5adb=function(_0x465e78,_0x469bae){_0x465e78=_0x465e78-0x0;var _0x2fdaea=_0xadb5[_0x465e78];return _0x2fdaea;};'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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x1a6278,_0x298782){var _0x557688=function(_0x23149c){while(--_0x23149c){_0x1a6278['push'](_0x1a6278['shift']());}};_0x557688(++_0x298782);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc4aa[_0x1d1779];return _0x2377e9;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 4597d33..4f7eb33 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 _0xfe62=['STRING','name','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe62,0x76));var _0x2fe6=function(_0x565b81,_0x1344f2){_0x565b81=_0x565b81-0x0;var _0x18bbd1=_0xfe62[_0x565b81];return _0x18bbd1;};'use strict';var Sequelize=require(_0x2fe6('0x0'));module[_0x2fe6('0x1')]={'name':{'type':Sequelize[_0x2fe6('0x2')],'unique':_0x2fe6('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2fe6('0x2')]},'companyId':{'type':Sequelize[_0x2fe6('0x2')]},'website':{'type':Sequelize[_0x2fe6('0x2')]},'phone':{'type':Sequelize[_0x2fe6('0x2')]},'fax':{'type':Sequelize[_0x2fe6('0x2')]},'type':{'type':Sequelize[_0x2fe6('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x2fe6('0x2')]},'city':{'type':Sequelize[_0x2fe6('0x2')]},'country':{'type':Sequelize[_0x2fe6('0x2')]},'email':{'type':Sequelize[_0x2fe6('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2fe6('0x2')]},'sStreet':{'type':Sequelize[_0x2fe6('0x2')]},'sPostalCode':{'type':Sequelize[_0x2fe6('0x2')]},'sCity':{'type':Sequelize[_0x2fe6('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fe6('0x2')]}};
\ No newline at end of file
+var _0x245e=['exports','name','STRING','sequelize'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x245e,0x15f));var _0xe245=function(_0x2e86b6,_0x47d704){_0x2e86b6=_0x2e86b6-0x0;var _0x5c767b=_0x245e[_0x2e86b6];return _0x5c767b;};'use strict';var Sequelize=require(_0xe245('0x0'));module[_0xe245('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe245('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe245('0x3')]},'companyId':{'type':Sequelize[_0xe245('0x3')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe245('0x3')]},'fax':{'type':Sequelize[_0xe245('0x3')]},'type':{'type':Sequelize[_0xe245('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe245('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xe245('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe245('0x3')]},'sStreet':{'type':Sequelize[_0xe245('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xe245('0x3')]},'sCountry':{'type':Sequelize[_0xe245('0x3')]},'description':{'type':Sequelize[_0xe245('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 650a61d..1f32b82 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 _0x357b=['where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','ids','findOne','CmContact','order','map','getContacts','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','destroy','then','get','Companies','sendStatus','error','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','nolimit','sort'];(function(_0x277b55,_0x8ba28){var _0xff0d15=function(_0x1beefc){while(--_0x1beefc){_0x277b55['push'](_0x277b55['shift']());}};_0xff0d15(++_0x8ba28);}(_0x357b,0x74));var _0xb357=function(_0x10bf41,_0x544170){_0x10bf41=_0x10bf41-0x0;var _0x7b6ea9=_0x357b[_0x10bf41];return _0x7b6ea9;};'use strict';var emlformat=require(_0xb357('0x0'));var rimraf=require(_0xb357('0x1'));var zipdir=require(_0xb357('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb357('0x3'));var moment=require('moment');var BPromise=require(_0xb357('0x4'));var Mustache=require(_0xb357('0x5'));var util=require(_0xb357('0x6'));var path=require(_0xb357('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb357('0x8'));var fs=require('fs');var fs_extra=require(_0xb357('0x9'));var _=require(_0xb357('0xa'));var squel=require(_0xb357('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb357('0xc'));var Papa=require(_0xb357('0xd'));var Redis=require(_0xb357('0xe'));var authService=require(_0xb357('0xf'));var qs=require(_0xb357('0x10'));var as=require(_0xb357('0x11'));var hardwareService=require(_0xb357('0x12'));var logger=require(_0xb357('0x13'))('api');var utils=require(_0xb357('0x14'));var config=require(_0xb357('0x15'));var licenseUtil=require(_0xb357('0x16'));var db=require(_0xb357('0x17'))['db'];function respondWithStatusCode(_0x333918,_0x1f8a8c){_0x1f8a8c=_0x1f8a8c||0xcc;return function(_0x1cc8b6){if(_0x1cc8b6){return _0x333918['sendStatus'](_0x1f8a8c);}return _0x333918['status'](_0x1f8a8c)[_0xb357('0x18')]();};}function respondWithResult(_0x1a16a6,_0x38d5ea){_0x38d5ea=_0x38d5ea||0xc8;return function(_0x3cd7b3){if(_0x3cd7b3){return _0x1a16a6['status'](_0x38d5ea)[_0xb357('0x19')](_0x3cd7b3);}};}function respondWithFilteredResult(_0x5c2205,_0x2782db){return function(_0x545367){if(_0x545367){var _0x465bec=typeof _0x2782db[_0xb357('0x1a')]==='undefined'&&typeof _0x2782db[_0xb357('0x1b')]===_0xb357('0x1c');var _0x4aa032=_0x545367[_0xb357('0x1d')];var _0x4db2c5=_0x465bec?0x0:_0x2782db['offset'];var _0x2334db=_0x465bec?_0x545367['count']:_0x2782db['offset']+_0x2782db[_0xb357('0x1b')];var _0x3b0efe;if(_0x2334db>=_0x4aa032){_0x2334db=_0x4aa032;_0x3b0efe=0xc8;}else{_0x3b0efe=0xce;}_0x5c2205[_0xb357('0x1e')](_0x3b0efe);return _0x5c2205[_0xb357('0x1f')](_0xb357('0x20'),_0x4db2c5+'-'+_0x2334db+'/'+_0x4aa032)[_0xb357('0x19')](_0x545367);}return null;};}function patchUpdates(_0x36422e){return function(_0x5179f7){try{jsonpatch[_0xb357('0x21')](_0x5179f7,_0x36422e,!![]);}catch(_0xb5e0c7){return BPromise[_0xb357('0x22')](_0xb5e0c7);}return _0x5179f7[_0xb357('0x23')]();};}function saveUpdates(_0x59b36e,_0x2d7268){return function(_0x4dd8b3){if(_0x4dd8b3){return _0x4dd8b3['update'](_0x59b36e)['then'](function(_0x22aad8){return _0x22aad8;});}return null;};}function removeEntity(_0x558c3e,_0x43403f){return function(_0x54e861){if(_0x54e861){return _0x54e861[_0xb357('0x24')]()[_0xb357('0x25')](function(){var _0x25ec03=_0x54e861[_0xb357('0x26')]({'plain':!![]});var _0x3f961c=_0xb357('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x3f961c,'resourceId':_0x25ec03['id']}})[_0xb357('0x25')](function(){return _0x54e861;});})['then'](function(){_0x558c3e[_0xb357('0x1e')](0xcc)[_0xb357('0x18')]();});}};}function handleEntityNotFound(_0x4fa31b,_0x3fea57){return function(_0x5dd2a4){if(!_0x5dd2a4){_0x4fa31b[_0xb357('0x28')](0x194);}return _0x5dd2a4;};}function handleError(_0x4c9fd6,_0x3d5705){_0x3d5705=_0x3d5705||0x1f4;return function(_0x2356dc){logger[_0xb357('0x29')](_0x2356dc[_0xb357('0x2a')]);if(_0x2356dc[_0xb357('0x2b')]){delete _0x2356dc['name'];}_0x4c9fd6[_0xb357('0x1e')](_0x3d5705)[_0xb357('0x2c')](_0x2356dc);};}exports[_0xb357('0x2d')]=function(_0x2ab1ed,_0x36c9ee){var _0x40ad2d={},_0x351a3f={},_0x5ea0d1={'count':0x0,'rows':[]};return db[_0xb357('0x2e')][_0xb357('0x2f')]()['then'](function(_0x45271f){_0x351a3f[_0xb357('0x30')]=_[_0xb357('0x31')](_0x45271f);_0x351a3f[_0xb357('0x32')]=_[_0xb357('0x31')](_0x2ab1ed[_0xb357('0x32')]);_0x351a3f['filters']=_[_0xb357('0x33')](_0x351a3f[_0xb357('0x30')],_0x351a3f[_0xb357('0x32')]);_0x40ad2d[_0xb357('0x34')]=_[_0xb357('0x33')](_0x351a3f[_0xb357('0x30')],qs[_0xb357('0x35')](_0x2ab1ed[_0xb357('0x32')][_0xb357('0x35')]));_0x40ad2d[_0xb357('0x34')]=_0x40ad2d[_0xb357('0x34')]['length']?_0x40ad2d['attributes']:_0x351a3f[_0xb357('0x30')];if(!_0x2ab1ed[_0xb357('0x32')]['hasOwnProperty'](_0xb357('0x36'))){_0x40ad2d[_0xb357('0x1b')]=qs[_0xb357('0x1b')](_0x2ab1ed[_0xb357('0x32')]['limit']);_0x40ad2d[_0xb357('0x1a')]=qs[_0xb357('0x1a')](_0x2ab1ed['query'][_0xb357('0x1a')]);}_0x40ad2d['order']=qs[_0xb357('0x37')](_0x2ab1ed[_0xb357('0x32')]['sort']);_0x40ad2d[_0xb357('0x38')]=qs[_0xb357('0x39')](_[_0xb357('0x3a')](_0x2ab1ed[_0xb357('0x32')],_0x351a3f[_0xb357('0x39')]),_0x45271f);if(_0x2ab1ed[_0xb357('0x32')][_0xb357('0x3b')]){_0x40ad2d['where']=_[_0xb357('0x3c')](_0x40ad2d[_0xb357('0x38')],{'$or':_['map'](_0x40ad2d[_0xb357('0x34')],function(_0x11d861){var _0x493e12={};_0x493e12[_0x11d861]={'$like':'%'+_0x2ab1ed[_0xb357('0x32')][_0xb357('0x3b')]+'%'};return _0x493e12;})});}_0x40ad2d=_[_0xb357('0x3c')]({},_0x40ad2d,_0x2ab1ed[_0xb357('0x3d')]);var _0x38ce02={'where':_0x40ad2d[_0xb357('0x38')]};return db[_0xb357('0x2e')][_0xb357('0x1d')](_0x38ce02)[_0xb357('0x25')](function(_0x5f0d90){_0x5ea0d1[_0xb357('0x1d')]=_0x5f0d90;if(_0x2ab1ed[_0xb357('0x32')][_0xb357('0x3e')]){_0x40ad2d[_0xb357('0x3f')]=[{'all':!![]}];}return db[_0xb357('0x2e')][_0xb357('0x40')](_0x40ad2d);})[_0xb357('0x25')](function(_0x53b64b){_0x5ea0d1['rows']=_0x53b64b;return _0x5ea0d1;})[_0xb357('0x25')](respondWithFilteredResult(_0x36c9ee,_0x40ad2d))[_0xb357('0x41')](handleError(_0x36c9ee,null));})[_0xb357('0x41')](handleError(_0x36c9ee,null));};exports[_0xb357('0x42')]=function(_0x1ba1f0,_0x4c5ff6){var _0x24d73b={'raw':![],'where':{'id':_0x1ba1f0['params']['id']}},_0x2b5e2c={};_0x2b5e2c[_0xb357('0x30')]=_[_0xb357('0x31')](db['CmCompany'][_0xb357('0x43')]);_0x2b5e2c['query']=_[_0xb357('0x31')](_0x1ba1f0[_0xb357('0x32')]);_0x2b5e2c[_0xb357('0x39')]=_['intersection'](_0x2b5e2c['model'],_0x2b5e2c[_0xb357('0x32')]);_0x24d73b[_0xb357('0x34')]=_[_0xb357('0x33')](_0x2b5e2c[_0xb357('0x30')],qs[_0xb357('0x35')](_0x1ba1f0[_0xb357('0x32')][_0xb357('0x35')]));_0x24d73b['attributes']=_0x24d73b[_0xb357('0x34')][_0xb357('0x44')]?_0x24d73b[_0xb357('0x34')]:_0x2b5e2c[_0xb357('0x30')];if(_0x1ba1f0[_0xb357('0x32')][_0xb357('0x3e')]){_0x24d73b[_0xb357('0x3f')]=[{'all':!![]}];}_0x24d73b=_[_0xb357('0x3c')]({},_0x24d73b,_0x1ba1f0[_0xb357('0x3d')]);return db[_0xb357('0x2e')][_0xb357('0x45')](_0x24d73b)[_0xb357('0x25')](handleEntityNotFound(_0x4c5ff6,null))[_0xb357('0x25')](respondWithResult(_0x4c5ff6,null))[_0xb357('0x41')](handleError(_0x4c5ff6,null));};exports['create']=function(_0x56cd0c,_0x203923){return db[_0xb357('0x2e')][_0xb357('0x46')](_0x56cd0c[_0xb357('0x47')],{})[_0xb357('0x25')](function(_0x2b534a){var _0x4a68c2=_0x56cd0c['user'][_0xb357('0x26')]({'plain':!![]});if(!_0x4a68c2)throw new Error(_0xb357('0x48'));if(_0x4a68c2['role']===_0xb357('0x49')){var _0x5632c=_0x2b534a[_0xb357('0x26')]({'plain':!![]});var _0x2d5e19='Companies';return db['UserProfileSection'][_0xb357('0x45')]({'where':{'name':_0x2d5e19,'userProfileId':_0x4a68c2[_0xb357('0x4a')]},'raw':!![]})['then'](function(_0x364ff6){if(_0x364ff6&&_0x364ff6[_0xb357('0x4b')]===0x0){return db[_0xb357('0x4c')][_0xb357('0x46')]({'name':_0x5632c['name'],'resourceId':_0x5632c['id'],'type':_0x364ff6[_0xb357('0x2b')],'sectionId':_0x364ff6['id']},{})['then'](function(){return _0x2b534a;});}else{return _0x2b534a;}})[_0xb357('0x41')](function(_0x1af72d){logger[_0xb357('0x29')](_0xb357('0x4d'),_0x1af72d);throw _0x1af72d;});}return _0x2b534a;})[_0xb357('0x25')](respondWithResult(_0x203923,0xc9))['catch'](handleError(_0x203923,null));};exports['update']=function(_0x2b3bad,_0x4db31f){if(_0x2b3bad[_0xb357('0x47')]['id']){delete _0x2b3bad[_0xb357('0x47')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x2b3bad[_0xb357('0x4e')]['id']}})[_0xb357('0x25')](handleEntityNotFound(_0x4db31f,null))[_0xb357('0x25')](saveUpdates(_0x2b3bad[_0xb357('0x47')],null))[_0xb357('0x25')](respondWithResult(_0x4db31f,null))[_0xb357('0x41')](handleError(_0x4db31f,null));};exports['destroy']=function(_0x3c15cc,_0x38bcd5){return db[_0xb357('0x2e')][_0xb357('0x45')]({'where':{'id':_0x3c15cc[_0xb357('0x4e')]['id']}})[_0xb357('0x25')](handleEntityNotFound(_0x38bcd5,null))[_0xb357('0x25')](removeEntity(_0x38bcd5,null))[_0xb357('0x41')](handleError(_0x38bcd5,null));};exports[_0xb357('0x2f')]=function(_0x2ce74e,_0x4fd662){return db[_0xb357('0x2e')][_0xb357('0x2f')]()[_0xb357('0x25')](respondWithResult(_0x4fd662,null))[_0xb357('0x41')](handleError(_0x4fd662,null));};exports[_0xb357('0x4f')]=function(_0x478263,_0x1f0982,_0x3241fe){return db['CmContact'][_0xb357('0x45')]({'where':{'id':_0x478263[_0xb357('0x4e')]['id']}})[_0xb357('0x25')](handleEntityNotFound(_0x1f0982,null))['then'](function(_0x386c90){if(_0x386c90){return _0x386c90[_0xb357('0x4f')](_0x478263['body'][_0xb357('0x50')],_['omit'](_0x478263[_0xb357('0x47')],[_0xb357('0x50'),'id'])||{});}})['then'](respondWithResult(_0x1f0982,null))[_0xb357('0x41')](handleError(_0x1f0982,null));};exports['getContacts']=function(_0x5002f8,_0x52fb7e,_0x29cec9){var _0x342a66={};var _0x3547f3={};var _0x3c2d5a;var _0x371179;return db[_0xb357('0x2e')][_0xb357('0x51')]({'where':{'id':_0x5002f8[_0xb357('0x4e')]['id']}})[_0xb357('0x25')](handleEntityNotFound(_0x52fb7e,null))[_0xb357('0x25')](function(_0x1cf232){if(_0x1cf232){_0x3c2d5a=_0x1cf232;_0x3547f3[_0xb357('0x30')]=_['keys'](db[_0xb357('0x52')][_0xb357('0x43')]);_0x3547f3['query']=_[_0xb357('0x31')](_0x5002f8['query']);_0x3547f3[_0xb357('0x39')]=_['intersection'](_0x3547f3[_0xb357('0x30')],_0x3547f3[_0xb357('0x32')]);_0x342a66['attributes']=_[_0xb357('0x33')](_0x3547f3[_0xb357('0x30')],qs[_0xb357('0x35')](_0x5002f8['query'][_0xb357('0x35')]));_0x342a66[_0xb357('0x34')]=_0x342a66['attributes'][_0xb357('0x44')]?_0x342a66['attributes']:_0x3547f3[_0xb357('0x30')];_0x342a66[_0xb357('0x53')]=qs[_0xb357('0x37')](_0x5002f8[_0xb357('0x32')]['sort']);_0x342a66[_0xb357('0x38')]=qs['filters'](_['pick'](_0x5002f8[_0xb357('0x32')],_0x3547f3[_0xb357('0x39')]));if(_0x5002f8[_0xb357('0x32')][_0xb357('0x3b')]){_0x342a66[_0xb357('0x38')]=_[_0xb357('0x3c')](_0x342a66['where'],{'$or':_[_0xb357('0x54')](_0x342a66['attributes'],function(_0x23e1f0){var _0x54c8fa={};_0x54c8fa[_0x23e1f0]={'$like':'%'+_0x5002f8[_0xb357('0x32')][_0xb357('0x3b')]+'%'};return _0x54c8fa;})});}_0x342a66=_['merge']({},_0x342a66,_0x5002f8['options']);return _0x3c2d5a[_0xb357('0x55')](_0x342a66);}})[_0xb357('0x25')](function(_0xf3260c){if(_0xf3260c){_0x371179=_0xf3260c[_0xb357('0x44')];if(!_0x5002f8['query']['hasOwnProperty'](_0xb357('0x36'))){_0x342a66[_0xb357('0x1b')]=qs['limit'](_0x5002f8[_0xb357('0x32')][_0xb357('0x1b')]);_0x342a66[_0xb357('0x1a')]=qs[_0xb357('0x1a')](_0x5002f8[_0xb357('0x32')][_0xb357('0x1a')]);}return _0x3c2d5a[_0xb357('0x55')](_0x342a66);}})[_0xb357('0x25')](function(_0x324493){if(_0x324493){return _0x324493?{'count':_0x371179,'rows':_0x324493}:null;}})[_0xb357('0x25')](respondWithResult(_0x52fb7e,null))[_0xb357('0x41')](handleError(_0x52fb7e,null));};
\ No newline at end of file
+var _0x272b=['fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','CmCompany','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','order','map','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','Companies','UserProfileResource','end','error','stack','name','send','describe','model','query','keys','filters','intersection'];(function(_0x33ffb2,_0x4987d3){var _0x19f512=function(_0x5832d7){while(--_0x5832d7){_0x33ffb2['push'](_0x33ffb2['shift']());}};_0x19f512(++_0x4987d3);}(_0x272b,0xd8));var _0xb272=function(_0xf9c82d,_0x375263){_0xf9c82d=_0xf9c82d-0x0;var _0x39c593=_0x272b[_0xf9c82d];return _0x39c593;};'use strict';var emlformat=require(_0xb272('0x0'));var rimraf=require(_0xb272('0x1'));var zipdir=require(_0xb272('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb272('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb272('0x4'));var util=require('util');var path=require(_0xb272('0x5'));var sox=require(_0xb272('0x6'));var csv=require('to-csv');var ejs=require(_0xb272('0x7'));var fs=require('fs');var fs_extra=require(_0xb272('0x8'));var _=require(_0xb272('0x9'));var squel=require(_0xb272('0xa'));var crypto=require(_0xb272('0xb'));var jsforce=require(_0xb272('0xc'));var deskjs=require(_0xb272('0xd'));var toCsv=require(_0xb272('0xe'));var querystring=require(_0xb272('0xf'));var Papa=require(_0xb272('0x10'));var Redis=require(_0xb272('0x11'));var authService=require(_0xb272('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb272('0x13'));var hardwareService=require(_0xb272('0x14'));var logger=require('../../config/logger')(_0xb272('0x15'));var utils=require('../../config/utils');var config=require(_0xb272('0x16'));var licenseUtil=require(_0xb272('0x17'));var db=require(_0xb272('0x18'))['db'];function respondWithStatusCode(_0x3c964e,_0x52c4ee){_0x52c4ee=_0x52c4ee||0xcc;return function(_0x5ef719){if(_0x5ef719){return _0x3c964e[_0xb272('0x19')](_0x52c4ee);}return _0x3c964e[_0xb272('0x1a')](_0x52c4ee)['end']();};}function respondWithResult(_0x5b253c,_0xf0d570){_0xf0d570=_0xf0d570||0xc8;return function(_0x14779d){if(_0x14779d){return _0x5b253c[_0xb272('0x1a')](_0xf0d570)[_0xb272('0x1b')](_0x14779d);}};}function respondWithFilteredResult(_0x175df9,_0x12b531){return function(_0x220ba9){if(_0x220ba9){var _0x4ebfe0=typeof _0x12b531['offset']===_0xb272('0x1c')&&typeof _0x12b531[_0xb272('0x1d')]==='undefined';var _0x493893=_0x220ba9[_0xb272('0x1e')];var _0x2c1774=_0x4ebfe0?0x0:_0x12b531['offset'];var _0x4477d8=_0x4ebfe0?_0x220ba9['count']:_0x12b531[_0xb272('0x1f')]+_0x12b531['limit'];var _0x12da43;if(_0x4477d8>=_0x493893){_0x4477d8=_0x493893;_0x12da43=0xc8;}else{_0x12da43=0xce;}_0x175df9[_0xb272('0x1a')](_0x12da43);return _0x175df9['set'](_0xb272('0x20'),_0x2c1774+'-'+_0x4477d8+'/'+_0x493893)[_0xb272('0x1b')](_0x220ba9);}return null;};}function patchUpdates(_0x3435bc){return function(_0x22d244){try{jsonpatch[_0xb272('0x21')](_0x22d244,_0x3435bc,!![]);}catch(_0x6c961e){return BPromise[_0xb272('0x22')](_0x6c961e);}return _0x22d244[_0xb272('0x23')]();};}function saveUpdates(_0x3557cd,_0x1dea93){return function(_0x49d6dc){if(_0x49d6dc){return _0x49d6dc[_0xb272('0x24')](_0x3557cd)[_0xb272('0x25')](function(_0x25a68e){return _0x25a68e;});}return null;};}function removeEntity(_0x2a8282,_0x131cf7){return function(_0x53d495){if(_0x53d495){return _0x53d495['destroy']()[_0xb272('0x25')](function(){var _0x1846dd=_0x53d495['get']({'plain':!![]});var _0xf23781=_0xb272('0x26');return db[_0xb272('0x27')]['destroy']({'where':{'type':_0xf23781,'resourceId':_0x1846dd['id']}})[_0xb272('0x25')](function(){return _0x53d495;});})[_0xb272('0x25')](function(){_0x2a8282[_0xb272('0x1a')](0xcc)[_0xb272('0x28')]();});}};}function handleEntityNotFound(_0x2fc6c4,_0x193e27){return function(_0x39ffa8){if(!_0x39ffa8){_0x2fc6c4[_0xb272('0x19')](0x194);}return _0x39ffa8;};}function handleError(_0x2547b4,_0x30477f){_0x30477f=_0x30477f||0x1f4;return function(_0x300101){logger[_0xb272('0x29')](_0x300101[_0xb272('0x2a')]);if(_0x300101['name']){delete _0x300101[_0xb272('0x2b')];}_0x2547b4[_0xb272('0x1a')](_0x30477f)[_0xb272('0x2c')](_0x300101);};}exports['index']=function(_0x5b8640,_0xbc0c6a){var _0x5d0afc={},_0x1f52f3={},_0x5acc55={'count':0x0,'rows':[]};return db['CmCompany'][_0xb272('0x2d')]()[_0xb272('0x25')](function(_0x13b026){_0x1f52f3[_0xb272('0x2e')]=_['keys'](_0x13b026);_0x1f52f3[_0xb272('0x2f')]=_[_0xb272('0x30')](_0x5b8640[_0xb272('0x2f')]);_0x1f52f3[_0xb272('0x31')]=_[_0xb272('0x32')](_0x1f52f3[_0xb272('0x2e')],_0x1f52f3[_0xb272('0x2f')]);_0x5d0afc['attributes']=_[_0xb272('0x32')](_0x1f52f3['model'],qs[_0xb272('0x33')](_0x5b8640[_0xb272('0x2f')]['fields']));_0x5d0afc[_0xb272('0x34')]=_0x5d0afc[_0xb272('0x34')][_0xb272('0x35')]?_0x5d0afc[_0xb272('0x34')]:_0x1f52f3[_0xb272('0x2e')];if(!_0x5b8640['query'][_0xb272('0x36')](_0xb272('0x37'))){_0x5d0afc[_0xb272('0x1d')]=qs[_0xb272('0x1d')](_0x5b8640['query'][_0xb272('0x1d')]);_0x5d0afc[_0xb272('0x1f')]=qs[_0xb272('0x1f')](_0x5b8640['query'][_0xb272('0x1f')]);}_0x5d0afc['order']=qs[_0xb272('0x38')](_0x5b8640[_0xb272('0x2f')][_0xb272('0x38')]);_0x5d0afc['where']=qs['filters'](_[_0xb272('0x39')](_0x5b8640[_0xb272('0x2f')],_0x1f52f3['filters']),_0x13b026);if(_0x5b8640['query'][_0xb272('0x3a')]){_0x5d0afc[_0xb272('0x3b')]=_[_0xb272('0x3c')](_0x5d0afc[_0xb272('0x3b')],{'$or':_['map'](_0x5d0afc[_0xb272('0x34')],function(_0x203175){var _0x22c9e1={};_0x22c9e1[_0x203175]={'$like':'%'+_0x5b8640[_0xb272('0x2f')][_0xb272('0x3a')]+'%'};return _0x22c9e1;})});}_0x5d0afc=_['merge']({},_0x5d0afc,_0x5b8640['options']);var _0x442c92={'where':_0x5d0afc[_0xb272('0x3b')]};return db[_0xb272('0x3d')][_0xb272('0x1e')](_0x442c92)['then'](function(_0x692df5){_0x5acc55[_0xb272('0x1e')]=_0x692df5;if(_0x5b8640['query'][_0xb272('0x3e')]){_0x5d0afc[_0xb272('0x3f')]=[{'all':!![]}];}return db[_0xb272('0x3d')][_0xb272('0x40')](_0x5d0afc);})[_0xb272('0x25')](function(_0xdc8f1a){_0x5acc55[_0xb272('0x41')]=_0xdc8f1a;return _0x5acc55;})[_0xb272('0x25')](respondWithFilteredResult(_0xbc0c6a,_0x5d0afc))[_0xb272('0x42')](handleError(_0xbc0c6a,null));})[_0xb272('0x42')](handleError(_0xbc0c6a,null));};exports[_0xb272('0x43')]=function(_0x3e4dfd,_0x2d0b4a){var _0x3dc31e={'raw':![],'where':{'id':_0x3e4dfd[_0xb272('0x44')]['id']}},_0x43cfc1={};_0x43cfc1['model']=_[_0xb272('0x30')](db[_0xb272('0x3d')]['rawAttributes']);_0x43cfc1[_0xb272('0x2f')]=_['keys'](_0x3e4dfd[_0xb272('0x2f')]);_0x43cfc1[_0xb272('0x31')]=_[_0xb272('0x32')](_0x43cfc1[_0xb272('0x2e')],_0x43cfc1['query']);_0x3dc31e[_0xb272('0x34')]=_[_0xb272('0x32')](_0x43cfc1[_0xb272('0x2e')],qs['fields'](_0x3e4dfd['query']['fields']));_0x3dc31e['attributes']=_0x3dc31e[_0xb272('0x34')][_0xb272('0x35')]?_0x3dc31e[_0xb272('0x34')]:_0x43cfc1[_0xb272('0x2e')];if(_0x3e4dfd[_0xb272('0x2f')][_0xb272('0x3e')]){_0x3dc31e[_0xb272('0x3f')]=[{'all':!![]}];}_0x3dc31e=_[_0xb272('0x3c')]({},_0x3dc31e,_0x3e4dfd[_0xb272('0x45')]);return db[_0xb272('0x3d')]['find'](_0x3dc31e)[_0xb272('0x25')](handleEntityNotFound(_0x2d0b4a,null))[_0xb272('0x25')](respondWithResult(_0x2d0b4a,null))[_0xb272('0x42')](handleError(_0x2d0b4a,null));};exports[_0xb272('0x46')]=function(_0x503568,_0x407b95){return db['CmCompany']['create'](_0x503568[_0xb272('0x47')],{})['then'](function(_0x256bbb){var _0x3c21ed=_0x503568[_0xb272('0x48')][_0xb272('0x49')]({'plain':!![]});if(!_0x3c21ed)throw new Error(_0xb272('0x4a'));if(_0x3c21ed[_0xb272('0x4b')]===_0xb272('0x48')){var _0x3a7039=_0x256bbb[_0xb272('0x49')]({'plain':!![]});var _0x185e1c=_0xb272('0x26');return db[_0xb272('0x4c')]['find']({'where':{'name':_0x185e1c,'userProfileId':_0x3c21ed[_0xb272('0x4d')]},'raw':!![]})[_0xb272('0x25')](function(_0x6b6490){if(_0x6b6490&&_0x6b6490['autoAssociation']===0x0){return db[_0xb272('0x27')]['create']({'name':_0x3a7039[_0xb272('0x2b')],'resourceId':_0x3a7039['id'],'type':_0x6b6490['name'],'sectionId':_0x6b6490['id']},{})[_0xb272('0x25')](function(){return _0x256bbb;});}else{return _0x256bbb;}})[_0xb272('0x42')](function(_0x50f32c){logger[_0xb272('0x29')](_0xb272('0x4e'),_0x50f32c);throw _0x50f32c;});}return _0x256bbb;})[_0xb272('0x25')](respondWithResult(_0x407b95,0xc9))[_0xb272('0x42')](handleError(_0x407b95,null));};exports[_0xb272('0x24')]=function(_0xd02a44,_0x52009c){if(_0xd02a44[_0xb272('0x47')]['id']){delete _0xd02a44['body']['id'];}return db[_0xb272('0x3d')][_0xb272('0x4f')]({'where':{'id':_0xd02a44[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x52009c,null))[_0xb272('0x25')](saveUpdates(_0xd02a44[_0xb272('0x47')],null))[_0xb272('0x25')](respondWithResult(_0x52009c,null))[_0xb272('0x42')](handleError(_0x52009c,null));};exports[_0xb272('0x50')]=function(_0x247185,_0x43bb2a){return db[_0xb272('0x3d')][_0xb272('0x4f')]({'where':{'id':_0x247185['params']['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x43bb2a,null))[_0xb272('0x25')](removeEntity(_0x43bb2a,null))[_0xb272('0x42')](handleError(_0x43bb2a,null));};exports['describe']=function(_0x2fc535,_0x5e048d){return db['CmCompany'][_0xb272('0x2d')]()[_0xb272('0x25')](respondWithResult(_0x5e048d,null))[_0xb272('0x42')](handleError(_0x5e048d,null));};exports[_0xb272('0x51')]=function(_0x156af4,_0x10a81e,_0x40f4d0){return db[_0xb272('0x52')][_0xb272('0x4f')]({'where':{'id':_0x156af4[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x10a81e,null))['then'](function(_0x1a6c1f){if(_0x1a6c1f){return _0x1a6c1f[_0xb272('0x51')](_0x156af4[_0xb272('0x47')][_0xb272('0x53')],_['omit'](_0x156af4[_0xb272('0x47')],['ids','id'])||{});}})[_0xb272('0x25')](respondWithResult(_0x10a81e,null))[_0xb272('0x42')](handleError(_0x10a81e,null));};exports[_0xb272('0x54')]=function(_0x5ef715,_0x34866d,_0x2f7872){var _0x3fade5={};var _0x38c93c={};var _0x1ef88d;var _0x160a76;return db['CmCompany'][_0xb272('0x55')]({'where':{'id':_0x5ef715[_0xb272('0x44')]['id']}})[_0xb272('0x25')](handleEntityNotFound(_0x34866d,null))[_0xb272('0x25')](function(_0x356627){if(_0x356627){_0x1ef88d=_0x356627;_0x38c93c[_0xb272('0x2e')]=_['keys'](db[_0xb272('0x52')][_0xb272('0x56')]);_0x38c93c[_0xb272('0x2f')]=_[_0xb272('0x30')](_0x5ef715[_0xb272('0x2f')]);_0x38c93c[_0xb272('0x31')]=_[_0xb272('0x32')](_0x38c93c['model'],_0x38c93c['query']);_0x3fade5['attributes']=_[_0xb272('0x32')](_0x38c93c[_0xb272('0x2e')],qs['fields'](_0x5ef715[_0xb272('0x2f')][_0xb272('0x33')]));_0x3fade5[_0xb272('0x34')]=_0x3fade5[_0xb272('0x34')][_0xb272('0x35')]?_0x3fade5[_0xb272('0x34')]:_0x38c93c[_0xb272('0x2e')];_0x3fade5[_0xb272('0x57')]=qs[_0xb272('0x38')](_0x5ef715[_0xb272('0x2f')][_0xb272('0x38')]);_0x3fade5['where']=qs[_0xb272('0x31')](_[_0xb272('0x39')](_0x5ef715[_0xb272('0x2f')],_0x38c93c[_0xb272('0x31')]));if(_0x5ef715[_0xb272('0x2f')][_0xb272('0x3a')]){_0x3fade5[_0xb272('0x3b')]=_[_0xb272('0x3c')](_0x3fade5[_0xb272('0x3b')],{'$or':_[_0xb272('0x58')](_0x3fade5[_0xb272('0x34')],function(_0x2403e3){var _0x3b1527={};_0x3b1527[_0x2403e3]={'$like':'%'+_0x5ef715[_0xb272('0x2f')][_0xb272('0x3a')]+'%'};return _0x3b1527;})});}_0x3fade5=_[_0xb272('0x3c')]({},_0x3fade5,_0x5ef715['options']);return _0x1ef88d[_0xb272('0x54')](_0x3fade5);}})[_0xb272('0x25')](function(_0x5f06c2){if(_0x5f06c2){_0x160a76=_0x5f06c2['length'];if(!_0x5ef715[_0xb272('0x2f')][_0xb272('0x36')](_0xb272('0x37'))){_0x3fade5[_0xb272('0x1d')]=qs[_0xb272('0x1d')](_0x5ef715['query'][_0xb272('0x1d')]);_0x3fade5[_0xb272('0x1f')]=qs[_0xb272('0x1f')](_0x5ef715[_0xb272('0x2f')][_0xb272('0x1f')]);}return _0x1ef88d[_0xb272('0x54')](_0x3fade5);}})[_0xb272('0x25')](function(_0x2c5724){if(_0x2c5724){return _0x2c5724?{'count':_0x160a76,'rows':_0x2c5724}:null;}})[_0xb272('0x25')](respondWithResult(_0x34866d,null))['catch'](handleError(_0x34866d,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index e129c3b..c3d01f0 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 _0x07a6=['moment','request-promise','path','rimraf','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x48baec,_0x3f9c47){var _0x4454ac=function(_0xfc751){while(--_0xfc751){_0x48baec['push'](_0x48baec['shift']());}};_0x4454ac(++_0x3f9c47);}(_0x07a6,0x17e));var _0x607a=function(_0x1a7f7d,_0x3cedf0){_0x1a7f7d=_0x1a7f7d-0x0;var _0x2a1453=_0x07a6[_0x1a7f7d];return _0x2a1453;};'use strict';var _=require(_0x607a('0x0'));var util=require('util');var logger=require(_0x607a('0x1'))(_0x607a('0x2'));var moment=require(_0x607a('0x3'));var BPromise=require('bluebird');var rp=require(_0x607a('0x4'));var fs=require('fs');var path=require(_0x607a('0x5'));var rimraf=require(_0x607a('0x6'));var config=require('../../config/environment');var attributes=require(_0x607a('0x7'));module[_0x607a('0x8')]=function(_0x11ddf9,_0x36b9e4){return _0x11ddf9['define'](_0x607a('0x9'),attributes,{'tableName':_0x607a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c40=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x4e11e7,_0x42d0b6){var _0x1d7d39=function(_0x416030){while(--_0x416030){_0x4e11e7['push'](_0x4e11e7['shift']());}};_0x1d7d39(++_0x42d0b6);}(_0x5c40,0x11c));var _0x05c4=function(_0x53e1c4,_0x11347f){_0x53e1c4=_0x53e1c4-0x0;var _0xaa2da3=_0x5c40[_0x53e1c4];return _0xaa2da3;};'use strict';var _=require(_0x05c4('0x0'));var util=require(_0x05c4('0x1'));var logger=require(_0x05c4('0x2'))(_0x05c4('0x3'));var moment=require(_0x05c4('0x4'));var BPromise=require(_0x05c4('0x5'));var rp=require(_0x05c4('0x6'));var fs=require('fs');var path=require(_0x05c4('0x7'));var rimraf=require('rimraf');var config=require(_0x05c4('0x8'));var attributes=require('./cmCompany.attributes');module[_0x05c4('0x9')]=function(_0x36383d,_0x2f3852){return _0x36383d[_0x05c4('0xa')](_0x05c4('0xb'),attributes,{'tableName':_0x05c4('0xc'),'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 c3ac4d2..bd1f116 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 _0x33d0=['info','debug','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33d0,0xc9));var _0x033d=function(_0x329a4c,_0x4a124f){_0x329a4c=_0x329a4c-0x0;var _0x4b4197=_0x33d0[_0x329a4c];return _0x4b4197;};'use strict';var _=require(_0x033d('0x0'));var util=require(_0x033d('0x1'));var moment=require(_0x033d('0x2'));var BPromise=require(_0x033d('0x3'));var rs=require(_0x033d('0x4'));var fs=require('fs');var Redis=require(_0x033d('0x5'));var db=require(_0x033d('0x6'))['db'];var utils=require(_0x033d('0x7'));var logger=require(_0x033d('0x8'))(_0x033d('0x9'));var config=require(_0x033d('0xa'));var jayson=require(_0x033d('0xb'));var client=jayson['client'][_0x033d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x229c68,_0x20e750,_0x4e4c68){return new BPromise(function(_0x29984f,_0x4ee2de){return client[_0x033d('0xd')](_0x229c68,_0x4e4c68)[_0x033d('0xe')](function(_0x34993d){logger[_0x033d('0xf')]('CmCompany,\x20%s,\x20%s',_0x20e750,'request\x20sent');logger[_0x033d('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x20e750,_0x033d('0x11'),JSON[_0x033d('0x12')](_0x34993d));if(_0x34993d[_0x033d('0x13')]){if(_0x34993d['error'][_0x033d('0x14')]===0x1f4){logger[_0x033d('0x13')](_0x033d('0x15'),_0x20e750,_0x34993d[_0x033d('0x13')]['message']);return _0x4ee2de(_0x34993d['error'][_0x033d('0x16')]);}logger[_0x033d('0x13')]('CmCompany,\x20%s,\x20%s',_0x20e750,_0x34993d[_0x033d('0x13')]['message']);return _0x29984f(_0x34993d[_0x033d('0x13')]['message']);}else{logger[_0x033d('0xf')](_0x033d('0x15'),_0x20e750,_0x033d('0x11'));_0x29984f(_0x34993d['result'][_0x033d('0x16')]);}})[_0x033d('0x17')](function(_0x3c2ce8){logger[_0x033d('0x13')]('CmCompany,\x20%s,\x20%s',_0x20e750,_0x3c2ce8);_0x4ee2de(_0x3c2ce8);});});}
\ No newline at end of file
+var _0x6178=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then'];(function(_0x4dd441,_0x4a0ea0){var _0x492067=function(_0x310ab8){while(--_0x310ab8){_0x4dd441['push'](_0x4dd441['shift']());}};_0x492067(++_0x4a0ea0);}(_0x6178,0x8e));var _0x8617=function(_0x275560,_0xead495){_0x275560=_0x275560-0x0;var _0x3dcabc=_0x6178[_0x275560];return _0x3dcabc;};'use strict';var _=require(_0x8617('0x0'));var util=require(_0x8617('0x1'));var moment=require(_0x8617('0x2'));var BPromise=require(_0x8617('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8617('0x4'));var db=require(_0x8617('0x5'))['db'];var utils=require(_0x8617('0x6'));var logger=require('../../config/logger')(_0x8617('0x7'));var config=require(_0x8617('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8617('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6318,_0x5e6380,_0x185e85){return new BPromise(function(_0x2582e9,_0x470bcc){return client[_0x8617('0xa')](_0x1f6318,_0x185e85)[_0x8617('0xb')](function(_0x383555){logger['info'](_0x8617('0xc'),_0x5e6380,_0x8617('0xd'));logger[_0x8617('0xe')](_0x8617('0xf'),_0x5e6380,'request\x20sent',JSON[_0x8617('0x10')](_0x383555));if(_0x383555[_0x8617('0x11')]){if(_0x383555[_0x8617('0x11')][_0x8617('0x12')]===0x1f4){logger[_0x8617('0x11')](_0x8617('0xc'),_0x5e6380,_0x383555['error'][_0x8617('0x13')]);return _0x470bcc(_0x383555['error'][_0x8617('0x13')]);}logger['error'](_0x8617('0xc'),_0x5e6380,_0x383555[_0x8617('0x11')][_0x8617('0x13')]);return _0x2582e9(_0x383555[_0x8617('0x11')][_0x8617('0x13')]);}else{logger[_0x8617('0x14')](_0x8617('0xc'),_0x5e6380,_0x8617('0xd'));_0x2582e9(_0x383555['result']['message']);}})[_0x8617('0x15')](function(_0x5c6ec1){logger['error'](_0x8617('0xc'),_0x5e6380,_0x5c6ec1);_0x470bcc(_0x5c6ec1);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 91b9b2a..3e58b2a 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 _0x57ac=['/describe','describe','show','/:id/contacts','getContacts','post','create','addContacts','put','update','/:id','destroy','exports','multer','express','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','index'];(function(_0x3d618f,_0x3bfd66){var _0x51a32b=function(_0x3f9e15){while(--_0x3f9e15){_0x3d618f['push'](_0x3d618f['shift']());}};_0x51a32b(++_0x3bfd66);}(_0x57ac,0x71));var _0xc57a=function(_0x81bb9b,_0x3d47b5){_0x81bb9b=_0x81bb9b-0x0;var _0x28cd0e=_0x57ac[_0x81bb9b];return _0x28cd0e;};'use strict';var multer=require(_0xc57a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc57a('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc57a('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc57a('0x3'));router[_0xc57a('0x4')]('/',auth[_0xc57a('0x5')](),controller[_0xc57a('0x6')]);router[_0xc57a('0x4')](_0xc57a('0x7'),auth['isAuthenticated'](),controller[_0xc57a('0x8')]);router[_0xc57a('0x4')]('/:id',auth[_0xc57a('0x5')](),controller[_0xc57a('0x9')]);router[_0xc57a('0x4')](_0xc57a('0xa'),auth[_0xc57a('0x5')](),controller[_0xc57a('0xb')]);router[_0xc57a('0xc')]('/',auth[_0xc57a('0x5')](),controller[_0xc57a('0xd')]);router['post'](_0xc57a('0xa'),auth[_0xc57a('0x5')](),controller[_0xc57a('0xe')]);router[_0xc57a('0xf')]('/:id',auth[_0xc57a('0x5')](),controller[_0xc57a('0x10')]);router['delete'](_0xc57a('0x11'),auth[_0xc57a('0x5')](),controller[_0xc57a('0x12')]);module[_0xc57a('0x13')]=router;
\ No newline at end of file
+var _0x5def=['express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','addContacts','put','delete','destroy','exports','multer','util','path'];(function(_0x47412e,_0x1acf84){var _0x398524=function(_0x2d358c){while(--_0x2d358c){_0x47412e['push'](_0x47412e['shift']());}};_0x398524(++_0x1acf84);}(_0x5def,0x162));var _0xf5de=function(_0x3614f2,_0x1bb103){_0x3614f2=_0x3614f2-0x0;var _0x5dc391=_0x5def[_0x3614f2];return _0x5dc391;};'use strict';var multer=require(_0xf5de('0x0'));var util=require(_0xf5de('0x1'));var path=require(_0xf5de('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5de('0x3'));var router=express[_0xf5de('0x4')]();var fs_extra=require(_0xf5de('0x5'));var auth=require(_0xf5de('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5de('0x7'));router[_0xf5de('0x8')]('/',auth[_0xf5de('0x9')](),controller['index']);router[_0xf5de('0x8')](_0xf5de('0xa'),auth[_0xf5de('0x9')](),controller[_0xf5de('0xb')]);router['get'](_0xf5de('0xc'),auth['isAuthenticated'](),controller[_0xf5de('0xd')]);router[_0xf5de('0x8')](_0xf5de('0xe'),auth[_0xf5de('0x9')](),controller['getContacts']);router[_0xf5de('0xf')]('/',auth[_0xf5de('0x9')](),controller['create']);router[_0xf5de('0xf')](_0xf5de('0xe'),auth[_0xf5de('0x9')](),controller[_0xf5de('0x10')]);router[_0xf5de('0x11')]('/:id',auth[_0xf5de('0x9')](),controller['update']);router[_0xf5de('0x12')](_0xf5de('0xc'),auth['isAuthenticated'](),controller[_0xf5de('0x13')]);module[_0xf5de('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index fd9642a..05ad743 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 _0x003c=['INTEGER','lodash','sequelize','exports','STRING','TEXT'];(function(_0x3edddc,_0xe5c487){var _0x512473=function(_0x2ae0d4){while(--_0x2ae0d4){_0x3edddc['push'](_0x3edddc['shift']());}};_0x512473(++_0xe5c487);}(_0x003c,0x8b));var _0xc003=function(_0x1b4166,_0x422c86){_0x1b4166=_0x1b4166-0x0;var _0x35df01=_0x003c[_0x1b4166];return _0x35df01;};'use strict';var _=require(_0xc003('0x0'));var Sequelize=require(_0xc003('0x1'));module[_0xc003('0x2')]={'firstName':{'type':Sequelize[_0xc003('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc003('0x3')]},'street':{'type':Sequelize[_0xc003('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc003('0x3')]},'country':{'type':Sequelize[_0xc003('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc003('0x4')]},'phone':{'type':Sequelize[_0xc003('0x3')]},'mobile':{'type':Sequelize[_0xc003('0x3')]},'fax':{'type':Sequelize[_0xc003('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xc003('0x3')]},'fb_data':{'type':Sequelize[_0xc003('0x3')]},'twitter':{'type':Sequelize[_0xc003('0x3')]},'skype':{'type':Sequelize[_0xc003('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xc003('0x3')]},'line':{'type':Sequelize[_0xc003('0x3')]},'wechat':{'type':Sequelize[_0xc003('0x3')]},'telegram':{'type':Sequelize[_0xc003('0x3')]},'UserId':{'type':Sequelize[_0xc003('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x631f=['lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x631f,0x198));var _0xf631=function(_0x5a8aa3,_0x2294d5){_0x5a8aa3=_0x5a8aa3-0x0;var _0x5d0458=_0x631f[_0x5a8aa3];return _0x5d0458;};'use strict';var _=require(_0xf631('0x0'));var Sequelize=require(_0xf631('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xf631('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf631('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf631('0x2')]},'country':{'type':Sequelize[_0xf631('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf631('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf631('0x2')]},'fax':{'type':Sequelize[_0xf631('0x2')]},'email':{'type':Sequelize[_0xf631('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xf631('0x2')]},'fb_data':{'type':Sequelize[_0xf631('0x2')]},'twitter':{'type':Sequelize[_0xf631('0x2')]},'skype':{'type':Sequelize[_0xf631('0x2')]},'teams':{'type':Sequelize[_0xf631('0x2')]},'viber':{'type':Sequelize[_0xf631('0x2')]},'line':{'type':Sequelize[_0xf631('0x2')]},'wechat':{'type':Sequelize[_0xf631('0x2')]},'telegram':{'type':Sequelize[_0xf631('0x2')]},'UserId':{'type':Sequelize[_0xf631('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xf631('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf631('0x6')],'defaultValue':Sequelize[_0xf631('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 6274205..1a8c9ca 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 _0x38fd=['then','end','stack','name','send','index','CmContact','keys','length','startsWith','push','CmCustomField','findOne','trimStart','fieldType','type','query','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','field','color','from','tools_tags','select','left_join','cm_user_has_contacts','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','parseSearch','sqlOperator','conditions','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','DATE','text','start','hasOwnProperty','filter','Contact','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','isEmpty','having','t.id\x20IN\x20?','some','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','role','agent','toString','sequelize','keyBy','merge','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','rows','catch','describe','tags','cf_','displayName','findAll','columnName','alias','custom','values','body','get','mergeWith','isArray','[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','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','create','join','bulkCreate','duplicates','$or','findOrCreate','spread','show','find','params','isNil','$and','omit','format','cf_%d','pickBy','table','cm_contacts','setFields','toParam','phone','getTags','rawAttributes','options','setTags','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','fork','../../components/import/cm/csv','pid','upload','parse','meta','import','binding','firstName','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','stringify','exit','getJourney','mail','chat','sms','openchannel','fax','voice','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','Website','closed','closedAt','disposition','secondDisposition','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','substatus','startCase','Interaction','all','sortBy','reverse','slice','moment','bluebird','util','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmContact.socket','register','offset','count','limit','status','set','Content-Range','json','update','destroy'];(function(_0x1fc0f3,_0x4e92c7){var _0x50dde9=function(_0x2773e7){while(--_0x2773e7){_0x1fc0f3['push'](_0x1fc0f3['shift']());}};_0x50dde9(++_0x4e92c7);}(_0x38fd,0x100));var _0xd38f=function(_0x1e0806,_0x365bc5){_0x1e0806=_0x1e0806-0x0;var _0x2ac21d=_0x38fd[_0x1e0806];return _0x2ac21d;};'use strict';var moment=require(_0xd38f('0x0'));var BPromise=require(_0xd38f('0x1'));var util=require(_0xd38f('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0xd38f('0x3'));var Papa=require(_0xd38f('0x4'));var Redis=require(_0xd38f('0x5'));var qs=require(_0xd38f('0x6'));var as=require(_0xd38f('0x7'));var logger=require(_0xd38f('0x8'))(_0xd38f('0x9'));var config=require(_0xd38f('0xa'));var db=require(_0xd38f('0xb'))['db'];config[_0xd38f('0xc')]=_[_0xd38f('0xd')](config[_0xd38f('0xc')],{'host':_0xd38f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd38f('0xc')]));require(_0xd38f('0xf'))[_0xd38f('0x10')](socket);function respondWithResult(_0xd4cc94,_0x217157){_0x217157=_0x217157||0xc8;return function(_0x3c2afe){if(_0x3c2afe){return _0xd4cc94['status'](_0x217157)['json'](_0x3c2afe);}};}function respondWithFilteredResult(_0x2f52b2,_0x5cd68c){return function(_0x9f473b){if(_0x9f473b){var _0x5f1cde=typeof _0x5cd68c[_0xd38f('0x11')]==='undefined'&&typeof _0x5cd68c['limit']==='undefined';var _0x5b6651=_0x9f473b[_0xd38f('0x12')];var _0x299e04=_0x5f1cde?0x0:_0x5cd68c[_0xd38f('0x11')];var _0x2f978b=_0x5f1cde?_0x9f473b[_0xd38f('0x12')]:_0x5cd68c['offset']+_0x5cd68c[_0xd38f('0x13')];var _0x238af6;if(_0x2f978b>=_0x5b6651){_0x2f978b=_0x5b6651;_0x238af6=0xc8;}else{_0x238af6=0xce;}_0x2f52b2[_0xd38f('0x14')](_0x238af6);return _0x2f52b2[_0xd38f('0x15')](_0xd38f('0x16'),_0x299e04+'-'+_0x2f978b+'/'+_0x5b6651)[_0xd38f('0x17')](_0x9f473b);}return null;};}function saveUpdates(_0x39b1f1){return function(_0x48f1b7){if(_0x48f1b7){return _0x48f1b7[_0xd38f('0x18')](_0x39b1f1)['then'](function(_0x424aa3){return _0x424aa3;});}return null;};}function removeEntity(_0x338f4c){return function(_0x7c897d){if(_0x7c897d){return _0x7c897d[_0xd38f('0x19')]()[_0xd38f('0x1a')](function(){_0x338f4c[_0xd38f('0x14')](0xcc)[_0xd38f('0x1b')]();});}};}function handleEntityNotFound(_0x15e3df){return function(_0x2c02bf){if(!_0x2c02bf){_0x15e3df['sendStatus'](0x194);}return _0x2c02bf;};}function handleError(_0x8bc840,_0x4c821f){_0x4c821f=_0x4c821f||0x1f4;return function(_0xba723b){logger['error'](_0xba723b[_0xd38f('0x1c')]);if(_0xba723b[_0xd38f('0x1d')]){delete _0xba723b[_0xd38f('0x1d')];}_0x8bc840[_0xd38f('0x14')](_0x4c821f)[_0xd38f('0x1e')](_0xba723b);};}exports[_0xd38f('0x1f')]=function(_0x1d02cc,_0x49bc03){var _0x158095={},_0x5dbce4={},_0x5dbea0={'count':0x0,'rows':[]};return db[_0xd38f('0x20')]['describe']()['then'](function(_0x11f9c1){var _0xd726db=[];for(var _0x33302a=0x0;_0x33302a
','Attachments','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate'];(function(_0x1abd98,_0x4efa0b){var _0x547194=function(_0x5d153e){while(--_0x5d153e){_0x1abd98['push'](_0x1abd98['shift']());}};_0x547194(++_0x4efa0b);}(_0x651b,0x1db));var _0xb651=function(_0x468c87,_0x3ecc35){_0x468c87=_0x468c87-0x0;var _0x3a9381=_0x651b[_0x468c87];return _0x3a9381;};'use strict';var _=require('lodash');var moment=require(_0xb651('0x0'));var random=require(_0xb651('0x1'));var fs=require('fs');var path=require(_0xb651('0x2'));var util=require('util');var tnef=require(_0xb651('0x3'));var logger=require(_0xb651('0x4'))(_0xb651('0x5'));var config=require(_0xb651('0x6'));function getAddress(_0x39cdda){var _0x357f45=_['head'](_0x39cdda[_0xb651('0x7')]);return _0x357f45&&_0x357f45[_0xb651('0x8')]?_0x357f45['address']:_0xb651('0x9')+random[_0xb651('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x2d260a){var _0x2ff0e9=_[_0xb651('0xb')](_0x2d260a[_0xb651('0x7')]);if(_0x2ff0e9&&_0x2ff0e9[_0xb651('0xc')]){if(_0x2ff0e9[_0xb651('0xc')]==_0x2ff0e9[_0xb651('0x8')]){return _0x2ff0e9['name'][_0xb651('0xd')](0x0,_0x2ff0e9[_0xb651('0xc')][_0xb651('0xe')]('@'));}var _0x39cf61=_0x2ff0e9[_0xb651('0xc')][_0xb651('0xf')](/\s+/);return _0x39cf61['length']>0x1?_0x39cf61[_0xb651('0x10')](0x0,-0x1)[_0xb651('0x11')]('\x20'):_0x2ff0e9['name'];}return _0xb651('0x12');}function getLastName(_0x289b4e){var _0x4d17d5=_[_0xb651('0xb')](_0x289b4e[_0xb651('0x7')]);if(_0x4d17d5&&_0x4d17d5['name']){var _0x4aea2c=_0x4d17d5[_0xb651('0xc')]['split'](/\s+/);return _0x4aea2c[_0xb651('0x13')]>0x1?_0x4aea2c[_0xb651('0x14')]():'';}return'';}function getMails(_0x3af96e,_0x37b382){var _0x69d87c='';for(var _0x35b039=0x0;_0x35b039<_0x37b382[_0xb651('0x7')][_0xb651('0x13')];_0x35b039+=0x1){if(_0x37b382['value'][_0x35b039]['address']!==_0x3af96e){if(!_['isEmpty'](_0x69d87c)){_0x69d87c+=',';}_0x69d87c+=_0x37b382['value'][_0x35b039][_0xb651('0xc')]||_0x37b382[_0xb651('0x7')][_0x35b039][_0xb651('0x8')]||'';_0x69d87c+='\x20<';_0x69d87c+=_0x37b382['value'][_0x35b039][_0xb651('0x8')]?_0x37b382[_0xb651('0x7')][_0x35b039][_0xb651('0x8')]:'anonymous'+random[_0xb651('0xa')](0x6)+_0xb651('0x15');_0x69d87c+='>';}}return _0x69d87c;}function parseEmail(_0x3db476,_0x212de4,_0x846816){if(_0x212de4[_0xb651('0x16')]){var _0xa31e3=/