From: support
Date: Fri, 25 Mar 2022 09:38:57 +0000 (+0000)
Subject: Built motion from commit 076b6d01.|2.6.7
X-Git-Url: http://repos.xcallymotion.com/base//%22https:/wiki.xcallymotion.com/display/XMV/%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C2%20%20%20%20%20%20%2014%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C21110E%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C202%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C2%20%20%20%20%20%20%200%C3%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%C205?a=commitdiff_plain;h=ab94598496c5c2e949d99c6307a7405f14d1c4de;p=motion2.git
Built motion from commit 076b6d01.|2.6.7
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 45be773..00d4e22 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-25T08:59:50.509Z",
+ "time": "2022-03-25T09:30:30.041Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index cf8cad7..0fd2ce7 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-25T08:59:50.509Z",
+ "time": "2022-03-25T09:30:30.041Z",
"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 1f77e4d..8512047 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 _0x24bf=['VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','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[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports'];(function(_0x5a61c0,_0x35449e){var _0x50fe35=function(_0x33d97a){while(--_0x33d97a){_0x5a61c0['push'](_0x5a61c0['shift']());}};_0x50fe35(++_0x35449e);}(_0x24bf,0xee));var _0xf24b=function(_0x53d7a8,_0x42bd72){_0x53d7a8=_0x53d7a8-0x0;var _0x4caee1=_0x24bf[_0x53d7a8];return _0x4caee1;};'use strict';var Sequelize=require(_0xf24b('0x0'));module[_0xf24b('0x1')]={'name':{'type':Sequelize[_0xf24b('0x2')],'get':function(_0x4defc1){return this[_0xf24b('0x3')](_0xf24b('0x4'));}},'action':{'type':Sequelize[_0xf24b('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0xf24b('0x6'),'integration',_0xf24b('0x7'),'jscripty','urlForward','browser','bot','script']],'msg':_0xf24b('0x8')}},'comment':_0xf24b('0x8')},'data1':{'type':Sequelize[_0xf24b('0x5')](0x1000),'comment':_0xf24b('0x9')},'data2':{'type':Sequelize[_0xf24b('0x5')](0x1000),'comment':_0xf24b('0xa')},'data3':{'type':Sequelize[_0xf24b('0x5')](0x1000),'comment':_0xf24b('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xf24b('0xc')},'data5':{'type':Sequelize[_0xf24b('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xf24b('0x5')],'comments':_0xf24b('0xd')},'data7':{'type':Sequelize[_0xf24b('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0xedef=['motionbar','urlForward','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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0x42353c,_0x1eb7b7){var _0x5ba6d4=function(_0x197180){while(--_0x197180){_0x42353c['push'](_0x42353c['shift']());}};_0x5ba6d4(++_0x1eb7b7);}(_0xedef,0x83));var _0xfede=function(_0x299d68,_0x1455c8){_0x299d68=_0x299d68-0x0;var _0x427fe5=_0xedef[_0x299d68];return _0x427fe5;};'use strict';var Sequelize=require(_0xfede('0x0'));module[_0xfede('0x1')]={'name':{'type':Sequelize[_0xfede('0x2')],'get':function(_0x1dfc1d){return this[_0xfede('0x3')]('action');}},'action':{'type':Sequelize[_0xfede('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xfede('0x5'),'jscripty',_0xfede('0x6'),_0xfede('0x7'),'bot',_0xfede('0x8')]],'msg':_0xfede('0x9')}},'comment':_0xfede('0x9')},'data1':{'type':Sequelize[_0xfede('0x4')](0x1000),'comment':_0xfede('0xa')},'data2':{'type':Sequelize[_0xfede('0x4')](0x1000),'comment':_0xfede('0xb')},'data3':{'type':Sequelize[_0xfede('0x4')](0x1000),'comment':_0xfede('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xfede('0xd')},'data6':{'type':Sequelize[_0xfede('0x4')],'comments':_0xfede('0xe')},'data7':{'type':Sequelize[_0xfede('0xf')],'comments':_0xfede('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index c1af917..6d9a6f5 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 _0xef92=['count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','Action','find','params','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xef92,0x176));var _0x2ef9=function(_0x22bd74,_0x3b231b){_0x22bd74=_0x22bd74-0x0;var _0x4b9505=_0xef92[_0x22bd74];return _0x4b9505;};'use strict';var emlformat=require(_0x2ef9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2ef9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ef9('0x2'));var moment=require(_0x2ef9('0x3'));var BPromise=require(_0x2ef9('0x4'));var Mustache=require(_0x2ef9('0x5'));var util=require('util');var path=require(_0x2ef9('0x6'));var sox=require(_0x2ef9('0x7'));var csv=require(_0x2ef9('0x8'));var ejs=require(_0x2ef9('0x9'));var fs=require('fs');var fs_extra=require(_0x2ef9('0xa'));var _=require(_0x2ef9('0xb'));var squel=require(_0x2ef9('0xc'));var crypto=require(_0x2ef9('0xd'));var jsforce=require(_0x2ef9('0xe'));var deskjs=require(_0x2ef9('0xf'));var toCsv=require(_0x2ef9('0x8'));var querystring=require(_0x2ef9('0x10'));var Papa=require(_0x2ef9('0x11'));var Redis=require(_0x2ef9('0x12'));var authService=require(_0x2ef9('0x13'));var qs=require(_0x2ef9('0x14'));var as=require(_0x2ef9('0x15'));var hardwareService=require(_0x2ef9('0x16'));var logger=require(_0x2ef9('0x17'))('api');var utils=require(_0x2ef9('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2ef9('0x19'));var db=require(_0x2ef9('0x1a'))['db'];function respondWithStatusCode(_0x3e9c3e,_0x2c8299){_0x2c8299=_0x2c8299||0xcc;return function(_0x3ba0f0){if(_0x3ba0f0){return _0x3e9c3e[_0x2ef9('0x1b')](_0x2c8299);}return _0x3e9c3e[_0x2ef9('0x1c')](_0x2c8299)[_0x2ef9('0x1d')]();};}function respondWithResult(_0x20f80a,_0x579c1b){_0x579c1b=_0x579c1b||0xc8;return function(_0x366e3a){if(_0x366e3a){return _0x20f80a[_0x2ef9('0x1c')](_0x579c1b)[_0x2ef9('0x1e')](_0x366e3a);}};}function respondWithFilteredResult(_0x23dd58,_0x41fe32){return function(_0xfeaa03){if(_0xfeaa03){var _0x32bd70=typeof _0x41fe32[_0x2ef9('0x1f')]===_0x2ef9('0x20')&&typeof _0x41fe32[_0x2ef9('0x21')]===_0x2ef9('0x20');var _0x3d0efd=_0xfeaa03[_0x2ef9('0x22')];var _0xc2786=_0x32bd70?0x0:_0x41fe32[_0x2ef9('0x1f')];var _0x32ecc8=_0x32bd70?_0xfeaa03[_0x2ef9('0x22')]:_0x41fe32[_0x2ef9('0x1f')]+_0x41fe32['limit'];var _0xef21a3;if(_0x32ecc8>=_0x3d0efd){_0x32ecc8=_0x3d0efd;_0xef21a3=0xc8;}else{_0xef21a3=0xce;}_0x23dd58[_0x2ef9('0x1c')](_0xef21a3);return _0x23dd58[_0x2ef9('0x23')](_0x2ef9('0x24'),_0xc2786+'-'+_0x32ecc8+'/'+_0x3d0efd)[_0x2ef9('0x1e')](_0xfeaa03);}return null;};}function patchUpdates(_0x53d8eb){return function(_0x8e1582){try{jsonpatch[_0x2ef9('0x25')](_0x8e1582,_0x53d8eb,!![]);}catch(_0x574161){return BPromise[_0x2ef9('0x26')](_0x574161);}return _0x8e1582[_0x2ef9('0x27')]();};}function saveUpdates(_0xcb2675,_0x28f9e2){return function(_0x3ff5af){if(_0x3ff5af){return _0x3ff5af[_0x2ef9('0x28')](_0xcb2675)[_0x2ef9('0x29')](function(_0x257748){return _0x257748;});}return null;};}function removeEntity(_0x4bcb2f,_0xbad401){return function(_0x544a4e){if(_0x544a4e){return _0x544a4e[_0x2ef9('0x2a')]()[_0x2ef9('0x29')](function(){_0x4bcb2f[_0x2ef9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b3d21,_0x5398ff){return function(_0x33b175){if(!_0x33b175){_0x5b3d21[_0x2ef9('0x1b')](0x194);}return _0x33b175;};}function handleError(_0x1e4e82,_0x1e486a){_0x1e486a=_0x1e486a||0x1f4;return function(_0x4f6bf1){logger['error'](_0x4f6bf1[_0x2ef9('0x2b')]);if(_0x4f6bf1[_0x2ef9('0x2c')]){delete _0x4f6bf1[_0x2ef9('0x2c')];}_0x1e4e82[_0x2ef9('0x1c')](_0x1e486a)[_0x2ef9('0x2d')](_0x4f6bf1);};}exports[_0x2ef9('0x28')]=function(_0x2ab761,_0x1cf18a){if(_0x2ab761[_0x2ef9('0x2e')]['id']){delete _0x2ab761[_0x2ef9('0x2e')]['id'];}return db[_0x2ef9('0x2f')][_0x2ef9('0x30')]({'where':{'id':_0x2ab761[_0x2ef9('0x31')]['id']}})[_0x2ef9('0x29')](handleEntityNotFound(_0x1cf18a,null))[_0x2ef9('0x29')](saveUpdates(_0x2ab761[_0x2ef9('0x2e')],null))['then'](respondWithResult(_0x1cf18a,null))[_0x2ef9('0x32')](handleError(_0x1cf18a,null));};exports[_0x2ef9('0x2a')]=function(_0x46defc,_0x421c85){return db['Action'][_0x2ef9('0x30')]({'where':{'id':_0x46defc[_0x2ef9('0x31')]['id']}})[_0x2ef9('0x29')](handleEntityNotFound(_0x421c85,null))['then'](removeEntity(_0x421c85,null))['catch'](handleError(_0x421c85,null));};
\ No newline at end of file
+var _0x91ec=['papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','sendStatus','stack','name','body','Action','params','then','catch','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x3f345d,_0x29513a){var _0x4ebfb9=function(_0x19af4b){while(--_0x19af4b){_0x3f345d['push'](_0x3f345d['shift']());}};_0x4ebfb9(++_0x29513a);}(_0x91ec,0x12b));var _0xc91e=function(_0x3f3d2b,_0x8bb927){_0x3f3d2b=_0x3f3d2b-0x0;var _0x5b12fc=_0x91ec[_0x3f3d2b];return _0x5b12fc;};'use strict';var emlformat=require(_0xc91e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc91e('0x1'));var rp=require(_0xc91e('0x2'));var moment=require(_0xc91e('0x3'));var BPromise=require(_0xc91e('0x4'));var Mustache=require(_0xc91e('0x5'));var util=require('util');var path=require(_0xc91e('0x6'));var sox=require(_0xc91e('0x7'));var csv=require(_0xc91e('0x8'));var ejs=require(_0xc91e('0x9'));var fs=require('fs');var fs_extra=require(_0xc91e('0xa'));var _=require(_0xc91e('0xb'));var squel=require(_0xc91e('0xc'));var crypto=require('crypto');var jsforce=require(_0xc91e('0xd'));var deskjs=require(_0xc91e('0xe'));var toCsv=require(_0xc91e('0x8'));var querystring=require(_0xc91e('0xf'));var Papa=require(_0xc91e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc91e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc91e('0x12'));var logger=require(_0xc91e('0x13'))(_0xc91e('0x14'));var utils=require(_0xc91e('0x15'));var config=require(_0xc91e('0x16'));var licenseUtil=require(_0xc91e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3944f1,_0x27e646){_0x27e646=_0x27e646||0xcc;return function(_0xbefcfc){if(_0xbefcfc){return _0x3944f1['sendStatus'](_0x27e646);}return _0x3944f1[_0xc91e('0x18')](_0x27e646)[_0xc91e('0x19')]();};}function respondWithResult(_0x3b08e8,_0x53aba9){_0x53aba9=_0x53aba9||0xc8;return function(_0xd5c60a){if(_0xd5c60a){return _0x3b08e8[_0xc91e('0x18')](_0x53aba9)[_0xc91e('0x1a')](_0xd5c60a);}};}function respondWithFilteredResult(_0x30f616,_0x49734c){return function(_0x301de8){if(_0x301de8){var _0x594ccc=typeof _0x49734c[_0xc91e('0x1b')]==='undefined'&&typeof _0x49734c[_0xc91e('0x1c')]===_0xc91e('0x1d');var _0x2d4cf9=_0x301de8[_0xc91e('0x1e')];var _0x455524=_0x594ccc?0x0:_0x49734c[_0xc91e('0x1b')];var _0x16f7ae=_0x594ccc?_0x301de8[_0xc91e('0x1e')]:_0x49734c[_0xc91e('0x1b')]+_0x49734c[_0xc91e('0x1c')];var _0x307b44;if(_0x16f7ae>=_0x2d4cf9){_0x16f7ae=_0x2d4cf9;_0x307b44=0xc8;}else{_0x307b44=0xce;}_0x30f616['status'](_0x307b44);return _0x30f616[_0xc91e('0x1f')](_0xc91e('0x20'),_0x455524+'-'+_0x16f7ae+'/'+_0x2d4cf9)[_0xc91e('0x1a')](_0x301de8);}return null;};}function patchUpdates(_0x14da77){return function(_0x3e98f5){try{jsonpatch[_0xc91e('0x21')](_0x3e98f5,_0x14da77,!![]);}catch(_0x4d7a60){return BPromise[_0xc91e('0x22')](_0x4d7a60);}return _0x3e98f5[_0xc91e('0x23')]();};}function saveUpdates(_0x1b6190,_0x3bb1a7){return function(_0x11a01c){if(_0x11a01c){return _0x11a01c['update'](_0x1b6190)['then'](function(_0x36f3fa){return _0x36f3fa;});}return null;};}function removeEntity(_0x522a47,_0xdc5be8){return function(_0x350063){if(_0x350063){return _0x350063['destroy']()['then'](function(){_0x522a47[_0xc91e('0x18')](0xcc)[_0xc91e('0x19')]();});}};}function handleEntityNotFound(_0x18577f,_0x35dba8){return function(_0x2de2ad){if(!_0x2de2ad){_0x18577f[_0xc91e('0x24')](0x194);}return _0x2de2ad;};}function handleError(_0xa175ab,_0x54f026){_0x54f026=_0x54f026||0x1f4;return function(_0x51a7b9){logger['error'](_0x51a7b9[_0xc91e('0x25')]);if(_0x51a7b9['name']){delete _0x51a7b9[_0xc91e('0x26')];}_0xa175ab[_0xc91e('0x18')](_0x54f026)['send'](_0x51a7b9);};}exports['update']=function(_0x23a6ab,_0x1b2dbc){if(_0x23a6ab[_0xc91e('0x27')]['id']){delete _0x23a6ab[_0xc91e('0x27')]['id'];}return db[_0xc91e('0x28')]['find']({'where':{'id':_0x23a6ab[_0xc91e('0x29')]['id']}})[_0xc91e('0x2a')](handleEntityNotFound(_0x1b2dbc,null))[_0xc91e('0x2a')](saveUpdates(_0x23a6ab[_0xc91e('0x27')],null))[_0xc91e('0x2a')](respondWithResult(_0x1b2dbc,null))[_0xc91e('0x2b')](handleError(_0x1b2dbc,null));};exports['destroy']=function(_0x349b85,_0x29c6e9){return db[_0xc91e('0x28')][_0xc91e('0x2c')]({'where':{'id':_0x349b85[_0xc91e('0x29')]['id']}})['then'](handleEntityNotFound(_0x29c6e9,null))[_0xc91e('0x2a')](removeEntity(_0x29c6e9,null))[_0xc91e('0x2b')](handleError(_0x29c6e9,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 8ccf0a1..c3b9060 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 _0xd2ee=['tools_actions','util','api','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x55a832,_0x438a35){var _0x6b362a=function(_0x4ec981){while(--_0x4ec981){_0x55a832['push'](_0x55a832['shift']());}};_0x6b362a(++_0x438a35);}(_0xd2ee,0x161));var _0xed2e=function(_0x3f1e54,_0x4f9625){_0x3f1e54=_0x3f1e54-0x0;var _0x1f38bd=_0xd2ee[_0x3f1e54];return _0x1f38bd;};'use strict';var _=require('lodash');var util=require(_0xed2e('0x0'));var logger=require('../../config/logger')(_0xed2e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xed2e('0x2'));var rimraf=require(_0xed2e('0x3'));var config=require(_0xed2e('0x4'));var attributes=require(_0xed2e('0x5'));module['exports']=function(_0x4b2fb9,_0x1971f9){return _0x4b2fb9[_0xed2e('0x6')]('Action',attributes,{'tableName':_0xed2e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b1b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','Action','tools_actions','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4b1b,0x17f));var _0xb4b1=function(_0x50087e,_0x4c5bb2){_0x50087e=_0x50087e-0x0;var _0xd49460=_0x4b1b[_0x50087e];return _0xd49460;};'use strict';var _=require(_0xb4b1('0x0'));var util=require(_0xb4b1('0x1'));var logger=require(_0xb4b1('0x2'))(_0xb4b1('0x3'));var moment=require(_0xb4b1('0x4'));var BPromise=require(_0xb4b1('0x5'));var rp=require(_0xb4b1('0x6'));var fs=require('fs');var path=require(_0xb4b1('0x7'));var rimraf=require(_0xb4b1('0x8'));var config=require('../../config/environment');var attributes=require('./action.attributes');module['exports']=function(_0x49ddcd,_0x2b28b4){return _0x49ddcd[_0xb4b1('0x9')](_0xb4b1('0xa'),attributes,{'tableName':_0xb4b1('0xb'),'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 c7b95b9..8ef44d2 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 _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(_0x208774,_0x5676b0){var _0x4ba5c0=function(_0x236eb6){while(--_0x236eb6){_0x208774['push'](_0x208774['shift']());}};_0x4ba5c0(++_0x5676b0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x7fbe[_0x3cfb0d];return _0x3486b4;};'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
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xcf22a8,_0x35d51c){var _0x1137eb=function(_0x22bdf6){while(--_0x22bdf6){_0xcf22a8['push'](_0xcf22a8['shift']());}};_0x1137eb(++_0x35d51c);}(_0x5fab,0x177));var _0xb5fa=function(_0x273517,_0x50b234){_0x273517=_0x273517-0x0;var _0x2c6334=_0x5fab[_0x273517];return _0x2c6334;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index ad362f5..f496c6d 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 _0x4388=['../../components/auth/service','./action.controller','put','/:id','delete','isAuthenticated','exports','multer','util','path','express','Router'];(function(_0x5a0cb3,_0x2620a9){var _0x2cf9ed=function(_0x37ac41){while(--_0x37ac41){_0x5a0cb3['push'](_0x5a0cb3['shift']());}};_0x2cf9ed(++_0x2620a9);}(_0x4388,0x163));var _0x8438=function(_0x42ba84,_0x4a3c10){_0x42ba84=_0x42ba84-0x0;var _0x22a316=_0x4388[_0x42ba84];return _0x22a316;};'use strict';var multer=require(_0x8438('0x0'));var util=require(_0x8438('0x1'));var path=require(_0x8438('0x2'));var timeout=require('connect-timeout');var express=require(_0x8438('0x3'));var router=express[_0x8438('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8438('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8438('0x6'));router[_0x8438('0x7')](_0x8438('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x8438('0x9')]('/:id',auth[_0x8438('0xa')](),controller['destroy']);module[_0x8438('0xb')]=router;
\ No newline at end of file
+var _0x6542=['/:id','delete','isAuthenticated','destroy','exports','express','Router','../../components/auth/service','../../config/environment','put'];(function(_0x2c47a9,_0x120e40){var _0x792f9b=function(_0x342644){while(--_0x342644){_0x2c47a9['push'](_0x2c47a9['shift']());}};_0x792f9b(++_0x120e40);}(_0x6542,0xeb));var _0x2654=function(_0x5991df,_0x9d6ea2){_0x5991df=_0x5991df-0x0;var _0x36baa1=_0x6542[_0x5991df];return _0x36baa1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2654('0x0'));var router=express[_0x2654('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x2654('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x2654('0x3'));var controller=require('./action.controller');router[_0x2654('0x4')](_0x2654('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x2654('0x6')](_0x2654('0x5'),auth[_0x2654('0x7')](),controller[_0x2654('0x8')]);module[_0x2654('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 95f9825..c5b2c1d 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x409a8f,_0xa8d109){var _0x548c1e=function(_0x40ab24){while(--_0x40ab24){_0x409a8f['push'](_0x409a8f['shift']());}};_0x548c1e(++_0xa8d109);}(_0x7217,0x19e));var _0x7721=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7217[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2eb2=['TEXT','exports','STRING'];(function(_0x3270de,_0x293830){var _0x47d908=function(_0x1e2d73){while(--_0x1e2d73){_0x3270de['push'](_0x3270de['shift']());}};_0x47d908(++_0x293830);}(_0x2eb2,0x19f));var _0x22eb=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x2eb2[_0x40bffc];return _0x3007e9;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'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 1c28240..8ba993f 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 _0xc5c7=['ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','left_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','IS\x20NOT\x20NULL','operator','metric','parentKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','fork','../../components/export/','savename','COUNT(*)','SELECT','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','CustomReports','UserProfileResource','error','stack','name','send','index','map','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','keys','rawAttributes','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','Reports','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)'];(function(_0x44c274,_0x1b2a32){var _0x1a2907=function(_0x4d6d2a){while(--_0x4d6d2a){_0x44c274['push'](_0x44c274['shift']());}};_0x1a2907(++_0x1b2a32);}(_0xc5c7,0xf1));var _0x7c5c=function(_0xcf7c43,_0x215025){_0xcf7c43=_0xcf7c43-0x0;var _0x3ec6de=_0xc5c7[_0xcf7c43];return _0x3ec6de;};'use strict';var emlformat=require(_0x7c5c('0x0'));var rimraf=require(_0x7c5c('0x1'));var zipdir=require(_0x7c5c('0x2'));var jsonpatch=require(_0x7c5c('0x3'));var rp=require(_0x7c5c('0x4'));var moment=require(_0x7c5c('0x5'));var BPromise=require(_0x7c5c('0x6'));var Mustache=require(_0x7c5c('0x7'));var util=require(_0x7c5c('0x8'));var path=require(_0x7c5c('0x9'));var sox=require(_0x7c5c('0xa'));var csv=require('to-csv');var ejs=require(_0x7c5c('0xb'));var fs=require('fs');var fs_extra=require(_0x7c5c('0xc'));var _=require('lodash');var squel=require(_0x7c5c('0xd'));var crypto=require(_0x7c5c('0xe'));var jsforce=require(_0x7c5c('0xf'));var deskjs=require(_0x7c5c('0x10'));var toCsv=require(_0x7c5c('0x11'));var querystring=require('querystring');var Papa=require(_0x7c5c('0x12'));var Redis=require(_0x7c5c('0x13'));var authService=require(_0x7c5c('0x14'));var qs=require(_0x7c5c('0x15'));var as=require(_0x7c5c('0x16'));var hardwareService=require(_0x7c5c('0x17'));var logger=require(_0x7c5c('0x18'))(_0x7c5c('0x19'));var utils=require(_0x7c5c('0x1a'));var config=require(_0x7c5c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c5c('0x1c'))['db'];var dbH=require(_0x7c5c('0x1c'))[_0x7c5c('0x1d')];function respondWithStatusCode(_0x52f9d3,_0x2d082c){_0x2d082c=_0x2d082c||0xcc;return function(_0x49e58c){if(_0x49e58c){return _0x52f9d3[_0x7c5c('0x1e')](_0x2d082c);}return _0x52f9d3[_0x7c5c('0x1f')](_0x2d082c)[_0x7c5c('0x20')]();};}function respondWithResult(_0x13b23f,_0x328bee){_0x328bee=_0x328bee||0xc8;return function(_0x26d252){if(_0x26d252){return _0x13b23f['status'](_0x328bee)[_0x7c5c('0x21')](_0x26d252);}};}function respondWithFilteredResult(_0x3faece,_0x176b4c){return function(_0x86fd51){if(_0x86fd51){var _0x5928e9=typeof _0x176b4c[_0x7c5c('0x22')]==='undefined'&&typeof _0x176b4c[_0x7c5c('0x23')]===_0x7c5c('0x24');var _0x18c1da=_0x86fd51[_0x7c5c('0x25')];var _0x1bb5de=_0x5928e9?0x0:_0x176b4c[_0x7c5c('0x22')];var _0x2d8d80=_0x5928e9?_0x86fd51[_0x7c5c('0x25')]:_0x176b4c[_0x7c5c('0x22')]+_0x176b4c['limit'];var _0x4d8d5d;if(_0x2d8d80>=_0x18c1da){_0x2d8d80=_0x18c1da;_0x4d8d5d=0xc8;}else{_0x4d8d5d=0xce;}_0x3faece[_0x7c5c('0x1f')](_0x4d8d5d);return _0x3faece[_0x7c5c('0x26')](_0x7c5c('0x27'),_0x1bb5de+'-'+_0x2d8d80+'/'+_0x18c1da)[_0x7c5c('0x21')](_0x86fd51);}return null;};}function patchUpdates(_0x2787b9){return function(_0x247be4){try{jsonpatch[_0x7c5c('0x28')](_0x247be4,_0x2787b9,!![]);}catch(_0x2ad171){return BPromise[_0x7c5c('0x29')](_0x2ad171);}return _0x247be4[_0x7c5c('0x2a')]();};}function saveUpdates(_0x41052b,_0x4d0396){return function(_0x13a640){if(_0x13a640){return _0x13a640[_0x7c5c('0x2b')](_0x41052b)['then'](function(_0x6ceeea){return _0x6ceeea;});}return null;};}function removeEntity(_0x183290,_0x519a8a){return function(_0x533afd){if(_0x533afd){return _0x533afd[_0x7c5c('0x2c')]()[_0x7c5c('0x2d')](function(){var _0x4d6bb5=_0x533afd['get']({'plain':!![]});var _0x4763e9=_0x7c5c('0x2e');return db[_0x7c5c('0x2f')]['destroy']({'where':{'type':_0x4763e9,'resourceId':_0x4d6bb5['id']}})[_0x7c5c('0x2d')](function(){return _0x533afd;});})['then'](function(){_0x183290['status'](0xcc)[_0x7c5c('0x20')]();});}};}function handleEntityNotFound(_0x4cbb2d,_0x283379){return function(_0x152102){if(!_0x152102){_0x4cbb2d[_0x7c5c('0x1e')](0x194);}return _0x152102;};}function handleError(_0x3236b9,_0x12bb09){_0x12bb09=_0x12bb09||0x1f4;return function(_0x371681){logger[_0x7c5c('0x30')](_0x371681[_0x7c5c('0x31')]);if(_0x371681[_0x7c5c('0x32')]){delete _0x371681[_0x7c5c('0x32')];}_0x3236b9[_0x7c5c('0x1f')](_0x12bb09)[_0x7c5c('0x33')](_0x371681);};}exports[_0x7c5c('0x34')]=function(_0x111188,_0x5a1a1c){var _0x4a541b={},_0x3e9404={},_0x540e51={'count':0x0,'rows':[]};var _0x55fe14=_[_0x7c5c('0x35')](db['AnalyticCustomReport']['rawAttributes'],function(_0x14e478){return{'name':_0x14e478['fieldName'],'type':_0x14e478[_0x7c5c('0x36')][_0x7c5c('0x37')]};});_0x3e9404[_0x7c5c('0x38')]=_[_0x7c5c('0x35')](_0x55fe14,_0x7c5c('0x32'));_0x3e9404['query']=_['keys'](_0x111188[_0x7c5c('0x39')]);_0x3e9404[_0x7c5c('0x3a')]=_['intersection'](_0x3e9404[_0x7c5c('0x38')],_0x3e9404[_0x7c5c('0x39')]);_0x4a541b[_0x7c5c('0x3b')]=_['intersection'](_0x3e9404[_0x7c5c('0x38')],qs['fields'](_0x111188[_0x7c5c('0x39')][_0x7c5c('0x3c')]));_0x4a541b[_0x7c5c('0x3b')]=_0x4a541b['attributes'][_0x7c5c('0x3d')]?_0x4a541b[_0x7c5c('0x3b')]:_0x3e9404[_0x7c5c('0x38')];if(!_0x111188[_0x7c5c('0x39')][_0x7c5c('0x3e')]('nolimit')){_0x4a541b[_0x7c5c('0x23')]=qs[_0x7c5c('0x23')](_0x111188['query'][_0x7c5c('0x23')]);_0x4a541b['offset']=qs[_0x7c5c('0x22')](_0x111188[_0x7c5c('0x39')][_0x7c5c('0x22')]);}_0x4a541b['order']=qs[_0x7c5c('0x3f')](_0x111188[_0x7c5c('0x39')][_0x7c5c('0x3f')]);_0x4a541b[_0x7c5c('0x40')]=qs[_0x7c5c('0x3a')](_[_0x7c5c('0x41')](_0x111188[_0x7c5c('0x39')],_0x3e9404[_0x7c5c('0x3a')]),_0x55fe14);if(_0x111188[_0x7c5c('0x39')][_0x7c5c('0x42')]){_0x4a541b[_0x7c5c('0x40')]=_['merge'](_0x4a541b[_0x7c5c('0x40')],{'$or':_[_0x7c5c('0x35')](_0x55fe14,function(_0x10693c){if(_0x10693c[_0x7c5c('0x36')]!=='VIRTUAL'){var _0x1f6288={};_0x1f6288[_0x10693c['name']]={'$like':'%'+_0x111188['query'][_0x7c5c('0x42')]+'%'};return _0x1f6288;}})});}_0x4a541b=_[_0x7c5c('0x43')]({},_0x4a541b,_0x111188[_0x7c5c('0x44')]);var _0x1f62c4={'where':_0x4a541b[_0x7c5c('0x40')]};return db[_0x7c5c('0x45')][_0x7c5c('0x25')](_0x1f62c4)['then'](function(_0x3f273b){_0x540e51[_0x7c5c('0x25')]=_0x3f273b;if(_0x111188[_0x7c5c('0x39')][_0x7c5c('0x46')]){_0x4a541b[_0x7c5c('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x7c5c('0x48')](_0x4a541b);})[_0x7c5c('0x2d')](function(_0x2408ad){_0x540e51['rows']=_0x2408ad;return _0x540e51;})['then'](respondWithFilteredResult(_0x5a1a1c,_0x4a541b))[_0x7c5c('0x49')](handleError(_0x5a1a1c,null));};exports[_0x7c5c('0x4a')]=function(_0x5e83e5,_0x1ba5a3){var _0x7d239b={'raw':![],'where':{'id':_0x5e83e5['params']['id']}},_0x2f0581={};_0x2f0581[_0x7c5c('0x38')]=_[_0x7c5c('0x4b')](db['AnalyticCustomReport'][_0x7c5c('0x4c')]);_0x2f0581[_0x7c5c('0x39')]=_['keys'](_0x5e83e5[_0x7c5c('0x39')]);_0x2f0581[_0x7c5c('0x3a')]=_[_0x7c5c('0x4d')](_0x2f0581[_0x7c5c('0x38')],_0x2f0581[_0x7c5c('0x39')]);_0x7d239b[_0x7c5c('0x3b')]=_[_0x7c5c('0x4d')](_0x2f0581['model'],qs[_0x7c5c('0x3c')](_0x5e83e5[_0x7c5c('0x39')][_0x7c5c('0x3c')]));_0x7d239b[_0x7c5c('0x3b')]=_0x7d239b['attributes']['length']?_0x7d239b[_0x7c5c('0x3b')]:_0x2f0581[_0x7c5c('0x38')];if(_0x5e83e5[_0x7c5c('0x39')]['includeAll']){_0x7d239b[_0x7c5c('0x47')]=[{'all':!![]}];}_0x7d239b=_[_0x7c5c('0x43')]({},_0x7d239b,_0x5e83e5[_0x7c5c('0x44')]);return db['AnalyticCustomReport']['find'](_0x7d239b)[_0x7c5c('0x2d')](handleEntityNotFound(_0x1ba5a3,null))[_0x7c5c('0x2d')](respondWithResult(_0x1ba5a3,null))[_0x7c5c('0x49')](handleError(_0x1ba5a3,null));};exports[_0x7c5c('0x4e')]=function(_0x175293,_0x3002be){return db[_0x7c5c('0x45')][_0x7c5c('0x4e')](_0x175293[_0x7c5c('0x4f')],{})[_0x7c5c('0x2d')](function(_0x43518e){var _0x7ffa0c=_0x175293['user']['get']({'plain':!![]});if(!_0x7ffa0c)throw new Error(_0x7c5c('0x50'));if(_0x7ffa0c[_0x7c5c('0x51')]===_0x7c5c('0x52')){var _0x48fb73=_0x43518e[_0x7c5c('0x53')]({'plain':!![]});var _0x4eb8a0=_0x7c5c('0x54');return db[_0x7c5c('0x55')][_0x7c5c('0x56')]({'where':{'name':_0x4eb8a0,'userProfileId':_0x7ffa0c['userProfileId']},'raw':!![]})[_0x7c5c('0x2d')](function(_0x43009d){if(_0x43009d&&_0x43009d[_0x7c5c('0x57')]===0x0){return db[_0x7c5c('0x2f')][_0x7c5c('0x4e')]({'name':_0x48fb73[_0x7c5c('0x32')],'resourceId':_0x48fb73['id'],'type':'CustomReports','sectionId':_0x43009d['id']},{})['then'](function(){return _0x43518e;});}else{return _0x43518e;}})['catch'](function(_0x5ec26e){logger[_0x7c5c('0x30')](_0x7c5c('0x58'),_0x5ec26e);throw _0x5ec26e;});}return _0x43518e;})['then'](respondWithResult(_0x3002be,0xc9))[_0x7c5c('0x49')](handleError(_0x3002be,null));};exports[_0x7c5c('0x2b')]=function(_0x1c9d07,_0x393aaf){if(_0x1c9d07[_0x7c5c('0x4f')]['id']){delete _0x1c9d07[_0x7c5c('0x4f')]['id'];}return db[_0x7c5c('0x45')]['find']({'where':{'id':_0x1c9d07[_0x7c5c('0x59')]['id']}})['then'](handleEntityNotFound(_0x393aaf,null))[_0x7c5c('0x2d')](saveUpdates(_0x1c9d07[_0x7c5c('0x4f')],null))[_0x7c5c('0x2d')](respondWithResult(_0x393aaf,null))['catch'](handleError(_0x393aaf,null));};exports[_0x7c5c('0x2c')]=function(_0x3621e7,_0x7d6197){return db['AnalyticCustomReport']['find']({'where':{'id':_0x3621e7[_0x7c5c('0x59')]['id']}})[_0x7c5c('0x2d')](handleEntityNotFound(_0x7d6197,null))['then'](removeEntity(_0x7d6197,null))[_0x7c5c('0x49')](handleError(_0x7d6197,null));};exports[_0x7c5c('0x5a')]=function(_0x55dc0b,_0x21e7e7){var _0x3be2cb=0xa;var _0x10801b=[_0x7c5c('0x5b'),'left_join',_0x7c5c('0x5c'),_0x7c5c('0x5d')];var _0x10ba25={'SUM':_0x7c5c('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x7c5c('0x5f'),'AVG':_0x7c5c('0x60'),'GROUP_CONCAT':_0x7c5c('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7c5c('0x62')};var _0x4cc56f={'SEC_TO_TIME':_0x7c5c('0x63'),'DATE':_0x7c5c('0x64'),'HOUR':'HOUR(%s)','ROUND':_0x7c5c('0x65'),'UNIX_TIMESTAMP':_0x7c5c('0x66')};var _0x29d62b=function(_0x5e9467){return!_[_0x7c5c('0x67')]([_0x7c5c('0x68'),'IS\x20NOT\x20NULL',_0x7c5c('0x69'),'IS\x20NOT\x20EMPTY'],_0x5e9467);};var _0x551908=function(_0x32b3b4){if(!_0x32b3b4||!_0x32b3b4[_0x7c5c('0x6a')][_0x7c5c('0x3d')]){return'';}for(var _0x2ef769='(',_0x5716a5=0x0;_0x5716a5<_0x32b3b4[_0x7c5c('0x6a')][_0x7c5c('0x3d')];_0x5716a5+=0x1){_0x5716a5>0x0&&(_0x2ef769+='\x20'+_0x32b3b4['operator']+'\x20');_0x2ef769+=_0x32b3b4[_0x7c5c('0x6a')][_0x5716a5]['group']?_0x551908(_0x32b3b4['rules'][_0x5716a5][_0x7c5c('0x6b')]):_0x32b3b4[_0x7c5c('0x6a')][_0x5716a5]['field']+'\x20'+_0x32b3b4['rules'][_0x5716a5]['condition']+(_0x29d62b(_0x32b3b4['rules'][_0x5716a5][_0x7c5c('0x6c')])?'\x20'+_0x32b3b4[_0x7c5c('0x6a')][_0x5716a5][_0x7c5c('0x6d')]:'');}return _0x2ef769+')';};var _0xd482b9={'where':{'id':_0x55dc0b[_0x7c5c('0x59')]['id']}},_0x40454d,_0x3a3f6b,_0x2f7839,_0x37b5b1,_0x40560b;_0xd482b9=_[_0x7c5c('0x43')]({},_0xd482b9,_0x55dc0b[_0x7c5c('0x44')]);return db[_0x7c5c('0x45')][_0x7c5c('0x56')](_0xd482b9)['then'](function(_0x564bc2){if(_0x564bc2){_0x40454d=_0x564bc2;return _0x564bc2[_0x7c5c('0x6e')]();}return null;})['then'](function(_0xed8436){if(_0xed8436){if(!_0xed8436['length']){throw new db[(_0x7c5c('0x6f'))][(_0x7c5c('0x70'))](_0x7c5c('0x71'),0x193);}_0x3a3f6b=_0xed8436;return db[_0x7c5c('0x72')][_0x7c5c('0x48')]({'raw':!![]});}return null;})['then'](function(_0x5593ba){if(_0x5593ba){_0x2f7839=_[_0x7c5c('0x73')](_0x5593ba,'id');var _0x30dd1f;var _0x2298c2=squel[_0x7c5c('0x74')]();_0x2298c2[_0x7c5c('0x75')](_0x40454d['table']);for(var _0x243c4a=0x0;_0x243c4a<_0x3a3f6b[_0x7c5c('0x3d')];_0x243c4a+=0x1){_0x30dd1f=_0x3a3f6b[_0x243c4a]['MetricId']?_0x2f7839[_0x3a3f6b[_0x243c4a][_0x7c5c('0x76')]]['metric']:_0x3a3f6b[_0x243c4a][_0x7c5c('0x77')];_0x30dd1f=_0x3a3f6b[_0x243c4a][_0x7c5c('0x78')]?_[_0x7c5c('0x79')](_0x10ba25[_0x3a3f6b[_0x243c4a]['function']],'%s',_0x30dd1f):_0x30dd1f;_0x30dd1f=_0x3a3f6b[_0x243c4a][_0x7c5c('0x7a')]?_[_0x7c5c('0x79')](_0x4cc56f[_0x3a3f6b[_0x243c4a][_0x7c5c('0x7a')]],'%s',_0x30dd1f):_0x30dd1f;if(_0x3a3f6b[_0x243c4a][_0x7c5c('0x7b')]){_0x2298c2[_0x7c5c('0x6b')](_0x30dd1f);}_0x3a3f6b[_0x243c4a][_0x7c5c('0x7c')]&&_0x2298c2[_0x7c5c('0x7d')](_0x30dd1f,_0x3a3f6b[_0x243c4a][_0x7c5c('0x7c')]===_0x7c5c('0x7e')?![]:!![]);_0x2298c2[_0x7c5c('0x77')](_0x30dd1f,_0x3a3f6b[_0x243c4a][_0x7c5c('0x7f')]||_0x30dd1f);}if(_0x40454d[_0x7c5c('0x80')]){_0x40454d[_0x7c5c('0x80')]=JSON[_0x7c5c('0x81')](_0x40454d['joins']);for(var _0x1ab2ef=0x0;_0x1ab2ef<_0x40454d[_0x7c5c('0x80')][_0x7c5c('0x3d')];_0x1ab2ef+=0x1){if(_0x40454d[_0x7c5c('0x80')][_0x1ab2ef][_0x7c5c('0x36')]&&_[_0x7c5c('0x67')](_0x10801b,_0x40454d[_0x7c5c('0x80')][_0x1ab2ef][_0x7c5c('0x36')])&&_0x40454d[_0x7c5c('0x80')][_0x1ab2ef]['parentKey']&&_0x40454d[_0x7c5c('0x80')][_0x1ab2ef][_0x7c5c('0x82')]&&_0x40454d['joins'][_0x1ab2ef][_0x7c5c('0x83')]){_0x2298c2[_0x40454d['joins'][_0x1ab2ef]['type']](_0x40454d['joins'][_0x1ab2ef][_0x7c5c('0x82')],null,util[_0x7c5c('0x7a')](_0x7c5c('0x84'),_0x40454d[_0x7c5c('0x85')],_0x40454d[_0x7c5c('0x80')][_0x1ab2ef]['parentKey'],_0x40454d[_0x7c5c('0x80')][_0x1ab2ef][_0x7c5c('0x82')],_0x40454d[_0x7c5c('0x80')][_0x1ab2ef][_0x7c5c('0x83')]));}}}if(_0x40454d[_0x7c5c('0x86')]){_0x40454d['conditions']=JSON[_0x7c5c('0x81')](_0x40454d[_0x7c5c('0x86')]);_0x2298c2[_0x7c5c('0x40')](_0x551908(_0x40454d[_0x7c5c('0x86')][_0x7c5c('0x6b')]));}_0x40560b=_0x2298c2[_0x7c5c('0x87')]();_0x2298c2[_0x7c5c('0x23')](_0x3be2cb);_0x2298c2['offset'](0x0);logger[_0x7c5c('0x88')](_0x7c5c('0x89'),_0x2298c2['toString']());return dbH[_0x7c5c('0x8a')][_0x7c5c('0x39')](_0x2298c2[_0x7c5c('0x8b')](),{'type':dbH[_0x7c5c('0x8a')][_0x7c5c('0x8c')]['SELECT']});}})[_0x7c5c('0x2d')](respondWithResult(_0x21e7e7,null))['catch'](handleError(_0x21e7e7,null));};function runReport(_0x286786,_0x56269b,_0x35292e){var _0x23390d=_0x56269b[_0x7c5c('0x32')];var _0x50e292=0xa;var _0x2a31e3=[_0x7c5c('0x5b'),_0x7c5c('0x8d'),_0x7c5c('0x5c'),_0x7c5c('0x5d')];var _0x4ed489={'SUM':'SUM(%s)','COUNT':_0x7c5c('0x8e'),'COUNT DISTINCT':_0x7c5c('0x8f'),'MAX':_0x7c5c('0x90'),'MIN':_0x7c5c('0x5f'),'AVG':_0x7c5c('0x60'),'GROUP_CONCAT':_0x7c5c('0x61'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7c5c('0x62')};var _0x2636e9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7c5c('0x64'),'HOUR':_0x7c5c('0x91'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7c5c('0x66')};var _0x23b444=function(_0x5f0299){return!_[_0x7c5c('0x67')](['IS\x20NULL',_0x7c5c('0x92'),_0x7c5c('0x69'),'IS\x20NOT\x20EMPTY'],_0x5f0299);};var _0x560ac8=function(_0x32c38b){if(!_0x32c38b||!_0x32c38b[_0x7c5c('0x6a')][_0x7c5c('0x3d')]){return'';}for(var _0x3d914c='(',_0x20c14f=0x0;_0x20c14f<_0x32c38b['rules'][_0x7c5c('0x3d')];_0x20c14f+=0x1){_0x20c14f>0x0&&(_0x3d914c+='\x20'+_0x32c38b[_0x7c5c('0x93')]+'\x20');_0x3d914c+=_0x32c38b[_0x7c5c('0x6a')][_0x20c14f][_0x7c5c('0x6b')]?_0x560ac8(_0x32c38b[_0x7c5c('0x6a')][_0x20c14f][_0x7c5c('0x6b')]):_0x32c38b['rules'][_0x20c14f]['field']+'\x20'+_0x32c38b['rules'][_0x20c14f][_0x7c5c('0x6c')]+(_0x23b444(_0x32c38b['rules'][_0x20c14f]['condition'])?'\x20'+_0x32c38b[_0x7c5c('0x6a')][_0x20c14f][_0x7c5c('0x6d')]:'');}return _0x3d914c+')';};var _0x1abd10={'where':{'id':_0x286786['id']}},_0x951a18,_0x5b775d,_0x2744c8,_0x3d028a,_0x221d89;_0x1abd10=_[_0x7c5c('0x43')]({},_0x1abd10,_0x35292e);return db['AnalyticCustomReport'][_0x7c5c('0x56')](_0x1abd10)['then'](function(_0x52fbb8){if(_0x52fbb8){_0x951a18=_0x52fbb8;return _0x52fbb8[_0x7c5c('0x6e')]();}return null;})[_0x7c5c('0x2d')](function(_0x4870cd){if(_0x4870cd){if(!_0x4870cd[_0x7c5c('0x3d')]){throw new db[(_0x7c5c('0x6f'))][(_0x7c5c('0x70'))](_0x7c5c('0x71'),0x193);}_0x5b775d=_0x4870cd;return db[_0x7c5c('0x72')][_0x7c5c('0x48')]({'raw':!![]});}return null;})['then'](function(_0x5730b8){if(_0x5730b8){_0x2744c8=_[_0x7c5c('0x73')](_0x5730b8,'id');var _0x142dad;var _0x1ff675=squel[_0x7c5c('0x74')]();_0x1ff675[_0x7c5c('0x75')](_0x951a18[_0x7c5c('0x85')]);for(var _0x44a4ae=0x0;_0x44a4ae<_0x5b775d[_0x7c5c('0x3d')];_0x44a4ae+=0x1){_0x142dad=_0x5b775d[_0x44a4ae][_0x7c5c('0x76')]?_0x2744c8[_0x5b775d[_0x44a4ae][_0x7c5c('0x76')]][_0x7c5c('0x94')]:_0x5b775d[_0x44a4ae][_0x7c5c('0x77')];_0x142dad=_0x5b775d[_0x44a4ae][_0x7c5c('0x78')]?_['replace'](_0x4ed489[_0x5b775d[_0x44a4ae][_0x7c5c('0x78')]],'%s',_0x142dad):_0x142dad;_0x142dad=_0x5b775d[_0x44a4ae][_0x7c5c('0x7a')]?_[_0x7c5c('0x79')](_0x2636e9[_0x5b775d[_0x44a4ae][_0x7c5c('0x7a')]],'%s',_0x142dad):_0x142dad;if(_0x5b775d[_0x44a4ae][_0x7c5c('0x7b')]){_0x1ff675[_0x7c5c('0x6b')](_0x142dad);}_0x5b775d[_0x44a4ae][_0x7c5c('0x7c')]&&_0x1ff675[_0x7c5c('0x7d')](_0x142dad,_0x5b775d[_0x44a4ae][_0x7c5c('0x7c')]===_0x7c5c('0x7e')?![]:!![]);_0x1ff675['field'](_0x142dad,_0x5b775d[_0x44a4ae]['alias']||_0x142dad);}if(_0x951a18[_0x7c5c('0x80')]){_0x951a18['joins']=JSON[_0x7c5c('0x81')](_0x951a18[_0x7c5c('0x80')]);for(var _0x4f6eb2=0x0;_0x4f6eb2<_0x951a18[_0x7c5c('0x80')][_0x7c5c('0x3d')];_0x4f6eb2+=0x1){if(_0x951a18[_0x7c5c('0x80')][_0x4f6eb2][_0x7c5c('0x36')]&&_[_0x7c5c('0x67')](_0x2a31e3,_0x951a18['joins'][_0x4f6eb2][_0x7c5c('0x36')])&&_0x951a18[_0x7c5c('0x80')][_0x4f6eb2]['parentKey']&&_0x951a18[_0x7c5c('0x80')][_0x4f6eb2][_0x7c5c('0x82')]&&_0x951a18['joins'][_0x4f6eb2]['foreignKey']){_0x1ff675[_0x951a18[_0x7c5c('0x80')][_0x4f6eb2]['type']](_0x951a18[_0x7c5c('0x80')][_0x4f6eb2][_0x7c5c('0x82')],null,util[_0x7c5c('0x7a')]('%s.%s\x20=\x20%s.%s',_0x951a18[_0x7c5c('0x85')],_0x951a18['joins'][_0x4f6eb2][_0x7c5c('0x95')],_0x951a18[_0x7c5c('0x80')][_0x4f6eb2]['foreignTable'],_0x951a18[_0x7c5c('0x80')][_0x4f6eb2][_0x7c5c('0x83')]));}}}if(_0x951a18[_0x7c5c('0x86')]){_0x951a18['conditions']=JSON[_0x7c5c('0x81')](_0x951a18['conditions']);_0x1ff675[_0x7c5c('0x40')](_0x560ac8(_0x951a18[_0x7c5c('0x86')][_0x7c5c('0x6b')]));}_0x221d89=_0x1ff675['clone']();_0x1ff675[_0x7c5c('0x23')](_0x50e292);_0x1ff675[_0x7c5c('0x22')](0x0);return;}})['then'](function(){if(_0x56269b[_0x7c5c('0x96')]==='web'){return null;}var _0x1200c5=_['merge'](_0x56269b,{'name':_0x56269b[_0x7c5c('0x97')]||_0x56269b[_0x7c5c('0x32')]||_0x951a18['name'],'basename':_0x23390d,'savename':util[_0x7c5c('0x7a')](_0x7c5c('0x98'),_0x56269b[_0x7c5c('0x32')]||_0x951a18[_0x7c5c('0x32')],require(_0x7c5c('0x99'))[_0x7c5c('0x9a')](0x4),_0x56269b[_0x7c5c('0x96')]||_0x7c5c('0x9b')),'reportId':_0x951a18['id'],'reportType':'custom'});return db[_0x7c5c('0x9c')][_0x7c5c('0x4e')](_0x1200c5,{'raw':!![]});})[_0x7c5c('0x2d')](function(_0x4b3ced){if(_0x951a18[_0x7c5c('0x85')]===_0x7c5c('0x9d')){_0x221d89[_0x7c5c('0x40')](_0x951a18[_0x7c5c('0x85')]+_0x7c5c('0x9e'),_0x56269b[_0x7c5c('0x9f')],_0x56269b['endDate']);}else{_0x221d89['where'](_0x951a18[_0x7c5c('0x85')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x56269b['startDate'],_0x56269b[_0x7c5c('0xa0')]);}if(_0x4b3ced){logger['info'](_0x7c5c('0xa1'),_0x221d89[_0x7c5c('0x8b')]());require('child_process')[_0x7c5c('0xa2')](path[_0x7c5c('0x5b')](__dirname,_0x7c5c('0xa3'),_0x4b3ced[_0x7c5c('0x96')]),[_0x4b3ced['id'],_0x221d89[_0x7c5c('0x8b')](),path['join'](__dirname,'../../files/reports',_0x4b3ced[_0x7c5c('0xa4')]),_0x23390d]);return _0x4b3ced;}else{var _0x47ddd5=squel[_0x7c5c('0x74')]();_0x47ddd5[_0x7c5c('0x75')]('('+_0x221d89[_0x7c5c('0x8b')]()+')','countTable');_0x47ddd5[_0x7c5c('0x77')](_0x7c5c('0xa5'),'count');_0x221d89['limit'](_0x56269b[_0x7c5c('0x23')]||_0x50e292);_0x221d89[_0x7c5c('0x22')](_0x56269b[_0x7c5c('0x22')]||0x0);return dbH[_0x7c5c('0x8a')][_0x7c5c('0x39')](_0x47ddd5[_0x7c5c('0x8b')](),{'type':dbH[_0x7c5c('0x8a')][_0x7c5c('0x8c')][_0x7c5c('0xa6')]})[_0x7c5c('0x2d')](function(_0x2a77e3){if(!_0x2a77e3[_0x7c5c('0x3d')]){_0x3d028a=0x0;}else{_0x3d028a=_0x2a77e3[0x0]['count']||0x0;}return dbH[_0x7c5c('0x8a')][_0x7c5c('0x39')](_0x221d89[_0x7c5c('0x8b')](),{'type':dbH[_0x7c5c('0x8a')][_0x7c5c('0x8c')][_0x7c5c('0xa6')]});})[_0x7c5c('0x2d')](function(_0x364dd2){return{'rows':_0x364dd2||[],'count':_0x3d028a};});}});}exports[_0x7c5c('0xa7')]=function(_0x35be68,_0x109faf){return runReport(_0x35be68[_0x7c5c('0x59')],_0x35be68[_0x7c5c('0x39')],_0x35be68[_0x7c5c('0x44')])[_0x7c5c('0x2d')](respondWithResult(_0x109faf,null))[_0x7c5c('0x49')](handleError(_0x109faf,null));};exports[_0x7c5c('0xa8')]=runReport;exports['query']=function(_0x577e8f,_0x35bcad){var _0x31125e=0xa;var _0x4ffe7b=['join',_0x7c5c('0x8d'),_0x7c5c('0x5c'),_0x7c5c('0x5d')];var _0x1698e4={'SUM':'SUM(%s)','COUNT':_0x7c5c('0x8e'),'COUNT DISTINCT':_0x7c5c('0x8f'),'MAX':_0x7c5c('0x90'),'MIN':_0x7c5c('0x5f'),'AVG':_0x7c5c('0x60'),'GROUP_CONCAT':_0x7c5c('0x61'),'GROUP_CONCAT ASC':_0x7c5c('0xa9'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x27462f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x7c5c('0x91'),'ROUND':_0x7c5c('0x65'),'UNIX_TIMESTAMP':_0x7c5c('0x66')};var _0x206c3b=function(_0x4b7210){return!_[_0x7c5c('0x67')]([_0x7c5c('0x68'),_0x7c5c('0x92'),'IS\x20EMPTY',_0x7c5c('0xaa')],_0x4b7210);};var _0x1808c1=function(_0x49c38c){if(!_0x49c38c||!_0x49c38c[_0x7c5c('0x6a')][_0x7c5c('0x3d')]){return'';}for(var _0x195aec='(',_0x4fcd85=0x0;_0x4fcd85<_0x49c38c[_0x7c5c('0x6a')]['length'];_0x4fcd85+=0x1){_0x4fcd85>0x0&&(_0x195aec+='\x20'+_0x49c38c[_0x7c5c('0x93')]+'\x20');_0x195aec+=_0x49c38c['rules'][_0x4fcd85][_0x7c5c('0x6b')]?_0x1808c1(_0x49c38c[_0x7c5c('0x6a')][_0x4fcd85][_0x7c5c('0x6b')]):_0x49c38c[_0x7c5c('0x6a')][_0x4fcd85][_0x7c5c('0x77')]+'\x20'+_0x49c38c[_0x7c5c('0x6a')][_0x4fcd85][_0x7c5c('0x6c')]+(_0x206c3b(_0x49c38c[_0x7c5c('0x6a')][_0x4fcd85][_0x7c5c('0x6c')])?'\x20'+_0x49c38c['rules'][_0x4fcd85][_0x7c5c('0x6d')]:'');}return _0x195aec+')';};var _0x3cfeb9={'where':{'id':_0x577e8f[_0x7c5c('0x59')]['id']}},_0x5390f4,_0x404e58,_0xcb6613,_0xf21f88,_0x3fa67b;_0x3cfeb9=_[_0x7c5c('0x43')]({},_0x3cfeb9,_0x577e8f[_0x7c5c('0x44')]);return db[_0x7c5c('0x45')][_0x7c5c('0x56')](_0x3cfeb9)[_0x7c5c('0x2d')](function(_0x4e53e8){if(_0x4e53e8){_0x5390f4=_0x4e53e8;return _0x4e53e8['getFields']();}return null;})[_0x7c5c('0x2d')](function(_0x1e0bd4){if(_0x1e0bd4){if(!_0x1e0bd4[_0x7c5c('0x3d')]){throw new db['Sequelize'][(_0x7c5c('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x404e58=_0x1e0bd4;return db[_0x7c5c('0x72')][_0x7c5c('0x48')]({'raw':!![]});}return null;})[_0x7c5c('0x2d')](function(_0x53374c){if(_0x53374c){_0xcb6613=_['keyBy'](_0x53374c,'id');var _0x5c0186;var _0x1eae34=squel[_0x7c5c('0x74')]();_0x1eae34[_0x7c5c('0x75')](_0x5390f4[_0x7c5c('0x85')]);for(var _0x306d1e=0x0;_0x306d1e<_0x404e58[_0x7c5c('0x3d')];_0x306d1e+=0x1){_0x5c0186=_0x404e58[_0x306d1e][_0x7c5c('0x76')]?_0xcb6613[_0x404e58[_0x306d1e][_0x7c5c('0x76')]]['metric']:_0x404e58[_0x306d1e]['field'];_0x5c0186=_0x404e58[_0x306d1e][_0x7c5c('0x78')]?_['replace'](_0x1698e4[_0x404e58[_0x306d1e]['function']],'%s',_0x5c0186):_0x5c0186;_0x5c0186=_0x404e58[_0x306d1e][_0x7c5c('0x7a')]?_['replace'](_0x27462f[_0x404e58[_0x306d1e][_0x7c5c('0x7a')]],'%s',_0x5c0186):_0x5c0186;if(_0x404e58[_0x306d1e]['groupBy']){_0x1eae34[_0x7c5c('0x6b')](_0x5c0186);}_0x404e58[_0x306d1e][_0x7c5c('0x7c')]&&_0x1eae34[_0x7c5c('0x7d')](_0x5c0186,_0x404e58[_0x306d1e][_0x7c5c('0x7c')]==='DESC'?![]:!![]);_0x1eae34[_0x7c5c('0x77')](_0x5c0186,_0x404e58[_0x306d1e][_0x7c5c('0x7f')]||_0x5c0186);}if(_0x5390f4[_0x7c5c('0x80')]){_0x5390f4['joins']=JSON[_0x7c5c('0x81')](_0x5390f4[_0x7c5c('0x80')]);for(var _0x342577=0x0;_0x342577<_0x5390f4[_0x7c5c('0x80')][_0x7c5c('0x3d')];_0x342577+=0x1){if(_0x5390f4['joins'][_0x342577][_0x7c5c('0x36')]&&_[_0x7c5c('0x67')](_0x4ffe7b,_0x5390f4[_0x7c5c('0x80')][_0x342577][_0x7c5c('0x36')])&&_0x5390f4['joins'][_0x342577][_0x7c5c('0x95')]&&_0x5390f4[_0x7c5c('0x80')][_0x342577][_0x7c5c('0x82')]&&_0x5390f4[_0x7c5c('0x80')][_0x342577][_0x7c5c('0x83')]){_0x1eae34[_0x5390f4[_0x7c5c('0x80')][_0x342577][_0x7c5c('0x36')]](_0x5390f4[_0x7c5c('0x80')][_0x342577][_0x7c5c('0x82')],null,util[_0x7c5c('0x7a')](_0x7c5c('0x84'),_0x5390f4['table'],_0x5390f4['joins'][_0x342577]['parentKey'],_0x5390f4['joins'][_0x342577][_0x7c5c('0x82')],_0x5390f4[_0x7c5c('0x80')][_0x342577][_0x7c5c('0x83')]));}}}if(_0x5390f4[_0x7c5c('0x86')]){_0x5390f4['conditions']=JSON[_0x7c5c('0x81')](_0x5390f4[_0x7c5c('0x86')]);_0x1eae34[_0x7c5c('0x40')](_0x1808c1(_0x5390f4[_0x7c5c('0x86')][_0x7c5c('0x6b')]));}_0x3fa67b=_0x1eae34['clone']();_0x1eae34[_0x7c5c('0x23')](_0x31125e);_0x1eae34[_0x7c5c('0x22')](0x0);logger[_0x7c5c('0x88')](_0x7c5c('0x89'),_0x1eae34[_0x7c5c('0x8b')]());return dbH['sequelize'][_0x7c5c('0x39')](_0x1eae34['toString'](),{'type':dbH['sequelize'][_0x7c5c('0x8c')][_0x7c5c('0xa6')]});}})[_0x7c5c('0x2d')](function(){return{'sql':_0x3fa67b[_0x7c5c('0x8b')]()};})[_0x7c5c('0x2d')](respondWithResult(_0x35bcad,null))['catch'](handleError(_0x35bcad,null));};
\ No newline at end of file
+var _0x96c1=['MetricId','metric','function','replace','groupBy','orderBy','DESC','alias','joins','parse','type','includes','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','operator','ValidationErrorItem','output','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','run','runReport','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','get','destroy','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table'];(function(_0x53d9ba,_0x33330c){var _0x287bd7=function(_0x26e481){while(--_0x26e481){_0x53d9ba['push'](_0x53d9ba['shift']());}};_0x287bd7(++_0x33330c);}(_0x96c1,0x174));var _0x196c=function(_0x5bea79,_0x5ea536){_0x5bea79=_0x5bea79-0x0;var _0x4bedcd=_0x96c1[_0x5bea79];return _0x4bedcd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x196c('0x0'));var zipdir=require(_0x196c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x196c('0x2'));var moment=require('moment');var BPromise=require(_0x196c('0x3'));var Mustache=require(_0x196c('0x4'));var util=require('util');var path=require(_0x196c('0x5'));var sox=require(_0x196c('0x6'));var csv=require('to-csv');var ejs=require(_0x196c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x196c('0x8'));var squel=require(_0x196c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x196c('0xa'));var toCsv=require(_0x196c('0xb'));var querystring=require(_0x196c('0xc'));var Papa=require(_0x196c('0xd'));var Redis=require(_0x196c('0xe'));var authService=require(_0x196c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x196c('0x10'));var hardwareService=require(_0x196c('0x11'));var logger=require(_0x196c('0x12'))(_0x196c('0x13'));var utils=require(_0x196c('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x196c('0x15'))['db'];var dbH=require('../../mysqldb')[_0x196c('0x16')];function respondWithStatusCode(_0xcc4223,_0x3fc403){_0x3fc403=_0x3fc403||0xcc;return function(_0x2ca3be){if(_0x2ca3be){return _0xcc4223[_0x196c('0x17')](_0x3fc403);}return _0xcc4223[_0x196c('0x18')](_0x3fc403)[_0x196c('0x19')]();};}function respondWithResult(_0x46f721,_0x190b69){_0x190b69=_0x190b69||0xc8;return function(_0x228810){if(_0x228810){return _0x46f721['status'](_0x190b69)[_0x196c('0x1a')](_0x228810);}};}function respondWithFilteredResult(_0x352a27,_0x13c8bd){return function(_0x523fae){if(_0x523fae){var _0x4774a2=typeof _0x13c8bd[_0x196c('0x1b')]===_0x196c('0x1c')&&typeof _0x13c8bd[_0x196c('0x1d')]===_0x196c('0x1c');var _0x473fa4=_0x523fae[_0x196c('0x1e')];var _0xe36591=_0x4774a2?0x0:_0x13c8bd[_0x196c('0x1b')];var _0x541b5d=_0x4774a2?_0x523fae[_0x196c('0x1e')]:_0x13c8bd['offset']+_0x13c8bd[_0x196c('0x1d')];var _0x278253;if(_0x541b5d>=_0x473fa4){_0x541b5d=_0x473fa4;_0x278253=0xc8;}else{_0x278253=0xce;}_0x352a27[_0x196c('0x18')](_0x278253);return _0x352a27[_0x196c('0x1f')]('Content-Range',_0xe36591+'-'+_0x541b5d+'/'+_0x473fa4)[_0x196c('0x1a')](_0x523fae);}return null;};}function patchUpdates(_0x45178c){return function(_0xae2770){try{jsonpatch[_0x196c('0x20')](_0xae2770,_0x45178c,!![]);}catch(_0x383973){return BPromise[_0x196c('0x21')](_0x383973);}return _0xae2770['save']();};}function saveUpdates(_0xcb542b,_0x217327){return function(_0x28273f){if(_0x28273f){return _0x28273f[_0x196c('0x22')](_0xcb542b)[_0x196c('0x23')](function(_0x713478){return _0x713478;});}return null;};}function removeEntity(_0x11d5f1,_0x5c328c){return function(_0x152e75){if(_0x152e75){return _0x152e75['destroy']()[_0x196c('0x23')](function(){var _0x47a7d7=_0x152e75[_0x196c('0x24')]({'plain':!![]});var _0x1fc7e5='CustomReports';return db['UserProfileResource'][_0x196c('0x25')]({'where':{'type':_0x1fc7e5,'resourceId':_0x47a7d7['id']}})['then'](function(){return _0x152e75;});})[_0x196c('0x23')](function(){_0x11d5f1[_0x196c('0x18')](0xcc)[_0x196c('0x19')]();});}};}function handleEntityNotFound(_0xc4d939,_0x15c576){return function(_0x3f0328){if(!_0x3f0328){_0xc4d939[_0x196c('0x17')](0x194);}return _0x3f0328;};}function handleError(_0x1a4449,_0x55a3c3){_0x55a3c3=_0x55a3c3||0x1f4;return function(_0x3caa61){logger[_0x196c('0x26')](_0x3caa61[_0x196c('0x27')]);if(_0x3caa61['name']){delete _0x3caa61[_0x196c('0x28')];}_0x1a4449[_0x196c('0x18')](_0x55a3c3)[_0x196c('0x29')](_0x3caa61);};}exports[_0x196c('0x2a')]=function(_0xd9d384,_0x5371cd){var _0x30e8ba={},_0x323d93={},_0x559693={'count':0x0,'rows':[]};var _0x2abc9c=_[_0x196c('0x2b')](db[_0x196c('0x2c')][_0x196c('0x2d')],function(_0x53949d){return{'name':_0x53949d['fieldName'],'type':_0x53949d['type']['key']};});_0x323d93['model']=_['map'](_0x2abc9c,'name');_0x323d93['query']=_[_0x196c('0x2e')](_0xd9d384[_0x196c('0x2f')]);_0x323d93[_0x196c('0x30')]=_['intersection'](_0x323d93[_0x196c('0x31')],_0x323d93['query']);_0x30e8ba[_0x196c('0x32')]=_[_0x196c('0x33')](_0x323d93[_0x196c('0x31')],qs['fields'](_0xd9d384['query'][_0x196c('0x34')]));_0x30e8ba[_0x196c('0x32')]=_0x30e8ba['attributes'][_0x196c('0x35')]?_0x30e8ba[_0x196c('0x32')]:_0x323d93[_0x196c('0x31')];if(!_0xd9d384[_0x196c('0x2f')][_0x196c('0x36')]('nolimit')){_0x30e8ba[_0x196c('0x1d')]=qs[_0x196c('0x1d')](_0xd9d384['query'][_0x196c('0x1d')]);_0x30e8ba[_0x196c('0x1b')]=qs[_0x196c('0x1b')](_0xd9d384[_0x196c('0x2f')][_0x196c('0x1b')]);}_0x30e8ba[_0x196c('0x37')]=qs['sort'](_0xd9d384[_0x196c('0x2f')]['sort']);_0x30e8ba[_0x196c('0x38')]=qs[_0x196c('0x30')](_['pick'](_0xd9d384[_0x196c('0x2f')],_0x323d93['filters']),_0x2abc9c);if(_0xd9d384['query'][_0x196c('0x39')]){_0x30e8ba[_0x196c('0x38')]=_[_0x196c('0x3a')](_0x30e8ba['where'],{'$or':_[_0x196c('0x2b')](_0x2abc9c,function(_0x17c5e2){if(_0x17c5e2['type']!==_0x196c('0x3b')){var _0x463e75={};_0x463e75[_0x17c5e2[_0x196c('0x28')]]={'$like':'%'+_0xd9d384[_0x196c('0x2f')][_0x196c('0x39')]+'%'};return _0x463e75;}})});}_0x30e8ba=_[_0x196c('0x3a')]({},_0x30e8ba,_0xd9d384[_0x196c('0x3c')]);var _0x17a4b4={'where':_0x30e8ba['where']};return db[_0x196c('0x2c')][_0x196c('0x1e')](_0x17a4b4)[_0x196c('0x23')](function(_0x2af661){_0x559693[_0x196c('0x1e')]=_0x2af661;if(_0xd9d384[_0x196c('0x2f')]['includeAll']){_0x30e8ba[_0x196c('0x3d')]=[{'all':!![]}];}return db[_0x196c('0x2c')][_0x196c('0x3e')](_0x30e8ba);})[_0x196c('0x23')](function(_0x2c8b78){_0x559693[_0x196c('0x3f')]=_0x2c8b78;return _0x559693;})['then'](respondWithFilteredResult(_0x5371cd,_0x30e8ba))[_0x196c('0x40')](handleError(_0x5371cd,null));};exports[_0x196c('0x41')]=function(_0x29a823,_0x33e633){var _0x1d46bf={'raw':![],'where':{'id':_0x29a823[_0x196c('0x42')]['id']}},_0x5dd72b={};_0x5dd72b[_0x196c('0x31')]=_[_0x196c('0x2e')](db[_0x196c('0x2c')]['rawAttributes']);_0x5dd72b['query']=_[_0x196c('0x2e')](_0x29a823[_0x196c('0x2f')]);_0x5dd72b[_0x196c('0x30')]=_[_0x196c('0x33')](_0x5dd72b[_0x196c('0x31')],_0x5dd72b[_0x196c('0x2f')]);_0x1d46bf[_0x196c('0x32')]=_['intersection'](_0x5dd72b[_0x196c('0x31')],qs[_0x196c('0x34')](_0x29a823['query'][_0x196c('0x34')]));_0x1d46bf['attributes']=_0x1d46bf['attributes'][_0x196c('0x35')]?_0x1d46bf[_0x196c('0x32')]:_0x5dd72b[_0x196c('0x31')];if(_0x29a823[_0x196c('0x2f')][_0x196c('0x43')]){_0x1d46bf[_0x196c('0x3d')]=[{'all':!![]}];}_0x1d46bf=_[_0x196c('0x3a')]({},_0x1d46bf,_0x29a823[_0x196c('0x3c')]);return db[_0x196c('0x2c')][_0x196c('0x44')](_0x1d46bf)[_0x196c('0x23')](handleEntityNotFound(_0x33e633,null))[_0x196c('0x23')](respondWithResult(_0x33e633,null))[_0x196c('0x40')](handleError(_0x33e633,null));};exports[_0x196c('0x45')]=function(_0x493c4c,_0x4e9e17){return db['AnalyticCustomReport']['create'](_0x493c4c[_0x196c('0x46')],{})[_0x196c('0x23')](function(_0x2f2085){var _0x36146d=_0x493c4c['user']['get']({'plain':!![]});if(!_0x36146d)throw new Error(_0x196c('0x47'));if(_0x36146d['role']===_0x196c('0x48')){var _0x2031ee=_0x2f2085['get']({'plain':!![]});var _0x45bdf2=_0x196c('0x49');return db[_0x196c('0x4a')][_0x196c('0x44')]({'where':{'name':_0x45bdf2,'userProfileId':_0x36146d[_0x196c('0x4b')]},'raw':!![]})[_0x196c('0x23')](function(_0x18650c){if(_0x18650c&&_0x18650c[_0x196c('0x4c')]===0x0){return db[_0x196c('0x4d')][_0x196c('0x45')]({'name':_0x2031ee['name'],'resourceId':_0x2031ee['id'],'type':_0x196c('0x4e'),'sectionId':_0x18650c['id']},{})[_0x196c('0x23')](function(){return _0x2f2085;});}else{return _0x2f2085;}})['catch'](function(_0x521c01){logger['error'](_0x196c('0x4f'),_0x521c01);throw _0x521c01;});}return _0x2f2085;})[_0x196c('0x23')](respondWithResult(_0x4e9e17,0xc9))[_0x196c('0x40')](handleError(_0x4e9e17,null));};exports[_0x196c('0x22')]=function(_0x21ae91,_0x3a7019){if(_0x21ae91['body']['id']){delete _0x21ae91['body']['id'];}return db[_0x196c('0x2c')][_0x196c('0x44')]({'where':{'id':_0x21ae91['params']['id']}})[_0x196c('0x23')](handleEntityNotFound(_0x3a7019,null))[_0x196c('0x23')](saveUpdates(_0x21ae91[_0x196c('0x46')],null))[_0x196c('0x23')](respondWithResult(_0x3a7019,null))[_0x196c('0x40')](handleError(_0x3a7019,null));};exports[_0x196c('0x25')]=function(_0x3a08e9,_0x352144){return db[_0x196c('0x2c')][_0x196c('0x44')]({'where':{'id':_0x3a08e9['params']['id']}})[_0x196c('0x23')](handleEntityNotFound(_0x352144,null))[_0x196c('0x23')](removeEntity(_0x352144,null))['catch'](handleError(_0x352144,null));};exports[_0x196c('0x50')]=function(_0x494e1d,_0x423d2b){var _0x34a238=0xa;var _0x2c3967=[_0x196c('0x51'),_0x196c('0x52'),'right_join',_0x196c('0x53')];var _0x1d78af={'SUM':_0x196c('0x54'),'COUNT':_0x196c('0x55'),'COUNT DISTINCT':_0x196c('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x196c('0x57'),'GROUP_CONCAT':_0x196c('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x196c('0x59')};var _0xc82530={'SEC_TO_TIME':_0x196c('0x5a'),'DATE':_0x196c('0x5b'),'HOUR':_0x196c('0x5c'),'ROUND':_0x196c('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5418f8=function(_0x189ae5){return!_['includes']([_0x196c('0x5e'),_0x196c('0x5f'),_0x196c('0x60'),_0x196c('0x61')],_0x189ae5);};var _0x569b09=function(_0x48e340){if(!_0x48e340||!_0x48e340[_0x196c('0x62')][_0x196c('0x35')]){return'';}for(var _0x586432='(',_0x530784=0x0;_0x530784<_0x48e340['rules']['length'];_0x530784+=0x1){_0x530784>0x0&&(_0x586432+='\x20'+_0x48e340['operator']+'\x20');_0x586432+=_0x48e340[_0x196c('0x62')][_0x530784][_0x196c('0x63')]?_0x569b09(_0x48e340[_0x196c('0x62')][_0x530784]['group']):_0x48e340['rules'][_0x530784][_0x196c('0x64')]+'\x20'+_0x48e340[_0x196c('0x62')][_0x530784][_0x196c('0x65')]+(_0x5418f8(_0x48e340[_0x196c('0x62')][_0x530784][_0x196c('0x65')])?'\x20'+_0x48e340[_0x196c('0x62')][_0x530784][_0x196c('0x66')]:'');}return _0x586432+')';};var _0x419172={'where':{'id':_0x494e1d[_0x196c('0x42')]['id']}},_0x55b6b0,_0x2e089a,_0x1444dc,_0x4ce772,_0x57a397;_0x419172=_[_0x196c('0x3a')]({},_0x419172,_0x494e1d['options']);return db[_0x196c('0x2c')][_0x196c('0x44')](_0x419172)[_0x196c('0x23')](function(_0x56ffa3){if(_0x56ffa3){_0x55b6b0=_0x56ffa3;return _0x56ffa3[_0x196c('0x67')]();}return null;})['then'](function(_0x3ff7d6){if(_0x3ff7d6){if(!_0x3ff7d6[_0x196c('0x35')]){throw new db[(_0x196c('0x68'))]['ValidationErrorItem'](_0x196c('0x69'),0x193);}_0x2e089a=_0x3ff7d6;return db[_0x196c('0x6a')][_0x196c('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x4b3500){if(_0x4b3500){_0x1444dc=_[_0x196c('0x6b')](_0x4b3500,'id');var _0xb9c690;var _0x5dc983=squel[_0x196c('0x6c')]();_0x5dc983[_0x196c('0x6d')](_0x55b6b0[_0x196c('0x6e')]);for(var _0x2ab622=0x0;_0x2ab622<_0x2e089a[_0x196c('0x35')];_0x2ab622+=0x1){_0xb9c690=_0x2e089a[_0x2ab622][_0x196c('0x6f')]?_0x1444dc[_0x2e089a[_0x2ab622][_0x196c('0x6f')]][_0x196c('0x70')]:_0x2e089a[_0x2ab622][_0x196c('0x64')];_0xb9c690=_0x2e089a[_0x2ab622][_0x196c('0x71')]?_['replace'](_0x1d78af[_0x2e089a[_0x2ab622]['function']],'%s',_0xb9c690):_0xb9c690;_0xb9c690=_0x2e089a[_0x2ab622]['format']?_[_0x196c('0x72')](_0xc82530[_0x2e089a[_0x2ab622]['format']],'%s',_0xb9c690):_0xb9c690;if(_0x2e089a[_0x2ab622][_0x196c('0x73')]){_0x5dc983[_0x196c('0x63')](_0xb9c690);}_0x2e089a[_0x2ab622][_0x196c('0x74')]&&_0x5dc983[_0x196c('0x37')](_0xb9c690,_0x2e089a[_0x2ab622]['orderBy']===_0x196c('0x75')?![]:!![]);_0x5dc983[_0x196c('0x64')](_0xb9c690,_0x2e089a[_0x2ab622][_0x196c('0x76')]||_0xb9c690);}if(_0x55b6b0[_0x196c('0x77')]){_0x55b6b0['joins']=JSON[_0x196c('0x78')](_0x55b6b0[_0x196c('0x77')]);for(var _0xdc3542=0x0;_0xdc3542<_0x55b6b0[_0x196c('0x77')]['length'];_0xdc3542+=0x1){if(_0x55b6b0[_0x196c('0x77')][_0xdc3542][_0x196c('0x79')]&&_[_0x196c('0x7a')](_0x2c3967,_0x55b6b0['joins'][_0xdc3542][_0x196c('0x79')])&&_0x55b6b0[_0x196c('0x77')][_0xdc3542]['parentKey']&&_0x55b6b0[_0x196c('0x77')][_0xdc3542][_0x196c('0x7b')]&&_0x55b6b0[_0x196c('0x77')][_0xdc3542][_0x196c('0x7c')]){_0x5dc983[_0x55b6b0[_0x196c('0x77')][_0xdc3542]['type']](_0x55b6b0[_0x196c('0x77')][_0xdc3542][_0x196c('0x7b')],null,util[_0x196c('0x7d')](_0x196c('0x7e'),_0x55b6b0[_0x196c('0x6e')],_0x55b6b0[_0x196c('0x77')][_0xdc3542][_0x196c('0x7f')],_0x55b6b0[_0x196c('0x77')][_0xdc3542][_0x196c('0x7b')],_0x55b6b0[_0x196c('0x77')][_0xdc3542]['foreignKey']));}}}if(_0x55b6b0['conditions']){_0x55b6b0[_0x196c('0x80')]=JSON[_0x196c('0x78')](_0x55b6b0[_0x196c('0x80')]);_0x5dc983['where'](_0x569b09(_0x55b6b0['conditions']['group']));}_0x57a397=_0x5dc983[_0x196c('0x81')]();_0x5dc983['limit'](_0x34a238);_0x5dc983[_0x196c('0x1b')](0x0);logger[_0x196c('0x82')](_0x196c('0x83'),_0x5dc983['toString']());return dbH[_0x196c('0x84')][_0x196c('0x2f')](_0x5dc983[_0x196c('0x85')](),{'type':dbH[_0x196c('0x84')][_0x196c('0x86')][_0x196c('0x87')]});}})['then'](respondWithResult(_0x423d2b,null))['catch'](handleError(_0x423d2b,null));};function runReport(_0x4380ee,_0x1cf5a0,_0x118295){var _0x182a74=_0x1cf5a0[_0x196c('0x28')];var _0x346cc7=0xa;var _0x11b867=['join',_0x196c('0x52'),'right_join',_0x196c('0x53')];var _0x2a9442={'SUM':'SUM(%s)','COUNT':_0x196c('0x55'),'COUNT DISTINCT':_0x196c('0x56'),'MAX':_0x196c('0x88'),'MIN':_0x196c('0x89'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x196c('0x58'),'GROUP_CONCAT ASC':_0x196c('0x8a'),'GROUP_CONCAT DESC':_0x196c('0x59')};var _0x2967b8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x196c('0x5b'),'HOUR':_0x196c('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x196c('0x8b')};var _0x2eec1b=function(_0x4c2075){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x196c('0x60'),_0x196c('0x61')],_0x4c2075);};var _0x45df24=function(_0x4bde63){if(!_0x4bde63||!_0x4bde63[_0x196c('0x62')][_0x196c('0x35')]){return'';}for(var _0x24e9bd='(',_0x54f405=0x0;_0x54f405<_0x4bde63[_0x196c('0x62')][_0x196c('0x35')];_0x54f405+=0x1){_0x54f405>0x0&&(_0x24e9bd+='\x20'+_0x4bde63[_0x196c('0x8c')]+'\x20');_0x24e9bd+=_0x4bde63[_0x196c('0x62')][_0x54f405][_0x196c('0x63')]?_0x45df24(_0x4bde63[_0x196c('0x62')][_0x54f405][_0x196c('0x63')]):_0x4bde63[_0x196c('0x62')][_0x54f405][_0x196c('0x64')]+'\x20'+_0x4bde63[_0x196c('0x62')][_0x54f405][_0x196c('0x65')]+(_0x2eec1b(_0x4bde63[_0x196c('0x62')][_0x54f405][_0x196c('0x65')])?'\x20'+_0x4bde63[_0x196c('0x62')][_0x54f405]['value']:'');}return _0x24e9bd+')';};var _0x17f8ea={'where':{'id':_0x4380ee['id']}},_0x26d3ae,_0x1e03aa,_0x175d48,_0x52afd4,_0x43995a;_0x17f8ea=_['merge']({},_0x17f8ea,_0x118295);return db[_0x196c('0x2c')]['find'](_0x17f8ea)['then'](function(_0x1114ed){if(_0x1114ed){_0x26d3ae=_0x1114ed;return _0x1114ed[_0x196c('0x67')]();}return null;})['then'](function(_0x52614c){if(_0x52614c){if(!_0x52614c[_0x196c('0x35')]){throw new db[(_0x196c('0x68'))][(_0x196c('0x8d'))](_0x196c('0x69'),0x193);}_0x1e03aa=_0x52614c;return db[_0x196c('0x6a')][_0x196c('0x3e')]({'raw':!![]});}return null;})['then'](function(_0x4c01fd){if(_0x4c01fd){_0x175d48=_[_0x196c('0x6b')](_0x4c01fd,'id');var _0x386360;var _0x276416=squel[_0x196c('0x6c')]();_0x276416['from'](_0x26d3ae[_0x196c('0x6e')]);for(var _0x5144e7=0x0;_0x5144e7<_0x1e03aa[_0x196c('0x35')];_0x5144e7+=0x1){_0x386360=_0x1e03aa[_0x5144e7]['MetricId']?_0x175d48[_0x1e03aa[_0x5144e7]['MetricId']]['metric']:_0x1e03aa[_0x5144e7][_0x196c('0x64')];_0x386360=_0x1e03aa[_0x5144e7][_0x196c('0x71')]?_[_0x196c('0x72')](_0x2a9442[_0x1e03aa[_0x5144e7][_0x196c('0x71')]],'%s',_0x386360):_0x386360;_0x386360=_0x1e03aa[_0x5144e7][_0x196c('0x7d')]?_[_0x196c('0x72')](_0x2967b8[_0x1e03aa[_0x5144e7][_0x196c('0x7d')]],'%s',_0x386360):_0x386360;if(_0x1e03aa[_0x5144e7][_0x196c('0x73')]){_0x276416['group'](_0x386360);}_0x1e03aa[_0x5144e7]['orderBy']&&_0x276416[_0x196c('0x37')](_0x386360,_0x1e03aa[_0x5144e7]['orderBy']===_0x196c('0x75')?![]:!![]);_0x276416[_0x196c('0x64')](_0x386360,_0x1e03aa[_0x5144e7][_0x196c('0x76')]||_0x386360);}if(_0x26d3ae['joins']){_0x26d3ae[_0x196c('0x77')]=JSON[_0x196c('0x78')](_0x26d3ae['joins']);for(var _0x709908=0x0;_0x709908<_0x26d3ae[_0x196c('0x77')][_0x196c('0x35')];_0x709908+=0x1){if(_0x26d3ae[_0x196c('0x77')][_0x709908][_0x196c('0x79')]&&_[_0x196c('0x7a')](_0x11b867,_0x26d3ae[_0x196c('0x77')][_0x709908][_0x196c('0x79')])&&_0x26d3ae[_0x196c('0x77')][_0x709908][_0x196c('0x7f')]&&_0x26d3ae['joins'][_0x709908]['foreignTable']&&_0x26d3ae[_0x196c('0x77')][_0x709908][_0x196c('0x7c')]){_0x276416[_0x26d3ae['joins'][_0x709908][_0x196c('0x79')]](_0x26d3ae['joins'][_0x709908]['foreignTable'],null,util[_0x196c('0x7d')]('%s.%s\x20=\x20%s.%s',_0x26d3ae['table'],_0x26d3ae[_0x196c('0x77')][_0x709908][_0x196c('0x7f')],_0x26d3ae[_0x196c('0x77')][_0x709908][_0x196c('0x7b')],_0x26d3ae[_0x196c('0x77')][_0x709908][_0x196c('0x7c')]));}}}if(_0x26d3ae['conditions']){_0x26d3ae[_0x196c('0x80')]=JSON[_0x196c('0x78')](_0x26d3ae['conditions']);_0x276416[_0x196c('0x38')](_0x45df24(_0x26d3ae[_0x196c('0x80')][_0x196c('0x63')]));}_0x43995a=_0x276416[_0x196c('0x81')]();_0x276416[_0x196c('0x1d')](_0x346cc7);_0x276416[_0x196c('0x1b')](0x0);return;}})['then'](function(){if(_0x1cf5a0[_0x196c('0x8e')]==='web'){return null;}var _0x1141be=_[_0x196c('0x3a')](_0x1cf5a0,{'name':_0x1cf5a0['fullPath']||_0x1cf5a0[_0x196c('0x28')]||_0x26d3ae[_0x196c('0x28')],'basename':_0x182a74,'savename':util['format'](_0x196c('0x8f'),_0x1cf5a0[_0x196c('0x28')]||_0x26d3ae[_0x196c('0x28')],require(_0x196c('0x90'))['generate'](0x4),_0x1cf5a0[_0x196c('0x8e')]||_0x196c('0x91')),'reportId':_0x26d3ae['id'],'reportType':_0x196c('0x92')});return db[_0x196c('0x93')][_0x196c('0x45')](_0x1141be,{'raw':!![]});})[_0x196c('0x23')](function(_0x452b1c){if(_0x26d3ae[_0x196c('0x6e')]===_0x196c('0x94')){_0x43995a[_0x196c('0x38')](_0x26d3ae[_0x196c('0x6e')]+_0x196c('0x95'),_0x1cf5a0[_0x196c('0x96')],_0x1cf5a0[_0x196c('0x97')]);}else{_0x43995a[_0x196c('0x38')](_0x26d3ae['table']+_0x196c('0x98'),_0x1cf5a0[_0x196c('0x96')],_0x1cf5a0[_0x196c('0x97')]);}if(_0x452b1c){logger['info'](_0x196c('0x99'),_0x43995a[_0x196c('0x85')]());require(_0x196c('0x9a'))[_0x196c('0x9b')](path['join'](__dirname,_0x196c('0x9c'),_0x452b1c[_0x196c('0x8e')]),[_0x452b1c['id'],_0x43995a['toString'](),path['join'](__dirname,_0x196c('0x9d'),_0x452b1c[_0x196c('0x9e')]),_0x182a74]);return _0x452b1c;}else{var _0x36e32f=squel[_0x196c('0x6c')]();_0x36e32f[_0x196c('0x6d')]('('+_0x43995a[_0x196c('0x85')]()+')','countTable');_0x36e32f[_0x196c('0x64')]('COUNT(*)',_0x196c('0x1e'));_0x43995a[_0x196c('0x1d')](_0x1cf5a0[_0x196c('0x1d')]||_0x346cc7);_0x43995a['offset'](_0x1cf5a0[_0x196c('0x1b')]||0x0);return dbH[_0x196c('0x84')][_0x196c('0x2f')](_0x36e32f[_0x196c('0x85')](),{'type':dbH[_0x196c('0x84')][_0x196c('0x86')][_0x196c('0x87')]})[_0x196c('0x23')](function(_0x1cc619){if(!_0x1cc619['length']){_0x52afd4=0x0;}else{_0x52afd4=_0x1cc619[0x0][_0x196c('0x1e')]||0x0;}return dbH['sequelize'][_0x196c('0x2f')](_0x43995a[_0x196c('0x85')](),{'type':dbH[_0x196c('0x84')]['QueryTypes'][_0x196c('0x87')]});})[_0x196c('0x23')](function(_0x486d48){return{'rows':_0x486d48||[],'count':_0x52afd4};});}});}exports[_0x196c('0x9f')]=function(_0x35a90,_0x212686){return runReport(_0x35a90[_0x196c('0x42')],_0x35a90[_0x196c('0x2f')],_0x35a90['options'])[_0x196c('0x23')](respondWithResult(_0x212686,null))['catch'](handleError(_0x212686,null));};exports[_0x196c('0xa0')]=runReport;exports[_0x196c('0x2f')]=function(_0x1b8f99,_0x3661e4){var _0x1aa0ca=0xa;var _0x1d8936=['join',_0x196c('0x52'),'right_join',_0x196c('0x53')];var _0x545a56={'SUM':_0x196c('0x54'),'COUNT':_0x196c('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x196c('0x88'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x196c('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4b9c10={'SEC_TO_TIME':_0x196c('0x5a'),'DATE':_0x196c('0x5b'),'HOUR':_0x196c('0x5c'),'ROUND':_0x196c('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4e6843=function(_0x3b7584){return!_['includes']([_0x196c('0x5e'),_0x196c('0x5f'),_0x196c('0x60'),_0x196c('0x61')],_0x3b7584);};var _0x346561=function(_0x5f03e4){if(!_0x5f03e4||!_0x5f03e4[_0x196c('0x62')][_0x196c('0x35')]){return'';}for(var _0x4a665f='(',_0x5ef8d4=0x0;_0x5ef8d4<_0x5f03e4[_0x196c('0x62')][_0x196c('0x35')];_0x5ef8d4+=0x1){_0x5ef8d4>0x0&&(_0x4a665f+='\x20'+_0x5f03e4[_0x196c('0x8c')]+'\x20');_0x4a665f+=_0x5f03e4[_0x196c('0x62')][_0x5ef8d4][_0x196c('0x63')]?_0x346561(_0x5f03e4[_0x196c('0x62')][_0x5ef8d4][_0x196c('0x63')]):_0x5f03e4[_0x196c('0x62')][_0x5ef8d4]['field']+'\x20'+_0x5f03e4[_0x196c('0x62')][_0x5ef8d4]['condition']+(_0x4e6843(_0x5f03e4[_0x196c('0x62')][_0x5ef8d4][_0x196c('0x65')])?'\x20'+_0x5f03e4[_0x196c('0x62')][_0x5ef8d4][_0x196c('0x66')]:'');}return _0x4a665f+')';};var _0x3ed925={'where':{'id':_0x1b8f99[_0x196c('0x42')]['id']}},_0x1f8565,_0x340fcf,_0x526627,_0x830ae4,_0x27d054;_0x3ed925=_['merge']({},_0x3ed925,_0x1b8f99[_0x196c('0x3c')]);return db[_0x196c('0x2c')][_0x196c('0x44')](_0x3ed925)['then'](function(_0x1c7252){if(_0x1c7252){_0x1f8565=_0x1c7252;return _0x1c7252['getFields']();}return null;})[_0x196c('0x23')](function(_0x5b620f){if(_0x5b620f){if(!_0x5b620f[_0x196c('0x35')]){throw new db[(_0x196c('0x68'))][(_0x196c('0x8d'))](_0x196c('0x69'),0x193);}_0x340fcf=_0x5b620f;return db[_0x196c('0x6a')][_0x196c('0x3e')]({'raw':!![]});}return null;})[_0x196c('0x23')](function(_0xe511a){if(_0xe511a){_0x526627=_[_0x196c('0x6b')](_0xe511a,'id');var _0x38939a;var _0x1e9134=squel[_0x196c('0x6c')]();_0x1e9134[_0x196c('0x6d')](_0x1f8565[_0x196c('0x6e')]);for(var _0x143823=0x0;_0x143823<_0x340fcf['length'];_0x143823+=0x1){_0x38939a=_0x340fcf[_0x143823][_0x196c('0x6f')]?_0x526627[_0x340fcf[_0x143823]['MetricId']]['metric']:_0x340fcf[_0x143823][_0x196c('0x64')];_0x38939a=_0x340fcf[_0x143823][_0x196c('0x71')]?_['replace'](_0x545a56[_0x340fcf[_0x143823][_0x196c('0x71')]],'%s',_0x38939a):_0x38939a;_0x38939a=_0x340fcf[_0x143823][_0x196c('0x7d')]?_[_0x196c('0x72')](_0x4b9c10[_0x340fcf[_0x143823][_0x196c('0x7d')]],'%s',_0x38939a):_0x38939a;if(_0x340fcf[_0x143823]['groupBy']){_0x1e9134[_0x196c('0x63')](_0x38939a);}_0x340fcf[_0x143823][_0x196c('0x74')]&&_0x1e9134['order'](_0x38939a,_0x340fcf[_0x143823]['orderBy']===_0x196c('0x75')?![]:!![]);_0x1e9134[_0x196c('0x64')](_0x38939a,_0x340fcf[_0x143823]['alias']||_0x38939a);}if(_0x1f8565[_0x196c('0x77')]){_0x1f8565[_0x196c('0x77')]=JSON[_0x196c('0x78')](_0x1f8565[_0x196c('0x77')]);for(var _0x61cf23=0x0;_0x61cf23<_0x1f8565[_0x196c('0x77')][_0x196c('0x35')];_0x61cf23+=0x1){if(_0x1f8565[_0x196c('0x77')][_0x61cf23][_0x196c('0x79')]&&_[_0x196c('0x7a')](_0x1d8936,_0x1f8565['joins'][_0x61cf23]['type'])&&_0x1f8565[_0x196c('0x77')][_0x61cf23][_0x196c('0x7f')]&&_0x1f8565[_0x196c('0x77')][_0x61cf23][_0x196c('0x7b')]&&_0x1f8565['joins'][_0x61cf23]['foreignKey']){_0x1e9134[_0x1f8565[_0x196c('0x77')][_0x61cf23][_0x196c('0x79')]](_0x1f8565['joins'][_0x61cf23]['foreignTable'],null,util[_0x196c('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1f8565[_0x196c('0x6e')],_0x1f8565[_0x196c('0x77')][_0x61cf23]['parentKey'],_0x1f8565[_0x196c('0x77')][_0x61cf23][_0x196c('0x7b')],_0x1f8565[_0x196c('0x77')][_0x61cf23][_0x196c('0x7c')]));}}}if(_0x1f8565[_0x196c('0x80')]){_0x1f8565[_0x196c('0x80')]=JSON[_0x196c('0x78')](_0x1f8565[_0x196c('0x80')]);_0x1e9134[_0x196c('0x38')](_0x346561(_0x1f8565['conditions'][_0x196c('0x63')]));}_0x27d054=_0x1e9134[_0x196c('0x81')]();_0x1e9134[_0x196c('0x1d')](_0x1aa0ca);_0x1e9134[_0x196c('0x1b')](0x0);logger[_0x196c('0x82')](_0x196c('0x83'),_0x1e9134['toString']());return dbH[_0x196c('0x84')]['query'](_0x1e9134['toString'](),{'type':dbH[_0x196c('0x84')][_0x196c('0x86')]['SELECT']});}})[_0x196c('0x23')](function(){return{'sql':_0x27d054['toString']()};})[_0x196c('0x23')](respondWithResult(_0x3661e4,null))['catch'](handleError(_0x3661e4,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 1214e23..b5dbde8 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 _0x00d5=['request-promise','path','rimraf','exports','AnalyticCustomReport','lodash','util','../../config/logger','api','bluebird'];(function(_0x41ef92,_0x4012d6){var _0x3a2add=function(_0x55d9bd){while(--_0x55d9bd){_0x41ef92['push'](_0x41ef92['shift']());}};_0x3a2add(++_0x4012d6);}(_0x00d5,0x19f));var _0x500d=function(_0x5de58a,_0x23d58e){_0x5de58a=_0x5de58a-0x0;var _0x589a6d=_0x00d5[_0x5de58a];return _0x589a6d;};'use strict';var _=require(_0x500d('0x0'));var util=require(_0x500d('0x1'));var logger=require(_0x500d('0x2'))(_0x500d('0x3'));var moment=require('moment');var BPromise=require(_0x500d('0x4'));var rp=require(_0x500d('0x5'));var fs=require('fs');var path=require(_0x500d('0x6'));var rimraf=require(_0x500d('0x7'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x500d('0x8')]=function(_0xda6957,_0x435ad3){return _0xda6957['define'](_0x500d('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2ec=['bluebird','path','rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment'];(function(_0x5ac7d7,_0x109040){var _0x23955f=function(_0x52a2ac){while(--_0x52a2ac){_0x5ac7d7['push'](_0x5ac7d7['shift']());}};_0x23955f(++_0x109040);}(_0xd2ec,0x17b));var _0xcd2e=function(_0x3b811c,_0x1e5435){_0x3b811c=_0x3b811c-0x0;var _0x126b18=_0xd2ec[_0x3b811c];return _0x126b18;};'use strict';var _=require(_0xcd2e('0x0'));var util=require(_0xcd2e('0x1'));var logger=require(_0xcd2e('0x2'))(_0xcd2e('0x3'));var moment=require(_0xcd2e('0x4'));var BPromise=require(_0xcd2e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd2e('0x6'));var rimraf=require(_0xcd2e('0x7'));var config=require(_0xcd2e('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xcd2e('0x9')]=function(_0x3a72b2,_0x164760){return _0x3a72b2[_0xcd2e('0xa')](_0xcd2e('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 04ec0b2..e830d30 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 _0xc9dc=['request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xc9dc,0x9e));var _0xcc9d=function(_0x170bda,_0x3c08ab){_0x170bda=_0x170bda-0x0;var _0x1df66d=_0xc9dc[_0x170bda];return _0x1df66d;};'use strict';var _=require(_0xcc9d('0x0'));var util=require(_0xcc9d('0x1'));var moment=require(_0xcc9d('0x2'));var BPromise=require(_0xcc9d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc9d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc9d('0x5'));var logger=require(_0xcc9d('0x6'))('rpc');var config=require(_0xcc9d('0x7'));var jayson=require(_0xcc9d('0x8'));var client=jayson[_0xcc9d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x360c03,_0x5ce81c,_0x28aa02){return new BPromise(function(_0x4ee175,_0x36c7d4){return client[_0xcc9d('0xa')](_0x360c03,_0x28aa02)['then'](function(_0x21131b){logger[_0xcc9d('0xb')](_0xcc9d('0xc'),_0x5ce81c,_0xcc9d('0xd'));logger[_0xcc9d('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x5ce81c,_0xcc9d('0xd'),JSON[_0xcc9d('0xf')](_0x21131b));if(_0x21131b[_0xcc9d('0x10')]){if(_0x21131b[_0xcc9d('0x10')][_0xcc9d('0x11')]===0x1f4){logger[_0xcc9d('0x10')](_0xcc9d('0xc'),_0x5ce81c,_0x21131b[_0xcc9d('0x10')]['message']);return _0x36c7d4(_0x21131b['error'][_0xcc9d('0x12')]);}logger['error'](_0xcc9d('0xc'),_0x5ce81c,_0x21131b['error'][_0xcc9d('0x12')]);return _0x4ee175(_0x21131b['error'][_0xcc9d('0x12')]);}else{logger['info'](_0xcc9d('0xc'),_0x5ce81c,'request\x20sent');_0x4ee175(_0x21131b[_0xcc9d('0x13')][_0xcc9d('0x12')]);}})[_0xcc9d('0x14')](function(_0x446281){logger[_0xcc9d('0x10')](_0xcc9d('0xc'),_0x5ce81c,_0x446281);_0x36c7d4(_0x446281);});});}
\ No newline at end of file
+var _0x530f=['request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x17323e,_0x3ed331){var _0x577592=function(_0xe72d15){while(--_0xe72d15){_0x17323e['push'](_0x17323e['shift']());}};_0x577592(++_0x3ed331);}(_0x530f,0x1a6));var _0xf530=function(_0x426dd2,_0x4b0012){_0x426dd2=_0x426dd2-0x0;var _0x4bc76c=_0x530f[_0x426dd2];return _0x4bc76c;};'use strict';var _=require(_0xf530('0x0'));var util=require(_0xf530('0x1'));var moment=require('moment');var BPromise=require(_0xf530('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf530('0x3'));var db=require(_0xf530('0x4'))['db'];var utils=require(_0xf530('0x5'));var logger=require(_0xf530('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf530('0x7'));var client=jayson[_0xf530('0x8')][_0xf530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b2a9a,_0x436ebf,_0x57dab6){return new BPromise(function(_0x33384,_0x528d25){return client[_0xf530('0xa')](_0x4b2a9a,_0x57dab6)[_0xf530('0xb')](function(_0xe85709){logger[_0xf530('0xc')](_0xf530('0xd'),_0x436ebf,_0xf530('0xe'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x436ebf,'request\x20sent',JSON['stringify'](_0xe85709));if(_0xe85709[_0xf530('0xf')]){if(_0xe85709[_0xf530('0xf')]['code']===0x1f4){logger['error'](_0xf530('0xd'),_0x436ebf,_0xe85709['error'][_0xf530('0x10')]);return _0x528d25(_0xe85709[_0xf530('0xf')][_0xf530('0x10')]);}logger[_0xf530('0xf')](_0xf530('0xd'),_0x436ebf,_0xe85709[_0xf530('0xf')][_0xf530('0x10')]);return _0x33384(_0xe85709['error']['message']);}else{logger[_0xf530('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x436ebf,_0xf530('0xe'));_0x33384(_0xe85709['result']['message']);}})[_0xf530('0x11')](function(_0x2364fc){logger[_0xf530('0xf')](_0xf530('0xd'),_0x436ebf,_0x2364fc);_0x528d25(_0x2364fc);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 3b75861..c2090d7 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 _0xa94d=['/:id','show','run','/:id/query','query','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index'];(function(_0x5b1d90,_0x479bd6){var _0x4fecce=function(_0x3c87c0){while(--_0x3c87c0){_0x5b1d90['push'](_0x5b1d90['shift']());}};_0x4fecce(++_0x479bd6);}(_0xa94d,0x147));var _0xda94=function(_0x1ba3fd,_0x254b67){_0x1ba3fd=_0x1ba3fd-0x0;var _0x3341b7=_0xa94d[_0x1ba3fd];return _0x3341b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xda94('0x0'));var timeout=require(_0xda94('0x1'));var express=require(_0xda94('0x2'));var router=express['Router']();var fs_extra=require(_0xda94('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xda94('0x4'));var controller=require(_0xda94('0x5'));router[_0xda94('0x6')]('/',auth[_0xda94('0x7')](),controller[_0xda94('0x8')]);router[_0xda94('0x6')](_0xda94('0x9'),auth['isAuthenticated'](),controller[_0xda94('0xa')]);router[_0xda94('0x6')]('/:id/preview',auth[_0xda94('0x7')](),controller['preview']);router[_0xda94('0x6')]('/:id/run',auth[_0xda94('0x7')](),controller[_0xda94('0xb')]);router['get'](_0xda94('0xc'),auth[_0xda94('0x7')](),controller[_0xda94('0xd')]);router[_0xda94('0xe')]('/',auth[_0xda94('0x7')](),controller[_0xda94('0xf')]);router[_0xda94('0x10')](_0xda94('0x9'),auth['isAuthenticated'](),controller[_0xda94('0x11')]);router[_0xda94('0x12')](_0xda94('0x9'),auth[_0xda94('0x7')](),controller[_0xda94('0x13')]);module[_0xda94('0x14')]=router;
\ No newline at end of file
+var _0xd213=['get','isAuthenticated','index','/:id','run','query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57a6a6,_0x170131){var _0x1d29b9=function(_0x42dc4c){while(--_0x42dc4c){_0x57a6a6['push'](_0x57a6a6['shift']());}};_0x1d29b9(++_0x170131);}(_0xd213,0xca));var _0x3d21=function(_0x3416d1,_0xb068b7){_0x3416d1=_0x3416d1-0x0;var _0x47a68b=_0xd213[_0x3416d1];return _0x47a68b;};'use strict';var multer=require(_0x3d21('0x0'));var util=require('util');var path=require(_0x3d21('0x1'));var timeout=require(_0x3d21('0x2'));var express=require('express');var router=express[_0x3d21('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3d21('0x4'));var interaction=require(_0x3d21('0x5'));var config=require(_0x3d21('0x6'));var controller=require('./analyticCustomReport.controller');router[_0x3d21('0x7')]('/',auth[_0x3d21('0x8')](),controller[_0x3d21('0x9')]);router['get'](_0x3d21('0xa'),auth[_0x3d21('0x8')](),controller['show']);router[_0x3d21('0x7')]('/:id/preview',auth[_0x3d21('0x8')](),controller['preview']);router[_0x3d21('0x7')]('/:id/run',auth[_0x3d21('0x8')](),controller[_0x3d21('0xb')]);router[_0x3d21('0x7')]('/:id/query',auth[_0x3d21('0x8')](),controller[_0x3d21('0xc')]);router['post']('/',auth[_0x3d21('0x8')](),controller[_0x3d21('0xd')]);router[_0x3d21('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3d21('0xf')]);router[_0x3d21('0x10')](_0x3d21('0xa'),auth[_0x3d21('0x8')](),controller[_0x3d21('0x11')]);module[_0x3d21('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index b431135..bfca99e 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x2c9288,_0x16be0d){var _0x4691a2=function(_0x34c63e){while(--_0x34c63e){_0x2c9288['push'](_0x2c9288['shift']());}};_0x4691a2(++_0x16be0d);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x557a0c,_0x78cee2){_0x557a0c=_0x557a0c-0x0;var _0xdbee70=_0xdbf5[_0x557a0c];return _0xdbee70;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0x33c5=['STRING','TEXT','exports'];(function(_0x2e7b8d,_0x3c8076){var _0x14b1ca=function(_0x2863da){while(--_0x2863da){_0x2e7b8d['push'](_0x2e7b8d['shift']());}};_0x14b1ca(++_0x3c8076);}(_0x33c5,0xe6));var _0x533c=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x33c5[_0x37cc52];return _0x2b4a90;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 8355a03..ef6c546 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 _0x53ec=['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','format','replace','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','HOUR(%s)','ROUND(%s)','condition','Sequelize','groupBy','foreignKey','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','cross_join','COUNT(%s)','MIN(%s)','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','include','AnalyticDefaultReport','params','includeAll','options','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','catch','preview','join','left_join','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes'];(function(_0x28afe3,_0xef8354){var _0x377bf4=function(_0x189a04){while(--_0x189a04){_0x28afe3['push'](_0x28afe3['shift']());}};_0x377bf4(++_0xef8354);}(_0x53ec,0x192));var _0xc53e=function(_0x45030e,_0x32b6b8){_0x45030e=_0x45030e-0x0;var _0x4df3be=_0x53ec[_0x45030e];return _0x4df3be;};'use strict';var emlformat=require(_0xc53e('0x0'));var rimraf=require(_0xc53e('0x1'));var zipdir=require(_0xc53e('0x2'));var jsonpatch=require(_0xc53e('0x3'));var rp=require(_0xc53e('0x4'));var moment=require(_0xc53e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc53e('0x6'));var util=require('util');var path=require(_0xc53e('0x7'));var sox=require(_0xc53e('0x8'));var csv=require('to-csv');var ejs=require(_0xc53e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0xe'));var querystring=require(_0xc53e('0xf'));var Papa=require(_0xc53e('0x10'));var Redis=require(_0xc53e('0x11'));var authService=require(_0xc53e('0x12'));var qs=require(_0xc53e('0x13'));var as=require(_0xc53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc53e('0x16'));var db=require(_0xc53e('0x17'))['db'];var dbH=require(_0xc53e('0x17'))[_0xc53e('0x18')];function respondWithStatusCode(_0x56f0e5,_0x4e74c9){_0x4e74c9=_0x4e74c9||0xcc;return function(_0x1c06cd){if(_0x1c06cd){return _0x56f0e5[_0xc53e('0x19')](_0x4e74c9);}return _0x56f0e5[_0xc53e('0x1a')](_0x4e74c9)[_0xc53e('0x1b')]();};}function respondWithResult(_0x358ef3,_0x382e87){_0x382e87=_0x382e87||0xc8;return function(_0x3dc2fa){if(_0x3dc2fa){return _0x358ef3[_0xc53e('0x1a')](_0x382e87)[_0xc53e('0x1c')](_0x3dc2fa);}};}function respondWithFilteredResult(_0x2ad6eb,_0x5b0a88){return function(_0x8a522e){if(_0x8a522e){var _0x191567=typeof _0x5b0a88[_0xc53e('0x1d')]===_0xc53e('0x1e')&&typeof _0x5b0a88[_0xc53e('0x1f')]===_0xc53e('0x1e');var _0x164016=_0x8a522e[_0xc53e('0x20')];var _0x3b550e=_0x191567?0x0:_0x5b0a88['offset'];var _0x546fab=_0x191567?_0x8a522e[_0xc53e('0x20')]:_0x5b0a88[_0xc53e('0x1d')]+_0x5b0a88[_0xc53e('0x1f')];var _0x2e85df;if(_0x546fab>=_0x164016){_0x546fab=_0x164016;_0x2e85df=0xc8;}else{_0x2e85df=0xce;}_0x2ad6eb[_0xc53e('0x1a')](_0x2e85df);return _0x2ad6eb[_0xc53e('0x21')](_0xc53e('0x22'),_0x3b550e+'-'+_0x546fab+'/'+_0x164016)[_0xc53e('0x1c')](_0x8a522e);}return null;};}function patchUpdates(_0x364c80){return function(_0x401af6){try{jsonpatch[_0xc53e('0x23')](_0x401af6,_0x364c80,!![]);}catch(_0x44fd93){return BPromise[_0xc53e('0x24')](_0x44fd93);}return _0x401af6['save']();};}function saveUpdates(_0x47cfdd,_0x531ede){return function(_0x4f4304){if(_0x4f4304){return _0x4f4304[_0xc53e('0x25')](_0x47cfdd)[_0xc53e('0x26')](function(_0x4015c8){return _0x4015c8;});}return null;};}function removeEntity(_0x180811,_0x5009e1){return function(_0x5e5377){if(_0x5e5377){return _0x5e5377[_0xc53e('0x27')]()['then'](function(){var _0x1ae55e=_0x5e5377[_0xc53e('0x28')]({'plain':!![]});var _0x443179=_0xc53e('0x29');return db[_0xc53e('0x2a')]['destroy']({'where':{'type':_0x443179,'resourceId':_0x1ae55e['id']}})[_0xc53e('0x26')](function(){return _0x5e5377;});})['then'](function(){_0x180811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c5056,_0x57a1f5){return function(_0x28240a){if(!_0x28240a){_0x3c5056['sendStatus'](0x194);}return _0x28240a;};}function handleError(_0x24a77e,_0x5112d2){_0x5112d2=_0x5112d2||0x1f4;return function(_0x5ce216){logger[_0xc53e('0x2b')](_0x5ce216[_0xc53e('0x2c')]);if(_0x5ce216[_0xc53e('0x2d')]){delete _0x5ce216[_0xc53e('0x2d')];}_0x24a77e[_0xc53e('0x1a')](_0x5112d2)[_0xc53e('0x2e')](_0x5ce216);};}exports[_0xc53e('0x2f')]=function(_0x2a2ca9,_0x4ace0b){var _0x437893={},_0x311835={},_0x2d36c0={'count':0x0,'rows':[]};var _0x56206b=_[_0xc53e('0x30')](db['AnalyticDefaultReport'][_0xc53e('0x31')],function(_0x2467f4){return{'name':_0x2467f4['fieldName'],'type':_0x2467f4['type'][_0xc53e('0x32')]};});_0x311835[_0xc53e('0x33')]=_[_0xc53e('0x30')](_0x56206b,_0xc53e('0x2d'));_0x311835[_0xc53e('0x34')]=_[_0xc53e('0x35')](_0x2a2ca9[_0xc53e('0x34')]);_0x311835[_0xc53e('0x36')]=_['intersection'](_0x311835[_0xc53e('0x33')],_0x311835[_0xc53e('0x34')]);_0x437893[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x311835[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x39')]));_0x437893[_0xc53e('0x37')]=_0x437893['attributes'][_0xc53e('0x3a')]?_0x437893['attributes']:_0x311835[_0xc53e('0x33')];if(!_0x2a2ca9[_0xc53e('0x34')]['hasOwnProperty'](_0xc53e('0x3b'))){_0x437893[_0xc53e('0x1f')]=qs[_0xc53e('0x1f')](_0x2a2ca9['query'][_0xc53e('0x1f')]);_0x437893[_0xc53e('0x1d')]=qs[_0xc53e('0x1d')](_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x1d')]);}_0x437893[_0xc53e('0x3c')]=qs[_0xc53e('0x3d')](_0x2a2ca9['query'][_0xc53e('0x3d')]);_0x437893[_0xc53e('0x3e')]=qs[_0xc53e('0x36')](_['pick'](_0x2a2ca9[_0xc53e('0x34')],_0x311835['filters']),_0x56206b);if(_0x2a2ca9[_0xc53e('0x34')][_0xc53e('0x3f')]){_0x437893[_0xc53e('0x3e')]=_[_0xc53e('0x40')](_0x437893[_0xc53e('0x3e')],{'$or':_['map'](_0x56206b,function(_0x3dda55){if(_0x3dda55[_0xc53e('0x41')]!=='VIRTUAL'){var _0x5b7354={};_0x5b7354[_0x3dda55['name']]={'$like':'%'+_0x2a2ca9['query'][_0xc53e('0x3f')]+'%'};return _0x5b7354;}})});}_0x437893=_[_0xc53e('0x40')]({},_0x437893,_0x2a2ca9['options']);var _0x460ee6={'where':_0x437893['where']};return db['AnalyticDefaultReport']['count'](_0x460ee6)[_0xc53e('0x26')](function(_0x4ba96f){_0x2d36c0['count']=_0x4ba96f;if(_0x2a2ca9[_0xc53e('0x34')]['includeAll']){_0x437893[_0xc53e('0x42')]=[{'all':!![]}];}return db[_0xc53e('0x43')]['findAll'](_0x437893);})[_0xc53e('0x26')](function(_0x3a4ebc){_0x2d36c0['rows']=_0x3a4ebc;return _0x2d36c0;})[_0xc53e('0x26')](respondWithFilteredResult(_0x4ace0b,_0x437893))['catch'](handleError(_0x4ace0b,null));};exports['show']=function(_0x481e6d,_0x4efee5){var _0x887d78={'raw':!![],'where':{'id':_0x481e6d[_0xc53e('0x44')]['id']}},_0x17b586={};_0x17b586['model']=_[_0xc53e('0x35')](db[_0xc53e('0x43')]['rawAttributes']);_0x17b586['query']=_[_0xc53e('0x35')](_0x481e6d[_0xc53e('0x34')]);_0x17b586[_0xc53e('0x36')]=_['intersection'](_0x17b586[_0xc53e('0x33')],_0x17b586[_0xc53e('0x34')]);_0x887d78[_0xc53e('0x37')]=_[_0xc53e('0x38')](_0x17b586[_0xc53e('0x33')],qs[_0xc53e('0x39')](_0x481e6d[_0xc53e('0x34')]['fields']));_0x887d78[_0xc53e('0x37')]=_0x887d78[_0xc53e('0x37')][_0xc53e('0x3a')]?_0x887d78['attributes']:_0x17b586[_0xc53e('0x33')];if(_0x481e6d[_0xc53e('0x34')][_0xc53e('0x45')]){_0x887d78[_0xc53e('0x42')]=[{'all':!![]}];}_0x887d78=_[_0xc53e('0x40')]({},_0x887d78,_0x481e6d[_0xc53e('0x46')]);return db['AnalyticDefaultReport'][_0xc53e('0x47')](_0x887d78)[_0xc53e('0x26')](handleEntityNotFound(_0x4efee5,null))[_0xc53e('0x26')](respondWithResult(_0x4efee5,null))['catch'](handleError(_0x4efee5,null));};exports[_0xc53e('0x48')]=function(_0x1d2491,_0x1eeb65){return db[_0xc53e('0x43')][_0xc53e('0x48')](_0x1d2491[_0xc53e('0x49')],{})[_0xc53e('0x26')](function(_0x2ba2b4){var _0x34de2d=_0x1d2491[_0xc53e('0x4a')]['get']({'plain':!![]});if(!_0x34de2d)throw new Error(_0xc53e('0x4b'));if(_0x34de2d[_0xc53e('0x4c')]===_0xc53e('0x4a')){var _0x3d74ac=_0x2ba2b4[_0xc53e('0x28')]({'plain':!![]});var _0x52dac7='Reports';return db[_0xc53e('0x4d')]['find']({'where':{'name':_0x52dac7,'userProfileId':_0x34de2d[_0xc53e('0x4e')]},'raw':!![]})['then'](function(_0x3a49a4){if(_0x3a49a4&&_0x3a49a4[_0xc53e('0x4f')]===0x0){return db[_0xc53e('0x2a')]['create']({'name':_0x3d74ac[_0xc53e('0x2d')],'resourceId':_0x3d74ac['id'],'type':_0xc53e('0x29'),'sectionId':_0x3a49a4['id']},{})[_0xc53e('0x26')](function(){return _0x2ba2b4;});}else{return _0x2ba2b4;}})['catch'](function(_0x2f7df2){logger['error'](_0xc53e('0x50'),_0x2f7df2);throw _0x2f7df2;});}return _0x2ba2b4;})[_0xc53e('0x26')](respondWithResult(_0x1eeb65,0xc9))['catch'](handleError(_0x1eeb65,null));};exports[_0xc53e('0x25')]=function(_0x1515ea,_0x5bba72){if(_0x1515ea[_0xc53e('0x49')]['id']){delete _0x1515ea[_0xc53e('0x49')]['id'];}return db[_0xc53e('0x43')][_0xc53e('0x47')]({'where':{'id':_0x1515ea[_0xc53e('0x44')]['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x5bba72,null))[_0xc53e('0x26')](saveUpdates(_0x1515ea[_0xc53e('0x49')],null))[_0xc53e('0x26')](respondWithResult(_0x5bba72,null))[_0xc53e('0x51')](handleError(_0x5bba72,null));};exports[_0xc53e('0x27')]=function(_0x47dd5a,_0x8364f6){return db['AnalyticDefaultReport'][_0xc53e('0x47')]({'where':{'id':_0x47dd5a['params']['id']}})[_0xc53e('0x26')](handleEntityNotFound(_0x8364f6,null))[_0xc53e('0x26')](removeEntity(_0x8364f6,null))['catch'](handleError(_0x8364f6,null));};exports[_0xc53e('0x52')]=function(_0x7f0bc0,_0x9c0112){var _0x432a91=0xa;var _0x53083b=[_0xc53e('0x53'),_0xc53e('0x54'),'right_join','cross_join'];var _0x3c0aa1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x5fcd58={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x37b091=function(_0x31e22b){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x31e22b);};var _0x13bf71=function(_0x16d8a1){if(!_0x16d8a1||!_0x16d8a1[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xdc0e49='(',_0x520738=0x0;_0x520738<_0x16d8a1[_0xc53e('0x61')]['length'];_0x520738+=0x1){_0x520738>0x0&&(_0xdc0e49+='\x20'+_0x16d8a1[_0xc53e('0x62')]+'\x20');_0xdc0e49+=_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]?_0x13bf71(_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x63')]):_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x64')]+'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738]['condition']+(_0x37b091(_0x16d8a1['rules'][_0x520738]['condition'])?'\x20'+_0x16d8a1[_0xc53e('0x61')][_0x520738][_0xc53e('0x65')]:'');}return _0xdc0e49+')';};var _0x37ac78={'where':{'id':_0x7f0bc0['params']['id']}},_0x25e4b6,_0x247d99,_0x160ca3,_0x3581ab,_0x5a9596;_0x37ac78=_['merge']({},_0x37ac78,_0x7f0bc0[_0xc53e('0x46')]);return db[_0xc53e('0x43')]['find'](_0x37ac78)[_0xc53e('0x26')](function(_0x235a6b){if(_0x235a6b){_0x25e4b6=_0x235a6b;return _0x235a6b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x22829b){if(_0x22829b){if(!_0x22829b[_0xc53e('0x3a')]){throw new db['Sequelize']['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x247d99=_0x22829b;return db[_0xc53e('0x68')][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x29ee08){if(_0x29ee08){_0x160ca3=_[_0xc53e('0x6a')](_0x29ee08,'id');var _0x5a1a4b;var _0x2b6734=squel[_0xc53e('0x6b')]();_0x2b6734[_0xc53e('0x6c')](_0x25e4b6[_0xc53e('0x6d')]);for(var _0x4d2609=0x0;_0x4d2609<_0x247d99[_0xc53e('0x3a')];_0x4d2609+=0x1){_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x6e')]?_0x160ca3[_0x247d99[_0x4d2609][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x247d99[_0x4d2609][_0xc53e('0x64')];_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x70')]?_['replace'](_0x3c0aa1[_0x247d99[_0x4d2609][_0xc53e('0x70')]],'%s',_0x5a1a4b):_0x5a1a4b;_0x5a1a4b=_0x247d99[_0x4d2609][_0xc53e('0x71')]?_[_0xc53e('0x72')](_0x5fcd58[_0x247d99[_0x4d2609][_0xc53e('0x71')]],'%s',_0x5a1a4b):_0x5a1a4b;if(_0x247d99[_0x4d2609]['groupBy']){_0x2b6734['group'](_0x5a1a4b);}_0x247d99[_0x4d2609][_0xc53e('0x73')]&&_0x2b6734[_0xc53e('0x3c')](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x2b6734['field'](_0x5a1a4b,_0x247d99[_0x4d2609][_0xc53e('0x75')]||_0x5a1a4b);}if(_0x25e4b6['joins']){_0x25e4b6[_0xc53e('0x76')]=JSON['parse'](_0x25e4b6[_0xc53e('0x76')]);for(var _0x4e128a=0x0;_0x4e128a<_0x25e4b6[_0xc53e('0x76')][_0xc53e('0x3a')];_0x4e128a+=0x1){if(_0x25e4b6['joins'][_0x4e128a][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x53083b,_0x25e4b6['joins'][_0x4e128a]['type'])&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')]&&_0x25e4b6['joins'][_0x4e128a]['foreignTable']&&_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']){_0x2b6734[_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['type']](_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x25e4b6[_0xc53e('0x6d')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x77')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a][_0xc53e('0x78')],_0x25e4b6[_0xc53e('0x76')][_0x4e128a]['foreignKey']));}}}if(_0x25e4b6[_0xc53e('0x7a')]){_0x25e4b6['conditions']=JSON[_0xc53e('0x7b')](_0x25e4b6[_0xc53e('0x7a')]);_0x2b6734[_0xc53e('0x3e')](_0x13bf71(_0x25e4b6[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x5a9596=_0x2b6734[_0xc53e('0x7c')]();_0x2b6734[_0xc53e('0x1f')](_0x432a91);_0x2b6734[_0xc53e('0x1d')](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x2b6734['toString']());return dbH[_0xc53e('0x7f')]['query'](_0x2b6734[_0xc53e('0x80')](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']});}})[_0xc53e('0x26')](respondWithResult(_0x9c0112,null))[_0xc53e('0x51')](handleError(_0x9c0112,null));};function runReport(_0x381652,_0xec3738,_0x3a84a2){var _0x508671=_0xec3738[_0xc53e('0x2d')];var _0x48e337=0xa;var _0x56c66f=[_0xc53e('0x53'),_0xc53e('0x54'),_0xc53e('0x82'),'cross_join'];var _0x35b6dc={'SUM':_0xc53e('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc53e('0x85'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc53e('0x58')};var _0x3d2636={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':'DATE(%s)','HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x4c8112=function(_0x1a8ae4){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),'IS\x20NOT\x20EMPTY'],_0x1a8ae4);};var _0x3dac82=function(_0x325287){if(!_0x325287||!_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')]){return'';}for(var _0xe6a976='(',_0x4102bc=0x0;_0x4102bc<_0x325287[_0xc53e('0x61')][_0xc53e('0x3a')];_0x4102bc+=0x1){_0x4102bc>0x0&&(_0xe6a976+='\x20'+_0x325287[_0xc53e('0x62')]+'\x20');_0xe6a976+=_0x325287['rules'][_0x4102bc][_0xc53e('0x63')]?_0x3dac82(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x63')]):_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x64')]+'\x20'+_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')]+(_0x4c8112(_0x325287[_0xc53e('0x61')][_0x4102bc][_0xc53e('0x88')])?'\x20'+_0x325287['rules'][_0x4102bc][_0xc53e('0x65')]:'');}return _0xe6a976+')';};var _0x190509={'where':{'id':_0x381652['id']}},_0x110e32,_0x2135d4,_0x4bbf8a,_0x31b06d,_0x21fc8d;_0x190509=_[_0xc53e('0x40')]({},_0x190509,_0x3a84a2);return db[_0xc53e('0x43')]['find'](_0x190509)[_0xc53e('0x26')](function(_0x138870){if(_0x138870){_0x110e32=_0x138870;return _0x138870[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x621e78){if(_0x621e78){if(!_0x621e78[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))]['ValidationErrorItem'](_0xc53e('0x67'),0x193);}_0x2135d4=_0x621e78;return db['AnalyticMetric'][_0xc53e('0x69')]({'raw':!![]});}return null;})[_0xc53e('0x26')](function(_0x3fe278){if(_0x3fe278){_0x4bbf8a=_['keyBy'](_0x3fe278,'id');var _0x7c56eb;var _0x36dffe=squel[_0xc53e('0x6b')]();_0x36dffe['from'](_0x110e32[_0xc53e('0x6d')]);for(var _0xedb93a=0x0;_0xedb93a<_0x2135d4[_0xc53e('0x3a')];_0xedb93a+=0x1){_0x7c56eb=_0x2135d4[_0xedb93a]['MetricId']?_0x4bbf8a[_0x2135d4[_0xedb93a][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x2135d4[_0xedb93a][_0xc53e('0x64')];_0x7c56eb=_0x2135d4[_0xedb93a][_0xc53e('0x70')]?_[_0xc53e('0x72')](_0x35b6dc[_0x2135d4[_0xedb93a]['function']],'%s',_0x7c56eb):_0x7c56eb;_0x7c56eb=_0x2135d4[_0xedb93a]['format']?_['replace'](_0x3d2636[_0x2135d4[_0xedb93a][_0xc53e('0x71')]],'%s',_0x7c56eb):_0x7c56eb;if(_0x2135d4[_0xedb93a][_0xc53e('0x8a')]){_0x36dffe[_0xc53e('0x63')](_0x7c56eb);}_0x2135d4[_0xedb93a][_0xc53e('0x73')]&&_0x36dffe['order'](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x73')]==='DESC'?![]:!![]);_0x36dffe[_0xc53e('0x64')](_0x7c56eb,_0x2135d4[_0xedb93a][_0xc53e('0x75')]||_0x7c56eb);}if(_0x110e32[_0xc53e('0x76')]){_0x110e32[_0xc53e('0x76')]=JSON['parse'](_0x110e32[_0xc53e('0x76')]);for(var _0xc23eef=0x0;_0xc23eef<_0x110e32[_0xc53e('0x76')][_0xc53e('0x3a')];_0xc23eef+=0x1){if(_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]&&_[_0xc53e('0x5c')](_0x56c66f,_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')])&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')]&&_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x8b')]){_0x36dffe[_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x41')]](_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x78')],null,util[_0xc53e('0x71')](_0xc53e('0x79'),_0x110e32[_0xc53e('0x6d')],_0x110e32[_0xc53e('0x76')][_0xc23eef][_0xc53e('0x77')],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignTable'],_0x110e32[_0xc53e('0x76')][_0xc23eef]['foreignKey']));}}}if(_0x110e32[_0xc53e('0x7a')]){_0x110e32[_0xc53e('0x7a')]=JSON['parse'](_0x110e32[_0xc53e('0x7a')]);_0x36dffe[_0xc53e('0x3e')](_0x3dac82(_0x110e32[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x21fc8d=_0x36dffe[_0xc53e('0x7c')]();_0x36dffe[_0xc53e('0x1f')](_0x48e337);_0x36dffe[_0xc53e('0x1d')](0x0);return;}})[_0xc53e('0x26')](function(){if(_0xec3738[_0xc53e('0x8c')]==='web'){return null;}var _0x37c8e6=_['merge'](_0xec3738,{'name':_0xec3738[_0xc53e('0x8d')]||_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],'basename':_0x508671,'savename':util[_0xc53e('0x71')](_0xc53e('0x8e'),_0xec3738[_0xc53e('0x2d')]||_0x110e32[_0xc53e('0x2d')],require(_0xc53e('0x8f'))[_0xc53e('0x90')](0x4),_0xec3738[_0xc53e('0x8c')]||_0xc53e('0x91')),'reportId':_0x110e32['id'],'reportType':_0xc53e('0x92')});return db[_0xc53e('0x93')]['create'](_0x37c8e6,{'raw':!![]});})[_0xc53e('0x26')](function(_0x575ef5){if(_0x110e32[_0xc53e('0x6d')]===_0xc53e('0x94')){_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xec3738['startDate'],_0xec3738[_0xc53e('0x95')]);}else{_0x21fc8d[_0xc53e('0x3e')](_0x110e32[_0xc53e('0x6d')]+_0xc53e('0x96'),_0xec3738['startDate'],_0xec3738['endDate']);}if(_0x575ef5){logger[_0xc53e('0x97')](_0xc53e('0x98'),_0x21fc8d[_0xc53e('0x80')]());require(_0xc53e('0x99'))[_0xc53e('0x9a')](path[_0xc53e('0x53')](__dirname,'../../components/export/',_0x575ef5[_0xc53e('0x8c')]),[_0x575ef5['id'],_0x21fc8d[_0xc53e('0x80')](),path[_0xc53e('0x53')](__dirname,_0xc53e('0x9b'),_0x575ef5[_0xc53e('0x9c')]),_0x508671]);return _0x575ef5;}else{var _0x4f527e=squel[_0xc53e('0x6b')]();_0x4f527e[_0xc53e('0x6c')]('('+_0x21fc8d[_0xc53e('0x80')]()+')',_0xc53e('0x9d'));_0x4f527e[_0xc53e('0x64')](_0xc53e('0x9e'),_0xc53e('0x20'));_0x21fc8d[_0xc53e('0x1f')](_0xec3738[_0xc53e('0x1f')]||_0x48e337);_0x21fc8d[_0xc53e('0x1d')](_0xec3738[_0xc53e('0x1d')]||0x0);return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x4f527e['toString'](),{'type':dbH[_0xc53e('0x7f')][_0xc53e('0x81')]['SELECT']})[_0xc53e('0x26')](function(_0x4ee56b){if(!_0x4ee56b['length']){_0x31b06d=0x0;}else{_0x31b06d=_0x4ee56b[0x0][_0xc53e('0x20')]||0x0;}return dbH['sequelize'][_0xc53e('0x34')](_0x21fc8d['toString'](),{'type':dbH[_0xc53e('0x7f')]['QueryTypes'][_0xc53e('0x9f')]});})[_0xc53e('0x26')](function(_0x10ad32){return{'rows':_0x10ad32||[],'count':_0x31b06d};});}});}exports['run']=function(_0xf3f34a,_0x5dd87e){return runReport(_0xf3f34a[_0xc53e('0x44')],_0xf3f34a[_0xc53e('0x34')],_0xf3f34a[_0xc53e('0x46')])[_0xc53e('0x26')](respondWithResult(_0x5dd87e,null))[_0xc53e('0x51')](handleError(_0x5dd87e,null));};exports[_0xc53e('0xa0')]=runReport;exports[_0xc53e('0x34')]=function(_0x265292,_0x2c776c){var _0x383f22=0xa;var _0x51f2a4=['join',_0xc53e('0x54'),'right_join',_0xc53e('0xa1')];var _0xbc960={'SUM':_0xc53e('0x83'),'COUNT':_0xc53e('0xa2'),'COUNT DISTINCT':_0xc53e('0x84'),'MAX':_0xc53e('0x55'),'MIN':_0xc53e('0xa3'),'AVG':_0xc53e('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc53e('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x34cb12={'SEC_TO_TIME':_0xc53e('0x59'),'DATE':_0xc53e('0x5a'),'HOUR':_0xc53e('0x86'),'ROUND':_0xc53e('0x87'),'UNIX_TIMESTAMP':_0xc53e('0x5b')};var _0x227e0c=function(_0x4c0802){return!_[_0xc53e('0x5c')]([_0xc53e('0x5d'),_0xc53e('0x5e'),_0xc53e('0x5f'),_0xc53e('0x60')],_0x4c0802);};var _0x590fb6=function(_0x15d269){if(!_0x15d269||!_0x15d269[_0xc53e('0x61')]['length']){return'';}for(var _0x5253b1='(',_0x208c17=0x0;_0x208c17<_0x15d269['rules'][_0xc53e('0x3a')];_0x208c17+=0x1){_0x208c17>0x0&&(_0x5253b1+='\x20'+_0x15d269[_0xc53e('0x62')]+'\x20');_0x5253b1+=_0x15d269['rules'][_0x208c17]['group']?_0x590fb6(_0x15d269[_0xc53e('0x61')][_0x208c17]['group']):_0x15d269[_0xc53e('0x61')][_0x208c17]['field']+'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')]+(_0x227e0c(_0x15d269[_0xc53e('0x61')][_0x208c17][_0xc53e('0x88')])?'\x20'+_0x15d269[_0xc53e('0x61')][_0x208c17]['value']:'');}return _0x5253b1+')';};var _0x2f5d22={'where':{'id':_0x265292[_0xc53e('0x44')]['id']}},_0x478e57,_0x5e427a,_0x3e666b,_0x365a98,_0x375d8b;_0x2f5d22=_[_0xc53e('0x40')]({},_0x2f5d22,_0x265292[_0xc53e('0x46')]);return db[_0xc53e('0x43')][_0xc53e('0x47')](_0x2f5d22)[_0xc53e('0x26')](function(_0x3b778b){if(_0x3b778b){_0x478e57=_0x3b778b;return _0x3b778b[_0xc53e('0x66')]();}return null;})[_0xc53e('0x26')](function(_0x55581a){if(_0x55581a){if(!_0x55581a[_0xc53e('0x3a')]){throw new db[(_0xc53e('0x89'))][(_0xc53e('0xa4'))](_0xc53e('0x67'),0x193);}_0x5e427a=_0x55581a;return db[_0xc53e('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x34c717){if(_0x34c717){_0x3e666b=_[_0xc53e('0x6a')](_0x34c717,'id');var _0x2718fe;var _0x15014e=squel[_0xc53e('0x6b')]();_0x15014e[_0xc53e('0x6c')](_0x478e57[_0xc53e('0x6d')]);for(var _0x2d80f5=0x0;_0x2d80f5<_0x5e427a[_0xc53e('0x3a')];_0x2d80f5+=0x1){_0x2718fe=_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]?_0x3e666b[_0x5e427a[_0x2d80f5][_0xc53e('0x6e')]][_0xc53e('0x6f')]:_0x5e427a[_0x2d80f5][_0xc53e('0x64')];_0x2718fe=_0x5e427a[_0x2d80f5]['function']?_[_0xc53e('0x72')](_0xbc960[_0x5e427a[_0x2d80f5][_0xc53e('0x70')]],'%s',_0x2718fe):_0x2718fe;_0x2718fe=_0x5e427a[_0x2d80f5]['format']?_[_0xc53e('0x72')](_0x34cb12[_0x5e427a[_0x2d80f5][_0xc53e('0x71')]],'%s',_0x2718fe):_0x2718fe;if(_0x5e427a[_0x2d80f5][_0xc53e('0x8a')]){_0x15014e['group'](_0x2718fe);}_0x5e427a[_0x2d80f5]['orderBy']&&_0x15014e[_0xc53e('0x3c')](_0x2718fe,_0x5e427a[_0x2d80f5][_0xc53e('0x73')]===_0xc53e('0x74')?![]:!![]);_0x15014e[_0xc53e('0x64')](_0x2718fe,_0x5e427a[_0x2d80f5]['alias']||_0x2718fe);}if(_0x478e57[_0xc53e('0x76')]){_0x478e57[_0xc53e('0x76')]=JSON[_0xc53e('0x7b')](_0x478e57['joins']);for(var _0x48d301=0x0;_0x48d301<_0x478e57[_0xc53e('0x76')][_0xc53e('0x3a')];_0x48d301+=0x1){if(_0x478e57[_0xc53e('0x76')][_0x48d301]['type']&&_[_0xc53e('0x5c')](_0x51f2a4,_0x478e57[_0xc53e('0x76')][_0x48d301]['type'])&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')]&&_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x78')]&&_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']){_0x15014e[_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x41')]](_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],null,util['format'](_0xc53e('0x79'),_0x478e57[_0xc53e('0x6d')],_0x478e57[_0xc53e('0x76')][_0x48d301][_0xc53e('0x77')],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignTable'],_0x478e57[_0xc53e('0x76')][_0x48d301]['foreignKey']));}}}if(_0x478e57[_0xc53e('0x7a')]){_0x478e57[_0xc53e('0x7a')]=JSON[_0xc53e('0x7b')](_0x478e57[_0xc53e('0x7a')]);_0x15014e[_0xc53e('0x3e')](_0x590fb6(_0x478e57[_0xc53e('0x7a')][_0xc53e('0x63')]));}_0x375d8b=_0x15014e[_0xc53e('0x7c')]();_0x15014e[_0xc53e('0x1f')](_0x383f22);_0x15014e['offset'](0x0);logger[_0xc53e('0x7d')](_0xc53e('0x7e'),_0x15014e[_0xc53e('0x80')]());return dbH[_0xc53e('0x7f')][_0xc53e('0x34')](_0x15014e[_0xc53e('0x80')](),{'type':dbH['sequelize'][_0xc53e('0x81')][_0xc53e('0x9f')]});}})[_0xc53e('0x26')](function(){return{'sql':_0x375d8b[_0xc53e('0x80')]()};})[_0xc53e('0x26')](respondWithResult(_0x2c776c,null))[_0xc53e('0x51')](handleError(_0x2c776c,null));};
\ No newline at end of file
+var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x454cc9,_0x2dc258){var _0x538d36=function(_0x1b1655){while(--_0x1b1655){_0x454cc9['push'](_0x454cc9['shift']());}};_0x538d36(++_0x2dc258);}(_0x524e,0x15e));var _0xe524=function(_0x801fea,_0x246d11){_0x801fea=_0x801fea-0x0;var _0x341147=_0x524e[_0x801fea];return _0x341147;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 0ee4c8e..5a44f5e 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 _0x0382=['api','moment','request-promise','path','rimraf','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x57c9db,_0x5e3706){var _0x34b33d=function(_0x1976fb){while(--_0x1976fb){_0x57c9db['push'](_0x57c9db['shift']());}};_0x34b33d(++_0x5e3706);}(_0x0382,0x1c5));var _0x2038=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x0382[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require(_0x2038('0x0'));var util=require(_0x2038('0x1'));var logger=require(_0x2038('0x2'))(_0x2038('0x3'));var moment=require(_0x2038('0x4'));var BPromise=require('bluebird');var rp=require(_0x2038('0x5'));var fs=require('fs');var path=require(_0x2038('0x6'));var rimraf=require(_0x2038('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x2038('0x8')]=function(_0xb7eab,_0x360fd8){return _0xb7eab[_0x2038('0x9')](_0x2038('0xa'),attributes,{'tableName':_0x2038('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdbe7=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x357dd7,_0x431a02){var _0xcb0466=function(_0x3ab60d){while(--_0x3ab60d){_0x357dd7['push'](_0x357dd7['shift']());}};_0xcb0466(++_0x431a02);}(_0xdbe7,0xe4));var _0x7dbe=function(_0x4ae4d6,_0x2f62d5){_0x4ae4d6=_0x4ae4d6-0x0;var _0x5de416=_0xdbe7[_0x4ae4d6];return _0x5de416;};'use strict';var _=require(_0x7dbe('0x0'));var util=require('util');var logger=require(_0x7dbe('0x1'))(_0x7dbe('0x2'));var moment=require('moment');var BPromise=require(_0x7dbe('0x3'));var rp=require(_0x7dbe('0x4'));var fs=require('fs');var path=require(_0x7dbe('0x5'));var rimraf=require(_0x7dbe('0x6'));var config=require(_0x7dbe('0x7'));var attributes=require(_0x7dbe('0x8'));module[_0x7dbe('0x9')]=function(_0x5c9a55,_0x4ee1fc){return _0x5c9a55[_0x7dbe('0xa')](_0x7dbe('0xb'),attributes,{'tableName':_0x7dbe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 17e63b2..e3f4925 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 _0x0e8e=['../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','AnalyticDefaultReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4b6ccc,_0x146dc3){var _0x15e250=function(_0xef70d5){while(--_0xef70d5){_0x4b6ccc['push'](_0x4b6ccc['shift']());}};_0x15e250(++_0x146dc3);}(_0x0e8e,0xd5));var _0xe0e8=function(_0x5500c4,_0x160ef0){_0x5500c4=_0x5500c4-0x0;var _0x36c5ff=_0x0e8e[_0x5500c4];return _0x36c5ff;};'use strict';var _=require(_0xe0e8('0x0'));var util=require(_0xe0e8('0x1'));var moment=require(_0xe0e8('0x2'));var BPromise=require(_0xe0e8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0e8('0x4'));var db=require(_0xe0e8('0x5'))['db'];var utils=require(_0xe0e8('0x6'));var logger=require(_0xe0e8('0x7'))(_0xe0e8('0x8'));var config=require('../../config/environment');var jayson=require(_0xe0e8('0x9'));var client=jayson[_0xe0e8('0xa')][_0xe0e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59f947,_0x60cd75,_0x1f7c17){return new BPromise(function(_0x47e025,_0x45013f){return client[_0xe0e8('0xc')](_0x59f947,_0x1f7c17)['then'](function(_0x2b2ab9){logger[_0xe0e8('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x60cd75,_0xe0e8('0xe'));logger[_0xe0e8('0xf')](_0xe0e8('0x10'),_0x60cd75,_0xe0e8('0xe'),JSON['stringify'](_0x2b2ab9));if(_0x2b2ab9['error']){if(_0x2b2ab9[_0xe0e8('0x11')]['code']===0x1f4){logger[_0xe0e8('0x11')](_0xe0e8('0x12'),_0x60cd75,_0x2b2ab9[_0xe0e8('0x11')][_0xe0e8('0x13')]);return _0x45013f(_0x2b2ab9['error'][_0xe0e8('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x60cd75,_0x2b2ab9['error'][_0xe0e8('0x13')]);return _0x47e025(_0x2b2ab9['error'][_0xe0e8('0x13')]);}else{logger[_0xe0e8('0xd')](_0xe0e8('0x12'),_0x60cd75,'request\x20sent');_0x47e025(_0x2b2ab9['result']['message']);}})['catch'](function(_0x5dd6c5){logger['error'](_0xe0e8('0x12'),_0x60cd75,_0x5dd6c5);_0x45013f(_0x5dd6c5);});});}
\ No newline at end of file
+var _0xee48=['request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x31aed6,_0x424dcc){var _0x45ac4a=function(_0x1b5d37){while(--_0x1b5d37){_0x31aed6['push'](_0x31aed6['shift']());}};_0x45ac4a(++_0x424dcc);}(_0xee48,0x1a5));var _0x8ee4=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xee48[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0x8ee4('0x0'));var util=require(_0x8ee4('0x1'));var moment=require(_0x8ee4('0x2'));var BPromise=require(_0x8ee4('0x3'));var rs=require(_0x8ee4('0x4'));var fs=require('fs');var Redis=require(_0x8ee4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ee4('0x6'));var logger=require(_0x8ee4('0x7'))(_0x8ee4('0x8'));var config=require(_0x8ee4('0x9'));var jayson=require(_0x8ee4('0xa'));var client=jayson[_0x8ee4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x774139,_0x4f03f6,_0x1e9158){return new BPromise(function(_0x4943fd,_0x3b45e4){return client[_0x8ee4('0xc')](_0x774139,_0x1e9158)[_0x8ee4('0xd')](function(_0x4e53ce){logger[_0x8ee4('0xe')](_0x8ee4('0xf'),_0x4f03f6,_0x8ee4('0x10'));logger[_0x8ee4('0x11')](_0x8ee4('0x12'),_0x4f03f6,_0x8ee4('0x10'),JSON['stringify'](_0x4e53ce));if(_0x4e53ce[_0x8ee4('0x13')]){if(_0x4e53ce[_0x8ee4('0x13')][_0x8ee4('0x14')]===0x1f4){logger[_0x8ee4('0x13')](_0x8ee4('0xf'),_0x4f03f6,_0x4e53ce[_0x8ee4('0x13')][_0x8ee4('0x15')]);return _0x3b45e4(_0x4e53ce[_0x8ee4('0x13')][_0x8ee4('0x15')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4f03f6,_0x4e53ce[_0x8ee4('0x13')][_0x8ee4('0x15')]);return _0x4943fd(_0x4e53ce[_0x8ee4('0x13')][_0x8ee4('0x15')]);}else{logger[_0x8ee4('0xe')](_0x8ee4('0xf'),_0x4f03f6,'request\x20sent');_0x4943fd(_0x4e53ce[_0x8ee4('0x16')][_0x8ee4('0x15')]);}})['catch'](function(_0x33981d){logger['error'](_0x8ee4('0xf'),_0x4f03f6,_0x33981d);_0x3b45e4(_0x33981d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index cad32b5..ed90403 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 _0x8276=['Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','preview','run','query','post','update','multer','util','express'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x8276,0xa7));var _0x6827=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8276[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x6827('0x0'));var util=require(_0x6827('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6827('0x2'));var router=express[_0x6827('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6827('0x4'));var interaction=require(_0x6827('0x5'));var config=require('../../config/environment');var controller=require(_0x6827('0x6'));router[_0x6827('0x7')]('/',auth[_0x6827('0x8')](),controller[_0x6827('0x9')]);router[_0x6827('0x7')](_0x6827('0xa'),auth[_0x6827('0x8')](),controller[_0x6827('0xb')]);router[_0x6827('0x7')]('/:id/preview',auth[_0x6827('0x8')](),controller[_0x6827('0xc')]);router[_0x6827('0x7')]('/:id/run',auth[_0x6827('0x8')](),controller[_0x6827('0xd')]);router[_0x6827('0x7')]('/:id/query',auth[_0x6827('0x8')](),controller[_0x6827('0xe')]);router[_0x6827('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6827('0xa'),auth[_0x6827('0x8')](),controller[_0x6827('0x10')]);router['delete'](_0x6827('0xa'),auth[_0x6827('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4be7=['index','/:id','/:id/preview','preview','/:id/run','/:id/query','post','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x189fe1,_0x373c91){var _0x17364e=function(_0x1b5471){while(--_0x1b5471){_0x189fe1['push'](_0x189fe1['shift']());}};_0x17364e(++_0x373c91);}(_0x4be7,0x114));var _0x74be=function(_0x59ae80,_0x56b205){_0x59ae80=_0x59ae80-0x0;var _0x473bf9=_0x4be7[_0x59ae80];return _0x473bf9;};'use strict';var multer=require(_0x74be('0x0'));var util=require(_0x74be('0x1'));var path=require(_0x74be('0x2'));var timeout=require('connect-timeout');var express=require(_0x74be('0x3'));var router=express[_0x74be('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x74be('0x5'));var config=require(_0x74be('0x6'));var controller=require(_0x74be('0x7'));router[_0x74be('0x8')]('/',auth[_0x74be('0x9')](),controller[_0x74be('0xa')]);router['get'](_0x74be('0xb'),auth[_0x74be('0x9')](),controller['show']);router['get'](_0x74be('0xc'),auth[_0x74be('0x9')](),controller[_0x74be('0xd')]);router[_0x74be('0x8')](_0x74be('0xe'),auth[_0x74be('0x9')](),controller['run']);router['get'](_0x74be('0xf'),auth[_0x74be('0x9')](),controller['query']);router[_0x74be('0x10')]('/',auth[_0x74be('0x9')](),controller[_0x74be('0x11')]);router[_0x74be('0x12')]('/:id',auth[_0x74be('0x9')](),controller['update']);router[_0x74be('0x13')](_0x74be('0xb'),auth[_0x74be('0x9')](),controller[_0x74be('0x14')]);module[_0x74be('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 00d448c..28aa429 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 _0x684d=['STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x4232bf,_0x538fe0){var _0x11e51e=function(_0x246746){while(--_0x246746){_0x4232bf['push'](_0x4232bf['shift']());}};_0x11e51e(++_0x538fe0);}(_0x684d,0xe2));var _0xd684=function(_0x869bce,_0x18c2f9){_0x869bce=_0x869bce-0x0;var _0x889be3=_0x684d[_0x869bce];return _0x889be3;};'use strict';var Sequelize=require(_0xd684('0x0'));var moment=require(_0xd684('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xd684('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd684('0x3')]('csv',_0xd684('0x4'),_0xd684('0x5')),'allowNull':![],'defaultValue':_0xd684('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xd684('0x7')]},'endDate':{'type':Sequelize[_0xd684('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xd684('0x8')},'type':{'type':Sequelize[_0xd684('0x3')](_0xd684('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0xd684('0x9')},'reportId':{'type':Sequelize[_0xd684('0xa')](0xb)[_0xd684('0xb')]},'reportType':{'type':Sequelize[_0xd684('0x2')]}};
\ No newline at end of file
+var _0xba3f=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','INTEGER','moment','exports'];(function(_0x4177c6,_0x4e2e1d){var _0xb34d1f=function(_0x5dbf33){while(--_0x5dbf33){_0x4177c6['push'](_0x4177c6['shift']());}};_0xb34d1f(++_0x4e2e1d);}(_0xba3f,0x195));var _0xfba3=function(_0x46964a,_0x3a9ed5){_0x46964a=_0x46964a-0x0;var _0x2df4ad=_0xba3f[_0x46964a];return _0x2df4ad;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfba3('0x0'));module[_0xfba3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xfba3('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xfba3('0x3')](_0xfba3('0x4'),_0xfba3('0x5'),_0xfba3('0x6')),'allowNull':![],'defaultValue':_0xfba3('0x4')},'savename':{'type':Sequelize[_0xfba3('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfba3('0x7')]},'endDate':{'type':Sequelize[_0xfba3('0x7')]},'status':{'type':Sequelize[_0xfba3('0x2')],'defaultValue':_0xfba3('0x8')},'type':{'type':Sequelize[_0xfba3('0x3')](_0xfba3('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0xfba3('0x9')},'reportId':{'type':Sequelize[_0xfba3('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xfba3('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index e8382d8..90edff4 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 _0xfd59=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','AnalyticExtractedReport','includeAll','include','findAll','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','download','basename','savename','output','existsSync','join','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','stack','name','index','map','fieldName','type','model'];(function(_0x33a2b3,_0x4dcb36){var _0xf11442=function(_0x3bfd77){while(--_0x3bfd77){_0x33a2b3['push'](_0x33a2b3['shift']());}};_0xf11442(++_0x4dcb36);}(_0xfd59,0x154));var _0x9fd5=function(_0x1b59af,_0x40b2db){_0x1b59af=_0x1b59af-0x0;var _0x54e6f5=_0xfd59[_0x1b59af];return _0x54e6f5;};'use strict';var emlformat=require(_0x9fd5('0x0'));var rimraf=require(_0x9fd5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fd5('0x2'));var rp=require(_0x9fd5('0x3'));var moment=require(_0x9fd5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9fd5('0x5'));var util=require(_0x9fd5('0x6'));var path=require(_0x9fd5('0x7'));var sox=require(_0x9fd5('0x8'));var csv=require(_0x9fd5('0x9'));var ejs=require(_0x9fd5('0xa'));var fs=require('fs');var fs_extra=require(_0x9fd5('0xb'));var _=require(_0x9fd5('0xc'));var squel=require(_0x9fd5('0xd'));var crypto=require(_0x9fd5('0xe'));var jsforce=require(_0x9fd5('0xf'));var deskjs=require(_0x9fd5('0x10'));var toCsv=require(_0x9fd5('0x9'));var querystring=require(_0x9fd5('0x11'));var Papa=require(_0x9fd5('0x12'));var Redis=require(_0x9fd5('0x13'));var authService=require(_0x9fd5('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9fd5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9fd5('0x16'))(_0x9fd5('0x17'));var utils=require(_0x9fd5('0x18'));var config=require(_0x9fd5('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x9fd5('0x1a'))['db'];function respondWithStatusCode(_0x30c2f3,_0x2ee368){_0x2ee368=_0x2ee368||0xcc;return function(_0x4d486f){if(_0x4d486f){return _0x30c2f3[_0x9fd5('0x1b')](_0x2ee368);}return _0x30c2f3[_0x9fd5('0x1c')](_0x2ee368)['end']();};}function respondWithResult(_0x46f810,_0x5b34cc){_0x5b34cc=_0x5b34cc||0xc8;return function(_0x429928){if(_0x429928){return _0x46f810[_0x9fd5('0x1c')](_0x5b34cc)[_0x9fd5('0x1d')](_0x429928);}};}function respondWithFilteredResult(_0x211868,_0x213626){return function(_0x28d83b){if(_0x28d83b){var _0x4f13c8=typeof _0x213626[_0x9fd5('0x1e')]==='undefined'&&typeof _0x213626[_0x9fd5('0x1f')]===_0x9fd5('0x20');var _0x292383=_0x28d83b['count'];var _0x5beed3=_0x4f13c8?0x0:_0x213626[_0x9fd5('0x1e')];var _0x5eb46f=_0x4f13c8?_0x28d83b[_0x9fd5('0x21')]:_0x213626['offset']+_0x213626[_0x9fd5('0x1f')];var _0x58db0e;if(_0x5eb46f>=_0x292383){_0x5eb46f=_0x292383;_0x58db0e=0xc8;}else{_0x58db0e=0xce;}_0x211868[_0x9fd5('0x1c')](_0x58db0e);return _0x211868[_0x9fd5('0x22')]('Content-Range',_0x5beed3+'-'+_0x5eb46f+'/'+_0x292383)['json'](_0x28d83b);}return null;};}function patchUpdates(_0x1a8662){return function(_0x1fdc00){try{jsonpatch[_0x9fd5('0x23')](_0x1fdc00,_0x1a8662,!![]);}catch(_0x1f4462){return BPromise[_0x9fd5('0x24')](_0x1f4462);}return _0x1fdc00[_0x9fd5('0x25')]();};}function saveUpdates(_0x17bc53,_0x4e7d6c){return function(_0x59bb9d){if(_0x59bb9d){return _0x59bb9d[_0x9fd5('0x26')](_0x17bc53)[_0x9fd5('0x27')](function(_0xf07d03){return _0xf07d03;});}return null;};}function removeEntity(_0x28c8dd,_0x45b97b){return function(_0x5cadef){if(_0x5cadef){return _0x5cadef[_0x9fd5('0x28')]()[_0x9fd5('0x27')](function(){var _0x1d9d77=_0x5cadef[_0x9fd5('0x29')]({'plain':!![]});var _0x379b8b=_0x9fd5('0x2a');return db[_0x9fd5('0x2b')][_0x9fd5('0x28')]({'where':{'type':_0x379b8b,'resourceId':_0x1d9d77['id']}})[_0x9fd5('0x27')](function(){return _0x5cadef;});})[_0x9fd5('0x27')](function(){_0x28c8dd[_0x9fd5('0x1c')](0xcc)[_0x9fd5('0x2c')]();});}};}function handleEntityNotFound(_0x420cc8,_0x2dc21a){return function(_0x2505eb){if(!_0x2505eb){_0x420cc8[_0x9fd5('0x1b')](0x194);}return _0x2505eb;};}function handleError(_0x11c260,_0x59d978){_0x59d978=_0x59d978||0x1f4;return function(_0x237c2d){logger['error'](_0x237c2d[_0x9fd5('0x2d')]);if(_0x237c2d[_0x9fd5('0x2e')]){delete _0x237c2d[_0x9fd5('0x2e')];}_0x11c260[_0x9fd5('0x1c')](_0x59d978)['send'](_0x237c2d);};}exports[_0x9fd5('0x2f')]=function(_0x4247a6,_0x117573){var _0x3910cf={},_0x4cb4e4={},_0xceb175={'count':0x0,'rows':[]};var _0x5a4aac=_[_0x9fd5('0x30')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x397df6){return{'name':_0x397df6[_0x9fd5('0x31')],'type':_0x397df6[_0x9fd5('0x32')]['key']};});_0x4cb4e4[_0x9fd5('0x33')]=_[_0x9fd5('0x30')](_0x5a4aac,_0x9fd5('0x2e'));_0x4cb4e4[_0x9fd5('0x34')]=_[_0x9fd5('0x35')](_0x4247a6['query']);_0x4cb4e4[_0x9fd5('0x36')]=_[_0x9fd5('0x37')](_0x4cb4e4[_0x9fd5('0x33')],_0x4cb4e4[_0x9fd5('0x34')]);_0x3910cf[_0x9fd5('0x38')]=_[_0x9fd5('0x37')](_0x4cb4e4[_0x9fd5('0x33')],qs[_0x9fd5('0x39')](_0x4247a6[_0x9fd5('0x34')]['fields']));_0x3910cf[_0x9fd5('0x38')]=_0x3910cf['attributes'][_0x9fd5('0x3a')]?_0x3910cf[_0x9fd5('0x38')]:_0x4cb4e4[_0x9fd5('0x33')];if(!_0x4247a6[_0x9fd5('0x34')][_0x9fd5('0x3b')](_0x9fd5('0x3c'))){_0x3910cf[_0x9fd5('0x1f')]=qs[_0x9fd5('0x1f')](_0x4247a6[_0x9fd5('0x34')][_0x9fd5('0x1f')]);_0x3910cf[_0x9fd5('0x1e')]=qs[_0x9fd5('0x1e')](_0x4247a6[_0x9fd5('0x34')][_0x9fd5('0x1e')]);}_0x3910cf[_0x9fd5('0x3d')]=qs['sort'](_0x4247a6[_0x9fd5('0x34')][_0x9fd5('0x3e')]);_0x3910cf[_0x9fd5('0x3f')]=qs['filters'](_[_0x9fd5('0x40')](_0x4247a6[_0x9fd5('0x34')],_0x4cb4e4[_0x9fd5('0x36')]),_0x5a4aac);if(_0x4247a6[_0x9fd5('0x34')]['filter']){_0x3910cf[_0x9fd5('0x3f')]=_[_0x9fd5('0x41')](_0x3910cf['where'],{'$or':_[_0x9fd5('0x30')](_0x5a4aac,function(_0x5d7040){if(_0x5d7040[_0x9fd5('0x32')]!=='VIRTUAL'){var _0x5e5228={};_0x5e5228[_0x5d7040[_0x9fd5('0x2e')]]={'$like':'%'+_0x4247a6[_0x9fd5('0x34')][_0x9fd5('0x42')]+'%'};return _0x5e5228;}})});}_0x3910cf=_[_0x9fd5('0x41')]({},_0x3910cf,_0x4247a6[_0x9fd5('0x43')]);var _0xad78db={'where':_0x3910cf[_0x9fd5('0x3f')]};return db[_0x9fd5('0x44')][_0x9fd5('0x21')](_0xad78db)[_0x9fd5('0x27')](function(_0x320d9d){_0xceb175['count']=_0x320d9d;if(_0x4247a6['query'][_0x9fd5('0x45')]){_0x3910cf[_0x9fd5('0x46')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x9fd5('0x47')](_0x3910cf);})[_0x9fd5('0x27')](function(_0x26061d){_0xceb175['rows']=_0x26061d;return _0xceb175;})[_0x9fd5('0x27')](respondWithFilteredResult(_0x117573,_0x3910cf))[_0x9fd5('0x48')](handleError(_0x117573,null));};exports[_0x9fd5('0x49')]=function(_0x11e157,_0x37f46c){var _0x10b5c2={'raw':!![],'where':{'id':_0x11e157['params']['id']}},_0x1d411f={};_0x1d411f[_0x9fd5('0x33')]=_[_0x9fd5('0x35')](db['AnalyticExtractedReport']['rawAttributes']);_0x1d411f['query']=_[_0x9fd5('0x35')](_0x11e157[_0x9fd5('0x34')]);_0x1d411f[_0x9fd5('0x36')]=_['intersection'](_0x1d411f[_0x9fd5('0x33')],_0x1d411f[_0x9fd5('0x34')]);_0x10b5c2['attributes']=_[_0x9fd5('0x37')](_0x1d411f[_0x9fd5('0x33')],qs[_0x9fd5('0x39')](_0x11e157['query'][_0x9fd5('0x39')]));_0x10b5c2[_0x9fd5('0x38')]=_0x10b5c2[_0x9fd5('0x38')][_0x9fd5('0x3a')]?_0x10b5c2[_0x9fd5('0x38')]:_0x1d411f[_0x9fd5('0x33')];if(_0x11e157[_0x9fd5('0x34')][_0x9fd5('0x45')]){_0x10b5c2[_0x9fd5('0x46')]=[{'all':!![]}];}_0x10b5c2=_['merge']({},_0x10b5c2,_0x11e157['options']);return db[_0x9fd5('0x44')]['find'](_0x10b5c2)[_0x9fd5('0x27')](handleEntityNotFound(_0x37f46c,null))[_0x9fd5('0x27')](respondWithResult(_0x37f46c,null))['catch'](handleError(_0x37f46c,null));};exports[_0x9fd5('0x4a')]=function(_0x534479,_0x343180){return db[_0x9fd5('0x44')]['create'](_0x534479[_0x9fd5('0x4b')],{})[_0x9fd5('0x27')](function(_0x1c2ae1){var _0x32f5b3=_0x534479[_0x9fd5('0x4c')]['get']({'plain':!![]});if(!_0x32f5b3)throw new Error(_0x9fd5('0x4d'));if(_0x32f5b3[_0x9fd5('0x4e')]===_0x9fd5('0x4c')){var _0x1f1cb4=_0x1c2ae1[_0x9fd5('0x29')]({'plain':!![]});var _0xc9ec1e=_0x9fd5('0x2a');return db[_0x9fd5('0x4f')]['find']({'where':{'name':_0xc9ec1e,'userProfileId':_0x32f5b3[_0x9fd5('0x50')]},'raw':!![]})[_0x9fd5('0x27')](function(_0x5ba2d8){if(_0x5ba2d8&&_0x5ba2d8[_0x9fd5('0x51')]===0x0){return db['UserProfileResource'][_0x9fd5('0x4a')]({'name':_0x1f1cb4[_0x9fd5('0x2e')],'resourceId':_0x1f1cb4['id'],'type':_0x5ba2d8['name'],'sectionId':_0x5ba2d8['id']},{})['then'](function(){return _0x1c2ae1;});}else{return _0x1c2ae1;}})[_0x9fd5('0x48')](function(_0x3227ef){logger[_0x9fd5('0x52')](_0x9fd5('0x53'),_0x3227ef);throw _0x3227ef;});}return _0x1c2ae1;})[_0x9fd5('0x27')](respondWithResult(_0x343180,0xc9))[_0x9fd5('0x48')](handleError(_0x343180,null));};exports['update']=function(_0x4e7eab,_0x231cd0){if(_0x4e7eab[_0x9fd5('0x4b')]['id']){delete _0x4e7eab['body']['id'];}return db[_0x9fd5('0x44')]['find']({'where':{'id':_0x4e7eab['params']['id']}})[_0x9fd5('0x27')](handleEntityNotFound(_0x231cd0,null))['then'](saveUpdates(_0x4e7eab['body'],null))['then'](respondWithResult(_0x231cd0,null))[_0x9fd5('0x48')](handleError(_0x231cd0,null));};exports['destroy']=function(_0x481584,_0x324206){return db[_0x9fd5('0x44')][_0x9fd5('0x54')]({'where':{'id':_0x481584[_0x9fd5('0x55')]['id']}})[_0x9fd5('0x27')](handleEntityNotFound(_0x324206,null))[_0x9fd5('0x27')](removeEntity(_0x324206,null))['catch'](handleError(_0x324206,null));};exports[_0x9fd5('0x56')]=function(_0x890360,_0x17e1a9,_0x574f1d){return db[_0x9fd5('0x44')][_0x9fd5('0x54')]({'where':{'id':_0x890360['params']['id']},'attributes':[_0x9fd5('0x2e'),_0x9fd5('0x57'),_0x9fd5('0x58'),_0x9fd5('0x59')],'raw':!![]})[_0x9fd5('0x27')](handleEntityNotFound(_0x17e1a9,null))[_0x9fd5('0x27')](function(_0x1c4fa0){if(_0x1c4fa0){if(!fs[_0x9fd5('0x5a')](path[_0x9fd5('0x5b')](config['root'],'server/files/reports',_0x1c4fa0[_0x9fd5('0x58')]))){throw new db['Sequelize'][(_0x9fd5('0x5c'))](_0x9fd5('0x5d'));}if(_0x890360['query'][_0x9fd5('0x5e')]){return _0x17e1a9[_0x9fd5('0x1b')](0xc8);}return _0x17e1a9[_0x9fd5('0x56')](path[_0x9fd5('0x5b')](config['root'],_0x9fd5('0x5f'),_0x1c4fa0[_0x9fd5('0x58')]),util[_0x9fd5('0x60')](_0x9fd5('0x61'),_0x1c4fa0['basename']||_0x1c4fa0[_0x9fd5('0x2e')],_0x1c4fa0[_0x9fd5('0x59')]['toLowerCase']()));}})['catch'](handleError(_0x17e1a9,null));};
\ No newline at end of file
+var _0xd25e=['offset','undefined','limit','count','Content-Range','json','apply','save','then','get','ExtractedReports','destroy','error','stack','name','map','AnalyticExtractedReport','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','length','find','catch','create','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x237bf7,_0xb851fc){var _0x5928ba=function(_0x14c0d0){while(--_0x14c0d0){_0x237bf7['push'](_0x237bf7['shift']());}};_0x5928ba(++_0xb851fc);}(_0xd25e,0x1c3));var _0xed25=function(_0x4eb4b0,_0x27c635){_0x4eb4b0=_0x4eb4b0-0x0;var _0x4209c9=_0xd25e[_0x4eb4b0];return _0x4209c9;};'use strict';var emlformat=require(_0xed25('0x0'));var rimraf=require(_0xed25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed25('0x2'));var rp=require(_0xed25('0x3'));var moment=require(_0xed25('0x4'));var BPromise=require(_0xed25('0x5'));var Mustache=require(_0xed25('0x6'));var util=require(_0xed25('0x7'));var path=require(_0xed25('0x8'));var sox=require(_0xed25('0x9'));var csv=require('to-csv');var ejs=require(_0xed25('0xa'));var fs=require('fs');var fs_extra=require(_0xed25('0xb'));var _=require('lodash');var squel=require(_0xed25('0xc'));var crypto=require(_0xed25('0xd'));var jsforce=require(_0xed25('0xe'));var deskjs=require(_0xed25('0xf'));var toCsv=require(_0xed25('0x10'));var querystring=require(_0xed25('0x11'));var Papa=require(_0xed25('0x12'));var Redis=require(_0xed25('0x13'));var authService=require(_0xed25('0x14'));var qs=require(_0xed25('0x15'));var as=require(_0xed25('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed25('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xed25('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xed25('0x19'))['db'];function respondWithStatusCode(_0xaee3b5,_0x231a75){_0x231a75=_0x231a75||0xcc;return function(_0x303081){if(_0x303081){return _0xaee3b5[_0xed25('0x1a')](_0x231a75);}return _0xaee3b5[_0xed25('0x1b')](_0x231a75)[_0xed25('0x1c')]();};}function respondWithResult(_0x47b11e,_0x26ef59){_0x26ef59=_0x26ef59||0xc8;return function(_0x27781c){if(_0x27781c){return _0x47b11e[_0xed25('0x1b')](_0x26ef59)['json'](_0x27781c);}};}function respondWithFilteredResult(_0x427b37,_0x47771b){return function(_0x3238fb){if(_0x3238fb){var _0x377e29=typeof _0x47771b[_0xed25('0x1d')]===_0xed25('0x1e')&&typeof _0x47771b[_0xed25('0x1f')]==='undefined';var _0xe43e3b=_0x3238fb[_0xed25('0x20')];var _0x3bc551=_0x377e29?0x0:_0x47771b[_0xed25('0x1d')];var _0x324f30=_0x377e29?_0x3238fb['count']:_0x47771b[_0xed25('0x1d')]+_0x47771b[_0xed25('0x1f')];var _0x2e7ee3;if(_0x324f30>=_0xe43e3b){_0x324f30=_0xe43e3b;_0x2e7ee3=0xc8;}else{_0x2e7ee3=0xce;}_0x427b37[_0xed25('0x1b')](_0x2e7ee3);return _0x427b37['set'](_0xed25('0x21'),_0x3bc551+'-'+_0x324f30+'/'+_0xe43e3b)[_0xed25('0x22')](_0x3238fb);}return null;};}function patchUpdates(_0x5bdff5){return function(_0x20a589){try{jsonpatch[_0xed25('0x23')](_0x20a589,_0x5bdff5,!![]);}catch(_0x60060f){return BPromise['reject'](_0x60060f);}return _0x20a589[_0xed25('0x24')]();};}function saveUpdates(_0x5d6133,_0x2aba00){return function(_0x499368){if(_0x499368){return _0x499368['update'](_0x5d6133)['then'](function(_0x1c6ce4){return _0x1c6ce4;});}return null;};}function removeEntity(_0x5a55ea,_0x11c7f4){return function(_0x392de7){if(_0x392de7){return _0x392de7['destroy']()[_0xed25('0x25')](function(){var _0x12e3f=_0x392de7[_0xed25('0x26')]({'plain':!![]});var _0x499943=_0xed25('0x27');return db['UserProfileResource'][_0xed25('0x28')]({'where':{'type':_0x499943,'resourceId':_0x12e3f['id']}})['then'](function(){return _0x392de7;});})[_0xed25('0x25')](function(){_0x5a55ea[_0xed25('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13173c,_0x5ea7eb){return function(_0x51da28){if(!_0x51da28){_0x13173c[_0xed25('0x1a')](0x194);}return _0x51da28;};}function handleError(_0x130b6c,_0x3aae3a){_0x3aae3a=_0x3aae3a||0x1f4;return function(_0x186e5c){logger[_0xed25('0x29')](_0x186e5c[_0xed25('0x2a')]);if(_0x186e5c[_0xed25('0x2b')]){delete _0x186e5c[_0xed25('0x2b')];}_0x130b6c[_0xed25('0x1b')](_0x3aae3a)['send'](_0x186e5c);};}exports['index']=function(_0x45b95b,_0x224c8e){var _0x26a14f={},_0x276a6a={},_0x3418f9={'count':0x0,'rows':[]};var _0xfb157c=_[_0xed25('0x2c')](db[_0xed25('0x2d')]['rawAttributes'],function(_0x27de92){return{'name':_0x27de92[_0xed25('0x2e')],'type':_0x27de92[_0xed25('0x2f')][_0xed25('0x30')]};});_0x276a6a[_0xed25('0x31')]=_[_0xed25('0x2c')](_0xfb157c,_0xed25('0x2b'));_0x276a6a['query']=_[_0xed25('0x32')](_0x45b95b[_0xed25('0x33')]);_0x276a6a['filters']=_[_0xed25('0x34')](_0x276a6a[_0xed25('0x31')],_0x276a6a[_0xed25('0x33')]);_0x26a14f[_0xed25('0x35')]=_['intersection'](_0x276a6a[_0xed25('0x31')],qs[_0xed25('0x36')](_0x45b95b[_0xed25('0x33')][_0xed25('0x36')]));_0x26a14f['attributes']=_0x26a14f['attributes']['length']?_0x26a14f[_0xed25('0x35')]:_0x276a6a[_0xed25('0x31')];if(!_0x45b95b['query'][_0xed25('0x37')](_0xed25('0x38'))){_0x26a14f[_0xed25('0x1f')]=qs[_0xed25('0x1f')](_0x45b95b[_0xed25('0x33')]['limit']);_0x26a14f[_0xed25('0x1d')]=qs[_0xed25('0x1d')](_0x45b95b[_0xed25('0x33')][_0xed25('0x1d')]);}_0x26a14f[_0xed25('0x39')]=qs[_0xed25('0x3a')](_0x45b95b[_0xed25('0x33')]['sort']);_0x26a14f[_0xed25('0x3b')]=qs[_0xed25('0x3c')](_[_0xed25('0x3d')](_0x45b95b[_0xed25('0x33')],_0x276a6a[_0xed25('0x3c')]),_0xfb157c);if(_0x45b95b[_0xed25('0x33')][_0xed25('0x3e')]){_0x26a14f[_0xed25('0x3b')]=_['merge'](_0x26a14f[_0xed25('0x3b')],{'$or':_[_0xed25('0x2c')](_0xfb157c,function(_0x270d82){if(_0x270d82[_0xed25('0x2f')]!==_0xed25('0x3f')){var _0x3fe677={};_0x3fe677[_0x270d82['name']]={'$like':'%'+_0x45b95b[_0xed25('0x33')][_0xed25('0x3e')]+'%'};return _0x3fe677;}})});}_0x26a14f=_[_0xed25('0x40')]({},_0x26a14f,_0x45b95b[_0xed25('0x41')]);var _0x145fef={'where':_0x26a14f[_0xed25('0x3b')]};return db[_0xed25('0x2d')][_0xed25('0x20')](_0x145fef)[_0xed25('0x25')](function(_0x30a543){_0x3418f9[_0xed25('0x20')]=_0x30a543;if(_0x45b95b[_0xed25('0x33')][_0xed25('0x42')]){_0x26a14f['include']=[{'all':!![]}];}return db[_0xed25('0x2d')][_0xed25('0x43')](_0x26a14f);})[_0xed25('0x25')](function(_0x43168b){_0x3418f9[_0xed25('0x44')]=_0x43168b;return _0x3418f9;})[_0xed25('0x25')](respondWithFilteredResult(_0x224c8e,_0x26a14f))['catch'](handleError(_0x224c8e,null));};exports[_0xed25('0x45')]=function(_0xb5b181,_0x2c501e){var _0x11dcb2={'raw':!![],'where':{'id':_0xb5b181['params']['id']}},_0x1dac52={};_0x1dac52['model']=_['keys'](db[_0xed25('0x2d')]['rawAttributes']);_0x1dac52['query']=_['keys'](_0xb5b181[_0xed25('0x33')]);_0x1dac52[_0xed25('0x3c')]=_[_0xed25('0x34')](_0x1dac52['model'],_0x1dac52[_0xed25('0x33')]);_0x11dcb2[_0xed25('0x35')]=_[_0xed25('0x34')](_0x1dac52['model'],qs[_0xed25('0x36')](_0xb5b181['query'][_0xed25('0x36')]));_0x11dcb2['attributes']=_0x11dcb2[_0xed25('0x35')][_0xed25('0x46')]?_0x11dcb2[_0xed25('0x35')]:_0x1dac52[_0xed25('0x31')];if(_0xb5b181[_0xed25('0x33')]['includeAll']){_0x11dcb2['include']=[{'all':!![]}];}_0x11dcb2=_[_0xed25('0x40')]({},_0x11dcb2,_0xb5b181[_0xed25('0x41')]);return db[_0xed25('0x2d')][_0xed25('0x47')](_0x11dcb2)[_0xed25('0x25')](handleEntityNotFound(_0x2c501e,null))[_0xed25('0x25')](respondWithResult(_0x2c501e,null))[_0xed25('0x48')](handleError(_0x2c501e,null));};exports[_0xed25('0x49')]=function(_0x1aa332,_0x3f8ec1){return db[_0xed25('0x2d')][_0xed25('0x49')](_0x1aa332['body'],{})[_0xed25('0x25')](function(_0x3f29a5){var _0x1f2352=_0x1aa332['user'][_0xed25('0x26')]({'plain':!![]});if(!_0x1f2352)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f2352[_0xed25('0x4a')]==='user'){var _0x3e8564=_0x3f29a5[_0xed25('0x26')]({'plain':!![]});var _0x5e9ae8=_0xed25('0x27');return db[_0xed25('0x4b')][_0xed25('0x47')]({'where':{'name':_0x5e9ae8,'userProfileId':_0x1f2352[_0xed25('0x4c')]},'raw':!![]})[_0xed25('0x25')](function(_0x37ec03){if(_0x37ec03&&_0x37ec03[_0xed25('0x4d')]===0x0){return db[_0xed25('0x4e')][_0xed25('0x49')]({'name':_0x3e8564[_0xed25('0x2b')],'resourceId':_0x3e8564['id'],'type':_0x37ec03[_0xed25('0x2b')],'sectionId':_0x37ec03['id']},{})[_0xed25('0x25')](function(){return _0x3f29a5;});}else{return _0x3f29a5;}})['catch'](function(_0x46702b){logger[_0xed25('0x29')](_0xed25('0x4f'),_0x46702b);throw _0x46702b;});}return _0x3f29a5;})['then'](respondWithResult(_0x3f8ec1,0xc9))[_0xed25('0x48')](handleError(_0x3f8ec1,null));};exports[_0xed25('0x50')]=function(_0x152145,_0x4cc127){if(_0x152145['body']['id']){delete _0x152145[_0xed25('0x51')]['id'];}return db['AnalyticExtractedReport'][_0xed25('0x47')]({'where':{'id':_0x152145['params']['id']}})[_0xed25('0x25')](handleEntityNotFound(_0x4cc127,null))[_0xed25('0x25')](saveUpdates(_0x152145[_0xed25('0x51')],null))['then'](respondWithResult(_0x4cc127,null))['catch'](handleError(_0x4cc127,null));};exports[_0xed25('0x28')]=function(_0x3a28c6,_0x206078){return db['AnalyticExtractedReport'][_0xed25('0x47')]({'where':{'id':_0x3a28c6[_0xed25('0x52')]['id']}})[_0xed25('0x25')](handleEntityNotFound(_0x206078,null))[_0xed25('0x25')](removeEntity(_0x206078,null))['catch'](handleError(_0x206078,null));};exports[_0xed25('0x53')]=function(_0x43704c,_0x55f662,_0x3eb282){return db[_0xed25('0x2d')]['find']({'where':{'id':_0x43704c[_0xed25('0x52')]['id']},'attributes':[_0xed25('0x2b'),_0xed25('0x54'),_0xed25('0x55'),_0xed25('0x56')],'raw':!![]})[_0xed25('0x25')](handleEntityNotFound(_0x55f662,null))[_0xed25('0x25')](function(_0xb7a3b){if(_0xb7a3b){if(!fs[_0xed25('0x57')](path[_0xed25('0x58')](config[_0xed25('0x59')],'server/files/reports',_0xb7a3b[_0xed25('0x55')]))){throw new db[(_0xed25('0x5a'))][(_0xed25('0x5b'))](_0xed25('0x5c'));}if(_0x43704c['query'][_0xed25('0x5d')]){return _0x55f662['sendStatus'](0xc8);}return _0x55f662[_0xed25('0x53')](path[_0xed25('0x58')](config[_0xed25('0x59')],_0xed25('0x5e'),_0xb7a3b[_0xed25('0x55')]),util[_0xed25('0x5f')]('%s.%s',_0xb7a3b[_0xed25('0x54')]||_0xb7a3b[_0xed25('0x2b')],_0xb7a3b['output']['toLowerCase']()));}})[_0xed25('0x48')](handleError(_0x55f662,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 4cfc14c..860f4c2 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 _0x9970=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api'];(function(_0x85e29d,_0x9a1e60){var _0x351b9e=function(_0x2b7457){while(--_0x2b7457){_0x85e29d['push'](_0x85e29d['shift']());}};_0x351b9e(++_0x9a1e60);}(_0x9970,0x8c));var _0x0997=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9970[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x0997('0x0'));var util=require('util');var logger=require(_0x0997('0x1'))(_0x0997('0x2'));var moment=require(_0x0997('0x3'));var BPromise=require(_0x0997('0x4'));var rp=require(_0x0997('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0997('0x6'));var config=require(_0x0997('0x7'));var attributes=require(_0x0997('0x8'));module[_0x0997('0x9')]=function(_0x411da7,_0x1e98b7){return _0x411da7[_0x0997('0xa')](_0x0997('0xb'),attributes,{'tableName':_0x0997('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x90c3=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x90c3,0xdb));var _0x390c=function(_0x3b06a5,_0xbbecbb){_0x3b06a5=_0x3b06a5-0x0;var _0x9ea4ea=_0x90c3[_0x3b06a5];return _0x9ea4ea;};'use strict';var _=require(_0x390c('0x0'));var util=require(_0x390c('0x1'));var logger=require(_0x390c('0x2'))('api');var moment=require(_0x390c('0x3'));var BPromise=require(_0x390c('0x4'));var rp=require(_0x390c('0x5'));var fs=require('fs');var path=require(_0x390c('0x6'));var rimraf=require(_0x390c('0x7'));var config=require(_0x390c('0x8'));var attributes=require(_0x390c('0x9'));module[_0x390c('0xa')]=function(_0x456e06,_0x51eeca){return _0x456e06['define'](_0x390c('0xb'),attributes,{'tableName':_0x390c('0xc'),'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 cf2842f..e68d029 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 _0x2dac=['error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x2bc186,_0x3a4e44){var _0x30a0c4=function(_0x32a129){while(--_0x32a129){_0x2bc186['push'](_0x2bc186['shift']());}};_0x30a0c4(++_0x3a4e44);}(_0x2dac,0x98));var _0xc2da=function(_0x31d636,_0x11a8cf){_0x31d636=_0x31d636-0x0;var _0x3a5382=_0x2dac[_0x31d636];return _0x3a5382;};'use strict';var _=require(_0xc2da('0x0'));var util=require(_0xc2da('0x1'));var moment=require('moment');var BPromise=require(_0xc2da('0x2'));var rs=require(_0xc2da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2da('0x4'))['db'];var utils=require(_0xc2da('0x5'));var logger=require(_0xc2da('0x6'))('rpc');var config=require(_0xc2da('0x7'));var jayson=require(_0xc2da('0x8'));var client=jayson[_0xc2da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x794d4c,_0x2c04b7,_0x430061){return new BPromise(function(_0x5ddb53,_0x5765fe){return client['request'](_0x794d4c,_0x430061)[_0xc2da('0xa')](function(_0x4e8a99){logger[_0xc2da('0xb')](_0xc2da('0xc'),_0x2c04b7,_0xc2da('0xd'));logger[_0xc2da('0xe')](_0xc2da('0xf'),_0x2c04b7,_0xc2da('0xd'),JSON['stringify'](_0x4e8a99));if(_0x4e8a99[_0xc2da('0x10')]){if(_0x4e8a99[_0xc2da('0x10')][_0xc2da('0x11')]===0x1f4){logger[_0xc2da('0x10')](_0xc2da('0xc'),_0x2c04b7,_0x4e8a99[_0xc2da('0x10')][_0xc2da('0x12')]);return _0x5765fe(_0x4e8a99[_0xc2da('0x10')][_0xc2da('0x12')]);}logger[_0xc2da('0x10')](_0xc2da('0xc'),_0x2c04b7,_0x4e8a99[_0xc2da('0x10')]['message']);return _0x5ddb53(_0x4e8a99[_0xc2da('0x10')][_0xc2da('0x12')]);}else{logger[_0xc2da('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2c04b7,'request\x20sent');_0x5ddb53(_0x4e8a99[_0xc2da('0x13')][_0xc2da('0x12')]);}})[_0xc2da('0x14')](function(_0x165434){logger[_0xc2da('0x10')](_0xc2da('0xc'),_0x2c04b7,_0x165434);_0x5765fe(_0x165434);});});}
\ No newline at end of file
+var _0x7b21=['message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','AnalyticExtractedReport,\x20%s,\x20%s'];(function(_0x496af1,_0x2d5f59){var _0x5700b3=function(_0x4e346a){while(--_0x4e346a){_0x496af1['push'](_0x496af1['shift']());}};_0x5700b3(++_0x2d5f59);}(_0x7b21,0x159));var _0x17b2=function(_0x339852,_0x717220){_0x339852=_0x339852-0x0;var _0x734c8c=_0x7b21[_0x339852];return _0x734c8c;};'use strict';var _=require(_0x17b2('0x0'));var util=require(_0x17b2('0x1'));var moment=require('moment');var BPromise=require(_0x17b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17b2('0x3'))['db'];var utils=require(_0x17b2('0x4'));var logger=require(_0x17b2('0x5'))(_0x17b2('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x17b2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x252018,_0x225614,_0x24d9b5){return new BPromise(function(_0x2b80df,_0x38c9e9){return client[_0x17b2('0x8')](_0x252018,_0x24d9b5)[_0x17b2('0x9')](function(_0x38fd92){logger[_0x17b2('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x225614,'request\x20sent');logger['debug'](_0x17b2('0xb'),_0x225614,_0x17b2('0xc'),JSON['stringify'](_0x38fd92));if(_0x38fd92[_0x17b2('0xd')]){if(_0x38fd92[_0x17b2('0xd')][_0x17b2('0xe')]===0x1f4){logger['error'](_0x17b2('0xf'),_0x225614,_0x38fd92[_0x17b2('0xd')]['message']);return _0x38c9e9(_0x38fd92[_0x17b2('0xd')][_0x17b2('0x10')]);}logger[_0x17b2('0xd')](_0x17b2('0xf'),_0x225614,_0x38fd92[_0x17b2('0xd')][_0x17b2('0x10')]);return _0x2b80df(_0x38fd92['error'][_0x17b2('0x10')]);}else{logger[_0x17b2('0xa')](_0x17b2('0xf'),_0x225614,_0x17b2('0xc'));_0x2b80df(_0x38fd92[_0x17b2('0x11')][_0x17b2('0x10')]);}})[_0x17b2('0x12')](function(_0x953e8a){logger[_0x17b2('0xd')](_0x17b2('0xf'),_0x225614,_0x953e8a);_0x38c9e9(_0x953e8a);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 76cc56c..768450d 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 _0x688c=['/:id/download','download','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','show'];(function(_0x4fab3f,_0x5b0e8a){var _0x27364e=function(_0x4fa9f0){while(--_0x4fa9f0){_0x4fab3f['push'](_0x4fab3f['shift']());}};_0x27364e(++_0x5b0e8a);}(_0x688c,0x97));var _0xc688=function(_0x55fc12,_0x2ed9e4){_0x55fc12=_0x55fc12-0x0;var _0x272887=_0x688c[_0x55fc12];return _0x272887;};'use strict';var multer=require(_0xc688('0x0'));var util=require('util');var path=require(_0xc688('0x1'));var timeout=require(_0xc688('0x2'));var express=require(_0xc688('0x3'));var router=express[_0xc688('0x4')]();var fs_extra=require(_0xc688('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc688('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0xc688('0x7')]('/',auth[_0xc688('0x8')](),controller[_0xc688('0x9')]);router[_0xc688('0x7')]('/:id',auth[_0xc688('0x8')](),controller[_0xc688('0xa')]);router['get'](_0xc688('0xb'),auth['isAuthenticated'](),controller[_0xc688('0xc')]);router['post']('/',auth[_0xc688('0x8')](),controller['create']);router['put']('/:id',auth[_0xc688('0x8')](),controller[_0xc688('0xd')]);router[_0xc688('0xe')](_0xc688('0xf'),auth['isAuthenticated'](),controller[_0xc688('0x10')]);module[_0xc688('0x11')]=router;
\ No newline at end of file
+var _0xea0b=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','download','put','delete'];(function(_0x3ce7ff,_0xa8ff6){var _0x634f0d=function(_0x1e2a78){while(--_0x1e2a78){_0x3ce7ff['push'](_0x3ce7ff['shift']());}};_0x634f0d(++_0xa8ff6);}(_0xea0b,0x18e));var _0xbea0=function(_0xda8f94,_0xba9150){_0xda8f94=_0xda8f94-0x0;var _0x5ef241=_0xea0b[_0xda8f94];return _0x5ef241;};'use strict';var multer=require(_0xbea0('0x0'));var util=require('util');var path=require(_0xbea0('0x1'));var timeout=require(_0xbea0('0x2'));var express=require(_0xbea0('0x3'));var router=express[_0xbea0('0x4')]();var fs_extra=require(_0xbea0('0x5'));var auth=require(_0xbea0('0x6'));var interaction=require(_0xbea0('0x7'));var config=require(_0xbea0('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xbea0('0x9')]('/',auth[_0xbea0('0xa')](),controller[_0xbea0('0xb')]);router[_0xbea0('0x9')](_0xbea0('0xc'),auth[_0xbea0('0xa')](),controller['show']);router[_0xbea0('0x9')]('/:id/download',auth[_0xbea0('0xa')](),controller[_0xbea0('0xd')]);router['post']('/',auth[_0xbea0('0xa')](),controller['create']);router[_0xbea0('0xe')]('/:id',auth[_0xbea0('0xa')](),controller['update']);router[_0xbea0('0xf')](_0xbea0('0xc'),auth[_0xbea0('0xa')](),controller[_0xbea0('0x10')]);module[_0xbea0('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 791c484..3df8881 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 _0x057c=['exports','STRING','BOOLEAN'];(function(_0xcc4dda,_0x149272){var _0x22aec3=function(_0x32c947){while(--_0x32c947){_0xcc4dda['push'](_0xcc4dda['shift']());}};_0x22aec3(++_0x149272);}(_0x057c,0x1e9));var _0xc057=function(_0x141bd8,_0xde2cfa){_0x141bd8=_0x141bd8-0x0;var _0x343827=_0x057c[_0x141bd8];return _0x343827;};'use strict';var Sequelize=require('sequelize');module[_0xc057('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xc057('0x1')]},'function':{'type':Sequelize[_0xc057('0x1')]},'format':{'type':Sequelize[_0xc057('0x1')]},'groupBy':{'type':Sequelize[_0xc057('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc057('0x1')]},'custom':{'type':Sequelize[_0xc057('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7864=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x1fa4c8,_0x5d9c19){var _0x1cb245=function(_0x5acc86){while(--_0x5acc86){_0x1fa4c8['push'](_0x1fa4c8['shift']());}};_0x1cb245(++_0x5d9c19);}(_0x7864,0x9e));var _0x4786=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x7864[_0x5d80de];return _0x1c7556;};'use strict';var Sequelize=require(_0x4786('0x0'));module[_0x4786('0x1')]={'field':{'type':Sequelize[_0x4786('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x4786('0x3')]},'format':{'type':Sequelize[_0x4786('0x3')]},'groupBy':{'type':Sequelize[_0x4786('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x4786('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 637e2a7..b392c3c 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 _0x7913=['pick','merge','VIRTUAL','filter','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','bulkCreate','body','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0xc3583b,_0x3edf7a){var _0x19bc79=function(_0x2b68e1){while(--_0x2b68e1){_0xc3583b['push'](_0xc3583b['shift']());}};_0x19bc79(++_0x3edf7a);}(_0x7913,0xbb));var _0x3791=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7913[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3791('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3791('0x1'));var jsonpatch=require(_0x3791('0x2'));var rp=require(_0x3791('0x3'));var moment=require(_0x3791('0x4'));var BPromise=require(_0x3791('0x5'));var Mustache=require(_0x3791('0x6'));var util=require(_0x3791('0x7'));var path=require(_0x3791('0x8'));var sox=require('sox');var csv=require(_0x3791('0x9'));var ejs=require(_0x3791('0xa'));var fs=require('fs');var fs_extra=require(_0x3791('0xb'));var _=require('lodash');var squel=require(_0x3791('0xc'));var crypto=require('crypto');var jsforce=require(_0x3791('0xd'));var deskjs=require(_0x3791('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3791('0xf'));var Redis=require(_0x3791('0x10'));var authService=require(_0x3791('0x11'));var qs=require(_0x3791('0x12'));var as=require(_0x3791('0x13'));var hardwareService=require(_0x3791('0x14'));var logger=require('../../config/logger')(_0x3791('0x15'));var utils=require(_0x3791('0x16'));var config=require(_0x3791('0x17'));var licenseUtil=require(_0x3791('0x18'));var db=require(_0x3791('0x19'))['db'];function respondWithStatusCode(_0x3e3f98,_0x5c77f4){_0x5c77f4=_0x5c77f4||0xcc;return function(_0x245f09){if(_0x245f09){return _0x3e3f98[_0x3791('0x1a')](_0x5c77f4);}return _0x3e3f98[_0x3791('0x1b')](_0x5c77f4)[_0x3791('0x1c')]();};}function respondWithResult(_0x1e31a8,_0x53d540){_0x53d540=_0x53d540||0xc8;return function(_0x447974){if(_0x447974){return _0x1e31a8[_0x3791('0x1b')](_0x53d540)[_0x3791('0x1d')](_0x447974);}};}function respondWithFilteredResult(_0x5c2a1d,_0x22a87e){return function(_0x99049a){if(_0x99049a){var _0x4407f9=typeof _0x22a87e[_0x3791('0x1e')]===_0x3791('0x1f')&&typeof _0x22a87e[_0x3791('0x20')]===_0x3791('0x1f');var _0x50f445=_0x99049a['count'];var _0x578901=_0x4407f9?0x0:_0x22a87e[_0x3791('0x1e')];var _0x56cced=_0x4407f9?_0x99049a[_0x3791('0x21')]:_0x22a87e[_0x3791('0x1e')]+_0x22a87e[_0x3791('0x20')];var _0x5b75c9;if(_0x56cced>=_0x50f445){_0x56cced=_0x50f445;_0x5b75c9=0xc8;}else{_0x5b75c9=0xce;}_0x5c2a1d[_0x3791('0x1b')](_0x5b75c9);return _0x5c2a1d['set']('Content-Range',_0x578901+'-'+_0x56cced+'/'+_0x50f445)[_0x3791('0x1d')](_0x99049a);}return null;};}function patchUpdates(_0x28eb13){return function(_0x50f865){try{jsonpatch['apply'](_0x50f865,_0x28eb13,!![]);}catch(_0x264367){return BPromise[_0x3791('0x22')](_0x264367);}return _0x50f865['save']();};}function saveUpdates(_0x57dd3b,_0x5c7d02){return function(_0x5b14d7){if(_0x5b14d7){return _0x5b14d7[_0x3791('0x23')](_0x57dd3b)[_0x3791('0x24')](function(_0x2a4135){return _0x2a4135;});}return null;};}function removeEntity(_0x274975,_0x21943d){return function(_0x329511){if(_0x329511){return _0x329511['destroy']()['then'](function(){_0x274975[_0x3791('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x100b1f,_0xd84eb7){return function(_0x3d2433){if(!_0x3d2433){_0x100b1f['sendStatus'](0x194);}return _0x3d2433;};}function handleError(_0x1c75fb,_0x505e09){_0x505e09=_0x505e09||0x1f4;return function(_0x5171c8){logger[_0x3791('0x25')](_0x5171c8[_0x3791('0x26')]);if(_0x5171c8[_0x3791('0x27')]){delete _0x5171c8['name'];}_0x1c75fb[_0x3791('0x1b')](_0x505e09)[_0x3791('0x28')](_0x5171c8);};}exports['index']=function(_0x1057dd,_0x34048e){var _0x3efa83={},_0x58df47={},_0x4cf376={'count':0x0,'rows':[]};var _0x4bd437=_[_0x3791('0x29')](db['AnalyticFieldReport'][_0x3791('0x2a')],function(_0x3c2a60){return{'name':_0x3c2a60[_0x3791('0x2b')],'type':_0x3c2a60[_0x3791('0x2c')]['key']};});_0x58df47[_0x3791('0x2d')]=_[_0x3791('0x29')](_0x4bd437,_0x3791('0x27'));_0x58df47[_0x3791('0x2e')]=_['keys'](_0x1057dd[_0x3791('0x2e')]);_0x58df47[_0x3791('0x2f')]=_['intersection'](_0x58df47['model'],_0x58df47[_0x3791('0x2e')]);_0x3efa83[_0x3791('0x30')]=_[_0x3791('0x31')](_0x58df47[_0x3791('0x2d')],qs[_0x3791('0x32')](_0x1057dd[_0x3791('0x2e')][_0x3791('0x32')]));_0x3efa83[_0x3791('0x30')]=_0x3efa83[_0x3791('0x30')][_0x3791('0x33')]?_0x3efa83[_0x3791('0x30')]:_0x58df47[_0x3791('0x2d')];if(!_0x1057dd[_0x3791('0x2e')][_0x3791('0x34')](_0x3791('0x35'))){_0x3efa83[_0x3791('0x20')]=qs[_0x3791('0x20')](_0x1057dd[_0x3791('0x2e')][_0x3791('0x20')]);_0x3efa83[_0x3791('0x1e')]=qs[_0x3791('0x1e')](_0x1057dd[_0x3791('0x2e')][_0x3791('0x1e')]);}_0x3efa83['order']=qs[_0x3791('0x36')](_0x1057dd[_0x3791('0x2e')][_0x3791('0x36')]);_0x3efa83[_0x3791('0x37')]=qs[_0x3791('0x2f')](_[_0x3791('0x38')](_0x1057dd['query'],_0x58df47['filters']),_0x4bd437);if(_0x1057dd['query']['filter']){_0x3efa83['where']=_[_0x3791('0x39')](_0x3efa83['where'],{'$or':_[_0x3791('0x29')](_0x4bd437,function(_0x582d17){if(_0x582d17[_0x3791('0x2c')]!==_0x3791('0x3a')){var _0x14316a={};_0x14316a[_0x582d17[_0x3791('0x27')]]={'$like':'%'+_0x1057dd[_0x3791('0x2e')][_0x3791('0x3b')]+'%'};return _0x14316a;}})});}_0x3efa83=_['merge']({},_0x3efa83,_0x1057dd[_0x3791('0x3c')]);var _0x350273={'where':_0x3efa83['where']};return db[_0x3791('0x3d')][_0x3791('0x21')](_0x350273)[_0x3791('0x24')](function(_0x12c4bb){_0x4cf376[_0x3791('0x21')]=_0x12c4bb;if(_0x1057dd[_0x3791('0x2e')][_0x3791('0x3e')]){_0x3efa83[_0x3791('0x3f')]=[{'all':!![]}];}return db[_0x3791('0x3d')][_0x3791('0x40')](_0x3efa83);})[_0x3791('0x24')](function(_0x3fe678){_0x4cf376[_0x3791('0x41')]=_0x3fe678;return _0x4cf376;})[_0x3791('0x24')](respondWithFilteredResult(_0x34048e,_0x3efa83))[_0x3791('0x42')](handleError(_0x34048e,null));};exports[_0x3791('0x43')]=function(_0x39890,_0x4d8a36){var _0x50cc43={'raw':![],'where':{'id':_0x39890[_0x3791('0x44')]['id']}},_0x4cd184={};_0x4cd184['model']=_['keys'](db[_0x3791('0x3d')][_0x3791('0x2a')]);_0x4cd184[_0x3791('0x2e')]=_[_0x3791('0x45')](_0x39890[_0x3791('0x2e')]);_0x4cd184[_0x3791('0x2f')]=_['intersection'](_0x4cd184[_0x3791('0x2d')],_0x4cd184[_0x3791('0x2e')]);_0x50cc43[_0x3791('0x30')]=_[_0x3791('0x31')](_0x4cd184[_0x3791('0x2d')],qs['fields'](_0x39890['query'][_0x3791('0x32')]));_0x50cc43[_0x3791('0x30')]=_0x50cc43['attributes'][_0x3791('0x33')]?_0x50cc43[_0x3791('0x30')]:_0x4cd184[_0x3791('0x2d')];if(_0x39890[_0x3791('0x2e')][_0x3791('0x3e')]){_0x50cc43['include']=[{'all':!![]}];}_0x50cc43=_[_0x3791('0x39')]({},_0x50cc43,_0x39890[_0x3791('0x3c')]);return db[_0x3791('0x3d')][_0x3791('0x46')](_0x50cc43)[_0x3791('0x24')](handleEntityNotFound(_0x4d8a36,null))[_0x3791('0x24')](respondWithResult(_0x4d8a36,null))['catch'](handleError(_0x4d8a36,null));};exports[_0x3791('0x47')]=function(_0x44094b,_0x38cdfa){return db[_0x3791('0x3d')][_0x3791('0x47')](_0x44094b['body'],{})[_0x3791('0x24')](respondWithResult(_0x38cdfa,0xc9))[_0x3791('0x42')](handleError(_0x38cdfa,null));};exports[_0x3791('0x48')]=function(_0xc2b51e,_0x5942bd){return db[_0x3791('0x3d')][_0x3791('0x48')](_0xc2b51e[_0x3791('0x49')],{'raw':![],'individualHooks':!![]})[_0x3791('0x24')](respondWithResult(_0x5942bd,0xc9))['catch'](handleError(_0x5942bd,null));};exports['update']=function(_0x52efea,_0x62dd77){if(_0x52efea[_0x3791('0x49')]['id']){delete _0x52efea[_0x3791('0x49')]['id'];}return db[_0x3791('0x3d')][_0x3791('0x46')]({'where':{'id':_0x52efea[_0x3791('0x44')]['id']}})['then'](handleEntityNotFound(_0x62dd77,null))['then'](saveUpdates(_0x52efea[_0x3791('0x49')],null))[_0x3791('0x24')](respondWithResult(_0x62dd77,null))[_0x3791('0x42')](handleError(_0x62dd77,null));};exports[_0x3791('0x4a')]=function(_0x3bec54,_0x3603fb){return db[_0x3791('0x3d')][_0x3791('0x46')]({'where':{'id':_0x3bec54['params']['id']}})[_0x3791('0x24')](handleEntityNotFound(_0x3603fb,null))[_0x3791('0x24')](removeEntity(_0x3603fb,null))[_0x3791('0x42')](handleError(_0x3603fb,null));};exports[_0x3791('0x4b')]=function(_0x1ebb7e,_0x192afc){return db[_0x3791('0x3d')][_0x3791('0x4a')]({'where':{'id':_0x1ebb7e[_0x3791('0x2e')][_0x3791('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x3791('0x24')](respondWithResult(_0x192afc,0xcc))['catch'](handleError(_0x192afc,null));};exports[_0x3791('0x4d')]=function(_0x58d13c,_0x236fa9,_0xb46aa3){return db[_0x3791('0x4e')]['findOne']({'where':{'id':_0x58d13c['params']['id']}})['then'](handleEntityNotFound(_0x236fa9,null))['then'](function(_0x15d606){if(_0x15d606){return db[_0x3791('0x4f')][_0x3791('0x50')](function(_0x547c04){return db['AnalyticFieldReport'][_0x3791('0x4a')]({'where':{'CustomReportId':_0x58d13c['params']['id']},'transaction':_0x547c04})[_0x3791('0x24')](function(_0x1edf26){var _0x2947a1=_[_0x3791('0x29')](_0x58d13c[_0x3791('0x49')],function(_0x3ad58e){delete _0x3ad58e['id'];_0x3ad58e['CustomReportId']=_0x58d13c[_0x3791('0x44')]['id'];return _0x3ad58e;});return db[_0x3791('0x3d')][_0x3791('0x48')](_0x2947a1,{'transaction':_0x547c04});});})['then'](function(){return db[_0x3791('0x3d')]['findAll']({'where':{'CustomReportId':_0x58d13c[_0x3791('0x44')]['id']}});});}})[_0x3791('0x24')](respondWithResult(_0x236fa9,null))[_0x3791('0x42')](handleError(_0x236fa9,null));};
\ No newline at end of file
+var _0xc832=['transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','limit','undefined','count','status','set','apply','reject','save','then','destroy','end','error','name','send','index','map','AnalyticFieldReport','fieldName','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','bulkCreate','body','update','ids','addFields','findOne','sequelize'];(function(_0x31c178,_0x4a428c){var _0x2d5a9f=function(_0x367641){while(--_0x367641){_0x31c178['push'](_0x31c178['shift']());}};_0x2d5a9f(++_0x4a428c);}(_0xc832,0x1e8));var _0x2c83=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xc832[_0x1d9aa0];return _0x226868;};'use strict';var emlformat=require(_0x2c83('0x0'));var rimraf=require(_0x2c83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c83('0x2'));var rp=require(_0x2c83('0x3'));var moment=require(_0x2c83('0x4'));var BPromise=require(_0x2c83('0x5'));var Mustache=require(_0x2c83('0x6'));var util=require(_0x2c83('0x7'));var path=require('path');var sox=require(_0x2c83('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c83('0x9'));var squel=require(_0x2c83('0xa'));var crypto=require(_0x2c83('0xb'));var jsforce=require(_0x2c83('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2c83('0xd'));var Papa=require(_0x2c83('0xe'));var Redis=require(_0x2c83('0xf'));var authService=require(_0x2c83('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c83('0x11'));var logger=require('../../config/logger')(_0x2c83('0x12'));var utils=require(_0x2c83('0x13'));var config=require(_0x2c83('0x14'));var licenseUtil=require(_0x2c83('0x15'));var db=require(_0x2c83('0x16'))['db'];function respondWithStatusCode(_0x4000fd,_0x18a7e9){_0x18a7e9=_0x18a7e9||0xcc;return function(_0x70565a){if(_0x70565a){return _0x4000fd[_0x2c83('0x17')](_0x18a7e9);}return _0x4000fd['status'](_0x18a7e9)['end']();};}function respondWithResult(_0x48cc96,_0x40ac5c){_0x40ac5c=_0x40ac5c||0xc8;return function(_0x360ac1){if(_0x360ac1){return _0x48cc96['status'](_0x40ac5c)['json'](_0x360ac1);}};}function respondWithFilteredResult(_0x1569f0,_0x355838){return function(_0xe35370){if(_0xe35370){var _0x42135d=typeof _0x355838[_0x2c83('0x18')]==='undefined'&&typeof _0x355838[_0x2c83('0x19')]===_0x2c83('0x1a');var _0x5ef8dc=_0xe35370[_0x2c83('0x1b')];var _0x1a6883=_0x42135d?0x0:_0x355838['offset'];var _0x51fe17=_0x42135d?_0xe35370[_0x2c83('0x1b')]:_0x355838[_0x2c83('0x18')]+_0x355838[_0x2c83('0x19')];var _0x21fa0c;if(_0x51fe17>=_0x5ef8dc){_0x51fe17=_0x5ef8dc;_0x21fa0c=0xc8;}else{_0x21fa0c=0xce;}_0x1569f0[_0x2c83('0x1c')](_0x21fa0c);return _0x1569f0[_0x2c83('0x1d')]('Content-Range',_0x1a6883+'-'+_0x51fe17+'/'+_0x5ef8dc)['json'](_0xe35370);}return null;};}function patchUpdates(_0x515ce3){return function(_0x464bd8){try{jsonpatch[_0x2c83('0x1e')](_0x464bd8,_0x515ce3,!![]);}catch(_0x1252f8){return BPromise[_0x2c83('0x1f')](_0x1252f8);}return _0x464bd8[_0x2c83('0x20')]();};}function saveUpdates(_0x31190e,_0x3b13ed){return function(_0x54b5b7){if(_0x54b5b7){return _0x54b5b7['update'](_0x31190e)[_0x2c83('0x21')](function(_0x37e2b1){return _0x37e2b1;});}return null;};}function removeEntity(_0x1fd0cf,_0x410f27){return function(_0x2d8e39){if(_0x2d8e39){return _0x2d8e39[_0x2c83('0x22')]()['then'](function(){_0x1fd0cf[_0x2c83('0x1c')](0xcc)[_0x2c83('0x23')]();});}};}function handleEntityNotFound(_0x4918a1,_0x13a92d){return function(_0x48a11e){if(!_0x48a11e){_0x4918a1['sendStatus'](0x194);}return _0x48a11e;};}function handleError(_0x1a1770,_0x52edad){_0x52edad=_0x52edad||0x1f4;return function(_0x2e92c3){logger[_0x2c83('0x24')](_0x2e92c3['stack']);if(_0x2e92c3[_0x2c83('0x25')]){delete _0x2e92c3[_0x2c83('0x25')];}_0x1a1770[_0x2c83('0x1c')](_0x52edad)[_0x2c83('0x26')](_0x2e92c3);};}exports[_0x2c83('0x27')]=function(_0x21daf9,_0x3a6ce1){var _0x3c441c={},_0x25d800={},_0x40fdbb={'count':0x0,'rows':[]};var _0x2bfdbc=_[_0x2c83('0x28')](db[_0x2c83('0x29')]['rawAttributes'],function(_0x452af0){return{'name':_0x452af0[_0x2c83('0x2a')],'type':_0x452af0[_0x2c83('0x2b')]['key']};});_0x25d800['model']=_['map'](_0x2bfdbc,_0x2c83('0x25'));_0x25d800['query']=_['keys'](_0x21daf9[_0x2c83('0x2c')]);_0x25d800[_0x2c83('0x2d')]=_[_0x2c83('0x2e')](_0x25d800['model'],_0x25d800['query']);_0x3c441c[_0x2c83('0x2f')]=_[_0x2c83('0x2e')](_0x25d800[_0x2c83('0x30')],qs[_0x2c83('0x31')](_0x21daf9[_0x2c83('0x2c')][_0x2c83('0x31')]));_0x3c441c['attributes']=_0x3c441c[_0x2c83('0x2f')]['length']?_0x3c441c['attributes']:_0x25d800[_0x2c83('0x30')];if(!_0x21daf9[_0x2c83('0x2c')][_0x2c83('0x32')](_0x2c83('0x33'))){_0x3c441c['limit']=qs[_0x2c83('0x19')](_0x21daf9[_0x2c83('0x2c')][_0x2c83('0x19')]);_0x3c441c['offset']=qs[_0x2c83('0x18')](_0x21daf9[_0x2c83('0x2c')][_0x2c83('0x18')]);}_0x3c441c[_0x2c83('0x34')]=qs[_0x2c83('0x35')](_0x21daf9[_0x2c83('0x2c')][_0x2c83('0x35')]);_0x3c441c[_0x2c83('0x36')]=qs[_0x2c83('0x2d')](_[_0x2c83('0x37')](_0x21daf9[_0x2c83('0x2c')],_0x25d800[_0x2c83('0x2d')]),_0x2bfdbc);if(_0x21daf9[_0x2c83('0x2c')][_0x2c83('0x38')]){_0x3c441c['where']=_[_0x2c83('0x39')](_0x3c441c['where'],{'$or':_[_0x2c83('0x28')](_0x2bfdbc,function(_0xc9c0ef){if(_0xc9c0ef[_0x2c83('0x2b')]!==_0x2c83('0x3a')){var _0x1685c0={};_0x1685c0[_0xc9c0ef['name']]={'$like':'%'+_0x21daf9['query'][_0x2c83('0x38')]+'%'};return _0x1685c0;}})});}_0x3c441c=_[_0x2c83('0x39')]({},_0x3c441c,_0x21daf9[_0x2c83('0x3b')]);var _0x482be3={'where':_0x3c441c['where']};return db[_0x2c83('0x29')][_0x2c83('0x1b')](_0x482be3)[_0x2c83('0x21')](function(_0x2d36fd){_0x40fdbb[_0x2c83('0x1b')]=_0x2d36fd;if(_0x21daf9[_0x2c83('0x2c')][_0x2c83('0x3c')]){_0x3c441c[_0x2c83('0x3d')]=[{'all':!![]}];}return db[_0x2c83('0x29')][_0x2c83('0x3e')](_0x3c441c);})[_0x2c83('0x21')](function(_0x52b7bc){_0x40fdbb[_0x2c83('0x3f')]=_0x52b7bc;return _0x40fdbb;})['then'](respondWithFilteredResult(_0x3a6ce1,_0x3c441c))[_0x2c83('0x40')](handleError(_0x3a6ce1,null));};exports[_0x2c83('0x41')]=function(_0x151520,_0x5ede27){var _0x324fd2={'raw':![],'where':{'id':_0x151520[_0x2c83('0x42')]['id']}},_0x27ea5e={};_0x27ea5e[_0x2c83('0x30')]=_[_0x2c83('0x43')](db[_0x2c83('0x29')][_0x2c83('0x44')]);_0x27ea5e[_0x2c83('0x2c')]=_['keys'](_0x151520[_0x2c83('0x2c')]);_0x27ea5e[_0x2c83('0x2d')]=_[_0x2c83('0x2e')](_0x27ea5e[_0x2c83('0x30')],_0x27ea5e['query']);_0x324fd2[_0x2c83('0x2f')]=_[_0x2c83('0x2e')](_0x27ea5e[_0x2c83('0x30')],qs[_0x2c83('0x31')](_0x151520['query']['fields']));_0x324fd2[_0x2c83('0x2f')]=_0x324fd2[_0x2c83('0x2f')][_0x2c83('0x45')]?_0x324fd2['attributes']:_0x27ea5e[_0x2c83('0x30')];if(_0x151520[_0x2c83('0x2c')][_0x2c83('0x3c')]){_0x324fd2[_0x2c83('0x3d')]=[{'all':!![]}];}_0x324fd2=_[_0x2c83('0x39')]({},_0x324fd2,_0x151520['options']);return db['AnalyticFieldReport'][_0x2c83('0x46')](_0x324fd2)[_0x2c83('0x21')](handleEntityNotFound(_0x5ede27,null))[_0x2c83('0x21')](respondWithResult(_0x5ede27,null))['catch'](handleError(_0x5ede27,null));};exports['create']=function(_0x466970,_0x87177c){return db[_0x2c83('0x29')][_0x2c83('0x47')](_0x466970['body'],{})['then'](respondWithResult(_0x87177c,0xc9))['catch'](handleError(_0x87177c,null));};exports[_0x2c83('0x48')]=function(_0xab3388,_0x49ccf4){return db['AnalyticFieldReport'][_0x2c83('0x48')](_0xab3388[_0x2c83('0x49')],{'raw':![],'individualHooks':!![]})[_0x2c83('0x21')](respondWithResult(_0x49ccf4,0xc9))[_0x2c83('0x40')](handleError(_0x49ccf4,null));};exports[_0x2c83('0x4a')]=function(_0x22fae2,_0x2314dc){if(_0x22fae2['body']['id']){delete _0x22fae2['body']['id'];}return db['AnalyticFieldReport'][_0x2c83('0x46')]({'where':{'id':_0x22fae2[_0x2c83('0x42')]['id']}})['then'](handleEntityNotFound(_0x2314dc,null))[_0x2c83('0x21')](saveUpdates(_0x22fae2[_0x2c83('0x49')],null))[_0x2c83('0x21')](respondWithResult(_0x2314dc,null))[_0x2c83('0x40')](handleError(_0x2314dc,null));};exports[_0x2c83('0x22')]=function(_0x4f290a,_0x488883){return db[_0x2c83('0x29')][_0x2c83('0x46')]({'where':{'id':_0x4f290a[_0x2c83('0x42')]['id']}})['then'](handleEntityNotFound(_0x488883,null))[_0x2c83('0x21')](removeEntity(_0x488883,null))[_0x2c83('0x40')](handleError(_0x488883,null));};exports['bulkDestroy']=function(_0x153320,_0x21bc93){return db['AnalyticFieldReport'][_0x2c83('0x22')]({'where':{'id':_0x153320['query'][_0x2c83('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x2c83('0x21')](respondWithResult(_0x21bc93,0xcc))[_0x2c83('0x40')](handleError(_0x21bc93,null));};exports[_0x2c83('0x4c')]=function(_0xa7d0cc,_0x96bf12,_0x3cd559){return db['AnalyticCustomReport'][_0x2c83('0x4d')]({'where':{'id':_0xa7d0cc['params']['id']}})[_0x2c83('0x21')](handleEntityNotFound(_0x96bf12,null))[_0x2c83('0x21')](function(_0x4b75d8){if(_0x4b75d8){return db[_0x2c83('0x4e')][_0x2c83('0x4f')](function(_0x50f3b2){return db[_0x2c83('0x29')][_0x2c83('0x22')]({'where':{'CustomReportId':_0xa7d0cc['params']['id']},'transaction':_0x50f3b2})[_0x2c83('0x21')](function(_0x34fa01){var _0x479037=_[_0x2c83('0x28')](_0xa7d0cc[_0x2c83('0x49')],function(_0x21ba86){delete _0x21ba86['id'];_0x21ba86[_0x2c83('0x50')]=_0xa7d0cc['params']['id'];return _0x21ba86;});return db['AnalyticFieldReport'][_0x2c83('0x48')](_0x479037,{'transaction':_0x50f3b2});});})[_0x2c83('0x21')](function(){return db[_0x2c83('0x29')][_0x2c83('0x3e')]({'where':{'CustomReportId':_0xa7d0cc[_0x2c83('0x42')]['id']}});});}})['then'](respondWithResult(_0x96bf12,null))[_0x2c83('0x40')](handleError(_0x96bf12,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 1c8c389..6df9a70 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 _0x92db=['./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x14761d,_0x204fcc){var _0x8f69ee=function(_0x1fd266){while(--_0x1fd266){_0x14761d['push'](_0x14761d['shift']());}};_0x8f69ee(++_0x204fcc);}(_0x92db,0xa9));var _0xb92d=function(_0x492bb6,_0x3e67b2){_0x492bb6=_0x492bb6-0x0;var _0x18ea7e=_0x92db[_0x492bb6];return _0x18ea7e;};'use strict';var _=require(_0xb92d('0x0'));var util=require('util');var logger=require(_0xb92d('0x1'))('api');var moment=require(_0xb92d('0x2'));var BPromise=require(_0xb92d('0x3'));var rp=require(_0xb92d('0x4'));var fs=require('fs');var path=require(_0xb92d('0x5'));var rimraf=require(_0xb92d('0x6'));var config=require('../../config/environment');var attributes=require(_0xb92d('0x7'));module['exports']=function(_0x171822,_0x1b4bf4){return _0x171822[_0xb92d('0x8')](_0xb92d('0x9'),attributes,{'tableName':_0xb92d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x36f4=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment'];(function(_0x5dce5a,_0x553e15){var _0x17fd57=function(_0x39055e){while(--_0x39055e){_0x5dce5a['push'](_0x5dce5a['shift']());}};_0x17fd57(++_0x553e15);}(_0x36f4,0x163));var _0x436f=function(_0x14cbd8,_0x4c86ed){_0x14cbd8=_0x14cbd8-0x0;var _0x305443=_0x36f4[_0x14cbd8];return _0x305443;};'use strict';var _=require(_0x436f('0x0'));var util=require(_0x436f('0x1'));var logger=require(_0x436f('0x2'))(_0x436f('0x3'));var moment=require(_0x436f('0x4'));var BPromise=require(_0x436f('0x5'));var rp=require(_0x436f('0x6'));var fs=require('fs');var path=require(_0x436f('0x7'));var rimraf=require(_0x436f('0x8'));var config=require(_0x436f('0x9'));var attributes=require(_0x436f('0xa'));module[_0x436f('0xb')]=function(_0x1c0dda,_0xa70d8a){return _0x1c0dda[_0x436f('0xc')](_0x436f('0xd'),attributes,{'tableName':_0x436f('0xe'),'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 63ca9be..267483a 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 _0x41a5=['code','AnalyticFieldReport,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4ab19d,_0x8be494){var _0x1c2201=function(_0x1dace2){while(--_0x1dace2){_0x4ab19d['push'](_0x4ab19d['shift']());}};_0x1c2201(++_0x8be494);}(_0x41a5,0x146));var _0x541a=function(_0x2185f9,_0x14aeb8){_0x2185f9=_0x2185f9-0x0;var _0x64f64d=_0x41a5[_0x2185f9];return _0x64f64d;};'use strict';var _=require('lodash');var util=require(_0x541a('0x0'));var moment=require(_0x541a('0x1'));var BPromise=require(_0x541a('0x2'));var rs=require(_0x541a('0x3'));var fs=require('fs');var Redis=require(_0x541a('0x4'));var db=require(_0x541a('0x5'))['db'];var utils=require(_0x541a('0x6'));var logger=require(_0x541a('0x7'))(_0x541a('0x8'));var config=require('../../config/environment');var jayson=require(_0x541a('0x9'));var client=jayson[_0x541a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1af9fd,_0x4ba24f,_0x1141a3){return new BPromise(function(_0x41a3a1,_0x412be6){return client[_0x541a('0xb')](_0x1af9fd,_0x1141a3)[_0x541a('0xc')](function(_0x51274d){logger[_0x541a('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ba24f,_0x541a('0xe'));logger[_0x541a('0xf')](_0x541a('0x10'),_0x4ba24f,_0x541a('0xe'),JSON[_0x541a('0x11')](_0x51274d));if(_0x51274d[_0x541a('0x12')]){if(_0x51274d['error'][_0x541a('0x13')]===0x1f4){logger[_0x541a('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ba24f,_0x51274d[_0x541a('0x12')]['message']);return _0x412be6(_0x51274d[_0x541a('0x12')]['message']);}logger['error'](_0x541a('0x14'),_0x4ba24f,_0x51274d['error'][_0x541a('0x15')]);return _0x41a3a1(_0x51274d[_0x541a('0x12')][_0x541a('0x15')]);}else{logger[_0x541a('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4ba24f,_0x541a('0xe'));_0x41a3a1(_0x51274d['result'][_0x541a('0x15')]);}})[_0x541a('0x16')](function(_0x37d070){logger['error'](_0x541a('0x14'),_0x4ba24f,_0x37d070);_0x412be6(_0x37d070);});});}
\ No newline at end of file
+var _0x2316=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','lodash','util','moment','ioredis'];(function(_0x574308,_0x447878){var _0x233bb4=function(_0x347814){while(--_0x347814){_0x574308['push'](_0x574308['shift']());}};_0x233bb4(++_0x447878);}(_0x2316,0xc4));var _0x6231=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0x2316[_0x12bcf7];return _0x2825a;};'use strict';var _=require(_0x6231('0x0'));var util=require(_0x6231('0x1'));var moment=require(_0x6231('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6231('0x3'));var db=require(_0x6231('0x4'))['db'];var utils=require(_0x6231('0x5'));var logger=require(_0x6231('0x6'))('rpc');var config=require(_0x6231('0x7'));var jayson=require(_0x6231('0x8'));var client=jayson[_0x6231('0x9')][_0x6231('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf63932,_0x89e20f,_0x16dec1){return new BPromise(function(_0x9abe76,_0x5a7117){return client[_0x6231('0xb')](_0xf63932,_0x16dec1)[_0x6231('0xc')](function(_0x3f2994){logger['info'](_0x6231('0xd'),_0x89e20f,'request\x20sent');logger[_0x6231('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x89e20f,_0x6231('0xf'),JSON['stringify'](_0x3f2994));if(_0x3f2994[_0x6231('0x10')]){if(_0x3f2994[_0x6231('0x10')][_0x6231('0x11')]===0x1f4){logger[_0x6231('0x10')](_0x6231('0xd'),_0x89e20f,_0x3f2994[_0x6231('0x10')][_0x6231('0x12')]);return _0x5a7117(_0x3f2994[_0x6231('0x10')][_0x6231('0x12')]);}logger[_0x6231('0x10')](_0x6231('0xd'),_0x89e20f,_0x3f2994[_0x6231('0x10')][_0x6231('0x12')]);return _0x9abe76(_0x3f2994[_0x6231('0x10')]['message']);}else{logger[_0x6231('0x13')](_0x6231('0xd'),_0x89e20f,_0x6231('0xf'));_0x9abe76(_0x3f2994['result']['message']);}})['catch'](function(_0x196ac7){logger[_0x6231('0x10')](_0x6231('0xd'),_0x89e20f,_0x196ac7);_0x5a7117(_0x196ac7);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 0230ec8..a12ca20 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(_0x591dd7,_0xfc74e4){var _0xc384bd=function(_0x3fb04c){while(--_0x3fb04c){_0x591dd7['push'](_0x591dd7['shift']());}};_0xc384bd(++_0xfc74e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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(_0x51c87e,_0x5dc3ea){var _0x38da34=function(_0x5cb9e5){while(--_0x5cb9e5){_0x51c87e['push'](_0x51c87e['shift']());}};_0x38da34(++_0x5dc3ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 255db96..43d3b00 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 _0xbb95=['exports','STRING','TEXT','sequelize'];(function(_0x5733f7,_0x1080f3){var _0x16de42=function(_0x519a3f){while(--_0x519a3f){_0x5733f7['push'](_0x5733f7['shift']());}};_0x16de42(++_0x1080f3);}(_0xbb95,0x7f));var _0x5bb9=function(_0x5ce7e2,_0x8dd5de){_0x5ce7e2=_0x5ce7e2-0x0;var _0x5224d1=_0xbb95[_0x5ce7e2];return _0x5224d1;};'use strict';var Sequelize=require(_0x5bb9('0x0'));module[_0x5bb9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x5bb9('0x2')]},'metric':{'type':Sequelize[_0x5bb9('0x3')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x41bb=['TEXT','STRING','sequelize','exports','name'];(function(_0x48a91d,_0x54cdaa){var _0x288403=function(_0x72e98b){while(--_0x72e98b){_0x48a91d['push'](_0x48a91d['shift']());}};_0x288403(++_0x54cdaa);}(_0x41bb,0xc5));var _0xb41b=function(_0xe37b5,_0x5ef854){_0xe37b5=_0xe37b5-0x0;var _0x2b09ab=_0x41bb[_0xe37b5];return _0x2b09ab;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb41b('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xb41b('0x3')]},'description':{'type':Sequelize[_0xb41b('0x4')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 91734eb..fbe48e0 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 _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(_0x49748c,_0x3d2005){var _0xedf6b6=function(_0x11628d){while(--_0x11628d){_0x49748c['push'](_0x49748c['shift']());}};_0xedf6b6(++_0x3d2005);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x104056,_0x330044){_0x104056=_0x104056-0x0;var _0x2c7cd0=_0x8d0e[_0x104056];return _0x2c7cd0;};'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
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5552d7,_0x37c9da){var _0x5b49d6=function(_0x1a2c78){while(--_0x1a2c78){_0x5552d7['push'](_0x5552d7['shift']());}};_0x5b49d6(++_0x37c9da);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x7fbe[_0x650e11];return _0x1a9b47;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index bc56bb2..2c68043 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 _0x7d10=['AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','path','rimraf','./analyticMetric.attributes','exports'];(function(_0x27dfcc,_0x561bb1){var _0x2031c4=function(_0x4e7290){while(--_0x4e7290){_0x27dfcc['push'](_0x27dfcc['shift']());}};_0x2031c4(++_0x561bb1);}(_0x7d10,0x1ce));var _0x07d1=function(_0x35b49d,_0x4bbcb1){_0x35b49d=_0x35b49d-0x0;var _0xf1de19=_0x7d10[_0x35b49d];return _0xf1de19;};'use strict';var _=require('lodash');var util=require(_0x07d1('0x0'));var logger=require(_0x07d1('0x1'))('api');var moment=require(_0x07d1('0x2'));var BPromise=require(_0x07d1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x07d1('0x4'));var rimraf=require(_0x07d1('0x5'));var config=require('../../config/environment');var attributes=require(_0x07d1('0x6'));module[_0x07d1('0x7')]=function(_0x1c8f3d,_0x36198a){return _0x1c8f3d['define'](_0x07d1('0x8'),attributes,{'tableName':_0x07d1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc9c3=['path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','../../config/logger','moment','bluebird','request-promise'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0xc9c3,0x96));var _0x3c9c=function(_0x191d71,_0x32ce70){_0x191d71=_0x191d71-0x0;var _0x3b6195=_0xc9c3[_0x191d71];return _0x3b6195;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3c9c('0x0'))('api');var moment=require(_0x3c9c('0x1'));var BPromise=require(_0x3c9c('0x2'));var rp=require(_0x3c9c('0x3'));var fs=require('fs');var path=require(_0x3c9c('0x4'));var rimraf=require(_0x3c9c('0x5'));var config=require(_0x3c9c('0x6'));var attributes=require(_0x3c9c('0x7'));module['exports']=function(_0x48b219,_0x5c86bd){return _0x48b219[_0x3c9c('0x8')](_0x3c9c('0x9'),attributes,{'tableName':_0x3c9c('0xa'),'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 45c91d5..6df5731 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 _0x4892=['../../config/environment','jayson/promise','client','http','request','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x4aa6cb,_0x4b3912){var _0x300640=function(_0x29c0b7){while(--_0x29c0b7){_0x4aa6cb['push'](_0x4aa6cb['shift']());}};_0x300640(++_0x4b3912);}(_0x4892,0x10b));var _0x2489=function(_0xe76499,_0x300943){_0xe76499=_0xe76499-0x0;var _0x4617fb=_0x4892[_0xe76499];return _0x4617fb;};'use strict';var _=require(_0x2489('0x0'));var util=require(_0x2489('0x1'));var moment=require(_0x2489('0x2'));var BPromise=require(_0x2489('0x3'));var rs=require(_0x2489('0x4'));var fs=require('fs');var Redis=require(_0x2489('0x5'));var db=require(_0x2489('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2489('0x7'))(_0x2489('0x8'));var config=require(_0x2489('0x9'));var jayson=require(_0x2489('0xa'));var client=jayson[_0x2489('0xb')][_0x2489('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa454a9,_0x504483,_0xb7ac89){return new BPromise(function(_0x3bc7b9,_0x34ff86){return client[_0x2489('0xd')](_0xa454a9,_0xb7ac89)['then'](function(_0x3dee5b){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x504483,_0x2489('0xe'));logger['debug'](_0x2489('0xf'),_0x504483,_0x2489('0xe'),JSON[_0x2489('0x10')](_0x3dee5b));if(_0x3dee5b[_0x2489('0x11')]){if(_0x3dee5b[_0x2489('0x11')][_0x2489('0x12')]===0x1f4){logger[_0x2489('0x11')](_0x2489('0x13'),_0x504483,_0x3dee5b[_0x2489('0x11')]['message']);return _0x34ff86(_0x3dee5b[_0x2489('0x11')][_0x2489('0x14')]);}logger[_0x2489('0x11')](_0x2489('0x13'),_0x504483,_0x3dee5b[_0x2489('0x11')][_0x2489('0x14')]);return _0x3bc7b9(_0x3dee5b[_0x2489('0x11')][_0x2489('0x14')]);}else{logger[_0x2489('0x15')](_0x2489('0x13'),_0x504483,'request\x20sent');_0x3bc7b9(_0x3dee5b['result'][_0x2489('0x14')]);}})[_0x2489('0x16')](function(_0x3aa496){logger[_0x2489('0x11')](_0x2489('0x13'),_0x504483,_0x3aa496);_0x34ff86(_0x3aa496);});});}
\ No newline at end of file
+var _0x2bc9=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4d275c,_0x522396){var _0x55b75f=function(_0x47e6d3){while(--_0x47e6d3){_0x4d275c['push'](_0x4d275c['shift']());}};_0x55b75f(++_0x522396);}(_0x2bc9,0x151));var _0x92bc=function(_0x6a47c,_0x2cbd54){_0x6a47c=_0x6a47c-0x0;var _0x1b8c47=_0x2bc9[_0x6a47c];return _0x1b8c47;};'use strict';var _=require(_0x92bc('0x0'));var util=require(_0x92bc('0x1'));var moment=require(_0x92bc('0x2'));var BPromise=require(_0x92bc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x92bc('0x5'));var logger=require(_0x92bc('0x6'))(_0x92bc('0x7'));var config=require(_0x92bc('0x8'));var jayson=require(_0x92bc('0x9'));var client=jayson[_0x92bc('0xa')][_0x92bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11dbd1,_0x55ac11,_0xca1ba8){return new BPromise(function(_0x22abc5,_0x579b83){return client[_0x92bc('0xc')](_0x11dbd1,_0xca1ba8)[_0x92bc('0xd')](function(_0x446166){logger[_0x92bc('0xe')](_0x92bc('0xf'),_0x55ac11,_0x92bc('0x10'));logger['debug'](_0x92bc('0x11'),_0x55ac11,_0x92bc('0x10'),JSON[_0x92bc('0x12')](_0x446166));if(_0x446166['error']){if(_0x446166['error'][_0x92bc('0x13')]===0x1f4){logger[_0x92bc('0x14')](_0x92bc('0xf'),_0x55ac11,_0x446166[_0x92bc('0x14')][_0x92bc('0x15')]);return _0x579b83(_0x446166[_0x92bc('0x14')][_0x92bc('0x15')]);}logger[_0x92bc('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x55ac11,_0x446166[_0x92bc('0x14')][_0x92bc('0x15')]);return _0x22abc5(_0x446166['error'][_0x92bc('0x15')]);}else{logger[_0x92bc('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x55ac11,_0x92bc('0x10'));_0x22abc5(_0x446166[_0x92bc('0x16')][_0x92bc('0x15')]);}})['catch'](function(_0x258a8c){logger[_0x92bc('0x14')](_0x92bc('0xf'),_0x55ac11,_0x258a8c);_0x579b83(_0x258a8c);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 1f33a3b..aefaad9 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 _0x05bc=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xc05b('0x0'));var path=require('path');var timeout=require(_0xc05b('0x1'));var express=require(_0xc05b('0x2'));var router=express['Router']();var fs_extra=require(_0xc05b('0x3'));var auth=require(_0xc05b('0x4'));var interaction=require(_0xc05b('0x5'));var config=require(_0xc05b('0x6'));var controller=require(_0xc05b('0x7'));router[_0xc05b('0x8')]('/',auth[_0xc05b('0x9')](),controller[_0xc05b('0xa')]);router[_0xc05b('0x8')](_0xc05b('0xb'),auth[_0xc05b('0x9')](),controller[_0xc05b('0xc')]);router[_0xc05b('0xd')]('/',auth[_0xc05b('0x9')](),controller['create']);router['put'](_0xc05b('0xb'),auth[_0xc05b('0x9')](),controller[_0xc05b('0xe')]);router[_0xc05b('0xf')](_0xc05b('0xb'),auth[_0xc05b('0x9')](),controller[_0xc05b('0x10')]);module[_0xc05b('0x11')]=router;
\ No newline at end of file
+var _0x078c=['index','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x078c,0x19f));var _0xc078=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x078c[_0x3a3758];return _0x1a9234;};'use strict';var multer=require(_0xc078('0x0'));var util=require('util');var path=require(_0xc078('0x1'));var timeout=require(_0xc078('0x2'));var express=require('express');var router=express[_0xc078('0x3')]();var fs_extra=require(_0xc078('0x4'));var auth=require(_0xc078('0x5'));var interaction=require(_0xc078('0x6'));var config=require('../../config/environment');var controller=require(_0xc078('0x7'));router[_0xc078('0x8')]('/',auth[_0xc078('0x9')](),controller[_0xc078('0xa')]);router[_0xc078('0x8')](_0xc078('0xb'),auth[_0xc078('0x9')](),controller[_0xc078('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xc078('0xd')](_0xc078('0xb'),auth['isAuthenticated'](),controller[_0xc078('0xe')]);router[_0xc078('0xf')](_0xc078('0xb'),auth[_0xc078('0x9')](),controller[_0xc078('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 9ac34e5..feab01b 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 _0x7f5e=['sequelize','exports','TEXT'];(function(_0x2755b2,_0x4cca8c){var _0x260f28=function(_0x1faf58){while(--_0x1faf58){_0x2755b2['push'](_0x2755b2['shift']());}};_0x260f28(++_0x4cca8c);}(_0x7f5e,0x10b));var _0xe7f5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f5e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe7f5('0x0'));module[_0xe7f5('0x1')]={'tree':{'type':Sequelize[_0xe7f5('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x8b80=['TEXT','sequelize','exports'];(function(_0x3dacec,_0x2c775a){var _0x20335e=function(_0x4e3e61){while(--_0x4e3e61){_0x3dacec['push'](_0x3dacec['shift']());}};_0x20335e(++_0x2c775a);}(_0x8b80,0xbb));var _0x08b8=function(_0x3ad7ad,_0x291a8d){_0x3ad7ad=_0x3ad7ad-0x0;var _0x225a60=_0x8b80[_0x3ad7ad];return _0x225a60;};'use strict';var Sequelize=require(_0x08b8('0x0'));module[_0x08b8('0x1')]={'tree':{'type':Sequelize[_0x08b8('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 0ed57cb..440b4e6 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 _0x3a3e=['fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','type','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','status','error','stack','name','send','index','map','rawAttributes'];(function(_0x433446,_0x4e8885){var _0xe3aad3=function(_0x555a18){while(--_0x555a18){_0x433446['push'](_0x433446['shift']());}};_0xe3aad3(++_0x4e8885);}(_0x3a3e,0x180));var _0xe3a3=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x3a3e[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require(_0xe3a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe3a3('0x1'));var jsonpatch=require(_0xe3a3('0x2'));var rp=require(_0xe3a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe3a3('0x4'));var util=require(_0xe3a3('0x5'));var path=require(_0xe3a3('0x6'));var sox=require('sox');var csv=require(_0xe3a3('0x7'));var ejs=require(_0xe3a3('0x8'));var fs=require('fs');var fs_extra=require(_0xe3a3('0x9'));var _=require('lodash');var squel=require(_0xe3a3('0xa'));var crypto=require(_0xe3a3('0xb'));var jsforce=require(_0xe3a3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe3a3('0x7'));var querystring=require('querystring');var Papa=require(_0xe3a3('0xd'));var Redis=require(_0xe3a3('0xe'));var authService=require(_0xe3a3('0xf'));var qs=require(_0xe3a3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3a3('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe3a3('0x12'));var licenseUtil=require(_0xe3a3('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36090a,_0x2e99e6){_0x2e99e6=_0x2e99e6||0xcc;return function(_0x5eb7c){if(_0x5eb7c){return _0x36090a[_0xe3a3('0x14')](_0x2e99e6);}return _0x36090a['status'](_0x2e99e6)[_0xe3a3('0x15')]();};}function respondWithResult(_0x5cb312,_0x1eb142){_0x1eb142=_0x1eb142||0xc8;return function(_0x12bdae){if(_0x12bdae){return _0x5cb312['status'](_0x1eb142)[_0xe3a3('0x16')](_0x12bdae);}};}function respondWithFilteredResult(_0x190d0a,_0x6b39ec){return function(_0x5c70ad){if(_0x5c70ad){var _0x2fa5ea=typeof _0x6b39ec[_0xe3a3('0x17')]===_0xe3a3('0x18')&&typeof _0x6b39ec[_0xe3a3('0x19')]===_0xe3a3('0x18');var _0x521263=_0x5c70ad['count'];var _0x47869b=_0x2fa5ea?0x0:_0x6b39ec[_0xe3a3('0x17')];var _0x33273b=_0x2fa5ea?_0x5c70ad[_0xe3a3('0x1a')]:_0x6b39ec[_0xe3a3('0x17')]+_0x6b39ec[_0xe3a3('0x19')];var _0x3b3c6c;if(_0x33273b>=_0x521263){_0x33273b=_0x521263;_0x3b3c6c=0xc8;}else{_0x3b3c6c=0xce;}_0x190d0a['status'](_0x3b3c6c);return _0x190d0a[_0xe3a3('0x1b')](_0xe3a3('0x1c'),_0x47869b+'-'+_0x33273b+'/'+_0x521263)[_0xe3a3('0x16')](_0x5c70ad);}return null;};}function patchUpdates(_0x1a83b4){return function(_0x270e33){try{jsonpatch[_0xe3a3('0x1d')](_0x270e33,_0x1a83b4,!![]);}catch(_0x5c1109){return BPromise['reject'](_0x5c1109);}return _0x270e33[_0xe3a3('0x1e')]();};}function saveUpdates(_0x212ce0,_0x5ddf7f){return function(_0x23358b){if(_0x23358b){return _0x23358b[_0xe3a3('0x1f')](_0x212ce0)['then'](function(_0x3b6107){return _0x3b6107;});}return null;};}function removeEntity(_0x3d36ba,_0x50d0fe){return function(_0x5e921c){if(_0x5e921c){return _0x5e921c[_0xe3a3('0x20')]()[_0xe3a3('0x21')](function(){_0x3d36ba[_0xe3a3('0x22')](0xcc)[_0xe3a3('0x15')]();});}};}function handleEntityNotFound(_0x51624b,_0x48a6a2){return function(_0x5ce4c6){if(!_0x5ce4c6){_0x51624b[_0xe3a3('0x14')](0x194);}return _0x5ce4c6;};}function handleError(_0x3e8b3f,_0x32f92b){_0x32f92b=_0x32f92b||0x1f4;return function(_0xa4ac26){logger[_0xe3a3('0x23')](_0xa4ac26[_0xe3a3('0x24')]);if(_0xa4ac26[_0xe3a3('0x25')]){delete _0xa4ac26[_0xe3a3('0x25')];}_0x3e8b3f[_0xe3a3('0x22')](_0x32f92b)[_0xe3a3('0x26')](_0xa4ac26);};}exports[_0xe3a3('0x27')]=function(_0x3811ee,_0x2a8216){var _0x17adcc={},_0x2d79e={},_0x34de36={'count':0x0,'rows':[]};var _0x2d3e37=_[_0xe3a3('0x28')](db['AnalyticTreeReport'][_0xe3a3('0x29')],function(_0x2a33d2){return{'name':_0x2a33d2[_0xe3a3('0x2a')],'type':_0x2a33d2['type'][_0xe3a3('0x2b')]};});_0x2d79e[_0xe3a3('0x2c')]=_[_0xe3a3('0x28')](_0x2d3e37,'name');_0x2d79e[_0xe3a3('0x2d')]=_[_0xe3a3('0x2e')](_0x3811ee['query']);_0x2d79e['filters']=_[_0xe3a3('0x2f')](_0x2d79e[_0xe3a3('0x2c')],_0x2d79e[_0xe3a3('0x2d')]);_0x17adcc[_0xe3a3('0x30')]=_[_0xe3a3('0x2f')](_0x2d79e[_0xe3a3('0x2c')],qs['fields'](_0x3811ee[_0xe3a3('0x2d')][_0xe3a3('0x31')]));_0x17adcc[_0xe3a3('0x30')]=_0x17adcc[_0xe3a3('0x30')][_0xe3a3('0x32')]?_0x17adcc['attributes']:_0x2d79e['model'];if(!_0x3811ee[_0xe3a3('0x2d')][_0xe3a3('0x33')]('nolimit')){_0x17adcc['limit']=qs['limit'](_0x3811ee['query'][_0xe3a3('0x19')]);_0x17adcc['offset']=qs['offset'](_0x3811ee[_0xe3a3('0x2d')]['offset']);}_0x17adcc['order']=qs[_0xe3a3('0x34')](_0x3811ee['query']['sort']);_0x17adcc[_0xe3a3('0x35')]=qs[_0xe3a3('0x36')](_[_0xe3a3('0x37')](_0x3811ee[_0xe3a3('0x2d')],_0x2d79e[_0xe3a3('0x36')]),_0x2d3e37);if(_0x3811ee['query'][_0xe3a3('0x38')]){_0x17adcc[_0xe3a3('0x35')]=_[_0xe3a3('0x39')](_0x17adcc['where'],{'$or':_[_0xe3a3('0x28')](_0x2d3e37,function(_0x43c4a9){if(_0x43c4a9[_0xe3a3('0x3a')]!=='VIRTUAL'){var _0x2298d2={};_0x2298d2[_0x43c4a9[_0xe3a3('0x25')]]={'$like':'%'+_0x3811ee[_0xe3a3('0x2d')][_0xe3a3('0x38')]+'%'};return _0x2298d2;}})});}_0x17adcc=_[_0xe3a3('0x39')]({},_0x17adcc,_0x3811ee['options']);var _0xbfc0e0={'where':_0x17adcc[_0xe3a3('0x35')]};return db[_0xe3a3('0x3b')]['count'](_0xbfc0e0)[_0xe3a3('0x21')](function(_0x4c98ce){_0x34de36[_0xe3a3('0x1a')]=_0x4c98ce;if(_0x3811ee[_0xe3a3('0x2d')][_0xe3a3('0x3c')]){_0x17adcc[_0xe3a3('0x3d')]=[{'all':!![]}];}return db[_0xe3a3('0x3b')][_0xe3a3('0x3e')](_0x17adcc);})['then'](function(_0x15a5f1){_0x34de36[_0xe3a3('0x3f')]=_0x15a5f1;return _0x34de36;})[_0xe3a3('0x21')](respondWithFilteredResult(_0x2a8216,_0x17adcc))[_0xe3a3('0x40')](handleError(_0x2a8216,null));};exports[_0xe3a3('0x41')]=function(_0x59f046,_0xba3200){var _0x52dc21={'raw':!![],'where':{'id':_0x59f046['params']['id']}},_0x1ad4c6={};_0x1ad4c6[_0xe3a3('0x2c')]=_[_0xe3a3('0x2e')](db[_0xe3a3('0x3b')][_0xe3a3('0x29')]);_0x1ad4c6['query']=_[_0xe3a3('0x2e')](_0x59f046[_0xe3a3('0x2d')]);_0x1ad4c6[_0xe3a3('0x36')]=_[_0xe3a3('0x2f')](_0x1ad4c6[_0xe3a3('0x2c')],_0x1ad4c6[_0xe3a3('0x2d')]);_0x52dc21['attributes']=_['intersection'](_0x1ad4c6[_0xe3a3('0x2c')],qs[_0xe3a3('0x31')](_0x59f046[_0xe3a3('0x2d')]['fields']));_0x52dc21[_0xe3a3('0x30')]=_0x52dc21[_0xe3a3('0x30')][_0xe3a3('0x32')]?_0x52dc21[_0xe3a3('0x30')]:_0x1ad4c6[_0xe3a3('0x2c')];if(_0x59f046[_0xe3a3('0x2d')][_0xe3a3('0x3c')]){_0x52dc21[_0xe3a3('0x3d')]=[{'all':!![]}];}_0x52dc21=_[_0xe3a3('0x39')]({},_0x52dc21,_0x59f046[_0xe3a3('0x42')]);return db[_0xe3a3('0x3b')][_0xe3a3('0x43')](_0x52dc21)[_0xe3a3('0x21')](handleEntityNotFound(_0xba3200,null))[_0xe3a3('0x21')](respondWithResult(_0xba3200,null))[_0xe3a3('0x40')](handleError(_0xba3200,null));};exports[_0xe3a3('0x44')]=function(_0xb84cfe,_0x378461){return db[_0xe3a3('0x3b')][_0xe3a3('0x44')](_0xb84cfe[_0xe3a3('0x45')],{})['then'](respondWithResult(_0x378461,0xc9))[_0xe3a3('0x40')](handleError(_0x378461,null));};exports[_0xe3a3('0x1f')]=function(_0x4b8bc5,_0x329383){if(_0x4b8bc5[_0xe3a3('0x45')]['id']){delete _0x4b8bc5[_0xe3a3('0x45')]['id'];}return db[_0xe3a3('0x3b')][_0xe3a3('0x43')]({'where':{'id':_0x4b8bc5[_0xe3a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x329383,null))['then'](saveUpdates(_0x4b8bc5[_0xe3a3('0x45')],null))[_0xe3a3('0x21')](respondWithResult(_0x329383,null))[_0xe3a3('0x40')](handleError(_0x329383,null));};exports[_0xe3a3('0x20')]=function(_0x186c65,_0x2fe17c){return db[_0xe3a3('0x3b')]['find']({'where':{'id':_0x186c65[_0xe3a3('0x46')]['id']}})['then'](handleEntityNotFound(_0x2fe17c,null))[_0xe3a3('0x21')](removeEntity(_0x2fe17c,null))['catch'](handleError(_0x2fe17c,null));};
\ No newline at end of file
+var _0xaca5=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','params','keys','find','catch','create','body','update','eml-format','rimraf','zip-dir'];(function(_0x536256,_0x237fb5){var _0x1675f7=function(_0x339198){while(--_0x339198){_0x536256['push'](_0x536256['shift']());}};_0x1675f7(++_0x237fb5);}(_0xaca5,0xe4));var _0x5aca=function(_0x225a50,_0x593a61){_0x225a50=_0x225a50-0x0;var _0xc7afb4=_0xaca5[_0x225a50];return _0xc7afb4;};'use strict';var emlformat=require(_0x5aca('0x0'));var rimraf=require(_0x5aca('0x1'));var zipdir=require(_0x5aca('0x2'));var jsonpatch=require(_0x5aca('0x3'));var rp=require(_0x5aca('0x4'));var moment=require(_0x5aca('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5aca('0x6'));var util=require(_0x5aca('0x7'));var path=require(_0x5aca('0x8'));var sox=require(_0x5aca('0x9'));var csv=require(_0x5aca('0xa'));var ejs=require(_0x5aca('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5aca('0xc'));var squel=require(_0x5aca('0xd'));var crypto=require('crypto');var jsforce=require(_0x5aca('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5aca('0xa'));var querystring=require(_0x5aca('0xf'));var Papa=require(_0x5aca('0x10'));var Redis=require(_0x5aca('0x11'));var authService=require(_0x5aca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5aca('0x13'));var hardwareService=require(_0x5aca('0x14'));var logger=require(_0x5aca('0x15'))(_0x5aca('0x16'));var utils=require(_0x5aca('0x17'));var config=require(_0x5aca('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5aca('0x19'))['db'];function respondWithStatusCode(_0x52327b,_0x160781){_0x160781=_0x160781||0xcc;return function(_0x5d1156){if(_0x5d1156){return _0x52327b[_0x5aca('0x1a')](_0x160781);}return _0x52327b[_0x5aca('0x1b')](_0x160781)[_0x5aca('0x1c')]();};}function respondWithResult(_0x5e977e,_0x586ce9){_0x586ce9=_0x586ce9||0xc8;return function(_0x2f6c54){if(_0x2f6c54){return _0x5e977e[_0x5aca('0x1b')](_0x586ce9)[_0x5aca('0x1d')](_0x2f6c54);}};}function respondWithFilteredResult(_0x2fb818,_0x396cb6){return function(_0x4b3d70){if(_0x4b3d70){var _0x4c3ab4=typeof _0x396cb6[_0x5aca('0x1e')]===_0x5aca('0x1f')&&typeof _0x396cb6[_0x5aca('0x20')]===_0x5aca('0x1f');var _0x30c95e=_0x4b3d70['count'];var _0x18ac71=_0x4c3ab4?0x0:_0x396cb6['offset'];var _0x13dae6=_0x4c3ab4?_0x4b3d70[_0x5aca('0x21')]:_0x396cb6[_0x5aca('0x1e')]+_0x396cb6[_0x5aca('0x20')];var _0x4a2cbb;if(_0x13dae6>=_0x30c95e){_0x13dae6=_0x30c95e;_0x4a2cbb=0xc8;}else{_0x4a2cbb=0xce;}_0x2fb818[_0x5aca('0x1b')](_0x4a2cbb);return _0x2fb818[_0x5aca('0x22')](_0x5aca('0x23'),_0x18ac71+'-'+_0x13dae6+'/'+_0x30c95e)['json'](_0x4b3d70);}return null;};}function patchUpdates(_0x106fc6){return function(_0x3131c3){try{jsonpatch[_0x5aca('0x24')](_0x3131c3,_0x106fc6,!![]);}catch(_0x4b241f){return BPromise[_0x5aca('0x25')](_0x4b241f);}return _0x3131c3[_0x5aca('0x26')]();};}function saveUpdates(_0x37823b,_0x3f87a4){return function(_0x34c40a){if(_0x34c40a){return _0x34c40a['update'](_0x37823b)[_0x5aca('0x27')](function(_0x5d7bd7){return _0x5d7bd7;});}return null;};}function removeEntity(_0x56da55,_0x44a1df){return function(_0x453e45){if(_0x453e45){return _0x453e45[_0x5aca('0x28')]()[_0x5aca('0x27')](function(){_0x56da55['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf1a327,_0x3427b5){return function(_0x2e4075){if(!_0x2e4075){_0xf1a327[_0x5aca('0x1a')](0x194);}return _0x2e4075;};}function handleError(_0x59e0a8,_0x2c9c2f){_0x2c9c2f=_0x2c9c2f||0x1f4;return function(_0x2f8944){logger[_0x5aca('0x29')](_0x2f8944[_0x5aca('0x2a')]);if(_0x2f8944[_0x5aca('0x2b')]){delete _0x2f8944[_0x5aca('0x2b')];}_0x59e0a8['status'](_0x2c9c2f)['send'](_0x2f8944);};}exports[_0x5aca('0x2c')]=function(_0x1b9894,_0x135252){var _0x271106={},_0x5068de={},_0x3a6cc7={'count':0x0,'rows':[]};var _0xf4928c=_[_0x5aca('0x2d')](db[_0x5aca('0x2e')][_0x5aca('0x2f')],function(_0x31e75e){return{'name':_0x31e75e[_0x5aca('0x30')],'type':_0x31e75e[_0x5aca('0x31')][_0x5aca('0x32')]};});_0x5068de['model']=_['map'](_0xf4928c,_0x5aca('0x2b'));_0x5068de[_0x5aca('0x33')]=_['keys'](_0x1b9894[_0x5aca('0x33')]);_0x5068de[_0x5aca('0x34')]=_[_0x5aca('0x35')](_0x5068de[_0x5aca('0x36')],_0x5068de['query']);_0x271106[_0x5aca('0x37')]=_[_0x5aca('0x35')](_0x5068de[_0x5aca('0x36')],qs['fields'](_0x1b9894['query'][_0x5aca('0x38')]));_0x271106['attributes']=_0x271106[_0x5aca('0x37')][_0x5aca('0x39')]?_0x271106['attributes']:_0x5068de[_0x5aca('0x36')];if(!_0x1b9894[_0x5aca('0x33')][_0x5aca('0x3a')](_0x5aca('0x3b'))){_0x271106[_0x5aca('0x20')]=qs[_0x5aca('0x20')](_0x1b9894[_0x5aca('0x33')][_0x5aca('0x20')]);_0x271106['offset']=qs['offset'](_0x1b9894['query']['offset']);}_0x271106[_0x5aca('0x3c')]=qs[_0x5aca('0x3d')](_0x1b9894[_0x5aca('0x33')][_0x5aca('0x3d')]);_0x271106[_0x5aca('0x3e')]=qs[_0x5aca('0x34')](_[_0x5aca('0x3f')](_0x1b9894[_0x5aca('0x33')],_0x5068de['filters']),_0xf4928c);if(_0x1b9894[_0x5aca('0x33')][_0x5aca('0x40')]){_0x271106[_0x5aca('0x3e')]=_['merge'](_0x271106[_0x5aca('0x3e')],{'$or':_[_0x5aca('0x2d')](_0xf4928c,function(_0x178f7e){if(_0x178f7e[_0x5aca('0x31')]!=='VIRTUAL'){var _0x23fb42={};_0x23fb42[_0x178f7e[_0x5aca('0x2b')]]={'$like':'%'+_0x1b9894[_0x5aca('0x33')][_0x5aca('0x40')]+'%'};return _0x23fb42;}})});}_0x271106=_[_0x5aca('0x41')]({},_0x271106,_0x1b9894[_0x5aca('0x42')]);var _0x1a04a9={'where':_0x271106[_0x5aca('0x3e')]};return db[_0x5aca('0x2e')][_0x5aca('0x21')](_0x1a04a9)[_0x5aca('0x27')](function(_0x2a8be8){_0x3a6cc7[_0x5aca('0x21')]=_0x2a8be8;if(_0x1b9894['query'][_0x5aca('0x43')]){_0x271106[_0x5aca('0x44')]=[{'all':!![]}];}return db[_0x5aca('0x2e')]['findAll'](_0x271106);})[_0x5aca('0x27')](function(_0x4325c0){_0x3a6cc7[_0x5aca('0x45')]=_0x4325c0;return _0x3a6cc7;})[_0x5aca('0x27')](respondWithFilteredResult(_0x135252,_0x271106))['catch'](handleError(_0x135252,null));};exports['show']=function(_0x28c768,_0x112980){var _0x2cd346={'raw':!![],'where':{'id':_0x28c768[_0x5aca('0x46')]['id']}},_0x1e5800={};_0x1e5800['model']=_[_0x5aca('0x47')](db['AnalyticTreeReport'][_0x5aca('0x2f')]);_0x1e5800[_0x5aca('0x33')]=_['keys'](_0x28c768[_0x5aca('0x33')]);_0x1e5800['filters']=_[_0x5aca('0x35')](_0x1e5800['model'],_0x1e5800['query']);_0x2cd346[_0x5aca('0x37')]=_['intersection'](_0x1e5800['model'],qs['fields'](_0x28c768[_0x5aca('0x33')][_0x5aca('0x38')]));_0x2cd346['attributes']=_0x2cd346[_0x5aca('0x37')][_0x5aca('0x39')]?_0x2cd346['attributes']:_0x1e5800[_0x5aca('0x36')];if(_0x28c768[_0x5aca('0x33')][_0x5aca('0x43')]){_0x2cd346[_0x5aca('0x44')]=[{'all':!![]}];}_0x2cd346=_[_0x5aca('0x41')]({},_0x2cd346,_0x28c768[_0x5aca('0x42')]);return db['AnalyticTreeReport'][_0x5aca('0x48')](_0x2cd346)[_0x5aca('0x27')](handleEntityNotFound(_0x112980,null))[_0x5aca('0x27')](respondWithResult(_0x112980,null))[_0x5aca('0x49')](handleError(_0x112980,null));};exports['create']=function(_0x4ee0d5,_0x50573d){return db[_0x5aca('0x2e')][_0x5aca('0x4a')](_0x4ee0d5[_0x5aca('0x4b')],{})['then'](respondWithResult(_0x50573d,0xc9))['catch'](handleError(_0x50573d,null));};exports[_0x5aca('0x4c')]=function(_0x2ac1eb,_0x1123b3){if(_0x2ac1eb['body']['id']){delete _0x2ac1eb['body']['id'];}return db[_0x5aca('0x2e')][_0x5aca('0x48')]({'where':{'id':_0x2ac1eb['params']['id']}})['then'](handleEntityNotFound(_0x1123b3,null))['then'](saveUpdates(_0x2ac1eb['body'],null))[_0x5aca('0x27')](respondWithResult(_0x1123b3,null))[_0x5aca('0x49')](handleError(_0x1123b3,null));};exports[_0x5aca('0x28')]=function(_0x319026,_0x117c46){return db['AnalyticTreeReport'][_0x5aca('0x48')]({'where':{'id':_0x319026['params']['id']}})['then'](handleEntityNotFound(_0x117c46,null))[_0x5aca('0x27')](removeEntity(_0x117c46,null))[_0x5aca('0x49')](handleError(_0x117c46,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index e0c0407..301cb3d 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 _0xc68a=['define','AnalyticTreeReport','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0xc68a,0xf4));var _0xac68=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0xc68a[_0x11155f];return _0xd07e48;};'use strict';var _=require(_0xac68('0x0'));var util=require(_0xac68('0x1'));var logger=require(_0xac68('0x2'))(_0xac68('0x3'));var moment=require('moment');var BPromise=require(_0xac68('0x4'));var rp=require(_0xac68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac68('0x6'));var attributes=require(_0xac68('0x7'));module[_0xac68('0x8')]=function(_0x10df11,_0x17962c){return _0x10df11[_0xac68('0x9')](_0xac68('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1db=['exports','AnalyticTreeReport','analytics_report_trees','../../config/logger','moment','path','rimraf','../../config/environment'];(function(_0x14d752,_0x40833b){var _0x225bea=function(_0x1fe54d){while(--_0x1fe54d){_0x14d752['push'](_0x14d752['shift']());}};_0x225bea(++_0x40833b);}(_0xf1db,0x83));var _0xbf1d=function(_0x3471ab,_0x513323){_0x3471ab=_0x3471ab-0x0;var _0x1f8413=_0xf1db[_0x3471ab];return _0x1f8413;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf1d('0x0'))('api');var moment=require(_0xbf1d('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf1d('0x2'));var rimraf=require(_0xbf1d('0x3'));var config=require(_0xbf1d('0x4'));var attributes=require('./analyticTreeReport.attributes');module[_0xbf1d('0x5')]=function(_0x2bd3b4,_0x15fa55){return _0x2bd3b4['define'](_0xbf1d('0x6'),attributes,{'tableName':_0xbf1d('0x7'),'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 cb8b53b..c71ac8a 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(_0xb92da,_0x50b913){var _0x2957e6=function(_0x415958){while(--_0x415958){_0xb92da['push'](_0xb92da['shift']());}};_0x2957e6(++_0x50b913);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x21fc68,_0x459828){var _0x3561e1=function(_0x3dea77){while(--_0x3dea77){_0x21fc68['push'](_0x21fc68['shift']());}};_0x3561e1(++_0x459828);}(_0x2ef3,0xba));var _0x32ef=function(_0x4c0a05,_0x4ba9f3){_0x4c0a05=_0x4c0a05-0x0;var _0x4ff639=_0x2ef3[_0x4c0a05];return _0x4ff639;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index aa1b56e..b556730 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 _0xf5f1=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','create','put','/:id','update','exports','multer','path','connect-timeout','Router'];(function(_0x2614d2,_0x5656f1){var _0x43d9cd=function(_0x2904c5){while(--_0x2904c5){_0x2614d2['push'](_0x2614d2['shift']());}};_0x43d9cd(++_0x5656f1);}(_0xf5f1,0x155));var _0x1f5f=function(_0x13c4ea,_0xe23d79){_0x13c4ea=_0x13c4ea-0x0;var _0x5dd633=_0xf5f1[_0x13c4ea];return _0x5dd633;};'use strict';var multer=require(_0x1f5f('0x0'));var util=require('util');var path=require(_0x1f5f('0x1'));var timeout=require(_0x1f5f('0x2'));var express=require('express');var router=express[_0x1f5f('0x3')]();var fs_extra=require(_0x1f5f('0x4'));var auth=require(_0x1f5f('0x5'));var interaction=require(_0x1f5f('0x6'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x1f5f('0x7')]('/',auth[_0x1f5f('0x8')](),controller[_0x1f5f('0x9')]);router[_0x1f5f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x1f5f('0x8')](),controller[_0x1f5f('0xa')]);router[_0x1f5f('0xb')](_0x1f5f('0xc'),auth[_0x1f5f('0x8')](),controller[_0x1f5f('0xd')]);router['delete'](_0x1f5f('0xc'),auth[_0x1f5f('0x8')](),controller['destroy']);module[_0x1f5f('0xe')]=router;
\ No newline at end of file
+var _0xee82=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee82,0x155));var _0x2ee8=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xee82[_0x2136d5];return _0x3bee2e;};'use strict';var multer=require(_0x2ee8('0x0'));var util=require(_0x2ee8('0x1'));var path=require('path');var timeout=require(_0x2ee8('0x2'));var express=require('express');var router=express[_0x2ee8('0x3')]();var fs_extra=require(_0x2ee8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2ee8('0x5'));var config=require(_0x2ee8('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x2ee8('0x7')]('/',auth[_0x2ee8('0x8')](),controller[_0x2ee8('0x9')]);router[_0x2ee8('0x7')]('/:id',auth[_0x2ee8('0x8')](),controller[_0x2ee8('0xa')]);router['post']('/',auth[_0x2ee8('0x8')](),controller[_0x2ee8('0xb')]);router[_0x2ee8('0xc')](_0x2ee8('0xd'),auth[_0x2ee8('0x8')](),controller[_0x2ee8('0xe')]);router[_0x2ee8('0xf')](_0x2ee8('0xd'),auth[_0x2ee8('0x8')](),controller['destroy']);module[_0x2ee8('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 629a935..d22404a 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 _0x7bae=['STRING'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x7bae,0x13b));var _0xe7ba=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7bae[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7ba('0x0')]},'basename':{'type':Sequelize[_0xe7ba('0x0')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x34e8=['sequelize','exports','STRING'];(function(_0x9d95b8,_0x4050d6){var _0x4098cc=function(_0x4350b6){while(--_0x4350b6){_0x9d95b8['push'](_0x9d95b8['shift']());}};_0x4098cc(++_0x4050d6);}(_0x34e8,0x12c));var _0x834e=function(_0x290c60,_0x2f8f66){_0x290c60=_0x290c60-0x0;var _0x332089=_0x34e8[_0x290c60];return _0x332089;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'basename':{'type':Sequelize[_0x834e('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index d7e38cd..c301a92 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 _0xdd7a=['set','Content-Range','json','reject','save','update','then','destroy','error','name','index','map','Attachment','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','rawAttributes','find','get','updatedAt','body','omit','createdAt','create','catch','file','originalname','mimetype','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','offset','count'];(function(_0x3c7731,_0x345465){var _0x77af90=function(_0x58f69c){while(--_0x58f69c){_0x3c7731['push'](_0x3c7731['shift']());}};_0x77af90(++_0x345465);}(_0xdd7a,0x149));var _0xadd7=function(_0x86a1fb,_0x33d77e){_0x86a1fb=_0x86a1fb-0x0;var _0x27c791=_0xdd7a[_0x86a1fb];return _0x27c791;};'use strict';var emlformat=require(_0xadd7('0x0'));var rimraf=require(_0xadd7('0x1'));var zipdir=require(_0xadd7('0x2'));var jsonpatch=require(_0xadd7('0x3'));var rp=require(_0xadd7('0x4'));var moment=require('moment');var BPromise=require(_0xadd7('0x5'));var Mustache=require(_0xadd7('0x6'));var util=require(_0xadd7('0x7'));var path=require(_0xadd7('0x8'));var sox=require(_0xadd7('0x9'));var csv=require('to-csv');var ejs=require(_0xadd7('0xa'));var fs=require('fs');var fs_extra=require(_0xadd7('0xb'));var _=require(_0xadd7('0xc'));var squel=require(_0xadd7('0xd'));var crypto=require(_0xadd7('0xe'));var jsforce=require(_0xadd7('0xf'));var deskjs=require(_0xadd7('0x10'));var toCsv=require(_0xadd7('0x11'));var querystring=require('querystring');var Papa=require(_0xadd7('0x12'));var Redis=require(_0xadd7('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xadd7('0x14'));var as=require(_0xadd7('0x15'));var hardwareService=require(_0xadd7('0x16'));var logger=require(_0xadd7('0x17'))(_0xadd7('0x18'));var utils=require(_0xadd7('0x19'));var config=require(_0xadd7('0x1a'));var licenseUtil=require(_0xadd7('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4714c8,_0x5a2686){_0x5a2686=_0x5a2686||0xcc;return function(_0x183779){if(_0x183779){return _0x4714c8[_0xadd7('0x1c')](_0x5a2686);}return _0x4714c8[_0xadd7('0x1d')](_0x5a2686)[_0xadd7('0x1e')]();};}function respondWithResult(_0x5fa10e,_0x3c89b4){_0x3c89b4=_0x3c89b4||0xc8;return function(_0x4357dc){if(_0x4357dc){return _0x5fa10e[_0xadd7('0x1d')](_0x3c89b4)['json'](_0x4357dc);}};}function respondWithFilteredResult(_0x268a10,_0x27a7cf){return function(_0x485f39){if(_0x485f39){var _0x35a9fc=typeof _0x27a7cf['offset']==='undefined'&&typeof _0x27a7cf[_0xadd7('0x1f')]===_0xadd7('0x20');var _0x150b03=_0x485f39['count'];var _0x30adf5=_0x35a9fc?0x0:_0x27a7cf[_0xadd7('0x21')];var _0x557985=_0x35a9fc?_0x485f39[_0xadd7('0x22')]:_0x27a7cf['offset']+_0x27a7cf[_0xadd7('0x1f')];var _0x217a20;if(_0x557985>=_0x150b03){_0x557985=_0x150b03;_0x217a20=0xc8;}else{_0x217a20=0xce;}_0x268a10[_0xadd7('0x1d')](_0x217a20);return _0x268a10[_0xadd7('0x23')](_0xadd7('0x24'),_0x30adf5+'-'+_0x557985+'/'+_0x150b03)[_0xadd7('0x25')](_0x485f39);}return null;};}function patchUpdates(_0x56638f){return function(_0x5a548a){try{jsonpatch['apply'](_0x5a548a,_0x56638f,!![]);}catch(_0x24030c){return BPromise[_0xadd7('0x26')](_0x24030c);}return _0x5a548a[_0xadd7('0x27')]();};}function saveUpdates(_0x3657a5,_0x1ba59f){return function(_0x30ae47){if(_0x30ae47){return _0x30ae47[_0xadd7('0x28')](_0x3657a5)[_0xadd7('0x29')](function(_0x1aec6b){return _0x1aec6b;});}return null;};}function removeEntity(_0x20ebcd,_0x48f851){return function(_0x41da3f){if(_0x41da3f){return _0x41da3f[_0xadd7('0x2a')]()[_0xadd7('0x29')](function(){_0x20ebcd[_0xadd7('0x1d')](0xcc)[_0xadd7('0x1e')]();});}};}function handleEntityNotFound(_0x3b2313,_0x493785){return function(_0x1465f9){if(!_0x1465f9){_0x3b2313[_0xadd7('0x1c')](0x194);}return _0x1465f9;};}function handleError(_0x38812a,_0x49080c){_0x49080c=_0x49080c||0x1f4;return function(_0x5c5a41){logger[_0xadd7('0x2b')](_0x5c5a41['stack']);if(_0x5c5a41[_0xadd7('0x2c')]){delete _0x5c5a41[_0xadd7('0x2c')];}_0x38812a[_0xadd7('0x1d')](_0x49080c)['send'](_0x5c5a41);};}exports[_0xadd7('0x2d')]=function(_0x118e1b,_0x54fbb9){var _0x1368e2={},_0x132a92={},_0x552829={'count':0x0,'rows':[]};var _0xe400d3=_[_0xadd7('0x2e')](db[_0xadd7('0x2f')]['rawAttributes'],function(_0x395c08){return{'name':_0x395c08[_0xadd7('0x30')],'type':_0x395c08[_0xadd7('0x31')][_0xadd7('0x32')]};});_0x132a92[_0xadd7('0x33')]=_[_0xadd7('0x2e')](_0xe400d3,_0xadd7('0x2c'));_0x132a92[_0xadd7('0x34')]=_[_0xadd7('0x35')](_0x118e1b[_0xadd7('0x34')]);_0x132a92[_0xadd7('0x36')]=_[_0xadd7('0x37')](_0x132a92['model'],_0x132a92[_0xadd7('0x34')]);_0x1368e2[_0xadd7('0x38')]=_[_0xadd7('0x37')](_0x132a92[_0xadd7('0x33')],qs['fields'](_0x118e1b['query'][_0xadd7('0x39')]));_0x1368e2['attributes']=_0x1368e2[_0xadd7('0x38')][_0xadd7('0x3a')]?_0x1368e2['attributes']:_0x132a92[_0xadd7('0x33')];if(!_0x118e1b['query']['hasOwnProperty']('nolimit')){_0x1368e2['limit']=qs[_0xadd7('0x1f')](_0x118e1b['query'][_0xadd7('0x1f')]);_0x1368e2[_0xadd7('0x21')]=qs[_0xadd7('0x21')](_0x118e1b[_0xadd7('0x34')][_0xadd7('0x21')]);}_0x1368e2[_0xadd7('0x3b')]=qs[_0xadd7('0x3c')](_0x118e1b[_0xadd7('0x34')][_0xadd7('0x3c')]);_0x1368e2['where']=qs[_0xadd7('0x36')](_[_0xadd7('0x3d')](_0x118e1b[_0xadd7('0x34')],_0x132a92['filters']),_0xe400d3);if(_0x118e1b[_0xadd7('0x34')]['filter']){_0x1368e2[_0xadd7('0x3e')]=_[_0xadd7('0x3f')](_0x1368e2[_0xadd7('0x3e')],{'$or':_['map'](_0xe400d3,function(_0x3cbf94){if(_0x3cbf94[_0xadd7('0x31')]!==_0xadd7('0x40')){var _0x41001a={};_0x41001a[_0x3cbf94['name']]={'$like':'%'+_0x118e1b[_0xadd7('0x34')][_0xadd7('0x41')]+'%'};return _0x41001a;}})});}_0x1368e2=_['merge']({},_0x1368e2,_0x118e1b[_0xadd7('0x42')]);var _0x5ccba0={'where':_0x1368e2[_0xadd7('0x3e')]};return db[_0xadd7('0x2f')][_0xadd7('0x22')](_0x5ccba0)[_0xadd7('0x29')](function(_0x520ef4){_0x552829[_0xadd7('0x22')]=_0x520ef4;if(_0x118e1b['query'][_0xadd7('0x43')]){_0x1368e2[_0xadd7('0x44')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x1368e2);})['then'](function(_0x1700dd){_0x552829[_0xadd7('0x45')]=_0x1700dd;return _0x552829;})[_0xadd7('0x29')](respondWithFilteredResult(_0x54fbb9,_0x1368e2))['catch'](handleError(_0x54fbb9,null));};exports[_0xadd7('0x46')]=function(_0x36dfac,_0x3be8db){var _0x2ea287={'raw':!![],'where':{'id':_0x36dfac[_0xadd7('0x47')]['id']}},_0x9973b9={};_0x9973b9[_0xadd7('0x33')]=_[_0xadd7('0x35')](db['Attachment'][_0xadd7('0x48')]);_0x9973b9[_0xadd7('0x34')]=_['keys'](_0x36dfac[_0xadd7('0x34')]);_0x9973b9[_0xadd7('0x36')]=_[_0xadd7('0x37')](_0x9973b9['model'],_0x9973b9['query']);_0x2ea287[_0xadd7('0x38')]=_[_0xadd7('0x37')](_0x9973b9[_0xadd7('0x33')],qs['fields'](_0x36dfac[_0xadd7('0x34')]['fields']));_0x2ea287[_0xadd7('0x38')]=_0x2ea287[_0xadd7('0x38')][_0xadd7('0x3a')]?_0x2ea287[_0xadd7('0x38')]:_0x9973b9[_0xadd7('0x33')];if(_0x36dfac[_0xadd7('0x34')][_0xadd7('0x43')]){_0x2ea287[_0xadd7('0x44')]=[{'all':!![]}];}_0x2ea287=_[_0xadd7('0x3f')]({},_0x2ea287,_0x36dfac['options']);return db[_0xadd7('0x2f')][_0xadd7('0x49')](_0x2ea287)[_0xadd7('0x29')](handleEntityNotFound(_0x3be8db,null))[_0xadd7('0x29')](respondWithResult(_0x3be8db,null))['catch'](handleError(_0x3be8db,null));};exports['clone']=function(_0x384b3b,_0x2bd23b){var _0x564c3e={'where':{'id':_0x384b3b[_0xadd7('0x47')]['id']}},_0x19ad2d={};_0x19ad2d['model']=_['keys'](db[_0xadd7('0x2f')]['rawAttributes']);_0x564c3e[_0xadd7('0x38')]=_[_0xadd7('0x37')](_0x19ad2d[_0xadd7('0x33')],qs[_0xadd7('0x39')](_0x384b3b[_0xadd7('0x34')]['fields']));_0x564c3e['attributes']=_0x564c3e[_0xadd7('0x38')][_0xadd7('0x3a')]?_0x564c3e[_0xadd7('0x38')]:_0x19ad2d[_0xadd7('0x33')];if(_0x384b3b[_0xadd7('0x34')][_0xadd7('0x43')]){_0x564c3e[_0xadd7('0x44')]=[{'all':!![]}];}_0x564c3e=_[_0xadd7('0x3f')]({},_0x564c3e,_0x384b3b[_0xadd7('0x42')]);return db[_0xadd7('0x2f')][_0xadd7('0x49')](_0x564c3e)[_0xadd7('0x29')](handleEntityNotFound(_0x2bd23b,null))['then'](function(_0x61da1d){if(_0x61da1d){var _0x68691b=_0x61da1d[_0xadd7('0x4a')]({'plain':!![]});_0x68691b=qs['omit'](_0x68691b,['id','createdAt',_0xadd7('0x4b')]);_0x384b3b[_0xadd7('0x4c')]=_[_0xadd7('0x4d')](_0x384b3b[_0xadd7('0x4c')],['id',_0xadd7('0x4e'),_0xadd7('0x4b')]);return db[_0xadd7('0x2f')][_0xadd7('0x4f')](_[_0xadd7('0x3f')](_0x68691b,_0x384b3b[_0xadd7('0x4c')]),{'include':_0x384b3b[_0xadd7('0x34')][_0xadd7('0x43')]?[{'all':!![]}]:undefined});}})[_0xadd7('0x29')](respondWithResult(_0x2bd23b,0xc9))[_0xadd7('0x50')](handleError(_0x2bd23b,null));};exports['update']=function(_0x3dfa66,_0x4fee20){if(_0x3dfa66[_0xadd7('0x4c')]['id']){delete _0x3dfa66['body']['id'];}return db[_0xadd7('0x2f')]['find']({'where':{'id':_0x3dfa66[_0xadd7('0x47')]['id']}})[_0xadd7('0x29')](handleEntityNotFound(_0x4fee20,null))['then'](saveUpdates(_0x3dfa66[_0xadd7('0x4c')],null))[_0xadd7('0x29')](respondWithResult(_0x4fee20,null))[_0xadd7('0x50')](handleError(_0x4fee20,null));};exports[_0xadd7('0x2a')]=function(_0x43381b,_0x1e3439){return db[_0xadd7('0x2f')][_0xadd7('0x49')]({'where':{'id':_0x43381b[_0xadd7('0x47')]['id']}})[_0xadd7('0x29')](handleEntityNotFound(_0x1e3439,null))[_0xadd7('0x29')](removeEntity(_0x1e3439,null))[_0xadd7('0x50')](handleError(_0x1e3439,null));};exports['create']=function(_0x58c2cf,_0x43c83a,_0x3ab7e5){_0x58c2cf[_0xadd7('0x4c')][_0xadd7('0x2c')]=_0x58c2cf[_0xadd7('0x51')][_0xadd7('0x52')];_0x58c2cf[_0xadd7('0x4c')]['basename']=_0x58c2cf['file']['filename'];_0x58c2cf['body'][_0xadd7('0x31')]=_0x58c2cf['file'][_0xadd7('0x53')];return db['Attachment'][_0xadd7('0x4f')](_0x58c2cf['body'])[_0xadd7('0x29')](respondWithResult(_0x43c83a,0xc9))[_0xadd7('0x50')](handleError(_0x43c83a,null));};exports['download']=function(_0x348436,_0x3240ca,_0x590a0c){return db[_0xadd7('0x2f')]['findOne']({'where':{'id':_0x348436['params']['id']},'raw':!![]})[_0xadd7('0x29')](handleEntityNotFound(_0x3240ca,null))['then'](function(_0x36f5d8){if(_0x36f5d8){var _0x14271a=_0x36f5d8[_0xadd7('0x54')]!==null;var _0x1607dc=path[_0xadd7('0x55')](config[_0xadd7('0x56')],_0xadd7('0x57'));if(_0x14271a){_0x1607dc=path[_0xadd7('0x55')](_0x1607dc,_0xadd7('0x58'));}var _0x4e4b55=path[_0xadd7('0x55')](_0x1607dc,_0x36f5d8[_0xadd7('0x59')]);return _0x3240ca[_0xadd7('0x5a')](_0x4e4b55);}})[_0xadd7('0x50')](handleError(_0x3240ca,null));};
\ No newline at end of file
+var _0xdd60=['name','send','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','offset','sort','where','pick','filter','merge','Attachment','includeAll','include','findAll','rows','catch','show','params','keys','options','clone','find','get','updatedAt','body','omit','createdAt','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','status','end','error'];(function(_0x58b768,_0x27c50d){var _0x17d09d=function(_0x1b9566){while(--_0x1b9566){_0x58b768['push'](_0x58b768['shift']());}};_0x17d09d(++_0x27c50d);}(_0xdd60,0xe4));var _0x0dd6=function(_0x559587,_0x53504b){_0x559587=_0x559587-0x0;var _0x21f2b0=_0xdd60[_0x559587];return _0x21f2b0;};'use strict';var emlformat=require(_0x0dd6('0x0'));var rimraf=require(_0x0dd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0dd6('0x2'));var rp=require(_0x0dd6('0x3'));var moment=require(_0x0dd6('0x4'));var BPromise=require(_0x0dd6('0x5'));var Mustache=require(_0x0dd6('0x6'));var util=require(_0x0dd6('0x7'));var path=require('path');var sox=require(_0x0dd6('0x8'));var csv=require(_0x0dd6('0x9'));var ejs=require(_0x0dd6('0xa'));var fs=require('fs');var fs_extra=require(_0x0dd6('0xb'));var _=require('lodash');var squel=require(_0x0dd6('0xc'));var crypto=require(_0x0dd6('0xd'));var jsforce=require(_0x0dd6('0xe'));var deskjs=require(_0x0dd6('0xf'));var toCsv=require(_0x0dd6('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0dd6('0x10'));var authService=require(_0x0dd6('0x11'));var qs=require(_0x0dd6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0dd6('0x13'));var utils=require(_0x0dd6('0x14'));var config=require(_0x0dd6('0x15'));var licenseUtil=require(_0x0dd6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4311e6,_0xd1c56b){_0xd1c56b=_0xd1c56b||0xcc;return function(_0x469a6d){if(_0x469a6d){return _0x4311e6[_0x0dd6('0x17')](_0xd1c56b);}return _0x4311e6['status'](_0xd1c56b)['end']();};}function respondWithResult(_0x44e3d3,_0x586acf){_0x586acf=_0x586acf||0xc8;return function(_0x283c82){if(_0x283c82){return _0x44e3d3['status'](_0x586acf)[_0x0dd6('0x18')](_0x283c82);}};}function respondWithFilteredResult(_0x56c8e1,_0x43e4){return function(_0x40c965){if(_0x40c965){var _0x4df0f3=typeof _0x43e4['offset']==='undefined'&&typeof _0x43e4[_0x0dd6('0x19')]===_0x0dd6('0x1a');var _0x230e26=_0x40c965[_0x0dd6('0x1b')];var _0x27b15d=_0x4df0f3?0x0:_0x43e4['offset'];var _0x2e389f=_0x4df0f3?_0x40c965[_0x0dd6('0x1b')]:_0x43e4['offset']+_0x43e4[_0x0dd6('0x19')];var _0x4260a3;if(_0x2e389f>=_0x230e26){_0x2e389f=_0x230e26;_0x4260a3=0xc8;}else{_0x4260a3=0xce;}_0x56c8e1['status'](_0x4260a3);return _0x56c8e1[_0x0dd6('0x1c')](_0x0dd6('0x1d'),_0x27b15d+'-'+_0x2e389f+'/'+_0x230e26)[_0x0dd6('0x18')](_0x40c965);}return null;};}function patchUpdates(_0x1d9a5b){return function(_0x312a95){try{jsonpatch[_0x0dd6('0x1e')](_0x312a95,_0x1d9a5b,!![]);}catch(_0x5b5042){return BPromise[_0x0dd6('0x1f')](_0x5b5042);}return _0x312a95[_0x0dd6('0x20')]();};}function saveUpdates(_0x77ec07,_0x3d1c0a){return function(_0x8ffaf5){if(_0x8ffaf5){return _0x8ffaf5[_0x0dd6('0x21')](_0x77ec07)[_0x0dd6('0x22')](function(_0xd27fb3){return _0xd27fb3;});}return null;};}function removeEntity(_0x4ef99e,_0x29030d){return function(_0x43576b){if(_0x43576b){return _0x43576b[_0x0dd6('0x23')]()['then'](function(){_0x4ef99e[_0x0dd6('0x24')](0xcc)[_0x0dd6('0x25')]();});}};}function handleEntityNotFound(_0x88381f,_0xa14859){return function(_0x171451){if(!_0x171451){_0x88381f[_0x0dd6('0x17')](0x194);}return _0x171451;};}function handleError(_0x445c6f,_0x242481){_0x242481=_0x242481||0x1f4;return function(_0x4879af){logger[_0x0dd6('0x26')](_0x4879af['stack']);if(_0x4879af[_0x0dd6('0x27')]){delete _0x4879af['name'];}_0x445c6f[_0x0dd6('0x24')](_0x242481)[_0x0dd6('0x28')](_0x4879af);};}exports['index']=function(_0x206232,_0x2f5e41){var _0x5c7581={},_0x328e3f={},_0x1e16d6={'count':0x0,'rows':[]};var _0x54fb55=_[_0x0dd6('0x29')](db['Attachment'][_0x0dd6('0x2a')],function(_0x1d64bd){return{'name':_0x1d64bd[_0x0dd6('0x2b')],'type':_0x1d64bd[_0x0dd6('0x2c')][_0x0dd6('0x2d')]};});_0x328e3f['model']=_[_0x0dd6('0x29')](_0x54fb55,_0x0dd6('0x27'));_0x328e3f[_0x0dd6('0x2e')]=_['keys'](_0x206232[_0x0dd6('0x2e')]);_0x328e3f[_0x0dd6('0x2f')]=_[_0x0dd6('0x30')](_0x328e3f[_0x0dd6('0x31')],_0x328e3f[_0x0dd6('0x2e')]);_0x5c7581['attributes']=_['intersection'](_0x328e3f['model'],qs[_0x0dd6('0x32')](_0x206232[_0x0dd6('0x2e')][_0x0dd6('0x32')]));_0x5c7581[_0x0dd6('0x33')]=_0x5c7581[_0x0dd6('0x33')][_0x0dd6('0x34')]?_0x5c7581['attributes']:_0x328e3f[_0x0dd6('0x31')];if(!_0x206232[_0x0dd6('0x2e')][_0x0dd6('0x35')]('nolimit')){_0x5c7581[_0x0dd6('0x19')]=qs['limit'](_0x206232[_0x0dd6('0x2e')][_0x0dd6('0x19')]);_0x5c7581[_0x0dd6('0x36')]=qs[_0x0dd6('0x36')](_0x206232[_0x0dd6('0x2e')][_0x0dd6('0x36')]);}_0x5c7581['order']=qs['sort'](_0x206232['query'][_0x0dd6('0x37')]);_0x5c7581[_0x0dd6('0x38')]=qs[_0x0dd6('0x2f')](_[_0x0dd6('0x39')](_0x206232[_0x0dd6('0x2e')],_0x328e3f[_0x0dd6('0x2f')]),_0x54fb55);if(_0x206232[_0x0dd6('0x2e')][_0x0dd6('0x3a')]){_0x5c7581[_0x0dd6('0x38')]=_['merge'](_0x5c7581['where'],{'$or':_[_0x0dd6('0x29')](_0x54fb55,function(_0xbdc208){if(_0xbdc208[_0x0dd6('0x2c')]!=='VIRTUAL'){var _0x5c4e68={};_0x5c4e68[_0xbdc208['name']]={'$like':'%'+_0x206232['query'][_0x0dd6('0x3a')]+'%'};return _0x5c4e68;}})});}_0x5c7581=_[_0x0dd6('0x3b')]({},_0x5c7581,_0x206232['options']);var _0x477ecb={'where':_0x5c7581[_0x0dd6('0x38')]};return db[_0x0dd6('0x3c')][_0x0dd6('0x1b')](_0x477ecb)['then'](function(_0x4842f0){_0x1e16d6[_0x0dd6('0x1b')]=_0x4842f0;if(_0x206232[_0x0dd6('0x2e')][_0x0dd6('0x3d')]){_0x5c7581[_0x0dd6('0x3e')]=[{'all':!![]}];}return db['Attachment'][_0x0dd6('0x3f')](_0x5c7581);})[_0x0dd6('0x22')](function(_0x223018){_0x1e16d6[_0x0dd6('0x40')]=_0x223018;return _0x1e16d6;})[_0x0dd6('0x22')](respondWithFilteredResult(_0x2f5e41,_0x5c7581))[_0x0dd6('0x41')](handleError(_0x2f5e41,null));};exports[_0x0dd6('0x42')]=function(_0x215ca9,_0xaa0c7){var _0x26270e={'raw':!![],'where':{'id':_0x215ca9[_0x0dd6('0x43')]['id']}},_0x20b0d6={};_0x20b0d6[_0x0dd6('0x31')]=_[_0x0dd6('0x44')](db['Attachment']['rawAttributes']);_0x20b0d6[_0x0dd6('0x2e')]=_[_0x0dd6('0x44')](_0x215ca9[_0x0dd6('0x2e')]);_0x20b0d6[_0x0dd6('0x2f')]=_[_0x0dd6('0x30')](_0x20b0d6[_0x0dd6('0x31')],_0x20b0d6[_0x0dd6('0x2e')]);_0x26270e[_0x0dd6('0x33')]=_['intersection'](_0x20b0d6['model'],qs[_0x0dd6('0x32')](_0x215ca9[_0x0dd6('0x2e')][_0x0dd6('0x32')]));_0x26270e[_0x0dd6('0x33')]=_0x26270e[_0x0dd6('0x33')][_0x0dd6('0x34')]?_0x26270e[_0x0dd6('0x33')]:_0x20b0d6[_0x0dd6('0x31')];if(_0x215ca9[_0x0dd6('0x2e')]['includeAll']){_0x26270e['include']=[{'all':!![]}];}_0x26270e=_[_0x0dd6('0x3b')]({},_0x26270e,_0x215ca9[_0x0dd6('0x45')]);return db[_0x0dd6('0x3c')]['find'](_0x26270e)[_0x0dd6('0x22')](handleEntityNotFound(_0xaa0c7,null))[_0x0dd6('0x22')](respondWithResult(_0xaa0c7,null))[_0x0dd6('0x41')](handleError(_0xaa0c7,null));};exports[_0x0dd6('0x46')]=function(_0x594393,_0x420c23){var _0x18818a={'where':{'id':_0x594393['params']['id']}},_0xd0a2de={};_0xd0a2de[_0x0dd6('0x31')]=_[_0x0dd6('0x44')](db[_0x0dd6('0x3c')]['rawAttributes']);_0x18818a[_0x0dd6('0x33')]=_[_0x0dd6('0x30')](_0xd0a2de[_0x0dd6('0x31')],qs[_0x0dd6('0x32')](_0x594393[_0x0dd6('0x2e')][_0x0dd6('0x32')]));_0x18818a[_0x0dd6('0x33')]=_0x18818a[_0x0dd6('0x33')][_0x0dd6('0x34')]?_0x18818a[_0x0dd6('0x33')]:_0xd0a2de[_0x0dd6('0x31')];if(_0x594393[_0x0dd6('0x2e')][_0x0dd6('0x3d')]){_0x18818a['include']=[{'all':!![]}];}_0x18818a=_['merge']({},_0x18818a,_0x594393['options']);return db['Attachment'][_0x0dd6('0x47')](_0x18818a)[_0x0dd6('0x22')](handleEntityNotFound(_0x420c23,null))[_0x0dd6('0x22')](function(_0x13a00b){if(_0x13a00b){var _0x5ac297=_0x13a00b[_0x0dd6('0x48')]({'plain':!![]});_0x5ac297=qs['omit'](_0x5ac297,['id','createdAt',_0x0dd6('0x49')]);_0x594393[_0x0dd6('0x4a')]=_[_0x0dd6('0x4b')](_0x594393[_0x0dd6('0x4a')],['id',_0x0dd6('0x4c'),'updatedAt']);return db['Attachment'][_0x0dd6('0x4d')](_[_0x0dd6('0x3b')](_0x5ac297,_0x594393['body']),{'include':_0x594393[_0x0dd6('0x2e')][_0x0dd6('0x3d')]?[{'all':!![]}]:undefined});}})[_0x0dd6('0x22')](respondWithResult(_0x420c23,0xc9))['catch'](handleError(_0x420c23,null));};exports['update']=function(_0x5850df,_0x2c3754){if(_0x5850df[_0x0dd6('0x4a')]['id']){delete _0x5850df[_0x0dd6('0x4a')]['id'];}return db[_0x0dd6('0x3c')][_0x0dd6('0x47')]({'where':{'id':_0x5850df[_0x0dd6('0x43')]['id']}})[_0x0dd6('0x22')](handleEntityNotFound(_0x2c3754,null))[_0x0dd6('0x22')](saveUpdates(_0x5850df[_0x0dd6('0x4a')],null))[_0x0dd6('0x22')](respondWithResult(_0x2c3754,null))[_0x0dd6('0x41')](handleError(_0x2c3754,null));};exports['destroy']=function(_0x35e4f2,_0xc9b9b1){return db[_0x0dd6('0x3c')]['find']({'where':{'id':_0x35e4f2[_0x0dd6('0x43')]['id']}})['then'](handleEntityNotFound(_0xc9b9b1,null))[_0x0dd6('0x22')](removeEntity(_0xc9b9b1,null))['catch'](handleError(_0xc9b9b1,null));};exports['create']=function(_0x24b1d9,_0x126f5d,_0x2342a4){_0x24b1d9[_0x0dd6('0x4a')][_0x0dd6('0x27')]=_0x24b1d9[_0x0dd6('0x4e')][_0x0dd6('0x4f')];_0x24b1d9[_0x0dd6('0x4a')][_0x0dd6('0x50')]=_0x24b1d9[_0x0dd6('0x4e')][_0x0dd6('0x51')];_0x24b1d9[_0x0dd6('0x4a')][_0x0dd6('0x2c')]=_0x24b1d9['file'][_0x0dd6('0x52')];return db[_0x0dd6('0x3c')][_0x0dd6('0x4d')](_0x24b1d9[_0x0dd6('0x4a')])[_0x0dd6('0x22')](respondWithResult(_0x126f5d,0xc9))[_0x0dd6('0x41')](handleError(_0x126f5d,null));};exports[_0x0dd6('0x53')]=function(_0x3babc0,_0x23f7db,_0x37e7d8){return db[_0x0dd6('0x3c')][_0x0dd6('0x54')]({'where':{'id':_0x3babc0[_0x0dd6('0x43')]['id']},'raw':!![]})[_0x0dd6('0x22')](handleEntityNotFound(_0x23f7db,null))[_0x0dd6('0x22')](function(_0x5cdf1e){if(_0x5cdf1e){var _0x50a2e4=_0x5cdf1e[_0x0dd6('0x55')]!==null;var _0x4023a2=path[_0x0dd6('0x56')](config['root'],_0x0dd6('0x57'));if(_0x50a2e4){_0x4023a2=path[_0x0dd6('0x56')](_0x4023a2,_0x0dd6('0x58'));}var _0x39e954=path[_0x0dd6('0x56')](_0x4023a2,_0x5cdf1e['basename']);return _0x23f7db[_0x0dd6('0x53')](_0x39e954);}})[_0x0dd6('0x41')](handleError(_0x23f7db,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 5ad9fed..f45d3ce 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 _0x7366=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','attachments','lodash','util'];(function(_0x3452e3,_0x1ba27c){var _0x4e6bd1=function(_0x3f46b1){while(--_0x3f46b1){_0x3452e3['push'](_0x3452e3['shift']());}};_0x4e6bd1(++_0x1ba27c);}(_0x7366,0xbe));var _0x6736=function(_0x7371d,_0x5d145a){_0x7371d=_0x7371d-0x0;var _0x238e70=_0x7366[_0x7371d];return _0x238e70;};'use strict';var _=require(_0x6736('0x0'));var util=require(_0x6736('0x1'));var logger=require(_0x6736('0x2'))(_0x6736('0x3'));var moment=require(_0x6736('0x4'));var BPromise=require(_0x6736('0x5'));var rp=require(_0x6736('0x6'));var fs=require('fs');var path=require(_0x6736('0x7'));var rimraf=require('rimraf');var config=require(_0x6736('0x8'));var attributes=require(_0x6736('0x9'));module[_0x6736('0xa')]=function(_0x7a70f9,_0x50c6b5){return _0x7a70f9['define']('Attachment',attributes,{'tableName':_0x6736('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3310=['path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','util','api','moment','bluebird','request-promise'];(function(_0x495c36,_0x4ada64){var _0x87e294=function(_0x3519d2){while(--_0x3519d2){_0x495c36['push'](_0x495c36['shift']());}};_0x87e294(++_0x4ada64);}(_0x3310,0x7c));var _0x0331=function(_0x2b3be8,_0x2356c3){_0x2b3be8=_0x2b3be8-0x0;var _0x5596d8=_0x3310[_0x2b3be8];return _0x5596d8;};'use strict';var _=require(_0x0331('0x0'));var util=require(_0x0331('0x1'));var logger=require('../../config/logger')(_0x0331('0x2'));var moment=require(_0x0331('0x3'));var BPromise=require(_0x0331('0x4'));var rp=require(_0x0331('0x5'));var fs=require('fs');var path=require(_0x0331('0x6'));var rimraf=require(_0x0331('0x7'));var config=require(_0x0331('0x8'));var attributes=require(_0x0331('0x9'));module['exports']=function(_0x4e5e8c,_0x541f97){return _0x4e5e8c[_0x0331('0xa')](_0x0331('0xb'),attributes,{'tableName':_0x0331('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 44d6cc5..8273eea 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(_0x443093,_0x657163){var _0x5c9622=function(_0x1bb592){while(--_0x1bb592){_0x443093['push'](_0x443093['shift']());}};_0x5c9622(++_0x657163);}(_0xe205,0xa7));var _0x5e20=function(_0x4e5f0d,_0xac055e){_0x4e5f0d=_0x4e5f0d-0x0;var _0x52dcf6=_0xe205[_0x4e5f0d];return _0x52dcf6;};'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 _0x8e0d=['CreateAttachment','Attachment','body','options','raw','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Attachment,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x8e0d,0x82));var _0xd8e0=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0x8e0d[_0x1c5142];return _0x1268cb;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd8e0('0x1'));var rs=require(_0xd8e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8e0('0x3'))['db'];var utils=require(_0xd8e0('0x4'));var logger=require(_0xd8e0('0x5'))(_0xd8e0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8e0('0x7')][_0xd8e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42d42b,_0x1e4616,_0x5e9735){return new BPromise(function(_0xd0c45c,_0x144a8a){return client[_0xd8e0('0x9')](_0x42d42b,_0x5e9735)[_0xd8e0('0xa')](function(_0x127a32){logger['info'](_0xd8e0('0xb'),_0x1e4616,'request\x20sent');logger[_0xd8e0('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1e4616,'request\x20sent',JSON[_0xd8e0('0xd')](_0x127a32));if(_0x127a32[_0xd8e0('0xe')]){if(_0x127a32[_0xd8e0('0xe')]['code']===0x1f4){logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0x144a8a(_0x127a32['error']['message']);}logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0xd0c45c(_0x127a32[_0xd8e0('0xe')][_0xd8e0('0xf')]);}else{logger[_0xd8e0('0x10')](_0xd8e0('0xb'),_0x1e4616,_0xd8e0('0x11'));_0xd0c45c(_0x127a32[_0xd8e0('0x12')][_0xd8e0('0xf')]);}})[_0xd8e0('0x13')](function(_0x488ed9){logger[_0xd8e0('0xe')](_0xd8e0('0xb'),_0x1e4616,_0x488ed9);_0x144a8a(_0x488ed9);});});}exports[_0xd8e0('0x14')]=function(_0x42586f){var _0x3b28bc=this;return new Promise(function(_0x2bf195,_0x2c4eaf){return db[_0xd8e0('0x15')]['create'](_0x42586f[_0xd8e0('0x16')],{'raw':_0x42586f[_0xd8e0('0x17')]?_0x42586f['options'][_0xd8e0('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55ce9b){logger['info'](_0xd8e0('0x14'),_0x42586f);logger[_0xd8e0('0xc')]('CreateAttachment',_0x42586f,JSON[_0xd8e0('0xd')](_0x55ce9b));_0x2bf195(_0x55ce9b);})[_0xd8e0('0x13')](function(_0x1d31de){logger[_0xd8e0('0xe')](_0xd8e0('0x14'),_0x1d31de[_0xd8e0('0xf')],_0x42586f);_0x2c4eaf(_0x3b28bc['error'](0x1f4,_0x1d31de[_0xd8e0('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 1fc9ff1..b57dc92 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x49eb05,_0x4da739){var _0xcc2076=function(_0xb7d987){while(--_0xb7d987){_0x49eb05['push'](_0x49eb05['shift']());}};_0xcc2076(++_0x4da739);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3e3e8d,_0x4b3914){_0x3e3e8d=_0x3e3e8d-0x0;var _0x3d51d4=_0x5f2f[_0x3e3e8d];return _0x3d51d4;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x242711,_0x44fbd3){var _0x45d109=function(_0x251dad){while(--_0x251dad){_0x242711['push'](_0x242711['shift']());}};_0x45d109(++_0x44fbd3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f98c0,_0x4ddddf){_0x1f98c0=_0x1f98c0-0x0;var _0x1cc656=_0xb10b[_0x1f98c0];return _0x1cc656;};'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')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 1673367..5c15922 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 _0xe700=['role','blocked','blockedAt','online','user','agent','disabled','add','minutes','clearBlockUser','getLicense','catch','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt'];(function(_0x6a371d,_0x539e2d){var _0x165a01=function(_0x3a3536){while(--_0x3a3536){_0x6a371d['push'](_0x6a371d['shift']());}};_0x165a01(++_0x539e2d);}(_0xe700,0x75));var _0x0e70=function(_0x591422,_0x3e498c){_0x591422=_0x591422-0x0;var _0x3ca6ce=_0xe700[_0x591422];return _0x3ca6ce;};'use strict';var passport=require(_0x0e70('0x0'));var LocalStrategy=require(_0x0e70('0x1'))[_0x0e70('0x2')];var moment=require(_0x0e70('0x3'));var ActiveDirectory=require(_0x0e70('0x4'));var BPromise=require(_0x0e70('0x5'));var util=require(_0x0e70('0x6'));var db=require(_0x0e70('0x7'))['db'];var authService=require(_0x0e70('0x8'));var utils=require(_0x0e70('0x9'));var config=require('../../config/environment');var logger=require(_0x0e70('0xa'))('api');function isActiveDirectoryConfigured(_0x44a1ee){var _0x30303a=![];if(typeof _0x44a1ee[_0x0e70('0xb')]!==_0x0e70('0xc')){_0x30303a=_0x44a1ee[_0x0e70('0xb')][_0x0e70('0xd')]&&_0x44a1ee[_0x0e70('0xb')][_0x0e70('0xe')]&&_0x44a1ee[_0x0e70('0xb')][_0x0e70('0xf')];}return _0x30303a;}function adAuthenticate(_0x1332a2,_0x32a108,_0x3240d5){return new BPromise(function(_0x1accbb,_0x8a3776){try{var _0x5c5673=new ActiveDirectory(_0x1332a2);_0x5c5673[_0x0e70('0x10')](_0x32a108,_0x3240d5,function(_0x145ae6,_0x2e31f3){if(_0x145ae6){logger['error'](_0x0e70('0x11'),_0x32a108,util[_0x0e70('0x12')](_0x145ae6,{'showHidden':![],'depth':null}));_0x8a3776(_0x0e70('0x13'));}else if(!_0x2e31f3){logger[_0x0e70('0x14')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x32a108);_0x8a3776(_0x0e70('0x13'));}else{_0x1accbb(_0x2e31f3);}});}catch(_0x175bca){_0x8a3776(_0x175bca);}});}function ActiveDirectoryAuthenticate(_0x30660e,_0x58a533,_0x5049ec,_0x1c427a){var _0x4b3e5f,_0x47446b;if(!isActiveDirectoryConfigured(config)){logger[_0x0e70('0x14')](_0x0e70('0x15'),_0x58a533);return _0x1c427a(null,![],{'message':_0x0e70('0x13')});}return db['Setting'][_0x0e70('0x16')]({'where':{'id':0x1},'attributes':[_0x0e70('0x17'),_0x0e70('0x18')],'raw':!![]})[_0x0e70('0x19')](function(_0x13ff53){_0x4b3e5f=_0x13ff53;if(!_0x4b3e5f[_0x0e70('0x17')]){logger['error'](_0x0e70('0x1a'),_0x58a533);throw new Error(_0x0e70('0x13'));}return _0x30660e['findOne']({'attributes':['id',_0x0e70('0x1b'),_0x0e70('0x1c'),_0x0e70('0x1d'),_0x0e70('0x1e'),'disabled',_0x0e70('0x1f'),_0x0e70('0x20'),_0x0e70('0x21')],'where':{'name':_0x58a533,'role':{'$or':['admin',_0x0e70('0x22'),_0x0e70('0x23')]},'adSsoEnabled':!![]}});})['then'](function(_0x3b2d2a){if(!_0x3b2d2a||_0x3b2d2a&&_0x3b2d2a[_0x0e70('0x1b')]!==_0x58a533){throw new Error(_0x0e70('0x13'));}_0x47446b=_0x3b2d2a;var _0x15ee8c=_0x47446b[_0x0e70('0x1b')]+'@'+config[_0x0e70('0xb')][_0x0e70('0xf')];return adAuthenticate(config[_0x0e70('0xb')],_0x15ee8c,_0x5049ec);})[_0x0e70('0x19')](function(_0x1e81c5){if(_0x47446b[_0x0e70('0x24')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x4b3e5f['blockDuration']>0x0){if(_0x47446b[_0x0e70('0x1f')]){if(moment(_0x47446b['blockedAt'])[_0x0e70('0x25')](_0x4b3e5f['blockDuration'],_0x0e70('0x26'))>moment()){throw new Error(_0x0e70('0x13'));}return utils[_0x0e70('0x27')](_0x47446b,0x0,![],null)[_0x0e70('0x19')](function(){return utils[_0x0e70('0x28')](_0x47446b);})[_0x0e70('0x19')](function(){return _0x1c427a(null,_0x47446b);});}else{return utils[_0x0e70('0x28')](_0x47446b)[_0x0e70('0x19')](function(){return _0x1c427a(null,_0x47446b);});}}else{return utils[_0x0e70('0x28')](_0x47446b)[_0x0e70('0x19')](function(){return _0x1c427a(null,_0x47446b);});}})[_0x0e70('0x29')](function(_0x132fe2){return _0x1c427a(null,![],_0x132fe2);});}function handleError(_0xa59504,_0x36bbc5,_0x5e7409){return _0xa59504['status'](_0x36bbc5||0x1f4)[_0x0e70('0x2a')]({'message':_0x5e7409?_0x5e7409[_0x0e70('0x2b')]||_0x5e7409:''});}exports['login']=function(_0x5c9c73,_0x16e6ae,_0xa6e8a3){passport[_0x0e70('0x10')](_0x0e70('0x2c'),function(_0x301383,_0x1498b1,_0x1e35d2){var _0x16cd39=_0x301383||_0x1e35d2;if(_0x16cd39){return handleError(_0x16e6ae,0x191,_0x16cd39);}if(!_0x1498b1){return handleError(_0x16e6ae,0x194,{'message':_0x0e70('0x2d')});}else{var _0xa71a83={'payload':{'id':_0x1498b1['id'],'role':_0x1498b1[_0x0e70('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0x0e70('0x2e')](_0xa71a83)['then'](function(_0x530138){_0x16e6ae[_0x0e70('0x2f')]({'id':_0x1498b1['id'],'token':_0x530138,'statusCall':'','isAlreadyLogged':_0x1498b1[_0x0e70('0x21')]});});}})(_0x5c9c73,_0x16e6ae,_0xa6e8a3);};passport[_0x0e70('0x30')](_0x0e70('0x2c'),new LocalStrategy({'usernameField':'name','passwordField':_0x0e70('0x1c')},function(_0x5f50dd,_0xbba7a0,_0xf7430){return ActiveDirectoryAuthenticate(db['User'],_0x5f50dd,_0xbba7a0,_0xf7430);}));
\ No newline at end of file
+var _0xa12e=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','agent','add','minutes','clearBlockUser','getLicense','status','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect'];(function(_0x291374,_0x1f67b3){var _0x5c62a9=function(_0x4dbf99){while(--_0x4dbf99){_0x291374['push'](_0x291374['shift']());}};_0x5c62a9(++_0x1f67b3);}(_0xa12e,0x138));var _0xea12=function(_0x14c358,_0x522070){_0x14c358=_0x14c358-0x0;var _0x33b11d=_0xa12e[_0x14c358];return _0x33b11d;};'use strict';var passport=require(_0xea12('0x0'));var LocalStrategy=require(_0xea12('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xea12('0x2'));var util=require(_0xea12('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0xea12('0x4'));var utils=require(_0xea12('0x5'));var config=require(_0xea12('0x6'));var logger=require(_0xea12('0x7'))(_0xea12('0x8'));function isActiveDirectoryConfigured(_0x2904ef){var _0x2f325a=![];if(typeof _0x2904ef[_0xea12('0x9')]!==_0xea12('0xa')){_0x2f325a=_0x2904ef[_0xea12('0x9')][_0xea12('0xb')]&&_0x2904ef[_0xea12('0x9')]['url']&&_0x2904ef[_0xea12('0x9')][_0xea12('0xc')];}return _0x2f325a;}function adAuthenticate(_0x13bf70,_0x2398c6,_0x1dd0c6){return new BPromise(function(_0x1eccaf,_0x5494b6){try{var _0x2b65d9=new ActiveDirectory(_0x13bf70);_0x2b65d9[_0xea12('0xd')](_0x2398c6,_0x1dd0c6,function(_0x41c45b,_0x400ce4){if(_0x41c45b){logger[_0xea12('0xe')](_0xea12('0xf'),_0x2398c6,util[_0xea12('0x10')](_0x41c45b,{'showHidden':![],'depth':null}));_0x5494b6(_0xea12('0x11'));}else if(!_0x400ce4){logger[_0xea12('0xe')](_0xea12('0x12'),_0x2398c6);_0x5494b6(_0xea12('0x11'));}else{_0x1eccaf(_0x400ce4);}});}catch(_0x4d3b1d){_0x5494b6(_0x4d3b1d);}});}function ActiveDirectoryAuthenticate(_0x2d3ed6,_0x34aa8f,_0x351852,_0x4f07bb){var _0x369e9b,_0x4e5177;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xea12('0x13'),_0x34aa8f);return _0x4f07bb(null,![],{'message':_0xea12('0x11')});}return db[_0xea12('0x14')][_0xea12('0x15')]({'where':{'id':0x1},'attributes':[_0xea12('0x16'),_0xea12('0x17')],'raw':!![]})[_0xea12('0x18')](function(_0x33f3a5){_0x369e9b=_0x33f3a5;if(!_0x369e9b['adSsoEnabled']){logger['error'](_0xea12('0x19'),_0x34aa8f);throw new Error(_0xea12('0x11'));}return _0x2d3ed6[_0xea12('0x15')]({'attributes':['id',_0xea12('0x1a'),_0xea12('0x1b'),_0xea12('0x1c'),_0xea12('0x1d'),_0xea12('0x1e'),_0xea12('0x1f'),_0xea12('0x20'),_0xea12('0x21')],'where':{'name':_0x34aa8f,'role':{'$or':['admin','user',_0xea12('0x22')]},'adSsoEnabled':!![]}});})[_0xea12('0x18')](function(_0x4c6c39){if(!_0x4c6c39||_0x4c6c39&&_0x4c6c39[_0xea12('0x1a')]!==_0x34aa8f){throw new Error(_0xea12('0x11'));}_0x4e5177=_0x4c6c39;var _0x3b7a01=_0x4e5177[_0xea12('0x1a')]+'@'+config[_0xea12('0x9')]['domain'];return adAuthenticate(config[_0xea12('0x9')],_0x3b7a01,_0x351852);})['then'](function(_0x48104e){if(_0x4e5177['disabled']){throw new Error(_0xea12('0x11'));}if(_0x369e9b[_0xea12('0x17')]>0x0){if(_0x4e5177[_0xea12('0x1f')]){if(moment(_0x4e5177['blockedAt'])[_0xea12('0x23')](_0x369e9b[_0xea12('0x17')],_0xea12('0x24'))>moment()){throw new Error(_0xea12('0x11'));}return utils[_0xea12('0x25')](_0x4e5177,0x0,![],null)['then'](function(){return utils['getLicense'](_0x4e5177);})[_0xea12('0x18')](function(){return _0x4f07bb(null,_0x4e5177);});}else{return utils['getLicense'](_0x4e5177)[_0xea12('0x18')](function(){return _0x4f07bb(null,_0x4e5177);});}}else{return utils[_0xea12('0x26')](_0x4e5177)[_0xea12('0x18')](function(){return _0x4f07bb(null,_0x4e5177);});}})['catch'](function(_0x212258){return _0x4f07bb(null,![],_0x212258);});}function handleError(_0x314ca2,_0x874216,_0x281971){return _0x314ca2[_0xea12('0x27')](_0x874216||0x1f4)[_0xea12('0x28')]({'message':_0x281971?_0x281971[_0xea12('0x29')]||_0x281971:''});}exports['login']=function(_0x14c404,_0xaf7b07,_0x4cf591){passport[_0xea12('0xd')]('ad-login',function(_0x4e8d21,_0x3decbc,_0x3b2ad9){var _0x569930=_0x4e8d21||_0x3b2ad9;if(_0x569930){return handleError(_0xaf7b07,0x191,_0x569930);}if(!_0x3decbc){return handleError(_0xaf7b07,0x194,{'message':_0xea12('0x2a')});}else{var _0x2b8c7f={'payload':{'id':_0x3decbc['id'],'role':_0x3decbc[_0xea12('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0xea12('0x2b')](_0x2b8c7f)[_0xea12('0x18')](function(_0x3fc39c){_0xaf7b07[_0xea12('0x2c')]({'id':_0x3decbc['id'],'token':_0x3fc39c,'statusCall':'','isAlreadyLogged':_0x3decbc['online']});});}})(_0x14c404,_0xaf7b07,_0x4cf591);};passport[_0xea12('0x2d')]('ad-login',new LocalStrategy({'usernameField':_0xea12('0x1a'),'passwordField':_0xea12('0x1b')},function(_0xa44c3e,_0x3d2646,_0x507cb8){return ActiveDirectoryAuthenticate(db[_0xea12('0x2e')],_0xa44c3e,_0x3d2646,_0x507cb8);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index acb1f26..ec0fafd 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 _0x49e6=['express','./authActiveDirectory.controller','post','login','exports'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x49e6,0xd2));var _0x649e=function(_0x31a5db,_0xc073cc){_0x31a5db=_0x31a5db-0x0;var _0x59ffe1=_0x49e6[_0x31a5db];return _0x59ffe1;};'use strict';var express=require(_0x649e('0x0'));var router=express['Router']();var controller=require(_0x649e('0x1'));router[_0x649e('0x2')]('/',controller[_0x649e('0x3')]);module[_0x649e('0x4')]=router;
\ No newline at end of file
+var _0x0d1c=['./authActiveDirectory.controller','post','login'];(function(_0x20f0b0,_0x431f47){var _0x1c94a5=function(_0x5c2757){while(--_0x5c2757){_0x20f0b0['push'](_0x20f0b0['shift']());}};_0x1c94a5(++_0x431f47);}(_0x0d1c,0xed));var _0xc0d1=function(_0x45dbd5,_0x293cc4){_0x45dbd5=_0x45dbd5-0x0;var _0x393dfe=_0x0d1c[_0x45dbd5];return _0x393dfe;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xc0d1('0x0'));router[_0xc0d1('0x1')]('/',controller[_0xc0d1('0x2')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index dbbf653..47d3a04 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(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x7a54,0x106));var _0x47a5=function(_0x562ba0,_0x52f234){_0x562ba0=_0x562ba0-0x0;var _0xd0a256=_0x7a54[_0x562ba0];return _0xd0a256;};'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 _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(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x7a54,0x106));var _0x47a5=function(_0x2f8801,_0x131c81){_0x2f8801=_0x2f8801-0x0;var _0x3358ea=_0x7a54[_0x2f8801];return _0x3358ea;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 7befeb6..fe5ca57 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 _0x465b=['callback','isMiddleware','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x1c8c2f,_0x1d99fe){var _0x24fa67=function(_0x15fd50){while(--_0x15fd50){_0x1c8c2f['push'](_0x1c8c2f['shift']());}};_0x24fa67(++_0x1d99fe);}(_0x465b,0x1dc));var _0xb465=function(_0x6e96cb,_0x2c9290){_0x6e96cb=_0x6e96cb-0x0;var _0x399691=_0x465b[_0x6e96cb];return _0x399691;};'use strict';var express=require(_0xb465('0x0'));var passport=require(_0xb465('0x1'));var router=express['Router']();var controller=require(_0xb465('0x2'));var userController=require(_0xb465('0x3'));var authService=require(_0xb465('0x4'));router[_0xb465('0x5')]('/',controller[_0xb465('0x6')]);router['get'](_0xb465('0x7'),controller[_0xb465('0x8')],authService[_0xb465('0x9')],userController[_0xb465('0x6')],authService['setTokenCookie']);module[_0xb465('0xa')]=router;
\ No newline at end of file
+var _0x1c34=['setTokenCookie','exports','express','passport','./authGoogle.controller','get','login','/callback','callback'];(function(_0x401b51,_0x5a05c1){var _0x395ae6=function(_0x1337fa){while(--_0x1337fa){_0x401b51['push'](_0x401b51['shift']());}};_0x395ae6(++_0x5a05c1);}(_0x1c34,0x65));var _0x41c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c34[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x41c3('0x0'));var passport=require(_0x41c3('0x1'));var router=express['Router']();var controller=require(_0x41c3('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x41c3('0x3')]('/',controller[_0x41c3('0x4')]);router[_0x41c3('0x3')](_0x41c3('0x5'),controller[_0x41c3('0x6')],authService['isMiddleware'],userController[_0x41c3('0x4')],authService[_0x41c3('0x7')]);module[_0x41c3('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index baf59fd..502a4fd 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 _0xdec7=['generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','previousPasswords','save','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blocked','blockedAt','catch','MailAccount','find','email','Smtp','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0xdec7,0x1c0));var _0x7dec=function(_0x6cfa99,_0x513821){_0x6cfa99=_0x6cfa99-0x0;var _0x3d3555=_0xdec7[_0x6cfa99];return _0x3d3555;};'use strict';var util=require(_0x7dec('0x0'));var passport=require('passport');var LocalStrategy=require(_0x7dec('0x1'))['Strategy'];var jayson=require(_0x7dec('0x2'));var _=require(_0x7dec('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x7dec('0x4'))['db'];var authService=require(_0x7dec('0x5'));var utils=require(_0x7dec('0x6'));var client=jayson[_0x7dec('0x7')][_0x7dec('0x8')]({'port':0x232b});function localAuthenticate(_0x14ca92,_0xdce360,_0x165760,_0xf94e51){var _0x3b9985,_0xefe553;return db[_0x7dec('0x9')][_0x7dec('0xa')]({'where':{'id':0x1},'attributes':[_0x7dec('0xb'),_0x7dec('0xc')],'raw':!![]})[_0x7dec('0xd')](function(_0x3610cb){_0x3b9985=_0x3610cb;return _0x14ca92[_0x7dec('0xa')]({'attributes':['id',_0x7dec('0xe'),_0x7dec('0xf'),_0x7dec('0x10'),_0x7dec('0x11'),_0x7dec('0x12'),'blocked','blockedAt','loginAttempts'],'where':{'name':_0xdce360,'role':{'$or':[_0x7dec('0x13'),'user',_0x7dec('0x14')]}}});})['then'](function(_0x5e3f4f){if(!_0x5e3f4f||_0x5e3f4f&&_0x5e3f4f['name']!==_0xdce360){throw new Error(_0x7dec('0x15'));}else{_0xefe553=_0x5e3f4f;return _0xefe553;}})[_0x7dec('0xd')](function(){_0xefe553[_0x7dec('0x16')](_0x165760,function(_0x233f0f,_0x4a2959){var _0x3e4745=_0xefe553[_0x7dec('0x17')]+0x1;if(_0x233f0f){return _0xf94e51(_0x233f0f);}else if(!_0x4a2959){if(_0xefe553[_0x7dec('0x12')]){return _0xf94e51(null,![],{'message':_0x7dec('0x15')});}else if(_0x3b9985[_0x7dec('0xb')]>0x0){if(_0xefe553['blocked']){if(_0x3b9985[_0x7dec('0xc')]>0x0){if(moment(_0xefe553['blockedAt'])[_0x7dec('0x18')](_0x3b9985['blockDuration'],_0x7dec('0x19'))>moment()){return _0xf94e51(null,![],{'message':_0x7dec('0x15')});}else{return utils[_0x7dec('0x1a')](_0xefe553,_0x3e4745,![],null)[_0x7dec('0xd')](function(){return _0xf94e51(null,![],{'message':_0x7dec('0x15')});});}}else{return _0xf94e51(null,![],{'message':_0x7dec('0x15')});}}else{if(_0x3e4745>=_0x3b9985[_0x7dec('0xb')]){return utils['clearBlockUser'](_0xefe553,0x0,!![],moment())[_0x7dec('0xd')](function(){return _0xf94e51(null,![],{'message':_0x7dec('0x15')});});}else{return utils['clearBlockUser'](_0xefe553,_0x3e4745,![],null)[_0x7dec('0xd')](function(){return _0xf94e51(null,![],{'message':_0x7dec('0x15')});});}}}else{return _0xf94e51(null,![],{'message':_0x7dec('0x15')});}}else{if(_0xefe553['disabled']){return _0xf94e51(null,![],{'message':_0x7dec('0x15')});}else if(_0x3b9985[_0x7dec('0xb')]>0x0){if(_0xefe553[_0x7dec('0x1b')]){if(_0x3b9985[_0x7dec('0xc')]>0x0){if(moment(_0xefe553[_0x7dec('0x1c')])[_0x7dec('0x18')](_0x3b9985['blockDuration'],_0x7dec('0x19'))>moment()){return _0xf94e51(null,![],{'message':_0x7dec('0x15')});}else{return utils[_0x7dec('0x1a')](_0xefe553,0x0,![],null)[_0x7dec('0xd')](function(){return utils['getLicense'](_0xefe553);})[_0x7dec('0xd')](function(){return _0xf94e51(null,_0xefe553);});}}else{return _0xf94e51(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x7dec('0x1a')](_0xefe553,0x0,![],null)[_0x7dec('0xd')](function(){return utils['getLicense'](_0xefe553);})[_0x7dec('0xd')](function(){return _0xf94e51(null,_0xefe553);})['catch'](function(_0x357024){return _0xf94e51(null,![],_0x357024);});}}else{if(_0xefe553[_0x7dec('0x1b')]){return _0xf94e51(null,![],{'message':_0x7dec('0x15')});}else{return utils['getLicense'](_0xefe553)['then'](function(){return _0xf94e51(null,_0xefe553);});}}}});})[_0x7dec('0x1d')](function(_0x1b8b27){return _0xf94e51(null,![],_0x1b8b27);});}function sendServiceMail(_0x518213){return db[_0x7dec('0x1e')][_0x7dec('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x7dec('0xe'),_0x7dec('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x7dec('0x21'),'include':[{'model':db[_0x7dec('0x22')],'as':_0x7dec('0x22')}]}]})[_0x7dec('0xd')](function(_0x593b51){if(!_0x593b51){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3620dd=_0x593b51[_0x7dec('0x23')]();var _0x4560a8={'account':_0x3620dd,'message':_[_0x7dec('0x24')]({'from':util[_0x7dec('0x25')](_0x7dec('0x26'),_0x593b51[_0x7dec('0xe')],_0x593b51[_0x7dec('0x20')]||_0x593b51[_0x7dec('0x21')][_0x7dec('0x27')])},_0x518213)};return client[_0x7dec('0x28')](_0x7dec('0x29'),_0x4560a8);})[_0x7dec('0xd')](function(_0x1476bc){if(_0x1476bc[_0x7dec('0x2a')]){throw new Error(util[_0x7dec('0x25')](_0x7dec('0x2b'),_0x1476bc['error'][_0x7dec('0x2c')]||JSON[_0x7dec('0x2d')](_0x1476bc[_0x7dec('0x2a')])));}return!![];});}function handleError(_0x35159c,_0x4cd4de,_0x211404){return _0x35159c['status'](_0x4cd4de||0x1f4)[_0x7dec('0x2e')]({'message':_0x211404?_0x211404[_0x7dec('0x2c')]||_0x211404:''});}exports[_0x7dec('0x2f')]=function(_0x67ebe5,_0x57df8e,_0x1d2086){passport[_0x7dec('0x16')](_0x7dec('0x30'),function(_0x6a2a5c,_0x424c69,_0x5c5339){var _0x20ba17=_0x6a2a5c||_0x5c5339;if(_0x20ba17){return handleError(_0x57df8e,0x191,_0x20ba17);}if(!_0x424c69){return handleError(_0x57df8e,0x194,{'message':_0x7dec('0x31')});}else{var _0x2f92e8={'payload':{'id':_0x424c69['id'],'role':_0x424c69[_0x7dec('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x7dec('0x32')](_0x2f92e8)[_0x7dec('0xd')](function(_0x148d3b){_0x57df8e[_0x7dec('0x33')]({'id':_0x424c69['id'],'token':_0x148d3b,'statusCall':'','isAlreadyLogged':_0x424c69[_0x7dec('0x34')]});});}})(_0x67ebe5,_0x57df8e,_0x1d2086);};exports[_0x7dec('0x35')]=function(_0xa73c05,_0xfd658a){if(!_0xa73c05[_0x7dec('0x36')][_0x7dec('0x20')]){return handleError(_0xfd658a,0x1f4,{'message':_0x7dec('0x37')});}var _0x5d830d=rs[_0x7dec('0x38')]();_0xa73c05[_0x7dec('0x36')][_0x7dec('0x20')]=_0xa73c05['body'][_0x7dec('0x20')]['trim']()[_0x7dec('0x39')]();var _0x5a5b10;return db['Setting'][_0x7dec('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x7dec('0xc')],'raw':!![]})['then'](function(_0x123ddd){_0x5a5b10=_0x123ddd;return db[_0x7dec('0x3a')][_0x7dec('0x1f')]({'where':{'email':_0xa73c05[_0x7dec('0x36')]['email']}});})[_0x7dec('0xd')](function(_0x1df28a){if(!_0x1df28a){throw new Error(_0x7dec('0x3b'));}if(_0x1df28a[_0x7dec('0x12')]){throw new Error(_0x7dec('0x3c'));}if(_0x1df28a['blocked']){if(moment(_0x1df28a[_0x7dec('0x1c')])[_0x7dec('0x18')](_0x5a5b10[_0x7dec('0xc')],_0x7dec('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x1df28a['blocked']=![];_0x1df28a['blockedAt']=null;}}_0x1df28a[_0x7dec('0x3d')]=_0x5d830d;_0x1df28a[_0x7dec('0x3e')]=Date[_0x7dec('0x3f')]()+0x36ee80;return _0x1df28a['save']();})[_0x7dec('0xd')](function(){return sendServiceMail({'to':_0xa73c05[_0x7dec('0x36')][_0x7dec('0x20')],'subject':_0x7dec('0x40'),'text':_0x7dec('0x41')+_0x7dec('0x42')+'https://'+_0xa73c05[_0x7dec('0x43')]['host']+_0x7dec('0x44')+_0x5d830d+'\x0a\x0a'+_0x7dec('0x45')});})['then'](function(){_0xfd658a[_0x7dec('0x46')](0xc8)[_0x7dec('0x2e')]({'message':_0x7dec('0x47')});})[_0x7dec('0x1d')](function(_0x1004ff){return handleError(_0xfd658a,0x1f4,_0x1004ff);});};exports[_0x7dec('0x48')]=function(_0x5e50f0,_0x2d5c29){return db[_0x7dec('0x3a')][_0x7dec('0x1f')]({'where':{'resetPasswordToken':_0x5e50f0[_0x7dec('0x49')][_0x7dec('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x7dec('0x3f')]()}}})[_0x7dec('0xd')](function(_0x17bae4){if(!_0x17bae4){throw new Error(_0x7dec('0x4b'));}return db[_0x7dec('0x9')][_0x7dec('0xa')]({'attributes':['id',_0x7dec('0x4c'),'enforcePasswordHistory',_0x7dec('0x4d')]})[_0x7dec('0xd')](function(_0x704590){if(_0x704590['securePassword'])authService['validatePasswordPattern'](_0x5e50f0['body']['password']);if(!_0x704590[_0x7dec('0x4e')]||!_0x17bae4['previousPasswords'])return _0x17bae4;authService[_0x7dec('0x4f')](_0x5e50f0[_0x7dec('0x36')][_0x7dec('0xf')],_0x17bae4[_0x7dec('0x50')],_0x704590['passwordHistoryLimit']);return _0x17bae4;})[_0x7dec('0xd')](function(){_0x17bae4[_0x7dec('0xf')]=_0x5e50f0[_0x7dec('0x36')][_0x7dec('0xf')];_0x17bae4['resetPasswordToken']=null;_0x17bae4['resetPasswordExpires']=null;return _0x17bae4[_0x7dec('0x51')]();});})[_0x7dec('0xd')](function(){_0x2d5c29['status'](0xc8)[_0x7dec('0x2e')]({'message':_0x7dec('0x52')});})[_0x7dec('0x1d')](function(_0x5662e9){return handleError(_0x2d5c29,0x1f4,_0x5662e9);});};passport[_0x7dec('0x53')]('local-login',new LocalStrategy({'usernameField':_0x7dec('0xe'),'passwordField':_0x7dec('0xf')},function(_0x18b230,_0x38e2d5,_0x191b37){return localAuthenticate(db[_0x7dec('0x3a')],_0x18b230,_0x38e2d5,_0x191b37);}));
\ No newline at end of file
+var _0x6f05=['Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','disabled','blockedAt','loginAttempts','admin','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','clearBlockUser','getLicense','catch','MailAccount','find','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','online','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\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','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','password','passwordHistoryLimit','resetPasswordToken','send','Password\x20reset!','use','util','passport'];(function(_0x14259b,_0x588942){var _0x5d87fa=function(_0x2164e9){while(--_0x2164e9){_0x14259b['push'](_0x14259b['shift']());}};_0x5d87fa(++_0x588942);}(_0x6f05,0x19d));var _0x56f0=function(_0x278ab8,_0x16c13f){_0x278ab8=_0x278ab8-0x0;var _0x3995c7=_0x6f05[_0x278ab8];return _0x3995c7;};'use strict';var util=require(_0x56f0('0x0'));var passport=require(_0x56f0('0x1'));var LocalStrategy=require('passport-local')[_0x56f0('0x2')];var jayson=require(_0x56f0('0x3'));var _=require(_0x56f0('0x4'));var rs=require(_0x56f0('0x5'));var moment=require(_0x56f0('0x6'));var db=require(_0x56f0('0x7'))['db'];var authService=require(_0x56f0('0x8'));var utils=require('../../config/utils');var client=jayson['client'][_0x56f0('0x9')]({'port':0x232b});function localAuthenticate(_0x3db8c1,_0x7a7753,_0x280863,_0x28ded5){var _0x4a9abf,_0x3891f2;return db[_0x56f0('0xa')][_0x56f0('0xb')]({'where':{'id':0x1},'attributes':[_0x56f0('0xc'),_0x56f0('0xd')],'raw':!![]})[_0x56f0('0xe')](function(_0x1a47f4){_0x4a9abf=_0x1a47f4;return _0x3db8c1[_0x56f0('0xb')]({'attributes':['id','name','password','salt','role',_0x56f0('0xf'),'blocked',_0x56f0('0x10'),_0x56f0('0x11')],'where':{'name':_0x7a7753,'role':{'$or':[_0x56f0('0x12'),'user',_0x56f0('0x13')]}}});})[_0x56f0('0xe')](function(_0x5aadc7){if(!_0x5aadc7||_0x5aadc7&&_0x5aadc7['name']!==_0x7a7753){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3891f2=_0x5aadc7;return _0x3891f2;}})[_0x56f0('0xe')](function(){_0x3891f2[_0x56f0('0x14')](_0x280863,function(_0x2be8c7,_0x4b3b7f){var _0x5add3d=_0x3891f2['loginAttempts']+0x1;if(_0x2be8c7){return _0x28ded5(_0x2be8c7);}else if(!_0x4b3b7f){if(_0x3891f2[_0x56f0('0xf')]){return _0x28ded5(null,![],{'message':_0x56f0('0x15')});}else if(_0x4a9abf[_0x56f0('0xc')]>0x0){if(_0x3891f2[_0x56f0('0x16')]){if(_0x4a9abf[_0x56f0('0xd')]>0x0){if(moment(_0x3891f2['blockedAt'])['add'](_0x4a9abf[_0x56f0('0xd')],_0x56f0('0x17'))>moment()){return _0x28ded5(null,![],{'message':_0x56f0('0x15')});}else{return utils[_0x56f0('0x18')](_0x3891f2,_0x5add3d,![],null)['then'](function(){return _0x28ded5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x28ded5(null,![],{'message':_0x56f0('0x15')});}}else{if(_0x5add3d>=_0x4a9abf[_0x56f0('0xc')]){return utils[_0x56f0('0x18')](_0x3891f2,0x0,!![],moment())['then'](function(){return _0x28ded5(null,![],{'message':_0x56f0('0x15')});});}else{return utils[_0x56f0('0x18')](_0x3891f2,_0x5add3d,![],null)[_0x56f0('0xe')](function(){return _0x28ded5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x28ded5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3891f2['disabled']){return _0x28ded5(null,![],{'message':_0x56f0('0x15')});}else if(_0x4a9abf['allowedLoginAttempts']>0x0){if(_0x3891f2[_0x56f0('0x16')]){if(_0x4a9abf[_0x56f0('0xd')]>0x0){if(moment(_0x3891f2[_0x56f0('0x10')])['add'](_0x4a9abf[_0x56f0('0xd')],_0x56f0('0x17'))>moment()){return _0x28ded5(null,![],{'message':_0x56f0('0x15')});}else{return utils['clearBlockUser'](_0x3891f2,0x0,![],null)[_0x56f0('0xe')](function(){return utils[_0x56f0('0x19')](_0x3891f2);})[_0x56f0('0xe')](function(){return _0x28ded5(null,_0x3891f2);});}}else{return _0x28ded5(null,![],{'message':_0x56f0('0x15')});}}else{return utils[_0x56f0('0x18')](_0x3891f2,0x0,![],null)['then'](function(){return utils[_0x56f0('0x19')](_0x3891f2);})['then'](function(){return _0x28ded5(null,_0x3891f2);})[_0x56f0('0x1a')](function(_0xed53dd){return _0x28ded5(null,![],_0xed53dd);});}}else{if(_0x3891f2[_0x56f0('0x16')]){return _0x28ded5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x56f0('0x19')](_0x3891f2)[_0x56f0('0xe')](function(){return _0x28ded5(null,_0x3891f2);});}}}});})[_0x56f0('0x1a')](function(_0x4f6044){return _0x28ded5(null,![],_0x4f6044);});}function sendServiceMail(_0x1062ec){return db[_0x56f0('0x1b')][_0x56f0('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x56f0('0x1d'),_0x56f0('0x1e')],'include':[{'model':db[_0x56f0('0x1f')],'as':_0x56f0('0x20'),'include':[{'model':db[_0x56f0('0x21')],'as':'CloudProvider'}]}]})[_0x56f0('0xe')](function(_0x57646f){if(!_0x57646f){throw new Error(_0x56f0('0x22'));}var _0x4886ff=_0x57646f[_0x56f0('0x23')]();var _0x2bf235={'account':_0x4886ff,'message':_[_0x56f0('0x24')]({'from':util[_0x56f0('0x25')](_0x56f0('0x26'),_0x57646f[_0x56f0('0x1d')],_0x57646f[_0x56f0('0x1e')]||_0x57646f[_0x56f0('0x20')]['user'])},_0x1062ec)};return client[_0x56f0('0x27')]('SendMail',_0x2bf235);})[_0x56f0('0xe')](function(_0x25fd0e){if(_0x25fd0e[_0x56f0('0x28')]){throw new Error(util[_0x56f0('0x25')](_0x56f0('0x29'),_0x25fd0e[_0x56f0('0x28')][_0x56f0('0x2a')]||JSON['stringify'](_0x25fd0e[_0x56f0('0x28')])));}return!![];});}function handleError(_0x3c4a8,_0x14dd57,_0x1e6ecf){return _0x3c4a8[_0x56f0('0x2b')](_0x14dd57||0x1f4)['send']({'message':_0x1e6ecf?_0x1e6ecf[_0x56f0('0x2a')]||_0x1e6ecf:''});}exports[_0x56f0('0x2c')]=function(_0x22f597,_0x5caf6d,_0x53f5ef){passport[_0x56f0('0x14')](_0x56f0('0x2d'),function(_0x46473b,_0x2a0184,_0xff3266){var _0x14e204=_0x46473b||_0xff3266;if(_0x14e204){return handleError(_0x5caf6d,0x191,_0x14e204);}if(!_0x2a0184){return handleError(_0x5caf6d,0x194,{'message':_0x56f0('0x2e')});}else{var _0xaadca1={'payload':{'id':_0x2a0184['id'],'role':_0x2a0184[_0x56f0('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x56f0('0x30')](_0xaadca1)[_0x56f0('0xe')](function(_0x4ada2e){_0x5caf6d['json']({'id':_0x2a0184['id'],'token':_0x4ada2e,'statusCall':'','isAlreadyLogged':_0x2a0184[_0x56f0('0x31')]});});}})(_0x22f597,_0x5caf6d,_0x53f5ef);};exports['forgot']=function(_0x34d1f2,_0x1b922f){if(!_0x34d1f2[_0x56f0('0x32')][_0x56f0('0x1e')]){return handleError(_0x1b922f,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xe945c2=rs[_0x56f0('0x33')]();_0x34d1f2[_0x56f0('0x32')][_0x56f0('0x1e')]=_0x34d1f2[_0x56f0('0x32')][_0x56f0('0x1e')][_0x56f0('0x34')]()[_0x56f0('0x35')]();var _0x2137be;return db[_0x56f0('0xa')][_0x56f0('0xb')]({'where':{'id':0x1},'attributes':[_0x56f0('0xc'),'blockDuration'],'raw':!![]})[_0x56f0('0xe')](function(_0x1c25de){_0x2137be=_0x1c25de;return db[_0x56f0('0x36')][_0x56f0('0x1c')]({'where':{'email':_0x34d1f2[_0x56f0('0x32')][_0x56f0('0x1e')]}});})[_0x56f0('0xe')](function(_0x136b2f){if(!_0x136b2f){throw new Error(_0x56f0('0x37'));}if(_0x136b2f[_0x56f0('0xf')]){throw new Error(_0x56f0('0x38'));}if(_0x136b2f[_0x56f0('0x16')]){if(moment(_0x136b2f[_0x56f0('0x10')])[_0x56f0('0x39')](_0x2137be[_0x56f0('0xd')],_0x56f0('0x17'))>moment()){throw new Error(_0x56f0('0x3a'));}else{_0x136b2f['blocked']=![];_0x136b2f['blockedAt']=null;}}_0x136b2f['resetPasswordToken']=_0xe945c2;_0x136b2f[_0x56f0('0x3b')]=Date['now']()+0x36ee80;return _0x136b2f[_0x56f0('0x3c')]();})['then'](function(){return sendServiceMail({'to':_0x34d1f2[_0x56f0('0x32')][_0x56f0('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x56f0('0x3d')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x56f0('0x3e')+_0x34d1f2[_0x56f0('0x3f')]['host']+_0x56f0('0x40')+_0xe945c2+'\x0a\x0a'+_0x56f0('0x41')});})['then'](function(){_0x1b922f[_0x56f0('0x2b')](0xc8)['send']({'message':_0x56f0('0x42')});})[_0x56f0('0x1a')](function(_0x5bdd2d){return handleError(_0x1b922f,0x1f4,_0x5bdd2d);});};exports[_0x56f0('0x43')]=function(_0x400ce7,_0xb433a4){return db[_0x56f0('0x36')][_0x56f0('0x1c')]({'where':{'resetPasswordToken':_0x400ce7[_0x56f0('0x44')][_0x56f0('0x45')],'resetPasswordExpires':{'$gt':Date[_0x56f0('0x46')]()}}})['then'](function(_0x1701b7){if(!_0x1701b7){throw new Error(_0x56f0('0x47'));}return db['Setting']['findOne']({'attributes':['id',_0x56f0('0x48'),_0x56f0('0x49'),'passwordHistoryLimit']})[_0x56f0('0xe')](function(_0xc19e37){if(_0xc19e37[_0x56f0('0x48')])authService[_0x56f0('0x4a')](_0x400ce7[_0x56f0('0x32')]['password']);if(!_0xc19e37['enforcePasswordHistory']||!_0x1701b7[_0x56f0('0x4b')])return _0x1701b7;authService[_0x56f0('0x4c')](_0x400ce7[_0x56f0('0x32')][_0x56f0('0x4d')],_0x1701b7['previousPasswords'],_0xc19e37[_0x56f0('0x4e')]);return _0x1701b7;})['then'](function(){_0x1701b7[_0x56f0('0x4d')]=_0x400ce7[_0x56f0('0x32')]['password'];_0x1701b7[_0x56f0('0x4f')]=null;_0x1701b7[_0x56f0('0x3b')]=null;return _0x1701b7[_0x56f0('0x3c')]();});})[_0x56f0('0xe')](function(){_0xb433a4[_0x56f0('0x2b')](0xc8)[_0x56f0('0x50')]({'message':_0x56f0('0x51')});})[_0x56f0('0x1a')](function(_0x3114e5){return handleError(_0xb433a4,0x1f4,_0x3114e5);});};passport[_0x56f0('0x52')](_0x56f0('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0x56f0('0x4d')},function(_0x4cc98b,_0x54d95b,_0x43159b){return localAuthenticate(db[_0x56f0('0x36')],_0x4cc98b,_0x54d95b,_0x43159b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index feba6dd..e068f45 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 _0xd397=['post','forgot','/reset/:token','exports','express','Router','./authLocal.controller'];(function(_0x3b05bc,_0x557573){var _0x2c8f51=function(_0x45afb7){while(--_0x45afb7){_0x3b05bc['push'](_0x3b05bc['shift']());}};_0x2c8f51(++_0x557573);}(_0xd397,0xcf));var _0x7d39=function(_0x3f8314,_0x165b04){_0x3f8314=_0x3f8314-0x0;var _0x515a78=_0xd397[_0x3f8314];return _0x515a78;};'use strict';var express=require(_0x7d39('0x0'));var router=express[_0x7d39('0x1')]();var controller=require(_0x7d39('0x2'));router['post']('/',controller['login']);router[_0x7d39('0x3')]('/forgot',controller[_0x7d39('0x4')]);router[_0x7d39('0x3')](_0x7d39('0x5'),controller['reset']);module[_0x7d39('0x6')]=router;
\ No newline at end of file
+var _0x9004=['express','Router','./authLocal.controller','post','login','/reset/:token','exports'];(function(_0x571541,_0x3b6dc0){var _0x2a729f=function(_0x12c1ee){while(--_0x12c1ee){_0x571541['push'](_0x571541['shift']());}};_0x2a729f(++_0x3b6dc0);}(_0x9004,0x196));var _0x4900=function(_0x21949d,_0x220ac2){_0x21949d=_0x21949d-0x0;var _0x3989d8=_0x9004[_0x21949d];return _0x3989d8;};'use strict';var express=require(_0x4900('0x0'));var router=express[_0x4900('0x1')]();var controller=require(_0x4900('0x2'));router[_0x4900('0x3')]('/',controller[_0x4900('0x4')]);router['post']('/forgot',controller['forgot']);router[_0x4900('0x3')](_0x4900('0x5'),controller['reset']);module[_0x4900('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 890c478..1e8430d 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 _0xccf7=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1999c4,_0x39059f){var _0x4afd7d=function(_0x846a7a){while(--_0x846a7a){_0x1999c4['push'](_0x1999c4['shift']());}};_0x4afd7d(++_0x39059f);}(_0xccf7,0xd7));var _0x7ccf=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0xccf7[_0x16938f];return _0x5c66e9;};'use strict';var Sequelize=require(_0x7ccf('0x0'));module[_0x7ccf('0x1')]={'name':{'type':Sequelize[_0x7ccf('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7ccf('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x7ccf('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7ccf('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xb8f4=['exports','STRING','sequelize'];(function(_0x200c4c,_0x3fb6d3){var _0x3c43c9=function(_0x2af216){while(--_0x2af216){_0x200c4c['push'](_0x200c4c['shift']());}};_0x3c43c9(++_0x3fb6d3);}(_0xb8f4,0x104));var _0x4b8f=function(_0x2fc4b4,_0x243370){_0x2fc4b4=_0x2fc4b4-0x0;var _0x346113=_0xb8f4[_0x2fc4b4];return _0x346113;};'use strict';var Sequelize=require(_0x4b8f('0x0'));module[_0x4b8f('0x1')]={'name':{'type':Sequelize[_0x4b8f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x4b8f('0x2')]},'description':{'type':Sequelize[_0x4b8f('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 3136829..7e2f28c 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 _0xa4c4=['ids','Condition','nolimit','getConditions','addActions','Action','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','includeAll','options','create','body','find','addConditions','omit'];(function(_0x403328,_0x519fb9){var _0x3e3162=function(_0x5d3bd9){while(--_0x5d3bd9){_0x403328['push'](_0x403328['shift']());}};_0x3e3162(++_0x519fb9);}(_0xa4c4,0x163));var _0x4a4c=function(_0x4037ac,_0x260423){_0x4037ac=_0x4037ac-0x0;var _0x1d17b5=_0xa4c4[_0x4037ac];return _0x1d17b5;};'use strict';var emlformat=require(_0x4a4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a4c('0x1'));var jsonpatch=require(_0x4a4c('0x2'));var rp=require(_0x4a4c('0x3'));var moment=require(_0x4a4c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4a4c('0x5'));var util=require(_0x4a4c('0x6'));var path=require(_0x4a4c('0x7'));var sox=require(_0x4a4c('0x8'));var csv=require('to-csv');var ejs=require(_0x4a4c('0x9'));var fs=require('fs');var fs_extra=require(_0x4a4c('0xa'));var _=require(_0x4a4c('0xb'));var squel=require(_0x4a4c('0xc'));var crypto=require(_0x4a4c('0xd'));var jsforce=require(_0x4a4c('0xe'));var deskjs=require(_0x4a4c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4a4c('0x10'));var Papa=require('papaparse');var Redis=require(_0x4a4c('0x11'));var authService=require(_0x4a4c('0x12'));var qs=require(_0x4a4c('0x13'));var as=require(_0x4a4c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a4c('0x15'))(_0x4a4c('0x16'));var utils=require(_0x4a4c('0x17'));var config=require(_0x4a4c('0x18'));var licenseUtil=require(_0x4a4c('0x19'));var db=require(_0x4a4c('0x1a'))['db'];function respondWithStatusCode(_0x3dfce4,_0xb7c1ff){_0xb7c1ff=_0xb7c1ff||0xcc;return function(_0x1c5d5a){if(_0x1c5d5a){return _0x3dfce4[_0x4a4c('0x1b')](_0xb7c1ff);}return _0x3dfce4[_0x4a4c('0x1c')](_0xb7c1ff)[_0x4a4c('0x1d')]();};}function respondWithResult(_0xbd55a8,_0x22b0b5){_0x22b0b5=_0x22b0b5||0xc8;return function(_0x1c6261){if(_0x1c6261){return _0xbd55a8[_0x4a4c('0x1c')](_0x22b0b5)['json'](_0x1c6261);}};}function respondWithFilteredResult(_0x394e82,_0xb427af){return function(_0x478df3){if(_0x478df3){var _0x2c95bd=typeof _0xb427af[_0x4a4c('0x1e')]===_0x4a4c('0x1f')&&typeof _0xb427af[_0x4a4c('0x20')]===_0x4a4c('0x1f');var _0x5462b1=_0x478df3[_0x4a4c('0x21')];var _0x374f9f=_0x2c95bd?0x0:_0xb427af[_0x4a4c('0x1e')];var _0x79eaa7=_0x2c95bd?_0x478df3[_0x4a4c('0x21')]:_0xb427af[_0x4a4c('0x1e')]+_0xb427af[_0x4a4c('0x20')];var _0x115fa3;if(_0x79eaa7>=_0x5462b1){_0x79eaa7=_0x5462b1;_0x115fa3=0xc8;}else{_0x115fa3=0xce;}_0x394e82['status'](_0x115fa3);return _0x394e82['set'](_0x4a4c('0x22'),_0x374f9f+'-'+_0x79eaa7+'/'+_0x5462b1)[_0x4a4c('0x23')](_0x478df3);}return null;};}function patchUpdates(_0x2dcb69){return function(_0x10b9ea){try{jsonpatch['apply'](_0x10b9ea,_0x2dcb69,!![]);}catch(_0x80284f){return BPromise[_0x4a4c('0x24')](_0x80284f);}return _0x10b9ea[_0x4a4c('0x25')]();};}function saveUpdates(_0x25e59d,_0x46ce64){return function(_0x13b723){if(_0x13b723){return _0x13b723[_0x4a4c('0x26')](_0x25e59d)['then'](function(_0xbd696e){return _0xbd696e;});}return null;};}function removeEntity(_0x18685e,_0x4662b9){return function(_0x5d9ab8){if(_0x5d9ab8){return _0x5d9ab8[_0x4a4c('0x27')]()[_0x4a4c('0x28')](function(){_0x18685e[_0x4a4c('0x1c')](0xcc)[_0x4a4c('0x1d')]();});}};}function handleEntityNotFound(_0x591885,_0x13819f){return function(_0x55f01d){if(!_0x55f01d){_0x591885[_0x4a4c('0x1b')](0x194);}return _0x55f01d;};}function handleError(_0x4b56cb,_0x244632){_0x244632=_0x244632||0x1f4;return function(_0x457be4){logger[_0x4a4c('0x29')](_0x457be4['stack']);if(_0x457be4[_0x4a4c('0x2a')]){delete _0x457be4[_0x4a4c('0x2a')];}_0x4b56cb['status'](_0x244632)[_0x4a4c('0x2b')](_0x457be4);};}exports[_0x4a4c('0x2c')]=function(_0x2e32ac,_0x46a1fa){var _0x1f9ead={},_0x2ae116={},_0x48c995={'count':0x0,'rows':[]};var _0x80922f=_[_0x4a4c('0x2d')](db[_0x4a4c('0x2e')][_0x4a4c('0x2f')],function(_0xeb943){return{'name':_0xeb943[_0x4a4c('0x30')],'type':_0xeb943[_0x4a4c('0x31')][_0x4a4c('0x32')]};});_0x2ae116['model']=_['map'](_0x80922f,_0x4a4c('0x2a'));_0x2ae116[_0x4a4c('0x33')]=_[_0x4a4c('0x34')](_0x2e32ac[_0x4a4c('0x33')]);_0x2ae116['filters']=_[_0x4a4c('0x35')](_0x2ae116[_0x4a4c('0x36')],_0x2ae116[_0x4a4c('0x33')]);_0x1f9ead[_0x4a4c('0x37')]=_[_0x4a4c('0x35')](_0x2ae116['model'],qs[_0x4a4c('0x38')](_0x2e32ac[_0x4a4c('0x33')]['fields']));_0x1f9ead[_0x4a4c('0x37')]=_0x1f9ead['attributes'][_0x4a4c('0x39')]?_0x1f9ead[_0x4a4c('0x37')]:_0x2ae116[_0x4a4c('0x36')];if(!_0x2e32ac[_0x4a4c('0x33')][_0x4a4c('0x3a')]('nolimit')){_0x1f9ead[_0x4a4c('0x20')]=qs['limit'](_0x2e32ac[_0x4a4c('0x33')][_0x4a4c('0x20')]);_0x1f9ead[_0x4a4c('0x1e')]=qs[_0x4a4c('0x1e')](_0x2e32ac[_0x4a4c('0x33')][_0x4a4c('0x1e')]);}_0x1f9ead[_0x4a4c('0x3b')]=qs[_0x4a4c('0x3c')](_0x2e32ac[_0x4a4c('0x33')][_0x4a4c('0x3c')]);_0x1f9ead[_0x4a4c('0x3d')]=qs[_0x4a4c('0x3e')](_[_0x4a4c('0x3f')](_0x2e32ac[_0x4a4c('0x33')],_0x2ae116[_0x4a4c('0x3e')]),_0x80922f);if(_0x2e32ac[_0x4a4c('0x33')]['filter']){_0x1f9ead[_0x4a4c('0x3d')]=_[_0x4a4c('0x40')](_0x1f9ead['where'],{'$or':_[_0x4a4c('0x2d')](_0x80922f,function(_0xd2ce76){if(_0xd2ce76[_0x4a4c('0x31')]!==_0x4a4c('0x41')){var _0x4f266b={};_0x4f266b[_0xd2ce76[_0x4a4c('0x2a')]]={'$like':'%'+_0x2e32ac[_0x4a4c('0x33')][_0x4a4c('0x42')]+'%'};return _0x4f266b;}})});}_0x1f9ead=_['merge']({},_0x1f9ead,_0x2e32ac['options']);var _0x2c306c={'where':_0x1f9ead['where']};return db[_0x4a4c('0x2e')][_0x4a4c('0x21')](_0x2c306c)['then'](function(_0x1061f6){_0x48c995[_0x4a4c('0x21')]=_0x1061f6;if(_0x2e32ac[_0x4a4c('0x33')]['includeAll']){_0x1f9ead[_0x4a4c('0x43')]=[{'all':!![]}];}return db[_0x4a4c('0x2e')][_0x4a4c('0x44')](_0x1f9ead);})[_0x4a4c('0x28')](function(_0x6c4c13){_0x48c995[_0x4a4c('0x45')]=_0x6c4c13;return _0x48c995;})['then'](respondWithFilteredResult(_0x46a1fa,_0x1f9ead))[_0x4a4c('0x46')](handleError(_0x46a1fa,null));};exports[_0x4a4c('0x47')]=function(_0x264cda,_0x220dff){var _0x4b65bb={'raw':![],'where':{'id':_0x264cda[_0x4a4c('0x48')]['id']}},_0x131c46={};_0x131c46[_0x4a4c('0x36')]=_[_0x4a4c('0x34')](db[_0x4a4c('0x2e')][_0x4a4c('0x2f')]);_0x131c46['query']=_[_0x4a4c('0x34')](_0x264cda[_0x4a4c('0x33')]);_0x131c46[_0x4a4c('0x3e')]=_[_0x4a4c('0x35')](_0x131c46[_0x4a4c('0x36')],_0x131c46[_0x4a4c('0x33')]);_0x4b65bb[_0x4a4c('0x37')]=_['intersection'](_0x131c46[_0x4a4c('0x36')],qs[_0x4a4c('0x38')](_0x264cda['query'][_0x4a4c('0x38')]));_0x4b65bb['attributes']=_0x4b65bb[_0x4a4c('0x37')]['length']?_0x4b65bb[_0x4a4c('0x37')]:_0x131c46[_0x4a4c('0x36')];if(_0x264cda[_0x4a4c('0x33')][_0x4a4c('0x49')]){_0x4b65bb['include']=[{'all':!![]}];}_0x4b65bb=_['merge']({},_0x4b65bb,_0x264cda[_0x4a4c('0x4a')]);return db['Automation']['find'](_0x4b65bb)[_0x4a4c('0x28')](handleEntityNotFound(_0x220dff,null))['then'](respondWithResult(_0x220dff,null))['catch'](handleError(_0x220dff,null));};exports[_0x4a4c('0x4b')]=function(_0x19b403,_0x4b9e89){return db['Automation'][_0x4a4c('0x4b')](_0x19b403['body'],{})[_0x4a4c('0x28')](respondWithResult(_0x4b9e89,0xc9))[_0x4a4c('0x46')](handleError(_0x4b9e89,null));};exports[_0x4a4c('0x26')]=function(_0x3df3f4,_0x170452){if(_0x3df3f4['body']['id']){delete _0x3df3f4[_0x4a4c('0x4c')]['id'];}return db[_0x4a4c('0x2e')][_0x4a4c('0x4d')]({'where':{'id':_0x3df3f4[_0x4a4c('0x48')]['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x170452,null))[_0x4a4c('0x28')](saveUpdates(_0x3df3f4['body'],null))[_0x4a4c('0x28')](respondWithResult(_0x170452,null))[_0x4a4c('0x46')](handleError(_0x170452,null));};exports['destroy']=function(_0x2b75ff,_0x357aa5){return db[_0x4a4c('0x2e')][_0x4a4c('0x4d')]({'where':{'id':_0x2b75ff['params']['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x357aa5,null))[_0x4a4c('0x28')](removeEntity(_0x357aa5,null))[_0x4a4c('0x46')](handleError(_0x357aa5,null));};exports[_0x4a4c('0x4e')]=function(_0x3591d5,_0x486e11,_0x2bdb76){return db['Condition'][_0x4a4c('0x4d')]({'where':{'id':_0x3591d5[_0x4a4c('0x48')]['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x486e11,null))[_0x4a4c('0x28')](function(_0x4b157a){if(_0x4b157a){return _0x4b157a[_0x4a4c('0x4e')](_0x3591d5[_0x4a4c('0x4c')]['ids'],_[_0x4a4c('0x4f')](_0x3591d5[_0x4a4c('0x4c')],[_0x4a4c('0x50'),'id'])||{});}})[_0x4a4c('0x28')](respondWithResult(_0x486e11,null))[_0x4a4c('0x46')](handleError(_0x486e11,null));};exports['getConditions']=function(_0x25e0de,_0x392a4a,_0x433b29){var _0x35a97d={};var _0x105a16={};var _0x360e78;var _0x74be9f;return db[_0x4a4c('0x2e')]['findOne']({'where':{'id':_0x25e0de['params']['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x392a4a,null))[_0x4a4c('0x28')](function(_0xa33cdf){if(_0xa33cdf){_0x360e78=_0xa33cdf;_0x105a16['model']=_[_0x4a4c('0x34')](db[_0x4a4c('0x51')][_0x4a4c('0x2f')]);_0x105a16[_0x4a4c('0x33')]=_['keys'](_0x25e0de[_0x4a4c('0x33')]);_0x105a16['filters']=_[_0x4a4c('0x35')](_0x105a16[_0x4a4c('0x36')],_0x105a16[_0x4a4c('0x33')]);_0x35a97d['attributes']=_['intersection'](_0x105a16['model'],qs[_0x4a4c('0x38')](_0x25e0de[_0x4a4c('0x33')][_0x4a4c('0x38')]));_0x35a97d['attributes']=_0x35a97d[_0x4a4c('0x37')]['length']?_0x35a97d['attributes']:_0x105a16[_0x4a4c('0x36')];_0x35a97d[_0x4a4c('0x3b')]=qs['sort'](_0x25e0de[_0x4a4c('0x33')][_0x4a4c('0x3c')]);_0x35a97d[_0x4a4c('0x3d')]=qs[_0x4a4c('0x3e')](_[_0x4a4c('0x3f')](_0x25e0de[_0x4a4c('0x33')],_0x105a16['filters']));if(_0x25e0de[_0x4a4c('0x33')][_0x4a4c('0x42')]){_0x35a97d['where']=_['merge'](_0x35a97d[_0x4a4c('0x3d')],{'$or':_[_0x4a4c('0x2d')](_0x35a97d[_0x4a4c('0x37')],function(_0x3b143e){var _0x2981c3={};_0x2981c3[_0x3b143e]={'$like':'%'+_0x25e0de[_0x4a4c('0x33')]['filter']+'%'};return _0x2981c3;})});}_0x35a97d=_[_0x4a4c('0x40')]({},_0x35a97d,_0x25e0de[_0x4a4c('0x4a')]);return _0x360e78['getConditions'](_0x35a97d);}})[_0x4a4c('0x28')](function(_0x1f33dc){if(_0x1f33dc){_0x74be9f=_0x1f33dc[_0x4a4c('0x39')];if(!_0x25e0de[_0x4a4c('0x33')][_0x4a4c('0x3a')](_0x4a4c('0x52'))){_0x35a97d['limit']=qs[_0x4a4c('0x20')](_0x25e0de[_0x4a4c('0x33')]['limit']);_0x35a97d['offset']=qs[_0x4a4c('0x1e')](_0x25e0de[_0x4a4c('0x33')]['offset']);}return _0x360e78[_0x4a4c('0x53')](_0x35a97d);}})['then'](function(_0x245d95){if(_0x245d95){return _0x245d95?{'count':_0x74be9f,'rows':_0x245d95}:null;}})[_0x4a4c('0x28')](respondWithResult(_0x392a4a,null))[_0x4a4c('0x46')](handleError(_0x392a4a,null));};exports[_0x4a4c('0x54')]=function(_0x31fd7a,_0x3871c4,_0x5e3a19){return db[_0x4a4c('0x55')][_0x4a4c('0x4d')]({'where':{'id':_0x31fd7a['params']['id']}})[_0x4a4c('0x28')](handleEntityNotFound(_0x3871c4,null))['then'](function(_0x546bd4){if(_0x546bd4){return _0x546bd4[_0x4a4c('0x54')](_0x31fd7a[_0x4a4c('0x4c')][_0x4a4c('0x50')],_[_0x4a4c('0x4f')](_0x31fd7a[_0x4a4c('0x4c')],[_0x4a4c('0x50'),'id'])||{});}})[_0x4a4c('0x28')](respondWithResult(_0x3871c4,null))[_0x4a4c('0x46')](handleError(_0x3871c4,null));};exports['getActions']=function(_0x39db56,_0x48e8a3,_0x289a2d){var _0x5d9511={};var _0x5c8f1a={};var _0x2fd001;var _0x55e310;return db[_0x4a4c('0x2e')][_0x4a4c('0x56')]({'where':{'id':_0x39db56['params']['id']}})['then'](handleEntityNotFound(_0x48e8a3,null))[_0x4a4c('0x28')](function(_0x3be374){if(_0x3be374){_0x2fd001=_0x3be374;_0x5c8f1a['model']=_[_0x4a4c('0x34')](db[_0x4a4c('0x55')][_0x4a4c('0x2f')]);_0x5c8f1a[_0x4a4c('0x33')]=_[_0x4a4c('0x34')](_0x39db56['query']);_0x5c8f1a[_0x4a4c('0x3e')]=_[_0x4a4c('0x35')](_0x5c8f1a['model'],_0x5c8f1a[_0x4a4c('0x33')]);_0x5d9511[_0x4a4c('0x37')]=_[_0x4a4c('0x35')](_0x5c8f1a[_0x4a4c('0x36')],qs[_0x4a4c('0x38')](_0x39db56['query'][_0x4a4c('0x38')]));_0x5d9511[_0x4a4c('0x37')]=_0x5d9511[_0x4a4c('0x37')][_0x4a4c('0x39')]?_0x5d9511['attributes']:_0x5c8f1a[_0x4a4c('0x36')];_0x5d9511[_0x4a4c('0x3b')]=qs['sort'](_0x39db56[_0x4a4c('0x33')][_0x4a4c('0x3c')]);_0x5d9511['where']=qs['filters'](_[_0x4a4c('0x3f')](_0x39db56[_0x4a4c('0x33')],_0x5c8f1a[_0x4a4c('0x3e')]));if(_0x39db56['query']['filter']){_0x5d9511[_0x4a4c('0x3d')]=_[_0x4a4c('0x40')](_0x5d9511[_0x4a4c('0x3d')],{'$or':_[_0x4a4c('0x2d')](_0x5d9511['attributes'],function(_0x354f3d){var _0x27ba14={};_0x27ba14[_0x354f3d]={'$like':'%'+_0x39db56['query'][_0x4a4c('0x42')]+'%'};return _0x27ba14;})});}_0x5d9511=_[_0x4a4c('0x40')]({},_0x5d9511,_0x39db56[_0x4a4c('0x4a')]);return _0x2fd001['getActions'](_0x5d9511);}})[_0x4a4c('0x28')](function(_0x40606e){if(_0x40606e){_0x55e310=_0x40606e[_0x4a4c('0x39')];if(!_0x39db56[_0x4a4c('0x33')][_0x4a4c('0x3a')]('nolimit')){_0x5d9511['limit']=qs[_0x4a4c('0x20')](_0x39db56[_0x4a4c('0x33')][_0x4a4c('0x20')]);_0x5d9511[_0x4a4c('0x1e')]=qs[_0x4a4c('0x1e')](_0x39db56[_0x4a4c('0x33')][_0x4a4c('0x1e')]);}return _0x2fd001['getActions'](_0x5d9511);}})[_0x4a4c('0x28')](function(_0x458861){if(_0x458861){return _0x458861?{'count':_0x55e310,'rows':_0x458861}:null;}})['then'](respondWithResult(_0x48e8a3,null))[_0x4a4c('0x46')](handleError(_0x48e8a3,null));};
\ No newline at end of file
+var _0x40c5=['merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','rawAttributes','length','find','create','body','params','addConditions','ids','getConditions','findOne','Condition','Action','addActions','omit','getActions','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Automation','key','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x46bd4a,_0x38f47d){var _0x5bb00f=function(_0x5308d6){while(--_0x5308d6){_0x46bd4a['push'](_0x46bd4a['shift']());}};_0x5bb00f(++_0x38f47d);}(_0x40c5,0x1d2));var _0x540c=function(_0x5b4849,_0x44297b){_0x5b4849=_0x5b4849-0x0;var _0x1f3f55=_0x40c5[_0x5b4849];return _0x1f3f55;};'use strict';var emlformat=require(_0x540c('0x0'));var rimraf=require(_0x540c('0x1'));var zipdir=require(_0x540c('0x2'));var jsonpatch=require(_0x540c('0x3'));var rp=require(_0x540c('0x4'));var moment=require(_0x540c('0x5'));var BPromise=require(_0x540c('0x6'));var Mustache=require('mustache');var util=require(_0x540c('0x7'));var path=require(_0x540c('0x8'));var sox=require(_0x540c('0x9'));var csv=require(_0x540c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x540c('0xb'));var _=require(_0x540c('0xc'));var squel=require(_0x540c('0xd'));var crypto=require(_0x540c('0xe'));var jsforce=require(_0x540c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x540c('0xa'));var querystring=require(_0x540c('0x10'));var Papa=require(_0x540c('0x11'));var Redis=require('ioredis');var authService=require(_0x540c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x540c('0x13'));var logger=require(_0x540c('0x14'))(_0x540c('0x15'));var utils=require(_0x540c('0x16'));var config=require(_0x540c('0x17'));var licenseUtil=require(_0x540c('0x18'));var db=require(_0x540c('0x19'))['db'];function respondWithStatusCode(_0x369a2d,_0x49458f){_0x49458f=_0x49458f||0xcc;return function(_0x5cacee){if(_0x5cacee){return _0x369a2d[_0x540c('0x1a')](_0x49458f);}return _0x369a2d[_0x540c('0x1b')](_0x49458f)[_0x540c('0x1c')]();};}function respondWithResult(_0x48a1b1,_0x3fd3af){_0x3fd3af=_0x3fd3af||0xc8;return function(_0x1ed572){if(_0x1ed572){return _0x48a1b1['status'](_0x3fd3af)[_0x540c('0x1d')](_0x1ed572);}};}function respondWithFilteredResult(_0x42f837,_0x1d4cd2){return function(_0x44f848){if(_0x44f848){var _0x8f3852=typeof _0x1d4cd2[_0x540c('0x1e')]===_0x540c('0x1f')&&typeof _0x1d4cd2[_0x540c('0x20')]==='undefined';var _0x261a64=_0x44f848[_0x540c('0x21')];var _0xa22369=_0x8f3852?0x0:_0x1d4cd2['offset'];var _0x177a43=_0x8f3852?_0x44f848[_0x540c('0x21')]:_0x1d4cd2[_0x540c('0x1e')]+_0x1d4cd2[_0x540c('0x20')];var _0x22335f;if(_0x177a43>=_0x261a64){_0x177a43=_0x261a64;_0x22335f=0xc8;}else{_0x22335f=0xce;}_0x42f837[_0x540c('0x1b')](_0x22335f);return _0x42f837[_0x540c('0x22')](_0x540c('0x23'),_0xa22369+'-'+_0x177a43+'/'+_0x261a64)[_0x540c('0x1d')](_0x44f848);}return null;};}function patchUpdates(_0x115fa7){return function(_0x1bb88e){try{jsonpatch[_0x540c('0x24')](_0x1bb88e,_0x115fa7,!![]);}catch(_0x42efc4){return BPromise[_0x540c('0x25')](_0x42efc4);}return _0x1bb88e[_0x540c('0x26')]();};}function saveUpdates(_0x4f2e91,_0x5a149e){return function(_0x48ac36){if(_0x48ac36){return _0x48ac36[_0x540c('0x27')](_0x4f2e91)[_0x540c('0x28')](function(_0x3cf330){return _0x3cf330;});}return null;};}function removeEntity(_0x4f2f3b,_0x394694){return function(_0x31c1b2){if(_0x31c1b2){return _0x31c1b2[_0x540c('0x29')]()[_0x540c('0x28')](function(){_0x4f2f3b[_0x540c('0x1b')](0xcc)[_0x540c('0x1c')]();});}};}function handleEntityNotFound(_0x4775ad,_0x25c4a7){return function(_0x3969a7){if(!_0x3969a7){_0x4775ad[_0x540c('0x1a')](0x194);}return _0x3969a7;};}function handleError(_0x2d26e6,_0x273ecb){_0x273ecb=_0x273ecb||0x1f4;return function(_0x29953f){logger[_0x540c('0x2a')](_0x29953f[_0x540c('0x2b')]);if(_0x29953f[_0x540c('0x2c')]){delete _0x29953f['name'];}_0x2d26e6[_0x540c('0x1b')](_0x273ecb)[_0x540c('0x2d')](_0x29953f);};}exports[_0x540c('0x2e')]=function(_0x296587,_0x48dc1d){var _0x854ecd={},_0x1048ad={},_0x42d7c7={'count':0x0,'rows':[]};var _0xa6290c=_['map'](db[_0x540c('0x2f')]['rawAttributes'],function(_0x424235){return{'name':_0x424235['fieldName'],'type':_0x424235['type'][_0x540c('0x30')]};});_0x1048ad[_0x540c('0x31')]=_[_0x540c('0x32')](_0xa6290c,_0x540c('0x2c'));_0x1048ad['query']=_['keys'](_0x296587['query']);_0x1048ad[_0x540c('0x33')]=_[_0x540c('0x34')](_0x1048ad[_0x540c('0x31')],_0x1048ad[_0x540c('0x35')]);_0x854ecd[_0x540c('0x36')]=_[_0x540c('0x34')](_0x1048ad[_0x540c('0x31')],qs['fields'](_0x296587['query'][_0x540c('0x37')]));_0x854ecd[_0x540c('0x36')]=_0x854ecd[_0x540c('0x36')]['length']?_0x854ecd[_0x540c('0x36')]:_0x1048ad['model'];if(!_0x296587[_0x540c('0x35')][_0x540c('0x38')]('nolimit')){_0x854ecd['limit']=qs['limit'](_0x296587['query'][_0x540c('0x20')]);_0x854ecd['offset']=qs['offset'](_0x296587[_0x540c('0x35')]['offset']);}_0x854ecd[_0x540c('0x39')]=qs['sort'](_0x296587[_0x540c('0x35')][_0x540c('0x3a')]);_0x854ecd[_0x540c('0x3b')]=qs[_0x540c('0x33')](_[_0x540c('0x3c')](_0x296587[_0x540c('0x35')],_0x1048ad[_0x540c('0x33')]),_0xa6290c);if(_0x296587[_0x540c('0x35')][_0x540c('0x3d')]){_0x854ecd[_0x540c('0x3b')]=_[_0x540c('0x3e')](_0x854ecd[_0x540c('0x3b')],{'$or':_[_0x540c('0x32')](_0xa6290c,function(_0x4359f2){if(_0x4359f2[_0x540c('0x3f')]!==_0x540c('0x40')){var _0x285ff7={};_0x285ff7[_0x4359f2['name']]={'$like':'%'+_0x296587[_0x540c('0x35')][_0x540c('0x3d')]+'%'};return _0x285ff7;}})});}_0x854ecd=_['merge']({},_0x854ecd,_0x296587[_0x540c('0x41')]);var _0x22c819={'where':_0x854ecd[_0x540c('0x3b')]};return db[_0x540c('0x2f')][_0x540c('0x21')](_0x22c819)[_0x540c('0x28')](function(_0x4290c7){_0x42d7c7[_0x540c('0x21')]=_0x4290c7;if(_0x296587[_0x540c('0x35')][_0x540c('0x42')]){_0x854ecd[_0x540c('0x43')]=[{'all':!![]}];}return db['Automation'][_0x540c('0x44')](_0x854ecd);})[_0x540c('0x28')](function(_0xe99b09){_0x42d7c7['rows']=_0xe99b09;return _0x42d7c7;})['then'](respondWithFilteredResult(_0x48dc1d,_0x854ecd))[_0x540c('0x45')](handleError(_0x48dc1d,null));};exports[_0x540c('0x46')]=function(_0x2f8190,_0x10657d){var _0x547f50={'raw':![],'where':{'id':_0x2f8190['params']['id']}},_0x4fd719={};_0x4fd719[_0x540c('0x31')]=_[_0x540c('0x47')](db[_0x540c('0x2f')][_0x540c('0x48')]);_0x4fd719[_0x540c('0x35')]=_[_0x540c('0x47')](_0x2f8190['query']);_0x4fd719[_0x540c('0x33')]=_[_0x540c('0x34')](_0x4fd719[_0x540c('0x31')],_0x4fd719[_0x540c('0x35')]);_0x547f50['attributes']=_[_0x540c('0x34')](_0x4fd719[_0x540c('0x31')],qs[_0x540c('0x37')](_0x2f8190['query'][_0x540c('0x37')]));_0x547f50[_0x540c('0x36')]=_0x547f50['attributes'][_0x540c('0x49')]?_0x547f50[_0x540c('0x36')]:_0x4fd719[_0x540c('0x31')];if(_0x2f8190['query'][_0x540c('0x42')]){_0x547f50[_0x540c('0x43')]=[{'all':!![]}];}_0x547f50=_['merge']({},_0x547f50,_0x2f8190['options']);return db[_0x540c('0x2f')][_0x540c('0x4a')](_0x547f50)[_0x540c('0x28')](handleEntityNotFound(_0x10657d,null))[_0x540c('0x28')](respondWithResult(_0x10657d,null))[_0x540c('0x45')](handleError(_0x10657d,null));};exports[_0x540c('0x4b')]=function(_0x29178b,_0x13cb55){return db[_0x540c('0x2f')][_0x540c('0x4b')](_0x29178b[_0x540c('0x4c')],{})[_0x540c('0x28')](respondWithResult(_0x13cb55,0xc9))[_0x540c('0x45')](handleError(_0x13cb55,null));};exports['update']=function(_0x2116b1,_0x52f26d){if(_0x2116b1[_0x540c('0x4c')]['id']){delete _0x2116b1[_0x540c('0x4c')]['id'];}return db[_0x540c('0x2f')]['find']({'where':{'id':_0x2116b1['params']['id']}})[_0x540c('0x28')](handleEntityNotFound(_0x52f26d,null))['then'](saveUpdates(_0x2116b1[_0x540c('0x4c')],null))[_0x540c('0x28')](respondWithResult(_0x52f26d,null))[_0x540c('0x45')](handleError(_0x52f26d,null));};exports[_0x540c('0x29')]=function(_0x676595,_0x11cd37){return db[_0x540c('0x2f')][_0x540c('0x4a')]({'where':{'id':_0x676595[_0x540c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x11cd37,null))[_0x540c('0x28')](removeEntity(_0x11cd37,null))['catch'](handleError(_0x11cd37,null));};exports[_0x540c('0x4e')]=function(_0xd29d6,_0x3f4e7c,_0x4e04e7){return db['Condition'][_0x540c('0x4a')]({'where':{'id':_0xd29d6['params']['id']}})[_0x540c('0x28')](handleEntityNotFound(_0x3f4e7c,null))[_0x540c('0x28')](function(_0x97b110){if(_0x97b110){return _0x97b110[_0x540c('0x4e')](_0xd29d6['body'][_0x540c('0x4f')],_['omit'](_0xd29d6[_0x540c('0x4c')],['ids','id'])||{});}})[_0x540c('0x28')](respondWithResult(_0x3f4e7c,null))[_0x540c('0x45')](handleError(_0x3f4e7c,null));};exports[_0x540c('0x50')]=function(_0x4acb42,_0x324d0c,_0x148108){var _0x5356ec={};var _0x48fea2={};var _0x16bf81;var _0x119df4;return db[_0x540c('0x2f')][_0x540c('0x51')]({'where':{'id':_0x4acb42[_0x540c('0x4d')]['id']}})[_0x540c('0x28')](handleEntityNotFound(_0x324d0c,null))[_0x540c('0x28')](function(_0x1eca7e){if(_0x1eca7e){_0x16bf81=_0x1eca7e;_0x48fea2[_0x540c('0x31')]=_[_0x540c('0x47')](db[_0x540c('0x52')][_0x540c('0x48')]);_0x48fea2[_0x540c('0x35')]=_[_0x540c('0x47')](_0x4acb42[_0x540c('0x35')]);_0x48fea2[_0x540c('0x33')]=_['intersection'](_0x48fea2['model'],_0x48fea2[_0x540c('0x35')]);_0x5356ec[_0x540c('0x36')]=_[_0x540c('0x34')](_0x48fea2[_0x540c('0x31')],qs[_0x540c('0x37')](_0x4acb42['query']['fields']));_0x5356ec[_0x540c('0x36')]=_0x5356ec['attributes']['length']?_0x5356ec['attributes']:_0x48fea2[_0x540c('0x31')];_0x5356ec[_0x540c('0x39')]=qs['sort'](_0x4acb42['query'][_0x540c('0x3a')]);_0x5356ec[_0x540c('0x3b')]=qs[_0x540c('0x33')](_['pick'](_0x4acb42[_0x540c('0x35')],_0x48fea2['filters']));if(_0x4acb42['query'][_0x540c('0x3d')]){_0x5356ec['where']=_[_0x540c('0x3e')](_0x5356ec[_0x540c('0x3b')],{'$or':_[_0x540c('0x32')](_0x5356ec[_0x540c('0x36')],function(_0x11bdef){var _0x3095cd={};_0x3095cd[_0x11bdef]={'$like':'%'+_0x4acb42[_0x540c('0x35')]['filter']+'%'};return _0x3095cd;})});}_0x5356ec=_[_0x540c('0x3e')]({},_0x5356ec,_0x4acb42[_0x540c('0x41')]);return _0x16bf81['getConditions'](_0x5356ec);}})[_0x540c('0x28')](function(_0x21f482){if(_0x21f482){_0x119df4=_0x21f482[_0x540c('0x49')];if(!_0x4acb42['query'][_0x540c('0x38')]('nolimit')){_0x5356ec['limit']=qs[_0x540c('0x20')](_0x4acb42[_0x540c('0x35')][_0x540c('0x20')]);_0x5356ec['offset']=qs[_0x540c('0x1e')](_0x4acb42[_0x540c('0x35')][_0x540c('0x1e')]);}return _0x16bf81[_0x540c('0x50')](_0x5356ec);}})[_0x540c('0x28')](function(_0x26d376){if(_0x26d376){return _0x26d376?{'count':_0x119df4,'rows':_0x26d376}:null;}})[_0x540c('0x28')](respondWithResult(_0x324d0c,null))[_0x540c('0x45')](handleError(_0x324d0c,null));};exports['addActions']=function(_0x5f2541,_0x48fa93,_0x2ca8c0){return db[_0x540c('0x53')][_0x540c('0x4a')]({'where':{'id':_0x5f2541[_0x540c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x48fa93,null))['then'](function(_0x171dee){if(_0x171dee){return _0x171dee[_0x540c('0x54')](_0x5f2541[_0x540c('0x4c')][_0x540c('0x4f')],_[_0x540c('0x55')](_0x5f2541['body'],[_0x540c('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x48fa93,null))['catch'](handleError(_0x48fa93,null));};exports[_0x540c('0x56')]=function(_0xd9766a,_0x38bd3f,_0x549970){var _0x429b59={};var _0x3040d1={};var _0x2d7a2f;var _0x5d0982;return db[_0x540c('0x2f')]['findOne']({'where':{'id':_0xd9766a[_0x540c('0x4d')]['id']}})[_0x540c('0x28')](handleEntityNotFound(_0x38bd3f,null))[_0x540c('0x28')](function(_0x42d485){if(_0x42d485){_0x2d7a2f=_0x42d485;_0x3040d1['model']=_['keys'](db[_0x540c('0x53')]['rawAttributes']);_0x3040d1[_0x540c('0x35')]=_[_0x540c('0x47')](_0xd9766a[_0x540c('0x35')]);_0x3040d1[_0x540c('0x33')]=_[_0x540c('0x34')](_0x3040d1[_0x540c('0x31')],_0x3040d1[_0x540c('0x35')]);_0x429b59[_0x540c('0x36')]=_[_0x540c('0x34')](_0x3040d1[_0x540c('0x31')],qs[_0x540c('0x37')](_0xd9766a[_0x540c('0x35')][_0x540c('0x37')]));_0x429b59[_0x540c('0x36')]=_0x429b59['attributes'][_0x540c('0x49')]?_0x429b59[_0x540c('0x36')]:_0x3040d1[_0x540c('0x31')];_0x429b59[_0x540c('0x39')]=qs[_0x540c('0x3a')](_0xd9766a[_0x540c('0x35')][_0x540c('0x3a')]);_0x429b59[_0x540c('0x3b')]=qs['filters'](_[_0x540c('0x3c')](_0xd9766a[_0x540c('0x35')],_0x3040d1[_0x540c('0x33')]));if(_0xd9766a['query'][_0x540c('0x3d')]){_0x429b59['where']=_[_0x540c('0x3e')](_0x429b59[_0x540c('0x3b')],{'$or':_[_0x540c('0x32')](_0x429b59[_0x540c('0x36')],function(_0x1cc799){var _0x4e6583={};_0x4e6583[_0x1cc799]={'$like':'%'+_0xd9766a[_0x540c('0x35')][_0x540c('0x3d')]+'%'};return _0x4e6583;})});}_0x429b59=_['merge']({},_0x429b59,_0xd9766a[_0x540c('0x41')]);return _0x2d7a2f[_0x540c('0x56')](_0x429b59);}})[_0x540c('0x28')](function(_0x320329){if(_0x320329){_0x5d0982=_0x320329[_0x540c('0x49')];if(!_0xd9766a[_0x540c('0x35')][_0x540c('0x38')](_0x540c('0x57'))){_0x429b59[_0x540c('0x20')]=qs[_0x540c('0x20')](_0xd9766a[_0x540c('0x35')][_0x540c('0x20')]);_0x429b59[_0x540c('0x1e')]=qs[_0x540c('0x1e')](_0xd9766a[_0x540c('0x35')][_0x540c('0x1e')]);}return _0x2d7a2f[_0x540c('0x56')](_0x429b59);}})['then'](function(_0x15fdcb){if(_0x15fdcb){return _0x15fdcb?{'count':_0x5d0982,'rows':_0x15fdcb}:null;}})[_0x540c('0x28')](respondWithResult(_0x38bd3f,null))['catch'](handleError(_0x38bd3f,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 57e3338..e86ae81 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 _0x03f8=['moment','bluebird','path','./automation.attributes','exports','define','Automation','lodash','../../config/logger','api'];(function(_0x4541e4,_0x41e295){var _0x45c618=function(_0x280993){while(--_0x280993){_0x4541e4['push'](_0x4541e4['shift']());}};_0x45c618(++_0x41e295);}(_0x03f8,0x1d3));var _0x803f=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x03f8[_0x1f5a63];return _0x30bb7a;};'use strict';var _=require(_0x803f('0x0'));var util=require('util');var logger=require(_0x803f('0x1'))(_0x803f('0x2'));var moment=require(_0x803f('0x3'));var BPromise=require(_0x803f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x803f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x803f('0x6'));module[_0x803f('0x7')]=function(_0x20861f,_0xed797e){return _0x20861f[_0x803f('0x8')](_0x803f('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3320=['moment','bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x3320,0x171));var _0x0332=function(_0x544a8b,_0x22977f){_0x544a8b=_0x544a8b-0x0;var _0x399cb2=_0x3320[_0x544a8b];return _0x399cb2;};'use strict';var _=require(_0x0332('0x0'));var util=require(_0x0332('0x1'));var logger=require(_0x0332('0x2'))('api');var moment=require(_0x0332('0x3'));var BPromise=require(_0x0332('0x4'));var rp=require(_0x0332('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0332('0x6'));var config=require(_0x0332('0x7'));var attributes=require(_0x0332('0x8'));module[_0x0332('0x9')]=function(_0x104a3d,_0x12ecca){return _0x104a3d['define'](_0x0332('0xa'),attributes,{'tableName':_0x0332('0xb'),'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 4cdef89..6a7d1ad 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 _0x9672=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x5c4546,_0x5b914e){var _0x422f39=function(_0x1af47a){while(--_0x1af47a){_0x5c4546['push'](_0x5c4546['shift']());}};_0x422f39(++_0x5b914e);}(_0x9672,0xee));var _0x2967=function(_0x4d79b1,_0x28a8b9){_0x4d79b1=_0x4d79b1-0x0;var _0x885257=_0x9672[_0x4d79b1];return _0x885257;};'use strict';var _=require(_0x2967('0x0'));var util=require(_0x2967('0x1'));var moment=require('moment');var BPromise=require(_0x2967('0x2'));var rs=require(_0x2967('0x3'));var fs=require('fs');var Redis=require(_0x2967('0x4'));var db=require(_0x2967('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2967('0x6'))(_0x2967('0x7'));var config=require(_0x2967('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2967('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x355e82,_0x1aa9a5,_0x77f846){return new BPromise(function(_0x3bcd7e,_0xf353b6){return client[_0x2967('0xa')](_0x355e82,_0x77f846)[_0x2967('0xb')](function(_0x4aec0f){logger[_0x2967('0xc')](_0x2967('0xd'),_0x1aa9a5,_0x2967('0xe'));logger[_0x2967('0xf')](_0x2967('0x10'),_0x1aa9a5,_0x2967('0xe'),JSON['stringify'](_0x4aec0f));if(_0x4aec0f[_0x2967('0x11')]){if(_0x4aec0f['error'][_0x2967('0x12')]===0x1f4){logger['error'](_0x2967('0xd'),_0x1aa9a5,_0x4aec0f[_0x2967('0x11')]['message']);return _0xf353b6(_0x4aec0f[_0x2967('0x11')]['message']);}logger[_0x2967('0x11')](_0x2967('0xd'),_0x1aa9a5,_0x4aec0f[_0x2967('0x11')]['message']);return _0x3bcd7e(_0x4aec0f['error'][_0x2967('0x13')]);}else{logger[_0x2967('0xc')](_0x2967('0xd'),_0x1aa9a5,'request\x20sent');_0x3bcd7e(_0x4aec0f['result'][_0x2967('0x13')]);}})[_0x2967('0x14')](function(_0x1bcec9){logger[_0x2967('0x11')](_0x2967('0xd'),_0x1aa9a5,_0x1bcec9);_0xf353b6(_0x1bcec9);});});}
\ No newline at end of file
+var _0x5ed9=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','Automation,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5ed9[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var moment=require('moment');var BPromise=require(_0x95ed('0x2'));var rs=require(_0x95ed('0x3'));var fs=require('fs');var Redis=require(_0x95ed('0x4'));var db=require(_0x95ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x95ed('0x6'))(_0x95ed('0x7'));var config=require(_0x95ed('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x95ed('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32bf25,_0xaa1eb1,_0x3753b5){return new BPromise(function(_0x1df51f,_0x46ed43){return client[_0x95ed('0xa')](_0x32bf25,_0x3753b5)['then'](function(_0x2b59f5){logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,'request\x20sent');logger[_0x95ed('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0xaa1eb1,_0x95ed('0xe'),JSON[_0x95ed('0xf')](_0x2b59f5));if(_0x2b59f5[_0x95ed('0x10')]){if(_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x11')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x46ed43(_0x2b59f5['error']['message']);}logger[_0x95ed('0x10')](_0x95ed('0xc'),_0xaa1eb1,_0x2b59f5[_0x95ed('0x10')][_0x95ed('0x12')]);return _0x1df51f(_0x2b59f5['error'][_0x95ed('0x12')]);}else{logger[_0x95ed('0xb')](_0x95ed('0xc'),_0xaa1eb1,_0x95ed('0xe'));_0x1df51f(_0x2b59f5[_0x95ed('0x13')]['message']);}})[_0x95ed('0x14')](function(_0x54ad78){logger['error']('Automation,\x20%s,\x20%s',_0xaa1eb1,_0x54ad78);_0x46ed43(_0x54ad78);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 1dd0df2..86f8938 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 _0x16c1=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','delete','destroy','exports','multer','util'];(function(_0x4b1434,_0x1fa900){var _0x9870da=function(_0x1e9432){while(--_0x1e9432){_0x4b1434['push'](_0x4b1434['shift']());}};_0x9870da(++_0x1fa900);}(_0x16c1,0x66));var _0x116c=function(_0x48acc8,_0x1b3e47){_0x48acc8=_0x48acc8-0x0;var _0x19a079=_0x16c1[_0x48acc8];return _0x19a079;};'use strict';var multer=require(_0x116c('0x0'));var util=require(_0x116c('0x1'));var path=require(_0x116c('0x2'));var timeout=require(_0x116c('0x3'));var express=require(_0x116c('0x4'));var router=express[_0x116c('0x5')]();var fs_extra=require(_0x116c('0x6'));var auth=require(_0x116c('0x7'));var interaction=require(_0x116c('0x8'));var config=require('../../config/environment');var controller=require(_0x116c('0x9'));router['get']('/',auth[_0x116c('0xa')](),controller[_0x116c('0xb')]);router[_0x116c('0xc')](_0x116c('0xd'),auth[_0x116c('0xa')](),controller[_0x116c('0xe')]);router['get'](_0x116c('0xf'),auth[_0x116c('0xa')](),controller[_0x116c('0x10')]);router[_0x116c('0xc')](_0x116c('0x11'),auth[_0x116c('0xa')](),controller['getActions']);router[_0x116c('0x12')]('/',auth[_0x116c('0xa')](),controller[_0x116c('0x13')]);router[_0x116c('0x12')](_0x116c('0xf'),auth[_0x116c('0xa')](),controller[_0x116c('0x14')]);router[_0x116c('0x12')](_0x116c('0x11'),auth['isAuthenticated'](),controller[_0x116c('0x15')]);router[_0x116c('0x16')](_0x116c('0xd'),auth[_0x116c('0xa')](),controller['update']);router[_0x116c('0x17')](_0x116c('0xd'),auth[_0x116c('0xa')](),controller[_0x116c('0x18')]);module[_0x116c('0x19')]=router;
\ No newline at end of file
+var _0xeec3=['destroy','multer','util','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','/:id','show','get','/:id/conditions','getConditions','post','create','addActions','put','update'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xeec3,0x1c3));var _0x3eec=function(_0x5dc9d9,_0x5b91c0){_0x5dc9d9=_0x5dc9d9-0x0;var _0x4824b7=_0xeec3[_0x5dc9d9];return _0x4824b7;};'use strict';var multer=require(_0x3eec('0x0'));var util=require(_0x3eec('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3eec('0x2'));var interaction=require(_0x3eec('0x3'));var config=require('../../config/environment');var controller=require(_0x3eec('0x4'));router['get']('/',auth[_0x3eec('0x5')](),controller[_0x3eec('0x6')]);router['get'](_0x3eec('0x7'),auth[_0x3eec('0x5')](),controller[_0x3eec('0x8')]);router[_0x3eec('0x9')](_0x3eec('0xa'),auth[_0x3eec('0x5')](),controller[_0x3eec('0xb')]);router[_0x3eec('0x9')]('/:id/actions',auth[_0x3eec('0x5')](),controller['getActions']);router[_0x3eec('0xc')]('/',auth[_0x3eec('0x5')](),controller[_0x3eec('0xd')]);router[_0x3eec('0xc')]('/:id/conditions',auth[_0x3eec('0x5')](),controller['addConditions']);router['post']('/:id/actions',auth[_0x3eec('0x5')](),controller[_0x3eec('0xe')]);router[_0x3eec('0xf')](_0x3eec('0x7'),auth['isAuthenticated'](),controller[_0x3eec('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3eec('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index d896745..461975a 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 _0xd2ca=['never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xd2ca,0xba));var _0xad2c=function(_0x414356,_0x591827){_0x414356=_0x414356-0x0;var _0x4bdafb=_0xd2ca[_0x414356];return _0x4bdafb;};'use strict';var Sequelize=require('sequelize');module[_0xad2c('0x0')]={'name':{'type':Sequelize[_0xad2c('0x1')],'unique':_0xad2c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xad2c('0x3')](_0xad2c('0x4')),'allowNull':![],'defaultValue':_0xad2c('0x4')},'description':{'type':Sequelize[_0xad2c('0x1')]},'active':{'type':Sequelize[_0xad2c('0x5')],'defaultValue':0x0,'comment':_0xad2c('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xad2c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xad2c('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xad2c('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xad2c('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xad2c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad2c('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xad2c('0xa')](0x3)[_0xad2c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad2c('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xad2c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad2c('0xc')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xad2c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xad2c('0xa')](0x5)[_0xad2c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad2c('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xad2c('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xad2c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad2c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xad2c('0xa')](0x3)[_0xad2c('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xad2c('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xad2c('0x1')],'defaultValue':_0xad2c('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xad2c('0x3')](_0xad2c('0x11'),_0xad2c('0x12'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xad2c('0x5')],'defaultValue':0x0,'comment':_0xad2c('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xad2c('0xa')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xad2c('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xad2c('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xad2c('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xad2c('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xad2c('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xad2c('0xa')](0x9)[_0xad2c('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xad2c('0xa')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xad2c('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xad2c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xad2c('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xad2c('0xa')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xad2c('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xad2c('0x3')](_0xad2c('0x19'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xad2c('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xad2c('0xa')](0x3)[_0xad2c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xad2c('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xad2c('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xad2c('0xa')](0x3)[_0xad2c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad2c('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xad2c('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xad2c('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad2c('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xad2c('0xa')](0x5)[_0xad2c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad2c('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xad2c('0xa')](0x3)[_0xad2c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xad2c('0xa')](0x5)[_0xad2c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad2c('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xad2c('0xa')](0x3)[_0xad2c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad2c('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xad2c('0xa')](0x3)[_0xad2c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad2c('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xad2c('0xa')](0x5)[_0xad2c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad2c('0x21')}};
\ No newline at end of file
+var _0x3441=['ENUM','ivr','STRING','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','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\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','name'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0x3441,0x14b));var _0x1344=function(_0x1ef726,_0x16fdea){_0x1ef726=_0x1ef726-0x0;var _0x4c3c66=_0x3441[_0x1ef726];return _0x4c3c66;};'use strict';var Sequelize=require(_0x1344('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1344('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1344('0x2')]('ivr'),'allowNull':![],'defaultValue':_0x1344('0x3')},'description':{'type':Sequelize[_0x1344('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x1344('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1344('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1344('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1344('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x1344('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1344('0x5')](0x3)[_0x1344('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1344('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x1344('0x5')](0x3)[_0x1344('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1344('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1344('0x5')](0x5)[_0x1344('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1344('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1344('0x5')](0x3)[_0x1344('0x7')],'defaultValue':0x3,'comment':_0x1344('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1344('0x5')](0x5)[_0x1344('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1344('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1344('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1344('0xd')},'dialTimezone':{'type':Sequelize[_0x1344('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1344('0x4')],'defaultValue':_0x1344('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x1344('0x2')](_0x1344('0xf'),_0x1344('0x10'),_0x1344('0x11')),'defaultValue':_0x1344('0xf')},'dialAMDActive':{'type':Sequelize[_0x1344('0x12')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1344('0x5')](0x9)[_0x1344('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1344('0x5')](0x9)[_0x1344('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1344('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1344('0x5')](0x9)[_0x1344('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1344('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x1344('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1344('0x5')](0x9)[_0x1344('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1344('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1344('0x5')](0x9)[_0x1344('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1344('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1344('0x5')](0x9)[_0x1344('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1344('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1344('0x5')](0x5)[_0x1344('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1344('0x5')](0x9)[_0x1344('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1344('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1344('0x2')](_0x1344('0x19'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x1344('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1344('0x5')](0x3)[_0x1344('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1344('0x1a')},'dialCutDigit':{'type':Sequelize[_0x1344('0x5')](0x3)[_0x1344('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1344('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1344('0x5')](0x3)[_0x1344('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1344('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1344('0x5')](0x5)[_0x1344('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1344('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x1344('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1344('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1344('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1344('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1344('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x1344('0x5')](0x3)[_0x1344('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1344('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1344('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1344('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1344('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1344('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1344('0x24')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5a3d3de..f36cee3 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 _0x316b=['order','sort','where','pick','filter','VIRTUAL','options','Campaign','includeAll','include','catch','show','params','keys','intersection','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','userProfileId','error','getHoppers','findOne','nolimit','CampaignId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','scheduledAt','cmHopperId','OrderBy','h.id','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','set','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','stack','name','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','hasOwnProperty','limit','offset'];(function(_0x22ad0c,_0x56e8a1){var _0x3787a9=function(_0x1d87a9){while(--_0x1d87a9){_0x22ad0c['push'](_0x22ad0c['shift']());}};_0x3787a9(++_0x56e8a1);}(_0x316b,0x17e));var _0xb316=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x316b[_0x568a61];return _0x334c3b;};'use strict';var emlformat=require(_0xb316('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb316('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb316('0x2'));var moment=require(_0xb316('0x3'));var BPromise=require(_0xb316('0x4'));var Mustache=require(_0xb316('0x5'));var util=require(_0xb316('0x6'));var path=require(_0xb316('0x7'));var sox=require(_0xb316('0x8'));var csv=require('to-csv');var ejs=require(_0xb316('0x9'));var fs=require('fs');var fs_extra=require(_0xb316('0xa'));var _=require(_0xb316('0xb'));var squel=require(_0xb316('0xc'));var crypto=require('crypto');var jsforce=require(_0xb316('0xd'));var deskjs=require(_0xb316('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb316('0xf'));var Papa=require(_0xb316('0x10'));var Redis=require(_0xb316('0x11'));var authService=require(_0xb316('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb316('0x13'));var hardwareService=require(_0xb316('0x14'));var logger=require(_0xb316('0x15'))(_0xb316('0x16'));var utils=require(_0xb316('0x17'));var config=require(_0xb316('0x18'));var licenseUtil=require(_0xb316('0x19'));var db=require(_0xb316('0x1a'))['db'];function respondWithStatusCode(_0x1c96cc,_0x3f45df){_0x3f45df=_0x3f45df||0xcc;return function(_0x5bbf73){if(_0x5bbf73){return _0x1c96cc[_0xb316('0x1b')](_0x3f45df);}return _0x1c96cc[_0xb316('0x1c')](_0x3f45df)['end']();};}function respondWithResult(_0x451ef6,_0x9aa523){_0x9aa523=_0x9aa523||0xc8;return function(_0x2e4583){if(_0x2e4583){return _0x451ef6[_0xb316('0x1c')](_0x9aa523)['json'](_0x2e4583);}};}function respondWithFilteredResult(_0xf00fc6,_0x19df6a){return function(_0x47d482){if(_0x47d482){var _0x4a1e93=typeof _0x19df6a['offset']===_0xb316('0x1d')&&typeof _0x19df6a['limit']===_0xb316('0x1d');var _0x58d965=_0x47d482['count'];var _0x1463cd=_0x4a1e93?0x0:_0x19df6a['offset'];var _0x54c716=_0x4a1e93?_0x47d482[_0xb316('0x1e')]:_0x19df6a['offset']+_0x19df6a['limit'];var _0x1fc163;if(_0x54c716>=_0x58d965){_0x54c716=_0x58d965;_0x1fc163=0xc8;}else{_0x1fc163=0xce;}_0xf00fc6[_0xb316('0x1c')](_0x1fc163);return _0xf00fc6[_0xb316('0x1f')]('Content-Range',_0x1463cd+'-'+_0x54c716+'/'+_0x58d965)['json'](_0x47d482);}return null;};}function patchUpdates(_0x3f0c08){return function(_0x2b1698){try{jsonpatch[_0xb316('0x20')](_0x2b1698,_0x3f0c08,!![]);}catch(_0x1d9e14){return BPromise[_0xb316('0x21')](_0x1d9e14);}return _0x2b1698[_0xb316('0x22')]();};}function saveUpdates(_0x4c5d06,_0x222375){return function(_0x5d65b6){if(_0x5d65b6){return _0x5d65b6[_0xb316('0x23')](_0x4c5d06)[_0xb316('0x24')](function(_0x515cb5){return _0x515cb5;});}return null;};}function removeEntity(_0x5f069e,_0x55fa58){return function(_0x32cbf2){if(_0x32cbf2){return _0x32cbf2['destroy']()[_0xb316('0x24')](function(){var _0x549535=_0x32cbf2[_0xb316('0x25')]({'plain':!![]});var _0x199511=_0xb316('0x26');return db[_0xb316('0x27')][_0xb316('0x28')]({'where':{'type':_0x199511,'resourceId':_0x549535['id']}})[_0xb316('0x24')](function(){return _0x32cbf2;});})[_0xb316('0x24')](function(){_0x5f069e[_0xb316('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x152686,_0x5e9b17){return function(_0x2ab05a){if(!_0x2ab05a){_0x152686[_0xb316('0x1b')](0x194);}return _0x2ab05a;};}function handleError(_0xe1a09,_0x2b9be0){_0x2b9be0=_0x2b9be0||0x1f4;return function(_0x1dc996){logger['error'](_0x1dc996[_0xb316('0x29')]);if(_0x1dc996['name']){delete _0x1dc996[_0xb316('0x2a')];}_0xe1a09['status'](_0x2b9be0)['send'](_0x1dc996);};}exports['index']=function(_0x55588d,_0xd071f9){var _0x575650={},_0xd51317={},_0x3c08ca={'count':0x0,'rows':[]};var _0x1533e9=_['map'](db['Campaign'][_0xb316('0x2b')],function(_0x40e781){return{'name':_0x40e781[_0xb316('0x2c')],'type':_0x40e781[_0xb316('0x2d')][_0xb316('0x2e')]};});_0xd51317[_0xb316('0x2f')]=_[_0xb316('0x30')](_0x1533e9,_0xb316('0x2a'));_0xd51317[_0xb316('0x31')]=_['keys'](_0x55588d[_0xb316('0x31')]);_0xd51317[_0xb316('0x32')]=_['intersection'](_0xd51317[_0xb316('0x2f')],_0xd51317[_0xb316('0x31')]);_0x575650[_0xb316('0x33')]=_['intersection'](_0xd51317[_0xb316('0x2f')],qs[_0xb316('0x34')](_0x55588d[_0xb316('0x31')][_0xb316('0x34')]));_0x575650['attributes']=_0x575650[_0xb316('0x33')]['length']?_0x575650[_0xb316('0x33')]:_0xd51317[_0xb316('0x2f')];if(!_0x55588d['query'][_0xb316('0x35')]('nolimit')){_0x575650[_0xb316('0x36')]=qs[_0xb316('0x36')](_0x55588d[_0xb316('0x31')][_0xb316('0x36')]);_0x575650[_0xb316('0x37')]=qs[_0xb316('0x37')](_0x55588d[_0xb316('0x31')][_0xb316('0x37')]);}_0x575650[_0xb316('0x38')]=qs[_0xb316('0x39')](_0x55588d[_0xb316('0x31')][_0xb316('0x39')]);_0x575650[_0xb316('0x3a')]=qs['filters'](_[_0xb316('0x3b')](_0x55588d[_0xb316('0x31')],_0xd51317[_0xb316('0x32')]),_0x1533e9);if(_0x55588d['query'][_0xb316('0x3c')]){_0x575650[_0xb316('0x3a')]=_['merge'](_0x575650[_0xb316('0x3a')],{'$or':_[_0xb316('0x30')](_0x1533e9,function(_0x4b553d){if(_0x4b553d['type']!==_0xb316('0x3d')){var _0xc30fb9={};_0xc30fb9[_0x4b553d['name']]={'$like':'%'+_0x55588d['query'][_0xb316('0x3c')]+'%'};return _0xc30fb9;}})});}_0x575650=_['merge']({},_0x575650,_0x55588d[_0xb316('0x3e')]);var _0x4a8afd={'where':_0x575650['where']};return db[_0xb316('0x3f')]['count'](_0x4a8afd)[_0xb316('0x24')](function(_0x21d6cd){_0x3c08ca[_0xb316('0x1e')]=_0x21d6cd;if(_0x55588d[_0xb316('0x31')][_0xb316('0x40')]){_0x575650[_0xb316('0x41')]=[{'all':!![]}];}return db[_0xb316('0x3f')]['findAll'](_0x575650);})[_0xb316('0x24')](function(_0x442243){_0x3c08ca['rows']=_0x442243;return _0x3c08ca;})['then'](respondWithFilteredResult(_0xd071f9,_0x575650))[_0xb316('0x42')](handleError(_0xd071f9,null));};exports[_0xb316('0x43')]=function(_0x134957,_0x35db08){var _0x37f743={'raw':![],'where':{'id':_0x134957[_0xb316('0x44')]['id']}},_0x2521c9={};_0x2521c9['model']=_[_0xb316('0x45')](db[_0xb316('0x3f')]['rawAttributes']);_0x2521c9[_0xb316('0x31')]=_[_0xb316('0x45')](_0x134957['query']);_0x2521c9['filters']=_[_0xb316('0x46')](_0x2521c9[_0xb316('0x2f')],_0x2521c9['query']);_0x37f743[_0xb316('0x33')]=_[_0xb316('0x46')](_0x2521c9[_0xb316('0x2f')],qs[_0xb316('0x34')](_0x134957['query'][_0xb316('0x34')]));_0x37f743[_0xb316('0x33')]=_0x37f743['attributes'][_0xb316('0x47')]?_0x37f743[_0xb316('0x33')]:_0x2521c9[_0xb316('0x2f')];if(_0x134957[_0xb316('0x31')][_0xb316('0x40')]){_0x37f743[_0xb316('0x41')]=[{'all':!![]}];}_0x37f743=_[_0xb316('0x48')]({},_0x37f743,_0x134957[_0xb316('0x3e')]);return db['Campaign']['find'](_0x37f743)[_0xb316('0x24')](handleEntityNotFound(_0x35db08,null))[_0xb316('0x24')](respondWithResult(_0x35db08,null))[_0xb316('0x42')](handleError(_0x35db08,null));};exports['create']=function(_0x2427fb,_0x4f04ff){return db[_0xb316('0x3f')][_0xb316('0x49')](_0x2427fb[_0xb316('0x4a')],{})['then'](function(_0x2fb415){var _0x466789=_0x2427fb[_0xb316('0x4b')][_0xb316('0x25')]({'plain':!![]});if(!_0x466789)throw new Error(_0xb316('0x4c'));if(_0x466789[_0xb316('0x4d')]==='user'){var _0x17683a=_0x2fb415['get']({'plain':!![]});var _0x1e2c89=_0xb316('0x26');return db[_0xb316('0x4e')][_0xb316('0x4f')]({'where':{'name':_0x1e2c89,'userProfileId':_0x466789['userProfileId']},'raw':!![]})[_0xb316('0x24')](function(_0x4fe5e5){if(_0x4fe5e5&&_0x4fe5e5['autoAssociation']===0x0){return db[_0xb316('0x27')][_0xb316('0x49')]({'name':_0x17683a['name'],'resourceId':_0x17683a['id'],'type':_0x4fe5e5[_0xb316('0x2a')],'sectionId':_0x4fe5e5['id']},{})[_0xb316('0x24')](function(){return _0x2fb415;});}else{return _0x2fb415;}})[_0xb316('0x42')](function(_0x2575e3){logger['error'](_0xb316('0x50'),_0x2575e3);throw _0x2575e3;});}return _0x2fb415;})['then'](respondWithResult(_0x4f04ff,0xc9))[_0xb316('0x42')](handleError(_0x4f04ff,null));};exports[_0xb316('0x51')]=function(_0x1d3dcd,_0x2a8cb7){var _0xefbd4d={'where':{'id':_0x1d3dcd[_0xb316('0x44')]['id']}},_0x9b6d3b={};_0x9b6d3b[_0xb316('0x2f')]=_[_0xb316('0x45')](db[_0xb316('0x3f')][_0xb316('0x2b')]);_0xefbd4d[_0xb316('0x33')]=_[_0xb316('0x46')](_0x9b6d3b[_0xb316('0x2f')],qs[_0xb316('0x34')](_0x1d3dcd[_0xb316('0x31')]['fields']));_0xefbd4d[_0xb316('0x33')]=_0xefbd4d['attributes'][_0xb316('0x47')]?_0xefbd4d['attributes']:_0x9b6d3b['model'];if(_0x1d3dcd[_0xb316('0x31')][_0xb316('0x40')]){_0xefbd4d[_0xb316('0x41')]=[{'all':!![]}];}_0xefbd4d=_[_0xb316('0x48')]({},_0xefbd4d,_0x1d3dcd[_0xb316('0x3e')]);return db['Campaign'][_0xb316('0x4f')](_0xefbd4d)[_0xb316('0x24')](handleEntityNotFound(_0x2a8cb7,null))[_0xb316('0x24')](function(_0x3ab74d){if(_0x3ab74d){var _0x3b3a62=_0x3ab74d[_0xb316('0x25')]({'plain':!![]});_0x3b3a62=qs['omit'](_0x3b3a62,['id',_0xb316('0x52'),_0xb316('0x53')]);_0x1d3dcd['body']=_[_0xb316('0x54')](_0x1d3dcd[_0xb316('0x4a')],['id',_0xb316('0x52'),_0xb316('0x53')]);return db[_0xb316('0x3f')]['create'](_[_0xb316('0x48')](_0x3b3a62,_0x1d3dcd[_0xb316('0x4a')]),{'include':_0x1d3dcd[_0xb316('0x31')][_0xb316('0x40')]?[{'all':!![]}]:undefined})[_0xb316('0x24')](function(_0x5e2a64){var _0x3c6c08=_0x1d3dcd[_0xb316('0x4b')][_0xb316('0x25')]({'plain':!![]});if(!_0x3c6c08)throw new Error(_0xb316('0x4c'));if(_0x3c6c08[_0xb316('0x4d')]===_0xb316('0x4b')){var _0x43fecf=_0x5e2a64[_0xb316('0x25')]({'plain':!![]});var _0x3b5f48='IvrCampaigns';return db[_0xb316('0x4e')][_0xb316('0x4f')]({'where':{'name':_0x3b5f48,'userProfileId':_0x3c6c08[_0xb316('0x55')]},'raw':!![]})[_0xb316('0x24')](function(_0xc3d37e){if(_0xc3d37e&&_0xc3d37e['autoAssociation']===0x0){return db[_0xb316('0x27')]['create']({'name':_0x43fecf['name'],'resourceId':_0x43fecf['id'],'type':_0xc3d37e[_0xb316('0x2a')],'sectionId':_0xc3d37e['id']},{})['then'](function(){return _0x5e2a64;});}else{return _0x5e2a64;}})[_0xb316('0x42')](function(_0xae708a){logger[_0xb316('0x56')](_0xb316('0x50'),_0xae708a);throw _0xae708a;});}return _0x5e2a64;});}})[_0xb316('0x24')](respondWithResult(_0x2a8cb7,0xc9))['catch'](handleError(_0x2a8cb7,null));};exports[_0xb316('0x23')]=function(_0x4b63c1,_0x2a36f8){if(_0x4b63c1['body']['id']){delete _0x4b63c1['body']['id'];}return db['Campaign']['find']({'where':{'id':_0x4b63c1[_0xb316('0x44')]['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x2a36f8,null))[_0xb316('0x24')](saveUpdates(_0x4b63c1[_0xb316('0x4a')],null))['then'](respondWithResult(_0x2a36f8,null))[_0xb316('0x42')](handleError(_0x2a36f8,null));};exports['destroy']=function(_0x366ceb,_0x11c307){return db[_0xb316('0x3f')][_0xb316('0x4f')]({'where':{'id':_0x366ceb[_0xb316('0x44')]['id']}})['then'](handleEntityNotFound(_0x11c307,null))[_0xb316('0x24')](removeEntity(_0x11c307,null))['catch'](handleError(_0x11c307,null));};exports[_0xb316('0x57')]=function(_0x3c388b,_0x695ebe,_0x7405f8){var _0x2f0348={'raw':!![],'where':{}};var _0x30afb5={};var _0x44b76a={'count':0x0,'rows':[]};return db[_0xb316('0x3f')][_0xb316('0x58')]({'where':{'id':_0x3c388b[_0xb316('0x44')]['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x695ebe,null))['then'](function(_0x3cf379){if(_0x3cf379){_0x30afb5[_0xb316('0x2f')]=_[_0xb316('0x45')](db['CmHopper']['rawAttributes']);_0x30afb5[_0xb316('0x31')]=_[_0xb316('0x45')](_0x3c388b['query']);_0x30afb5[_0xb316('0x32')]=_[_0xb316('0x46')](_0x30afb5[_0xb316('0x2f')],_0x30afb5[_0xb316('0x31')]);_0x2f0348['attributes']=_[_0xb316('0x46')](_0x30afb5[_0xb316('0x2f')],qs[_0xb316('0x34')](_0x3c388b['query'][_0xb316('0x34')]));_0x2f0348['attributes']=_0x2f0348[_0xb316('0x33')][_0xb316('0x47')]?_0x2f0348[_0xb316('0x33')]:_0x30afb5['model'];if(!_0x3c388b[_0xb316('0x31')][_0xb316('0x35')](_0xb316('0x59'))){_0x2f0348[_0xb316('0x36')]=qs[_0xb316('0x36')](_0x3c388b[_0xb316('0x31')][_0xb316('0x36')]);_0x2f0348[_0xb316('0x37')]=qs[_0xb316('0x37')](_0x3c388b[_0xb316('0x31')][_0xb316('0x37')]);}_0x2f0348[_0xb316('0x38')]=qs[_0xb316('0x39')](_0x3c388b['query'][_0xb316('0x39')]);_0x2f0348[_0xb316('0x3a')]=qs[_0xb316('0x32')](_['pick'](_0x3c388b[_0xb316('0x31')],_0x30afb5['filters']));_0x2f0348['where'][_0xb316('0x5a')]=_0x3cf379['id'];if(_0x3c388b[_0xb316('0x31')][_0xb316('0x3c')]){_0x2f0348['where']=_[_0xb316('0x48')](_0x2f0348[_0xb316('0x3a')],{'$or':_['map'](_0x2f0348[_0xb316('0x33')],function(_0x4d1484){var _0x32cb08={};_0x32cb08[_0x4d1484]={'$like':'%'+_0x3c388b[_0xb316('0x31')][_0xb316('0x3c')]+'%'};return _0x32cb08;})});}_0x2f0348=_['merge']({},_0x2f0348,_0x3c388b['options']);return db[_0xb316('0x5b')][_0xb316('0x1e')]({'where':_0x2f0348[_0xb316('0x3a')]})[_0xb316('0x24')](function(_0x22ac31){_0x44b76a[_0xb316('0x1e')]=_0x22ac31;if(_0x3c388b[_0xb316('0x31')]['includeAll']){_0x2f0348[_0xb316('0x41')]=[{'all':!![]}];}return db[_0xb316('0x5b')][_0xb316('0x5c')](_0x2f0348);})[_0xb316('0x24')](function(_0x2995c0){_0x44b76a[_0xb316('0x5d')]=_0x2995c0;return _0x44b76a;});}})[_0xb316('0x24')](respondWithFilteredResult(_0x695ebe,_0x2f0348))[_0xb316('0x42')](handleError(_0x695ebe,null));};exports[_0xb316('0x5e')]=function(_0x184e6d,_0x16d93f,_0x457659){var _0x391b63={'raw':!![],'where':{}};var _0x57074c={};var _0x140f30={'count':0x0,'rows':[]};return db[_0xb316('0x3f')][_0xb316('0x58')]({'where':{'id':_0x184e6d['params']['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x16d93f,null))[_0xb316('0x24')](function(_0x12556e){if(_0x12556e){_0x57074c[_0xb316('0x2f')]=_[_0xb316('0x45')](db['CmHopperHistory'][_0xb316('0x2b')]);_0x57074c[_0xb316('0x31')]=_[_0xb316('0x45')](_0x184e6d[_0xb316('0x31')]);_0x57074c[_0xb316('0x32')]=_[_0xb316('0x46')](_0x57074c['model'],_0x57074c['query']);_0x391b63['attributes']=_[_0xb316('0x46')](_0x57074c[_0xb316('0x2f')],qs['fields'](_0x184e6d[_0xb316('0x31')][_0xb316('0x34')]));_0x391b63[_0xb316('0x33')]=_0x391b63[_0xb316('0x33')][_0xb316('0x47')]?_0x391b63['attributes']:_0x57074c['model'];if(!_0x184e6d[_0xb316('0x31')]['hasOwnProperty'](_0xb316('0x59'))){_0x391b63[_0xb316('0x36')]=qs[_0xb316('0x36')](_0x184e6d['query'][_0xb316('0x36')]);_0x391b63[_0xb316('0x37')]=qs[_0xb316('0x37')](_0x184e6d['query'][_0xb316('0x37')]);}_0x391b63[_0xb316('0x38')]=qs[_0xb316('0x39')](_0x184e6d[_0xb316('0x31')]['sort']);_0x391b63[_0xb316('0x3a')]=qs[_0xb316('0x32')](_[_0xb316('0x3b')](_0x184e6d[_0xb316('0x31')],_0x57074c['filters']));_0x391b63[_0xb316('0x3a')][_0xb316('0x5a')]=_0x12556e['id'];if(_0x184e6d[_0xb316('0x31')][_0xb316('0x3c')]){_0x391b63[_0xb316('0x3a')]=_[_0xb316('0x48')](_0x391b63[_0xb316('0x3a')],{'$or':_['map'](_0x391b63[_0xb316('0x33')],function(_0x4c18e2){var _0x7535a5={};_0x7535a5[_0x4c18e2]={'$like':'%'+_0x184e6d[_0xb316('0x31')][_0xb316('0x3c')]+'%'};return _0x7535a5;})});}_0x391b63=_['merge']({},_0x391b63,_0x184e6d['options']);return db[_0xb316('0x5f')]['count']({'where':_0x391b63['where']})[_0xb316('0x24')](function(_0x2cbaee){_0x140f30[_0xb316('0x1e')]=_0x2cbaee;if(_0x184e6d['query'][_0xb316('0x40')]){_0x391b63[_0xb316('0x41')]=[{'all':!![]}];}return db[_0xb316('0x5f')][_0xb316('0x5c')](_0x391b63);})['then'](function(_0x161bbe){_0x140f30['rows']=_0x161bbe;return _0x140f30;});}})[_0xb316('0x24')](respondWithFilteredResult(_0x16d93f,_0x391b63))[_0xb316('0x42')](handleError(_0x16d93f,null));};exports['getHopperFinals']=function(_0x4daf85,_0x5ee730,_0x312660){var _0x3ea249={'raw':!![],'where':{}};var _0x1cd9e5={};var _0x62bbe3={'count':0x0,'rows':[]};return db[_0xb316('0x3f')][_0xb316('0x58')]({'where':{'id':_0x4daf85['params']['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x5ee730,null))[_0xb316('0x24')](function(_0x4e3e0f){if(_0x4e3e0f){_0x1cd9e5[_0xb316('0x2f')]=_[_0xb316('0x45')](db[_0xb316('0x60')]['rawAttributes']);_0x1cd9e5[_0xb316('0x31')]=_[_0xb316('0x45')](_0x4daf85[_0xb316('0x31')]);_0x1cd9e5[_0xb316('0x32')]=_[_0xb316('0x46')](_0x1cd9e5[_0xb316('0x2f')],_0x1cd9e5[_0xb316('0x31')]);_0x3ea249[_0xb316('0x33')]=_['intersection'](_0x1cd9e5['model'],qs[_0xb316('0x34')](_0x4daf85[_0xb316('0x31')][_0xb316('0x34')]));_0x3ea249['attributes']=_0x3ea249[_0xb316('0x33')][_0xb316('0x47')]?_0x3ea249[_0xb316('0x33')]:_0x1cd9e5['model'];if(!_0x4daf85['query'][_0xb316('0x35')]('nolimit')){_0x3ea249[_0xb316('0x36')]=qs['limit'](_0x4daf85[_0xb316('0x31')][_0xb316('0x36')]);_0x3ea249['offset']=qs[_0xb316('0x37')](_0x4daf85['query'][_0xb316('0x37')]);}_0x3ea249['order']=qs[_0xb316('0x39')](_0x4daf85['query'][_0xb316('0x39')]);_0x3ea249['where']=qs[_0xb316('0x32')](_[_0xb316('0x3b')](_0x4daf85['query'],_0x1cd9e5[_0xb316('0x32')]));_0x3ea249['where'][_0xb316('0x5a')]=_0x4e3e0f['id'];if(_0x4daf85[_0xb316('0x31')]['filter']){_0x3ea249[_0xb316('0x3a')]=_['merge'](_0x3ea249[_0xb316('0x3a')],{'$or':_[_0xb316('0x30')](_0x3ea249['attributes'],function(_0x5c78a8){var _0x2758bf={};_0x2758bf[_0x5c78a8]={'$like':'%'+_0x4daf85[_0xb316('0x31')][_0xb316('0x3c')]+'%'};return _0x2758bf;})});}_0x3ea249=_[_0xb316('0x48')]({},_0x3ea249,_0x4daf85[_0xb316('0x3e')]);return db[_0xb316('0x60')][_0xb316('0x1e')]({'where':_0x3ea249[_0xb316('0x3a')]})[_0xb316('0x24')](function(_0x1bc554){_0x62bbe3[_0xb316('0x1e')]=_0x1bc554;if(_0x4daf85[_0xb316('0x31')]['includeAll']){_0x3ea249[_0xb316('0x41')]=[{'all':!![]}];}return db[_0xb316('0x60')][_0xb316('0x5c')](_0x3ea249);})['then'](function(_0x4a947d){_0x62bbe3[_0xb316('0x5d')]=_0x4a947d;return _0x62bbe3;});}})[_0xb316('0x24')](respondWithFilteredResult(_0x5ee730,_0x3ea249))['catch'](handleError(_0x5ee730,null));};exports['getHopperBlacks']=function(_0x4f3aa4,_0xa9376f,_0x4f1d20){var _0x35975d={'raw':!![],'where':{}};var _0xe400eb={};var _0x4c80a0={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4f3aa4['params']['id']}})[_0xb316('0x24')](handleEntityNotFound(_0xa9376f,null))['then'](function(_0x82823){if(_0x82823){_0xe400eb[_0xb316('0x2f')]=_[_0xb316('0x45')](db[_0xb316('0x61')][_0xb316('0x2b')]);_0xe400eb[_0xb316('0x31')]=_[_0xb316('0x45')](_0x4f3aa4['query']);_0xe400eb[_0xb316('0x32')]=_[_0xb316('0x46')](_0xe400eb[_0xb316('0x2f')],_0xe400eb[_0xb316('0x31')]);_0x35975d[_0xb316('0x33')]=_['intersection'](_0xe400eb['model'],qs['fields'](_0x4f3aa4['query']['fields']));_0x35975d['attributes']=_0x35975d[_0xb316('0x33')]['length']?_0x35975d['attributes']:_0xe400eb[_0xb316('0x2f')];if(!_0x4f3aa4[_0xb316('0x31')][_0xb316('0x35')](_0xb316('0x59'))){_0x35975d[_0xb316('0x36')]=qs[_0xb316('0x36')](_0x4f3aa4[_0xb316('0x31')][_0xb316('0x36')]);_0x35975d[_0xb316('0x37')]=qs[_0xb316('0x37')](_0x4f3aa4['query']['offset']);}_0x35975d[_0xb316('0x38')]=qs[_0xb316('0x39')](_0x4f3aa4['query'][_0xb316('0x39')]);_0x35975d['where']=qs[_0xb316('0x32')](_['pick'](_0x4f3aa4[_0xb316('0x31')],_0xe400eb[_0xb316('0x32')]));_0x35975d[_0xb316('0x3a')][_0xb316('0x5a')]=_0x82823['id'];if(_0x4f3aa4['query']['filter']){_0x35975d[_0xb316('0x3a')]=_[_0xb316('0x48')](_0x35975d[_0xb316('0x3a')],{'$or':_[_0xb316('0x30')](_0x35975d[_0xb316('0x33')],function(_0x37cc45){var _0x553c80={};_0x553c80[_0x37cc45]={'$like':'%'+_0x4f3aa4['query'][_0xb316('0x3c')]+'%'};return _0x553c80;})});}_0x35975d=_[_0xb316('0x48')]({},_0x35975d,_0x4f3aa4[_0xb316('0x3e')]);return db[_0xb316('0x61')][_0xb316('0x1e')]({'where':_0x35975d[_0xb316('0x3a')]})[_0xb316('0x24')](function(_0x2c3982){_0x4c80a0['count']=_0x2c3982;if(_0x4f3aa4['query'][_0xb316('0x40')]){_0x35975d[_0xb316('0x41')]=[{'all':!![]}];}return db[_0xb316('0x61')][_0xb316('0x5c')](_0x35975d);})[_0xb316('0x24')](function(_0x519050){_0x4c80a0[_0xb316('0x5d')]=_0x519050;return _0x4c80a0;});}})[_0xb316('0x24')](respondWithFilteredResult(_0xa9376f,_0x35975d))[_0xb316('0x42')](handleError(_0xa9376f,null));};exports[_0xb316('0x62')]=function(_0x3b7c8e,_0x145043,_0x1ba87a){var _0x51082c={};var _0x491fe1={};var _0x3686c4;var _0x470f9d;return db[_0xb316('0x3f')][_0xb316('0x58')]({'where':{'id':_0x3b7c8e['params']['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x145043,null))[_0xb316('0x24')](function(_0x3e0acb){if(_0x3e0acb){_0x3686c4=_0x3e0acb;_0x491fe1[_0xb316('0x2f')]=_[_0xb316('0x45')](db[_0xb316('0x63')][_0xb316('0x2b')]);_0x491fe1[_0xb316('0x31')]=_[_0xb316('0x45')](_0x3b7c8e['query']);_0x491fe1['filters']=_[_0xb316('0x46')](_0x491fe1['model'],_0x491fe1[_0xb316('0x31')]);_0x51082c[_0xb316('0x33')]=_[_0xb316('0x46')](_0x491fe1['model'],qs[_0xb316('0x34')](_0x3b7c8e['query'][_0xb316('0x34')]));_0x51082c[_0xb316('0x33')]=_0x51082c[_0xb316('0x33')][_0xb316('0x47')]?_0x51082c[_0xb316('0x33')]:_0x491fe1[_0xb316('0x2f')];_0x51082c[_0xb316('0x38')]=qs[_0xb316('0x39')](_0x3b7c8e[_0xb316('0x31')][_0xb316('0x39')]);_0x51082c[_0xb316('0x3a')]=qs[_0xb316('0x32')](_['pick'](_0x3b7c8e[_0xb316('0x31')],_0x491fe1[_0xb316('0x32')]));if(_0x3b7c8e['query'][_0xb316('0x3c')]){_0x51082c[_0xb316('0x3a')]=_[_0xb316('0x48')](_0x51082c[_0xb316('0x3a')],{'$or':_[_0xb316('0x30')](_0x51082c[_0xb316('0x33')],function(_0x21fdc3){var _0x2b984f={};_0x2b984f[_0x21fdc3]={'$like':'%'+_0x3b7c8e['query'][_0xb316('0x3c')]+'%'};return _0x2b984f;})});}_0x51082c=_[_0xb316('0x48')]({},_0x51082c,_0x3b7c8e[_0xb316('0x3e')]);return _0x3686c4['getLists'](_0x51082c);}})['then'](function(_0x3f97f4){if(_0x3f97f4){_0x470f9d=_0x3f97f4[_0xb316('0x47')];if(!_0x3b7c8e[_0xb316('0x31')]['hasOwnProperty'](_0xb316('0x59'))){_0x51082c[_0xb316('0x36')]=qs['limit'](_0x3b7c8e[_0xb316('0x31')][_0xb316('0x36')]);_0x51082c[_0xb316('0x37')]=qs[_0xb316('0x37')](_0x3b7c8e[_0xb316('0x31')][_0xb316('0x37')]);}return _0x3686c4[_0xb316('0x62')](_0x51082c);}})[_0xb316('0x24')](function(_0x3a479c){if(_0x3a479c){return _0x3a479c?{'count':_0x470f9d,'rows':_0x3a479c}:null;}})[_0xb316('0x24')](respondWithResult(_0x145043,null))[_0xb316('0x42')](handleError(_0x145043,null));};exports[_0xb316('0x64')]=function(_0x2c8f28,_0x18c94e,_0x340db3){var _0x4670db,_0x372037;var _0x9e58c5=[];var _0x9cefe=moment()[_0xb316('0x65')](_0xb316('0x66'));return db[_0xb316('0x3f')][_0xb316('0x4f')]({'where':{'id':_0x2c8f28['params']['id']}})['then'](handleEntityNotFound(_0x18c94e,null))[_0xb316('0x24')](function(_0x37f3fa){if(_0x37f3fa){_0x372037=_0x37f3fa;return _0x37f3fa[_0xb316('0x64')](_0x2c8f28['body'][_0xb316('0x67')],_[_0xb316('0x54')](_0x2c8f28[_0xb316('0x4a')],['ids','id'])||{});}return null;})[_0xb316('0x68')](function(_0x3aedcb){var _0x3d2db8;var _0x301bb9;_0x4670db=_0x3aedcb||[];var _0x33968b=[];if(_0x3aedcb){for(var _0x2ab203=0x0;_0x2ab203<_0x3aedcb[_0xb316('0x47')];_0x2ab203+=0x1){var _0x4336c3=_0x3aedcb[_0x2ab203][_0xb316('0x25')]({'plain':!![]});_0x372037['dialCheckDuplicateType']=_0x2c8f28[_0xb316('0x4a')][_0xb316('0x69')]?_0x2c8f28['body'][_0xb316('0x69')]:_0x372037[_0xb316('0x69')];switch(_0x372037['dialCheckDuplicateType']){case _0xb316('0x6a'):_0x3d2db8=squel[_0xb316('0x6b')]()[_0xb316('0x6c')](_0xb316('0x6d'))[_0xb316('0x6e')]([_0xb316('0x6f'),'scheduledAt',_0xb316('0x70'),_0xb316('0x71'),_0xb316('0x5a'),_0xb316('0x52'),_0xb316('0x53')],squel[_0xb316('0x72')]()[_0xb316('0x73')](_0xb316('0x6f'),_0xb316('0x6f'))[_0xb316('0x73')](_0xb316('0x74'),'scheduledAt')['field']('id',_0xb316('0x70'))[_0xb316('0x73')](_0x4336c3[_0xb316('0x75')][_0xb316('0x76')](),_0xb316('0x71'))[_0xb316('0x73')](_0x2c8f28[_0xb316('0x44')]['id'][_0xb316('0x76')](),'CampaignId')['field']('\x27'+_0x9cefe+'\x27','createdAt')[_0xb316('0x73')]('\x27'+_0x9cefe+'\x27',_0xb316('0x53'))[_0xb316('0x77')](_0xb316('0x78'))[_0xb316('0x3a')](_0xb316('0x79'))[_0xb316('0x3a')]('ListId\x20=\x20?',_0x4336c3[_0xb316('0x75')][_0xb316('0x76')]())[_0xb316('0x3a')](_0xb316('0x7a'))[_0xb316('0x3a')](_0xb316('0x7b'),squel[_0xb316('0x72')]()['field'](_0xb316('0x7c'))[_0xb316('0x77')]('cm_hopper_final')[_0xb316('0x3a')](_0xb316('0x7d'),_0x2c8f28['params']['id'][_0xb316('0x76')]()))[_0xb316('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb316('0x72')]()[_0xb316('0x73')](_0xb316('0x7e'))[_0xb316('0x77')](_0xb316('0x6d'))[_0xb316('0x3a')](_0xb316('0x7d'),_0x2c8f28[_0xb316('0x44')]['id']['toString']())))[_0xb316('0x76')]();break;case'onlyIfOpen':_0x3d2db8=squel[_0xb316('0x6b')]()[_0xb316('0x6c')](_0xb316('0x6d'))[_0xb316('0x6e')](['phone','scheduledAt',_0xb316('0x70'),_0xb316('0x71'),_0xb316('0x5a'),_0xb316('0x52'),_0xb316('0x53')],squel[_0xb316('0x72')]()['field'](_0xb316('0x6f'),'phone')[_0xb316('0x73')](_0xb316('0x74'),'scheduledAt')[_0xb316('0x73')]('id','ContactId')[_0xb316('0x73')](_0x4336c3[_0xb316('0x75')][_0xb316('0x76')](),'ListId')[_0xb316('0x73')](_0x2c8f28[_0xb316('0x44')]['id'][_0xb316('0x76')](),_0xb316('0x5a'))[_0xb316('0x73')]('\x27'+_0x9cefe+'\x27','createdAt')['field']('\x27'+_0x9cefe+'\x27',_0xb316('0x53'))[_0xb316('0x77')](_0xb316('0x78'))[_0xb316('0x3a')](_0xb316('0x79'))[_0xb316('0x3a')](_0xb316('0x7f'),_0x4336c3[_0xb316('0x75')]['toString']())[_0xb316('0x3a')](_0xb316('0x7a'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xb316('0x73')](_0xb316('0x7e'))['from'](_0xb316('0x6d'))[_0xb316('0x3a')](_0xb316('0x7d'),_0x2c8f28[_0xb316('0x44')]['id']['toString']())))['toString']();break;default:_0x3d2db8=squel[_0xb316('0x6b')]()[_0xb316('0x6c')](_0xb316('0x6d'))[_0xb316('0x6e')]([_0xb316('0x6f'),_0xb316('0x80'),'ContactId',_0xb316('0x71'),_0xb316('0x5a'),'createdAt',_0xb316('0x53')],squel['select']()[_0xb316('0x73')](_0xb316('0x6f'),_0xb316('0x6f'))[_0xb316('0x73')]('NOW()',_0xb316('0x80'))['field']('id',_0xb316('0x70'))[_0xb316('0x73')](_0x4336c3[_0xb316('0x75')][_0xb316('0x76')](),_0xb316('0x71'))[_0xb316('0x73')](_0x2c8f28['params']['id']['toString'](),_0xb316('0x5a'))[_0xb316('0x73')]('\x27'+_0x9cefe+'\x27',_0xb316('0x52'))['field']('\x27'+_0x9cefe+'\x27',_0xb316('0x53'))[_0xb316('0x77')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xb316('0x3a')](_0xb316('0x7f'),_0x4336c3[_0xb316('0x75')][_0xb316('0x76')]())[_0xb316('0x3a')](_0xb316('0x7a')))[_0xb316('0x76')]();}_0x301bb9=squel[_0xb316('0x6b')]()[_0xb316('0x6c')]('cm_hopper_additional_phones')['fromQuery']([_0xb316('0x81'),'scheduledAt',_0xb316('0x6f'),_0xb316('0x82'),_0xb316('0x52'),_0xb316('0x53')],squel[_0xb316('0x72')]()[_0xb316('0x73')](_0xb316('0x83'),'id')[_0xb316('0x73')](_0xb316('0x74'),'scheduledAt')['field']('ci.item',_0xb316('0x6f'))[_0xb316('0x73')]('ci.OrderBY',_0xb316('0x82'))[_0xb316('0x73')]('\x27'+_0x9cefe+'\x27',_0xb316('0x52'))[_0xb316('0x73')]('\x27'+_0x9cefe+'\x27',_0xb316('0x53'))[_0xb316('0x77')](_0xb316('0x84'),'ci')[_0xb316('0x85')](_0xb316('0x6d'),'h',_0xb316('0x86'))[_0xb316('0x3a')](_0xb316('0x87'),_0x4336c3[_0xb316('0x75')][_0xb316('0x76')]())[_0xb316('0x3a')](_0xb316('0x88'),_0x2c8f28[_0xb316('0x44')]['id'][_0xb316('0x76')]())[_0xb316('0x3a')](_0xb316('0x89'),_0x9cefe))[_0xb316('0x76')]();_0x33968b[_0xb316('0x8a')](db[_0xb316('0x8b')][_0xb316('0x31')](_0x3d2db8));_0x9e58c5[_0xb316('0x8a')](db[_0xb316('0x8b')][_0xb316('0x31')](_0x301bb9));}return BPromise[_0xb316('0x8c')](_0x33968b);}})['then'](function(){return BPromise[_0xb316('0x8c')](_0x9e58c5);})[_0xb316('0x24')](function(){return _0x4670db;})[_0xb316('0x24')](respondWithResult(_0x18c94e,null))[_0xb316('0x42')](handleError(_0x18c94e,null));};exports[_0xb316('0x8d')]=function(_0x1b9e66,_0xfb88ba,_0x26e457){return db[_0xb316('0x3f')][_0xb316('0x4f')]({'where':{'id':_0x1b9e66[_0xb316('0x44')]['id']}})[_0xb316('0x24')](handleEntityNotFound(_0xfb88ba,null))['then'](function(_0x340be6){if(_0x340be6){return _0x340be6[_0xb316('0x8d')](_0x1b9e66[_0xb316('0x31')][_0xb316('0x67')]);}})[_0xb316('0x24')](function(_0x436a50){if(_0x436a50){return db[_0xb316('0x5b')][_0xb316('0x28')]({'where':{'ListId':_0x1b9e66[_0xb316('0x31')][_0xb316('0x67')],'CampaignId':_0x1b9e66['params']['id']}})[_0xb316('0x24')](function(){return _0x436a50;});}})['then'](respondWithStatusCode(_0xfb88ba,null))[_0xb316('0x42')](handleError(_0xfb88ba,null));};exports[_0xb316('0x8e')]=function(_0x24fac9,_0xf21d91,_0xc1c6a3){var _0x37b8bb={};var _0x192225={};var _0x35dc3e;var _0x273776;return db[_0xb316('0x3f')]['findOne']({'where':{'id':_0x24fac9[_0xb316('0x44')]['id']}})[_0xb316('0x24')](handleEntityNotFound(_0xf21d91,null))[_0xb316('0x24')](function(_0x2db500){if(_0x2db500){_0x35dc3e=_0x2db500;_0x192225[_0xb316('0x2f')]=_[_0xb316('0x45')](db[_0xb316('0x63')][_0xb316('0x2b')]);_0x192225[_0xb316('0x31')]=_[_0xb316('0x45')](_0x24fac9[_0xb316('0x31')]);_0x192225[_0xb316('0x32')]=_[_0xb316('0x46')](_0x192225[_0xb316('0x2f')],_0x192225[_0xb316('0x31')]);_0x37b8bb['attributes']=_[_0xb316('0x46')](_0x192225['model'],qs[_0xb316('0x34')](_0x24fac9[_0xb316('0x31')][_0xb316('0x34')]));_0x37b8bb[_0xb316('0x33')]=_0x37b8bb['attributes'][_0xb316('0x47')]?_0x37b8bb[_0xb316('0x33')]:_0x192225[_0xb316('0x2f')];_0x37b8bb[_0xb316('0x38')]=qs[_0xb316('0x39')](_0x24fac9['query'][_0xb316('0x39')]);_0x37b8bb[_0xb316('0x3a')]=qs[_0xb316('0x32')](_[_0xb316('0x3b')](_0x24fac9[_0xb316('0x31')],_0x192225[_0xb316('0x32')]));if(_0x24fac9[_0xb316('0x31')][_0xb316('0x3c')]){_0x37b8bb[_0xb316('0x3a')]=_[_0xb316('0x48')](_0x37b8bb[_0xb316('0x3a')],{'$or':_[_0xb316('0x30')](_0x37b8bb['attributes'],function(_0x1736d8){var _0x41faf8={};_0x41faf8[_0x1736d8]={'$like':'%'+_0x24fac9[_0xb316('0x31')]['filter']+'%'};return _0x41faf8;})});}_0x37b8bb=_[_0xb316('0x48')]({},_0x37b8bb,_0x24fac9[_0xb316('0x3e')]);return _0x35dc3e[_0xb316('0x8e')](_0x37b8bb);}})[_0xb316('0x24')](function(_0x57d15c){if(_0x57d15c){_0x273776=_0x57d15c[_0xb316('0x47')];if(!_0x24fac9[_0xb316('0x31')]['hasOwnProperty'](_0xb316('0x59'))){_0x37b8bb[_0xb316('0x36')]=qs['limit'](_0x24fac9[_0xb316('0x31')][_0xb316('0x36')]);_0x37b8bb['offset']=qs[_0xb316('0x37')](_0x24fac9[_0xb316('0x31')]['offset']);}return _0x35dc3e['getBlackLists'](_0x37b8bb);}})[_0xb316('0x24')](function(_0x118106){if(_0x118106){return _0x118106?{'count':_0x273776,'rows':_0x118106}:null;}})['then'](respondWithResult(_0xf21d91,null))['catch'](handleError(_0xf21d91,null));};exports[_0xb316('0x8f')]=function(_0x3274f8,_0x5b5df2,_0x311306){var _0x6ec3bf,_0xd9dc4e;var _0x1f0c6c=[];var _0x12dcf5=moment()[_0xb316('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xb316('0x3f')][_0xb316('0x4f')]({'where':{'id':_0x3274f8[_0xb316('0x44')]['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x5b5df2,null))[_0xb316('0x24')](function(_0x5a418b){if(_0x5a418b){_0xd9dc4e=_0x5a418b;return _0x5a418b[_0xb316('0x8f')](_0x3274f8[_0xb316('0x4a')][_0xb316('0x67')],_[_0xb316('0x54')](_0x3274f8[_0xb316('0x4a')],[_0xb316('0x67'),'id'])||{});}return null;})[_0xb316('0x68')](function(_0x2a1bd9){var _0xf0a7ab;var _0x6406bc;_0x6ec3bf=_0x2a1bd9||[];var _0x46c86b=[];if(_0x2a1bd9){for(var _0x4994f5=0x0;_0x4994f5<_0x2a1bd9[_0xb316('0x47')];_0x4994f5+=0x1){var _0x3d94ef=_0x2a1bd9[_0x4994f5]['get']({'plain':!![]});_0xf0a7ab=squel[_0xb316('0x6b')]()[_0xb316('0x6c')](_0xb316('0x90'))[_0xb316('0x6e')](['phone',_0xb316('0x70'),_0xb316('0x71'),_0xb316('0x5a'),_0xb316('0x52'),_0xb316('0x53')],squel[_0xb316('0x72')]()[_0xb316('0x73')]('phone','phone')[_0xb316('0x73')]('id',_0xb316('0x70'))[_0xb316('0x73')](_0x3d94ef[_0xb316('0x75')][_0xb316('0x76')](),_0xb316('0x71'))[_0xb316('0x73')](_0x3274f8[_0xb316('0x44')]['id']['toString'](),'CampaignId')[_0xb316('0x73')](_0xb316('0x74'),_0xb316('0x52'))['field']('NOW()',_0xb316('0x53'))['from']('cm_contacts')[_0xb316('0x3a')](_0xb316('0x79'))[_0xb316('0x3a')](_0xb316('0x7f'),_0x3d94ef[_0xb316('0x75')]['toString']())[_0xb316('0x3a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x46c86b[_0xb316('0x8a')](db[_0xb316('0x8b')]['query'](_0xf0a7ab));}return BPromise[_0xb316('0x8c')](_0x46c86b);}})[_0xb316('0x24')](function(){return _0x6ec3bf;})['then'](respondWithResult(_0x5b5df2,null))[_0xb316('0x42')](handleError(_0x5b5df2,null));};exports['removeBlackLists']=function(_0x456d74,_0x1471c4,_0x12b76d){return db[_0xb316('0x3f')]['find']({'where':{'id':_0x456d74['params']['id']}})[_0xb316('0x24')](handleEntityNotFound(_0x1471c4,null))['then'](function(_0x152e8a){if(_0x152e8a){return _0x152e8a[_0xb316('0x91')](_0x456d74[_0xb316('0x31')][_0xb316('0x67')]);}})[_0xb316('0x24')](function(_0x4d95f1){if(_0x4d95f1){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x456d74[_0xb316('0x31')][_0xb316('0x67')],'CampaignId':_0x456d74[_0xb316('0x44')]['id']}})[_0xb316('0x24')](function(){return _0x4d95f1;});}})['then'](respondWithStatusCode(_0x1471c4,null))[_0xb316('0x42')](handleError(_0x1471c4,null));};
\ No newline at end of file
+var _0x9c02=['limit','count','set','Content-Range','apply','reject','save','then','destroy','IvrCampaigns','stack','name','index','map','Campaign','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','find','create','body','user','get','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','include','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','update','getHoppers','findOne','nolimit','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ListId','cm_hopper_additional_phones','fromQuery','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','mustache','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0xf04221,_0x4c7328){var _0x57a74d=function(_0x5c4187){while(--_0x5c4187){_0xf04221['push'](_0xf04221['shift']());}};_0x57a74d(++_0x4c7328);}(_0x9c02,0x196));var _0x29c0=function(_0x222f1b,_0x3a8cdc){_0x222f1b=_0x222f1b-0x0;var _0x132412=_0x9c02[_0x222f1b];return _0x132412;};'use strict';var emlformat=require(_0x29c0('0x0'));var rimraf=require(_0x29c0('0x1'));var zipdir=require(_0x29c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x29c0('0x3'));var util=require('util');var path=require(_0x29c0('0x4'));var sox=require('sox');var csv=require(_0x29c0('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29c0('0x6'));var _=require(_0x29c0('0x7'));var squel=require(_0x29c0('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x29c0('0x9'));var toCsv=require(_0x29c0('0x5'));var querystring=require(_0x29c0('0xa'));var Papa=require(_0x29c0('0xb'));var Redis=require(_0x29c0('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x29c0('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29c0('0xe'))(_0x29c0('0xf'));var utils=require(_0x29c0('0x10'));var config=require(_0x29c0('0x11'));var licenseUtil=require(_0x29c0('0x12'));var db=require(_0x29c0('0x13'))['db'];function respondWithStatusCode(_0x5b4ef2,_0x7a6a5e){_0x7a6a5e=_0x7a6a5e||0xcc;return function(_0x350922){if(_0x350922){return _0x5b4ef2[_0x29c0('0x14')](_0x7a6a5e);}return _0x5b4ef2[_0x29c0('0x15')](_0x7a6a5e)[_0x29c0('0x16')]();};}function respondWithResult(_0x28cc02,_0x1e622a){_0x1e622a=_0x1e622a||0xc8;return function(_0x2947da){if(_0x2947da){return _0x28cc02[_0x29c0('0x15')](_0x1e622a)[_0x29c0('0x17')](_0x2947da);}};}function respondWithFilteredResult(_0x4721f0,_0xccb222){return function(_0x235725){if(_0x235725){var _0x1ce122=typeof _0xccb222[_0x29c0('0x18')]===_0x29c0('0x19')&&typeof _0xccb222[_0x29c0('0x1a')]===_0x29c0('0x19');var _0x4309fc=_0x235725[_0x29c0('0x1b')];var _0x627c4c=_0x1ce122?0x0:_0xccb222[_0x29c0('0x18')];var _0x2bfa71=_0x1ce122?_0x235725[_0x29c0('0x1b')]:_0xccb222[_0x29c0('0x18')]+_0xccb222[_0x29c0('0x1a')];var _0x311c9b;if(_0x2bfa71>=_0x4309fc){_0x2bfa71=_0x4309fc;_0x311c9b=0xc8;}else{_0x311c9b=0xce;}_0x4721f0['status'](_0x311c9b);return _0x4721f0[_0x29c0('0x1c')](_0x29c0('0x1d'),_0x627c4c+'-'+_0x2bfa71+'/'+_0x4309fc)[_0x29c0('0x17')](_0x235725);}return null;};}function patchUpdates(_0x3c3eb2){return function(_0x38eab0){try{jsonpatch[_0x29c0('0x1e')](_0x38eab0,_0x3c3eb2,!![]);}catch(_0x54f8f1){return BPromise[_0x29c0('0x1f')](_0x54f8f1);}return _0x38eab0[_0x29c0('0x20')]();};}function saveUpdates(_0x45a6cb,_0x26bf2e){return function(_0x1f962f){if(_0x1f962f){return _0x1f962f['update'](_0x45a6cb)[_0x29c0('0x21')](function(_0x42b082){return _0x42b082;});}return null;};}function removeEntity(_0x5846d0,_0x1114a8){return function(_0x402c54){if(_0x402c54){return _0x402c54[_0x29c0('0x22')]()['then'](function(){var _0x1993a5=_0x402c54['get']({'plain':!![]});var _0x161b39=_0x29c0('0x23');return db['UserProfileResource'][_0x29c0('0x22')]({'where':{'type':_0x161b39,'resourceId':_0x1993a5['id']}})[_0x29c0('0x21')](function(){return _0x402c54;});})[_0x29c0('0x21')](function(){_0x5846d0[_0x29c0('0x15')](0xcc)[_0x29c0('0x16')]();});}};}function handleEntityNotFound(_0x46be76,_0x4d11b3){return function(_0x531c2c){if(!_0x531c2c){_0x46be76['sendStatus'](0x194);}return _0x531c2c;};}function handleError(_0x3a684c,_0x9803d5){_0x9803d5=_0x9803d5||0x1f4;return function(_0x4cdf7c){logger['error'](_0x4cdf7c[_0x29c0('0x24')]);if(_0x4cdf7c[_0x29c0('0x25')]){delete _0x4cdf7c['name'];}_0x3a684c['status'](_0x9803d5)['send'](_0x4cdf7c);};}exports[_0x29c0('0x26')]=function(_0x193e55,_0x322c86){var _0x4edead={},_0x19dd04={},_0x291748={'count':0x0,'rows':[]};var _0x598bc4=_[_0x29c0('0x27')](db[_0x29c0('0x28')][_0x29c0('0x29')],function(_0x188910){return{'name':_0x188910[_0x29c0('0x2a')],'type':_0x188910[_0x29c0('0x2b')][_0x29c0('0x2c')]};});_0x19dd04['model']=_['map'](_0x598bc4,_0x29c0('0x25'));_0x19dd04[_0x29c0('0x2d')]=_[_0x29c0('0x2e')](_0x193e55['query']);_0x19dd04[_0x29c0('0x2f')]=_[_0x29c0('0x30')](_0x19dd04['model'],_0x19dd04['query']);_0x4edead[_0x29c0('0x31')]=_[_0x29c0('0x30')](_0x19dd04[_0x29c0('0x32')],qs[_0x29c0('0x33')](_0x193e55[_0x29c0('0x2d')][_0x29c0('0x33')]));_0x4edead[_0x29c0('0x31')]=_0x4edead['attributes'][_0x29c0('0x34')]?_0x4edead['attributes']:_0x19dd04[_0x29c0('0x32')];if(!_0x193e55[_0x29c0('0x2d')][_0x29c0('0x35')]('nolimit')){_0x4edead[_0x29c0('0x1a')]=qs[_0x29c0('0x1a')](_0x193e55['query'][_0x29c0('0x1a')]);_0x4edead[_0x29c0('0x18')]=qs[_0x29c0('0x18')](_0x193e55[_0x29c0('0x2d')][_0x29c0('0x18')]);}_0x4edead[_0x29c0('0x36')]=qs[_0x29c0('0x37')](_0x193e55[_0x29c0('0x2d')][_0x29c0('0x37')]);_0x4edead[_0x29c0('0x38')]=qs[_0x29c0('0x2f')](_[_0x29c0('0x39')](_0x193e55[_0x29c0('0x2d')],_0x19dd04[_0x29c0('0x2f')]),_0x598bc4);if(_0x193e55[_0x29c0('0x2d')][_0x29c0('0x3a')]){_0x4edead[_0x29c0('0x38')]=_[_0x29c0('0x3b')](_0x4edead[_0x29c0('0x38')],{'$or':_[_0x29c0('0x27')](_0x598bc4,function(_0x12df6a){if(_0x12df6a[_0x29c0('0x2b')]!==_0x29c0('0x3c')){var _0x5d42f6={};_0x5d42f6[_0x12df6a[_0x29c0('0x25')]]={'$like':'%'+_0x193e55[_0x29c0('0x2d')][_0x29c0('0x3a')]+'%'};return _0x5d42f6;}})});}_0x4edead=_[_0x29c0('0x3b')]({},_0x4edead,_0x193e55[_0x29c0('0x3d')]);var _0x4f1900={'where':_0x4edead[_0x29c0('0x38')]};return db[_0x29c0('0x28')][_0x29c0('0x1b')](_0x4f1900)['then'](function(_0x42d7b9){_0x291748[_0x29c0('0x1b')]=_0x42d7b9;if(_0x193e55['query'][_0x29c0('0x3e')]){_0x4edead['include']=[{'all':!![]}];}return db[_0x29c0('0x28')]['findAll'](_0x4edead);})[_0x29c0('0x21')](function(_0x406a23){_0x291748[_0x29c0('0x3f')]=_0x406a23;return _0x291748;})[_0x29c0('0x21')](respondWithFilteredResult(_0x322c86,_0x4edead))[_0x29c0('0x40')](handleError(_0x322c86,null));};exports[_0x29c0('0x41')]=function(_0x4b1d0d,_0x4a277b){var _0x2dfcb7={'raw':![],'where':{'id':_0x4b1d0d['params']['id']}},_0x44bb0d={};_0x44bb0d[_0x29c0('0x32')]=_[_0x29c0('0x2e')](db[_0x29c0('0x28')][_0x29c0('0x29')]);_0x44bb0d[_0x29c0('0x2d')]=_[_0x29c0('0x2e')](_0x4b1d0d[_0x29c0('0x2d')]);_0x44bb0d[_0x29c0('0x2f')]=_[_0x29c0('0x30')](_0x44bb0d[_0x29c0('0x32')],_0x44bb0d[_0x29c0('0x2d')]);_0x2dfcb7[_0x29c0('0x31')]=_[_0x29c0('0x30')](_0x44bb0d[_0x29c0('0x32')],qs[_0x29c0('0x33')](_0x4b1d0d[_0x29c0('0x2d')]['fields']));_0x2dfcb7[_0x29c0('0x31')]=_0x2dfcb7[_0x29c0('0x31')]['length']?_0x2dfcb7[_0x29c0('0x31')]:_0x44bb0d[_0x29c0('0x32')];if(_0x4b1d0d['query'][_0x29c0('0x3e')]){_0x2dfcb7['include']=[{'all':!![]}];}_0x2dfcb7=_[_0x29c0('0x3b')]({},_0x2dfcb7,_0x4b1d0d['options']);return db[_0x29c0('0x28')][_0x29c0('0x42')](_0x2dfcb7)[_0x29c0('0x21')](handleEntityNotFound(_0x4a277b,null))['then'](respondWithResult(_0x4a277b,null))[_0x29c0('0x40')](handleError(_0x4a277b,null));};exports['create']=function(_0x3e1386,_0x4bc495){return db[_0x29c0('0x28')][_0x29c0('0x43')](_0x3e1386[_0x29c0('0x44')],{})[_0x29c0('0x21')](function(_0x55b2b3){var _0x53edae=_0x3e1386[_0x29c0('0x45')][_0x29c0('0x46')]({'plain':!![]});if(!_0x53edae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53edae[_0x29c0('0x47')]===_0x29c0('0x45')){var _0x32e3ca=_0x55b2b3[_0x29c0('0x46')]({'plain':!![]});var _0x1d2578=_0x29c0('0x23');return db['UserProfileSection'][_0x29c0('0x42')]({'where':{'name':_0x1d2578,'userProfileId':_0x53edae[_0x29c0('0x48')]},'raw':!![]})['then'](function(_0x473072){if(_0x473072&&_0x473072[_0x29c0('0x49')]===0x0){return db['UserProfileResource'][_0x29c0('0x43')]({'name':_0x32e3ca['name'],'resourceId':_0x32e3ca['id'],'type':_0x473072['name'],'sectionId':_0x473072['id']},{})[_0x29c0('0x21')](function(){return _0x55b2b3;});}else{return _0x55b2b3;}})['catch'](function(_0x271709){logger[_0x29c0('0x4a')](_0x29c0('0x4b'),_0x271709);throw _0x271709;});}return _0x55b2b3;})[_0x29c0('0x21')](respondWithResult(_0x4bc495,0xc9))[_0x29c0('0x40')](handleError(_0x4bc495,null));};exports['clone']=function(_0x4f3d30,_0x2e3f93){var _0x4bfdb6={'where':{'id':_0x4f3d30[_0x29c0('0x4c')]['id']}},_0x36afb={};_0x36afb['model']=_[_0x29c0('0x2e')](db['Campaign'][_0x29c0('0x29')]);_0x4bfdb6['attributes']=_[_0x29c0('0x30')](_0x36afb[_0x29c0('0x32')],qs['fields'](_0x4f3d30['query']['fields']));_0x4bfdb6[_0x29c0('0x31')]=_0x4bfdb6[_0x29c0('0x31')]['length']?_0x4bfdb6['attributes']:_0x36afb[_0x29c0('0x32')];if(_0x4f3d30[_0x29c0('0x2d')][_0x29c0('0x3e')]){_0x4bfdb6[_0x29c0('0x4d')]=[{'all':!![]}];}_0x4bfdb6=_[_0x29c0('0x3b')]({},_0x4bfdb6,_0x4f3d30['options']);return db[_0x29c0('0x28')]['find'](_0x4bfdb6)[_0x29c0('0x21')](handleEntityNotFound(_0x2e3f93,null))[_0x29c0('0x21')](function(_0x203641){if(_0x203641){var _0x8bd093=_0x203641[_0x29c0('0x46')]({'plain':!![]});_0x8bd093=qs[_0x29c0('0x4e')](_0x8bd093,['id',_0x29c0('0x4f'),_0x29c0('0x50')]);_0x4f3d30[_0x29c0('0x44')]=_['omit'](_0x4f3d30['body'],['id',_0x29c0('0x4f'),_0x29c0('0x50')]);return db[_0x29c0('0x28')][_0x29c0('0x43')](_['merge'](_0x8bd093,_0x4f3d30['body']),{'include':_0x4f3d30[_0x29c0('0x2d')][_0x29c0('0x3e')]?[{'all':!![]}]:undefined})[_0x29c0('0x21')](function(_0x5a393d){var _0x4fc1bc=_0x4f3d30[_0x29c0('0x45')]['get']({'plain':!![]});if(!_0x4fc1bc)throw new Error(_0x29c0('0x51'));if(_0x4fc1bc[_0x29c0('0x47')]===_0x29c0('0x45')){var _0x2afda9=_0x5a393d[_0x29c0('0x46')]({'plain':!![]});var _0x1fecd8=_0x29c0('0x23');return db[_0x29c0('0x52')]['find']({'where':{'name':_0x1fecd8,'userProfileId':_0x4fc1bc[_0x29c0('0x48')]},'raw':!![]})['then'](function(_0x18f619){if(_0x18f619&&_0x18f619[_0x29c0('0x49')]===0x0){return db[_0x29c0('0x53')][_0x29c0('0x43')]({'name':_0x2afda9[_0x29c0('0x25')],'resourceId':_0x2afda9['id'],'type':_0x18f619[_0x29c0('0x25')],'sectionId':_0x18f619['id']},{})[_0x29c0('0x21')](function(){return _0x5a393d;});}else{return _0x5a393d;}})[_0x29c0('0x40')](function(_0x1a686f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a686f);throw _0x1a686f;});}return _0x5a393d;});}})[_0x29c0('0x21')](respondWithResult(_0x2e3f93,0xc9))[_0x29c0('0x40')](handleError(_0x2e3f93,null));};exports[_0x29c0('0x54')]=function(_0x28c970,_0x2006fd){if(_0x28c970[_0x29c0('0x44')]['id']){delete _0x28c970['body']['id'];}return db['Campaign'][_0x29c0('0x42')]({'where':{'id':_0x28c970['params']['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x2006fd,null))['then'](saveUpdates(_0x28c970['body'],null))[_0x29c0('0x21')](respondWithResult(_0x2006fd,null))['catch'](handleError(_0x2006fd,null));};exports[_0x29c0('0x22')]=function(_0x4465b9,_0x19ef14){return db[_0x29c0('0x28')][_0x29c0('0x42')]({'where':{'id':_0x4465b9['params']['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x19ef14,null))[_0x29c0('0x21')](removeEntity(_0x19ef14,null))[_0x29c0('0x40')](handleError(_0x19ef14,null));};exports[_0x29c0('0x55')]=function(_0x28fb45,_0x1acd75,_0x146a41){var _0x1001e1={'raw':!![],'where':{}};var _0x1adafe={};var _0x15eabe={'count':0x0,'rows':[]};return db['Campaign'][_0x29c0('0x56')]({'where':{'id':_0x28fb45[_0x29c0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1acd75,null))[_0x29c0('0x21')](function(_0x1ab96a){if(_0x1ab96a){_0x1adafe['model']=_[_0x29c0('0x2e')](db['CmHopper']['rawAttributes']);_0x1adafe['query']=_[_0x29c0('0x2e')](_0x28fb45[_0x29c0('0x2d')]);_0x1adafe['filters']=_[_0x29c0('0x30')](_0x1adafe['model'],_0x1adafe[_0x29c0('0x2d')]);_0x1001e1[_0x29c0('0x31')]=_[_0x29c0('0x30')](_0x1adafe[_0x29c0('0x32')],qs[_0x29c0('0x33')](_0x28fb45[_0x29c0('0x2d')][_0x29c0('0x33')]));_0x1001e1[_0x29c0('0x31')]=_0x1001e1[_0x29c0('0x31')][_0x29c0('0x34')]?_0x1001e1[_0x29c0('0x31')]:_0x1adafe[_0x29c0('0x32')];if(!_0x28fb45['query'][_0x29c0('0x35')](_0x29c0('0x57'))){_0x1001e1[_0x29c0('0x1a')]=qs[_0x29c0('0x1a')](_0x28fb45[_0x29c0('0x2d')][_0x29c0('0x1a')]);_0x1001e1[_0x29c0('0x18')]=qs['offset'](_0x28fb45[_0x29c0('0x2d')][_0x29c0('0x18')]);}_0x1001e1[_0x29c0('0x36')]=qs[_0x29c0('0x37')](_0x28fb45[_0x29c0('0x2d')][_0x29c0('0x37')]);_0x1001e1['where']=qs[_0x29c0('0x2f')](_[_0x29c0('0x39')](_0x28fb45['query'],_0x1adafe[_0x29c0('0x2f')]));_0x1001e1[_0x29c0('0x38')][_0x29c0('0x58')]=_0x1ab96a['id'];if(_0x28fb45[_0x29c0('0x2d')][_0x29c0('0x3a')]){_0x1001e1[_0x29c0('0x38')]=_[_0x29c0('0x3b')](_0x1001e1[_0x29c0('0x38')],{'$or':_['map'](_0x1001e1['attributes'],function(_0x5d4097){var _0x23d4a6={};_0x23d4a6[_0x5d4097]={'$like':'%'+_0x28fb45['query']['filter']+'%'};return _0x23d4a6;})});}_0x1001e1=_['merge']({},_0x1001e1,_0x28fb45['options']);return db['CmHopper'][_0x29c0('0x1b')]({'where':_0x1001e1['where']})[_0x29c0('0x21')](function(_0xa45593){_0x15eabe[_0x29c0('0x1b')]=_0xa45593;if(_0x28fb45['query'][_0x29c0('0x3e')]){_0x1001e1['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1001e1);})[_0x29c0('0x21')](function(_0x43bad4){_0x15eabe[_0x29c0('0x3f')]=_0x43bad4;return _0x15eabe;});}})[_0x29c0('0x21')](respondWithFilteredResult(_0x1acd75,_0x1001e1))[_0x29c0('0x40')](handleError(_0x1acd75,null));};exports[_0x29c0('0x59')]=function(_0x483427,_0x7920d5,_0x237359){var _0x5ce488={'raw':!![],'where':{}};var _0x244a09={};var _0x212940={'count':0x0,'rows':[]};return db[_0x29c0('0x28')][_0x29c0('0x56')]({'where':{'id':_0x483427[_0x29c0('0x4c')]['id']}})['then'](handleEntityNotFound(_0x7920d5,null))[_0x29c0('0x21')](function(_0x1941ba){if(_0x1941ba){_0x244a09[_0x29c0('0x32')]=_[_0x29c0('0x2e')](db['CmHopperHistory'][_0x29c0('0x29')]);_0x244a09[_0x29c0('0x2d')]=_[_0x29c0('0x2e')](_0x483427['query']);_0x244a09['filters']=_[_0x29c0('0x30')](_0x244a09[_0x29c0('0x32')],_0x244a09[_0x29c0('0x2d')]);_0x5ce488[_0x29c0('0x31')]=_[_0x29c0('0x30')](_0x244a09[_0x29c0('0x32')],qs[_0x29c0('0x33')](_0x483427[_0x29c0('0x2d')][_0x29c0('0x33')]));_0x5ce488['attributes']=_0x5ce488['attributes'][_0x29c0('0x34')]?_0x5ce488[_0x29c0('0x31')]:_0x244a09[_0x29c0('0x32')];if(!_0x483427[_0x29c0('0x2d')][_0x29c0('0x35')](_0x29c0('0x57'))){_0x5ce488[_0x29c0('0x1a')]=qs[_0x29c0('0x1a')](_0x483427[_0x29c0('0x2d')][_0x29c0('0x1a')]);_0x5ce488['offset']=qs[_0x29c0('0x18')](_0x483427[_0x29c0('0x2d')][_0x29c0('0x18')]);}_0x5ce488['order']=qs['sort'](_0x483427[_0x29c0('0x2d')][_0x29c0('0x37')]);_0x5ce488['where']=qs['filters'](_[_0x29c0('0x39')](_0x483427[_0x29c0('0x2d')],_0x244a09[_0x29c0('0x2f')]));_0x5ce488[_0x29c0('0x38')][_0x29c0('0x58')]=_0x1941ba['id'];if(_0x483427['query'][_0x29c0('0x3a')]){_0x5ce488['where']=_[_0x29c0('0x3b')](_0x5ce488[_0x29c0('0x38')],{'$or':_['map'](_0x5ce488[_0x29c0('0x31')],function(_0x28e32e){var _0x95cb56={};_0x95cb56[_0x28e32e]={'$like':'%'+_0x483427[_0x29c0('0x2d')]['filter']+'%'};return _0x95cb56;})});}_0x5ce488=_['merge']({},_0x5ce488,_0x483427[_0x29c0('0x3d')]);return db[_0x29c0('0x5a')][_0x29c0('0x1b')]({'where':_0x5ce488[_0x29c0('0x38')]})[_0x29c0('0x21')](function(_0x308170){_0x212940['count']=_0x308170;if(_0x483427['query'][_0x29c0('0x3e')]){_0x5ce488[_0x29c0('0x4d')]=[{'all':!![]}];}return db[_0x29c0('0x5a')]['findAll'](_0x5ce488);})[_0x29c0('0x21')](function(_0x432035){_0x212940[_0x29c0('0x3f')]=_0x432035;return _0x212940;});}})[_0x29c0('0x21')](respondWithFilteredResult(_0x7920d5,_0x5ce488))[_0x29c0('0x40')](handleError(_0x7920d5,null));};exports[_0x29c0('0x5b')]=function(_0x1a68a2,_0x44d789,_0x2082c1){var _0x2350c7={'raw':!![],'where':{}};var _0x4486ab={};var _0x25bcad={'count':0x0,'rows':[]};return db[_0x29c0('0x28')][_0x29c0('0x56')]({'where':{'id':_0x1a68a2[_0x29c0('0x4c')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x44d789,null))['then'](function(_0x4c531a){if(_0x4c531a){_0x4486ab[_0x29c0('0x32')]=_[_0x29c0('0x2e')](db['CmHopperFinal'][_0x29c0('0x29')]);_0x4486ab['query']=_[_0x29c0('0x2e')](_0x1a68a2[_0x29c0('0x2d')]);_0x4486ab[_0x29c0('0x2f')]=_['intersection'](_0x4486ab['model'],_0x4486ab[_0x29c0('0x2d')]);_0x2350c7['attributes']=_[_0x29c0('0x30')](_0x4486ab[_0x29c0('0x32')],qs[_0x29c0('0x33')](_0x1a68a2[_0x29c0('0x2d')][_0x29c0('0x33')]));_0x2350c7[_0x29c0('0x31')]=_0x2350c7['attributes']['length']?_0x2350c7['attributes']:_0x4486ab['model'];if(!_0x1a68a2['query'][_0x29c0('0x35')](_0x29c0('0x57'))){_0x2350c7[_0x29c0('0x1a')]=qs[_0x29c0('0x1a')](_0x1a68a2[_0x29c0('0x2d')][_0x29c0('0x1a')]);_0x2350c7[_0x29c0('0x18')]=qs[_0x29c0('0x18')](_0x1a68a2[_0x29c0('0x2d')]['offset']);}_0x2350c7['order']=qs[_0x29c0('0x37')](_0x1a68a2['query'][_0x29c0('0x37')]);_0x2350c7[_0x29c0('0x38')]=qs['filters'](_[_0x29c0('0x39')](_0x1a68a2['query'],_0x4486ab[_0x29c0('0x2f')]));_0x2350c7[_0x29c0('0x38')][_0x29c0('0x58')]=_0x4c531a['id'];if(_0x1a68a2[_0x29c0('0x2d')][_0x29c0('0x3a')]){_0x2350c7[_0x29c0('0x38')]=_['merge'](_0x2350c7[_0x29c0('0x38')],{'$or':_[_0x29c0('0x27')](_0x2350c7[_0x29c0('0x31')],function(_0x57b098){var _0x2dd8f6={};_0x2dd8f6[_0x57b098]={'$like':'%'+_0x1a68a2[_0x29c0('0x2d')][_0x29c0('0x3a')]+'%'};return _0x2dd8f6;})});}_0x2350c7=_['merge']({},_0x2350c7,_0x1a68a2[_0x29c0('0x3d')]);return db[_0x29c0('0x5c')]['count']({'where':_0x2350c7['where']})[_0x29c0('0x21')](function(_0x22a01a){_0x25bcad[_0x29c0('0x1b')]=_0x22a01a;if(_0x1a68a2[_0x29c0('0x2d')][_0x29c0('0x3e')]){_0x2350c7[_0x29c0('0x4d')]=[{'all':!![]}];}return db[_0x29c0('0x5c')][_0x29c0('0x5d')](_0x2350c7);})['then'](function(_0x7e3d54){_0x25bcad['rows']=_0x7e3d54;return _0x25bcad;});}})['then'](respondWithFilteredResult(_0x44d789,_0x2350c7))[_0x29c0('0x40')](handleError(_0x44d789,null));};exports[_0x29c0('0x5e')]=function(_0x29f492,_0x220aa1,_0xfb92a3){var _0x5c6383={'raw':!![],'where':{}};var _0x23f63e={};var _0x4e8b5f={'count':0x0,'rows':[]};return db[_0x29c0('0x28')]['findOne']({'where':{'id':_0x29f492[_0x29c0('0x4c')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x220aa1,null))['then'](function(_0x355c5c){if(_0x355c5c){_0x23f63e[_0x29c0('0x32')]=_[_0x29c0('0x2e')](db['CmHopperBlack']['rawAttributes']);_0x23f63e[_0x29c0('0x2d')]=_['keys'](_0x29f492[_0x29c0('0x2d')]);_0x23f63e[_0x29c0('0x2f')]=_[_0x29c0('0x30')](_0x23f63e[_0x29c0('0x32')],_0x23f63e[_0x29c0('0x2d')]);_0x5c6383[_0x29c0('0x31')]=_[_0x29c0('0x30')](_0x23f63e[_0x29c0('0x32')],qs[_0x29c0('0x33')](_0x29f492[_0x29c0('0x2d')][_0x29c0('0x33')]));_0x5c6383[_0x29c0('0x31')]=_0x5c6383[_0x29c0('0x31')][_0x29c0('0x34')]?_0x5c6383['attributes']:_0x23f63e[_0x29c0('0x32')];if(!_0x29f492['query']['hasOwnProperty'](_0x29c0('0x57'))){_0x5c6383[_0x29c0('0x1a')]=qs[_0x29c0('0x1a')](_0x29f492['query']['limit']);_0x5c6383[_0x29c0('0x18')]=qs[_0x29c0('0x18')](_0x29f492[_0x29c0('0x2d')][_0x29c0('0x18')]);}_0x5c6383[_0x29c0('0x36')]=qs[_0x29c0('0x37')](_0x29f492[_0x29c0('0x2d')][_0x29c0('0x37')]);_0x5c6383[_0x29c0('0x38')]=qs[_0x29c0('0x2f')](_[_0x29c0('0x39')](_0x29f492[_0x29c0('0x2d')],_0x23f63e[_0x29c0('0x2f')]));_0x5c6383[_0x29c0('0x38')][_0x29c0('0x58')]=_0x355c5c['id'];if(_0x29f492[_0x29c0('0x2d')][_0x29c0('0x3a')]){_0x5c6383['where']=_['merge'](_0x5c6383['where'],{'$or':_['map'](_0x5c6383[_0x29c0('0x31')],function(_0x16d5e4){var _0x427ac8={};_0x427ac8[_0x16d5e4]={'$like':'%'+_0x29f492[_0x29c0('0x2d')][_0x29c0('0x3a')]+'%'};return _0x427ac8;})});}_0x5c6383=_[_0x29c0('0x3b')]({},_0x5c6383,_0x29f492[_0x29c0('0x3d')]);return db[_0x29c0('0x5f')][_0x29c0('0x1b')]({'where':_0x5c6383['where']})['then'](function(_0x52ad1e){_0x4e8b5f[_0x29c0('0x1b')]=_0x52ad1e;if(_0x29f492[_0x29c0('0x2d')][_0x29c0('0x3e')]){_0x5c6383['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x29c0('0x5d')](_0x5c6383);})['then'](function(_0x16ab77){_0x4e8b5f[_0x29c0('0x3f')]=_0x16ab77;return _0x4e8b5f;});}})[_0x29c0('0x21')](respondWithFilteredResult(_0x220aa1,_0x5c6383))[_0x29c0('0x40')](handleError(_0x220aa1,null));};exports['getLists']=function(_0x15abf4,_0x4b94bf,_0x145ce1){var _0x5cbde3={};var _0x30603f={};var _0x5a4272;var _0x22df88;return db['Campaign'][_0x29c0('0x56')]({'where':{'id':_0x15abf4[_0x29c0('0x4c')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x4b94bf,null))[_0x29c0('0x21')](function(_0x1e107d){if(_0x1e107d){_0x5a4272=_0x1e107d;_0x30603f['model']=_['keys'](db[_0x29c0('0x60')][_0x29c0('0x29')]);_0x30603f[_0x29c0('0x2d')]=_[_0x29c0('0x2e')](_0x15abf4[_0x29c0('0x2d')]);_0x30603f['filters']=_[_0x29c0('0x30')](_0x30603f['model'],_0x30603f[_0x29c0('0x2d')]);_0x5cbde3[_0x29c0('0x31')]=_[_0x29c0('0x30')](_0x30603f[_0x29c0('0x32')],qs[_0x29c0('0x33')](_0x15abf4[_0x29c0('0x2d')]['fields']));_0x5cbde3['attributes']=_0x5cbde3[_0x29c0('0x31')][_0x29c0('0x34')]?_0x5cbde3[_0x29c0('0x31')]:_0x30603f[_0x29c0('0x32')];_0x5cbde3['order']=qs[_0x29c0('0x37')](_0x15abf4[_0x29c0('0x2d')][_0x29c0('0x37')]);_0x5cbde3[_0x29c0('0x38')]=qs[_0x29c0('0x2f')](_[_0x29c0('0x39')](_0x15abf4['query'],_0x30603f[_0x29c0('0x2f')]));if(_0x15abf4[_0x29c0('0x2d')][_0x29c0('0x3a')]){_0x5cbde3[_0x29c0('0x38')]=_[_0x29c0('0x3b')](_0x5cbde3['where'],{'$or':_['map'](_0x5cbde3[_0x29c0('0x31')],function(_0x41ee35){var _0x305e74={};_0x305e74[_0x41ee35]={'$like':'%'+_0x15abf4[_0x29c0('0x2d')]['filter']+'%'};return _0x305e74;})});}_0x5cbde3=_[_0x29c0('0x3b')]({},_0x5cbde3,_0x15abf4['options']);return _0x5a4272[_0x29c0('0x61')](_0x5cbde3);}})[_0x29c0('0x21')](function(_0x3ff7d3){if(_0x3ff7d3){_0x22df88=_0x3ff7d3[_0x29c0('0x34')];if(!_0x15abf4['query'][_0x29c0('0x35')](_0x29c0('0x57'))){_0x5cbde3[_0x29c0('0x1a')]=qs[_0x29c0('0x1a')](_0x15abf4['query'][_0x29c0('0x1a')]);_0x5cbde3['offset']=qs[_0x29c0('0x18')](_0x15abf4[_0x29c0('0x2d')][_0x29c0('0x18')]);}return _0x5a4272['getLists'](_0x5cbde3);}})[_0x29c0('0x21')](function(_0x2dc543){if(_0x2dc543){return _0x2dc543?{'count':_0x22df88,'rows':_0x2dc543}:null;}})['then'](respondWithResult(_0x4b94bf,null))[_0x29c0('0x40')](handleError(_0x4b94bf,null));};exports['addLists']=function(_0x3a41e8,_0x5ebedc,_0x4c16af){var _0x399ff2,_0x48829e;var _0x514ec0=[];var _0x27d9d6=moment()['format'](_0x29c0('0x62'));return db[_0x29c0('0x28')]['find']({'where':{'id':_0x3a41e8[_0x29c0('0x4c')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x5ebedc,null))[_0x29c0('0x21')](function(_0x264c9e){if(_0x264c9e){_0x48829e=_0x264c9e;return _0x264c9e['addLists'](_0x3a41e8[_0x29c0('0x44')][_0x29c0('0x63')],_[_0x29c0('0x4e')](_0x3a41e8['body'],['ids','id'])||{});}return null;})['spread'](function(_0x636f97){var _0x258b93;var _0x1f2fd9;_0x399ff2=_0x636f97||[];var _0x8492f4=[];if(_0x636f97){for(var _0x4ae0ea=0x0;_0x4ae0ea<_0x636f97[_0x29c0('0x34')];_0x4ae0ea+=0x1){var _0x17dd7e=_0x636f97[_0x4ae0ea][_0x29c0('0x46')]({'plain':!![]});_0x48829e[_0x29c0('0x64')]=_0x3a41e8[_0x29c0('0x44')]['dialCheckDuplicateType']?_0x3a41e8[_0x29c0('0x44')]['dialCheckDuplicateType']:_0x48829e['dialCheckDuplicateType'];switch(_0x48829e[_0x29c0('0x64')]){case _0x29c0('0x65'):_0x258b93=squel[_0x29c0('0x66')]()[_0x29c0('0x67')](_0x29c0('0x68'))['fromQuery']([_0x29c0('0x69'),'scheduledAt',_0x29c0('0x6a'),'ListId',_0x29c0('0x58'),_0x29c0('0x4f'),_0x29c0('0x50')],squel[_0x29c0('0x6b')]()[_0x29c0('0x6c')]('phone',_0x29c0('0x69'))['field'](_0x29c0('0x6d'),_0x29c0('0x6e'))[_0x29c0('0x6c')]('id',_0x29c0('0x6a'))[_0x29c0('0x6c')](_0x17dd7e['CmListId'][_0x29c0('0x6f')](),'ListId')['field'](_0x3a41e8[_0x29c0('0x4c')]['id'][_0x29c0('0x6f')](),_0x29c0('0x58'))[_0x29c0('0x6c')]('\x27'+_0x27d9d6+'\x27','createdAt')[_0x29c0('0x6c')]('\x27'+_0x27d9d6+'\x27',_0x29c0('0x50'))[_0x29c0('0x70')](_0x29c0('0x71'))[_0x29c0('0x38')](_0x29c0('0x72'))[_0x29c0('0x38')](_0x29c0('0x73'),_0x17dd7e[_0x29c0('0x74')][_0x29c0('0x6f')]())[_0x29c0('0x38')](_0x29c0('0x75'))['where'](_0x29c0('0x76'),squel['select']()['field'](_0x29c0('0x77'))[_0x29c0('0x70')]('cm_hopper_final')['where'](_0x29c0('0x78'),_0x3a41e8[_0x29c0('0x4c')]['id'][_0x29c0('0x6f')]()))[_0x29c0('0x38')](_0x29c0('0x76'),squel[_0x29c0('0x6b')]()[_0x29c0('0x6c')](_0x29c0('0x79'))[_0x29c0('0x70')](_0x29c0('0x68'))['where'](_0x29c0('0x78'),_0x3a41e8[_0x29c0('0x4c')]['id'][_0x29c0('0x6f')]())))[_0x29c0('0x6f')]();break;case'onlyIfOpen':_0x258b93=squel[_0x29c0('0x66')]()['into'](_0x29c0('0x68'))['fromQuery'](['phone','scheduledAt',_0x29c0('0x6a'),_0x29c0('0x7a'),_0x29c0('0x58'),_0x29c0('0x4f'),_0x29c0('0x50')],squel['select']()[_0x29c0('0x6c')](_0x29c0('0x69'),_0x29c0('0x69'))[_0x29c0('0x6c')](_0x29c0('0x6d'),_0x29c0('0x6e'))[_0x29c0('0x6c')]('id',_0x29c0('0x6a'))[_0x29c0('0x6c')](_0x17dd7e['CmListId'][_0x29c0('0x6f')](),_0x29c0('0x7a'))[_0x29c0('0x6c')](_0x3a41e8[_0x29c0('0x4c')]['id'][_0x29c0('0x6f')](),_0x29c0('0x58'))['field']('\x27'+_0x27d9d6+'\x27',_0x29c0('0x4f'))[_0x29c0('0x6c')]('\x27'+_0x27d9d6+'\x27',_0x29c0('0x50'))[_0x29c0('0x70')](_0x29c0('0x71'))['where'](_0x29c0('0x72'))['where']('ListId\x20=\x20?',_0x17dd7e[_0x29c0('0x74')][_0x29c0('0x6f')]())['where'](_0x29c0('0x75'))[_0x29c0('0x38')](_0x29c0('0x76'),squel['select']()[_0x29c0('0x6c')](_0x29c0('0x79'))[_0x29c0('0x70')](_0x29c0('0x68'))[_0x29c0('0x38')](_0x29c0('0x78'),_0x3a41e8[_0x29c0('0x4c')]['id'][_0x29c0('0x6f')]())))['toString']();break;default:_0x258b93=squel['insert']()['into'](_0x29c0('0x68'))['fromQuery']([_0x29c0('0x69'),'scheduledAt',_0x29c0('0x6a'),'ListId',_0x29c0('0x58'),_0x29c0('0x4f'),_0x29c0('0x50')],squel[_0x29c0('0x6b')]()['field'](_0x29c0('0x69'),'phone')[_0x29c0('0x6c')](_0x29c0('0x6d'),_0x29c0('0x6e'))[_0x29c0('0x6c')]('id',_0x29c0('0x6a'))[_0x29c0('0x6c')](_0x17dd7e[_0x29c0('0x74')][_0x29c0('0x6f')](),'ListId')[_0x29c0('0x6c')](_0x3a41e8[_0x29c0('0x4c')]['id'][_0x29c0('0x6f')](),_0x29c0('0x58'))['field']('\x27'+_0x27d9d6+'\x27','createdAt')[_0x29c0('0x6c')]('\x27'+_0x27d9d6+'\x27','updatedAt')[_0x29c0('0x70')]('cm_contacts')[_0x29c0('0x38')](_0x29c0('0x72'))[_0x29c0('0x38')](_0x29c0('0x73'),_0x17dd7e[_0x29c0('0x74')][_0x29c0('0x6f')]())['where'](_0x29c0('0x75')))[_0x29c0('0x6f')]();}_0x1f2fd9=squel[_0x29c0('0x66')]()[_0x29c0('0x67')](_0x29c0('0x7b'))[_0x29c0('0x7c')]([_0x29c0('0x7d'),_0x29c0('0x6e'),_0x29c0('0x69'),_0x29c0('0x7e'),_0x29c0('0x4f'),'updatedAt'],squel[_0x29c0('0x6b')]()['field'](_0x29c0('0x7f'),'id')[_0x29c0('0x6c')](_0x29c0('0x6d'),_0x29c0('0x6e'))[_0x29c0('0x6c')](_0x29c0('0x80'),_0x29c0('0x69'))[_0x29c0('0x6c')](_0x29c0('0x81'),_0x29c0('0x7e'))[_0x29c0('0x6c')]('\x27'+_0x27d9d6+'\x27',_0x29c0('0x4f'))[_0x29c0('0x6c')]('\x27'+_0x27d9d6+'\x27',_0x29c0('0x50'))[_0x29c0('0x70')](_0x29c0('0x82'),'ci')[_0x29c0('0x83')](_0x29c0('0x68'),'h',_0x29c0('0x84'))[_0x29c0('0x38')](_0x29c0('0x85'),_0x17dd7e[_0x29c0('0x74')]['toString']())[_0x29c0('0x38')]('h.CampaignId=?',_0x3a41e8['params']['id'][_0x29c0('0x6f')]())[_0x29c0('0x38')](_0x29c0('0x86'),_0x27d9d6))[_0x29c0('0x6f')]();_0x8492f4[_0x29c0('0x87')](db['sequelize'][_0x29c0('0x2d')](_0x258b93));_0x514ec0['push'](db[_0x29c0('0x88')][_0x29c0('0x2d')](_0x1f2fd9));}return BPromise[_0x29c0('0x89')](_0x8492f4);}})[_0x29c0('0x21')](function(){return BPromise[_0x29c0('0x89')](_0x514ec0);})['then'](function(){return _0x399ff2;})[_0x29c0('0x21')](respondWithResult(_0x5ebedc,null))['catch'](handleError(_0x5ebedc,null));};exports['removeLists']=function(_0x4d4476,_0x348866,_0x29c329){return db[_0x29c0('0x28')][_0x29c0('0x42')]({'where':{'id':_0x4d4476[_0x29c0('0x4c')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x348866,null))[_0x29c0('0x21')](function(_0x10a565){if(_0x10a565){return _0x10a565[_0x29c0('0x8a')](_0x4d4476[_0x29c0('0x2d')][_0x29c0('0x63')]);}})['then'](function(_0x55b5ed){if(_0x55b5ed){return db['CmHopper'][_0x29c0('0x22')]({'where':{'ListId':_0x4d4476[_0x29c0('0x2d')][_0x29c0('0x63')],'CampaignId':_0x4d4476[_0x29c0('0x4c')]['id']}})[_0x29c0('0x21')](function(){return _0x55b5ed;});}})[_0x29c0('0x21')](respondWithStatusCode(_0x348866,null))[_0x29c0('0x40')](handleError(_0x348866,null));};exports['getBlackLists']=function(_0x4b634e,_0x281926,_0x51934d){var _0x46c39b={};var _0x164cd4={};var _0x17d7ff;var _0x36259f;return db[_0x29c0('0x28')][_0x29c0('0x56')]({'where':{'id':_0x4b634e['params']['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x281926,null))['then'](function(_0x59b373){if(_0x59b373){_0x17d7ff=_0x59b373;_0x164cd4['model']=_[_0x29c0('0x2e')](db[_0x29c0('0x60')][_0x29c0('0x29')]);_0x164cd4['query']=_[_0x29c0('0x2e')](_0x4b634e[_0x29c0('0x2d')]);_0x164cd4[_0x29c0('0x2f')]=_[_0x29c0('0x30')](_0x164cd4[_0x29c0('0x32')],_0x164cd4[_0x29c0('0x2d')]);_0x46c39b[_0x29c0('0x31')]=_[_0x29c0('0x30')](_0x164cd4[_0x29c0('0x32')],qs['fields'](_0x4b634e[_0x29c0('0x2d')][_0x29c0('0x33')]));_0x46c39b[_0x29c0('0x31')]=_0x46c39b[_0x29c0('0x31')][_0x29c0('0x34')]?_0x46c39b['attributes']:_0x164cd4['model'];_0x46c39b[_0x29c0('0x36')]=qs['sort'](_0x4b634e['query'][_0x29c0('0x37')]);_0x46c39b['where']=qs[_0x29c0('0x2f')](_[_0x29c0('0x39')](_0x4b634e['query'],_0x164cd4[_0x29c0('0x2f')]));if(_0x4b634e['query'][_0x29c0('0x3a')]){_0x46c39b['where']=_[_0x29c0('0x3b')](_0x46c39b[_0x29c0('0x38')],{'$or':_[_0x29c0('0x27')](_0x46c39b[_0x29c0('0x31')],function(_0x4f959f){var _0x21ea05={};_0x21ea05[_0x4f959f]={'$like':'%'+_0x4b634e[_0x29c0('0x2d')][_0x29c0('0x3a')]+'%'};return _0x21ea05;})});}_0x46c39b=_[_0x29c0('0x3b')]({},_0x46c39b,_0x4b634e[_0x29c0('0x3d')]);return _0x17d7ff[_0x29c0('0x8b')](_0x46c39b);}})['then'](function(_0x420713){if(_0x420713){_0x36259f=_0x420713['length'];if(!_0x4b634e['query'][_0x29c0('0x35')]('nolimit')){_0x46c39b[_0x29c0('0x1a')]=qs[_0x29c0('0x1a')](_0x4b634e[_0x29c0('0x2d')][_0x29c0('0x1a')]);_0x46c39b[_0x29c0('0x18')]=qs[_0x29c0('0x18')](_0x4b634e[_0x29c0('0x2d')][_0x29c0('0x18')]);}return _0x17d7ff[_0x29c0('0x8b')](_0x46c39b);}})[_0x29c0('0x21')](function(_0x4c55d7){if(_0x4c55d7){return _0x4c55d7?{'count':_0x36259f,'rows':_0x4c55d7}:null;}})[_0x29c0('0x21')](respondWithResult(_0x281926,null))[_0x29c0('0x40')](handleError(_0x281926,null));};exports[_0x29c0('0x8c')]=function(_0x33120e,_0x41e898,_0x4f5d79){var _0x588549,_0x275617;var _0x3ca521=[];var _0x4f4958=moment()['format'](_0x29c0('0x62'));return db[_0x29c0('0x28')][_0x29c0('0x42')]({'where':{'id':_0x33120e[_0x29c0('0x4c')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x41e898,null))['then'](function(_0x176631){if(_0x176631){_0x275617=_0x176631;return _0x176631[_0x29c0('0x8c')](_0x33120e[_0x29c0('0x44')]['ids'],_['omit'](_0x33120e[_0x29c0('0x44')],[_0x29c0('0x63'),'id'])||{});}return null;})[_0x29c0('0x8d')](function(_0x28b2f5){var _0xacca6c;var _0x3da0b2;_0x588549=_0x28b2f5||[];var _0x14f2e1=[];if(_0x28b2f5){for(var _0x344d78=0x0;_0x344d78<_0x28b2f5['length'];_0x344d78+=0x1){var _0x2db2fd=_0x28b2f5[_0x344d78]['get']({'plain':!![]});_0xacca6c=squel[_0x29c0('0x66')]()[_0x29c0('0x67')](_0x29c0('0x8e'))[_0x29c0('0x7c')]([_0x29c0('0x69'),'ContactId',_0x29c0('0x7a'),_0x29c0('0x58'),_0x29c0('0x4f'),_0x29c0('0x50')],squel[_0x29c0('0x6b')]()['field'](_0x29c0('0x69'),'phone')[_0x29c0('0x6c')]('id',_0x29c0('0x6a'))[_0x29c0('0x6c')](_0x2db2fd['CmListId'][_0x29c0('0x6f')](),'ListId')['field'](_0x33120e['params']['id'][_0x29c0('0x6f')](),_0x29c0('0x58'))[_0x29c0('0x6c')]('NOW()',_0x29c0('0x4f'))[_0x29c0('0x6c')](_0x29c0('0x6d'),_0x29c0('0x50'))[_0x29c0('0x70')](_0x29c0('0x71'))[_0x29c0('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0x29c0('0x73'),_0x2db2fd[_0x29c0('0x74')][_0x29c0('0x6f')]())[_0x29c0('0x38')](_0x29c0('0x75')))[_0x29c0('0x6f')]();_0x14f2e1[_0x29c0('0x87')](db[_0x29c0('0x88')][_0x29c0('0x2d')](_0xacca6c));}return BPromise[_0x29c0('0x89')](_0x14f2e1);}})['then'](function(){return _0x588549;})[_0x29c0('0x21')](respondWithResult(_0x41e898,null))[_0x29c0('0x40')](handleError(_0x41e898,null));};exports['removeBlackLists']=function(_0x3a4834,_0x2d2152,_0x2d4795){return db[_0x29c0('0x28')][_0x29c0('0x42')]({'where':{'id':_0x3a4834['params']['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x2d2152,null))[_0x29c0('0x21')](function(_0x22e791){if(_0x22e791){return _0x22e791[_0x29c0('0x8f')](_0x3a4834['query'][_0x29c0('0x63')]);}})[_0x29c0('0x21')](function(_0x463fcf){if(_0x463fcf){return db[_0x29c0('0x5f')][_0x29c0('0x22')]({'where':{'ListId':_0x3a4834['query']['ids'],'CampaignId':_0x3a4834[_0x29c0('0x4c')]['id']}})[_0x29c0('0x21')](function(){return _0x463fcf;});}})[_0x29c0('0x21')](respondWithStatusCode(_0x2d2152,null))[_0x29c0('0x40')](handleError(_0x2d2152,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index dc8fe27..3aee6d5 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x49684e,_0x9a24fb){var _0x54062f=function(_0x4e410a){while(--_0x4e410a){_0x49684e['push'](_0x49684e['shift']());}};_0x54062f(++_0x9a24fb);}(_0x7a54,0x106));var _0x47a5=function(_0x30a150,_0x40d8e1){_0x30a150=_0x30a150-0x0;var _0x5dfd31=_0x7a54[_0x30a150];return _0x5dfd31;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 3179d92..5b9f6f4 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 _0xacfe=['where','attributes','limit','map','include','model','then','GetCampaign','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','raw'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xacfe,0xfd));var _0xeacf=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xacfe[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeacf('0x0'));var BPromise=require(_0xeacf('0x1'));var rs=require(_0xeacf('0x2'));var fs=require('fs');var Redis=require(_0xeacf('0x3'));var db=require(_0xeacf('0x4'))['db'];var utils=require(_0xeacf('0x5'));var logger=require(_0xeacf('0x6'))(_0xeacf('0x7'));var config=require(_0xeacf('0x8'));var jayson=require(_0xeacf('0x9'));var client=jayson[_0xeacf('0xa')][_0xeacf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13cba2,_0x5eb516,_0x411634){return new BPromise(function(_0xce0437,_0x17b21c){return client[_0xeacf('0xc')](_0x13cba2,_0x411634)['then'](function(_0xfe344){logger['info'](_0xeacf('0xd'),_0x5eb516,_0xeacf('0xe'));logger[_0xeacf('0xf')](_0xeacf('0x10'),_0x5eb516,_0xeacf('0xe'),JSON[_0xeacf('0x11')](_0xfe344));if(_0xfe344[_0xeacf('0x12')]){if(_0xfe344[_0xeacf('0x12')][_0xeacf('0x13')]===0x1f4){logger[_0xeacf('0x12')]('Campaign,\x20%s,\x20%s',_0x5eb516,_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);return _0x17b21c(_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);}logger['error'](_0xeacf('0xd'),_0x5eb516,_0xfe344[_0xeacf('0x12')][_0xeacf('0x14')]);return _0xce0437(_0xfe344['error']['message']);}else{logger[_0xeacf('0x15')](_0xeacf('0xd'),_0x5eb516,'request\x20sent');_0xce0437(_0xfe344[_0xeacf('0x16')]['message']);}})[_0xeacf('0x17')](function(_0x1df080){logger['error'](_0xeacf('0xd'),_0x5eb516,_0x1df080);_0x17b21c(_0x1df080);});});}exports['GetCampaign']=function(_0x650730){var _0xe87314=this;return new Promise(function(_0x18de20,_0x118932){return db['Campaign'][_0xeacf('0x18')]({'raw':_0x650730['options']?_0x650730[_0xeacf('0x19')][_0xeacf('0x1a')]===undefined?!![]:![]:!![],'where':_0x650730[_0xeacf('0x19')]?_0x650730['options'][_0xeacf('0x1b')]||null:null,'attributes':_0x650730[_0xeacf('0x19')]?_0x650730[_0xeacf('0x19')][_0xeacf('0x1c')]||null:null,'limit':_0x650730[_0xeacf('0x19')]?_0x650730[_0xeacf('0x19')][_0xeacf('0x1d')]||null:null,'include':_0x650730[_0xeacf('0x19')]?_0x650730[_0xeacf('0x19')]['include']?_[_0xeacf('0x1e')](_0x650730[_0xeacf('0x19')][_0xeacf('0x1f')],function(_0x35338b){return{'model':db[_0x35338b[_0xeacf('0x20')]],'as':_0x35338b['as'],'attributes':_0x35338b[_0xeacf('0x1c')],'include':_0x35338b[_0xeacf('0x1f')]?_['map'](_0x35338b['include'],function(_0x4332b7){return{'model':db[_0x4332b7[_0xeacf('0x20')]],'as':_0x4332b7['as'],'attributes':_0x4332b7['attributes'],'include':_0x4332b7[_0xeacf('0x1f')]?_[_0xeacf('0x1e')](_0x4332b7[_0xeacf('0x1f')],function(_0x1e368a){return{'model':db[_0x1e368a['model']],'as':_0x1e368a['as'],'attributes':_0x1e368a[_0xeacf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xeacf('0x21')](function(_0x4c161e){logger[_0xeacf('0x15')](_0xeacf('0x22'),_0x650730);logger[_0xeacf('0xf')](_0xeacf('0x22'),_0x650730,JSON['stringify'](_0x4c161e));_0x18de20(_0x4c161e);})[_0xeacf('0x17')](function(_0x1d375a){logger['error']('GetCampaign',_0x1d375a['message'],_0x650730);_0x118932(_0xe87314['error'](0x1f4,_0x1d375a[_0xeacf('0x14')]));});});};
\ No newline at end of file
+var _0x750a=['GetCampaign','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','Campaign,\x20%s,\x20%s','message','catch','options','raw','attributes','limit','model','include','map'];(function(_0x11f1e0,_0x568eae){var _0x3369c7=function(_0x53105a){while(--_0x53105a){_0x11f1e0['push'](_0x11f1e0['shift']());}};_0x3369c7(++_0x568eae);}(_0x750a,0x140));var _0xa750=function(_0x50a75e,_0x41e663){_0x50a75e=_0x50a75e-0x0;var _0x304e15=_0x750a[_0x50a75e];return _0x304e15;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('Campaign,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});}exports['GetCampaign']=function(_0x433dbd){var _0x1bde87=this;return new Promise(function(_0x4f1faa,_0x36dcca){return db['Campaign']['findAll']({'raw':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x16')]===undefined?!![]:![]:!![],'where':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['where']||null:null,'attributes':_0x433dbd[_0xa750('0x15')]?_0x433dbd['options'][_0xa750('0x17')]||null:null,'limit':_0x433dbd['options']?_0x433dbd['options'][_0xa750('0x18')]||null:null,'include':_0x433dbd['options']?_0x433dbd[_0xa750('0x15')]['include']?_['map'](_0x433dbd['options']['include'],function(_0x15d72f){return{'model':db[_0x15d72f[_0xa750('0x19')]],'as':_0x15d72f['as'],'attributes':_0x15d72f[_0xa750('0x17')],'include':_0x15d72f[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x15d72f[_0xa750('0x1a')],function(_0x3001bc){return{'model':db[_0x3001bc[_0xa750('0x19')]],'as':_0x3001bc['as'],'attributes':_0x3001bc[_0xa750('0x17')],'include':_0x3001bc[_0xa750('0x1a')]?_[_0xa750('0x1b')](_0x3001bc[_0xa750('0x1a')],function(_0x31ea63){return{'model':db[_0x31ea63[_0xa750('0x19')]],'as':_0x31ea63['as'],'attributes':_0x31ea63[_0xa750('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d3923){logger[_0xa750('0xc')](_0xa750('0x1c'),_0x433dbd);logger['debug'](_0xa750('0x1c'),_0x433dbd,JSON[_0xa750('0xf')](_0x3d3923));_0x4f1faa(_0x3d3923);})[_0xa750('0x14')](function(_0x1223d2){logger['error'](_0xa750('0x1c'),_0x1223d2[_0xa750('0x13')],_0x433dbd);_0x36dcca(_0x1bde87[_0xa750('0x10')](0x1f4,_0x1223d2[_0xa750('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 88d2a79..e6674b6 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 _0x7f90=['express','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','/:id/blacklists','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout'];(function(_0x4d19ce,_0xbc25fa){var _0x3fda80=function(_0x5f087){while(--_0x5f087){_0x4d19ce['push'](_0x4d19ce['shift']());}};_0x3fda80(++_0xbc25fa);}(_0x7f90,0xf4));var _0x07f9=function(_0x16b77e,_0x4a56a3){_0x16b77e=_0x16b77e-0x0;var _0x3ae284=_0x7f90[_0x16b77e];return _0x3ae284;};'use strict';var multer=require(_0x07f9('0x0'));var util=require(_0x07f9('0x1'));var path=require(_0x07f9('0x2'));var timeout=require(_0x07f9('0x3'));var express=require(_0x07f9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x07f9('0x5'));var interaction=require(_0x07f9('0x6'));var config=require('../../config/environment');var controller=require(_0x07f9('0x7'));router[_0x07f9('0x8')]('/',auth[_0x07f9('0x9')](),controller[_0x07f9('0xa')]);router[_0x07f9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x07f9('0xb')]);router[_0x07f9('0x8')]('/:id/hoppers',auth[_0x07f9('0x9')](),controller['getHoppers']);router[_0x07f9('0x8')](_0x07f9('0xc'),auth[_0x07f9('0x9')](),controller[_0x07f9('0xd')]);router['get'](_0x07f9('0xe'),auth[_0x07f9('0x9')](),controller[_0x07f9('0xf')]);router[_0x07f9('0x8')]('/:id/hopper_black',auth[_0x07f9('0x9')](),controller['getHopperBlacks']);router[_0x07f9('0x8')](_0x07f9('0x10'),auth[_0x07f9('0x9')](),controller[_0x07f9('0x11')]);router[_0x07f9('0x8')]('/:id/blacklists',auth[_0x07f9('0x9')](),controller[_0x07f9('0x12')]);router['post']('/',auth[_0x07f9('0x9')](),controller['create']);router[_0x07f9('0x13')](_0x07f9('0x14'),auth['isAuthenticated'](),controller[_0x07f9('0x15')]);router[_0x07f9('0x13')](_0x07f9('0x10'),auth[_0x07f9('0x9')](),controller['addLists']);router[_0x07f9('0x13')](_0x07f9('0x16'),auth[_0x07f9('0x9')](),controller[_0x07f9('0x17')]);router['put'](_0x07f9('0x18'),auth[_0x07f9('0x9')](),controller[_0x07f9('0x19')]);router[_0x07f9('0x1a')](_0x07f9('0x18'),auth['isAuthenticated'](),controller[_0x07f9('0x1b')]);router[_0x07f9('0x1a')](_0x07f9('0x10'),auth[_0x07f9('0x9')](),controller[_0x07f9('0x1c')]);router['delete']('/:id/blacklists',auth[_0x07f9('0x9')](),controller[_0x07f9('0x1d')]);module[_0x07f9('0x1e')]=router;
\ No newline at end of file
+var _0xa567=['get','index','/:id','isAuthenticated','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','update','destroy','delete','removeBlackLists','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0xa1e6b9,_0x484192){var _0x4db940=function(_0x39c320){while(--_0x39c320){_0xa1e6b9['push'](_0xa1e6b9['shift']());}};_0x4db940(++_0x484192);}(_0xa567,0x119));var _0x7a56=function(_0x540d28,_0x34ef0e){_0x540d28=_0x540d28-0x0;var _0x12635b=_0xa567[_0x540d28];return _0x12635b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7a56('0x0'));var timeout=require(_0x7a56('0x1'));var express=require(_0x7a56('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7a56('0x3'));var config=require(_0x7a56('0x4'));var controller=require('./campaign.controller');router[_0x7a56('0x5')]('/',auth['isAuthenticated'](),controller[_0x7a56('0x6')]);router['get'](_0x7a56('0x7'),auth[_0x7a56('0x8')](),controller[_0x7a56('0x9')]);router[_0x7a56('0x5')](_0x7a56('0xa'),auth[_0x7a56('0x8')](),controller['getHoppers']);router[_0x7a56('0x5')]('/:id/hopper_histories',auth[_0x7a56('0x8')](),controller[_0x7a56('0xb')]);router[_0x7a56('0x5')](_0x7a56('0xc'),auth[_0x7a56('0x8')](),controller['getHopperFinals']);router[_0x7a56('0x5')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router['get'](_0x7a56('0xd'),auth[_0x7a56('0x8')](),controller[_0x7a56('0xe')]);router[_0x7a56('0x5')](_0x7a56('0xf'),auth[_0x7a56('0x8')](),controller[_0x7a56('0x10')]);router[_0x7a56('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/clone',auth[_0x7a56('0x8')](),controller['clone']);router[_0x7a56('0x11')](_0x7a56('0xd'),auth['isAuthenticated'](),controller['addLists']);router[_0x7a56('0x11')](_0x7a56('0xf'),auth[_0x7a56('0x8')](),controller['addBlackLists']);router['put'](_0x7a56('0x7'),auth[_0x7a56('0x8')](),controller[_0x7a56('0x12')]);router['delete'](_0x7a56('0x7'),auth[_0x7a56('0x8')](),controller[_0x7a56('0x13')]);router['delete'](_0x7a56('0xd'),auth[_0x7a56('0x8')](),controller['removeLists']);router[_0x7a56('0x14')](_0x7a56('0xf'),auth[_0x7a56('0x8')](),controller[_0x7a56('0x15')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 5330e82..ef2fa25 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 _0x0994=['sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x562d4a,_0x3c31d5){var _0x28244c=function(_0x189326){while(--_0x189326){_0x562d4a['push'](_0x562d4a['shift']());}};_0x28244c(++_0x3c31d5);}(_0x0994,0x14a));var _0x4099=function(_0x451694,_0x413f83){_0x451694=_0x451694-0x0;var _0x26c770=_0x0994[_0x451694];return _0x26c770;};'use strict';var Sequelize=require(_0x4099('0x0'));module[_0x4099('0x1')]={'key':{'type':Sequelize[_0x4099('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x4099('0x2')]},'name':{'type':Sequelize[_0x4099('0x3')],'get':function(){return this[_0x4099('0x4')]('key');}}};
\ No newline at end of file
+var _0xc9aa=['VIRTUAL','sequelize','STRING','TEXT'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc9aa,0xd1));var _0xac9a=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xc9aa[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require(_0xac9a('0x0'));module['exports']={'key':{'type':Sequelize[_0xac9a('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xac9a('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xac9a('0x3')],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index b9c88a8..71737df 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 _0x7d39=['apply','reject','save','then','get','UserProfileResource','destroy','send','index','map','CannedAnswer','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x2a2ca0,_0x394fa8){var _0x1a62e6=function(_0x307189){while(--_0x307189){_0x2a2ca0['push'](_0x2a2ca0['shift']());}};_0x1a62e6(++_0x394fa8);}(_0x7d39,0xe7));var _0x97d3=function(_0x53e0c7,_0x3e3e9a){_0x53e0c7=_0x53e0c7-0x0;var _0x2548f3=_0x7d39[_0x53e0c7];return _0x2548f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97d3('0x0'));var zipdir=require(_0x97d3('0x1'));var jsonpatch=require(_0x97d3('0x2'));var rp=require(_0x97d3('0x3'));var moment=require(_0x97d3('0x4'));var BPromise=require(_0x97d3('0x5'));var Mustache=require(_0x97d3('0x6'));var util=require(_0x97d3('0x7'));var path=require(_0x97d3('0x8'));var sox=require(_0x97d3('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97d3('0xa'));var _=require(_0x97d3('0xb'));var squel=require('squel');var crypto=require(_0x97d3('0xc'));var jsforce=require(_0x97d3('0xd'));var deskjs=require(_0x97d3('0xe'));var toCsv=require(_0x97d3('0xf'));var querystring=require('querystring');var Papa=require(_0x97d3('0x10'));var Redis=require(_0x97d3('0x11'));var authService=require(_0x97d3('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97d3('0x13'));var logger=require(_0x97d3('0x14'))(_0x97d3('0x15'));var utils=require(_0x97d3('0x16'));var config=require(_0x97d3('0x17'));var licenseUtil=require(_0x97d3('0x18'));var db=require(_0x97d3('0x19'))['db'];function respondWithStatusCode(_0xcf84db,_0x2cfa95){_0x2cfa95=_0x2cfa95||0xcc;return function(_0x488008){if(_0x488008){return _0xcf84db[_0x97d3('0x1a')](_0x2cfa95);}return _0xcf84db[_0x97d3('0x1b')](_0x2cfa95)[_0x97d3('0x1c')]();};}function respondWithResult(_0x52e3a0,_0x526f62){_0x526f62=_0x526f62||0xc8;return function(_0x4ae610){if(_0x4ae610){return _0x52e3a0['status'](_0x526f62)[_0x97d3('0x1d')](_0x4ae610);}};}function respondWithFilteredResult(_0x32a1d8,_0x56936c){return function(_0x1bd1cc){if(_0x1bd1cc){var _0x4c6647=typeof _0x56936c['offset']===_0x97d3('0x1e')&&typeof _0x56936c[_0x97d3('0x1f')]===_0x97d3('0x1e');var _0x25271a=_0x1bd1cc[_0x97d3('0x20')];var _0x46dd6e=_0x4c6647?0x0:_0x56936c[_0x97d3('0x21')];var _0x5197ca=_0x4c6647?_0x1bd1cc['count']:_0x56936c[_0x97d3('0x21')]+_0x56936c[_0x97d3('0x1f')];var _0x225ec4;if(_0x5197ca>=_0x25271a){_0x5197ca=_0x25271a;_0x225ec4=0xc8;}else{_0x225ec4=0xce;}_0x32a1d8['status'](_0x225ec4);return _0x32a1d8[_0x97d3('0x22')](_0x97d3('0x23'),_0x46dd6e+'-'+_0x5197ca+'/'+_0x25271a)[_0x97d3('0x1d')](_0x1bd1cc);}return null;};}function patchUpdates(_0x178205){return function(_0x59973e){try{jsonpatch[_0x97d3('0x24')](_0x59973e,_0x178205,!![]);}catch(_0x3238aa){return BPromise[_0x97d3('0x25')](_0x3238aa);}return _0x59973e[_0x97d3('0x26')]();};}function saveUpdates(_0x3ab789,_0xf53d0e){return function(_0x58e048){if(_0x58e048){return _0x58e048['update'](_0x3ab789)[_0x97d3('0x27')](function(_0x20d20f){return _0x20d20f;});}return null;};}function removeEntity(_0xd9fbcd,_0xb07618){return function(_0x41db58){if(_0x41db58){return _0x41db58['destroy']()[_0x97d3('0x27')](function(){var _0x457fb6=_0x41db58[_0x97d3('0x28')]({'plain':!![]});var _0x5d6fdd='CannedAnswers';return db[_0x97d3('0x29')][_0x97d3('0x2a')]({'where':{'type':_0x5d6fdd,'resourceId':_0x457fb6['id']}})[_0x97d3('0x27')](function(){return _0x41db58;});})[_0x97d3('0x27')](function(){_0xd9fbcd[_0x97d3('0x1b')](0xcc)[_0x97d3('0x1c')]();});}};}function handleEntityNotFound(_0x260886,_0x3fdaf7){return function(_0x3f9fb5){if(!_0x3f9fb5){_0x260886[_0x97d3('0x1a')](0x194);}return _0x3f9fb5;};}function handleError(_0x1790fc,_0x46da88){_0x46da88=_0x46da88||0x1f4;return function(_0x5119a0){logger['error'](_0x5119a0['stack']);if(_0x5119a0['name']){delete _0x5119a0['name'];}_0x1790fc[_0x97d3('0x1b')](_0x46da88)[_0x97d3('0x2b')](_0x5119a0);};}exports[_0x97d3('0x2c')]=function(_0x5df8e6,_0x4f8715){var _0x36728b={},_0x14f804={},_0x124f57={'count':0x0,'rows':[]};var _0xfca8c9=_[_0x97d3('0x2d')](db[_0x97d3('0x2e')]['rawAttributes'],function(_0x1016bc){return{'name':_0x1016bc[_0x97d3('0x2f')],'type':_0x1016bc[_0x97d3('0x30')][_0x97d3('0x31')]};});_0x14f804[_0x97d3('0x32')]=_[_0x97d3('0x2d')](_0xfca8c9,_0x97d3('0x33'));_0x14f804[_0x97d3('0x34')]=_[_0x97d3('0x35')](_0x5df8e6[_0x97d3('0x34')]);_0x14f804['filters']=_[_0x97d3('0x36')](_0x14f804['model'],_0x14f804[_0x97d3('0x34')]);_0x36728b[_0x97d3('0x37')]=_[_0x97d3('0x36')](_0x14f804[_0x97d3('0x32')],qs[_0x97d3('0x38')](_0x5df8e6['query'][_0x97d3('0x38')]));_0x36728b[_0x97d3('0x37')]=_0x36728b[_0x97d3('0x37')][_0x97d3('0x39')]?_0x36728b[_0x97d3('0x37')]:_0x14f804['model'];if(!_0x5df8e6[_0x97d3('0x34')][_0x97d3('0x3a')]('nolimit')){_0x36728b['limit']=qs[_0x97d3('0x1f')](_0x5df8e6[_0x97d3('0x34')][_0x97d3('0x1f')]);_0x36728b['offset']=qs['offset'](_0x5df8e6['query'][_0x97d3('0x21')]);}_0x36728b[_0x97d3('0x3b')]=qs[_0x97d3('0x3c')](_0x5df8e6[_0x97d3('0x34')][_0x97d3('0x3c')]);_0x36728b[_0x97d3('0x3d')]=qs[_0x97d3('0x3e')](_[_0x97d3('0x3f')](_0x5df8e6[_0x97d3('0x34')],_0x14f804[_0x97d3('0x3e')]),_0xfca8c9);if(_0x5df8e6['query'][_0x97d3('0x40')]){_0x36728b[_0x97d3('0x3d')]=_[_0x97d3('0x41')](_0x36728b[_0x97d3('0x3d')],{'$or':[{'key':{'$like':'%'+_0x5df8e6[_0x97d3('0x34')][_0x97d3('0x40')]+'%'}},{'value':{'$like':'%'+_0x5df8e6['query']['filter']+'%'}}]});}_0x36728b=_[_0x97d3('0x41')]({},_0x36728b,_0x5df8e6[_0x97d3('0x42')]);var _0x5c1e96={'where':_0x36728b[_0x97d3('0x3d')]};return db['CannedAnswer'][_0x97d3('0x20')](_0x5c1e96)[_0x97d3('0x27')](function(_0xf837bd){_0x124f57[_0x97d3('0x20')]=_0xf837bd;if(_0x5df8e6[_0x97d3('0x34')][_0x97d3('0x43')]){_0x36728b[_0x97d3('0x44')]=[{'all':!![]}];}return db[_0x97d3('0x2e')][_0x97d3('0x45')](_0x36728b);})[_0x97d3('0x27')](function(_0x52956e){_0x124f57['rows']=_0x52956e;return _0x124f57;})['then'](respondWithFilteredResult(_0x4f8715,_0x36728b))['catch'](handleError(_0x4f8715,null));};exports['show']=function(_0x4f2862,_0x2930e1){var _0x32886c={'raw':!![],'where':{'id':_0x4f2862[_0x97d3('0x46')]['id']}},_0x183ac3={};_0x183ac3['model']=_['keys'](db[_0x97d3('0x2e')][_0x97d3('0x47')]);_0x183ac3[_0x97d3('0x34')]=_[_0x97d3('0x35')](_0x4f2862[_0x97d3('0x34')]);_0x183ac3[_0x97d3('0x3e')]=_[_0x97d3('0x36')](_0x183ac3[_0x97d3('0x32')],_0x183ac3['query']);_0x32886c[_0x97d3('0x37')]=_[_0x97d3('0x36')](_0x183ac3[_0x97d3('0x32')],qs[_0x97d3('0x38')](_0x4f2862[_0x97d3('0x34')][_0x97d3('0x38')]));_0x32886c[_0x97d3('0x37')]=_0x32886c[_0x97d3('0x37')][_0x97d3('0x39')]?_0x32886c[_0x97d3('0x37')]:_0x183ac3[_0x97d3('0x32')];if(_0x4f2862[_0x97d3('0x34')][_0x97d3('0x43')]){_0x32886c[_0x97d3('0x44')]=[{'all':!![]}];}_0x32886c=_['merge']({},_0x32886c,_0x4f2862['options']);return db[_0x97d3('0x2e')][_0x97d3('0x48')](_0x32886c)['then'](handleEntityNotFound(_0x2930e1,null))[_0x97d3('0x27')](respondWithResult(_0x2930e1,null))[_0x97d3('0x49')](handleError(_0x2930e1,null));};exports[_0x97d3('0x4a')]=function(_0x538dc3,_0x234018){if(_0x538dc3[_0x97d3('0x4b')]['id']){delete _0x538dc3[_0x97d3('0x4b')]['id'];}return db[_0x97d3('0x2e')][_0x97d3('0x48')]({'where':{'id':_0x538dc3[_0x97d3('0x46')]['id']}})[_0x97d3('0x27')](handleEntityNotFound(_0x234018,null))[_0x97d3('0x27')](saveUpdates(_0x538dc3[_0x97d3('0x4b')],null))[_0x97d3('0x27')](respondWithResult(_0x234018,null))[_0x97d3('0x49')](handleError(_0x234018,null));};exports[_0x97d3('0x2a')]=function(_0x412312,_0x16111f){return db[_0x97d3('0x2e')][_0x97d3('0x48')]({'where':{'id':_0x412312[_0x97d3('0x46')]['id']}})[_0x97d3('0x27')](handleEntityNotFound(_0x16111f,null))[_0x97d3('0x27')](removeEntity(_0x16111f,null))[_0x97d3('0x49')](handleError(_0x16111f,null));};exports[_0x97d3('0x4c')]=function(_0x1ea31a,_0x5e809f){var _0x18977={'key':_0x1ea31a[_0x97d3('0x4b')]['key']};if(_0x1ea31a[_0x97d3('0x4b')][_0x97d3('0x4d')]){_0x18977[_0x97d3('0x4d')]=_0x1ea31a[_0x97d3('0x4b')][_0x97d3('0x4d')];}else if(_0x1ea31a[_0x97d3('0x4b')][_0x97d3('0x4e')]){_0x18977['SmsAccountId']=_0x1ea31a[_0x97d3('0x4b')]['SmsAccountId'];}else if(_0x1ea31a['body']['OpenchannelAccountId']){_0x18977['OpenchannelAccountId']=_0x1ea31a[_0x97d3('0x4b')][_0x97d3('0x4f')];}else if(_0x1ea31a['body'][_0x97d3('0x50')]){_0x18977[_0x97d3('0x50')]=_0x1ea31a[_0x97d3('0x4b')][_0x97d3('0x50')];}return db['CannedAnswer'][_0x97d3('0x48')]({'where':_0x18977})[_0x97d3('0x27')](function(_0x51fe65){if(_0x51fe65){throw new db[(_0x97d3('0x51'))]['ValidationError'](_0x97d3('0x52'));}return db[_0x97d3('0x2e')][_0x97d3('0x4c')](_0x1ea31a[_0x97d3('0x4b')]);})[_0x97d3('0x27')](function(_0xfcf98c){var _0x429658=_0x1ea31a[_0x97d3('0x53')][_0x97d3('0x28')]({'plain':!![]});if(!_0x429658)throw new Error(_0x97d3('0x54'));if(_0x429658['role']==='user'){var _0xe88cc4=_0xfcf98c[_0x97d3('0x28')]({'plain':!![]});return db[_0x97d3('0x55')][_0x97d3('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x429658[_0x97d3('0x56')]},'raw':!![]})['then'](function(_0x11d3b4){if(_0x11d3b4&&_0x11d3b4[_0x97d3('0x57')]===0x0){return db[_0x97d3('0x29')]['create']({'name':_0xe88cc4[_0x97d3('0x33')],'resourceId':_0xe88cc4['id'],'type':_0x11d3b4['name'],'sectionId':_0x11d3b4['id']},{})[_0x97d3('0x27')](function(){return _0xfcf98c;});}else{return _0xfcf98c;}})[_0x97d3('0x49')](function(_0x5ac4cf){logger[_0x97d3('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ac4cf);throw _0x5ac4cf;});}return _0xfcf98c;})[_0x97d3('0x27')](respondWithResult(_0x5e809f,0xc9))[_0x97d3('0x49')](handleError(_0x5e809f,null));};
\ No newline at end of file
+var _0x3b7c=['then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x97b3e7,_0x19d219){var _0x4d9b45=function(_0x2b23ba){while(--_0x2b23ba){_0x97b3e7['push'](_0x97b3e7['shift']());}};_0x4d9b45(++_0x19d219);}(_0x3b7c,0x90));var _0xc3b7=function(_0x302b72,_0x483f35){_0x302b72=_0x302b72-0x0;var _0x48aa64=_0x3b7c[_0x302b72];return _0x48aa64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3b7('0x0'));var zipdir=require(_0xc3b7('0x1'));var jsonpatch=require(_0xc3b7('0x2'));var rp=require(_0xc3b7('0x3'));var moment=require('moment');var BPromise=require(_0xc3b7('0x4'));var Mustache=require(_0xc3b7('0x5'));var util=require(_0xc3b7('0x6'));var path=require('path');var sox=require(_0xc3b7('0x7'));var csv=require(_0xc3b7('0x8'));var ejs=require(_0xc3b7('0x9'));var fs=require('fs');var fs_extra=require(_0xc3b7('0xa'));var _=require(_0xc3b7('0xb'));var squel=require(_0xc3b7('0xc'));var crypto=require(_0xc3b7('0xd'));var jsforce=require(_0xc3b7('0xe'));var deskjs=require(_0xc3b7('0xf'));var toCsv=require(_0xc3b7('0x8'));var querystring=require('querystring');var Papa=require(_0xc3b7('0x10'));var Redis=require(_0xc3b7('0x11'));var authService=require(_0xc3b7('0x12'));var qs=require(_0xc3b7('0x13'));var as=require(_0xc3b7('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3b7('0x15'))(_0xc3b7('0x16'));var utils=require(_0xc3b7('0x17'));var config=require(_0xc3b7('0x18'));var licenseUtil=require(_0xc3b7('0x19'));var db=require(_0xc3b7('0x1a'))['db'];function respondWithStatusCode(_0x3ea339,_0x5b1344){_0x5b1344=_0x5b1344||0xcc;return function(_0x50bc8b){if(_0x50bc8b){return _0x3ea339[_0xc3b7('0x1b')](_0x5b1344);}return _0x3ea339[_0xc3b7('0x1c')](_0x5b1344)[_0xc3b7('0x1d')]();};}function respondWithResult(_0xe844f8,_0x536954){_0x536954=_0x536954||0xc8;return function(_0x227bda){if(_0x227bda){return _0xe844f8[_0xc3b7('0x1c')](_0x536954)[_0xc3b7('0x1e')](_0x227bda);}};}function respondWithFilteredResult(_0x58b203,_0x626314){return function(_0x384194){if(_0x384194){var _0x2d3789=typeof _0x626314[_0xc3b7('0x1f')]==='undefined'&&typeof _0x626314[_0xc3b7('0x20')]==='undefined';var _0x349c1e=_0x384194[_0xc3b7('0x21')];var _0x91fb29=_0x2d3789?0x0:_0x626314[_0xc3b7('0x1f')];var _0x38279b=_0x2d3789?_0x384194[_0xc3b7('0x21')]:_0x626314[_0xc3b7('0x1f')]+_0x626314[_0xc3b7('0x20')];var _0x2e0187;if(_0x38279b>=_0x349c1e){_0x38279b=_0x349c1e;_0x2e0187=0xc8;}else{_0x2e0187=0xce;}_0x58b203[_0xc3b7('0x1c')](_0x2e0187);return _0x58b203[_0xc3b7('0x22')](_0xc3b7('0x23'),_0x91fb29+'-'+_0x38279b+'/'+_0x349c1e)[_0xc3b7('0x1e')](_0x384194);}return null;};}function patchUpdates(_0x2ecea1){return function(_0x1b7a93){try{jsonpatch[_0xc3b7('0x24')](_0x1b7a93,_0x2ecea1,!![]);}catch(_0x1949c0){return BPromise[_0xc3b7('0x25')](_0x1949c0);}return _0x1b7a93[_0xc3b7('0x26')]();};}function saveUpdates(_0x5ab44e,_0x44492e){return function(_0x5824e0){if(_0x5824e0){return _0x5824e0[_0xc3b7('0x27')](_0x5ab44e)[_0xc3b7('0x28')](function(_0x206609){return _0x206609;});}return null;};}function removeEntity(_0x251990,_0x414e5c){return function(_0x27ba39){if(_0x27ba39){return _0x27ba39[_0xc3b7('0x29')]()[_0xc3b7('0x28')](function(){var _0x4ea003=_0x27ba39[_0xc3b7('0x2a')]({'plain':!![]});var _0x48ec3d='CannedAnswers';return db[_0xc3b7('0x2b')][_0xc3b7('0x29')]({'where':{'type':_0x48ec3d,'resourceId':_0x4ea003['id']}})[_0xc3b7('0x28')](function(){return _0x27ba39;});})['then'](function(){_0x251990[_0xc3b7('0x1c')](0xcc)[_0xc3b7('0x1d')]();});}};}function handleEntityNotFound(_0x35c319,_0x2f0924){return function(_0x3375fa){if(!_0x3375fa){_0x35c319[_0xc3b7('0x1b')](0x194);}return _0x3375fa;};}function handleError(_0x2808da,_0x402dee){_0x402dee=_0x402dee||0x1f4;return function(_0x1c4009){logger[_0xc3b7('0x2c')](_0x1c4009[_0xc3b7('0x2d')]);if(_0x1c4009[_0xc3b7('0x2e')]){delete _0x1c4009[_0xc3b7('0x2e')];}_0x2808da[_0xc3b7('0x1c')](_0x402dee)[_0xc3b7('0x2f')](_0x1c4009);};}exports[_0xc3b7('0x30')]=function(_0x5027e3,_0x620ce4){var _0x31cc76={},_0x3e99e5={},_0x44965b={'count':0x0,'rows':[]};var _0x1f744f=_[_0xc3b7('0x31')](db[_0xc3b7('0x32')][_0xc3b7('0x33')],function(_0x3bdcfc){return{'name':_0x3bdcfc[_0xc3b7('0x34')],'type':_0x3bdcfc[_0xc3b7('0x35')]['key']};});_0x3e99e5[_0xc3b7('0x36')]=_['map'](_0x1f744f,_0xc3b7('0x2e'));_0x3e99e5[_0xc3b7('0x37')]=_[_0xc3b7('0x38')](_0x5027e3[_0xc3b7('0x37')]);_0x3e99e5[_0xc3b7('0x39')]=_['intersection'](_0x3e99e5['model'],_0x3e99e5[_0xc3b7('0x37')]);_0x31cc76['attributes']=_[_0xc3b7('0x3a')](_0x3e99e5[_0xc3b7('0x36')],qs[_0xc3b7('0x3b')](_0x5027e3[_0xc3b7('0x37')][_0xc3b7('0x3b')]));_0x31cc76['attributes']=_0x31cc76[_0xc3b7('0x3c')][_0xc3b7('0x3d')]?_0x31cc76[_0xc3b7('0x3c')]:_0x3e99e5['model'];if(!_0x5027e3['query'][_0xc3b7('0x3e')](_0xc3b7('0x3f'))){_0x31cc76[_0xc3b7('0x20')]=qs[_0xc3b7('0x20')](_0x5027e3[_0xc3b7('0x37')]['limit']);_0x31cc76['offset']=qs['offset'](_0x5027e3[_0xc3b7('0x37')][_0xc3b7('0x1f')]);}_0x31cc76[_0xc3b7('0x40')]=qs[_0xc3b7('0x41')](_0x5027e3[_0xc3b7('0x37')]['sort']);_0x31cc76[_0xc3b7('0x42')]=qs[_0xc3b7('0x39')](_[_0xc3b7('0x43')](_0x5027e3[_0xc3b7('0x37')],_0x3e99e5[_0xc3b7('0x39')]),_0x1f744f);if(_0x5027e3[_0xc3b7('0x37')][_0xc3b7('0x44')]){_0x31cc76[_0xc3b7('0x42')]=_[_0xc3b7('0x45')](_0x31cc76[_0xc3b7('0x42')],{'$or':[{'key':{'$like':'%'+_0x5027e3[_0xc3b7('0x37')][_0xc3b7('0x44')]+'%'}},{'value':{'$like':'%'+_0x5027e3[_0xc3b7('0x37')][_0xc3b7('0x44')]+'%'}}]});}_0x31cc76=_[_0xc3b7('0x45')]({},_0x31cc76,_0x5027e3[_0xc3b7('0x46')]);var _0x142cc9={'where':_0x31cc76[_0xc3b7('0x42')]};return db[_0xc3b7('0x32')]['count'](_0x142cc9)[_0xc3b7('0x28')](function(_0x25c10e){_0x44965b['count']=_0x25c10e;if(_0x5027e3[_0xc3b7('0x37')]['includeAll']){_0x31cc76[_0xc3b7('0x47')]=[{'all':!![]}];}return db[_0xc3b7('0x32')][_0xc3b7('0x48')](_0x31cc76);})[_0xc3b7('0x28')](function(_0x407072){_0x44965b[_0xc3b7('0x49')]=_0x407072;return _0x44965b;})[_0xc3b7('0x28')](respondWithFilteredResult(_0x620ce4,_0x31cc76))[_0xc3b7('0x4a')](handleError(_0x620ce4,null));};exports[_0xc3b7('0x4b')]=function(_0xc94fa4,_0x4572c9){var _0x35b578={'raw':!![],'where':{'id':_0xc94fa4[_0xc3b7('0x4c')]['id']}},_0x2db30e={};_0x2db30e[_0xc3b7('0x36')]=_[_0xc3b7('0x38')](db['CannedAnswer']['rawAttributes']);_0x2db30e['query']=_['keys'](_0xc94fa4[_0xc3b7('0x37')]);_0x2db30e[_0xc3b7('0x39')]=_[_0xc3b7('0x3a')](_0x2db30e[_0xc3b7('0x36')],_0x2db30e[_0xc3b7('0x37')]);_0x35b578['attributes']=_['intersection'](_0x2db30e[_0xc3b7('0x36')],qs[_0xc3b7('0x3b')](_0xc94fa4['query'][_0xc3b7('0x3b')]));_0x35b578[_0xc3b7('0x3c')]=_0x35b578['attributes'][_0xc3b7('0x3d')]?_0x35b578[_0xc3b7('0x3c')]:_0x2db30e[_0xc3b7('0x36')];if(_0xc94fa4['query'][_0xc3b7('0x4d')]){_0x35b578[_0xc3b7('0x47')]=[{'all':!![]}];}_0x35b578=_[_0xc3b7('0x45')]({},_0x35b578,_0xc94fa4[_0xc3b7('0x46')]);return db[_0xc3b7('0x32')][_0xc3b7('0x4e')](_0x35b578)[_0xc3b7('0x28')](handleEntityNotFound(_0x4572c9,null))['then'](respondWithResult(_0x4572c9,null))[_0xc3b7('0x4a')](handleError(_0x4572c9,null));};exports[_0xc3b7('0x27')]=function(_0x533c81,_0x16fec0){if(_0x533c81['body']['id']){delete _0x533c81[_0xc3b7('0x4f')]['id'];}return db[_0xc3b7('0x32')]['find']({'where':{'id':_0x533c81[_0xc3b7('0x4c')]['id']}})[_0xc3b7('0x28')](handleEntityNotFound(_0x16fec0,null))['then'](saveUpdates(_0x533c81[_0xc3b7('0x4f')],null))[_0xc3b7('0x28')](respondWithResult(_0x16fec0,null))[_0xc3b7('0x4a')](handleError(_0x16fec0,null));};exports[_0xc3b7('0x29')]=function(_0x576968,_0x5098c3){return db['CannedAnswer'][_0xc3b7('0x4e')]({'where':{'id':_0x576968[_0xc3b7('0x4c')]['id']}})[_0xc3b7('0x28')](handleEntityNotFound(_0x5098c3,null))[_0xc3b7('0x28')](removeEntity(_0x5098c3,null))['catch'](handleError(_0x5098c3,null));};exports[_0xc3b7('0x50')]=function(_0x26eeb2,_0x3cef1b){var _0x7b4ba1={'key':_0x26eeb2[_0xc3b7('0x4f')]['key']};if(_0x26eeb2[_0xc3b7('0x4f')][_0xc3b7('0x51')]){_0x7b4ba1['MailAccountId']=_0x26eeb2[_0xc3b7('0x4f')][_0xc3b7('0x51')];}else if(_0x26eeb2['body'][_0xc3b7('0x52')]){_0x7b4ba1[_0xc3b7('0x52')]=_0x26eeb2[_0xc3b7('0x4f')][_0xc3b7('0x52')];}else if(_0x26eeb2[_0xc3b7('0x4f')][_0xc3b7('0x53')]){_0x7b4ba1['OpenchannelAccountId']=_0x26eeb2['body'][_0xc3b7('0x53')];}else if(_0x26eeb2[_0xc3b7('0x4f')][_0xc3b7('0x54')]){_0x7b4ba1[_0xc3b7('0x54')]=_0x26eeb2[_0xc3b7('0x4f')][_0xc3b7('0x54')];}return db[_0xc3b7('0x32')]['find']({'where':_0x7b4ba1})[_0xc3b7('0x28')](function(_0x280870){if(_0x280870){throw new db[(_0xc3b7('0x55'))][(_0xc3b7('0x56'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xc3b7('0x32')]['create'](_0x26eeb2['body']);})[_0xc3b7('0x28')](function(_0x280cda){var _0x4559da=_0x26eeb2[_0xc3b7('0x57')][_0xc3b7('0x2a')]({'plain':!![]});if(!_0x4559da)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4559da['role']==='user'){var _0x4d693d=_0x280cda[_0xc3b7('0x2a')]({'plain':!![]});return db[_0xc3b7('0x58')][_0xc3b7('0x4e')]({'where':{'name':_0xc3b7('0x59'),'userProfileId':_0x4559da[_0xc3b7('0x5a')]},'raw':!![]})[_0xc3b7('0x28')](function(_0x1180dc){if(_0x1180dc&&_0x1180dc[_0xc3b7('0x5b')]===0x0){return db[_0xc3b7('0x2b')][_0xc3b7('0x50')]({'name':_0x4d693d[_0xc3b7('0x2e')],'resourceId':_0x4d693d['id'],'type':_0x1180dc[_0xc3b7('0x2e')],'sectionId':_0x1180dc['id']},{})[_0xc3b7('0x28')](function(){return _0x280cda;});}else{return _0x280cda;}})['catch'](function(_0x3cad8c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3cad8c);throw _0x3cad8c;});}return _0x280cda;})[_0xc3b7('0x28')](respondWithResult(_0x3cef1b,0xc9))[_0xc3b7('0x4a')](handleError(_0x3cef1b,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 7bcc455..a894512 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 _0x1584=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2f42d3,_0x362e7a){var _0x25a67e=function(_0x103ce2){while(--_0x103ce2){_0x2f42d3['push'](_0x2f42d3['shift']());}};_0x25a67e(++_0x362e7a);}(_0x1584,0x139));var _0x4158=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x1584[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x4158('0x0'));var util=require(_0x4158('0x1'));var logger=require(_0x4158('0x2'))(_0x4158('0x3'));var moment=require(_0x4158('0x4'));var BPromise=require(_0x4158('0x5'));var rp=require(_0x4158('0x6'));var fs=require('fs');var path=require(_0x4158('0x7'));var rimraf=require(_0x4158('0x8'));var config=require(_0x4158('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0x4158('0xa')]=function(_0x540f45,_0x1b8c41){return _0x540f45['define'](_0x4158('0xb'),attributes,{'tableName':_0x4158('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4158('0xd'),'collate':_0x4158('0xe')});};
\ No newline at end of file
+var _0xa264=['exports','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x40a529,_0x1ac70a){var _0x1936a8=function(_0x1a46b8){while(--_0x1a46b8){_0x40a529['push'](_0x40a529['shift']());}};_0x1936a8(++_0x1ac70a);}(_0xa264,0x1d3));var _0x4a26=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0xa264[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0x4a26('0x0'));var util=require('util');var logger=require(_0x4a26('0x1'))(_0x4a26('0x2'));var moment=require('moment');var BPromise=require(_0x4a26('0x3'));var rp=require(_0x4a26('0x4'));var fs=require('fs');var path=require(_0x4a26('0x5'));var rimraf=require(_0x4a26('0x6'));var config=require(_0x4a26('0x7'));var attributes=require(_0x4a26('0x8'));module[_0x4a26('0x9')]=function(_0x528fc6,_0x4cab68){return _0x528fc6[_0x4a26('0xa')](_0x4a26('0xb'),attributes,{'tableName':_0x4a26('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a26('0xd'),'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 eb8d2ef..f659542 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(_0x5286f9,_0x31a3a8){var _0x59e798=function(_0x428a72){while(--_0x428a72){_0x5286f9['push'](_0x5286f9['shift']());}};_0x59e798(++_0x31a3a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x22466b,_0x266fad){var _0xa00c5e=function(_0x42c503){while(--_0x42c503){_0x22466b['push'](_0x22466b['shift']());}};_0xa00c5e(++_0x266fad);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 281bebc..4daa978 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 _0xd03e=['index','/:id','show','isAuthenticated','create','put','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x495b00,_0x14ea09){var _0x3dae04=function(_0x4684f7){while(--_0x4684f7){_0x495b00['push'](_0x495b00['shift']());}};_0x3dae04(++_0x14ea09);}(_0xd03e,0x116));var _0xed03=function(_0x4d11eb,_0x4dd9cf){_0x4d11eb=_0x4d11eb-0x0;var _0x5bfece=_0xd03e[_0x4d11eb];return _0x5bfece;};'use strict';var multer=require(_0xed03('0x0'));var util=require('util');var path=require(_0xed03('0x1'));var timeout=require(_0xed03('0x2'));var express=require(_0xed03('0x3'));var router=express['Router']();var fs_extra=require(_0xed03('0x4'));var auth=require(_0xed03('0x5'));var interaction=require(_0xed03('0x6'));var config=require(_0xed03('0x7'));var controller=require(_0xed03('0x8'));router[_0xed03('0x9')]('/',auth['isAuthenticated'](),controller[_0xed03('0xa')]);router[_0xed03('0x9')](_0xed03('0xb'),auth['isAuthenticated'](),controller[_0xed03('0xc')]);router['post']('/',auth[_0xed03('0xd')](),controller[_0xed03('0xe')]);router[_0xed03('0xf')](_0xed03('0xb'),auth[_0xed03('0xd')](),controller['update']);router[_0xed03('0x10')]('/:id',auth[_0xed03('0xd')](),controller[_0xed03('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x4921=['put','update','/:id','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post'];(function(_0x5f9810,_0x1cb048){var _0x318fae=function(_0x26d5db){while(--_0x26d5db){_0x5f9810['push'](_0x5f9810['shift']());}};_0x318fae(++_0x1cb048);}(_0x4921,0x1d4));var _0x1492=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x4921[_0x36c6eb];return _0x30675b;};'use strict';var multer=require(_0x1492('0x0'));var util=require(_0x1492('0x1'));var path=require('path');var timeout=require(_0x1492('0x2'));var express=require(_0x1492('0x3'));var router=express['Router']();var fs_extra=require(_0x1492('0x4'));var auth=require(_0x1492('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1492('0x6'));var controller=require('./cannedAnswer.controller');router[_0x1492('0x7')]('/',auth[_0x1492('0x8')](),controller[_0x1492('0x9')]);router[_0x1492('0x7')]('/:id',auth[_0x1492('0x8')](),controller[_0x1492('0xa')]);router[_0x1492('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1492('0xc')]('/:id',auth[_0x1492('0x8')](),controller[_0x1492('0xd')]);router['delete'](_0x1492('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1492('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 7b94822..43389de 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 _0x6aa0=['exports','DATE','STRING','INTEGER'];(function(_0x8a30a2,_0x2d36a6){var _0xa4e91e=function(_0xdabc7b){while(--_0xdabc7b){_0x8a30a2['push'](_0x8a30a2['shift']());}};_0xa4e91e(++_0x2d36a6);}(_0x6aa0,0xb8));var _0x06aa=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x6aa0[_0x3c4a7c];return _0xf13d1e;};'use strict';var Sequelize=require('sequelize');module[_0x06aa('0x0')]={'calldate':{'type':Sequelize[_0x06aa('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x06aa('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x06aa('0x2')]},'dcontext':{'type':Sequelize[_0x06aa('0x2')]},'channel':{'type':Sequelize[_0x06aa('0x2')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x06aa('0x2')]},'lastdata':{'type':Sequelize[_0x06aa('0x2')]},'duration':{'type':Sequelize[_0x06aa('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x06aa('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x06aa('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x06aa('0x2')]},'userfield':{'type':Sequelize[_0x06aa('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x06aa('0x2')]},'sequence':{'type':Sequelize[_0x06aa('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x06aa('0x2')]}};
\ No newline at end of file
+var _0x1bb2=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x1bb2,0x152));var _0x21bb=function(_0x55825c,_0x37b078){_0x55825c=_0x55825c-0x0;var _0x32a9ed=_0x1bb2[_0x55825c];return _0x32a9ed;};'use strict';var Sequelize=require('sequelize');module[_0x21bb('0x0')]={'calldate':{'type':Sequelize[_0x21bb('0x1')],'allowNull':![],'defaultValue':_0x21bb('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x21bb('0x3')]},'dcontext':{'type':Sequelize[_0x21bb('0x3')]},'channel':{'type':Sequelize[_0x21bb('0x3')]},'dstchannel':{'type':Sequelize[_0x21bb('0x3')]},'lastapp':{'type':Sequelize[_0x21bb('0x3')]},'lastdata':{'type':Sequelize[_0x21bb('0x3')]},'duration':{'type':Sequelize[_0x21bb('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x21bb('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x21bb('0x3')]},'amaflags':{'type':Sequelize[_0x21bb('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x21bb('0x3')]},'userfield':{'type':Sequelize[_0x21bb('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x21bb('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x21bb('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 12055e9..3e2ce8d 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 _0x9fd4=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','Cdr','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x9fd4,0x16c));var _0x49fd=function(_0xc048e2,_0x3825ef){_0xc048e2=_0xc048e2-0x0;var _0x4012ed=_0x9fd4[_0xc048e2];return _0x4012ed;};'use strict';var emlformat=require(_0x49fd('0x0'));var rimraf=require(_0x49fd('0x1'));var zipdir=require(_0x49fd('0x2'));var jsonpatch=require(_0x49fd('0x3'));var rp=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var BPromise=require(_0x49fd('0x6'));var Mustache=require(_0x49fd('0x7'));var util=require(_0x49fd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49fd('0x9'));var ejs=require(_0x49fd('0xa'));var fs=require('fs');var fs_extra=require(_0x49fd('0xb'));var _=require(_0x49fd('0xc'));var squel=require('squel');var crypto=require(_0x49fd('0xd'));var jsforce=require(_0x49fd('0xe'));var deskjs=require(_0x49fd('0xf'));var toCsv=require(_0x49fd('0x9'));var querystring=require(_0x49fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x49fd('0x11'));var authService=require(_0x49fd('0x12'));var qs=require(_0x49fd('0x13'));var as=require(_0x49fd('0x14'));var hardwareService=require(_0x49fd('0x15'));var logger=require(_0x49fd('0x16'))(_0x49fd('0x17'));var utils=require('../../config/utils');var config=require(_0x49fd('0x18'));var licenseUtil=require(_0x49fd('0x19'));var db=require(_0x49fd('0x1a'))['db'];function respondWithStatusCode(_0x40d1b0,_0x15dabd){_0x15dabd=_0x15dabd||0xcc;return function(_0x206bd8){if(_0x206bd8){return _0x40d1b0[_0x49fd('0x1b')](_0x15dabd);}return _0x40d1b0[_0x49fd('0x1c')](_0x15dabd)[_0x49fd('0x1d')]();};}function respondWithResult(_0x652890,_0x157b09){_0x157b09=_0x157b09||0xc8;return function(_0x44c18c){if(_0x44c18c){return _0x652890[_0x49fd('0x1c')](_0x157b09)[_0x49fd('0x1e')](_0x44c18c);}};}function respondWithFilteredResult(_0x264ab1,_0x201109){return function(_0x2859f2){if(_0x2859f2){var _0x3ca675=typeof _0x201109[_0x49fd('0x1f')]===_0x49fd('0x20')&&typeof _0x201109[_0x49fd('0x21')]===_0x49fd('0x20');var _0x320fe5=_0x2859f2[_0x49fd('0x22')];var _0xb55d24=_0x3ca675?0x0:_0x201109[_0x49fd('0x1f')];var _0x598793=_0x3ca675?_0x2859f2[_0x49fd('0x22')]:_0x201109[_0x49fd('0x1f')]+_0x201109['limit'];var _0x5c323a;if(_0x598793>=_0x320fe5){_0x598793=_0x320fe5;_0x5c323a=0xc8;}else{_0x5c323a=0xce;}_0x264ab1[_0x49fd('0x1c')](_0x5c323a);return _0x264ab1['set'](_0x49fd('0x23'),_0xb55d24+'-'+_0x598793+'/'+_0x320fe5)[_0x49fd('0x1e')](_0x2859f2);}return null;};}function patchUpdates(_0x599315){return function(_0xf7efcf){try{jsonpatch[_0x49fd('0x24')](_0xf7efcf,_0x599315,!![]);}catch(_0x5ae3bc){return BPromise[_0x49fd('0x25')](_0x5ae3bc);}return _0xf7efcf[_0x49fd('0x26')]();};}function saveUpdates(_0x2e1c40,_0x290f59){return function(_0x20fa0d){if(_0x20fa0d){return _0x20fa0d[_0x49fd('0x27')](_0x2e1c40)['then'](function(_0x46019d){return _0x46019d;});}return null;};}function removeEntity(_0xd43815,_0x8f202b){return function(_0x4bf811){if(_0x4bf811){return _0x4bf811[_0x49fd('0x28')]()[_0x49fd('0x29')](function(){_0xd43815[_0x49fd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597161,_0x497469){return function(_0x13c5a8){if(!_0x13c5a8){_0x597161[_0x49fd('0x1b')](0x194);}return _0x13c5a8;};}function handleError(_0x4ec190,_0x302ab2){_0x302ab2=_0x302ab2||0x1f4;return function(_0x9587b9){logger[_0x49fd('0x2a')](_0x9587b9[_0x49fd('0x2b')]);if(_0x9587b9[_0x49fd('0x2c')]){delete _0x9587b9['name'];}_0x4ec190[_0x49fd('0x1c')](_0x302ab2)['send'](_0x9587b9);};}exports[_0x49fd('0x2d')]=function(_0x89badc,_0x54acb5){var _0x203038={},_0x2c8568={},_0x23374c={'count':0x0,'rows':[]};var _0x43826f=_[_0x49fd('0x2e')](db[_0x49fd('0x2f')][_0x49fd('0x30')],function(_0x242203){return{'name':_0x242203['fieldName'],'type':_0x242203[_0x49fd('0x31')]['key']};});_0x2c8568[_0x49fd('0x32')]=_['map'](_0x43826f,_0x49fd('0x2c'));_0x2c8568[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x89badc['query']);_0x2c8568['filters']=_['intersection'](_0x2c8568[_0x49fd('0x32')],_0x2c8568[_0x49fd('0x33')]);_0x203038['attributes']=_[_0x49fd('0x35')](_0x2c8568['model'],qs['fields'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x36')]));_0x203038[_0x49fd('0x37')]=_0x203038[_0x49fd('0x37')][_0x49fd('0x38')]?_0x203038['attributes']:_0x2c8568['model'];if(!_0x89badc[_0x49fd('0x33')][_0x49fd('0x39')](_0x49fd('0x3a'))){_0x203038[_0x49fd('0x21')]=qs['limit'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x21')]);_0x203038[_0x49fd('0x1f')]=qs[_0x49fd('0x1f')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x1f')]);}_0x203038[_0x49fd('0x3b')]=qs[_0x49fd('0x3c')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x3c')]);_0x203038[_0x49fd('0x3d')]=qs['filters'](_[_0x49fd('0x3e')](_0x89badc[_0x49fd('0x33')],_0x2c8568[_0x49fd('0x3f')]),_0x43826f);if(_0x89badc[_0x49fd('0x33')][_0x49fd('0x40')]){_0x203038[_0x49fd('0x3d')]=_[_0x49fd('0x41')](_0x203038[_0x49fd('0x3d')],{'$or':_[_0x49fd('0x2e')](_0x43826f,function(_0x4a1856){if(_0x4a1856[_0x49fd('0x31')]!=='VIRTUAL'){var _0x46e84c={};_0x46e84c[_0x4a1856[_0x49fd('0x2c')]]={'$like':'%'+_0x89badc['query'][_0x49fd('0x40')]+'%'};return _0x46e84c;}})});}_0x203038=_[_0x49fd('0x41')]({},_0x203038,_0x89badc['options']);var _0x1f9a65={'where':_0x203038['where']};return db['Cdr']['count'](_0x1f9a65)[_0x49fd('0x29')](function(_0x32982e){_0x23374c[_0x49fd('0x22')]=_0x32982e;if(_0x89badc[_0x49fd('0x33')]['includeAll']){_0x203038[_0x49fd('0x42')]=[{'all':!![]}];}return db[_0x49fd('0x2f')][_0x49fd('0x43')](_0x203038);})[_0x49fd('0x29')](function(_0x115c5a){_0x23374c[_0x49fd('0x44')]=_0x115c5a;return _0x23374c;})[_0x49fd('0x29')](respondWithFilteredResult(_0x54acb5,_0x203038))[_0x49fd('0x45')](handleError(_0x54acb5,null));};exports['show']=function(_0x255a73,_0x2c8ab1){var _0x4dce94={'raw':!![],'where':{'id':_0x255a73[_0x49fd('0x46')]['id']}},_0x3be41b={};_0x3be41b['model']=_[_0x49fd('0x34')](db['Cdr'][_0x49fd('0x30')]);_0x3be41b[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x255a73[_0x49fd('0x33')]);_0x3be41b['filters']=_['intersection'](_0x3be41b[_0x49fd('0x32')],_0x3be41b['query']);_0x4dce94[_0x49fd('0x37')]=_[_0x49fd('0x35')](_0x3be41b[_0x49fd('0x32')],qs[_0x49fd('0x36')](_0x255a73['query'][_0x49fd('0x36')]));_0x4dce94[_0x49fd('0x37')]=_0x4dce94[_0x49fd('0x37')][_0x49fd('0x38')]?_0x4dce94[_0x49fd('0x37')]:_0x3be41b[_0x49fd('0x32')];if(_0x255a73[_0x49fd('0x33')][_0x49fd('0x47')]){_0x4dce94[_0x49fd('0x42')]=[{'all':!![]}];}_0x4dce94=_[_0x49fd('0x41')]({},_0x4dce94,_0x255a73[_0x49fd('0x48')]);return db[_0x49fd('0x2f')][_0x49fd('0x49')](_0x4dce94)[_0x49fd('0x29')](handleEntityNotFound(_0x2c8ab1,null))['then'](respondWithResult(_0x2c8ab1,null))['catch'](handleError(_0x2c8ab1,null));};exports[_0x49fd('0x4a')]=function(_0xa3518f,_0x42287e){return db[_0x49fd('0x2f')]['create'](_0xa3518f[_0x49fd('0x4b')],{})[_0x49fd('0x29')](respondWithResult(_0x42287e,0xc9))['catch'](handleError(_0x42287e,null));};exports[_0x49fd('0x27')]=function(_0x270360,_0xaac56f){if(_0x270360[_0x49fd('0x4b')]['id']){delete _0x270360[_0x49fd('0x4b')]['id'];}return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x270360[_0x49fd('0x46')]['id']}})[_0x49fd('0x29')](handleEntityNotFound(_0xaac56f,null))[_0x49fd('0x29')](saveUpdates(_0x270360[_0x49fd('0x4b')],null))['then'](respondWithResult(_0xaac56f,null))[_0x49fd('0x45')](handleError(_0xaac56f,null));};exports[_0x49fd('0x28')]=function(_0x32694b,_0x263cf3){return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x32694b['params']['id']}})['then'](handleEntityNotFound(_0x263cf3,null))[_0x49fd('0x29')](removeEntity(_0x263cf3,null))[_0x49fd('0x45')](handleError(_0x263cf3,null));};exports[_0x49fd('0x4c')]=function(_0x5c34c0,_0x31783f){return db[_0x49fd('0x2f')]['describe']()['then'](respondWithResult(_0x31783f,null))['catch'](handleError(_0x31783f,null));};
\ No newline at end of file
+var _0x8958=['describe','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','Cdr','includeAll','include','findAll','merge','find','catch','create','body','params'];(function(_0x58ebf8,_0x416386){var _0x17f9a0=function(_0x535d42){while(--_0x535d42){_0x58ebf8['push'](_0x58ebf8['shift']());}};_0x17f9a0(++_0x416386);}(_0x8958,0x93));var _0x8895=function(_0x1105ad,_0x374846){_0x1105ad=_0x1105ad-0x0;var _0x283bfd=_0x8958[_0x1105ad];return _0x283bfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['Cdr']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['map'](_0x16b65b,_0x8895('0x26'));_0x37ac3a['query']=_[_0x8895('0x2e')](_0x5c03ea['query']);_0x37ac3a[_0x8895('0x2f')]=_[_0x8895('0x30')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a[_0x8895('0x31')]);_0x6e449d[_0x8895('0x32')]=_['intersection'](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x33')](_0x5c03ea[_0x8895('0x31')][_0x8895('0x33')]));_0x6e449d[_0x8895('0x32')]=_0x6e449d['attributes'][_0x8895('0x34')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea['query'][_0x8895('0x35')](_0x8895('0x36'))){_0x6e449d[_0x8895('0x1d')]=qs[_0x8895('0x1d')](_0x5c03ea[_0x8895('0x31')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs['offset'](_0x5c03ea[_0x8895('0x31')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x37')]=qs[_0x8895('0x38')](_0x5c03ea[_0x8895('0x31')][_0x8895('0x38')]);_0x6e449d['where']=qs[_0x8895('0x2f')](_[_0x8895('0x39')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x2f')]),_0x16b65b);if(_0x5c03ea['query'][_0x8895('0x3a')]){_0x6e449d[_0x8895('0x3b')]=_['merge'](_0x6e449d[_0x8895('0x3b')],{'$or':_[_0x8895('0x29')](_0x16b65b,function(_0x5b7204){if(_0x5b7204['type']!==_0x8895('0x3c')){var _0xf0b378={};_0xf0b378[_0x5b7204[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea[_0x8895('0x31')][_0x8895('0x3a')]+'%'};return _0xf0b378;}})});}_0x6e449d=_['merge']({},_0x6e449d,_0x5c03ea[_0x8895('0x3d')]);var _0x25c854={'where':_0x6e449d[_0x8895('0x3b')]};return db[_0x8895('0x3e')][_0x8895('0x1e')](_0x25c854)[_0x8895('0x24')](function(_0x4a7e22){_0x3fc4cc[_0x8895('0x1e')]=_0x4a7e22;if(_0x5c03ea['query'][_0x8895('0x3f')]){_0x6e449d[_0x8895('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x8895('0x41')](_0x6e449d);})['then'](function(_0x1e6395){_0x3fc4cc['rows']=_0x1e6395;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x4881d0,_0x47cf10){var _0x447ed6={'raw':!![],'where':{'id':_0x4881d0['params']['id']}},_0x206f57={};_0x206f57['model']=_[_0x8895('0x2e')](db[_0x8895('0x3e')]['rawAttributes']);_0x206f57[_0x8895('0x31')]=_[_0x8895('0x2e')](_0x4881d0[_0x8895('0x31')]);_0x206f57[_0x8895('0x2f')]=_[_0x8895('0x30')](_0x206f57['model'],_0x206f57['query']);_0x447ed6['attributes']=_[_0x8895('0x30')](_0x206f57['model'],qs[_0x8895('0x33')](_0x4881d0[_0x8895('0x31')][_0x8895('0x33')]));_0x447ed6[_0x8895('0x32')]=_0x447ed6['attributes'][_0x8895('0x34')]?_0x447ed6[_0x8895('0x32')]:_0x206f57[_0x8895('0x2d')];if(_0x4881d0[_0x8895('0x31')][_0x8895('0x3f')]){_0x447ed6[_0x8895('0x40')]=[{'all':!![]}];}_0x447ed6=_[_0x8895('0x42')]({},_0x447ed6,_0x4881d0[_0x8895('0x3d')]);return db['Cdr'][_0x8895('0x43')](_0x447ed6)[_0x8895('0x24')](handleEntityNotFound(_0x47cf10,null))['then'](respondWithResult(_0x47cf10,null))[_0x8895('0x44')](handleError(_0x47cf10,null));};exports['create']=function(_0x5829ec,_0x13546d){return db[_0x8895('0x3e')][_0x8895('0x45')](_0x5829ec['body'],{})[_0x8895('0x24')](respondWithResult(_0x13546d,0xc9))['catch'](handleError(_0x13546d,null));};exports[_0x8895('0x23')]=function(_0x152197,_0xb3ecd6){if(_0x152197[_0x8895('0x46')]['id']){delete _0x152197[_0x8895('0x46')]['id'];}return db[_0x8895('0x3e')][_0x8895('0x43')]({'where':{'id':_0x152197['params']['id']}})['then'](handleEntityNotFound(_0xb3ecd6,null))[_0x8895('0x24')](saveUpdates(_0x152197[_0x8895('0x46')],null))['then'](respondWithResult(_0xb3ecd6,null))[_0x8895('0x44')](handleError(_0xb3ecd6,null));};exports['destroy']=function(_0x4e8af3,_0x2daafe){return db['Cdr'][_0x8895('0x43')]({'where':{'id':_0x4e8af3[_0x8895('0x47')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2daafe,null))[_0x8895('0x24')](removeEntity(_0x2daafe,null))[_0x8895('0x44')](handleError(_0x2daafe,null));};exports[_0x8895('0x48')]=function(_0x306481,_0x38d6ae){return db['Cdr'][_0x8895('0x48')]()[_0x8895('0x24')](respondWithResult(_0x38d6ae,null))[_0x8895('0x44')](handleError(_0x38d6ae,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 7e9e6fa..4cb2613 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x39af91,_0x90a626){var _0x1827db=function(_0x56a405){while(--_0x56a405){_0x39af91['push'](_0x39af91['shift']());}};_0x1827db(++_0x90a626);}(_0x7a54,0x106));var _0x47a5=function(_0x5271db,_0xfc90e7){_0x5271db=_0x5271db-0x0;var _0x416438=_0x7a54[_0x5271db];return _0x416438;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x53a316,_0xf26b8f){var _0x37c0df=function(_0x1220b0){while(--_0x1220b0){_0x53a316['push'](_0x53a316['shift']());}};_0x37c0df(++_0xf26b8f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 25ae926..74d09bf 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 _0x6487=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result'];(function(_0x5223d8,_0x4084f2){var _0x35b768=function(_0x1281d0){while(--_0x1281d0){_0x5223d8['push'](_0x5223d8['shift']());}};_0x35b768(++_0x4084f2);}(_0x6487,0x112));var _0x7648=function(_0x2b5d2c,_0x2da1a8){_0x2b5d2c=_0x2b5d2c-0x0;var _0x50de0a=_0x6487[_0x2b5d2c];return _0x50de0a;};'use strict';var _=require('lodash');var util=require(_0x7648('0x0'));var moment=require(_0x7648('0x1'));var BPromise=require(_0x7648('0x2'));var rs=require(_0x7648('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7648('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7648('0x5'))(_0x7648('0x6'));var config=require(_0x7648('0x7'));var jayson=require(_0x7648('0x8'));var client=jayson[_0x7648('0x9')][_0x7648('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x557d9f,_0x3ab286,_0x1ec19e){return new BPromise(function(_0x331e4f,_0x4560ec){return client[_0x7648('0xb')](_0x557d9f,_0x1ec19e)['then'](function(_0x188d3e){logger[_0x7648('0xc')]('Cdr,\x20%s,\x20%s',_0x3ab286,_0x7648('0xd'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x3ab286,_0x7648('0xd'),JSON[_0x7648('0xe')](_0x188d3e));if(_0x188d3e[_0x7648('0xf')]){if(_0x188d3e['error'][_0x7648('0x10')]===0x1f4){logger['error'](_0x7648('0x11'),_0x3ab286,_0x188d3e[_0x7648('0xf')][_0x7648('0x12')]);return _0x4560ec(_0x188d3e[_0x7648('0xf')]['message']);}logger[_0x7648('0xf')](_0x7648('0x11'),_0x3ab286,_0x188d3e[_0x7648('0xf')][_0x7648('0x12')]);return _0x331e4f(_0x188d3e[_0x7648('0xf')][_0x7648('0x12')]);}else{logger[_0x7648('0xc')]('Cdr,\x20%s,\x20%s',_0x3ab286,_0x7648('0xd'));_0x331e4f(_0x188d3e[_0x7648('0x13')][_0x7648('0x12')]);}})[_0x7648('0x14')](function(_0x2c9dc1){logger[_0x7648('0xf')](_0x7648('0x11'),_0x3ab286,_0x2c9dc1);_0x4560ec(_0x2c9dc1);});});}
\ No newline at end of file
+var _0x711a=['client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0xb2120f,_0x1e23c1){var _0x3b8dd9=function(_0xa8dafe){while(--_0xa8dafe){_0xb2120f['push'](_0xb2120f['shift']());}};_0x3b8dd9(++_0x1e23c1);}(_0x711a,0xf5));var _0xa711=function(_0x165b12,_0x4aff80){_0x165b12=_0x165b12-0x0;var _0x378222=_0x711a[_0x165b12];return _0x378222;};'use strict';var _=require('lodash');var util=require(_0xa711('0x0'));var moment=require('moment');var BPromise=require(_0xa711('0x1'));var rs=require(_0xa711('0x2'));var fs=require('fs');var Redis=require(_0xa711('0x3'));var db=require(_0xa711('0x4'))['db'];var utils=require(_0xa711('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa711('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa711('0x7')][_0xa711('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x256113,_0x43080a,_0x4daae4){return new BPromise(function(_0x4f8d44,_0x19f618){return client[_0xa711('0x9')](_0x256113,_0x4daae4)[_0xa711('0xa')](function(_0x153ece){logger['info'](_0xa711('0xb'),_0x43080a,_0xa711('0xc'));logger[_0xa711('0xd')](_0xa711('0xe'),_0x43080a,'request\x20sent',JSON[_0xa711('0xf')](_0x153ece));if(_0x153ece['error']){if(_0x153ece['error'][_0xa711('0x10')]===0x1f4){logger['error'](_0xa711('0xb'),_0x43080a,_0x153ece[_0xa711('0x11')][_0xa711('0x12')]);return _0x19f618(_0x153ece['error'][_0xa711('0x12')]);}logger['error'](_0xa711('0xb'),_0x43080a,_0x153ece[_0xa711('0x11')][_0xa711('0x12')]);return _0x4f8d44(_0x153ece['error'][_0xa711('0x12')]);}else{logger[_0xa711('0x13')](_0xa711('0xb'),_0x43080a,_0xa711('0xc'));_0x4f8d44(_0x153ece[_0xa711('0x14')]['message']);}})['catch'](function(_0x105483){logger[_0xa711('0x11')]('Cdr,\x20%s,\x20%s',_0x43080a,_0x105483);_0x19f618(_0x105483);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index fb85b20..2b40ed0 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x54820c,_0xd5a2f6){var _0x5c60c1=function(_0x495680){while(--_0x495680){_0x54820c['push'](_0x54820c['shift']());}};_0x5c60c1(++_0xd5a2f6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 1c1432c..757a463 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 _0x11fc=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x1b3228,_0x220869){var _0x47dade=function(_0x27523b){while(--_0x27523b){_0x1b3228['push'](_0x1b3228['shift']());}};_0x47dade(++_0x220869);}(_0x11fc,0x1ea));var _0xc11f=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x11fc[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xc11f('0x0'));module[_0xc11f('0x1')]={'priority':{'type':Sequelize[_0xc11f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc11f('0x3')],'allowNull':![],'defaultValue':_0xc11f('0x4')},'appdata':{'type':Sequelize[_0xc11f('0x5')]()},'description':{'type':Sequelize[_0xc11f('0x3')]},'interval':{'type':Sequelize[_0xc11f('0x3')],'defaultValue':_0xc11f('0x6')}};
\ No newline at end of file
+var _0xe59b=['noop','TEXT','STRING','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe59b,0x1de));var _0xbe59=function(_0x52253f,_0x1def94){_0x52253f=_0x52253f-0x0;var _0x462d99=_0xe59b[_0x52253f];return _0x462d99;};'use strict';var Sequelize=require(_0xbe59('0x0'));module[_0xbe59('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbe59('0x2')},'appdata':{'type':Sequelize[_0xbe59('0x3')]()},'description':{'type':Sequelize[_0xbe59('0x4')]},'interval':{'type':Sequelize[_0xbe59('0x4')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index bcc7bdc..1dd88ae 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 _0x26f9=['length','includeAll','include','options','find','catch','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','params','model','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields'];(function(_0x4e5658,_0x1746c3){var _0x5a9e0b=function(_0x17fe7e){while(--_0x17fe7e){_0x4e5658['push'](_0x4e5658['shift']());}};_0x5a9e0b(++_0x1746c3);}(_0x26f9,0x16f));var _0x926f=function(_0x4d830b,_0x27f78d){_0x4d830b=_0x4d830b-0x0;var _0x238c89=_0x26f9[_0x4d830b];return _0x238c89;};'use strict';var emlformat=require(_0x926f('0x0'));var rimraf=require(_0x926f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x926f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x926f('0x3'));var Mustache=require(_0x926f('0x4'));var util=require('util');var path=require(_0x926f('0x5'));var sox=require(_0x926f('0x6'));var csv=require(_0x926f('0x7'));var ejs=require(_0x926f('0x8'));var fs=require('fs');var fs_extra=require(_0x926f('0x9'));var _=require(_0x926f('0xa'));var squel=require(_0x926f('0xb'));var crypto=require(_0x926f('0xc'));var jsforce=require(_0x926f('0xd'));var deskjs=require(_0x926f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x926f('0xf'));var Papa=require('papaparse');var Redis=require(_0x926f('0x10'));var authService=require(_0x926f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x926f('0x12'));var hardwareService=require(_0x926f('0x13'));var logger=require(_0x926f('0x14'))(_0x926f('0x15'));var utils=require(_0x926f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x926f('0x17'));var db=require(_0x926f('0x18'))['db'];function respondWithStatusCode(_0x14f316,_0x1ac8ab){_0x1ac8ab=_0x1ac8ab||0xcc;return function(_0x44f5da){if(_0x44f5da){return _0x14f316[_0x926f('0x19')](_0x1ac8ab);}return _0x14f316[_0x926f('0x1a')](_0x1ac8ab)['end']();};}function respondWithResult(_0x48ee07,_0x5e6fb1){_0x5e6fb1=_0x5e6fb1||0xc8;return function(_0x11197b){if(_0x11197b){return _0x48ee07[_0x926f('0x1a')](_0x5e6fb1)[_0x926f('0x1b')](_0x11197b);}};}function respondWithFilteredResult(_0x280759,_0x57c87f){return function(_0x37035c){if(_0x37035c){var _0x385fad=typeof _0x57c87f['offset']===_0x926f('0x1c')&&typeof _0x57c87f['limit']===_0x926f('0x1c');var _0x5ad99f=_0x37035c['count'];var _0x36ead3=_0x385fad?0x0:_0x57c87f[_0x926f('0x1d')];var _0x4f25e3=_0x385fad?_0x37035c[_0x926f('0x1e')]:_0x57c87f[_0x926f('0x1d')]+_0x57c87f[_0x926f('0x1f')];var _0x50b2d4;if(_0x4f25e3>=_0x5ad99f){_0x4f25e3=_0x5ad99f;_0x50b2d4=0xc8;}else{_0x50b2d4=0xce;}_0x280759[_0x926f('0x1a')](_0x50b2d4);return _0x280759[_0x926f('0x20')]('Content-Range',_0x36ead3+'-'+_0x4f25e3+'/'+_0x5ad99f)[_0x926f('0x1b')](_0x37035c);}return null;};}function patchUpdates(_0x4241ac){return function(_0x56fef1){try{jsonpatch[_0x926f('0x21')](_0x56fef1,_0x4241ac,!![]);}catch(_0xa942ae){return BPromise[_0x926f('0x22')](_0xa942ae);}return _0x56fef1[_0x926f('0x23')]();};}function saveUpdates(_0x150430,_0x3b7179){return function(_0x412260){if(_0x412260){return _0x412260[_0x926f('0x24')](_0x150430)[_0x926f('0x25')](function(_0x61738a){return _0x61738a;});}return null;};}function removeEntity(_0x2be66b,_0x4a93a4){return function(_0x2d76eb){if(_0x2d76eb){return _0x2d76eb[_0x926f('0x26')]()['then'](function(){_0x2be66b[_0x926f('0x1a')](0xcc)[_0x926f('0x27')]();});}};}function handleEntityNotFound(_0x36a17e,_0x26391d){return function(_0x799889){if(!_0x799889){_0x36a17e[_0x926f('0x19')](0x194);}return _0x799889;};}function handleError(_0x4b8964,_0x110e59){_0x110e59=_0x110e59||0x1f4;return function(_0x5065dd){logger[_0x926f('0x28')](_0x5065dd[_0x926f('0x29')]);if(_0x5065dd[_0x926f('0x2a')]){delete _0x5065dd[_0x926f('0x2a')];}_0x4b8964['status'](_0x110e59)[_0x926f('0x2b')](_0x5065dd);};}exports['show']=function(_0xc88ea4,_0x2556ce){var _0x518a47={'raw':!![],'where':{'id':_0xc88ea4[_0x926f('0x2c')]['id']}},_0x5f35fe={};_0x5f35fe[_0x926f('0x2d')]=_['keys'](db[_0x926f('0x2e')][_0x926f('0x2f')]);_0x5f35fe['query']=_['keys'](_0xc88ea4[_0x926f('0x30')]);_0x5f35fe[_0x926f('0x31')]=_[_0x926f('0x32')](_0x5f35fe['model'],_0x5f35fe[_0x926f('0x30')]);_0x518a47[_0x926f('0x33')]=_[_0x926f('0x32')](_0x5f35fe['model'],qs[_0x926f('0x34')](_0xc88ea4[_0x926f('0x30')][_0x926f('0x34')]));_0x518a47[_0x926f('0x33')]=_0x518a47[_0x926f('0x33')][_0x926f('0x35')]?_0x518a47['attributes']:_0x5f35fe[_0x926f('0x2d')];if(_0xc88ea4[_0x926f('0x30')][_0x926f('0x36')]){_0x518a47[_0x926f('0x37')]=[{'all':!![]}];}_0x518a47=_['merge']({},_0x518a47,_0xc88ea4[_0x926f('0x38')]);return db[_0x926f('0x2e')][_0x926f('0x39')](_0x518a47)[_0x926f('0x25')](handleEntityNotFound(_0x2556ce,null))[_0x926f('0x25')](respondWithResult(_0x2556ce,null))[_0x926f('0x3a')](handleError(_0x2556ce,null));};exports[_0x926f('0x24')]=function(_0xaad45d,_0x2184c1){if(_0xaad45d[_0x926f('0x3b')]['id']){delete _0xaad45d[_0x926f('0x3b')]['id'];}return db['ChatApplication'][_0x926f('0x39')]({'where':{'id':_0xaad45d[_0x926f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2184c1,null))[_0x926f('0x25')](saveUpdates(_0xaad45d[_0x926f('0x3b')],null))[_0x926f('0x25')](respondWithResult(_0x2184c1,null))[_0x926f('0x3a')](handleError(_0x2184c1,null));};exports[_0x926f('0x26')]=function(_0x3a21ca,_0x9ff853){return db[_0x926f('0x2e')]['find']({'where':{'id':_0x3a21ca[_0x926f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x9ff853,null))[_0x926f('0x25')](removeEntity(_0x9ff853,null))[_0x926f('0x3a')](handleError(_0x9ff853,null));};
\ No newline at end of file
+var _0x9c02=['destroy','error','stack','send','show','ChatApplication','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','options','find','catch','update','body','params','eml-format','rimraf','zip-dir','mustache','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../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','then'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x9c02,0x196));var _0x29c0=function(_0x906146,_0x2ac357){_0x906146=_0x906146-0x0;var _0x225ecb=_0x9c02[_0x906146];return _0x225ecb;};'use strict';var emlformat=require(_0x29c0('0x0'));var rimraf=require(_0x29c0('0x1'));var zipdir=require(_0x29c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x29c0('0x3'));var util=require('util');var path=require(_0x29c0('0x4'));var sox=require('sox');var csv=require(_0x29c0('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29c0('0x6'));var _=require(_0x29c0('0x7'));var squel=require(_0x29c0('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x29c0('0x9'));var toCsv=require(_0x29c0('0x5'));var querystring=require(_0x29c0('0xa'));var Papa=require(_0x29c0('0xb'));var Redis=require(_0x29c0('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x29c0('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29c0('0xe'))(_0x29c0('0xf'));var utils=require(_0x29c0('0x10'));var config=require(_0x29c0('0x11'));var licenseUtil=require(_0x29c0('0x12'));var db=require(_0x29c0('0x13'))['db'];function respondWithStatusCode(_0x5b4ef2,_0x7a6a5e){_0x7a6a5e=_0x7a6a5e||0xcc;return function(_0x350922){if(_0x350922){return _0x5b4ef2[_0x29c0('0x14')](_0x7a6a5e);}return _0x5b4ef2[_0x29c0('0x15')](_0x7a6a5e)[_0x29c0('0x16')]();};}function respondWithResult(_0x28cc02,_0x1e622a){_0x1e622a=_0x1e622a||0xc8;return function(_0x2947da){if(_0x2947da){return _0x28cc02[_0x29c0('0x15')](_0x1e622a)[_0x29c0('0x17')](_0x2947da);}};}function respondWithFilteredResult(_0x4721f0,_0xccb222){return function(_0x235725){if(_0x235725){var _0x1ce122=typeof _0xccb222[_0x29c0('0x18')]===_0x29c0('0x19')&&typeof _0xccb222[_0x29c0('0x1a')]===_0x29c0('0x19');var _0x4309fc=_0x235725[_0x29c0('0x1b')];var _0x627c4c=_0x1ce122?0x0:_0xccb222[_0x29c0('0x18')];var _0x2bfa71=_0x1ce122?_0x235725[_0x29c0('0x1b')]:_0xccb222[_0x29c0('0x18')]+_0xccb222[_0x29c0('0x1a')];var _0x311c9b;if(_0x2bfa71>=_0x4309fc){_0x2bfa71=_0x4309fc;_0x311c9b=0xc8;}else{_0x311c9b=0xce;}_0x4721f0['status'](_0x311c9b);return _0x4721f0[_0x29c0('0x1c')](_0x29c0('0x1d'),_0x627c4c+'-'+_0x2bfa71+'/'+_0x4309fc)[_0x29c0('0x17')](_0x235725);}return null;};}function patchUpdates(_0x3c3eb2){return function(_0x38eab0){try{jsonpatch[_0x29c0('0x1e')](_0x38eab0,_0x3c3eb2,!![]);}catch(_0x54f8f1){return BPromise[_0x29c0('0x1f')](_0x54f8f1);}return _0x38eab0[_0x29c0('0x20')]();};}function saveUpdates(_0x45a6cb,_0x26bf2e){return function(_0x1f962f){if(_0x1f962f){return _0x1f962f['update'](_0x45a6cb)[_0x29c0('0x21')](function(_0x42b082){return _0x42b082;});}return null;};}function removeEntity(_0x5846d0,_0x1114a8){return function(_0x402c54){if(_0x402c54){return _0x402c54[_0x29c0('0x22')]()['then'](function(){_0x5846d0[_0x29c0('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x161b39,_0x140988){return function(_0x5561af){if(!_0x5561af){_0x161b39[_0x29c0('0x14')](0x194);}return _0x5561af;};}function handleError(_0xd7f9a8,_0x3946f8){_0x3946f8=_0x3946f8||0x1f4;return function(_0x184998){logger[_0x29c0('0x23')](_0x184998[_0x29c0('0x24')]);if(_0x184998['name']){delete _0x184998['name'];}_0xd7f9a8['status'](_0x3946f8)[_0x29c0('0x25')](_0x184998);};}exports[_0x29c0('0x26')]=function(_0x4cdf7c,_0x4aa6bd){var _0x208a5d={'raw':!![],'where':{'id':_0x4cdf7c['params']['id']}},_0x3eebaa={};_0x3eebaa['model']=_['keys'](db[_0x29c0('0x27')][_0x29c0('0x28')]);_0x3eebaa[_0x29c0('0x29')]=_['keys'](_0x4cdf7c[_0x29c0('0x29')]);_0x3eebaa[_0x29c0('0x2a')]=_['intersection'](_0x3eebaa[_0x29c0('0x2b')],_0x3eebaa[_0x29c0('0x29')]);_0x208a5d[_0x29c0('0x2c')]=_[_0x29c0('0x2d')](_0x3eebaa[_0x29c0('0x2b')],qs[_0x29c0('0x2e')](_0x4cdf7c[_0x29c0('0x29')]['fields']));_0x208a5d['attributes']=_0x208a5d[_0x29c0('0x2c')][_0x29c0('0x2f')]?_0x208a5d[_0x29c0('0x2c')]:_0x3eebaa['model'];if(_0x4cdf7c[_0x29c0('0x29')][_0x29c0('0x30')]){_0x208a5d['include']=[{'all':!![]}];}_0x208a5d=_['merge']({},_0x208a5d,_0x4cdf7c[_0x29c0('0x31')]);return db[_0x29c0('0x27')][_0x29c0('0x32')](_0x208a5d)[_0x29c0('0x21')](handleEntityNotFound(_0x4aa6bd,null))[_0x29c0('0x21')](respondWithResult(_0x4aa6bd,null))[_0x29c0('0x33')](handleError(_0x4aa6bd,null));};exports[_0x29c0('0x34')]=function(_0x566e0a,_0x315bca){if(_0x566e0a['body']['id']){delete _0x566e0a[_0x29c0('0x35')]['id'];}return db[_0x29c0('0x27')][_0x29c0('0x32')]({'where':{'id':_0x566e0a['params']['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x315bca,null))[_0x29c0('0x21')](saveUpdates(_0x566e0a['body'],null))[_0x29c0('0x21')](respondWithResult(_0x315bca,null))[_0x29c0('0x33')](handleError(_0x315bca,null));};exports[_0x29c0('0x22')]=function(_0x28c919,_0x3a9b92){return db[_0x29c0('0x27')][_0x29c0('0x32')]({'where':{'id':_0x28c919[_0x29c0('0x36')]['id']}})[_0x29c0('0x21')](handleEntityNotFound(_0x3a9b92,null))[_0x29c0('0x21')](removeEntity(_0x3a9b92,null))[_0x29c0('0x33')](handleError(_0x3a9b92,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 1cd5565..86f0c62 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 _0x3c57=['./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x516a08,_0xb28bd5){var _0x5bd2b3=function(_0x567e55){while(--_0x567e55){_0x516a08['push'](_0x516a08['shift']());}};_0x5bd2b3(++_0xb28bd5);}(_0x3c57,0x8c));var _0x73c5=function(_0x1bf3b9,_0x3456ec){_0x1bf3b9=_0x1bf3b9-0x0;var _0xcf3b80=_0x3c57[_0x1bf3b9];return _0xcf3b80;};'use strict';var _=require(_0x73c5('0x0'));var util=require(_0x73c5('0x1'));var logger=require(_0x73c5('0x2'))(_0x73c5('0x3'));var moment=require(_0x73c5('0x4'));var BPromise=require(_0x73c5('0x5'));var rp=require(_0x73c5('0x6'));var fs=require('fs');var path=require(_0x73c5('0x7'));var rimraf=require(_0x73c5('0x8'));var config=require(_0x73c5('0x9'));var attributes=require(_0x73c5('0xa'));module[_0x73c5('0xb')]=function(_0x47bec6,_0x5750e5){return _0x47bec6['define'](_0x73c5('0xc'),attributes,{'tableName':_0x73c5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x73c5('0xe')});};
\ No newline at end of file
+var _0xcb70=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise','path'];(function(_0x277ac1,_0x1b4e45){var _0x28db07=function(_0x57e0a6){while(--_0x57e0a6){_0x277ac1['push'](_0x277ac1['shift']());}};_0x28db07(++_0x1b4e45);}(_0xcb70,0xf3));var _0x0cb7=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xcb70[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x0cb7('0x0'));var util=require(_0x0cb7('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0cb7('0x2'));var fs=require('fs');var path=require(_0x0cb7('0x3'));var rimraf=require(_0x0cb7('0x4'));var config=require(_0x0cb7('0x5'));var attributes=require(_0x0cb7('0x6'));module[_0x0cb7('0x7')]=function(_0x19a010,_0x4e5b82){return _0x19a010[_0x0cb7('0x8')](_0x0cb7('0x9'),attributes,{'tableName':_0x0cb7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0cb7('0xb'),'collate':_0x0cb7('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 2666909..5e4d023 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 _0xf691=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','ChatApplication,\x20%s,\x20%s','message','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent'];(function(_0xcd9ece,_0x33ff67){var _0x36f54f=function(_0x54ec76){while(--_0x54ec76){_0xcd9ece['push'](_0xcd9ece['shift']());}};_0x36f54f(++_0x33ff67);}(_0xf691,0x147));var _0x1f69=function(_0x29799f,_0x57f5b2){_0x29799f=_0x29799f-0x0;var _0x3c98df=_0xf691[_0x29799f];return _0x3c98df;};'use strict';var _=require(_0x1f69('0x0'));var util=require(_0x1f69('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1f69('0x2'));var fs=require('fs');var Redis=require(_0x1f69('0x3'));var db=require(_0x1f69('0x4'))['db'];var utils=require(_0x1f69('0x5'));var logger=require('../../config/logger')(_0x1f69('0x6'));var config=require(_0x1f69('0x7'));var jayson=require(_0x1f69('0x8'));var client=jayson[_0x1f69('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x431ed9,_0x1b468a,_0x5775cb){return new BPromise(function(_0x555769,_0x33d1a3){return client[_0x1f69('0xa')](_0x431ed9,_0x5775cb)[_0x1f69('0xb')](function(_0x5158cb){logger['info']('ChatApplication,\x20%s,\x20%s',_0x1b468a,_0x1f69('0xc'));logger[_0x1f69('0xd')](_0x1f69('0xe'),_0x1b468a,_0x1f69('0xc'),JSON['stringify'](_0x5158cb));if(_0x5158cb[_0x1f69('0xf')]){if(_0x5158cb['error'][_0x1f69('0x10')]===0x1f4){logger[_0x1f69('0xf')](_0x1f69('0x11'),_0x1b468a,_0x5158cb[_0x1f69('0xf')]['message']);return _0x33d1a3(_0x5158cb[_0x1f69('0xf')]['message']);}logger[_0x1f69('0xf')](_0x1f69('0x11'),_0x1b468a,_0x5158cb['error'][_0x1f69('0x12')]);return _0x555769(_0x5158cb[_0x1f69('0xf')]['message']);}else{logger[_0x1f69('0x13')](_0x1f69('0x11'),_0x1b468a,_0x1f69('0xc'));_0x555769(_0x5158cb['result'][_0x1f69('0x12')]);}})['catch'](function(_0x485798){logger[_0x1f69('0xf')](_0x1f69('0x11'),_0x1b468a,_0x485798);_0x33d1a3(_0x485798);});});}
\ No newline at end of file
+var _0x7cb1=['ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cb1,0x141));var _0x17cb=function(_0x22c94b,_0x58862a){_0x22c94b=_0x22c94b-0x0;var _0x377849=_0x7cb1[_0x22c94b];return _0x377849;};'use strict';var _=require('lodash');var util=require(_0x17cb('0x0'));var moment=require(_0x17cb('0x1'));var BPromise=require(_0x17cb('0x2'));var rs=require(_0x17cb('0x3'));var fs=require('fs');var Redis=require(_0x17cb('0x4'));var db=require(_0x17cb('0x5'))['db'];var utils=require(_0x17cb('0x6'));var logger=require(_0x17cb('0x7'))(_0x17cb('0x8'));var config=require('../../config/environment');var jayson=require(_0x17cb('0x9'));var client=jayson[_0x17cb('0xa')][_0x17cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ef211,_0x36316a,_0x13172f){return new BPromise(function(_0x4280c2,_0xfc3c3e){return client[_0x17cb('0xc')](_0x5ef211,_0x13172f)[_0x17cb('0xd')](function(_0x2a80d9){logger[_0x17cb('0xe')](_0x17cb('0xf'),_0x36316a,'request\x20sent');logger[_0x17cb('0x10')](_0x17cb('0x11'),_0x36316a,_0x17cb('0x12'),JSON[_0x17cb('0x13')](_0x2a80d9));if(_0x2a80d9[_0x17cb('0x14')]){if(_0x2a80d9[_0x17cb('0x14')][_0x17cb('0x15')]===0x1f4){logger['error'](_0x17cb('0xf'),_0x36316a,_0x2a80d9[_0x17cb('0x14')][_0x17cb('0x16')]);return _0xfc3c3e(_0x2a80d9['error'][_0x17cb('0x16')]);}logger[_0x17cb('0x14')](_0x17cb('0xf'),_0x36316a,_0x2a80d9['error'][_0x17cb('0x16')]);return _0x4280c2(_0x2a80d9[_0x17cb('0x14')][_0x17cb('0x16')]);}else{logger[_0x17cb('0xe')](_0x17cb('0xf'),_0x36316a,_0x17cb('0x12'));_0x4280c2(_0x2a80d9[_0x17cb('0x17')][_0x17cb('0x16')]);}})['catch'](function(_0x2fa848){logger[_0x17cb('0x14')]('ChatApplication,\x20%s,\x20%s',_0x36316a,_0x2fa848);_0xfc3c3e(_0x2fa848);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index f982373..4865138 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 _0x5643=['/:id','isAuthenticated','show','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get'];(function(_0x33a8c0,_0x19c717){var _0x367ab5=function(_0x125eca){while(--_0x125eca){_0x33a8c0['push'](_0x33a8c0['shift']());}};_0x367ab5(++_0x19c717);}(_0x5643,0xb1));var _0x3564=function(_0x3c7233,_0x4bc39b){_0x3c7233=_0x3c7233-0x0;var _0x29283d=_0x5643[_0x3c7233];return _0x29283d;};'use strict';var multer=require(_0x3564('0x0'));var util=require('util');var path=require(_0x3564('0x1'));var timeout=require(_0x3564('0x2'));var express=require(_0x3564('0x3'));var router=express['Router']();var fs_extra=require(_0x3564('0x4'));var auth=require(_0x3564('0x5'));var interaction=require(_0x3564('0x6'));var config=require(_0x3564('0x7'));var controller=require(_0x3564('0x8'));router[_0x3564('0x9')](_0x3564('0xa'),auth[_0x3564('0xb')](),controller[_0x3564('0xc')]);router[_0x3564('0xd')](_0x3564('0xa'),auth[_0x3564('0xb')](),controller[_0x3564('0xe')]);router[_0x3564('0xf')]('/:id',auth[_0x3564('0xb')](),controller['destroy']);module[_0x3564('0x10')]=router;
\ No newline at end of file
+var _0xa4c2=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xa4c2,0xc5));var _0x2a4c=function(_0x28ce22,_0x3dc50b){_0x28ce22=_0x28ce22-0x0;var _0x46c0df=_0xa4c2[_0x28ce22];return _0x46c0df;};'use strict';var multer=require(_0x2a4c('0x0'));var util=require(_0x2a4c('0x1'));var path=require(_0x2a4c('0x2'));var timeout=require(_0x2a4c('0x3'));var express=require(_0x2a4c('0x4'));var router=express['Router']();var fs_extra=require(_0x2a4c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a4c('0x6'));var config=require(_0x2a4c('0x7'));var controller=require(_0x2a4c('0x8'));router[_0x2a4c('0x9')]('/:id',auth[_0x2a4c('0xa')](),controller['show']);router[_0x2a4c('0xb')](_0x2a4c('0xc'),auth[_0x2a4c('0xa')](),controller[_0x2a4c('0xd')]);router['delete'](_0x2a4c('0xc'),auth['isAuthenticated'](),controller[_0x2a4c('0xe')]);module[_0x2a4c('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 05b5d4d..b073c54 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 _0x237b=['sequelize','exports','STRING'];(function(_0x5dacf5,_0x5518c3){var _0x4205e3=function(_0x131c39){while(--_0x131c39){_0x5dacf5['push'](_0x5dacf5['shift']());}};_0x4205e3(++_0x5518c3);}(_0x237b,0x1a7));var _0xb237=function(_0x2a6980,_0x348831){_0x2a6980=_0x2a6980-0x0;var _0x368cf7=_0x237b[_0x2a6980];return _0x368cf7;};'use strict';var Sequelize=require(_0xb237('0x0'));module[_0xb237('0x1')]={'name':{'type':Sequelize[_0xb237('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb237('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x7510=['BOOLEAN','exports','STRING'];(function(_0x3eb789,_0x48354c){var _0x545ece=function(_0x3f1af0){while(--_0x3f1af0){_0x3eb789['push'](_0x3eb789['shift']());}};_0x545ece(++_0x48354c);}(_0x7510,0xa9));var _0x0751=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7510[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0751('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0751('0x1')]},'write':{'type':Sequelize[_0x0751('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 3d02f5d..bc9dbd2 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 _0xeab6=['count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','ChatGroup','rawAttributes','type','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','pick','filter','length','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','order','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x57706c,_0x609b07){var _0x1e221a=function(_0x239112){while(--_0x239112){_0x57706c['push'](_0x57706c['shift']());}};_0x1e221a(++_0x609b07);}(_0xeab6,0x16b));var _0x6eab=function(_0x29af75,_0x152b87){_0x29af75=_0x29af75-0x0;var _0x32b56b=_0xeab6[_0x29af75];return _0x32b56b;};'use strict';var emlformat=require(_0x6eab('0x0'));var rimraf=require(_0x6eab('0x1'));var zipdir=require(_0x6eab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6eab('0x3'));var moment=require(_0x6eab('0x4'));var BPromise=require(_0x6eab('0x5'));var Mustache=require(_0x6eab('0x6'));var util=require('util');var path=require(_0x6eab('0x7'));var sox=require(_0x6eab('0x8'));var csv=require(_0x6eab('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6eab('0xa'));var _=require(_0x6eab('0xb'));var squel=require(_0x6eab('0xc'));var crypto=require(_0x6eab('0xd'));var jsforce=require(_0x6eab('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6eab('0x9'));var querystring=require(_0x6eab('0xf'));var Papa=require(_0x6eab('0x10'));var Redis=require(_0x6eab('0x11'));var authService=require(_0x6eab('0x12'));var qs=require(_0x6eab('0x13'));var as=require(_0x6eab('0x14'));var hardwareService=require(_0x6eab('0x15'));var logger=require(_0x6eab('0x16'))(_0x6eab('0x17'));var utils=require(_0x6eab('0x18'));var config=require(_0x6eab('0x19'));var licenseUtil=require(_0x6eab('0x1a'));var db=require(_0x6eab('0x1b'))['db'];config['redis']=_[_0x6eab('0x1c')](config[_0x6eab('0x1d')],{'host':_0x6eab('0x1e'),'port':0x18eb});var socket=require(_0x6eab('0x1f'))(new Redis(config[_0x6eab('0x1d')]));require(_0x6eab('0x20'))[_0x6eab('0x21')](socket);function respondWithStatusCode(_0x3257aa,_0x1a1ef4){_0x1a1ef4=_0x1a1ef4||0xcc;return function(_0x1a1fae){if(_0x1a1fae){return _0x3257aa[_0x6eab('0x22')](_0x1a1ef4);}return _0x3257aa['status'](_0x1a1ef4)[_0x6eab('0x23')]();};}function respondWithResult(_0x19d6f8,_0x2257c4){_0x2257c4=_0x2257c4||0xc8;return function(_0x489958){if(_0x489958){return _0x19d6f8[_0x6eab('0x24')](_0x2257c4)[_0x6eab('0x25')](_0x489958);}};}function respondWithFilteredResult(_0x53d48b,_0x1fba25){return function(_0x4db94a){if(_0x4db94a){var _0x5cb305=typeof _0x1fba25[_0x6eab('0x26')]===_0x6eab('0x27')&&typeof _0x1fba25[_0x6eab('0x28')]===_0x6eab('0x27');var _0xccb114=_0x4db94a[_0x6eab('0x29')];var _0x3a6196=_0x5cb305?0x0:_0x1fba25[_0x6eab('0x26')];var _0x5aa5b8=_0x5cb305?_0x4db94a[_0x6eab('0x29')]:_0x1fba25[_0x6eab('0x26')]+_0x1fba25['limit'];var _0x20cfc0;if(_0x5aa5b8>=_0xccb114){_0x5aa5b8=_0xccb114;_0x20cfc0=0xc8;}else{_0x20cfc0=0xce;}_0x53d48b[_0x6eab('0x24')](_0x20cfc0);return _0x53d48b[_0x6eab('0x2a')](_0x6eab('0x2b'),_0x3a6196+'-'+_0x5aa5b8+'/'+_0xccb114)[_0x6eab('0x25')](_0x4db94a);}return null;};}function patchUpdates(_0x52bc35){return function(_0x469301){try{jsonpatch[_0x6eab('0x2c')](_0x469301,_0x52bc35,!![]);}catch(_0x2aa348){return BPromise[_0x6eab('0x2d')](_0x2aa348);}return _0x469301[_0x6eab('0x2e')]();};}function saveUpdates(_0x16d30d,_0x7e6a52){return function(_0x5bef32){if(_0x5bef32){return _0x5bef32[_0x6eab('0x2f')](_0x16d30d)['then'](function(_0xd98f5b){return _0xd98f5b;});}return null;};}function removeEntity(_0x5955ac,_0x1d4f5a){return function(_0x499e12){if(_0x499e12){return _0x499e12[_0x6eab('0x30')]()[_0x6eab('0x31')](function(){_0x5955ac[_0x6eab('0x24')](0xcc)[_0x6eab('0x23')]();});}};}function handleEntityNotFound(_0x3e505b,_0x30c5e0){return function(_0x3fc065){if(!_0x3fc065){_0x3e505b['sendStatus'](0x194);}return _0x3fc065;};}function handleError(_0x5573ba,_0x25a2b6){_0x25a2b6=_0x25a2b6||0x1f4;return function(_0x185e41){logger['error'](_0x185e41[_0x6eab('0x32')]);if(_0x185e41[_0x6eab('0x33')]){delete _0x185e41[_0x6eab('0x33')];}_0x5573ba[_0x6eab('0x24')](_0x25a2b6)[_0x6eab('0x34')](_0x185e41);};}exports[_0x6eab('0x35')]=function(_0x792a6b,_0x41a7a2){var _0x7afe1={},_0x17b42a={},_0x5cf053={'count':0x0,'rows':[]};var _0x41f7c4=_[_0x6eab('0x36')](db[_0x6eab('0x37')][_0x6eab('0x38')],function(_0x1965ff){return{'name':_0x1965ff['fieldName'],'type':_0x1965ff[_0x6eab('0x39')]['key']};});_0x17b42a['model']=_[_0x6eab('0x36')](_0x41f7c4,_0x6eab('0x33'));_0x17b42a[_0x6eab('0x3a')]=_['keys'](_0x792a6b['query']);_0x17b42a['filters']=_['intersection'](_0x17b42a[_0x6eab('0x3b')],_0x17b42a['query']);_0x7afe1[_0x6eab('0x3c')]=_[_0x6eab('0x3d')](_0x17b42a['model'],qs[_0x6eab('0x3e')](_0x792a6b[_0x6eab('0x3a')][_0x6eab('0x3e')]));_0x7afe1['attributes']=_0x7afe1['attributes']['length']?_0x7afe1[_0x6eab('0x3c')]:_0x17b42a[_0x6eab('0x3b')];if(!_0x792a6b[_0x6eab('0x3a')][_0x6eab('0x3f')](_0x6eab('0x40'))){_0x7afe1[_0x6eab('0x28')]=qs[_0x6eab('0x28')](_0x792a6b[_0x6eab('0x3a')][_0x6eab('0x28')]);_0x7afe1['offset']=qs[_0x6eab('0x26')](_0x792a6b['query']['offset']);}_0x7afe1['order']=qs[_0x6eab('0x41')](_0x792a6b[_0x6eab('0x3a')][_0x6eab('0x41')]);_0x7afe1[_0x6eab('0x42')]=qs[_0x6eab('0x43')](_['pick'](_0x792a6b[_0x6eab('0x3a')],_0x17b42a[_0x6eab('0x43')]),_0x41f7c4);if(_0x792a6b[_0x6eab('0x3a')]['filter']){_0x7afe1['where']=_['merge'](_0x7afe1['where'],{'$or':_[_0x6eab('0x36')](_0x41f7c4,function(_0x5995b5){if(_0x5995b5[_0x6eab('0x39')]!=='VIRTUAL'){var _0x427975={};_0x427975[_0x5995b5[_0x6eab('0x33')]]={'$like':'%'+_0x792a6b[_0x6eab('0x3a')]['filter']+'%'};return _0x427975;}})});}_0x7afe1=_[_0x6eab('0x44')]({},_0x7afe1,_0x792a6b[_0x6eab('0x45')]);var _0x484166={'where':_0x7afe1[_0x6eab('0x42')]};return db['ChatGroup'][_0x6eab('0x29')](_0x484166)[_0x6eab('0x31')](function(_0x5e4826){_0x5cf053[_0x6eab('0x29')]=_0x5e4826;if(_0x792a6b[_0x6eab('0x3a')][_0x6eab('0x46')]){_0x7afe1[_0x6eab('0x47')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x7afe1);})[_0x6eab('0x31')](function(_0x3f5555){_0x5cf053[_0x6eab('0x48')]=_0x3f5555;return _0x5cf053;})['then'](respondWithFilteredResult(_0x41a7a2,_0x7afe1))[_0x6eab('0x49')](handleError(_0x41a7a2,null));};exports[_0x6eab('0x4a')]=function(_0x2f8135,_0x5d244f){var _0x547851={'raw':!![],'where':{'id':_0x2f8135[_0x6eab('0x4b')]['id']}},_0x964a4b={};_0x964a4b[_0x6eab('0x3b')]=_[_0x6eab('0x4c')](db[_0x6eab('0x37')]['rawAttributes']);_0x964a4b[_0x6eab('0x3a')]=_['keys'](_0x2f8135['query']);_0x964a4b[_0x6eab('0x43')]=_[_0x6eab('0x3d')](_0x964a4b['model'],_0x964a4b[_0x6eab('0x3a')]);_0x547851[_0x6eab('0x3c')]=_[_0x6eab('0x3d')](_0x964a4b['model'],qs[_0x6eab('0x3e')](_0x2f8135[_0x6eab('0x3a')][_0x6eab('0x3e')]));_0x547851[_0x6eab('0x3c')]=_0x547851[_0x6eab('0x3c')]['length']?_0x547851[_0x6eab('0x3c')]:_0x964a4b['model'];if(_0x2f8135[_0x6eab('0x3a')][_0x6eab('0x46')]){_0x547851[_0x6eab('0x47')]=[{'all':!![]}];}_0x547851=_[_0x6eab('0x44')]({},_0x547851,_0x2f8135[_0x6eab('0x45')]);return db[_0x6eab('0x37')][_0x6eab('0x4d')](_0x547851)['then'](handleEntityNotFound(_0x5d244f,null))[_0x6eab('0x31')](respondWithResult(_0x5d244f,null))['catch'](handleError(_0x5d244f,null));};exports[_0x6eab('0x4e')]=function(_0x1326f0,_0x1257e1){return db[_0x6eab('0x37')]['create'](_0x1326f0[_0x6eab('0x4f')],{})[_0x6eab('0x31')](respondWithResult(_0x1257e1,0xc9))[_0x6eab('0x49')](handleError(_0x1257e1,null));};exports[_0x6eab('0x2f')]=function(_0x36b0ab,_0x29dc7a){if(_0x36b0ab[_0x6eab('0x4f')]['id']){delete _0x36b0ab['body']['id'];}return db[_0x6eab('0x37')][_0x6eab('0x4d')]({'where':{'id':_0x36b0ab[_0x6eab('0x4b')]['id']}})['then'](handleEntityNotFound(_0x29dc7a,null))[_0x6eab('0x31')](saveUpdates(_0x36b0ab[_0x6eab('0x4f')],null))[_0x6eab('0x31')](respondWithResult(_0x29dc7a,null))[_0x6eab('0x49')](handleError(_0x29dc7a,null));};exports[_0x6eab('0x30')]=function(_0x2a2ad9,_0x2fd9cc){return db[_0x6eab('0x37')]['find']({'where':{'id':_0x2a2ad9['params']['id']}})['then'](handleEntityNotFound(_0x2fd9cc,null))['then'](removeEntity(_0x2fd9cc,null))['catch'](handleError(_0x2fd9cc,null));};exports[_0x6eab('0x50')]=function(_0x1f2fba,_0x5842bd){return db[_0x6eab('0x37')][_0x6eab('0x50')]()[_0x6eab('0x31')](respondWithResult(_0x5842bd,null))[_0x6eab('0x49')](handleError(_0x5842bd,null));};exports[_0x6eab('0x51')]=function(_0x19c0fb,_0x5171d5,_0x3e1ab6){return db['ChatInternalMessage'][_0x6eab('0x29')]({'where':{'ChatGroupId':_0x19c0fb[_0x6eab('0x4b')]['id'],'ToId':_0x19c0fb[_0x6eab('0x52')]['id'],'read':![]}})[_0x6eab('0x31')](function(_0x3e69d7){return{'id':_[_0x6eab('0x53')](_0x19c0fb[_0x6eab('0x4b')]['id']),'count':_0x3e69d7};})[_0x6eab('0x31')](respondWithResult(_0x5171d5,null))['catch'](handleError(_0x5171d5,null));};exports[_0x6eab('0x54')]=function(_0x322e33,_0x2b879d,_0x2c02a1){return db[_0x6eab('0x37')]['find']({'where':{'id':_0x322e33['params']['id']}})[_0x6eab('0x31')](handleEntityNotFound(_0x2b879d,null))[_0x6eab('0x31')](function(_0x271a45){if(_0x271a45){return _0x271a45[_0x6eab('0x54')](_0x322e33[_0x6eab('0x4f')][_0x6eab('0x55')],_[_0x6eab('0x56')](_0x322e33[_0x6eab('0x4f')],[_0x6eab('0x55'),'id'])||{});}})[_0x6eab('0x31')](respondWithResult(_0x2b879d,null))[_0x6eab('0x49')](handleError(_0x2b879d,null));};exports[_0x6eab('0x57')]=function(_0x5a49ef,_0xa95171,_0x31068f){var _0x5bb3a9={};var _0x38204d={};var _0x4ed0a5;var _0x1ed574;return db[_0x6eab('0x37')]['findOne']({'where':{'id':_0x5a49ef['params']['id']}})[_0x6eab('0x31')](handleEntityNotFound(_0xa95171,null))[_0x6eab('0x31')](function(_0x2ee999){if(_0x2ee999){_0x4ed0a5=_0x2ee999;_0x38204d['model']=_['keys'](db['User'][_0x6eab('0x38')]);_0x38204d[_0x6eab('0x3a')]=_['keys'](_0x5a49ef[_0x6eab('0x3a')]);_0x38204d[_0x6eab('0x43')]=_[_0x6eab('0x3d')](_0x38204d[_0x6eab('0x3b')],_0x38204d[_0x6eab('0x3a')]);_0x5bb3a9[_0x6eab('0x3c')]=_[_0x6eab('0x3d')](_0x38204d[_0x6eab('0x3b')],qs['fields'](_0x5a49ef[_0x6eab('0x3a')][_0x6eab('0x3e')]));_0x5bb3a9[_0x6eab('0x3c')]=_0x5bb3a9[_0x6eab('0x3c')]['length']?_0x5bb3a9[_0x6eab('0x3c')]:_0x38204d['model'];_0x5bb3a9['order']=qs[_0x6eab('0x41')](_0x5a49ef[_0x6eab('0x3a')][_0x6eab('0x41')]);_0x5bb3a9['where']=qs[_0x6eab('0x43')](_[_0x6eab('0x58')](_0x5a49ef[_0x6eab('0x3a')],_0x38204d[_0x6eab('0x43')]));if(_0x5a49ef[_0x6eab('0x3a')]['filter']){_0x5bb3a9[_0x6eab('0x42')]=_[_0x6eab('0x44')](_0x5bb3a9[_0x6eab('0x42')],{'$or':_[_0x6eab('0x36')](_0x5bb3a9[_0x6eab('0x3c')],function(_0x5a7871){var _0x12affb={};_0x12affb[_0x5a7871]={'$like':'%'+_0x5a49ef[_0x6eab('0x3a')][_0x6eab('0x59')]+'%'};return _0x12affb;})});}_0x5bb3a9=_['merge']({},_0x5bb3a9,_0x5a49ef[_0x6eab('0x45')]);return _0x4ed0a5[_0x6eab('0x57')](_0x5bb3a9);}})[_0x6eab('0x31')](function(_0x5772e9){if(_0x5772e9){_0x1ed574=_0x5772e9[_0x6eab('0x5a')];if(!_0x5a49ef[_0x6eab('0x3a')][_0x6eab('0x3f')]('nolimit')){_0x5bb3a9['limit']=qs[_0x6eab('0x28')](_0x5a49ef[_0x6eab('0x3a')][_0x6eab('0x28')]);_0x5bb3a9['offset']=qs['offset'](_0x5a49ef[_0x6eab('0x3a')][_0x6eab('0x26')]);}return _0x4ed0a5['getMembers'](_0x5bb3a9);}})[_0x6eab('0x31')](function(_0x1bcff1){if(_0x1bcff1){return _0x1bcff1?{'count':_0x1ed574,'rows':_0x1bcff1}:null;}})['then'](respondWithResult(_0xa95171,null))[_0x6eab('0x49')](handleError(_0xa95171,null));};exports[_0x6eab('0x5b')]=function(_0x166c3d,_0x5a9dd9,_0x2fb2ea){return db[_0x6eab('0x37')][_0x6eab('0x4d')]({'where':{'id':_0x166c3d[_0x6eab('0x4b')]['id']}})[_0x6eab('0x31')](handleEntityNotFound(_0x5a9dd9,null))[_0x6eab('0x31')](function(_0x433da9){if(_0x433da9){return _0x433da9[_0x6eab('0x5b')](_0x166c3d[_0x6eab('0x3a')][_0x6eab('0x55')]);}})[_0x6eab('0x31')](respondWithStatusCode(_0x5a9dd9,null))[_0x6eab('0x49')](handleError(_0x5a9dd9,null));};exports[_0x6eab('0x5c')]=function(_0x3caedd,_0x1da1a0,_0x4f871e){if(_0x3caedd[_0x6eab('0x4f')]['id']){delete _0x3caedd[_0x6eab('0x4f')]['id'];}return db[_0x6eab('0x37')][_0x6eab('0x4d')]({'where':{'id':_0x3caedd[_0x6eab('0x4b')]['id']}})[_0x6eab('0x31')](handleEntityNotFound(_0x1da1a0,null))[_0x6eab('0x31')](function(_0x5c9df8){if(_0x5c9df8){_0x3caedd[_0x6eab('0x4f')][_0x6eab('0x5d')]=_0x5c9df8['id'];return db[_0x6eab('0x5e')][_0x6eab('0x4e')](_0x3caedd['body']);}})[_0x6eab('0x31')](respondWithResult(_0x1da1a0,null))['catch'](handleError(_0x1da1a0,null));};exports[_0x6eab('0x5f')]=function(_0x4bd0c4,_0x167ee5,_0x4abb36){var _0x364e94={};var _0x31df06={};var _0x4d2280;var _0x426bec;return db[_0x6eab('0x37')][_0x6eab('0x60')]({'where':{'id':_0x4bd0c4[_0x6eab('0x4b')]['id']}})[_0x6eab('0x31')](handleEntityNotFound(_0x167ee5,null))['then'](function(_0x117526){if(_0x117526){_0x4d2280=_0x117526;_0x31df06[_0x6eab('0x3b')]=_[_0x6eab('0x4c')](db[_0x6eab('0x5e')][_0x6eab('0x38')]);_0x31df06['query']=_[_0x6eab('0x4c')](_0x4bd0c4['query']);_0x31df06[_0x6eab('0x43')]=_[_0x6eab('0x3d')](_0x31df06[_0x6eab('0x3b')],_0x31df06[_0x6eab('0x3a')]);_0x364e94[_0x6eab('0x3c')]=_[_0x6eab('0x3d')](_0x31df06['model'],qs[_0x6eab('0x3e')](_0x4bd0c4[_0x6eab('0x3a')][_0x6eab('0x3e')]));_0x364e94[_0x6eab('0x3c')]=_0x364e94['attributes'][_0x6eab('0x5a')]?_0x364e94['attributes']:_0x31df06[_0x6eab('0x3b')];_0x364e94[_0x6eab('0x61')]=qs['sort'](_0x4bd0c4[_0x6eab('0x3a')][_0x6eab('0x41')]);_0x364e94[_0x6eab('0x42')]=qs[_0x6eab('0x43')](_[_0x6eab('0x58')](_0x4bd0c4['query'],_0x31df06[_0x6eab('0x43')]));if(_0x4bd0c4[_0x6eab('0x3a')][_0x6eab('0x59')]){_0x364e94[_0x6eab('0x42')]=_[_0x6eab('0x44')](_0x364e94[_0x6eab('0x42')],{'$or':_[_0x6eab('0x36')](_0x364e94[_0x6eab('0x3c')],function(_0x4b05a6){var _0x2d0912={};_0x2d0912[_0x4b05a6]={'$like':'%'+_0x4bd0c4['query']['filter']+'%'};return _0x2d0912;})});}if(_0x4bd0c4['query'][_0x6eab('0x62')]){var _0x2119f2=_0x4bd0c4['query']['$gte'][_0x6eab('0x63')](',');var _0x4a21fe={};_0x4a21fe[_0x2119f2[0x0]]={'$gte':moment(_0x2119f2[0x1])['format'](_0x6eab('0x64'))};_0x364e94[_0x6eab('0x42')]=_[_0x6eab('0x44')](_0x364e94[_0x6eab('0x42')],_0x4a21fe);}_0x364e94=_[_0x6eab('0x44')]({},_0x364e94,_0x4bd0c4[_0x6eab('0x45')]);return _0x4d2280[_0x6eab('0x5f')](_0x364e94);}})['then'](function(_0x97bd81){if(_0x97bd81){_0x426bec=_0x97bd81['length'];if(!_0x4bd0c4[_0x6eab('0x3a')][_0x6eab('0x3f')]('nolimit')){_0x364e94[_0x6eab('0x28')]=qs['limit'](_0x4bd0c4[_0x6eab('0x3a')][_0x6eab('0x28')]);_0x364e94[_0x6eab('0x26')]=qs['offset'](_0x4bd0c4[_0x6eab('0x3a')]['offset']);}return _0x4d2280[_0x6eab('0x5f')](_0x364e94);}})[_0x6eab('0x31')](function(_0x3c47b4){if(_0x3c47b4){return _0x3c47b4?{'count':_0x426bec,'rows':_0x3c47b4}:null;}})['then'](respondWithResult(_0x167ee5,null))['catch'](handleError(_0x167ee5,null));};
\ No newline at end of file
+var _0x91cd=['addMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','type','query','keys','model','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','show','params','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','hasOwnProperty','removeMembers'];(function(_0x4b7e53,_0x2d02b1){var _0x5a7bd1=function(_0x42f4f6){while(--_0x42f4f6){_0x4b7e53['push'](_0x4b7e53['shift']());}};_0x5a7bd1(++_0x2d02b1);}(_0x91cd,0x176));var _0xd91c=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x91cd[_0x3a0c4f];return _0x247049;};'use strict';var emlformat=require(_0xd91c('0x0'));var rimraf=require(_0xd91c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd91c('0x2'));var rp=require(_0xd91c('0x3'));var moment=require('moment');var BPromise=require(_0xd91c('0x4'));var Mustache=require(_0xd91c('0x5'));var util=require('util');var path=require(_0xd91c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd91c('0x7'));var _=require('lodash');var squel=require(_0xd91c('0x8'));var crypto=require(_0xd91c('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd91c('0xa'));var toCsv=require(_0xd91c('0xb'));var querystring=require('querystring');var Papa=require(_0xd91c('0xc'));var Redis=require(_0xd91c('0xd'));var authService=require(_0xd91c('0xe'));var qs=require(_0xd91c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd91c('0x10'));var logger=require(_0xd91c('0x11'))(_0xd91c('0x12'));var utils=require(_0xd91c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd91c('0x14'));var db=require(_0xd91c('0x15'))['db'];config['redis']=_[_0xd91c('0x16')](config[_0xd91c('0x17')],{'host':_0xd91c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xd91c('0x19')](socket);function respondWithStatusCode(_0x1a1821,_0x45d524){_0x45d524=_0x45d524||0xcc;return function(_0x139a59){if(_0x139a59){return _0x1a1821[_0xd91c('0x1a')](_0x45d524);}return _0x1a1821['status'](_0x45d524)[_0xd91c('0x1b')]();};}function respondWithResult(_0x3b49af,_0x31eb7a){_0x31eb7a=_0x31eb7a||0xc8;return function(_0x481e27){if(_0x481e27){return _0x3b49af[_0xd91c('0x1c')](_0x31eb7a)[_0xd91c('0x1d')](_0x481e27);}};}function respondWithFilteredResult(_0x3ec5a7,_0x248511){return function(_0x1ac413){if(_0x1ac413){var _0x2b7928=typeof _0x248511[_0xd91c('0x1e')]===_0xd91c('0x1f')&&typeof _0x248511[_0xd91c('0x20')]===_0xd91c('0x1f');var _0x19bb4d=_0x1ac413[_0xd91c('0x21')];var _0x49b907=_0x2b7928?0x0:_0x248511[_0xd91c('0x1e')];var _0xbb3b6e=_0x2b7928?_0x1ac413[_0xd91c('0x21')]:_0x248511[_0xd91c('0x1e')]+_0x248511[_0xd91c('0x20')];var _0x380f1d;if(_0xbb3b6e>=_0x19bb4d){_0xbb3b6e=_0x19bb4d;_0x380f1d=0xc8;}else{_0x380f1d=0xce;}_0x3ec5a7[_0xd91c('0x1c')](_0x380f1d);return _0x3ec5a7[_0xd91c('0x22')](_0xd91c('0x23'),_0x49b907+'-'+_0xbb3b6e+'/'+_0x19bb4d)['json'](_0x1ac413);}return null;};}function patchUpdates(_0x3543df){return function(_0x3677d4){try{jsonpatch[_0xd91c('0x24')](_0x3677d4,_0x3543df,!![]);}catch(_0x1c9dd1){return BPromise[_0xd91c('0x25')](_0x1c9dd1);}return _0x3677d4[_0xd91c('0x26')]();};}function saveUpdates(_0x48c3f9,_0x3f8b4f){return function(_0x34efcc){if(_0x34efcc){return _0x34efcc[_0xd91c('0x27')](_0x48c3f9)[_0xd91c('0x28')](function(_0x583be8){return _0x583be8;});}return null;};}function removeEntity(_0x30ba14,_0xa6316d){return function(_0x39c661){if(_0x39c661){return _0x39c661[_0xd91c('0x29')]()[_0xd91c('0x28')](function(){_0x30ba14['status'](0xcc)[_0xd91c('0x1b')]();});}};}function handleEntityNotFound(_0x5e1adc,_0x3281af){return function(_0x45aa57){if(!_0x45aa57){_0x5e1adc['sendStatus'](0x194);}return _0x45aa57;};}function handleError(_0x2b8770,_0x3dbd6b){_0x3dbd6b=_0x3dbd6b||0x1f4;return function(_0x155e18){logger[_0xd91c('0x2a')](_0x155e18[_0xd91c('0x2b')]);if(_0x155e18[_0xd91c('0x2c')]){delete _0x155e18[_0xd91c('0x2c')];}_0x2b8770[_0xd91c('0x1c')](_0x3dbd6b)['send'](_0x155e18);};}exports[_0xd91c('0x2d')]=function(_0x8f06e3,_0x45de9f){var _0x436e46={},_0x14d262={},_0x592642={'count':0x0,'rows':[]};var _0x3a1760=_[_0xd91c('0x2e')](db[_0xd91c('0x2f')][_0xd91c('0x30')],function(_0x3e7f33){return{'name':_0x3e7f33['fieldName'],'type':_0x3e7f33[_0xd91c('0x31')]['key']};});_0x14d262['model']=_[_0xd91c('0x2e')](_0x3a1760,'name');_0x14d262[_0xd91c('0x32')]=_[_0xd91c('0x33')](_0x8f06e3[_0xd91c('0x32')]);_0x14d262['filters']=_['intersection'](_0x14d262[_0xd91c('0x34')],_0x14d262['query']);_0x436e46[_0xd91c('0x35')]=_[_0xd91c('0x36')](_0x14d262[_0xd91c('0x34')],qs[_0xd91c('0x37')](_0x8f06e3[_0xd91c('0x32')]['fields']));_0x436e46[_0xd91c('0x35')]=_0x436e46[_0xd91c('0x35')][_0xd91c('0x38')]?_0x436e46[_0xd91c('0x35')]:_0x14d262['model'];if(!_0x8f06e3['query']['hasOwnProperty']('nolimit')){_0x436e46[_0xd91c('0x20')]=qs[_0xd91c('0x20')](_0x8f06e3[_0xd91c('0x32')][_0xd91c('0x20')]);_0x436e46['offset']=qs[_0xd91c('0x1e')](_0x8f06e3[_0xd91c('0x32')][_0xd91c('0x1e')]);}_0x436e46[_0xd91c('0x39')]=qs[_0xd91c('0x3a')](_0x8f06e3[_0xd91c('0x32')]['sort']);_0x436e46[_0xd91c('0x3b')]=qs[_0xd91c('0x3c')](_[_0xd91c('0x3d')](_0x8f06e3['query'],_0x14d262[_0xd91c('0x3c')]),_0x3a1760);if(_0x8f06e3[_0xd91c('0x32')][_0xd91c('0x3e')]){_0x436e46[_0xd91c('0x3b')]=_[_0xd91c('0x3f')](_0x436e46[_0xd91c('0x3b')],{'$or':_['map'](_0x3a1760,function(_0x4a86d5){if(_0x4a86d5['type']!=='VIRTUAL'){var _0x2b037d={};_0x2b037d[_0x4a86d5['name']]={'$like':'%'+_0x8f06e3['query']['filter']+'%'};return _0x2b037d;}})});}_0x436e46=_[_0xd91c('0x3f')]({},_0x436e46,_0x8f06e3[_0xd91c('0x40')]);var _0x2dac74={'where':_0x436e46['where']};return db[_0xd91c('0x2f')][_0xd91c('0x21')](_0x2dac74)[_0xd91c('0x28')](function(_0x38ce51){_0x592642[_0xd91c('0x21')]=_0x38ce51;if(_0x8f06e3[_0xd91c('0x32')][_0xd91c('0x41')]){_0x436e46[_0xd91c('0x42')]=[{'all':!![]}];}return db[_0xd91c('0x2f')]['findAll'](_0x436e46);})['then'](function(_0x1408c4){_0x592642[_0xd91c('0x43')]=_0x1408c4;return _0x592642;})[_0xd91c('0x28')](respondWithFilteredResult(_0x45de9f,_0x436e46))['catch'](handleError(_0x45de9f,null));};exports[_0xd91c('0x44')]=function(_0x2373e4,_0xfc2f9f){var _0x1584d9={'raw':!![],'where':{'id':_0x2373e4[_0xd91c('0x45')]['id']}},_0x47cdf9={};_0x47cdf9[_0xd91c('0x34')]=_[_0xd91c('0x33')](db[_0xd91c('0x2f')][_0xd91c('0x30')]);_0x47cdf9[_0xd91c('0x32')]=_[_0xd91c('0x33')](_0x2373e4[_0xd91c('0x32')]);_0x47cdf9[_0xd91c('0x3c')]=_[_0xd91c('0x36')](_0x47cdf9[_0xd91c('0x34')],_0x47cdf9['query']);_0x1584d9[_0xd91c('0x35')]=_[_0xd91c('0x36')](_0x47cdf9[_0xd91c('0x34')],qs[_0xd91c('0x37')](_0x2373e4[_0xd91c('0x32')][_0xd91c('0x37')]));_0x1584d9[_0xd91c('0x35')]=_0x1584d9[_0xd91c('0x35')][_0xd91c('0x38')]?_0x1584d9[_0xd91c('0x35')]:_0x47cdf9[_0xd91c('0x34')];if(_0x2373e4[_0xd91c('0x32')]['includeAll']){_0x1584d9['include']=[{'all':!![]}];}_0x1584d9=_[_0xd91c('0x3f')]({},_0x1584d9,_0x2373e4['options']);return db['ChatGroup'][_0xd91c('0x46')](_0x1584d9)[_0xd91c('0x28')](handleEntityNotFound(_0xfc2f9f,null))[_0xd91c('0x28')](respondWithResult(_0xfc2f9f,null))[_0xd91c('0x47')](handleError(_0xfc2f9f,null));};exports[_0xd91c('0x48')]=function(_0x336c73,_0x207690){return db[_0xd91c('0x2f')][_0xd91c('0x48')](_0x336c73[_0xd91c('0x49')],{})['then'](respondWithResult(_0x207690,0xc9))[_0xd91c('0x47')](handleError(_0x207690,null));};exports[_0xd91c('0x27')]=function(_0x636151,_0x32d8bf){if(_0x636151[_0xd91c('0x49')]['id']){delete _0x636151[_0xd91c('0x49')]['id'];}return db[_0xd91c('0x2f')][_0xd91c('0x46')]({'where':{'id':_0x636151['params']['id']}})[_0xd91c('0x28')](handleEntityNotFound(_0x32d8bf,null))[_0xd91c('0x28')](saveUpdates(_0x636151[_0xd91c('0x49')],null))[_0xd91c('0x28')](respondWithResult(_0x32d8bf,null))[_0xd91c('0x47')](handleError(_0x32d8bf,null));};exports[_0xd91c('0x29')]=function(_0x3fac39,_0x1957d7){return db['ChatGroup'][_0xd91c('0x46')]({'where':{'id':_0x3fac39[_0xd91c('0x45')]['id']}})['then'](handleEntityNotFound(_0x1957d7,null))['then'](removeEntity(_0x1957d7,null))[_0xd91c('0x47')](handleError(_0x1957d7,null));};exports[_0xd91c('0x4a')]=function(_0x234266,_0xa1d8c2){return db[_0xd91c('0x2f')][_0xd91c('0x4a')]()['then'](respondWithResult(_0xa1d8c2,null))[_0xd91c('0x47')](handleError(_0xa1d8c2,null));};exports[_0xd91c('0x4b')]=function(_0xd4a8d5,_0x4d0c9a,_0x1eb59b){return db[_0xd91c('0x4c')][_0xd91c('0x21')]({'where':{'ChatGroupId':_0xd4a8d5['params']['id'],'ToId':_0xd4a8d5[_0xd91c('0x4d')]['id'],'read':![]}})[_0xd91c('0x28')](function(_0x75a0eb){return{'id':_[_0xd91c('0x4e')](_0xd4a8d5['params']['id']),'count':_0x75a0eb};})['then'](respondWithResult(_0x4d0c9a,null))['catch'](handleError(_0x4d0c9a,null));};exports[_0xd91c('0x4f')]=function(_0x5832cf,_0x2e2ef9,_0x30568f){return db['ChatGroup']['find']({'where':{'id':_0x5832cf[_0xd91c('0x45')]['id']}})['then'](handleEntityNotFound(_0x2e2ef9,null))[_0xd91c('0x28')](function(_0x537580){if(_0x537580){return _0x537580[_0xd91c('0x4f')](_0x5832cf[_0xd91c('0x49')]['ids'],_[_0xd91c('0x50')](_0x5832cf['body'],[_0xd91c('0x51'),'id'])||{});}})[_0xd91c('0x28')](respondWithResult(_0x2e2ef9,null))['catch'](handleError(_0x2e2ef9,null));};exports[_0xd91c('0x52')]=function(_0x479924,_0x4cf8fd,_0x382161){var _0x900bcc={};var _0xe738e9={};var _0x135c47;var _0x1424b6;return db[_0xd91c('0x2f')][_0xd91c('0x53')]({'where':{'id':_0x479924[_0xd91c('0x45')]['id']}})[_0xd91c('0x28')](handleEntityNotFound(_0x4cf8fd,null))['then'](function(_0x290296){if(_0x290296){_0x135c47=_0x290296;_0xe738e9[_0xd91c('0x34')]=_['keys'](db['User'][_0xd91c('0x30')]);_0xe738e9[_0xd91c('0x32')]=_['keys'](_0x479924[_0xd91c('0x32')]);_0xe738e9['filters']=_[_0xd91c('0x36')](_0xe738e9['model'],_0xe738e9[_0xd91c('0x32')]);_0x900bcc[_0xd91c('0x35')]=_['intersection'](_0xe738e9[_0xd91c('0x34')],qs[_0xd91c('0x37')](_0x479924['query']['fields']));_0x900bcc[_0xd91c('0x35')]=_0x900bcc['attributes'][_0xd91c('0x38')]?_0x900bcc[_0xd91c('0x35')]:_0xe738e9[_0xd91c('0x34')];_0x900bcc[_0xd91c('0x39')]=qs[_0xd91c('0x3a')](_0x479924[_0xd91c('0x32')][_0xd91c('0x3a')]);_0x900bcc['where']=qs['filters'](_[_0xd91c('0x3d')](_0x479924[_0xd91c('0x32')],_0xe738e9[_0xd91c('0x3c')]));if(_0x479924[_0xd91c('0x32')][_0xd91c('0x3e')]){_0x900bcc['where']=_[_0xd91c('0x3f')](_0x900bcc[_0xd91c('0x3b')],{'$or':_[_0xd91c('0x2e')](_0x900bcc[_0xd91c('0x35')],function(_0x225f3e){var _0x11e8e7={};_0x11e8e7[_0x225f3e]={'$like':'%'+_0x479924[_0xd91c('0x32')][_0xd91c('0x3e')]+'%'};return _0x11e8e7;})});}_0x900bcc=_[_0xd91c('0x3f')]({},_0x900bcc,_0x479924['options']);return _0x135c47[_0xd91c('0x52')](_0x900bcc);}})[_0xd91c('0x28')](function(_0x58330d){if(_0x58330d){_0x1424b6=_0x58330d[_0xd91c('0x38')];if(!_0x479924[_0xd91c('0x32')][_0xd91c('0x54')]('nolimit')){_0x900bcc[_0xd91c('0x20')]=qs[_0xd91c('0x20')](_0x479924[_0xd91c('0x32')][_0xd91c('0x20')]);_0x900bcc[_0xd91c('0x1e')]=qs[_0xd91c('0x1e')](_0x479924['query'][_0xd91c('0x1e')]);}return _0x135c47['getMembers'](_0x900bcc);}})[_0xd91c('0x28')](function(_0x3b5e34){if(_0x3b5e34){return _0x3b5e34?{'count':_0x1424b6,'rows':_0x3b5e34}:null;}})['then'](respondWithResult(_0x4cf8fd,null))['catch'](handleError(_0x4cf8fd,null));};exports['removeMembers']=function(_0x27d48c,_0x533e70,_0x2ce9e5){return db[_0xd91c('0x2f')]['find']({'where':{'id':_0x27d48c[_0xd91c('0x45')]['id']}})[_0xd91c('0x28')](handleEntityNotFound(_0x533e70,null))[_0xd91c('0x28')](function(_0x710e2a){if(_0x710e2a){return _0x710e2a[_0xd91c('0x55')](_0x27d48c['query'][_0xd91c('0x51')]);}})[_0xd91c('0x28')](respondWithStatusCode(_0x533e70,null))['catch'](handleError(_0x533e70,null));};exports[_0xd91c('0x56')]=function(_0x551440,_0x3596fc,_0x57a87b){if(_0x551440[_0xd91c('0x49')]['id']){delete _0x551440[_0xd91c('0x49')]['id'];}return db[_0xd91c('0x2f')]['find']({'where':{'id':_0x551440[_0xd91c('0x45')]['id']}})[_0xd91c('0x28')](handleEntityNotFound(_0x3596fc,null))[_0xd91c('0x28')](function(_0x3d9afe){if(_0x3d9afe){_0x551440[_0xd91c('0x49')]['ChatGroupId']=_0x3d9afe['id'];return db[_0xd91c('0x4c')][_0xd91c('0x48')](_0x551440[_0xd91c('0x49')]);}})[_0xd91c('0x28')](respondWithResult(_0x3596fc,null))['catch'](handleError(_0x3596fc,null));};exports[_0xd91c('0x57')]=function(_0x14a291,_0x2591b0,_0x11c6a8){var _0x2fa4cb={};var _0x4c789c={};var _0x3b36ac;var _0x4a9275;return db[_0xd91c('0x2f')][_0xd91c('0x53')]({'where':{'id':_0x14a291[_0xd91c('0x45')]['id']}})[_0xd91c('0x28')](handleEntityNotFound(_0x2591b0,null))[_0xd91c('0x28')](function(_0x295208){if(_0x295208){_0x3b36ac=_0x295208;_0x4c789c['model']=_[_0xd91c('0x33')](db[_0xd91c('0x4c')][_0xd91c('0x30')]);_0x4c789c[_0xd91c('0x32')]=_[_0xd91c('0x33')](_0x14a291[_0xd91c('0x32')]);_0x4c789c[_0xd91c('0x3c')]=_[_0xd91c('0x36')](_0x4c789c['model'],_0x4c789c[_0xd91c('0x32')]);_0x2fa4cb[_0xd91c('0x35')]=_['intersection'](_0x4c789c[_0xd91c('0x34')],qs[_0xd91c('0x37')](_0x14a291[_0xd91c('0x32')]['fields']));_0x2fa4cb[_0xd91c('0x35')]=_0x2fa4cb['attributes']['length']?_0x2fa4cb[_0xd91c('0x35')]:_0x4c789c['model'];_0x2fa4cb[_0xd91c('0x39')]=qs['sort'](_0x14a291['query']['sort']);_0x2fa4cb[_0xd91c('0x3b')]=qs[_0xd91c('0x3c')](_[_0xd91c('0x3d')](_0x14a291[_0xd91c('0x32')],_0x4c789c['filters']));if(_0x14a291['query'][_0xd91c('0x3e')]){_0x2fa4cb[_0xd91c('0x3b')]=_['merge'](_0x2fa4cb['where'],{'$or':_[_0xd91c('0x2e')](_0x2fa4cb[_0xd91c('0x35')],function(_0x3c80a1){var _0x2425c3={};_0x2425c3[_0x3c80a1]={'$like':'%'+_0x14a291[_0xd91c('0x32')]['filter']+'%'};return _0x2425c3;})});}if(_0x14a291[_0xd91c('0x32')][_0xd91c('0x58')]){var _0x15ba76=_0x14a291['query'][_0xd91c('0x58')]['split'](',');var _0x5bf6f1={};_0x5bf6f1[_0x15ba76[0x0]]={'$gte':moment(_0x15ba76[0x1])[_0xd91c('0x59')](_0xd91c('0x5a'))};_0x2fa4cb[_0xd91c('0x3b')]=_['merge'](_0x2fa4cb[_0xd91c('0x3b')],_0x5bf6f1);}_0x2fa4cb=_[_0xd91c('0x3f')]({},_0x2fa4cb,_0x14a291['options']);return _0x3b36ac['getMessages'](_0x2fa4cb);}})[_0xd91c('0x28')](function(_0xcbc636){if(_0xcbc636){_0x4a9275=_0xcbc636[_0xd91c('0x38')];if(!_0x14a291[_0xd91c('0x32')]['hasOwnProperty'](_0xd91c('0x5b'))){_0x2fa4cb[_0xd91c('0x20')]=qs[_0xd91c('0x20')](_0x14a291[_0xd91c('0x32')][_0xd91c('0x20')]);_0x2fa4cb[_0xd91c('0x1e')]=qs[_0xd91c('0x1e')](_0x14a291[_0xd91c('0x32')]['offset']);}return _0x3b36ac[_0xd91c('0x57')](_0x2fa4cb);}})[_0xd91c('0x28')](function(_0x2de048){if(_0x2de048){return _0x2de048?{'count':_0x4a9275,'rows':_0x2de048}:null;}})['then'](respondWithResult(_0x2591b0,null))[_0xd91c('0x47')](handleError(_0x2591b0,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 79f554b..71bda71 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 _0x85ed=['exports','events','save','update','remove','hook'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x85ed,0x1e7));var _0xd85e=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x85ed[_0x45b034];return _0x509cb0;};'use strict';var EventEmitter=require(_0xd85e('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd85e('0x1'),'afterUpdate':_0xd85e('0x2'),'afterDestroy':_0xd85e('0x3')};function emitEvent(_0xeb1bf9){return function(_0x2ddd68,_0x5178b6,_0x3d70d5){ChatGroupEvents['emit'](_0xeb1bf9+':'+_0x2ddd68['id'],_0x2ddd68);ChatGroupEvents['emit'](_0xeb1bf9,_0x2ddd68);_0x3d70d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xd85e('0x4')](e,emitEvent(event));}}module[_0xd85e('0x5')]=ChatGroupEvents;
\ No newline at end of file
+var _0x228d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update','remove'];(function(_0x546ce7,_0x135234){var _0x1e1530=function(_0x4459f6){while(--_0x4459f6){_0x546ce7['push'](_0x546ce7['shift']());}};_0x1e1530(++_0x135234);}(_0x228d,0xfe));var _0xd228=function(_0xea46d,_0x254082){_0xea46d=_0xea46d-0x0;var _0x1fa4c5=_0x228d[_0xea46d];return _0x1fa4c5;};'use strict';var EventEmitter=require(_0xd228('0x0'));var ChatGroup=require(_0xd228('0x1'))['db'][_0xd228('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xd228('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd228('0x4'),'afterDestroy':_0xd228('0x5')};function emitEvent(_0xa06a3f){return function(_0x560ad1,_0x42172b,_0x2c9e33){ChatGroupEvents[_0xd228('0x6')](_0xa06a3f+':'+_0x560ad1['id'],_0x560ad1);ChatGroupEvents[_0xd228('0x6')](_0xa06a3f,_0x560ad1);_0x2c9e33(null);};}for(var e in events){if(events[_0xd228('0x7')](e)){var event=events[e];ChatGroup[_0xd228('0x8')](e,emitEvent(event));}}module[_0xd228('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 09d96c8..4014e7e 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 _0x21e2=['ChatGroup','chat_groups','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x21e2,0x77));var _0x221e=function(_0x49a1e5,_0xe640ba){_0x49a1e5=_0x49a1e5-0x0;var _0x184230=_0x21e2[_0x49a1e5];return _0x184230;};'use strict';var _=require(_0x221e('0x0'));var util=require(_0x221e('0x1'));var logger=require(_0x221e('0x2'))('api');var moment=require(_0x221e('0x3'));var BPromise=require(_0x221e('0x4'));var rp=require(_0x221e('0x5'));var fs=require('fs');var path=require(_0x221e('0x6'));var rimraf=require(_0x221e('0x7'));var config=require(_0x221e('0x8'));var attributes=require(_0x221e('0x9'));module[_0x221e('0xa')]=function(_0x1de45f,_0x54d35c){return _0x1de45f['define'](_0x221e('0xb'),attributes,{'tableName':_0x221e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8bfa=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','api'];(function(_0x4b009d,_0x2817e3){var _0x77ff93=function(_0x5228af){while(--_0x5228af){_0x4b009d['push'](_0x4b009d['shift']());}};_0x77ff93(++_0x2817e3);}(_0x8bfa,0xfa));var _0xa8bf=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0x8bfa[_0x33554b];return _0x256954;};'use strict';var _=require('lodash');var util=require(_0xa8bf('0x0'));var logger=require(_0xa8bf('0x1'))(_0xa8bf('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa8bf('0x3'));var fs=require('fs');var path=require(_0xa8bf('0x4'));var rimraf=require('rimraf');var config=require(_0xa8bf('0x5'));var attributes=require(_0xa8bf('0x6'));module[_0xa8bf('0x7')]=function(_0x4d2fe2,_0x3953c6){return _0x4d2fe2[_0xa8bf('0x8')](_0xa8bf('0x9'),attributes,{'tableName':_0xa8bf('0xa'),'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 d0261fd..6b9b38d 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 _0xa400=['client','http','redis','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0x5500e6,_0x614a4f){var _0x72373b=function(_0x3e3c54){while(--_0x3e3c54){_0x5500e6['push'](_0x5500e6['shift']());}};_0x72373b(++_0x614a4f);}(_0xa400,0xc1));var _0x0a40=function(_0x36a94d,_0x2f8299){_0x36a94d=_0x36a94d-0x0;var _0x1aa6ec=_0xa400[_0x36a94d];return _0x1aa6ec;};'use strict';var _=require(_0x0a40('0x0'));var util=require(_0x0a40('0x1'));var moment=require(_0x0a40('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a40('0x3'))['db'];var utils=require(_0x0a40('0x4'));var logger=require('../../config/logger')(_0x0a40('0x5'));var config=require('../../config/environment');var jayson=require(_0x0a40('0x6'));var client=jayson[_0x0a40('0x7')][_0x0a40('0x8')]({'port':0x232a});config[_0x0a40('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a40('0xa'))(new Redis(config[_0x0a40('0x9')]));require(_0x0a40('0xb'))[_0x0a40('0xc')](socket);function respondWithRpcPromise(_0x2495e8,_0x1dc503,_0x229a1f){return new BPromise(function(_0x1f639b,_0x3cc137){return client[_0x0a40('0xd')](_0x2495e8,_0x229a1f)[_0x0a40('0xe')](function(_0x38c13d){logger[_0x0a40('0xf')](_0x0a40('0x10'),_0x1dc503,_0x0a40('0x11'));logger[_0x0a40('0x12')](_0x0a40('0x13'),_0x1dc503,'request\x20sent',JSON['stringify'](_0x38c13d));if(_0x38c13d['error']){if(_0x38c13d[_0x0a40('0x14')][_0x0a40('0x15')]===0x1f4){logger['error'](_0x0a40('0x10'),_0x1dc503,_0x38c13d['error'][_0x0a40('0x16')]);return _0x3cc137(_0x38c13d[_0x0a40('0x14')]['message']);}logger[_0x0a40('0x14')](_0x0a40('0x10'),_0x1dc503,_0x38c13d[_0x0a40('0x14')]['message']);return _0x1f639b(_0x38c13d['error'][_0x0a40('0x16')]);}else{logger[_0x0a40('0xf')](_0x0a40('0x10'),_0x1dc503,_0x0a40('0x11'));_0x1f639b(_0x38c13d[_0x0a40('0x17')]['message']);}})[_0x0a40('0x18')](function(_0x445905){logger[_0x0a40('0x14')]('ChatGroup,\x20%s,\x20%s',_0x1dc503,_0x445905);_0x3cc137(_0x445905);});});}
\ No newline at end of file
+var _0xb2b5=['result','catch','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatGroup,\x20%s,\x20%s'];(function(_0x30ae7b,_0x3a718f){var _0xa9d0cf=function(_0x8102a1){while(--_0x8102a1){_0x30ae7b['push'](_0x30ae7b['shift']());}};_0xa9d0cf(++_0x3a718f);}(_0xb2b5,0xa3));var _0x5b2b=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xb2b5[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b2b('0x0'));var fs=require('fs');var Redis=require(_0x5b2b('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b2b('0x2'))(_0x5b2b('0x3'));var config=require(_0x5b2b('0x4'));var jayson=require(_0x5b2b('0x5'));var client=jayson['client'][_0x5b2b('0x6')]({'port':0x232a});config[_0x5b2b('0x7')]=_['defaults'](config['redis'],{'host':_0x5b2b('0x8'),'port':0x18eb});var socket=require(_0x5b2b('0x9'))(new Redis(config[_0x5b2b('0x7')]));require(_0x5b2b('0xa'))[_0x5b2b('0xb')](socket);function respondWithRpcPromise(_0x29d7be,_0x15425f,_0xa39fc6){return new BPromise(function(_0x52675e,_0x56c260){return client[_0x5b2b('0xc')](_0x29d7be,_0xa39fc6)['then'](function(_0x1290ed){logger[_0x5b2b('0xd')]('ChatGroup,\x20%s,\x20%s',_0x15425f,_0x5b2b('0xe'));logger[_0x5b2b('0xf')](_0x5b2b('0x10'),_0x15425f,_0x5b2b('0xe'),JSON[_0x5b2b('0x11')](_0x1290ed));if(_0x1290ed[_0x5b2b('0x12')]){if(_0x1290ed[_0x5b2b('0x12')]['code']===0x1f4){logger[_0x5b2b('0x12')]('ChatGroup,\x20%s,\x20%s',_0x15425f,_0x1290ed[_0x5b2b('0x12')][_0x5b2b('0x13')]);return _0x56c260(_0x1290ed[_0x5b2b('0x12')][_0x5b2b('0x13')]);}logger['error'](_0x5b2b('0x14'),_0x15425f,_0x1290ed['error'][_0x5b2b('0x13')]);return _0x52675e(_0x1290ed['error']['message']);}else{logger[_0x5b2b('0xd')](_0x5b2b('0x14'),_0x15425f,'request\x20sent');_0x52675e(_0x1290ed[_0x5b2b('0x15')][_0x5b2b('0x13')]);}})[_0x5b2b('0x16')](function(_0xce3474){logger[_0x5b2b('0x12')]('ChatGroup,\x20%s,\x20%s',_0x15425f,_0xce3474);_0x56c260(_0xce3474);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 6acbaab..fb0c752 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 _0x6158=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x107f31,_0x1bcd53){var _0x10560c=function(_0x5e1fc4){while(--_0x5e1fc4){_0x107f31['push'](_0x107f31['shift']());}};_0x10560c(++_0x1bcd53);}(_0x6158,0x14a));var _0x8615=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6158[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x8615('0x0'));var events=[_0x8615('0x1'),_0x8615('0x2'),_0x8615('0x3')];function createListener(_0x3c10dc,_0x2abebc){return function(_0x6a294d){_0x2abebc[_0x8615('0x4')](_0x3c10dc,_0x6a294d);};}function removeListener(_0x317c9b,_0x479275){return function(){ChatGroupEvents[_0x8615('0x5')](_0x317c9b,_0x479275);};}exports[_0x8615('0x6')]=function(_0x626896){for(var _0xced9a=0x0,_0x3d9380=events[_0x8615('0x7')];_0xced9a<_0x3d9380;_0xced9a++){var _0xb3c75e=events[_0xced9a];var _0x1b2e7f=createListener(_0x8615('0x8')+_0xb3c75e,_0x626896);ChatGroupEvents['on'](_0xb3c75e,_0x1b2e7f);}};
\ No newline at end of file
+var _0xa314=['length','chatGroup:','./chatGroup.events','save','removeListener','register'];(function(_0x4c6500,_0xba0326){var _0x7fe60d=function(_0x436843){while(--_0x436843){_0x4c6500['push'](_0x4c6500['shift']());}};_0x7fe60d(++_0xba0326);}(_0xa314,0x152));var _0x4a31=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0xa314[_0x81f000];return _0x337aa2;};'use strict';var ChatGroupEvents=require(_0x4a31('0x0'));var events=[_0x4a31('0x1'),'remove','update'];function createListener(_0x465004,_0x37e8d0){return function(_0x2ce6e9){_0x37e8d0['emit'](_0x465004,_0x2ce6e9);};}function removeListener(_0x4b57c9,_0x52c8e3){return function(){ChatGroupEvents[_0x4a31('0x2')](_0x4b57c9,_0x52c8e3);};}exports[_0x4a31('0x3')]=function(_0x5220b9){for(var _0x1edc49=0x0,_0x55c39d=events[_0x4a31('0x4')];_0x1edc49<_0x55c39d;_0x1edc49++){var _0x33e9ff=events[_0x1edc49];var _0x2816e9=createListener(_0x4a31('0x5')+_0x33e9ff,_0x5220b9);ChatGroupEvents['on'](_0x33e9ff,_0x2816e9);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index cc31b9c..648acea 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 _0xf05f=['/:id/members','addMembers','put','update','delete','destroy','removeMembers','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','getMembers','/:id/messages','getMessages','post'];(function(_0x55c76a,_0x247eba){var _0x1e940c=function(_0x4c5f41){while(--_0x4c5f41){_0x55c76a['push'](_0x55c76a['shift']());}};_0x1e940c(++_0x247eba);}(_0xf05f,0x7c));var _0xff05=function(_0x4ed178,_0x253c5a){_0x4ed178=_0x4ed178-0x0;var _0x24d1ee=_0xf05f[_0x4ed178];return _0x24d1ee;};'use strict';var multer=require(_0xff05('0x0'));var util=require(_0xff05('0x1'));var path=require(_0xff05('0x2'));var timeout=require('connect-timeout');var express=require(_0xff05('0x3'));var router=express['Router']();var fs_extra=require(_0xff05('0x4'));var auth=require(_0xff05('0x5'));var interaction=require(_0xff05('0x6'));var config=require(_0xff05('0x7'));var controller=require(_0xff05('0x8'));router[_0xff05('0x9')]('/',auth[_0xff05('0xa')](),controller[_0xff05('0xb')]);router[_0xff05('0x9')](_0xff05('0xc'),auth[_0xff05('0xa')](),controller[_0xff05('0xd')]);router[_0xff05('0x9')](_0xff05('0xe'),auth[_0xff05('0xa')](),controller[_0xff05('0xf')]);router[_0xff05('0x9')]('/:id/unread',auth[_0xff05('0xa')](),controller[_0xff05('0x10')]);router[_0xff05('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xff05('0x11')]);router[_0xff05('0x9')](_0xff05('0x12'),auth[_0xff05('0xa')](),controller[_0xff05('0x13')]);router[_0xff05('0x14')]('/',auth[_0xff05('0xa')](),controller['create']);router[_0xff05('0x14')](_0xff05('0x15'),auth[_0xff05('0xa')](),controller[_0xff05('0x16')]);router[_0xff05('0x14')](_0xff05('0x12'),auth[_0xff05('0xa')](),controller['addMessage']);router[_0xff05('0x17')](_0xff05('0xe'),auth[_0xff05('0xa')](),controller[_0xff05('0x18')]);router[_0xff05('0x19')](_0xff05('0xe'),auth[_0xff05('0xa')](),controller[_0xff05('0x1a')]);router[_0xff05('0x19')](_0xff05('0x15'),auth['isAuthenticated'](),controller[_0xff05('0x1b')]);module[_0xff05('0x1c')]=router;
\ No newline at end of file
+var _0x7957=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','update','delete','removeMembers','exports','multer','path','connect-timeout','express','Router'];(function(_0x3a1e38,_0x978148){var _0x370473=function(_0x53975e){while(--_0x53975e){_0x3a1e38['push'](_0x3a1e38['shift']());}};_0x370473(++_0x978148);}(_0x7957,0x8c));var _0x7795=function(_0x21205e,_0x7eb8e7){_0x21205e=_0x21205e-0x0;var _0x136ebb=_0x7957[_0x21205e];return _0x136ebb;};'use strict';var multer=require(_0x7795('0x0'));var util=require('util');var path=require(_0x7795('0x1'));var timeout=require(_0x7795('0x2'));var express=require(_0x7795('0x3'));var router=express[_0x7795('0x4')]();var fs_extra=require(_0x7795('0x5'));var auth=require(_0x7795('0x6'));var interaction=require(_0x7795('0x7'));var config=require('../../config/environment');var controller=require(_0x7795('0x8'));router['get']('/',auth[_0x7795('0x9')](),controller[_0x7795('0xa')]);router[_0x7795('0xb')](_0x7795('0xc'),auth[_0x7795('0x9')](),controller[_0x7795('0xd')]);router['get'](_0x7795('0xe'),auth['isAuthenticated'](),controller[_0x7795('0xf')]);router[_0x7795('0xb')](_0x7795('0x10'),auth[_0x7795('0x9')](),controller[_0x7795('0x11')]);router['get'](_0x7795('0x12'),auth[_0x7795('0x9')](),controller[_0x7795('0x13')]);router[_0x7795('0xb')](_0x7795('0x14'),auth[_0x7795('0x9')](),controller[_0x7795('0x15')]);router['post']('/',auth[_0x7795('0x9')](),controller[_0x7795('0x16')]);router[_0x7795('0x17')]('/:id/members',auth[_0x7795('0x9')](),controller[_0x7795('0x18')]);router['post'](_0x7795('0x14'),auth[_0x7795('0x9')](),controller['addMessage']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7795('0x19')]);router[_0x7795('0x1a')](_0x7795('0xe'),auth[_0x7795('0x9')](),controller['destroy']);router[_0x7795('0x1a')](_0x7795('0x12'),auth[_0x7795('0x9')](),controller[_0x7795('0x1b')]);module[_0x7795('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 2c5f8df..c8a6692 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 _0xbc87=['sequelize','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out'];(function(_0x290c30,_0x27584b){var _0x573cf9=function(_0x428783){while(--_0x428783){_0x290c30['push'](_0x290c30['shift']());}};_0x573cf9(++_0x27584b);}(_0xbc87,0x144));var _0x7bc8=function(_0x1aa4ba,_0x3ca443){_0x1aa4ba=_0x1aa4ba-0x0;var _0xd4f238=_0xbc87[_0x1aa4ba];return _0xd4f238;};'use strict';var Sequelize=require(_0x7bc8('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7bc8('0x1')]},'ratingType':{'type':Sequelize[_0x7bc8('0x2')](_0x7bc8('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x7bc8('0x4')]},'pathTranscript':{'type':Sequelize[_0x7bc8('0x4')]},'mailTranscript':{'type':Sequelize[_0x7bc8('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7bc8('0x6')]},'disposition':{'type':Sequelize[_0x7bc8('0x5')]},'secondDisposition':{'type':Sequelize[_0x7bc8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7bc8('0x5')]},'note':{'type':Sequelize[_0x7bc8('0x5')]},'browserName':{'type':Sequelize[_0x7bc8('0x5')]},'browserVersion':{'type':Sequelize[_0x7bc8('0x5')]},'osName':{'type':Sequelize[_0x7bc8('0x5')]},'osVersion':{'type':Sequelize[_0x7bc8('0x5')]},'deviceModel':{'type':Sequelize[_0x7bc8('0x5')]},'deviceVendor':{'type':Sequelize[_0x7bc8('0x5')]},'deviceType':{'type':Sequelize[_0x7bc8('0x5')]},'referer':{'type':Sequelize[_0x7bc8('0x4')]},'customerIp':{'type':Sequelize[_0x7bc8('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x7bc8('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x7bc8('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x7bc8('0x2')]('in',_0x7bc8('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x7bc8('0x5')]},'customerPort':{'type':Sequelize[_0x7bc8('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x7bc8('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xba5a=['star','TEXT','STRING','long','DATE','exports','BOOLEAN','INTEGER','thumb'];(function(_0x178611,_0x5a2987){var _0x5454f5=function(_0x93af96){while(--_0x93af96){_0x178611['push'](_0x178611['shift']());}};_0x5454f5(++_0x5a2987);}(_0xba5a,0x1d0));var _0xaba5=function(_0x3cd133,_0x222fcb){_0x3cd133=_0x3cd133-0x0;var _0x2512c8=_0xba5a[_0x3cd133];return _0x2512c8;};'use strict';var Sequelize=require('sequelize');module[_0xaba5('0x0')]={'closed':{'type':Sequelize[_0xaba5('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaba5('0x2')]},'ratingType':{'type':Sequelize['ENUM']('star',_0xaba5('0x3')),'defaultValue':_0xaba5('0x4')},'ratingMessage':{'type':Sequelize[_0xaba5('0x5')]},'pathTranscript':{'type':Sequelize[_0xaba5('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xaba5('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xaba5('0x6')]},'browserName':{'type':Sequelize[_0xaba5('0x6')]},'browserVersion':{'type':Sequelize[_0xaba5('0x6')]},'osName':{'type':Sequelize[_0xaba5('0x6')]},'osVersion':{'type':Sequelize[_0xaba5('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xaba5('0x6')]},'deviceType':{'type':Sequelize[_0xaba5('0x6')]},'referer':{'type':Sequelize[_0xaba5('0x5')]},'customerIp':{'type':Sequelize[_0xaba5('0x6')]},'formData':{'type':Sequelize[_0xaba5('0x5')](_0xaba5('0x7'))},'read1stAt':{'type':Sequelize[_0xaba5('0x8')]},'lastMsgAt':{'type':Sequelize[_0xaba5('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xaba5('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xaba5('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index fdca4e0..d8781db 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 _0x153f=['sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','include','findAll','getMyMessages','setTags','spread','emit','chatInteractionTags:save','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','secret','read','Account','Owner','get','mkdirSync','Chat','N.A.','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','lastName','renderFile','views','transcript-','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','stack','name','send','render','merge','contact','agent','interaction','account','Users','map','TagIds','split','Tags','push','catch','waiting','talking','answered','unmanaged','closed','UserId','disposition','abandoned','total','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','value','`\x20=\x200','having','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','body','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','unreadMessages','order','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','ChatInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','rows','show','params','fields','includeAll','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','isNull','vidaooMetadata','metadata','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','pathTranscript','Messages','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','Smtp','CloudProvider','getSmtpOptions','SendMail'];(function(_0x1619c1,_0x21b9fd){var _0x424d3f=function(_0x388463){while(--_0x388463){_0x1619c1['push'](_0x1619c1['shift']());}};_0x424d3f(++_0x21b9fd);}(_0x153f,0x15b));var _0xf153=function(_0xf921b3,_0x27ab6b){_0xf921b3=_0xf921b3-0x0;var _0xbe2b38=_0x153f[_0xf921b3];return _0xbe2b38;};'use strict';var rimraf=require(_0xf153('0x0'));var zipdir=require(_0xf153('0x1'));var rp=require(_0xf153('0x2'));var moment=require(_0xf153('0x3'));var BPromise=require(_0xf153('0x4'));var Mustache=require(_0xf153('0x5'));var util=require(_0xf153('0x6'));var path=require('path');var ejs=require(_0xf153('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf153('0x8'));var Redis=require(_0xf153('0x9'));var qs=require(_0xf153('0xa'));var as=require(_0xf153('0xb'));var pdf=require(_0xf153('0xc'));var logger=require('../../config/logger')(_0xf153('0xd'));var config=require(_0xf153('0xe'));var db=require(_0xf153('0xf'))['db'];config[_0xf153('0x10')]=_[_0xf153('0x11')](config[_0xf153('0x10')],{'host':_0xf153('0x12'),'port':0x18eb});var socket=require(_0xf153('0x13'))(new Redis(config[_0xf153('0x10')]));require(_0xf153('0x14'))['register'](socket);var jayson=require(_0xf153('0x15'));var client=jayson[_0xf153('0x16')][_0xf153('0x17')]({'port':0x232b});var client9004=jayson['client'][_0xf153('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x292f89,_0x65756d,_0x1cc666,_0x256b7d){return new BPromise(function(_0x107d31,_0x3f915c){var _0x1d54c4=_0x256b7d||client;return _0x1d54c4[_0xf153('0x18')](_0x292f89,_0x1cc666)['then'](function(_0x18be7e){logger[_0xf153('0x19')](_0xf153('0x1a'),_0x65756d,_0xf153('0x1b'));logger[_0xf153('0x1c')](_0xf153('0x1d'),_0x65756d,_0xf153('0x1b'),JSON[_0xf153('0x1e')](_0x18be7e));if(_0x18be7e['error']){if(_0x18be7e[_0xf153('0x1f')]['code']===0x1f4){logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);return _0x3f915c(_0x18be7e['error'][_0xf153('0x20')]);}logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);return _0x107d31(_0x18be7e[_0xf153('0x1f')][_0xf153('0x20')]);}else{logger[_0xf153('0x19')](_0xf153('0x1a'),_0x65756d,_0xf153('0x1b'));_0x107d31(_0x18be7e[_0xf153('0x21')][_0xf153('0x20')]);}})['catch'](function(_0xcd5762){logger[_0xf153('0x1f')](_0xf153('0x1a'),_0x65756d,_0xcd5762);_0x3f915c(_0xcd5762);});});}function respondWithStatusCode(_0x32e759,_0x5c9f44){_0x5c9f44=_0x5c9f44||0xcc;return function(_0x3e94b5){if(_0x3e94b5){return _0x32e759[_0xf153('0x22')](_0x5c9f44);}return _0x32e759[_0xf153('0x23')](_0x5c9f44)[_0xf153('0x24')]();};}function respondWithResult(_0x38190c,_0x1570fc){_0x1570fc=_0x1570fc||0xc8;return function(_0x39f3ed){if(_0x39f3ed){return _0x38190c[_0xf153('0x23')](_0x1570fc)[_0xf153('0x25')](_0x39f3ed);}};}function respondWithFilteredResult(_0xe490f8,_0x35f9da){return function(_0x141ef4){if(_0x141ef4){var _0x703adb=typeof _0x35f9da[_0xf153('0x26')]===_0xf153('0x27')&&typeof _0x35f9da['limit']===_0xf153('0x27');var _0x3f1c6f=_0x141ef4['count'];var _0x16cdcd=_0x703adb?0x0:_0x35f9da[_0xf153('0x26')];var _0x4e45f9=_0x703adb?_0x141ef4[_0xf153('0x28')]:_0x35f9da[_0xf153('0x26')]+_0x35f9da[_0xf153('0x29')];var _0x2b9a9c;if(_0x4e45f9>=_0x3f1c6f){_0x4e45f9=_0x3f1c6f;_0x2b9a9c=0xc8;}else{_0x2b9a9c=0xce;}_0xe490f8[_0xf153('0x23')](_0x2b9a9c);return _0xe490f8[_0xf153('0x2a')](_0xf153('0x2b'),_0x16cdcd+'-'+_0x4e45f9+'/'+_0x3f1c6f)[_0xf153('0x25')](_0x141ef4);}return null;};}function saveUpdates(_0x19a568){return function(_0x8e31bf){if(_0x8e31bf){return _0x8e31bf[_0xf153('0x2c')](_0x19a568)[_0xf153('0x2d')](function(_0x5b5237){return _0x5b5237;});}return null;};}function removeEntity(_0x258fb0){return function(_0xbb3619){if(_0xbb3619){return _0xbb3619[_0xf153('0x2e')]()[_0xf153('0x2d')](function(){_0x258fb0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28433d){return function(_0x4c6ea0){if(!_0x4c6ea0){_0x28433d['sendStatus'](0x194);}return _0x4c6ea0;};}function handleError(_0x2473d0,_0x4ab958){_0x4ab958=_0x4ab958||0x1f4;return function(_0x2b9623){logger['error'](_0x2b9623[_0xf153('0x2f')]);if(_0x2b9623[_0xf153('0x30')]){delete _0x2b9623['name'];}_0x2473d0[_0xf153('0x23')](_0x4ab958)[_0xf153('0x31')](_0x2b9623);};}function getMustacheRender(_0x538069,_0x40be52){return Mustache[_0xf153('0x32')](_0x538069,_[_0xf153('0x33')](_0x40be52['body'],{'contact':_0x40be52[_0xf153('0x34')],'message':_0x40be52['message'],'agent':_0x40be52[_0xf153('0x35')],'interaction':_0x40be52[_0xf153('0x36')],'account':_0x40be52[_0xf153('0x37')]}))||'';}function getInteractionUsers(_0x1820c3,_0x274bcc){return new BPromise(function(_0x284fe8,_0x4becf3){try{if(_0x274bcc[_0x1820c3['id']]){_0x1820c3[_0xf153('0x38')]=_[_0xf153('0x39')](_0x274bcc[_0x1820c3['id']],function(_0x332809){return{'id':_0x332809['id'],'fullname':_0x332809['fullname']};});}}catch(_0x244172){_0x4becf3(_0x244172);}_0x284fe8(_0x1820c3);});}function getInteractionTags(_0x17d60c,_0xd2a763){return new BPromise(function(_0x254692,_0x36c5cd){try{if(_0x17d60c[_0xf153('0x3a')]){_0x17d60c['Tags']=[];_0x17d60c[_0xf153('0x3a')][_0xf153('0x3b')](',')['forEach'](function(_0x14b2e3){_0x17d60c[_0xf153('0x3c')][_0xf153('0x3d')](_0xd2a763[_0x14b2e3]);});}delete _0x17d60c[_0xf153('0x3a')];}catch(_0x103b91){_0x36c5cd(_0x103b91);}_0x254692(_0x17d60c);});}function updateChatInteraction(_0x42360a,_0xef1510,_0x4d90c1){return new BPromise(function(_0x355131,_0x2f63d6){return getInteractionUsers(_0x42360a,_0x4d90c1)[_0xf153('0x2d')](function(_0x352e7c){return getInteractionTags(_0x352e7c,_0xef1510);})[_0xf153('0x2d')](function(_0x1ee606){return getStateInteraction(_0x1ee606);})['then'](function(_0x4b108e){_0x355131(_0x4b108e);})[_0xf153('0x3e')](function(_0x5051f3){_0x2f63d6(_0x5051f3);});});}function getStateInteraction(_0x46dd09){return new BPromise(function(_0x36c456){_0x46dd09[_0xf153('0x3f')]=0x0;_0x46dd09[_0xf153('0x40')]=0x0;_0x46dd09[_0xf153('0x41')]=0x0;_0x46dd09[_0xf153('0x42')]=0x0;_0x46dd09['abandoned']=0x0;_0x46dd09['total']=0x0;if(!_0x46dd09[_0xf153('0x43')]&&!_0x46dd09[_0xf153('0x44')]){_0x46dd09['waiting']+=0x1;}if(!_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x44')]){_0x46dd09[_0xf153('0x40')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09[_0xf153('0x3f')]-=0x1;}}if(_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x45')]===_0xf153('0x46')){_0x46dd09[_0xf153('0x46')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09[_0xf153('0x3f')]-=0x1;}}else if(_0x46dd09[_0xf153('0x43')]&&!_0x46dd09['UserId']&&_0x46dd09[_0xf153('0x45')]){_0x46dd09[_0xf153('0x42')]+=0x1;if(_0x46dd09[_0xf153('0x3f')]){_0x46dd09['waiting']-=0x1;}}else if(_0x46dd09[_0xf153('0x43')]&&_0x46dd09[_0xf153('0x44')]){_0x46dd09['answered']+=0x1;if(_0x46dd09[_0xf153('0x40')]){_0x46dd09['talking']-=0x1;}}_0x46dd09[_0xf153('0x47')]+=0x1;_0x36c456(_0x46dd09);});}exports[_0xf153('0x48')]=function(_0x17fb10,_0x550d45){var _0x1f540b={},_0x209048={},_0x1426eb={'count':0x0,'rows':[]};var _0x1bece2=_[_0xf153('0x39')](db['ChatInteraction'][_0xf153('0x49')],function(_0x3bc265){return{'name':_0x3bc265['fieldName'],'type':_0x3bc265[_0xf153('0x4a')][_0xf153('0x4b')]};});_0x209048[_0xf153('0x4c')]=_['map'](_0x1bece2,_0xf153('0x30'));_0x209048[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x17fb10[_0xf153('0x4d')]);_0x209048[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x209048[_0xf153('0x4c')],_0x209048[_0xf153('0x4d')]);_0x1f540b[_0xf153('0x51')]=_['intersection'](_0x209048[_0xf153('0x4c')],qs['fields'](_0x17fb10['query']['fields']));_0x1f540b[_0xf153('0x51')]=_0x1f540b[_0xf153('0x51')]['length']?_0x1f540b[_0xf153('0x51')]:_0x209048[_0xf153('0x4c')];if(!_0x17fb10['query'][_0xf153('0x52')](_0xf153('0x53'))){_0x1f540b[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x29')]);_0x1f540b['offset']=qs[_0xf153('0x26')](_0x17fb10[_0xf153('0x4d')]['offset']);}_0x1f540b['order']=qs[_0xf153('0x54')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x54')]);_0x1f540b[_0xf153('0x55')]=qs[_0xf153('0x4f')](_[_0xf153('0x56')](_0x17fb10['query'],_0x209048[_0xf153('0x4f')]),_0x1bece2);var _0x51d813=[];var _0x340aba=squel[_0xf153('0x57')]()[_0xf153('0x58')]('id')['field'](_0xf153('0x30'))[_0xf153('0x58')](_0xf153('0x59'))[_0xf153('0x5a')](_0xf153('0x5b'));var _0x18d0ce=squel[_0xf153('0x57')]()['field'](_0xf153('0x5c'))[_0xf153('0x58')](_0xf153('0x5d'))['field'](_0xf153('0x5e'))[_0xf153('0x5a')](_0xf153('0x5f'),'ui')[_0xf153('0x60')](_0xf153('0x61'),'u',_0xf153('0x62'));var _0x245124=squel[_0xf153('0x57')]()['from'](_0xf153('0x63'),'i')[_0xf153('0x60')]('cm_contacts','c',_0xf153('0x64'))[_0xf153('0x60')](_0xf153('0x61'),'o',_0xf153('0x65'))[_0xf153('0x60')](_0xf153('0x66'),'a',_0xf153('0x67'))[_0xf153('0x60')](_0xf153('0x68'),'me',_0xf153('0x69'))[_0xf153('0x60')]('chat_interaction_has_tags','it',_0xf153('0x6a'))[_0xf153('0x60')]('tools_tags','t',_0xf153('0x6b'));var _0x25e66e=squel[_0xf153('0x6c')]();var _0x147d3a=[];var _0x603892=squel[_0xf153('0x6c')]();var _0x2736e3;if(_0x17fb10['query'][_0xf153('0x6d')]){_0x2736e3=as[_0xf153('0x6e')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x6d')]);var _0x17f58d=_0x2736e3[_0xf153('0x6f')];for(var _0x19ec0b=0x0;_0x19ec0b<_0x2736e3[_0xf153('0x70')][_0xf153('0x71')];_0x19ec0b++){var _0x4c9157=_0x2736e3[_0xf153('0x70')][_0x19ec0b];var _0x433566='i';var _0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name',_0x4c9157[_0xf153('0x58')]]);if(!_0x4afdc4){switch(_0x4c9157[_0xf153('0x58')]){case'unreadMessages':if(_0x4c9157[_0xf153('0x73')]==0x1){_0x245124['having']('`'+_0x4c9157[_0xf153('0x58')]+_0xf153('0x74'));}else{_0x245124[_0xf153('0x75')]('`'+_0x4c9157[_0xf153('0x58')]+'`\x20>\x200');}break;case _0xf153('0x76'):if(_0x4c9157[_0xf153('0x77')]==='$substring'){if(_0x4c9157[_0xf153('0x73')][_0xf153('0x3b')]('\x20')[_0xf153('0x71')]>0x1){_0x25e66e[_0x17f58d](_0xf153('0x78'),qs[_0xf153('0x79')](_0x4c9157['value']),null);}else{var _0xf4a542='%'+_0x4c9157['value']+'%';_0x25e66e[_0x17f58d](_0xf153('0x7a'),_0xf4a542,_0xf4a542,_0xf4a542);}}else{_0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name','ContactId']);_0x4c9157[_0xf153('0x58')]=_0xf153('0x7b');_0x44da13=as['buildExpression'](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13[_0xf153('0x73')]['start'],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);}break;case _0xf153('0x7d'):var _0x1e5e95=_0x4c9157[_0xf153('0x73')][_0xf153('0x3b')](',')[_0xf153('0x39')](function(_0x364957){return Number(_0x364957);});_0x1e5e95[_0xf153('0x7e')](function(_0x858289){_0x603892['or'](_0xf153('0x7f'),'%,'+_0x858289+',%');});_0x147d3a=_[_0xf153('0x80')](_0x147d3a,_0x1e5e95);break;case _0xf153('0x81'):if(_0x4c9157[_0xf153('0x77')]===_0xf153('0x82')){_0x25e66e[_0x17f58d](_0xf153('0x83'),'%'+_0x4c9157['value']+'%',null);}else{_0x4afdc4=_[_0xf153('0x72')](_0x1bece2,['name','UserId']);_0x4c9157[_0xf153('0x58')]='UserId';_0x44da13=as[_0xf153('0x84')](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13[_0xf153('0x73')][_0xf153('0x85')],_0x44da13[_0xf153('0x73')]['end']);}break;case _0xf153('0x86'):_0x44da13=as[_0xf153('0x84')]('me',null,_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13[_0xf153('0x7c')],_0x44da13['value']['start'],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);break;}}else{var _0x44da13=as['buildExpression'](_0x433566,_0x4afdc4[_0xf153('0x4a')],_0x4c9157);_0x25e66e[_0x17f58d](_0x44da13['text'],_0x44da13['value'][_0xf153('0x85')],_0x44da13[_0xf153('0x73')][_0xf153('0x24')]);}}}else{var _0x583dbf=_(_0x17fb10[_0xf153('0x4d')])[_0xf153('0x4e')]()['map'](function(_0x193c8c){return _[_0xf153('0x87')](_0x1bece2,[_0xf153('0x30'),_0x193c8c])?_0x193c8c:undefined;})[_0xf153('0x88')]()[_0xf153('0x73')]();if(!_['isEmpty'](_0x583dbf)){_0x583dbf[_0xf153('0x7e')](function(_0xf791a1){if(_0xf791a1===_0xf153('0x89')){_0x245124[_0xf153('0x55')](_0xf153('0x8a'),[][_0xf153('0x8b')](_0x17fb10[_0xf153('0x4d')][_0xf791a1]));}else if(_0xf791a1==='createdAt'){var _0x756f52=JSON[_0xf153('0x8c')](_0x17fb10[_0xf153('0x4d')][_0xf791a1])[_0xf153('0x8d')];var _0x269102=JSON[_0xf153('0x8c')](_0x17fb10['query'][_0xf791a1])[_0xf153('0x8e')];_0x245124[_0xf153('0x55')](_0xf153('0x8f'),_0x756f52,_0x269102);}else{if(_0x17fb10[_0xf153('0x4d')][_0xf791a1]===_0xf153('0x90')){_0x245124[_0xf153('0x55')]('i.'+_0xf791a1+_0xf153('0x91'));}else{_0x245124[_0xf153('0x55')]('i.'+_0xf791a1+_0xf153('0x92'),_0x17fb10[_0xf153('0x4d')][_0xf791a1]);}}});}if(_0x17fb10['query']['read']){if(_0x17fb10['query']['read']==0x1){_0x245124[_0xf153('0x75')](_0xf153('0x93'));}else{_0x245124[_0xf153('0x75')](_0xf153('0x94'));}}if(_0x17fb10[_0xf153('0x4d')]['tag']){_0x147d3a=_[_0xf153('0x95')](_0x17fb10[_0xf153('0x4d')][_0xf153('0x96')])?_0x17fb10[_0xf153('0x4d')]['tag']:new Array(_0x17fb10[_0xf153('0x4d')][_0xf153('0x96')]);_0x147d3a[_0xf153('0x7e')](function(_0x4a5f54){_0x603892['or'](_0xf153('0x7f'),'%,'+_0x4a5f54+',%');});}if(_0x17fb10['query'][_0xf153('0x97')]){var _0x25ab76=_0x17fb10[_0xf153('0x4d')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf153('0x98')](_0x25ab76)){_0x25e66e['or'](_0xf153('0x99'),_0x25ab76+'%');}else{_0x25e66e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x25ab76))['or'](_0xf153('0x9a'),_0x25ab76+'%');}}}_0x245124['where'](_0x25e66e);_0x245124[_0xf153('0x9b')]('i.id');var _0xb3632c={'type':db[_0xf153('0x9c')][_0xf153('0x9d')][_0xf153('0x9e')],'raw':!![]};var _0x303dcf=_0x245124[_0xf153('0x9f')]();_0x303dcf['field'](_0xf153('0xa0'));_0x303dcf[_0xf153('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf153('0xa1'));if(_0x1f540b[_0xf153('0xa2')]){_0x1f540b[_0xf153('0xa2')][_0xf153('0x7e')](function(_0x5c6ac2){var _0x3e36fc=_0x5c6ac2[0x0]===_0xf153('0xa3')?_0x5c6ac2[0x0]:'i.'+_0x5c6ac2[0x0];_0x245124['order'](_0x3e36fc,_0x5c6ac2[0x1]===_0xf153('0xa4')?![]:!![]);});}if(!_[_0xf153('0xa5')](_0x147d3a)){_0x245124[_0xf153('0x75')](_0x603892);_0x303dcf[_0xf153('0x55')]('t.id\x20IN\x20?',_0x147d3a);}BPromise[_0xf153('0xa6')]()[_0xf153('0x2d')](function(){if(!_0x2736e3){if(_0x17fb10[_0xf153('0x4d')][_0xf153('0x89')])return;_0x303dcf[_0xf153('0x55')](_0xf153('0xa7'));_0x245124[_0xf153('0x55')](_0xf153('0xa7'));return;}if(_0x17fb10[_0xf153('0xa8')]['role']!==_0xf153('0x35'))return;return _0x17fb10[_0xf153('0xa8')][_0xf153('0xa9')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4d24b5){if(_[_0xf153('0xa5')](_0x4d24b5)){_0x303dcf['where'](_0xf153('0xaa'));_0x245124[_0xf153('0x55')](_0xf153('0xaa'));}else{_0x303dcf['where']('i.ChatWebsiteId\x20IN\x20?',_[_0xf153('0x39')](_0x4d24b5,'id'));_0x245124[_0xf153('0x55')](_0xf153('0x8a'),_['map'](_0x4d24b5,'id'));}});})[_0xf153('0x2d')](function(){if(_0x17fb10[_0xf153('0xa8')][_0xf153('0xab')]===_0xf153('0x35')&&!_0x2736e3&&!_0x17fb10[_0xf153('0x4d')][_0xf153('0x89')])return[];return db[_0xf153('0xac')][_0xf153('0x4d')](_0x303dcf[_0xf153('0xad')](),_0xb3632c);})[_0xf153('0x2d')](function(_0x347859){_0x1426eb[_0xf153('0x28')]=_0x347859[_0xf153('0x71')];if(_0x1426eb['count']===0x0)return[];return db[_0xf153('0xac')][_0xf153('0x4d')](_0x340aba[_0xf153('0xad')](),_0xb3632c)['then'](function(_0x573032){_0x51d813=_[_0xf153('0xae')](_0x573032,'id');_0xb3632c=_['merge'](_0xb3632c,{'model':db[_0xf153('0xaf')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17fb10[_0xf153('0x4d')]['fields']){_0x1f540b[_0xf153('0x51')][_0xf153('0x7e')](function(_0x3b0b94){_0x245124[_0xf153('0x58')]('i.'+_0x3b0b94);});}else{_0x245124[_0xf153('0x58')](_0xf153('0xb0'),_0xf153('0xa1'));_0x245124[_0xf153('0x58')]('a.key',_0xf153('0xb1'));_0x245124[_0xf153('0x58')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x245124[_0xf153('0x58')]('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','contactName');_0x245124[_0xf153('0x58')](_0xf153('0xb2'));_0x245124['field'](_0xf153('0xb3'),_0xf153('0xb4'));_0x245124[_0xf153('0x58')](_0xf153('0xb5'),_0xf153('0xb6'));_0x245124[_0xf153('0x58')](_0xf153('0xb7'),_0xf153('0xb8'));_0x245124[_0xf153('0x58')]('c.phone',_0xf153('0xb9'));_0x245124['field'](_0xf153('0xba'),'Contact.mobile');_0x245124[_0xf153('0x58')]('c.fax','Contact.fax');_0x245124[_0xf153('0x58')]('o.fullname',_0xf153('0xbb'));_0x245124[_0xf153('0x58')]('o.internal','Owner.internal');_0x245124[_0xf153('0x58')](_0xf153('0xbc'),_0xf153('0x3a'));}if(_0x1f540b['limit'])_0x245124[_0xf153('0x29')](_0x1f540b[_0xf153('0x29')]);if(_0x1f540b[_0xf153('0x26')])_0x245124[_0xf153('0x26')](_0x1f540b['offset']);return db[_0xf153('0xac')][_0xf153('0x4d')](_0x245124[_0xf153('0xad')](),_0xb3632c);})[_0xf153('0x2d')](function(_0x1022c5){if(_0x1022c5[_0xf153('0x71')]>0x0)_0x18d0ce[_0xf153('0x55')](_0xf153('0xbd'),_[_0xf153('0x39')](_0x1022c5,'id'));return db[_0xf153('0xac')][_0xf153('0x4d')](_0x18d0ce[_0xf153('0xad')](),_0xb3632c)['then'](function(_0x1aebab){var _0x192708=_['groupBy'](_0x1aebab,_0xf153('0xbe'));var _0x4525e1=[];_0x1022c5[_0xf153('0x7e')](function(_0x449f8d){_0x4525e1[_0xf153('0x3d')](updateChatInteraction(_0x449f8d,_0x51d813,_0x192708));});return BPromise['all'](_0x4525e1);});});})[_0xf153('0x2d')](function(_0xa13662){_0x1426eb[_0xf153('0xbf')]=_0xa13662;return _0x1426eb;})[_0xf153('0x2d')](respondWithFilteredResult(_0x550d45,_0x1f540b))[_0xf153('0x3e')](handleError(_0x550d45,null));};exports[_0xf153('0xc0')]=function(_0x2e55f4,_0x1098b7){var _0x29d492={'raw':![],'where':{'id':_0x2e55f4[_0xf153('0xc1')]['id']}},_0x3f7938={};_0x3f7938[_0xf153('0x4c')]=_[_0xf153('0x4e')](db[_0xf153('0xaf')][_0xf153('0x49')]);_0x3f7938['query']=_[_0xf153('0x4e')](_0x2e55f4[_0xf153('0x4d')]);_0x3f7938[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x3f7938[_0xf153('0x4c')],_0x3f7938[_0xf153('0x4d')]);_0x29d492[_0xf153('0x51')]=_[_0xf153('0x50')](_0x3f7938['model'],qs[_0xf153('0xc2')](_0x2e55f4[_0xf153('0x4d')][_0xf153('0xc2')]));_0x29d492[_0xf153('0x51')]=_0x29d492[_0xf153('0x51')]['length']?_0x29d492[_0xf153('0x51')]:_0x3f7938[_0xf153('0x4c')];if(_0x2e55f4[_0xf153('0x4d')][_0xf153('0xc3')]){_0x29d492['include']=[{'all':!![]}];}_0x29d492=_['merge']({},_0x29d492,_0x2e55f4[_0xf153('0xc4')]);return db[_0xf153('0xaf')]['find'](_0x29d492)['then'](handleEntityNotFound(_0x1098b7,null))[_0xf153('0x2d')](respondWithResult(_0x1098b7,null))[_0xf153('0x3e')](handleError(_0x1098b7,null));};exports[_0xf153('0xc5')]=function(_0x339e9e,_0x31a019){return db[_0xf153('0xaf')][_0xf153('0xc5')](_0x339e9e[_0xf153('0x86')],{})[_0xf153('0x2d')](respondWithResult(_0x31a019,0xc9))['catch'](handleError(_0x31a019,null));};exports[_0xf153('0x2c')]=function(_0x110f72,_0x527cce){if(_0x110f72[_0xf153('0x86')]['id']){delete _0x110f72[_0xf153('0x86')]['id'];}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x110f72['params']['id']}})['then'](handleEntityNotFound(_0x527cce,null))[_0xf153('0x2d')](saveUpdates(_0x110f72[_0xf153('0x86')],null))[_0xf153('0x2d')](respondWithResult(_0x527cce,null))['catch'](handleError(_0x527cce,null));};exports[_0xf153('0x2e')]=function(_0x45c835,_0x3ca774){return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x45c835[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3ca774,null))['then'](removeEntity(_0x3ca774,null))[_0xf153('0x3e')](handleError(_0x3ca774,null));};exports[_0xf153('0xc6')]=function(_0x3451e9,_0x3af786){return db[_0xf153('0xaf')][_0xf153('0xc6')]()[_0xf153('0x2d')](respondWithResult(_0x3af786,null))[_0xf153('0x3e')](handleError(_0x3af786,null));};exports[_0xf153('0xc7')]=function(_0x53eee4,_0x2dd1d8){var _0x2c3f76=_0x53eee4[_0xf153('0xc1')]['id'];var _0x374ba4;var _0x1b4f50;var _0x40c1d1;return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x2c3f76}})[_0xf153('0x2d')](function(_0x8711eb){_0x374ba4=_0x8711eb;return db[_0xf153('0xc9')]['findOne']({'where':{'id':_0x8711eb[_0xf153('0x89')]},'attributes':['id',_0xf153('0xca'),_0xf153('0xcb'),_0xf153('0xcc'),_0xf153('0xcd'),'vidaooMetadata'],'raw':!![]});})[_0xf153('0x2d')](function(_0x2e908a){if(_0x2e908a&&_0x2e908a['vidaooApiKey']&&_0x2e908a[_0xf153('0xcb')]){_0x1b4f50=_0x2e908a;var _0x57d320={'interaction':{'id':_0x2c3f76},'agent':{'id':_0x53eee4[_0xf153('0xa8')]['id'],'name':_0x53eee4[_0xf153('0xa8')][_0xf153('0x30')],'fullname':_0x53eee4[_0xf153('0xa8')]['fullname'],'email':_0x53eee4[_0xf153('0xa8')][_0xf153('0xce')]},'contact':_0x53eee4['body'][_0xf153('0x34')],'account':_0x53eee4['body'][_0xf153('0x37')]};var _0x30ae3c={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2e908a['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x53eee4[_0xf153('0xa8')][_0xf153('0xce')]],'buttons':null,'topic':_0x1b4f50['vidaooTopic'],'note':_[_0xf153('0xcf')](_0x1b4f50[_0xf153('0xcd')])?null:getMustacheRender(_0x1b4f50['vidaooNote'],_0x57d320),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xf153('0xcf')](_0x1b4f50[_0xf153('0xd0')])){var _0x32971d=getMustacheRender(_0x1b4f50[_0xf153('0xd0')],_0x57d320);var _0x1a4825=JSON[_0xf153('0x8c')](_0x32971d);_0x30ae3c[_0xf153('0x86')][_0xf153('0xd1')]=_0x1a4825;}}catch(_0xb03f70){throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xd2'));}return rp(_0x30ae3c);}else{throw new db['Sequelize']['ValidationError'](_0xf153('0xd3'));}})[_0xf153('0x2d')](function(_0x264968){_0x40c1d1=_0x264968;if(_0x40c1d1['id']){var _0xe61167={'body':_0x40c1d1['join_url'],'ChatWebsiteId':_0x1b4f50['id'],'ChatInteractionId':_0x374ba4['id'],'direction':_0xf153('0xd4'),'UserId':_0x53eee4['user']['id']};return db[_0xf153('0xd5')][_0xf153('0xc5')](_0xe61167,{});}else{throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xd6'));}})[_0xf153('0x2d')](function(){return _0x374ba4['updateAttributes']({'vidaooSessionId':_0x40c1d1['id']});})[_0xf153('0x2d')](respondWithResult(_0x2dd1d8,null))['catch'](handleError(_0x2dd1d8,null));};exports[_0xf153('0xd7')]=function(_0x1ba174,_0xab67b7){if(_0x1ba174['body']['id']){delete _0x1ba174['body']['id'];}return db[_0xf153('0xaf')]['find']({'where':{'id':_0x1ba174[_0xf153('0xc1')]['id']},'include':[{'model':db[_0xf153('0xd8')],'as':_0xf153('0x76')}]})[_0xf153('0x2d')](handleEntityNotFound(_0xab67b7,null))[_0xf153('0x2d')](saveUpdates(_0x1ba174[_0xf153('0x86')],null))[_0xf153('0x2d')](respondWithResult(_0xab67b7,null))[_0xf153('0x3e')](handleError(_0xab67b7,null));};exports[_0xf153('0xd9')]=function(_0x40ade6,_0x1a9bfb){if(_0x40ade6[_0xf153('0x86')]['id']){delete _0x40ade6[_0xf153('0x86')]['id'];}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x40ade6[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](function(_0x50dd96){if(!_0x50dd96){logger[_0xf153('0x1f')](_0xf153('0xda'),_0xf153('0xd9'),0x194,'entity\x20not\x20found');_0x1a9bfb[_0xf153('0x22')](0x194);}else{if(_0x50dd96[_0xf153('0x44')]){throw new db[(_0xf153('0x9c'))]['ValidationError'](_0xf153('0xdb'));}}return _0x50dd96;})[_0xf153('0x2d')](function(_0xeebd4f){if(_0xeebd4f){return _0xeebd4f[_0xf153('0x2c')]({'closed':_0x40ade6[_0xf153('0x86')]['closed'],'disposition':_0x40ade6[_0xf153('0x86')]['disposition']})[_0xf153('0x2d')](function(_0x4fe273){return _0x4fe273;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0xf153('0xd9'),_0x40ade6['body'],client9004);})[_0xf153('0x2d')](respondWithResult(_0x1a9bfb,null))['catch'](handleError(_0x1a9bfb,null));};exports[_0xf153('0xdc')]=function(_0x25543b,_0x3c1ae6){_0x25543b[_0xf153('0x86')]['name']=_0x25543b[_0xf153('0xdd')][_0xf153('0xde')];_0x25543b['body'][_0xf153('0xdf')]=_0x25543b[_0xf153('0xdd')][_0xf153('0xe0')];_0x25543b[_0xf153('0x86')][_0xf153('0x4a')]=_0x25543b[_0xf153('0xdd')][_0xf153('0xe1')];return db['Attachment'][_0xf153('0xc5')](_0x25543b[_0xf153('0x86')])[_0xf153('0x2d')](respondWithResult(_0x3c1ae6,0xc9))[_0xf153('0x3e')](handleError(_0x3c1ae6,null));};exports[_0xf153('0xe2')]=function(_0x2c8401,_0x41ef70){return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x2c8401[_0xf153('0xc1')]['id']},'raw':!![]})[_0xf153('0x2d')](handleEntityNotFound(_0x41ef70,null))[_0xf153('0x2d')](function(_0x283f9e){if(_0x283f9e){if(_0x283f9e['closed']){return _0x41ef70['status'](0x193)[_0xf153('0x25')]({'status':0x193,'message':_0xf153('0xe3')});}return db['Attachment'][_0xf153('0xc8')]({'where':{'id':_0x2c8401[_0xf153('0x4d')][_0xf153('0xe4')]},'raw':!![]})['then'](handleEntityNotFound(_0x41ef70,null));}})['then'](function(_0x13b7e2){if(_0x13b7e2){var _0x25222f=_0x13b7e2[_0xf153('0xe5')]!==null;var _0x4b2cdd=path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0xe8'));if(_0x25222f){_0x4b2cdd=path[_0xf153('0xe6')](_0x4b2cdd,_0xf153('0xe9'));}var _0x1ac5ff=path[_0xf153('0xe6')](_0x4b2cdd,_0x13b7e2[_0xf153('0xdf')]);return _0x41ef70[_0xf153('0xea')](_0x1ac5ff);}})[_0xf153('0x3e')](handleError(_0x41ef70,null));};exports[_0xf153('0xeb')]=function(_0x126535,_0x392c8e){var _0x203143=null;var _0x173f12=null;var _0x1f8794=null;if(_0x126535[_0xf153('0x86')]['id']){delete _0x126535[_0xf153('0x86')]['id'];}if(_0x126535['body'][_0xf153('0xec')]){_0x1f8794=path['join'](config[_0xf153('0xe7')],_0xf153('0xed'),util['format']('transcript-%s.txt',Date['now']()));_0x126535[_0xf153('0x86')][_0xf153('0xee')]=_0x1f8794;}return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x126535['params']['id']},'include':[{'model':db[_0xf153('0xd5')],'as':_0xf153('0xef'),'include':[{'model':db[_0xf153('0x81')],'as':_0xf153('0x81')}]}]})[_0xf153('0x2d')](handleEntityNotFound(_0x392c8e,null))[_0xf153('0x2d')](saveUpdates(_0x126535[_0xf153('0x86')],null))[_0xf153('0x2d')](function(_0x4c2b50){if(_0x4c2b50){_0x203143=_0x4c2b50;return db[_0xf153('0xc9')][_0xf153('0x72')]({'where':{'id':_0x203143['ChatWebsiteId']}});}})['then'](function(_0x3021e6){if(_0x3021e6){_0x173f12=_0x3021e6;return db[_0xf153('0xd8')]['find']({'where':{'id':_0x203143[_0xf153('0x7b')]}});}})['then'](function(_0x3057f1){if(_0x3057f1){if(_0x1f8794){var _0x207255=null;for(var _0xd8cd84=0x1;_0xd8cd84<_0x203143[_0xf153('0xef')][_0xf153('0x71')];++_0xd8cd84){_0x207255=_0x203143['Messages'][_0xd8cd84];var _0xb4dbdd=_0x207255['UserId']?util['format'](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');var _0x5b1a91=_0x126535[_0xf153('0x86')][_0xf153('0xf3')]||util[_0xf153('0xf4')](_0xf153('0xf0'),_0xf153('0xf5'),_0x207255[_0xf153('0x7b')]);switch(_0x173f12[_0xf153('0xf6')]){case _0xf153('0xf7'):_0xb4dbdd=_0x207255['UserId']?util[_0xf153('0xf4')](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');break;case _0xf153('0xf8'):_0xb4dbdd=_0x207255[_0xf153('0x44')]?_0x207255[_0xf153('0x81')][_0xf153('0xf9')]||_0x207255[_0xf153('0x81')][_0xf153('0xfa')]:_0xf153('0xf2');break;case'agent_fullname':_0xb4dbdd=_0x207255[_0xf153('0x44')]?_0x207255[_0xf153('0x81')]['fullname']:_0xf153('0xf2');break;default:_0xb4dbdd=_0x207255[_0xf153('0x44')]?util[_0xf153('0xf4')](_0xf153('0xf0'),_0x173f12[_0xf153('0xf1')],_0x207255[_0xf153('0x44')]):_0xf153('0xf2');}var _0x4b8d5c=util[_0xf153('0xf4')](_0xf153('0xfb'),moment(_0x207255[_0xf153('0xfc')])[_0xf153('0xf4')]('MM/DD/YYYY\x20HH:mm:ss'),_0x207255[_0xf153('0xfd')]==='in'?_0x5b1a91:_0xb4dbdd,_0x207255[_0xf153('0x86')]);if(!_0x207255['secret']){fs[_0xf153('0xfe')](_0x1f8794,_0x4b8d5c);}}return db['MailAccount'][_0xf153('0xc8')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf153('0xff'),'raw':!![],'include':[{'model':db[_0xf153('0x100')],'as':_0xf153('0x100'),'raw':!![]}]}]});}}})[_0xf153('0x2d')](function(_0x5a8d13){if(!_0x5a8d13||!_0x5a8d13[_0xf153('0xff')]||!_0x126535['body'])return _0x203143;var _0x21285e=_0x5a8d13[_0xf153('0x101')]();return respondWithRpcPromise(_0xf153('0x102'),_0xf153('0x103'),{'account':_0x21285e,'message':{'from':util[_0xf153('0xf4')](_0xf153('0x104'),_0x5a8d13['name'],_0x5a8d13[_0xf153('0xce')]||_0x5a8d13['Smtp'][_0xf153('0xa8')]),'to':_0x126535['body'][_0xf153('0xec')],'subject':_0xf153('0x105'),'text':util[_0xf153('0xf4')](_0xf153('0x106'),_0x126535['body'][_0xf153('0xec')]),'attachments':[{'path':_0x1f8794}]}})['then'](function(){return _0x203143;})[_0xf153('0x3e')](function(_0x5c32d1){logger[_0xf153('0x1f')](_0x5c32d1);});})[_0xf153('0x2d')](respondWithStatusCode(_0x392c8e,0xc8))[_0xf153('0x3e')](handleError(_0x392c8e,null));};exports[_0xf153('0x107')]=function(_0x273b03,_0x3165e5){return db[_0xf153('0xd5')][_0xf153('0x72')]({'where':{'id':_0x273b03['params']['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3165e5,null))[_0xf153('0x2d')](function(_0x48c9e4){if(_0x48c9e4){return _0x48c9e4[_0xf153('0x107')](_0x273b03[_0xf153('0x86')][_0xf153('0x108')],_[_0xf153('0x109')](_0x273b03[_0xf153('0x86')],[_0xf153('0x108'),'id'])||{});}})[_0xf153('0x2d')](respondWithResult(_0x3165e5,null))['catch'](handleError(_0x3165e5,null));};exports['getMessages']=function(_0x550c10,_0x3e8153){var _0x1fb83a={'raw':![],'where':{}};var _0x10f948={};var _0x5cc922={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf153('0xc8')]({'where':{'id':_0x550c10['params']['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x3e8153,null))[_0xf153('0x2d')](function(_0x21a1c9){if(_0x21a1c9){_0x10f948[_0xf153('0x4c')]=_[_0xf153('0x4e')](db['ChatMessage'][_0xf153('0x49')]);_0x10f948[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x550c10['query']);_0x10f948[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x10f948[_0xf153('0x4c')],_0x10f948[_0xf153('0x4d')]);_0x1fb83a[_0xf153('0x51')]=_[_0xf153('0x50')](_0x10f948[_0xf153('0x4c')],qs[_0xf153('0xc2')](_0x550c10[_0xf153('0x4d')][_0xf153('0xc2')]));_0x1fb83a[_0xf153('0x51')]=_0x1fb83a[_0xf153('0x51')][_0xf153('0x71')]?_0x1fb83a[_0xf153('0x51')]:_0x10f948[_0xf153('0x4c')];if(!_0x550c10[_0xf153('0x4d')][_0xf153('0x52')]('nolimit')){_0x1fb83a[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x550c10[_0xf153('0x4d')][_0xf153('0x29')]);_0x1fb83a['offset']=qs[_0xf153('0x26')](_0x550c10[_0xf153('0x4d')][_0xf153('0x26')]);}_0x1fb83a[_0xf153('0xa2')]=qs[_0xf153('0x54')](_0x550c10[_0xf153('0x4d')]['sort']);_0x1fb83a[_0xf153('0x55')]=qs[_0xf153('0x4f')](_['pick'](_0x550c10[_0xf153('0x4d')],_0x10f948[_0xf153('0x4f')]));_0x1fb83a[_0xf153('0x55')][_0xf153('0xbe')]=_0x21a1c9['id'];if(_0x550c10[_0xf153('0x4d')][_0xf153('0x97')]){_0x1fb83a[_0xf153('0x55')]=_[_0xf153('0x33')](_0x1fb83a[_0xf153('0x55')],{'$or':_[_0xf153('0x39')](_0x1fb83a[_0xf153('0x51')],function(_0x4538be){var _0x63ad32={};_0x63ad32[_0x4538be]={'$like':'%'+_0x550c10['query'][_0xf153('0x97')]+'%'};return _0x63ad32;})});}if(_0x550c10[_0xf153('0x4d')][_0xf153('0x8d')]){var _0x9503e=_0x550c10[_0xf153('0x4d')][_0xf153('0x8d')]['split'](',');var _0x49ea9a={};_0x49ea9a[_0x9503e[0x0]]={'$gte':moment(_0x9503e[0x1])[_0xf153('0xf4')](_0xf153('0x10a'))};_0x1fb83a[_0xf153('0x55')]=_['merge'](_0x1fb83a[_0xf153('0x55')],_0x49ea9a);}_0x1fb83a=_[_0xf153('0x33')]({},_0x1fb83a,_0x550c10[_0xf153('0xc4')]);return db[_0xf153('0xd5')][_0xf153('0x28')]({'where':_0x1fb83a[_0xf153('0x55')]})[_0xf153('0x2d')](function(_0x921b52){_0x5cc922['count']=_0x921b52;if(_0x550c10['query'][_0xf153('0xc3')]){_0x1fb83a[_0xf153('0x10b')]=[{'all':!![]}];}return db[_0xf153('0xd5')][_0xf153('0x10c')](_0x1fb83a);})[_0xf153('0x2d')](function(_0x577fc7){_0x5cc922[_0xf153('0xbf')]=_0x577fc7;return _0x5cc922;});}})[_0xf153('0x2d')](respondWithFilteredResult(_0x3e8153,_0x1fb83a))[_0xf153('0x3e')](handleError(_0x3e8153,null));};exports[_0xf153('0x10d')]=function(_0x283af8,_0x58be79){var _0x1d0d1a={'where':{}},_0x5397a8={},_0x466386={'count':0x0,'rows':[]};return db[_0xf153('0xaf')][_0xf153('0xc8')]({'where':{'id':_0x283af8[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x58be79,null))['then'](function(_0x5efd23){if(_0x5efd23){_0x5397a8[_0xf153('0x4c')]=_[_0xf153('0x4e')](db[_0xf153('0xd5')][_0xf153('0x49')]);_0x5397a8[_0xf153('0x4d')]=_[_0xf153('0x4e')](_0x283af8[_0xf153('0x4d')]);_0x5397a8[_0xf153('0x4f')]=_[_0xf153('0x50')](_0x5397a8[_0xf153('0x4c')],_0x5397a8[_0xf153('0x4d')]);_0x1d0d1a[_0xf153('0x51')]=_[_0xf153('0x50')](_0x5397a8[_0xf153('0x4c')],qs[_0xf153('0xc2')](_0x283af8[_0xf153('0x4d')][_0xf153('0xc2')]));_0x1d0d1a[_0xf153('0x51')]=_0x1d0d1a[_0xf153('0x51')][_0xf153('0x71')]?_0x1d0d1a[_0xf153('0x51')]:_0x5397a8[_0xf153('0x4c')];if(!_0x283af8['query']['hasOwnProperty'](_0xf153('0x53'))){_0x1d0d1a[_0xf153('0x29')]=qs[_0xf153('0x29')](_0x283af8['query'][_0xf153('0x29')]);_0x1d0d1a[_0xf153('0x26')]=qs[_0xf153('0x26')](_0x283af8['query'][_0xf153('0x26')]);}_0x1d0d1a[_0xf153('0xa2')]=qs[_0xf153('0x54')](_0x283af8[_0xf153('0x4d')]['sort']);_0x1d0d1a[_0xf153('0x55')]=qs['filters'](_[_0xf153('0x56')](_0x283af8[_0xf153('0x4d')],_0x5397a8[_0xf153('0x4f')]));_0x1d0d1a[_0xf153('0x55')]['ChatInteractionId']=_0x5efd23['id'];if(_0x283af8[_0xf153('0x4d')]['filter']){_0x1d0d1a[_0xf153('0x55')]=_[_0xf153('0x33')](_0x1d0d1a[_0xf153('0x55')],{'$or':_[_0xf153('0x39')](_0x1d0d1a[_0xf153('0x51')],function(_0x397ee2){var _0x17e62e={};_0x17e62e[_0x397ee2]={'$like':'%'+_0x283af8[_0xf153('0x4d')][_0xf153('0x97')]+'%'};return _0x17e62e;})});}_0x1d0d1a['where']['secret']=![];if(_0x283af8[_0xf153('0x4d')]['id']){_0x1d0d1a[_0xf153('0x55')]['id']={'$gt':_0x283af8[_0xf153('0x4d')]['id']};}_0x1d0d1a=_['merge']({},_0x1d0d1a,_0x283af8[_0xf153('0xc4')]);return db[_0xf153('0xd5')][_0xf153('0x28')]({'where':_0x1d0d1a['where']})[_0xf153('0x2d')](function(_0x100f48){_0x466386[_0xf153('0x28')]=_0x100f48;_0x1d0d1a[_0xf153('0x10b')]=[];if(_0x283af8['query']['includeAgent']){_0x1d0d1a[_0xf153('0x10b')][_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x81'),'attributes':['id','fullname',_0xf153('0xf9')]});}if(_0x283af8[_0xf153('0x4d')][_0xf153('0xc3')]){_0x1d0d1a[_0xf153('0x10b')]=[{'all':!![]}];}return db[_0xf153('0xd5')][_0xf153('0x10c')](_0x1d0d1a);})[_0xf153('0x2d')](function(_0x3a94c5){_0x466386[_0xf153('0xbf')]=_0x3a94c5;return _0x466386;});}})[_0xf153('0x2d')](respondWithFilteredResult(_0x58be79,_0x1d0d1a))['catch'](handleError(_0x58be79,null));};exports['addTags']=function(_0x11997d,_0x74943){return db[_0xf153('0xaf')]['find']({'where':{'id':_0x11997d[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x74943,null))['then'](function(_0x3f7eb6){if(_0x3f7eb6){return _0x3f7eb6[_0xf153('0x10e')](_0x11997d['body']['ids'],_[_0xf153('0x109')](_0x11997d['body'],[_0xf153('0x108'),'id'])||{})[_0xf153('0x10f')](function(){return db[_0xf153('0x7d')]['findAll']({'attributes':['id',_0xf153('0x30'),_0xf153('0x59')],'where':{'id':_0x11997d['body'][_0xf153('0x108')]}});})['then'](function(_0x5742a6){socket[_0xf153('0x110')](_0xf153('0x111'),{'id':Number(_0x11997d[_0xf153('0xc1')]['id']),'tags':_0x5742a6||[]});return{'id':Number(_0x11997d[_0xf153('0xc1')]['id']),'tags':_0x5742a6||[]};});}})[_0xf153('0x2d')](respondWithResult(_0x74943,null))[_0xf153('0x3e')](handleError(_0x74943,null));};exports['removeTags']=function(_0x9d9d65,_0x301675){return db[_0xf153('0xaf')][_0xf153('0x72')]({'where':{'id':_0x9d9d65[_0xf153('0xc1')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x301675,null))[_0xf153('0x2d')](function(_0x4a5c86){if(_0x4a5c86){return _0x4a5c86['removeTags'](_0x9d9d65[_0xf153('0x4d')][_0xf153('0x108')]);}})['then'](respondWithStatusCode(_0x301675,null))[_0xf153('0x3e')](handleError(_0x301675,null));};exports[_0xf153('0xea')]=function(_0x252e74,_0x48f9ff){var _0x2180ec=moment()[_0xf153('0x112')]()[_0xf153('0xad')]();var _0x265407=path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0x113'),_0xf153('0x114'),_0xf153('0x115'));var _0x2a39ae=path[_0xf153('0xe6')](config['root'],_0xf153('0x113'),_0xf153('0x114'),_0xf153('0x116'));var _0x154c3c=path[_0xf153('0xe6')](_0x265407,_0x2180ec);var _0x5b9c=util[_0xf153('0xf4')](_0xf153('0x117'),_0x252e74[_0xf153('0xc1')]['id'],_0x2180ec);var _0x304d66=path['join'](_0x265407,_0x5b9c);var _0x444f68=[];_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x81'),'attributes':['id',_0xf153('0xfa')],'raw':!![]});_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0xd8')],'as':_0xf153('0x76'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x252e74[_0xf153('0x4d')]['attachments']){_0x444f68[_0xf153('0x3d')]({'model':db[_0xf153('0x118')],'as':_0xf153('0x118'),'raw':!![]});}var _0x3d553d=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xf153('0x86'),_0xf153('0xfc'),_0xf153('0xfd'),_0xf153('0x119'),_0xf153('0x11a')],'include':_0x444f68}];_0x3d553d[_0xf153('0x3d')]({'model':db[_0xf153('0xc9')],'as':_0xf153('0x11b'),'attributes':['id',_0xf153('0x30')]});_0x3d553d[_0xf153('0x3d')]({'model':db[_0xf153('0x81')],'as':_0xf153('0x11c'),'attributes':['id',_0xf153('0xfa')]});return db[_0xf153('0xaf')]['find']({'where':{'id':_0x252e74[_0xf153('0xc1')]['id']},'include':_0x3d553d})[_0xf153('0x2d')](handleEntityNotFound(_0x48f9ff,null))[_0xf153('0x2d')](function(_0xf53fc6){if(_0xf53fc6){var _0x45112b=_0xf53fc6[_0xf153('0x11d')]({'plain':!![]});fs[_0xf153('0x11e')](_0x154c3c);var _0x1435bd={'channel':_0xf153('0x11f'),'account':_0x45112b[_0xf153('0x11b')]['name'],'agent':_0x45112b[_0xf153('0x11c')]?_0x45112b[_0xf153('0x11c')][_0xf153('0xfa')]:_0xf153('0x120'),'createdAt':moment(_0x45112b['createdAt'])[_0xf153('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x45112b['closed']?moment(_0x45112b['closedAt'])[_0xf153('0xf4')](_0xf153('0x10a'))[_0xf153('0xad')]():'','disposition':_0x45112b[_0xf153('0x45')],'chatInfo':{'browser':_0x45112b[_0xf153('0x121')],'os':_0x45112b['osName'],'referer':_0x45112b[_0xf153('0x122')],'customerIp':_0x45112b[_0xf153('0x123')],'customerPort':_0x45112b['customerPort']?_0x45112b[_0xf153('0x124')]:_0xf153('0x120')},'messages':_(_0x45112b['Messages'])[_0xf153('0x125')]()['filter']({'secret':![]})[_0xf153('0x39')](function(_0x5aa0bf){if(_0x5aa0bf[_0xf153('0x118')]){var _0x5ec77c=path[_0xf153('0xe6')](_0x2a39ae,_0x5aa0bf[_0xf153('0x118')][_0xf153('0xdf')]);if(fs[_0xf153('0x126')](_0x5ec77c)){fs[_0xf153('0x127')](_0x5ec77c)['pipe'](fs[_0xf153('0x128')](path[_0xf153('0xe6')](_0x154c3c,_0x5aa0bf[_0xf153('0x118')][_0xf153('0xdf')])));}}return{'date':moment(_0x5aa0bf['createdAt'])[_0xf153('0xf4')](_0xf153('0x10a'))[_0xf153('0xad')](),'sender':_0x5aa0bf[_0xf153('0xfd')]===_0xf153('0xd4')?_0x5aa0bf['User']?_0x5aa0bf[_0xf153('0x81')][_0xf153('0xfa')]:_0xf153('0xf2'):_0x5aa0bf[_0xf153('0x76')]['firstName']+(_0x5aa0bf[_0xf153('0x76')][_0xf153('0x129')]?'\x20'+_0x5aa0bf[_0xf153('0x76')][_0xf153('0x129')]:''),'body':_0x5aa0bf[_0xf153('0x118')]?_0x5aa0bf['Attachment'][_0xf153('0xdf')]:_0x5aa0bf[_0xf153('0x86')],'direction':_0x5aa0bf[_0xf153('0xfd')]===_0xf153('0xd4')?'A':'C','secret':_0x5aa0bf[_0xf153('0x119')],'read':_0x5aa0bf[_0xf153('0x11a')],'attachment':_0x5aa0bf['Attachment']};})['value']()};return ejs[_0xf153('0x12a')](path[_0xf153('0xe6')](config[_0xf153('0xe7')],_0xf153('0x113'),_0xf153('0x12b'),'downloadInteraction.ejs'),{'interaction':_0x1435bd})[_0xf153('0x2d')](function(_0x415d13){var _0xb2f8e0=path[_0xf153('0xe6')](_0x154c3c,_0xf153('0x12c')+_0x45112b['id']+'-'+_0x2180ec+'.pdf');var _0x3b6a0e={'path':_0xb2f8e0,'channel':_0xf153('0x11f'),'interactionId':_0x45112b['id']};return pdf['createPdfFromHTML'](_0x415d13,_0x3b6a0e);})[_0xf153('0x2d')](function(){return new Promise(function(_0x19de76,_0x5912d8){zipdir(_0x154c3c,{'saveTo':_0x304d66},function(_0x426db4,_0x52677c){if(_0x426db4)return _0x5912d8(_0x426db4);return _0x19de76(_0x52677c);});})[_0xf153('0x2d')](function(){return new BPromise(function(_0x200d37,_0x393d95){rimraf(_0x154c3c,function(_0x30a638){if(_0x30a638)_0x393d95(_0x30a638);return _0x200d37();});});})[_0xf153('0x2d')](function(){return _0x48f9ff['download'](_0x304d66,_0x5b9c,function(_0x416a91){if(_0x416a91){logger['error'](_0xf153('0x12d'),_0x416a91);}else{fs[_0xf153('0x12e')](_0x304d66);}});});});}else{return _0x48f9ff[_0xf153('0x22')](0xc8);}})[_0xf153('0x3e')](handleError(_0x48f9ff,null));};
\ No newline at end of file
+var _0xda55=['fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','AbandonInteraction','file','basename','filename','Attachment','attachmentDownload','Unauthorized','join','root','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','CmContact','%s%d','agentAlias','customer','Visitor','website_alias','agent_alias','System','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','rawAttributes','sort','filter','merge','include','findAll','rows','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','views','transcript-','createPdfFromHTML','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','ejs','squel','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','json','offset','undefined','count','limit','Content-Range','destroy','then','stack','name','send','render','body','contact','agent','interaction','account','Users','map','TagIds','split','forEach','Tags','push','waiting','unmanaged','abandoned','total','closed','UserId','talking','disposition','answered','index','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','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','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','toString','keyBy','ChatInteraction','a.key','Account.key','a.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','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','ChatInteractionId','all','show','params','includeAll','options','create','update','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooMetadata'];(function(_0x10e1d9,_0x973af7){var _0x2c0c87=function(_0x502d8b){while(--_0x502d8b){_0x10e1d9['push'](_0x10e1d9['shift']());}};_0x2c0c87(++_0x973af7);}(_0xda55,0x6d));var _0x5da5=function(_0x5353a5,_0x550668){_0x5353a5=_0x5353a5-0x0;var _0x1a856b=_0xda55[_0x5353a5];return _0x1a856b;};'use strict';var rimraf=require(_0x5da5('0x0'));var zipdir=require(_0x5da5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5da5('0x2'));var Mustache=require(_0x5da5('0x3'));var util=require(_0x5da5('0x4'));var path=require(_0x5da5('0x5'));var ejs=require(_0x5da5('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5da5('0x7'));var Redis=require('ioredis');var qs=require(_0x5da5('0x8'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x5da5('0x9'));var logger=require(_0x5da5('0xa'))(_0x5da5('0xb'));var config=require(_0x5da5('0xc'));var db=require(_0x5da5('0xd'))['db'];config[_0x5da5('0xe')]=_[_0x5da5('0xf')](config[_0x5da5('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x5da5('0x10'))(new Redis(config[_0x5da5('0xe')]));require(_0x5da5('0x11'))[_0x5da5('0x12')](socket);var jayson=require(_0x5da5('0x13'));var client=jayson[_0x5da5('0x14')][_0x5da5('0x15')]({'port':0x232b});var client9004=jayson['client'][_0x5da5('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x3b5ff9,_0x4f813b,_0x37aeb0,_0x31366e){return new BPromise(function(_0x3ced00,_0x43d526){var _0x1877d4=_0x31366e||client;return _0x1877d4[_0x5da5('0x16')](_0x3b5ff9,_0x37aeb0)['then'](function(_0x489b60){logger['info'](_0x5da5('0x17'),_0x4f813b,_0x5da5('0x18'));logger[_0x5da5('0x19')](_0x5da5('0x1a'),_0x4f813b,_0x5da5('0x18'),JSON[_0x5da5('0x1b')](_0x489b60));if(_0x489b60[_0x5da5('0x1c')]){if(_0x489b60['error'][_0x5da5('0x1d')]===0x1f4){logger[_0x5da5('0x1c')](_0x5da5('0x17'),_0x4f813b,_0x489b60[_0x5da5('0x1c')][_0x5da5('0x1e')]);return _0x43d526(_0x489b60[_0x5da5('0x1c')]['message']);}logger[_0x5da5('0x1c')](_0x5da5('0x17'),_0x4f813b,_0x489b60[_0x5da5('0x1c')][_0x5da5('0x1e')]);return _0x3ced00(_0x489b60[_0x5da5('0x1c')]['message']);}else{logger[_0x5da5('0x1f')](_0x5da5('0x17'),_0x4f813b,_0x5da5('0x18'));_0x3ced00(_0x489b60['result'][_0x5da5('0x1e')]);}})[_0x5da5('0x20')](function(_0x20c8a6){logger[_0x5da5('0x1c')](_0x5da5('0x17'),_0x4f813b,_0x20c8a6);_0x43d526(_0x20c8a6);});});}function respondWithStatusCode(_0x436960,_0x47d4e8){_0x47d4e8=_0x47d4e8||0xcc;return function(_0x1a6bd7){if(_0x1a6bd7){return _0x436960['sendStatus'](_0x47d4e8);}return _0x436960[_0x5da5('0x21')](_0x47d4e8)[_0x5da5('0x22')]();};}function respondWithResult(_0x2dd138,_0x5d983c){_0x5d983c=_0x5d983c||0xc8;return function(_0x31c6ed){if(_0x31c6ed){return _0x2dd138[_0x5da5('0x21')](_0x5d983c)[_0x5da5('0x23')](_0x31c6ed);}};}function respondWithFilteredResult(_0x21e795,_0x55d517){return function(_0x5b0b43){if(_0x5b0b43){var _0x50aadc=typeof _0x55d517[_0x5da5('0x24')]==='undefined'&&typeof _0x55d517['limit']===_0x5da5('0x25');var _0x3974d8=_0x5b0b43['count'];var _0x1798ae=_0x50aadc?0x0:_0x55d517[_0x5da5('0x24')];var _0x558b12=_0x50aadc?_0x5b0b43[_0x5da5('0x26')]:_0x55d517[_0x5da5('0x24')]+_0x55d517[_0x5da5('0x27')];var _0x42292d;if(_0x558b12>=_0x3974d8){_0x558b12=_0x3974d8;_0x42292d=0xc8;}else{_0x42292d=0xce;}_0x21e795[_0x5da5('0x21')](_0x42292d);return _0x21e795['set'](_0x5da5('0x28'),_0x1798ae+'-'+_0x558b12+'/'+_0x3974d8)[_0x5da5('0x23')](_0x5b0b43);}return null;};}function saveUpdates(_0x31cb5f){return function(_0x15a0c0){if(_0x15a0c0){return _0x15a0c0['update'](_0x31cb5f)['then'](function(_0x4cb022){return _0x4cb022;});}return null;};}function removeEntity(_0x245273){return function(_0x27ed41){if(_0x27ed41){return _0x27ed41[_0x5da5('0x29')]()[_0x5da5('0x2a')](function(){_0x245273['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e115){return function(_0x4afb58){if(!_0x4afb58){_0x24e115['sendStatus'](0x194);}return _0x4afb58;};}function handleError(_0x2dd4b6,_0x4c6cce){_0x4c6cce=_0x4c6cce||0x1f4;return function(_0x42dc92){logger[_0x5da5('0x1c')](_0x42dc92[_0x5da5('0x2b')]);if(_0x42dc92[_0x5da5('0x2c')]){delete _0x42dc92[_0x5da5('0x2c')];}_0x2dd4b6[_0x5da5('0x21')](_0x4c6cce)[_0x5da5('0x2d')](_0x42dc92);};}function getMustacheRender(_0x3dc66a,_0x52ce3c){return Mustache[_0x5da5('0x2e')](_0x3dc66a,_['merge'](_0x52ce3c[_0x5da5('0x2f')],{'contact':_0x52ce3c[_0x5da5('0x30')],'message':_0x52ce3c[_0x5da5('0x1e')],'agent':_0x52ce3c[_0x5da5('0x31')],'interaction':_0x52ce3c[_0x5da5('0x32')],'account':_0x52ce3c[_0x5da5('0x33')]}))||'';}function getInteractionUsers(_0x325ccd,_0x117610){return new BPromise(function(_0xf6c5c9,_0x1828e9){try{if(_0x117610[_0x325ccd['id']]){_0x325ccd[_0x5da5('0x34')]=_[_0x5da5('0x35')](_0x117610[_0x325ccd['id']],function(_0x3ba804){return{'id':_0x3ba804['id'],'fullname':_0x3ba804['fullname']};});}}catch(_0x43686c){_0x1828e9(_0x43686c);}_0xf6c5c9(_0x325ccd);});}function getInteractionTags(_0x4cf3ad,_0x2d6280){return new BPromise(function(_0x40f6c6,_0x29d6aa){try{if(_0x4cf3ad[_0x5da5('0x36')]){_0x4cf3ad['Tags']=[];_0x4cf3ad[_0x5da5('0x36')][_0x5da5('0x37')](',')[_0x5da5('0x38')](function(_0x56fd57){_0x4cf3ad[_0x5da5('0x39')][_0x5da5('0x3a')](_0x2d6280[_0x56fd57]);});}delete _0x4cf3ad['TagIds'];}catch(_0x18d00b){_0x29d6aa(_0x18d00b);}_0x40f6c6(_0x4cf3ad);});}function updateChatInteraction(_0xa90d5,_0xe9888e,_0x38a974){return new BPromise(function(_0x2c9b00,_0x664a8d){return getInteractionUsers(_0xa90d5,_0x38a974)['then'](function(_0x1ab02){return getInteractionTags(_0x1ab02,_0xe9888e);})[_0x5da5('0x2a')](function(_0x14c3f5){return getStateInteraction(_0x14c3f5);})[_0x5da5('0x2a')](function(_0x4466b2){_0x2c9b00(_0x4466b2);})['catch'](function(_0x472e9f){_0x664a8d(_0x472e9f);});});}function getStateInteraction(_0x21ffa1){return new BPromise(function(_0x5a189e){_0x21ffa1[_0x5da5('0x3b')]=0x0;_0x21ffa1['talking']=0x0;_0x21ffa1['answered']=0x0;_0x21ffa1[_0x5da5('0x3c')]=0x0;_0x21ffa1[_0x5da5('0x3d')]=0x0;_0x21ffa1[_0x5da5('0x3e')]=0x0;if(!_0x21ffa1[_0x5da5('0x3f')]&&!_0x21ffa1[_0x5da5('0x40')]){_0x21ffa1[_0x5da5('0x3b')]+=0x1;}if(!_0x21ffa1[_0x5da5('0x3f')]&&_0x21ffa1[_0x5da5('0x40')]){_0x21ffa1[_0x5da5('0x41')]+=0x1;if(_0x21ffa1[_0x5da5('0x3b')]){_0x21ffa1[_0x5da5('0x3b')]-=0x1;}}if(_0x21ffa1[_0x5da5('0x3f')]&&_0x21ffa1[_0x5da5('0x42')]===_0x5da5('0x3d')){_0x21ffa1[_0x5da5('0x3d')]+=0x1;if(_0x21ffa1[_0x5da5('0x3b')]){_0x21ffa1[_0x5da5('0x3b')]-=0x1;}}else if(_0x21ffa1[_0x5da5('0x3f')]&&!_0x21ffa1[_0x5da5('0x40')]&&_0x21ffa1[_0x5da5('0x42')]){_0x21ffa1['unmanaged']+=0x1;if(_0x21ffa1['waiting']){_0x21ffa1[_0x5da5('0x3b')]-=0x1;}}else if(_0x21ffa1[_0x5da5('0x3f')]&&_0x21ffa1['UserId']){_0x21ffa1[_0x5da5('0x43')]+=0x1;if(_0x21ffa1[_0x5da5('0x41')]){_0x21ffa1[_0x5da5('0x41')]-=0x1;}}_0x21ffa1[_0x5da5('0x3e')]+=0x1;_0x5a189e(_0x21ffa1);});}exports[_0x5da5('0x44')]=function(_0x207a7c,_0x2775da){var _0x362028={},_0x3cb7a9={},_0x44de08={'count':0x0,'rows':[]};var _0x4fc584=_[_0x5da5('0x35')](db['ChatInteraction']['rawAttributes'],function(_0x2a0fb6){return{'name':_0x2a0fb6[_0x5da5('0x45')],'type':_0x2a0fb6[_0x5da5('0x46')][_0x5da5('0x47')]};});_0x3cb7a9[_0x5da5('0x48')]=_[_0x5da5('0x35')](_0x4fc584,'name');_0x3cb7a9[_0x5da5('0x49')]=_['keys'](_0x207a7c['query']);_0x3cb7a9[_0x5da5('0x4a')]=_[_0x5da5('0x4b')](_0x3cb7a9['model'],_0x3cb7a9[_0x5da5('0x49')]);_0x362028[_0x5da5('0x4c')]=_[_0x5da5('0x4b')](_0x3cb7a9[_0x5da5('0x48')],qs[_0x5da5('0x4d')](_0x207a7c['query'][_0x5da5('0x4d')]));_0x362028['attributes']=_0x362028['attributes'][_0x5da5('0x4e')]?_0x362028['attributes']:_0x3cb7a9[_0x5da5('0x48')];if(!_0x207a7c[_0x5da5('0x49')][_0x5da5('0x4f')](_0x5da5('0x50'))){_0x362028[_0x5da5('0x27')]=qs[_0x5da5('0x27')](_0x207a7c['query']['limit']);_0x362028[_0x5da5('0x24')]=qs[_0x5da5('0x24')](_0x207a7c['query']['offset']);}_0x362028[_0x5da5('0x51')]=qs['sort'](_0x207a7c[_0x5da5('0x49')]['sort']);_0x362028['where']=qs[_0x5da5('0x4a')](_[_0x5da5('0x52')](_0x207a7c[_0x5da5('0x49')],_0x3cb7a9[_0x5da5('0x4a')]),_0x4fc584);var _0x4c654c=[];var _0x267b07=squel[_0x5da5('0x53')]()[_0x5da5('0x54')]('id')['field'](_0x5da5('0x2c'))[_0x5da5('0x54')](_0x5da5('0x55'))[_0x5da5('0x56')](_0x5da5('0x57'));var _0x2e6460=squel[_0x5da5('0x53')]()[_0x5da5('0x54')](_0x5da5('0x58'))[_0x5da5('0x54')](_0x5da5('0x59'))[_0x5da5('0x54')](_0x5da5('0x5a'))[_0x5da5('0x56')](_0x5da5('0x5b'),'ui')[_0x5da5('0x5c')](_0x5da5('0x5d'),'u',_0x5da5('0x5e'));var _0x191691=squel[_0x5da5('0x53')]()[_0x5da5('0x56')]('chat_interactions','i')[_0x5da5('0x5c')](_0x5da5('0x5f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x5da5('0x60'))[_0x5da5('0x5c')](_0x5da5('0x61'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0x5da5('0x62'),'me',_0x5da5('0x63'))[_0x5da5('0x5c')](_0x5da5('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x5da5('0x5c')](_0x5da5('0x57'),'t',_0x5da5('0x65'));var _0x4e4ffa=squel[_0x5da5('0x66')]();var _0x5913b3=[];var _0x107211=squel[_0x5da5('0x66')]();var _0x4f0e51;if(_0x207a7c[_0x5da5('0x49')][_0x5da5('0x67')]){_0x4f0e51=as[_0x5da5('0x68')](_0x207a7c[_0x5da5('0x49')][_0x5da5('0x67')]);var _0x1252b4=_0x4f0e51[_0x5da5('0x69')];for(var _0x2f9f72=0x0;_0x2f9f72<_0x4f0e51[_0x5da5('0x6a')][_0x5da5('0x4e')];_0x2f9f72++){var _0xb3a7a3=_0x4f0e51[_0x5da5('0x6a')][_0x2f9f72];var _0xd7f04d='i';var _0x1a7f01=_[_0x5da5('0x6b')](_0x4fc584,[_0x5da5('0x2c'),_0xb3a7a3[_0x5da5('0x54')]]);if(!_0x1a7f01){switch(_0xb3a7a3[_0x5da5('0x54')]){case'unreadMessages':if(_0xb3a7a3['value']==0x1){_0x191691[_0x5da5('0x6c')]('`'+_0xb3a7a3[_0x5da5('0x54')]+_0x5da5('0x6d'));}else{_0x191691['having']('`'+_0xb3a7a3[_0x5da5('0x54')]+_0x5da5('0x6e'));}break;case _0x5da5('0x6f'):if(_0xb3a7a3[_0x5da5('0x70')]==='$substring'){if(_0xb3a7a3[_0x5da5('0x71')]['split']('\x20')[_0x5da5('0x4e')]>0x1){_0x4e4ffa[_0x1252b4](_0x5da5('0x72'),qs[_0x5da5('0x73')](_0xb3a7a3[_0x5da5('0x71')]),null);}else{var _0x57966d='%'+_0xb3a7a3[_0x5da5('0x71')]+'%';_0x4e4ffa[_0x1252b4](_0x5da5('0x74'),_0x57966d,_0x57966d,_0x57966d);}}else{_0x1a7f01=_['find'](_0x4fc584,['name','ContactId']);_0xb3a7a3[_0x5da5('0x54')]=_0x5da5('0x75');_0x74801a=as[_0x5da5('0x76')](_0xd7f04d,_0x1a7f01[_0x5da5('0x46')],_0xb3a7a3);_0x4e4ffa[_0x1252b4](_0x74801a[_0x5da5('0x77')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x78')],_0x74801a[_0x5da5('0x71')]['end']);}break;case _0x5da5('0x79'):var _0x444b99=_0xb3a7a3['value']['split'](',')[_0x5da5('0x35')](function(_0x5b48e5){return Number(_0x5b48e5);});_0x444b99[_0x5da5('0x38')](function(_0x4f7e64){_0x107211['or'](_0x5da5('0x7a'),'%,'+_0x4f7e64+',%');});_0x5913b3=_[_0x5da5('0x7b')](_0x5913b3,_0x444b99);break;case _0x5da5('0x7c'):if(_0xb3a7a3[_0x5da5('0x70')]===_0x5da5('0x7d')){_0x4e4ffa[_0x1252b4](_0x5da5('0x7e'),'%'+_0xb3a7a3[_0x5da5('0x71')]+'%',null);}else{_0x1a7f01=_[_0x5da5('0x6b')](_0x4fc584,[_0x5da5('0x2c'),_0x5da5('0x40')]);_0xb3a7a3[_0x5da5('0x54')]=_0x5da5('0x40');_0x74801a=as['buildExpression'](_0xd7f04d,_0x1a7f01['type'],_0xb3a7a3);_0x4e4ffa[_0x1252b4](_0x74801a[_0x5da5('0x77')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x78')],_0x74801a[_0x5da5('0x71')]['end']);}break;case'body':_0x74801a=as['buildExpression']('me',null,_0xb3a7a3);_0x4e4ffa[_0x1252b4](_0x74801a[_0x5da5('0x77')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x78')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x22')]);break;}}else{var _0x74801a=as[_0x5da5('0x76')](_0xd7f04d,_0x1a7f01[_0x5da5('0x46')],_0xb3a7a3);_0x4e4ffa[_0x1252b4](_0x74801a[_0x5da5('0x77')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x78')],_0x74801a[_0x5da5('0x71')][_0x5da5('0x22')]);}}}else{var _0x3852bf=_(_0x207a7c[_0x5da5('0x49')])[_0x5da5('0x7f')]()[_0x5da5('0x35')](function(_0x242ca9){return _[_0x5da5('0x80')](_0x4fc584,[_0x5da5('0x2c'),_0x242ca9])?_0x242ca9:undefined;})[_0x5da5('0x81')]()['value']();if(!_[_0x5da5('0x82')](_0x3852bf)){_0x3852bf[_0x5da5('0x38')](function(_0x3fc27e){if(_0x3fc27e===_0x5da5('0x83')){_0x191691['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x5da5('0x84')](_0x207a7c['query'][_0x3fc27e]));}else if(_0x3fc27e===_0x5da5('0x85')){var _0x2b2856=JSON[_0x5da5('0x86')](_0x207a7c[_0x5da5('0x49')][_0x3fc27e])[_0x5da5('0x87')];var _0x3b0282=JSON[_0x5da5('0x86')](_0x207a7c[_0x5da5('0x49')][_0x3fc27e])[_0x5da5('0x88')];_0x191691['where'](_0x5da5('0x89'),_0x2b2856,_0x3b0282);}else{if(_0x207a7c['query'][_0x3fc27e]===_0x5da5('0x8a')){_0x191691[_0x5da5('0x8b')]('i.'+_0x3fc27e+'\x20IS\x20NULL');}else{_0x191691[_0x5da5('0x8b')]('i.'+_0x3fc27e+'\x20=\x20?',_0x207a7c[_0x5da5('0x49')][_0x3fc27e]);}}});}if(_0x207a7c['query'][_0x5da5('0x8c')]){if(_0x207a7c[_0x5da5('0x49')][_0x5da5('0x8c')]==0x1){_0x191691[_0x5da5('0x6c')](_0x5da5('0x8d'));}else{_0x191691[_0x5da5('0x6c')](_0x5da5('0x8e'));}}if(_0x207a7c[_0x5da5('0x49')][_0x5da5('0x8f')]){_0x5913b3=_['isArray'](_0x207a7c[_0x5da5('0x49')][_0x5da5('0x8f')])?_0x207a7c['query']['tag']:new Array(_0x207a7c[_0x5da5('0x49')][_0x5da5('0x8f')]);_0x5913b3[_0x5da5('0x38')](function(_0xcc15e9){_0x107211['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xcc15e9+',%');});}if(_0x207a7c[_0x5da5('0x49')]['filter']){var _0x26aa9f=_0x207a7c['query']['filter'][_0x5da5('0x90')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x26aa9f)){_0x4e4ffa['or'](_0x5da5('0x91'),_0x26aa9f+'%');}else{_0x4e4ffa['or'](_0x5da5('0x92'),qs[_0x5da5('0x73')](_0x26aa9f))['or'](_0x5da5('0x93'),_0x26aa9f+'%');}}}_0x191691[_0x5da5('0x8b')](_0x4e4ffa);_0x191691[_0x5da5('0x94')](_0x5da5('0x95'));var _0x2bdcc1={'type':db['Sequelize'][_0x5da5('0x96')][_0x5da5('0x97')],'raw':!![]};var _0x3fb2e9=_0x191691[_0x5da5('0x98')]();_0x3fb2e9[_0x5da5('0x54')](_0x5da5('0x95'));_0x3fb2e9[_0x5da5('0x54')](_0x5da5('0x99'),_0x5da5('0x9a'));if(_0x362028[_0x5da5('0x51')]){_0x362028[_0x5da5('0x51')][_0x5da5('0x38')](function(_0x104ae6){var _0xed45a1=_0x104ae6[0x0]===_0x5da5('0x9b')?_0x104ae6[0x0]:'i.'+_0x104ae6[0x0];_0x191691[_0x5da5('0x51')](_0xed45a1,_0x104ae6[0x1]===_0x5da5('0x9c')?![]:!![]);});}if(!_[_0x5da5('0x82')](_0x5913b3)){_0x191691[_0x5da5('0x6c')](_0x107211);_0x3fb2e9[_0x5da5('0x8b')](_0x5da5('0x9d'),_0x5913b3);}BPromise[_0x5da5('0x9e')]()[_0x5da5('0x2a')](function(){if(!_0x4f0e51){if(_0x207a7c[_0x5da5('0x49')]['ChatWebsiteId'])return;_0x3fb2e9[_0x5da5('0x8b')](_0x5da5('0x9f'));_0x191691['where'](_0x5da5('0x9f'));return;}if(_0x207a7c['user'][_0x5da5('0xa0')]!==_0x5da5('0x31'))return;return _0x207a7c[_0x5da5('0xa1')][_0x5da5('0xa2')]({'attributes':['id'],'raw':!![]})[_0x5da5('0x2a')](function(_0x16ceeb){if(_['isEmpty'](_0x16ceeb)){_0x3fb2e9[_0x5da5('0x8b')](_0x5da5('0xa3'));_0x191691['where'](_0x5da5('0xa3'));}else{_0x3fb2e9[_0x5da5('0x8b')]('i.ChatWebsiteId\x20IN\x20?',_[_0x5da5('0x35')](_0x16ceeb,'id'));_0x191691[_0x5da5('0x8b')](_0x5da5('0xa4'),_[_0x5da5('0x35')](_0x16ceeb,'id'));}});})[_0x5da5('0x2a')](function(){if(_0x207a7c[_0x5da5('0xa1')][_0x5da5('0xa0')]===_0x5da5('0x31')&&!_0x4f0e51&&!_0x207a7c[_0x5da5('0x49')][_0x5da5('0x83')])return[];return db['sequelize'][_0x5da5('0x49')](_0x3fb2e9[_0x5da5('0xa5')](),_0x2bdcc1);})[_0x5da5('0x2a')](function(_0x23c2a7){_0x44de08[_0x5da5('0x26')]=_0x23c2a7[_0x5da5('0x4e')];if(_0x44de08[_0x5da5('0x26')]===0x0)return[];return db['sequelize']['query'](_0x267b07[_0x5da5('0xa5')](),_0x2bdcc1)['then'](function(_0x5c8ec0){_0x4c654c=_[_0x5da5('0xa6')](_0x5c8ec0,'id');_0x2bdcc1=_['merge'](_0x2bdcc1,{'model':db[_0x5da5('0xa7')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x207a7c['query'][_0x5da5('0x4d')]){_0x362028[_0x5da5('0x4c')][_0x5da5('0x38')](function(_0x3b834f){_0x191691['field']('i.'+_0x3b834f);});}else{_0x191691[_0x5da5('0x54')](_0x5da5('0x99'),_0x5da5('0x9a'));_0x191691[_0x5da5('0x54')](_0x5da5('0xa8'),_0x5da5('0xa9'));_0x191691[_0x5da5('0x54')](_0x5da5('0xaa'),'Account.mandatoryDisposition');_0x191691[_0x5da5('0x54')](_0x5da5('0xab'),'contactName');_0x191691[_0x5da5('0x54')](_0x5da5('0xac'));_0x191691[_0x5da5('0x54')](_0x5da5('0xad'),'Contact.firstName');_0x191691['field'](_0x5da5('0xae'),_0x5da5('0xaf'));_0x191691[_0x5da5('0x54')](_0x5da5('0xb0'),_0x5da5('0xb1'));_0x191691['field'](_0x5da5('0xb2'),_0x5da5('0xb3'));_0x191691[_0x5da5('0x54')](_0x5da5('0xb4'),_0x5da5('0xb5'));_0x191691[_0x5da5('0x54')](_0x5da5('0xb6'),_0x5da5('0xb7'));_0x191691[_0x5da5('0x54')](_0x5da5('0xb8'),_0x5da5('0xb9'));_0x191691[_0x5da5('0x54')](_0x5da5('0xba'),_0x5da5('0xbb'));_0x191691[_0x5da5('0x54')](_0x5da5('0xbc'),_0x5da5('0x36'));}if(_0x362028[_0x5da5('0x27')])_0x191691[_0x5da5('0x27')](_0x362028['limit']);if(_0x362028[_0x5da5('0x24')])_0x191691['offset'](_0x362028[_0x5da5('0x24')]);return db[_0x5da5('0xbd')][_0x5da5('0x49')](_0x191691[_0x5da5('0xa5')](),_0x2bdcc1);})[_0x5da5('0x2a')](function(_0x5b1a72){if(_0x5b1a72[_0x5da5('0x4e')]>0x0)_0x2e6460[_0x5da5('0x8b')]('ui.ChatInteractionId\x20IN\x20?',_['map'](_0x5b1a72,'id'));return db[_0x5da5('0xbd')]['query'](_0x2e6460[_0x5da5('0xa5')](),_0x2bdcc1)[_0x5da5('0x2a')](function(_0x1782a6){var _0x1b555f=_[_0x5da5('0xbe')](_0x1782a6,_0x5da5('0xbf'));var _0x341587=[];_0x5b1a72['forEach'](function(_0x57b6e4){_0x341587['push'](updateChatInteraction(_0x57b6e4,_0x4c654c,_0x1b555f));});return BPromise[_0x5da5('0xc0')](_0x341587);});});})[_0x5da5('0x2a')](function(_0x101cdc){_0x44de08['rows']=_0x101cdc;return _0x44de08;})[_0x5da5('0x2a')](respondWithFilteredResult(_0x2775da,_0x362028))[_0x5da5('0x20')](handleError(_0x2775da,null));};exports[_0x5da5('0xc1')]=function(_0xbe0ade,_0x3d6503){var _0xd56fa3={'raw':![],'where':{'id':_0xbe0ade[_0x5da5('0xc2')]['id']}},_0x51a597={};_0x51a597[_0x5da5('0x48')]=_[_0x5da5('0x7f')](db['ChatInteraction']['rawAttributes']);_0x51a597[_0x5da5('0x49')]=_[_0x5da5('0x7f')](_0xbe0ade['query']);_0x51a597[_0x5da5('0x4a')]=_[_0x5da5('0x4b')](_0x51a597['model'],_0x51a597[_0x5da5('0x49')]);_0xd56fa3['attributes']=_['intersection'](_0x51a597[_0x5da5('0x48')],qs['fields'](_0xbe0ade[_0x5da5('0x49')]['fields']));_0xd56fa3[_0x5da5('0x4c')]=_0xd56fa3[_0x5da5('0x4c')]['length']?_0xd56fa3[_0x5da5('0x4c')]:_0x51a597[_0x5da5('0x48')];if(_0xbe0ade[_0x5da5('0x49')][_0x5da5('0xc3')]){_0xd56fa3['include']=[{'all':!![]}];}_0xd56fa3=_['merge']({},_0xd56fa3,_0xbe0ade[_0x5da5('0xc4')]);return db[_0x5da5('0xa7')][_0x5da5('0x6b')](_0xd56fa3)[_0x5da5('0x2a')](handleEntityNotFound(_0x3d6503,null))[_0x5da5('0x2a')](respondWithResult(_0x3d6503,null))[_0x5da5('0x20')](handleError(_0x3d6503,null));};exports['create']=function(_0x2ddbcb,_0x314e83){return db[_0x5da5('0xa7')][_0x5da5('0xc5')](_0x2ddbcb['body'],{})['then'](respondWithResult(_0x314e83,0xc9))[_0x5da5('0x20')](handleError(_0x314e83,null));};exports[_0x5da5('0xc6')]=function(_0x44a307,_0x51cd21){if(_0x44a307['body']['id']){delete _0x44a307[_0x5da5('0x2f')]['id'];}return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x44a307[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x51cd21,null))['then'](saveUpdates(_0x44a307['body'],null))[_0x5da5('0x2a')](respondWithResult(_0x51cd21,null))['catch'](handleError(_0x51cd21,null));};exports[_0x5da5('0x29')]=function(_0x449379,_0x24c565){return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x449379[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x24c565,null))[_0x5da5('0x2a')](removeEntity(_0x24c565,null))[_0x5da5('0x20')](handleError(_0x24c565,null));};exports[_0x5da5('0xc7')]=function(_0x2212b1,_0x401cad){return db['ChatInteraction'][_0x5da5('0xc7')]()[_0x5da5('0x2a')](respondWithResult(_0x401cad,null))['catch'](handleError(_0x401cad,null));};exports[_0x5da5('0xc8')]=function(_0x15ccd3,_0x1971c2){var _0x3385eb=_0x15ccd3[_0x5da5('0xc2')]['id'];var _0xe36532;var _0x3568ee;var _0x2daf1d;return db[_0x5da5('0xa7')][_0x5da5('0xc9')]({'where':{'id':_0x3385eb}})['then'](function(_0x3514b3){_0xe36532=_0x3514b3;return db[_0x5da5('0xca')][_0x5da5('0xc9')]({'where':{'id':_0x3514b3['ChatWebsiteId']},'attributes':['id',_0x5da5('0xcb'),'vidaooEscalation','vidaooTopic','vidaooNote',_0x5da5('0xcc')],'raw':!![]});})[_0x5da5('0x2a')](function(_0x1f06ad){if(_0x1f06ad&&_0x1f06ad[_0x5da5('0xcb')]&&_0x1f06ad['vidaooEscalation']){_0x3568ee=_0x1f06ad;var _0x2e341c={'interaction':{'id':_0x3385eb},'agent':{'id':_0x15ccd3[_0x5da5('0xa1')]['id'],'name':_0x15ccd3[_0x5da5('0xa1')][_0x5da5('0x2c')],'fullname':_0x15ccd3[_0x5da5('0xa1')][_0x5da5('0xcd')],'email':_0x15ccd3[_0x5da5('0xa1')]['email']},'contact':_0x15ccd3[_0x5da5('0x2f')][_0x5da5('0x30')],'account':_0x15ccd3[_0x5da5('0x2f')][_0x5da5('0x33')]};var _0x5d85ff={'rejectUnauthorized':![],'method':_0x5da5('0xce'),'url':_0x5da5('0xcf'),'headers':{'X-APIKEY':_0x1f06ad['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x15ccd3[_0x5da5('0xa1')][_0x5da5('0xd0')]],'buttons':null,'topic':_0x3568ee[_0x5da5('0xd1')],'note':_[_0x5da5('0xd2')](_0x3568ee['vidaooNote'])?null:getMustacheRender(_0x3568ee['vidaooNote'],_0x2e341c),'metadata':null},'redirect':_0x5da5('0xd3'),'json':!![]};try{if(!_[_0x5da5('0xd2')](_0x3568ee[_0x5da5('0xcc')])){var _0x513dc5=getMustacheRender(_0x3568ee[_0x5da5('0xcc')],_0x2e341c);var _0x555728=JSON['parse'](_0x513dc5);_0x5d85ff[_0x5da5('0x2f')][_0x5da5('0xd4')]=_0x555728;}}catch(_0x2623e4){throw new db['Sequelize'][(_0x5da5('0xd5'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5d85ff);}else{throw new db['Sequelize'][(_0x5da5('0xd5'))](_0x5da5('0xd6'));}})[_0x5da5('0x2a')](function(_0x5a1bf4){_0x2daf1d=_0x5a1bf4;if(_0x2daf1d['id']){var _0x50d000={'body':_0x2daf1d[_0x5da5('0xd7')],'ChatWebsiteId':_0x3568ee['id'],'ChatInteractionId':_0xe36532['id'],'direction':_0x5da5('0xd8'),'UserId':_0x15ccd3['user']['id']};return db['ChatMessage'][_0x5da5('0xc5')](_0x50d000,{});}else{throw new db['Sequelize'][(_0x5da5('0xd5'))](_0x5da5('0xd9'));}})[_0x5da5('0x2a')](function(){return _0xe36532[_0x5da5('0xda')]({'vidaooSessionId':_0x2daf1d['id']});})[_0x5da5('0x2a')](respondWithResult(_0x1971c2,null))[_0x5da5('0x20')](handleError(_0x1971c2,null));};exports[_0x5da5('0xdb')]=function(_0x17c226,_0x41e33d){if(_0x17c226[_0x5da5('0x2f')]['id']){delete _0x17c226[_0x5da5('0x2f')]['id'];}return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x17c226[_0x5da5('0xc2')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x5da5('0x2a')](handleEntityNotFound(_0x41e33d,null))[_0x5da5('0x2a')](saveUpdates(_0x17c226[_0x5da5('0x2f')],null))[_0x5da5('0x2a')](respondWithResult(_0x41e33d,null))[_0x5da5('0x20')](handleError(_0x41e33d,null));};exports['abandon']=function(_0x165bc8,_0x21c4f6){if(_0x165bc8[_0x5da5('0x2f')]['id']){delete _0x165bc8['body']['id'];}return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x165bc8[_0x5da5('0xc2')]['id']}})[_0x5da5('0x2a')](function(_0x303676){if(!_0x303676){logger[_0x5da5('0x1c')](_0x5da5('0xdc'),_0x5da5('0xdd'),0x194,_0x5da5('0xde'));_0x21c4f6[_0x5da5('0xdf')](0x194);}else{if(_0x303676[_0x5da5('0x40')]){throw new db['Sequelize'][(_0x5da5('0xd5'))](_0x5da5('0xe0'));}}return _0x303676;})[_0x5da5('0x2a')](function(_0x4baa4b){if(_0x4baa4b){return _0x4baa4b[_0x5da5('0xc6')]({'closed':_0x165bc8['body'][_0x5da5('0x3f')],'disposition':_0x165bc8[_0x5da5('0x2f')][_0x5da5('0x42')]})['then'](function(_0x562291){return _0x562291;});}})[_0x5da5('0x2a')](function(){return respondWithRpcPromise(_0x5da5('0xe1'),_0x5da5('0xdd'),_0x165bc8[_0x5da5('0x2f')],client9004);})[_0x5da5('0x2a')](respondWithResult(_0x21c4f6,null))[_0x5da5('0x20')](handleError(_0x21c4f6,null));};exports['attachmentUpload']=function(_0x222950,_0x596940){_0x222950[_0x5da5('0x2f')][_0x5da5('0x2c')]=_0x222950[_0x5da5('0xe2')]['originalname'];_0x222950['body'][_0x5da5('0xe3')]=_0x222950[_0x5da5('0xe2')][_0x5da5('0xe4')];_0x222950[_0x5da5('0x2f')][_0x5da5('0x46')]=_0x222950['file']['mimetype'];return db[_0x5da5('0xe5')]['create'](_0x222950[_0x5da5('0x2f')])[_0x5da5('0x2a')](respondWithResult(_0x596940,0xc9))[_0x5da5('0x20')](handleError(_0x596940,null));};exports[_0x5da5('0xe6')]=function(_0x340b1d,_0x22c12d){return db[_0x5da5('0xa7')]['findOne']({'where':{'id':_0x340b1d[_0x5da5('0xc2')]['id']},'raw':!![]})[_0x5da5('0x2a')](handleEntityNotFound(_0x22c12d,null))[_0x5da5('0x2a')](function(_0x416760){if(_0x416760){if(_0x416760[_0x5da5('0x3f')]){return _0x22c12d['status'](0x193)[_0x5da5('0x23')]({'status':0x193,'message':_0x5da5('0xe7')});}return db[_0x5da5('0xe5')][_0x5da5('0xc9')]({'where':{'id':_0x340b1d[_0x5da5('0x49')]['attachId']},'raw':!![]})[_0x5da5('0x2a')](handleEntityNotFound(_0x22c12d,null));}})[_0x5da5('0x2a')](function(_0x4f32d7){if(_0x4f32d7){var _0x484c7f=_0x4f32d7['ChatOfflineMessageId']!==null;var _0x15c938=path[_0x5da5('0xe8')](config[_0x5da5('0xe9')],'server/files/attachments/');if(_0x484c7f){_0x15c938=path[_0x5da5('0xe8')](_0x15c938,_0x5da5('0xea'));}var _0x480b1e=path[_0x5da5('0xe8')](_0x15c938,_0x4f32d7[_0x5da5('0xe3')]);return _0x22c12d[_0x5da5('0xeb')](_0x480b1e);}})[_0x5da5('0x20')](handleError(_0x22c12d,null));};exports['close']=function(_0x22413b,_0x5e6bb4){var _0x1cce33=null;var _0x2199f2=null;var _0x563113=null;if(_0x22413b[_0x5da5('0x2f')]['id']){delete _0x22413b[_0x5da5('0x2f')]['id'];}if(_0x22413b[_0x5da5('0x2f')][_0x5da5('0xec')]){_0x563113=path[_0x5da5('0xe8')](config[_0x5da5('0xe9')],_0x5da5('0xed'),util[_0x5da5('0xee')](_0x5da5('0xef'),Date[_0x5da5('0xf0')]()));_0x22413b[_0x5da5('0x2f')][_0x5da5('0xf1')]=_0x563113;}return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x22413b[_0x5da5('0xc2')]['id']},'include':[{'model':db[_0x5da5('0xf2')],'as':_0x5da5('0xf3'),'include':[{'model':db[_0x5da5('0x7c')],'as':_0x5da5('0x7c')}]}]})[_0x5da5('0x2a')](handleEntityNotFound(_0x5e6bb4,null))[_0x5da5('0x2a')](saveUpdates(_0x22413b[_0x5da5('0x2f')],null))[_0x5da5('0x2a')](function(_0x35b7e8){if(_0x35b7e8){_0x1cce33=_0x35b7e8;return db[_0x5da5('0xca')][_0x5da5('0x6b')]({'where':{'id':_0x1cce33[_0x5da5('0x83')]}});}})[_0x5da5('0x2a')](function(_0xafe658){if(_0xafe658){_0x2199f2=_0xafe658;return db[_0x5da5('0xf4')][_0x5da5('0x6b')]({'where':{'id':_0x1cce33[_0x5da5('0x75')]}});}})[_0x5da5('0x2a')](function(_0x2ab9ba){if(_0x2ab9ba){if(_0x563113){var _0x423431=null;for(var _0x231009=0x1;_0x231009<_0x1cce33[_0x5da5('0xf3')][_0x5da5('0x4e')];++_0x231009){_0x423431=_0x1cce33[_0x5da5('0xf3')][_0x231009];var _0x3453ce=_0x423431['UserId']?util['format'](_0x5da5('0xf5'),_0x2199f2[_0x5da5('0xf6')],_0x423431['UserId']):'System';var _0xd36fe0=_0x22413b[_0x5da5('0x2f')][_0x5da5('0xf7')]||util[_0x5da5('0xee')](_0x5da5('0xf5'),_0x5da5('0xf8'),_0x423431[_0x5da5('0x75')]);switch(_0x2199f2['agentIdentifier']){case _0x5da5('0xf9'):_0x3453ce=_0x423431[_0x5da5('0x40')]?util[_0x5da5('0xee')](_0x5da5('0xf5'),_0x2199f2[_0x5da5('0xf6')],_0x423431['UserId']):'System';break;case _0x5da5('0xfa'):_0x3453ce=_0x423431[_0x5da5('0x40')]?_0x423431['User']['alias']||_0x423431[_0x5da5('0x7c')][_0x5da5('0xcd')]:_0x5da5('0xfb');break;case'agent_fullname':_0x3453ce=_0x423431[_0x5da5('0x40')]?_0x423431[_0x5da5('0x7c')]['fullname']:'System';break;default:_0x3453ce=_0x423431[_0x5da5('0x40')]?util[_0x5da5('0xee')](_0x5da5('0xf5'),_0x2199f2[_0x5da5('0xf6')],_0x423431[_0x5da5('0x40')]):_0x5da5('0xfb');}var _0x3a5453=util['format'](_0x5da5('0xfc'),moment(_0x423431['createdAt'])[_0x5da5('0xee')](_0x5da5('0xfd')),_0x423431[_0x5da5('0xfe')]==='in'?_0xd36fe0:_0x3453ce,_0x423431[_0x5da5('0x2f')]);if(!_0x423431[_0x5da5('0xff')]){fs[_0x5da5('0x100')](_0x563113,_0x3a5453);}}return db[_0x5da5('0x101')][_0x5da5('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x5da5('0x102')],'as':_0x5da5('0x103'),'raw':!![],'include':[{'model':db[_0x5da5('0x104')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x5da5('0x2a')](function(_0x268871){if(!_0x268871||!_0x268871[_0x5da5('0x103')]||!_0x22413b['body'])return _0x1cce33;var _0x118647=_0x268871[_0x5da5('0x105')]();return respondWithRpcPromise(_0x5da5('0x106'),_0x5da5('0x107'),{'account':_0x118647,'message':{'from':util[_0x5da5('0xee')](_0x5da5('0x108'),_0x268871[_0x5da5('0x2c')],_0x268871['email']||_0x268871['Smtp'][_0x5da5('0xa1')]),'to':_0x22413b[_0x5da5('0x2f')][_0x5da5('0xec')],'subject':_0x5da5('0x109'),'text':util['format'](_0x5da5('0x10a'),_0x22413b[_0x5da5('0x2f')]['mailTranscript']),'attachments':[{'path':_0x563113}]}})[_0x5da5('0x2a')](function(){return _0x1cce33;})[_0x5da5('0x20')](function(_0xcfa153){logger['error'](_0xcfa153);});})[_0x5da5('0x2a')](respondWithStatusCode(_0x5e6bb4,0xc8))[_0x5da5('0x20')](handleError(_0x5e6bb4,null));};exports['addMessage']=function(_0x2143f0,_0x245338){return db[_0x5da5('0xf2')][_0x5da5('0x6b')]({'where':{'id':_0x2143f0[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x245338,null))[_0x5da5('0x2a')](function(_0x255556){if(_0x255556){return _0x255556[_0x5da5('0x10b')](_0x2143f0[_0x5da5('0x2f')][_0x5da5('0x10c')],_[_0x5da5('0x10d')](_0x2143f0[_0x5da5('0x2f')],['ids','id'])||{});}})['then'](respondWithResult(_0x245338,null))['catch'](handleError(_0x245338,null));};exports[_0x5da5('0x10e')]=function(_0xf685e2,_0x53f7d1){var _0x3c532e={'raw':![],'where':{}};var _0x5ab150={};var _0x58ef45={'count':0x0,'rows':[]};return db[_0x5da5('0xa7')]['findOne']({'where':{'id':_0xf685e2[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x53f7d1,null))[_0x5da5('0x2a')](function(_0x1da022){if(_0x1da022){_0x5ab150['model']=_[_0x5da5('0x7f')](db[_0x5da5('0xf2')][_0x5da5('0x10f')]);_0x5ab150[_0x5da5('0x49')]=_[_0x5da5('0x7f')](_0xf685e2[_0x5da5('0x49')]);_0x5ab150['filters']=_['intersection'](_0x5ab150[_0x5da5('0x48')],_0x5ab150[_0x5da5('0x49')]);_0x3c532e['attributes']=_[_0x5da5('0x4b')](_0x5ab150[_0x5da5('0x48')],qs[_0x5da5('0x4d')](_0xf685e2['query']['fields']));_0x3c532e['attributes']=_0x3c532e[_0x5da5('0x4c')][_0x5da5('0x4e')]?_0x3c532e[_0x5da5('0x4c')]:_0x5ab150[_0x5da5('0x48')];if(!_0xf685e2['query'][_0x5da5('0x4f')](_0x5da5('0x50'))){_0x3c532e[_0x5da5('0x27')]=qs[_0x5da5('0x27')](_0xf685e2['query']['limit']);_0x3c532e[_0x5da5('0x24')]=qs[_0x5da5('0x24')](_0xf685e2[_0x5da5('0x49')]['offset']);}_0x3c532e[_0x5da5('0x51')]=qs[_0x5da5('0x110')](_0xf685e2['query']['sort']);_0x3c532e[_0x5da5('0x8b')]=qs['filters'](_[_0x5da5('0x52')](_0xf685e2[_0x5da5('0x49')],_0x5ab150[_0x5da5('0x4a')]));_0x3c532e[_0x5da5('0x8b')]['ChatInteractionId']=_0x1da022['id'];if(_0xf685e2['query'][_0x5da5('0x111')]){_0x3c532e[_0x5da5('0x8b')]=_[_0x5da5('0x112')](_0x3c532e[_0x5da5('0x8b')],{'$or':_[_0x5da5('0x35')](_0x3c532e[_0x5da5('0x4c')],function(_0x5e81d){var _0x41cd89={};_0x41cd89[_0x5e81d]={'$like':'%'+_0xf685e2['query'][_0x5da5('0x111')]+'%'};return _0x41cd89;})});}if(_0xf685e2[_0x5da5('0x49')]['$gte']){var _0x4b0dcd=_0xf685e2[_0x5da5('0x49')][_0x5da5('0x87')]['split'](',');var _0x663647={};_0x663647[_0x4b0dcd[0x0]]={'$gte':moment(_0x4b0dcd[0x1])[_0x5da5('0xee')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3c532e[_0x5da5('0x8b')]=_['merge'](_0x3c532e[_0x5da5('0x8b')],_0x663647);}_0x3c532e=_[_0x5da5('0x112')]({},_0x3c532e,_0xf685e2[_0x5da5('0xc4')]);return db[_0x5da5('0xf2')]['count']({'where':_0x3c532e[_0x5da5('0x8b')]})[_0x5da5('0x2a')](function(_0x2226d4){_0x58ef45[_0x5da5('0x26')]=_0x2226d4;if(_0xf685e2['query'][_0x5da5('0xc3')]){_0x3c532e[_0x5da5('0x113')]=[{'all':!![]}];}return db['ChatMessage'][_0x5da5('0x114')](_0x3c532e);})[_0x5da5('0x2a')](function(_0x3c2680){_0x58ef45[_0x5da5('0x115')]=_0x3c2680;return _0x58ef45;});}})[_0x5da5('0x2a')](respondWithFilteredResult(_0x53f7d1,_0x3c532e))[_0x5da5('0x20')](handleError(_0x53f7d1,null));};exports[_0x5da5('0x116')]=function(_0x455bf5,_0x3215b8){var _0x93fc22={'where':{}},_0x29a452={},_0xc0ad3b={'count':0x0,'rows':[]};return db[_0x5da5('0xa7')]['findOne']({'where':{'id':_0x455bf5['params']['id']}})['then'](handleEntityNotFound(_0x3215b8,null))['then'](function(_0x2075f8){if(_0x2075f8){_0x29a452[_0x5da5('0x48')]=_['keys'](db['ChatMessage'][_0x5da5('0x10f')]);_0x29a452['query']=_[_0x5da5('0x7f')](_0x455bf5[_0x5da5('0x49')]);_0x29a452['filters']=_[_0x5da5('0x4b')](_0x29a452['model'],_0x29a452[_0x5da5('0x49')]);_0x93fc22[_0x5da5('0x4c')]=_[_0x5da5('0x4b')](_0x29a452['model'],qs['fields'](_0x455bf5[_0x5da5('0x49')][_0x5da5('0x4d')]));_0x93fc22[_0x5da5('0x4c')]=_0x93fc22[_0x5da5('0x4c')][_0x5da5('0x4e')]?_0x93fc22[_0x5da5('0x4c')]:_0x29a452[_0x5da5('0x48')];if(!_0x455bf5[_0x5da5('0x49')][_0x5da5('0x4f')](_0x5da5('0x50'))){_0x93fc22['limit']=qs[_0x5da5('0x27')](_0x455bf5[_0x5da5('0x49')][_0x5da5('0x27')]);_0x93fc22['offset']=qs[_0x5da5('0x24')](_0x455bf5[_0x5da5('0x49')]['offset']);}_0x93fc22[_0x5da5('0x51')]=qs['sort'](_0x455bf5[_0x5da5('0x49')][_0x5da5('0x110')]);_0x93fc22[_0x5da5('0x8b')]=qs[_0x5da5('0x4a')](_[_0x5da5('0x52')](_0x455bf5[_0x5da5('0x49')],_0x29a452['filters']));_0x93fc22['where'][_0x5da5('0xbf')]=_0x2075f8['id'];if(_0x455bf5[_0x5da5('0x49')]['filter']){_0x93fc22[_0x5da5('0x8b')]=_[_0x5da5('0x112')](_0x93fc22[_0x5da5('0x8b')],{'$or':_['map'](_0x93fc22[_0x5da5('0x4c')],function(_0x5b20d9){var _0x54df1a={};_0x54df1a[_0x5b20d9]={'$like':'%'+_0x455bf5[_0x5da5('0x49')][_0x5da5('0x111')]+'%'};return _0x54df1a;})});}_0x93fc22['where'][_0x5da5('0xff')]=![];if(_0x455bf5['query']['id']){_0x93fc22[_0x5da5('0x8b')]['id']={'$gt':_0x455bf5[_0x5da5('0x49')]['id']};}_0x93fc22=_[_0x5da5('0x112')]({},_0x93fc22,_0x455bf5[_0x5da5('0xc4')]);return db['ChatMessage'][_0x5da5('0x26')]({'where':_0x93fc22[_0x5da5('0x8b')]})[_0x5da5('0x2a')](function(_0x70f31d){_0xc0ad3b[_0x5da5('0x26')]=_0x70f31d;_0x93fc22['include']=[];if(_0x455bf5[_0x5da5('0x49')][_0x5da5('0x117')]){_0x93fc22[_0x5da5('0x113')][_0x5da5('0x3a')]({'model':db[_0x5da5('0x7c')],'as':'User','attributes':['id',_0x5da5('0xcd'),'alias']});}if(_0x455bf5['query'][_0x5da5('0xc3')]){_0x93fc22['include']=[{'all':!![]}];}return db[_0x5da5('0xf2')][_0x5da5('0x114')](_0x93fc22);})[_0x5da5('0x2a')](function(_0x21d019){_0xc0ad3b[_0x5da5('0x115')]=_0x21d019;return _0xc0ad3b;});}})[_0x5da5('0x2a')](respondWithFilteredResult(_0x3215b8,_0x93fc22))[_0x5da5('0x20')](handleError(_0x3215b8,null));};exports[_0x5da5('0x118')]=function(_0x199ab0,_0x38f596){return db[_0x5da5('0xa7')][_0x5da5('0x6b')]({'where':{'id':_0x199ab0[_0x5da5('0xc2')]['id']}})['then'](handleEntityNotFound(_0x38f596,null))['then'](function(_0x5f4410){if(_0x5f4410){return _0x5f4410[_0x5da5('0x119')](_0x199ab0[_0x5da5('0x2f')][_0x5da5('0x10c')],_[_0x5da5('0x10d')](_0x199ab0[_0x5da5('0x2f')],['ids','id'])||{})[_0x5da5('0x11a')](function(){return db[_0x5da5('0x79')][_0x5da5('0x114')]({'attributes':['id',_0x5da5('0x2c'),_0x5da5('0x55')],'where':{'id':_0x199ab0['body'][_0x5da5('0x10c')]}});})[_0x5da5('0x2a')](function(_0xb897d){socket[_0x5da5('0x11b')]('chatInteractionTags:save',{'id':Number(_0x199ab0[_0x5da5('0xc2')]['id']),'tags':_0xb897d||[]});return{'id':Number(_0x199ab0[_0x5da5('0xc2')]['id']),'tags':_0xb897d||[]};});}})[_0x5da5('0x2a')](respondWithResult(_0x38f596,null))[_0x5da5('0x20')](handleError(_0x38f596,null));};exports['removeTags']=function(_0x2fd629,_0x3213c8){return db['ChatInteraction'][_0x5da5('0x6b')]({'where':{'id':_0x2fd629[_0x5da5('0xc2')]['id']}})[_0x5da5('0x2a')](handleEntityNotFound(_0x3213c8,null))[_0x5da5('0x2a')](function(_0x58fe7d){if(_0x58fe7d){return _0x58fe7d[_0x5da5('0x11c')](_0x2fd629[_0x5da5('0x49')][_0x5da5('0x10c')]);}})[_0x5da5('0x2a')](respondWithStatusCode(_0x3213c8,null))[_0x5da5('0x20')](handleError(_0x3213c8,null));};exports[_0x5da5('0xeb')]=function(_0x10e296,_0x3a6962){var _0xe1a9c2=moment()[_0x5da5('0x11d')]()[_0x5da5('0xa5')]();var _0x13950f=path[_0x5da5('0xe8')](config['root'],_0x5da5('0x11e'),_0x5da5('0x11f'),_0x5da5('0x120'));var _0x1800d0=path[_0x5da5('0xe8')](config[_0x5da5('0xe9')],_0x5da5('0x11e'),_0x5da5('0x11f'),_0x5da5('0x121'));var _0x454639=path[_0x5da5('0xe8')](_0x13950f,_0xe1a9c2);var _0x1cddaf=util[_0x5da5('0xee')](_0x5da5('0x122'),_0x10e296[_0x5da5('0xc2')]['id'],_0xe1a9c2);var _0x11394e=path[_0x5da5('0xe8')](_0x13950f,_0x1cddaf);var _0x4413c3=[];_0x4413c3[_0x5da5('0x3a')]({'model':db[_0x5da5('0x7c')],'as':_0x5da5('0x7c'),'attributes':['id',_0x5da5('0xcd')],'raw':!![]});_0x4413c3[_0x5da5('0x3a')]({'model':db[_0x5da5('0xf4')],'as':_0x5da5('0x6f'),'attributes':['id',_0x5da5('0x123'),_0x5da5('0x124')],'raw':!![]});if(_0x10e296[_0x5da5('0x49')][_0x5da5('0x121')]){_0x4413c3[_0x5da5('0x3a')]({'model':db['Attachment'],'as':_0x5da5('0xe5'),'raw':!![]});}var _0x3203e7=[{'model':db[_0x5da5('0xf2')],'as':'Messages','attributes':['id',_0x5da5('0x2f'),_0x5da5('0x85'),_0x5da5('0xfe'),'secret',_0x5da5('0x8c')],'include':_0x4413c3}];_0x3203e7[_0x5da5('0x3a')]({'model':db[_0x5da5('0xca')],'as':_0x5da5('0x125'),'attributes':['id',_0x5da5('0x2c')]});_0x3203e7[_0x5da5('0x3a')]({'model':db[_0x5da5('0x7c')],'as':_0x5da5('0x126'),'attributes':['id',_0x5da5('0xcd')]});return db['ChatInteraction'][_0x5da5('0x6b')]({'where':{'id':_0x10e296[_0x5da5('0xc2')]['id']},'include':_0x3203e7})[_0x5da5('0x2a')](handleEntityNotFound(_0x3a6962,null))[_0x5da5('0x2a')](function(_0x512d10){if(_0x512d10){var _0x2b7834=_0x512d10[_0x5da5('0x127')]({'plain':!![]});fs[_0x5da5('0x128')](_0x454639);var _0x182053={'channel':_0x5da5('0x129'),'account':_0x2b7834[_0x5da5('0x125')]['name'],'agent':_0x2b7834['Owner']?_0x2b7834[_0x5da5('0x126')][_0x5da5('0xcd')]:_0x5da5('0x12a'),'createdAt':moment(_0x2b7834['createdAt'])[_0x5da5('0xee')](_0x5da5('0x12b'))[_0x5da5('0xa5')](),'closedAt':_0x2b7834[_0x5da5('0x3f')]?moment(_0x2b7834[_0x5da5('0x12c')])[_0x5da5('0xee')](_0x5da5('0x12b'))[_0x5da5('0xa5')]():'','disposition':_0x2b7834[_0x5da5('0x42')],'chatInfo':{'browser':_0x2b7834[_0x5da5('0x12d')],'os':_0x2b7834[_0x5da5('0x12e')],'referer':_0x2b7834[_0x5da5('0x12f')],'customerIp':_0x2b7834[_0x5da5('0x130')],'customerPort':_0x2b7834[_0x5da5('0x131')]?_0x2b7834[_0x5da5('0x131')]:'N.A.'},'messages':_(_0x2b7834[_0x5da5('0xf3')])[_0x5da5('0x132')]()[_0x5da5('0x111')]({'secret':![]})[_0x5da5('0x35')](function(_0x4aeb17){if(_0x4aeb17[_0x5da5('0xe5')]){var _0x35c55f=path[_0x5da5('0xe8')](_0x1800d0,_0x4aeb17['Attachment'][_0x5da5('0xe3')]);if(fs[_0x5da5('0x133')](_0x35c55f)){fs[_0x5da5('0x134')](_0x35c55f)['pipe'](fs[_0x5da5('0x135')](path['join'](_0x454639,_0x4aeb17[_0x5da5('0xe5')][_0x5da5('0xe3')])));}}return{'date':moment(_0x4aeb17[_0x5da5('0x85')])[_0x5da5('0xee')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5da5('0xa5')](),'sender':_0x4aeb17[_0x5da5('0xfe')]==='out'?_0x4aeb17[_0x5da5('0x7c')]?_0x4aeb17[_0x5da5('0x7c')][_0x5da5('0xcd')]:_0x5da5('0xfb'):_0x4aeb17[_0x5da5('0x6f')][_0x5da5('0x123')]+(_0x4aeb17[_0x5da5('0x6f')][_0x5da5('0x124')]?'\x20'+_0x4aeb17[_0x5da5('0x6f')][_0x5da5('0x124')]:''),'body':_0x4aeb17['Attachment']?_0x4aeb17[_0x5da5('0xe5')][_0x5da5('0xe3')]:_0x4aeb17['body'],'direction':_0x4aeb17[_0x5da5('0xfe')]===_0x5da5('0xd8')?'A':'C','secret':_0x4aeb17[_0x5da5('0xff')],'read':_0x4aeb17[_0x5da5('0x8c')],'attachment':_0x4aeb17['Attachment']};})[_0x5da5('0x71')]()};return ejs['renderFile'](path[_0x5da5('0xe8')](config['root'],_0x5da5('0x11e'),_0x5da5('0x136'),'downloadInteraction.ejs'),{'interaction':_0x182053})[_0x5da5('0x2a')](function(_0x4c13d8){var _0x15e4f9=path['join'](_0x454639,_0x5da5('0x137')+_0x2b7834['id']+'-'+_0xe1a9c2+'.pdf');var _0x5c31c7={'path':_0x15e4f9,'channel':_0x5da5('0x129'),'interactionId':_0x2b7834['id']};return pdf[_0x5da5('0x138')](_0x4c13d8,_0x5c31c7);})[_0x5da5('0x2a')](function(){return new Promise(function(_0x344da7,_0x44774c){zipdir(_0x454639,{'saveTo':_0x11394e},function(_0x1c3d84,_0x2e06f4){if(_0x1c3d84)return _0x44774c(_0x1c3d84);return _0x344da7(_0x2e06f4);});})[_0x5da5('0x2a')](function(){return new BPromise(function(_0xc2e222,_0x1560a5){rimraf(_0x454639,function(_0x464cd6){if(_0x464cd6)_0x1560a5(_0x464cd6);return _0xc2e222();});});})[_0x5da5('0x2a')](function(){return _0x3a6962['download'](_0x11394e,_0x1cddaf,function(_0x5bb2be){if(_0x5bb2be){logger[_0x5da5('0x1c')]('err',_0x5bb2be);}else{fs[_0x5da5('0x139')](_0x11394e);}});});});}else{return _0x3a6962[_0x5da5('0xdf')](0xc8);}})[_0x5da5('0x20')](handleError(_0x3a6962,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index feda90f..7616b10 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 _0x00b3=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','save','update','getUsers'];(function(_0x30e4dc,_0x3087c8){var _0x54245c=function(_0x2d7e1c){while(--_0x2d7e1c){_0x30e4dc['push'](_0x30e4dc['shift']());}};_0x54245c(++_0x3087c8);}(_0x00b3,0x170));var _0x300b=function(_0x2b2b3e,_0x206c3b){_0x2b2b3e=_0x2b2b3e-0x0;var _0x1bc311=_0x00b3[_0x2b2b3e];return _0x1bc311;};'use strict';var EventEmitter=require(_0x300b('0x0'));var ChatInteraction=require(_0x300b('0x1'))['db'][_0x300b('0x2')];var ChatMessage=require(_0x300b('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x300b('0x3'),'afterUpdate':_0x300b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d4caa){return function(_0x20aeb7,_0x3891ce,_0x5489b1){_0x20aeb7[_0x300b('0x5')]({'attributes':['id'],'raw':!![]})[_0x300b('0x6')](function(_0x50df4c){_0x20aeb7[_0x300b('0x7')](_0x300b('0x8'),_0x50df4c[_0x300b('0x9')](function(_0x6a8fff){return{'id':_0x6a8fff['id']};}));return ChatMessage[_0x300b('0xa')]({'where':{'ChatInteractionId':_0x20aeb7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x300b('0x6')](function(_0x21f6c1){_0x20aeb7['setDataValue']('unreadMessages',_0x21f6c1[_0x300b('0xb')]);ChatInteractionEvents['emit'](_0x1d4caa+':'+_0x20aeb7['id'],_0x20aeb7);ChatInteractionEvents[_0x300b('0xc')](_0x1d4caa,_0x20aeb7);_0x5489b1(null);})[_0x300b('0xd')](_0x5489b1(null));};}for(var e in events){if(events[_0x300b('0xe')](e)){var event=events[e];ChatInteraction[_0x300b('0xf')](e,emitEvent(event));}}module[_0x300b('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x10cf=['catch','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','remove','setDataValue','Users','map','findAll','length','emit'];(function(_0x2cb147,_0x35d804){var _0xd5d41f=function(_0x4d8584){while(--_0x4d8584){_0x2cb147['push'](_0x2cb147['shift']());}};_0xd5d41f(++_0x35d804);}(_0x10cf,0x73));var _0xf10c=function(_0x47f5f6,_0x7aa8cd){_0x47f5f6=_0x47f5f6-0x0;var _0x3e7445=_0x10cf[_0x47f5f6];return _0x3e7445;};'use strict';var EventEmitter=require(_0xf10c('0x0'));var ChatInteraction=require(_0xf10c('0x1'))['db'][_0xf10c('0x2')];var ChatMessage=require(_0xf10c('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xf10c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf10c('0x4')};function emitEvent(_0x2074ea){return function(_0x1522f9,_0x446bad,_0x2e649e){_0x1522f9['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x2ca25b){_0x1522f9[_0xf10c('0x5')](_0xf10c('0x6'),_0x2ca25b[_0xf10c('0x7')](function(_0x4e7b4c){return{'id':_0x4e7b4c['id']};}));return ChatMessage[_0xf10c('0x8')]({'where':{'ChatInteractionId':_0x1522f9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5992a2){_0x1522f9[_0xf10c('0x5')]('unreadMessages',_0x5992a2[_0xf10c('0x9')]);ChatInteractionEvents[_0xf10c('0xa')](_0x2074ea+':'+_0x1522f9['id'],_0x1522f9);ChatInteractionEvents[_0xf10c('0xa')](_0x2074ea,_0x1522f9);_0x2e649e(null);})[_0xf10c('0xb')](_0x2e649e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xf10c('0xc')](e,emitEvent(event));}}module[_0xf10c('0xd')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 2abb6ad..451a956 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 _0x661a=['closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','request-promise','rimraf','exports','define','ChatInteraction','chat_interactions','changed'];(function(_0x237d67,_0x4ff2db){var _0x292dfb=function(_0x565a7d){while(--_0x565a7d){_0x237d67['push'](_0x237d67['shift']());}};_0x292dfb(++_0x4ff2db);}(_0x661a,0xaa));var _0xa661=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0x661a[_0x628eee];return _0x447718;};'use strict';var _=require(_0xa661('0x0'));var util=require(_0xa661('0x1'));var logger=require('../../config/logger')(_0xa661('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa661('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa661('0x4'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xa661('0x5')]=function(_0xc2da46,_0x5e1af9){return _0xc2da46[_0xa661('0x6')](_0xa661('0x7'),attributes,{'tableName':_0xa661('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2dce78,_0x1da5a0,_0x861c1c){if(_0x2dce78[_0xa661('0x9')](_0xa661('0xa'))){_0x2dce78[_0xa661('0xb')]=moment()[_0xa661('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x861c1c(null,_0x2dce78);}},'charset':_0xa661('0xd'),'collate':_0xa661('0xe')});};
\ No newline at end of file
+var _0x672c=['moment','bluebird','rimraf','exports','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x352ec6,_0x43fce0){var _0x221d8e=function(_0x595072){while(--_0x595072){_0x352ec6['push'](_0x352ec6['shift']());}};_0x221d8e(++_0x43fce0);}(_0x672c,0x1bf));var _0xc672=function(_0x46210b,_0x3e08fa){_0x46210b=_0x46210b-0x0;var _0x448b89=_0x672c[_0x46210b];return _0x448b89;};'use strict';var _=require(_0xc672('0x0'));var util=require(_0xc672('0x1'));var logger=require(_0xc672('0x2'))('api');var moment=require(_0xc672('0x3'));var BPromise=require(_0xc672('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc672('0x5'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0xc672('0x6')]=function(_0x8a65e9,_0x24c545){return _0x8a65e9['define'](_0xc672('0x7'),attributes,{'tableName':_0xc672('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x16071a,_0x507bf1,_0x4385cc){if(_0x16071a[_0xc672('0x9')]('closed')){_0x16071a[_0xc672('0xa')]=moment()[_0xc672('0xb')](_0xc672('0xc'));}_0x4385cc(null,_0x16071a);}},'charset':_0xc672('0xd'),'collate':_0xc672('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 51b017a..9837cc4 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 _0x3e31=['where','attributes','limit','debug','catch','find','addTags','body','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UpdateChatInteraction','ChatInteraction','update','options','raw'];(function(_0x1177f0,_0x508e3e){var _0x3dca9e=function(_0x2f8571){while(--_0x2f8571){_0x1177f0['push'](_0x1177f0['shift']());}};_0x3dca9e(++_0x508e3e);}(_0x3e31,0x10d));var _0x13e3=function(_0x222b59,_0x45b188){_0x222b59=_0x222b59-0x0;var _0x18f9c2=_0x3e31[_0x222b59];return _0x18f9c2;};'use strict';var _=require(_0x13e3('0x0'));var util=require(_0x13e3('0x1'));var moment=require(_0x13e3('0x2'));var BPromise=require(_0x13e3('0x3'));var rs=require(_0x13e3('0x4'));var fs=require('fs');var Redis=require(_0x13e3('0x5'));var db=require(_0x13e3('0x6'))['db'];var utils=require(_0x13e3('0x7'));var logger=require('../../config/logger')(_0x13e3('0x8'));var config=require(_0x13e3('0x9'));var jayson=require(_0x13e3('0xa'));var client=jayson[_0x13e3('0xb')][_0x13e3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x13e3('0xd')],{'host':_0x13e3('0xe'),'port':0x18eb});var socket=require(_0x13e3('0xf'))(new Redis(config[_0x13e3('0xd')]));require(_0x13e3('0x10'))[_0x13e3('0x11')](socket);function respondWithRpcPromise(_0x6c9ca8,_0x3082a2,_0x1a7f1c){return new BPromise(function(_0x4e7868,_0x45a9dd){return client['request'](_0x6c9ca8,_0x1a7f1c)[_0x13e3('0x12')](function(_0xea6c8e){logger['info'](_0x13e3('0x13'),_0x3082a2,_0x13e3('0x14'));logger['debug'](_0x13e3('0x15'),_0x3082a2,'request\x20sent',JSON[_0x13e3('0x16')](_0xea6c8e));if(_0xea6c8e['error']){if(_0xea6c8e[_0x13e3('0x17')][_0x13e3('0x18')]===0x1f4){logger[_0x13e3('0x17')](_0x13e3('0x13'),_0x3082a2,_0xea6c8e['error'][_0x13e3('0x19')]);return _0x45a9dd(_0xea6c8e[_0x13e3('0x17')]['message']);}logger[_0x13e3('0x17')](_0x13e3('0x13'),_0x3082a2,_0xea6c8e[_0x13e3('0x17')][_0x13e3('0x19')]);return _0x4e7868(_0xea6c8e['error'][_0x13e3('0x19')]);}else{logger[_0x13e3('0x1a')](_0x13e3('0x13'),_0x3082a2,_0x13e3('0x14'));_0x4e7868(_0xea6c8e['result'][_0x13e3('0x19')]);}})['catch'](function(_0x3ec74b){logger[_0x13e3('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x3082a2,_0x3ec74b);_0x45a9dd(_0x3ec74b);});});}exports[_0x13e3('0x1b')]=function(_0x36ba6d){var _0x589b62=this;return new Promise(function(_0x398eed,_0x3742bf){return db[_0x13e3('0x1c')][_0x13e3('0x1d')](_0x36ba6d['body'],{'raw':_0x36ba6d[_0x13e3('0x1e')]?_0x36ba6d['options'][_0x13e3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36ba6d['options']?_0x36ba6d[_0x13e3('0x1e')][_0x13e3('0x20')]||null:null,'attributes':_0x36ba6d['options']?_0x36ba6d[_0x13e3('0x1e')][_0x13e3('0x21')]||null:null,'limit':_0x36ba6d[_0x13e3('0x1e')]?_0x36ba6d['options'][_0x13e3('0x22')]||null:null})[_0x13e3('0x12')](function(_0xe3f43b){logger['info'](_0x13e3('0x1b'),_0x36ba6d);logger[_0x13e3('0x23')](_0x13e3('0x1b'),_0x36ba6d,JSON[_0x13e3('0x16')](_0xe3f43b));_0x398eed(_0xe3f43b);})[_0x13e3('0x24')](function(_0x1e09ab){logger[_0x13e3('0x17')](_0x13e3('0x1b'),_0x1e09ab[_0x13e3('0x19')],_0x36ba6d);_0x3742bf(_0x589b62['error'](0x1f4,_0x1e09ab['message']));});});};exports['AddTagsToChatInteraction']=function(_0x2308da){return new Promise(function(_0x122e3b,_0x29d6cc){return db[_0x13e3('0x1c')][_0x13e3('0x25')]({'where':_0x2308da['options']?_0x2308da['options'][_0x13e3('0x20')]||null:null})[_0x13e3('0x12')](function(_0x4fb343){if(_0x4fb343){return _0x4fb343[_0x13e3('0x26')](_0x2308da[_0x13e3('0x27')][_0x13e3('0x28')],_['omit'](_0x2308da['body'],[_0x13e3('0x28'),'id'])||{});}})[_0x13e3('0x29')](function(_0x569ee5){logger[_0x13e3('0x1a')](_0x13e3('0x2a'),_0x2308da);logger[_0x13e3('0x23')]('AddTags',_0x2308da,JSON['stringify'](_0x569ee5));_0x122e3b(_0x569ee5);})[_0x13e3('0x24')](function(_0x3e91b){logger[_0x13e3('0x17')](_0x13e3('0x2a'),_0x3e91b[_0x13e3('0x19')],_0x2308da);_0x29d6cc(_this[_0x13e3('0x17')](0x1f4,_0x3e91b[_0x13e3('0x19')]));});});};
\ No newline at end of file
+var _0x21bd=['find','where','then','addTags','ids','omit','body','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','limit','AddTagsToChatInteraction'];(function(_0x4eccbe,_0x4676c7){var _0x59964a=function(_0x29513b){while(--_0x29513b){_0x4eccbe['push'](_0x4eccbe['shift']());}};_0x59964a(++_0x4676c7);}(_0x21bd,0x83));var _0xd21b=function(_0x3706e9,_0x5bafe4){_0x3706e9=_0x3706e9-0x0;var _0x4a96c1=_0x21bd[_0x3706e9];return _0x4a96c1;};'use strict';var _=require(_0xd21b('0x0'));var util=require(_0xd21b('0x1'));var moment=require(_0xd21b('0x2'));var BPromise=require(_0xd21b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd21b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd21b('0x5'));var logger=require(_0xd21b('0x6'))(_0xd21b('0x7'));var config=require(_0xd21b('0x8'));var jayson=require(_0xd21b('0x9'));var client=jayson[_0xd21b('0xa')]['http']({'port':0x232a});config[_0xd21b('0xb')]=_[_0xd21b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd21b('0xd'))(new Redis(config[_0xd21b('0xb')]));require(_0xd21b('0xe'))[_0xd21b('0xf')](socket);function respondWithRpcPromise(_0x367dc3,_0x16a382,_0x18bf18){return new BPromise(function(_0x741ac7,_0x2363da){return client[_0xd21b('0x10')](_0x367dc3,_0x18bf18)['then'](function(_0x372192){logger['info'](_0xd21b('0x11'),_0x16a382,'request\x20sent');logger[_0xd21b('0x12')](_0xd21b('0x13'),_0x16a382,'request\x20sent',JSON[_0xd21b('0x14')](_0x372192));if(_0x372192[_0xd21b('0x15')]){if(_0x372192[_0xd21b('0x15')]['code']===0x1f4){logger[_0xd21b('0x15')](_0xd21b('0x11'),_0x16a382,_0x372192['error'][_0xd21b('0x16')]);return _0x2363da(_0x372192[_0xd21b('0x15')][_0xd21b('0x16')]);}logger[_0xd21b('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x16a382,_0x372192[_0xd21b('0x15')]['message']);return _0x741ac7(_0x372192['error'][_0xd21b('0x16')]);}else{logger[_0xd21b('0x17')](_0xd21b('0x11'),_0x16a382,'request\x20sent');_0x741ac7(_0x372192[_0xd21b('0x18')][_0xd21b('0x16')]);}})[_0xd21b('0x19')](function(_0x5f4fbd){logger['error'](_0xd21b('0x11'),_0x16a382,_0x5f4fbd);_0x2363da(_0x5f4fbd);});});}exports[_0xd21b('0x1a')]=function(_0x3b6b51){var _0x17800d=this;return new Promise(function(_0x494c52,_0x82fcba){return db[_0xd21b('0x1b')][_0xd21b('0x1c')](_0x3b6b51['body'],{'raw':_0x3b6b51[_0xd21b('0x1d')]?_0x3b6b51[_0xd21b('0x1d')][_0xd21b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b6b51[_0xd21b('0x1d')]?_0x3b6b51[_0xd21b('0x1d')]['where']||null:null,'attributes':_0x3b6b51[_0xd21b('0x1d')]?_0x3b6b51[_0xd21b('0x1d')]['attributes']||null:null,'limit':_0x3b6b51[_0xd21b('0x1d')]?_0x3b6b51['options'][_0xd21b('0x1f')]||null:null})['then'](function(_0x4c580c){logger[_0xd21b('0x17')](_0xd21b('0x1a'),_0x3b6b51);logger[_0xd21b('0x12')](_0xd21b('0x1a'),_0x3b6b51,JSON[_0xd21b('0x14')](_0x4c580c));_0x494c52(_0x4c580c);})['catch'](function(_0x5393fe){logger[_0xd21b('0x15')](_0xd21b('0x1a'),_0x5393fe['message'],_0x3b6b51);_0x82fcba(_0x17800d['error'](0x1f4,_0x5393fe[_0xd21b('0x16')]));});});};exports[_0xd21b('0x20')]=function(_0x1b65f6){return new Promise(function(_0x8ce25d,_0x3ea1e9){return db['ChatInteraction'][_0xd21b('0x21')]({'where':_0x1b65f6['options']?_0x1b65f6[_0xd21b('0x1d')][_0xd21b('0x22')]||null:null})[_0xd21b('0x23')](function(_0x42d013){if(_0x42d013){return _0x42d013[_0xd21b('0x24')](_0x1b65f6['body'][_0xd21b('0x25')],_[_0xd21b('0x26')](_0x1b65f6[_0xd21b('0x27')],[_0xd21b('0x25'),'id'])||{});}})['spread'](function(_0x2dfcf1){logger[_0xd21b('0x17')](_0xd21b('0x28'),_0x1b65f6);logger[_0xd21b('0x12')]('AddTags',_0x1b65f6,JSON[_0xd21b('0x14')](_0x2dfcf1));_0x8ce25d(_0x2dfcf1);})[_0xd21b('0x19')](function(_0x4b8b54){logger['error'](_0xd21b('0x28'),_0x4b8b54[_0xd21b('0x16')],_0x1b65f6);_0x3ea1e9(_this[_0xd21b('0x15')](0x1f4,_0x4b8b54[_0xd21b('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index f646fd8..1a42ba1 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 _0x1d18=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update'];(function(_0x4aabec,_0xf02f7e){var _0xc4ea3=function(_0x352942){while(--_0x352942){_0x4aabec['push'](_0x4aabec['shift']());}};_0xc4ea3(++_0xf02f7e);}(_0x1d18,0x10d));var _0x81d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d18[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0x81d1('0x0'));var events=[_0x81d1('0x1'),_0x81d1('0x2'),_0x81d1('0x3')];function createListener(_0x10c31e,_0x5e7f36){return function(_0x368e61){_0x5e7f36['emit'](_0x10c31e,_0x368e61);};}function removeListener(_0x45bba6,_0x25d207){return function(){ChatInteractionEvents['removeListener'](_0x45bba6,_0x25d207);};}exports[_0x81d1('0x4')]=function(_0x225218){for(var _0x5742ce=0x0,_0x1d8664=events[_0x81d1('0x5')];_0x5742ce<_0x1d8664;_0x5742ce++){var _0x5ecee5=events[_0x5742ce];var _0xa4dbc0=createListener(_0x81d1('0x6')+_0x5ecee5,_0x225218);ChatInteractionEvents['on'](_0x5ecee5,_0xa4dbc0);}};
\ No newline at end of file
+var _0x8cd9=['remove','update','emit','removeListener','chatInteraction:','./chatInteraction.events','save'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x8cd9,0x186));var _0x98cd=function(_0x55e773,_0x4c1e79){_0x55e773=_0x55e773-0x0;var _0xe29927=_0x8cd9[_0x55e773];return _0xe29927;};'use strict';var ChatInteractionEvents=require(_0x98cd('0x0'));var events=[_0x98cd('0x1'),_0x98cd('0x2'),_0x98cd('0x3')];function createListener(_0x46677d,_0x37c155){return function(_0x355efa){_0x37c155[_0x98cd('0x4')](_0x46677d,_0x355efa);};}function removeListener(_0x1c8b4f,_0x209fc5){return function(){ChatInteractionEvents[_0x98cd('0x5')](_0x1c8b4f,_0x209fc5);};}exports['register']=function(_0x1379b8){for(var _0x59e346=0x0,_0x386ab8=events['length'];_0x59e346<_0x386ab8;_0x59e346++){var _0x5e6cb3=events[_0x59e346];var _0xe94b8a=createListener(_0x98cd('0x6')+_0x5e6cb3,_0x1379b8);ChatInteractionEvents['on'](_0x5e6cb3,_0xe94b8a);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 41c189b..160bdb0 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 _0x8ef5=['/:id/download','post','/:id/vidaoo','createVidaooSession','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','chatinteraction:destroy','destroy','delete','removeTags','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages'];(function(_0xa14749,_0x1cd81e){var _0x254790=function(_0x15f59d){while(--_0x15f59d){_0xa14749['push'](_0xa14749['shift']());}};_0x254790(++_0x1cd81e);}(_0x8ef5,0xea));var _0x58ef=function(_0x528db5,_0x31e843){_0x528db5=_0x528db5-0x0;var _0x2e2c9d=_0x8ef5[_0x528db5];return _0x2e2c9d;};'use strict';var multer=require(_0x58ef('0x0'));var util=require('util');var path=require(_0x58ef('0x1'));var timeout=require(_0x58ef('0x2'));var express=require('express');var router=express[_0x58ef('0x3')]();var fs_extra=require(_0x58ef('0x4'));var auth=require(_0x58ef('0x5'));var interaction=require(_0x58ef('0x6'));var config=require(_0x58ef('0x7'));var controller=require(_0x58ef('0x8'));router['get']('/',auth[_0x58ef('0x9')](),controller[_0x58ef('0xa')]);router[_0x58ef('0xb')]('/describe',auth[_0x58ef('0x9')](),controller[_0x58ef('0xc')]);router[_0x58ef('0xb')](_0x58ef('0xd'),auth[_0x58ef('0xe')](),controller[_0x58ef('0xf')]);router[_0x58ef('0xb')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x58ef('0x10')]);router[_0x58ef('0xb')](_0x58ef('0x11'),auth[_0x58ef('0x9')](),controller[_0x58ef('0x12')]);router[_0x58ef('0xb')](_0x58ef('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x58ef('0x14')]);router[_0x58ef('0xb')](_0x58ef('0x15'),auth['isAuthenticated'](),controller['download']);router[_0x58ef('0x16')]('/',auth[_0x58ef('0x9')](),controller['create']);router[_0x58ef('0x16')](_0x58ef('0x17'),auth[_0x58ef('0x9')](),controller[_0x58ef('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd18ffe,_0x548df2,_0x588d05){_0x588d05(null,path[_0x58ef('0x19')](config['root'],_0x58ef('0x1a')));},'filename':function(_0x8bca73,_0x53a217,_0x6b8ba1){_0x6b8ba1(null,util[_0x58ef('0x1b')](_0x58ef('0x1c'),Date[_0x58ef('0x1d')](),_0x53a217[_0x58ef('0x1e')][_0x58ef('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x58ef('0x20'),upload[_0x58ef('0x21')](_0x58ef('0x22')),controller[_0x58ef('0x23')]);router[_0x58ef('0x16')]('/:id/messages',auth[_0x58ef('0xe')](),controller['addMessage']);router[_0x58ef('0x16')](_0x58ef('0x24'),auth['isAuthenticated'](),interaction[_0x58ef('0x25')](_0x58ef('0x26'),_0x58ef('0x27')),controller[_0x58ef('0x28')]);router[_0x58ef('0x29')]('/:id',auth['isAuthenticated'](),interaction[_0x58ef('0x25')]('chat',_0x58ef('0x2a')),controller['update']);router[_0x58ef('0x29')](_0x58ef('0x2b'),controller[_0x58ef('0x2c')]);router['put'](_0x58ef('0x2d'),auth[_0x58ef('0xe')](),controller['abandon']);router[_0x58ef('0x29')](_0x58ef('0x2e'),controller['close']);router['delete'](_0x58ef('0xd'),auth[_0x58ef('0x9')](),interaction['tracked']('chat',_0x58ef('0x2f')),controller[_0x58ef('0x30')]);router[_0x58ef('0x31')]('/:id/tags',auth[_0x58ef('0x9')](),controller[_0x58ef('0x32')]);module['exports']=router;
\ No newline at end of file
+var _0x6b83=['put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:update'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x6b83,0xdc));var _0x36b8=function(_0x5d73b2,_0x1ea5cd){_0x5d73b2=_0x5d73b2-0x0;var _0x1e4551=_0x6b83[_0x5d73b2];return _0x1e4551;};'use strict';var multer=require(_0x36b8('0x0'));var util=require(_0x36b8('0x1'));var path=require(_0x36b8('0x2'));var timeout=require(_0x36b8('0x3'));var express=require(_0x36b8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x36b8('0x5'));var config=require(_0x36b8('0x6'));var controller=require(_0x36b8('0x7'));router[_0x36b8('0x8')]('/',auth[_0x36b8('0x9')](),controller['index']);router[_0x36b8('0x8')](_0x36b8('0xa'),auth[_0x36b8('0x9')](),controller['describe']);router[_0x36b8('0x8')](_0x36b8('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x36b8('0xc')]);router[_0x36b8('0x8')](_0x36b8('0xd'),auth[_0x36b8('0xe')](),controller[_0x36b8('0xf')]);router['get'](_0x36b8('0x10'),auth['isAuthenticated'](),controller[_0x36b8('0x11')]);router[_0x36b8('0x8')](_0x36b8('0x12'),auth[_0x36b8('0xe')](),controller[_0x36b8('0x13')]);router[_0x36b8('0x8')](_0x36b8('0x14'),auth['isAuthenticated'](),controller['download']);router[_0x36b8('0x15')]('/',auth[_0x36b8('0x9')](),controller[_0x36b8('0x16')]);router[_0x36b8('0x15')](_0x36b8('0x17'),auth[_0x36b8('0x9')](),controller[_0x36b8('0x18')]);var upload=multer({'storage':multer[_0x36b8('0x19')]({'destination':function(_0xcb739d,_0x56291b,_0x794662){_0x794662(null,path[_0x36b8('0x1a')](config['root'],_0x36b8('0x1b')));},'filename':function(_0x3cf8c5,_0x2bb171,_0x56064d){_0x56064d(null,util[_0x36b8('0x1c')](_0x36b8('0x1d'),Date[_0x36b8('0x1e')](),_0x2bb171[_0x36b8('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x36b8('0x15')](_0x36b8('0x20'),upload[_0x36b8('0x21')]('file'),controller[_0x36b8('0x22')]);router[_0x36b8('0x15')](_0x36b8('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x36b8('0x23')]);router[_0x36b8('0x15')](_0x36b8('0x24'),auth[_0x36b8('0x9')](),interaction[_0x36b8('0x25')](_0x36b8('0x26'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0x36b8('0xb'),auth[_0x36b8('0x9')](),interaction['tracked'](_0x36b8('0x26'),_0x36b8('0x27')),controller['update']);router[_0x36b8('0x28')](_0x36b8('0x29'),controller[_0x36b8('0x2a')]);router['put'](_0x36b8('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x36b8('0x2c')]);router[_0x36b8('0x28')](_0x36b8('0x2d'),controller[_0x36b8('0x2e')]);router[_0x36b8('0x2f')]('/:id',auth['isAuthenticated'](),interaction[_0x36b8('0x25')](_0x36b8('0x26'),_0x36b8('0x30')),controller[_0x36b8('0x31')]);router['delete'](_0x36b8('0x24'),auth[_0x36b8('0x9')](),controller[_0x36b8('0x32')]);module[_0x36b8('0x33')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index cece5c9..4ebaa72 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 _0x38bf=['INTEGER','sequelize','TEXT','medium','BOOLEAN'];(function(_0x1fb1c1,_0x4ebe69){var _0x1622df=function(_0x52b793){while(--_0x52b793){_0x1fb1c1['push'](_0x1fb1c1['shift']());}};_0x1622df(++_0x4ebe69);}(_0x38bf,0x1c8));var _0xf38b=function(_0x112666,_0x2fd1a5){_0x112666=_0x112666-0x0;var _0x381764=_0x38bf[_0x112666];return _0x381764;};'use strict';var Sequelize=require(_0xf38b('0x0'));module['exports']={'body':{'type':Sequelize[_0xf38b('0x1')](_0xf38b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xf38b('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf38b('0x4')]}};
\ No newline at end of file
+var _0x82ce=['INTEGER','sequelize','exports'];(function(_0x565f06,_0x3e9246){var _0x351eb2=function(_0x15d052){while(--_0x15d052){_0x565f06['push'](_0x565f06['shift']());}};_0x351eb2(++_0x3e9246);}(_0x82ce,0x106));var _0xe82c=function(_0x337306,_0x4c72e8){_0x337306=_0x337306-0x0;var _0x4cdfa4=_0x82ce[_0x337306];return _0x4cdfa4;};'use strict';var Sequelize=require(_0xe82c('0x0'));module[_0xe82c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe82c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 4401f7f..7c261ea 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 _0xda21=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','register','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','end','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','type','merge','options','where','includeAll','include','findAll','rows','catch','show','find','body','params','destroy','describe','get','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xda21,0x135));var _0x1da2=function(_0x4d1c51,_0x3b6fb0){_0x4d1c51=_0x4d1c51-0x0;var _0x667b49=_0xda21[_0x4d1c51];return _0x667b49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1da2('0x0'));var zipdir=require(_0x1da2('0x1'));var jsonpatch=require(_0x1da2('0x2'));var rp=require('request-promise');var moment=require(_0x1da2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1da2('0x4'));var util=require(_0x1da2('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1da2('0x6'));var fs=require('fs');var fs_extra=require(_0x1da2('0x7'));var _=require(_0x1da2('0x8'));var squel=require(_0x1da2('0x9'));var crypto=require(_0x1da2('0xa'));var jsforce=require(_0x1da2('0xb'));var deskjs=require(_0x1da2('0xc'));var toCsv=require(_0x1da2('0xd'));var querystring=require(_0x1da2('0xe'));var Papa=require(_0x1da2('0xf'));var Redis=require(_0x1da2('0x10'));var authService=require(_0x1da2('0x11'));var qs=require(_0x1da2('0x12'));var as=require(_0x1da2('0x13'));var hardwareService=require(_0x1da2('0x14'));var logger=require(_0x1da2('0x15'))(_0x1da2('0x16'));var utils=require(_0x1da2('0x17'));var config=require(_0x1da2('0x18'));var licenseUtil=require(_0x1da2('0x19'));var db=require('../../mysqldb')['db'];config[_0x1da2('0x1a')]=_['defaults'](config['redis'],{'host':_0x1da2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x1da2('0x1c')](socket);function respondWithStatusCode(_0x4926ef,_0x18f8c9){_0x18f8c9=_0x18f8c9||0xcc;return function(_0x312e40){if(_0x312e40){return _0x4926ef['sendStatus'](_0x18f8c9);}return _0x4926ef['status'](_0x18f8c9)['end']();};}function respondWithResult(_0x1af883,_0x524a42){_0x524a42=_0x524a42||0xc8;return function(_0x4a52d9){if(_0x4a52d9){return _0x1af883[_0x1da2('0x1d')](_0x524a42)[_0x1da2('0x1e')](_0x4a52d9);}};}function respondWithFilteredResult(_0x3f1297,_0x792a8f){return function(_0x5eb53a){if(_0x5eb53a){var _0x3ba3d2=typeof _0x792a8f[_0x1da2('0x1f')]===_0x1da2('0x20')&&typeof _0x792a8f[_0x1da2('0x21')]===_0x1da2('0x20');var _0x2f9f4e=_0x5eb53a[_0x1da2('0x22')];var _0x3daa75=_0x3ba3d2?0x0:_0x792a8f[_0x1da2('0x1f')];var _0x1ffe29=_0x3ba3d2?_0x5eb53a[_0x1da2('0x22')]:_0x792a8f[_0x1da2('0x1f')]+_0x792a8f[_0x1da2('0x21')];var _0x17b8f3;if(_0x1ffe29>=_0x2f9f4e){_0x1ffe29=_0x2f9f4e;_0x17b8f3=0xc8;}else{_0x17b8f3=0xce;}_0x3f1297[_0x1da2('0x1d')](_0x17b8f3);return _0x3f1297['set'](_0x1da2('0x23'),_0x3daa75+'-'+_0x1ffe29+'/'+_0x2f9f4e)['json'](_0x5eb53a);}return null;};}function patchUpdates(_0x4fa737){return function(_0xe56867){try{jsonpatch[_0x1da2('0x24')](_0xe56867,_0x4fa737,!![]);}catch(_0x417f18){return BPromise[_0x1da2('0x25')](_0x417f18);}return _0xe56867[_0x1da2('0x26')]();};}function saveUpdates(_0x12cdde,_0x428272){return function(_0x4716d1){if(_0x4716d1){return _0x4716d1['update'](_0x12cdde)[_0x1da2('0x27')](function(_0x923d5a){return _0x923d5a;});}return null;};}function removeEntity(_0xed9c,_0xc4792e){return function(_0x34f06b){if(_0x34f06b){return _0x34f06b['destroy']()[_0x1da2('0x27')](function(){_0xed9c['status'](0xcc)[_0x1da2('0x28')]();});}};}function handleEntityNotFound(_0x1610f8,_0x43cf87){return function(_0x1b54c5){if(!_0x1b54c5){_0x1610f8['sendStatus'](0x194);}return _0x1b54c5;};}function handleError(_0xa0b678,_0xa8c1c0){_0xa8c1c0=_0xa8c1c0||0x1f4;return function(_0x247ac8){logger['error'](_0x247ac8[_0x1da2('0x29')]);if(_0x247ac8[_0x1da2('0x2a')]){delete _0x247ac8[_0x1da2('0x2a')];}_0xa0b678['status'](_0xa8c1c0)['send'](_0x247ac8);};}exports['index']=function(_0xb58413,_0x3b8ed0){var _0x2bcf74={},_0x546145={},_0x59bf78={'count':0x0,'rows':[]};var _0x4afff4=_[_0x1da2('0x2b')](db[_0x1da2('0x2c')][_0x1da2('0x2d')],function(_0x38d395){return{'name':_0x38d395[_0x1da2('0x2e')],'type':_0x38d395['type']['key']};});_0x546145[_0x1da2('0x2f')]=_[_0x1da2('0x2b')](_0x4afff4,'name');_0x546145['query']=_[_0x1da2('0x30')](_0xb58413[_0x1da2('0x31')]);_0x546145[_0x1da2('0x32')]=_['intersection'](_0x546145[_0x1da2('0x2f')],_0x546145['query']);_0x2bcf74[_0x1da2('0x33')]=_[_0x1da2('0x34')](_0x546145[_0x1da2('0x2f')],qs[_0x1da2('0x35')](_0xb58413[_0x1da2('0x31')][_0x1da2('0x35')]));_0x2bcf74[_0x1da2('0x33')]=_0x2bcf74[_0x1da2('0x33')][_0x1da2('0x36')]?_0x2bcf74['attributes']:_0x546145[_0x1da2('0x2f')];if(!_0xb58413[_0x1da2('0x31')][_0x1da2('0x37')](_0x1da2('0x38'))){_0x2bcf74[_0x1da2('0x21')]=qs['limit'](_0xb58413[_0x1da2('0x31')]['limit']);_0x2bcf74['offset']=qs[_0x1da2('0x1f')](_0xb58413[_0x1da2('0x31')][_0x1da2('0x1f')]);}_0x2bcf74[_0x1da2('0x39')]=qs[_0x1da2('0x3a')](_0xb58413[_0x1da2('0x31')][_0x1da2('0x3a')]);_0x2bcf74['where']=qs[_0x1da2('0x32')](_['pick'](_0xb58413[_0x1da2('0x31')],_0x546145[_0x1da2('0x32')]),_0x4afff4);if(_0xb58413[_0x1da2('0x31')][_0x1da2('0x3b')]){_0x2bcf74['where']=_['merge'](_0x2bcf74['where'],{'$or':_[_0x1da2('0x2b')](_0x4afff4,function(_0x444e58){if(_0x444e58[_0x1da2('0x3c')]!=='VIRTUAL'){var _0x409f8f={};_0x409f8f[_0x444e58['name']]={'$like':'%'+_0xb58413[_0x1da2('0x31')]['filter']+'%'};return _0x409f8f;}})});}_0x2bcf74=_[_0x1da2('0x3d')]({},_0x2bcf74,_0xb58413[_0x1da2('0x3e')]);var _0x4b91c8={'where':_0x2bcf74[_0x1da2('0x3f')]};return db[_0x1da2('0x2c')][_0x1da2('0x22')](_0x4b91c8)[_0x1da2('0x27')](function(_0x15a5f7){_0x59bf78[_0x1da2('0x22')]=_0x15a5f7;if(_0xb58413[_0x1da2('0x31')][_0x1da2('0x40')]){_0x2bcf74[_0x1da2('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x1da2('0x42')](_0x2bcf74);})[_0x1da2('0x27')](function(_0x4217e2){_0x59bf78[_0x1da2('0x43')]=_0x4217e2;return _0x59bf78;})['then'](respondWithFilteredResult(_0x3b8ed0,_0x2bcf74))[_0x1da2('0x44')](handleError(_0x3b8ed0,null));};exports[_0x1da2('0x45')]=function(_0x4cf5b1,_0x3e3d65){var _0x1de039={'raw':!![],'where':{'id':_0x4cf5b1['params']['id']}},_0x25e049={};_0x25e049[_0x1da2('0x2f')]=_[_0x1da2('0x30')](db[_0x1da2('0x2c')][_0x1da2('0x2d')]);_0x25e049[_0x1da2('0x31')]=_[_0x1da2('0x30')](_0x4cf5b1[_0x1da2('0x31')]);_0x25e049[_0x1da2('0x32')]=_[_0x1da2('0x34')](_0x25e049[_0x1da2('0x2f')],_0x25e049[_0x1da2('0x31')]);_0x1de039[_0x1da2('0x33')]=_['intersection'](_0x25e049['model'],qs[_0x1da2('0x35')](_0x4cf5b1['query']['fields']));_0x1de039['attributes']=_0x1de039[_0x1da2('0x33')][_0x1da2('0x36')]?_0x1de039[_0x1da2('0x33')]:_0x25e049[_0x1da2('0x2f')];if(_0x4cf5b1[_0x1da2('0x31')][_0x1da2('0x40')]){_0x1de039['include']=[{'all':!![]}];}_0x1de039=_[_0x1da2('0x3d')]({},_0x1de039,_0x4cf5b1[_0x1da2('0x3e')]);return db[_0x1da2('0x2c')][_0x1da2('0x46')](_0x1de039)['then'](handleEntityNotFound(_0x3e3d65,null))[_0x1da2('0x27')](respondWithResult(_0x3e3d65,null))[_0x1da2('0x44')](handleError(_0x3e3d65,null));};exports['create']=function(_0x335cfa,_0x25d19f){return db[_0x1da2('0x2c')]['create'](_0x335cfa[_0x1da2('0x47')],{})[_0x1da2('0x27')](respondWithResult(_0x25d19f,0xc9))[_0x1da2('0x44')](handleError(_0x25d19f,null));};exports['update']=function(_0x56fcd1,_0xf6286a){if(_0x56fcd1[_0x1da2('0x47')]['id']){delete _0x56fcd1[_0x1da2('0x47')]['id'];}return db[_0x1da2('0x2c')][_0x1da2('0x46')]({'where':{'id':_0x56fcd1[_0x1da2('0x48')]['id']}})['then'](handleEntityNotFound(_0xf6286a,null))[_0x1da2('0x27')](saveUpdates(_0x56fcd1[_0x1da2('0x47')],null))[_0x1da2('0x27')](respondWithResult(_0xf6286a,null))[_0x1da2('0x44')](handleError(_0xf6286a,null));};exports[_0x1da2('0x49')]=function(_0x5ac154,_0x2138e1){return db[_0x1da2('0x2c')][_0x1da2('0x46')]({'where':{'id':_0x5ac154[_0x1da2('0x48')]['id']}})[_0x1da2('0x27')](handleEntityNotFound(_0x2138e1,null))[_0x1da2('0x27')](removeEntity(_0x2138e1,null))[_0x1da2('0x44')](handleError(_0x2138e1,null));};exports['describe']=function(_0x2d7a5d,_0x31d5c0){return db[_0x1da2('0x2c')][_0x1da2('0x4a')]()['then'](respondWithResult(_0x31d5c0,null))[_0x1da2('0x44')](handleError(_0x31d5c0,null));};function wrapUser(_0x5e5d42){return function(_0x4fabe9){var _0x28ab5b=_0x5e5d42[_0x1da2('0x4b')]({'plain':!![]});_0x28ab5b[_0x1da2('0x4c')]=[];if(_0x4fabe9){_0x28ab5b['lastMessageAt']=_0x4fabe9['createdAt'];_0x28ab5b[_0x1da2('0x4d')]=_0x4fabe9;}else{_0x28ab5b[_0x1da2('0x4e')]=moment(0x0)[_0x1da2('0x4f')](_0x1da2('0x50'));_0x28ab5b[_0x1da2('0x4d')]={};}return _0x28ab5b;};}exports[_0x1da2('0x51')]=function(_0x161f0e,_0x4e121b,_0x52a74a){var _0x13075e=[];return db[_0x1da2('0x52')][_0x1da2('0x42')]({'where':{'role':[_0x1da2('0x53'),_0x1da2('0x54'),_0x1da2('0x55')]},'attributes':['id',_0x1da2('0x56'),_0x1da2('0x2a'),_0x1da2('0x57'),_0x1da2('0x58'),'internal','online',_0x1da2('0x59'),_0x1da2('0x5a'),_0x1da2('0x5b')],'order':qs[_0x1da2('0x3a')]('-online'),'include':[{'model':db[_0x1da2('0x5c')],'as':_0x1da2('0x5d'),'attributes':['id',_0x1da2('0x2a'),_0x1da2('0x3c')],'through':{'attributes':[]}}]})[_0x1da2('0x27')](function(_0x2dc87b){if(_0x2dc87b){var _0x515260=_0x161f0e[_0x1da2('0x55')][_0x1da2('0x4b')]({'plain':!![]});if(!_0x515260)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x515260['role']==='user'){return db[_0x1da2('0x5e')][_0x1da2('0x46')]({'where':{'name':_0x1da2('0x5f'),'userProfileId':_0x515260[_0x1da2('0x60')]},'raw':!![]})[_0x1da2('0x27')](function(_0x195c71){if(_0x195c71){if(_0x195c71[_0x1da2('0x61')]===0x0){return db[_0x1da2('0x62')]['findAll']({'where':{'sectionId':_0x195c71['id']},'raw':!![]})[_0x1da2('0x27')](function(_0x232c87){var _0x52b47c=[];if(_[_0x1da2('0x63')](_0x232c87)){_0x52b47c=_[_0x1da2('0x3b')](_0x2dc87b,function(_0x8ad1db){if(_0x8ad1db[_0x1da2('0x57')]!==_0x1da2('0x53')){return _0x8ad1db;}});return _0x52b47c;}else{for(var _0x59606c=0x0;_0x59606c<_0x2dc87b['length'];_0x59606c++){var _0x45ebf5=_0x2dc87b[_0x59606c];if(_0x45ebf5[_0x1da2('0x57')]===_0x1da2('0x53')){var _0x354476=_[_0x1da2('0x46')](_0x232c87,function(_0x2f688b){return _0x2f688b[_0x1da2('0x64')]===_0x45ebf5['id'];});if(_0x354476)_0x52b47c[_0x1da2('0x65')](_0x45ebf5);}else{_0x52b47c[_0x1da2('0x65')](_0x45ebf5);}}return _0x52b47c;}});}else{return _0x2dc87b;}}else{var _0x620744=_['filter'](_0x2dc87b,function(_0x139400){if(_0x139400['role']!==_0x1da2('0x53')){return _0x139400;}});return _0x620744;}});}else{return _0x2dc87b;}}})[_0x1da2('0x27')](function(_0x5d1aab){var _0x1129d3=[];if(_0x5d1aab){_0x13075e=_0x5d1aab;for(var _0x10ba9f=0x0;_0x10ba9f<_0x5d1aab['length'];_0x10ba9f+=0x1){_0x13075e[_0x10ba9f][_0x1da2('0x4c')]=[];_0x1129d3[_0x1da2('0x65')](db[_0x1da2('0x2c')][_0x1da2('0x46')]({'where':{'FromId':[_0x161f0e['user']['id'],_0x5d1aab[_0x10ba9f]['id']],'ToId':[_0x161f0e[_0x1da2('0x55')]['id'],_0x5d1aab[_0x10ba9f]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x1da2('0x66'),_0x1da2('0x67'),_0x1da2('0x68'),'body'],'order':qs['sort'](_0x1da2('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1da2('0x27')](wrapUser(_0x5d1aab[_0x10ba9f])));}return BPromise[_0x1da2('0x6a')](_0x1129d3);}return[];})[_0x1da2('0x27')](function(_0x32f202){return{'rows':_0x32f202,'count':_0x32f202[_0x1da2('0x36')]};})['then'](respondWithResult(_0x4e121b,null))[_0x1da2('0x44')](handleError(_0x4e121b,null));};
\ No newline at end of file
+var _0xa095=['count','includeAll','findAll','rows','catch','rawAttributes','include','find','create','body','params','destroy','describe','messages','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','then','error','stack','name','send','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x382649,_0x35867e){var _0x359910=function(_0x40914d){while(--_0x40914d){_0x382649['push'](_0x382649['shift']());}};_0x359910(++_0x35867e);}(_0xa095,0x92));var _0x5a09=function(_0x449e84,_0x505ae7){_0x449e84=_0x449e84-0x0;var _0x72d311=_0xa095[_0x449e84];return _0x72d311;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a09('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a09('0x1'));var rp=require(_0x5a09('0x2'));var moment=require(_0x5a09('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5a09('0x4'));var util=require('util');var path=require(_0x5a09('0x5'));var sox=require(_0x5a09('0x6'));var csv=require(_0x5a09('0x7'));var ejs=require(_0x5a09('0x8'));var fs=require('fs');var fs_extra=require(_0x5a09('0x9'));var _=require(_0x5a09('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5a09('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5a09('0x7'));var querystring=require(_0x5a09('0xc'));var Papa=require(_0x5a09('0xd'));var Redis=require(_0x5a09('0xe'));var authService=require(_0x5a09('0xf'));var qs=require(_0x5a09('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a09('0x11'));var logger=require(_0x5a09('0x12'))(_0x5a09('0x13'));var utils=require('../../config/utils');var config=require(_0x5a09('0x14'));var licenseUtil=require(_0x5a09('0x15'));var db=require('../../mysqldb')['db'];config[_0x5a09('0x16')]=_[_0x5a09('0x17')](config[_0x5a09('0x16')],{'host':_0x5a09('0x18'),'port':0x18eb});var socket=require(_0x5a09('0x19'))(new Redis(config['redis']));require(_0x5a09('0x1a'))['register'](socket);function respondWithStatusCode(_0x503ed3,_0x70c737){_0x70c737=_0x70c737||0xcc;return function(_0x177afe){if(_0x177afe){return _0x503ed3[_0x5a09('0x1b')](_0x70c737);}return _0x503ed3[_0x5a09('0x1c')](_0x70c737)[_0x5a09('0x1d')]();};}function respondWithResult(_0xb0ec6b,_0x407baa){_0x407baa=_0x407baa||0xc8;return function(_0x2e7d23){if(_0x2e7d23){return _0xb0ec6b['status'](_0x407baa)[_0x5a09('0x1e')](_0x2e7d23);}};}function respondWithFilteredResult(_0x2f1f4d,_0xe4137a){return function(_0x52de0a){if(_0x52de0a){var _0x166d0d=typeof _0xe4137a[_0x5a09('0x1f')]==='undefined'&&typeof _0xe4137a[_0x5a09('0x20')]===_0x5a09('0x21');var _0x225437=_0x52de0a['count'];var _0x267a05=_0x166d0d?0x0:_0xe4137a['offset'];var _0x10259a=_0x166d0d?_0x52de0a['count']:_0xe4137a[_0x5a09('0x1f')]+_0xe4137a[_0x5a09('0x20')];var _0x594501;if(_0x10259a>=_0x225437){_0x10259a=_0x225437;_0x594501=0xc8;}else{_0x594501=0xce;}_0x2f1f4d[_0x5a09('0x1c')](_0x594501);return _0x2f1f4d[_0x5a09('0x22')]('Content-Range',_0x267a05+'-'+_0x10259a+'/'+_0x225437)[_0x5a09('0x1e')](_0x52de0a);}return null;};}function patchUpdates(_0x9ec7ec){return function(_0x1135f4){try{jsonpatch[_0x5a09('0x23')](_0x1135f4,_0x9ec7ec,!![]);}catch(_0x3d29db){return BPromise[_0x5a09('0x24')](_0x3d29db);}return _0x1135f4[_0x5a09('0x25')]();};}function saveUpdates(_0x15c45f,_0x43678f){return function(_0x14b017){if(_0x14b017){return _0x14b017['update'](_0x15c45f)[_0x5a09('0x26')](function(_0x21bb1c){return _0x21bb1c;});}return null;};}function removeEntity(_0x30ec8a,_0x14b217){return function(_0x592238){if(_0x592238){return _0x592238['destroy']()[_0x5a09('0x26')](function(){_0x30ec8a[_0x5a09('0x1c')](0xcc)[_0x5a09('0x1d')]();});}};}function handleEntityNotFound(_0x3a99a8,_0x3b8e12){return function(_0x525e70){if(!_0x525e70){_0x3a99a8[_0x5a09('0x1b')](0x194);}return _0x525e70;};}function handleError(_0x270264,_0x42d355){_0x42d355=_0x42d355||0x1f4;return function(_0x4cea0c){logger[_0x5a09('0x27')](_0x4cea0c[_0x5a09('0x28')]);if(_0x4cea0c[_0x5a09('0x29')]){delete _0x4cea0c[_0x5a09('0x29')];}_0x270264['status'](_0x42d355)[_0x5a09('0x2a')](_0x4cea0c);};}exports['index']=function(_0x2a1a1b,_0x597ffc){var _0xb0edec={},_0x156c66={},_0x430da7={'count':0x0,'rows':[]};var _0x32bc94=_[_0x5a09('0x2b')](db[_0x5a09('0x2c')]['rawAttributes'],function(_0x3675db){return{'name':_0x3675db[_0x5a09('0x2d')],'type':_0x3675db[_0x5a09('0x2e')][_0x5a09('0x2f')]};});_0x156c66[_0x5a09('0x30')]=_[_0x5a09('0x2b')](_0x32bc94,_0x5a09('0x29'));_0x156c66[_0x5a09('0x31')]=_[_0x5a09('0x32')](_0x2a1a1b['query']);_0x156c66[_0x5a09('0x33')]=_[_0x5a09('0x34')](_0x156c66[_0x5a09('0x30')],_0x156c66[_0x5a09('0x31')]);_0xb0edec['attributes']=_[_0x5a09('0x34')](_0x156c66[_0x5a09('0x30')],qs[_0x5a09('0x35')](_0x2a1a1b[_0x5a09('0x31')][_0x5a09('0x35')]));_0xb0edec['attributes']=_0xb0edec[_0x5a09('0x36')][_0x5a09('0x37')]?_0xb0edec[_0x5a09('0x36')]:_0x156c66[_0x5a09('0x30')];if(!_0x2a1a1b[_0x5a09('0x31')][_0x5a09('0x38')](_0x5a09('0x39'))){_0xb0edec[_0x5a09('0x20')]=qs[_0x5a09('0x20')](_0x2a1a1b[_0x5a09('0x31')]['limit']);_0xb0edec[_0x5a09('0x1f')]=qs['offset'](_0x2a1a1b[_0x5a09('0x31')][_0x5a09('0x1f')]);}_0xb0edec[_0x5a09('0x3a')]=qs[_0x5a09('0x3b')](_0x2a1a1b['query'][_0x5a09('0x3b')]);_0xb0edec[_0x5a09('0x3c')]=qs[_0x5a09('0x33')](_['pick'](_0x2a1a1b[_0x5a09('0x31')],_0x156c66['filters']),_0x32bc94);if(_0x2a1a1b['query'][_0x5a09('0x3d')]){_0xb0edec[_0x5a09('0x3c')]=_[_0x5a09('0x3e')](_0xb0edec[_0x5a09('0x3c')],{'$or':_[_0x5a09('0x2b')](_0x32bc94,function(_0x183a0b){if(_0x183a0b[_0x5a09('0x2e')]!==_0x5a09('0x3f')){var _0x21b5c8={};_0x21b5c8[_0x183a0b[_0x5a09('0x29')]]={'$like':'%'+_0x2a1a1b[_0x5a09('0x31')][_0x5a09('0x3d')]+'%'};return _0x21b5c8;}})});}_0xb0edec=_[_0x5a09('0x3e')]({},_0xb0edec,_0x2a1a1b['options']);var _0x5d9b87={'where':_0xb0edec[_0x5a09('0x3c')]};return db[_0x5a09('0x2c')][_0x5a09('0x40')](_0x5d9b87)[_0x5a09('0x26')](function(_0xd69f9f){_0x430da7['count']=_0xd69f9f;if(_0x2a1a1b[_0x5a09('0x31')][_0x5a09('0x41')]){_0xb0edec['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0x5a09('0x42')](_0xb0edec);})['then'](function(_0x1b5997){_0x430da7[_0x5a09('0x43')]=_0x1b5997;return _0x430da7;})[_0x5a09('0x26')](respondWithFilteredResult(_0x597ffc,_0xb0edec))[_0x5a09('0x44')](handleError(_0x597ffc,null));};exports['show']=function(_0x35b90f,_0x30e036){var _0xcaecc6={'raw':!![],'where':{'id':_0x35b90f['params']['id']}},_0x33d2a2={};_0x33d2a2[_0x5a09('0x30')]=_[_0x5a09('0x32')](db[_0x5a09('0x2c')][_0x5a09('0x45')]);_0x33d2a2[_0x5a09('0x31')]=_[_0x5a09('0x32')](_0x35b90f[_0x5a09('0x31')]);_0x33d2a2['filters']=_[_0x5a09('0x34')](_0x33d2a2[_0x5a09('0x30')],_0x33d2a2[_0x5a09('0x31')]);_0xcaecc6[_0x5a09('0x36')]=_['intersection'](_0x33d2a2[_0x5a09('0x30')],qs[_0x5a09('0x35')](_0x35b90f[_0x5a09('0x31')][_0x5a09('0x35')]));_0xcaecc6[_0x5a09('0x36')]=_0xcaecc6[_0x5a09('0x36')][_0x5a09('0x37')]?_0xcaecc6[_0x5a09('0x36')]:_0x33d2a2[_0x5a09('0x30')];if(_0x35b90f[_0x5a09('0x31')]['includeAll']){_0xcaecc6[_0x5a09('0x46')]=[{'all':!![]}];}_0xcaecc6=_[_0x5a09('0x3e')]({},_0xcaecc6,_0x35b90f['options']);return db['ChatInternalMessage'][_0x5a09('0x47')](_0xcaecc6)[_0x5a09('0x26')](handleEntityNotFound(_0x30e036,null))['then'](respondWithResult(_0x30e036,null))['catch'](handleError(_0x30e036,null));};exports[_0x5a09('0x48')]=function(_0x232e2f,_0x2415f0){return db[_0x5a09('0x2c')][_0x5a09('0x48')](_0x232e2f['body'],{})[_0x5a09('0x26')](respondWithResult(_0x2415f0,0xc9))['catch'](handleError(_0x2415f0,null));};exports['update']=function(_0x5399ce,_0x2611b3){if(_0x5399ce['body']['id']){delete _0x5399ce[_0x5a09('0x49')]['id'];}return db[_0x5a09('0x2c')][_0x5a09('0x47')]({'where':{'id':_0x5399ce[_0x5a09('0x4a')]['id']}})[_0x5a09('0x26')](handleEntityNotFound(_0x2611b3,null))[_0x5a09('0x26')](saveUpdates(_0x5399ce[_0x5a09('0x49')],null))[_0x5a09('0x26')](respondWithResult(_0x2611b3,null))['catch'](handleError(_0x2611b3,null));};exports[_0x5a09('0x4b')]=function(_0x4259f0,_0x4d10a2){return db[_0x5a09('0x2c')]['find']({'where':{'id':_0x4259f0['params']['id']}})[_0x5a09('0x26')](handleEntityNotFound(_0x4d10a2,null))[_0x5a09('0x26')](removeEntity(_0x4d10a2,null))[_0x5a09('0x44')](handleError(_0x4d10a2,null));};exports[_0x5a09('0x4c')]=function(_0x25b741,_0x508091){return db[_0x5a09('0x2c')][_0x5a09('0x4c')]()[_0x5a09('0x26')](respondWithResult(_0x508091,null))[_0x5a09('0x44')](handleError(_0x508091,null));};function wrapUser(_0x55b1f0){return function(_0x534caf){var _0x5dc435=_0x55b1f0['get']({'plain':!![]});_0x5dc435[_0x5a09('0x4d')]=[];if(_0x534caf){_0x5dc435['lastMessageAt']=_0x534caf[_0x5a09('0x4e')];_0x5dc435[_0x5a09('0x4f')]=_0x534caf;}else{_0x5dc435[_0x5a09('0x50')]=moment(0x0)['format'](_0x5a09('0x51'));_0x5dc435['lastMessage']={};}return _0x5dc435;};}exports[_0x5a09('0x52')]=function(_0x3214ac,_0x24f703,_0xd3eb21){var _0x535ccc=[];return db[_0x5a09('0x53')][_0x5a09('0x42')]({'where':{'role':['agent','admin',_0x5a09('0x54')]},'attributes':['id',_0x5a09('0x55'),_0x5a09('0x29'),_0x5a09('0x56'),_0x5a09('0x57'),_0x5a09('0x58'),'online',_0x5a09('0x59'),_0x5a09('0x5a'),_0x5a09('0x5b')],'order':qs[_0x5a09('0x3b')]('-online'),'include':[{'model':db[_0x5a09('0x5c')],'as':'VoiceQueues','attributes':['id',_0x5a09('0x29'),_0x5a09('0x2e')],'through':{'attributes':[]}}]})[_0x5a09('0x26')](function(_0x496774){if(_0x496774){var _0x513fcc=_0x3214ac[_0x5a09('0x54')]['get']({'plain':!![]});if(!_0x513fcc)throw new Error(_0x5a09('0x5d'));if(_0x513fcc[_0x5a09('0x56')]===_0x5a09('0x54')){return db['UserProfileSection']['find']({'where':{'name':_0x5a09('0x5e'),'userProfileId':_0x513fcc[_0x5a09('0x5f')]},'raw':!![]})[_0x5a09('0x26')](function(_0x4635e8){if(_0x4635e8){if(_0x4635e8[_0x5a09('0x60')]===0x0){return db[_0x5a09('0x61')]['findAll']({'where':{'sectionId':_0x4635e8['id']},'raw':!![]})[_0x5a09('0x26')](function(_0x106122){var _0x1935bc=[];if(_[_0x5a09('0x62')](_0x106122)){_0x1935bc=_['filter'](_0x496774,function(_0x33fda9){if(_0x33fda9[_0x5a09('0x56')]!=='agent'){return _0x33fda9;}});return _0x1935bc;}else{for(var _0x12f807=0x0;_0x12f807<_0x496774[_0x5a09('0x37')];_0x12f807++){var _0x460187=_0x496774[_0x12f807];if(_0x460187['role']===_0x5a09('0x63')){var _0x53099e=_[_0x5a09('0x47')](_0x106122,function(_0x5679b4){return _0x5679b4[_0x5a09('0x64')]===_0x460187['id'];});if(_0x53099e)_0x1935bc[_0x5a09('0x65')](_0x460187);}else{_0x1935bc[_0x5a09('0x65')](_0x460187);}}return _0x1935bc;}});}else{return _0x496774;}}else{var _0x423c68=_[_0x5a09('0x3d')](_0x496774,function(_0x1403d6){if(_0x1403d6[_0x5a09('0x56')]!==_0x5a09('0x63')){return _0x1403d6;}});return _0x423c68;}});}else{return _0x496774;}}})[_0x5a09('0x26')](function(_0xb2f805){var _0x226435=[];if(_0xb2f805){_0x535ccc=_0xb2f805;for(var _0x4a0fad=0x0;_0x4a0fad<_0xb2f805[_0x5a09('0x37')];_0x4a0fad+=0x1){_0x535ccc[_0x4a0fad][_0x5a09('0x4d')]=[];_0x226435[_0x5a09('0x65')](db[_0x5a09('0x2c')][_0x5a09('0x47')]({'where':{'FromId':[_0x3214ac['user']['id'],_0xb2f805[_0x4a0fad]['id']],'ToId':[_0x3214ac[_0x5a09('0x54')]['id'],_0xb2f805[_0x4a0fad]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x5a09('0x66'),'ToId','read',_0x5a09('0x49')],'order':qs[_0x5a09('0x3b')](_0x5a09('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5a09('0x26')](wrapUser(_0xb2f805[_0x4a0fad])));}return BPromise[_0x5a09('0x68')](_0x226435);}return[];})[_0x5a09('0x26')](function(_0x1eddd0){return{'rows':_0x1eddd0,'count':_0x1eddd0['length']};})['then'](respondWithResult(_0x24f703,null))[_0x5a09('0x44')](handleError(_0x24f703,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 5deba57..21c7b07 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 _0x689b=['hook','exports','events','ChatInternalMessage','update','remove','emit','hasOwnProperty'];(function(_0x488991,_0x491e2a){var _0x52fa69=function(_0x264ca8){while(--_0x264ca8){_0x488991['push'](_0x488991['shift']());}};_0x52fa69(++_0x491e2a);}(_0x689b,0x142));var _0xb689=function(_0x480020,_0xc7b1db){_0x480020=_0x480020-0x0;var _0x364f47=_0x689b[_0x480020];return _0x364f47;};'use strict';var EventEmitter=require(_0xb689('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xb689('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb689('0x2'),'afterDestroy':_0xb689('0x3')};function emitEvent(_0x220061){return function(_0x4378a8,_0x2bcd76,_0x17ed70){ChatInternalMessageEvents[_0xb689('0x4')](_0x220061+':'+_0x4378a8['id'],_0x4378a8);ChatInternalMessageEvents['emit'](_0x220061,_0x4378a8);_0x17ed70(null);};}for(var e in events){if(events[_0xb689('0x5')](e)){var event=events[e];ChatInternalMessage[_0xb689('0x6')](e,emitEvent(event));}}module[_0xb689('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x3525=['emit','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x3a8697,_0x15a965){var _0x1da8d5=function(_0x314035){while(--_0x314035){_0x3a8697['push'](_0x3a8697['shift']());}};_0x1da8d5(++_0x15a965);}(_0x3525,0x16a));var _0x5352=function(_0x6453b,_0xd44754){_0x6453b=_0x6453b-0x0;var _0x2fd18c=_0x3525[_0x6453b];return _0x2fd18c;};'use strict';var EventEmitter=require(_0x5352('0x0'));var ChatInternalMessage=require(_0x5352('0x1'))['db'][_0x5352('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5352('0x3')](0x0);var events={'afterCreate':_0x5352('0x4'),'afterUpdate':_0x5352('0x5'),'afterDestroy':_0x5352('0x6')};function emitEvent(_0x1301b9){return function(_0x39492b,_0x537148,_0x3ef38d){ChatInternalMessageEvents[_0x5352('0x7')](_0x1301b9+':'+_0x39492b['id'],_0x39492b);ChatInternalMessageEvents[_0x5352('0x7')](_0x1301b9,_0x39492b);_0x3ef38d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x5352('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 2503ad6..5aff0b5 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 _0x8bfb=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x477e24,_0x405e6b){var _0x2d82b5=function(_0x6fb74c){while(--_0x6fb74c){_0x477e24['push'](_0x477e24['shift']());}};_0x2d82b5(++_0x405e6b);}(_0x8bfb,0x1d0));var _0xb8bf=function(_0x19d2c8,_0x3eaadc){_0x19d2c8=_0x19d2c8-0x0;var _0x14805a=_0x8bfb[_0x19d2c8];return _0x14805a;};'use strict';var _=require(_0xb8bf('0x0'));var util=require(_0xb8bf('0x1'));var logger=require('../../config/logger')(_0xb8bf('0x2'));var moment=require(_0xb8bf('0x3'));var BPromise=require(_0xb8bf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb8bf('0x5'));var config=require(_0xb8bf('0x6'));var attributes=require(_0xb8bf('0x7'));module['exports']=function(_0x44f2e6,_0x1c55f6){return _0x44f2e6[_0xb8bf('0x8')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb8bf('0x9'),'collate':_0xb8bf('0xa')});};
\ No newline at end of file
+var _0x5ab7=['exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes'];(function(_0x13c2d1,_0x14355e){var _0x3d1651=function(_0x271341){while(--_0x271341){_0x13c2d1['push'](_0x13c2d1['shift']());}};_0x3d1651(++_0x14355e);}(_0x5ab7,0x1bf));var _0x75ab=function(_0x4f6d01,_0x4d9f26){_0x4f6d01=_0x4f6d01-0x0;var _0x392f88=_0x5ab7[_0x4f6d01];return _0x392f88;};'use strict';var _=require(_0x75ab('0x0'));var util=require(_0x75ab('0x1'));var logger=require(_0x75ab('0x2'))(_0x75ab('0x3'));var moment=require('moment');var BPromise=require(_0x75ab('0x4'));var rp=require(_0x75ab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x75ab('0x6'));var attributes=require(_0x75ab('0x7'));module[_0x75ab('0x8')]=function(_0x343554,_0x4da861){return _0x343554['define'](_0x75ab('0x9'),attributes,{'tableName':_0x75ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x75ab('0xb'),'collate':_0x75ab('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index cffeebe..816006e 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 _0x8781=['request\x20sent','stringify','code','error','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x8781,0x1c8));var _0x1878=function(_0x328cf0,_0x12065c){_0x328cf0=_0x328cf0-0x0;var _0xd97677=_0x8781[_0x328cf0];return _0xd97677;};'use strict';var _=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var moment=require(_0x1878('0x2'));var BPromise=require(_0x1878('0x3'));var rs=require(_0x1878('0x4'));var fs=require('fs');var Redis=require(_0x1878('0x5'));var db=require(_0x1878('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1878('0x7'))(_0x1878('0x8'));var config=require(_0x1878('0x9'));var jayson=require(_0x1878('0xa'));var client=jayson[_0x1878('0xb')][_0x1878('0xc')]({'port':0x232a});config['redis']=_[_0x1878('0xd')](config[_0x1878('0xe')],{'host':_0x1878('0xf'),'port':0x18eb});var socket=require(_0x1878('0x10'))(new Redis(config[_0x1878('0xe')]));require(_0x1878('0x11'))[_0x1878('0x12')](socket);function respondWithRpcPromise(_0x31008c,_0x3f00a4,_0x23b04b){return new BPromise(function(_0x412d55,_0x5d66e0){return client[_0x1878('0x13')](_0x31008c,_0x23b04b)[_0x1878('0x14')](function(_0x3cf2ac){logger[_0x1878('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x3f00a4,'request\x20sent');logger[_0x1878('0x16')](_0x1878('0x17'),_0x3f00a4,_0x1878('0x18'),JSON[_0x1878('0x19')](_0x3cf2ac));if(_0x3cf2ac['error']){if(_0x3cf2ac['error'][_0x1878('0x1a')]===0x1f4){logger[_0x1878('0x1b')]('ChatInternalMessage,\x20%s,\x20%s',_0x3f00a4,_0x3cf2ac[_0x1878('0x1b')][_0x1878('0x1c')]);return _0x5d66e0(_0x3cf2ac[_0x1878('0x1b')]['message']);}logger['error'](_0x1878('0x1d'),_0x3f00a4,_0x3cf2ac[_0x1878('0x1b')][_0x1878('0x1c')]);return _0x412d55(_0x3cf2ac[_0x1878('0x1b')][_0x1878('0x1c')]);}else{logger[_0x1878('0x15')](_0x1878('0x1d'),_0x3f00a4,_0x1878('0x18'));_0x412d55(_0x3cf2ac[_0x1878('0x1e')][_0x1878('0x1c')]);}})[_0x1878('0x1f')](function(_0x5a8ea3){logger['error'](_0x1878('0x1d'),_0x3f00a4,_0x5a8ea3);_0x5d66e0(_0x5a8ea3);});});}
\ No newline at end of file
+var _0xe07c=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xda0f1a,_0x42d7f6){var _0x1b8e0c=function(_0x17b3fc){while(--_0x17b3fc){_0xda0f1a['push'](_0xda0f1a['shift']());}};_0x1b8e0c(++_0x42d7f6);}(_0xe07c,0x1f3));var _0xce07=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xe07c[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xce07('0x0'));var util=require(_0xce07('0x1'));var moment=require(_0xce07('0x2'));var BPromise=require(_0xce07('0x3'));var rs=require(_0xce07('0x4'));var fs=require('fs');var Redis=require(_0xce07('0x5'));var db=require(_0xce07('0x6'))['db'];var utils=require(_0xce07('0x7'));var logger=require('../../config/logger')(_0xce07('0x8'));var config=require(_0xce07('0x9'));var jayson=require(_0xce07('0xa'));var client=jayson[_0xce07('0xb')][_0xce07('0xc')]({'port':0x232a});config[_0xce07('0xd')]=_[_0xce07('0xe')](config[_0xce07('0xd')],{'host':_0xce07('0xf'),'port':0x18eb});var socket=require(_0xce07('0x10'))(new Redis(config[_0xce07('0xd')]));require(_0xce07('0x11'))[_0xce07('0x12')](socket);function respondWithRpcPromise(_0x640036,_0x1841c8,_0x140c3e){return new BPromise(function(_0x57d108,_0x33cb49){return client[_0xce07('0x13')](_0x640036,_0x140c3e)[_0xce07('0x14')](function(_0x510afd){logger[_0xce07('0x15')](_0xce07('0x16'),_0x1841c8,_0xce07('0x17'));logger[_0xce07('0x18')](_0xce07('0x19'),_0x1841c8,'request\x20sent',JSON[_0xce07('0x1a')](_0x510afd));if(_0x510afd[_0xce07('0x1b')]){if(_0x510afd[_0xce07('0x1b')][_0xce07('0x1c')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1841c8,_0x510afd[_0xce07('0x1b')][_0xce07('0x1d')]);return _0x33cb49(_0x510afd['error'][_0xce07('0x1d')]);}logger[_0xce07('0x1b')]('ChatInternalMessage,\x20%s,\x20%s',_0x1841c8,_0x510afd['error'][_0xce07('0x1d')]);return _0x57d108(_0x510afd[_0xce07('0x1b')][_0xce07('0x1d')]);}else{logger['info'](_0xce07('0x16'),_0x1841c8,_0xce07('0x17'));_0x57d108(_0x510afd['result']['message']);}})[_0xce07('0x1e')](function(_0x20df84){logger[_0xce07('0x1b')](_0xce07('0x16'),_0x1841c8,_0x20df84);_0x33cb49(_0x20df84);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 36d07fb..e6be1af 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 _0x73dd=['emit','removeListener','./chatInternalMessage.events','save','update'];(function(_0x335dc7,_0x55f535){var _0x526df6=function(_0x3437dd){while(--_0x3437dd){_0x335dc7['push'](_0x335dc7['shift']());}};_0x526df6(++_0x55f535);}(_0x73dd,0xc5));var _0xd73d=function(_0x39a7a5,_0xc92eab){_0x39a7a5=_0x39a7a5-0x0;var _0x55aa3f=_0x73dd[_0x39a7a5];return _0x55aa3f;};'use strict';var ChatInternalMessageEvents=require(_0xd73d('0x0'));var events=[_0xd73d('0x1'),'remove',_0xd73d('0x2')];function createListener(_0xa2fe27,_0x1f4598){return function(_0x3a39a4){_0x1f4598[_0xd73d('0x3')](_0xa2fe27,_0x3a39a4);};}function removeListener(_0xc21b65,_0x1c69d8){return function(){ChatInternalMessageEvents[_0xd73d('0x4')](_0xc21b65,_0x1c69d8);};}exports['register']=function(_0x376595){for(var _0x348d68=0x0,_0x1f632f=events['length'];_0x348d68<_0x1f632f;_0x348d68++){var _0x24c10a=events[_0x348d68];var _0xa4dee5=createListener('chatInternalMessage:'+_0x24c10a,_0x376595);ChatInternalMessageEvents['on'](_0x24c10a,_0xa4dee5);}};
\ No newline at end of file
+var _0x54b2=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x1762d,_0x3976d6){var _0x390ff0=function(_0x3962bc){while(--_0x3962bc){_0x1762d['push'](_0x1762d['shift']());}};_0x390ff0(++_0x3976d6);}(_0x54b2,0x113));var _0x254b=function(_0x328bd3,_0x5231d6){_0x328bd3=_0x328bd3-0x0;var _0x5ba7d0=_0x54b2[_0x328bd3];return _0x5ba7d0;};'use strict';var ChatInternalMessageEvents=require(_0x254b('0x0'));var events=[_0x254b('0x1'),_0x254b('0x2'),_0x254b('0x3')];function createListener(_0x50b845,_0x50e4cb){return function(_0x3ed570){_0x50e4cb[_0x254b('0x4')](_0x50b845,_0x3ed570);};}function removeListener(_0x43d5d9,_0x571f13){return function(){ChatInternalMessageEvents[_0x254b('0x5')](_0x43d5d9,_0x571f13);};}exports[_0x254b('0x6')]=function(_0x2ee395){for(var _0x507e55=0x0,_0x34122d=events[_0x254b('0x7')];_0x507e55<_0x34122d;_0x507e55++){var _0x5b5e18=events[_0x507e55];var _0x150147=createListener(_0x254b('0x8')+_0x5b5e18,_0x2ee395);ChatInternalMessageEvents['on'](_0x5b5e18,_0x150147);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 577efd3..b967b31 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 _0xa141=['isAuthenticated','index','/describe','describe','/users','getUsers','/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x5ab6fb,_0x2fbddc){var _0xd0aed5=function(_0x411b71){while(--_0x411b71){_0x5ab6fb['push'](_0x5ab6fb['shift']());}};_0xd0aed5(++_0x2fbddc);}(_0xa141,0x11e));var _0x1a14=function(_0x46c4d8,_0x433a55){_0x46c4d8=_0x46c4d8-0x0;var _0x1f0e07=_0xa141[_0x46c4d8];return _0x1f0e07;};'use strict';var multer=require(_0x1a14('0x0'));var util=require('util');var path=require(_0x1a14('0x1'));var timeout=require(_0x1a14('0x2'));var express=require(_0x1a14('0x3'));var router=express[_0x1a14('0x4')]();var fs_extra=require(_0x1a14('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a14('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x1a14('0x7')]('/',auth[_0x1a14('0x8')](),controller[_0x1a14('0x9')]);router['get'](_0x1a14('0xa'),auth[_0x1a14('0x8')](),controller[_0x1a14('0xb')]);router['get'](_0x1a14('0xc'),auth['isAuthenticated'](),controller[_0x1a14('0xd')]);router[_0x1a14('0x7')](_0x1a14('0xe'),auth[_0x1a14('0x8')](),controller['show']);router[_0x1a14('0xf')]('/',auth[_0x1a14('0x8')](),controller[_0x1a14('0x10')]);router['put']('/:id',controller[_0x1a14('0x11')]);router[_0x1a14('0x12')](_0x1a14('0xe'),auth[_0x1a14('0x8')](),controller[_0x1a14('0x13')]);module[_0x1a14('0x14')]=router;
\ No newline at end of file
+var _0x2dd6=['/describe','isAuthenticated','describe','getUsers','/:id','show','post','create','destroy','exports','multer','connect-timeout','Router','fs-extra','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x1aa93c,_0x18bc9b){var _0x4720e6=function(_0x1b1a97){while(--_0x1b1a97){_0x1aa93c['push'](_0x1aa93c['shift']());}};_0x4720e6(++_0x18bc9b);}(_0x2dd6,0x81));var _0x62dd=function(_0x409542,_0x5921c9){_0x409542=_0x409542-0x0;var _0x4cdf40=_0x2dd6[_0x409542];return _0x4cdf40;};'use strict';var multer=require(_0x62dd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x62dd('0x1'));var express=require('express');var router=express[_0x62dd('0x2')]();var fs_extra=require(_0x62dd('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x62dd('0x4'));var controller=require(_0x62dd('0x5'));router[_0x62dd('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x62dd('0x6')](_0x62dd('0x7'),auth[_0x62dd('0x8')](),controller[_0x62dd('0x9')]);router['get']('/users',auth['isAuthenticated'](),controller[_0x62dd('0xa')]);router['get'](_0x62dd('0xb'),auth['isAuthenticated'](),controller[_0x62dd('0xc')]);router[_0x62dd('0xd')]('/',auth[_0x62dd('0x8')](),controller[_0x62dd('0xe')]);router['put'](_0x62dd('0xb'),controller['update']);router['delete'](_0x62dd('0xb'),auth[_0x62dd('0x8')](),controller[_0x62dd('0xf')]);module[_0x62dd('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 8fe1e4b..cedad22 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 _0x173d=['exports','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x416d60,_0x56dde9){var _0x286bd7=function(_0x38ba01){while(--_0x38ba01){_0x416d60['push'](_0x416d60['shift']());}};_0x286bd7(++_0x56dde9);}(_0x173d,0x108));var _0xd173=function(_0x17df10,_0x5384be){_0x17df10=_0x17df10-0x0;var _0x2a114b=_0x173d[_0x17df10];return _0x2a114b;};'use strict';var Sequelize=require('sequelize');module[_0xd173('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd173('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd173('0x2')]('in',_0xd173('0x3')),'defaultValue':_0xd173('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd173('0x4')]},'providerName':{'type':Sequelize[_0xd173('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2547=['TEXT','medium','BOOLEAN','ENUM','out','STRING','exports'];(function(_0x2fe986,_0x194907){var _0x360558=function(_0x4c284f){while(--_0x4c284f){_0x2fe986['push'](_0x2fe986['shift']());}};_0x360558(++_0x194907);}(_0x2547,0x1cd));var _0x7254=function(_0x471b87,_0x2e88ed){_0x471b87=_0x471b87-0x0;var _0x3a1236=_0x2547[_0x471b87];return _0x3a1236;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'body':{'type':Sequelize[_0x7254('0x1')](_0x7254('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7254('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7254('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7254('0x4')]('in',_0x7254('0x5')),'defaultValue':_0x7254('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x7254('0x6')]},'providerResponse':{'type':Sequelize[_0x7254('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index d10f547..aaaca30 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 _0xb7d8=['rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','create','body','describe','../../config/logger','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','rejectmessage','eml-format'];(function(_0x226232,_0x43950b){var _0x3d8e6d=function(_0x508951){while(--_0x508951){_0x226232['push'](_0x226232['shift']());}};_0x3d8e6d(++_0x43950b);}(_0xb7d8,0x113));var _0x8b7d=function(_0x3aff19,_0x57873f){_0x3aff19=_0x3aff19-0x0;var _0x909e1a=_0xb7d8[_0x3aff19];return _0x909e1a;};'use strict';var emlformat=require(_0x8b7d('0x0'));var rimraf=require(_0x8b7d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b7d('0x2'));var moment=require(_0x8b7d('0x3'));var BPromise=require(_0x8b7d('0x4'));var Mustache=require(_0x8b7d('0x5'));var util=require(_0x8b7d('0x6'));var path=require(_0x8b7d('0x7'));var sox=require('sox');var csv=require(_0x8b7d('0x8'));var ejs=require(_0x8b7d('0x9'));var fs=require('fs');var fs_extra=require(_0x8b7d('0xa'));var _=require(_0x8b7d('0xb'));var squel=require(_0x8b7d('0xc'));var crypto=require(_0x8b7d('0xd'));var jsforce=require(_0x8b7d('0xe'));var deskjs=require(_0x8b7d('0xf'));var toCsv=require(_0x8b7d('0x8'));var querystring=require(_0x8b7d('0x10'));var Papa=require(_0x8b7d('0x11'));var Redis=require(_0x8b7d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8b7d('0x13'));var as=require(_0x8b7d('0x14'));var hardwareService=require(_0x8b7d('0x15'));var logger=require('../../config/logger')(_0x8b7d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b7d('0x17'));var db=require('../../mysqldb')['db'];config[_0x8b7d('0x18')]=_[_0x8b7d('0x19')](config[_0x8b7d('0x18')],{'host':_0x8b7d('0x1a'),'port':0x18eb});var socket=require(_0x8b7d('0x1b'))(new Redis(config[_0x8b7d('0x18')]));require('./chatMessage.socket')[_0x8b7d('0x1c')](socket);var jayson=require(_0x8b7d('0x1d'));var client=jayson[_0x8b7d('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0x8b7d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x213a28,_0x5afe87,_0x4f1483,_0x221759){return new BPromise(function(_0x1fdbe4,_0x858592){var _0x385b98=_0x221759||client;return _0x385b98['request'](_0x213a28,_0x4f1483)['then'](function(_0x57e5ab){logger[_0x8b7d('0x20')](_0x8b7d('0x21'),_0x5afe87,_0x8b7d('0x22'));logger['debug'](_0x8b7d('0x23'),_0x5afe87,_0x8b7d('0x22'),JSON['stringify'](_0x57e5ab));if(_0x57e5ab[_0x8b7d('0x24')]){if(_0x57e5ab[_0x8b7d('0x24')][_0x8b7d('0x25')]===0x1f4){logger[_0x8b7d('0x24')](_0x8b7d('0x21'),_0x5afe87,_0x57e5ab[_0x8b7d('0x24')]['message']);return _0x858592(_0x57e5ab[_0x8b7d('0x24')][_0x8b7d('0x26')]);}logger['error'](_0x8b7d('0x21'),_0x5afe87,_0x57e5ab[_0x8b7d('0x24')][_0x8b7d('0x26')]);return _0x1fdbe4(_0x57e5ab[_0x8b7d('0x24')][_0x8b7d('0x26')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x5afe87,_0x8b7d('0x22'));_0x1fdbe4(_0x57e5ab[_0x8b7d('0x27')][_0x8b7d('0x26')]);}})[_0x8b7d('0x28')](function(_0x2ace11){logger[_0x8b7d('0x24')](_0x8b7d('0x21'),_0x5afe87,_0x2ace11);_0x858592(_0x2ace11);});});}function respondWithStatusCode(_0x1126af,_0x428ef8){_0x428ef8=_0x428ef8||0xcc;return function(_0x8e81d){if(_0x8e81d){return _0x1126af[_0x8b7d('0x29')](_0x428ef8);}return _0x1126af[_0x8b7d('0x2a')](_0x428ef8)['end']();};}function respondWithResult(_0x4f3232,_0x5899ab){_0x5899ab=_0x5899ab||0xc8;return function(_0x43b9d9){if(_0x43b9d9){return _0x4f3232['status'](_0x5899ab)['json'](_0x43b9d9);}};}function respondWithFilteredResult(_0xf6f047,_0x3ff0d4){return function(_0x4fc405){if(_0x4fc405){var _0x2bf948=typeof _0x3ff0d4['offset']===_0x8b7d('0x2b')&&typeof _0x3ff0d4['limit']===_0x8b7d('0x2b');var _0x51805b=_0x4fc405[_0x8b7d('0x2c')];var _0x1db041=_0x2bf948?0x0:_0x3ff0d4[_0x8b7d('0x2d')];var _0x591242=_0x2bf948?_0x4fc405[_0x8b7d('0x2c')]:_0x3ff0d4['offset']+_0x3ff0d4['limit'];var _0x47d2d9;if(_0x591242>=_0x51805b){_0x591242=_0x51805b;_0x47d2d9=0xc8;}else{_0x47d2d9=0xce;}_0xf6f047[_0x8b7d('0x2a')](_0x47d2d9);return _0xf6f047[_0x8b7d('0x2e')](_0x8b7d('0x2f'),_0x1db041+'-'+_0x591242+'/'+_0x51805b)[_0x8b7d('0x30')](_0x4fc405);}return null;};}function patchUpdates(_0x7d82cc){return function(_0x20c56b){try{jsonpatch[_0x8b7d('0x31')](_0x20c56b,_0x7d82cc,!![]);}catch(_0x4f1ab1){return BPromise[_0x8b7d('0x32')](_0x4f1ab1);}return _0x20c56b[_0x8b7d('0x33')]();};}function saveUpdates(_0x3a5e71,_0xa6fc0d){return function(_0x4e0d19){if(_0x4e0d19){return _0x4e0d19[_0x8b7d('0x34')](_0x3a5e71)['then'](function(_0x3031ec){return _0x3031ec;});}return null;};}function removeEntity(_0x931dc0,_0x4c5d4a){return function(_0x25e163){if(_0x25e163){return _0x25e163[_0x8b7d('0x35')]()[_0x8b7d('0x36')](function(){_0x931dc0[_0x8b7d('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfadcf,_0x197464){return function(_0x5d8a92){if(!_0x5d8a92){_0xfadcf[_0x8b7d('0x29')](0x194);}return _0x5d8a92;};}function handleError(_0x1c92ec,_0x1b23c7){_0x1b23c7=_0x1b23c7||0x1f4;return function(_0x21cda2){logger[_0x8b7d('0x24')](_0x21cda2[_0x8b7d('0x37')]);if(_0x21cda2[_0x8b7d('0x38')]){delete _0x21cda2[_0x8b7d('0x38')];}_0x1c92ec[_0x8b7d('0x2a')](_0x1b23c7)[_0x8b7d('0x39')](_0x21cda2);};}exports['index']=function(_0x333d37,_0x3936d2){var _0x6274d6={},_0x5c6b4a={},_0x1ead79={'count':0x0,'rows':[]};var _0x3203c4=_[_0x8b7d('0x3a')](db[_0x8b7d('0x3b')]['rawAttributes'],function(_0x276741){return{'name':_0x276741[_0x8b7d('0x3c')],'type':_0x276741[_0x8b7d('0x3d')][_0x8b7d('0x3e')]};});_0x5c6b4a[_0x8b7d('0x3f')]=_['map'](_0x3203c4,_0x8b7d('0x38'));_0x5c6b4a[_0x8b7d('0x40')]=_[_0x8b7d('0x41')](_0x333d37['query']);_0x5c6b4a[_0x8b7d('0x42')]=_[_0x8b7d('0x43')](_0x5c6b4a[_0x8b7d('0x3f')],_0x5c6b4a['query']);_0x6274d6[_0x8b7d('0x44')]=_[_0x8b7d('0x43')](_0x5c6b4a[_0x8b7d('0x3f')],qs[_0x8b7d('0x45')](_0x333d37['query'][_0x8b7d('0x45')]));_0x6274d6[_0x8b7d('0x44')]=_0x6274d6[_0x8b7d('0x44')]['length']?_0x6274d6[_0x8b7d('0x44')]:_0x5c6b4a[_0x8b7d('0x3f')];if(!_0x333d37[_0x8b7d('0x40')][_0x8b7d('0x46')](_0x8b7d('0x47'))){_0x6274d6[_0x8b7d('0x48')]=qs[_0x8b7d('0x48')](_0x333d37[_0x8b7d('0x40')]['limit']);_0x6274d6[_0x8b7d('0x2d')]=qs[_0x8b7d('0x2d')](_0x333d37[_0x8b7d('0x40')]['offset']);}_0x6274d6[_0x8b7d('0x49')]=qs[_0x8b7d('0x4a')](_0x333d37[_0x8b7d('0x40')][_0x8b7d('0x4a')]);_0x6274d6[_0x8b7d('0x4b')]=qs[_0x8b7d('0x42')](_[_0x8b7d('0x4c')](_0x333d37['query'],_0x5c6b4a['filters']),_0x3203c4);if(_0x333d37[_0x8b7d('0x40')][_0x8b7d('0x4d')]){_0x6274d6[_0x8b7d('0x4b')]=_[_0x8b7d('0x4e')](_0x6274d6[_0x8b7d('0x4b')],{'$or':_[_0x8b7d('0x3a')](_0x3203c4,function(_0x4d385b){if(_0x4d385b[_0x8b7d('0x3d')]!==_0x8b7d('0x4f')){var _0x1612a9={};_0x1612a9[_0x4d385b['name']]={'$like':'%'+_0x333d37[_0x8b7d('0x40')][_0x8b7d('0x4d')]+'%'};return _0x1612a9;}})});}_0x6274d6=_['merge']({},_0x6274d6,_0x333d37[_0x8b7d('0x50')]);var _0x1da5e4={'where':_0x6274d6[_0x8b7d('0x4b')]};return db[_0x8b7d('0x3b')][_0x8b7d('0x2c')](_0x1da5e4)[_0x8b7d('0x36')](function(_0x540787){_0x1ead79[_0x8b7d('0x2c')]=_0x540787;if(_0x333d37[_0x8b7d('0x40')][_0x8b7d('0x51')]){_0x6274d6[_0x8b7d('0x52')]=[{'all':!![]}];}return db[_0x8b7d('0x3b')][_0x8b7d('0x53')](_0x6274d6);})[_0x8b7d('0x36')](function(_0x2bbd78){_0x1ead79[_0x8b7d('0x54')]=_0x2bbd78;return _0x1ead79;})[_0x8b7d('0x36')](respondWithFilteredResult(_0x3936d2,_0x6274d6))['catch'](handleError(_0x3936d2,null));};exports['show']=function(_0x31ee6d,_0x28805a){var _0x851c1f={'raw':!![],'where':{'id':_0x31ee6d[_0x8b7d('0x55')]['id']}},_0x58c527={};_0x58c527[_0x8b7d('0x3f')]=_[_0x8b7d('0x41')](db['ChatMessage'][_0x8b7d('0x56')]);_0x58c527['query']=_['keys'](_0x31ee6d['query']);_0x58c527['filters']=_[_0x8b7d('0x43')](_0x58c527[_0x8b7d('0x3f')],_0x58c527[_0x8b7d('0x40')]);_0x851c1f[_0x8b7d('0x44')]=_['intersection'](_0x58c527[_0x8b7d('0x3f')],qs[_0x8b7d('0x45')](_0x31ee6d[_0x8b7d('0x40')][_0x8b7d('0x45')]));_0x851c1f['attributes']=_0x851c1f[_0x8b7d('0x44')][_0x8b7d('0x57')]?_0x851c1f[_0x8b7d('0x44')]:_0x58c527[_0x8b7d('0x3f')];if(_0x31ee6d['query']['includeAll']){_0x851c1f['include']=[{'all':!![]}];}_0x851c1f=_[_0x8b7d('0x4e')]({},_0x851c1f,_0x31ee6d['options']);return db['ChatMessage'][_0x8b7d('0x58')](_0x851c1f)[_0x8b7d('0x36')](handleEntityNotFound(_0x28805a,null))['then'](respondWithResult(_0x28805a,null))['catch'](handleError(_0x28805a,null));};exports[_0x8b7d('0x59')]=function(_0x1e2e83,_0x4faba7){return db[_0x8b7d('0x3b')]['create'](_0x1e2e83[_0x8b7d('0x5a')],{})['then'](respondWithResult(_0x4faba7,0xc9))['catch'](handleError(_0x4faba7,null));};exports[_0x8b7d('0x34')]=function(_0x325129,_0x7b542){if(_0x325129[_0x8b7d('0x5a')]['id']){delete _0x325129[_0x8b7d('0x5a')]['id'];}return db['ChatMessage'][_0x8b7d('0x58')]({'where':{'id':_0x325129[_0x8b7d('0x55')]['id']}})[_0x8b7d('0x36')](handleEntityNotFound(_0x7b542,null))[_0x8b7d('0x36')](saveUpdates(_0x325129[_0x8b7d('0x5a')],null))['then'](respondWithResult(_0x7b542,null))[_0x8b7d('0x28')](handleError(_0x7b542,null));};exports[_0x8b7d('0x35')]=function(_0x11d7c1,_0x3a9147){return db[_0x8b7d('0x3b')]['find']({'where':{'id':_0x11d7c1[_0x8b7d('0x55')]['id']}})[_0x8b7d('0x36')](handleEntityNotFound(_0x3a9147,null))['then'](removeEntity(_0x3a9147,null))[_0x8b7d('0x28')](handleError(_0x3a9147,null));};exports[_0x8b7d('0x5b')]=function(_0x51c1ad,_0x2023a2){return db['ChatMessage']['describe']()[_0x8b7d('0x36')](respondWithResult(_0x2023a2,null))['catch'](handleError(_0x2023a2,null));};var interaction_log=require(_0x8b7d('0x5c'))('chat-interactions');exports[_0x8b7d('0x5d')]=function(_0x3e04e0,_0x52867f,_0x4992c2){var _0xfd0f04={'agent':{},'channel':_0x8b7d('0x5e')};if(_0x3e04e0['body']['id']){delete _0x3e04e0[_0x8b7d('0x5a')]['id'];}_0x3e04e0['body']['read']=!![];_0x3e04e0['body'][_0x8b7d('0x5f')]=moment()[_0x8b7d('0x60')](_0x8b7d('0x61'));_0x3e04e0[_0x8b7d('0x5a')][_0x8b7d('0x62')]=_0x3e04e0[_0x8b7d('0x5a')]['UserId']||_0x3e04e0[_0x8b7d('0x63')]['id'];_0xfd0f04[_0x8b7d('0x64')]['id']=_0x3e04e0[_0x8b7d('0x5a')][_0x8b7d('0x62')];return db['ChatMessage'][_0x8b7d('0x58')]({'where':{'id':_0x3e04e0[_0x8b7d('0x55')]['id'],'UserId':null}})[_0x8b7d('0x36')](handleEntityNotFound(_0x52867f,null))['then'](saveUpdates(_0x3e04e0[_0x8b7d('0x5a')],null))['then'](function(_0x310cb9){if(_0x310cb9){_0xfd0f04[_0x8b7d('0x26')]=_0x310cb9['get']({'plain':!![]});return db[_0x8b7d('0x65')][_0x8b7d('0x58')]({'where':{'id':_0x310cb9[_0x8b7d('0x66')]}});}return null;})[_0x8b7d('0x36')](handleEntityNotFound(_0x52867f,null))[_0x8b7d('0x36')](function(_0x31df11){if(_0x31df11){return _0x31df11[_0x8b7d('0x34')]({'UserId':_0x3e04e0[_0x8b7d('0x5a')][_0x8b7d('0x62')],'read1stAt':_[_0x8b7d('0x67')](_0x31df11[_0x8b7d('0x68')])?moment()[_0x8b7d('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x3d0a3a){if(_0x3d0a3a){_0xfd0f04[_0x8b7d('0x69')]=_0x3d0a3a[_0x8b7d('0x6a')]({'plain':!![]});interaction_log[_0x8b7d('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3e04e0[_0x8b7d('0x63')]['id'],_0x3e04e0[_0x8b7d('0x63')][_0x8b7d('0x38')],_0x3e04e0[_0x8b7d('0x63')]['role'],_0xfd0f04[_0x8b7d('0x69')]['id'],_0x3e04e0[_0x8b7d('0x5a')]?JSON[_0x8b7d('0x6b')](_0x3e04e0['body']):_0x8b7d('0x6c'));return respondWithRpcPromise(_0x8b7d('0x6d'),_0x8b7d('0x6e'),_0xfd0f04);}return null;})[_0x8b7d('0x36')](function(_0x6d44ca){var _0x2ae086=_0x8b7d('0x6f')+_0x6d44ca[_0x8b7d('0x26')][_0x8b7d('0x70')];return db['sequelize'][_0x8b7d('0x40')](_0x2ae086,{'type':db[_0x8b7d('0x71')][_0x8b7d('0x72')][_0x8b7d('0x73')],'raw':!![]})[_0x8b7d('0x36')](function(_0x22ef9b){return _0x22ef9b;});})['then'](function(_0x4f4698){if(_0x4f4698){_0xfd0f04[_0x8b7d('0x26')][_0x8b7d('0x74')]=_0x4f4698[0x0];if(!_0x3e04e0[_0x8b7d('0x5a')][_0x8b7d('0x62')])return;return db[_0x8b7d('0x75')][_0x8b7d('0x58')]({'where':{'id':_0x3e04e0[_0x8b7d('0x5a')][_0x8b7d('0x62')],'role':_0x8b7d('0x64')},'attributes':['id',_0x8b7d('0x38'),_0x8b7d('0x76'),_0x8b7d('0x77'),_0x8b7d('0x78')],'raw':!![]});}return null;})[_0x8b7d('0x36')](function(_0x53eb21){if(!_0x53eb21)return null;_0xfd0f04[_0x8b7d('0x26')]['agent']=_0x53eb21;return _0xfd0f04;})[_0x8b7d('0x36')](function(_0x35c27b){if(_0x35c27b){if(_0x3e04e0[_0x8b7d('0x5a')][_0x8b7d('0x79')]){_0xfd0f04[_0x8b7d('0x26')][_0x8b7d('0x7a')]=util[_0x8b7d('0x60')](_0x8b7d('0x7b'),_0x3e04e0[_0x8b7d('0x63')][_0x8b7d('0x38')]);_0xfd0f04['message'][_0x8b7d('0x7c')]=_0xfd0f04[_0x8b7d('0x7c')];_0xfd0f04[_0x8b7d('0x26')][_0x8b7d('0x7d')]=_0xfd0f04[_0x8b7d('0x7c')];_0xfd0f04['message'][_0x8b7d('0x7e')]=_0x8b7d('0x5d');return respondWithRpcPromise(_0x8b7d('0x7f'),'EventManager',{'event':_0x8b7d('0x80'),'message':_[_0x8b7d('0x4e')](_0xfd0f04[_0x8b7d('0x26')],JSON[_0x8b7d('0x81')](_0xfd0f04[_0x8b7d('0x69')][_0x8b7d('0x82')]))},client9002)[_0x8b7d('0x36')](function(){return _0xfd0f04;});}return _0xfd0f04;}return null;})['then'](respondWithResult(_0x52867f,null))['catch'](handleError(_0x52867f,null));};var interaction_log=require(_0x8b7d('0x5c'))(_0x8b7d('0x83'));exports[_0x8b7d('0x32')]=function(_0x1f9f8c,_0xb74350,_0x1864d6){var _0x37ee05={'agent':{},'channel':_0x8b7d('0x5e')};if(_0x1f9f8c[_0x8b7d('0x5a')]['id']){delete _0x1f9f8c[_0x8b7d('0x5a')]['id'];}_0x1f9f8c[_0x8b7d('0x5a')][_0x8b7d('0x62')]=_0x1f9f8c[_0x8b7d('0x5a')][_0x8b7d('0x62')]||_0x1f9f8c['user']['id'];_0x37ee05[_0x8b7d('0x64')]['id']=_0x1f9f8c['body'][_0x8b7d('0x62')];return db[_0x8b7d('0x3b')][_0x8b7d('0x58')]({'where':{'id':_0x1f9f8c['params']['id'],'UserId':null}})[_0x8b7d('0x36')](handleEntityNotFound(_0xb74350,null))[_0x8b7d('0x36')](function(_0x10b3f4){if(_0x10b3f4){_0x37ee05['message']=_0x10b3f4[_0x8b7d('0x6a')]({'plain':!![]});return db[_0x8b7d('0x65')][_0x8b7d('0x58')]({'where':{'id':_0x10b3f4[_0x8b7d('0x66')]}});}return null;})[_0x8b7d('0x36')](handleEntityNotFound(_0xb74350,null))[_0x8b7d('0x36')](function(_0x490f0c){if(_0x490f0c){_0x37ee05[_0x8b7d('0x69')]=_0x490f0c[_0x8b7d('0x6a')]({'plain':!![]});interaction_log[_0x8b7d('0x20')](_0x8b7d('0x84'),_0x1f9f8c[_0x8b7d('0x63')]['id'],_0x1f9f8c[_0x8b7d('0x63')][_0x8b7d('0x38')],_0x1f9f8c['user'][_0x8b7d('0x85')],_0x37ee05[_0x8b7d('0x69')]['id'],_0x1f9f8c[_0x8b7d('0x5a')]?JSON['stringify'](_0x1f9f8c['body']):_0x8b7d('0x6c'));return respondWithRpcPromise(_0x8b7d('0x86'),_0x8b7d('0x87'),_0x37ee05);}return null;})[_0x8b7d('0x36')](function(_0x21c502){var _0x42df83=_0x8b7d('0x6f')+_0x21c502[_0x8b7d('0x26')]['ContactId'];return db[_0x8b7d('0x88')]['query'](_0x42df83,{'type':db[_0x8b7d('0x71')][_0x8b7d('0x72')][_0x8b7d('0x73')],'raw':!![]})[_0x8b7d('0x36')](function(_0x83896){return _0x83896;});})['then'](function(_0x305525){if(_0x305525){_0x37ee05[_0x8b7d('0x26')][_0x8b7d('0x74')]=_0x305525[0x0];if(!_0x1f9f8c[_0x8b7d('0x5a')][_0x8b7d('0x62')])return;return db[_0x8b7d('0x75')][_0x8b7d('0x58')]({'where':{'id':_0x1f9f8c[_0x8b7d('0x5a')][_0x8b7d('0x62')],'role':_0x8b7d('0x64')},'attributes':['id',_0x8b7d('0x38'),_0x8b7d('0x76'),_0x8b7d('0x77'),'internal'],'raw':!![]});}return null;})[_0x8b7d('0x36')](function(_0xbdfe8b){if(!_0xbdfe8b)return null;_0x37ee05['message'][_0x8b7d('0x64')]=_0xbdfe8b;return _0x37ee05;})[_0x8b7d('0x36')](function(_0xe70953){if(_0xe70953){_0xe70953[_0x8b7d('0x26')]['interface']=util[_0x8b7d('0x60')]('SIP/%s',_0x1f9f8c[_0x8b7d('0x63')][_0x8b7d('0x38')]);_0xe70953['message'][_0x8b7d('0x7c')]=_0x37ee05[_0x8b7d('0x7c')];_0xe70953[_0x8b7d('0x26')][_0x8b7d('0x7d')]=_0x37ee05[_0x8b7d('0x7c')];_0xe70953[_0x8b7d('0x26')][_0x8b7d('0x7e')]=_0x8b7d('0x32');respondWithRpcPromise(_0x8b7d('0x7f'),_0x8b7d('0x7f'),{'event':_0x8b7d('0x89'),'message':_[_0x8b7d('0x4e')](_0x37ee05['message'],JSON[_0x8b7d('0x81')](_0x37ee05['interaction'][_0x8b7d('0x82')]))},client9002);return _0x37ee05;}return null;})[_0x8b7d('0x36')](respondWithResult(_0xb74350,null))['catch'](handleError(_0xb74350,null));};
\ No newline at end of file
+var _0xda58=['message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','body','describe','accept','chat','read','format','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','UserId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','User','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c2df6,_0x3659cd){var _0x41da8c=function(_0xf03476){while(--_0xf03476){_0x2c2df6['push'](_0x2c2df6['shift']());}};_0x41da8c(++_0x3659cd);}(_0xda58,0xea));var _0x8da5=function(_0x1d08f1,_0x8c0438){_0x1d08f1=_0x1d08f1-0x0;var _0x58a254=_0xda58[_0x1d08f1];return _0x58a254;};'use strict';var emlformat=require(_0x8da5('0x0'));var rimraf=require(_0x8da5('0x1'));var zipdir=require(_0x8da5('0x2'));var jsonpatch=require(_0x8da5('0x3'));var rp=require(_0x8da5('0x4'));var moment=require(_0x8da5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8da5('0x6'));var util=require('util');var path=require(_0x8da5('0x7'));var sox=require('sox');var csv=require(_0x8da5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8da5('0x9'));var _=require(_0x8da5('0xa'));var squel=require(_0x8da5('0xb'));var crypto=require('crypto');var jsforce=require(_0x8da5('0xc'));var deskjs=require(_0x8da5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8da5('0xe'));var Papa=require(_0x8da5('0xf'));var Redis=require('ioredis');var authService=require(_0x8da5('0x10'));var qs=require(_0x8da5('0x11'));var as=require(_0x8da5('0x12'));var hardwareService=require(_0x8da5('0x13'));var logger=require(_0x8da5('0x14'))('api');var utils=require(_0x8da5('0x15'));var config=require(_0x8da5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8da5('0x17'))['db'];config[_0x8da5('0x18')]=_[_0x8da5('0x19')](config[_0x8da5('0x18')],{'host':_0x8da5('0x1a'),'port':0x18eb});var socket=require(_0x8da5('0x1b'))(new Redis(config[_0x8da5('0x18')]));require(_0x8da5('0x1c'))[_0x8da5('0x1d')](socket);var jayson=require(_0x8da5('0x1e'));var client=jayson[_0x8da5('0x1f')][_0x8da5('0x20')]({'port':0x232c});var client9002=jayson[_0x8da5('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x550fc9,_0xa27e35,_0xfe6fa2,_0x3da833){return new BPromise(function(_0x5f2933,_0xd8a76f){var _0x586c7f=_0x3da833||client;return _0x586c7f[_0x8da5('0x21')](_0x550fc9,_0xfe6fa2)[_0x8da5('0x22')](function(_0x13d522){logger[_0x8da5('0x23')](_0x8da5('0x24'),_0xa27e35,_0x8da5('0x25'));logger[_0x8da5('0x26')](_0x8da5('0x27'),_0xa27e35,_0x8da5('0x25'),JSON[_0x8da5('0x28')](_0x13d522));if(_0x13d522[_0x8da5('0x29')]){if(_0x13d522[_0x8da5('0x29')]['code']===0x1f4){logger[_0x8da5('0x29')](_0x8da5('0x24'),_0xa27e35,_0x13d522[_0x8da5('0x29')][_0x8da5('0x2a')]);return _0xd8a76f(_0x13d522['error']['message']);}logger[_0x8da5('0x29')](_0x8da5('0x24'),_0xa27e35,_0x13d522[_0x8da5('0x29')][_0x8da5('0x2a')]);return _0x5f2933(_0x13d522[_0x8da5('0x29')][_0x8da5('0x2a')]);}else{logger['info'](_0x8da5('0x24'),_0xa27e35,'request\x20sent');_0x5f2933(_0x13d522['result'][_0x8da5('0x2a')]);}})[_0x8da5('0x2b')](function(_0x2cc81b){logger[_0x8da5('0x29')](_0x8da5('0x24'),_0xa27e35,_0x2cc81b);_0xd8a76f(_0x2cc81b);});});}function respondWithStatusCode(_0x52a8c1,_0x5424f1){_0x5424f1=_0x5424f1||0xcc;return function(_0x100e9e){if(_0x100e9e){return _0x52a8c1[_0x8da5('0x2c')](_0x5424f1);}return _0x52a8c1[_0x8da5('0x2d')](_0x5424f1)['end']();};}function respondWithResult(_0x4fefcc,_0x4b4741){_0x4b4741=_0x4b4741||0xc8;return function(_0x38df30){if(_0x38df30){return _0x4fefcc['status'](_0x4b4741)[_0x8da5('0x2e')](_0x38df30);}};}function respondWithFilteredResult(_0x361b54,_0x47ef28){return function(_0x56a425){if(_0x56a425){var _0x4a5dc3=typeof _0x47ef28[_0x8da5('0x2f')]===_0x8da5('0x30')&&typeof _0x47ef28[_0x8da5('0x31')]===_0x8da5('0x30');var _0xb10b6e=_0x56a425['count'];var _0x134211=_0x4a5dc3?0x0:_0x47ef28['offset'];var _0x7d356=_0x4a5dc3?_0x56a425[_0x8da5('0x32')]:_0x47ef28[_0x8da5('0x2f')]+_0x47ef28[_0x8da5('0x31')];var _0x12883d;if(_0x7d356>=_0xb10b6e){_0x7d356=_0xb10b6e;_0x12883d=0xc8;}else{_0x12883d=0xce;}_0x361b54[_0x8da5('0x2d')](_0x12883d);return _0x361b54[_0x8da5('0x33')](_0x8da5('0x34'),_0x134211+'-'+_0x7d356+'/'+_0xb10b6e)['json'](_0x56a425);}return null;};}function patchUpdates(_0x2a3a1e){return function(_0x33a378){try{jsonpatch[_0x8da5('0x35')](_0x33a378,_0x2a3a1e,!![]);}catch(_0x2acbcf){return BPromise[_0x8da5('0x36')](_0x2acbcf);}return _0x33a378[_0x8da5('0x37')]();};}function saveUpdates(_0x446c17,_0xfa877f){return function(_0x517674){if(_0x517674){return _0x517674[_0x8da5('0x38')](_0x446c17)['then'](function(_0x9078fc){return _0x9078fc;});}return null;};}function removeEntity(_0x5239c0,_0x3df03d){return function(_0x232aa1){if(_0x232aa1){return _0x232aa1[_0x8da5('0x39')]()[_0x8da5('0x22')](function(){_0x5239c0[_0x8da5('0x2d')](0xcc)[_0x8da5('0x3a')]();});}};}function handleEntityNotFound(_0x168ff2,_0x597778){return function(_0x195aca){if(!_0x195aca){_0x168ff2['sendStatus'](0x194);}return _0x195aca;};}function handleError(_0xa878b9,_0x519869){_0x519869=_0x519869||0x1f4;return function(_0x4c6d26){logger[_0x8da5('0x29')](_0x4c6d26[_0x8da5('0x3b')]);if(_0x4c6d26['name']){delete _0x4c6d26[_0x8da5('0x3c')];}_0xa878b9[_0x8da5('0x2d')](_0x519869)[_0x8da5('0x3d')](_0x4c6d26);};}exports[_0x8da5('0x3e')]=function(_0x4d59d4,_0x4d244d){var _0x4141fd={},_0x5d8c12={},_0x4cd566={'count':0x0,'rows':[]};var _0x188f2f=_[_0x8da5('0x3f')](db[_0x8da5('0x40')][_0x8da5('0x41')],function(_0x8c0ad8){return{'name':_0x8c0ad8[_0x8da5('0x42')],'type':_0x8c0ad8['type'][_0x8da5('0x43')]};});_0x5d8c12[_0x8da5('0x44')]=_[_0x8da5('0x3f')](_0x188f2f,_0x8da5('0x3c'));_0x5d8c12[_0x8da5('0x45')]=_['keys'](_0x4d59d4[_0x8da5('0x45')]);_0x5d8c12['filters']=_[_0x8da5('0x46')](_0x5d8c12[_0x8da5('0x44')],_0x5d8c12[_0x8da5('0x45')]);_0x4141fd[_0x8da5('0x47')]=_[_0x8da5('0x46')](_0x5d8c12[_0x8da5('0x44')],qs[_0x8da5('0x48')](_0x4d59d4[_0x8da5('0x45')][_0x8da5('0x48')]));_0x4141fd['attributes']=_0x4141fd['attributes'][_0x8da5('0x49')]?_0x4141fd['attributes']:_0x5d8c12['model'];if(!_0x4d59d4[_0x8da5('0x45')][_0x8da5('0x4a')](_0x8da5('0x4b'))){_0x4141fd[_0x8da5('0x31')]=qs['limit'](_0x4d59d4[_0x8da5('0x45')][_0x8da5('0x31')]);_0x4141fd['offset']=qs[_0x8da5('0x2f')](_0x4d59d4[_0x8da5('0x45')][_0x8da5('0x2f')]);}_0x4141fd[_0x8da5('0x4c')]=qs[_0x8da5('0x4d')](_0x4d59d4[_0x8da5('0x45')][_0x8da5('0x4d')]);_0x4141fd[_0x8da5('0x4e')]=qs['filters'](_[_0x8da5('0x4f')](_0x4d59d4[_0x8da5('0x45')],_0x5d8c12[_0x8da5('0x50')]),_0x188f2f);if(_0x4d59d4['query'][_0x8da5('0x51')]){_0x4141fd['where']=_[_0x8da5('0x52')](_0x4141fd['where'],{'$or':_[_0x8da5('0x3f')](_0x188f2f,function(_0x1e4245){if(_0x1e4245['type']!==_0x8da5('0x53')){var _0x81663d={};_0x81663d[_0x1e4245[_0x8da5('0x3c')]]={'$like':'%'+_0x4d59d4[_0x8da5('0x45')]['filter']+'%'};return _0x81663d;}})});}_0x4141fd=_['merge']({},_0x4141fd,_0x4d59d4[_0x8da5('0x54')]);var _0x51d924={'where':_0x4141fd[_0x8da5('0x4e')]};return db[_0x8da5('0x40')]['count'](_0x51d924)[_0x8da5('0x22')](function(_0x46631c){_0x4cd566[_0x8da5('0x32')]=_0x46631c;if(_0x4d59d4[_0x8da5('0x45')][_0x8da5('0x55')]){_0x4141fd[_0x8da5('0x56')]=[{'all':!![]}];}return db[_0x8da5('0x40')][_0x8da5('0x57')](_0x4141fd);})[_0x8da5('0x22')](function(_0xa650c1){_0x4cd566[_0x8da5('0x58')]=_0xa650c1;return _0x4cd566;})[_0x8da5('0x22')](respondWithFilteredResult(_0x4d244d,_0x4141fd))[_0x8da5('0x2b')](handleError(_0x4d244d,null));};exports[_0x8da5('0x59')]=function(_0x510dc7,_0x92b997){var _0x2e16da={'raw':!![],'where':{'id':_0x510dc7[_0x8da5('0x5a')]['id']}},_0x35f038={};_0x35f038['model']=_[_0x8da5('0x5b')](db['ChatMessage'][_0x8da5('0x41')]);_0x35f038[_0x8da5('0x45')]=_[_0x8da5('0x5b')](_0x510dc7[_0x8da5('0x45')]);_0x35f038[_0x8da5('0x50')]=_[_0x8da5('0x46')](_0x35f038[_0x8da5('0x44')],_0x35f038[_0x8da5('0x45')]);_0x2e16da[_0x8da5('0x47')]=_[_0x8da5('0x46')](_0x35f038[_0x8da5('0x44')],qs[_0x8da5('0x48')](_0x510dc7[_0x8da5('0x45')][_0x8da5('0x48')]));_0x2e16da[_0x8da5('0x47')]=_0x2e16da[_0x8da5('0x47')][_0x8da5('0x49')]?_0x2e16da[_0x8da5('0x47')]:_0x35f038[_0x8da5('0x44')];if(_0x510dc7['query'][_0x8da5('0x55')]){_0x2e16da[_0x8da5('0x56')]=[{'all':!![]}];}_0x2e16da=_['merge']({},_0x2e16da,_0x510dc7['options']);return db['ChatMessage'][_0x8da5('0x5c')](_0x2e16da)[_0x8da5('0x22')](handleEntityNotFound(_0x92b997,null))[_0x8da5('0x22')](respondWithResult(_0x92b997,null))[_0x8da5('0x2b')](handleError(_0x92b997,null));};exports['create']=function(_0x5643cb,_0x11665f){return db[_0x8da5('0x40')]['create'](_0x5643cb[_0x8da5('0x5d')],{})[_0x8da5('0x22')](respondWithResult(_0x11665f,0xc9))[_0x8da5('0x2b')](handleError(_0x11665f,null));};exports[_0x8da5('0x38')]=function(_0x4cc9e2,_0x2b98df){if(_0x4cc9e2[_0x8da5('0x5d')]['id']){delete _0x4cc9e2[_0x8da5('0x5d')]['id'];}return db[_0x8da5('0x40')][_0x8da5('0x5c')]({'where':{'id':_0x4cc9e2[_0x8da5('0x5a')]['id']}})[_0x8da5('0x22')](handleEntityNotFound(_0x2b98df,null))['then'](saveUpdates(_0x4cc9e2[_0x8da5('0x5d')],null))[_0x8da5('0x22')](respondWithResult(_0x2b98df,null))[_0x8da5('0x2b')](handleError(_0x2b98df,null));};exports[_0x8da5('0x39')]=function(_0x454003,_0x42dfab){return db['ChatMessage'][_0x8da5('0x5c')]({'where':{'id':_0x454003[_0x8da5('0x5a')]['id']}})[_0x8da5('0x22')](handleEntityNotFound(_0x42dfab,null))[_0x8da5('0x22')](removeEntity(_0x42dfab,null))[_0x8da5('0x2b')](handleError(_0x42dfab,null));};exports[_0x8da5('0x5e')]=function(_0x33ad9b,_0x194bf8){return db[_0x8da5('0x40')]['describe']()[_0x8da5('0x22')](respondWithResult(_0x194bf8,null))[_0x8da5('0x2b')](handleError(_0x194bf8,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x8da5('0x5f')]=function(_0x5d6584,_0x28829c,_0x4f3f5c){var _0xcd10b0={'agent':{},'channel':_0x8da5('0x60')};if(_0x5d6584[_0x8da5('0x5d')]['id']){delete _0x5d6584[_0x8da5('0x5d')]['id'];}_0x5d6584[_0x8da5('0x5d')][_0x8da5('0x61')]=!![];_0x5d6584[_0x8da5('0x5d')]['readAt']=moment()[_0x8da5('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d6584[_0x8da5('0x5d')]['UserId']=_0x5d6584['body']['UserId']||_0x5d6584[_0x8da5('0x63')]['id'];_0xcd10b0[_0x8da5('0x64')]['id']=_0x5d6584['body']['UserId'];return db[_0x8da5('0x40')]['find']({'where':{'id':_0x5d6584[_0x8da5('0x5a')]['id'],'UserId':null}})[_0x8da5('0x22')](handleEntityNotFound(_0x28829c,null))[_0x8da5('0x22')](saveUpdates(_0x5d6584[_0x8da5('0x5d')],null))[_0x8da5('0x22')](function(_0x1b0259){if(_0x1b0259){_0xcd10b0[_0x8da5('0x2a')]=_0x1b0259['get']({'plain':!![]});return db[_0x8da5('0x65')][_0x8da5('0x5c')]({'where':{'id':_0x1b0259[_0x8da5('0x66')]}});}return null;})[_0x8da5('0x22')](handleEntityNotFound(_0x28829c,null))['then'](function(_0x2952ec){if(_0x2952ec){return _0x2952ec[_0x8da5('0x38')]({'UserId':_0x5d6584[_0x8da5('0x5d')]['UserId'],'read1stAt':_[_0x8da5('0x67')](_0x2952ec[_0x8da5('0x68')])?moment()[_0x8da5('0x62')](_0x8da5('0x69')):undefined});}return null;})['then'](function(_0x446ab8){if(_0x446ab8){_0xcd10b0[_0x8da5('0x6a')]=_0x446ab8[_0x8da5('0x6b')]({'plain':!![]});interaction_log[_0x8da5('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d6584[_0x8da5('0x63')]['id'],_0x5d6584[_0x8da5('0x63')]['name'],_0x5d6584[_0x8da5('0x63')][_0x8da5('0x6c')],_0xcd10b0[_0x8da5('0x6a')]['id'],_0x5d6584[_0x8da5('0x5d')]?JSON[_0x8da5('0x28')](_0x5d6584[_0x8da5('0x5d')]):_0x8da5('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x8da5('0x6e'),_0xcd10b0);}return null;})[_0x8da5('0x22')](function(_0x3f5007){var _0x2786d6=_0x8da5('0x6f')+_0x3f5007[_0x8da5('0x2a')][_0x8da5('0x70')];return db[_0x8da5('0x71')][_0x8da5('0x45')](_0x2786d6,{'type':db['Sequelize'][_0x8da5('0x72')][_0x8da5('0x73')],'raw':!![]})['then'](function(_0x392253){return _0x392253;});})[_0x8da5('0x22')](function(_0x4edfae){if(_0x4edfae){_0xcd10b0[_0x8da5('0x2a')][_0x8da5('0x74')]=_0x4edfae[0x0];if(!_0x5d6584[_0x8da5('0x5d')]['UserId'])return;return db['User']['find']({'where':{'id':_0x5d6584[_0x8da5('0x5d')]['UserId'],'role':_0x8da5('0x64')},'attributes':['id',_0x8da5('0x3c'),_0x8da5('0x75'),_0x8da5('0x76'),_0x8da5('0x77')],'raw':!![]});}return null;})['then'](function(_0x503495){if(!_0x503495)return null;_0xcd10b0[_0x8da5('0x2a')][_0x8da5('0x64')]=_0x503495;return _0xcd10b0;})[_0x8da5('0x22')](function(_0x28f745){if(_0x28f745){if(_0x5d6584[_0x8da5('0x5d')][_0x8da5('0x78')]){_0xcd10b0[_0x8da5('0x2a')][_0x8da5('0x79')]=util[_0x8da5('0x62')](_0x8da5('0x7a'),_0x5d6584[_0x8da5('0x63')]['name']);_0xcd10b0[_0x8da5('0x2a')][_0x8da5('0x7b')]=_0xcd10b0['channel'];_0xcd10b0['message'][_0x8da5('0x7c')]=_0xcd10b0['channel'];_0xcd10b0['message'][_0x8da5('0x7d')]=_0x8da5('0x5f');return respondWithRpcPromise(_0x8da5('0x7e'),_0x8da5('0x7e'),{'event':_0x8da5('0x7f'),'message':_[_0x8da5('0x52')](_0xcd10b0['message'],JSON['parse'](_0xcd10b0[_0x8da5('0x6a')][_0x8da5('0x80')]))},client9002)[_0x8da5('0x22')](function(){return _0xcd10b0;});}return _0xcd10b0;}return null;})[_0x8da5('0x22')](respondWithResult(_0x28829c,null))[_0x8da5('0x2b')](handleError(_0x28829c,null));};var interaction_log=require(_0x8da5('0x14'))(_0x8da5('0x81'));exports[_0x8da5('0x36')]=function(_0x178285,_0x396201,_0x201949){var _0x51b31e={'agent':{},'channel':_0x8da5('0x60')};if(_0x178285[_0x8da5('0x5d')]['id']){delete _0x178285[_0x8da5('0x5d')]['id'];}_0x178285[_0x8da5('0x5d')][_0x8da5('0x82')]=_0x178285[_0x8da5('0x5d')][_0x8da5('0x82')]||_0x178285[_0x8da5('0x63')]['id'];_0x51b31e['agent']['id']=_0x178285[_0x8da5('0x5d')][_0x8da5('0x82')];return db['ChatMessage']['find']({'where':{'id':_0x178285[_0x8da5('0x5a')]['id'],'UserId':null}})[_0x8da5('0x22')](handleEntityNotFound(_0x396201,null))['then'](function(_0x4eea3f){if(_0x4eea3f){_0x51b31e['message']=_0x4eea3f[_0x8da5('0x6b')]({'plain':!![]});return db[_0x8da5('0x65')]['find']({'where':{'id':_0x4eea3f['ChatInteractionId']}});}return null;})[_0x8da5('0x22')](handleEntityNotFound(_0x396201,null))[_0x8da5('0x22')](function(_0x13c376){if(_0x13c376){_0x51b31e[_0x8da5('0x6a')]=_0x13c376[_0x8da5('0x6b')]({'plain':!![]});interaction_log['info'](_0x8da5('0x83'),_0x178285[_0x8da5('0x63')]['id'],_0x178285[_0x8da5('0x63')][_0x8da5('0x3c')],_0x178285['user'][_0x8da5('0x6c')],_0x51b31e[_0x8da5('0x6a')]['id'],_0x178285[_0x8da5('0x5d')]?JSON[_0x8da5('0x28')](_0x178285[_0x8da5('0x5d')]):'null');return respondWithRpcPromise(_0x8da5('0x84'),_0x8da5('0x85'),_0x51b31e);}return null;})[_0x8da5('0x22')](function(_0x2bf0a0){var _0x54798b=_0x8da5('0x6f')+_0x2bf0a0[_0x8da5('0x2a')][_0x8da5('0x70')];return db[_0x8da5('0x71')][_0x8da5('0x45')](_0x54798b,{'type':db[_0x8da5('0x86')][_0x8da5('0x72')][_0x8da5('0x73')],'raw':!![]})['then'](function(_0x32037c){return _0x32037c;});})[_0x8da5('0x22')](function(_0x56fdb3){if(_0x56fdb3){_0x51b31e[_0x8da5('0x2a')]['contact']=_0x56fdb3[0x0];if(!_0x178285[_0x8da5('0x5d')][_0x8da5('0x82')])return;return db[_0x8da5('0x87')][_0x8da5('0x5c')]({'where':{'id':_0x178285[_0x8da5('0x5d')]['UserId'],'role':_0x8da5('0x64')},'attributes':['id','name',_0x8da5('0x75'),_0x8da5('0x76'),_0x8da5('0x77')],'raw':!![]});}return null;})[_0x8da5('0x22')](function(_0x2a4288){if(!_0x2a4288)return null;_0x51b31e[_0x8da5('0x2a')]['agent']=_0x2a4288;return _0x51b31e;})['then'](function(_0x399a49){if(_0x399a49){_0x399a49[_0x8da5('0x2a')]['interface']=util['format']('SIP/%s',_0x178285['user']['name']);_0x399a49[_0x8da5('0x2a')][_0x8da5('0x7b')]=_0x51b31e[_0x8da5('0x7b')];_0x399a49[_0x8da5('0x2a')][_0x8da5('0x7c')]=_0x51b31e[_0x8da5('0x7b')];_0x399a49[_0x8da5('0x2a')][_0x8da5('0x7d')]='reject';respondWithRpcPromise(_0x8da5('0x7e'),'EventManager',{'event':_0x8da5('0x88'),'message':_[_0x8da5('0x52')](_0x51b31e[_0x8da5('0x2a')],JSON[_0x8da5('0x89')](_0x51b31e[_0x8da5('0x6a')][_0x8da5('0x80')]))},client9002);return _0x51b31e;}return null;})[_0x8da5('0x22')](respondWithResult(_0x396201,null))[_0x8da5('0x2b')](handleError(_0x396201,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index a059169..5c39c8e 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 _0x65d5=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x14d8c1,_0x39c8ec){var _0xe3c07e=function(_0x3bef60){while(--_0x3bef60){_0x14d8c1['push'](_0x14d8c1['shift']());}};_0xe3c07e(++_0x39c8ec);}(_0x65d5,0x1ae));var _0x565d=function(_0x4e8ffa,_0x5c243b){_0x4e8ffa=_0x4e8ffa-0x0;var _0x1ae8cf=_0x65d5[_0x4e8ffa];return _0x1ae8cf;};'use strict';var EventEmitter=require(_0x565d('0x0'));var ChatMessage=require(_0x565d('0x1'))['db'][_0x565d('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x565d('0x3')](0x0);var events={'afterCreate':_0x565d('0x4'),'afterUpdate':_0x565d('0x5'),'afterDestroy':_0x565d('0x6')};function emitEvent(_0x1b2cc1){return function(_0x20c7ac,_0x49b4e2,_0x562f5b){ChatMessageEvents['emit'](_0x1b2cc1+':'+_0x20c7ac['id'],_0x20c7ac);ChatMessageEvents[_0x565d('0x7')](_0x1b2cc1,_0x20c7ac);_0x562f5b(null);};}for(var e in events){if(events[_0x565d('0x8')](e)){var event=events[e];ChatMessage[_0x565d('0x9')](e,emitEvent(event));}}module[_0x565d('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0xe174=['../../mysqldb','ChatMessage','setMaxListeners','save','emit','hasOwnProperty','exports','events'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xe174,0x1b7));var _0x4e17=function(_0xee4bb8,_0x23b2ae){_0xee4bb8=_0xee4bb8-0x0;var _0xa0c0be=_0xe174[_0xee4bb8];return _0xa0c0be;};'use strict';var EventEmitter=require(_0x4e17('0x0'));var ChatMessage=require(_0x4e17('0x1'))['db'][_0x4e17('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x4e17('0x3')](0x0);var events={'afterCreate':_0x4e17('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4c9122){return function(_0x44f3e6,_0x2cf4bf,_0xd02cbe){ChatMessageEvents[_0x4e17('0x5')](_0x4c9122+':'+_0x44f3e6['id'],_0x44f3e6);ChatMessageEvents[_0x4e17('0x5')](_0x4c9122,_0x44f3e6);_0xd02cbe(null);};}for(var e in events){if(events[_0x4e17('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x4e17('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 48a6e48..f58c7ac 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 _0x6a46=['isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','out','secret'];(function(_0x2bf8ef,_0x7a261c){var _0x44106b=function(_0x269891){while(--_0x269891){_0x2bf8ef['push'](_0x2bf8ef['shift']());}};_0x44106b(++_0x7a261c);}(_0x6a46,0x1cd));var _0x66a4=function(_0x56d2b3,_0x3c4a59){_0x56d2b3=_0x56d2b3-0x0;var _0x5c7a00=_0x6a46[_0x56d2b3];return _0x5c7a00;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x66a4('0x0'))(_0x66a4('0x1'));var moment=require(_0x66a4('0x2'));var BPromise=require(_0x66a4('0x3'));var rp=require(_0x66a4('0x4'));var fs=require('fs');var path=require(_0x66a4('0x5'));var rimraf=require(_0x66a4('0x6'));var config=require(_0x66a4('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x3d0379,_0x43ab8d){return _0x3d0379[_0x66a4('0x8')](_0x66a4('0x9'),attributes,{'tableName':_0x66a4('0xa'),'paranoid':![],'indexes':[{'name':_0x66a4('0xb'),'fields':[_0x66a4('0xc')],'type':_0x66a4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3bd249,_0x127271,_0x2aee52){var _0x1e3c20=_0x3d0379[_0x66a4('0xe')];var _0x195b44=_0x3bd249[_0x66a4('0xf')]({'plain':!![]});if(_0x195b44['direction']['toLowerCase']()==='in'||_0x195b44['direction'][_0x66a4('0x10')]()===_0x66a4('0x11')&&!_0x195b44[_0x66a4('0x12')]&&!_[_0x66a4('0x13')](_0x195b44[_0x66a4('0x14')])){_0x1e3c20[_0x66a4('0x15')][_0x66a4('0x16')]({'where':{'id':_0x195b44[_0x66a4('0x17')]}})[_0x66a4('0x18')](function(_0x649ba9){if(_0x649ba9){_0x649ba9[_0x66a4('0x19')]({'lastMsgAt':_0x195b44[_0x66a4('0x1a')],'lastMsgDirection':_0x195b44[_0x66a4('0x1b')][_0x66a4('0x10')]()});}})[_0x66a4('0x1c')](function(_0xaedf94){console[_0x66a4('0x1d')](_0xaedf94);});}_0x2aee52();}},'charset':_0x66a4('0x1e'),'collate':_0x66a4('0x1f')});};
\ No newline at end of file
+var _0x8646=['ChatMessage','chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','update','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x31a8d4,_0x1f9a85){var _0x57cd33=function(_0x3ca875){while(--_0x3ca875){_0x31a8d4['push'](_0x31a8d4['shift']());}};_0x57cd33(++_0x1f9a85);}(_0x8646,0xf1));var _0x6864=function(_0x22c880,_0x392465){_0x22c880=_0x22c880-0x0;var _0x5b193d=_0x8646[_0x22c880];return _0x5b193d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6864('0x0'))(_0x6864('0x1'));var moment=require(_0x6864('0x2'));var BPromise=require(_0x6864('0x3'));var rp=require(_0x6864('0x4'));var fs=require('fs');var path=require(_0x6864('0x5'));var rimraf=require(_0x6864('0x6'));var config=require(_0x6864('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x1e0b07,_0x5a5d6b){return _0x1e0b07[_0x6864('0x8')](_0x6864('0x9'),attributes,{'tableName':_0x6864('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x6864('0xb')],'type':_0x6864('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfbc65f,_0x280c00,_0x210a24){var _0x36530f=_0x1e0b07[_0x6864('0xd')];var _0x31b709=_0xfbc65f['get']({'plain':!![]});if(_0x31b709[_0x6864('0xe')][_0x6864('0xf')]()==='in'||_0x31b709[_0x6864('0xe')]['toLowerCase']()===_0x6864('0x10')&&!_0x31b709['secret']&&!_[_0x6864('0x11')](_0x31b709[_0x6864('0x12')])){_0x36530f['ChatInteraction'][_0x6864('0x13')]({'where':{'id':_0x31b709[_0x6864('0x14')]}})['then'](function(_0x476677){if(_0x476677){_0x476677[_0x6864('0x15')]({'lastMsgAt':_0x31b709['createdAt'],'lastMsgDirection':_0x31b709[_0x6864('0xe')][_0x6864('0xf')]()});}})['catch'](function(_0x5cf9f2){console[_0x6864('0x16')](_0x5cf9f2);});}_0x210a24();}},'charset':_0x6864('0x17'),'collate':_0x6864('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 3753c97..b5ddcbe 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 _0x1779=['error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','stringify'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x1779,0x175));var _0x9177=function(_0x43480b,_0x253501){_0x43480b=_0x43480b-0x0;var _0x4526d0=_0x1779[_0x43480b];return _0x4526d0;};'use strict';var _=require(_0x9177('0x0'));var util=require(_0x9177('0x1'));var moment=require(_0x9177('0x2'));var BPromise=require(_0x9177('0x3'));var rs=require(_0x9177('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9177('0x5'))['db'];var utils=require(_0x9177('0x6'));var logger=require(_0x9177('0x7'))(_0x9177('0x8'));var config=require('../../config/environment');var jayson=require(_0x9177('0x9'));var client=jayson[_0x9177('0xa')][_0x9177('0xb')]({'port':0x232a});config['redis']=_[_0x9177('0xc')](config[_0x9177('0xd')],{'host':_0x9177('0xe'),'port':0x18eb});var socket=require(_0x9177('0xf'))(new Redis(config[_0x9177('0xd')]));require(_0x9177('0x10'))[_0x9177('0x11')](socket);function respondWithRpcPromise(_0x2d3aaa,_0x3e8105,_0x564e73){return new BPromise(function(_0xa64a96,_0x32eaa4){return client[_0x9177('0x12')](_0x2d3aaa,_0x564e73)[_0x9177('0x13')](function(_0x57aa1e){logger[_0x9177('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3e8105,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3e8105,_0x9177('0x15'),JSON[_0x9177('0x16')](_0x57aa1e));if(_0x57aa1e[_0x9177('0x17')]){if(_0x57aa1e[_0x9177('0x17')][_0x9177('0x18')]===0x1f4){logger[_0x9177('0x17')](_0x9177('0x19'),_0x3e8105,_0x57aa1e[_0x9177('0x17')][_0x9177('0x1a')]);return _0x32eaa4(_0x57aa1e[_0x9177('0x17')][_0x9177('0x1a')]);}logger[_0x9177('0x17')](_0x9177('0x19'),_0x3e8105,_0x57aa1e[_0x9177('0x17')][_0x9177('0x1a')]);return _0xa64a96(_0x57aa1e[_0x9177('0x17')]['message']);}else{logger[_0x9177('0x14')](_0x9177('0x19'),_0x3e8105,_0x9177('0x15'));_0xa64a96(_0x57aa1e[_0x9177('0x1b')][_0x9177('0x1a')]);}})[_0x9177('0x1c')](function(_0x1d09ed){logger['error'](_0x9177('0x19'),_0x3e8105,_0x1d09ed);_0x32eaa4(_0x1d09ed);});});}exports[_0x9177('0x1d')]=function(_0x5be53){var _0x1bfbee=this;return new Promise(function(_0x2a811b,_0x30a78a){return db[_0x9177('0x1e')][_0x9177('0x1f')](_0x5be53[_0x9177('0x20')],{'raw':_0x5be53[_0x9177('0x21')]?_0x5be53[_0x9177('0x21')][_0x9177('0x22')]===undefined?!![]:![]:!![]})[_0x9177('0x13')](function(_0x2a1e6e){logger[_0x9177('0x14')](_0x9177('0x1d'),_0x5be53);logger[_0x9177('0x23')]('CreateChatMessage',_0x5be53,JSON[_0x9177('0x16')](_0x2a1e6e));_0x2a811b(_0x2a1e6e);})[_0x9177('0x1c')](function(_0x473032){logger[_0x9177('0x17')](_0x9177('0x1d'),_0x473032[_0x9177('0x1a')],_0x5be53);_0x30a78a(_0x1bfbee['error'](0x1f4,_0x473032['message']));});});};
\ No newline at end of file
+var _0x8331=['client','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ChatMessage','create','body','options','CreateChatMessage','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b4210,_0x521514){var _0x5b5b93=function(_0x2a3140){while(--_0x2a3140){_0x2b4210['push'](_0x2b4210['shift']());}};_0x5b5b93(++_0x521514);}(_0x8331,0xff));var _0x1833=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0x8331[_0x454018];return _0x24697d;};'use strict';var _=require(_0x1833('0x0'));var util=require('util');var moment=require(_0x1833('0x1'));var BPromise=require(_0x1833('0x2'));var rs=require(_0x1833('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1833('0x4'));var logger=require(_0x1833('0x5'))(_0x1833('0x6'));var config=require(_0x1833('0x7'));var jayson=require(_0x1833('0x8'));var client=jayson[_0x1833('0x9')]['http']({'port':0x232a});config[_0x1833('0xa')]=_['defaults'](config[_0x1833('0xa')],{'host':_0x1833('0xb'),'port':0x18eb});var socket=require(_0x1833('0xc'))(new Redis(config[_0x1833('0xa')]));require(_0x1833('0xd'))[_0x1833('0xe')](socket);function respondWithRpcPromise(_0x2268d9,_0x6c25db,_0x147235){return new BPromise(function(_0x1c1bd4,_0x55ccbd){return client[_0x1833('0xf')](_0x2268d9,_0x147235)[_0x1833('0x10')](function(_0x1770b6){logger[_0x1833('0x11')](_0x1833('0x12'),_0x6c25db,'request\x20sent');logger[_0x1833('0x13')](_0x1833('0x14'),_0x6c25db,_0x1833('0x15'),JSON[_0x1833('0x16')](_0x1770b6));if(_0x1770b6[_0x1833('0x17')]){if(_0x1770b6['error'][_0x1833('0x18')]===0x1f4){logger[_0x1833('0x17')](_0x1833('0x12'),_0x6c25db,_0x1770b6['error']['message']);return _0x55ccbd(_0x1770b6[_0x1833('0x17')][_0x1833('0x19')]);}logger[_0x1833('0x17')](_0x1833('0x12'),_0x6c25db,_0x1770b6['error']['message']);return _0x1c1bd4(_0x1770b6[_0x1833('0x17')]['message']);}else{logger['info'](_0x1833('0x12'),_0x6c25db,_0x1833('0x15'));_0x1c1bd4(_0x1770b6[_0x1833('0x1a')]['message']);}})[_0x1833('0x1b')](function(_0x22c2b2){logger[_0x1833('0x17')]('ChatMessage,\x20%s,\x20%s',_0x6c25db,_0x22c2b2);_0x55ccbd(_0x22c2b2);});});}exports['CreateChatMessage']=function(_0x351107){var _0x4383e3=this;return new Promise(function(_0x34cd2b,_0x1c7321){return db[_0x1833('0x1c')][_0x1833('0x1d')](_0x351107[_0x1833('0x1e')],{'raw':_0x351107[_0x1833('0x1f')]?_0x351107[_0x1833('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x1833('0x10')](function(_0x3cbe6a){logger[_0x1833('0x11')](_0x1833('0x20'),_0x351107);logger[_0x1833('0x13')](_0x1833('0x20'),_0x351107,JSON[_0x1833('0x16')](_0x3cbe6a));_0x34cd2b(_0x3cbe6a);})['catch'](function(_0x582ec8){logger[_0x1833('0x17')]('CreateChatMessage',_0x582ec8['message'],_0x351107);_0x1c7321(_0x4383e3[_0x1833('0x17')](0x1f4,_0x582ec8[_0x1833('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index e0aa5d8..7364655 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 _0xeb5d=['register','length','chatMessage:','save','remove','update','emit','removeListener'];(function(_0x522a17,_0x2736e5){var _0x44f1bd=function(_0x2e0325){while(--_0x2e0325){_0x522a17['push'](_0x522a17['shift']());}};_0x44f1bd(++_0x2736e5);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xeb5d[_0x40a045];return _0x1a687c;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xdeb5('0x0'),_0xdeb5('0x1'),_0xdeb5('0x2')];function createListener(_0x2b0a09,_0x55bbde){return function(_0x5acd11){_0x55bbde[_0xdeb5('0x3')](_0x2b0a09,_0x5acd11);};}function removeListener(_0x16c31b,_0x546313){return function(){ChatMessageEvents[_0xdeb5('0x4')](_0x16c31b,_0x546313);};}exports[_0xdeb5('0x5')]=function(_0x164ecb){for(var _0x33af72=0x0,_0x120329=events[_0xdeb5('0x6')];_0x33af72<_0x120329;_0x33af72++){var _0x328d6b=events[_0x33af72];var _0x35c086=createListener(_0xdeb5('0x7')+_0x328d6b,_0x164ecb);ChatMessageEvents['on'](_0x328d6b,_0x35c086);}};
\ No newline at end of file
+var _0xa7e6=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x3ba89a,_0x34affe){var _0x50bd58=function(_0xa01b75){while(--_0xa01b75){_0x3ba89a['push'](_0x3ba89a['shift']());}};_0x50bd58(++_0x34affe);}(_0xa7e6,0x74));var _0x6a7e=function(_0x119769,_0x32865d){_0x119769=_0x119769-0x0;var _0x105c19=_0xa7e6[_0x119769];return _0x105c19;};'use strict';var ChatMessageEvents=require(_0x6a7e('0x0'));var events=[_0x6a7e('0x1'),_0x6a7e('0x2'),_0x6a7e('0x3')];function createListener(_0x67fa72,_0x21c1de){return function(_0x4c809c){_0x21c1de[_0x6a7e('0x4')](_0x67fa72,_0x4c809c);};}function removeListener(_0x8787b5,_0x1ea310){return function(){ChatMessageEvents[_0x6a7e('0x5')](_0x8787b5,_0x1ea310);};}exports[_0x6a7e('0x6')]=function(_0x599006){for(var _0x79df6f=0x0,_0x16249d=events[_0x6a7e('0x7')];_0x79df6f<_0x16249d;_0x79df6f++){var _0x342c96=events[_0x79df6f];var _0x45e92e=createListener(_0x6a7e('0x8')+_0x342c96,_0x599006);ChatMessageEvents['on'](_0x342c96,_0x45e92e);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 6833f35..46d16c4 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 _0xe3e3=['accept','put','reject','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','post','tracked','chat','chatmessage:create','update','/:id/accept'];(function(_0x1379b2,_0x550f73){var _0x93f87c=function(_0x44d760){while(--_0x44d760){_0x1379b2['push'](_0x1379b2['shift']());}};_0x93f87c(++_0x550f73);}(_0xe3e3,0xd7));var _0x3e3e=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xe3e3[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0x3e3e('0x0'));var util=require('util');var path=require(_0x3e3e('0x1'));var timeout=require(_0x3e3e('0x2'));var express=require(_0x3e3e('0x3'));var router=express[_0x3e3e('0x4')]();var fs_extra=require(_0x3e3e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3e3e('0x6'));var controller=require(_0x3e3e('0x7'));router[_0x3e3e('0x8')]('/',auth[_0x3e3e('0x9')](),controller[_0x3e3e('0xa')]);router[_0x3e3e('0x8')](_0x3e3e('0xb'),auth[_0x3e3e('0x9')](),controller[_0x3e3e('0xc')]);router[_0x3e3e('0x8')]('/:id',auth[_0x3e3e('0x9')](),controller['show']);router[_0x3e3e('0xd')]('/',auth[_0x3e3e('0x9')](),interaction[_0x3e3e('0xe')](_0x3e3e('0xf'),_0x3e3e('0x10')),controller['create']);router['put']('/:id',controller[_0x3e3e('0x11')]);router['put'](_0x3e3e('0x12'),auth['isAuthenticated'](),controller[_0x3e3e('0x13')]);router[_0x3e3e('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0x3e3e('0x15')]);router[_0x3e3e('0x16')](_0x3e3e('0x17'),auth[_0x3e3e('0x9')](),controller[_0x3e3e('0x18')]);module[_0x3e3e('0x19')]=router;
\ No newline at end of file
+var _0xcf9f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','describe','show','tracked','chat','chatmessage:create','create','put','/:id','update','/:id/accept','reject','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5f158a,_0x380823){var _0x3ffb26=function(_0x5c71f3){while(--_0x5c71f3){_0x5f158a['push'](_0x5f158a['shift']());}};_0x3ffb26(++_0x380823);}(_0xcf9f,0x182));var _0xfcf9=function(_0x577298,_0x351f89){_0x577298=_0x577298-0x0;var _0x42c0b0=_0xcf9f[_0x577298];return _0x42c0b0;};'use strict';var multer=require(_0xfcf9('0x0'));var util=require(_0xfcf9('0x1'));var path=require(_0xfcf9('0x2'));var timeout=require(_0xfcf9('0x3'));var express=require(_0xfcf9('0x4'));var router=express[_0xfcf9('0x5')]();var fs_extra=require(_0xfcf9('0x6'));var auth=require(_0xfcf9('0x7'));var interaction=require(_0xfcf9('0x8'));var config=require('../../config/environment');var controller=require(_0xfcf9('0x9'));router[_0xfcf9('0xa')]('/',auth[_0xfcf9('0xb')](),controller[_0xfcf9('0xc')]);router['get']('/describe',auth[_0xfcf9('0xb')](),controller[_0xfcf9('0xd')]);router[_0xfcf9('0xa')]('/:id',auth[_0xfcf9('0xb')](),controller[_0xfcf9('0xe')]);router['post']('/',auth[_0xfcf9('0xb')](),interaction[_0xfcf9('0xf')](_0xfcf9('0x10'),_0xfcf9('0x11')),controller[_0xfcf9('0x12')]);router[_0xfcf9('0x13')](_0xfcf9('0x14'),controller[_0xfcf9('0x15')]);router[_0xfcf9('0x13')](_0xfcf9('0x16'),auth[_0xfcf9('0xb')](),controller['accept']);router[_0xfcf9('0x13')]('/:id/reject',auth[_0xfcf9('0xb')](),controller[_0xfcf9('0x17')]);router['delete'](_0xfcf9('0x14'),auth['isAuthenticated'](),controller[_0xfcf9('0x18')]);module[_0xfcf9('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index f035363..f0239cc 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x222f7a,_0x47de96){var _0x4da2c1=function(_0x53063c){while(--_0x53063c){_0x222f7a['push'](_0x222f7a['shift']());}};_0x4da2c1(++_0x47de96);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f8999,_0x58ef02){_0x1f8999=_0x1f8999-0x0;var _0x4a4d99=_0xb10b[_0x1f8999];return _0x4a4d99;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0b0e,0x187));var _0xe0b0=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x0b0e[_0x58db4e];return _0x40139a;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('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 3ad11d1..16f53eb 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(_0x1a7441,_0x4c408e){var _0xb3c67=function(_0x4bd098){while(--_0x4bd098){_0x1a7441['push'](_0x1a7441['shift']());}};_0xb3c67(++_0x4c408e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x7a54,0x106));var _0x47a5=function(_0x49ab41,_0x501330){_0x49ab41=_0x49ab41-0x0;var _0x5074c7=_0x7a54[_0x49ab41];return _0x5074c7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 0ba39de..bccc91d 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9137=['ChatOfflineMessage','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x9137,0x15d));var _0x7913=function(_0x2a84d6,_0x538497){_0x2a84d6=_0x2a84d6-0x0;var _0x55c2ea=_0x9137[_0x2a84d6];return _0x55c2ea;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x7913('0x0'))['db'][_0x7913('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7913('0x2'),'afterUpdate':'update','afterDestroy':_0x7913('0x3')};function emitEvent(_0x55c380){return function(_0x4e502e,_0x3f4689,_0x4755b3){ChatOfflineMessageEvents[_0x7913('0x4')](_0x55c380+':'+_0x4e502e['id'],_0x4e502e);ChatOfflineMessageEvents['emit'](_0x55c380,_0x4e502e);_0x4755b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x7913('0x5')](e,emitEvent(event));}}module[_0x7913('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x7850=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','update','remove'];(function(_0x3c4e48,_0x43a5eb){var _0x37fd7e=function(_0x27aa2b){while(--_0x27aa2b){_0x3c4e48['push'](_0x3c4e48['shift']());}};_0x37fd7e(++_0x43a5eb);}(_0x7850,0x1e1));var _0x0785=function(_0x4fccba,_0x594ed0){_0x4fccba=_0x4fccba-0x0;var _0x4ec9a0=_0x7850[_0x4fccba];return _0x4ec9a0;};'use strict';var EventEmitter=require(_0x0785('0x0'));var ChatOfflineMessage=require(_0x0785('0x1'))['db'][_0x0785('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0785('0x3'),'afterDestroy':_0x0785('0x4')};function emitEvent(_0x59a055){return function(_0x2e5c97,_0x24bbd3,_0x20385a){ChatOfflineMessageEvents[_0x0785('0x5')](_0x59a055+':'+_0x2e5c97['id'],_0x2e5c97);ChatOfflineMessageEvents[_0x0785('0x5')](_0x59a055,_0x2e5c97);_0x20385a(null);};}for(var e in events){if(events[_0x0785('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x0785('0x7')](e,emitEvent(event));}}module[_0x0785('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 28cb74b..10d3d13 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 _0x2011=['./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x2011,0x1d1));var _0x1201=function(_0x15ddd4,_0xdb94b2){_0x15ddd4=_0x15ddd4-0x0;var _0x41b6eb=_0x2011[_0x15ddd4];return _0x41b6eb;};'use strict';var attributes=require(_0x1201('0x0'));module[_0x1201('0x1')]=function(_0x37bb3b){return _0x37bb3b[_0x1201('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x1201('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1201('0x4')});};
\ No newline at end of file
+var _0x48c0=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','ChatOfflineMessage'];(function(_0x10e084,_0xf761e1){var _0x4ca640=function(_0x196aa3){while(--_0x196aa3){_0x10e084['push'](_0x10e084['shift']());}};_0x4ca640(++_0xf761e1);}(_0x48c0,0x1b9));var _0x048c=function(_0x509572,_0x5c4ee9){_0x509572=_0x509572-0x0;var _0x579f64=_0x48c0[_0x509572];return _0x579f64;};'use strict';var attributes=require(_0x048c('0x0'));module[_0x048c('0x1')]=function(_0x424c4e){return _0x424c4e['define'](_0x048c('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x048c('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index f9f52d7..e558b4b 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 _0x5814=['then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x49aee5,_0x35466c){var _0xa69a8d=function(_0xf8e323){while(--_0xf8e323){_0x49aee5['push'](_0x49aee5['shift']());}};_0xa69a8d(++_0x35466c);}(_0x5814,0x6f));var _0x4581=function(_0x340d83,_0x418c44){_0x340d83=_0x340d83-0x0;var _0x2a424f=_0x5814[_0x340d83];return _0x2a424f;};'use strict';var _=require(_0x4581('0x0'));var util=require('util');var moment=require(_0x4581('0x1'));var BPromise=require('bluebird');var rs=require(_0x4581('0x2'));var fs=require('fs');var Redis=require(_0x4581('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4581('0x4'));var logger=require(_0x4581('0x5'))(_0x4581('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4581('0x7')][_0x4581('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53cbd8,_0x47ece4,_0x484124){return new BPromise(function(_0x4216bf,_0x553bb6){return client['request'](_0x53cbd8,_0x484124)[_0x4581('0x9')](function(_0x5547da){logger[_0x4581('0xa')](_0x4581('0xb'),_0x47ece4,'request\x20sent');logger[_0x4581('0xc')](_0x4581('0xd'),_0x47ece4,_0x4581('0xe'),JSON[_0x4581('0xf')](_0x5547da));if(_0x5547da['error']){if(_0x5547da['error'][_0x4581('0x10')]===0x1f4){logger[_0x4581('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x47ece4,_0x5547da[_0x4581('0x11')][_0x4581('0x12')]);return _0x553bb6(_0x5547da[_0x4581('0x11')][_0x4581('0x12')]);}logger[_0x4581('0x11')](_0x4581('0xb'),_0x47ece4,_0x5547da[_0x4581('0x11')][_0x4581('0x12')]);return _0x4216bf(_0x5547da[_0x4581('0x11')]['message']);}else{logger[_0x4581('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x47ece4,_0x4581('0xe'));_0x4216bf(_0x5547da[_0x4581('0x13')][_0x4581('0x12')]);}})['catch'](function(_0x5252f2){logger[_0x4581('0x11')](_0x4581('0xb'),_0x47ece4,_0x5252f2);_0x553bb6(_0x5252f2);});});}
\ No newline at end of file
+var _0xc3d6=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x38f5b6,_0x5f0777){var _0x43149f=function(_0x36c387){while(--_0x36c387){_0x38f5b6['push'](_0x38f5b6['shift']());}};_0x43149f(++_0x5f0777);}(_0xc3d6,0x153));var _0x6c3d=function(_0x585554,_0x1f84c7){_0x585554=_0x585554-0x0;var _0x34a185=_0xc3d6[_0x585554];return _0x34a185;};'use strict';var _=require(_0x6c3d('0x0'));var util=require(_0x6c3d('0x1'));var moment=require(_0x6c3d('0x2'));var BPromise=require(_0x6c3d('0x3'));var rs=require(_0x6c3d('0x4'));var fs=require('fs');var Redis=require(_0x6c3d('0x5'));var db=require(_0x6c3d('0x6'))['db'];var utils=require(_0x6c3d('0x7'));var logger=require(_0x6c3d('0x8'))(_0x6c3d('0x9'));var config=require('../../config/environment');var jayson=require(_0x6c3d('0xa'));var client=jayson['client'][_0x6c3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5058e2,_0x74763,_0x35c1aa){return new BPromise(function(_0x3fbfc3,_0x7d4b89){return client[_0x6c3d('0xc')](_0x5058e2,_0x35c1aa)[_0x6c3d('0xd')](function(_0x2b251f){logger[_0x6c3d('0xe')](_0x6c3d('0xf'),_0x74763,'request\x20sent');logger[_0x6c3d('0x10')](_0x6c3d('0x11'),_0x74763,'request\x20sent',JSON[_0x6c3d('0x12')](_0x2b251f));if(_0x2b251f[_0x6c3d('0x13')]){if(_0x2b251f[_0x6c3d('0x13')][_0x6c3d('0x14')]===0x1f4){logger[_0x6c3d('0x13')](_0x6c3d('0xf'),_0x74763,_0x2b251f[_0x6c3d('0x13')][_0x6c3d('0x15')]);return _0x7d4b89(_0x2b251f[_0x6c3d('0x13')][_0x6c3d('0x15')]);}logger['error'](_0x6c3d('0xf'),_0x74763,_0x2b251f[_0x6c3d('0x13')][_0x6c3d('0x15')]);return _0x3fbfc3(_0x2b251f[_0x6c3d('0x13')][_0x6c3d('0x15')]);}else{logger[_0x6c3d('0xe')](_0x6c3d('0xf'),_0x74763,_0x6c3d('0x16'));_0x3fbfc3(_0x2b251f[_0x6c3d('0x17')][_0x6c3d('0x15')]);}})[_0x6c3d('0x18')](function(_0x5731fa){logger[_0x6c3d('0x13')](_0x6c3d('0xf'),_0x74763,_0x5731fa);_0x7d4b89(_0x5731fa);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index f9c0447..17777dc 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 _0xcabf=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5224b9,_0x195fcb){var _0x363bcc=function(_0x3d219a){while(--_0x3d219a){_0x5224b9['push'](_0x5224b9['shift']());}};_0x363bcc(++_0x195fcb);}(_0xcabf,0x1f2));var _0xfcab=function(_0x7ad4d5,_0x44ab61){_0x7ad4d5=_0x7ad4d5-0x0;var _0xfb6b46=_0xcabf[_0x7ad4d5];return _0xfb6b46;};'use strict';var multer=require(_0xfcab('0x0'));var util=require('util');var path=require(_0xfcab('0x1'));var timeout=require(_0xfcab('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfcab('0x3'));var auth=require(_0xfcab('0x4'));var interaction=require(_0xfcab('0x5'));var config=require(_0xfcab('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xfcab('0x7')]('/',auth[_0xfcab('0x8')](),controller['index']);router[_0xfcab('0x7')](_0xfcab('0x9'),auth[_0xfcab('0x8')](),controller[_0xfcab('0xa')]);router[_0xfcab('0x7')](_0xfcab('0xb'),auth[_0xfcab('0x8')](),controller[_0xfcab('0xc')]);router[_0xfcab('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfcab('0xe')](_0xfcab('0xb'),auth[_0xfcab('0x8')](),controller[_0xfcab('0xf')]);router['delete'](_0xfcab('0xb'),auth['isAuthenticated'](),controller[_0xfcab('0x10')]);module[_0xfcab('0x11')]=router;
\ No newline at end of file
+var _0xecfd=['delete','destroy','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x5a474d,_0x3c85e2){var _0x512f2a=function(_0x2f6669){while(--_0x2f6669){_0x5a474d['push'](_0x5a474d['shift']());}};_0x512f2a(++_0x3c85e2);}(_0xecfd,0x1d6));var _0xdecf=function(_0x275709,_0x51f458){_0x275709=_0x275709-0x0;var _0x20bafb=_0xecfd[_0x275709];return _0x20bafb;};'use strict';var multer=require(_0xdecf('0x0'));var util=require(_0xdecf('0x1'));var path=require(_0xdecf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdecf('0x3'));var auth=require(_0xdecf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdecf('0x5'));var controller=require(_0xdecf('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xdecf('0x7')](_0xdecf('0x8'),auth[_0xdecf('0x9')](),controller['describe']);router['get'](_0xdecf('0xa'),auth[_0xdecf('0x9')](),controller[_0xdecf('0xb')]);router[_0xdecf('0xc')]('/',auth['isAuthenticated'](),controller[_0xdecf('0xd')]);router[_0xdecf('0xe')]('/:id',auth[_0xdecf('0x9')](),controller[_0xdecf('0xf')]);router[_0xdecf('0x10')](_0xdecf('0xa'),auth[_0xdecf('0x9')](),controller[_0xdecf('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index a426fdc..f4038a5 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 _0x5494=['exports','STRING','mouseOver','timeout','INTEGER','sequelize'];(function(_0x47ac41,_0x1dba4b){var _0x5a4c8a=function(_0x201036){while(--_0x201036){_0x47ac41['push'](_0x47ac41['shift']());}};_0x5a4c8a(++_0x1dba4b);}(_0x5494,0x1cd));var _0x4549=function(_0x38a155,_0x2aa026){_0x38a155=_0x38a155-0x0;var _0x269403=_0x5494[_0x38a155];return _0x269403;};'use strict';var Sequelize=require(_0x4549('0x0'));module[_0x4549('0x1')]={'name':{'type':Sequelize[_0x4549('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4549('0x3'),_0x4549('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x4549('0x5')]}};
\ No newline at end of file
+var _0xd73c=['ENUM','mouseOver','INTEGER','STRING'];(function(_0x166e8d,_0x16181b){var _0x287e90=function(_0x5233a0){while(--_0x5233a0){_0x166e8d['push'](_0x166e8d['shift']());}};_0x287e90(++_0x16181b);}(_0xd73c,0x11b));var _0xcd73=function(_0x581e92,_0x34f32f){_0x581e92=_0x581e92-0x0;var _0xaf08d4=_0xd73c[_0x581e92];return _0xaf08d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcd73('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xcd73('0x1')]('mouseOver','timeout'),'defaultValue':_0xcd73('0x2')},'selector':{'type':Sequelize[_0xcd73('0x0')]},'timeout':{'type':Sequelize[_0xcd73('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index bde6852..5250a8b 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 _0x177a=['catch','create','body','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','set','Content-Range','save','then','stack','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','find'];(function(_0x13e999,_0xc4b319){var _0x78e618=function(_0x53e6d4){while(--_0x53e6d4){_0x13e999['push'](_0x13e999['shift']());}};_0x78e618(++_0xc4b319);}(_0x177a,0xdd));var _0xa177=function(_0x3b413b,_0x4a683f){_0x3b413b=_0x3b413b-0x0;var _0x78ef6d=_0x177a[_0x3b413b];return _0x78ef6d;};'use strict';var emlformat=require(_0xa177('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa177('0x1'));var rp=require(_0xa177('0x2'));var moment=require(_0xa177('0x3'));var BPromise=require(_0xa177('0x4'));var Mustache=require(_0xa177('0x5'));var util=require(_0xa177('0x6'));var path=require('path');var sox=require(_0xa177('0x7'));var csv=require(_0xa177('0x8'));var ejs=require(_0xa177('0x9'));var fs=require('fs');var fs_extra=require(_0xa177('0xa'));var _=require(_0xa177('0xb'));var squel=require(_0xa177('0xc'));var crypto=require(_0xa177('0xd'));var jsforce=require(_0xa177('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa177('0x8'));var querystring=require('querystring');var Papa=require(_0xa177('0xf'));var Redis=require(_0xa177('0x10'));var authService=require(_0xa177('0x11'));var qs=require(_0xa177('0x12'));var as=require(_0xa177('0x13'));var hardwareService=require(_0xa177('0x14'));var logger=require(_0xa177('0x15'))('api');var utils=require(_0xa177('0x16'));var config=require(_0xa177('0x17'));var licenseUtil=require(_0xa177('0x18'));var db=require(_0xa177('0x19'))['db'];function respondWithStatusCode(_0x411274,_0x34baf1){_0x34baf1=_0x34baf1||0xcc;return function(_0x26c738){if(_0x26c738){return _0x411274['sendStatus'](_0x34baf1);}return _0x411274['status'](_0x34baf1)[_0xa177('0x1a')]();};}function respondWithResult(_0x198a92,_0x39d274){_0x39d274=_0x39d274||0xc8;return function(_0x179f42){if(_0x179f42){return _0x198a92[_0xa177('0x1b')](_0x39d274)[_0xa177('0x1c')](_0x179f42);}};}function respondWithFilteredResult(_0x258985,_0xbc9fa4){return function(_0x278633){if(_0x278633){var _0x3c1443=typeof _0xbc9fa4[_0xa177('0x1d')]===_0xa177('0x1e')&&typeof _0xbc9fa4['limit']===_0xa177('0x1e');var _0x43fc77=_0x278633['count'];var _0x5e6ae3=_0x3c1443?0x0:_0xbc9fa4[_0xa177('0x1d')];var _0x11b060=_0x3c1443?_0x278633[_0xa177('0x1f')]:_0xbc9fa4['offset']+_0xbc9fa4['limit'];var _0x516acf;if(_0x11b060>=_0x43fc77){_0x11b060=_0x43fc77;_0x516acf=0xc8;}else{_0x516acf=0xce;}_0x258985[_0xa177('0x1b')](_0x516acf);return _0x258985[_0xa177('0x20')](_0xa177('0x21'),_0x5e6ae3+'-'+_0x11b060+'/'+_0x43fc77)[_0xa177('0x1c')](_0x278633);}return null;};}function patchUpdates(_0x50a957){return function(_0x324bda){try{jsonpatch['apply'](_0x324bda,_0x50a957,!![]);}catch(_0x3b2fa6){return BPromise['reject'](_0x3b2fa6);}return _0x324bda[_0xa177('0x22')]();};}function saveUpdates(_0x184178,_0x369942){return function(_0x279632){if(_0x279632){return _0x279632['update'](_0x184178)[_0xa177('0x23')](function(_0x27a0f1){return _0x27a0f1;});}return null;};}function removeEntity(_0x1ad5da,_0x4bc686){return function(_0x5d5118){if(_0x5d5118){return _0x5d5118['destroy']()['then'](function(){_0x1ad5da[_0xa177('0x1b')](0xcc)[_0xa177('0x1a')]();});}};}function handleEntityNotFound(_0x1cf775,_0x1b7cec){return function(_0xf5d168){if(!_0xf5d168){_0x1cf775['sendStatus'](0x194);}return _0xf5d168;};}function handleError(_0x31608c,_0x102095){_0x102095=_0x102095||0x1f4;return function(_0x479587){logger['error'](_0x479587[_0xa177('0x24')]);if(_0x479587['name']){delete _0x479587['name'];}_0x31608c['status'](_0x102095)[_0xa177('0x25')](_0x479587);};}exports['show']=function(_0x216cab,_0x3ae38f){var _0x320cce={'raw':!![],'where':{'id':_0x216cab[_0xa177('0x26')]['id']}},_0x5f20d4={};_0x5f20d4[_0xa177('0x27')]=_['keys'](db[_0xa177('0x28')][_0xa177('0x29')]);_0x5f20d4[_0xa177('0x2a')]=_[_0xa177('0x2b')](_0x216cab[_0xa177('0x2a')]);_0x5f20d4[_0xa177('0x2c')]=_[_0xa177('0x2d')](_0x5f20d4[_0xa177('0x27')],_0x5f20d4['query']);_0x320cce[_0xa177('0x2e')]=_[_0xa177('0x2d')](_0x5f20d4['model'],qs[_0xa177('0x2f')](_0x216cab[_0xa177('0x2a')]['fields']));_0x320cce[_0xa177('0x2e')]=_0x320cce[_0xa177('0x2e')]['length']?_0x320cce[_0xa177('0x2e')]:_0x5f20d4[_0xa177('0x27')];if(_0x216cab[_0xa177('0x2a')]['includeAll']){_0x320cce['include']=[{'all':!![]}];}_0x320cce=_['merge']({},_0x320cce,_0x216cab['options']);return db['ChatProactiveAction'][_0xa177('0x30')](_0x320cce)[_0xa177('0x23')](handleEntityNotFound(_0x3ae38f,null))[_0xa177('0x23')](respondWithResult(_0x3ae38f,null))[_0xa177('0x31')](handleError(_0x3ae38f,null));};exports[_0xa177('0x32')]=function(_0x79f018,_0x4c0890){return db[_0xa177('0x28')][_0xa177('0x32')](_0x79f018[_0xa177('0x33')],{})[_0xa177('0x23')](respondWithResult(_0x4c0890,0xc9))[_0xa177('0x31')](handleError(_0x4c0890,null));};exports[_0xa177('0x34')]=function(_0x3d2350,_0x3d141c){if(_0x3d2350['body']['id']){delete _0x3d2350[_0xa177('0x33')]['id'];}return db[_0xa177('0x28')]['find']({'where':{'id':_0x3d2350[_0xa177('0x26')]['id']}})['then'](handleEntityNotFound(_0x3d141c,null))[_0xa177('0x23')](saveUpdates(_0x3d2350[_0xa177('0x33')],null))['then'](respondWithResult(_0x3d141c,null))[_0xa177('0x31')](handleError(_0x3d141c,null));};exports[_0xa177('0x35')]=function(_0x2e4712,_0x80d2ae){return db[_0xa177('0x28')][_0xa177('0x30')]({'where':{'id':_0x2e4712[_0xa177('0x26')]['id']}})[_0xa177('0x23')](handleEntityNotFound(_0x80d2ae,null))[_0xa177('0x23')](removeEntity(_0x80d2ae,null))[_0xa177('0x31')](handleError(_0x80d2ae,null));};
\ No newline at end of file
+var _0x04de=['query','keys','filters','intersection','attributes','length','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','then','error','stack','name','send','params','model','rawAttributes'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x04de,0x107));var _0xe04d=function(_0xf9936a,_0x3f2f70){_0xf9936a=_0xf9936a-0x0;var _0x234dee=_0x04de[_0xf9936a];return _0x234dee;};'use strict';var emlformat=require(_0xe04d('0x0'));var rimraf=require(_0xe04d('0x1'));var zipdir=require(_0xe04d('0x2'));var jsonpatch=require(_0xe04d('0x3'));var rp=require(_0xe04d('0x4'));var moment=require(_0xe04d('0x5'));var BPromise=require(_0xe04d('0x6'));var Mustache=require(_0xe04d('0x7'));var util=require(_0xe04d('0x8'));var path=require(_0xe04d('0x9'));var sox=require(_0xe04d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe04d('0xb'));var crypto=require(_0xe04d('0xc'));var jsforce=require(_0xe04d('0xd'));var deskjs=require(_0xe04d('0xe'));var toCsv=require(_0xe04d('0xf'));var querystring=require(_0xe04d('0x10'));var Papa=require(_0xe04d('0x11'));var Redis=require(_0xe04d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe04d('0x13'));var as=require(_0xe04d('0x14'));var hardwareService=require(_0xe04d('0x15'));var logger=require(_0xe04d('0x16'))(_0xe04d('0x17'));var utils=require(_0xe04d('0x18'));var config=require(_0xe04d('0x19'));var licenseUtil=require(_0xe04d('0x1a'));var db=require(_0xe04d('0x1b'))['db'];function respondWithStatusCode(_0x53f59a,_0x8bf2d2){_0x8bf2d2=_0x8bf2d2||0xcc;return function(_0x1d3f03){if(_0x1d3f03){return _0x53f59a[_0xe04d('0x1c')](_0x8bf2d2);}return _0x53f59a[_0xe04d('0x1d')](_0x8bf2d2)[_0xe04d('0x1e')]();};}function respondWithResult(_0xa2521,_0xf205f5){_0xf205f5=_0xf205f5||0xc8;return function(_0x143019){if(_0x143019){return _0xa2521[_0xe04d('0x1d')](_0xf205f5)[_0xe04d('0x1f')](_0x143019);}};}function respondWithFilteredResult(_0xbc5cc7,_0x1aa69b){return function(_0x5cfd5b){if(_0x5cfd5b){var _0x1f29a7=typeof _0x1aa69b['offset']===_0xe04d('0x20')&&typeof _0x1aa69b['limit']===_0xe04d('0x20');var _0xbd5fa1=_0x5cfd5b[_0xe04d('0x21')];var _0x93b107=_0x1f29a7?0x0:_0x1aa69b[_0xe04d('0x22')];var _0x35a2b4=_0x1f29a7?_0x5cfd5b[_0xe04d('0x21')]:_0x1aa69b[_0xe04d('0x22')]+_0x1aa69b[_0xe04d('0x23')];var _0x5d8a1e;if(_0x35a2b4>=_0xbd5fa1){_0x35a2b4=_0xbd5fa1;_0x5d8a1e=0xc8;}else{_0x5d8a1e=0xce;}_0xbc5cc7[_0xe04d('0x1d')](_0x5d8a1e);return _0xbc5cc7[_0xe04d('0x24')](_0xe04d('0x25'),_0x93b107+'-'+_0x35a2b4+'/'+_0xbd5fa1)[_0xe04d('0x1f')](_0x5cfd5b);}return null;};}function patchUpdates(_0x2ac847){return function(_0x34e15f){try{jsonpatch['apply'](_0x34e15f,_0x2ac847,!![]);}catch(_0x3b1f42){return BPromise[_0xe04d('0x26')](_0x3b1f42);}return _0x34e15f['save']();};}function saveUpdates(_0x4b4d8b,_0x5bcfc3){return function(_0x46fab1){if(_0x46fab1){return _0x46fab1['update'](_0x4b4d8b)['then'](function(_0x185d42){return _0x185d42;});}return null;};}function removeEntity(_0x26a869,_0x495f73){return function(_0x942d8a){if(_0x942d8a){return _0x942d8a['destroy']()[_0xe04d('0x27')](function(){_0x26a869['status'](0xcc)[_0xe04d('0x1e')]();});}};}function handleEntityNotFound(_0x456822,_0x48db4e){return function(_0x29ad33){if(!_0x29ad33){_0x456822[_0xe04d('0x1c')](0x194);}return _0x29ad33;};}function handleError(_0x51540e,_0x10aa20){_0x10aa20=_0x10aa20||0x1f4;return function(_0x3e43ca){logger[_0xe04d('0x28')](_0x3e43ca[_0xe04d('0x29')]);if(_0x3e43ca['name']){delete _0x3e43ca[_0xe04d('0x2a')];}_0x51540e[_0xe04d('0x1d')](_0x10aa20)[_0xe04d('0x2b')](_0x3e43ca);};}exports['show']=function(_0x187c29,_0x5a3899){var _0x4f5883={'raw':!![],'where':{'id':_0x187c29[_0xe04d('0x2c')]['id']}},_0x569e4b={};_0x569e4b[_0xe04d('0x2d')]=_['keys'](db['ChatProactiveAction'][_0xe04d('0x2e')]);_0x569e4b[_0xe04d('0x2f')]=_[_0xe04d('0x30')](_0x187c29['query']);_0x569e4b[_0xe04d('0x31')]=_[_0xe04d('0x32')](_0x569e4b['model'],_0x569e4b[_0xe04d('0x2f')]);_0x4f5883['attributes']=_[_0xe04d('0x32')](_0x569e4b[_0xe04d('0x2d')],qs['fields'](_0x187c29[_0xe04d('0x2f')]['fields']));_0x4f5883[_0xe04d('0x33')]=_0x4f5883[_0xe04d('0x33')][_0xe04d('0x34')]?_0x4f5883[_0xe04d('0x33')]:_0x569e4b[_0xe04d('0x2d')];if(_0x187c29[_0xe04d('0x2f')][_0xe04d('0x35')]){_0x4f5883['include']=[{'all':!![]}];}_0x4f5883=_[_0xe04d('0x36')]({},_0x4f5883,_0x187c29[_0xe04d('0x37')]);return db[_0xe04d('0x38')][_0xe04d('0x39')](_0x4f5883)[_0xe04d('0x27')](handleEntityNotFound(_0x5a3899,null))[_0xe04d('0x27')](respondWithResult(_0x5a3899,null))[_0xe04d('0x3a')](handleError(_0x5a3899,null));};exports[_0xe04d('0x3b')]=function(_0x26c6c5,_0x59ed1c){return db[_0xe04d('0x38')]['create'](_0x26c6c5[_0xe04d('0x3c')],{})['then'](respondWithResult(_0x59ed1c,0xc9))['catch'](handleError(_0x59ed1c,null));};exports[_0xe04d('0x3d')]=function(_0x9353a1,_0x261116){if(_0x9353a1[_0xe04d('0x3c')]['id']){delete _0x9353a1['body']['id'];}return db[_0xe04d('0x38')][_0xe04d('0x39')]({'where':{'id':_0x9353a1[_0xe04d('0x2c')]['id']}})[_0xe04d('0x27')](handleEntityNotFound(_0x261116,null))[_0xe04d('0x27')](saveUpdates(_0x9353a1['body'],null))['then'](respondWithResult(_0x261116,null))[_0xe04d('0x3a')](handleError(_0x261116,null));};exports['destroy']=function(_0x53c072,_0x23e4b2){return db[_0xe04d('0x38')][_0xe04d('0x39')]({'where':{'id':_0x53c072[_0xe04d('0x2c')]['id']}})['then'](handleEntityNotFound(_0x23e4b2,null))['then'](removeEntity(_0x23e4b2,null))[_0xe04d('0x3a')](handleError(_0x23e4b2,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 39b728b..6382068 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 _0xabda=['ChatProactiveAction','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0xabda,0xf1));var _0xaabd=function(_0x540160,_0x24c6b6){_0x540160=_0x540160-0x0;var _0x476120=_0xabda[_0x540160];return _0x476120;};'use strict';var _=require(_0xaabd('0x0'));var util=require(_0xaabd('0x1'));var logger=require(_0xaabd('0x2'))('api');var moment=require(_0xaabd('0x3'));var BPromise=require(_0xaabd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaabd('0x5'));var rimraf=require(_0xaabd('0x6'));var config=require('../../config/environment');var attributes=require(_0xaabd('0x7'));module[_0xaabd('0x8')]=function(_0x3b6697,_0x57cad3){return _0x3b6697['define'](_0xaabd('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea97=['util','api','moment','bluebird','path','rimraf','exports','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xea97,0xd1));var _0x7ea9=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xea97[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x7ea9('0x0'));var util=require(_0x7ea9('0x1'));var logger=require('../../config/logger')(_0x7ea9('0x2'));var moment=require(_0x7ea9('0x3'));var BPromise=require(_0x7ea9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ea9('0x5'));var rimraf=require(_0x7ea9('0x6'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0x7ea9('0x7')]=function(_0x291b42,_0x585fc7){return _0x291b42['define'](_0x7ea9('0x8'),attributes,{'tableName':_0x7ea9('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 3e96899..da3f599 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 _0x6075=['result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/environment','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x552352,_0x51e3b0){var _0x1e0d71=function(_0xa0c4f5){while(--_0xa0c4f5){_0x552352['push'](_0x552352['shift']());}};_0x1e0d71(++_0x51e3b0);}(_0x6075,0x142));var _0x5607=function(_0x172ced,_0x16e422){_0x172ced=_0x172ced-0x0;var _0x220b96=_0x6075[_0x172ced];return _0x220b96;};'use strict';var _=require(_0x5607('0x0'));var util=require(_0x5607('0x1'));var moment=require('moment');var BPromise=require(_0x5607('0x2'));var rs=require(_0x5607('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5607('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5607('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5607('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34a8d9,_0x49f0f2,_0x415836){return new BPromise(function(_0x5f92ad,_0xbdf802){return client[_0x5607('0x7')](_0x34a8d9,_0x415836)[_0x5607('0x8')](function(_0x2aec99){logger[_0x5607('0x9')](_0x5607('0xa'),_0x49f0f2,_0x5607('0xb'));logger[_0x5607('0xc')](_0x5607('0xd'),_0x49f0f2,_0x5607('0xb'),JSON[_0x5607('0xe')](_0x2aec99));if(_0x2aec99['error']){if(_0x2aec99[_0x5607('0xf')][_0x5607('0x10')]===0x1f4){logger[_0x5607('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x49f0f2,_0x2aec99[_0x5607('0xf')][_0x5607('0x11')]);return _0xbdf802(_0x2aec99['error'][_0x5607('0x11')]);}logger[_0x5607('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x49f0f2,_0x2aec99[_0x5607('0xf')]['message']);return _0x5f92ad(_0x2aec99[_0x5607('0xf')][_0x5607('0x11')]);}else{logger[_0x5607('0x9')](_0x5607('0xa'),_0x49f0f2,_0x5607('0xb'));_0x5f92ad(_0x2aec99[_0x5607('0x12')][_0x5607('0x11')]);}})[_0x5607('0x13')](function(_0x156060){logger[_0x5607('0xf')](_0x5607('0xa'),_0x49f0f2,_0x156060);_0xbdf802(_0x156060);});});}
\ No newline at end of file
+var _0x805b=['message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2100f2,_0x254f79){var _0x3e265c=function(_0x6e64c0){while(--_0x6e64c0){_0x2100f2['push'](_0x2100f2['shift']());}};_0x3e265c(++_0x254f79);}(_0x805b,0x162));var _0xb805=function(_0x4df7f8,_0x28cdcf){_0x4df7f8=_0x4df7f8-0x0;var _0x24404b=_0x805b[_0x4df7f8];return _0x24404b;};'use strict';var _=require('lodash');var util=require(_0xb805('0x0'));var moment=require(_0xb805('0x1'));var BPromise=require(_0xb805('0x2'));var rs=require(_0xb805('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb805('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb805('0x5'))(_0xb805('0x6'));var config=require(_0xb805('0x7'));var jayson=require(_0xb805('0x8'));var client=jayson[_0xb805('0x9')][_0xb805('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e3c07,_0x1f4207,_0x53509a){return new BPromise(function(_0x9adfe5,_0x383575){return client[_0xb805('0xb')](_0x1e3c07,_0x53509a)[_0xb805('0xc')](function(_0x44becf){logger[_0xb805('0xd')](_0xb805('0xe'),_0x1f4207,_0xb805('0xf'));logger[_0xb805('0x10')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x1f4207,_0xb805('0xf'),JSON[_0xb805('0x11')](_0x44becf));if(_0x44becf[_0xb805('0x12')]){if(_0x44becf[_0xb805('0x12')][_0xb805('0x13')]===0x1f4){logger[_0xb805('0x12')](_0xb805('0xe'),_0x1f4207,_0x44becf['error'][_0xb805('0x14')]);return _0x383575(_0x44becf[_0xb805('0x12')]['message']);}logger[_0xb805('0x12')](_0xb805('0xe'),_0x1f4207,_0x44becf[_0xb805('0x12')]['message']);return _0x9adfe5(_0x44becf[_0xb805('0x12')][_0xb805('0x14')]);}else{logger[_0xb805('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x1f4207,_0xb805('0xf'));_0x9adfe5(_0x44becf[_0xb805('0x15')][_0xb805('0x14')]);}})['catch'](function(_0x3f68f0){logger[_0xb805('0x12')](_0xb805('0xe'),_0x1f4207,_0x3f68f0);_0x383575(_0x3f68f0);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 0a1d7d1..9a414d3 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 _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x40f58b,_0x372061){_0x40f58b=_0x40f58b-0x0;var _0x2bcc2a=_0x8d0e[_0x40f58b];return _0x2bcc2a;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x146ca3,_0x29a10e){var _0x30dd24=function(_0x4b4f36){while(--_0x4b4f36){_0x146ca3['push'](_0x146ca3['shift']());}};_0x30dd24(++_0x29a10e);}(_0x46ed,0x168));var _0xd46e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x46ed[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 3943633..2bf1881 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 _0x46aa=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x46aa,0x6e));var _0xa46a=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x46aa[_0x725b8e];return _0x43ac45;};'use strict';var Sequelize=require('sequelize');module[_0xa46a('0x0')]={'name':{'type':Sequelize[_0xa46a('0x1')],'unique':_0xa46a('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa46a('0x1')]},'timeout':{'type':Sequelize[_0xa46a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa46a('0x4')](_0xa46a('0x5'),_0xa46a('0x6'),_0xa46a('0x7'))}};
\ No newline at end of file
+var _0xee95=['STRING','rrmemory','beepall','sequelize','exports'];(function(_0x165a3c,_0x31411e){var _0x2a22eb=function(_0x43f0b2){while(--_0x43f0b2){_0x165a3c['push'](_0x165a3c['shift']());}};_0x2a22eb(++_0x31411e);}(_0xee95,0x1b1));var _0x5ee9=function(_0x141db1,_0x550580){_0x141db1=_0x141db1-0x0;var _0x1c70f7=_0xee95[_0x141db1];return _0x1c70f7;};'use strict';var Sequelize=require(_0x5ee9('0x0'));module[_0x5ee9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5ee9('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5ee9('0x3'),_0x5ee9('0x4'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 20a2935..7c82df9 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 _0xaf02=['online','interface','flatMap','sequelize','transaction','each','findOrCreate','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','ids','isEmpty','forEach','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','ChatQueues','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xaf02,0x1f4));var _0x2af0=function(_0x3005f4,_0x1de400){_0x3005f4=_0x3005f4-0x0;var _0x1fd800=_0xaf02[_0x3005f4];return _0x1fd800;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2af0('0x0'));var zipdir=require(_0x2af0('0x1'));var jsonpatch=require(_0x2af0('0x2'));var rp=require(_0x2af0('0x3'));var moment=require(_0x2af0('0x4'));var BPromise=require(_0x2af0('0x5'));var Mustache=require(_0x2af0('0x6'));var util=require(_0x2af0('0x7'));var path=require(_0x2af0('0x8'));var sox=require(_0x2af0('0x9'));var csv=require(_0x2af0('0xa'));var ejs=require(_0x2af0('0xb'));var fs=require('fs');var fs_extra=require(_0x2af0('0xc'));var _=require(_0x2af0('0xd'));var squel=require(_0x2af0('0xe'));var crypto=require(_0x2af0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2af0('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2af0('0x11'));var Papa=require(_0x2af0('0x12'));var Redis=require(_0x2af0('0x13'));var authService=require(_0x2af0('0x14'));var qs=require(_0x2af0('0x15'));var as=require(_0x2af0('0x16'));var hardwareService=require(_0x2af0('0x17'));var logger=require(_0x2af0('0x18'))(_0x2af0('0x19'));var utils=require(_0x2af0('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2af0('0x1b'))['db'];config[_0x2af0('0x1c')]=_[_0x2af0('0x1d')](config['redis'],{'host':_0x2af0('0x1e'),'port':0x18eb});var socket=require(_0x2af0('0x1f'))(new Redis(config[_0x2af0('0x1c')]));require(_0x2af0('0x20'))[_0x2af0('0x21')](socket);var jayson=require(_0x2af0('0x22'));var client=jayson[_0x2af0('0x23')][_0x2af0('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x1b7b54,_0x23d50b,_0x201ae4,_0x45429e){return new BPromise(function(_0x56947f,_0x53cebe){var _0xff2a9e=_0x45429e||client;return _0xff2a9e['request'](_0x1b7b54,_0x201ae4)[_0x2af0('0x25')](function(_0x14127a){logger[_0x2af0('0x26')](_0x2af0('0x27'),_0x23d50b,'request\x20sent');logger[_0x2af0('0x28')](_0x2af0('0x29'),_0x23d50b,'request\x20sent',JSON[_0x2af0('0x2a')](_0x14127a));if(_0x14127a[_0x2af0('0x2b')]){if(_0x14127a[_0x2af0('0x2b')]['code']===0x1f4){logger[_0x2af0('0x2b')](_0x2af0('0x27'),_0x23d50b,_0x14127a[_0x2af0('0x2b')][_0x2af0('0x2c')]);return _0x53cebe(_0x14127a[_0x2af0('0x2b')]['message']);}logger[_0x2af0('0x2b')](_0x2af0('0x27'),_0x23d50b,_0x14127a[_0x2af0('0x2b')][_0x2af0('0x2c')]);return _0x56947f(_0x14127a[_0x2af0('0x2b')][_0x2af0('0x2c')]);}else{logger[_0x2af0('0x26')](_0x2af0('0x27'),_0x23d50b,_0x2af0('0x2d'));_0x56947f(_0x14127a['result'][_0x2af0('0x2c')]);}})[_0x2af0('0x2e')](function(_0x226351){logger['error']('ChatQueue,\x20%s,\x20%s',_0x23d50b,_0x226351);_0x53cebe(_0x226351);});});}function respondWithStatusCode(_0x43fcd5,_0x3e42bd){_0x3e42bd=_0x3e42bd||0xcc;return function(_0x18537c){if(_0x18537c){return _0x43fcd5[_0x2af0('0x2f')](_0x3e42bd);}return _0x43fcd5[_0x2af0('0x30')](_0x3e42bd)[_0x2af0('0x31')]();};}function respondWithResult(_0x4c5227,_0x58cbb7){_0x58cbb7=_0x58cbb7||0xc8;return function(_0x1a6e89){if(_0x1a6e89){return _0x4c5227[_0x2af0('0x30')](_0x58cbb7)[_0x2af0('0x32')](_0x1a6e89);}};}function respondWithFilteredResult(_0x25d697,_0x53d364){return function(_0x51a017){if(_0x51a017){var _0x4c3ad3=typeof _0x53d364[_0x2af0('0x33')]===_0x2af0('0x34')&&typeof _0x53d364['limit']===_0x2af0('0x34');var _0x14b0c2=_0x51a017[_0x2af0('0x35')];var _0x28f289=_0x4c3ad3?0x0:_0x53d364[_0x2af0('0x33')];var _0xaa8452=_0x4c3ad3?_0x51a017[_0x2af0('0x35')]:_0x53d364[_0x2af0('0x33')]+_0x53d364[_0x2af0('0x36')];var _0x3f6697;if(_0xaa8452>=_0x14b0c2){_0xaa8452=_0x14b0c2;_0x3f6697=0xc8;}else{_0x3f6697=0xce;}_0x25d697[_0x2af0('0x30')](_0x3f6697);return _0x25d697[_0x2af0('0x37')](_0x2af0('0x38'),_0x28f289+'-'+_0xaa8452+'/'+_0x14b0c2)[_0x2af0('0x32')](_0x51a017);}return null;};}function patchUpdates(_0x3836b7){return function(_0x41ca4a){try{jsonpatch[_0x2af0('0x39')](_0x41ca4a,_0x3836b7,!![]);}catch(_0x233c20){return BPromise['reject'](_0x233c20);}return _0x41ca4a[_0x2af0('0x3a')]();};}function saveUpdates(_0x12732a,_0x46f073){return function(_0x4b0b93){if(_0x4b0b93){return _0x4b0b93[_0x2af0('0x3b')](_0x12732a)[_0x2af0('0x25')](function(_0x55626a){return _0x55626a;});}return null;};}function removeEntity(_0x91529e,_0x501640){return function(_0x5624be){if(_0x5624be){return _0x5624be[_0x2af0('0x3c')]()['then'](function(){var _0x397cd7=_0x5624be['get']({'plain':!![]});var _0x205dc5=_0x2af0('0x3d');return db['UserProfileResource'][_0x2af0('0x3c')]({'where':{'type':_0x205dc5,'resourceId':_0x397cd7['id']}})[_0x2af0('0x25')](function(){return _0x5624be;});})['then'](function(){_0x91529e['status'](0xcc)[_0x2af0('0x31')]();});}};}function handleEntityNotFound(_0x53edbc,_0x93af2c){return function(_0x5dfc33){if(!_0x5dfc33){_0x53edbc[_0x2af0('0x2f')](0x194);}return _0x5dfc33;};}function handleError(_0x3d4fb8,_0x4dba63){_0x4dba63=_0x4dba63||0x1f4;return function(_0x266b35){logger[_0x2af0('0x2b')](_0x266b35['stack']);if(_0x266b35['name']){delete _0x266b35[_0x2af0('0x3e')];}_0x3d4fb8[_0x2af0('0x30')](_0x4dba63)[_0x2af0('0x3f')](_0x266b35);};}exports[_0x2af0('0x40')]=function(_0x2eb541,_0x312873){var _0x247a8a={},_0xd93c00={},_0x333efb={'count':0x0,'rows':[]};var _0x466d70=_[_0x2af0('0x41')](db[_0x2af0('0x42')][_0x2af0('0x43')],function(_0x4dc17e){return{'name':_0x4dc17e[_0x2af0('0x44')],'type':_0x4dc17e[_0x2af0('0x45')][_0x2af0('0x46')]};});_0xd93c00['model']=_[_0x2af0('0x41')](_0x466d70,_0x2af0('0x3e'));_0xd93c00[_0x2af0('0x47')]=_[_0x2af0('0x48')](_0x2eb541['query']);_0xd93c00[_0x2af0('0x49')]=_[_0x2af0('0x4a')](_0xd93c00['model'],_0xd93c00['query']);_0x247a8a[_0x2af0('0x4b')]=_[_0x2af0('0x4a')](_0xd93c00[_0x2af0('0x4c')],qs[_0x2af0('0x4d')](_0x2eb541[_0x2af0('0x47')][_0x2af0('0x4d')]));_0x247a8a[_0x2af0('0x4b')]=_0x247a8a[_0x2af0('0x4b')][_0x2af0('0x4e')]?_0x247a8a[_0x2af0('0x4b')]:_0xd93c00[_0x2af0('0x4c')];if(!_0x2eb541[_0x2af0('0x47')][_0x2af0('0x4f')](_0x2af0('0x50'))){_0x247a8a[_0x2af0('0x36')]=qs[_0x2af0('0x36')](_0x2eb541[_0x2af0('0x47')]['limit']);_0x247a8a[_0x2af0('0x33')]=qs[_0x2af0('0x33')](_0x2eb541['query'][_0x2af0('0x33')]);}_0x247a8a['order']=qs['sort'](_0x2eb541[_0x2af0('0x47')][_0x2af0('0x51')]);_0x247a8a[_0x2af0('0x52')]=qs[_0x2af0('0x49')](_[_0x2af0('0x53')](_0x2eb541[_0x2af0('0x47')],_0xd93c00[_0x2af0('0x49')]),_0x466d70);if(_0x2eb541[_0x2af0('0x47')][_0x2af0('0x54')]){_0x247a8a[_0x2af0('0x52')]=_[_0x2af0('0x55')](_0x247a8a[_0x2af0('0x52')],{'$or':_[_0x2af0('0x41')](_0x466d70,function(_0x52ef7a){if(_0x52ef7a['type']!==_0x2af0('0x56')){var _0x4e83c3={};_0x4e83c3[_0x52ef7a[_0x2af0('0x3e')]]={'$like':'%'+_0x2eb541['query']['filter']+'%'};return _0x4e83c3;}})});}_0x247a8a=_[_0x2af0('0x55')]({},_0x247a8a,_0x2eb541['options']);var _0x27353a={'where':_0x247a8a[_0x2af0('0x52')]};return db['ChatQueue'][_0x2af0('0x35')](_0x27353a)[_0x2af0('0x25')](function(_0x170005){_0x333efb[_0x2af0('0x35')]=_0x170005;if(_0x2eb541[_0x2af0('0x47')][_0x2af0('0x57')]){_0x247a8a[_0x2af0('0x58')]=[{'all':!![]}];}return db[_0x2af0('0x42')][_0x2af0('0x59')](_0x247a8a);})[_0x2af0('0x25')](function(_0x5093f4){_0x333efb[_0x2af0('0x5a')]=_0x5093f4;return _0x333efb;})[_0x2af0('0x25')](respondWithFilteredResult(_0x312873,_0x247a8a))[_0x2af0('0x2e')](handleError(_0x312873,null));};exports['show']=function(_0x3b6242,_0x26040a){var _0x2dbf80={'raw':!![],'where':{'id':_0x3b6242[_0x2af0('0x5b')]['id']}},_0x21b1a5={};_0x21b1a5[_0x2af0('0x4c')]=_[_0x2af0('0x48')](db[_0x2af0('0x42')]['rawAttributes']);_0x21b1a5[_0x2af0('0x47')]=_[_0x2af0('0x48')](_0x3b6242['query']);_0x21b1a5[_0x2af0('0x49')]=_[_0x2af0('0x4a')](_0x21b1a5[_0x2af0('0x4c')],_0x21b1a5[_0x2af0('0x47')]);_0x2dbf80['attributes']=_[_0x2af0('0x4a')](_0x21b1a5['model'],qs['fields'](_0x3b6242['query'][_0x2af0('0x4d')]));_0x2dbf80['attributes']=_0x2dbf80['attributes'][_0x2af0('0x4e')]?_0x2dbf80[_0x2af0('0x4b')]:_0x21b1a5[_0x2af0('0x4c')];if(_0x3b6242['query'][_0x2af0('0x57')]){_0x2dbf80[_0x2af0('0x58')]=[{'all':!![]}];}_0x2dbf80=_[_0x2af0('0x55')]({},_0x2dbf80,_0x3b6242[_0x2af0('0x5c')]);return db['ChatQueue'][_0x2af0('0x5d')](_0x2dbf80)[_0x2af0('0x25')](handleEntityNotFound(_0x26040a,null))[_0x2af0('0x25')](respondWithResult(_0x26040a,null))[_0x2af0('0x2e')](handleError(_0x26040a,null));};exports[_0x2af0('0x5e')]=function(_0x5a9f27,_0x105fbd){return db[_0x2af0('0x42')][_0x2af0('0x5e')](_0x5a9f27[_0x2af0('0x5f')],{})[_0x2af0('0x25')](function(_0x3b19ee){var _0x2f7af9=_0x5a9f27[_0x2af0('0x60')][_0x2af0('0x61')]({'plain':!![]});if(!_0x2f7af9)throw new Error(_0x2af0('0x62'));if(_0x2f7af9[_0x2af0('0x63')]==='user'){var _0x37e2a9=_0x3b19ee['get']({'plain':!![]});var _0x3f55cc='ChatQueues';return db['UserProfileSection'][_0x2af0('0x5d')]({'where':{'name':_0x3f55cc,'userProfileId':_0x2f7af9[_0x2af0('0x64')]},'raw':!![]})[_0x2af0('0x25')](function(_0x1630ba){if(_0x1630ba&&_0x1630ba[_0x2af0('0x65')]===0x0){return db[_0x2af0('0x66')]['create']({'name':_0x37e2a9[_0x2af0('0x3e')],'resourceId':_0x37e2a9['id'],'type':_0x1630ba[_0x2af0('0x3e')],'sectionId':_0x1630ba['id']},{})[_0x2af0('0x25')](function(){return _0x3b19ee;});}else{return _0x3b19ee;}})[_0x2af0('0x2e')](function(_0x43a7ca){logger[_0x2af0('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43a7ca);throw _0x43a7ca;});}return _0x3b19ee;})[_0x2af0('0x25')](respondWithResult(_0x105fbd,0xc9))['catch'](handleError(_0x105fbd,null));};exports[_0x2af0('0x3b')]=function(_0xc5f177,_0x204c5f){if(_0xc5f177[_0x2af0('0x5f')]['id']){delete _0xc5f177[_0x2af0('0x5f')]['id'];}return db[_0x2af0('0x42')][_0x2af0('0x5d')]({'where':{'id':_0xc5f177['params']['id']}})['then'](handleEntityNotFound(_0x204c5f,null))[_0x2af0('0x25')](saveUpdates(_0xc5f177['body'],null))['then'](respondWithResult(_0x204c5f,null))[_0x2af0('0x2e')](handleError(_0x204c5f,null));};exports['destroy']=function(_0x223e15,_0x3691ac){return db[_0x2af0('0x42')][_0x2af0('0x5d')]({'where':{'id':_0x223e15[_0x2af0('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3691ac,null))[_0x2af0('0x25')](removeEntity(_0x3691ac,null))[_0x2af0('0x2e')](handleError(_0x3691ac,null));};exports[_0x2af0('0x67')]=function(_0x238d4f,_0x526b4e){return db[_0x2af0('0x42')]['describe']()[_0x2af0('0x25')](respondWithResult(_0x526b4e,null))['catch'](handleError(_0x526b4e,null));};exports[_0x2af0('0x68')]=function(_0x3e19ed,_0x1e6bbd,_0x58cc81){var _0xa82ddb={'raw':!![],'where':{}},_0x17057e={},_0x527476;return db[_0x2af0('0x42')][_0x2af0('0x69')]({'where':{'id':_0x3e19ed[_0x2af0('0x5b')]['id']}})[_0x2af0('0x25')](handleEntityNotFound(_0x1e6bbd,null))[_0x2af0('0x25')](function(_0x5367b5){if(_0x5367b5){_0x527476=_0x5367b5[_0x2af0('0x61')]({'plain':!![]});_0x17057e[_0x2af0('0x4c')]=_[_0x2af0('0x48')](db[_0x2af0('0x6a')][_0x2af0('0x43')]);_0x17057e[_0x2af0('0x47')]=_[_0x2af0('0x48')](_0x3e19ed[_0x2af0('0x47')]);_0x17057e[_0x2af0('0x49')]=_[_0x2af0('0x4a')](_0x17057e[_0x2af0('0x4c')],_0x17057e[_0x2af0('0x47')]);_0xa82ddb[_0x2af0('0x4b')]=_[_0x2af0('0x4a')](_0x17057e[_0x2af0('0x4c')],qs[_0x2af0('0x4d')](_0x3e19ed['query'][_0x2af0('0x4d')]));_0xa82ddb['attributes']=_0xa82ddb['attributes'][_0x2af0('0x4e')]?_0xa82ddb[_0x2af0('0x4b')]:_0x17057e[_0x2af0('0x4c')];if(!_0x3e19ed[_0x2af0('0x47')][_0x2af0('0x4f')](_0x2af0('0x50'))){_0xa82ddb[_0x2af0('0x36')]=qs['limit'](_0x3e19ed[_0x2af0('0x47')][_0x2af0('0x36')]);_0xa82ddb[_0x2af0('0x33')]=qs[_0x2af0('0x33')](_0x3e19ed[_0x2af0('0x47')][_0x2af0('0x33')]);}_0xa82ddb['order']=qs[_0x2af0('0x51')](_0x3e19ed[_0x2af0('0x47')][_0x2af0('0x51')]);_0xa82ddb['where']=qs['filters'](_[_0x2af0('0x53')](_0x3e19ed['query'],_0x17057e[_0x2af0('0x49')]));_0xa82ddb['where'][_0x2af0('0x6b')]=_0x5367b5['id'];if(_0x3e19ed[_0x2af0('0x47')][_0x2af0('0x54')]){_0xa82ddb[_0x2af0('0x52')]=_['merge'](_0xa82ddb['where'],{'$or':_[_0x2af0('0x41')](_0xa82ddb[_0x2af0('0x4b')],function(_0x8dccf9){var _0xb6f55b={};_0xb6f55b[_0x8dccf9]={'$like':'%'+_0x3e19ed[_0x2af0('0x47')][_0x2af0('0x54')]+'%'};return _0xb6f55b;})});}_0xa82ddb=_['merge']({},_0xa82ddb,_0x3e19ed[_0x2af0('0x5c')]);return db[_0x2af0('0x6a')][_0x2af0('0x59')](_0xa82ddb);}})['then'](function(_0x1cac5b){if(_0x1cac5b){return db[_0x2af0('0x6c')][_0x2af0('0x6d')]({'where':{'id':_['map'](_0x1cac5b,_0x2af0('0x6e')),'role':'agent'},'attributes':['id',_0x2af0('0x3e'),_0x2af0('0x6f'),_0x2af0('0x70'),_0x2af0('0x71')]});}})[_0x2af0('0x25')](function(_0x466ea5){if(_0x466ea5){return{'count':_0x466ea5['count'],'rows':_[_0x2af0('0x41')](_0x466ea5[_0x2af0('0x5a')],function(_0x31c1c2){return{'membername':_0x31c1c2[_0x2af0('0x3e')],'UserId':_0x31c1c2['id'],'queue_name':_0x527476[_0x2af0('0x3e')],'ChatQueueId':_0x527476['id'],'interface':util[_0x2af0('0x72')](_0x2af0('0x73'),'SIP',_0x31c1c2[_0x2af0('0x3e')]),'penalty':0x0,'paused':_0x31c1c2[_0x2af0('0x6f')],'createdAt':_0x31c1c2[_0x2af0('0x71')],'updatedAt':_0x31c1c2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2af0('0x25')](respondWithFilteredResult(_0x1e6bbd,_0xa82ddb))[_0x2af0('0x2e')](handleError(_0x1e6bbd,null));};exports[_0x2af0('0x74')]=function(_0x2973d7,_0x1f1da4,_0x24c1d2){var _0x354751={};var _0x417e5c={};var _0x5b1f25;var _0xbe2e87;return db[_0x2af0('0x42')][_0x2af0('0x69')]({'where':{'id':_0x2973d7[_0x2af0('0x5b')]['id']}})[_0x2af0('0x25')](handleEntityNotFound(_0x1f1da4,null))[_0x2af0('0x25')](function(_0x1b5ad7){if(_0x1b5ad7){_0x5b1f25=_0x1b5ad7;_0x417e5c['model']=_['keys'](db[_0x2af0('0x75')][_0x2af0('0x43')]);_0x417e5c[_0x2af0('0x47')]=_[_0x2af0('0x48')](_0x2973d7['query']);_0x417e5c[_0x2af0('0x49')]=_[_0x2af0('0x4a')](_0x417e5c[_0x2af0('0x4c')],_0x417e5c[_0x2af0('0x47')]);_0x354751[_0x2af0('0x4b')]=_[_0x2af0('0x4a')](_0x417e5c[_0x2af0('0x4c')],qs[_0x2af0('0x4d')](_0x2973d7[_0x2af0('0x47')][_0x2af0('0x4d')]));_0x354751['attributes']=_0x354751[_0x2af0('0x4b')]['length']?_0x354751[_0x2af0('0x4b')]:_0x417e5c[_0x2af0('0x4c')];_0x354751['order']=qs[_0x2af0('0x51')](_0x2973d7[_0x2af0('0x47')][_0x2af0('0x51')]);_0x354751[_0x2af0('0x52')]=qs[_0x2af0('0x49')](_[_0x2af0('0x53')](_0x2973d7[_0x2af0('0x47')],_0x417e5c['filters']));if(_0x2973d7[_0x2af0('0x47')][_0x2af0('0x54')]){_0x354751['where']=_[_0x2af0('0x55')](_0x354751['where'],{'$or':_[_0x2af0('0x41')](_0x354751[_0x2af0('0x4b')],function(_0x1b652c){var _0x49e838={};_0x49e838[_0x1b652c]={'$like':'%'+_0x2973d7[_0x2af0('0x47')][_0x2af0('0x54')]+'%'};return _0x49e838;})});}_0x354751=_[_0x2af0('0x55')]({},_0x354751,_0x2973d7[_0x2af0('0x5c')]);return _0x5b1f25[_0x2af0('0x74')](_0x354751);}})[_0x2af0('0x25')](function(_0x443151){if(_0x443151){_0xbe2e87=_0x443151[_0x2af0('0x4e')];if(!_0x2973d7[_0x2af0('0x47')][_0x2af0('0x4f')](_0x2af0('0x50'))){_0x354751[_0x2af0('0x36')]=qs['limit'](_0x2973d7[_0x2af0('0x47')][_0x2af0('0x36')]);_0x354751[_0x2af0('0x33')]=qs[_0x2af0('0x33')](_0x2973d7['query'][_0x2af0('0x33')]);}return _0x5b1f25[_0x2af0('0x74')](_0x354751);}})[_0x2af0('0x25')](function(_0x6510b7){if(_0x6510b7){return _0x6510b7?{'count':_0xbe2e87,'rows':_0x6510b7}:null;}})[_0x2af0('0x25')](respondWithResult(_0x1f1da4,null))[_0x2af0('0x2e')](handleError(_0x1f1da4,null));};exports[_0x2af0('0x76')]=function(_0x21c21c,_0x2f34b0,_0x35a5e3){var _0x199748=_0x21c21c[_0x2af0('0x5f')]['ids'];return db[_0x2af0('0x75')][_0x2af0('0x59')]({'where':{'id':_0x199748},'attributes':['id'],'include':[{'model':db[_0x2af0('0x6c')],'as':_0x2af0('0x77'),'attributes':['id','name',_0x2af0('0x78'),'voicePause',_0x2af0('0x79')],'raw':!![]}]})['then'](function(_0x1a4cae){if(_0x1a4cae){var _0x2705a5=_[_0x2af0('0x7a')](_0x1a4cae,function(_0x6ab288){var _0x48e3da=_0x6ab288[_0x2af0('0x61')]({'plain':!![]});return _0x48e3da['Agents'];});return db[_0x2af0('0x42')][_0x2af0('0x5d')]({'where':{'id':_0x21c21c['params']['id']}})[_0x2af0('0x25')](function(_0x5e1eb8){return db[_0x2af0('0x7b')][_0x2af0('0x7c')](function(_0x51485a){return _0x5e1eb8[_0x2af0('0x76')](_0x199748,{'transaction':_0x51485a})[_0x2af0('0x25')](function(){return BPromise[_0x2af0('0x7d')](_0x2705a5,function(_0x5bbe37){return db[_0x2af0('0x6a')][_0x2af0('0x7e')]({'where':{'UserId':_0x5bbe37['id'],'ChatQueueId':_0x21c21c[_0x2af0('0x5b')]['id']},'transaction':_0x51485a});});})[_0x2af0('0x25')](function(){_0x2705a5['forEach'](function(_0x47f5e7){socket['emit'](_0x2af0('0x7f'),{'UserId':_0x47f5e7['id'],'ChatQueueId':_0x5e1eb8['id']});});});});});}})[_0x2af0('0x25')](respondWithStatusCode(_0x2f34b0,null))['catch'](handleError(_0x2f34b0,null));};exports[_0x2af0('0x80')]=function(_0x38fd30,_0x22db25,_0x156a9a){return db['Team']['findAll']({'where':{'id':_0x38fd30[_0x2af0('0x47')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2af0('0x6c')],'as':_0x2af0('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x22db25,null))[_0x2af0('0x25')](function(_0x455672){var _0x4fbd72=_['map'](_0x455672,'id');var _0x45d78b=[];var _0x5ec622=[];var _0x2166c5=squel[_0x2af0('0x81')]();_0x2166c5[_0x2af0('0x82')](_0x2af0('0x83'))[_0x2af0('0x84')](_0x2af0('0x85'),'tq')[_0x2af0('0x86')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x2af0('0x87'),_0x38fd30[_0x2af0('0x5b')]['id']);for(var _0x543a42=0x0;_0x543a42<_0x455672[_0x2af0('0x4e')];_0x543a42+=0x1){let _0x1c9a88=_0x455672[_0x543a42];for(var _0x57719e=0x0;_0x57719e<_0x1c9a88[_0x2af0('0x77')][_0x2af0('0x4e')];_0x57719e+=0x1){let _0x87b465=_0x1c9a88[_0x2af0('0x77')][_0x57719e];var _0x7ba972=_0x2166c5['clone']();_0x7ba972['where'](_0x2af0('0x88'),_0x87b465['id']);_0x5ec622[_0x2af0('0x89')](db[_0x2af0('0x7b')][_0x2af0('0x47')](_0x7ba972[_0x2af0('0x8a')](),{'type':db['sequelize'][_0x2af0('0x8b')][_0x2af0('0x8c')]})[_0x2af0('0x25')](function(_0x13fad8){if(_0x13fad8['length']===0x1){return _0x87b465['id'];}else{var _0x1f3393=_[_0x2af0('0x8d')](_[_0x2af0('0x41')](_0x13fad8,_0x2af0('0x8e')),function(_0x57ea7e){return _[_0x2af0('0x8f')](_0x4fbd72,_0x57ea7e);});if(_0x1f3393){return _0x87b465['id'];}}}));}}return BPromise[_0x2af0('0x90')](_0x5ec622)[_0x2af0('0x25')](function(_0x56bc49){_0x45d78b=_(_0x45d78b)['union'](_0x56bc49)['compact']()['value']();return db[_0x2af0('0x42')][_0x2af0('0x5d')]({'where':{'id':_0x38fd30['params']['id']}})['then'](function(_0x3f6c78){return db[_0x2af0('0x7b')]['transaction'](function(_0x4629c3){return _0x3f6c78[_0x2af0('0x80')](_0x38fd30[_0x2af0('0x47')][_0x2af0('0x91')],{'transaction':_0x4629c3})[_0x2af0('0x25')](function(){if(!_[_0x2af0('0x92')](_0x45d78b)){return _0x3f6c78['removeAgents'](_0x45d78b,{'transaction':_0x4629c3});}})['then'](function(){_0x45d78b[_0x2af0('0x93')](function(_0x386e57){socket[_0x2af0('0x94')](_0x2af0('0x95'),{'UserId':_0x386e57,'ChatQueueId':_0x3f6c78['id']});});});});});});})['then'](respondWithStatusCode(_0x22db25,null))['catch'](handleError(_0x22db25,null));};exports['addAgents']=function(_0x375b49,_0x4cf4f5,_0x4b8c26){return db['ChatQueue'][_0x2af0('0x5d')]({'where':{'id':_0x375b49['params']['id']}})[_0x2af0('0x25')](handleEntityNotFound(_0x4cf4f5,null))[_0x2af0('0x25')](function(_0x5a3782){if(_0x5a3782){return _0x5a3782[_0x2af0('0x96')](_0x375b49['body'][_0x2af0('0x91')],_[_0x2af0('0x97')](_0x375b49[_0x2af0('0x5f')],[_0x2af0('0x91'),'id'])||{})[_0x2af0('0x98')](function(_0x30c704){for(var _0x540e7e=0x0;_0x540e7e<_0x375b49[_0x2af0('0x5f')][_0x2af0('0x91')][_0x2af0('0x4e')];_0x540e7e+=0x1){socket[_0x2af0('0x94')](_0x2af0('0x7f'),{'UserId':Number(_0x375b49[_0x2af0('0x5f')][_0x2af0('0x91')][_0x540e7e]),'ChatQueueId':Number(_0x375b49['params']['id'])});}return _0x30c704;});}})[_0x2af0('0x25')](respondWithResult(_0x4cf4f5,null))[_0x2af0('0x2e')](handleError(_0x4cf4f5,null));};exports[_0x2af0('0x99')]=function(_0x9fdc9a,_0x31f3a0,_0x1594da){return db[_0x2af0('0x42')][_0x2af0('0x5d')]({'where':{'id':_0x9fdc9a[_0x2af0('0x5b')]['id']}})[_0x2af0('0x25')](handleEntityNotFound(_0x31f3a0,null))['then'](function(_0x2c22a9){if(_0x2c22a9){return _0x2c22a9[_0x2af0('0x99')](_0x9fdc9a[_0x2af0('0x47')]['ids'])[_0x2af0('0x25')](function(){if(_['isArray'](_0x9fdc9a[_0x2af0('0x47')][_0x2af0('0x91')])){for(var _0x5e3eff=0x0;_0x5e3eff<_0x9fdc9a['query']['ids'][_0x2af0('0x4e')];_0x5e3eff+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x9fdc9a['query'][_0x2af0('0x91')][_0x5e3eff]),'ChatQueueId':Number(_0x9fdc9a[_0x2af0('0x5b')]['id'])});}}else{socket[_0x2af0('0x94')](_0x2af0('0x95'),{'UserId':Number(_0x9fdc9a[_0x2af0('0x47')]['ids']),'ChatQueueId':Number(_0x9fdc9a[_0x2af0('0x5b')]['id'])});}});}})[_0x2af0('0x25')](respondWithStatusCode(_0x31f3a0,null))[_0x2af0('0x2e')](handleError(_0x31f3a0,null));};exports['getAgents']=function(_0x20c321,_0x50a905,_0x4e0ce8){var _0x24f462={};var _0x5bdb96={};var _0x55fd07;var _0x319467;return db['ChatQueue'][_0x2af0('0x69')]({'where':{'id':_0x20c321[_0x2af0('0x5b')]['id']}})[_0x2af0('0x25')](handleEntityNotFound(_0x50a905,null))[_0x2af0('0x25')](function(_0x40aafe){if(_0x40aafe){_0x55fd07=_0x40aafe;_0x5bdb96['model']=_[_0x2af0('0x48')](db[_0x2af0('0x6c')]['rawAttributes']);_0x5bdb96[_0x2af0('0x47')]=_[_0x2af0('0x48')](_0x20c321[_0x2af0('0x47')]);_0x5bdb96[_0x2af0('0x49')]=_[_0x2af0('0x4a')](_0x5bdb96['model'],_0x5bdb96[_0x2af0('0x47')]);_0x24f462[_0x2af0('0x4b')]=_[_0x2af0('0x4a')](_0x5bdb96[_0x2af0('0x4c')],qs[_0x2af0('0x4d')](_0x20c321['query']['fields']));_0x24f462['attributes']=_0x24f462[_0x2af0('0x4b')]['length']?_0x24f462[_0x2af0('0x4b')]:_0x5bdb96[_0x2af0('0x4c')];_0x24f462['order']=qs[_0x2af0('0x51')](_0x20c321[_0x2af0('0x47')][_0x2af0('0x51')]);_0x24f462[_0x2af0('0x52')]=qs[_0x2af0('0x49')](_[_0x2af0('0x53')](_0x20c321[_0x2af0('0x47')],_0x5bdb96['filters']));if(_0x20c321[_0x2af0('0x47')][_0x2af0('0x54')]){_0x24f462['where']=_[_0x2af0('0x55')](_0x24f462['where'],{'$or':_['map'](_0x24f462[_0x2af0('0x4b')],function(_0x555dad){var _0x4582f2={};_0x4582f2[_0x555dad]={'$like':'%'+_0x20c321[_0x2af0('0x47')]['filter']+'%'};return _0x4582f2;})});}_0x24f462=_['merge']({},_0x24f462,_0x20c321[_0x2af0('0x5c')]);return _0x55fd07[_0x2af0('0x9a')](_0x24f462);}})['then'](function(_0x302b2a){if(_0x302b2a){_0x319467=_0x302b2a[_0x2af0('0x4e')];if(!_0x20c321['query'][_0x2af0('0x4f')](_0x2af0('0x50'))){_0x24f462[_0x2af0('0x36')]=qs['limit'](_0x20c321[_0x2af0('0x47')]['limit']);_0x24f462[_0x2af0('0x33')]=qs[_0x2af0('0x33')](_0x20c321[_0x2af0('0x47')][_0x2af0('0x33')]);}return _0x55fd07[_0x2af0('0x9a')](_0x24f462);}})[_0x2af0('0x25')](function(_0x1ad410){if(_0x1ad410){return _0x1ad410?{'count':_0x319467,'rows':_0x1ad410}:null;}})['then'](respondWithResult(_0x50a905,null))[_0x2af0('0x2e')](handleError(_0x50a905,null));};
\ No newline at end of file
+var _0x39e9=['push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','removeTeams','isEmpty','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','ChatQueue','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','rawAttributes','length','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','findAll','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','User','Agents','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?'];(function(_0x165e10,_0x2d686d){var _0x417ccc=function(_0x4bd53f){while(--_0x4bd53f){_0x165e10['push'](_0x165e10['shift']());}};_0x417ccc(++_0x2d686d);}(_0x39e9,0x1de));var _0x939e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x39e9[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require(_0x939e('0x0'));var rimraf=require(_0x939e('0x1'));var zipdir=require(_0x939e('0x2'));var jsonpatch=require(_0x939e('0x3'));var rp=require(_0x939e('0x4'));var moment=require(_0x939e('0x5'));var BPromise=require(_0x939e('0x6'));var Mustache=require('mustache');var util=require(_0x939e('0x7'));var path=require(_0x939e('0x8'));var sox=require('sox');var csv=require(_0x939e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x939e('0xa'));var squel=require('squel');var crypto=require(_0x939e('0xb'));var jsforce=require(_0x939e('0xc'));var deskjs=require(_0x939e('0xd'));var toCsv=require(_0x939e('0x9'));var querystring=require(_0x939e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x939e('0xf'));var qs=require(_0x939e('0x10'));var as=require(_0x939e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x939e('0x12'))(_0x939e('0x13'));var utils=require(_0x939e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x939e('0x15'));var db=require(_0x939e('0x16'))['db'];config[_0x939e('0x17')]=_[_0x939e('0x18')](config[_0x939e('0x17')],{'host':_0x939e('0x19'),'port':0x18eb});var socket=require(_0x939e('0x1a'))(new Redis(config[_0x939e('0x17')]));require(_0x939e('0x1b'))[_0x939e('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x939e('0x1d')][_0x939e('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1e2ffd,_0x595c43,_0x338cce,_0x3a4dd7){return new BPromise(function(_0x4490ee,_0x18a09b){var _0xa9254e=_0x3a4dd7||client;return _0xa9254e[_0x939e('0x1f')](_0x1e2ffd,_0x338cce)[_0x939e('0x20')](function(_0x38ce24){logger[_0x939e('0x21')]('ChatQueue,\x20%s,\x20%s',_0x595c43,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x595c43,_0x939e('0x22'),JSON[_0x939e('0x23')](_0x38ce24));if(_0x38ce24[_0x939e('0x24')]){if(_0x38ce24[_0x939e('0x24')][_0x939e('0x25')]===0x1f4){logger[_0x939e('0x24')](_0x939e('0x26'),_0x595c43,_0x38ce24['error'][_0x939e('0x27')]);return _0x18a09b(_0x38ce24[_0x939e('0x24')][_0x939e('0x27')]);}logger[_0x939e('0x24')]('ChatQueue,\x20%s,\x20%s',_0x595c43,_0x38ce24[_0x939e('0x24')][_0x939e('0x27')]);return _0x4490ee(_0x38ce24[_0x939e('0x24')]['message']);}else{logger[_0x939e('0x21')](_0x939e('0x26'),_0x595c43,_0x939e('0x22'));_0x4490ee(_0x38ce24[_0x939e('0x28')][_0x939e('0x27')]);}})[_0x939e('0x29')](function(_0x587943){logger[_0x939e('0x24')]('ChatQueue,\x20%s,\x20%s',_0x595c43,_0x587943);_0x18a09b(_0x587943);});});}function respondWithStatusCode(_0x15ed18,_0x105c47){_0x105c47=_0x105c47||0xcc;return function(_0xf34c76){if(_0xf34c76){return _0x15ed18[_0x939e('0x2a')](_0x105c47);}return _0x15ed18[_0x939e('0x2b')](_0x105c47)[_0x939e('0x2c')]();};}function respondWithResult(_0x332bbc,_0x47c1be){_0x47c1be=_0x47c1be||0xc8;return function(_0x30b8e9){if(_0x30b8e9){return _0x332bbc[_0x939e('0x2b')](_0x47c1be)[_0x939e('0x2d')](_0x30b8e9);}};}function respondWithFilteredResult(_0x16097b,_0x3a9e5e){return function(_0x1627c9){if(_0x1627c9){var _0x318ef0=typeof _0x3a9e5e[_0x939e('0x2e')]===_0x939e('0x2f')&&typeof _0x3a9e5e[_0x939e('0x30')]===_0x939e('0x2f');var _0x1a438f=_0x1627c9[_0x939e('0x31')];var _0x1a3a3a=_0x318ef0?0x0:_0x3a9e5e['offset'];var _0x16830c=_0x318ef0?_0x1627c9[_0x939e('0x31')]:_0x3a9e5e[_0x939e('0x2e')]+_0x3a9e5e[_0x939e('0x30')];var _0x702917;if(_0x16830c>=_0x1a438f){_0x16830c=_0x1a438f;_0x702917=0xc8;}else{_0x702917=0xce;}_0x16097b[_0x939e('0x2b')](_0x702917);return _0x16097b[_0x939e('0x32')]('Content-Range',_0x1a3a3a+'-'+_0x16830c+'/'+_0x1a438f)[_0x939e('0x2d')](_0x1627c9);}return null;};}function patchUpdates(_0x4ad525){return function(_0x5e8e01){try{jsonpatch[_0x939e('0x33')](_0x5e8e01,_0x4ad525,!![]);}catch(_0x3627b6){return BPromise[_0x939e('0x34')](_0x3627b6);}return _0x5e8e01['save']();};}function saveUpdates(_0x4e0388,_0x1b4e03){return function(_0x252c71){if(_0x252c71){return _0x252c71[_0x939e('0x35')](_0x4e0388)[_0x939e('0x20')](function(_0x402ecc){return _0x402ecc;});}return null;};}function removeEntity(_0x4a54fa,_0x2c3c4f){return function(_0x5a9ae9){if(_0x5a9ae9){return _0x5a9ae9[_0x939e('0x36')]()['then'](function(){var _0x2e3442=_0x5a9ae9[_0x939e('0x37')]({'plain':!![]});var _0x4e3704=_0x939e('0x38');return db[_0x939e('0x39')]['destroy']({'where':{'type':_0x4e3704,'resourceId':_0x2e3442['id']}})[_0x939e('0x20')](function(){return _0x5a9ae9;});})[_0x939e('0x20')](function(){_0x4a54fa[_0x939e('0x2b')](0xcc)[_0x939e('0x2c')]();});}};}function handleEntityNotFound(_0x420f99,_0x262ada){return function(_0xed2197){if(!_0xed2197){_0x420f99[_0x939e('0x2a')](0x194);}return _0xed2197;};}function handleError(_0x3dab99,_0x24741d){_0x24741d=_0x24741d||0x1f4;return function(_0x1656a5){logger[_0x939e('0x24')](_0x1656a5['stack']);if(_0x1656a5[_0x939e('0x3a')]){delete _0x1656a5[_0x939e('0x3a')];}_0x3dab99['status'](_0x24741d)[_0x939e('0x3b')](_0x1656a5);};}exports[_0x939e('0x3c')]=function(_0x479154,_0x47f162){var _0x1baef4={},_0x153894={},_0x59df19={'count':0x0,'rows':[]};var _0x2d60c4=_['map'](db[_0x939e('0x3d')]['rawAttributes'],function(_0xb76e29){return{'name':_0xb76e29[_0x939e('0x3e')],'type':_0xb76e29[_0x939e('0x3f')][_0x939e('0x40')]};});_0x153894[_0x939e('0x41')]=_[_0x939e('0x42')](_0x2d60c4,'name');_0x153894[_0x939e('0x43')]=_['keys'](_0x479154['query']);_0x153894[_0x939e('0x44')]=_[_0x939e('0x45')](_0x153894[_0x939e('0x41')],_0x153894['query']);_0x1baef4['attributes']=_[_0x939e('0x45')](_0x153894[_0x939e('0x41')],qs[_0x939e('0x46')](_0x479154[_0x939e('0x43')][_0x939e('0x46')]));_0x1baef4[_0x939e('0x47')]=_0x1baef4[_0x939e('0x47')]['length']?_0x1baef4[_0x939e('0x47')]:_0x153894[_0x939e('0x41')];if(!_0x479154[_0x939e('0x43')][_0x939e('0x48')](_0x939e('0x49'))){_0x1baef4[_0x939e('0x30')]=qs[_0x939e('0x30')](_0x479154[_0x939e('0x43')]['limit']);_0x1baef4['offset']=qs[_0x939e('0x2e')](_0x479154[_0x939e('0x43')]['offset']);}_0x1baef4[_0x939e('0x4a')]=qs[_0x939e('0x4b')](_0x479154[_0x939e('0x43')][_0x939e('0x4b')]);_0x1baef4[_0x939e('0x4c')]=qs[_0x939e('0x44')](_[_0x939e('0x4d')](_0x479154[_0x939e('0x43')],_0x153894[_0x939e('0x44')]),_0x2d60c4);if(_0x479154[_0x939e('0x43')][_0x939e('0x4e')]){_0x1baef4[_0x939e('0x4c')]=_[_0x939e('0x4f')](_0x1baef4[_0x939e('0x4c')],{'$or':_[_0x939e('0x42')](_0x2d60c4,function(_0x1fc5bf){if(_0x1fc5bf[_0x939e('0x3f')]!==_0x939e('0x50')){var _0x371f5e={};_0x371f5e[_0x1fc5bf['name']]={'$like':'%'+_0x479154[_0x939e('0x43')][_0x939e('0x4e')]+'%'};return _0x371f5e;}})});}_0x1baef4=_[_0x939e('0x4f')]({},_0x1baef4,_0x479154[_0x939e('0x51')]);var _0x2d7b90={'where':_0x1baef4['where']};return db['ChatQueue']['count'](_0x2d7b90)[_0x939e('0x20')](function(_0x15b08d){_0x59df19['count']=_0x15b08d;if(_0x479154[_0x939e('0x43')][_0x939e('0x52')]){_0x1baef4[_0x939e('0x53')]=[{'all':!![]}];}return db[_0x939e('0x3d')]['findAll'](_0x1baef4);})[_0x939e('0x20')](function(_0x360cb8){_0x59df19[_0x939e('0x54')]=_0x360cb8;return _0x59df19;})['then'](respondWithFilteredResult(_0x47f162,_0x1baef4))[_0x939e('0x29')](handleError(_0x47f162,null));};exports[_0x939e('0x55')]=function(_0x1f2d9b,_0x4a3515){var _0x38a000={'raw':!![],'where':{'id':_0x1f2d9b[_0x939e('0x56')]['id']}},_0x38998f={};_0x38998f[_0x939e('0x41')]=_[_0x939e('0x57')](db[_0x939e('0x3d')][_0x939e('0x58')]);_0x38998f[_0x939e('0x43')]=_[_0x939e('0x57')](_0x1f2d9b['query']);_0x38998f[_0x939e('0x44')]=_[_0x939e('0x45')](_0x38998f[_0x939e('0x41')],_0x38998f[_0x939e('0x43')]);_0x38a000[_0x939e('0x47')]=_[_0x939e('0x45')](_0x38998f[_0x939e('0x41')],qs[_0x939e('0x46')](_0x1f2d9b['query'][_0x939e('0x46')]));_0x38a000[_0x939e('0x47')]=_0x38a000['attributes'][_0x939e('0x59')]?_0x38a000[_0x939e('0x47')]:_0x38998f[_0x939e('0x41')];if(_0x1f2d9b[_0x939e('0x43')][_0x939e('0x52')]){_0x38a000[_0x939e('0x53')]=[{'all':!![]}];}_0x38a000=_[_0x939e('0x4f')]({},_0x38a000,_0x1f2d9b[_0x939e('0x51')]);return db[_0x939e('0x3d')][_0x939e('0x5a')](_0x38a000)[_0x939e('0x20')](handleEntityNotFound(_0x4a3515,null))[_0x939e('0x20')](respondWithResult(_0x4a3515,null))[_0x939e('0x29')](handleError(_0x4a3515,null));};exports[_0x939e('0x5b')]=function(_0x257e1b,_0x6913f0){return db[_0x939e('0x3d')][_0x939e('0x5b')](_0x257e1b['body'],{})[_0x939e('0x20')](function(_0x2887c2){var _0x360c5b=_0x257e1b[_0x939e('0x5c')]['get']({'plain':!![]});if(!_0x360c5b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x360c5b[_0x939e('0x5d')]===_0x939e('0x5c')){var _0x535117=_0x2887c2[_0x939e('0x37')]({'plain':!![]});var _0x1e76ee=_0x939e('0x38');return db[_0x939e('0x5e')][_0x939e('0x5a')]({'where':{'name':_0x1e76ee,'userProfileId':_0x360c5b[_0x939e('0x5f')]},'raw':!![]})[_0x939e('0x20')](function(_0xb89544){if(_0xb89544&&_0xb89544['autoAssociation']===0x0){return db[_0x939e('0x39')][_0x939e('0x5b')]({'name':_0x535117[_0x939e('0x3a')],'resourceId':_0x535117['id'],'type':_0xb89544['name'],'sectionId':_0xb89544['id']},{})[_0x939e('0x20')](function(){return _0x2887c2;});}else{return _0x2887c2;}})[_0x939e('0x29')](function(_0x4aab0b){logger['error'](_0x939e('0x60'),_0x4aab0b);throw _0x4aab0b;});}return _0x2887c2;})[_0x939e('0x20')](respondWithResult(_0x6913f0,0xc9))[_0x939e('0x29')](handleError(_0x6913f0,null));};exports[_0x939e('0x35')]=function(_0x290f8c,_0x41e772){if(_0x290f8c[_0x939e('0x61')]['id']){delete _0x290f8c[_0x939e('0x61')]['id'];}return db[_0x939e('0x3d')][_0x939e('0x5a')]({'where':{'id':_0x290f8c[_0x939e('0x56')]['id']}})[_0x939e('0x20')](handleEntityNotFound(_0x41e772,null))[_0x939e('0x20')](saveUpdates(_0x290f8c[_0x939e('0x61')],null))['then'](respondWithResult(_0x41e772,null))[_0x939e('0x29')](handleError(_0x41e772,null));};exports['destroy']=function(_0x2cff24,_0x55d38a){return db['ChatQueue'][_0x939e('0x5a')]({'where':{'id':_0x2cff24['params']['id']}})[_0x939e('0x20')](handleEntityNotFound(_0x55d38a,null))[_0x939e('0x20')](removeEntity(_0x55d38a,null))[_0x939e('0x29')](handleError(_0x55d38a,null));};exports[_0x939e('0x62')]=function(_0x4f5581,_0x43fa55){return db['ChatQueue'][_0x939e('0x62')]()['then'](respondWithResult(_0x43fa55,null))['catch'](handleError(_0x43fa55,null));};exports[_0x939e('0x63')]=function(_0x5619b5,_0x3923ea,_0x1450ae){var _0x240ebe={'raw':!![],'where':{}},_0x352240={},_0x4adebc;return db[_0x939e('0x3d')][_0x939e('0x64')]({'where':{'id':_0x5619b5[_0x939e('0x56')]['id']}})[_0x939e('0x20')](handleEntityNotFound(_0x3923ea,null))[_0x939e('0x20')](function(_0x25593d){if(_0x25593d){_0x4adebc=_0x25593d[_0x939e('0x37')]({'plain':!![]});_0x352240[_0x939e('0x41')]=_['keys'](db[_0x939e('0x65')][_0x939e('0x58')]);_0x352240['query']=_[_0x939e('0x57')](_0x5619b5[_0x939e('0x43')]);_0x352240['filters']=_['intersection'](_0x352240[_0x939e('0x41')],_0x352240[_0x939e('0x43')]);_0x240ebe[_0x939e('0x47')]=_['intersection'](_0x352240['model'],qs[_0x939e('0x46')](_0x5619b5[_0x939e('0x43')][_0x939e('0x46')]));_0x240ebe[_0x939e('0x47')]=_0x240ebe['attributes']['length']?_0x240ebe['attributes']:_0x352240[_0x939e('0x41')];if(!_0x5619b5['query'][_0x939e('0x48')](_0x939e('0x49'))){_0x240ebe[_0x939e('0x30')]=qs[_0x939e('0x30')](_0x5619b5[_0x939e('0x43')][_0x939e('0x30')]);_0x240ebe['offset']=qs['offset'](_0x5619b5[_0x939e('0x43')][_0x939e('0x2e')]);}_0x240ebe[_0x939e('0x4a')]=qs[_0x939e('0x4b')](_0x5619b5[_0x939e('0x43')]['sort']);_0x240ebe[_0x939e('0x4c')]=qs[_0x939e('0x44')](_['pick'](_0x5619b5['query'],_0x352240['filters']));_0x240ebe[_0x939e('0x4c')]['ChatQueueId']=_0x25593d['id'];if(_0x5619b5[_0x939e('0x43')][_0x939e('0x4e')]){_0x240ebe[_0x939e('0x4c')]=_[_0x939e('0x4f')](_0x240ebe['where'],{'$or':_['map'](_0x240ebe['attributes'],function(_0x159e34){var _0x51c233={};_0x51c233[_0x159e34]={'$like':'%'+_0x5619b5['query'][_0x939e('0x4e')]+'%'};return _0x51c233;})});}_0x240ebe=_['merge']({},_0x240ebe,_0x5619b5['options']);return db['UserChatQueue']['findAll'](_0x240ebe);}})[_0x939e('0x20')](function(_0x383dc9){if(_0x383dc9){return db['User'][_0x939e('0x66')]({'where':{'id':_['map'](_0x383dc9,_0x939e('0x67')),'role':_0x939e('0x68')},'attributes':['id',_0x939e('0x3a'),_0x939e('0x69'),_0x939e('0x6a'),_0x939e('0x6b')]});}})[_0x939e('0x20')](function(_0x3abc8f){if(_0x3abc8f){return{'count':_0x3abc8f[_0x939e('0x31')],'rows':_[_0x939e('0x42')](_0x3abc8f[_0x939e('0x54')],function(_0x52233a){return{'membername':_0x52233a['name'],'UserId':_0x52233a['id'],'queue_name':_0x4adebc[_0x939e('0x3a')],'ChatQueueId':_0x4adebc['id'],'interface':util['format'](_0x939e('0x6c'),_0x939e('0x6d'),_0x52233a[_0x939e('0x3a')]),'penalty':0x0,'paused':_0x52233a[_0x939e('0x69')],'createdAt':_0x52233a[_0x939e('0x6b')],'updatedAt':_0x52233a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x939e('0x20')](respondWithFilteredResult(_0x3923ea,_0x240ebe))[_0x939e('0x29')](handleError(_0x3923ea,null));};exports[_0x939e('0x6e')]=function(_0x82b0a7,_0x1ba4ca,_0x454789){var _0x535ee2={};var _0xcc378c={};var _0x2e7143;var _0x58eb25;return db['ChatQueue'][_0x939e('0x64')]({'where':{'id':_0x82b0a7[_0x939e('0x56')]['id']}})[_0x939e('0x20')](handleEntityNotFound(_0x1ba4ca,null))['then'](function(_0x156b30){if(_0x156b30){_0x2e7143=_0x156b30;_0xcc378c[_0x939e('0x41')]=_[_0x939e('0x57')](db[_0x939e('0x6f')][_0x939e('0x58')]);_0xcc378c[_0x939e('0x43')]=_[_0x939e('0x57')](_0x82b0a7[_0x939e('0x43')]);_0xcc378c['filters']=_[_0x939e('0x45')](_0xcc378c['model'],_0xcc378c['query']);_0x535ee2[_0x939e('0x47')]=_[_0x939e('0x45')](_0xcc378c[_0x939e('0x41')],qs['fields'](_0x82b0a7[_0x939e('0x43')]['fields']));_0x535ee2[_0x939e('0x47')]=_0x535ee2[_0x939e('0x47')][_0x939e('0x59')]?_0x535ee2[_0x939e('0x47')]:_0xcc378c[_0x939e('0x41')];_0x535ee2[_0x939e('0x4a')]=qs[_0x939e('0x4b')](_0x82b0a7[_0x939e('0x43')][_0x939e('0x4b')]);_0x535ee2[_0x939e('0x4c')]=qs[_0x939e('0x44')](_[_0x939e('0x4d')](_0x82b0a7[_0x939e('0x43')],_0xcc378c[_0x939e('0x44')]));if(_0x82b0a7['query'][_0x939e('0x4e')]){_0x535ee2[_0x939e('0x4c')]=_[_0x939e('0x4f')](_0x535ee2[_0x939e('0x4c')],{'$or':_[_0x939e('0x42')](_0x535ee2[_0x939e('0x47')],function(_0x3308cc){var _0x585647={};_0x585647[_0x3308cc]={'$like':'%'+_0x82b0a7[_0x939e('0x43')][_0x939e('0x4e')]+'%'};return _0x585647;})});}_0x535ee2=_[_0x939e('0x4f')]({},_0x535ee2,_0x82b0a7[_0x939e('0x51')]);return _0x2e7143[_0x939e('0x6e')](_0x535ee2);}})[_0x939e('0x20')](function(_0x52bfe2){if(_0x52bfe2){_0x58eb25=_0x52bfe2[_0x939e('0x59')];if(!_0x82b0a7[_0x939e('0x43')][_0x939e('0x48')](_0x939e('0x49'))){_0x535ee2[_0x939e('0x30')]=qs[_0x939e('0x30')](_0x82b0a7[_0x939e('0x43')][_0x939e('0x30')]);_0x535ee2['offset']=qs[_0x939e('0x2e')](_0x82b0a7['query'][_0x939e('0x2e')]);}return _0x2e7143['getTeams'](_0x535ee2);}})[_0x939e('0x20')](function(_0x44ae6e){if(_0x44ae6e){return _0x44ae6e?{'count':_0x58eb25,'rows':_0x44ae6e}:null;}})['then'](respondWithResult(_0x1ba4ca,null))[_0x939e('0x29')](handleError(_0x1ba4ca,null));};exports[_0x939e('0x70')]=function(_0x464098,_0x28e304,_0x4cad7c){var _0x537d1d=_0x464098[_0x939e('0x61')][_0x939e('0x71')];return db[_0x939e('0x6f')][_0x939e('0x72')]({'where':{'id':_0x537d1d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x939e('0x3a'),_0x939e('0x73'),_0x939e('0x74'),'interface'],'raw':!![]}]})[_0x939e('0x20')](function(_0x2280c8){if(_0x2280c8){var _0x26f8d1=_[_0x939e('0x75')](_0x2280c8,function(_0x1665c6){var _0x260886=_0x1665c6[_0x939e('0x37')]({'plain':!![]});return _0x260886['Agents'];});return db[_0x939e('0x3d')][_0x939e('0x5a')]({'where':{'id':_0x464098['params']['id']}})[_0x939e('0x20')](function(_0x207d06){return db[_0x939e('0x76')][_0x939e('0x77')](function(_0x46f095){return _0x207d06[_0x939e('0x70')](_0x537d1d,{'transaction':_0x46f095})[_0x939e('0x20')](function(){return BPromise['each'](_0x26f8d1,function(_0x525992){return db[_0x939e('0x65')][_0x939e('0x78')]({'where':{'UserId':_0x525992['id'],'ChatQueueId':_0x464098['params']['id']},'transaction':_0x46f095});});})['then'](function(){_0x26f8d1[_0x939e('0x79')](function(_0x31080d){socket['emit'](_0x939e('0x7a'),{'UserId':_0x31080d['id'],'ChatQueueId':_0x207d06['id']});});});});});}})[_0x939e('0x20')](respondWithStatusCode(_0x28e304,null))[_0x939e('0x29')](handleError(_0x28e304,null));};exports['removeTeams']=function(_0x170992,_0x20f324,_0x48b83f){return db['Team']['findAll']({'where':{'id':_0x170992[_0x939e('0x43')][_0x939e('0x71')]},'attributes':['id'],'include':[{'model':db[_0x939e('0x7b')],'as':_0x939e('0x7c'),'attributes':['id'],'raw':!![]}]})[_0x939e('0x20')](handleEntityNotFound(_0x20f324,null))['then'](function(_0x265a27){var _0x2fede9=_[_0x939e('0x42')](_0x265a27,'id');var _0x465db6=[];var _0x14ab46=[];var _0x3885cb=squel[_0x939e('0x7d')]();_0x3885cb[_0x939e('0x7e')](_0x939e('0x7f'))['from'](_0x939e('0x80'),'tq')[_0x939e('0x81')](_0x939e('0x82'),'ut',_0x939e('0x83'))[_0x939e('0x4c')](_0x939e('0x84'),_0x170992['params']['id']);for(var _0x3581c7=0x0;_0x3581c7<_0x265a27[_0x939e('0x59')];_0x3581c7+=0x1){let _0x2142ba=_0x265a27[_0x3581c7];for(var _0x3abf86=0x0;_0x3abf86<_0x2142ba[_0x939e('0x7c')][_0x939e('0x59')];_0x3abf86+=0x1){let _0xe47c45=_0x2142ba[_0x939e('0x7c')][_0x3abf86];var _0x406a86=_0x3885cb['clone']();_0x406a86[_0x939e('0x4c')](_0x939e('0x85'),_0xe47c45['id']);_0x14ab46[_0x939e('0x86')](db['sequelize'][_0x939e('0x43')](_0x406a86[_0x939e('0x87')](),{'type':db['sequelize'][_0x939e('0x88')][_0x939e('0x89')]})[_0x939e('0x20')](function(_0x3fe875){if(_0x3fe875['length']===0x1){return _0xe47c45['id'];}else{var _0x37d977=_['every'](_[_0x939e('0x42')](_0x3fe875,_0x939e('0x8a')),function(_0x192a3f){return _[_0x939e('0x8b')](_0x2fede9,_0x192a3f);});if(_0x37d977){return _0xe47c45['id'];}}}));}}return BPromise[_0x939e('0x8c')](_0x14ab46)[_0x939e('0x20')](function(_0x58b546){_0x465db6=_(_0x465db6)[_0x939e('0x8d')](_0x58b546)[_0x939e('0x8e')]()['value']();return db[_0x939e('0x3d')][_0x939e('0x5a')]({'where':{'id':_0x170992[_0x939e('0x56')]['id']}})[_0x939e('0x20')](function(_0x3d0b6c){return db[_0x939e('0x76')][_0x939e('0x77')](function(_0x464fbd){return _0x3d0b6c[_0x939e('0x8f')](_0x170992[_0x939e('0x43')][_0x939e('0x71')],{'transaction':_0x464fbd})['then'](function(){if(!_[_0x939e('0x90')](_0x465db6)){return _0x3d0b6c['removeAgents'](_0x465db6,{'transaction':_0x464fbd});}})['then'](function(){_0x465db6[_0x939e('0x79')](function(_0x43dd5d){socket[_0x939e('0x91')](_0x939e('0x92'),{'UserId':_0x43dd5d,'ChatQueueId':_0x3d0b6c['id']});});});});});});})[_0x939e('0x20')](respondWithStatusCode(_0x20f324,null))[_0x939e('0x29')](handleError(_0x20f324,null));};exports[_0x939e('0x93')]=function(_0x37f88e,_0x1ccd68,_0x43aa86){return db['ChatQueue'][_0x939e('0x5a')]({'where':{'id':_0x37f88e['params']['id']}})['then'](handleEntityNotFound(_0x1ccd68,null))[_0x939e('0x20')](function(_0x3f19f9){if(_0x3f19f9){return _0x3f19f9[_0x939e('0x93')](_0x37f88e[_0x939e('0x61')][_0x939e('0x71')],_[_0x939e('0x94')](_0x37f88e[_0x939e('0x61')],[_0x939e('0x71'),'id'])||{})[_0x939e('0x95')](function(_0x4bd5c3){for(var _0x4ab4f6=0x0;_0x4ab4f6<_0x37f88e[_0x939e('0x61')]['ids'][_0x939e('0x59')];_0x4ab4f6+=0x1){socket[_0x939e('0x91')](_0x939e('0x7a'),{'UserId':Number(_0x37f88e[_0x939e('0x61')][_0x939e('0x71')][_0x4ab4f6]),'ChatQueueId':Number(_0x37f88e[_0x939e('0x56')]['id'])});}return _0x4bd5c3;});}})['then'](respondWithResult(_0x1ccd68,null))[_0x939e('0x29')](handleError(_0x1ccd68,null));};exports[_0x939e('0x96')]=function(_0x50e2d6,_0x5a838a,_0x18744a){return db[_0x939e('0x3d')]['find']({'where':{'id':_0x50e2d6['params']['id']}})[_0x939e('0x20')](handleEntityNotFound(_0x5a838a,null))['then'](function(_0x399ff2){if(_0x399ff2){return _0x399ff2[_0x939e('0x96')](_0x50e2d6[_0x939e('0x43')][_0x939e('0x71')])[_0x939e('0x20')](function(){if(_[_0x939e('0x97')](_0x50e2d6['query']['ids'])){for(var _0x402b54=0x0;_0x402b54<_0x50e2d6[_0x939e('0x43')][_0x939e('0x71')][_0x939e('0x59')];_0x402b54+=0x1){socket[_0x939e('0x91')](_0x939e('0x92'),{'UserId':Number(_0x50e2d6[_0x939e('0x43')][_0x939e('0x71')][_0x402b54]),'ChatQueueId':Number(_0x50e2d6[_0x939e('0x56')]['id'])});}}else{socket[_0x939e('0x91')](_0x939e('0x92'),{'UserId':Number(_0x50e2d6[_0x939e('0x43')][_0x939e('0x71')]),'ChatQueueId':Number(_0x50e2d6[_0x939e('0x56')]['id'])});}});}})[_0x939e('0x20')](respondWithStatusCode(_0x5a838a,null))['catch'](handleError(_0x5a838a,null));};exports[_0x939e('0x98')]=function(_0x1af4ab,_0x435dff,_0x19d049){var _0x19d3fb={};var _0x59b99f={};var _0x1ce3e8;var _0x2592d0;return db['ChatQueue'][_0x939e('0x64')]({'where':{'id':_0x1af4ab['params']['id']}})['then'](handleEntityNotFound(_0x435dff,null))[_0x939e('0x20')](function(_0x3a155d){if(_0x3a155d){_0x1ce3e8=_0x3a155d;_0x59b99f[_0x939e('0x41')]=_[_0x939e('0x57')](db[_0x939e('0x7b')][_0x939e('0x58')]);_0x59b99f[_0x939e('0x43')]=_[_0x939e('0x57')](_0x1af4ab[_0x939e('0x43')]);_0x59b99f[_0x939e('0x44')]=_[_0x939e('0x45')](_0x59b99f[_0x939e('0x41')],_0x59b99f[_0x939e('0x43')]);_0x19d3fb[_0x939e('0x47')]=_[_0x939e('0x45')](_0x59b99f[_0x939e('0x41')],qs[_0x939e('0x46')](_0x1af4ab[_0x939e('0x43')]['fields']));_0x19d3fb['attributes']=_0x19d3fb[_0x939e('0x47')][_0x939e('0x59')]?_0x19d3fb[_0x939e('0x47')]:_0x59b99f[_0x939e('0x41')];_0x19d3fb[_0x939e('0x4a')]=qs['sort'](_0x1af4ab['query'][_0x939e('0x4b')]);_0x19d3fb[_0x939e('0x4c')]=qs[_0x939e('0x44')](_['pick'](_0x1af4ab[_0x939e('0x43')],_0x59b99f[_0x939e('0x44')]));if(_0x1af4ab[_0x939e('0x43')][_0x939e('0x4e')]){_0x19d3fb[_0x939e('0x4c')]=_['merge'](_0x19d3fb[_0x939e('0x4c')],{'$or':_[_0x939e('0x42')](_0x19d3fb['attributes'],function(_0x1aca3e){var _0x5433ac={};_0x5433ac[_0x1aca3e]={'$like':'%'+_0x1af4ab[_0x939e('0x43')][_0x939e('0x4e')]+'%'};return _0x5433ac;})});}_0x19d3fb=_[_0x939e('0x4f')]({},_0x19d3fb,_0x1af4ab[_0x939e('0x51')]);return _0x1ce3e8[_0x939e('0x98')](_0x19d3fb);}})[_0x939e('0x20')](function(_0xd046f1){if(_0xd046f1){_0x2592d0=_0xd046f1[_0x939e('0x59')];if(!_0x1af4ab['query'][_0x939e('0x48')](_0x939e('0x49'))){_0x19d3fb['limit']=qs[_0x939e('0x30')](_0x1af4ab[_0x939e('0x43')][_0x939e('0x30')]);_0x19d3fb[_0x939e('0x2e')]=qs[_0x939e('0x2e')](_0x1af4ab[_0x939e('0x43')][_0x939e('0x2e')]);}return _0x1ce3e8['getAgents'](_0x19d3fb);}})[_0x939e('0x20')](function(_0x678c32){if(_0x678c32){return _0x678c32?{'count':_0x2592d0,'rows':_0x678c32}:null;}})['then'](respondWithResult(_0x435dff,null))[_0x939e('0x29')](handleError(_0x435dff,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index e38fa1f..e754e52 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 _0xd2c4=['hook','exports','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0xe9fb2,_0x50374b){var _0x822cb9=function(_0x175436){while(--_0x175436){_0xe9fb2['push'](_0xe9fb2['shift']());}};_0x822cb9(++_0x50374b);}(_0xd2c4,0x110));var _0x4d2c=function(_0x507126,_0x3dd5c3){_0x507126=_0x507126-0x0;var _0x5ca642=_0xd2c4[_0x507126];return _0x5ca642;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x4d2c('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4d2c('0x1')](0x0);var events={'afterCreate':_0x4d2c('0x2'),'afterUpdate':_0x4d2c('0x3'),'afterDestroy':_0x4d2c('0x4')};function emitEvent(_0x4d4b9d){return function(_0x57df0,_0x57047f,_0x3cd718){ChatQueueEvents[_0x4d2c('0x5')](_0x4d4b9d+':'+_0x57df0['id'],_0x57df0);ChatQueueEvents[_0x4d2c('0x5')](_0x4d4b9d,_0x57df0);_0x3cd718(null);};}for(var e in events){if(events[_0x4d2c('0x6')](e)){var event=events[e];ChatQueue[_0x4d2c('0x7')](e,emitEvent(event));}}module[_0x4d2c('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0dcf=['../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x21e49b,_0x3d9b77){var _0x374458=function(_0x4c25d3){while(--_0x4c25d3){_0x21e49b['push'](_0x21e49b['shift']());}};_0x374458(++_0x3d9b77);}(_0x0dcf,0x179));var _0xf0dc=function(_0x3a5e7c,_0x5cbdf3){_0x3a5e7c=_0x3a5e7c-0x0;var _0x41dc9f=_0x0dcf[_0x3a5e7c];return _0x41dc9f;};'use strict';var EventEmitter=require(_0xf0dc('0x0'));var ChatQueue=require(_0xf0dc('0x1'))['db'][_0xf0dc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0dc('0x3'),'afterUpdate':_0xf0dc('0x4'),'afterDestroy':_0xf0dc('0x5')};function emitEvent(_0x4d2705){return function(_0x4c44d2,_0x5c44eb,_0x405a46){ChatQueueEvents[_0xf0dc('0x6')](_0x4d2705+':'+_0x4c44d2['id'],_0x4c44d2);ChatQueueEvents[_0xf0dc('0x6')](_0x4d2705,_0x4c44d2);_0x405a46(null);};}for(var e in events){if(events[_0xf0dc('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xf0dc('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index ee5d3c0..1b246c3 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 _0x7c74=['ChatQueue','chat_queues','lodash','util','../../config/logger','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x7c74,0xa7));var _0x47c7=function(_0x23e33d,_0x31c8c8){_0x23e33d=_0x23e33d-0x0;var _0x818fc=_0x7c74[_0x23e33d];return _0x818fc;};'use strict';var _=require(_0x47c7('0x0'));var util=require(_0x47c7('0x1'));var logger=require(_0x47c7('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x47c7('0x3'));var fs=require('fs');var path=require(_0x47c7('0x4'));var rimraf=require('rimraf');var config=require(_0x47c7('0x5'));var attributes=require(_0x47c7('0x6'));module[_0x47c7('0x7')]=function(_0x26d0c2,_0x2a8763){return _0x26d0c2[_0x47c7('0x8')](_0x47c7('0x9'),attributes,{'tableName':_0x47c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1a8=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util'];(function(_0x36a1d4,_0x5c3a68){var _0x5eadb5=function(_0x5d9ca0){while(--_0x5d9ca0){_0x36a1d4['push'](_0x36a1d4['shift']());}};_0x5eadb5(++_0x5c3a68);}(_0xf1a8,0x143));var _0x8f1a=function(_0x4d0a56,_0x2a631b){_0x4d0a56=_0x4d0a56-0x0;var _0x1885b6=_0xf1a8[_0x4d0a56];return _0x1885b6;};'use strict';var _=require('lodash');var util=require(_0x8f1a('0x0'));var logger=require(_0x8f1a('0x1'))('api');var moment=require(_0x8f1a('0x2'));var BPromise=require('bluebird');var rp=require(_0x8f1a('0x3'));var fs=require('fs');var path=require(_0x8f1a('0x4'));var rimraf=require(_0x8f1a('0x5'));var config=require(_0x8f1a('0x6'));var attributes=require(_0x8f1a('0x7'));module[_0x8f1a('0x8')]=function(_0x16c03a,_0xd98048){return _0x16c03a[_0x8f1a('0x9')](_0x8f1a('0xa'),attributes,{'tableName':_0x8f1a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 6b1c918..e8e8d1b 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 _0x8286=['result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./chatQueue.socket','register','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message'];(function(_0x3259e4,_0x4134e5){var _0x4056db=function(_0x33bd2a){while(--_0x33bd2a){_0x3259e4['push'](_0x3259e4['shift']());}};_0x4056db(++_0x4134e5);}(_0x8286,0x66));var _0x6828=function(_0xd39159,_0x2f4bb3){_0xd39159=_0xd39159-0x0;var _0x4ca362=_0x8286[_0xd39159];return _0x4ca362;};'use strict';var _=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var moment=require(_0x6828('0x2'));var BPromise=require(_0x6828('0x3'));var rs=require(_0x6828('0x4'));var fs=require('fs');var Redis=require(_0x6828('0x5'));var db=require(_0x6828('0x6'))['db'];var utils=require(_0x6828('0x7'));var logger=require(_0x6828('0x8'))(_0x6828('0x9'));var config=require(_0x6828('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6828('0xb')][_0x6828('0xc')]({'port':0x232a});config['redis']=_[_0x6828('0xd')](config[_0x6828('0xe')],{'host':_0x6828('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6828('0xe')]));require(_0x6828('0x10'))[_0x6828('0x11')](socket);function respondWithRpcPromise(_0x7a118c,_0x17925b,_0x2b652c){return new BPromise(function(_0x171faf,_0x15c466){return client[_0x6828('0x12')](_0x7a118c,_0x2b652c)['then'](function(_0x592318){logger[_0x6828('0x13')]('ChatQueue,\x20%s,\x20%s',_0x17925b,_0x6828('0x14'));logger['debug'](_0x6828('0x15'),_0x17925b,_0x6828('0x14'),JSON[_0x6828('0x16')](_0x592318));if(_0x592318[_0x6828('0x17')]){if(_0x592318[_0x6828('0x17')][_0x6828('0x18')]===0x1f4){logger['error'](_0x6828('0x19'),_0x17925b,_0x592318[_0x6828('0x17')][_0x6828('0x1a')]);return _0x15c466(_0x592318['error'][_0x6828('0x1a')]);}logger[_0x6828('0x17')](_0x6828('0x19'),_0x17925b,_0x592318['error'][_0x6828('0x1a')]);return _0x171faf(_0x592318[_0x6828('0x17')]['message']);}else{logger[_0x6828('0x13')]('ChatQueue,\x20%s,\x20%s',_0x17925b,_0x6828('0x14'));_0x171faf(_0x592318[_0x6828('0x1b')][_0x6828('0x1a')]);}})[_0x6828('0x1c')](function(_0x36d297){logger['error']('ChatQueue,\x20%s,\x20%s',_0x17925b,_0x36d297);_0x15c466(_0x36d297);});});}exports[_0x6828('0x1d')]=function(_0x23c634){var _0x32de42=this;return new Promise(function(_0x5a43e4,_0x469a9f){return db[_0x6828('0x1e')][_0x6828('0x1f')]({'raw':_0x23c634[_0x6828('0x20')]?_0x23c634[_0x6828('0x20')][_0x6828('0x21')]===undefined?!![]:![]:!![],'where':_0x23c634[_0x6828('0x20')]?_0x23c634[_0x6828('0x20')][_0x6828('0x22')]||null:null,'attributes':_0x23c634[_0x6828('0x20')]?_0x23c634[_0x6828('0x20')][_0x6828('0x23')]||null:null,'limit':_0x23c634[_0x6828('0x20')]?_0x23c634[_0x6828('0x20')][_0x6828('0x24')]||null:null,'include':_0x23c634[_0x6828('0x20')]?_0x23c634[_0x6828('0x20')][_0x6828('0x25')]?_['map'](_0x23c634[_0x6828('0x20')][_0x6828('0x25')],function(_0x13f4bb){return{'model':db[_0x13f4bb[_0x6828('0x26')]],'as':_0x13f4bb['as'],'attributes':_0x13f4bb[_0x6828('0x23')],'include':_0x13f4bb[_0x6828('0x25')]?_['map'](_0x13f4bb['include'],function(_0x25cd0f){return{'model':db[_0x25cd0f['model']],'as':_0x25cd0f['as'],'attributes':_0x25cd0f[_0x6828('0x23')],'include':_0x25cd0f[_0x6828('0x25')]?_[_0x6828('0x27')](_0x25cd0f[_0x6828('0x25')],function(_0xe49985){return{'model':db[_0xe49985[_0x6828('0x26')]],'as':_0xe49985['as'],'attributes':_0xe49985[_0x6828('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6828('0x28')](function(_0x12ab2a){logger[_0x6828('0x13')](_0x6828('0x1d'),_0x23c634);logger['debug']('GetChatQueue',_0x23c634,JSON[_0x6828('0x16')](_0x12ab2a));_0x5a43e4(_0x12ab2a);})[_0x6828('0x1c')](function(_0x18f747){logger[_0x6828('0x17')](_0x6828('0x1d'),_0x18f747[_0x6828('0x1a')],_0x23c634);_0x469a9f(_0x32de42[_0x6828('0x17')](0x1f4,_0x18f747[_0x6828('0x1a')]));});});};exports[_0x6828('0x29')]=function(_0x4e9396){var _0xaff5f6=this;return new Promise(function(_0x38fae1,_0x4c29d9){return db[_0x6828('0x1e')][_0x6828('0x2a')]({'raw':_0x4e9396[_0x6828('0x20')]?_0x4e9396[_0x6828('0x20')][_0x6828('0x21')]===undefined?!![]:![]:!![],'where':_0x4e9396['options']?_0x4e9396[_0x6828('0x20')]['where']||null:null,'attributes':_0x4e9396['options']?_0x4e9396[_0x6828('0x20')][_0x6828('0x23')]||null:null,'include':_0x4e9396[_0x6828('0x20')]?_0x4e9396['options'][_0x6828('0x25')]?_[_0x6828('0x27')](_0x4e9396[_0x6828('0x20')][_0x6828('0x25')],function(_0x4f3003){return{'model':db[_0x4f3003[_0x6828('0x26')]],'as':_0x4f3003['as'],'attributes':_0x4f3003[_0x6828('0x23')],'include':_0x4f3003[_0x6828('0x25')]?_[_0x6828('0x27')](_0x4f3003['include'],function(_0x1a08cd){return{'model':db[_0x1a08cd[_0x6828('0x26')]],'as':_0x1a08cd['as'],'attributes':_0x1a08cd[_0x6828('0x23')],'include':_0x1a08cd[_0x6828('0x25')]?_[_0x6828('0x27')](_0x1a08cd[_0x6828('0x25')],function(_0x5ee413){return{'model':db[_0x5ee413[_0x6828('0x26')]],'as':_0x5ee413['as'],'attributes':_0x5ee413[_0x6828('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x153bb9){logger['info'](_0x6828('0x29'),_0x4e9396);logger['debug']('ShowChatQueue',_0x4e9396,JSON[_0x6828('0x16')](_0x153bb9));_0x38fae1(_0x153bb9);})[_0x6828('0x1c')](function(_0x1c07df){logger[_0x6828('0x17')](_0x6828('0x29'),_0x1c07df['message'],_0x4e9396);_0x4c29d9(_0xaff5f6[_0x6828('0x17')](0x1f4,_0x1c07df[_0x6828('0x1a')]));});});};
\ No newline at end of file
+var _0x174b=['../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','catch','GetChatQueue','findAll','options','where','attributes','include','map','model','then','find','raw','ShowChatQueue','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f940c,_0x1d40c0){var _0x166d58=function(_0x5b6110){while(--_0x5b6110){_0x4f940c['push'](_0x4f940c['shift']());}};_0x166d58(++_0x1d40c0);}(_0x174b,0x19d));var _0xb174=function(_0x1f658d,_0x8af0ac){_0x1f658d=_0x1f658d-0x0;var _0x266082=_0x174b[_0x1f658d];return _0x266082;};'use strict';var _=require(_0xb174('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb174('0x1'));var rs=require(_0xb174('0x2'));var fs=require('fs');var Redis=require(_0xb174('0x3'));var db=require(_0xb174('0x4'))['db'];var utils=require(_0xb174('0x5'));var logger=require(_0xb174('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb174('0x7'));var client=jayson[_0xb174('0x8')][_0xb174('0x9')]({'port':0x232a});config[_0xb174('0xa')]=_[_0xb174('0xb')](config[_0xb174('0xa')],{'host':_0xb174('0xc'),'port':0x18eb});var socket=require(_0xb174('0xd'))(new Redis(config[_0xb174('0xa')]));require(_0xb174('0xe'))['register'](socket);function respondWithRpcPromise(_0x84e738,_0x4b6dd6,_0x3a05e9){return new BPromise(function(_0x1a4775,_0x4dffab){return client[_0xb174('0xf')](_0x84e738,_0x3a05e9)['then'](function(_0x3fbd28){logger[_0xb174('0x10')]('ChatQueue,\x20%s,\x20%s',_0x4b6dd6,_0xb174('0x11'));logger[_0xb174('0x12')](_0xb174('0x13'),_0x4b6dd6,_0xb174('0x11'),JSON['stringify'](_0x3fbd28));if(_0x3fbd28[_0xb174('0x14')]){if(_0x3fbd28['error'][_0xb174('0x15')]===0x1f4){logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x3fbd28[_0xb174('0x14')]['message']);return _0x4dffab(_0x3fbd28[_0xb174('0x14')][_0xb174('0x17')]);}logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x3fbd28[_0xb174('0x14')][_0xb174('0x17')]);return _0x1a4775(_0x3fbd28['error']['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x4b6dd6,_0xb174('0x11'));_0x1a4775(_0x3fbd28['result'][_0xb174('0x17')]);}})[_0xb174('0x18')](function(_0x5ac337){logger[_0xb174('0x14')](_0xb174('0x16'),_0x4b6dd6,_0x5ac337);_0x4dffab(_0x5ac337);});});}exports[_0xb174('0x19')]=function(_0x3117e2){var _0x835251=this;return new Promise(function(_0x1dc03e,_0xcc8d9a){return db['ChatQueue'][_0xb174('0x1a')]({'raw':_0x3117e2[_0xb174('0x1b')]?_0x3117e2['options']['raw']===undefined?!![]:![]:!![],'where':_0x3117e2['options']?_0x3117e2[_0xb174('0x1b')][_0xb174('0x1c')]||null:null,'attributes':_0x3117e2[_0xb174('0x1b')]?_0x3117e2['options'][_0xb174('0x1d')]||null:null,'limit':_0x3117e2[_0xb174('0x1b')]?_0x3117e2[_0xb174('0x1b')]['limit']||null:null,'include':_0x3117e2[_0xb174('0x1b')]?_0x3117e2[_0xb174('0x1b')][_0xb174('0x1e')]?_[_0xb174('0x1f')](_0x3117e2[_0xb174('0x1b')]['include'],function(_0x1f6a70){return{'model':db[_0x1f6a70['model']],'as':_0x1f6a70['as'],'attributes':_0x1f6a70[_0xb174('0x1d')],'include':_0x1f6a70[_0xb174('0x1e')]?_[_0xb174('0x1f')](_0x1f6a70['include'],function(_0x59a348){return{'model':db[_0x59a348[_0xb174('0x20')]],'as':_0x59a348['as'],'attributes':_0x59a348[_0xb174('0x1d')],'include':_0x59a348['include']?_['map'](_0x59a348[_0xb174('0x1e')],function(_0x549fcf){return{'model':db[_0x549fcf[_0xb174('0x20')]],'as':_0x549fcf['as'],'attributes':_0x549fcf[_0xb174('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb174('0x21')](function(_0x2e9f7a){logger[_0xb174('0x10')](_0xb174('0x19'),_0x3117e2);logger[_0xb174('0x12')]('GetChatQueue',_0x3117e2,JSON['stringify'](_0x2e9f7a));_0x1dc03e(_0x2e9f7a);})[_0xb174('0x18')](function(_0xa46091){logger[_0xb174('0x14')](_0xb174('0x19'),_0xa46091[_0xb174('0x17')],_0x3117e2);_0xcc8d9a(_0x835251[_0xb174('0x14')](0x1f4,_0xa46091[_0xb174('0x17')]));});});};exports['ShowChatQueue']=function(_0x1517d8){var _0x3af043=this;return new Promise(function(_0x3e1659,_0x362c5c){return db['ChatQueue'][_0xb174('0x22')]({'raw':_0x1517d8[_0xb174('0x1b')]?_0x1517d8[_0xb174('0x1b')][_0xb174('0x23')]===undefined?!![]:![]:!![],'where':_0x1517d8[_0xb174('0x1b')]?_0x1517d8[_0xb174('0x1b')][_0xb174('0x1c')]||null:null,'attributes':_0x1517d8[_0xb174('0x1b')]?_0x1517d8[_0xb174('0x1b')][_0xb174('0x1d')]||null:null,'include':_0x1517d8[_0xb174('0x1b')]?_0x1517d8[_0xb174('0x1b')][_0xb174('0x1e')]?_[_0xb174('0x1f')](_0x1517d8[_0xb174('0x1b')][_0xb174('0x1e')],function(_0x4a7cd8){return{'model':db[_0x4a7cd8[_0xb174('0x20')]],'as':_0x4a7cd8['as'],'attributes':_0x4a7cd8[_0xb174('0x1d')],'include':_0x4a7cd8['include']?_[_0xb174('0x1f')](_0x4a7cd8[_0xb174('0x1e')],function(_0xe3b6c3){return{'model':db[_0xe3b6c3[_0xb174('0x20')]],'as':_0xe3b6c3['as'],'attributes':_0xe3b6c3[_0xb174('0x1d')],'include':_0xe3b6c3['include']?_[_0xb174('0x1f')](_0xe3b6c3[_0xb174('0x1e')],function(_0x2857a5){return{'model':db[_0x2857a5[_0xb174('0x20')]],'as':_0x2857a5['as'],'attributes':_0x2857a5[_0xb174('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb174('0x21')](function(_0x57b823){logger[_0xb174('0x10')](_0xb174('0x24'),_0x1517d8);logger[_0xb174('0x12')]('ShowChatQueue',_0x1517d8,JSON[_0xb174('0x25')](_0x57b823));_0x3e1659(_0x57b823);})[_0xb174('0x18')](function(_0x1a9e9a){logger[_0xb174('0x14')](_0xb174('0x24'),_0x1a9e9a[_0xb174('0x17')],_0x1517d8);_0x362c5c(_0x3af043[_0xb174('0x14')](0x1f4,_0x1a9e9a[_0xb174('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index e9cee0c..c2ce964 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 _0x8d0e=['save','remove','update','emit','removeListener','length','chatQueue:','./chatQueue.events'];(function(_0x3f0577,_0x13d404){var _0x3c70dc=function(_0x3fada8){while(--_0x3fada8){_0x3f0577['push'](_0x3f0577['shift']());}};_0x3c70dc(++_0x13d404);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x437006,_0x30c3ae){_0x437006=_0x437006-0x0;var _0x5dc592=_0x8d0e[_0x437006];return _0x5dc592;};'use strict';var ChatQueueEvents=require(_0xe8d0('0x0'));var events=[_0xe8d0('0x1'),_0xe8d0('0x2'),_0xe8d0('0x3')];function createListener(_0x2eae0c,_0x3584ab){return function(_0x15521e){_0x3584ab[_0xe8d0('0x4')](_0x2eae0c,_0x15521e);};}function removeListener(_0x32cee9,_0x579cb9){return function(){ChatQueueEvents[_0xe8d0('0x5')](_0x32cee9,_0x579cb9);};}exports['register']=function(_0x560dab){for(var _0x2e2985=0x0,_0x92483d=events[_0xe8d0('0x6')];_0x2e2985<_0x92483d;_0x2e2985++){var _0xcc03d0=events[_0x2e2985];var _0x2b6dce=createListener(_0xe8d0('0x7')+_0xcc03d0,_0x560dab);ChatQueueEvents['on'](_0xcc03d0,_0x2b6dce);}};
\ No newline at end of file
+var _0xac9d=['update','emit','register','length','chatQueue:','./chatQueue.events','save','remove'];(function(_0x389f87,_0x5e6f9f){var _0x5a1f4e=function(_0xf0f0b2){while(--_0xf0f0b2){_0x389f87['push'](_0x389f87['shift']());}};_0x5a1f4e(++_0x5e6f9f);}(_0xac9d,0x14d));var _0xdac9=function(_0x211576,_0xcc41af){_0x211576=_0x211576-0x0;var _0x3ce235=_0xac9d[_0x211576];return _0x3ce235;};'use strict';var ChatQueueEvents=require(_0xdac9('0x0'));var events=[_0xdac9('0x1'),_0xdac9('0x2'),_0xdac9('0x3')];function createListener(_0x12390c,_0x27eb7c){return function(_0x25d1b3){_0x27eb7c[_0xdac9('0x4')](_0x12390c,_0x25d1b3);};}function removeListener(_0x51a5d7,_0x1c17a6){return function(){ChatQueueEvents['removeListener'](_0x51a5d7,_0x1c17a6);};}exports[_0xdac9('0x5')]=function(_0x1f8ff3){for(var _0x1222bb=0x0,_0x776b6c=events[_0xdac9('0x6')];_0x1222bb<_0x776b6c;_0x1222bb++){var _0x39f560=events[_0x1222bb];var _0x5531af=createListener(_0xdac9('0x7')+_0x39f560,_0x1f8ff3);ChatQueueEvents['on'](_0x39f560,_0x5531af);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 6903b96..2450f13 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 _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(_0x3e8a05,_0x659ffa){var _0x43daaa=function(_0x1e5348){while(--_0x1e5348){_0x3e8a05['push'](_0x3e8a05['shift']());}};_0x43daaa(++_0x659ffa);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3e74,0x175));var _0x43e7=function(_0x4021fc,_0x316e5e){_0x4021fc=_0x4021fc-0x0;var _0x29b0df=_0x3e74[_0x4021fc];return _0x29b0df;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b6eaf8c..9159871 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 _0x60fe=['STRING','DATE'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x60fe,0x176));var _0xe60f=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x60fe[_0x10f6e8];return _0x35bb3c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe60f('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xe60f('0x0')]},'joinAt':{'type':Sequelize[_0xe60f('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe60f('0x1')]},'reason':{'type':Sequelize[_0xe60f('0x0')]}};
\ No newline at end of file
+var _0x64ea=['exports','STRING','DATE','moment','sequelize'];(function(_0x468be0,_0x50b945){var _0x3c71ec=function(_0x40ad7c){while(--_0x40ad7c){_0x468be0['push'](_0x468be0['shift']());}};_0x3c71ec(++_0x50b945);}(_0x64ea,0x80));var _0xa64e=function(_0x4d4e87,_0x3da0bc){_0x4d4e87=_0x4d4e87-0x0;var _0x580ca3=_0x64ea[_0x4d4e87];return _0x580ca3;};'use strict';var moment=require(_0xa64e('0x0'));var Sequelize=require(_0xa64e('0x1'));module[_0xa64e('0x2')]={'uniqueid':{'type':Sequelize[_0xa64e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa64e('0x3')]},'joinAt':{'type':Sequelize[_0xa64e('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa64e('0x4')]},'exitAt':{'type':Sequelize[_0xa64e('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 407330f..b84a24d 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 _0x3974=['ChatQueueReport','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','merge','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index'];(function(_0x14f5c6,_0x204dab){var _0x5df9d0=function(_0x152798){while(--_0x152798){_0x14f5c6['push'](_0x14f5c6['shift']());}};_0x5df9d0(++_0x204dab);}(_0x3974,0xbc));var _0x4397=function(_0x1103e0,_0xf50d22){_0x1103e0=_0x1103e0-0x0;var _0x55d70b=_0x3974[_0x1103e0];return _0x55d70b;};'use strict';var emlformat=require(_0x4397('0x0'));var rimraf=require(_0x4397('0x1'));var zipdir=require(_0x4397('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4397('0x3'));var BPromise=require(_0x4397('0x4'));var Mustache=require(_0x4397('0x5'));var util=require(_0x4397('0x6'));var path=require(_0x4397('0x7'));var sox=require('sox');var csv=require(_0x4397('0x8'));var ejs=require(_0x4397('0x9'));var fs=require('fs');var fs_extra=require(_0x4397('0xa'));var _=require(_0x4397('0xb'));var squel=require('squel');var crypto=require(_0x4397('0xc'));var jsforce=require(_0x4397('0xd'));var deskjs=require(_0x4397('0xe'));var toCsv=require(_0x4397('0x8'));var querystring=require('querystring');var Papa=require(_0x4397('0xf'));var Redis=require(_0x4397('0x10'));var authService=require(_0x4397('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4397('0x12'));var logger=require(_0x4397('0x13'))(_0x4397('0x14'));var utils=require('../../config/utils');var config=require(_0x4397('0x15'));var licenseUtil=require(_0x4397('0x16'));var db=require(_0x4397('0x17'))['db'];function respondWithStatusCode(_0x50b80d,_0x1354f5){_0x1354f5=_0x1354f5||0xcc;return function(_0x35f6ba){if(_0x35f6ba){return _0x50b80d[_0x4397('0x18')](_0x1354f5);}return _0x50b80d['status'](_0x1354f5)[_0x4397('0x19')]();};}function respondWithResult(_0x541bf0,_0x3b7b4a){_0x3b7b4a=_0x3b7b4a||0xc8;return function(_0x5f5899){if(_0x5f5899){return _0x541bf0[_0x4397('0x1a')](_0x3b7b4a)[_0x4397('0x1b')](_0x5f5899);}};}function respondWithFilteredResult(_0x3b6dfa,_0x1aa61f){return function(_0x172ce2){if(_0x172ce2){var _0x423224=typeof _0x1aa61f['offset']===_0x4397('0x1c')&&typeof _0x1aa61f[_0x4397('0x1d')]===_0x4397('0x1c');var _0x27c307=_0x172ce2[_0x4397('0x1e')];var _0xdd7dab=_0x423224?0x0:_0x1aa61f[_0x4397('0x1f')];var _0x24d400=_0x423224?_0x172ce2[_0x4397('0x1e')]:_0x1aa61f['offset']+_0x1aa61f['limit'];var _0xff27cd;if(_0x24d400>=_0x27c307){_0x24d400=_0x27c307;_0xff27cd=0xc8;}else{_0xff27cd=0xce;}_0x3b6dfa[_0x4397('0x1a')](_0xff27cd);return _0x3b6dfa[_0x4397('0x20')](_0x4397('0x21'),_0xdd7dab+'-'+_0x24d400+'/'+_0x27c307)['json'](_0x172ce2);}return null;};}function patchUpdates(_0x523002){return function(_0x64406d){try{jsonpatch[_0x4397('0x22')](_0x64406d,_0x523002,!![]);}catch(_0x52bf64){return BPromise['reject'](_0x52bf64);}return _0x64406d['save']();};}function saveUpdates(_0x2cc426,_0x5b33e9){return function(_0x4f60f1){if(_0x4f60f1){return _0x4f60f1[_0x4397('0x23')](_0x2cc426)[_0x4397('0x24')](function(_0x53d6d3){return _0x53d6d3;});}return null;};}function removeEntity(_0x2797d2,_0x4d6de6){return function(_0x2655f1){if(_0x2655f1){return _0x2655f1[_0x4397('0x25')]()['then'](function(){_0x2797d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fe57d,_0x404c69){return function(_0x1d8f8e){if(!_0x1d8f8e){_0x3fe57d[_0x4397('0x18')](0x194);}return _0x1d8f8e;};}function handleError(_0x3dfb6b,_0x5d2e7f){_0x5d2e7f=_0x5d2e7f||0x1f4;return function(_0x224662){logger[_0x4397('0x26')](_0x224662[_0x4397('0x27')]);if(_0x224662[_0x4397('0x28')]){delete _0x224662[_0x4397('0x28')];}_0x3dfb6b[_0x4397('0x1a')](_0x5d2e7f)[_0x4397('0x29')](_0x224662);};}exports[_0x4397('0x2a')]=function(_0x550b0d,_0x5291e9){var _0x3ce44f={},_0x575536={},_0x3d6188={'count':0x0,'rows':[]};var _0x32d542=_['map'](db[_0x4397('0x2b')][_0x4397('0x2c')],function(_0x3492f4){return{'name':_0x3492f4['fieldName'],'type':_0x3492f4[_0x4397('0x2d')][_0x4397('0x2e')]};});_0x575536[_0x4397('0x2f')]=_['map'](_0x32d542,_0x4397('0x28'));_0x575536['query']=_[_0x4397('0x30')](_0x550b0d['query']);_0x575536[_0x4397('0x31')]=_[_0x4397('0x32')](_0x575536[_0x4397('0x2f')],_0x575536[_0x4397('0x33')]);_0x3ce44f[_0x4397('0x34')]=_[_0x4397('0x32')](_0x575536['model'],qs[_0x4397('0x35')](_0x550b0d[_0x4397('0x33')]['fields']));_0x3ce44f['attributes']=_0x3ce44f['attributes'][_0x4397('0x36')]?_0x3ce44f[_0x4397('0x34')]:_0x575536[_0x4397('0x2f')];if(!_0x550b0d[_0x4397('0x33')][_0x4397('0x37')](_0x4397('0x38'))){_0x3ce44f[_0x4397('0x1d')]=qs['limit'](_0x550b0d['query'][_0x4397('0x1d')]);_0x3ce44f[_0x4397('0x1f')]=qs[_0x4397('0x1f')](_0x550b0d[_0x4397('0x33')]['offset']);}_0x3ce44f[_0x4397('0x39')]=qs[_0x4397('0x3a')](_0x550b0d[_0x4397('0x33')][_0x4397('0x3a')]);_0x3ce44f['where']=qs[_0x4397('0x31')](_[_0x4397('0x3b')](_0x550b0d['query'],_0x575536[_0x4397('0x31')]),_0x32d542);if(_0x550b0d[_0x4397('0x33')][_0x4397('0x3c')]){_0x3ce44f['where']=_['merge'](_0x3ce44f[_0x4397('0x3d')],{'$or':_[_0x4397('0x3e')](_0x32d542,function(_0x191e90){if(_0x191e90[_0x4397('0x2d')]!==_0x4397('0x3f')){var _0x32f144={};_0x32f144[_0x191e90['name']]={'$like':'%'+_0x550b0d['query'][_0x4397('0x3c')]+'%'};return _0x32f144;}})});}_0x3ce44f=_['merge']({},_0x3ce44f,_0x550b0d[_0x4397('0x40')]);var _0x9d5070={'where':_0x3ce44f[_0x4397('0x3d')]};return db[_0x4397('0x2b')][_0x4397('0x1e')](_0x9d5070)[_0x4397('0x24')](function(_0x56eeda){_0x3d6188[_0x4397('0x1e')]=_0x56eeda;if(_0x550b0d[_0x4397('0x33')]['includeAll']){_0x3ce44f[_0x4397('0x41')]=[{'all':!![]}];}return db[_0x4397('0x2b')][_0x4397('0x42')](_0x3ce44f);})['then'](function(_0x5aa05a){_0x3d6188[_0x4397('0x43')]=_0x5aa05a;return _0x3d6188;})['then'](respondWithFilteredResult(_0x5291e9,_0x3ce44f))[_0x4397('0x44')](handleError(_0x5291e9,null));};exports[_0x4397('0x45')]=function(_0x20dbd4,_0x469f2b){var _0x4f45a3={'raw':!![],'where':{'id':_0x20dbd4[_0x4397('0x46')]['id']}},_0x102da9={};_0x102da9[_0x4397('0x2f')]=_[_0x4397('0x30')](db[_0x4397('0x2b')][_0x4397('0x2c')]);_0x102da9['query']=_[_0x4397('0x30')](_0x20dbd4[_0x4397('0x33')]);_0x102da9[_0x4397('0x31')]=_['intersection'](_0x102da9[_0x4397('0x2f')],_0x102da9[_0x4397('0x33')]);_0x4f45a3[_0x4397('0x34')]=_[_0x4397('0x32')](_0x102da9[_0x4397('0x2f')],qs[_0x4397('0x35')](_0x20dbd4[_0x4397('0x33')]['fields']));_0x4f45a3[_0x4397('0x34')]=_0x4f45a3[_0x4397('0x34')][_0x4397('0x36')]?_0x4f45a3['attributes']:_0x102da9[_0x4397('0x2f')];if(_0x20dbd4[_0x4397('0x33')][_0x4397('0x47')]){_0x4f45a3[_0x4397('0x41')]=[{'all':!![]}];}_0x4f45a3=_[_0x4397('0x48')]({},_0x4f45a3,_0x20dbd4[_0x4397('0x40')]);return db[_0x4397('0x2b')][_0x4397('0x49')](_0x4f45a3)[_0x4397('0x24')](handleEntityNotFound(_0x469f2b,null))[_0x4397('0x24')](respondWithResult(_0x469f2b,null))['catch'](handleError(_0x469f2b,null));};exports['create']=function(_0x34dbe8,_0x14f430){return db[_0x4397('0x2b')][_0x4397('0x4a')](_0x34dbe8[_0x4397('0x4b')],{})[_0x4397('0x24')](respondWithResult(_0x14f430,0xc9))['catch'](handleError(_0x14f430,null));};exports[_0x4397('0x23')]=function(_0x2dc479,_0x5d095a){if(_0x2dc479['body']['id']){delete _0x2dc479[_0x4397('0x4b')]['id'];}return db[_0x4397('0x2b')][_0x4397('0x49')]({'where':{'id':_0x2dc479['params']['id']}})[_0x4397('0x24')](handleEntityNotFound(_0x5d095a,null))[_0x4397('0x24')](saveUpdates(_0x2dc479['body'],null))[_0x4397('0x24')](respondWithResult(_0x5d095a,null))['catch'](handleError(_0x5d095a,null));};exports[_0x4397('0x25')]=function(_0x4ad473,_0x33e2d7){return db[_0x4397('0x2b')][_0x4397('0x49')]({'where':{'id':_0x4ad473[_0x4397('0x46')]['id']}})[_0x4397('0x24')](handleEntityNotFound(_0x33e2d7,null))[_0x4397('0x24')](removeEntity(_0x33e2d7,null))['catch'](handleError(_0x33e2d7,null));};exports[_0x4397('0x4c')]=function(_0x402239,_0x5b675c){return db[_0x4397('0x2b')][_0x4397('0x4c')]()['then'](respondWithResult(_0x5b675c,null))[_0x4397('0x44')](handleError(_0x5b675c,null));};
\ No newline at end of file
+var _0x16a6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2d8428,_0x505867){var _0x4fe776=function(_0x52e9d0){while(--_0x52e9d0){_0x2d8428['push'](_0x2d8428['shift']());}};_0x4fe776(++_0x505867);}(_0x16a6,0x15c));var _0x616a=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x16a6[_0x4bc428];return _0x3ca37f;};'use strict';var emlformat=require(_0x616a('0x0'));var rimraf=require(_0x616a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x616a('0x2'));var rp=require(_0x616a('0x3'));var moment=require(_0x616a('0x4'));var BPromise=require(_0x616a('0x5'));var Mustache=require(_0x616a('0x6'));var util=require(_0x616a('0x7'));var path=require('path');var sox=require(_0x616a('0x8'));var csv=require(_0x616a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x616a('0xa'));var squel=require(_0x616a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x616a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x616a('0xd'));var Papa=require('papaparse');var Redis=require(_0x616a('0xe'));var authService=require(_0x616a('0xf'));var qs=require(_0x616a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x616a('0x11'));var logger=require(_0x616a('0x12'))(_0x616a('0x13'));var utils=require(_0x616a('0x14'));var config=require(_0x616a('0x15'));var licenseUtil=require(_0x616a('0x16'));var db=require(_0x616a('0x17'))['db'];function respondWithStatusCode(_0x4122b7,_0x5755c7){_0x5755c7=_0x5755c7||0xcc;return function(_0x318dfe){if(_0x318dfe){return _0x4122b7[_0x616a('0x18')](_0x5755c7);}return _0x4122b7[_0x616a('0x19')](_0x5755c7)[_0x616a('0x1a')]();};}function respondWithResult(_0x295fc2,_0x4a33d5){_0x4a33d5=_0x4a33d5||0xc8;return function(_0x1399c1){if(_0x1399c1){return _0x295fc2[_0x616a('0x19')](_0x4a33d5)[_0x616a('0x1b')](_0x1399c1);}};}function respondWithFilteredResult(_0x18b6dc,_0x3bcf20){return function(_0x53f228){if(_0x53f228){var _0x204e68=typeof _0x3bcf20[_0x616a('0x1c')]==='undefined'&&typeof _0x3bcf20['limit']===_0x616a('0x1d');var _0x4768b2=_0x53f228[_0x616a('0x1e')];var _0x4d59e7=_0x204e68?0x0:_0x3bcf20[_0x616a('0x1c')];var _0x1f3241=_0x204e68?_0x53f228['count']:_0x3bcf20['offset']+_0x3bcf20[_0x616a('0x1f')];var _0x27e95c;if(_0x1f3241>=_0x4768b2){_0x1f3241=_0x4768b2;_0x27e95c=0xc8;}else{_0x27e95c=0xce;}_0x18b6dc[_0x616a('0x19')](_0x27e95c);return _0x18b6dc[_0x616a('0x20')]('Content-Range',_0x4d59e7+'-'+_0x1f3241+'/'+_0x4768b2)['json'](_0x53f228);}return null;};}function patchUpdates(_0x5568fd){return function(_0x5f2e80){try{jsonpatch['apply'](_0x5f2e80,_0x5568fd,!![]);}catch(_0x5ee3f2){return BPromise[_0x616a('0x21')](_0x5ee3f2);}return _0x5f2e80['save']();};}function saveUpdates(_0xb8ceeb,_0x137974){return function(_0x4f5594){if(_0x4f5594){return _0x4f5594[_0x616a('0x22')](_0xb8ceeb)[_0x616a('0x23')](function(_0x3d484b){return _0x3d484b;});}return null;};}function removeEntity(_0x100c98,_0x500c22){return function(_0x2db2bb){if(_0x2db2bb){return _0x2db2bb[_0x616a('0x24')]()[_0x616a('0x23')](function(){_0x100c98[_0x616a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e11f2,_0x4be8a8){return function(_0x30c1a){if(!_0x30c1a){_0x3e11f2[_0x616a('0x18')](0x194);}return _0x30c1a;};}function handleError(_0x5f1e6a,_0x55abc8){_0x55abc8=_0x55abc8||0x1f4;return function(_0x50c6b8){logger[_0x616a('0x25')](_0x50c6b8[_0x616a('0x26')]);if(_0x50c6b8[_0x616a('0x27')]){delete _0x50c6b8[_0x616a('0x27')];}_0x5f1e6a['status'](_0x55abc8)[_0x616a('0x28')](_0x50c6b8);};}exports[_0x616a('0x29')]=function(_0x195b73,_0x163fd0){var _0x28ca50={},_0x87db00={},_0x41a22d={'count':0x0,'rows':[]};var _0x5f3a59=_[_0x616a('0x2a')](db[_0x616a('0x2b')]['rawAttributes'],function(_0x41f722){return{'name':_0x41f722['fieldName'],'type':_0x41f722['type'][_0x616a('0x2c')]};});_0x87db00[_0x616a('0x2d')]=_[_0x616a('0x2a')](_0x5f3a59,'name');_0x87db00[_0x616a('0x2e')]=_[_0x616a('0x2f')](_0x195b73[_0x616a('0x2e')]);_0x87db00[_0x616a('0x30')]=_[_0x616a('0x31')](_0x87db00[_0x616a('0x2d')],_0x87db00['query']);_0x28ca50[_0x616a('0x32')]=_['intersection'](_0x87db00[_0x616a('0x2d')],qs[_0x616a('0x33')](_0x195b73[_0x616a('0x2e')]['fields']));_0x28ca50[_0x616a('0x32')]=_0x28ca50[_0x616a('0x32')]['length']?_0x28ca50['attributes']:_0x87db00[_0x616a('0x2d')];if(!_0x195b73[_0x616a('0x2e')][_0x616a('0x34')](_0x616a('0x35'))){_0x28ca50['limit']=qs['limit'](_0x195b73['query'][_0x616a('0x1f')]);_0x28ca50[_0x616a('0x1c')]=qs[_0x616a('0x1c')](_0x195b73[_0x616a('0x2e')][_0x616a('0x1c')]);}_0x28ca50[_0x616a('0x36')]=qs[_0x616a('0x37')](_0x195b73[_0x616a('0x2e')][_0x616a('0x37')]);_0x28ca50[_0x616a('0x38')]=qs['filters'](_[_0x616a('0x39')](_0x195b73['query'],_0x87db00[_0x616a('0x30')]),_0x5f3a59);if(_0x195b73[_0x616a('0x2e')][_0x616a('0x3a')]){_0x28ca50[_0x616a('0x38')]=_[_0x616a('0x3b')](_0x28ca50[_0x616a('0x38')],{'$or':_[_0x616a('0x2a')](_0x5f3a59,function(_0x220c32){if(_0x220c32[_0x616a('0x3c')]!=='VIRTUAL'){var _0x304e27={};_0x304e27[_0x220c32[_0x616a('0x27')]]={'$like':'%'+_0x195b73[_0x616a('0x2e')][_0x616a('0x3a')]+'%'};return _0x304e27;}})});}_0x28ca50=_['merge']({},_0x28ca50,_0x195b73[_0x616a('0x3d')]);var _0x4c6a76={'where':_0x28ca50[_0x616a('0x38')]};return db['ChatQueueReport'][_0x616a('0x1e')](_0x4c6a76)[_0x616a('0x23')](function(_0x598085){_0x41a22d[_0x616a('0x1e')]=_0x598085;if(_0x195b73['query'][_0x616a('0x3e')]){_0x28ca50[_0x616a('0x3f')]=[{'all':!![]}];}return db[_0x616a('0x2b')][_0x616a('0x40')](_0x28ca50);})[_0x616a('0x23')](function(_0x21fd2b){_0x41a22d[_0x616a('0x41')]=_0x21fd2b;return _0x41a22d;})['then'](respondWithFilteredResult(_0x163fd0,_0x28ca50))[_0x616a('0x42')](handleError(_0x163fd0,null));};exports['show']=function(_0x409689,_0x35e3e3){var _0x199140={'raw':!![],'where':{'id':_0x409689[_0x616a('0x43')]['id']}},_0x4dbb8b={};_0x4dbb8b[_0x616a('0x2d')]=_[_0x616a('0x2f')](db[_0x616a('0x2b')][_0x616a('0x44')]);_0x4dbb8b['query']=_[_0x616a('0x2f')](_0x409689[_0x616a('0x2e')]);_0x4dbb8b[_0x616a('0x30')]=_['intersection'](_0x4dbb8b[_0x616a('0x2d')],_0x4dbb8b[_0x616a('0x2e')]);_0x199140[_0x616a('0x32')]=_[_0x616a('0x31')](_0x4dbb8b[_0x616a('0x2d')],qs[_0x616a('0x33')](_0x409689[_0x616a('0x2e')]['fields']));_0x199140[_0x616a('0x32')]=_0x199140[_0x616a('0x32')]['length']?_0x199140['attributes']:_0x4dbb8b[_0x616a('0x2d')];if(_0x409689[_0x616a('0x2e')][_0x616a('0x3e')]){_0x199140[_0x616a('0x3f')]=[{'all':!![]}];}_0x199140=_[_0x616a('0x3b')]({},_0x199140,_0x409689[_0x616a('0x3d')]);return db['ChatQueueReport'][_0x616a('0x45')](_0x199140)[_0x616a('0x23')](handleEntityNotFound(_0x35e3e3,null))[_0x616a('0x23')](respondWithResult(_0x35e3e3,null))['catch'](handleError(_0x35e3e3,null));};exports[_0x616a('0x46')]=function(_0x507efa,_0x52d38){return db[_0x616a('0x2b')][_0x616a('0x46')](_0x507efa[_0x616a('0x47')],{})['then'](respondWithResult(_0x52d38,0xc9))[_0x616a('0x42')](handleError(_0x52d38,null));};exports[_0x616a('0x22')]=function(_0x3bea90,_0x3d42fc){if(_0x3bea90[_0x616a('0x47')]['id']){delete _0x3bea90['body']['id'];}return db[_0x616a('0x2b')][_0x616a('0x45')]({'where':{'id':_0x3bea90[_0x616a('0x43')]['id']}})[_0x616a('0x23')](handleEntityNotFound(_0x3d42fc,null))[_0x616a('0x23')](saveUpdates(_0x3bea90[_0x616a('0x47')],null))['then'](respondWithResult(_0x3d42fc,null))[_0x616a('0x42')](handleError(_0x3d42fc,null));};exports[_0x616a('0x24')]=function(_0x349cd0,_0x16e6c2){return db['ChatQueueReport'][_0x616a('0x45')]({'where':{'id':_0x349cd0['params']['id']}})[_0x616a('0x23')](handleEntityNotFound(_0x16e6c2,null))[_0x616a('0x23')](removeEntity(_0x16e6c2,null))['catch'](handleError(_0x16e6c2,null));};exports[_0x616a('0x48')]=function(_0x1ea086,_0x30a48e){return db['ChatQueueReport'][_0x616a('0x48')]()[_0x616a('0x23')](respondWithResult(_0x30a48e,null))[_0x616a('0x42')](handleError(_0x30a48e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index c80d363..fcef776 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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x2f1697,_0x3643c0){var _0x40eff0=function(_0x380c6c){while(--_0x380c6c){_0x2f1697['push'](_0x2f1697['shift']());}};_0x40eff0(++_0x3643c0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xcb91[_0x35da42];return _0x370035;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x5f26a6,_0x372d7e){var _0x19ce1a=function(_0x223c4b){while(--_0x223c4b){_0x5f26a6['push'](_0x5f26a6['shift']());}};_0x19ce1a(++_0x372d7e);}(_0x757a,0xde));var _0xa757=function(_0xaa9a91,_0x1469d0){_0xaa9a91=_0xaa9a91-0x0;var _0x1d5402=_0x757a[_0xaa9a91];return _0x1d5402;};'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 804fa8c..4f69e47 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 _0x49ef=['stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','info','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x4754b6,_0x1c8818){var _0x4726d2=function(_0x361c00){while(--_0x361c00){_0x4754b6['push'](_0x4754b6['shift']());}};_0x4726d2(++_0x1c8818);}(_0x49ef,0x74));var _0xf49e=function(_0x24ada5,_0x5bc7ee){_0x24ada5=_0x24ada5-0x0;var _0x1c54bc=_0x49ef[_0x24ada5];return _0x1c54bc;};'use strict';var _=require(_0xf49e('0x0'));var util=require('util');var moment=require(_0xf49e('0x1'));var BPromise=require(_0xf49e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf49e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf49e('0x4'));var logger=require(_0xf49e('0x5'))(_0xf49e('0x6'));var config=require(_0xf49e('0x7'));var jayson=require(_0xf49e('0x8'));var client=jayson[_0xf49e('0x9')][_0xf49e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c79bb,_0x3156f7,_0x5bdaa5){return new BPromise(function(_0x4d4377,_0x1ff9c0){return client['request'](_0x4c79bb,_0x5bdaa5)[_0xf49e('0xb')](function(_0x35142b){logger['info'](_0xf49e('0xc'),_0x3156f7,_0xf49e('0xd'));logger[_0xf49e('0xe')](_0xf49e('0xf'),_0x3156f7,_0xf49e('0xd'),JSON[_0xf49e('0x10')](_0x35142b));if(_0x35142b[_0xf49e('0x11')]){if(_0x35142b[_0xf49e('0x11')]['code']===0x1f4){logger['error'](_0xf49e('0xc'),_0x3156f7,_0x35142b[_0xf49e('0x11')][_0xf49e('0x12')]);return _0x1ff9c0(_0x35142b[_0xf49e('0x11')]['message']);}logger[_0xf49e('0x11')](_0xf49e('0xc'),_0x3156f7,_0x35142b['error'][_0xf49e('0x12')]);return _0x4d4377(_0x35142b[_0xf49e('0x11')][_0xf49e('0x12')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x3156f7,'request\x20sent');_0x4d4377(_0x35142b[_0xf49e('0x13')]['message']);}})[_0xf49e('0x14')](function(_0x2f0187){logger['error'](_0xf49e('0xc'),_0x3156f7,_0x2f0187);_0x1ff9c0(_0x2f0187);});});}exports[_0xf49e('0x15')]=function(_0x11524e){var _0x2741aa=this;return new Promise(function(_0x415984,_0x310e59){return db[_0xf49e('0x16')][_0xf49e('0x17')](_0x11524e[_0xf49e('0x18')],{'raw':_0x11524e[_0xf49e('0x19')]?_0x11524e[_0xf49e('0x19')][_0xf49e('0x1a')]===undefined?!![]:![]:!![]})[_0xf49e('0xb')](function(_0x2c5581){logger['info'](_0xf49e('0x15'),_0x11524e);logger[_0xf49e('0xe')]('CreateChatQueueReport',_0x11524e,JSON[_0xf49e('0x10')](_0x2c5581));_0x415984(_0x2c5581);})[_0xf49e('0x14')](function(_0x4cf4a5){logger[_0xf49e('0x11')](_0xf49e('0x15'),_0x4cf4a5[_0xf49e('0x12')],_0x11524e);_0x310e59(_0x2741aa[_0xf49e('0x11')](0x1f4,_0x4cf4a5[_0xf49e('0x12')]));});});};exports[_0xf49e('0x1b')]=function(_0x2c8584){var _0x1b3390=this;return new Promise(function(_0x65326f,_0x2aad31){return db['ChatQueueReport'][_0xf49e('0x1c')](_0x2c8584[_0xf49e('0x18')],{'raw':_0x2c8584[_0xf49e('0x19')]?_0x2c8584['options'][_0xf49e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c8584[_0xf49e('0x19')]?_0x2c8584[_0xf49e('0x19')][_0xf49e('0x1d')]||null:null,'attributes':_0x2c8584[_0xf49e('0x19')]?_0x2c8584['options'][_0xf49e('0x1e')]||null:null,'limit':_0x2c8584[_0xf49e('0x19')]?_0x2c8584[_0xf49e('0x19')][_0xf49e('0x1f')]||null:null})['then'](function(_0x47eb68){logger[_0xf49e('0x20')](_0xf49e('0x1b'),_0x2c8584);logger[_0xf49e('0xe')](_0xf49e('0x1b'),_0x2c8584,JSON[_0xf49e('0x10')](_0x47eb68));_0x65326f(_0x47eb68);})[_0xf49e('0x14')](function(_0x18a1b5){logger[_0xf49e('0x11')](_0xf49e('0x1b'),_0x18a1b5[_0xf49e('0x12')],_0x2c8584);_0x2aad31(_0x1b3390[_0xf49e('0x11')](0x1f4,_0x18a1b5['message']));});});};
\ No newline at end of file
+var _0x5c33=['code','message','result','catch','CreateChatQueueReport','body','options','ChatQueueReport','update','raw','limit','then','UpdateChatQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4421eb,_0x17b98f){var _0x142c50=function(_0x5ed18b){while(--_0x5ed18b){_0x4421eb['push'](_0x4421eb['shift']());}};_0x142c50(++_0x17b98f);}(_0x5c33,0x199));var _0x35c3=function(_0x135fce,_0x320c7a){_0x135fce=_0x135fce-0x0;var _0x3a8afc=_0x5c33[_0x135fce];return _0x3a8afc;};'use strict';var _=require(_0x35c3('0x0'));var util=require(_0x35c3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x35c3('0x2'));var fs=require('fs');var Redis=require(_0x35c3('0x3'));var db=require(_0x35c3('0x4'))['db'];var utils=require(_0x35c3('0x5'));var logger=require(_0x35c3('0x6'))(_0x35c3('0x7'));var config=require(_0x35c3('0x8'));var jayson=require(_0x35c3('0x9'));var client=jayson[_0x35c3('0xa')][_0x35c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x15d474,_0x19a25d,_0x127032){return new BPromise(function(_0x6918fd,_0xf31fb4){return client[_0x35c3('0xc')](_0x15d474,_0x127032)['then'](function(_0x393606){logger[_0x35c3('0xd')](_0x35c3('0xe'),_0x19a25d,_0x35c3('0xf'));logger[_0x35c3('0x10')](_0x35c3('0x11'),_0x19a25d,_0x35c3('0xf'),JSON[_0x35c3('0x12')](_0x393606));if(_0x393606[_0x35c3('0x13')]){if(_0x393606[_0x35c3('0x13')][_0x35c3('0x14')]===0x1f4){logger[_0x35c3('0x13')](_0x35c3('0xe'),_0x19a25d,_0x393606['error']['message']);return _0xf31fb4(_0x393606[_0x35c3('0x13')][_0x35c3('0x15')]);}logger[_0x35c3('0x13')](_0x35c3('0xe'),_0x19a25d,_0x393606[_0x35c3('0x13')]['message']);return _0x6918fd(_0x393606[_0x35c3('0x13')][_0x35c3('0x15')]);}else{logger[_0x35c3('0xd')](_0x35c3('0xe'),_0x19a25d,'request\x20sent');_0x6918fd(_0x393606[_0x35c3('0x16')][_0x35c3('0x15')]);}})[_0x35c3('0x17')](function(_0xd1e1f3){logger[_0x35c3('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x19a25d,_0xd1e1f3);_0xf31fb4(_0xd1e1f3);});});}exports[_0x35c3('0x18')]=function(_0x180b5b){var _0xe1a1c6=this;return new Promise(function(_0x13ef6e,_0x577036){return db['ChatQueueReport']['create'](_0x180b5b[_0x35c3('0x19')],{'raw':_0x180b5b[_0x35c3('0x1a')]?_0x180b5b['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x28a0ba){logger[_0x35c3('0xd')](_0x35c3('0x18'),_0x180b5b);logger[_0x35c3('0x10')](_0x35c3('0x18'),_0x180b5b,JSON[_0x35c3('0x12')](_0x28a0ba));_0x13ef6e(_0x28a0ba);})[_0x35c3('0x17')](function(_0x7f5297){logger[_0x35c3('0x13')](_0x35c3('0x18'),_0x7f5297[_0x35c3('0x15')],_0x180b5b);_0x577036(_0xe1a1c6[_0x35c3('0x13')](0x1f4,_0x7f5297[_0x35c3('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x290509){var _0xf3ff71=this;return new Promise(function(_0x2ca057,_0x345e33){return db[_0x35c3('0x1b')][_0x35c3('0x1c')](_0x290509[_0x35c3('0x19')],{'raw':_0x290509[_0x35c3('0x1a')]?_0x290509[_0x35c3('0x1a')][_0x35c3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x290509[_0x35c3('0x1a')]?_0x290509[_0x35c3('0x1a')]['where']||null:null,'attributes':_0x290509[_0x35c3('0x1a')]?_0x290509[_0x35c3('0x1a')]['attributes']||null:null,'limit':_0x290509[_0x35c3('0x1a')]?_0x290509[_0x35c3('0x1a')][_0x35c3('0x1e')]||null:null})[_0x35c3('0x1f')](function(_0x44ac3){logger[_0x35c3('0xd')](_0x35c3('0x20'),_0x290509);logger[_0x35c3('0x10')](_0x35c3('0x20'),_0x290509,JSON[_0x35c3('0x12')](_0x44ac3));_0x2ca057(_0x44ac3);})[_0x35c3('0x17')](function(_0x466757){logger['error'](_0x35c3('0x20'),_0x466757[_0x35c3('0x15')],_0x290509);_0x345e33(_0xf3ff71['error'](0x1f4,_0x466757['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 54540cc..2caab63 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 _0xf886=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','post','create','update','delete','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x561146,_0x43d69b){var _0x20318e=function(_0x2f4fe2){while(--_0x2f4fe2){_0x561146['push'](_0x561146['shift']());}};_0x20318e(++_0x43d69b);}(_0xf886,0x11b));var _0x6f88=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0xf886[_0x4ac60a];return _0x4b22e8;};'use strict';var multer=require(_0x6f88('0x0'));var util=require(_0x6f88('0x1'));var path=require(_0x6f88('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f88('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6f88('0x4'));var interaction=require(_0x6f88('0x5'));var config=require(_0x6f88('0x6'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x6f88('0x7')](),controller['index']);router[_0x6f88('0x8')](_0x6f88('0x9'),auth['isAuthenticated'](),controller[_0x6f88('0xa')]);router[_0x6f88('0x8')]('/:id',auth[_0x6f88('0x7')](),controller['show']);router[_0x6f88('0xb')]('/',auth[_0x6f88('0x7')](),controller[_0x6f88('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6f88('0xd')]);router[_0x6f88('0xe')](_0x6f88('0xf'),auth[_0x6f88('0x7')](),controller[_0x6f88('0x10')]);module[_0x6f88('0x11')]=router;
\ No newline at end of file
+var _0x4028=['/describe','describe','/:id','show','post','create','update','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x47450d,_0x532512){var _0x3a0212=function(_0xe57f16){while(--_0xe57f16){_0x47450d['push'](_0x47450d['shift']());}};_0x3a0212(++_0x532512);}(_0x4028,0x75));var _0x8402=function(_0x332e78,_0x4ef6fc){_0x332e78=_0x332e78-0x0;var _0x507e27=_0x4028[_0x332e78];return _0x507e27;};'use strict';var multer=require('multer');var util=require(_0x8402('0x0'));var path=require(_0x8402('0x1'));var timeout=require(_0x8402('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8402('0x3'));var auth=require(_0x8402('0x4'));var interaction=require(_0x8402('0x5'));var config=require(_0x8402('0x6'));var controller=require('./chatQueueReport.controller');router[_0x8402('0x7')]('/',auth[_0x8402('0x8')](),controller['index']);router[_0x8402('0x7')](_0x8402('0x9'),auth[_0x8402('0x8')](),controller[_0x8402('0xa')]);router[_0x8402('0x7')](_0x8402('0xb'),auth[_0x8402('0x8')](),controller[_0x8402('0xc')]);router[_0x8402('0xd')]('/',auth[_0x8402('0x8')](),controller[_0x8402('0xe')]);router['put']('/:id',auth[_0x8402('0x8')](),controller[_0x8402('0xf')]);router['delete'](_0x8402('0xb'),auth['isAuthenticated'](),controller[_0x8402('0x10')]);module[_0x8402('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index ce7db5a..f399fd0 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x50854a,_0x115342){var _0x322816=function(_0x16a120){while(--_0x16a120){_0x50854a['push'](_0x50854a['shift']());}};_0x322816(++_0x115342);}(_0xedd9,0xfc));var _0x9edd=function(_0x1fbf9d,_0xe1bfb8){_0x1fbf9d=_0x1fbf9d-0x0;var _0x5174c9=_0xedd9[_0x1fbf9d];return _0x5174c9;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x287eaf,_0x41d318){var _0x321683=function(_0x4bda72){while(--_0x4bda72){_0x287eaf['push'](_0x287eaf['shift']());}};_0x321683(++_0x41d318);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 363d5d6..4d4d703 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 _0x8455=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','apply','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','key','model','keys','attributes','intersection','fields','query','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','update','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8455,0x82));var _0x5845=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8455[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5845('0x0'));var rimraf=require(_0x5845('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5845('0x2'));var moment=require('moment');var BPromise=require(_0x5845('0x3'));var Mustache=require(_0x5845('0x4'));var util=require(_0x5845('0x5'));var path=require(_0x5845('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5845('0x7'));var fs=require('fs');var fs_extra=require(_0x5845('0x8'));var _=require(_0x5845('0x9'));var squel=require(_0x5845('0xa'));var crypto=require(_0x5845('0xb'));var jsforce=require(_0x5845('0xc'));var deskjs=require(_0x5845('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5845('0xe'));var Papa=require('papaparse');var Redis=require(_0x5845('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5845('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5845('0x11'));var logger=require(_0x5845('0x12'))('api');var utils=require(_0x5845('0x13'));var config=require(_0x5845('0x14'));var licenseUtil=require(_0x5845('0x15'));var db=require(_0x5845('0x16'))['db'];function respondWithStatusCode(_0x45329e,_0x24ad43){_0x24ad43=_0x24ad43||0xcc;return function(_0x203142){if(_0x203142){return _0x45329e[_0x5845('0x17')](_0x24ad43);}return _0x45329e[_0x5845('0x18')](_0x24ad43)[_0x5845('0x19')]();};}function respondWithResult(_0x248bb8,_0x4c0ac){_0x4c0ac=_0x4c0ac||0xc8;return function(_0x59dfa1){if(_0x59dfa1){return _0x248bb8[_0x5845('0x18')](_0x4c0ac)['json'](_0x59dfa1);}};}function respondWithFilteredResult(_0x27bc21,_0xbe7692){return function(_0x386f46){if(_0x386f46){var _0x59b3dc=typeof _0xbe7692['offset']==='undefined'&&typeof _0xbe7692[_0x5845('0x1a')]===_0x5845('0x1b');var _0x3aad4b=_0x386f46[_0x5845('0x1c')];var _0x5cc99c=_0x59b3dc?0x0:_0xbe7692[_0x5845('0x1d')];var _0x5471b7=_0x59b3dc?_0x386f46[_0x5845('0x1c')]:_0xbe7692['offset']+_0xbe7692[_0x5845('0x1a')];var _0x13da25;if(_0x5471b7>=_0x3aad4b){_0x5471b7=_0x3aad4b;_0x13da25=0xc8;}else{_0x13da25=0xce;}_0x27bc21[_0x5845('0x18')](_0x13da25);return _0x27bc21[_0x5845('0x1e')]('Content-Range',_0x5cc99c+'-'+_0x5471b7+'/'+_0x3aad4b)[_0x5845('0x1f')](_0x386f46);}return null;};}function patchUpdates(_0x3babfd){return function(_0x48b9d3){try{jsonpatch[_0x5845('0x20')](_0x48b9d3,_0x3babfd,!![]);}catch(_0x55e138){return BPromise['reject'](_0x55e138);}return _0x48b9d3[_0x5845('0x21')]();};}function saveUpdates(_0x57c3e6,_0x25df2c){return function(_0x9dbf00){if(_0x9dbf00){return _0x9dbf00['update'](_0x57c3e6)[_0x5845('0x22')](function(_0x29586){return _0x29586;});}return null;};}function removeEntity(_0x4d9ee3,_0x43032f){return function(_0x6f5cfa){if(_0x6f5cfa){return _0x6f5cfa[_0x5845('0x23')]()[_0x5845('0x22')](function(){_0x4d9ee3[_0x5845('0x18')](0xcc)[_0x5845('0x19')]();});}};}function handleEntityNotFound(_0xfa20e3,_0x52e0fc){return function(_0x3de12f){if(!_0x3de12f){_0xfa20e3['sendStatus'](0x194);}return _0x3de12f;};}function handleError(_0x46888e,_0x31d51a){_0x31d51a=_0x31d51a||0x1f4;return function(_0x400118){logger[_0x5845('0x24')](_0x400118[_0x5845('0x25')]);if(_0x400118[_0x5845('0x26')]){delete _0x400118[_0x5845('0x26')];}_0x46888e[_0x5845('0x18')](_0x31d51a)[_0x5845('0x27')](_0x400118);};}exports[_0x5845('0x28')]=function(_0x4907f1,_0x4fbfdd){var _0x3df765={},_0x559d59={},_0x23ba6e={'count':0x0,'rows':[]};var _0x143cf7=_[_0x5845('0x29')](db[_0x5845('0x2a')][_0x5845('0x2b')],function(_0x3b69a3){return{'name':_0x3b69a3['fieldName'],'type':_0x3b69a3['type'][_0x5845('0x2c')]};});_0x559d59[_0x5845('0x2d')]=_[_0x5845('0x29')](_0x143cf7,_0x5845('0x26'));_0x559d59['query']=_[_0x5845('0x2e')](_0x4907f1['query']);_0x559d59['filters']=_['intersection'](_0x559d59[_0x5845('0x2d')],_0x559d59['query']);_0x3df765[_0x5845('0x2f')]=_[_0x5845('0x30')](_0x559d59[_0x5845('0x2d')],qs[_0x5845('0x31')](_0x4907f1[_0x5845('0x32')][_0x5845('0x31')]));_0x3df765[_0x5845('0x2f')]=_0x3df765[_0x5845('0x2f')]['length']?_0x3df765[_0x5845('0x2f')]:_0x559d59[_0x5845('0x2d')];if(!_0x4907f1[_0x5845('0x32')][_0x5845('0x33')](_0x5845('0x34'))){_0x3df765[_0x5845('0x1a')]=qs['limit'](_0x4907f1[_0x5845('0x32')][_0x5845('0x1a')]);_0x3df765[_0x5845('0x1d')]=qs[_0x5845('0x1d')](_0x4907f1['query']['offset']);}_0x3df765[_0x5845('0x35')]=qs[_0x5845('0x36')](_0x4907f1[_0x5845('0x32')][_0x5845('0x36')]);_0x3df765[_0x5845('0x37')]=qs[_0x5845('0x38')](_[_0x5845('0x39')](_0x4907f1[_0x5845('0x32')],_0x559d59[_0x5845('0x38')]),_0x143cf7);if(_0x4907f1[_0x5845('0x32')][_0x5845('0x3a')]){_0x3df765['where']=_[_0x5845('0x3b')](_0x3df765[_0x5845('0x37')],{'$or':_[_0x5845('0x29')](_0x143cf7,function(_0x33ebed){if(_0x33ebed[_0x5845('0x3c')]!=='VIRTUAL'){var _0x38e2c6={};_0x38e2c6[_0x33ebed[_0x5845('0x26')]]={'$like':'%'+_0x4907f1[_0x5845('0x32')]['filter']+'%'};return _0x38e2c6;}})});}_0x3df765=_[_0x5845('0x3b')]({},_0x3df765,_0x4907f1['options']);var _0x2b9624={'where':_0x3df765[_0x5845('0x37')]};return db[_0x5845('0x2a')][_0x5845('0x1c')](_0x2b9624)[_0x5845('0x22')](function(_0x6a3e5a){_0x23ba6e[_0x5845('0x1c')]=_0x6a3e5a;if(_0x4907f1['query'][_0x5845('0x3d')]){_0x3df765[_0x5845('0x3e')]=[{'all':!![]}];}return db[_0x5845('0x2a')][_0x5845('0x3f')](_0x3df765);})[_0x5845('0x22')](function(_0x170203){_0x23ba6e[_0x5845('0x40')]=_0x170203;return _0x23ba6e;})[_0x5845('0x22')](respondWithFilteredResult(_0x4fbfdd,_0x3df765))[_0x5845('0x41')](handleError(_0x4fbfdd,null));};exports[_0x5845('0x42')]=function(_0x31e027,_0x49b3a5){var _0x227118={'raw':!![],'where':{'id':_0x31e027[_0x5845('0x43')]['id']}},_0x2f467f={};_0x2f467f['model']=_['keys'](db[_0x5845('0x2a')]['rawAttributes']);_0x2f467f[_0x5845('0x32')]=_[_0x5845('0x2e')](_0x31e027['query']);_0x2f467f[_0x5845('0x38')]=_[_0x5845('0x30')](_0x2f467f[_0x5845('0x2d')],_0x2f467f['query']);_0x227118[_0x5845('0x2f')]=_[_0x5845('0x30')](_0x2f467f[_0x5845('0x2d')],qs[_0x5845('0x31')](_0x31e027['query'][_0x5845('0x31')]));_0x227118[_0x5845('0x2f')]=_0x227118[_0x5845('0x2f')][_0x5845('0x44')]?_0x227118[_0x5845('0x2f')]:_0x2f467f[_0x5845('0x2d')];if(_0x31e027[_0x5845('0x32')][_0x5845('0x3d')]){_0x227118[_0x5845('0x3e')]=[{'all':!![]}];}_0x227118=_[_0x5845('0x3b')]({},_0x227118,_0x31e027[_0x5845('0x45')]);return db[_0x5845('0x2a')]['find'](_0x227118)['then'](handleEntityNotFound(_0x49b3a5,null))['then'](respondWithResult(_0x49b3a5,null))['catch'](handleError(_0x49b3a5,null));};exports[_0x5845('0x46')]=function(_0x5f042c,_0x23ec33){return db[_0x5845('0x2a')]['create'](_0x5f042c[_0x5845('0x47')],{})[_0x5845('0x22')](respondWithResult(_0x23ec33,0xc9))['catch'](handleError(_0x23ec33,null));};exports[_0x5845('0x48')]=function(_0x3a3540,_0x172ae3){if(_0x3a3540[_0x5845('0x47')]['id']){delete _0x3a3540[_0x5845('0x47')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x3a3540['params']['id']}})['then'](handleEntityNotFound(_0x172ae3,null))[_0x5845('0x22')](saveUpdates(_0x3a3540[_0x5845('0x47')],null))['then'](respondWithResult(_0x172ae3,null))[_0x5845('0x41')](handleError(_0x172ae3,null));};exports['destroy']=function(_0x7be155,_0x30db1c){return db[_0x5845('0x2a')]['find']({'where':{'id':_0x7be155[_0x5845('0x43')]['id']}})[_0x5845('0x22')](handleEntityNotFound(_0x30db1c,null))[_0x5845('0x22')](removeEntity(_0x30db1c,null))[_0x5845('0x41')](handleError(_0x30db1c,null));};exports['describe']=function(_0x3fd1ba,_0x8e1a33){return db[_0x5845('0x2a')][_0x5845('0x49')]()[_0x5845('0x22')](respondWithResult(_0x8e1a33,null))['catch'](handleError(_0x8e1a33,null));};
\ No newline at end of file
+var _0xc496=['VIRTUAL','include','findAll','catch','show','params','keys','find','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x223f23,_0x1a45da){var _0x51a4aa=function(_0x7f97ce){while(--_0x7f97ce){_0x223f23['push'](_0x223f23['shift']());}};_0x51a4aa(++_0x1a45da);}(_0xc496,0xa1));var _0x6c49=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xc496[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c49('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c49('0x1'));var rp=require('request-promise');var moment=require(_0x6c49('0x2'));var BPromise=require(_0x6c49('0x3'));var Mustache=require(_0x6c49('0x4'));var util=require(_0x6c49('0x5'));var path=require(_0x6c49('0x6'));var sox=require(_0x6c49('0x7'));var csv=require(_0x6c49('0x8'));var ejs=require(_0x6c49('0x9'));var fs=require('fs');var fs_extra=require(_0x6c49('0xa'));var _=require(_0x6c49('0xb'));var squel=require(_0x6c49('0xc'));var crypto=require(_0x6c49('0xd'));var jsforce=require(_0x6c49('0xe'));var deskjs=require(_0x6c49('0xf'));var toCsv=require(_0x6c49('0x8'));var querystring=require(_0x6c49('0x10'));var Papa=require(_0x6c49('0x11'));var Redis=require(_0x6c49('0x12'));var authService=require(_0x6c49('0x13'));var qs=require(_0x6c49('0x14'));var as=require(_0x6c49('0x15'));var hardwareService=require(_0x6c49('0x16'));var logger=require('../../config/logger')(_0x6c49('0x17'));var utils=require(_0x6c49('0x18'));var config=require(_0x6c49('0x19'));var licenseUtil=require(_0x6c49('0x1a'));var db=require(_0x6c49('0x1b'))['db'];function respondWithStatusCode(_0x3347a2,_0x10f6b1){_0x10f6b1=_0x10f6b1||0xcc;return function(_0x48d4ff){if(_0x48d4ff){return _0x3347a2[_0x6c49('0x1c')](_0x10f6b1);}return _0x3347a2[_0x6c49('0x1d')](_0x10f6b1)[_0x6c49('0x1e')]();};}function respondWithResult(_0x738849,_0x5500ed){_0x5500ed=_0x5500ed||0xc8;return function(_0x2e623c){if(_0x2e623c){return _0x738849[_0x6c49('0x1d')](_0x5500ed)[_0x6c49('0x1f')](_0x2e623c);}};}function respondWithFilteredResult(_0x44591d,_0x420389){return function(_0x69adfd){if(_0x69adfd){var _0xfc7dc6=typeof _0x420389['offset']==='undefined'&&typeof _0x420389['limit']===_0x6c49('0x20');var _0x49544c=_0x69adfd[_0x6c49('0x21')];var _0x3ef499=_0xfc7dc6?0x0:_0x420389[_0x6c49('0x22')];var _0x32c4e2=_0xfc7dc6?_0x69adfd[_0x6c49('0x21')]:_0x420389[_0x6c49('0x22')]+_0x420389[_0x6c49('0x23')];var _0x3997a5;if(_0x32c4e2>=_0x49544c){_0x32c4e2=_0x49544c;_0x3997a5=0xc8;}else{_0x3997a5=0xce;}_0x44591d[_0x6c49('0x1d')](_0x3997a5);return _0x44591d[_0x6c49('0x24')](_0x6c49('0x25'),_0x3ef499+'-'+_0x32c4e2+'/'+_0x49544c)[_0x6c49('0x1f')](_0x69adfd);}return null;};}function patchUpdates(_0x3a0426){return function(_0x2bc36f){try{jsonpatch['apply'](_0x2bc36f,_0x3a0426,!![]);}catch(_0x500a1b){return BPromise[_0x6c49('0x26')](_0x500a1b);}return _0x2bc36f[_0x6c49('0x27')]();};}function saveUpdates(_0x5d38bc,_0x208915){return function(_0x489525){if(_0x489525){return _0x489525[_0x6c49('0x28')](_0x5d38bc)['then'](function(_0x427b6a){return _0x427b6a;});}return null;};}function removeEntity(_0x353178,_0x4d718e){return function(_0x263ca5){if(_0x263ca5){return _0x263ca5[_0x6c49('0x29')]()[_0x6c49('0x2a')](function(){_0x353178[_0x6c49('0x1d')](0xcc)[_0x6c49('0x1e')]();});}};}function handleEntityNotFound(_0x1ca85d,_0x8e7c29){return function(_0x1e98e3){if(!_0x1e98e3){_0x1ca85d[_0x6c49('0x1c')](0x194);}return _0x1e98e3;};}function handleError(_0x36f605,_0x930e80){_0x930e80=_0x930e80||0x1f4;return function(_0x361c44){logger[_0x6c49('0x2b')](_0x361c44[_0x6c49('0x2c')]);if(_0x361c44['name']){delete _0x361c44['name'];}_0x36f605['status'](_0x930e80)[_0x6c49('0x2d')](_0x361c44);};}exports['index']=function(_0x161eb3,_0x20aedc){var _0x5c74dc={},_0xb8b963={},_0x2aa99d={'count':0x0,'rows':[]};var _0x4bb979=_[_0x6c49('0x2e')](db[_0x6c49('0x2f')][_0x6c49('0x30')],function(_0x1f198e){return{'name':_0x1f198e[_0x6c49('0x31')],'type':_0x1f198e[_0x6c49('0x32')][_0x6c49('0x33')]};});_0xb8b963[_0x6c49('0x34')]=_[_0x6c49('0x2e')](_0x4bb979,_0x6c49('0x35'));_0xb8b963[_0x6c49('0x36')]=_['keys'](_0x161eb3[_0x6c49('0x36')]);_0xb8b963[_0x6c49('0x37')]=_['intersection'](_0xb8b963['model'],_0xb8b963[_0x6c49('0x36')]);_0x5c74dc[_0x6c49('0x38')]=_[_0x6c49('0x39')](_0xb8b963['model'],qs[_0x6c49('0x3a')](_0x161eb3['query'][_0x6c49('0x3a')]));_0x5c74dc[_0x6c49('0x38')]=_0x5c74dc[_0x6c49('0x38')][_0x6c49('0x3b')]?_0x5c74dc['attributes']:_0xb8b963[_0x6c49('0x34')];if(!_0x161eb3[_0x6c49('0x36')][_0x6c49('0x3c')](_0x6c49('0x3d'))){_0x5c74dc[_0x6c49('0x23')]=qs[_0x6c49('0x23')](_0x161eb3[_0x6c49('0x36')][_0x6c49('0x23')]);_0x5c74dc[_0x6c49('0x22')]=qs[_0x6c49('0x22')](_0x161eb3[_0x6c49('0x36')][_0x6c49('0x22')]);}_0x5c74dc[_0x6c49('0x3e')]=qs[_0x6c49('0x3f')](_0x161eb3[_0x6c49('0x36')][_0x6c49('0x3f')]);_0x5c74dc[_0x6c49('0x40')]=qs[_0x6c49('0x37')](_[_0x6c49('0x41')](_0x161eb3[_0x6c49('0x36')],_0xb8b963[_0x6c49('0x37')]),_0x4bb979);if(_0x161eb3[_0x6c49('0x36')][_0x6c49('0x42')]){_0x5c74dc[_0x6c49('0x40')]=_['merge'](_0x5c74dc['where'],{'$or':_[_0x6c49('0x2e')](_0x4bb979,function(_0x2e8c34){if(_0x2e8c34['type']!==_0x6c49('0x43')){var _0xca9cac={};_0xca9cac[_0x2e8c34[_0x6c49('0x35')]]={'$like':'%'+_0x161eb3['query'][_0x6c49('0x42')]+'%'};return _0xca9cac;}})});}_0x5c74dc=_['merge']({},_0x5c74dc,_0x161eb3['options']);var _0x579270={'where':_0x5c74dc[_0x6c49('0x40')]};return db[_0x6c49('0x2f')][_0x6c49('0x21')](_0x579270)[_0x6c49('0x2a')](function(_0x778828){_0x2aa99d[_0x6c49('0x21')]=_0x778828;if(_0x161eb3[_0x6c49('0x36')]['includeAll']){_0x5c74dc[_0x6c49('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x6c49('0x45')](_0x5c74dc);})['then'](function(_0x173eb8){_0x2aa99d['rows']=_0x173eb8;return _0x2aa99d;})[_0x6c49('0x2a')](respondWithFilteredResult(_0x20aedc,_0x5c74dc))[_0x6c49('0x46')](handleError(_0x20aedc,null));};exports[_0x6c49('0x47')]=function(_0x31d5d3,_0x70923a){var _0x36349f={'raw':!![],'where':{'id':_0x31d5d3[_0x6c49('0x48')]['id']}},_0x1b3b48={};_0x1b3b48[_0x6c49('0x34')]=_[_0x6c49('0x49')](db[_0x6c49('0x2f')][_0x6c49('0x30')]);_0x1b3b48[_0x6c49('0x36')]=_['keys'](_0x31d5d3[_0x6c49('0x36')]);_0x1b3b48['filters']=_[_0x6c49('0x39')](_0x1b3b48[_0x6c49('0x34')],_0x1b3b48['query']);_0x36349f[_0x6c49('0x38')]=_[_0x6c49('0x39')](_0x1b3b48[_0x6c49('0x34')],qs['fields'](_0x31d5d3[_0x6c49('0x36')][_0x6c49('0x3a')]));_0x36349f[_0x6c49('0x38')]=_0x36349f['attributes'][_0x6c49('0x3b')]?_0x36349f[_0x6c49('0x38')]:_0x1b3b48['model'];if(_0x31d5d3[_0x6c49('0x36')]['includeAll']){_0x36349f[_0x6c49('0x44')]=[{'all':!![]}];}_0x36349f=_['merge']({},_0x36349f,_0x31d5d3['options']);return db['ChatTransferReport'][_0x6c49('0x4a')](_0x36349f)[_0x6c49('0x2a')](handleEntityNotFound(_0x70923a,null))['then'](respondWithResult(_0x70923a,null))[_0x6c49('0x46')](handleError(_0x70923a,null));};exports['create']=function(_0x28b1c1,_0x1e972e){return db[_0x6c49('0x2f')]['create'](_0x28b1c1[_0x6c49('0x4b')],{})[_0x6c49('0x2a')](respondWithResult(_0x1e972e,0xc9))[_0x6c49('0x46')](handleError(_0x1e972e,null));};exports['update']=function(_0x5d6971,_0x3f0754){if(_0x5d6971[_0x6c49('0x4b')]['id']){delete _0x5d6971[_0x6c49('0x4b')]['id'];}return db[_0x6c49('0x2f')]['find']({'where':{'id':_0x5d6971[_0x6c49('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f0754,null))['then'](saveUpdates(_0x5d6971['body'],null))[_0x6c49('0x2a')](respondWithResult(_0x3f0754,null))['catch'](handleError(_0x3f0754,null));};exports[_0x6c49('0x29')]=function(_0x3e7b90,_0x203831){return db[_0x6c49('0x2f')]['find']({'where':{'id':_0x3e7b90[_0x6c49('0x48')]['id']}})[_0x6c49('0x2a')](handleEntityNotFound(_0x203831,null))[_0x6c49('0x2a')](removeEntity(_0x203831,null))[_0x6c49('0x46')](handleError(_0x203831,null));};exports['describe']=function(_0x13274b,_0x45450d){return db[_0x6c49('0x2f')]['describe']()[_0x6c49('0x2a')](respondWithResult(_0x45450d,null))['catch'](handleError(_0x45450d,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 9497189..0b92688 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 _0xcc26=['exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes'];(function(_0xf969eb,_0x4c6c2d){var _0x2de570=function(_0x33f8f7){while(--_0x33f8f7){_0xf969eb['push'](_0xf969eb['shift']());}};_0x2de570(++_0x4c6c2d);}(_0xcc26,0x1b6));var _0x6cc2=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xcc26[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x6cc2('0x0'));var util=require(_0x6cc2('0x1'));var logger=require(_0x6cc2('0x2'))(_0x6cc2('0x3'));var moment=require(_0x6cc2('0x4'));var BPromise=require(_0x6cc2('0x5'));var rp=require(_0x6cc2('0x6'));var fs=require('fs');var path=require(_0x6cc2('0x7'));var rimraf=require(_0x6cc2('0x8'));var config=require('../../config/environment');var attributes=require(_0x6cc2('0x9'));module[_0x6cc2('0xa')]=function(_0x524fe7,_0x7acade){return _0x524fe7['define'](_0x6cc2('0xb'),attributes,{'tableName':_0x6cc2('0xc'),'paranoid':![],'indexes':[{'name':_0x6cc2('0xd'),'fields':[_0x6cc2('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2722=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x2722,0x1de));var _0x2272=function(_0x5e0923,_0x51b52e){_0x5e0923=_0x5e0923-0x0;var _0x46e644=_0x2722[_0x5e0923];return _0x46e644;};'use strict';var _=require(_0x2272('0x0'));var util=require(_0x2272('0x1'));var logger=require(_0x2272('0x2'))(_0x2272('0x3'));var moment=require(_0x2272('0x4'));var BPromise=require(_0x2272('0x5'));var rp=require(_0x2272('0x6'));var fs=require('fs');var path=require(_0x2272('0x7'));var rimraf=require(_0x2272('0x8'));var config=require(_0x2272('0x9'));var attributes=require(_0x2272('0xa'));module['exports']=function(_0x5b7e9b,_0x40c104){return _0x5b7e9b[_0x2272('0xb')]('ChatTransferReport',attributes,{'tableName':_0x2272('0xc'),'paranoid':![],'indexes':[{'name':_0x2272('0xd'),'fields':[_0x2272('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 8c8d030..d2d7a9a 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 _0x691a=['request\x20sent','debug','stringify','error','message','info','result','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ChatTransferReport,\x20%s,\x20%s'];(function(_0x6b6340,_0x6302c4){var _0x3609bf=function(_0x1620a0){while(--_0x1620a0){_0x6b6340['push'](_0x6b6340['shift']());}};_0x3609bf(++_0x6302c4);}(_0x691a,0x127));var _0xa691=function(_0x1e0b34,_0x584715){_0x1e0b34=_0x1e0b34-0x0;var _0x395f97=_0x691a[_0x1e0b34];return _0x395f97;};'use strict';var _=require(_0xa691('0x0'));var util=require('util');var moment=require(_0xa691('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa691('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa691('0x3'));var logger=require(_0xa691('0x4'))('rpc');var config=require(_0xa691('0x5'));var jayson=require(_0xa691('0x6'));var client=jayson[_0xa691('0x7')][_0xa691('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x390964,_0x51e18f,_0x3697ab){return new BPromise(function(_0x583d6c,_0x560a2e){return client['request'](_0x390964,_0x3697ab)[_0xa691('0x9')](function(_0x3f1615){logger['info'](_0xa691('0xa'),_0x51e18f,_0xa691('0xb'));logger[_0xa691('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x51e18f,_0xa691('0xb'),JSON[_0xa691('0xd')](_0x3f1615));if(_0x3f1615[_0xa691('0xe')]){if(_0x3f1615[_0xa691('0xe')]['code']===0x1f4){logger[_0xa691('0xe')](_0xa691('0xa'),_0x51e18f,_0x3f1615['error']['message']);return _0x560a2e(_0x3f1615[_0xa691('0xe')][_0xa691('0xf')]);}logger[_0xa691('0xe')](_0xa691('0xa'),_0x51e18f,_0x3f1615[_0xa691('0xe')][_0xa691('0xf')]);return _0x583d6c(_0x3f1615[_0xa691('0xe')][_0xa691('0xf')]);}else{logger[_0xa691('0x10')](_0xa691('0xa'),_0x51e18f,_0xa691('0xb'));_0x583d6c(_0x3f1615[_0xa691('0x11')][_0xa691('0xf')]);}})['catch'](function(_0x1d6d92){logger[_0xa691('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x51e18f,_0x1d6d92);_0x560a2e(_0x1d6d92);});});}
\ No newline at end of file
+var _0xb3bc=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x49febd,_0x5f24f3){var _0x51b264=function(_0x40a4c4){while(--_0x40a4c4){_0x49febd['push'](_0x49febd['shift']());}};_0x51b264(++_0x5f24f3);}(_0xb3bc,0x1dd));var _0xcb3b=function(_0x3beff5,_0xd10aa2){_0x3beff5=_0x3beff5-0x0;var _0x7fc726=_0xb3bc[_0x3beff5];return _0x7fc726;};'use strict';var _=require('lodash');var util=require(_0xcb3b('0x0'));var moment=require(_0xcb3b('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb3b('0x2'));var fs=require('fs');var Redis=require(_0xcb3b('0x3'));var db=require(_0xcb3b('0x4'))['db'];var utils=require(_0xcb3b('0x5'));var logger=require(_0xcb3b('0x6'))(_0xcb3b('0x7'));var config=require(_0xcb3b('0x8'));var jayson=require(_0xcb3b('0x9'));var client=jayson[_0xcb3b('0xa')][_0xcb3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36fdfa,_0x18857f,_0x3b25b1){return new BPromise(function(_0x50021b,_0x43b310){return client['request'](_0x36fdfa,_0x3b25b1)['then'](function(_0x479227){logger[_0xcb3b('0xc')](_0xcb3b('0xd'),_0x18857f,_0xcb3b('0xe'));logger[_0xcb3b('0xf')](_0xcb3b('0x10'),_0x18857f,_0xcb3b('0xe'),JSON[_0xcb3b('0x11')](_0x479227));if(_0x479227['error']){if(_0x479227[_0xcb3b('0x12')][_0xcb3b('0x13')]===0x1f4){logger[_0xcb3b('0x12')](_0xcb3b('0xd'),_0x18857f,_0x479227[_0xcb3b('0x12')]['message']);return _0x43b310(_0x479227[_0xcb3b('0x12')][_0xcb3b('0x14')]);}logger[_0xcb3b('0x12')](_0xcb3b('0xd'),_0x18857f,_0x479227[_0xcb3b('0x12')]['message']);return _0x50021b(_0x479227[_0xcb3b('0x12')][_0xcb3b('0x14')]);}else{logger[_0xcb3b('0xc')](_0xcb3b('0xd'),_0x18857f,_0xcb3b('0xe'));_0x50021b(_0x479227[_0xcb3b('0x15')][_0xcb3b('0x14')]);}})[_0xcb3b('0x16')](function(_0x1b1fc8){logger[_0xcb3b('0x12')](_0xcb3b('0xd'),_0x18857f,_0x1b1fc8);_0x43b310(_0x1b1fc8);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 25baaf2..4bbf2e9 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 _0x5771=['index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x8ae771,_0x4bc486){var _0x38ba63=function(_0x68029a){while(--_0x68029a){_0x8ae771['push'](_0x8ae771['shift']());}};_0x38ba63(++_0x4bc486);}(_0x5771,0x185));var _0x1577=function(_0x504da4,_0xfd929a){_0x504da4=_0x504da4-0x0;var _0x44bd31=_0x5771[_0x504da4];return _0x44bd31;};'use strict';var multer=require(_0x1577('0x0'));var util=require(_0x1577('0x1'));var path=require(_0x1577('0x2'));var timeout=require(_0x1577('0x3'));var express=require(_0x1577('0x4'));var router=express[_0x1577('0x5')]();var fs_extra=require(_0x1577('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1577('0x7'));router[_0x1577('0x8')]('/',auth[_0x1577('0x9')](),controller[_0x1577('0xa')]);router[_0x1577('0x8')]('/describe',auth[_0x1577('0x9')](),controller['describe']);router['get'](_0x1577('0xb'),auth[_0x1577('0x9')](),controller[_0x1577('0xc')]);router[_0x1577('0xd')]('/',auth[_0x1577('0x9')](),controller[_0x1577('0xe')]);router['put'](_0x1577('0xb'),auth[_0x1577('0x9')](),controller[_0x1577('0xf')]);router[_0x1577('0x10')](_0x1577('0xb'),auth[_0x1577('0x9')](),controller[_0x1577('0x11')]);module[_0x1577('0x12')]=router;
\ No newline at end of file
+var _0x21fb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x21fb,0xab));var _0xb21f=function(_0x3fefaf,_0x298914){_0x3fefaf=_0x3fefaf-0x0;var _0x31bee8=_0x21fb[_0x3fefaf];return _0x31bee8;};'use strict';var multer=require('multer');var util=require(_0xb21f('0x0'));var path=require(_0xb21f('0x1'));var timeout=require('connect-timeout');var express=require(_0xb21f('0x2'));var router=express[_0xb21f('0x3')]();var fs_extra=require(_0xb21f('0x4'));var auth=require(_0xb21f('0x5'));var interaction=require(_0xb21f('0x6'));var config=require(_0xb21f('0x7'));var controller=require(_0xb21f('0x8'));router[_0xb21f('0x9')]('/',auth[_0xb21f('0xa')](),controller[_0xb21f('0xb')]);router[_0xb21f('0x9')]('/describe',auth[_0xb21f('0xa')](),controller[_0xb21f('0xc')]);router[_0xb21f('0x9')](_0xb21f('0xd'),auth[_0xb21f('0xa')](),controller[_0xb21f('0xe')]);router[_0xb21f('0xf')]('/',auth[_0xb21f('0xa')](),controller[_0xb21f('0x10')]);router[_0xb21f('0x11')](_0xb21f('0xd'),auth[_0xb21f('0xa')](),controller[_0xb21f('0x12')]);router[_0xb21f('0x13')](_0xb21f('0xd'),auth[_0xb21f('0xa')](),controller[_0xb21f('0x14')]);module[_0xb21f('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 28cb248..e3d00b4 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 _0xaa88=['#011F6A','#ffffff','BOOLEAN','ENUM','rounded','Chat','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Send','Skip','Feedback','star','thumb','input','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','INTEGER','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xaa88,0x137));var _0x8aa8=function(_0x1d4449,_0x495153){_0x1d4449=_0x1d4449-0x0;var _0x4dcde3=_0xaa88[_0x1d4449];return _0x4dcde3;};'use strict';var Sequelize=require(_0x8aa8('0x0'));var rs=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'name':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8aa8('0x4')},'description':{'type':Sequelize[_0x8aa8('0x3')]},'mapKey':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'mapKeyOffline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8aa8('0x3')]},'animation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0xb'),'squared'),'defaultValue':_0x8aa8('0xb')},'header_online':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xc')},'offline_chat_button':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xd')},'download_transcript':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x8aa8('0xe')]},'closingQuestion':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x11')},'noteTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x13')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x14')},'conditionAgreement':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x15')},'ratingType':{'type':Sequelize[_0x8aa8('0xa')](_0x8aa8('0x16'),_0x8aa8('0x17')),'defaultValue':_0x8aa8('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x8aa8('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x8aa8('0x18'),'props':{'title':_0x8aa8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x8aa8('0x1a')](_0x8aa8('0x1b'))?JSON[_0x8aa8('0x1c')](this['getDataValue']('onlineForm')):{};},'set':function(_0x2d1508){return this[_0x8aa8('0x1d')](_0x8aa8('0x1b'),JSON[_0x8aa8('0x1e')](_0x2d1508));}},'offlineForm':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x8aa8('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x8aa8('0x5'),'type':_0x8aa8('0x5')},'variable':null},{'type':_0x8aa8('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x8aa8('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8aa8('0x21'))?JSON[_0x8aa8('0x1c')](this[_0x8aa8('0x1a')](_0x8aa8('0x21'))):{};},'set':function(_0xe07a83){return this['setDataValue'](_0x8aa8('0x21'),JSON[_0x8aa8('0x1e')](_0xe07a83));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8aa8('0x22')]();}},'autoclose':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x8aa8('0x3')]},'forwardOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8aa8('0x3')]},'waitingTitle':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x23')},'waitingMessage':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x25')},'offlineMessageBody':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x27')},'skipUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x14')},'sendUnmanaged':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x13')},'enableCustomerAttachment':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':function(){return _0x8aa8('0x28');}},'notificationSound':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2a')},'verticalAlignment':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x8aa8('0x2c')},'messagesAlignment':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8aa8('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8aa8('0x2b')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8aa8('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8aa8('0x2b')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':_0x8aa8('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8aa8('0x2b')],'comment':_0x8aa8('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8aa8('0x30'),'set':function(_0x3c6115){if(!_0x3c6115)this[_0x8aa8('0x1d')](_0x8aa8('0x31'),null);this[_0x8aa8('0x1d')](_0x8aa8('0x32'),_0x3c6115);}},'vidaooEscalation':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8aa8('0x3')]},'vidaooTopic':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![],'defaultValue':_0x8aa8('0x33')},'vidaooNote':{'type':Sequelize[_0x8aa8('0x3')],'defaultValue':function(){return _0x8aa8('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8aa8('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8aa8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x8aa8('0xe')]}};
\ No newline at end of file
+var _0x9c44=['input','parse','getDataValue','setDataValue','onlineForm','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','ENUM','star','thumb','name'];(function(_0x391df0,_0x51b2dc){var _0x30bec6=function(_0x2899b1){while(--_0x2899b1){_0x391df0['push'](_0x391df0['shift']());}};_0x30bec6(++_0x51b2dc);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x49c4('0x0')]={'name':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'unique':_0x49c4('0x2')},'description':{'type':Sequelize[_0x49c4('0x1')]},'mapKey':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x4')},'customerAlias':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'defaultValue':_0x49c4('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49c4('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'defaultValue':_0x49c4('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x49c4('0x1')]},'animation':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x49c4('0x8'),_0x49c4('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0xa')},'start_chat_button':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0xc')},'download_transcript':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x49c4('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x49c4('0xf')]},'closingQuestion':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x11')},'noteTitle':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0xb')},'skipMessageButton':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x13')},'ratingType':{'type':Sequelize[_0x49c4('0x14')](_0x49c4('0x15'),_0x49c4('0x16')),'defaultValue':_0x49c4('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x49c4('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x49c4('0x17'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x49c4('0x18'),'props':{'title':_0x49c4('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x49c4('0x3'),'type':_0x49c4('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x49c4('0x19')](this[_0x49c4('0x1a')]('onlineForm')):{};},'set':function(_0x207358){return this[_0x49c4('0x1b')](_0x49c4('0x1c'),JSON[_0x49c4('0x1d')](_0x207358));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x49c4('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x49c4('0x3'),'type':_0x49c4('0x3')},'variable':null},{'type':_0x49c4('0x1e'),'config':{'placeholder':_0x49c4('0x1f')},'props':{'title':'Comments','helpText':_0x49c4('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x49c4('0x1a')](_0x49c4('0x21'))?JSON[_0x49c4('0x19')](this[_0x49c4('0x1a')](_0x49c4('0x21'))):{};},'set':function(_0x26ba17){return this[_0x49c4('0x1b')](_0x49c4('0x21'),JSON[_0x49c4('0x1d')](_0x26ba17));}},'token':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x49c4('0x1')]},'forwardOffline':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x49c4('0x1')]},'waitingTitle':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x23')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x24')},'skipUnmanaged':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x49c4('0x1')]},'notificationTemplate':{'type':Sequelize[_0x49c4('0xf')],'defaultValue':function(){return _0x49c4('0x26');}},'notificationSound':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x49c4('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x29')},'messagesAlignment':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x49c4('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x49c4('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49c4('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x49c4('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x49c4('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':_0x49c4('0x2c')},'systemAvatar':{'type':Sequelize[_0x49c4('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x49c4('0xd')],'comment':_0x49c4('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2d2510){if(!_0x2d2510)this[_0x49c4('0x1b')](_0x49c4('0x2e'),null);this[_0x49c4('0x1b')](_0x49c4('0x2f'),_0x2d2510);}},'vidaooEscalation':{'type':Sequelize[_0x49c4('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x49c4('0x1')]},'vidaooTopic':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![],'defaultValue':_0x49c4('0x30')},'vidaooNote':{'type':Sequelize[_0x49c4('0x1')],'defaultValue':function(){return _0x49c4('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x49c4('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x49c4('0x7')],'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 dcf7789..8f67807 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 _0x9491=['params','describe','addDisposition','ChatWebsiteId','Disposition','findOne','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','existsSync','showCustomerAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','ListId','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','browser','%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','stringify','ChatInteraction','threadId','externalUrl','interaction','contact','messageId','created','autoclose','close','unmanaged','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','push','all','some','server/files/chat/iframe.ejs','connection','remoteAddress','referer','render','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x5af89d,_0xa40ecd){var _0x44e390=function(_0x296473){while(--_0x296473){_0x5af89d['push'](_0x5af89d['shift']());}};_0x44e390(++_0xa40ecd);}(_0x9491,0xd5));var _0x1949=function(_0x3653e5,_0x2e2f26){_0x3653e5=_0x3653e5-0x0;var _0x17bf62=_0x9491[_0x3653e5];return _0x17bf62;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x1949('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x1949('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x1949('0x2'));var Redis=require(_0x1949('0x3'));var qs=require(_0x1949('0x4'));var logger=require(_0x1949('0x5'))(_0x1949('0x6'));var config=require('../../config/environment');var db=require(_0x1949('0x7'))['db'];config['redis']=_[_0x1949('0x8')](config[_0x1949('0x9')],{'host':_0x1949('0xa'),'port':0x18eb});var socket=require(_0x1949('0xb'))(new Redis(config[_0x1949('0x9')]));require(_0x1949('0xc'))[_0x1949('0xd')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0x1949('0xe')]['http']({'port':0x232c});var client9002=jayson[_0x1949('0xe')][_0x1949('0xf')]({'port':0x232a});var client9003=jayson[_0x1949('0xe')][_0x1949('0xf')]({'port':0x232b});var client9001=jayson[_0x1949('0xe')][_0x1949('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x190c33,_0x35df3f,_0x5a0b7f,_0x199b32){return new BPromise(function(_0x2557b4,_0xa737e4){var _0x4e28bb=_0x199b32||client;return _0x4e28bb['request'](_0x190c33,_0x5a0b7f)[_0x1949('0x10')](function(_0x269284){logger[_0x1949('0x11')](_0x1949('0x12'),_0x35df3f,_0x1949('0x13'));logger['debug'](_0x1949('0x14'),_0x35df3f,'request\x20sent',JSON['stringify'](_0x269284));if(_0x269284[_0x1949('0x15')]){if(_0x269284['error']['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x35df3f,_0x269284[_0x1949('0x15')][_0x1949('0x16')]);return _0xa737e4(_0x269284[_0x1949('0x15')]['message']);}logger[_0x1949('0x15')](_0x1949('0x12'),_0x35df3f,_0x269284[_0x1949('0x15')][_0x1949('0x16')]);return _0x2557b4(_0x269284[_0x1949('0x15')][_0x1949('0x16')]);}else{logger['info'](_0x1949('0x12'),_0x35df3f,'request\x20sent');_0x2557b4(_0x269284[_0x1949('0x17')][_0x1949('0x16')]);}})[_0x1949('0x18')](function(_0x319d8e){logger[_0x1949('0x15')](_0x1949('0x12'),_0x35df3f,_0x319d8e);_0xa737e4(_0x319d8e);});});}function respondWithStatusCode(_0x17ee9d,_0x2d316a){_0x2d316a=_0x2d316a||0xcc;return function(_0x1f8371){if(_0x1f8371){return _0x17ee9d['sendStatus'](_0x2d316a);}return _0x17ee9d[_0x1949('0x19')](_0x2d316a)[_0x1949('0x1a')]();};}function respondWithResult(_0x457db4,_0x5465c6){_0x5465c6=_0x5465c6||0xc8;return function(_0x4a8d28){if(_0x4a8d28){return _0x457db4[_0x1949('0x19')](_0x5465c6)['json'](_0x4a8d28);}};}function respondWithFilteredResult(_0x550dfa,_0x4b2578){return function(_0x431593){if(_0x431593){var _0xfcbad0=typeof _0x4b2578[_0x1949('0x1b')]===_0x1949('0x1c')&&typeof _0x4b2578[_0x1949('0x1d')]===_0x1949('0x1c');var _0x33aa5f=_0x431593['count'];var _0x33f76d=_0xfcbad0?0x0:_0x4b2578[_0x1949('0x1b')];var _0x16154c=_0xfcbad0?_0x431593[_0x1949('0x1e')]:_0x4b2578['offset']+_0x4b2578[_0x1949('0x1d')];var _0x4a4f42;if(_0x16154c>=_0x33aa5f){_0x16154c=_0x33aa5f;_0x4a4f42=0xc8;}else{_0x4a4f42=0xce;}_0x550dfa[_0x1949('0x19')](_0x4a4f42);return _0x550dfa['set'](_0x1949('0x1f'),_0x33f76d+'-'+_0x16154c+'/'+_0x33aa5f)[_0x1949('0x20')](_0x431593);}return null;};}function saveUpdates(_0x35cb98){return function(_0x36a204){if(_0x36a204){return _0x36a204['update'](_0x35cb98)[_0x1949('0x10')](function(_0x28a470){return _0x28a470;});}return null;};}function removeEntity(_0x4dcf00){return function(_0x559dee){if(_0x559dee){return _0x559dee['destroy']()[_0x1949('0x10')](function(){var _0x180179=_0x559dee[_0x1949('0x21')]({'plain':!![]});var _0x560273=_0x1949('0x22');return db[_0x1949('0x23')][_0x1949('0x24')]({'where':{'type':_0x560273,'resourceId':_0x180179['id']}})['then'](function(){return _0x559dee;});})[_0x1949('0x10')](function(){_0x4dcf00[_0x1949('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb596d2){return function(_0x17412b){if(!_0x17412b){_0xb596d2[_0x1949('0x25')](0x194);}return _0x17412b;};}function handleError(_0x282299,_0x450790){_0x450790=_0x450790||0x1f4;return function(_0xe28126){logger[_0x1949('0x15')](_0xe28126[_0x1949('0x26')]);if(_0xe28126['name']){delete _0xe28126[_0x1949('0x27')];}_0x282299[_0x1949('0x19')](_0x450790)[_0x1949('0x28')](_0xe28126);};}exports[_0x1949('0x29')]=function(_0x95bfad,_0x4d4990){var _0x38f1a9={'include':[{'model':db[_0x1949('0x2a')],'as':_0x1949('0x2b')}]},_0x2a91ab={},_0x5a6b42={'count':0x0,'rows':[]};var _0x5ad82c=_['map'](db[_0x1949('0x2c')][_0x1949('0x2d')],function(_0x251b12){return{'name':_0x251b12[_0x1949('0x2e')],'type':_0x251b12[_0x1949('0x2f')]['key']};});_0x2a91ab['model']=_[_0x1949('0x30')](_0x5ad82c,'name');_0x2a91ab[_0x1949('0x31')]=_[_0x1949('0x32')](_0x95bfad[_0x1949('0x31')]);_0x2a91ab[_0x1949('0x33')]=_[_0x1949('0x34')](_0x2a91ab[_0x1949('0x35')],_0x2a91ab[_0x1949('0x31')]);_0x38f1a9[_0x1949('0x36')]=_[_0x1949('0x34')](_0x2a91ab['model'],qs['fields'](_0x95bfad[_0x1949('0x31')]['fields']));_0x38f1a9[_0x1949('0x36')]=_0x38f1a9[_0x1949('0x36')][_0x1949('0x37')]?_0x38f1a9[_0x1949('0x36')]:_0x2a91ab['model'];if(!_0x95bfad['query'][_0x1949('0x38')](_0x1949('0x39'))){_0x38f1a9[_0x1949('0x1d')]=qs['limit'](_0x95bfad['query'][_0x1949('0x1d')]);_0x38f1a9['offset']=qs['offset'](_0x95bfad[_0x1949('0x31')][_0x1949('0x1b')]);}_0x38f1a9[_0x1949('0x3a')]=qs[_0x1949('0x3b')](_0x95bfad['query'][_0x1949('0x3b')]);_0x38f1a9[_0x1949('0x3c')]=qs[_0x1949('0x33')](_[_0x1949('0x3d')](_0x95bfad[_0x1949('0x31')],_0x2a91ab[_0x1949('0x33')]),_0x5ad82c);if(_0x95bfad[_0x1949('0x31')][_0x1949('0x3e')]){_0x38f1a9[_0x1949('0x3c')]=_[_0x1949('0x3f')](_0x38f1a9[_0x1949('0x3c')],{'$or':_[_0x1949('0x30')](_0x5ad82c,function(_0xd21af7){if(_0xd21af7[_0x1949('0x2f')]!=='VIRTUAL'){var _0x2f642c={};_0x2f642c[_0xd21af7['name']]={'$like':'%'+_0x95bfad[_0x1949('0x31')]['filter']+'%'};return _0x2f642c;}})});}_0x38f1a9=_['merge']({},_0x38f1a9,_0x95bfad[_0x1949('0x40')]);var _0x3e8acb={'where':_0x38f1a9['where']};return db['ChatWebsite'][_0x1949('0x1e')](_0x3e8acb)['then'](function(_0x4e856f){_0x5a6b42['count']=_0x4e856f;if(_0x95bfad[_0x1949('0x31')][_0x1949('0x41')]){_0x38f1a9[_0x1949('0x42')]=[{'all':!![]}];}return db[_0x1949('0x2c')]['findAll'](_0x38f1a9);})[_0x1949('0x10')](function(_0x268a8c){_0x5a6b42[_0x1949('0x43')]=_0x268a8c;return _0x5a6b42;})[_0x1949('0x10')](respondWithFilteredResult(_0x4d4990,_0x38f1a9))['catch'](handleError(_0x4d4990,null));};exports[_0x1949('0x44')]=function(_0x594da2,_0x2aca2d){var _0x578336={'raw':![],'where':{'id':_0x594da2['params']['id']},'include':[{'model':db[_0x1949('0x2a')],'as':_0x1949('0x2b')}]},_0x336f1d={};_0x336f1d['model']=_[_0x1949('0x32')](db[_0x1949('0x2c')][_0x1949('0x2d')]);_0x336f1d[_0x1949('0x31')]=_[_0x1949('0x32')](_0x594da2['query']);_0x336f1d[_0x1949('0x33')]=_[_0x1949('0x34')](_0x336f1d[_0x1949('0x35')],_0x336f1d[_0x1949('0x31')]);_0x578336[_0x1949('0x36')]=_[_0x1949('0x34')](_0x336f1d['model'],qs['fields'](_0x594da2[_0x1949('0x31')][_0x1949('0x45')]));_0x578336[_0x1949('0x36')]=_0x578336[_0x1949('0x36')]['length']?_0x578336[_0x1949('0x36')]:_0x336f1d[_0x1949('0x35')];if(_0x594da2[_0x1949('0x31')]['includeAll']){_0x578336[_0x1949('0x42')]=[{'all':!![]}];}_0x578336=_[_0x1949('0x3f')]({},_0x578336,_0x594da2[_0x1949('0x40')]);return db['ChatWebsite'][_0x1949('0x46')](_0x578336)['then'](handleEntityNotFound(_0x2aca2d,null))[_0x1949('0x10')](respondWithResult(_0x2aca2d,null))[_0x1949('0x18')](handleError(_0x2aca2d,null));};exports['create']=function(_0x287827,_0x1e8e36){return db['ChatWebsite'][_0x1949('0x47')](_0x287827[_0x1949('0x48')],{})[_0x1949('0x10')](function(_0x151d0a){var _0x580423=_0x287827['user'][_0x1949('0x21')]({'plain':!![]});if(!_0x580423)throw new Error(_0x1949('0x49'));if(_0x580423['role']===_0x1949('0x4a')){var _0x3a4574=_0x151d0a['get']({'plain':!![]});var _0x112859=_0x1949('0x22');return db[_0x1949('0x4b')][_0x1949('0x46')]({'where':{'name':_0x112859,'userProfileId':_0x580423['userProfileId']},'raw':!![]})['then'](function(_0x1bb4ee){if(_0x1bb4ee&&_0x1bb4ee[_0x1949('0x4c')]===0x0){return db[_0x1949('0x23')]['create']({'name':_0x3a4574[_0x1949('0x27')],'resourceId':_0x3a4574['id'],'type':_0x1bb4ee[_0x1949('0x27')],'sectionId':_0x1bb4ee['id']},{})[_0x1949('0x10')](function(){return _0x151d0a;});}else{return _0x151d0a;}})[_0x1949('0x18')](function(_0x243fd6){logger[_0x1949('0x15')](_0x1949('0x4d'),_0x243fd6);throw _0x243fd6;});}return _0x151d0a;})[_0x1949('0x10')](respondWithResult(_0x1e8e36,0xc9))['catch'](handleError(_0x1e8e36,null));};exports[_0x1949('0x4e')]=function(_0x59c9b2,_0x58e958){if(_0x59c9b2[_0x1949('0x48')]['id']){delete _0x59c9b2[_0x1949('0x48')]['id'];}return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x59c9b2['params']['id']},'include':[{'model':db[_0x1949('0x2a')],'as':_0x1949('0x2b')}]})[_0x1949('0x10')](handleEntityNotFound(_0x58e958,null))[_0x1949('0x10')](saveUpdates(_0x59c9b2[_0x1949('0x48')],null))[_0x1949('0x10')](respondWithResult(_0x58e958,null))['catch'](handleError(_0x58e958,null));};exports[_0x1949('0x24')]=function(_0x3f26f4,_0x500a71){return db['ChatWebsite'][_0x1949('0x46')]({'where':{'id':_0x3f26f4[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x500a71,null))['then'](removeEntity(_0x500a71,null))['catch'](handleError(_0x500a71,null));};exports[_0x1949('0x50')]=function(_0x56017f,_0x46a51c){return db[_0x1949('0x2c')][_0x1949('0x50')]()['then'](respondWithResult(_0x46a51c,null))[_0x1949('0x18')](handleError(_0x46a51c,null));};exports[_0x1949('0x51')]=function(_0x43cdb8,_0x1e63c8){if(_0x43cdb8[_0x1949('0x48')]['id']){delete _0x43cdb8[_0x1949('0x48')]['id'];}return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x43cdb8['params']['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x1e63c8,null))['then'](function(_0x179266){if(_0x179266){_0x43cdb8[_0x1949('0x48')][_0x1949('0x52')]=_0x179266['id'];return db[_0x1949('0x53')][_0x1949('0x47')](_0x43cdb8[_0x1949('0x48')]);}})[_0x1949('0x10')](respondWithResult(_0x1e63c8,null))[_0x1949('0x18')](handleError(_0x1e63c8,null));};exports['getDispositions']=function(_0xdb1ab7,_0x12fc24){var _0x1f5522={'raw':![],'where':{}};var _0x2e71ec={};var _0x591646={'count':0x0,'rows':[]};return db[_0x1949('0x2c')][_0x1949('0x54')]({'where':{'id':_0xdb1ab7[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x12fc24,null))[_0x1949('0x10')](function(_0x52b8a1){if(_0x52b8a1){_0x2e71ec[_0x1949('0x35')]=_[_0x1949('0x32')](db[_0x1949('0x53')]['rawAttributes']);_0x2e71ec[_0x1949('0x31')]=_[_0x1949('0x32')](_0xdb1ab7[_0x1949('0x31')]);_0x2e71ec[_0x1949('0x33')]=_[_0x1949('0x34')](_0x2e71ec[_0x1949('0x35')],_0x2e71ec[_0x1949('0x31')]);_0x1f5522[_0x1949('0x36')]=_['intersection'](_0x2e71ec[_0x1949('0x35')],qs[_0x1949('0x45')](_0xdb1ab7['query'][_0x1949('0x45')]));_0x1f5522['attributes']=_0x1f5522['attributes'][_0x1949('0x37')]?_0x1f5522[_0x1949('0x36')]:_0x2e71ec[_0x1949('0x35')];if(!_0xdb1ab7[_0x1949('0x31')][_0x1949('0x38')](_0x1949('0x39'))){_0x1f5522[_0x1949('0x1d')]=qs[_0x1949('0x1d')](_0xdb1ab7['query'][_0x1949('0x1d')]);_0x1f5522['offset']=qs[_0x1949('0x1b')](_0xdb1ab7['query'][_0x1949('0x1b')]);}_0x1f5522['order']=qs[_0x1949('0x3b')](_0xdb1ab7[_0x1949('0x31')][_0x1949('0x3b')]);_0x1f5522[_0x1949('0x3c')]=qs[_0x1949('0x33')](_[_0x1949('0x3d')](_0xdb1ab7['query'],_0x2e71ec[_0x1949('0x33')]));_0x1f5522[_0x1949('0x3c')][_0x1949('0x52')]=_0x52b8a1['id'];if(_0xdb1ab7[_0x1949('0x31')][_0x1949('0x3e')]){_0x1f5522[_0x1949('0x3c')]=_[_0x1949('0x3f')](_0x1f5522[_0x1949('0x3c')],{'$or':_[_0x1949('0x30')](_0x1f5522[_0x1949('0x36')],function(_0x47d796){var _0x48441f={};_0x48441f[_0x47d796]={'$like':'%'+_0xdb1ab7[_0x1949('0x31')][_0x1949('0x3e')]+'%'};return _0x48441f;})});}_0x1f5522=_['merge']({},_0x1f5522,_0xdb1ab7[_0x1949('0x40')]);return db[_0x1949('0x53')][_0x1949('0x1e')]({'where':_0x1f5522['where']})[_0x1949('0x10')](function(_0x1a8235){_0x591646[_0x1949('0x1e')]=_0x1a8235;if(_0xdb1ab7['query']['includeAll']){_0x1f5522[_0x1949('0x42')]=[{'all':!![]}];}return db[_0x1949('0x53')][_0x1949('0x55')](_0x1f5522);})[_0x1949('0x10')](function(_0x539088){_0x591646['rows']=_0x539088;return _0x591646;});}})['then'](respondWithFilteredResult(_0x12fc24,_0x1f5522))[_0x1949('0x18')](handleError(_0x12fc24,null));};exports[_0x1949('0x56')]=function(_0x19095f,_0x5a47d5){return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x19095f[_0x1949('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5a47d5,null))[_0x1949('0x10')](function(_0x16cc8d){if(_0x16cc8d){return _0x16cc8d['removeDispositions'](_0x19095f[_0x1949('0x31')][_0x1949('0x57')]);}})[_0x1949('0x10')](respondWithStatusCode(_0x5a47d5,null))[_0x1949('0x18')](handleError(_0x5a47d5,null));};exports[_0x1949('0x58')]=function(_0xe1215,_0x5c29b7){if(_0xe1215[_0x1949('0x48')]['id']){delete _0xe1215['body']['id'];}return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0xe1215['params']['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x5c29b7,null))[_0x1949('0x10')](function(_0x770180){if(_0x770180){_0xe1215['body'][_0x1949('0x52')]=_0x770180['id'];return db['CannedAnswer'][_0x1949('0x47')](_0xe1215[_0x1949('0x48')]);}})[_0x1949('0x10')](respondWithResult(_0x5c29b7,null))[_0x1949('0x18')](handleError(_0x5c29b7,null));};exports[_0x1949('0x59')]=function(_0x42893c,_0x1d0321){var _0xfbdbd3={'raw':![],'where':{}};var _0x292a1e={};var _0x326d9f={'count':0x0,'rows':[]};return db[_0x1949('0x2c')]['findOne']({'where':{'id':_0x42893c['params']['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x1d0321,null))[_0x1949('0x10')](function(_0x16c2cf){if(_0x16c2cf){_0x292a1e[_0x1949('0x35')]=_[_0x1949('0x32')](db[_0x1949('0x5a')][_0x1949('0x2d')]);_0x292a1e[_0x1949('0x31')]=_[_0x1949('0x32')](_0x42893c['query']);_0x292a1e[_0x1949('0x33')]=_[_0x1949('0x34')](_0x292a1e[_0x1949('0x35')],_0x292a1e[_0x1949('0x31')]);_0xfbdbd3[_0x1949('0x36')]=_[_0x1949('0x34')](_0x292a1e[_0x1949('0x35')],qs[_0x1949('0x45')](_0x42893c[_0x1949('0x31')][_0x1949('0x45')]));_0xfbdbd3[_0x1949('0x36')]=_0xfbdbd3[_0x1949('0x36')][_0x1949('0x37')]?_0xfbdbd3[_0x1949('0x36')]:_0x292a1e[_0x1949('0x35')];if(!_0x42893c[_0x1949('0x31')]['hasOwnProperty'](_0x1949('0x39'))){_0xfbdbd3['limit']=qs[_0x1949('0x1d')](_0x42893c['query']['limit']);_0xfbdbd3[_0x1949('0x1b')]=qs[_0x1949('0x1b')](_0x42893c['query'][_0x1949('0x1b')]);}_0xfbdbd3[_0x1949('0x3a')]=qs[_0x1949('0x3b')](_0x42893c[_0x1949('0x31')][_0x1949('0x3b')]);_0xfbdbd3[_0x1949('0x3c')]=qs[_0x1949('0x33')](_[_0x1949('0x3d')](_0x42893c[_0x1949('0x31')],_0x292a1e[_0x1949('0x33')]));_0xfbdbd3[_0x1949('0x3c')][_0x1949('0x52')]=_0x16c2cf['id'];if(_0x42893c[_0x1949('0x31')][_0x1949('0x3e')]){_0xfbdbd3[_0x1949('0x3c')]=_[_0x1949('0x3f')](_0xfbdbd3[_0x1949('0x3c')],{'$or':_[_0x1949('0x30')](_0xfbdbd3['attributes'],function(_0x59cd9c){var _0x193ca2={};_0x193ca2[_0x59cd9c]={'$like':'%'+_0x42893c[_0x1949('0x31')][_0x1949('0x3e')]+'%'};return _0x193ca2;})});}_0xfbdbd3=_[_0x1949('0x3f')]({},_0xfbdbd3,_0x42893c[_0x1949('0x40')]);return db['CannedAnswer']['count']({'where':_0xfbdbd3[_0x1949('0x3c')]})[_0x1949('0x10')](function(_0x44a466){_0x326d9f[_0x1949('0x1e')]=_0x44a466;if(_0x42893c[_0x1949('0x31')]['includeAll']){_0xfbdbd3['include']=[{'all':!![]}];}return db[_0x1949('0x5a')]['findAll'](_0xfbdbd3);})['then'](function(_0x1af6e8){_0x326d9f['rows']=_0x1af6e8;return _0x326d9f;});}})[_0x1949('0x10')](respondWithFilteredResult(_0x1d0321,_0xfbdbd3))[_0x1949('0x18')](handleError(_0x1d0321,null));};exports[_0x1949('0x5b')]=function(_0x2c88ad,_0x52c99e){return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x2c88ad['params']['id']}})['then'](handleEntityNotFound(_0x52c99e,null))[_0x1949('0x10')](function(_0x129eec){if(_0x129eec){return _0x129eec[_0x1949('0x5b')](_0x2c88ad[_0x1949('0x31')][_0x1949('0x57')]);}})['then'](respondWithStatusCode(_0x52c99e,null))[_0x1949('0x18')](handleError(_0x52c99e,null));};exports[_0x1949('0x5c')]=function(_0xfe5c57,_0x3c1c64){_0xfe5c57[_0x1949('0x48')]['sitepic']=_0xfe5c57[_0x1949('0x5d')][_0x1949('0x5e')];return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0xfe5c57[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x3c1c64,null))['then'](saveUpdates(_0xfe5c57[_0x1949('0x48')],null))[_0x1949('0x10')](respondWithResult(_0x3c1c64,null))[_0x1949('0x18')](handleError(_0x3c1c64,null));};exports[_0x1949('0x5f')]=function(_0x5acb38,_0x4bb999){_0x5acb38['body'][_0x1949('0x60')]=_0x5acb38[_0x1949('0x5d')][_0x1949('0x5e')];return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x5acb38[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x4bb999,null))[_0x1949('0x10')](saveUpdates(_0x5acb38[_0x1949('0x48')],null))['then'](respondWithResult(_0x4bb999,null))['catch'](handleError(_0x4bb999,null));};exports[_0x1949('0x61')]=function(_0x1224bc,_0x57b69b){_0x1224bc[_0x1949('0x48')][_0x1949('0x62')]=_0x1224bc[_0x1949('0x5d')][_0x1949('0x5e')];return db['ChatWebsite'][_0x1949('0x46')]({'where':{'id':_0x1224bc[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x57b69b,null))[_0x1949('0x10')](saveUpdates(_0x1224bc['body'],null))['then'](respondWithResult(_0x57b69b,null))[_0x1949('0x18')](handleError(_0x57b69b,null));};exports[_0x1949('0x63')]=function(_0x255f34,_0xc7806a){_0x255f34[_0x1949('0x48')][_0x1949('0x64')]=_0x255f34[_0x1949('0x5d')]['filename'];return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x255f34['params']['id']}})['then'](handleEntityNotFound(_0xc7806a,null))['then'](saveUpdates(_0x255f34[_0x1949('0x48')],null))['then'](respondWithResult(_0xc7806a,null))[_0x1949('0x18')](handleError(_0xc7806a,null));};exports['getLogo']=function(_0x11ccce,_0x16c006){var _0x14a8e7=path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x67'));var _0x5bfd41={'where':{'id':_0x11ccce[_0x1949('0x4f')]['id']},'attributes':['id',_0x1949('0x68')],'raw':!![]};var _0x1d886a=![];return require(_0x1949('0x69'))[_0x1949('0x6a')]()[_0x1949('0x10')](function(_0x27bb7f){if(_0x27bb7f){_0x1d886a=_0x27bb7f[_0x1949('0x6b')];}})[_0x1949('0x10')](function(){return db['ChatWebsite'][_0x1949('0x46')](_0x5bfd41);})[_0x1949('0x10')](handleEntityNotFound(_0x16c006,null))[_0x1949('0x10')](function(_0x48be57){if(_0x48be57){if(!_[_0x1949('0x6c')](_0x48be57[_0x1949('0x68')])){if(fs['existsSync'](path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x6d'),_0x48be57[_0x1949('0x68')]))&&_0x1d886a){_0x14a8e7=path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x6d'),_0x48be57[_0x1949('0x68')]);}}return _0x16c006[_0x1949('0x6e')](_0x14a8e7);}})[_0x1949('0x18')](handleError(_0x16c006,null));};exports[_0x1949('0x6f')]=function(_0x6d361a,_0x2a700a){var _0x5225ff=path[_0x1949('0x65')](config['root'],_0x1949('0x70'));var _0x17cdb6={'where':{'id':_0x6d361a[_0x1949('0x4f')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x1949('0x2c')]['find'](_0x17cdb6)['then'](handleEntityNotFound(_0x2a700a,null))[_0x1949('0x10')](function(_0x4eec85){if(_0x4eec85){if(!_[_0x1949('0x6c')](_0x4eec85[_0x1949('0x60')])){if(fs['existsSync'](path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x71'),_0x4eec85[_0x1949('0x60')]))){_0x5225ff=path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x71'),_0x4eec85[_0x1949('0x60')]);}}return _0x2a700a[_0x1949('0x6e')](_0x5225ff);}})[_0x1949('0x18')](handleError(_0x2a700a,null));};exports['getCustomerAvatar']=function(_0x4421f2,_0x46faa6){var _0x98b533=path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x72'));var _0x310d83={'where':{'id':_0x4421f2[_0x1949('0x4f')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db['ChatWebsite'][_0x1949('0x46')](_0x310d83)['then'](handleEntityNotFound(_0x46faa6,null))[_0x1949('0x10')](function(_0x2044f9){if(_0x2044f9){if(!_[_0x1949('0x6c')](_0x2044f9[_0x1949('0x62')])){if(fs[_0x1949('0x73')](path[_0x1949('0x65')](config['root'],_0x1949('0x71'),_0x2044f9[_0x1949('0x62')]))&&_0x2044f9[_0x1949('0x74')]){_0x98b533=path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x71'),_0x2044f9[_0x1949('0x62')]);}}return _0x46faa6[_0x1949('0x6e')](_0x98b533);}})['catch'](handleError(_0x46faa6,null));};exports['getSystemAvatar']=function(_0x308e63,_0x4afb97){var _0x284499=path[_0x1949('0x65')](config[_0x1949('0x66')],'server/files/images/avatars/system_avatar.png');var _0x6ba0e5={'where':{'id':_0x308e63[_0x1949('0x4f')]['id']},'attributes':['id',_0x1949('0x64')],'raw':!![]};return db[_0x1949('0x2c')][_0x1949('0x46')](_0x6ba0e5)[_0x1949('0x10')](handleEntityNotFound(_0x4afb97,null))['then'](function(_0x1ed7c7){if(_0x1ed7c7){if(!_[_0x1949('0x6c')](_0x1ed7c7[_0x1949('0x64')])){if(fs[_0x1949('0x73')](path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x71'),_0x1ed7c7[_0x1949('0x64')]))){_0x284499=path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x71'),_0x1ed7c7[_0x1949('0x64')]);}}return _0x4afb97[_0x1949('0x6e')](_0x284499);}})['catch'](handleError(_0x4afb97,null));};exports[_0x1949('0x75')]=function(_0x248094,_0x390fa9){var _0x5dd60c=require(_0x1949('0x76'));var _0x2b8ece=new _0x5dd60c();var _0x534353=_0x2b8ece[_0x1949('0x77')](_0x248094[_0x1949('0x78')][_0x1949('0x79')])[_0x1949('0x7a')]();var _0x5894ac={'body':_0x248094[_0x1949('0x48')],'channel':_0x1949('0x7b')};var _0x2070ad=[];var _0x594189=[];var _0xd877ba={};var _0x2d39c8=![];return db[_0x1949('0x7c')][_0x1949('0x50')]()['then'](function(_0x25b28a){if(!_0x25b28a){throw new db[(_0x1949('0x7d'))]['ValidationError'](_0x1949('0x7e'));}_0x2070ad=_[_0x1949('0x7f')](_[_0x1949('0x32')](_0x25b28a),[_0x1949('0x80'),_0x1949('0x81')]);_0x594189=_[_0x1949('0x7f')](_['keys'](_0x25b28a),[_0x1949('0x80'),_0x1949('0x81'),_0x1949('0x82'),'ListId']);if(_0x248094[_0x1949('0x48')]['id']){delete _0x248094[_0x1949('0x48')]['id'];}if(_[_0x1949('0x6c')](_0x248094[_0x1949('0x48')][_0x1949('0x83')])){throw new db[(_0x1949('0x7d'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x1949('0x6c')](_0x248094[_0x1949('0x48')][_0x1949('0x48')])||_0x248094['body'][_0x1949('0x48')]===''){throw new db[(_0x1949('0x7d'))][(_0x1949('0x84'))](_0x1949('0x85'));}if(_[_0x1949('0x6c')](_0x248094[_0x1949('0x48')]['mapKey'])){throw new db[(_0x1949('0x7d'))][(_0x1949('0x84'))](_0x1949('0x86')+_0x594189);}if(!_[_0x1949('0x87')](_0x594189,_0x248094[_0x1949('0x48')][_0x1949('0x88')])){throw new db['Sequelize'][(_0x1949('0x84'))](_0x1949('0x89')+_0x594189);}_0xd877ba[_0x248094[_0x1949('0x48')]['mapKey']]=_0x248094['body']['from'];})[_0x1949('0x10')](function(){return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x248094[_0x1949('0x4f')]['id']},'include':[{'model':db[_0x1949('0x8a')],'as':_0x1949('0x8b'),'include':[{'model':db['CmContact'],'as':_0x1949('0x8c'),'where':_0xd877ba,'limit':0x1,'order':[['updatedAt',_0x1949('0x8d')]]}]},{'model':db[_0x1949('0x8e')],'as':_0x1949('0x8f')}]});})[_0x1949('0x10')](handleEntityNotFound(_0x390fa9,null))[_0x1949('0x10')](function(_0x376cff){if(_0x376cff&&_0x376cff[_0x1949('0x8b')]){_0x5894ac[_0x1949('0x90')]=_0x376cff;_0x5894ac[_0x1949('0x91')]=_0x376cff[_0x1949('0x8f')];_0x5894ac[_0x1949('0x92')]=_0x376cff[_0x1949('0x8b')];_0x5894ac[_0x1949('0x91')]=_[_0x1949('0x93')](_0x5894ac[_0x1949('0x91')],[_0x1949('0x94')],['asc']);if(_0x5894ac['account'][_0x1949('0x8f')]){delete _0x5894ac[_0x1949('0x90')][_0x1949('0x8f')];}if(_0x5894ac[_0x1949('0x90')][_0x1949('0x8b')]&&_0x5894ac[_0x1949('0x90')][_0x1949('0x8b')][_0x1949('0x8c')]['length']){return _0x5894ac[_0x1949('0x90')][_0x1949('0x8b')]['Contacts'][0x0];}var _0x1f4027=_[_0x1949('0x8')](_0x248094[_0x1949('0x48')],{'firstName':_0x248094[_0x1949('0x48')][_0x1949('0x83')],'ListId':_0x376cff[_0x1949('0x95')]});_0x1f4027[_0x248094[_0x1949('0x48')]['mapKey']]=_0x248094[_0x1949('0x48')][_0x1949('0x83')];return db[_0x1949('0x7c')][_0x1949('0x47')](_0x1f4027,{'fields':_0x2070ad,'raw':!![]});}})[_0x1949('0x10')](handleEntityNotFound(_0x390fa9,null))[_0x1949('0x10')](function(_0x15c3fc){_0x5894ac['contact']=_0x15c3fc;var _0x8e811=_0x248094['body'][_0x1949('0x96')];if(_0x248094['headers'][_0x1949('0x97')]){_0x8e811=_0x248094[_0x1949('0x78')][_0x1949('0x97')];}else if(_0x248094['headers'][_0x1949('0x98')]){_0x8e811=_[_0x1949('0x99')](_0x248094['headers'][_0x1949('0x98')][_0x1949('0x9a')](','));}if(_0x15c3fc){var _0x4923ee={'ContactId':_0x15c3fc['id'],'ChatWebsiteId':_0x248094[_0x1949('0x4f')]['id'],'from':(_0x15c3fc[_0x1949('0x9b')]||'')+'\x20'+(_0x15c3fc[_0x1949('0x9c')]||''),'customerIp':_0x8e811,'customerPort':_0x248094[_0x1949('0x78')][_0x1949('0x9d')]?_0x248094[_0x1949('0x78')][_0x1949('0x9d')]:null,'referer':_0x248094[_0x1949('0x48')]['referer'],'browserName':_0x534353['browser'][_0x1949('0x27')]&&_0x534353[_0x1949('0x9e')]['version']?util['format'](_0x1949('0x9f'),_0x534353[_0x1949('0x9e')][_0x1949('0x27')],_0x534353[_0x1949('0x9e')][_0x1949('0xa0')]):_0x1949('0xa1'),'browserVersion':_0x534353['browser']['version']||_0x1949('0xa1'),'osName':util[_0x1949('0xa2')](_0x1949('0x9f'),_0x534353['os'][_0x1949('0x27')],_0x534353['os'][_0x1949('0xa0')]),'osVersion':_0x534353['os'][_0x1949('0xa0')],'deviceModel':_0x534353['device'][_0x1949('0x35')]&&_0x534353[_0x1949('0xa3')][_0x1949('0xa4')]?util[_0x1949('0xa2')](_0x1949('0xa5'),_0x534353[_0x1949('0xa3')]['model'],_0x534353[_0x1949('0xa3')][_0x1949('0xa4')],_0x534353[_0x1949('0xa3')][_0x1949('0x2f')]):null,'deviceVendor':_0x534353[_0x1949('0xa3')][_0x1949('0xa4')],'deviceType':_0x534353[_0x1949('0xa3')]['type'],'formData':JSON[_0x1949('0xa6')](_0x248094[_0x1949('0x48')])};var _0x580ba3={'ChatWebsiteId':_0x248094['params']['id'],'closed':![]};if(_0x248094['body']['threadId']){_0x580ba3['threadId']=_0x248094[_0x1949('0x48')]['threadId'];return db[_0x1949('0xa7')]['find']({'where':_0x580ba3})['then'](function(_0x185e94){if(_0x185e94){return[_0x185e94,![]];}_0x4923ee[_0x1949('0xa8')]=_0x248094[_0x1949('0x48')][_0x1949('0xa8')];_0x4923ee[_0x1949('0xa9')]=_0x248094[_0x1949('0x48')][_0x1949('0xa9')];return db[_0x1949('0xa7')][_0x1949('0x47')](_0x4923ee)['then'](function(_0x141205){return[_0x141205,!![]];});});}_0x580ba3['ContactId']=_0x15c3fc['id'];if(_0x248094['body'][_0x1949('0xaa')]&&_0x248094[_0x1949('0x48')][_0x1949('0xaa')]['id']){_0x580ba3['id']=_0x248094[_0x1949('0x48')][_0x1949('0xaa')]['id'];return db['ChatInteraction'][_0x1949('0x46')]({'where':_0x580ba3})[_0x1949('0x10')](function(_0x314fcb){if(_0x314fcb){return[_0x314fcb,![]];}return db[_0x1949('0xa7')]['create'](_0x4923ee)['then'](function(_0x5f3c8a){return[_0x5f3c8a,!![]];});});}return db[_0x1949('0xa7')][_0x1949('0x47')](_0x4923ee)[_0x1949('0x10')](function(_0x41aaf5){return[_0x41aaf5,!![]];});}})['spread'](function(_0xcadda5,_0x51a5ff){if(_0xcadda5){_0x2d39c8=_0x51a5ff;if(!_0x51a5ff){var _0x24197f={'from':(_0x5894ac[_0x1949('0xab')][_0x1949('0x9b')]||'')+'\x20'+(_0x5894ac['contact'][_0x1949('0x9c')]||'')};if(_0x248094['body']['threadId']&&_0x248094[_0x1949('0x48')][_0x1949('0xac')]&&_0x248094['body']['threadId']!=_0x248094[_0x1949('0x48')]['messageId']){_0x24197f[_0x1949('0xa8')]=_0x248094['body']['messageId'];}return _0xcadda5['update'](_0x24197f);}else{return _0xcadda5;}}})[_0x1949('0x10')](function(_0x140699){_0x5894ac[_0x1949('0xaa')]=_0x140699['get']({'plain':!![]});_0x5894ac['interaction'][_0x1949('0xad')]=_0x2d39c8;if(_0x5894ac['interaction'][_0x1949('0xad')]){if(_0x5894ac['account'][_0x1949('0xae')]){_0x5894ac[_0x1949('0x91')]['push']({'id':0x0,'priority':_0x5894ac['applications'][_0x1949('0x37')]+0x1,'app':_0x1949('0xaf'),'appdata':_0x1949('0xb0'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x1949('0x47')]({'body':_0x248094[_0x1949('0x48')][_0x1949('0x48')],'ChatWebsiteId':_0x248094[_0x1949('0x4f')]['id'],'ChatInteractionId':_0x140699['id'],'direction':'in','ContactId':_0x5894ac[_0x1949('0xab')]['id'],'AttachmentId':_0x248094[_0x1949('0x48')][_0x1949('0xb1')]});})['then'](function(_0x4c6307){_0x5894ac[_0x1949('0x16')]=_0x4c6307;if(_0x5894ac[_0x1949('0xaa')][_0x1949('0xb2')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x5894ac[_0x1949('0xaa')][_0x1949('0xb2')]}})[_0x1949('0x10')](function(_0x204751){if(_0x204751){_0x5894ac[_0x1949('0x91')][_0x1949('0xb3')]({'id':0x0,'priority':0x0,'app':_0x1949('0xb4'),'appdata':_0x204751[_0x1949('0x27')]+','+(_0x5894ac[_0x1949('0x90')][_0x1949('0xb5')]||0xa),'interval':_0x1949('0xb6')});_0x5894ac[_0x1949('0xb7')]=!![];}return respondWithRpcPromise(_0x1949('0xb8'),_0x1949('0xb9'),_0x5894ac);});}return respondWithRpcPromise(_0x1949('0xb8'),_0x1949('0xb9'),_0x5894ac);})['then'](function(_0x29aab7){respondWithRpcPromise(_0x1949('0xba'),_0x1949('0xba'),{'event':'notify','message':_0x29aab7},client9002);return _0x29aab7;})[_0x1949('0x10')](respondWithResult(_0x390fa9,null))[_0x1949('0x18')](handleError(_0x390fa9,null));};exports[_0x1949('0xbb')]=function(_0x3dfbbb,_0x3caba6){var _0x348efd,_0x3a340d,_0x3ed7d8;var _0x4328c7=[];var _0x422a3c={};var _0x35c2fd=_0x3dfbbb[_0x1949('0xbc')]||[];var _0x2403a2=[];var _0x25c785;return db[_0x1949('0x7c')][_0x1949('0x50')]()[_0x1949('0x10')](function(_0xc97eb5){if(!_0xc97eb5){throw new db[(_0x1949('0x7d'))]['ValidationError'](_0x1949('0x7e'));}_0x4328c7=_[_0x1949('0x7f')](_[_0x1949('0x32')](_0xc97eb5),[_0x1949('0x80'),_0x1949('0x81'),_0x1949('0x82'),'ListId']);if(_0x3dfbbb['body']['id']){delete _0x3dfbbb[_0x1949('0x48')]['id'];}if(_[_0x1949('0x6c')](_0x3dfbbb['body'][_0x1949('0x83')])){throw _0x3caba6[_0x1949('0x19')](0x1f4)[_0x1949('0x28')](new db['Sequelize'][(_0x1949('0x84'))](_0x1949('0xbd')));}if(_[_0x1949('0x6c')](_0x3dfbbb['body'][_0x1949('0x48')])||_0x3dfbbb[_0x1949('0x48')][_0x1949('0x48')]===''){throw _0x3caba6[_0x1949('0x19')](0x1f4)['send'](new db[(_0x1949('0x7d'))][(_0x1949('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x3dfbbb['body'][_0x1949('0xbe')])){throw _0x3caba6[_0x1949('0x19')](0x1f4)['send'](new db[(_0x1949('0x7d'))]['ValidationError'](_0x1949('0xbf')+_0x4328c7));}if(!_[_0x1949('0x87')](_0x4328c7,_0x3dfbbb[_0x1949('0x48')][_0x1949('0xbe')])){throw _0x3caba6[_0x1949('0x19')](0x1f4)[_0x1949('0x28')](new db[(_0x1949('0x7d'))][(_0x1949('0x84'))](_0x1949('0xc0')+_0x4328c7));}_0x422a3c[_0x3dfbbb[_0x1949('0x48')]['mapKeyOffline']]=_0x3dfbbb[_0x1949('0x48')]['from'];})[_0x1949('0x10')](function(){return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x3dfbbb[_0x1949('0x4f')]['id']},'include':[{'model':db[_0x1949('0x8a')],'as':_0x1949('0x8b')},{'model':db[_0x1949('0xc1')],'as':_0x1949('0xc1')}]});})[_0x1949('0x10')](handleEntityNotFound(_0x3caba6,null))[_0x1949('0x10')](function(_0x2dfe43){if(_0x2dfe43&&_0x2dfe43[_0x1949('0x8b')]){_0x3a340d=_0x2dfe43;var _0x2a49ec=_['defaults'](_0x3dfbbb[_0x1949('0x48')],{'firstName':_0x3dfbbb[_0x1949('0x48')][_0x1949('0x83')],'phone':_0x3dfbbb[_0x1949('0x48')][_0x1949('0x83')],'ListId':_0x2dfe43[_0x1949('0x95')]});_0x2a49ec[_0x3dfbbb[_0x1949('0x48')][_0x1949('0xbe')]]=_0x3dfbbb[_0x1949('0x48')][_0x1949('0x83')];return db[_0x1949('0x7c')][_0x1949('0xc2')]({'where':_0x422a3c,'defaults':_0x2a49ec});}})[_0x1949('0xc3')](function(_0x34cd5f){if(_0x34cd5f){_0x3ed7d8=_0x34cd5f;var _0x7aa982=fs['readFileSync'](path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0xc4')),_0x1949('0xc5'));var _0x2d49d9=ejs['render'](_0x7aa982,{'body':_['toPairs'](_0x3dfbbb[_0x1949('0x48')][_0x1949('0x48')]),'bodyTitle':_0x3a340d['offlineMessageBody']});return db[_0x1949('0xc6')]['create']({'body':_0x2d49d9,'plainBody':htmlToText[_0x1949('0xc7')](_0x2d49d9),'ContactId':_0x34cd5f['id'],'ChatWebsiteId':_0x3a340d['id']});}})[_0x1949('0x10')](function(_0x2b5930){_0x25c785=_0x2b5930;if(_0x35c2fd[_0x1949('0x37')]){var _0x815083=_0x35c2fd[_0x1949('0x30')](function(_0x3ab0b3){return{'name':_0x3ab0b3[_0x1949('0xc8')],'basename':_0x3ab0b3[_0x1949('0x5e')],'type':_0x3ab0b3[_0x1949('0xc9')],'ChatOfflineMessageId':_0x2b5930['id']};});_0x2403a2=_0x815083[_0x1949('0x30')](_0xcd49a6=>{var _0x17cb7f={'filename':_0xcd49a6[_0x1949('0x27')],'path':path[_0x1949('0x65')](config[_0x1949('0x66')],'server',_0x1949('0xbc'),_0x1949('0xca'),_0x1949('0xcb'),_0xcd49a6[_0x1949('0xcc')])};return _0x17cb7f;});if(!_0x3a340d[_0x1949('0xcd')]){return db[_0x1949('0xce')][_0x1949('0xcf')](function(_0x48f349){return db[_0x1949('0xd0')]['bulkCreate'](_0x815083,{'transaction':_0x48f349});});}}})[_0x1949('0x10')](function(){if(_0x25c785){_0x348efd=_0x25c785;return db[_0x1949('0xc1')][_0x1949('0x54')]({'where':{'service':!![]},'include':[{'model':db[_0x1949('0xd1')],'as':_0x1949('0xd2'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x1949('0xd3'),'raw':!![]}]}]});}})[_0x1949('0x10')](function(_0x2177de){if(_0x2177de&&_0x2177de[_0x1949('0xd2')]&&_0x3a340d[_0x1949('0xd4')]&&_0x3a340d[_0x1949('0xd5')]){var _0x225935=_0x2177de[_0x1949('0xd6')]();return respondWithRpcPromise(_0x1949('0xd7'),_0x1949('0xd8'),{'account':_0x225935,'message':{'from':util[_0x1949('0xa2')]('\x22%s\x22\x20<%s>',_0x2177de[_0x1949('0x27')],_0x2177de['email']||_0x2177de[_0x1949('0xd2')][_0x1949('0x4a')]),'to':_0x3a340d['forwardOfflineAddress'],'subject':_0x3a340d[_0x1949('0xd9')],'html':_0x348efd['body'],'attachments':_0x2403a2}},client9003)[_0x1949('0x10')](function(){return _0x348efd;})[_0x1949('0x18')](function(_0x1514b0){logger[_0x1949('0x15')](_0x1514b0);});}})[_0x1949('0x10')](function(){if(_0x3a340d&&_0x3a340d[_0x1949('0xcd')]&&_0x3a340d[_0x1949('0xda')]){var _0xffb006=[];if(_0x35c2fd[_0x1949('0x37')]){_0xffb006=_0x35c2fd[_0x1949('0x30')](function(_0x58530b){return{'name':_0x58530b[_0x1949('0xc8')],'basename':_0x58530b['filename'],'type':_0x58530b[_0x1949('0xc9')],'ChatOfflineMessageId':_0x25c785['id']};});}var _0x495ac7;if(!_[_0x1949('0x6c')](_0x3a340d[_0x1949('0xdb')])){var _0x13ee18=_[_0x1949('0x30')](_0x3dfbbb[_0x1949('0x48')],function(_0x3c9ebe){return _0x3c9ebe;});var _0x224895=_['toPairsIn'](_0x13ee18)[0x0];var _0x3dac27=_[_0x1949('0xdc')](_0x224895,function(_0x3780a6){return _0x3780a6;});_0x495ac7=_0x3dac27[0x1][_0x3a340d['subjectOffline']];}var _0xb39e16={'from':_0x3ed7d8[_0x1949('0xdd')],'firstName':_0x3ed7d8[_0x1949('0x9b')],'lastName':_0x3ed7d8[_0x1949('0x9c')],'mapKey':_0x1949('0xdd'),'message':{'from':_0x3ed7d8[_0x1949('0xdd')],'to':_0x3a340d[_0x1949('0xc1')][_0x1949('0xdd')],'cc':'','subject':_[_0x1949('0x6c')](_0x495ac7)?_0x3a340d[_0x1949('0xd9')]:_0x495ac7,'messageId':'','sentAt':new Date(),'attach':_0xffb006[_0x1949('0x37')],'attachments':_0xffb006,'originChannel':_0x1949('0xde'),'ChatWebsiteId':_0x3a340d['id'],'ChatOfflineMessageId':_0x348efd['id'],'originTo':_0x3a340d[_0x1949('0xc1')][_0x1949('0xdd')]},'body':_0x348efd[_0x1949('0x48')]};var _0x146324={'account':{'id':_0x3a340d['MailAccountId']},'body':_0xb39e16,'log':_0x1949('0xdf')};return respondWithRpcPromise(_0x1949('0xdf'),_0x1949('0xe0'),_0x146324,client9001)[_0x1949('0x10')](function(){return _0x348efd;})[_0x1949('0x18')](function(_0x36e5d2){logger[_0x1949('0x15')](_0x36e5d2);});}return;})[_0x1949('0x10')](function(){if(_0x348efd){return _0x348efd;}})['then'](respondWithResult(_0x3caba6,null))[_0x1949('0x18')](function(_0x237c66){logger['error'](_0x1949('0x18'),_0x237c66);for(var _0xa4216a of _0x35c2fd){var _0x4095d3=path[_0x1949('0x65')](config['root'],_0x1949('0xe1'),'files',_0x1949('0xca'),'offline-chat',_0xa4216a[_0x1949('0x5e')]);fs_extra[_0x1949('0xe2')](_0x4095d3)[_0x1949('0x18')](function(_0x412a41){logger['error'](_0x1949('0xe3'),_0x4095d3,_0x412a41);});}});};exports[_0x1949('0xe4')]=function(_0xc58587,_0x491cb0){return db[_0x1949('0xa7')][_0x1949('0x46')]({'where':{'id':_0xc58587[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x491cb0,null))[_0x1949('0x10')](function(_0x21aeab){if(_0x21aeab){return _0x21aeab[_0x1949('0xe4')](_0xc58587[_0x1949('0x48')][_0x1949('0x57')],_[_0x1949('0xe5')](_0xc58587[_0x1949('0x48')],['ids','id'])||{});}})[_0x1949('0x10')](respondWithResult(_0x491cb0,null))[_0x1949('0x18')](handleError(_0x491cb0,null));};exports[_0x1949('0xe6')]=function(_0x17301e,_0x2811b2){var _0x142498={'raw':![],'where':{}};var _0x2ffdef={};var _0x39b1ba={'count':0x0,'rows':[]};return db[_0x1949('0x2c')][_0x1949('0x54')]({'where':{'id':_0x17301e[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x2811b2,null))[_0x1949('0x10')](function(_0x23db84){if(_0x23db84){_0x2ffdef['model']=_[_0x1949('0x32')](db[_0x1949('0xa7')]['rawAttributes']);_0x2ffdef['query']=_[_0x1949('0x32')](_0x17301e[_0x1949('0x31')]);_0x2ffdef[_0x1949('0x33')]=_[_0x1949('0x34')](_0x2ffdef[_0x1949('0x35')],_0x2ffdef['query']);_0x142498[_0x1949('0x36')]=_['intersection'](_0x2ffdef[_0x1949('0x35')],qs[_0x1949('0x45')](_0x17301e[_0x1949('0x31')][_0x1949('0x45')]));_0x142498[_0x1949('0x36')]=_0x142498['attributes'][_0x1949('0x37')]?_0x142498['attributes']:_0x2ffdef[_0x1949('0x35')];if(!_0x17301e[_0x1949('0x31')]['hasOwnProperty']('nolimit')){_0x142498['limit']=qs[_0x1949('0x1d')](_0x17301e[_0x1949('0x31')][_0x1949('0x1d')]);_0x142498[_0x1949('0x1b')]=qs[_0x1949('0x1b')](_0x17301e[_0x1949('0x31')][_0x1949('0x1b')]);}_0x142498[_0x1949('0x3a')]=qs[_0x1949('0x3b')](_0x17301e[_0x1949('0x31')][_0x1949('0x3b')]);_0x142498[_0x1949('0x3c')]=qs[_0x1949('0x33')](_[_0x1949('0x3d')](_0x17301e[_0x1949('0x31')],_0x2ffdef[_0x1949('0x33')]));_0x142498[_0x1949('0x3c')][_0x1949('0x52')]=_0x23db84['id'];if(_0x17301e[_0x1949('0x31')]['filter']){_0x142498[_0x1949('0x3c')]=_[_0x1949('0x3f')](_0x142498[_0x1949('0x3c')],{'$or':_['map'](_0x142498[_0x1949('0x36')],function(_0x3f103f){var _0x5bb44a={};_0x5bb44a[_0x3f103f]={'$like':'%'+_0x17301e[_0x1949('0x31')][_0x1949('0x3e')]+'%'};return _0x5bb44a;})});}_0x142498=_[_0x1949('0x3f')]({},_0x142498,_0x17301e[_0x1949('0x40')]);return db[_0x1949('0xa7')]['count']({'where':_0x142498[_0x1949('0x3c')]})[_0x1949('0x10')](function(_0x43c837){_0x39b1ba[_0x1949('0x1e')]=_0x43c837;if(_0x17301e[_0x1949('0x31')]['includeAll']){_0x142498['include']=[{'model':db['CmContact'],'as':_0x1949('0xe7'),'required':![]},{'model':db[_0x1949('0xe8')],'as':'Owner','attributes':[_0x1949('0x27'),_0x1949('0xe9'),_0x1949('0xea')],'required':![]},{'model':db[_0x1949('0xeb')],'as':_0x1949('0xec'),'attributes':['id',_0x1949('0x27'),_0x1949('0xed')],'where':_0x17301e[_0x1949('0x31')][_0x1949('0xee')]?{'id':_0x17301e[_0x1949('0x31')]['tag']}:undefined,'required':_0x17301e['query'][_0x1949('0xee')]?!![]:![]}];}return db[_0x1949('0xa7')][_0x1949('0x55')](_0x142498);})[_0x1949('0x10')](function(_0x211eb3){_0x39b1ba['rows']=_0x211eb3;return _0x39b1ba;});}})[_0x1949('0x10')](respondWithFilteredResult(_0x2811b2,_0x142498))['catch'](handleError(_0x2811b2,null));};function iftimePromise(_0x4f7a2f,_0x58c7d5){return respondWithRpcPromise(_0x1949('0xef'),_0x1949('0xf0'),{'command':_0x58c7d5[_0x1949('0xf1')]?util[_0x1949('0xa2')]('iftime\x20%s,%s',_0x4f7a2f[_0x1949('0xf2')],_0x58c7d5['timezone']):util['format']('iftime\x20%s',_0x4f7a2f[_0x1949('0xf2')])},client9002)[_0x1949('0x10')](function(_0x45962b){var _0x51bb29=_0x45962b&&_0x45962b[_0x1949('0xf3')](_0x1949('0xf4'))>=0x0?!![]:![];logger[_0x1949('0x11')](_0x1949('0xf5'),_0x58c7d5['id'],_0x4f7a2f['id'],_0x4f7a2f[_0x1949('0xf2')],_0x51bb29?_0x1949('0xf6'):'OFFLINE',_0x58c7d5['timezone']?_0x58c7d5[_0x1949('0xf1')]:_0x1949('0xf7'));return _0x51bb29;})['catch'](function(_0x5af76f){logger[_0x1949('0x15')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x58c7d5['id'],_0x4f7a2f['id'],_0x4f7a2f[_0x1949('0xf2')],util[_0x1949('0xf8')](_0x5af76f,{'showHidden':![],'depth':null}),_0x58c7d5[_0x1949('0xf1')]?_0x58c7d5[_0x1949('0xf1')]:_0x1949('0xf7'));return![];});}exports['getSnippet']=function(_0x6087b2,_0x1b00c2){var _0xa464bd=0x0;var _0x349f84=0x0;var _0x24cd35=![];var _0x36943c;var _0x1cdd5d;return db[_0x1949('0x2c')]['find']({'where':{'id':_0x6087b2[_0x1949('0x4f')]['id']},'include':[{'model':db['Interval'],'as':_0x1949('0xf9'),'include':[{'model':db[_0x1949('0xf9')],'as':_0x1949('0xfa'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x1949('0x10')](handleEntityNotFound(_0x1b00c2,null))[_0x1949('0x10')](function(_0x35eaa2){if(_0x35eaa2){_0x36943c=_0x35eaa2;return _0x35eaa2[_0x1949('0xfb')]({'raw':!![]});}})[_0x1949('0x10')](function(_0x49e59a){if(_0x36943c){if(_0x49e59a){_0x1cdd5d=_0x49e59a;}}return require(_0x1949('0x69'))['getLicense']();})['then'](function(_0x32ca1d){if(_0x32ca1d){_0x349f84=_0x32ca1d[_0x1949('0xfc')];_0x24cd35=_0x32ca1d[_0x1949('0x6b')];}})[_0x1949('0x10')](function(){return db[_0x1949('0xa7')][_0x1949('0x1e')]({'where':{'closed':![]}});})[_0x1949('0x10')](function(_0x1f192e){_0xa464bd=_0x1f192e;if(_0x349f84&&_0x1f192e>_0x349f84){return db[_0x1949('0xfd')]['findOne']({'where':{'id':0x1}})[_0x1949('0x10')](function(_0xbd83c6){if(_0xbd83c6){_0xbd83c6[_0x1949('0xfe')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x36943c['Interval']&&_0x36943c[_0x1949('0xf9')][_0x1949('0xfa')]){var _0xa85283=[];for(var _0x4d70d9=0x0;_0x4d70d9<_0x36943c[_0x1949('0xf9')][_0x1949('0xfa')][_0x1949('0x37')];_0x4d70d9++){var _0x19bf67=_0x36943c[_0x1949('0xf9')]['Intervals'][_0x4d70d9][_0x1949('0x21')]({'plain':!![]});_0xa85283[_0x1949('0xff')](iftimePromise(_0x19bf67,_0x36943c));}return BPromise[_0x1949('0x100')](_0xa85283)['then'](function(_0x37331b){return _[_0x1949('0x101')](_0x37331b);});}else{return!![];}})[_0x1949('0x10')](function(_0x419962){var _0x27d3aa=fs['readFileSync'](path[_0x1949('0x65')](config[_0x1949('0x66')],_0x1949('0x102')),_0x1949('0xc5'));var _0x1b85ca={'remote':_0x36943c['remote'],'query':querystring[_0x1949('0xa6')](_[_0x1949('0x3f')](_0x36943c[_0x1949('0x21')]({'plain':!![]}),{'customerIp':_0x6087b2[_0x1949('0x78')][_0x1949('0x98')]||_0x6087b2['headers']['x-real-ip']||_0x6087b2[_0x1949('0x103')][_0x1949('0x104')]||_0x6087b2['ip'],'referer':_0x6087b2[_0x1949('0x78')][_0x1949('0x105')],'openedInteractions':_0xa464bd,'maxInteractions':_0x349f84,'virtual':_0x24cd35[_0x1949('0xfc')],'online':_0x419962,'custom':_0x24cd35}))['replace'](/'/g,'\x5c\x27')};_0x1b00c2['send'](ejs[_0x1949('0x106')](Mustache[_0x1949('0x106')](_0x27d3aa,_0x1b85ca),{'proactiveActions':_0x1cdd5d,'alignment':_0x36943c['alignment'],'verticalAlignment':_0x36943c[_0x1949('0x107')],'div_color':_0x36943c[_0x1949('0xed')],'labelText':_0x36943c['labelText'],'text_color':_0x36943c[_0x1949('0x108')],'text_button_color':_0x36943c[_0x1949('0x109')],'button_color':_0x36943c[_0x1949('0x10a')],'background_color':_0x36943c[_0x1949('0x10b')],'hideWhenOffline':_0x36943c['hideWhenOffline'],'interval':_0x36943c[_0x1949('0x10c')]}));})[_0x1949('0x18')](handleError(_0x1b00c2,null));};exports[_0x1949('0x10d')]=function(_0x457803,_0x317425){var _0x4765b3=_0x457803[_0x1949('0x4f')]['id'];var _0x5f23e1=_0x457803[_0x1949('0x48')];var _0x37dd6d=0xc8;var _0x268ef0=null;return db[_0x1949('0xce')][_0x1949('0xcf')]({'isolationLevel':db[_0x1949('0xce')]['Transaction'][_0x1949('0x10e')][_0x1949('0x10f')]},function(_0x5dc1aa){return db[_0x1949('0x2c')][_0x1949('0x54')]({'where':{'id':_0x4765b3},'transaction':_0x5dc1aa})[_0x1949('0x10')](function(_0x47d602){if(_0x47d602){return db[_0x1949('0x8e')][_0x1949('0x24')]({'where':{'ChatWebsiteId':_0x4765b3},'transaction':_0x5dc1aa})[_0x1949('0x10')](function(){var _0x3b7e1b=_['map'](_0x5f23e1,function(_0xfe71d9){_0xfe71d9[_0x1949('0x52')]=_0x4765b3;return _0xfe71d9;});return db[_0x1949('0x8e')][_0x1949('0x110')](_0x3b7e1b,{'transaction':_0x5dc1aa});});}else{_0x37dd6d=0x194;_0x268ef0=[];}});})[_0x1949('0x10')](function(){if(_0x37dd6d!==0x194){return db[_0x1949('0x8e')][_0x1949('0x111')]({'where':{'ChatWebsiteId':_0x4765b3},'order':_0x1949('0x94')})[_0x1949('0x10')](function(_0xa50a39){_0x268ef0=_0xa50a39;});}})[_0x1949('0x18')](function(_0x115d56){_0x37dd6d=0x1f4;logger[_0x1949('0x15')](_0x115d56[_0x1949('0x26')]);if(_0x115d56[_0x1949('0x27')]){delete _0x115d56['name'];}_0x268ef0=_0x115d56;})[_0x1949('0x112')](function(){if(_0x268ef0===null){_0x317425[_0x1949('0x25')](_0x37dd6d);}else{if(_0x37dd6d===0x1f4){_0x317425[_0x1949('0x19')](_0x37dd6d)[_0x1949('0x28')](_0x268ef0);}else{_0x317425[_0x1949('0x19')](_0x37dd6d)[_0x1949('0x20')](_0x268ef0);}}});};exports['getApplications']=function(_0x557e23,_0x5b08c3){var _0xf6272a={};var _0x4cd188={};var _0x5c3c0e;var _0xe9d5e7;return db['ChatWebsite'][_0x1949('0x54')]({'where':{'id':_0x557e23[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x5b08c3,null))['then'](function(_0x5064e6){if(_0x5064e6){_0x5c3c0e=_0x5064e6;_0x4cd188[_0x1949('0x35')]=_[_0x1949('0x32')](db[_0x1949('0x8e')][_0x1949('0x2d')]);_0x4cd188['query']=_[_0x1949('0x32')](_0x557e23[_0x1949('0x31')]);_0x4cd188[_0x1949('0x33')]=_[_0x1949('0x34')](_0x4cd188[_0x1949('0x35')],_0x4cd188[_0x1949('0x31')]);_0xf6272a[_0x1949('0x36')]=_['intersection'](_0x4cd188['model'],qs[_0x1949('0x45')](_0x557e23['query'][_0x1949('0x45')]));_0xf6272a['attributes']=_0xf6272a[_0x1949('0x36')]['length']?_0xf6272a['attributes']:_0x4cd188['model'];_0xf6272a[_0x1949('0x3a')]=qs[_0x1949('0x3b')](_0x557e23[_0x1949('0x31')]['sort']);_0xf6272a[_0x1949('0x3c')]=qs[_0x1949('0x33')](_['pick'](_0x557e23[_0x1949('0x31')],_0x4cd188['filters']));if(_0x557e23['query'][_0x1949('0x3e')]){_0xf6272a[_0x1949('0x3c')]=_[_0x1949('0x3f')](_0xf6272a[_0x1949('0x3c')],{'$or':_['map'](_0xf6272a[_0x1949('0x36')],function(_0x4fdd2c){var _0x97faff={};_0x97faff[_0x4fdd2c]={'$like':'%'+_0x557e23[_0x1949('0x31')]['filter']+'%'};return _0x97faff;})});}_0xf6272a=_[_0x1949('0x3f')]({},_0xf6272a,_0x557e23[_0x1949('0x40')]);return _0x5c3c0e[_0x1949('0x113')](_0xf6272a);}})[_0x1949('0x10')](function(_0x207d66){if(_0x207d66){_0xe9d5e7=_0x207d66[_0x1949('0x37')];if(!_0x557e23[_0x1949('0x31')][_0x1949('0x38')]('nolimit')){_0xf6272a['limit']=qs['limit'](_0x557e23[_0x1949('0x31')][_0x1949('0x1d')]);_0xf6272a[_0x1949('0x1b')]=qs[_0x1949('0x1b')](_0x557e23[_0x1949('0x31')][_0x1949('0x1b')]);}return _0x5c3c0e[_0x1949('0x113')](_0xf6272a);}})[_0x1949('0x10')](function(_0x378ddc){if(_0x378ddc){return _0x378ddc?{'count':_0xe9d5e7,'rows':_0x378ddc}:null;}})[_0x1949('0x10')](respondWithResult(_0x5b08c3,null))[_0x1949('0x18')](handleError(_0x5b08c3,null));};exports[_0x1949('0x114')]=function(_0x495e48,_0x11b7d6){return db[_0x1949('0x115')]['find']({'where':{'id':_0x495e48['params']['id']}})['then'](handleEntityNotFound(_0x11b7d6,null))[_0x1949('0x10')](function(_0x46313c){if(_0x46313c){return _0x46313c[_0x1949('0x114')](_0x495e48[_0x1949('0x48')]['ids'],_[_0x1949('0xe5')](_0x495e48['body'],[_0x1949('0x57'),'id'])||{});}})[_0x1949('0x10')](respondWithResult(_0x11b7d6,null))[_0x1949('0x18')](handleError(_0x11b7d6,null));};exports[_0x1949('0xfb')]=function(_0x5ed0a7,_0x5d5073){var _0x4996f9={};var _0x3978ad={};var _0x3ef4c4;var _0x118d45;return db[_0x1949('0x2c')][_0x1949('0x54')]({'where':{'id':_0x5ed0a7['params']['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x5d5073,null))[_0x1949('0x10')](function(_0x43684a){if(_0x43684a){_0x3ef4c4=_0x43684a;_0x3978ad[_0x1949('0x35')]=_[_0x1949('0x32')](db[_0x1949('0x116')][_0x1949('0x2d')]);_0x3978ad[_0x1949('0x31')]=_['keys'](_0x5ed0a7[_0x1949('0x31')]);_0x3978ad[_0x1949('0x33')]=_[_0x1949('0x34')](_0x3978ad[_0x1949('0x35')],_0x3978ad[_0x1949('0x31')]);_0x4996f9[_0x1949('0x36')]=_[_0x1949('0x34')](_0x3978ad[_0x1949('0x35')],qs['fields'](_0x5ed0a7[_0x1949('0x31')]['fields']));_0x4996f9['attributes']=_0x4996f9[_0x1949('0x36')][_0x1949('0x37')]?_0x4996f9[_0x1949('0x36')]:_0x3978ad[_0x1949('0x35')];_0x4996f9['order']=qs[_0x1949('0x3b')](_0x5ed0a7[_0x1949('0x31')][_0x1949('0x3b')]);_0x4996f9[_0x1949('0x3c')]=qs[_0x1949('0x33')](_[_0x1949('0x3d')](_0x5ed0a7[_0x1949('0x31')],_0x3978ad[_0x1949('0x33')]));if(_0x5ed0a7['query']['filter']){_0x4996f9[_0x1949('0x3c')]=_['merge'](_0x4996f9[_0x1949('0x3c')],{'$or':_[_0x1949('0x30')](_0x4996f9[_0x1949('0x36')],function(_0x5ee64f){var _0x5594a9={};_0x5594a9[_0x5ee64f]={'$like':'%'+_0x5ed0a7['query'][_0x1949('0x3e')]+'%'};return _0x5594a9;})});}_0x4996f9=_['merge']({},_0x4996f9,_0x5ed0a7[_0x1949('0x40')]);return _0x3ef4c4[_0x1949('0xfb')](_0x4996f9);}})['then'](function(_0x4b8887){if(_0x4b8887){_0x118d45=_0x4b8887[_0x1949('0x37')];if(!_0x5ed0a7['query'][_0x1949('0x38')]('nolimit')){_0x4996f9[_0x1949('0x1d')]=qs[_0x1949('0x1d')](_0x5ed0a7[_0x1949('0x31')][_0x1949('0x1d')]);_0x4996f9[_0x1949('0x1b')]=qs[_0x1949('0x1b')](_0x5ed0a7[_0x1949('0x31')][_0x1949('0x1b')]);}return _0x3ef4c4[_0x1949('0xfb')](_0x4996f9);}})['then'](function(_0x3bf3d0){if(_0x3bf3d0){return _0x3bf3d0?{'count':_0x118d45,'rows':_0x3bf3d0}:null;}})[_0x1949('0x10')](respondWithResult(_0x5d5073,null))[_0x1949('0x18')](handleError(_0x5d5073,null));};exports['getFields']=function(_0xa1ab80,_0x6eb1d7){var _0x186512=_0xa1ab80[_0x1949('0x31')][_0x1949('0x117')]===_0x1949('0x118')?_0x1949('0x119'):_0x1949('0x11a');return db[_0x1949('0x2c')]['find']({'attributes':['id',_0x186512],'where':{'id':_0xa1ab80['params']['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x6eb1d7,null))[_0x1949('0x10')](function(_0x579a9c){if(_0x579a9c){var _0x3effc0=_0x579a9c[_0x186512];var _0x18d9bf=_0x3effc0&&_0x3effc0[_0x1949('0x11b')]?_0x3effc0['items']:[];_0x6eb1d7[_0x1949('0x28')]({'fromKey':_[_0x1949('0x6c')](_0x3effc0['fromKey'])?undefined:_0x3effc0[_0x1949('0x11c')],'count':_0x18d9bf[_0x1949('0x37')],'rows':_0x18d9bf});}})[_0x1949('0x18')](handleError(_0x6eb1d7,null));};exports['getOfflineMessages']=function(_0x1f82de,_0x27221f){var _0x2323a1={'raw':![],'where':{}};var _0x4f5bca={};var _0x26f5cf={'count':0x0,'rows':[]};return db[_0x1949('0x2c')][_0x1949('0x54')]({'where':{'id':_0x1f82de[_0x1949('0x4f')]['id']}})['then'](handleEntityNotFound(_0x27221f,null))['then'](function(_0x424899){if(_0x424899){_0x4f5bca['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x4f5bca[_0x1949('0x31')]=_[_0x1949('0x32')](_0x1f82de[_0x1949('0x31')]);_0x4f5bca[_0x1949('0x33')]=_[_0x1949('0x34')](_0x4f5bca['model'],_0x4f5bca[_0x1949('0x31')]);_0x2323a1[_0x1949('0x36')]=_['intersection'](_0x4f5bca['model'],qs[_0x1949('0x45')](_0x1f82de[_0x1949('0x31')][_0x1949('0x45')]));_0x2323a1[_0x1949('0x36')]=_0x2323a1[_0x1949('0x36')][_0x1949('0x37')]?_0x2323a1[_0x1949('0x36')]:_0x4f5bca[_0x1949('0x35')];if(!_0x1f82de[_0x1949('0x31')][_0x1949('0x38')](_0x1949('0x39'))){_0x2323a1[_0x1949('0x1d')]=qs['limit'](_0x1f82de[_0x1949('0x31')][_0x1949('0x1d')]);_0x2323a1[_0x1949('0x1b')]=qs['offset'](_0x1f82de[_0x1949('0x31')][_0x1949('0x1b')]);}_0x2323a1[_0x1949('0x3a')]=qs[_0x1949('0x3b')](_0x1f82de['query'][_0x1949('0x3b')]);_0x2323a1['where']=qs[_0x1949('0x33')](_[_0x1949('0x3d')](_0x1f82de[_0x1949('0x31')],_0x4f5bca['filters']));_0x2323a1[_0x1949('0x3c')]['ChatWebsiteId']=_0x424899['id'];if(_0x1f82de['query']['filter']){_0x2323a1['where']=_[_0x1949('0x3f')](_0x2323a1['where'],{'$or':_['map'](_0x2323a1[_0x1949('0x36')],function(_0x53510f){var _0x2d7174={};_0x2d7174[_0x53510f]={'$like':'%'+_0x1f82de[_0x1949('0x31')][_0x1949('0x3e')]+'%'};return _0x2d7174;})});}_0x2323a1=_['merge']({},_0x2323a1,_0x1f82de[_0x1949('0x40')]);return db[_0x1949('0xc6')]['count']({'where':_0x2323a1['where']})['then'](function(_0x10616a){_0x26f5cf[_0x1949('0x1e')]=_0x10616a;if(_0x1f82de[_0x1949('0x31')][_0x1949('0x41')]){_0x2323a1[_0x1949('0x42')]=[{'all':!![]}];}else{_0x2323a1[_0x1949('0x42')]=[{'model':db[_0x1949('0x7c')],'as':_0x1949('0xe7'),'required':![]},{'model':db[_0x1949('0xd0')],'as':_0x1949('0x11d'),'required':![]}];}return db[_0x1949('0xc6')][_0x1949('0x55')](_0x2323a1);})['then'](function(_0x157b3b){_0x26f5cf[_0x1949('0x43')]=_0x157b3b;return _0x26f5cf;});}})['then'](respondWithFilteredResult(_0x27221f,_0x2323a1))['catch'](handleError(_0x27221f,null));};exports['addAgents']=function(_0x38b760,_0x3f6c8e){return db['ChatWebsite'][_0x1949('0x46')]({'where':{'id':_0x38b760[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x3f6c8e,null))[_0x1949('0x10')](function(_0x1b258a){if(_0x1b258a){return _0x1b258a[_0x1949('0x11e')](_0x38b760['body'][_0x1949('0x57')],_[_0x1949('0xe5')](_0x38b760[_0x1949('0x48')],[_0x1949('0x57'),'id'])||{})[_0x1949('0xc3')](function(_0x2bccd8){for(var _0x3a3968=0x0;_0x3a3968<_0x38b760[_0x1949('0x48')][_0x1949('0x57')][_0x1949('0x37')];_0x3a3968+=0x1){socket[_0x1949('0x11f')]('userChatWebsite:save',{'UserId':Number(_0x38b760[_0x1949('0x48')]['ids'][_0x3a3968]),'ChatWebsiteId':Number(_0x38b760[_0x1949('0x4f')]['id'])});}return _0x2bccd8;});}})[_0x1949('0x10')](respondWithResult(_0x3f6c8e,null))['catch'](handleError(_0x3f6c8e,null));};exports['removeAgents']=function(_0x136e5d,_0x5e8435){return db[_0x1949('0x2c')][_0x1949('0x46')]({'where':{'id':_0x136e5d[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x5e8435,null))[_0x1949('0x10')](function(_0x1e00fd){if(_0x1e00fd){return _0x1e00fd[_0x1949('0x120')](_0x136e5d[_0x1949('0x31')][_0x1949('0x57')])[_0x1949('0x10')](function(){if(_[_0x1949('0x121')](_0x136e5d[_0x1949('0x31')][_0x1949('0x57')])){for(var _0x3a602d=0x0;_0x3a602d<_0x136e5d[_0x1949('0x31')][_0x1949('0x57')]['length'];_0x3a602d+=0x1){socket[_0x1949('0x11f')](_0x1949('0x122'),{'UserId':Number(_0x136e5d[_0x1949('0x31')][_0x1949('0x57')][_0x3a602d]),'ChatWebsiteId':Number(_0x136e5d[_0x1949('0x4f')]['id'])});}}else{socket[_0x1949('0x11f')](_0x1949('0x122'),{'UserId':Number(_0x136e5d['query'][_0x1949('0x57')]),'ChatWebsiteId':Number(_0x136e5d[_0x1949('0x4f')]['id'])});}});}})[_0x1949('0x10')](respondWithStatusCode(_0x5e8435,null))[_0x1949('0x18')](handleError(_0x5e8435,null));};exports[_0x1949('0x123')]=function(_0x1d7500,_0x22068f){var _0x597343={};var _0x23d185={};var _0x3f097a;var _0x3dc3cb;return db['ChatWebsite'][_0x1949('0x54')]({'where':{'id':_0x1d7500[_0x1949('0x4f')]['id']}})[_0x1949('0x10')](handleEntityNotFound(_0x22068f,null))[_0x1949('0x10')](function(_0x2a2ace){if(_0x2a2ace){_0x3f097a=_0x2a2ace;_0x23d185['model']=_[_0x1949('0x32')](db[_0x1949('0xe8')][_0x1949('0x2d')]);_0x23d185['query']=_[_0x1949('0x32')](_0x1d7500[_0x1949('0x31')]);_0x23d185['filters']=_['intersection'](_0x23d185['model'],_0x23d185['query']);_0x597343[_0x1949('0x36')]=_[_0x1949('0x34')](_0x23d185['model'],qs[_0x1949('0x45')](_0x1d7500['query'][_0x1949('0x45')]));_0x597343[_0x1949('0x36')]=_0x597343[_0x1949('0x36')][_0x1949('0x37')]?_0x597343[_0x1949('0x36')]:_0x23d185[_0x1949('0x35')];_0x597343[_0x1949('0x3a')]=qs[_0x1949('0x3b')](_0x1d7500[_0x1949('0x31')][_0x1949('0x3b')]);_0x597343['where']=qs[_0x1949('0x33')](_['pick'](_0x1d7500[_0x1949('0x31')],_0x23d185[_0x1949('0x33')]));if(_0x1d7500[_0x1949('0x31')][_0x1949('0x3e')]){_0x597343[_0x1949('0x3c')]=_[_0x1949('0x3f')](_0x597343['where'],{'$or':_[_0x1949('0x30')](_0x597343[_0x1949('0x36')],function(_0x35774f){var _0x16cdd3={};_0x16cdd3[_0x35774f]={'$like':'%'+_0x1d7500['query'][_0x1949('0x3e')]+'%'};return _0x16cdd3;})});}_0x597343=_['merge']({},_0x597343,_0x1d7500[_0x1949('0x40')]);return _0x3f097a[_0x1949('0x123')](_0x597343);}})['then'](function(_0x2bc8ed){if(_0x2bc8ed){_0x3dc3cb=_0x2bc8ed['length'];if(!_0x1d7500[_0x1949('0x31')][_0x1949('0x38')]('nolimit')){_0x597343[_0x1949('0x1d')]=qs[_0x1949('0x1d')](_0x1d7500[_0x1949('0x31')][_0x1949('0x1d')]);_0x597343[_0x1949('0x1b')]=qs[_0x1949('0x1b')](_0x1d7500[_0x1949('0x31')][_0x1949('0x1b')]);}return _0x3f097a[_0x1949('0x123')](_0x597343);}})['then'](function(_0xaaffae){if(_0xaaffae){return _0xaaffae?{'count':_0x3dc3cb,'rows':_0xaaffae}:null;}})[_0x1949('0x10')](respondWithResult(_0x22068f,null))[_0x1949('0x18')](handleError(_0x22068f,null));};
\ No newline at end of file
+var _0x53c0=['No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','all','server/files/chat/iframe.ejs','remote','connection','remoteAddress','referer','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','IntervalId','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','spread','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','getLogo','sitepic','getLicense','custom','isNil','join','server/files/images/logos/','server/files/images/avatars/default_avatar.png','root','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','stringify','threadId','ChatInteraction','ContactId','interaction','messageId','created','push','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','files','offline-chat','basename','openNewInteraction','sequelize','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','originalname','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','MailAccountId','NotifyMailAccount','attachments','remove','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE'];(function(_0x174e9e,_0x4ece54){var _0x524f3f=function(_0x28a2ef){while(--_0x28a2ef){_0x174e9e['push'](_0x174e9e['shift']());}};_0x524f3f(++_0x4ece54);}(_0x53c0,0x15b));var _0x053c=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x53c0[_0x297fd3];return _0x2af381;};'use strict';var BPromise=require(_0x053c('0x0'));var Mustache=require(_0x053c('0x1'));var util=require(_0x053c('0x2'));var path=require(_0x053c('0x3'));var ejs=require(_0x053c('0x4'));var fs=require('fs');var fs_extra=require(_0x053c('0x5'));var _=require(_0x053c('0x6'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0x053c('0x7'));var logger=require(_0x053c('0x8'))('api');var config=require(_0x053c('0x9'));var db=require(_0x053c('0xa'))['db'];config['redis']=_[_0x053c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x053c('0xc')]));require(_0x053c('0xd'))[_0x053c('0xe')](socket);var htmlToText=require(_0x053c('0xf'));var jayson=require(_0x053c('0x10'));var client=jayson[_0x053c('0x11')]['http']({'port':0x232c});var client9002=jayson['client'][_0x053c('0x12')]({'port':0x232a});var client9003=jayson[_0x053c('0x11')][_0x053c('0x12')]({'port':0x232b});var client9001=jayson[_0x053c('0x11')][_0x053c('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x413186,_0x478b98,_0x273c70,_0xee6b4d){return new BPromise(function(_0x297af7,_0x2c0dd6){var _0x118aae=_0xee6b4d||client;return _0x118aae[_0x053c('0x13')](_0x413186,_0x273c70)[_0x053c('0x14')](function(_0x47c277){logger[_0x053c('0x15')](_0x053c('0x16'),_0x478b98,'request\x20sent');logger[_0x053c('0x17')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x478b98,'request\x20sent',JSON['stringify'](_0x47c277));if(_0x47c277[_0x053c('0x18')]){if(_0x47c277[_0x053c('0x18')]['code']===0x1f4){logger[_0x053c('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x478b98,_0x47c277[_0x053c('0x18')][_0x053c('0x19')]);return _0x2c0dd6(_0x47c277[_0x053c('0x18')][_0x053c('0x19')]);}logger[_0x053c('0x18')](_0x053c('0x16'),_0x478b98,_0x47c277[_0x053c('0x18')]['message']);return _0x297af7(_0x47c277['error'][_0x053c('0x19')]);}else{logger[_0x053c('0x15')](_0x053c('0x16'),_0x478b98,'request\x20sent');_0x297af7(_0x47c277[_0x053c('0x1a')][_0x053c('0x19')]);}})[_0x053c('0x1b')](function(_0x1f4128){logger[_0x053c('0x18')](_0x053c('0x16'),_0x478b98,_0x1f4128);_0x2c0dd6(_0x1f4128);});});}function respondWithStatusCode(_0x18042c,_0x2864ed){_0x2864ed=_0x2864ed||0xcc;return function(_0x40a725){if(_0x40a725){return _0x18042c[_0x053c('0x1c')](_0x2864ed);}return _0x18042c[_0x053c('0x1d')](_0x2864ed)[_0x053c('0x1e')]();};}function respondWithResult(_0x368948,_0x2f327e){_0x2f327e=_0x2f327e||0xc8;return function(_0x523687){if(_0x523687){return _0x368948[_0x053c('0x1d')](_0x2f327e)[_0x053c('0x1f')](_0x523687);}};}function respondWithFilteredResult(_0x1372f4,_0x57630d){return function(_0x185632){if(_0x185632){var _0x20aad0=typeof _0x57630d[_0x053c('0x20')]===_0x053c('0x21')&&typeof _0x57630d[_0x053c('0x22')]===_0x053c('0x21');var _0x16cad9=_0x185632[_0x053c('0x23')];var _0x32ffbf=_0x20aad0?0x0:_0x57630d[_0x053c('0x20')];var _0x21bb05=_0x20aad0?_0x185632[_0x053c('0x23')]:_0x57630d['offset']+_0x57630d[_0x053c('0x22')];var _0x22e112;if(_0x21bb05>=_0x16cad9){_0x21bb05=_0x16cad9;_0x22e112=0xc8;}else{_0x22e112=0xce;}_0x1372f4[_0x053c('0x1d')](_0x22e112);return _0x1372f4[_0x053c('0x24')](_0x053c('0x25'),_0x32ffbf+'-'+_0x21bb05+'/'+_0x16cad9)['json'](_0x185632);}return null;};}function saveUpdates(_0x199d66){return function(_0x197707){if(_0x197707){return _0x197707[_0x053c('0x26')](_0x199d66)[_0x053c('0x14')](function(_0x1b299f){return _0x1b299f;});}return null;};}function removeEntity(_0x569300){return function(_0x4527f8){if(_0x4527f8){return _0x4527f8[_0x053c('0x27')]()[_0x053c('0x14')](function(){var _0x55f3df=_0x4527f8[_0x053c('0x28')]({'plain':!![]});var _0xb27299=_0x053c('0x29');return db[_0x053c('0x2a')][_0x053c('0x27')]({'where':{'type':_0xb27299,'resourceId':_0x55f3df['id']}})[_0x053c('0x14')](function(){return _0x4527f8;});})[_0x053c('0x14')](function(){_0x569300['status'](0xcc)[_0x053c('0x1e')]();});}};}function handleEntityNotFound(_0x14390a){return function(_0x64424d){if(!_0x64424d){_0x14390a[_0x053c('0x1c')](0x194);}return _0x64424d;};}function handleError(_0x14c66c,_0x14157a){_0x14157a=_0x14157a||0x1f4;return function(_0x260f8c){logger[_0x053c('0x18')](_0x260f8c[_0x053c('0x2b')]);if(_0x260f8c[_0x053c('0x2c')]){delete _0x260f8c[_0x053c('0x2c')];}_0x14c66c[_0x053c('0x1d')](_0x14157a)[_0x053c('0x2d')](_0x260f8c);};}exports[_0x053c('0x2e')]=function(_0x58326f,_0x5644b2){var _0x2eedb9={'include':[{'model':db[_0x053c('0x2f')],'as':_0x053c('0x30')}]},_0x3c667a={},_0x16850f={'count':0x0,'rows':[]};var _0x7af68a=_['map'](db[_0x053c('0x31')][_0x053c('0x32')],function(_0x290cea){return{'name':_0x290cea[_0x053c('0x33')],'type':_0x290cea[_0x053c('0x34')][_0x053c('0x35')]};});_0x3c667a[_0x053c('0x36')]=_[_0x053c('0x37')](_0x7af68a,'name');_0x3c667a[_0x053c('0x38')]=_[_0x053c('0x39')](_0x58326f['query']);_0x3c667a['filters']=_[_0x053c('0x3a')](_0x3c667a[_0x053c('0x36')],_0x3c667a[_0x053c('0x38')]);_0x2eedb9[_0x053c('0x3b')]=_[_0x053c('0x3a')](_0x3c667a[_0x053c('0x36')],qs['fields'](_0x58326f[_0x053c('0x38')][_0x053c('0x3c')]));_0x2eedb9[_0x053c('0x3b')]=_0x2eedb9[_0x053c('0x3b')][_0x053c('0x3d')]?_0x2eedb9['attributes']:_0x3c667a[_0x053c('0x36')];if(!_0x58326f['query'][_0x053c('0x3e')](_0x053c('0x3f'))){_0x2eedb9[_0x053c('0x22')]=qs['limit'](_0x58326f[_0x053c('0x38')][_0x053c('0x22')]);_0x2eedb9[_0x053c('0x20')]=qs[_0x053c('0x20')](_0x58326f[_0x053c('0x38')][_0x053c('0x20')]);}_0x2eedb9[_0x053c('0x40')]=qs['sort'](_0x58326f[_0x053c('0x38')][_0x053c('0x41')]);_0x2eedb9[_0x053c('0x42')]=qs[_0x053c('0x43')](_[_0x053c('0x44')](_0x58326f[_0x053c('0x38')],_0x3c667a[_0x053c('0x43')]),_0x7af68a);if(_0x58326f[_0x053c('0x38')][_0x053c('0x45')]){_0x2eedb9[_0x053c('0x42')]=_['merge'](_0x2eedb9[_0x053c('0x42')],{'$or':_['map'](_0x7af68a,function(_0x33a025){if(_0x33a025['type']!=='VIRTUAL'){var _0x16a676={};_0x16a676[_0x33a025[_0x053c('0x2c')]]={'$like':'%'+_0x58326f[_0x053c('0x38')][_0x053c('0x45')]+'%'};return _0x16a676;}})});}_0x2eedb9=_[_0x053c('0x46')]({},_0x2eedb9,_0x58326f[_0x053c('0x47')]);var _0xb793b5={'where':_0x2eedb9['where']};return db['ChatWebsite'][_0x053c('0x23')](_0xb793b5)[_0x053c('0x14')](function(_0x59f94b){_0x16850f['count']=_0x59f94b;if(_0x58326f[_0x053c('0x38')]['includeAll']){_0x2eedb9[_0x053c('0x48')]=[{'all':!![]}];}return db[_0x053c('0x31')][_0x053c('0x49')](_0x2eedb9);})[_0x053c('0x14')](function(_0x476762){_0x16850f[_0x053c('0x4a')]=_0x476762;return _0x16850f;})[_0x053c('0x14')](respondWithFilteredResult(_0x5644b2,_0x2eedb9))[_0x053c('0x1b')](handleError(_0x5644b2,null));};exports[_0x053c('0x4b')]=function(_0x32eed9,_0x39fab8){var _0x50649b={'raw':![],'where':{'id':_0x32eed9['params']['id']},'include':[{'model':db['Pause'],'as':_0x053c('0x30')}]},_0x400296={};_0x400296[_0x053c('0x36')]=_['keys'](db['ChatWebsite'][_0x053c('0x32')]);_0x400296['query']=_[_0x053c('0x39')](_0x32eed9['query']);_0x400296[_0x053c('0x43')]=_['intersection'](_0x400296[_0x053c('0x36')],_0x400296[_0x053c('0x38')]);_0x50649b[_0x053c('0x3b')]=_['intersection'](_0x400296[_0x053c('0x36')],qs[_0x053c('0x3c')](_0x32eed9[_0x053c('0x38')][_0x053c('0x3c')]));_0x50649b[_0x053c('0x3b')]=_0x50649b['attributes'][_0x053c('0x3d')]?_0x50649b[_0x053c('0x3b')]:_0x400296[_0x053c('0x36')];if(_0x32eed9['query'][_0x053c('0x4c')]){_0x50649b[_0x053c('0x48')]=[{'all':!![]}];}_0x50649b=_[_0x053c('0x46')]({},_0x50649b,_0x32eed9[_0x053c('0x47')]);return db[_0x053c('0x31')][_0x053c('0x4d')](_0x50649b)['then'](handleEntityNotFound(_0x39fab8,null))[_0x053c('0x14')](respondWithResult(_0x39fab8,null))[_0x053c('0x1b')](handleError(_0x39fab8,null));};exports[_0x053c('0x4e')]=function(_0x19c42a,_0x132515){return db[_0x053c('0x31')][_0x053c('0x4e')](_0x19c42a[_0x053c('0x4f')],{})[_0x053c('0x14')](function(_0x31b55f){var _0x25ded7=_0x19c42a[_0x053c('0x50')]['get']({'plain':!![]});if(!_0x25ded7)throw new Error(_0x053c('0x51'));if(_0x25ded7[_0x053c('0x52')]===_0x053c('0x50')){var _0x5b33ae=_0x31b55f[_0x053c('0x28')]({'plain':!![]});var _0x3ab314=_0x053c('0x29');return db[_0x053c('0x53')][_0x053c('0x4d')]({'where':{'name':_0x3ab314,'userProfileId':_0x25ded7['userProfileId']},'raw':!![]})[_0x053c('0x14')](function(_0x5aba89){if(_0x5aba89&&_0x5aba89[_0x053c('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x5b33ae[_0x053c('0x2c')],'resourceId':_0x5b33ae['id'],'type':_0x5aba89[_0x053c('0x2c')],'sectionId':_0x5aba89['id']},{})[_0x053c('0x14')](function(){return _0x31b55f;});}else{return _0x31b55f;}})[_0x053c('0x1b')](function(_0xa54c0d){logger['error'](_0x053c('0x55'),_0xa54c0d);throw _0xa54c0d;});}return _0x31b55f;})['then'](respondWithResult(_0x132515,0xc9))[_0x053c('0x1b')](handleError(_0x132515,null));};exports['update']=function(_0x545759,_0x122926){if(_0x545759[_0x053c('0x4f')]['id']){delete _0x545759['body']['id'];}return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x545759[_0x053c('0x56')]['id']},'include':[{'model':db[_0x053c('0x2f')],'as':_0x053c('0x30')}]})[_0x053c('0x14')](handleEntityNotFound(_0x122926,null))[_0x053c('0x14')](saveUpdates(_0x545759[_0x053c('0x4f')],null))['then'](respondWithResult(_0x122926,null))['catch'](handleError(_0x122926,null));};exports[_0x053c('0x27')]=function(_0x1eeb3e,_0xcace4f){return db[_0x053c('0x31')]['find']({'where':{'id':_0x1eeb3e[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0xcace4f,null))[_0x053c('0x14')](removeEntity(_0xcace4f,null))['catch'](handleError(_0xcace4f,null));};exports['describe']=function(_0x1acc43,_0x505105){return db['ChatWebsite'][_0x053c('0x57')]()[_0x053c('0x14')](respondWithResult(_0x505105,null))[_0x053c('0x1b')](handleError(_0x505105,null));};exports[_0x053c('0x58')]=function(_0x1759ca,_0x4d3b0b){if(_0x1759ca['body']['id']){delete _0x1759ca[_0x053c('0x4f')]['id'];}return db[_0x053c('0x31')]['find']({'where':{'id':_0x1759ca[_0x053c('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d3b0b,null))['then'](function(_0xd486fb){if(_0xd486fb){_0x1759ca[_0x053c('0x4f')][_0x053c('0x59')]=_0xd486fb['id'];return db['Disposition'][_0x053c('0x4e')](_0x1759ca[_0x053c('0x4f')]);}})['then'](respondWithResult(_0x4d3b0b,null))[_0x053c('0x1b')](handleError(_0x4d3b0b,null));};exports['getDispositions']=function(_0x278aae,_0x132d95){var _0x3afff6={'raw':![],'where':{}};var _0x12361c={};var _0x4c7a97={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x278aae[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x132d95,null))['then'](function(_0x80cc8c){if(_0x80cc8c){_0x12361c[_0x053c('0x36')]=_['keys'](db[_0x053c('0x5a')][_0x053c('0x32')]);_0x12361c[_0x053c('0x38')]=_[_0x053c('0x39')](_0x278aae[_0x053c('0x38')]);_0x12361c[_0x053c('0x43')]=_['intersection'](_0x12361c[_0x053c('0x36')],_0x12361c[_0x053c('0x38')]);_0x3afff6[_0x053c('0x3b')]=_[_0x053c('0x3a')](_0x12361c['model'],qs[_0x053c('0x3c')](_0x278aae['query']['fields']));_0x3afff6['attributes']=_0x3afff6[_0x053c('0x3b')][_0x053c('0x3d')]?_0x3afff6[_0x053c('0x3b')]:_0x12361c['model'];if(!_0x278aae[_0x053c('0x38')]['hasOwnProperty'](_0x053c('0x3f'))){_0x3afff6[_0x053c('0x22')]=qs[_0x053c('0x22')](_0x278aae[_0x053c('0x38')][_0x053c('0x22')]);_0x3afff6[_0x053c('0x20')]=qs['offset'](_0x278aae[_0x053c('0x38')][_0x053c('0x20')]);}_0x3afff6[_0x053c('0x40')]=qs['sort'](_0x278aae['query'][_0x053c('0x41')]);_0x3afff6[_0x053c('0x42')]=qs[_0x053c('0x43')](_[_0x053c('0x44')](_0x278aae[_0x053c('0x38')],_0x12361c[_0x053c('0x43')]));_0x3afff6['where'][_0x053c('0x59')]=_0x80cc8c['id'];if(_0x278aae['query'][_0x053c('0x45')]){_0x3afff6[_0x053c('0x42')]=_[_0x053c('0x46')](_0x3afff6[_0x053c('0x42')],{'$or':_['map'](_0x3afff6[_0x053c('0x3b')],function(_0x4b413d){var _0x508c71={};_0x508c71[_0x4b413d]={'$like':'%'+_0x278aae[_0x053c('0x38')][_0x053c('0x45')]+'%'};return _0x508c71;})});}_0x3afff6=_[_0x053c('0x46')]({},_0x3afff6,_0x278aae['options']);return db[_0x053c('0x5a')]['count']({'where':_0x3afff6[_0x053c('0x42')]})[_0x053c('0x14')](function(_0x346a65){_0x4c7a97[_0x053c('0x23')]=_0x346a65;if(_0x278aae[_0x053c('0x38')][_0x053c('0x4c')]){_0x3afff6['include']=[{'all':!![]}];}return db[_0x053c('0x5a')][_0x053c('0x49')](_0x3afff6);})[_0x053c('0x14')](function(_0x1cd445){_0x4c7a97[_0x053c('0x4a')]=_0x1cd445;return _0x4c7a97;});}})[_0x053c('0x14')](respondWithFilteredResult(_0x132d95,_0x3afff6))[_0x053c('0x1b')](handleError(_0x132d95,null));};exports[_0x053c('0x5b')]=function(_0x599949,_0x5e074e){return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x599949['params']['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x5e074e,null))[_0x053c('0x14')](function(_0x507b75){if(_0x507b75){return _0x507b75[_0x053c('0x5b')](_0x599949['query'][_0x053c('0x5c')]);}})[_0x053c('0x14')](respondWithStatusCode(_0x5e074e,null))['catch'](handleError(_0x5e074e,null));};exports[_0x053c('0x5d')]=function(_0x32d7b0,_0x30d51f){if(_0x32d7b0[_0x053c('0x4f')]['id']){delete _0x32d7b0[_0x053c('0x4f')]['id'];}return db[_0x053c('0x31')]['find']({'where':{'id':_0x32d7b0[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x30d51f,null))[_0x053c('0x14')](function(_0x526ee0){if(_0x526ee0){_0x32d7b0[_0x053c('0x4f')][_0x053c('0x59')]=_0x526ee0['id'];return db[_0x053c('0x5e')][_0x053c('0x4e')](_0x32d7b0[_0x053c('0x4f')]);}})[_0x053c('0x14')](respondWithResult(_0x30d51f,null))[_0x053c('0x1b')](handleError(_0x30d51f,null));};exports[_0x053c('0x5f')]=function(_0x3691f1,_0xe45176){var _0x59d3f2={'raw':![],'where':{}};var _0x3ec0c4={};var _0x9fded0={'count':0x0,'rows':[]};return db[_0x053c('0x31')][_0x053c('0x60')]({'where':{'id':_0x3691f1[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0xe45176,null))[_0x053c('0x14')](function(_0x592627){if(_0x592627){_0x3ec0c4[_0x053c('0x36')]=_[_0x053c('0x39')](db[_0x053c('0x5e')][_0x053c('0x32')]);_0x3ec0c4['query']=_['keys'](_0x3691f1[_0x053c('0x38')]);_0x3ec0c4[_0x053c('0x43')]=_['intersection'](_0x3ec0c4[_0x053c('0x36')],_0x3ec0c4['query']);_0x59d3f2['attributes']=_[_0x053c('0x3a')](_0x3ec0c4[_0x053c('0x36')],qs[_0x053c('0x3c')](_0x3691f1[_0x053c('0x38')][_0x053c('0x3c')]));_0x59d3f2[_0x053c('0x3b')]=_0x59d3f2[_0x053c('0x3b')][_0x053c('0x3d')]?_0x59d3f2[_0x053c('0x3b')]:_0x3ec0c4[_0x053c('0x36')];if(!_0x3691f1[_0x053c('0x38')][_0x053c('0x3e')](_0x053c('0x3f'))){_0x59d3f2[_0x053c('0x22')]=qs[_0x053c('0x22')](_0x3691f1[_0x053c('0x38')][_0x053c('0x22')]);_0x59d3f2[_0x053c('0x20')]=qs['offset'](_0x3691f1[_0x053c('0x38')][_0x053c('0x20')]);}_0x59d3f2[_0x053c('0x40')]=qs['sort'](_0x3691f1[_0x053c('0x38')]['sort']);_0x59d3f2[_0x053c('0x42')]=qs['filters'](_[_0x053c('0x44')](_0x3691f1[_0x053c('0x38')],_0x3ec0c4[_0x053c('0x43')]));_0x59d3f2[_0x053c('0x42')]['ChatWebsiteId']=_0x592627['id'];if(_0x3691f1['query'][_0x053c('0x45')]){_0x59d3f2['where']=_[_0x053c('0x46')](_0x59d3f2[_0x053c('0x42')],{'$or':_[_0x053c('0x37')](_0x59d3f2[_0x053c('0x3b')],function(_0x2c1f24){var _0x284c19={};_0x284c19[_0x2c1f24]={'$like':'%'+_0x3691f1[_0x053c('0x38')][_0x053c('0x45')]+'%'};return _0x284c19;})});}_0x59d3f2=_[_0x053c('0x46')]({},_0x59d3f2,_0x3691f1[_0x053c('0x47')]);return db[_0x053c('0x5e')]['count']({'where':_0x59d3f2['where']})[_0x053c('0x14')](function(_0xd5da8d){_0x9fded0[_0x053c('0x23')]=_0xd5da8d;if(_0x3691f1[_0x053c('0x38')][_0x053c('0x4c')]){_0x59d3f2[_0x053c('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0x053c('0x49')](_0x59d3f2);})['then'](function(_0x1778b1){_0x9fded0[_0x053c('0x4a')]=_0x1778b1;return _0x9fded0;});}})[_0x053c('0x14')](respondWithFilteredResult(_0xe45176,_0x59d3f2))[_0x053c('0x1b')](handleError(_0xe45176,null));};exports[_0x053c('0x61')]=function(_0x5442ca,_0x29399e){return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x5442ca[_0x053c('0x56')]['id']}})['then'](handleEntityNotFound(_0x29399e,null))[_0x053c('0x14')](function(_0x5dfc70){if(_0x5dfc70){return _0x5dfc70[_0x053c('0x61')](_0x5442ca[_0x053c('0x38')][_0x053c('0x5c')]);}})[_0x053c('0x14')](respondWithStatusCode(_0x29399e,null))[_0x053c('0x1b')](handleError(_0x29399e,null));};exports[_0x053c('0x62')]=function(_0x5084e8,_0x5961ea){_0x5084e8[_0x053c('0x4f')]['sitepic']=_0x5084e8[_0x053c('0x63')][_0x053c('0x64')];return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x5084e8[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x5961ea,null))[_0x053c('0x14')](saveUpdates(_0x5084e8[_0x053c('0x4f')],null))[_0x053c('0x14')](respondWithResult(_0x5961ea,null))[_0x053c('0x1b')](handleError(_0x5961ea,null));};exports[_0x053c('0x65')]=function(_0x220509,_0x223b9c){_0x220509[_0x053c('0x4f')][_0x053c('0x66')]=_0x220509[_0x053c('0x63')][_0x053c('0x64')];return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x220509[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x223b9c,null))[_0x053c('0x14')](saveUpdates(_0x220509[_0x053c('0x4f')],null))[_0x053c('0x14')](respondWithResult(_0x223b9c,null))[_0x053c('0x1b')](handleError(_0x223b9c,null));};exports[_0x053c('0x67')]=function(_0x337a6b,_0x28fe8a){_0x337a6b[_0x053c('0x4f')][_0x053c('0x68')]=_0x337a6b[_0x053c('0x63')][_0x053c('0x64')];return db[_0x053c('0x31')]['find']({'where':{'id':_0x337a6b[_0x053c('0x56')]['id']}})['then'](handleEntityNotFound(_0x28fe8a,null))[_0x053c('0x14')](saveUpdates(_0x337a6b[_0x053c('0x4f')],null))[_0x053c('0x14')](respondWithResult(_0x28fe8a,null))['catch'](handleError(_0x28fe8a,null));};exports['addSystemAvatar']=function(_0x131b6b,_0x223e54){_0x131b6b[_0x053c('0x4f')]['systemAvatar']=_0x131b6b[_0x053c('0x63')]['filename'];return db[_0x053c('0x31')]['find']({'where':{'id':_0x131b6b['params']['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x223e54,null))['then'](saveUpdates(_0x131b6b[_0x053c('0x4f')],null))[_0x053c('0x14')](respondWithResult(_0x223e54,null))['catch'](handleError(_0x223e54,null));};exports[_0x053c('0x69')]=function(_0x16dfda,_0x44c7bf){var _0x3499fa=path['join'](config['root'],'server/files/images/logos/default_logo.svg');var _0x590372={'where':{'id':_0x16dfda[_0x053c('0x56')]['id']},'attributes':['id',_0x053c('0x6a')],'raw':!![]};var _0x5e69c6=![];return require('../../config/license/util')[_0x053c('0x6b')]()[_0x053c('0x14')](function(_0x281f71){if(_0x281f71){_0x5e69c6=_0x281f71[_0x053c('0x6c')];}})[_0x053c('0x14')](function(){return db['ChatWebsite'][_0x053c('0x4d')](_0x590372);})['then'](handleEntityNotFound(_0x44c7bf,null))['then'](function(_0x5e0424){if(_0x5e0424){if(!_[_0x053c('0x6d')](_0x5e0424['sitepic'])){if(fs['existsSync'](path[_0x053c('0x6e')](config['root'],_0x053c('0x6f'),_0x5e0424['sitepic']))&&_0x5e69c6){_0x3499fa=path[_0x053c('0x6e')](config['root'],_0x053c('0x6f'),_0x5e0424[_0x053c('0x6a')]);}}return _0x44c7bf['download'](_0x3499fa);}})[_0x053c('0x1b')](handleError(_0x44c7bf,null));};exports['getAvatar']=function(_0x56ffc2,_0x40e7eb){var _0x229431=path[_0x053c('0x6e')](config['root'],_0x053c('0x70'));var _0x3e8255={'where':{'id':_0x56ffc2[_0x053c('0x56')]['id']},'attributes':['id',_0x053c('0x66')],'raw':!![]};return db[_0x053c('0x31')]['find'](_0x3e8255)['then'](handleEntityNotFound(_0x40e7eb,null))[_0x053c('0x14')](function(_0x4da076){if(_0x4da076){if(!_[_0x053c('0x6d')](_0x4da076['agentAvatar'])){if(fs['existsSync'](path[_0x053c('0x6e')](config[_0x053c('0x71')],_0x053c('0x72'),_0x4da076[_0x053c('0x66')]))){_0x229431=path[_0x053c('0x6e')](config['root'],'server/files/images/avatars/',_0x4da076[_0x053c('0x66')]);}}return _0x40e7eb[_0x053c('0x73')](_0x229431);}})['catch'](handleError(_0x40e7eb,null));};exports[_0x053c('0x74')]=function(_0x209153,_0x2758d9){var _0x53325b=path[_0x053c('0x6e')](config['root'],_0x053c('0x75'));var _0x3738c1={'where':{'id':_0x209153[_0x053c('0x56')]['id']},'attributes':['id',_0x053c('0x68'),_0x053c('0x76')],'raw':!![]};return db[_0x053c('0x31')][_0x053c('0x4d')](_0x3738c1)[_0x053c('0x14')](handleEntityNotFound(_0x2758d9,null))['then'](function(_0x4c2a0a){if(_0x4c2a0a){if(!_['isNil'](_0x4c2a0a[_0x053c('0x68')])){if(fs[_0x053c('0x77')](path['join'](config['root'],_0x053c('0x72'),_0x4c2a0a[_0x053c('0x68')]))&&_0x4c2a0a[_0x053c('0x76')]){_0x53325b=path[_0x053c('0x6e')](config[_0x053c('0x71')],_0x053c('0x72'),_0x4c2a0a['customerAvatar']);}}return _0x2758d9[_0x053c('0x73')](_0x53325b);}})[_0x053c('0x1b')](handleError(_0x2758d9,null));};exports['getSystemAvatar']=function(_0x3020b6,_0x45d291){var _0x16fe65=path[_0x053c('0x6e')](config[_0x053c('0x71')],_0x053c('0x78'));var _0x2d11cb={'where':{'id':_0x3020b6[_0x053c('0x56')]['id']},'attributes':['id',_0x053c('0x79')],'raw':!![]};return db[_0x053c('0x31')][_0x053c('0x4d')](_0x2d11cb)[_0x053c('0x14')](handleEntityNotFound(_0x45d291,null))[_0x053c('0x14')](function(_0x231e11){if(_0x231e11){if(!_[_0x053c('0x6d')](_0x231e11[_0x053c('0x79')])){if(fs['existsSync'](path[_0x053c('0x6e')](config[_0x053c('0x71')],_0x053c('0x72'),_0x231e11[_0x053c('0x79')]))){_0x16fe65=path[_0x053c('0x6e')](config[_0x053c('0x71')],_0x053c('0x72'),_0x231e11['systemAvatar']);}}return _0x45d291[_0x053c('0x73')](_0x16fe65);}})[_0x053c('0x1b')](handleError(_0x45d291,null));};exports[_0x053c('0x7a')]=function(_0x5f554a,_0x204d87){var _0x50100e=require(_0x053c('0x7b'));var _0x2d4cb1=new _0x50100e();var _0x263d27=_0x2d4cb1['setUA'](_0x5f554a[_0x053c('0x7c')][_0x053c('0x7d')])[_0x053c('0x7e')]();var _0x8dc531={'body':_0x5f554a[_0x053c('0x4f')],'channel':_0x053c('0x7f')};var _0x56b08c=[];var _0x5a27be=[];var _0x36d753={};var _0x1b8b8a=![];return db[_0x053c('0x80')][_0x053c('0x57')]()[_0x053c('0x14')](function(_0x15adb8){if(!_0x15adb8){throw new db[(_0x053c('0x81'))]['ValidationError'](_0x053c('0x82'));}_0x56b08c=_[_0x053c('0x83')](_[_0x053c('0x39')](_0x15adb8),['createdAt',_0x053c('0x84')]);_0x5a27be=_['difference'](_[_0x053c('0x39')](_0x15adb8),[_0x053c('0x85'),_0x053c('0x84'),_0x053c('0x86'),_0x053c('0x87')]);if(_0x5f554a['body']['id']){delete _0x5f554a[_0x053c('0x4f')]['id'];}if(_[_0x053c('0x6d')](_0x5f554a[_0x053c('0x4f')][_0x053c('0x88')])){throw new db[(_0x053c('0x81'))][(_0x053c('0x89'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x5f554a[_0x053c('0x4f')]['body'])||_0x5f554a[_0x053c('0x4f')][_0x053c('0x4f')]===''){throw new db[(_0x053c('0x81'))][(_0x053c('0x89'))](_0x053c('0x8a'));}if(_[_0x053c('0x6d')](_0x5f554a['body'][_0x053c('0x8b')])){throw new db[(_0x053c('0x81'))]['ValidationError'](_0x053c('0x8c')+_0x5a27be);}if(!_[_0x053c('0x8d')](_0x5a27be,_0x5f554a[_0x053c('0x4f')][_0x053c('0x8b')])){throw new db[(_0x053c('0x81'))][(_0x053c('0x89'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a27be);}_0x36d753[_0x5f554a[_0x053c('0x4f')][_0x053c('0x8b')]]=_0x5f554a[_0x053c('0x4f')][_0x053c('0x88')];})[_0x053c('0x14')](function(){return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x5f554a[_0x053c('0x56')]['id']},'include':[{'model':db[_0x053c('0x8e')],'as':_0x053c('0x8f'),'include':[{'model':db[_0x053c('0x80')],'as':_0x053c('0x90'),'where':_0x36d753,'limit':0x1,'order':[[_0x053c('0x84'),_0x053c('0x91')]]}]},{'model':db[_0x053c('0x92')],'as':_0x053c('0x93')}]});})['then'](handleEntityNotFound(_0x204d87,null))[_0x053c('0x14')](function(_0x18a8f7){if(_0x18a8f7&&_0x18a8f7[_0x053c('0x8f')]){_0x8dc531[_0x053c('0x94')]=_0x18a8f7;_0x8dc531['applications']=_0x18a8f7[_0x053c('0x93')];_0x8dc531[_0x053c('0x95')]=_0x18a8f7['List'];_0x8dc531[_0x053c('0x96')]=_[_0x053c('0x97')](_0x8dc531['applications'],['priority'],['asc']);if(_0x8dc531[_0x053c('0x94')][_0x053c('0x93')]){delete _0x8dc531[_0x053c('0x94')][_0x053c('0x93')];}if(_0x8dc531[_0x053c('0x94')][_0x053c('0x8f')]&&_0x8dc531[_0x053c('0x94')][_0x053c('0x8f')][_0x053c('0x90')][_0x053c('0x3d')]){return _0x8dc531[_0x053c('0x94')]['List']['Contacts'][0x0];}var _0x32602f=_['defaults'](_0x5f554a['body'],{'firstName':_0x5f554a[_0x053c('0x4f')][_0x053c('0x88')],'ListId':_0x18a8f7[_0x053c('0x87')]});_0x32602f[_0x5f554a['body'][_0x053c('0x8b')]]=_0x5f554a[_0x053c('0x4f')]['from'];return db['CmContact'][_0x053c('0x4e')](_0x32602f,{'fields':_0x56b08c,'raw':!![]});}})[_0x053c('0x14')](handleEntityNotFound(_0x204d87,null))['then'](function(_0x1b356b){_0x8dc531[_0x053c('0x98')]=_0x1b356b;var _0x4ea62d=_0x5f554a['body'][_0x053c('0x99')];if(_0x5f554a[_0x053c('0x7c')][_0x053c('0x9a')]){_0x4ea62d=_0x5f554a[_0x053c('0x7c')]['cf-connecting-ip'];}else if(_0x5f554a[_0x053c('0x7c')]['x-forwarded-for']){_0x4ea62d=_[_0x053c('0x9b')](_0x5f554a[_0x053c('0x7c')][_0x053c('0x9c')]['split'](','));}if(_0x1b356b){var _0x2c83aa={'ContactId':_0x1b356b['id'],'ChatWebsiteId':_0x5f554a[_0x053c('0x56')]['id'],'from':(_0x1b356b[_0x053c('0x9d')]||'')+'\x20'+(_0x1b356b[_0x053c('0x9e')]||''),'customerIp':_0x4ea62d,'customerPort':_0x5f554a[_0x053c('0x7c')][_0x053c('0x9f')]?_0x5f554a[_0x053c('0x7c')][_0x053c('0x9f')]:null,'referer':_0x5f554a[_0x053c('0x4f')]['referer'],'browserName':_0x263d27[_0x053c('0xa0')][_0x053c('0x2c')]&&_0x263d27[_0x053c('0xa0')][_0x053c('0xa1')]?util[_0x053c('0xa2')](_0x053c('0xa3'),_0x263d27[_0x053c('0xa0')][_0x053c('0x2c')],_0x263d27['browser'][_0x053c('0xa1')]):_0x053c('0xa4'),'browserVersion':_0x263d27[_0x053c('0xa0')]['version']||'unknown','osName':util['format'](_0x053c('0xa3'),_0x263d27['os']['name'],_0x263d27['os'][_0x053c('0xa1')]),'osVersion':_0x263d27['os'][_0x053c('0xa1')],'deviceModel':_0x263d27['device'][_0x053c('0x36')]&&_0x263d27['device'][_0x053c('0xa5')]?util[_0x053c('0xa2')](_0x053c('0xa6'),_0x263d27[_0x053c('0xa7')][_0x053c('0x36')],_0x263d27[_0x053c('0xa7')][_0x053c('0xa5')],_0x263d27[_0x053c('0xa7')][_0x053c('0x34')]):null,'deviceVendor':_0x263d27[_0x053c('0xa7')][_0x053c('0xa5')],'deviceType':_0x263d27['device'][_0x053c('0x34')],'formData':JSON[_0x053c('0xa8')](_0x5f554a[_0x053c('0x4f')])};var _0x5094a7={'ChatWebsiteId':_0x5f554a[_0x053c('0x56')]['id'],'closed':![]};if(_0x5f554a[_0x053c('0x4f')][_0x053c('0xa9')]){_0x5094a7[_0x053c('0xa9')]=_0x5f554a[_0x053c('0x4f')][_0x053c('0xa9')];return db[_0x053c('0xaa')][_0x053c('0x4d')]({'where':_0x5094a7})[_0x053c('0x14')](function(_0x5d1dd5){if(_0x5d1dd5){return[_0x5d1dd5,![]];}_0x2c83aa[_0x053c('0xa9')]=_0x5f554a[_0x053c('0x4f')][_0x053c('0xa9')];_0x2c83aa['externalUrl']=_0x5f554a[_0x053c('0x4f')]['externalUrl'];return db[_0x053c('0xaa')][_0x053c('0x4e')](_0x2c83aa)[_0x053c('0x14')](function(_0x5b7594){return[_0x5b7594,!![]];});});}_0x5094a7[_0x053c('0xab')]=_0x1b356b['id'];if(_0x5f554a[_0x053c('0x4f')][_0x053c('0xac')]&&_0x5f554a[_0x053c('0x4f')][_0x053c('0xac')]['id']){_0x5094a7['id']=_0x5f554a[_0x053c('0x4f')]['interaction']['id'];return db[_0x053c('0xaa')][_0x053c('0x4d')]({'where':_0x5094a7})[_0x053c('0x14')](function(_0x26ee8a){if(_0x26ee8a){return[_0x26ee8a,![]];}return db[_0x053c('0xaa')][_0x053c('0x4e')](_0x2c83aa)[_0x053c('0x14')](function(_0x2084ef){return[_0x2084ef,!![]];});});}return db['ChatInteraction'][_0x053c('0x4e')](_0x2c83aa)[_0x053c('0x14')](function(_0x35b308){return[_0x35b308,!![]];});}})['spread'](function(_0x44156c,_0xcfa528){if(_0x44156c){_0x1b8b8a=_0xcfa528;if(!_0xcfa528){var _0x2208d6={'from':(_0x8dc531['contact'][_0x053c('0x9d')]||'')+'\x20'+(_0x8dc531[_0x053c('0x98')][_0x053c('0x9e')]||'')};if(_0x5f554a['body'][_0x053c('0xa9')]&&_0x5f554a[_0x053c('0x4f')][_0x053c('0xad')]&&_0x5f554a['body'][_0x053c('0xa9')]!=_0x5f554a[_0x053c('0x4f')][_0x053c('0xad')]){_0x2208d6[_0x053c('0xa9')]=_0x5f554a[_0x053c('0x4f')]['messageId'];}return _0x44156c[_0x053c('0x26')](_0x2208d6);}else{return _0x44156c;}}})[_0x053c('0x14')](function(_0x2504a6){_0x8dc531[_0x053c('0xac')]=_0x2504a6[_0x053c('0x28')]({'plain':!![]});_0x8dc531[_0x053c('0xac')][_0x053c('0xae')]=_0x1b8b8a;if(_0x8dc531['interaction']['created']){if(_0x8dc531['account']['autoclose']){_0x8dc531[_0x053c('0x96')][_0x053c('0xaf')]({'id':0x0,'priority':_0x8dc531['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0x053c('0xb0')});}}return db['ChatMessage'][_0x053c('0x4e')]({'body':_0x5f554a[_0x053c('0x4f')][_0x053c('0x4f')],'ChatWebsiteId':_0x5f554a[_0x053c('0x56')]['id'],'ChatInteractionId':_0x2504a6['id'],'direction':'in','ContactId':_0x8dc531[_0x053c('0x98')]['id'],'AttachmentId':_0x5f554a[_0x053c('0x4f')][_0x053c('0xb1')]});})[_0x053c('0x14')](function(_0x38dfce){_0x8dc531[_0x053c('0x19')]=_0x38dfce;if(_0x8dc531[_0x053c('0xac')][_0x053c('0xb2')]){return db['User'][_0x053c('0x4d')]({'attributes':['id',_0x053c('0x2c')],'where':{'id':_0x8dc531[_0x053c('0xac')][_0x053c('0xb2')]}})['then'](function(_0x3753b2){if(_0x3753b2){_0x8dc531[_0x053c('0x96')][_0x053c('0xb3')]({'id':0x0,'priority':0x0,'app':_0x053c('0xb4'),'appdata':_0x3753b2['name']+','+(_0x8dc531[_0x053c('0x94')][_0x053c('0xb5')]||0xa),'interval':_0x053c('0xb0')});_0x8dc531[_0x053c('0xb6')]=!![];}return respondWithRpcPromise(_0x053c('0xb7'),_0x053c('0xb8'),_0x8dc531);});}return respondWithRpcPromise(_0x053c('0xb7'),_0x053c('0xb8'),_0x8dc531);})[_0x053c('0x14')](function(_0x31d282){respondWithRpcPromise(_0x053c('0xb9'),_0x053c('0xb9'),{'event':_0x053c('0x7a'),'message':_0x31d282},client9002);return _0x31d282;})['then'](respondWithResult(_0x204d87,null))[_0x053c('0x1b')](handleError(_0x204d87,null));};exports[_0x053c('0xba')]=function(_0x3d1cf3,_0x4465e0){var _0x5ba703,_0x476798,_0x26cd40;var _0x24ec5a=[];var _0x24beaa={};var _0x4cf15e=_0x3d1cf3['files']||[];var _0x10d3e2=[];var _0x5af8dd;return db[_0x053c('0x80')][_0x053c('0x57')]()['then'](function(_0x246bad){if(!_0x246bad){throw new db[(_0x053c('0x81'))][(_0x053c('0x89'))](_0x053c('0x82'));}_0x24ec5a=_[_0x053c('0x83')](_['keys'](_0x246bad),[_0x053c('0x85'),'updatedAt','CompanyId',_0x053c('0x87')]);if(_0x3d1cf3['body']['id']){delete _0x3d1cf3[_0x053c('0x4f')]['id'];}if(_['isNil'](_0x3d1cf3['body'][_0x053c('0x88')])){throw _0x4465e0[_0x053c('0x1d')](0x1f4)[_0x053c('0x2d')](new db[(_0x053c('0x81'))]['ValidationError'](_0x053c('0xbb')));}if(_[_0x053c('0x6d')](_0x3d1cf3['body'][_0x053c('0x4f')])||_0x3d1cf3['body'][_0x053c('0x4f')]===''){throw _0x4465e0[_0x053c('0x1d')](0x1f4)[_0x053c('0x2d')](new db[(_0x053c('0x81'))]['ValidationError'](_0x053c('0x8a')));}if(_['isNil'](_0x3d1cf3[_0x053c('0x4f')][_0x053c('0xbc')])){throw _0x4465e0[_0x053c('0x1d')](0x1f4)[_0x053c('0x2d')](new db[(_0x053c('0x81'))]['ValidationError'](_0x053c('0xbd')+_0x24ec5a));}if(!_[_0x053c('0x8d')](_0x24ec5a,_0x3d1cf3[_0x053c('0x4f')][_0x053c('0xbc')])){throw _0x4465e0[_0x053c('0x1d')](0x1f4)[_0x053c('0x2d')](new db['Sequelize'][(_0x053c('0x89'))](_0x053c('0xbe')+_0x24ec5a));}_0x24beaa[_0x3d1cf3[_0x053c('0x4f')][_0x053c('0xbc')]]=_0x3d1cf3[_0x053c('0x4f')][_0x053c('0x88')];})[_0x053c('0x14')](function(){return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x3d1cf3[_0x053c('0x56')]['id']},'include':[{'model':db[_0x053c('0x8e')],'as':_0x053c('0x8f')},{'model':db[_0x053c('0xbf')],'as':_0x053c('0xbf')}]});})[_0x053c('0x14')](handleEntityNotFound(_0x4465e0,null))['then'](function(_0x1d8862){if(_0x1d8862&&_0x1d8862[_0x053c('0x8f')]){_0x476798=_0x1d8862;var _0x3a1eaa=_[_0x053c('0xb')](_0x3d1cf3['body'],{'firstName':_0x3d1cf3[_0x053c('0x4f')][_0x053c('0x88')],'phone':_0x3d1cf3['body'][_0x053c('0x88')],'ListId':_0x1d8862[_0x053c('0x87')]});_0x3a1eaa[_0x3d1cf3['body'][_0x053c('0xbc')]]=_0x3d1cf3['body']['from'];return db[_0x053c('0x80')][_0x053c('0xc0')]({'where':_0x24beaa,'defaults':_0x3a1eaa});}})['spread'](function(_0x39c8c6){if(_0x39c8c6){_0x26cd40=_0x39c8c6;var _0x56ff95=fs['readFileSync'](path['join'](config[_0x053c('0x71')],'server/files/templates/chatOfflineMessage.ejs'),_0x053c('0xc1'));var _0x533e87=ejs[_0x053c('0xc2')](_0x56ff95,{'body':_[_0x053c('0xc3')](_0x3d1cf3[_0x053c('0x4f')]['body']),'bodyTitle':_0x476798[_0x053c('0xc4')]});return db[_0x053c('0xc5')][_0x053c('0x4e')]({'body':_0x533e87,'plainBody':htmlToText[_0x053c('0xc6')](_0x533e87),'ContactId':_0x39c8c6['id'],'ChatWebsiteId':_0x476798['id']});}})[_0x053c('0x14')](function(_0x25471c){_0x5af8dd=_0x25471c;if(_0x4cf15e[_0x053c('0x3d')]){var _0x40c1ae=_0x4cf15e[_0x053c('0x37')](function(_0x232c69){return{'name':_0x232c69['originalname'],'basename':_0x232c69['filename'],'type':_0x232c69[_0x053c('0xc7')],'ChatOfflineMessageId':_0x25471c['id']};});_0x10d3e2=_0x40c1ae['map'](_0x23848f=>{var _0x5c9a99={'filename':_0x23848f['name'],'path':path[_0x053c('0x6e')](config[_0x053c('0x71')],_0x053c('0xc8'),_0x053c('0xc9'),'attachments',_0x053c('0xca'),_0x23848f[_0x053c('0xcb')])};return _0x5c9a99;});if(!_0x476798[_0x053c('0xcc')]){return db[_0x053c('0xcd')]['transaction'](function(_0x4264a2){return db[_0x053c('0xce')]['bulkCreate'](_0x40c1ae,{'transaction':_0x4264a2});});}}})[_0x053c('0x14')](function(){if(_0x5af8dd){_0x5ba703=_0x5af8dd;return db['MailAccount'][_0x053c('0x60')]({'where':{'service':!![]},'include':[{'model':db[_0x053c('0xcf')],'as':_0x053c('0xd0'),'raw':!![],'include':[{'model':db[_0x053c('0xd1')],'as':_0x053c('0xd1'),'raw':!![]}]}]});}})[_0x053c('0x14')](function(_0x3a6283){if(_0x3a6283&&_0x3a6283[_0x053c('0xd0')]&&_0x476798[_0x053c('0xd2')]&&_0x476798[_0x053c('0xd3')]){var _0x30883a=_0x3a6283[_0x053c('0xd4')]();return respondWithRpcPromise(_0x053c('0xd5'),_0x053c('0xd6'),{'account':_0x30883a,'message':{'from':util[_0x053c('0xa2')](_0x053c('0xd7'),_0x3a6283[_0x053c('0x2c')],_0x3a6283[_0x053c('0xd8')]||_0x3a6283[_0x053c('0xd0')][_0x053c('0x50')]),'to':_0x476798[_0x053c('0xd3')],'subject':_0x476798['offlineMessageSubject'],'html':_0x5ba703[_0x053c('0x4f')],'attachments':_0x10d3e2}},client9003)[_0x053c('0x14')](function(){return _0x5ba703;})[_0x053c('0x1b')](function(_0x29720b){logger[_0x053c('0x18')](_0x29720b);});}})['then'](function(){if(_0x476798&&_0x476798['openNewInteraction']&&_0x476798['MailAccountId']){var _0x55f1fd=[];if(_0x4cf15e[_0x053c('0x3d')]){_0x55f1fd=_0x4cf15e[_0x053c('0x37')](function(_0x548c74){return{'name':_0x548c74[_0x053c('0xd9')],'basename':_0x548c74[_0x053c('0x64')],'type':_0x548c74['mimetype'],'ChatOfflineMessageId':_0x5af8dd['id']};});}var _0x193e34;if(!_[_0x053c('0x6d')](_0x476798[_0x053c('0xda')])){var _0x368544=_[_0x053c('0x37')](_0x3d1cf3[_0x053c('0x4f')],function(_0x321880){return _0x321880;});var _0xdb27fe=_[_0x053c('0xdb')](_0x368544)[0x0];var _0x5f333e=_[_0x053c('0xdc')](_0xdb27fe,function(_0x63142d){return _0x63142d;});_0x193e34=_0x5f333e[0x1][_0x476798[_0x053c('0xda')]];}var _0x2d7bd5={'from':_0x26cd40['email'],'firstName':_0x26cd40['firstName'],'lastName':_0x26cd40[_0x053c('0x9e')],'mapKey':_0x053c('0xd8'),'message':{'from':_0x26cd40[_0x053c('0xd8')],'to':_0x476798['MailAccount']['email'],'cc':'','subject':_['isNil'](_0x193e34)?_0x476798[_0x053c('0xdd')]:_0x193e34,'messageId':'','sentAt':new Date(),'attach':_0x55f1fd[_0x053c('0x3d')],'attachments':_0x55f1fd,'originChannel':_0x053c('0xde'),'ChatWebsiteId':_0x476798['id'],'ChatOfflineMessageId':_0x5ba703['id'],'originTo':_0x476798['MailAccount'][_0x053c('0xd8')]},'body':_0x5ba703[_0x053c('0x4f')]};var _0x27c9c4={'account':{'id':_0x476798[_0x053c('0xdf')]},'body':_0x2d7bd5,'log':_0x053c('0xe0')};return respondWithRpcPromise(_0x053c('0xe0'),'notifyMail',_0x27c9c4,client9001)[_0x053c('0x14')](function(){return _0x5ba703;})[_0x053c('0x1b')](function(_0x453637){logger[_0x053c('0x18')](_0x453637);});}return;})[_0x053c('0x14')](function(){if(_0x5ba703){return _0x5ba703;}})[_0x053c('0x14')](respondWithResult(_0x4465e0,null))['catch'](function(_0x2980aa){logger['error'](_0x053c('0x1b'),_0x2980aa);for(var _0x21305c of _0x4cf15e){var _0xb4f1f1=path['join'](config['root'],'server',_0x053c('0xc9'),_0x053c('0xe1'),_0x053c('0xca'),_0x21305c[_0x053c('0x64')]);fs_extra[_0x053c('0xe2')](_0xb4f1f1)[_0x053c('0x1b')](function(_0x17c9d5){logger[_0x053c('0x18')]('Could\x20not\x20remove\x20attachment\x20file',_0xb4f1f1,_0x17c9d5);});}});};exports[_0x053c('0xe3')]=function(_0x5b19e8,_0x41bfc5){return db[_0x053c('0xaa')]['find']({'where':{'id':_0x5b19e8[_0x053c('0x56')]['id']}})['then'](handleEntityNotFound(_0x41bfc5,null))[_0x053c('0x14')](function(_0x1d12ea){if(_0x1d12ea){return _0x1d12ea[_0x053c('0xe3')](_0x5b19e8[_0x053c('0x4f')][_0x053c('0x5c')],_[_0x053c('0xe4')](_0x5b19e8['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x41bfc5,null))[_0x053c('0x1b')](handleError(_0x41bfc5,null));};exports[_0x053c('0xe5')]=function(_0x5b2e19,_0x1c750c){var _0x1801de={'raw':![],'where':{}};var _0x32033b={};var _0x3477dc={'count':0x0,'rows':[]};return db[_0x053c('0x31')][_0x053c('0x60')]({'where':{'id':_0x5b2e19['params']['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x1c750c,null))[_0x053c('0x14')](function(_0x4da8e7){if(_0x4da8e7){_0x32033b[_0x053c('0x36')]=_[_0x053c('0x39')](db[_0x053c('0xaa')]['rawAttributes']);_0x32033b[_0x053c('0x38')]=_['keys'](_0x5b2e19[_0x053c('0x38')]);_0x32033b['filters']=_['intersection'](_0x32033b['model'],_0x32033b[_0x053c('0x38')]);_0x1801de[_0x053c('0x3b')]=_[_0x053c('0x3a')](_0x32033b[_0x053c('0x36')],qs['fields'](_0x5b2e19['query'][_0x053c('0x3c')]));_0x1801de[_0x053c('0x3b')]=_0x1801de[_0x053c('0x3b')][_0x053c('0x3d')]?_0x1801de[_0x053c('0x3b')]:_0x32033b[_0x053c('0x36')];if(!_0x5b2e19[_0x053c('0x38')][_0x053c('0x3e')](_0x053c('0x3f'))){_0x1801de[_0x053c('0x22')]=qs['limit'](_0x5b2e19[_0x053c('0x38')][_0x053c('0x22')]);_0x1801de[_0x053c('0x20')]=qs[_0x053c('0x20')](_0x5b2e19[_0x053c('0x38')]['offset']);}_0x1801de['order']=qs[_0x053c('0x41')](_0x5b2e19[_0x053c('0x38')][_0x053c('0x41')]);_0x1801de['where']=qs[_0x053c('0x43')](_[_0x053c('0x44')](_0x5b2e19[_0x053c('0x38')],_0x32033b[_0x053c('0x43')]));_0x1801de[_0x053c('0x42')][_0x053c('0x59')]=_0x4da8e7['id'];if(_0x5b2e19['query']['filter']){_0x1801de[_0x053c('0x42')]=_[_0x053c('0x46')](_0x1801de['where'],{'$or':_[_0x053c('0x37')](_0x1801de['attributes'],function(_0x537078){var _0x373fa2={};_0x373fa2[_0x537078]={'$like':'%'+_0x5b2e19['query'][_0x053c('0x45')]+'%'};return _0x373fa2;})});}_0x1801de=_[_0x053c('0x46')]({},_0x1801de,_0x5b2e19[_0x053c('0x47')]);return db[_0x053c('0xaa')][_0x053c('0x23')]({'where':_0x1801de[_0x053c('0x42')]})['then'](function(_0x23846e){_0x3477dc[_0x053c('0x23')]=_0x23846e;if(_0x5b2e19[_0x053c('0x38')][_0x053c('0x4c')]){_0x1801de[_0x053c('0x48')]=[{'model':db[_0x053c('0x80')],'as':_0x053c('0xe6'),'required':![]},{'model':db[_0x053c('0xe7')],'as':_0x053c('0xe8'),'attributes':['name',_0x053c('0xe9'),_0x053c('0xea')],'required':![]},{'model':db[_0x053c('0xeb')],'as':'Tags','attributes':['id','name',_0x053c('0xec')],'where':_0x5b2e19[_0x053c('0x38')]['tag']?{'id':_0x5b2e19[_0x053c('0x38')][_0x053c('0xed')]}:undefined,'required':_0x5b2e19['query'][_0x053c('0xed')]?!![]:![]}];}return db[_0x053c('0xaa')][_0x053c('0x49')](_0x1801de);})[_0x053c('0x14')](function(_0x4859a3){_0x3477dc[_0x053c('0x4a')]=_0x4859a3;return _0x3477dc;});}})[_0x053c('0x14')](respondWithFilteredResult(_0x1c750c,_0x1801de))['catch'](handleError(_0x1c750c,null));};function iftimePromise(_0x3e46ed,_0x26c555){return respondWithRpcPromise(_0x053c('0xee'),_0x053c('0xef'),{'command':_0x26c555[_0x053c('0xf0')]?util[_0x053c('0xa2')](_0x053c('0xf1'),_0x3e46ed['interval'],_0x26c555['timezone']):util['format'](_0x053c('0xf2'),_0x3e46ed[_0x053c('0xf3')])},client9002)[_0x053c('0x14')](function(_0x2e2c87){var _0x434ea4=_0x2e2c87&&_0x2e2c87[_0x053c('0xf4')]('true')>=0x0?!![]:![];logger['info'](_0x053c('0xf5'),_0x26c555['id'],_0x3e46ed['id'],_0x3e46ed['interval'],_0x434ea4?'ONLINE':_0x053c('0xf6'),_0x26c555[_0x053c('0xf0')]?_0x26c555[_0x053c('0xf0')]:_0x053c('0xf7'));return _0x434ea4;})[_0x053c('0x1b')](function(_0x392855){logger[_0x053c('0x18')](_0x053c('0xf5'),_0x26c555['id'],_0x3e46ed['id'],_0x3e46ed[_0x053c('0xf3')],util[_0x053c('0xf8')](_0x392855,{'showHidden':![],'depth':null}),_0x26c555[_0x053c('0xf0')]?_0x26c555[_0x053c('0xf0')]:_0x053c('0xf7'));return![];});}exports[_0x053c('0xef')]=function(_0x553923,_0x1a18d1){var _0x4b9699=0x0;var _0x37106f=0x0;var _0x232d7f=![];var _0x511f61;var _0xbf99eb;return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x553923[_0x053c('0x56')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x053c('0xf9')],'as':_0x053c('0xfa'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1a18d1,null))[_0x053c('0x14')](function(_0x100c30){if(_0x100c30){_0x511f61=_0x100c30;return _0x100c30[_0x053c('0xfb')]({'raw':!![]});}})['then'](function(_0x20ead2){if(_0x511f61){if(_0x20ead2){_0xbf99eb=_0x20ead2;}}return require(_0x053c('0xfc'))['getLicense']();})[_0x053c('0x14')](function(_0x3d0ade){if(_0x3d0ade){_0x37106f=_0x3d0ade[_0x053c('0xfd')];_0x232d7f=_0x3d0ade[_0x053c('0x6c')];}})[_0x053c('0x14')](function(){return db['ChatInteraction'][_0x053c('0x23')]({'where':{'closed':![]}});})[_0x053c('0x14')](function(_0x568df2){_0x4b9699=_0x568df2;if(_0x37106f&&_0x568df2>_0x37106f){return db[_0x053c('0xfe')][_0x053c('0x60')]({'where':{'id':0x1}})[_0x053c('0x14')](function(_0x4be783){if(_0x4be783){_0x4be783[_0x053c('0xff')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x511f61[_0x053c('0xf9')]&&_0x511f61['Interval'][_0x053c('0xfa')]){var _0x1f9fd7=[];for(var _0x399e46=0x0;_0x399e46<_0x511f61[_0x053c('0xf9')][_0x053c('0xfa')][_0x053c('0x3d')];_0x399e46++){var _0x292993=_0x511f61[_0x053c('0xf9')][_0x053c('0xfa')][_0x399e46][_0x053c('0x28')]({'plain':!![]});_0x1f9fd7['push'](iftimePromise(_0x292993,_0x511f61));}return BPromise[_0x053c('0x100')](_0x1f9fd7)[_0x053c('0x14')](function(_0x37ee28){return _['some'](_0x37ee28);});}else{return!![];}})[_0x053c('0x14')](function(_0x59b670){var _0x1b0a59=fs['readFileSync'](path[_0x053c('0x6e')](config[_0x053c('0x71')],_0x053c('0x101')),_0x053c('0xc1'));var _0x1153b7={'remote':_0x511f61[_0x053c('0x102')],'query':querystring[_0x053c('0xa8')](_[_0x053c('0x46')](_0x511f61['get']({'plain':!![]}),{'customerIp':_0x553923[_0x053c('0x7c')][_0x053c('0x9c')]||_0x553923[_0x053c('0x7c')]['x-real-ip']||_0x553923[_0x053c('0x103')][_0x053c('0x104')]||_0x553923['ip'],'referer':_0x553923[_0x053c('0x7c')][_0x053c('0x105')],'openedInteractions':_0x4b9699,'maxInteractions':_0x37106f,'virtual':_0x232d7f[_0x053c('0xfd')],'online':_0x59b670,'custom':_0x232d7f}))[_0x053c('0x106')](/'/g,'\x5c\x27')};_0x1a18d1[_0x053c('0x2d')](ejs[_0x053c('0xc2')](Mustache[_0x053c('0xc2')](_0x1b0a59,_0x1153b7),{'proactiveActions':_0xbf99eb,'alignment':_0x511f61[_0x053c('0x107')],'verticalAlignment':_0x511f61[_0x053c('0x108')],'div_color':_0x511f61[_0x053c('0xec')],'labelText':_0x511f61[_0x053c('0x109')],'text_color':_0x511f61[_0x053c('0x10a')],'text_button_color':_0x511f61[_0x053c('0x10b')],'button_color':_0x511f61['color_button'],'background_color':_0x511f61[_0x053c('0x10c')],'hideWhenOffline':_0x511f61['hideWhenOffline'],'interval':_0x511f61[_0x053c('0x10d')]}));})['catch'](handleError(_0x1a18d1,null));};exports['addApplications']=function(_0x2f479f,_0x5a66ae){var _0x167143=_0x2f479f['params']['id'];var _0x277c48=_0x2f479f[_0x053c('0x4f')];var _0x1b2b35=0xc8;var _0x5e4809=null;return db['sequelize'][_0x053c('0x10e')]({'isolationLevel':db[_0x053c('0xcd')][_0x053c('0x10f')][_0x053c('0x110')][_0x053c('0x111')]},function(_0xcdd2da){return db[_0x053c('0x31')]['findOne']({'where':{'id':_0x167143},'transaction':_0xcdd2da})[_0x053c('0x14')](function(_0x15cd52){if(_0x15cd52){return db[_0x053c('0x92')][_0x053c('0x27')]({'where':{'ChatWebsiteId':_0x167143},'transaction':_0xcdd2da})[_0x053c('0x14')](function(){var _0x5cb678=_['map'](_0x277c48,function(_0x200d5a){_0x200d5a['ChatWebsiteId']=_0x167143;return _0x200d5a;});return db[_0x053c('0x92')][_0x053c('0x112')](_0x5cb678,{'transaction':_0xcdd2da});});}else{_0x1b2b35=0x194;_0x5e4809=[];}});})['then'](function(){if(_0x1b2b35!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x167143},'order':_0x053c('0x113')})[_0x053c('0x14')](function(_0x1012b7){_0x5e4809=_0x1012b7;});}})['catch'](function(_0xfc639d){_0x1b2b35=0x1f4;logger[_0x053c('0x18')](_0xfc639d[_0x053c('0x2b')]);if(_0xfc639d['name']){delete _0xfc639d[_0x053c('0x2c')];}_0x5e4809=_0xfc639d;})[_0x053c('0x114')](function(){if(_0x5e4809===null){_0x5a66ae['sendStatus'](_0x1b2b35);}else{if(_0x1b2b35===0x1f4){_0x5a66ae[_0x053c('0x1d')](_0x1b2b35)[_0x053c('0x2d')](_0x5e4809);}else{_0x5a66ae['status'](_0x1b2b35)['json'](_0x5e4809);}}});};exports[_0x053c('0x115')]=function(_0x27d87b,_0x5a571c){var _0x312b95={};var _0x36e305={};var _0x49c555;var _0x2ea465;return db[_0x053c('0x31')][_0x053c('0x60')]({'where':{'id':_0x27d87b[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x5a571c,null))[_0x053c('0x14')](function(_0x219c81){if(_0x219c81){_0x49c555=_0x219c81;_0x36e305[_0x053c('0x36')]=_[_0x053c('0x39')](db[_0x053c('0x92')]['rawAttributes']);_0x36e305[_0x053c('0x38')]=_['keys'](_0x27d87b[_0x053c('0x38')]);_0x36e305[_0x053c('0x43')]=_[_0x053c('0x3a')](_0x36e305[_0x053c('0x36')],_0x36e305[_0x053c('0x38')]);_0x312b95['attributes']=_['intersection'](_0x36e305[_0x053c('0x36')],qs[_0x053c('0x3c')](_0x27d87b[_0x053c('0x38')]['fields']));_0x312b95[_0x053c('0x3b')]=_0x312b95[_0x053c('0x3b')]['length']?_0x312b95[_0x053c('0x3b')]:_0x36e305['model'];_0x312b95['order']=qs[_0x053c('0x41')](_0x27d87b[_0x053c('0x38')][_0x053c('0x41')]);_0x312b95[_0x053c('0x42')]=qs[_0x053c('0x43')](_[_0x053c('0x44')](_0x27d87b[_0x053c('0x38')],_0x36e305['filters']));if(_0x27d87b[_0x053c('0x38')][_0x053c('0x45')]){_0x312b95[_0x053c('0x42')]=_[_0x053c('0x46')](_0x312b95[_0x053c('0x42')],{'$or':_['map'](_0x312b95[_0x053c('0x3b')],function(_0x265026){var _0x4b9bbe={};_0x4b9bbe[_0x265026]={'$like':'%'+_0x27d87b['query'][_0x053c('0x45')]+'%'};return _0x4b9bbe;})});}_0x312b95=_[_0x053c('0x46')]({},_0x312b95,_0x27d87b[_0x053c('0x47')]);return _0x49c555['getApplications'](_0x312b95);}})[_0x053c('0x14')](function(_0x3e18d2){if(_0x3e18d2){_0x2ea465=_0x3e18d2['length'];if(!_0x27d87b[_0x053c('0x38')][_0x053c('0x3e')](_0x053c('0x3f'))){_0x312b95[_0x053c('0x22')]=qs['limit'](_0x27d87b[_0x053c('0x38')][_0x053c('0x22')]);_0x312b95[_0x053c('0x20')]=qs['offset'](_0x27d87b[_0x053c('0x38')]['offset']);}return _0x49c555[_0x053c('0x115')](_0x312b95);}})[_0x053c('0x14')](function(_0x3fe8a0){if(_0x3fe8a0){return _0x3fe8a0?{'count':_0x2ea465,'rows':_0x3fe8a0}:null;}})['then'](respondWithResult(_0x5a571c,null))[_0x053c('0x1b')](handleError(_0x5a571c,null));};exports['addProactiveActions']=function(_0x46174c,_0x1b2c84){return db[_0x053c('0x116')][_0x053c('0x4d')]({'where':{'id':_0x46174c[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x1b2c84,null))[_0x053c('0x14')](function(_0x115d1e){if(_0x115d1e){return _0x115d1e[_0x053c('0x117')](_0x46174c[_0x053c('0x4f')]['ids'],_[_0x053c('0xe4')](_0x46174c[_0x053c('0x4f')],['ids','id'])||{});}})[_0x053c('0x14')](respondWithResult(_0x1b2c84,null))[_0x053c('0x1b')](handleError(_0x1b2c84,null));};exports[_0x053c('0xfb')]=function(_0x1f7a54,_0x2e2f9f){var _0x19cf7e={};var _0x36fbde={};var _0x41e516;var _0x1b4cf2;return db[_0x053c('0x31')][_0x053c('0x60')]({'where':{'id':_0x1f7a54['params']['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x2e2f9f,null))['then'](function(_0x23ff76){if(_0x23ff76){_0x41e516=_0x23ff76;_0x36fbde[_0x053c('0x36')]=_[_0x053c('0x39')](db[_0x053c('0x118')]['rawAttributes']);_0x36fbde[_0x053c('0x38')]=_['keys'](_0x1f7a54[_0x053c('0x38')]);_0x36fbde['filters']=_[_0x053c('0x3a')](_0x36fbde['model'],_0x36fbde[_0x053c('0x38')]);_0x19cf7e[_0x053c('0x3b')]=_['intersection'](_0x36fbde['model'],qs[_0x053c('0x3c')](_0x1f7a54[_0x053c('0x38')][_0x053c('0x3c')]));_0x19cf7e[_0x053c('0x3b')]=_0x19cf7e[_0x053c('0x3b')]['length']?_0x19cf7e[_0x053c('0x3b')]:_0x36fbde[_0x053c('0x36')];_0x19cf7e['order']=qs[_0x053c('0x41')](_0x1f7a54[_0x053c('0x38')][_0x053c('0x41')]);_0x19cf7e['where']=qs[_0x053c('0x43')](_[_0x053c('0x44')](_0x1f7a54[_0x053c('0x38')],_0x36fbde[_0x053c('0x43')]));if(_0x1f7a54[_0x053c('0x38')]['filter']){_0x19cf7e[_0x053c('0x42')]=_['merge'](_0x19cf7e['where'],{'$or':_[_0x053c('0x37')](_0x19cf7e[_0x053c('0x3b')],function(_0x1ea165){var _0x6532b7={};_0x6532b7[_0x1ea165]={'$like':'%'+_0x1f7a54[_0x053c('0x38')][_0x053c('0x45')]+'%'};return _0x6532b7;})});}_0x19cf7e=_[_0x053c('0x46')]({},_0x19cf7e,_0x1f7a54[_0x053c('0x47')]);return _0x41e516[_0x053c('0xfb')](_0x19cf7e);}})[_0x053c('0x14')](function(_0x3e0da3){if(_0x3e0da3){_0x1b4cf2=_0x3e0da3[_0x053c('0x3d')];if(!_0x1f7a54['query']['hasOwnProperty']('nolimit')){_0x19cf7e[_0x053c('0x22')]=qs[_0x053c('0x22')](_0x1f7a54[_0x053c('0x38')][_0x053c('0x22')]);_0x19cf7e[_0x053c('0x20')]=qs[_0x053c('0x20')](_0x1f7a54[_0x053c('0x38')][_0x053c('0x20')]);}return _0x41e516[_0x053c('0xfb')](_0x19cf7e);}})[_0x053c('0x14')](function(_0x184c78){if(_0x184c78){return _0x184c78?{'count':_0x1b4cf2,'rows':_0x184c78}:null;}})['then'](respondWithResult(_0x2e2f9f,null))[_0x053c('0x1b')](handleError(_0x2e2f9f,null));};exports[_0x053c('0x119')]=function(_0x14473c,_0x1bb00e){var _0x15db53=_0x14473c[_0x053c('0x38')][_0x053c('0x11a')]===_0x053c('0x11b')?_0x053c('0x11c'):_0x053c('0x11d');return db[_0x053c('0x31')][_0x053c('0x4d')]({'attributes':['id',_0x15db53],'where':{'id':_0x14473c['params']['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x1bb00e,null))[_0x053c('0x14')](function(_0x3f0b4e){if(_0x3f0b4e){var _0x5ab042=_0x3f0b4e[_0x15db53];var _0xff722e=_0x5ab042&&_0x5ab042[_0x053c('0x11e')]?_0x5ab042[_0x053c('0x11e')]:[];_0x1bb00e[_0x053c('0x2d')]({'fromKey':_['isNil'](_0x5ab042[_0x053c('0x11f')])?undefined:_0x5ab042['fromKey'],'count':_0xff722e['length'],'rows':_0xff722e});}})[_0x053c('0x1b')](handleError(_0x1bb00e,null));};exports['getOfflineMessages']=function(_0x4467a8,_0x57fd76){var _0x1d98fa={'raw':![],'where':{}};var _0x431bb7={};var _0xadae69={'count':0x0,'rows':[]};return db[_0x053c('0x31')]['findOne']({'where':{'id':_0x4467a8['params']['id']}})['then'](handleEntityNotFound(_0x57fd76,null))[_0x053c('0x14')](function(_0x417a3f){if(_0x417a3f){_0x431bb7[_0x053c('0x36')]=_[_0x053c('0x39')](db['ChatOfflineMessage']['rawAttributes']);_0x431bb7[_0x053c('0x38')]=_[_0x053c('0x39')](_0x4467a8[_0x053c('0x38')]);_0x431bb7['filters']=_[_0x053c('0x3a')](_0x431bb7['model'],_0x431bb7['query']);_0x1d98fa[_0x053c('0x3b')]=_[_0x053c('0x3a')](_0x431bb7[_0x053c('0x36')],qs[_0x053c('0x3c')](_0x4467a8[_0x053c('0x38')]['fields']));_0x1d98fa['attributes']=_0x1d98fa[_0x053c('0x3b')][_0x053c('0x3d')]?_0x1d98fa['attributes']:_0x431bb7[_0x053c('0x36')];if(!_0x4467a8['query'][_0x053c('0x3e')]('nolimit')){_0x1d98fa[_0x053c('0x22')]=qs['limit'](_0x4467a8['query'][_0x053c('0x22')]);_0x1d98fa['offset']=qs[_0x053c('0x20')](_0x4467a8['query'][_0x053c('0x20')]);}_0x1d98fa['order']=qs[_0x053c('0x41')](_0x4467a8[_0x053c('0x38')][_0x053c('0x41')]);_0x1d98fa[_0x053c('0x42')]=qs[_0x053c('0x43')](_[_0x053c('0x44')](_0x4467a8[_0x053c('0x38')],_0x431bb7[_0x053c('0x43')]));_0x1d98fa[_0x053c('0x42')][_0x053c('0x59')]=_0x417a3f['id'];if(_0x4467a8['query'][_0x053c('0x45')]){_0x1d98fa['where']=_['merge'](_0x1d98fa['where'],{'$or':_[_0x053c('0x37')](_0x1d98fa[_0x053c('0x3b')],function(_0x351b9d){var _0x1e589a={};_0x1e589a[_0x351b9d]={'$like':'%'+_0x4467a8[_0x053c('0x38')]['filter']+'%'};return _0x1e589a;})});}_0x1d98fa=_[_0x053c('0x46')]({},_0x1d98fa,_0x4467a8[_0x053c('0x47')]);return db[_0x053c('0xc5')][_0x053c('0x23')]({'where':_0x1d98fa[_0x053c('0x42')]})[_0x053c('0x14')](function(_0x3affb0){_0xadae69[_0x053c('0x23')]=_0x3affb0;if(_0x4467a8[_0x053c('0x38')][_0x053c('0x4c')]){_0x1d98fa[_0x053c('0x48')]=[{'all':!![]}];}else{_0x1d98fa[_0x053c('0x48')]=[{'model':db['CmContact'],'as':_0x053c('0xe6'),'required':![]},{'model':db[_0x053c('0xce')],'as':_0x053c('0x120'),'required':![]}];}return db['ChatOfflineMessage'][_0x053c('0x49')](_0x1d98fa);})[_0x053c('0x14')](function(_0x156c51){_0xadae69[_0x053c('0x4a')]=_0x156c51;return _0xadae69;});}})[_0x053c('0x14')](respondWithFilteredResult(_0x57fd76,_0x1d98fa))[_0x053c('0x1b')](handleError(_0x57fd76,null));};exports[_0x053c('0x121')]=function(_0x2ac09d,_0x4f231d){return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0x2ac09d[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x4f231d,null))[_0x053c('0x14')](function(_0x232bda){if(_0x232bda){return _0x232bda[_0x053c('0x121')](_0x2ac09d[_0x053c('0x4f')][_0x053c('0x5c')],_['omit'](_0x2ac09d[_0x053c('0x4f')],[_0x053c('0x5c'),'id'])||{})[_0x053c('0x122')](function(_0x4619be){for(var _0x450657=0x0;_0x450657<_0x2ac09d['body'][_0x053c('0x5c')][_0x053c('0x3d')];_0x450657+=0x1){socket[_0x053c('0x123')](_0x053c('0x124'),{'UserId':Number(_0x2ac09d[_0x053c('0x4f')][_0x053c('0x5c')][_0x450657]),'ChatWebsiteId':Number(_0x2ac09d['params']['id'])});}return _0x4619be;});}})[_0x053c('0x14')](respondWithResult(_0x4f231d,null))['catch'](handleError(_0x4f231d,null));};exports['removeAgents']=function(_0xba05fb,_0x4a04ac){return db[_0x053c('0x31')][_0x053c('0x4d')]({'where':{'id':_0xba05fb['params']['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x4a04ac,null))[_0x053c('0x14')](function(_0x32c2f3){if(_0x32c2f3){return _0x32c2f3[_0x053c('0x125')](_0xba05fb['query'][_0x053c('0x5c')])[_0x053c('0x14')](function(){if(_[_0x053c('0x126')](_0xba05fb['query'][_0x053c('0x5c')])){for(var _0x242328=0x0;_0x242328<_0xba05fb[_0x053c('0x38')][_0x053c('0x5c')]['length'];_0x242328+=0x1){socket[_0x053c('0x123')](_0x053c('0x127'),{'UserId':Number(_0xba05fb[_0x053c('0x38')][_0x053c('0x5c')][_0x242328]),'ChatWebsiteId':Number(_0xba05fb[_0x053c('0x56')]['id'])});}}else{socket['emit'](_0x053c('0x127'),{'UserId':Number(_0xba05fb['query']['ids']),'ChatWebsiteId':Number(_0xba05fb[_0x053c('0x56')]['id'])});}});}})[_0x053c('0x14')](respondWithStatusCode(_0x4a04ac,null))['catch'](handleError(_0x4a04ac,null));};exports[_0x053c('0x128')]=function(_0x53f192,_0x4ce574){var _0x292cc2={};var _0x2092e0={};var _0x55fc43;var _0xbd08ad;return db['ChatWebsite'][_0x053c('0x60')]({'where':{'id':_0x53f192[_0x053c('0x56')]['id']}})[_0x053c('0x14')](handleEntityNotFound(_0x4ce574,null))[_0x053c('0x14')](function(_0x5cf81a){if(_0x5cf81a){_0x55fc43=_0x5cf81a;_0x2092e0[_0x053c('0x36')]=_[_0x053c('0x39')](db[_0x053c('0xe7')]['rawAttributes']);_0x2092e0[_0x053c('0x38')]=_[_0x053c('0x39')](_0x53f192[_0x053c('0x38')]);_0x2092e0[_0x053c('0x43')]=_[_0x053c('0x3a')](_0x2092e0[_0x053c('0x36')],_0x2092e0[_0x053c('0x38')]);_0x292cc2['attributes']=_['intersection'](_0x2092e0[_0x053c('0x36')],qs['fields'](_0x53f192[_0x053c('0x38')][_0x053c('0x3c')]));_0x292cc2[_0x053c('0x3b')]=_0x292cc2[_0x053c('0x3b')][_0x053c('0x3d')]?_0x292cc2[_0x053c('0x3b')]:_0x2092e0[_0x053c('0x36')];_0x292cc2['order']=qs[_0x053c('0x41')](_0x53f192[_0x053c('0x38')][_0x053c('0x41')]);_0x292cc2['where']=qs[_0x053c('0x43')](_[_0x053c('0x44')](_0x53f192[_0x053c('0x38')],_0x2092e0[_0x053c('0x43')]));if(_0x53f192[_0x053c('0x38')][_0x053c('0x45')]){_0x292cc2[_0x053c('0x42')]=_['merge'](_0x292cc2[_0x053c('0x42')],{'$or':_['map'](_0x292cc2[_0x053c('0x3b')],function(_0x29e90c){var _0x288d6c={};_0x288d6c[_0x29e90c]={'$like':'%'+_0x53f192[_0x053c('0x38')][_0x053c('0x45')]+'%'};return _0x288d6c;})});}_0x292cc2=_[_0x053c('0x46')]({},_0x292cc2,_0x53f192[_0x053c('0x47')]);return _0x55fc43[_0x053c('0x128')](_0x292cc2);}})[_0x053c('0x14')](function(_0x105071){if(_0x105071){_0xbd08ad=_0x105071[_0x053c('0x3d')];if(!_0x53f192['query']['hasOwnProperty'](_0x053c('0x3f'))){_0x292cc2[_0x053c('0x22')]=qs[_0x053c('0x22')](_0x53f192[_0x053c('0x38')][_0x053c('0x22')]);_0x292cc2['offset']=qs[_0x053c('0x20')](_0x53f192[_0x053c('0x38')][_0x053c('0x20')]);}return _0x55fc43[_0x053c('0x128')](_0x292cc2);}})[_0x053c('0x14')](function(_0x1a9522){if(_0x1a9522){return _0x1a9522?{'count':_0xbd08ad,'rows':_0x1a9522}:null;}})[_0x053c('0x14')](respondWithResult(_0x4ce574,null))['catch'](handleError(_0x4ce574,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index af6501a..e1108f6 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 _0xf873=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatWebsite'];(function(_0x323d87,_0x4ef3f9){var _0x5e8f74=function(_0x185735){while(--_0x185735){_0x323d87['push'](_0x323d87['shift']());}};_0x5e8f74(++_0x4ef3f9);}(_0xf873,0xb2));var _0x3f87=function(_0x20dbbb,_0x4ee709){_0x20dbbb=_0x20dbbb-0x0;var _0x52aee3=_0xf873[_0x20dbbb];return _0x52aee3;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x3f87('0x0'))['db'][_0x3f87('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3f87('0x2')](0x0);var events={'afterCreate':_0x3f87('0x3'),'afterUpdate':_0x3f87('0x4'),'afterDestroy':_0x3f87('0x5')};function emitEvent(_0x2fbb4f){return function(_0x1d68dd,_0x3c80d6,_0x4a909e){ChatWebsiteEvents[_0x3f87('0x6')](_0x2fbb4f+':'+_0x1d68dd['id'],_0x1d68dd);ChatWebsiteEvents[_0x3f87('0x6')](_0x2fbb4f,_0x1d68dd);_0x4a909e(null);};}for(var e in events){if(events[_0x3f87('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x3f87('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x09f4=['update','remove','emit','exports','ChatWebsite','setMaxListeners','save'];(function(_0x3da940,_0x4bbf14){var _0x2e6abf=function(_0x1eae06){while(--_0x1eae06){_0x3da940['push'](_0x3da940['shift']());}};_0x2e6abf(++_0x4bbf14);}(_0x09f4,0xe4));var _0x409f=function(_0x3eef0d,_0x38a38b){_0x3eef0d=_0x3eef0d-0x0;var _0x2c78fc=_0x09f4[_0x3eef0d];return _0x2c78fc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x409f('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x409f('0x1')](0x0);var events={'afterCreate':_0x409f('0x2'),'afterUpdate':_0x409f('0x3'),'afterDestroy':_0x409f('0x4')};function emitEvent(_0x13f1a1){return function(_0x1d859b,_0x3c329a,_0x13f683){ChatWebsiteEvents[_0x409f('0x5')](_0x13f1a1+':'+_0x1d859b['id'],_0x1d859b);ChatWebsiteEvents[_0x409f('0x5')](_0x13f1a1,_0x1d859b);_0x13f683(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x409f('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 53c8ed6..dcecee1 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 _0xf5be=['api','moment','bluebird','request-promise','rimraf','define','ChatWebsite','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5be,0x13d));var _0xef5b=function(_0x1668d4,_0x4bd9dc){_0x1668d4=_0x1668d4-0x0;var _0x4e8393=_0xf5be[_0x1668d4];return _0x4e8393;};'use strict';var _=require(_0xef5b('0x0'));var util=require(_0xef5b('0x1'));var logger=require(_0xef5b('0x2'))(_0xef5b('0x3'));var moment=require(_0xef5b('0x4'));var BPromise=require(_0xef5b('0x5'));var rp=require(_0xef5b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef5b('0x7'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x329e32,_0x228b18){return _0x329e32[_0xef5b('0x8')](_0xef5b('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a1e=['chat_websites','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','define'];(function(_0x2f880a,_0x4551fb){var _0x5bef2a=function(_0x30f395){while(--_0x30f395){_0x2f880a['push'](_0x2f880a['shift']());}};_0x5bef2a(++_0x4551fb);}(_0x3a1e,0xc7));var _0xe3a1=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0x3a1e[_0x48c615];return _0x3d9e22;};'use strict';var _=require(_0xe3a1('0x0'));var util=require(_0xe3a1('0x1'));var logger=require(_0xe3a1('0x2'))(_0xe3a1('0x3'));var moment=require('moment');var BPromise=require(_0xe3a1('0x4'));var rp=require(_0xe3a1('0x5'));var fs=require('fs');var path=require(_0xe3a1('0x6'));var rimraf=require('rimraf');var config=require(_0xe3a1('0x7'));var attributes=require(_0xe3a1('0x8'));module['exports']=function(_0xd69498,_0xec1ea4){return _0xd69498[_0xe3a1('0x9')]('ChatWebsite',attributes,{'tableName':_0xe3a1('0xa'),'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 21a0fb0..d41cee4 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 _0x3f83=['debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x3a9220,_0x99eca7){var _0x984447=function(_0x8b60d6){while(--_0x8b60d6){_0x3a9220['push'](_0x3a9220['shift']());}};_0x984447(++_0x99eca7);}(_0x3f83,0x1aa));var _0x33f8=function(_0x5ed7bc,_0x270b64){_0x5ed7bc=_0x5ed7bc-0x0;var _0xd37edc=_0x3f83[_0x5ed7bc];return _0xd37edc;};'use strict';var _=require(_0x33f8('0x0'));var util=require(_0x33f8('0x1'));var moment=require(_0x33f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x33f8('0x3'));var fs=require('fs');var Redis=require(_0x33f8('0x4'));var db=require(_0x33f8('0x5'))['db'];var utils=require(_0x33f8('0x6'));var logger=require(_0x33f8('0x7'))(_0x33f8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x33f8('0x9')][_0x33f8('0xa')]({'port':0x232a});config[_0x33f8('0xb')]=_[_0x33f8('0xc')](config[_0x33f8('0xb')],{'host':_0x33f8('0xd'),'port':0x18eb});var socket=require(_0x33f8('0xe'))(new Redis(config[_0x33f8('0xb')]));require(_0x33f8('0xf'))[_0x33f8('0x10')](socket);function respondWithRpcPromise(_0x20c104,_0x165214,_0x2ad8a1){return new BPromise(function(_0x827fc1,_0x4181bb){return client[_0x33f8('0x11')](_0x20c104,_0x2ad8a1)[_0x33f8('0x12')](function(_0x4d5e64){logger[_0x33f8('0x13')](_0x33f8('0x14'),_0x165214,_0x33f8('0x15'));logger[_0x33f8('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x165214,_0x33f8('0x15'),JSON[_0x33f8('0x17')](_0x4d5e64));if(_0x4d5e64[_0x33f8('0x18')]){if(_0x4d5e64[_0x33f8('0x18')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x165214,_0x4d5e64[_0x33f8('0x18')][_0x33f8('0x19')]);return _0x4181bb(_0x4d5e64[_0x33f8('0x18')][_0x33f8('0x19')]);}logger[_0x33f8('0x18')](_0x33f8('0x14'),_0x165214,_0x4d5e64['error']['message']);return _0x827fc1(_0x4d5e64[_0x33f8('0x18')][_0x33f8('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x165214,_0x33f8('0x15'));_0x827fc1(_0x4d5e64[_0x33f8('0x1a')]['message']);}})[_0x33f8('0x1b')](function(_0x4934de){logger[_0x33f8('0x18')](_0x33f8('0x14'),_0x165214,_0x4934de);_0x4181bb(_0x4934de);});});}
\ No newline at end of file
+var _0xa3ab=['localhost','socket.io-emitter','./chatWebsite.socket','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa3ab,0x1ec));var _0xba3a=function(_0x2fa50a,_0xf02cd){_0x2fa50a=_0x2fa50a-0x0;var _0x47a58f=_0xa3ab[_0x2fa50a];return _0x47a58f;};'use strict';var _=require(_0xba3a('0x0'));var util=require(_0xba3a('0x1'));var moment=require(_0xba3a('0x2'));var BPromise=require(_0xba3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xba3a('0x5'));var logger=require('../../config/logger')(_0xba3a('0x6'));var config=require(_0xba3a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba3a('0x8')][_0xba3a('0x9')]({'port':0x232a});config[_0xba3a('0xa')]=_[_0xba3a('0xb')](config['redis'],{'host':_0xba3a('0xc'),'port':0x18eb});var socket=require(_0xba3a('0xd'))(new Redis(config[_0xba3a('0xa')]));require(_0xba3a('0xe'))['register'](socket);function respondWithRpcPromise(_0x460550,_0x170dd2,_0xff9490){return new BPromise(function(_0x31e8c2,_0x20bdae){return client['request'](_0x460550,_0xff9490)[_0xba3a('0xf')](function(_0x5680af){logger[_0xba3a('0x10')](_0xba3a('0x11'),_0x170dd2,_0xba3a('0x12'));logger['debug'](_0xba3a('0x13'),_0x170dd2,_0xba3a('0x12'),JSON[_0xba3a('0x14')](_0x5680af));if(_0x5680af[_0xba3a('0x15')]){if(_0x5680af['error']['code']===0x1f4){logger[_0xba3a('0x15')](_0xba3a('0x11'),_0x170dd2,_0x5680af[_0xba3a('0x15')][_0xba3a('0x16')]);return _0x20bdae(_0x5680af[_0xba3a('0x15')][_0xba3a('0x16')]);}logger['error'](_0xba3a('0x11'),_0x170dd2,_0x5680af[_0xba3a('0x15')]['message']);return _0x31e8c2(_0x5680af['error'][_0xba3a('0x16')]);}else{logger[_0xba3a('0x10')](_0xba3a('0x11'),_0x170dd2,_0xba3a('0x12'));_0x31e8c2(_0x5680af[_0xba3a('0x17')][_0xba3a('0x16')]);}})['catch'](function(_0x5b6c4b){logger[_0xba3a('0x15')](_0xba3a('0x11'),_0x170dd2,_0x5b6c4b);_0x20bdae(_0x5b6c4b);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 26acd23..4b5de1f 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 _0xdc0a=['length','chatWebsite:','./chatWebsite.events','save','emit','removeListener','register'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xdc0a,0x1f3));var _0xadc0=function(_0x50a25c,_0x589d2a){_0x50a25c=_0x50a25c-0x0;var _0x4d0fc9=_0xdc0a[_0x50a25c];return _0x4d0fc9;};'use strict';var ChatWebsiteEvents=require(_0xadc0('0x0'));var events=[_0xadc0('0x1'),'remove','update'];function createListener(_0x5aaefb,_0x402f4d){return function(_0x56567b){_0x402f4d[_0xadc0('0x2')](_0x5aaefb,_0x56567b);};}function removeListener(_0x5ddbeb,_0x68e68b){return function(){ChatWebsiteEvents[_0xadc0('0x3')](_0x5ddbeb,_0x68e68b);};}exports[_0xadc0('0x4')]=function(_0x27adf5){for(var _0x4d70cc=0x0,_0x341a8c=events[_0xadc0('0x5')];_0x4d70cc<_0x341a8c;_0x4d70cc++){var _0x115194=events[_0x4d70cc];var _0x113ba0=createListener(_0xadc0('0x6')+_0x115194,_0x27adf5);ChatWebsiteEvents['on'](_0x115194,_0x113ba0);}};
\ No newline at end of file
+var _0x5cb9=['emit','removeListener','register','length','save','remove','update'];(function(_0x2d2bbc,_0x2e5f03){var _0x4ec2e2=function(_0x520ddc){while(--_0x520ddc){_0x2d2bbc['push'](_0x2d2bbc['shift']());}};_0x4ec2e2(++_0x2e5f03);}(_0x5cb9,0x1d9));var _0x95cb=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5cb9[_0x5f0089];return _0x193892;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x95cb('0x0'),_0x95cb('0x1'),_0x95cb('0x2')];function createListener(_0x4baac6,_0x40f3b1){return function(_0x33f49a){_0x40f3b1[_0x95cb('0x3')](_0x4baac6,_0x33f49a);};}function removeListener(_0x37f3d6,_0x551e4b){return function(){ChatWebsiteEvents[_0x95cb('0x4')](_0x37f3d6,_0x551e4b);};}exports[_0x95cb('0x5')]=function(_0x2b021c){for(var _0xac6524=0x0,_0x4fe332=events[_0x95cb('0x6')];_0xac6524<_0x4fe332;_0xac6524++){var _0x21a77b=events[_0xac6524];var _0x3c2b5c=createListener('chatWebsite:'+_0x21a77b,_0x2b021c);ChatWebsiteEvents['on'](_0x21a77b,_0x3c2b5c);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index cb963cc..e35beef 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 _0x579a=['/:id/notify','server/files','offline-chat','ensureDir','extname','/:id/offline','any','/:id/applications','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','join','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar'];(function(_0x1f358d,_0x243b2f){var _0x53f2bf=function(_0x389b8a){while(--_0x389b8a){_0x1f358d['push'](_0x1f358d['shift']());}};_0x53f2bf(++_0x243b2f);}(_0x579a,0x9a));var _0xa579=function(_0x539fc5,_0x34ea87){_0x539fc5=_0x539fc5-0x0;var _0x41a99d=_0x579a[_0x539fc5];return _0x41a99d;};'use strict';var multer=require('multer');var util=require(_0xa579('0x0'));var path=require(_0xa579('0x1'));var timeout=require(_0xa579('0x2'));var express=require(_0xa579('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa579('0x4'));var interaction=require(_0xa579('0x5'));var config=require(_0xa579('0x6'));var controller=require(_0xa579('0x7'));router[_0xa579('0x8')]('/',auth[_0xa579('0x9')](),controller[_0xa579('0xa')]);router[_0xa579('0x8')](_0xa579('0xb'),auth[_0xa579('0x9')](),controller['describe']);router[_0xa579('0x8')]('/:id',auth[_0xa579('0x9')](),controller[_0xa579('0xc')]);router['get'](_0xa579('0xd'),auth[_0xa579('0x9')](),controller[_0xa579('0xe')]);router[_0xa579('0x8')](_0xa579('0xf'),auth[_0xa579('0x9')](),controller[_0xa579('0x10')]);router[_0xa579('0x8')](_0xa579('0x11'),controller['getLogo']);router[_0xa579('0x8')](_0xa579('0x12'),controller[_0xa579('0x13')]);router['get']('/:id/customer_avatar',controller[_0xa579('0x14')]);router[_0xa579('0x8')](_0xa579('0x15'),controller[_0xa579('0x16')]);router['get'](_0xa579('0x17'),auth[_0xa579('0x9')](),controller['getInteractions']);router[_0xa579('0x8')](_0xa579('0x18'),controller[_0xa579('0x19')]);router[_0xa579('0x8')]('/:id/applications',auth[_0xa579('0x9')](),controller[_0xa579('0x1a')]);router['get'](_0xa579('0x1b'),auth[_0xa579('0x9')](),controller[_0xa579('0x1c')]);router['get'](_0xa579('0x1d'),controller[_0xa579('0x1e')]);router['get'](_0xa579('0x1f'),auth['isAuthenticated'](),controller[_0xa579('0x20')]);router['get'](_0xa579('0x21'),auth[_0xa579('0x9')](),controller['getAgents']);router[_0xa579('0x22')]('/',auth[_0xa579('0x9')](),controller['create']);router[_0xa579('0x22')](_0xa579('0xd'),auth[_0xa579('0x9')](),controller[_0xa579('0x23')]);router['post'](_0xa579('0xf'),auth['isAuthenticated'](),controller[_0xa579('0x24')]);var upload=multer({'storage':multer[_0xa579('0x25')]({'destination':function(_0x343f43,_0x5d1ea4,_0x49b9cc){_0x49b9cc(null,path['join'](config[_0xa579('0x26')],_0xa579('0x27')));},'filename':function(_0x449e0c,_0x1638b5,_0x25b8a2){_0x25b8a2(null,util[_0xa579('0x28')](_0xa579('0x29'),Date[_0xa579('0x2a')](),_0x1638b5[_0xa579('0x2b')]));}})});router[_0xa579('0x22')](_0xa579('0x11'),upload[_0xa579('0x2c')](_0xa579('0x2d')),controller[_0xa579('0x2e')]);var upload=multer({'storage':multer[_0xa579('0x25')]({'destination':function(_0x4643ec,_0x4dafd8,_0x57ea69){_0x57ea69(null,path['join'](config[_0xa579('0x26')],_0xa579('0x2f')));},'filename':function(_0x338ae7,_0x43855c,_0x40eea7){_0x40eea7(null,util[_0xa579('0x28')](_0xa579('0x29'),Date['now'](),_0x43855c['originalname']));}})});router['post'](_0xa579('0x12'),upload[_0xa579('0x2c')]('file'),controller[_0xa579('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x668ec4,_0x3d006e,_0xe2a94b){_0xe2a94b(null,path[_0xa579('0x31')](config['root'],_0xa579('0x2f')));},'filename':function(_0x17b1fb,_0x56ac10,_0xfa7065){_0xfa7065(null,util[_0xa579('0x28')](_0xa579('0x29'),Date['now'](),_0x56ac10[_0xa579('0x2b')]));}})});router[_0xa579('0x22')](_0xa579('0x32'),upload['single'](_0xa579('0x2d')),controller[_0xa579('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x518254,_0x421a64,_0x178b7f){_0x178b7f(null,path[_0xa579('0x31')](config[_0xa579('0x26')],_0xa579('0x2f')));},'filename':function(_0x438e84,_0x22acf6,_0x3cc270){_0x3cc270(null,util['format'](_0xa579('0x29'),Date[_0xa579('0x2a')](),_0x22acf6[_0xa579('0x2b')]));}})});router[_0xa579('0x22')](_0xa579('0x15'),upload['single']('file'),controller[_0xa579('0x34')]);router[_0xa579('0x22')](_0xa579('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xa579('0x25')]({'destination':function(_0x1678fa,_0x1f1318,_0x962bab){const _0x569e86=path[_0xa579('0x31')](config['root'],_0xa579('0x36'),'attachments',_0xa579('0x37'));fs_extra[_0xa579('0x38')](_0x569e86,function(){_0x962bab(null,_0x569e86);});},'filename':function(_0x112998,_0x3d7d5e,_0x33cc14){const _0xd4661d=_0x3d7d5e[_0xa579('0x2b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x6ab6b4=path[_0xa579('0x39')](_0xd4661d);const _0x4da768=Date[_0xa579('0x2a')]()+'-'+_0xd4661d['replace'](_0x6ab6b4,'')+_0x6ab6b4;_0x33cc14(null,_0x4da768);}})});router[_0xa579('0x22')](_0xa579('0x3a'),offlineUploadMulter[_0xa579('0x3b')](),controller['offline']);router['post'](_0xa579('0x17'),auth[_0xa579('0x9')](),controller['addInteraction']);router[_0xa579('0x22')](_0xa579('0x3c'),auth[_0xa579('0x9')](),controller['addApplications']);router['post'](_0xa579('0x1b'),auth[_0xa579('0x9')](),controller['addProactiveActions']);router[_0xa579('0x22')]('/:id/users',auth[_0xa579('0x9')](),controller['addAgents']);router[_0xa579('0x3d')](_0xa579('0x3e'),auth[_0xa579('0x9')](),controller[_0xa579('0x3f')]);router[_0xa579('0x40')](_0xa579('0x3e'),auth[_0xa579('0x9')](),controller[_0xa579('0x41')]);router[_0xa579('0x40')](_0xa579('0xd'),auth['isAuthenticated'](),controller[_0xa579('0x42')]);router[_0xa579('0x40')](_0xa579('0xf'),auth[_0xa579('0x9')](),controller[_0xa579('0x43')]);router[_0xa579('0x40')](_0xa579('0x21'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa579('0x44')]=router;
\ No newline at end of file
+var _0xe5b6=['getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','/:id/users','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','originalname','/:id/logo','single','file','addLogo','join','server/files/images/avatars/','now','format','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xe5b6,0x10b));var _0x6e5b=function(_0x4bc2d7,_0x9f0153){_0x4bc2d7=_0x4bc2d7-0x0;var _0x4548dc=_0xe5b6[_0x4bc2d7];return _0x4548dc;};'use strict';var multer=require(_0x6e5b('0x0'));var util=require(_0x6e5b('0x1'));var path=require(_0x6e5b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6e5b('0x3'));var auth=require(_0x6e5b('0x4'));var interaction=require(_0x6e5b('0x5'));var config=require('../../config/environment');var controller=require(_0x6e5b('0x6'));router[_0x6e5b('0x7')]('/',auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x9')]);router[_0x6e5b('0x7')](_0x6e5b('0xa'),auth['isAuthenticated'](),controller[_0x6e5b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6e5b('0xc')]);router[_0x6e5b('0x7')](_0x6e5b('0xd'),auth[_0x6e5b('0x8')](),controller[_0x6e5b('0xe')]);router['get']('/:id/canned_answers',auth[_0x6e5b('0x8')](),controller[_0x6e5b('0xf')]);router['get']('/:id/logo',controller[_0x6e5b('0x10')]);router[_0x6e5b('0x7')](_0x6e5b('0x11'),controller[_0x6e5b('0x12')]);router['get'](_0x6e5b('0x13'),controller[_0x6e5b('0x14')]);router[_0x6e5b('0x7')](_0x6e5b('0x15'),controller[_0x6e5b('0x16')]);router['get'](_0x6e5b('0x17'),auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x18')]);router[_0x6e5b('0x7')]('/:id/snippet',controller[_0x6e5b('0x19')]);router[_0x6e5b('0x7')](_0x6e5b('0x1a'),auth['isAuthenticated'](),controller[_0x6e5b('0x1b')]);router['get']('/:id/proactive_actions',auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x1c')]);router[_0x6e5b('0x7')]('/:id/fields',controller[_0x6e5b('0x1d')]);router['get'](_0x6e5b('0x1e'),auth[_0x6e5b('0x8')](),controller['getOfflineMessages']);router[_0x6e5b('0x7')](_0x6e5b('0x1f'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x20')]);router[_0x6e5b('0x21')](_0x6e5b('0xd'),auth['isAuthenticated'](),controller[_0x6e5b('0x22')]);router['post'](_0x6e5b('0x23'),auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x24')]);var upload=multer({'storage':multer[_0x6e5b('0x25')]({'destination':function(_0x4bebae,_0x3c76dd,_0x1e312f){_0x1e312f(null,path['join'](config[_0x6e5b('0x26')],_0x6e5b('0x27')));},'filename':function(_0x3698bd,_0x3f65d9,_0x390310){_0x390310(null,util['format'](_0x6e5b('0x28'),Date['now'](),_0x3f65d9[_0x6e5b('0x29')]));}})});router[_0x6e5b('0x21')](_0x6e5b('0x2a'),upload[_0x6e5b('0x2b')](_0x6e5b('0x2c')),controller[_0x6e5b('0x2d')]);var upload=multer({'storage':multer[_0x6e5b('0x25')]({'destination':function(_0x49ca9a,_0x2618a7,_0x4733f3){_0x4733f3(null,path[_0x6e5b('0x2e')](config['root'],_0x6e5b('0x2f')));},'filename':function(_0x2f2783,_0x4ed8fe,_0x266c6e){_0x266c6e(null,util['format']('%s-%s',Date[_0x6e5b('0x30')](),_0x4ed8fe[_0x6e5b('0x29')]));}})});router[_0x6e5b('0x21')](_0x6e5b('0x11'),upload['single'](_0x6e5b('0x2c')),controller['addAvatar']);var upload=multer({'storage':multer[_0x6e5b('0x25')]({'destination':function(_0x206426,_0x5914a9,_0x16394d){_0x16394d(null,path['join'](config[_0x6e5b('0x26')],_0x6e5b('0x2f')));},'filename':function(_0x2e5724,_0x398db7,_0xd89c61){_0xd89c61(null,util[_0x6e5b('0x31')](_0x6e5b('0x28'),Date['now'](),_0x398db7[_0x6e5b('0x29')]));}})});router[_0x6e5b('0x21')](_0x6e5b('0x13'),upload[_0x6e5b('0x2b')](_0x6e5b('0x2c')),controller[_0x6e5b('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x11ab13,_0x3b622c,_0x35c0fc){_0x35c0fc(null,path[_0x6e5b('0x2e')](config['root'],_0x6e5b('0x2f')));},'filename':function(_0x43ebc9,_0x15aab3,_0x4914d9){_0x4914d9(null,util[_0x6e5b('0x31')]('%s-%s',Date[_0x6e5b('0x30')](),_0x15aab3[_0x6e5b('0x29')]));}})});router['post'](_0x6e5b('0x15'),upload[_0x6e5b('0x2b')](_0x6e5b('0x2c')),controller[_0x6e5b('0x33')]);router[_0x6e5b('0x21')](_0x6e5b('0x34'),controller[_0x6e5b('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x6e5b('0x25')]({'destination':function(_0x2a0ac8,_0x403532,_0x5b4572){const _0x4eb913=path[_0x6e5b('0x2e')](config[_0x6e5b('0x26')],_0x6e5b('0x36'),_0x6e5b('0x37'),_0x6e5b('0x38'));fs_extra[_0x6e5b('0x39')](_0x4eb913,function(){_0x5b4572(null,_0x4eb913);});},'filename':function(_0x31a137,_0x159551,_0x3a74f9){const _0x26d9ec=_0x159551['originalname'][_0x6e5b('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x902d9f=path[_0x6e5b('0x3b')](_0x26d9ec);const _0x1e7fc7=Date[_0x6e5b('0x30')]()+'-'+_0x26d9ec[_0x6e5b('0x3a')](_0x902d9f,'')+_0x902d9f;_0x3a74f9(null,_0x1e7fc7);}})});router[_0x6e5b('0x21')](_0x6e5b('0x3c'),offlineUploadMulter[_0x6e5b('0x3d')](),controller[_0x6e5b('0x3e')]);router[_0x6e5b('0x21')](_0x6e5b('0x17'),auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x3f')]);router['post'](_0x6e5b('0x1a'),auth['isAuthenticated'](),controller[_0x6e5b('0x40')]);router[_0x6e5b('0x21')]('/:id/proactive_actions',auth[_0x6e5b('0x8')](),controller['addProactiveActions']);router[_0x6e5b('0x21')](_0x6e5b('0x1f'),auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x41')]);router['put'](_0x6e5b('0x42'),auth['isAuthenticated'](),controller[_0x6e5b('0x43')]);router[_0x6e5b('0x44')](_0x6e5b('0x42'),auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x45')]);router[_0x6e5b('0x44')](_0x6e5b('0xd'),auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x46')]);router[_0x6e5b('0x44')]('/:id/canned_answers',auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x47')]);router[_0x6e5b('0x44')](_0x6e5b('0x1f'),auth[_0x6e5b('0x8')](),controller[_0x6e5b('0x48')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index e39e931..f1c196d 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a57=['use','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7a57,0x1d6));var _0x77a5=function(_0x1917ae,_0x4199fd){_0x1917ae=_0x1917ae-0x0;var _0x42fbc7=_0x7a57[_0x1917ae];return _0x42fbc7;};var beaverLogger=require(_0x77a5('0x0'));var express=require('express');var auth=require(_0x77a5('0x1'));var config=require(_0x77a5('0x2'));var router=express[_0x77a5('0x3')]();var isProduction=config[_0x77a5('0x4')]===_0x77a5('0x5')||![];function clientSideLogs(_0x1e5b49,_0x498d02,_0xc7cdd8){var _0xb4f1ef=_0x1e5b49[_0x77a5('0x6')][_0x77a5('0x7')](_0x77a5('0x8'));if(!_0xb4f1ef){throw new Error(_0x77a5('0x9'));}return beaverLogger['expressEndpoint']({'uri':_0x77a5('0xa'),'logger':_0xb4f1ef,'enableCors':!isProduction})(_0x1e5b49,_0x498d02,_0xc7cdd8);}router[_0x77a5('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x77a5('0xc')]=router;
\ No newline at end of file
+var _0xddf0=['expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x50d5f7,_0x1f531e){var _0x3bf4d4=function(_0x26f32d){while(--_0x26f32d){_0x50d5f7['push'](_0x50d5f7['shift']());}};_0x3bf4d4(++_0x1f531e);}(_0xddf0,0xac));var _0x0ddf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xddf0[_0x3dd15e];return _0x231fd0;};var beaverLogger=require(_0x0ddf('0x0'));var express=require(_0x0ddf('0x1'));var auth=require(_0x0ddf('0x2'));var config=require(_0x0ddf('0x3'));var router=express[_0x0ddf('0x4')]();var isProduction=config[_0x0ddf('0x5')]===_0x0ddf('0x6')||![];function clientSideLogs(_0x448bf5,_0x3ac17f,_0x49a76c){var _0x1dfb7b=_0x448bf5['app'][_0x0ddf('0x7')](_0x0ddf('0x8'));if(!_0x1dfb7b){throw new Error(_0x0ddf('0x9'));}return beaverLogger[_0x0ddf('0xa')]({'uri':'/client-logs','logger':_0x1dfb7b,'enableCors':!isProduction})(_0x448bf5,_0x3ac17f,_0x49a76c);}router[_0x0ddf('0xb')](auth[_0x0ddf('0xc')](),clientSideLogs);module[_0x0ddf('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 6ff32b3..4ddb0e9 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 _0x0d5b=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT'];(function(_0x1391ac,_0x54b306){var _0x2ff898=function(_0x264141){while(--_0x264141){_0x1391ac['push'](_0x1391ac['shift']());}};_0x2ff898(++_0x54b306);}(_0x0d5b,0x128));var _0xb0d5=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x0d5b[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module[_0xb0d5('0x0')]={'name':{'type':Sequelize[_0xb0d5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xb0d5('0x2'),_0xb0d5('0x3'),_0xb0d5('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb0d5('0x5')](_0xb0d5('0x6'),_0xb0d5('0x7'))},'data1':{'type':Sequelize[_0xb0d5('0x1')],'comment':_0xb0d5('0x8')},'data2':{'type':Sequelize[_0xb0d5('0x1')],'comment':_0xb0d5('0x9')},'data3':{'type':Sequelize[_0xb0d5('0x1')],'comment':_0xb0d5('0xa')},'data4':{'type':Sequelize[_0xb0d5('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xb0d5('0xb')],'comment':_0xb0d5('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xb0d5('0xd')},'data7':{'type':Sequelize[_0xb0d5('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x5186=['sequelize','STRING','ENUM','AmazonAWS','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x1ba22a,_0x2a568c){var _0x5ba115=function(_0x38ca3a){while(--_0x38ca3a){_0x1ba22a['push'](_0x1ba22a['shift']());}};_0x5ba115(++_0x2a568c);}(_0x5186,0x90));var _0x6518=function(_0xb74abd,_0x4ee757){_0xb74abd=_0xb74abd-0x0;var _0x1daf5f=_0x5186[_0xb74abd];return _0x1daf5f;};'use strict';var Sequelize=require(_0x6518('0x0'));module['exports']={'name':{'type':Sequelize[_0x6518('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6518('0x2')](_0x6518('0x3'),_0x6518('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0x6518('0x5'))},'data1':{'type':Sequelize[_0x6518('0x1')],'comment':_0x6518('0x6')},'data2':{'type':Sequelize[_0x6518('0x1')],'comment':_0x6518('0x7')},'data3':{'type':Sequelize[_0x6518('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x6518('0x1')],'comment':_0x6518('0x8')},'data5':{'type':Sequelize[_0x6518('0x9')],'comment':_0x6518('0xa')},'data6':{'type':Sequelize[_0x6518('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x6518('0x9')],'comment':_0x6518('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 800bd4f..cbea991 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 _0x8e3c=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','count','then','include','findAll','MicrosoftAzure','data3','catch','params','includeAll','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','update','oauth2MicrosoftAuthorize','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','base64','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','Content-Range','destroy','name','slice','index','map','CloudProvider','rawAttributes'];(function(_0x246499,_0x34ddcf){var _0x267fae=function(_0x58a8f4){while(--_0x58a8f4){_0x246499['push'](_0x246499['shift']());}};_0x267fae(++_0x34ddcf);}(_0x8e3c,0x104));var _0xc8e3=function(_0x36f3f3,_0xd4c1dd){_0x36f3f3=_0x36f3f3-0x0;var _0x45bd2e=_0x8e3c[_0x36f3f3];return _0x45bd2e;};'use strict';var _=require(_0xc8e3('0x0'));var Redis=require(_0xc8e3('0x1'));var qs=require(_0xc8e3('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xc8e3('0x3'));var logger=require('../../config/logger')(_0xc8e3('0x4'));var db=require(_0xc8e3('0x5'))['db'];var oauth=require(_0xc8e3('0x6'));config[_0xc8e3('0x7')]=_[_0xc8e3('0x8')](config['redis'],{'host':_0xc8e3('0x9'),'port':0x18eb});var socket=require(_0xc8e3('0xa'))(new Redis(config[_0xc8e3('0x7')]));var redis=new Redis(config[_0xc8e3('0x7')]);function respondWithStatusCode(_0x39e96e,_0x14cde0){_0x14cde0=_0x14cde0||0xcc;return function(_0x145c8e){if(_0x145c8e){return _0x39e96e[_0xc8e3('0xb')](_0x14cde0);}return _0x39e96e[_0xc8e3('0xc')](_0x14cde0)[_0xc8e3('0xd')]();};}function respondWithResult(_0x802cc,_0x51cbf9){_0x51cbf9=_0x51cbf9||0xc8;return function(_0x3af7a8){if(_0x3af7a8){return _0x802cc[_0xc8e3('0xc')](_0x51cbf9)[_0xc8e3('0xe')](_0x3af7a8);}};}function respondWithFilteredResult(_0x4e8255,_0x917f97){return function(_0x30fb70){if(_0x30fb70){var _0x2deee2=typeof _0x917f97[_0xc8e3('0xf')]===_0xc8e3('0x10')&&typeof _0x917f97['limit']===_0xc8e3('0x10');var _0x2e5d02=_0x30fb70['count'];var _0x5ab9ad=_0x2deee2?0x0:_0x917f97[_0xc8e3('0xf')];var _0x5d48a2=_0x2deee2?_0x30fb70['count']:_0x917f97[_0xc8e3('0xf')]+_0x917f97['limit'];var _0x32f59e;if(_0x5d48a2>=_0x2e5d02){_0x5d48a2=_0x2e5d02;_0x32f59e=0xc8;}else{_0x32f59e=0xce;}_0x4e8255[_0xc8e3('0xc')](_0x32f59e);return _0x4e8255['set'](_0xc8e3('0x11'),_0x5ab9ad+'-'+_0x5d48a2+'/'+_0x2e5d02)[_0xc8e3('0xe')](_0x30fb70);}return null;};}function saveUpdates(_0x632ae2){return function(_0x12b5c8){if(_0x12b5c8){return _0x12b5c8['update'](_0x632ae2)['then'](function(_0x3cc206){return _0x3cc206;});}return null;};}function removeEntity(_0x1f3ec6){return function(_0x54d3d0){if(_0x54d3d0){return _0x54d3d0[_0xc8e3('0x12')]()['then'](function(){_0x1f3ec6[_0xc8e3('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3396e1){return function(_0x29ab91){if(!_0x29ab91){_0x3396e1['sendStatus'](0x194);}return _0x29ab91;};}function handleError(_0x3a56c1,_0x216e08){_0x216e08=_0x216e08||0x1f4;return function(_0x12d9b2){logger['error'](_0x12d9b2['stack']);if(_0x12d9b2[_0xc8e3('0x13')]){delete _0x12d9b2['name'];}_0x3a56c1['status'](_0x216e08)['send'](_0x12d9b2);};}function maskClientSecret(_0x10f612){return _['padEnd'](_0x10f612[_0xc8e3('0x14')](0x0,0x3),0x14,'*');}exports[_0xc8e3('0x15')]=function(_0xac3046,_0x307817){var _0x2bf35c={},_0x5d13a4={},_0x316987={'count':0x0,'rows':[]};var _0xf7c46d=_[_0xc8e3('0x16')](db[_0xc8e3('0x17')][_0xc8e3('0x18')],function(_0x53fe1d){return{'name':_0x53fe1d[_0xc8e3('0x19')],'type':_0x53fe1d[_0xc8e3('0x1a')][_0xc8e3('0x1b')]};});_0x5d13a4[_0xc8e3('0x1c')]=_[_0xc8e3('0x16')](_0xf7c46d,_0xc8e3('0x13'));_0x5d13a4[_0xc8e3('0x1d')]=_[_0xc8e3('0x1e')](_0xac3046[_0xc8e3('0x1d')]);_0x5d13a4[_0xc8e3('0x1f')]=_[_0xc8e3('0x20')](_0x5d13a4[_0xc8e3('0x1c')],_0x5d13a4[_0xc8e3('0x1d')]);_0x2bf35c[_0xc8e3('0x21')]=_[_0xc8e3('0x20')](_0x5d13a4[_0xc8e3('0x1c')],qs[_0xc8e3('0x22')](_0xac3046['query']['fields']));_0x2bf35c[_0xc8e3('0x21')]=_0x2bf35c[_0xc8e3('0x21')][_0xc8e3('0x23')]?_0x2bf35c[_0xc8e3('0x21')]:_0x5d13a4[_0xc8e3('0x1c')];if(!_0xac3046[_0xc8e3('0x1d')][_0xc8e3('0x24')](_0xc8e3('0x25'))){_0x2bf35c[_0xc8e3('0x26')]=qs['limit'](_0xac3046['query'][_0xc8e3('0x26')]);_0x2bf35c['offset']=qs[_0xc8e3('0xf')](_0xac3046[_0xc8e3('0x1d')][_0xc8e3('0xf')]);}_0x2bf35c['order']=qs[_0xc8e3('0x27')](_0xac3046[_0xc8e3('0x1d')][_0xc8e3('0x27')]);_0x2bf35c['where']=qs[_0xc8e3('0x1f')](_[_0xc8e3('0x28')](_0xac3046[_0xc8e3('0x1d')],_0x5d13a4[_0xc8e3('0x1f')]),_0xf7c46d);if(_0xac3046[_0xc8e3('0x1d')]['filter']){_0x2bf35c[_0xc8e3('0x29')]=_[_0xc8e3('0x2a')](_0x2bf35c[_0xc8e3('0x29')],{'$or':_[_0xc8e3('0x16')](_0xf7c46d,function(_0x16ab6e){if(_0x16ab6e[_0xc8e3('0x1a')]!==_0xc8e3('0x2b')){var _0x2fb3fa={};_0x2fb3fa[_0x16ab6e['name']]={'$like':'%'+_0xac3046[_0xc8e3('0x1d')][_0xc8e3('0x2c')]+'%'};return _0x2fb3fa;}})});}_0x2bf35c=_[_0xc8e3('0x2a')]({},_0x2bf35c,_0xac3046[_0xc8e3('0x2d')]);var _0x69de43={'where':_0x2bf35c[_0xc8e3('0x29')]};return db['CloudProvider'][_0xc8e3('0x2e')](_0x69de43)[_0xc8e3('0x2f')](function(_0x448291){_0x316987[_0xc8e3('0x2e')]=_0x448291;if(_0xac3046[_0xc8e3('0x1d')]['includeAll']){_0x2bf35c[_0xc8e3('0x30')]=[{'all':!![]}];}return db[_0xc8e3('0x17')][_0xc8e3('0x31')](_0x2bf35c);})[_0xc8e3('0x2f')](function(_0x2f32d6){_0x316987['rows']=_[_0xc8e3('0x16')](_0x2f32d6,function(_0x51b651){if(_0x51b651['service']===_0xc8e3('0x32')){var _0x3473cb=encryptor['decryptString'](_0x51b651['data3']);_0x51b651[_0xc8e3('0x33')]=maskClientSecret(_0x3473cb);}return _0x51b651;});return _0x316987;})[_0xc8e3('0x2f')](respondWithFilteredResult(_0x307817,_0x2bf35c))[_0xc8e3('0x34')](handleError(_0x307817,null));};exports['show']=function(_0x27a1f5,_0x3291d7){var _0x35e97e={'raw':!![],'where':{'id':_0x27a1f5[_0xc8e3('0x35')]['id']}},_0xeabcec={};_0xeabcec[_0xc8e3('0x1c')]=_['keys'](db[_0xc8e3('0x17')][_0xc8e3('0x18')]);_0xeabcec[_0xc8e3('0x1d')]=_[_0xc8e3('0x1e')](_0x27a1f5['query']);_0xeabcec['filters']=_[_0xc8e3('0x20')](_0xeabcec[_0xc8e3('0x1c')],_0xeabcec[_0xc8e3('0x1d')]);_0x35e97e[_0xc8e3('0x21')]=_[_0xc8e3('0x20')](_0xeabcec[_0xc8e3('0x1c')],qs[_0xc8e3('0x22')](_0x27a1f5[_0xc8e3('0x1d')][_0xc8e3('0x22')]));_0x35e97e['attributes']=_0x35e97e[_0xc8e3('0x21')]['length']?_0x35e97e['attributes']:_0xeabcec['model'];if(_0x27a1f5[_0xc8e3('0x1d')][_0xc8e3('0x36')]){_0x35e97e[_0xc8e3('0x30')]=[{'all':!![]}];}_0x35e97e=_[_0xc8e3('0x2a')]({},_0x35e97e,_0x27a1f5[_0xc8e3('0x2d')]);return db[_0xc8e3('0x17')][_0xc8e3('0x37')](_0x35e97e)[_0xc8e3('0x2f')](handleEntityNotFound(_0x3291d7,null))[_0xc8e3('0x2f')](function(_0x4f30e6){if(_0x4f30e6[_0xc8e3('0x38')]==='MicrosoftAzure'){var _0x39de1a=encryptor['decryptString'](_0x4f30e6[_0xc8e3('0x33')]);_0x4f30e6[_0xc8e3('0x33')]=maskClientSecret(_0x39de1a);}return _0x4f30e6;})[_0xc8e3('0x2f')](respondWithResult(_0x3291d7,null))[_0xc8e3('0x34')](handleError(_0x3291d7,null));};exports[_0xc8e3('0x39')]=function(_0x306316,_0x27275b){if(!_0x306316[_0xc8e3('0x3a')][_0xc8e3('0x13')])throw new Error(_0xc8e3('0x3b'));if(!_0x306316['body'][_0xc8e3('0x38')])throw new Error(_0xc8e3('0x3c'));var _0x29ce92=db[_0xc8e3('0x17')][_0xc8e3('0x18')][_0xc8e3('0x38')][_0xc8e3('0x3d')];if(!_0x29ce92[_0xc8e3('0x3e')](_0x306316[_0xc8e3('0x3a')][_0xc8e3('0x38')]))throw new Error(_0xc8e3('0x3f')+_0x29ce92[_0xc8e3('0x40')](',\x20'));if(_0x306316[_0xc8e3('0x3a')][_0xc8e3('0x38')]==='MicrosoftAzure'&&_0x306316[_0xc8e3('0x3a')][_0xc8e3('0x33')]){_0x306316[_0xc8e3('0x3a')]['data3']=encryptor[_0xc8e3('0x41')](_0x306316[_0xc8e3('0x3a')][_0xc8e3('0x33')]);}return db[_0xc8e3('0x17')][_0xc8e3('0x39')](_0x306316[_0xc8e3('0x3a')],{})[_0xc8e3('0x2f')](respondWithResult(_0x27275b,0xc9))[_0xc8e3('0x34')](handleError(_0x27275b,null));};exports[_0xc8e3('0x42')]=function(_0x599396,_0x2648c5){if(_0x599396[_0xc8e3('0x3a')]['id']){delete _0x599396[_0xc8e3('0x3a')]['id'];}return db[_0xc8e3('0x17')][_0xc8e3('0x37')]({'where':{'id':_0x599396[_0xc8e3('0x35')]['id']}})[_0xc8e3('0x2f')](handleEntityNotFound(_0x2648c5,null))[_0xc8e3('0x2f')](function(_0x2dfd77){if(_0x2dfd77[_0xc8e3('0x38')]===_0xc8e3('0x32')&&_0x599396[_0xc8e3('0x3a')][_0xc8e3('0x33')]){_0x599396['body']['data3']=encryptor[_0xc8e3('0x41')](_0x599396['body'][_0xc8e3('0x33')]);}return _0x2dfd77;})[_0xc8e3('0x2f')](saveUpdates(_0x599396[_0xc8e3('0x3a')],null))[_0xc8e3('0x2f')](respondWithResult(_0x2648c5,null))[_0xc8e3('0x34')](handleError(_0x2648c5,null));};exports[_0xc8e3('0x12')]=function(_0x2df803,_0xddca70){return db[_0xc8e3('0x17')]['find']({'where':{'id':_0x2df803[_0xc8e3('0x35')]['id']}})[_0xc8e3('0x2f')](handleEntityNotFound(_0xddca70,null))[_0xc8e3('0x2f')](removeEntity(_0xddca70,null))['catch'](handleError(_0xddca70,null));};exports[_0xc8e3('0x43')]=function(_0x3cb83b,_0x153c96){return db[_0xc8e3('0x17')]['findOne']({'where':{'id':_0x3cb83b[_0xc8e3('0x35')]['id']},'raw':!![]})[_0xc8e3('0x2f')](function(_0x3c66a9){if(!_0x3c66a9)return _0x153c96[_0xc8e3('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3c66a9,_0x3cb83b[_0xc8e3('0x44')]['id'])};})[_0xc8e3('0x2f')](respondWithResult(_0x153c96,null))[_0xc8e3('0x34')](handleError(_0x153c96,null));};exports[_0xc8e3('0x45')]=function(_0x2d9f4b,_0x3bf8cb){var _0x7b89b=_0x2d9f4b[_0xc8e3('0x3a')];var _0x1af393;var _0x4fb96b;if(_0x7b89b['error'])throw _0x7b89b;redis[_0xc8e3('0x46')](_0x7b89b['state'])[_0xc8e3('0x2f')](function(_0xae717a){if(!_0xae717a)throw new Error(_0xc8e3('0x47'));_0x1af393=JSON[_0xc8e3('0x48')](_0xae717a);var _0x460855=Buffer[_0xc8e3('0x49')](_0x7b89b['state'],_0xc8e3('0x4a'))['toString'](_0xc8e3('0x4b'));_0x4fb96b=JSON[_0xc8e3('0x48')](_0x460855);if(!oauth['isValidIdToken'](_0x7b89b[_0xc8e3('0x4c')],_0x1af393[_0xc8e3('0x4d')]))throw new Error(_0xc8e3('0x4e'));redis[_0xc8e3('0x4f')](_0x7b89b[_0xc8e3('0x50')]);return oauth[_0xc8e3('0x51')](_0x7b89b[_0xc8e3('0x52')],_0x1af393);})[_0xc8e3('0x2f')](function(_0x2c8902){_0x1af393[_0xc8e3('0x53')]=_0x2c8902[_0xc8e3('0x54')];_0x1af393['data6']=_0x2c8902[_0xc8e3('0x55')];return db[_0xc8e3('0x17')][_0xc8e3('0x42')]({'data5':_0x1af393[_0xc8e3('0x53')],'data6':_0x1af393['data6']},{'where':{'id':_0x1af393['id']}});})[_0xc8e3('0x2f')](function(){oauth[_0xc8e3('0x56')](_0x1af393);socket[_0xc8e3('0x57')](_0xc8e3('0x58'),{'id':_0x4fb96b['id']});return;})['then'](respondWithStatusCode(_0x3bf8cb,null))[_0xc8e3('0x34')](function(_0x388fe9){if(_0x4fb96b){socket[_0xc8e3('0x57')](_0xc8e3('0x59'),{'id':_0x4fb96b['id']});}if(!_0x1af393){logger[_0xc8e3('0x5a')](_0xc8e3('0x5b'),_0x388fe9);return _0x3bf8cb[_0xc8e3('0xc')](0x1f4)[_0xc8e3('0x5c')](_0x388fe9['message']);}logger[_0xc8e3('0x5a')](_0xc8e3('0x5d'),_0x1af393['id'],JSON[_0xc8e3('0x5e')](_0x388fe9));});};
\ No newline at end of file
+var _0x0d08=['name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','service','MicrosoftAzure','decryptString','data3','catch','params','length','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','update','find','oauth2MicrosoftAuthorize','findOne','sendStatus','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','id_token','Unable\x20to\x20validate\x20id_token','del','code','access_token','data6','refresh_token','data5','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','count','destroy','then'];(function(_0x166780,_0xb61508){var _0x3c4bcc=function(_0x504a51){while(--_0x504a51){_0x166780['push'](_0x166780['shift']());}};_0x3c4bcc(++_0xb61508);}(_0x0d08,0x14f));var _0x80d0=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0d08[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x80d0('0x0'));var Redis=require(_0x80d0('0x1'));var qs=require(_0x80d0('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x80d0('0x3'))('api');var db=require(_0x80d0('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x80d0('0x5')]=_['defaults'](config[_0x80d0('0x5')],{'host':_0x80d0('0x6'),'port':0x18eb});var socket=require(_0x80d0('0x7'))(new Redis(config[_0x80d0('0x5')]));var redis=new Redis(config[_0x80d0('0x5')]);function respondWithStatusCode(_0x43decb,_0x3bb8ef){_0x3bb8ef=_0x3bb8ef||0xcc;return function(_0x38b0f3){if(_0x38b0f3){return _0x43decb['sendStatus'](_0x3bb8ef);}return _0x43decb[_0x80d0('0x8')](_0x3bb8ef)[_0x80d0('0x9')]();};}function respondWithResult(_0x4961c6,_0x102f9f){_0x102f9f=_0x102f9f||0xc8;return function(_0x140995){if(_0x140995){return _0x4961c6[_0x80d0('0x8')](_0x102f9f)[_0x80d0('0xa')](_0x140995);}};}function respondWithFilteredResult(_0x4be65e,_0x8c3c2c){return function(_0x3afc12){if(_0x3afc12){var _0x3429b0=typeof _0x8c3c2c[_0x80d0('0xb')]===_0x80d0('0xc')&&typeof _0x8c3c2c[_0x80d0('0xd')]===_0x80d0('0xc');var _0x994aae=_0x3afc12[_0x80d0('0xe')];var _0x500f5e=_0x3429b0?0x0:_0x8c3c2c[_0x80d0('0xb')];var _0x57fa22=_0x3429b0?_0x3afc12[_0x80d0('0xe')]:_0x8c3c2c['offset']+_0x8c3c2c[_0x80d0('0xd')];var _0x185af6;if(_0x57fa22>=_0x994aae){_0x57fa22=_0x994aae;_0x185af6=0xc8;}else{_0x185af6=0xce;}_0x4be65e[_0x80d0('0x8')](_0x185af6);return _0x4be65e['set']('Content-Range',_0x500f5e+'-'+_0x57fa22+'/'+_0x994aae)[_0x80d0('0xa')](_0x3afc12);}return null;};}function saveUpdates(_0x49238c){return function(_0x37aed7){if(_0x37aed7){return _0x37aed7['update'](_0x49238c)['then'](function(_0x427434){return _0x427434;});}return null;};}function removeEntity(_0x46c5b9){return function(_0x23495f){if(_0x23495f){return _0x23495f[_0x80d0('0xf')]()[_0x80d0('0x10')](function(){_0x46c5b9[_0x80d0('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32520e){return function(_0x338fb4){if(!_0x338fb4){_0x32520e['sendStatus'](0x194);}return _0x338fb4;};}function handleError(_0x35f2cf,_0x40941b){_0x40941b=_0x40941b||0x1f4;return function(_0x5359ab){logger['error'](_0x5359ab['stack']);if(_0x5359ab[_0x80d0('0x11')]){delete _0x5359ab[_0x80d0('0x11')];}_0x35f2cf[_0x80d0('0x8')](_0x40941b)[_0x80d0('0x12')](_0x5359ab);};}function maskClientSecret(_0x4bc5af){return _[_0x80d0('0x13')](_0x4bc5af[_0x80d0('0x14')](0x0,0x3),0x14,'*');}exports[_0x80d0('0x15')]=function(_0x1eb315,_0x174bcd){var _0x20a4fd={},_0x465921={},_0x2d80dd={'count':0x0,'rows':[]};var _0x18149b=_[_0x80d0('0x16')](db[_0x80d0('0x17')][_0x80d0('0x18')],function(_0x3d7681){return{'name':_0x3d7681[_0x80d0('0x19')],'type':_0x3d7681[_0x80d0('0x1a')][_0x80d0('0x1b')]};});_0x465921[_0x80d0('0x1c')]=_[_0x80d0('0x16')](_0x18149b,_0x80d0('0x11'));_0x465921[_0x80d0('0x1d')]=_['keys'](_0x1eb315['query']);_0x465921['filters']=_[_0x80d0('0x1e')](_0x465921[_0x80d0('0x1c')],_0x465921['query']);_0x20a4fd[_0x80d0('0x1f')]=_[_0x80d0('0x1e')](_0x465921[_0x80d0('0x1c')],qs[_0x80d0('0x20')](_0x1eb315['query']['fields']));_0x20a4fd[_0x80d0('0x1f')]=_0x20a4fd[_0x80d0('0x1f')]['length']?_0x20a4fd[_0x80d0('0x1f')]:_0x465921[_0x80d0('0x1c')];if(!_0x1eb315['query'][_0x80d0('0x21')](_0x80d0('0x22'))){_0x20a4fd[_0x80d0('0xd')]=qs[_0x80d0('0xd')](_0x1eb315['query'][_0x80d0('0xd')]);_0x20a4fd[_0x80d0('0xb')]=qs[_0x80d0('0xb')](_0x1eb315[_0x80d0('0x1d')]['offset']);}_0x20a4fd[_0x80d0('0x23')]=qs[_0x80d0('0x24')](_0x1eb315[_0x80d0('0x1d')]['sort']);_0x20a4fd[_0x80d0('0x25')]=qs[_0x80d0('0x26')](_['pick'](_0x1eb315[_0x80d0('0x1d')],_0x465921[_0x80d0('0x26')]),_0x18149b);if(_0x1eb315['query']['filter']){_0x20a4fd['where']=_['merge'](_0x20a4fd[_0x80d0('0x25')],{'$or':_[_0x80d0('0x16')](_0x18149b,function(_0x24bf71){if(_0x24bf71[_0x80d0('0x1a')]!==_0x80d0('0x27')){var _0x1c046e={};_0x1c046e[_0x24bf71[_0x80d0('0x11')]]={'$like':'%'+_0x1eb315['query'][_0x80d0('0x28')]+'%'};return _0x1c046e;}})});}_0x20a4fd=_[_0x80d0('0x29')]({},_0x20a4fd,_0x1eb315[_0x80d0('0x2a')]);var _0x3c4118={'where':_0x20a4fd[_0x80d0('0x25')]};return db['CloudProvider'][_0x80d0('0xe')](_0x3c4118)[_0x80d0('0x10')](function(_0x340d3c){_0x2d80dd[_0x80d0('0xe')]=_0x340d3c;if(_0x1eb315[_0x80d0('0x1d')][_0x80d0('0x2b')]){_0x20a4fd['include']=[{'all':!![]}];}return db[_0x80d0('0x17')]['findAll'](_0x20a4fd);})[_0x80d0('0x10')](function(_0x2cba23){_0x2d80dd['rows']=_['map'](_0x2cba23,function(_0x225b5a){if(_0x225b5a[_0x80d0('0x2c')]===_0x80d0('0x2d')){var _0x58ac22=encryptor[_0x80d0('0x2e')](_0x225b5a[_0x80d0('0x2f')]);_0x225b5a['data3']=maskClientSecret(_0x58ac22);}return _0x225b5a;});return _0x2d80dd;})[_0x80d0('0x10')](respondWithFilteredResult(_0x174bcd,_0x20a4fd))[_0x80d0('0x30')](handleError(_0x174bcd,null));};exports['show']=function(_0x4a8b4d,_0x27d4cf){var _0x475269={'raw':!![],'where':{'id':_0x4a8b4d[_0x80d0('0x31')]['id']}},_0x2218c3={};_0x2218c3[_0x80d0('0x1c')]=_['keys'](db[_0x80d0('0x17')][_0x80d0('0x18')]);_0x2218c3[_0x80d0('0x1d')]=_['keys'](_0x4a8b4d[_0x80d0('0x1d')]);_0x2218c3['filters']=_[_0x80d0('0x1e')](_0x2218c3[_0x80d0('0x1c')],_0x2218c3[_0x80d0('0x1d')]);_0x475269['attributes']=_['intersection'](_0x2218c3[_0x80d0('0x1c')],qs[_0x80d0('0x20')](_0x4a8b4d[_0x80d0('0x1d')][_0x80d0('0x20')]));_0x475269[_0x80d0('0x1f')]=_0x475269['attributes'][_0x80d0('0x32')]?_0x475269[_0x80d0('0x1f')]:_0x2218c3[_0x80d0('0x1c')];if(_0x4a8b4d[_0x80d0('0x1d')][_0x80d0('0x2b')]){_0x475269['include']=[{'all':!![]}];}_0x475269=_[_0x80d0('0x29')]({},_0x475269,_0x4a8b4d[_0x80d0('0x2a')]);return db[_0x80d0('0x17')]['find'](_0x475269)['then'](handleEntityNotFound(_0x27d4cf,null))[_0x80d0('0x10')](function(_0x30d148){if(_0x30d148[_0x80d0('0x2c')]==='MicrosoftAzure'){var _0x50e0be=encryptor[_0x80d0('0x2e')](_0x30d148[_0x80d0('0x2f')]);_0x30d148[_0x80d0('0x2f')]=maskClientSecret(_0x50e0be);}return _0x30d148;})['then'](respondWithResult(_0x27d4cf,null))['catch'](handleError(_0x27d4cf,null));};exports['create']=function(_0x6686d1,_0x2041cb){if(!_0x6686d1[_0x80d0('0x33')][_0x80d0('0x11')])throw new Error(_0x80d0('0x34'));if(!_0x6686d1['body'][_0x80d0('0x2c')])throw new Error(_0x80d0('0x35'));var _0x5f0136=db[_0x80d0('0x17')]['rawAttributes'][_0x80d0('0x2c')][_0x80d0('0x36')];if(!_0x5f0136['includes'](_0x6686d1[_0x80d0('0x33')][_0x80d0('0x2c')]))throw new Error(_0x80d0('0x37')+_0x5f0136[_0x80d0('0x38')](',\x20'));if(_0x6686d1[_0x80d0('0x33')]['service']===_0x80d0('0x2d')&&_0x6686d1[_0x80d0('0x33')][_0x80d0('0x2f')]){_0x6686d1[_0x80d0('0x33')][_0x80d0('0x2f')]=encryptor[_0x80d0('0x39')](_0x6686d1[_0x80d0('0x33')][_0x80d0('0x2f')]);}return db['CloudProvider'][_0x80d0('0x3a')](_0x6686d1[_0x80d0('0x33')],{})['then'](respondWithResult(_0x2041cb,0xc9))[_0x80d0('0x30')](handleError(_0x2041cb,null));};exports[_0x80d0('0x3b')]=function(_0x3f97eb,_0xa0f6a){if(_0x3f97eb['body']['id']){delete _0x3f97eb[_0x80d0('0x33')]['id'];}return db[_0x80d0('0x17')][_0x80d0('0x3c')]({'where':{'id':_0x3f97eb[_0x80d0('0x31')]['id']}})['then'](handleEntityNotFound(_0xa0f6a,null))[_0x80d0('0x10')](function(_0x3c418e){if(_0x3c418e[_0x80d0('0x2c')]==='MicrosoftAzure'&&_0x3f97eb['body'][_0x80d0('0x2f')]){_0x3f97eb[_0x80d0('0x33')][_0x80d0('0x2f')]=encryptor[_0x80d0('0x39')](_0x3f97eb[_0x80d0('0x33')]['data3']);}return _0x3c418e;})[_0x80d0('0x10')](saveUpdates(_0x3f97eb[_0x80d0('0x33')],null))[_0x80d0('0x10')](respondWithResult(_0xa0f6a,null))['catch'](handleError(_0xa0f6a,null));};exports['destroy']=function(_0x314da2,_0x370804){return db[_0x80d0('0x17')][_0x80d0('0x3c')]({'where':{'id':_0x314da2[_0x80d0('0x31')]['id']}})['then'](handleEntityNotFound(_0x370804,null))[_0x80d0('0x10')](removeEntity(_0x370804,null))['catch'](handleError(_0x370804,null));};exports[_0x80d0('0x3d')]=function(_0x7aeb88,_0x4ba18b){return db[_0x80d0('0x17')][_0x80d0('0x3e')]({'where':{'id':_0x7aeb88[_0x80d0('0x31')]['id']},'raw':!![]})[_0x80d0('0x10')](function(_0x38e31f){if(!_0x38e31f)return _0x4ba18b[_0x80d0('0x3f')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x38e31f,_0x7aeb88['user']['id'])};})[_0x80d0('0x10')](respondWithResult(_0x4ba18b,null))[_0x80d0('0x30')](handleError(_0x4ba18b,null));};exports[_0x80d0('0x40')]=function(_0x222089,_0x215ba9){var _0x1adc12=_0x222089[_0x80d0('0x33')];var _0x476643;var _0x5d7474;if(_0x1adc12['error'])throw _0x1adc12;redis[_0x80d0('0x41')](_0x1adc12[_0x80d0('0x42')])[_0x80d0('0x10')](function(_0x3b3289){if(!_0x3b3289)throw new Error(_0x80d0('0x43'));_0x476643=JSON[_0x80d0('0x44')](_0x3b3289);var _0x5453a9=Buffer[_0x80d0('0x45')](_0x1adc12[_0x80d0('0x42')],_0x80d0('0x46'))[_0x80d0('0x47')]('ascii');_0x5d7474=JSON[_0x80d0('0x44')](_0x5453a9);if(!oauth['isValidIdToken'](_0x1adc12[_0x80d0('0x48')],_0x476643['oauth2Claims']))throw new Error(_0x80d0('0x49'));redis[_0x80d0('0x4a')](_0x1adc12[_0x80d0('0x42')]);return oauth['getOauth2MicrosoftAccessToken'](_0x1adc12[_0x80d0('0x4b')],_0x476643);})[_0x80d0('0x10')](function(_0x428083){_0x476643['data5']=_0x428083[_0x80d0('0x4c')];_0x476643[_0x80d0('0x4d')]=_0x428083[_0x80d0('0x4e')];return db[_0x80d0('0x17')][_0x80d0('0x3b')]({'data5':_0x476643[_0x80d0('0x4f')],'data6':_0x476643[_0x80d0('0x4d')]},{'where':{'id':_0x476643['id']}});})[_0x80d0('0x10')](function(){oauth['startRefreshInterval'](_0x476643);socket['emit'](_0x80d0('0x50'),{'id':_0x5d7474['id']});return;})[_0x80d0('0x10')](respondWithStatusCode(_0x215ba9,null))[_0x80d0('0x30')](function(_0x17e10b){if(_0x5d7474){socket[_0x80d0('0x51')](_0x80d0('0x52'),{'id':_0x5d7474['id']});}if(!_0x476643){logger['error'](_0x80d0('0x53'),_0x17e10b);return _0x215ba9['status'](0x1f4)['send'](_0x17e10b[_0x80d0('0x54')]);}logger[_0x80d0('0x55')](_0x80d0('0x56'),_0x476643['id'],JSON[_0x80d0('0x57')](_0x17e10b));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 31655ab..ac76ece 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 _0x1a62=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define'];(function(_0x3720e7,_0x1556fd){var _0x10e8fe=function(_0x53b4ab){while(--_0x53b4ab){_0x3720e7['push'](_0x3720e7['shift']());}};_0x10e8fe(++_0x1556fd);}(_0x1a62,0x10c));var _0x21a6=function(_0x42f24a,_0x3ee0bc){_0x42f24a=_0x42f24a-0x0;var _0x2e1354=_0x1a62[_0x42f24a];return _0x2e1354;};'use strict';var _=require(_0x21a6('0x0'));var util=require(_0x21a6('0x1'));var logger=require(_0x21a6('0x2'))(_0x21a6('0x3'));var moment=require(_0x21a6('0x4'));var BPromise=require(_0x21a6('0x5'));var rp=require(_0x21a6('0x6'));var fs=require('fs');var path=require(_0x21a6('0x7'));var rimraf=require(_0x21a6('0x8'));var config=require(_0x21a6('0x9'));var attributes=require(_0x21a6('0xa'));module['exports']=function(_0x19aa87,_0x2c0fe9){return _0x19aa87[_0x21a6('0xb')](_0x21a6('0xc'),attributes,{'tableName':_0x21a6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x136b=['bluebird','rimraf','../../config/environment','CloudProvider','cloud_providers','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x136b,0x1eb));var _0xb136=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x136b[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xb136('0x0'));var util=require('util');var logger=require(_0xb136('0x1'))(_0xb136('0x2'));var moment=require(_0xb136('0x3'));var BPromise=require(_0xb136('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb136('0x5'));var config=require(_0xb136('0x6'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x58c72e,_0x1c4a01){return _0x58c72e['define'](_0xb136('0x7'),attributes,{'tableName':_0xb136('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 32c7cd1..b7051a2 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb2cd=['data6','decryptString','POST','data5','access_token','update','catch','error','authorization_code','intervals','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','/.default','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','form_post','state','login','key','value','join','oauth2Claims','oauth2/','set','stringify','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token'];(function(_0x16ec04,_0x55ecee){var _0x4e9077=function(_0x1ae80a){while(--_0x1ae80a){_0x16ec04['push'](_0x16ec04['shift']());}};_0x4e9077(++_0x55ecee);}(_0xb2cd,0xfe));var _0xdb2c=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb2cd[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0xdb2c('0x0'));var crypto=require('crypto');var jwt=require(_0xdb2c('0x1'));var moment=require(_0xdb2c('0x2'));var Redis=require(_0xdb2c('0x3'));var rp=require(_0xdb2c('0x4'));var util=require(_0xdb2c('0x5'));var encryptor=require(_0xdb2c('0x6'));var config=require(_0xdb2c('0x7'));var logger=require(_0xdb2c('0x8'))(_0xdb2c('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xdb2c('0xa'))['db'];config['redis']=_['defaults'](config[_0xdb2c('0xb')],{'host':_0xdb2c('0xc'),'port':0x18eb});var redis=new Redis(config[_0xdb2c('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xdb2c('0xd'),_0xdb2c('0xe'),_0xdb2c('0xf'),_0xdb2c('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xdb2c('0x11')],'Dynamics365':[_0xdb2c('0xd'),_0xdb2c('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xdb2c('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xdb2c('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2268c5){var _0x16a11f=_[_0xdb2c('0x14')](AZURE_AUTH_SCOPES[_0x2268c5['type']]);if(_0x2268c5[_0xdb2c('0x15')]==='Dynamics365')_0x16a11f[_0xdb2c('0x16')](_0x2268c5[_0xdb2c('0x17')]+_0xdb2c('0x18'));return _0x16a11f['join']('\x20');}function getAccessTokenScope(_0x399b47){if(_0x399b47[_0xdb2c('0x15')]===_0xdb2c('0x19'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x399b47[_0xdb2c('0x15')]===_0xdb2c('0x1a'))return _0x399b47['data7']+_0xdb2c('0x18');}function generateMicrosoftAuthorizationUrl(_0x5112cd,_0x485fe7){var _0x13a4c1=MICROSOFT_AUTH_URL[_0xdb2c('0x1b')](_0xdb2c('0x1c'),_0x5112cd[_0xdb2c('0x1d')]);var _0x5af71c=[_0xdb2c('0x1e'),_0xdb2c('0x1f')];var _0x1b1c54=Buffer[_0xdb2c('0x20')](JSON['stringify']({'id':_0x485fe7}))[_0xdb2c('0x21')]('base64');var _0x355716=crypto[_0xdb2c('0x22')](0x10)['toString'](_0xdb2c('0x23'));var _0x4a09af=getAuthorizationScopes(_0x5112cd);var _0x1f2a7e=[{'key':_0xdb2c('0x24'),'value':_0x5112cd[_0xdb2c('0x25')]},{'key':_0xdb2c('0x26'),'value':encodeURIComponent(_0x5af71c['join']('\x20'))},{'key':_0xdb2c('0x27'),'value':_0x5112cd[_0xdb2c('0x28')]},{'key':'response_mode','value':_0xdb2c('0x29')},{'key':'scope','value':encodeURIComponent(_0x4a09af)},{'key':_0xdb2c('0x2a'),'value':_0x1b1c54},{'key':'nonce','value':_0x355716},{'key':'prompt','value':_0xdb2c('0x2b')}];var _0x10a487=_0x13a4c1+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xdb2c('0x14')](_0x1f2a7e,function(_0x13b4a0){return _0x13b4a0[_0xdb2c('0x2c')]+'='+_0x13b4a0[_0xdb2c('0x2d')];})[_0xdb2c('0x2e')]('&');_0x5112cd[_0xdb2c('0x2f')]={'issuer':_0x13a4c1[_0xdb2c('0x1b')](_0xdb2c('0x30'),''),'audience':_0x5112cd['data1'],'state':_0x1b1c54,'nonce':_0x355716};redis[_0xdb2c('0x31')](_0x1b1c54,JSON[_0xdb2c('0x32')](_0x5112cd));return _0x10a487;}function isValidIdToken(_0x40fdad,_0x25150b){try{var _0x2ddcca=jwt['decode'](_0x40fdad,{'complete':!![]});var _0x316328=_0x2ddcca[_0xdb2c('0x33')];if(_0x316328[_0xdb2c('0x34')]!==_0x25150b[_0xdb2c('0x35')])return![];if(_0x316328[_0xdb2c('0x36')]!==_0x25150b[_0xdb2c('0x37')])return![];if(_0x316328[_0xdb2c('0x38')]!==_0x25150b[_0xdb2c('0x38')])return![];if(moment()[_0xdb2c('0x39')](moment[_0xdb2c('0x3a')](_0x316328[_0xdb2c('0x3b')])))return![];return!![];}catch(_0x1bc0c7){throw _0x1bc0c7;}}function refreshOauth2MicrosoftAccessToken(_0xd36b1f){return Promise[_0xdb2c('0x3c')]()[_0xdb2c('0x3d')](function(){if(_0xd36b1f[_0xdb2c('0x3e')])return _0xd36b1f;return db[_0xdb2c('0x3f')][_0xdb2c('0x40')]({'where':{'id':_0xd36b1f['id']},'raw':!![]});})['then'](function(_0x2f68b3){var _0x8f16f8={'grant_type':_0xdb2c('0x41'),'refresh_token':_0x2f68b3[_0xdb2c('0x42')],'scope':getAccessTokenScope(_0x2f68b3),'redirect_uri':_0x2f68b3['data4'],'client_id':_0x2f68b3['data1'],'client_secret':encryptor[_0xdb2c('0x43')](_0x2f68b3['data3'])};var _0x24ce76={'method':_0xdb2c('0x44'),'uri':MICROSOFT_AUTH_URL['replace'](_0xdb2c('0x1c'),_0x2f68b3[_0xdb2c('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x8f16f8,'json':!![]};return rp(_0x24ce76);})[_0xdb2c('0x3d')](function(_0x395109){_0xd36b1f[_0xdb2c('0x45')]=_0x395109[_0xdb2c('0x46')];_0xd36b1f[_0xdb2c('0x42')]=_0x395109['refresh_token'];return db[_0xdb2c('0x3f')][_0xdb2c('0x47')]({'data5':_0xd36b1f[_0xdb2c('0x45')],'data6':_0xd36b1f[_0xdb2c('0x42')]},{'where':{'id':_0xd36b1f['id']}});})[_0xdb2c('0x3d')](function(){return _0xd36b1f;})[_0xdb2c('0x48')](function(_0x3f4289){logger[_0xdb2c('0x49')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xd36b1f['id'],_0x3f4289);});}function getOauth2MicrosoftAccessToken(_0x4946f8,_0x520c56){var _0x5754d5={'grant_type':_0xdb2c('0x4a'),'code':_0x4946f8,'scope':getAccessTokenScope(_0x520c56),'redirect_uri':_0x520c56[_0xdb2c('0x28')],'client_id':_0x520c56[_0xdb2c('0x25')],'client_secret':encryptor[_0xdb2c('0x43')](_0x520c56['data3'])};var _0xfb52e7={'method':_0xdb2c('0x44'),'uri':MICROSOFT_AUTH_URL['replace'](_0xdb2c('0x1c'),_0x520c56[_0xdb2c('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5754d5,'json':!![]};return rp(_0xfb52e7);}function startRefreshInterval(_0x19f972){var _0x6323ed=schedule[_0xdb2c('0x4b')];if(_0x6323ed[_0x19f972['id']])clearInterval(_0x6323ed[_0x19f972['id']]);_0x6323ed[_0x19f972['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x19f972['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x6323ed;}function startAllRefreshIntervals(){return db[_0xdb2c('0x3f')][_0xdb2c('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xdb2c('0x3d')](function(_0x446acb){var _0x3eb830=_0x446acb['map'](function(_0x411891){return refreshOauth2MicrosoftAccessToken(_0x411891)['then'](function(_0x5051eb){startRefreshInterval(_0x5051eb);});});return Promise[_0xdb2c('0x4d')](_0x3eb830);})[_0xdb2c('0x48')](function(_0x298cd2){var _0xc93fba=_0x298cd2?util['inspect'](_0x298cd2,{'showHidden':![],'depth':null}):'';logger[_0xdb2c('0x49')](_0xdb2c('0x4e'),_0xc93fba);});}module[_0xdb2c('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xfb7d=['data2','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','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','map','Dynamics365','push','data7','/.default','join','Outlook365','type','replace','code','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','scope','state','nonce','prompt','login','key','oauth2Claims','oauth2/','set','payload','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','{TENANT_ID}'];(function(_0x3f7396,_0x32395b){var _0x19fea7=function(_0x56d188){while(--_0x56d188){_0x3f7396['push'](_0x3f7396['shift']());}};_0x19fea7(++_0x32395b);}(_0xfb7d,0xa3));var _0xdfb7=function(_0x2fe46e,_0x5e041f){_0x2fe46e=_0x2fe46e-0x0;var _0x226f6=_0xfb7d[_0x2fe46e];return _0x226f6;};'use strict';var _=require(_0xdfb7('0x0'));var crypto=require('crypto');var jwt=require(_0xdfb7('0x1'));var moment=require(_0xdfb7('0x2'));var Redis=require(_0xdfb7('0x3'));var rp=require(_0xdfb7('0x4'));var util=require(_0xdfb7('0x5'));var encryptor=require(_0xdfb7('0x6'));var config=require('../../config/environment');var logger=require(_0xdfb7('0x7'))(_0xdfb7('0x8'));var schedule=require(_0xdfb7('0x9'));var db=require(_0xdfb7('0xa'))['db'];config[_0xdfb7('0xb')]=_['defaults'](config[_0xdfb7('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xdfb7('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xdfb7('0xd'),_0xdfb7('0xe'),'email',_0xdfb7('0xf'),_0xdfb7('0x10'),_0xdfb7('0x11'),_0xdfb7('0x12')],'Dynamics365':[_0xdfb7('0xd'),_0xdfb7('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2116cd){var _0x4777f3=_[_0xdfb7('0x13')](AZURE_AUTH_SCOPES[_0x2116cd['type']]);if(_0x2116cd['type']===_0xdfb7('0x14'))_0x4777f3[_0xdfb7('0x15')](_0x2116cd[_0xdfb7('0x16')]+_0xdfb7('0x17'));return _0x4777f3[_0xdfb7('0x18')]('\x20');}function getAccessTokenScope(_0x5ad687){if(_0x5ad687['type']===_0xdfb7('0x19'))return _0xdfb7('0x10');if(_0x5ad687[_0xdfb7('0x1a')]==='Dynamics365')return _0x5ad687[_0xdfb7('0x16')]+_0xdfb7('0x17');}function generateMicrosoftAuthorizationUrl(_0x39be36,_0x4f6af7){var _0x2783f7=MICROSOFT_AUTH_URL[_0xdfb7('0x1b')]('{TENANT_ID}',_0x39be36['data2']);var _0x4fdec5=[_0xdfb7('0x1c'),'id_token'];var _0x23b9e1=Buffer['from'](JSON[_0xdfb7('0x1d')]({'id':_0x4f6af7}))[_0xdfb7('0x1e')](_0xdfb7('0x1f'));var _0x479afc=crypto[_0xdfb7('0x20')](0x10)[_0xdfb7('0x1e')](_0xdfb7('0x21'));var _0xa07b50=getAuthorizationScopes(_0x39be36);var _0x468eec=[{'key':_0xdfb7('0x22'),'value':_0x39be36[_0xdfb7('0x23')]},{'key':_0xdfb7('0x24'),'value':encodeURIComponent(_0x4fdec5['join']('\x20'))},{'key':_0xdfb7('0x25'),'value':_0x39be36[_0xdfb7('0x26')]},{'key':_0xdfb7('0x27'),'value':'form_post'},{'key':_0xdfb7('0x28'),'value':encodeURIComponent(_0xa07b50)},{'key':_0xdfb7('0x29'),'value':_0x23b9e1},{'key':_0xdfb7('0x2a'),'value':_0x479afc},{'key':_0xdfb7('0x2b'),'value':_0xdfb7('0x2c')}];var _0x404f60=_0x2783f7+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xdfb7('0x13')](_0x468eec,function(_0x1be107){return _0x1be107[_0xdfb7('0x2d')]+'='+_0x1be107['value'];})[_0xdfb7('0x18')]('&');_0x39be36[_0xdfb7('0x2e')]={'issuer':_0x2783f7['replace'](_0xdfb7('0x2f'),''),'audience':_0x39be36[_0xdfb7('0x23')],'state':_0x23b9e1,'nonce':_0x479afc};redis[_0xdfb7('0x30')](_0x23b9e1,JSON[_0xdfb7('0x1d')](_0x39be36));return _0x404f60;}function isValidIdToken(_0x2a1e67,_0x36d11e){try{var _0xb8ccdb=jwt['decode'](_0x2a1e67,{'complete':!![]});var _0x55a462=_0xb8ccdb[_0xdfb7('0x31')];if(_0x55a462['iss']!==_0x36d11e['issuer'])return![];if(_0x55a462[_0xdfb7('0x32')]!==_0x36d11e[_0xdfb7('0x33')])return![];if(_0x55a462[_0xdfb7('0x2a')]!==_0x36d11e[_0xdfb7('0x2a')])return![];if(moment()[_0xdfb7('0x34')](moment[_0xdfb7('0x35')](_0x55a462[_0xdfb7('0x36')])))return![];return!![];}catch(_0x5cb3ec){throw _0x5cb3ec;}}function refreshOauth2MicrosoftAccessToken(_0x3a49fc){return Promise[_0xdfb7('0x37')]()[_0xdfb7('0x38')](function(){if(_0x3a49fc[_0xdfb7('0x39')])return _0x3a49fc;return db[_0xdfb7('0x3a')][_0xdfb7('0x3b')]({'where':{'id':_0x3a49fc['id']},'raw':!![]});})['then'](function(_0x3018e4){var _0x3468f2={'grant_type':_0xdfb7('0x3c'),'refresh_token':_0x3018e4[_0xdfb7('0x3d')],'scope':getAccessTokenScope(_0x3018e4),'redirect_uri':_0x3018e4[_0xdfb7('0x26')],'client_id':_0x3018e4[_0xdfb7('0x23')],'client_secret':encryptor[_0xdfb7('0x3e')](_0x3018e4[_0xdfb7('0x39')])};var _0xb8e1f5={'method':_0xdfb7('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xdfb7('0x40'),_0x3018e4[_0xdfb7('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3468f2,'json':!![]};return rp(_0xb8e1f5);})['then'](function(_0x593626){_0x3a49fc['data5']=_0x593626['access_token'];_0x3a49fc[_0xdfb7('0x3d')]=_0x593626['refresh_token'];return db['CloudProvider']['update']({'data5':_0x3a49fc[_0xdfb7('0x42')],'data6':_0x3a49fc[_0xdfb7('0x3d')]},{'where':{'id':_0x3a49fc['id']}});})[_0xdfb7('0x38')](function(){return _0x3a49fc;})['catch'](function(_0x310b4f){logger[_0xdfb7('0x43')](_0xdfb7('0x44'),_0x3a49fc['id'],_0x310b4f);});}function getOauth2MicrosoftAccessToken(_0x29a9dc,_0x292e1e){var _0x27184a={'grant_type':_0xdfb7('0x45'),'code':_0x29a9dc,'scope':getAccessTokenScope(_0x292e1e),'redirect_uri':_0x292e1e['data4'],'client_id':_0x292e1e[_0xdfb7('0x23')],'client_secret':encryptor[_0xdfb7('0x3e')](_0x292e1e['data3'])};var _0x44521e={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xdfb7('0x1b')]('{TENANT_ID}',_0x292e1e['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x27184a,'json':!![]};return rp(_0x44521e);}function startRefreshInterval(_0x45c741){var _0x5c0a9d=schedule[_0xdfb7('0x46')];if(_0x5c0a9d[_0x45c741['id']])clearInterval(_0x5c0a9d[_0x45c741['id']]);_0x5c0a9d[_0x45c741['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xdfb7('0x47')](this,{'id':_0x45c741['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5c0a9d;}function startAllRefreshIntervals(){return db['CloudProvider'][_0xdfb7('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xdfb7('0x38')](function(_0x56d33b){var _0x4f41de=_0x56d33b['map'](function(_0x4bc4c7){return refreshOauth2MicrosoftAccessToken(_0x4bc4c7)[_0xdfb7('0x38')](function(_0x47e85a){startRefreshInterval(_0x47e85a);});});return Promise['all'](_0x4f41de);})[_0xdfb7('0x49')](function(_0x3e6046){var _0x3609cf=_0x3e6046?util['inspect'](_0x3e6046,{'showHidden':![],'depth':null}):'';logger[_0xdfb7('0x43')](_0xdfb7('0x4a'),_0x3609cf);});}module[_0xdfb7('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 46762c0..8c7c5cd 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 _0x3d3d=['info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5e1d73,_0x34e791){var _0x3f15cd=function(_0x15de48){while(--_0x15de48){_0x5e1d73['push'](_0x5e1d73['shift']());}};_0x3f15cd(++_0x34e791);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3d3('0x0'));var moment=require(_0xd3d3('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3d3('0x2'));var fs=require('fs');var Redis=require(_0xd3d3('0x3'));var db=require(_0xd3d3('0x4'))['db'];var utils=require(_0xd3d3('0x5'));var logger=require(_0xd3d3('0x6'))(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var jayson=require(_0xd3d3('0x9'));var client=jayson[_0xd3d3('0xa')][_0xd3d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aa421,_0x1f47fe,_0x263940){return new BPromise(function(_0x3fe58e,_0x2ed96f){return client['request'](_0x4aa421,_0x263940)[_0xd3d3('0xc')](function(_0x412054){logger[_0xd3d3('0xd')](_0xd3d3('0xe'),_0x1f47fe,'request\x20sent');logger[_0xd3d3('0xf')](_0xd3d3('0x10'),_0x1f47fe,_0xd3d3('0x11'),JSON[_0xd3d3('0x12')](_0x412054));if(_0x412054[_0xd3d3('0x13')]){if(_0x412054[_0xd3d3('0x13')]['code']===0x1f4){logger[_0xd3d3('0x13')]('CloudProvider,\x20%s,\x20%s',_0x1f47fe,_0x412054['error']['message']);return _0x2ed96f(_0x412054[_0xd3d3('0x13')]['message']);}logger['error'](_0xd3d3('0xe'),_0x1f47fe,_0x412054[_0xd3d3('0x13')]['message']);return _0x3fe58e(_0x412054[_0xd3d3('0x13')]['message']);}else{logger['info'](_0xd3d3('0xe'),_0x1f47fe,_0xd3d3('0x11'));_0x3fe58e(_0x412054[_0xd3d3('0x14')][_0xd3d3('0x15')]);}})[_0xd3d3('0x16')](function(_0x5c3462){logger[_0xd3d3('0x13')](_0xd3d3('0xe'),_0x1f47fe,_0x5c3462);_0x2ed96f(_0x5c3462);});});}
\ No newline at end of file
+var _0x4b74=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0x4b74,0x103));var _0x44b7=function(_0x54a9b7,_0x216841){_0x54a9b7=_0x54a9b7-0x0;var _0xc00ec4=_0x4b74[_0x54a9b7];return _0xc00ec4;};'use strict';var _=require(_0x44b7('0x0'));var util=require(_0x44b7('0x1'));var moment=require(_0x44b7('0x2'));var BPromise=require('bluebird');var rs=require(_0x44b7('0x3'));var fs=require('fs');var Redis=require(_0x44b7('0x4'));var db=require(_0x44b7('0x5'))['db'];var utils=require(_0x44b7('0x6'));var logger=require(_0x44b7('0x7'))(_0x44b7('0x8'));var config=require(_0x44b7('0x9'));var jayson=require(_0x44b7('0xa'));var client=jayson['client'][_0x44b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2174f2,_0x7b80e9,_0x4a582b){return new BPromise(function(_0x45dfbe,_0xabf05c){return client[_0x44b7('0xc')](_0x2174f2,_0x4a582b)['then'](function(_0x7d4b17){logger[_0x44b7('0xd')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x44b7('0xe'));logger[_0x44b7('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x7b80e9,_0x44b7('0xe'),JSON[_0x44b7('0x10')](_0x7d4b17));if(_0x7d4b17[_0x44b7('0x11')]){if(_0x7d4b17['error'][_0x44b7('0x12')]===0x1f4){logger[_0x44b7('0x11')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x7d4b17[_0x44b7('0x11')]['message']);return _0xabf05c(_0x7d4b17[_0x44b7('0x11')][_0x44b7('0x13')]);}logger[_0x44b7('0x11')]('CloudProvider,\x20%s,\x20%s',_0x7b80e9,_0x7d4b17['error'][_0x44b7('0x13')]);return _0x45dfbe(_0x7d4b17['error']['message']);}else{logger['info'](_0x44b7('0x14'),_0x7b80e9,_0x44b7('0xe'));_0x45dfbe(_0x7d4b17['result'][_0x44b7('0x13')]);}})[_0x44b7('0x15')](function(_0x3528c8){logger[_0x44b7('0x11')](_0x44b7('0x14'),_0x7b80e9,_0x3528c8);_0xabf05c(_0x3528c8);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index ec4eb2f..f7e897f 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 _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x57dc85,_0x3a6d51){var _0x563a2e=function(_0x5713b2){while(--_0x5713b2){_0x57dc85['push'](_0x57dc85['shift']());}};_0x563a2e(++_0x3a6d51);}(_0x1261,0x144));var _0x1126=function(_0x1d7bc0,_0x50a455){_0x1d7bc0=_0x1d7bc0-0x0;var _0x15a179=_0x1261[_0x1d7bc0];return _0x15a179;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
+var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0x1261,0x144));var _0x1126=function(_0x558615,_0x1eb496){_0x558615=_0x558615-0x0;var _0x1e032a=_0x1261[_0x558615];return _0x1e032a;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index c8a8982..a500f4b 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 _0xb2bb=['sequelize','STRING','name'];(function(_0x32674c,_0x179fd4){var _0x940adc=function(_0x337a76){while(--_0x337a76){_0x32674c['push'](_0x32674c['shift']());}};_0x940adc(++_0x179fd4);}(_0xb2bb,0x198));var _0xbb2b=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0xb2bb[_0x5a636f];return _0x6a8cfb;};'use strict';var Sequelize=require(_0xbb2b('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb2b('0x1')],'unique':_0xbb2b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbb2b('0x1')]},'companyId':{'type':Sequelize[_0xbb2b('0x1')]},'website':{'type':Sequelize[_0xbb2b('0x1')]},'phone':{'type':Sequelize[_0xbb2b('0x1')]},'fax':{'type':Sequelize[_0xbb2b('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xbb2b('0x1')]},'postalCode':{'type':Sequelize[_0xbb2b('0x1')]},'city':{'type':Sequelize[_0xbb2b('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xbb2b('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbb2b('0x1')]},'sStreet':{'type':Sequelize[_0xbb2b('0x1')]},'sPostalCode':{'type':Sequelize[_0xbb2b('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xbb2b('0x1')]},'description':{'type':Sequelize[_0xbb2b('0x1')]}};
\ No newline at end of file
+var _0xfe78=['name','exports','STRING'];(function(_0x564104,_0x74c357){var _0x6dabcd=function(_0x1b3d56){while(--_0x1b3d56){_0x564104['push'](_0x564104['shift']());}};_0x6dabcd(++_0x74c357);}(_0xfe78,0x70));var _0x8fe7=function(_0x4c2c04,_0x5e38cf){_0x4c2c04=_0x4c2c04-0x0;var _0x2e7e99=_0xfe78[_0x4c2c04];return _0x2e7e99;};'use strict';var Sequelize=require('sequelize');module[_0x8fe7('0x0')]={'name':{'type':Sequelize[_0x8fe7('0x1')],'unique':_0x8fe7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x8fe7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8fe7('0x1')]},'type':{'type':Sequelize[_0x8fe7('0x1')]},'street':{'type':Sequelize[_0x8fe7('0x1')]},'postalCode':{'type':Sequelize[_0x8fe7('0x1')]},'city':{'type':Sequelize[_0x8fe7('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8fe7('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x8fe7('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8fe7('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 8a090a5..fea23ef 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 _0x6150=['catch','show','rawAttributes','fields','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','CmContact','addContacts','ids','omit','getContacts','findOne','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','get','Companies','destroy','then','end','sendStatus','error','stack','name','send','CmCompany','describe','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows'];(function(_0x5ebb78,_0x108363){var _0x748baf=function(_0x26b1a3){while(--_0x26b1a3){_0x5ebb78['push'](_0x5ebb78['shift']());}};_0x748baf(++_0x108363);}(_0x6150,0x1d2));var _0x0615=function(_0x4fffea,_0x5b89d2){_0x4fffea=_0x4fffea-0x0;var _0x1a891f=_0x6150[_0x4fffea];return _0x1a891f;};'use strict';var emlformat=require(_0x0615('0x0'));var rimraf=require(_0x0615('0x1'));var zipdir=require(_0x0615('0x2'));var jsonpatch=require(_0x0615('0x3'));var rp=require(_0x0615('0x4'));var moment=require(_0x0615('0x5'));var BPromise=require(_0x0615('0x6'));var Mustache=require(_0x0615('0x7'));var util=require(_0x0615('0x8'));var path=require(_0x0615('0x9'));var sox=require(_0x0615('0xa'));var csv=require(_0x0615('0xb'));var ejs=require(_0x0615('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0615('0xd'));var squel=require(_0x0615('0xe'));var crypto=require(_0x0615('0xf'));var jsforce=require(_0x0615('0x10'));var deskjs=require(_0x0615('0x11'));var toCsv=require(_0x0615('0xb'));var querystring=require(_0x0615('0x12'));var Papa=require('papaparse');var Redis=require(_0x0615('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0615('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0615('0x15'));var logger=require(_0x0615('0x16'))(_0x0615('0x17'));var utils=require(_0x0615('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0615('0x19'));var db=require(_0x0615('0x1a'))['db'];function respondWithStatusCode(_0x56ba6c,_0x404e29){_0x404e29=_0x404e29||0xcc;return function(_0x5d8c8c){if(_0x5d8c8c){return _0x56ba6c['sendStatus'](_0x404e29);}return _0x56ba6c[_0x0615('0x1b')](_0x404e29)['end']();};}function respondWithResult(_0x457a3e,_0x3304da){_0x3304da=_0x3304da||0xc8;return function(_0x5d8535){if(_0x5d8535){return _0x457a3e[_0x0615('0x1b')](_0x3304da)[_0x0615('0x1c')](_0x5d8535);}};}function respondWithFilteredResult(_0x60ec8,_0x44f464){return function(_0x5b631d){if(_0x5b631d){var _0x219ed5=typeof _0x44f464[_0x0615('0x1d')]===_0x0615('0x1e')&&typeof _0x44f464[_0x0615('0x1f')]===_0x0615('0x1e');var _0xa81a13=_0x5b631d['count'];var _0x16912b=_0x219ed5?0x0:_0x44f464[_0x0615('0x1d')];var _0x10f50f=_0x219ed5?_0x5b631d[_0x0615('0x20')]:_0x44f464['offset']+_0x44f464[_0x0615('0x1f')];var _0x174ba5;if(_0x10f50f>=_0xa81a13){_0x10f50f=_0xa81a13;_0x174ba5=0xc8;}else{_0x174ba5=0xce;}_0x60ec8[_0x0615('0x1b')](_0x174ba5);return _0x60ec8[_0x0615('0x21')](_0x0615('0x22'),_0x16912b+'-'+_0x10f50f+'/'+_0xa81a13)['json'](_0x5b631d);}return null;};}function patchUpdates(_0x62b0f9){return function(_0x541faf){try{jsonpatch[_0x0615('0x23')](_0x541faf,_0x62b0f9,!![]);}catch(_0x305063){return BPromise['reject'](_0x305063);}return _0x541faf[_0x0615('0x24')]();};}function saveUpdates(_0x1d73c1,_0x244bb5){return function(_0x5d9a59){if(_0x5d9a59){return _0x5d9a59['update'](_0x1d73c1)['then'](function(_0x5cf1a9){return _0x5cf1a9;});}return null;};}function removeEntity(_0x583928,_0x104cfa){return function(_0xe46621){if(_0xe46621){return _0xe46621['destroy']()['then'](function(){var _0x35f297=_0xe46621[_0x0615('0x25')]({'plain':!![]});var _0x4e5da8=_0x0615('0x26');return db['UserProfileResource'][_0x0615('0x27')]({'where':{'type':_0x4e5da8,'resourceId':_0x35f297['id']}})[_0x0615('0x28')](function(){return _0xe46621;});})[_0x0615('0x28')](function(){_0x583928['status'](0xcc)[_0x0615('0x29')]();});}};}function handleEntityNotFound(_0x4b9bb9,_0x14fae5){return function(_0x437f8c){if(!_0x437f8c){_0x4b9bb9[_0x0615('0x2a')](0x194);}return _0x437f8c;};}function handleError(_0x2644e2,_0x15b57c){_0x15b57c=_0x15b57c||0x1f4;return function(_0x26abe7){logger[_0x0615('0x2b')](_0x26abe7[_0x0615('0x2c')]);if(_0x26abe7[_0x0615('0x2d')]){delete _0x26abe7['name'];}_0x2644e2[_0x0615('0x1b')](_0x15b57c)[_0x0615('0x2e')](_0x26abe7);};}exports['index']=function(_0x1f1b9e,_0x36946d){var _0x3cf61c={},_0x28b319={},_0x5ad3ba={'count':0x0,'rows':[]};return db[_0x0615('0x2f')][_0x0615('0x30')]()[_0x0615('0x28')](function(_0xd87249){_0x28b319[_0x0615('0x31')]=_[_0x0615('0x32')](_0xd87249);_0x28b319[_0x0615('0x33')]=_['keys'](_0x1f1b9e[_0x0615('0x33')]);_0x28b319[_0x0615('0x34')]=_[_0x0615('0x35')](_0x28b319[_0x0615('0x31')],_0x28b319[_0x0615('0x33')]);_0x3cf61c[_0x0615('0x36')]=_[_0x0615('0x35')](_0x28b319[_0x0615('0x31')],qs['fields'](_0x1f1b9e[_0x0615('0x33')]['fields']));_0x3cf61c['attributes']=_0x3cf61c['attributes'][_0x0615('0x37')]?_0x3cf61c[_0x0615('0x36')]:_0x28b319[_0x0615('0x31')];if(!_0x1f1b9e[_0x0615('0x33')][_0x0615('0x38')](_0x0615('0x39'))){_0x3cf61c['limit']=qs[_0x0615('0x1f')](_0x1f1b9e['query'][_0x0615('0x1f')]);_0x3cf61c[_0x0615('0x1d')]=qs['offset'](_0x1f1b9e[_0x0615('0x33')][_0x0615('0x1d')]);}_0x3cf61c[_0x0615('0x3a')]=qs[_0x0615('0x3b')](_0x1f1b9e['query'][_0x0615('0x3b')]);_0x3cf61c[_0x0615('0x3c')]=qs[_0x0615('0x34')](_[_0x0615('0x3d')](_0x1f1b9e[_0x0615('0x33')],_0x28b319['filters']),_0xd87249);if(_0x1f1b9e[_0x0615('0x33')][_0x0615('0x3e')]){_0x3cf61c[_0x0615('0x3c')]=_[_0x0615('0x3f')](_0x3cf61c[_0x0615('0x3c')],{'$or':_['map'](_0x3cf61c['attributes'],function(_0x285e42){var _0x37d2e1={};_0x37d2e1[_0x285e42]={'$like':'%'+_0x1f1b9e['query']['filter']+'%'};return _0x37d2e1;})});}_0x3cf61c=_[_0x0615('0x3f')]({},_0x3cf61c,_0x1f1b9e[_0x0615('0x40')]);var _0x212cc4={'where':_0x3cf61c[_0x0615('0x3c')]};return db[_0x0615('0x2f')][_0x0615('0x20')](_0x212cc4)[_0x0615('0x28')](function(_0x838207){_0x5ad3ba['count']=_0x838207;if(_0x1f1b9e[_0x0615('0x33')]['includeAll']){_0x3cf61c[_0x0615('0x41')]=[{'all':!![]}];}return db['CmCompany'][_0x0615('0x42')](_0x3cf61c);})['then'](function(_0x122c8e){_0x5ad3ba[_0x0615('0x43')]=_0x122c8e;return _0x5ad3ba;})[_0x0615('0x28')](respondWithFilteredResult(_0x36946d,_0x3cf61c))[_0x0615('0x44')](handleError(_0x36946d,null));})[_0x0615('0x44')](handleError(_0x36946d,null));};exports[_0x0615('0x45')]=function(_0xcc0351,_0x3588aa){var _0x1005e6={'raw':![],'where':{'id':_0xcc0351['params']['id']}},_0x1ff4da={};_0x1ff4da[_0x0615('0x31')]=_['keys'](db[_0x0615('0x2f')][_0x0615('0x46')]);_0x1ff4da[_0x0615('0x33')]=_[_0x0615('0x32')](_0xcc0351[_0x0615('0x33')]);_0x1ff4da[_0x0615('0x34')]=_[_0x0615('0x35')](_0x1ff4da[_0x0615('0x31')],_0x1ff4da[_0x0615('0x33')]);_0x1005e6[_0x0615('0x36')]=_['intersection'](_0x1ff4da[_0x0615('0x31')],qs['fields'](_0xcc0351[_0x0615('0x33')][_0x0615('0x47')]));_0x1005e6[_0x0615('0x36')]=_0x1005e6[_0x0615('0x36')]['length']?_0x1005e6[_0x0615('0x36')]:_0x1ff4da[_0x0615('0x31')];if(_0xcc0351[_0x0615('0x33')][_0x0615('0x48')]){_0x1005e6[_0x0615('0x41')]=[{'all':!![]}];}_0x1005e6=_[_0x0615('0x3f')]({},_0x1005e6,_0xcc0351[_0x0615('0x40')]);return db[_0x0615('0x2f')][_0x0615('0x49')](_0x1005e6)[_0x0615('0x28')](handleEntityNotFound(_0x3588aa,null))[_0x0615('0x28')](respondWithResult(_0x3588aa,null))[_0x0615('0x44')](handleError(_0x3588aa,null));};exports[_0x0615('0x4a')]=function(_0x5d55b7,_0x844db8){return db[_0x0615('0x2f')][_0x0615('0x4a')](_0x5d55b7['body'],{})['then'](function(_0x5b545c){var _0xea4d7a=_0x5d55b7['user']['get']({'plain':!![]});if(!_0xea4d7a)throw new Error(_0x0615('0x4b'));if(_0xea4d7a['role']==='user'){var _0x22761c=_0x5b545c[_0x0615('0x25')]({'plain':!![]});var _0x4b957b=_0x0615('0x26');return db[_0x0615('0x4c')][_0x0615('0x49')]({'where':{'name':_0x4b957b,'userProfileId':_0xea4d7a['userProfileId']},'raw':!![]})[_0x0615('0x28')](function(_0x307345){if(_0x307345&&_0x307345['autoAssociation']===0x0){return db[_0x0615('0x4d')][_0x0615('0x4a')]({'name':_0x22761c[_0x0615('0x2d')],'resourceId':_0x22761c['id'],'type':_0x307345[_0x0615('0x2d')],'sectionId':_0x307345['id']},{})[_0x0615('0x28')](function(){return _0x5b545c;});}else{return _0x5b545c;}})['catch'](function(_0x3dfa4d){logger[_0x0615('0x2b')](_0x0615('0x4e'),_0x3dfa4d);throw _0x3dfa4d;});}return _0x5b545c;})['then'](respondWithResult(_0x844db8,0xc9))[_0x0615('0x44')](handleError(_0x844db8,null));};exports[_0x0615('0x4f')]=function(_0x49900a,_0x32d73e){if(_0x49900a['body']['id']){delete _0x49900a[_0x0615('0x50')]['id'];}return db['CmCompany'][_0x0615('0x49')]({'where':{'id':_0x49900a['params']['id']}})[_0x0615('0x28')](handleEntityNotFound(_0x32d73e,null))[_0x0615('0x28')](saveUpdates(_0x49900a[_0x0615('0x50')],null))['then'](respondWithResult(_0x32d73e,null))[_0x0615('0x44')](handleError(_0x32d73e,null));};exports[_0x0615('0x27')]=function(_0x4bd63c,_0x50bfde){return db['CmCompany']['find']({'where':{'id':_0x4bd63c[_0x0615('0x51')]['id']}})[_0x0615('0x28')](handleEntityNotFound(_0x50bfde,null))[_0x0615('0x28')](removeEntity(_0x50bfde,null))[_0x0615('0x44')](handleError(_0x50bfde,null));};exports['describe']=function(_0x3a09ed,_0x5c3e9a){return db['CmCompany'][_0x0615('0x30')]()[_0x0615('0x28')](respondWithResult(_0x5c3e9a,null))[_0x0615('0x44')](handleError(_0x5c3e9a,null));};exports['addContacts']=function(_0x5c386f,_0x136570,_0x2c394f){return db[_0x0615('0x52')][_0x0615('0x49')]({'where':{'id':_0x5c386f[_0x0615('0x51')]['id']}})[_0x0615('0x28')](handleEntityNotFound(_0x136570,null))[_0x0615('0x28')](function(_0xd3f255){if(_0xd3f255){return _0xd3f255[_0x0615('0x53')](_0x5c386f['body'][_0x0615('0x54')],_[_0x0615('0x55')](_0x5c386f['body'],[_0x0615('0x54'),'id'])||{});}})[_0x0615('0x28')](respondWithResult(_0x136570,null))[_0x0615('0x44')](handleError(_0x136570,null));};exports[_0x0615('0x56')]=function(_0x3d31cc,_0x250d8d,_0x4590d2){var _0x43625e={};var _0x361677={};var _0x1b43e4;var _0x5b658c;return db[_0x0615('0x2f')][_0x0615('0x57')]({'where':{'id':_0x3d31cc[_0x0615('0x51')]['id']}})['then'](handleEntityNotFound(_0x250d8d,null))[_0x0615('0x28')](function(_0x51f376){if(_0x51f376){_0x1b43e4=_0x51f376;_0x361677[_0x0615('0x31')]=_[_0x0615('0x32')](db[_0x0615('0x52')]['rawAttributes']);_0x361677[_0x0615('0x33')]=_['keys'](_0x3d31cc[_0x0615('0x33')]);_0x361677[_0x0615('0x34')]=_['intersection'](_0x361677[_0x0615('0x31')],_0x361677[_0x0615('0x33')]);_0x43625e[_0x0615('0x36')]=_[_0x0615('0x35')](_0x361677[_0x0615('0x31')],qs['fields'](_0x3d31cc[_0x0615('0x33')][_0x0615('0x47')]));_0x43625e[_0x0615('0x36')]=_0x43625e[_0x0615('0x36')][_0x0615('0x37')]?_0x43625e['attributes']:_0x361677['model'];_0x43625e[_0x0615('0x3a')]=qs[_0x0615('0x3b')](_0x3d31cc[_0x0615('0x33')]['sort']);_0x43625e[_0x0615('0x3c')]=qs[_0x0615('0x34')](_[_0x0615('0x3d')](_0x3d31cc['query'],_0x361677[_0x0615('0x34')]));if(_0x3d31cc[_0x0615('0x33')][_0x0615('0x3e')]){_0x43625e[_0x0615('0x3c')]=_[_0x0615('0x3f')](_0x43625e[_0x0615('0x3c')],{'$or':_[_0x0615('0x58')](_0x43625e['attributes'],function(_0x1b6e29){var _0x59a38b={};_0x59a38b[_0x1b6e29]={'$like':'%'+_0x3d31cc[_0x0615('0x33')][_0x0615('0x3e')]+'%'};return _0x59a38b;})});}_0x43625e=_[_0x0615('0x3f')]({},_0x43625e,_0x3d31cc['options']);return _0x1b43e4[_0x0615('0x56')](_0x43625e);}})[_0x0615('0x28')](function(_0x18af1f){if(_0x18af1f){_0x5b658c=_0x18af1f[_0x0615('0x37')];if(!_0x3d31cc[_0x0615('0x33')]['hasOwnProperty']('nolimit')){_0x43625e['limit']=qs[_0x0615('0x1f')](_0x3d31cc[_0x0615('0x33')]['limit']);_0x43625e[_0x0615('0x1d')]=qs[_0x0615('0x1d')](_0x3d31cc[_0x0615('0x33')]['offset']);}return _0x1b43e4[_0x0615('0x56')](_0x43625e);}})[_0x0615('0x28')](function(_0x5926d9){if(_0x5926d9){return _0x5926d9?{'count':_0x5b658c,'rows':_0x5926d9}:null;}})['then'](respondWithResult(_0x250d8d,null))[_0x0615('0x44')](handleError(_0x250d8d,null));};
\ No newline at end of file
+var _0x92be=['getContacts','findOne','order','map','options','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','CmCompany','describe','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','rows','catch','show','rawAttributes','keys','length','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids'];(function(_0x4c9ed,_0x4357e1){var _0x49427b=function(_0x7b6da6){while(--_0x7b6da6){_0x4c9ed['push'](_0x4c9ed['shift']());}};_0x49427b(++_0x4357e1);}(_0x92be,0x107));var _0xe92b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x92be[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0xe92b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe92b('0x1'));var jsonpatch=require(_0xe92b('0x2'));var rp=require(_0xe92b('0x3'));var moment=require('moment');var BPromise=require(_0xe92b('0x4'));var Mustache=require(_0xe92b('0x5'));var util=require(_0xe92b('0x6'));var path=require(_0xe92b('0x7'));var sox=require(_0xe92b('0x8'));var csv=require(_0xe92b('0x9'));var ejs=require(_0xe92b('0xa'));var fs=require('fs');var fs_extra=require(_0xe92b('0xb'));var _=require(_0xe92b('0xc'));var squel=require(_0xe92b('0xd'));var crypto=require('crypto');var jsforce=require(_0xe92b('0xe'));var deskjs=require(_0xe92b('0xf'));var toCsv=require(_0xe92b('0x9'));var querystring=require('querystring');var Papa=require(_0xe92b('0x10'));var Redis=require(_0xe92b('0x11'));var authService=require(_0xe92b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe92b('0x13'));var logger=require('../../config/logger')(_0xe92b('0x14'));var utils=require(_0xe92b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe92b('0x16'));var db=require(_0xe92b('0x17'))['db'];function respondWithStatusCode(_0x31d5f4,_0x42b311){_0x42b311=_0x42b311||0xcc;return function(_0x5780f5){if(_0x5780f5){return _0x31d5f4[_0xe92b('0x18')](_0x42b311);}return _0x31d5f4[_0xe92b('0x19')](_0x42b311)['end']();};}function respondWithResult(_0x41c769,_0x4afeb1){_0x4afeb1=_0x4afeb1||0xc8;return function(_0x5f191e){if(_0x5f191e){return _0x41c769['status'](_0x4afeb1)[_0xe92b('0x1a')](_0x5f191e);}};}function respondWithFilteredResult(_0x17f6f6,_0x24d8b5){return function(_0x296ea6){if(_0x296ea6){var _0x424973=typeof _0x24d8b5['offset']==='undefined'&&typeof _0x24d8b5[_0xe92b('0x1b')]===_0xe92b('0x1c');var _0x19f84c=_0x296ea6[_0xe92b('0x1d')];var _0x58adba=_0x424973?0x0:_0x24d8b5[_0xe92b('0x1e')];var _0xe6d076=_0x424973?_0x296ea6[_0xe92b('0x1d')]:_0x24d8b5[_0xe92b('0x1e')]+_0x24d8b5[_0xe92b('0x1b')];var _0x133168;if(_0xe6d076>=_0x19f84c){_0xe6d076=_0x19f84c;_0x133168=0xc8;}else{_0x133168=0xce;}_0x17f6f6['status'](_0x133168);return _0x17f6f6[_0xe92b('0x1f')](_0xe92b('0x20'),_0x58adba+'-'+_0xe6d076+'/'+_0x19f84c)['json'](_0x296ea6);}return null;};}function patchUpdates(_0x5ecd53){return function(_0x250f8c){try{jsonpatch[_0xe92b('0x21')](_0x250f8c,_0x5ecd53,!![]);}catch(_0x280b7f){return BPromise[_0xe92b('0x22')](_0x280b7f);}return _0x250f8c['save']();};}function saveUpdates(_0x42d6f6,_0x395b01){return function(_0x477786){if(_0x477786){return _0x477786[_0xe92b('0x23')](_0x42d6f6)[_0xe92b('0x24')](function(_0x4ebd96){return _0x4ebd96;});}return null;};}function removeEntity(_0x518ae3,_0x26b6e9){return function(_0x291edc){if(_0x291edc){return _0x291edc[_0xe92b('0x25')]()[_0xe92b('0x24')](function(){var _0x176819=_0x291edc[_0xe92b('0x26')]({'plain':!![]});var _0x4aa530=_0xe92b('0x27');return db[_0xe92b('0x28')]['destroy']({'where':{'type':_0x4aa530,'resourceId':_0x176819['id']}})['then'](function(){return _0x291edc;});})[_0xe92b('0x24')](function(){_0x518ae3[_0xe92b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x144ec5,_0x3ad8c1){return function(_0x7435f0){if(!_0x7435f0){_0x144ec5['sendStatus'](0x194);}return _0x7435f0;};}function handleError(_0x412bdc,_0x289cdd){_0x289cdd=_0x289cdd||0x1f4;return function(_0x296e12){logger[_0xe92b('0x29')](_0x296e12[_0xe92b('0x2a')]);if(_0x296e12[_0xe92b('0x2b')]){delete _0x296e12[_0xe92b('0x2b')];}_0x412bdc['status'](_0x289cdd)[_0xe92b('0x2c')](_0x296e12);};}exports['index']=function(_0x44175d,_0x4c23eb){var _0x28799a={},_0x5e1f2d={},_0x2633d1={'count':0x0,'rows':[]};return db[_0xe92b('0x2d')][_0xe92b('0x2e')]()[_0xe92b('0x24')](function(_0x45a8bf){_0x5e1f2d['model']=_['keys'](_0x45a8bf);_0x5e1f2d['query']=_['keys'](_0x44175d[_0xe92b('0x2f')]);_0x5e1f2d[_0xe92b('0x30')]=_['intersection'](_0x5e1f2d[_0xe92b('0x31')],_0x5e1f2d['query']);_0x28799a[_0xe92b('0x32')]=_[_0xe92b('0x33')](_0x5e1f2d[_0xe92b('0x31')],qs[_0xe92b('0x34')](_0x44175d[_0xe92b('0x2f')][_0xe92b('0x34')]));_0x28799a['attributes']=_0x28799a[_0xe92b('0x32')]['length']?_0x28799a[_0xe92b('0x32')]:_0x5e1f2d[_0xe92b('0x31')];if(!_0x44175d[_0xe92b('0x2f')][_0xe92b('0x35')](_0xe92b('0x36'))){_0x28799a[_0xe92b('0x1b')]=qs[_0xe92b('0x1b')](_0x44175d['query']['limit']);_0x28799a[_0xe92b('0x1e')]=qs['offset'](_0x44175d[_0xe92b('0x2f')]['offset']);}_0x28799a['order']=qs[_0xe92b('0x37')](_0x44175d['query']['sort']);_0x28799a['where']=qs[_0xe92b('0x30')](_[_0xe92b('0x38')](_0x44175d[_0xe92b('0x2f')],_0x5e1f2d[_0xe92b('0x30')]),_0x45a8bf);if(_0x44175d[_0xe92b('0x2f')][_0xe92b('0x39')]){_0x28799a[_0xe92b('0x3a')]=_[_0xe92b('0x3b')](_0x28799a['where'],{'$or':_['map'](_0x28799a[_0xe92b('0x32')],function(_0x2e7d4d){var _0x463552={};_0x463552[_0x2e7d4d]={'$like':'%'+_0x44175d[_0xe92b('0x2f')][_0xe92b('0x39')]+'%'};return _0x463552;})});}_0x28799a=_[_0xe92b('0x3b')]({},_0x28799a,_0x44175d['options']);var _0x35c35a={'where':_0x28799a[_0xe92b('0x3a')]};return db[_0xe92b('0x2d')][_0xe92b('0x1d')](_0x35c35a)[_0xe92b('0x24')](function(_0x4b7b98){_0x2633d1[_0xe92b('0x1d')]=_0x4b7b98;if(_0x44175d[_0xe92b('0x2f')][_0xe92b('0x3c')]){_0x28799a['include']=[{'all':!![]}];}return db[_0xe92b('0x2d')]['findAll'](_0x28799a);})[_0xe92b('0x24')](function(_0x30c89d){_0x2633d1[_0xe92b('0x3d')]=_0x30c89d;return _0x2633d1;})['then'](respondWithFilteredResult(_0x4c23eb,_0x28799a))[_0xe92b('0x3e')](handleError(_0x4c23eb,null));})['catch'](handleError(_0x4c23eb,null));};exports[_0xe92b('0x3f')]=function(_0x7bce32,_0x380ccb){var _0x5aa0c7={'raw':![],'where':{'id':_0x7bce32['params']['id']}},_0x4c3ac4={};_0x4c3ac4[_0xe92b('0x31')]=_['keys'](db[_0xe92b('0x2d')][_0xe92b('0x40')]);_0x4c3ac4[_0xe92b('0x2f')]=_[_0xe92b('0x41')](_0x7bce32['query']);_0x4c3ac4[_0xe92b('0x30')]=_[_0xe92b('0x33')](_0x4c3ac4[_0xe92b('0x31')],_0x4c3ac4['query']);_0x5aa0c7[_0xe92b('0x32')]=_[_0xe92b('0x33')](_0x4c3ac4[_0xe92b('0x31')],qs[_0xe92b('0x34')](_0x7bce32[_0xe92b('0x2f')][_0xe92b('0x34')]));_0x5aa0c7[_0xe92b('0x32')]=_0x5aa0c7[_0xe92b('0x32')][_0xe92b('0x42')]?_0x5aa0c7[_0xe92b('0x32')]:_0x4c3ac4['model'];if(_0x7bce32[_0xe92b('0x2f')][_0xe92b('0x3c')]){_0x5aa0c7[_0xe92b('0x43')]=[{'all':!![]}];}_0x5aa0c7=_[_0xe92b('0x3b')]({},_0x5aa0c7,_0x7bce32['options']);return db[_0xe92b('0x2d')][_0xe92b('0x44')](_0x5aa0c7)['then'](handleEntityNotFound(_0x380ccb,null))['then'](respondWithResult(_0x380ccb,null))[_0xe92b('0x3e')](handleError(_0x380ccb,null));};exports['create']=function(_0x8d38fb,_0x3f3760){return db[_0xe92b('0x2d')][_0xe92b('0x45')](_0x8d38fb['body'],{})[_0xe92b('0x24')](function(_0x210426){var _0x3c0c96=_0x8d38fb[_0xe92b('0x46')]['get']({'plain':!![]});if(!_0x3c0c96)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c0c96[_0xe92b('0x47')]===_0xe92b('0x46')){var _0xd9cbf5=_0x210426[_0xe92b('0x26')]({'plain':!![]});var _0x164ad3=_0xe92b('0x27');return db[_0xe92b('0x48')][_0xe92b('0x44')]({'where':{'name':_0x164ad3,'userProfileId':_0x3c0c96[_0xe92b('0x49')]},'raw':!![]})[_0xe92b('0x24')](function(_0xbf1685){if(_0xbf1685&&_0xbf1685[_0xe92b('0x4a')]===0x0){return db[_0xe92b('0x28')]['create']({'name':_0xd9cbf5[_0xe92b('0x2b')],'resourceId':_0xd9cbf5['id'],'type':_0xbf1685[_0xe92b('0x2b')],'sectionId':_0xbf1685['id']},{})[_0xe92b('0x24')](function(){return _0x210426;});}else{return _0x210426;}})[_0xe92b('0x3e')](function(_0x13c5e1){logger[_0xe92b('0x29')](_0xe92b('0x4b'),_0x13c5e1);throw _0x13c5e1;});}return _0x210426;})[_0xe92b('0x24')](respondWithResult(_0x3f3760,0xc9))[_0xe92b('0x3e')](handleError(_0x3f3760,null));};exports[_0xe92b('0x23')]=function(_0x4212f3,_0x205bf5){if(_0x4212f3[_0xe92b('0x4c')]['id']){delete _0x4212f3[_0xe92b('0x4c')]['id'];}return db[_0xe92b('0x2d')][_0xe92b('0x44')]({'where':{'id':_0x4212f3[_0xe92b('0x4d')]['id']}})[_0xe92b('0x24')](handleEntityNotFound(_0x205bf5,null))[_0xe92b('0x24')](saveUpdates(_0x4212f3[_0xe92b('0x4c')],null))['then'](respondWithResult(_0x205bf5,null))[_0xe92b('0x3e')](handleError(_0x205bf5,null));};exports[_0xe92b('0x25')]=function(_0x288678,_0x14b593){return db[_0xe92b('0x2d')][_0xe92b('0x44')]({'where':{'id':_0x288678['params']['id']}})[_0xe92b('0x24')](handleEntityNotFound(_0x14b593,null))[_0xe92b('0x24')](removeEntity(_0x14b593,null))[_0xe92b('0x3e')](handleError(_0x14b593,null));};exports[_0xe92b('0x2e')]=function(_0x3eac60,_0x535f88){return db[_0xe92b('0x2d')]['describe']()[_0xe92b('0x24')](respondWithResult(_0x535f88,null))[_0xe92b('0x3e')](handleError(_0x535f88,null));};exports[_0xe92b('0x4e')]=function(_0x1bf1b2,_0x35c72b,_0x257d92){return db[_0xe92b('0x4f')]['find']({'where':{'id':_0x1bf1b2['params']['id']}})[_0xe92b('0x24')](handleEntityNotFound(_0x35c72b,null))[_0xe92b('0x24')](function(_0x109506){if(_0x109506){return _0x109506[_0xe92b('0x4e')](_0x1bf1b2[_0xe92b('0x4c')][_0xe92b('0x50')],_['omit'](_0x1bf1b2[_0xe92b('0x4c')],[_0xe92b('0x50'),'id'])||{});}})['then'](respondWithResult(_0x35c72b,null))['catch'](handleError(_0x35c72b,null));};exports[_0xe92b('0x51')]=function(_0x3884ae,_0x591ee2,_0x3f9c93){var _0x4c34ae={};var _0x10d909={};var _0x2ba4aa;var _0x3c069a;return db['CmCompany'][_0xe92b('0x52')]({'where':{'id':_0x3884ae[_0xe92b('0x4d')]['id']}})[_0xe92b('0x24')](handleEntityNotFound(_0x591ee2,null))['then'](function(_0x506009){if(_0x506009){_0x2ba4aa=_0x506009;_0x10d909[_0xe92b('0x31')]=_[_0xe92b('0x41')](db[_0xe92b('0x4f')][_0xe92b('0x40')]);_0x10d909[_0xe92b('0x2f')]=_[_0xe92b('0x41')](_0x3884ae[_0xe92b('0x2f')]);_0x10d909[_0xe92b('0x30')]=_[_0xe92b('0x33')](_0x10d909[_0xe92b('0x31')],_0x10d909[_0xe92b('0x2f')]);_0x4c34ae[_0xe92b('0x32')]=_[_0xe92b('0x33')](_0x10d909[_0xe92b('0x31')],qs[_0xe92b('0x34')](_0x3884ae['query']['fields']));_0x4c34ae['attributes']=_0x4c34ae[_0xe92b('0x32')]['length']?_0x4c34ae[_0xe92b('0x32')]:_0x10d909[_0xe92b('0x31')];_0x4c34ae[_0xe92b('0x53')]=qs['sort'](_0x3884ae[_0xe92b('0x2f')][_0xe92b('0x37')]);_0x4c34ae[_0xe92b('0x3a')]=qs[_0xe92b('0x30')](_['pick'](_0x3884ae[_0xe92b('0x2f')],_0x10d909['filters']));if(_0x3884ae['query'][_0xe92b('0x39')]){_0x4c34ae[_0xe92b('0x3a')]=_[_0xe92b('0x3b')](_0x4c34ae['where'],{'$or':_[_0xe92b('0x54')](_0x4c34ae[_0xe92b('0x32')],function(_0x34627a){var _0x29b01b={};_0x29b01b[_0x34627a]={'$like':'%'+_0x3884ae[_0xe92b('0x2f')][_0xe92b('0x39')]+'%'};return _0x29b01b;})});}_0x4c34ae=_['merge']({},_0x4c34ae,_0x3884ae[_0xe92b('0x55')]);return _0x2ba4aa[_0xe92b('0x51')](_0x4c34ae);}})[_0xe92b('0x24')](function(_0x147a86){if(_0x147a86){_0x3c069a=_0x147a86[_0xe92b('0x42')];if(!_0x3884ae[_0xe92b('0x2f')][_0xe92b('0x35')]('nolimit')){_0x4c34ae[_0xe92b('0x1b')]=qs[_0xe92b('0x1b')](_0x3884ae['query'][_0xe92b('0x1b')]);_0x4c34ae[_0xe92b('0x1e')]=qs[_0xe92b('0x1e')](_0x3884ae[_0xe92b('0x2f')][_0xe92b('0x1e')]);}return _0x2ba4aa[_0xe92b('0x51')](_0x4c34ae);}})[_0xe92b('0x24')](function(_0x12ee6c){if(_0x12ee6c){return _0x12ee6c?{'count':_0x3c069a,'rows':_0x12ee6c}:null;}})['then'](respondWithResult(_0x591ee2,null))['catch'](handleError(_0x591ee2,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 6f28871..e9c4454 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 _0x1f7b=['request-promise','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','bluebird'];(function(_0x4a8721,_0x143f8c){var _0x4ba00f=function(_0x2655d9){while(--_0x2655d9){_0x4a8721['push'](_0x4a8721['shift']());}};_0x4ba00f(++_0x143f8c);}(_0x1f7b,0x1d0));var _0xb1f7=function(_0x2ef44b,_0x553359){_0x2ef44b=_0x2ef44b-0x0;var _0x2405b9=_0x1f7b[_0x2ef44b];return _0x2405b9;};'use strict';var _=require(_0xb1f7('0x0'));var util=require(_0xb1f7('0x1'));var logger=require(_0xb1f7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb1f7('0x3'));var rp=require(_0xb1f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb1f7('0x5'));var config=require(_0xb1f7('0x6'));var attributes=require('./cmCompany.attributes');module[_0xb1f7('0x7')]=function(_0x3e93c8,_0x409d67){return _0x3e93c8[_0xb1f7('0x8')]('CmCompany',attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdaba=['cm_companies','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x2f2763,_0x4d9637){var _0x442362=function(_0xaed4fa){while(--_0xaed4fa){_0x2f2763['push'](_0x2f2763['shift']());}};_0x442362(++_0x4d9637);}(_0xdaba,0x1c9));var _0xadab=function(_0x3729fc,_0x10a08e){_0x3729fc=_0x3729fc-0x0;var _0x1bab4f=_0xdaba[_0x3729fc];return _0x1bab4f;};'use strict';var _=require(_0xadab('0x0'));var util=require('util');var logger=require(_0xadab('0x1'))(_0xadab('0x2'));var moment=require('moment');var BPromise=require(_0xadab('0x3'));var rp=require(_0xadab('0x4'));var fs=require('fs');var path=require(_0xadab('0x5'));var rimraf=require(_0xadab('0x6'));var config=require('../../config/environment');var attributes=require(_0xadab('0x7'));module[_0xadab('0x8')]=function(_0x5913ef,_0x105895){return _0x5913ef[_0xadab('0x9')](_0xadab('0xa'),attributes,{'tableName':_0xadab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 70812a3..7037e72 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 _0x4b1c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4b1c,0xe9));var _0xc4b1=function(_0x18cc77,_0x41d313){_0x18cc77=_0x18cc77-0x0;var _0x34e801=_0x4b1c[_0x18cc77];return _0x34e801;};'use strict';var _=require(_0xc4b1('0x0'));var util=require(_0xc4b1('0x1'));var moment=require(_0xc4b1('0x2'));var BPromise=require(_0xc4b1('0x3'));var rs=require(_0xc4b1('0x4'));var fs=require('fs');var Redis=require(_0xc4b1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc4b1('0x6'));var logger=require(_0xc4b1('0x7'))(_0xc4b1('0x8'));var config=require(_0xc4b1('0x9'));var jayson=require(_0xc4b1('0xa'));var client=jayson[_0xc4b1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22a48c,_0x479301,_0x7eb114){return new BPromise(function(_0x2a87c9,_0x32a012){return client['request'](_0x22a48c,_0x7eb114)[_0xc4b1('0xc')](function(_0x1c341e){logger['info'](_0xc4b1('0xd'),_0x479301,_0xc4b1('0xe'));logger[_0xc4b1('0xf')](_0xc4b1('0x10'),_0x479301,_0xc4b1('0xe'),JSON[_0xc4b1('0x11')](_0x1c341e));if(_0x1c341e[_0xc4b1('0x12')]){if(_0x1c341e[_0xc4b1('0x12')][_0xc4b1('0x13')]===0x1f4){logger[_0xc4b1('0x12')]('CmCompany,\x20%s,\x20%s',_0x479301,_0x1c341e['error']['message']);return _0x32a012(_0x1c341e[_0xc4b1('0x12')]['message']);}logger[_0xc4b1('0x12')](_0xc4b1('0xd'),_0x479301,_0x1c341e[_0xc4b1('0x12')][_0xc4b1('0x14')]);return _0x2a87c9(_0x1c341e['error'][_0xc4b1('0x14')]);}else{logger[_0xc4b1('0x15')](_0xc4b1('0xd'),_0x479301,_0xc4b1('0xe'));_0x2a87c9(_0x1c341e[_0xc4b1('0x16')][_0xc4b1('0x14')]);}})[_0xc4b1('0x17')](function(_0x186c3d){logger[_0xc4b1('0x12')](_0xc4b1('0xd'),_0x479301,_0x186c3d);_0x32a012(_0x186c3d);});});}
\ No newline at end of file
+var _0x3732=['result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','client','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x53b76e,_0x209fe3){var _0x311645=function(_0x314846){while(--_0x314846){_0x53b76e['push'](_0x53b76e['shift']());}};_0x311645(++_0x209fe3);}(_0x3732,0x19f));var _0x2373=function(_0xe2bf6f,_0x4a304f){_0xe2bf6f=_0xe2bf6f-0x0;var _0x1649ea=_0x3732[_0xe2bf6f];return _0x1649ea;};'use strict';var _=require(_0x2373('0x0'));var util=require(_0x2373('0x1'));var moment=require(_0x2373('0x2'));var BPromise=require('bluebird');var rs=require(_0x2373('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2373('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2373('0x5'))(_0x2373('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2373('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14c6b6,_0x44e242,_0x6c17ea){return new BPromise(function(_0x5a1189,_0x53fe00){return client[_0x2373('0x8')](_0x14c6b6,_0x6c17ea)['then'](function(_0x512f9f){logger['info'](_0x2373('0x9'),_0x44e242,_0x2373('0xa'));logger[_0x2373('0xb')](_0x2373('0xc'),_0x44e242,_0x2373('0xa'),JSON[_0x2373('0xd')](_0x512f9f));if(_0x512f9f['error']){if(_0x512f9f[_0x2373('0xe')]['code']===0x1f4){logger['error'](_0x2373('0x9'),_0x44e242,_0x512f9f[_0x2373('0xe')][_0x2373('0xf')]);return _0x53fe00(_0x512f9f[_0x2373('0xe')][_0x2373('0xf')]);}logger['error'](_0x2373('0x9'),_0x44e242,_0x512f9f[_0x2373('0xe')][_0x2373('0xf')]);return _0x5a1189(_0x512f9f[_0x2373('0xe')][_0x2373('0xf')]);}else{logger[_0x2373('0x10')](_0x2373('0x9'),_0x44e242,_0x2373('0xa'));_0x5a1189(_0x512f9f[_0x2373('0x11')][_0x2373('0xf')]);}})['catch'](function(_0x4544ac){logger[_0x2373('0xe')](_0x2373('0x9'),_0x44e242,_0x4544ac);_0x53fe00(_0x4544ac);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 28131a5..cf281e3 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 _0x2787=['describe','/:id','show','getContacts','post','addContacts','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x2787,0x15e));var _0x7278=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2787[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x7278('0x0'));var util=require('util');var path=require(_0x7278('0x1'));var timeout=require('connect-timeout');var express=require(_0x7278('0x2'));var router=express[_0x7278('0x3')]();var fs_extra=require(_0x7278('0x4'));var auth=require(_0x7278('0x5'));var interaction=require(_0x7278('0x6'));var config=require(_0x7278('0x7'));var controller=require('./cmCompany.controller');router[_0x7278('0x8')]('/',auth[_0x7278('0x9')](),controller['index']);router[_0x7278('0x8')](_0x7278('0xa'),auth['isAuthenticated'](),controller[_0x7278('0xb')]);router[_0x7278('0x8')](_0x7278('0xc'),auth[_0x7278('0x9')](),controller[_0x7278('0xd')]);router[_0x7278('0x8')]('/:id/contacts',auth[_0x7278('0x9')](),controller[_0x7278('0xe')]);router[_0x7278('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7278('0xf')]('/:id/contacts',auth[_0x7278('0x9')](),controller[_0x7278('0x10')]);router['put'](_0x7278('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7278('0xc'),auth[_0x7278('0x9')](),controller[_0x7278('0x11')]);module[_0x7278('0x12')]=router;
\ No newline at end of file
+var _0x9ec7=['./cmCompany.controller','isAuthenticated','index','get','/describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x559178,_0x2734c0){var _0x455e7f=function(_0x14aa39){while(--_0x14aa39){_0x559178['push'](_0x559178['shift']());}};_0x455e7f(++_0x2734c0);}(_0x9ec7,0x161));var _0x79ec=function(_0x4027f3,_0x4aa861){_0x4027f3=_0x4027f3-0x0;var _0x589b13=_0x9ec7[_0x4027f3];return _0x589b13;};'use strict';var multer=require(_0x79ec('0x0'));var util=require('util');var path=require(_0x79ec('0x1'));var timeout=require('connect-timeout');var express=require(_0x79ec('0x2'));var router=express['Router']();var fs_extra=require(_0x79ec('0x3'));var auth=require(_0x79ec('0x4'));var interaction=require(_0x79ec('0x5'));var config=require(_0x79ec('0x6'));var controller=require(_0x79ec('0x7'));router['get']('/',auth[_0x79ec('0x8')](),controller[_0x79ec('0x9')]);router[_0x79ec('0xa')](_0x79ec('0xb'),auth[_0x79ec('0x8')](),controller['describe']);router[_0x79ec('0xa')](_0x79ec('0xc'),auth[_0x79ec('0x8')](),controller[_0x79ec('0xd')]);router[_0x79ec('0xa')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x79ec('0xe')]);router[_0x79ec('0xf')]('/',auth['isAuthenticated'](),controller[_0x79ec('0x10')]);router[_0x79ec('0xf')](_0x79ec('0x11'),auth['isAuthenticated'](),controller[_0x79ec('0x12')]);router[_0x79ec('0x13')](_0x79ec('0xc'),auth[_0x79ec('0x8')](),controller[_0x79ec('0x14')]);router[_0x79ec('0x15')](_0x79ec('0xc'),auth[_0x79ec('0x8')](),controller[_0x79ec('0x16')]);module[_0x79ec('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 52ee9bd..f3c8003 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 _0x60c9=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x24a036,_0x47a5fd){var _0x1b614f=function(_0x2dbc3e){while(--_0x2dbc3e){_0x24a036['push'](_0x24a036['shift']());}};_0x1b614f(++_0x47a5fd);}(_0x60c9,0x190));var _0x960c=function(_0x27a8f2,_0x18da5d){_0x27a8f2=_0x27a8f2-0x0;var _0x2d98ab=_0x60c9[_0x27a8f2];return _0x2d98ab;};'use strict';var _=require(_0x960c('0x0'));var Sequelize=require(_0x960c('0x1'));module[_0x960c('0x2')]={'firstName':{'type':Sequelize[_0x960c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x960c('0x3')]},'street':{'type':Sequelize[_0x960c('0x3')]},'postalCode':{'type':Sequelize[_0x960c('0x3')]},'city':{'type':Sequelize[_0x960c('0x3')]},'country':{'type':Sequelize[_0x960c('0x3')]},'dateOfBirth':{'type':Sequelize[_0x960c('0x3')]},'description':{'type':Sequelize[_0x960c('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x960c('0x3')]},'fax':{'type':Sequelize[_0x960c('0x3')]},'email':{'type':Sequelize[_0x960c('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x960c('0x3')]},'fb_data':{'type':Sequelize[_0x960c('0x3')]},'twitter':{'type':Sequelize[_0x960c('0x3')]},'skype':{'type':Sequelize[_0x960c('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x960c('0x3')]},'line':{'type':Sequelize[_0x960c('0x3')]},'wechat':{'type':Sequelize[_0x960c('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x960c('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x960c('0x3')]},'priority':{'type':Sequelize[_0x960c('0x5')](0x2)[_0x960c('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x960c('0x7')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x960c('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x90f3=['TEXT','UNSIGNED','DATE','NOW','INTEGER','lodash','sequelize','STRING'];(function(_0x35821c,_0x1c2c65){var _0x4ddf39=function(_0x47482d){while(--_0x47482d){_0x35821c['push'](_0x35821c['shift']());}};_0x4ddf39(++_0x1c2c65);}(_0x90f3,0x65));var _0x390f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x90f3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x390f('0x0'));var Sequelize=require(_0x390f('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x390f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x390f('0x2')]},'street':{'type':Sequelize[_0x390f('0x2')]},'postalCode':{'type':Sequelize[_0x390f('0x2')]},'city':{'type':Sequelize[_0x390f('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x390f('0x2')]},'description':{'type':Sequelize[_0x390f('0x3')]},'phone':{'type':Sequelize[_0x390f('0x2')]},'mobile':{'type':Sequelize[_0x390f('0x2')]},'fax':{'type':Sequelize[_0x390f('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x390f('0x2')]},'facebook':{'type':Sequelize[_0x390f('0x2')]},'fb_data':{'type':Sequelize[_0x390f('0x2')]},'twitter':{'type':Sequelize[_0x390f('0x2')]},'skype':{'type':Sequelize[_0x390f('0x2')]},'teams':{'type':Sequelize[_0x390f('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x390f('0x2')]},'telegram':{'type':Sequelize[_0x390f('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x390f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x390f('0x5')],'defaultValue':Sequelize[_0x390f('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x390f('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 57138ad..308e8d8 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 _0xb411=['callerid','starttime','userDisposition','userSecondDisposition','userThirdDisposition','UserId','range','createdAt','findAndCountAll','fullname','startCase','Website','Account','closed','note','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','mail','substatus','externalUrl','threadId','flatten','sortBy','slice','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','json','limit','undefined','count','offset','set','Content-Range','then','end','sendStatus','error','stack','name','index','describe','keys','cf_','CmCustomField','trimStart','all','length','fieldType','type','model','query','filters','attributes','fields','hasOwnProperty','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','value','start','filter','isNil','Contact','push','isEmpty','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','split','getFullTextValue','isNumeric','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','c.id','order','DESC','having','t.id\x20IN\x20?','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','toString','keyBy','merge','CmContact','c.lastName','c.phone','c.mobile','c.fax','c.createdAt','c.CompanyId','TagIds','Tags','rows','catch','destroy','startsWith','columnName','displayName','analytics','findAll','alias','custom','values','body','get','mergeWith','tags','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','create','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','$or','contact','show','params','Tag','CmContactHasItem','Phones','ContactItemType','sequelize','literal','Phones.OrderBy','omit','format','pickBy','cf_%d','table','setFields','toParam','phone','findOne','rawAttributes','intersection','options','getTags','nolimit','setTags','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','OrderBy','PHONE','CmHopperAdditionalPhone','item','ItemType','CmHopperId','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','includeAll','ContactId','include','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','CompanyId','status','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','socket_timestamp','../../components/import/cm/csvUpdates','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','Invalid\x20channel','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20createdAt\x20filter','uniqueid','source','destination'];(function(_0x37c47b,_0x8c23d9){var _0x31826a=function(_0x154871){while(--_0x154871){_0x37c47b['push'](_0x37c47b['shift']());}};_0x31826a(++_0x8c23d9);}(_0xb411,0x161));var _0x1b41=function(_0x4abda7,_0x613405){_0x4abda7=_0x4abda7-0x0;var _0x350751=_0xb411[_0x4abda7];return _0x350751;};'use strict';var moment=require(_0x1b41('0x0'));var BPromise=require(_0x1b41('0x1'));var util=require(_0x1b41('0x2'));var path=require(_0x1b41('0x3'));var fs=require('fs');var _=require(_0x1b41('0x4'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x1b41('0x5'));var qs=require('../../components/parsers/qs');var as=require(_0x1b41('0x6'));var logger=require(_0x1b41('0x7'))(_0x1b41('0x8'));var config=require(_0x1b41('0x9'));var shared=require(_0x1b41('0xa'));var db=require(_0x1b41('0xb'))['db'];config[_0x1b41('0xc')]=_[_0x1b41('0xd')](config['redis'],{'host':_0x1b41('0xe'),'port':0x18eb});var socket=require(_0x1b41('0xf'))(new Redis(config[_0x1b41('0xc')]));require(_0x1b41('0x10'))[_0x1b41('0x11')](socket);function respondWithResult(_0x404b01,_0x1216fc){_0x1216fc=_0x1216fc||0xc8;return function(_0x296aac){if(_0x296aac){return _0x404b01['status'](_0x1216fc)[_0x1b41('0x12')](_0x296aac);}};}function respondWithFilteredResult(_0x5c41e0,_0xf04fbc){return function(_0x44f15b){if(_0x44f15b){var _0x402a79=typeof _0xf04fbc['offset']==='undefined'&&typeof _0xf04fbc[_0x1b41('0x13')]===_0x1b41('0x14');var _0x57d8df=_0x44f15b[_0x1b41('0x15')];var _0x2d31dd=_0x402a79?0x0:_0xf04fbc[_0x1b41('0x16')];var _0xf1a6f1=_0x402a79?_0x44f15b[_0x1b41('0x15')]:_0xf04fbc['offset']+_0xf04fbc[_0x1b41('0x13')];var _0x504587;if(_0xf1a6f1>=_0x57d8df){_0xf1a6f1=_0x57d8df;_0x504587=0xc8;}else{_0x504587=0xce;}_0x5c41e0['status'](_0x504587);return _0x5c41e0[_0x1b41('0x17')](_0x1b41('0x18'),_0x2d31dd+'-'+_0xf1a6f1+'/'+_0x57d8df)[_0x1b41('0x12')](_0x44f15b);}return null;};}function saveUpdates(_0x28661e){return function(_0x27ae3d){if(_0x27ae3d){return _0x27ae3d['update'](_0x28661e)['then'](function(_0x105775){return _0x105775;});}return null;};}function removeEntity(_0x448c1c){return function(_0x36ad85){if(_0x36ad85){return _0x36ad85['destroy']()[_0x1b41('0x19')](function(){_0x448c1c['status'](0xcc)[_0x1b41('0x1a')]();});}};}function handleEntityNotFound(_0x52ccdb){return function(_0x454953){if(!_0x454953){_0x52ccdb[_0x1b41('0x1b')](0x194);}return _0x454953;};}function handleError(_0xb83393,_0x1deba9){_0x1deba9=_0x1deba9||0x1f4;return function(_0x19d6da){logger[_0x1b41('0x1c')](_0x19d6da[_0x1b41('0x1d')]);if(_0x19d6da[_0x1b41('0x1e')]){delete _0x19d6da[_0x1b41('0x1e')];}_0xb83393['status'](_0x1deba9)['send'](_0x19d6da);};}exports[_0x1b41('0x1f')]=function(_0x3d7665,_0x1c0351){var _0x5652c7={},_0xbcc95b={},_0x221ece={'count':0x0,'rows':[]};return db['CmContact'][_0x1b41('0x20')]()['then'](function(_0x4a3299){var _0x17d2f2=[];for(var _0x38c346=0x0;_0x38c346
','Attachments','Title','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','join','Anonymous','length','pop','isEmpty','html','test','replace','includes','\x20[Attachment:\x20'];(function(_0x44638b,_0x21d816){var _0x34b05a=function(_0x1b6f6e){while(--_0x1b6f6e){_0x44638b['push'](_0x44638b['shift']());}};_0x34b05a(++_0x21d816);}(_0xd3ba,0x13a));var _0xad3b=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xd3ba[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xad3b('0x0'));var moment=require(_0xad3b('0x1'));var random=require(_0xad3b('0x2'));var fs=require('fs');var path=require(_0xad3b('0x3'));var util=require(_0xad3b('0x4'));var tnef=require(_0xad3b('0x5'));var logger=require(_0xad3b('0x6'))(_0xad3b('0x7'));var config=require(_0xad3b('0x8'));function getAddress(_0x204a00){var _0xcb26ec=_[_0xad3b('0x9')](_0x204a00[_0xad3b('0xa')]);return _0xcb26ec&&_0xcb26ec['address']?_0xcb26ec[_0xad3b('0xb')]:_0xad3b('0xc')+random[_0xad3b('0xd')](0x6)+_0xad3b('0xe');}function getFirstName(_0x1358c8){var _0x3ec85d=_[_0xad3b('0x9')](_0x1358c8[_0xad3b('0xa')]);if(_0x3ec85d&&_0x3ec85d['name']){if(_0x3ec85d[_0xad3b('0xf')]==_0x3ec85d[_0xad3b('0xb')]){return _0x3ec85d[_0xad3b('0xf')][_0xad3b('0x10')](0x0,_0x3ec85d[_0xad3b('0xf')][_0xad3b('0x11')]('@'));}var _0x2239af=_0x3ec85d['name'][_0xad3b('0x12')](/\s+/);return _0x2239af['length']>0x1?_0x2239af['slice'](0x0,-0x1)[_0xad3b('0x13')]('\x20'):_0x3ec85d[_0xad3b('0xf')];}return _0xad3b('0x14');}function getLastName(_0x1203f5){var _0x19c2e6=_[_0xad3b('0x9')](_0x1203f5['value']);if(_0x19c2e6&&_0x19c2e6[_0xad3b('0xf')]){var _0x420021=_0x19c2e6[_0xad3b('0xf')]['split'](/\s+/);return _0x420021[_0xad3b('0x15')]>0x1?_0x420021[_0xad3b('0x16')]():'';}return'';}function getMails(_0x4bd4cc,_0x3c7752){var _0x3b9185='';for(var _0x52b479=0x0;_0x52b479<_0x3c7752['value'][_0xad3b('0x15')];_0x52b479+=0x1){if(_0x3c7752[_0xad3b('0xa')][_0x52b479]['address']!==_0x4bd4cc){if(!_[_0xad3b('0x17')](_0x3b9185)){_0x3b9185+=',';}_0x3b9185+=_0x3c7752[_0xad3b('0xa')][_0x52b479][_0xad3b('0xf')]||_0x3c7752[_0xad3b('0xa')][_0x52b479]['address']||'';_0x3b9185+='\x20<';_0x3b9185+=_0x3c7752['value'][_0x52b479][_0xad3b('0xb')]?_0x3c7752['value'][_0x52b479][_0xad3b('0xb')]:_0xad3b('0xc')+random[_0xad3b('0xd')](0x6)+_0xad3b('0xe');_0x3b9185+='>';}}return _0x3b9185;}function parseEmail(_0x17716c,_0x47b9a7,_0x4dc5a1){if(_0x47b9a7[_0xad3b('0x18')]){var _0x1fa414=/