From 343bdb2aa460dd9ee642947d457783ff69ff7c1c Mon Sep 17 00:00:00 2001
From: Andrea Bianco
Date: Sun, 16 Jan 2022 16:25:45 +0100
Subject: [PATCH] Built motion from commit 8a7b3435.|2.5.48
---
apidoc/api_project.js | 4 +-
apidoc/api_project.json | 4 +-
package.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage.events.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
server/api/client-side-logs.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.oauth.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/cloud-provider.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/migrations/2.5.48.js | 169 ++++++++++++++++++++
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
server/utils/client-side-logger.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
1171 files changed, 1341 insertions(+), 1172 deletions(-)
create mode 100644 server/migrations/2.5.48.js
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 0c70c9a..3e46f52 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.5.47",
+ "version": "2.5.48",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-15T17:05:30.472Z",
+ "time": "2022-01-16T15:10:30.694Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 8e84d96..683a76f 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.5.47",
+ "version": "2.5.48",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-01-15T17:05:30.472Z",
+ "time": "2022-01-16T15:10:30.694Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/package.json b/package.json
index c87aa55..c5310d8 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.5.47",
+ "version": "2.5.48",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index b91f521..f10eb21 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 _0x2eec=['contactManager','integration','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x5702fb,_0x3f4105){var _0x2b0178=function(_0x3782c0){while(--_0x3782c0){_0x5702fb['push'](_0x5702fb['shift']());}};_0x2b0178(++_0x3f4105);}(_0x2eec,0xe6));var _0xc2ee=function(_0x53654e,_0x160bcc){_0x53654e=_0x53654e-0x0;var _0x3e5207=_0x2eec[_0x53654e];return _0x3e5207;};'use strict';var Sequelize=require(_0xc2ee('0x0'));module[_0xc2ee('0x1')]={'name':{'type':Sequelize[_0xc2ee('0x2')],'get':function(_0x31c363){return this[_0xc2ee('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xc2ee('0x4'),_0xc2ee('0x5'),'motionbar','jscripty',_0xc2ee('0x6'),_0xc2ee('0x7'),_0xc2ee('0x8'),_0xc2ee('0x9')]],'msg':_0xc2ee('0xa')}},'comment':_0xc2ee('0xa')},'data1':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comment':_0xc2ee('0xc')},'data2':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comment':_0xc2ee('0xd')},'data3':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comments':_0xc2ee('0xe')},'data5':{'type':Sequelize[_0xc2ee('0xb')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xc2ee('0xb')],'comments':_0xc2ee('0xf')},'data7':{'type':Sequelize[_0xc2ee('0x10')],'comments':_0xc2ee('0x11')}};
\ No newline at end of file
+var _0x7bb4=['urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','motionbar','jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7bb4,0x191));var _0x47bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bb4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x47bb('0x0')]={'name':{'type':Sequelize[_0x47bb('0x1')],'get':function(_0x527a85){return this['getDataValue'](_0x47bb('0x2'));}},'action':{'type':Sequelize[_0x47bb('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x47bb('0x4'),'integration',_0x47bb('0x5'),_0x47bb('0x6'),'urlForward',_0x47bb('0x7'),_0x47bb('0x8'),'script']],'msg':_0x47bb('0x9')}},'comment':_0x47bb('0x9')},'data1':{'type':Sequelize[_0x47bb('0x3')](0x1000),'comment':_0x47bb('0xa')},'data2':{'type':Sequelize[_0x47bb('0x3')](0x1000),'comment':_0x47bb('0xb')},'data3':{'type':Sequelize[_0x47bb('0x3')](0x1000),'comment':_0x47bb('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x47bb('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x47bb('0xe')},'data6':{'type':Sequelize[_0x47bb('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x47bb('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 837d706..819888d 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 _0x4753=['moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','body','find','params','catch','Action','eml-format','zip-dir','request-promise'];(function(_0x32f75b,_0x16cde7){var _0x26f5c7=function(_0x2f80b8){while(--_0x2f80b8){_0x32f75b['push'](_0x32f75b['shift']());}};_0x26f5c7(++_0x16cde7);}(_0x4753,0x84));var _0x3475=function(_0x4ad9b3,_0x22fef3){_0x4ad9b3=_0x4ad9b3-0x0;var _0x11c321=_0x4753[_0x4ad9b3];return _0x11c321;};'use strict';var emlformat=require(_0x3475('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3475('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3475('0x2'));var moment=require(_0x3475('0x3'));var BPromise=require(_0x3475('0x4'));var Mustache=require(_0x3475('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3475('0x6'));var csv=require(_0x3475('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3475('0x8'));var _=require(_0x3475('0x9'));var squel=require(_0x3475('0xa'));var crypto=require('crypto');var jsforce=require(_0x3475('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3475('0xc'));var Redis=require(_0x3475('0xd'));var authService=require(_0x3475('0xe'));var qs=require(_0x3475('0xf'));var as=require(_0x3475('0x10'));var hardwareService=require(_0x3475('0x11'));var logger=require('../../config/logger')(_0x3475('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3475('0x13'));var db=require(_0x3475('0x14'))['db'];function respondWithStatusCode(_0x2801f8,_0x26743a){_0x26743a=_0x26743a||0xcc;return function(_0x29668e){if(_0x29668e){return _0x2801f8[_0x3475('0x15')](_0x26743a);}return _0x2801f8[_0x3475('0x16')](_0x26743a)[_0x3475('0x17')]();};}function respondWithResult(_0x1991a1,_0xd408cb){_0xd408cb=_0xd408cb||0xc8;return function(_0x4d65cc){if(_0x4d65cc){return _0x1991a1['status'](_0xd408cb)['json'](_0x4d65cc);}};}function respondWithFilteredResult(_0x30098c,_0x1b30bf){return function(_0x1e6a4e){if(_0x1e6a4e){var _0x537a1e=typeof _0x1b30bf[_0x3475('0x18')]===_0x3475('0x19')&&typeof _0x1b30bf[_0x3475('0x1a')]===_0x3475('0x19');var _0x1c2043=_0x1e6a4e[_0x3475('0x1b')];var _0x4b6a69=_0x537a1e?0x0:_0x1b30bf[_0x3475('0x18')];var _0x20b00f=_0x537a1e?_0x1e6a4e[_0x3475('0x1b')]:_0x1b30bf[_0x3475('0x18')]+_0x1b30bf[_0x3475('0x1a')];var _0x10096c;if(_0x20b00f>=_0x1c2043){_0x20b00f=_0x1c2043;_0x10096c=0xc8;}else{_0x10096c=0xce;}_0x30098c[_0x3475('0x16')](_0x10096c);return _0x30098c[_0x3475('0x1c')](_0x3475('0x1d'),_0x4b6a69+'-'+_0x20b00f+'/'+_0x1c2043)[_0x3475('0x1e')](_0x1e6a4e);}return null;};}function patchUpdates(_0xe1a150){return function(_0x1ecff8){try{jsonpatch['apply'](_0x1ecff8,_0xe1a150,!![]);}catch(_0x488bc7){return BPromise[_0x3475('0x1f')](_0x488bc7);}return _0x1ecff8[_0x3475('0x20')]();};}function saveUpdates(_0x25fc30,_0x5ded07){return function(_0x220ac7){if(_0x220ac7){return _0x220ac7[_0x3475('0x21')](_0x25fc30)['then'](function(_0x465a76){return _0x465a76;});}return null;};}function removeEntity(_0x1ba636,_0x391435){return function(_0x49b521){if(_0x49b521){return _0x49b521[_0x3475('0x22')]()[_0x3475('0x23')](function(){_0x1ba636[_0x3475('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x522b88,_0x2cf552){return function(_0x5e7d40){if(!_0x5e7d40){_0x522b88['sendStatus'](0x194);}return _0x5e7d40;};}function handleError(_0x5e9dd2,_0x2c1fb3){_0x2c1fb3=_0x2c1fb3||0x1f4;return function(_0x5318aa){logger[_0x3475('0x24')](_0x5318aa[_0x3475('0x25')]);if(_0x5318aa[_0x3475('0x26')]){delete _0x5318aa[_0x3475('0x26')];}_0x5e9dd2[_0x3475('0x16')](_0x2c1fb3)[_0x3475('0x27')](_0x5318aa);};}exports[_0x3475('0x21')]=function(_0x14b080,_0x3dcd89){if(_0x14b080[_0x3475('0x28')]['id']){delete _0x14b080[_0x3475('0x28')]['id'];}return db['Action'][_0x3475('0x29')]({'where':{'id':_0x14b080[_0x3475('0x2a')]['id']}})[_0x3475('0x23')](handleEntityNotFound(_0x3dcd89,null))[_0x3475('0x23')](saveUpdates(_0x14b080[_0x3475('0x28')],null))[_0x3475('0x23')](respondWithResult(_0x3dcd89,null))[_0x3475('0x2b')](handleError(_0x3dcd89,null));};exports[_0x3475('0x22')]=function(_0x32ea27,_0x32bc0e){return db[_0x3475('0x2c')]['find']({'where':{'id':_0x32ea27[_0x3475('0x2a')]['id']}})['then'](handleEntityNotFound(_0x32bc0e,null))['then'](removeEntity(_0x32bc0e,null))['catch'](handleError(_0x32bc0e,null));};
\ No newline at end of file
+var _0x03c5=['Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','then','error','stack','name','send','update','body'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x03c5,0x1a2));var _0x503c=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0x03c5[_0x3cb152];return _0x4f54c3;};'use strict';var emlformat=require(_0x503c('0x0'));var rimraf=require(_0x503c('0x1'));var zipdir=require(_0x503c('0x2'));var jsonpatch=require(_0x503c('0x3'));var rp=require('request-promise');var moment=require(_0x503c('0x4'));var BPromise=require(_0x503c('0x5'));var Mustache=require(_0x503c('0x6'));var util=require('util');var path=require(_0x503c('0x7'));var sox=require('sox');var csv=require(_0x503c('0x8'));var ejs=require(_0x503c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x503c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x503c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x503c('0x8'));var querystring=require(_0x503c('0xc'));var Papa=require(_0x503c('0xd'));var Redis=require(_0x503c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x503c('0xf'));var logger=require(_0x503c('0x10'))(_0x503c('0x11'));var utils=require(_0x503c('0x12'));var config=require(_0x503c('0x13'));var licenseUtil=require(_0x503c('0x14'));var db=require(_0x503c('0x15'))['db'];function respondWithStatusCode(_0x80722b,_0x5f5f0b){_0x5f5f0b=_0x5f5f0b||0xcc;return function(_0x2f4c40){if(_0x2f4c40){return _0x80722b[_0x503c('0x16')](_0x5f5f0b);}return _0x80722b[_0x503c('0x17')](_0x5f5f0b)[_0x503c('0x18')]();};}function respondWithResult(_0x493ef5,_0x247a27){_0x247a27=_0x247a27||0xc8;return function(_0xe962fd){if(_0xe962fd){return _0x493ef5[_0x503c('0x17')](_0x247a27)[_0x503c('0x19')](_0xe962fd);}};}function respondWithFilteredResult(_0x25bfe6,_0x477c36){return function(_0x1f2c39){if(_0x1f2c39){var _0x485bd8=typeof _0x477c36[_0x503c('0x1a')]===_0x503c('0x1b')&&typeof _0x477c36[_0x503c('0x1c')]===_0x503c('0x1b');var _0x3f8f1b=_0x1f2c39[_0x503c('0x1d')];var _0x23ecf2=_0x485bd8?0x0:_0x477c36[_0x503c('0x1a')];var _0x201425=_0x485bd8?_0x1f2c39[_0x503c('0x1d')]:_0x477c36[_0x503c('0x1a')]+_0x477c36[_0x503c('0x1c')];var _0x16de92;if(_0x201425>=_0x3f8f1b){_0x201425=_0x3f8f1b;_0x16de92=0xc8;}else{_0x16de92=0xce;}_0x25bfe6[_0x503c('0x17')](_0x16de92);return _0x25bfe6[_0x503c('0x1e')](_0x503c('0x1f'),_0x23ecf2+'-'+_0x201425+'/'+_0x3f8f1b)[_0x503c('0x19')](_0x1f2c39);}return null;};}function patchUpdates(_0x52bf15){return function(_0x22563f){try{jsonpatch['apply'](_0x22563f,_0x52bf15,!![]);}catch(_0x2b3784){return BPromise[_0x503c('0x20')](_0x2b3784);}return _0x22563f[_0x503c('0x21')]();};}function saveUpdates(_0x368b00,_0x374bc3){return function(_0x2e2d2a){if(_0x2e2d2a){return _0x2e2d2a['update'](_0x368b00)['then'](function(_0x6825b1){return _0x6825b1;});}return null;};}function removeEntity(_0x1100e4,_0x466d0c){return function(_0x120b22){if(_0x120b22){return _0x120b22[_0x503c('0x22')]()[_0x503c('0x23')](function(){_0x1100e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be802,_0x58835d){return function(_0x25ad10){if(!_0x25ad10){_0x4be802[_0x503c('0x16')](0x194);}return _0x25ad10;};}function handleError(_0x5714da,_0x1f931a){_0x1f931a=_0x1f931a||0x1f4;return function(_0x544cb8){logger[_0x503c('0x24')](_0x544cb8[_0x503c('0x25')]);if(_0x544cb8[_0x503c('0x26')]){delete _0x544cb8[_0x503c('0x26')];}_0x5714da[_0x503c('0x17')](_0x1f931a)[_0x503c('0x27')](_0x544cb8);};}exports[_0x503c('0x28')]=function(_0x496603,_0x2362ab){if(_0x496603[_0x503c('0x29')]['id']){delete _0x496603[_0x503c('0x29')]['id'];}return db[_0x503c('0x2a')][_0x503c('0x2b')]({'where':{'id':_0x496603['params']['id']}})[_0x503c('0x23')](handleEntityNotFound(_0x2362ab,null))[_0x503c('0x23')](saveUpdates(_0x496603['body'],null))['then'](respondWithResult(_0x2362ab,null))[_0x503c('0x2c')](handleError(_0x2362ab,null));};exports[_0x503c('0x22')]=function(_0x47a329,_0x3a743b){return db[_0x503c('0x2a')][_0x503c('0x2b')]({'where':{'id':_0x47a329[_0x503c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3a743b,null))[_0x503c('0x23')](removeEntity(_0x3a743b,null))[_0x503c('0x2c')](handleError(_0x3a743b,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 5e35a6f..c6b018c 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 _0x2c31=['path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','lodash','util','api','moment','request-promise'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x2c31,0x13f));var _0x12c3=function(_0x4a4a82,_0x172322){_0x4a4a82=_0x4a4a82-0x0;var _0x4d069b=_0x2c31[_0x4a4a82];return _0x4d069b;};'use strict';var _=require(_0x12c3('0x0'));var util=require(_0x12c3('0x1'));var logger=require('../../config/logger')(_0x12c3('0x2'));var moment=require(_0x12c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x12c3('0x4'));var fs=require('fs');var path=require(_0x12c3('0x5'));var rimraf=require(_0x12c3('0x6'));var config=require(_0x12c3('0x7'));var attributes=require(_0x12c3('0x8'));module[_0x12c3('0x9')]=function(_0x273c40,_0x1e63bf){return _0x273c40[_0x12c3('0xa')]('Action',attributes,{'tableName':_0x12c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa7a6=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util'];(function(_0x5a8b3d,_0x540e49){var _0x5b619f=function(_0x55225f){while(--_0x55225f){_0x5a8b3d['push'](_0x5a8b3d['shift']());}};_0x5b619f(++_0x540e49);}(_0xa7a6,0x1d2));var _0x6a7a=function(_0x235983,_0xd22673){_0x235983=_0x235983-0x0;var _0x538b67=_0xa7a6[_0x235983];return _0x538b67;};'use strict';var _=require(_0x6a7a('0x0'));var util=require(_0x6a7a('0x1'));var logger=require(_0x6a7a('0x2'))(_0x6a7a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6a7a('0x4'));var fs=require('fs');var path=require(_0x6a7a('0x5'));var rimraf=require(_0x6a7a('0x6'));var config=require(_0x6a7a('0x7'));var attributes=require(_0x6a7a('0x8'));module[_0x6a7a('0x9')]=function(_0x1b8027,_0x45e0b9){return _0x1b8027[_0x6a7a('0xa')](_0x6a7a('0xb'),attributes,{'tableName':_0x6a7a('0xc'),'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 1f56247..05e1cea 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3a5ab4,_0x56f591){var _0x4838f9=function(_0x4750ac){while(--_0x4750ac){_0x3a5ab4['push'](_0x3a5ab4['shift']());}};_0x4838f9(++_0x56f591);}(_0xabce,0x103));var _0xeabc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xabce[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ 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(_0x421a2d,_0xefe4a4){var _0x461f53=function(_0x42fdc3){while(--_0x42fdc3){_0x421a2d['push'](_0x421a2d['shift']());}};_0x461f53(++_0xefe4a4);}(_0x5fab,0x177));var _0xb5fa=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x5fab[_0x2125f0];return _0x12d6eb;};'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 90cca20..fd1451d 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 _0x2506=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','/:id','isAuthenticated','update','delete','exports','util'];(function(_0x49af8b,_0x48d216){var _0x4f9e96=function(_0x3d39f7){while(--_0x3d39f7){_0x49af8b['push'](_0x49af8b['shift']());}};_0x4f9e96(++_0x48d216);}(_0x2506,0x15f));var _0x6250=function(_0x327aa9,_0x52ffa3){_0x327aa9=_0x327aa9-0x0;var _0x166bf2=_0x2506[_0x327aa9];return _0x166bf2;};'use strict';var multer=require('multer');var util=require(_0x6250('0x0'));var path=require(_0x6250('0x1'));var timeout=require(_0x6250('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6250('0x3'));var auth=require(_0x6250('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6250('0x5'));var controller=require('./action.controller');router['put'](_0x6250('0x6'),auth[_0x6250('0x7')](),controller[_0x6250('0x8')]);router[_0x6250('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6250('0xa')]=router;
\ No newline at end of file
+var _0xfbc5=['express','Router','fs-extra','../../config/environment','./action.controller','put','/:id','update','isAuthenticated','destroy','multer','util','path','connect-timeout'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xfbc5,0x1ca));var _0x5fbc=function(_0x4ef839,_0x1f379b){_0x4ef839=_0x4ef839-0x0;var _0x59810f=_0xfbc5[_0x4ef839];return _0x59810f;};'use strict';var multer=require(_0x5fbc('0x0'));var util=require(_0x5fbc('0x1'));var path=require(_0x5fbc('0x2'));var timeout=require(_0x5fbc('0x3'));var express=require(_0x5fbc('0x4'));var router=express[_0x5fbc('0x5')]();var fs_extra=require(_0x5fbc('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5fbc('0x7'));var controller=require(_0x5fbc('0x8'));router[_0x5fbc('0x9')](_0x5fbc('0xa'),auth['isAuthenticated'](),controller[_0x5fbc('0xb')]);router['delete'](_0x5fbc('0xa'),auth[_0x5fbc('0xc')](),controller[_0x5fbc('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 88dbf4f..92e098b 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeec6=['STRING','TEXT','sequelize','exports'];(function(_0x2f8ed4,_0x295402){var _0x543bff=function(_0x3f6dca){while(--_0x3f6dca){_0x2f8ed4['push'](_0x2f8ed4['shift']());}};_0x543bff(++_0x295402);}(_0xeec6,0x1c2));var _0x6eec=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xeec6[_0x126fb9];return _0xc8a3b1;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'name':{'type':Sequelize[_0x6eec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6eec('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6eec('0x2')]},'conditions':{'type':Sequelize[_0x6eec('0x3')]},'joins':{'type':Sequelize[_0x6eec('0x3')]}};
\ No newline at end of file
+var _0x71ab=['TEXT','exports','STRING'];(function(_0x5b0c7d,_0x26ffc7){var _0x510470=function(_0x2d673f){while(--_0x2d673f){_0x5b0c7d['push'](_0x5b0c7d['shift']());}};_0x510470(++_0x26ffc7);}(_0x71ab,0x64));var _0xb71a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x71ab[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0xb71a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb71a('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb71a('0x1')]},'conditions':{'type':Sequelize[_0xb71a('0x2')]},'joins':{'type':Sequelize[_0xb71a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 68b262a..24a9677 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 _0x2820=['startDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','ValidationErrorItem','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','end','stack','name','send','index','map','AnalyticCustomReport','fieldName','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','group','field','condition','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','operator','getFields','Sequelize','keyBy','from','output','web','fullPath','randomstring','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x2820,0xb2));var _0x0282=function(_0x553e1f,_0x52741){_0x553e1f=_0x553e1f-0x0;var _0x45728a=_0x2820[_0x553e1f];return _0x45728a;};'use strict';var emlformat=require(_0x0282('0x0'));var rimraf=require(_0x0282('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0282('0x2'));var rp=require(_0x0282('0x3'));var moment=require(_0x0282('0x4'));var BPromise=require(_0x0282('0x5'));var Mustache=require('mustache');var util=require(_0x0282('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0282('0x7'));var _=require(_0x0282('0x8'));var squel=require(_0x0282('0x9'));var crypto=require(_0x0282('0xa'));var jsforce=require(_0x0282('0xb'));var deskjs=require(_0x0282('0xc'));var toCsv=require(_0x0282('0xd'));var querystring=require('querystring');var Papa=require(_0x0282('0xe'));var Redis=require(_0x0282('0xf'));var authService=require(_0x0282('0x10'));var qs=require(_0x0282('0x11'));var as=require(_0x0282('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0282('0x13'));var utils=require('../../config/utils');var config=require(_0x0282('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0282('0x15'))['db'];var dbH=require('../../mysqldb')[_0x0282('0x16')];function respondWithStatusCode(_0x2b6973,_0xbeea1d){_0xbeea1d=_0xbeea1d||0xcc;return function(_0x3693cb){if(_0x3693cb){return _0x2b6973[_0x0282('0x17')](_0xbeea1d);}return _0x2b6973[_0x0282('0x18')](_0xbeea1d)['end']();};}function respondWithResult(_0x37e6e8,_0x3a8f3b){_0x3a8f3b=_0x3a8f3b||0xc8;return function(_0x2e77ee){if(_0x2e77ee){return _0x37e6e8[_0x0282('0x18')](_0x3a8f3b)[_0x0282('0x19')](_0x2e77ee);}};}function respondWithFilteredResult(_0x3c4908,_0x5c01cd){return function(_0x32a1cb){if(_0x32a1cb){var _0xf7af46=typeof _0x5c01cd[_0x0282('0x1a')]===_0x0282('0x1b')&&typeof _0x5c01cd[_0x0282('0x1c')]===_0x0282('0x1b');var _0x2962c4=_0x32a1cb[_0x0282('0x1d')];var _0x16b273=_0xf7af46?0x0:_0x5c01cd['offset'];var _0x32e75c=_0xf7af46?_0x32a1cb[_0x0282('0x1d')]:_0x5c01cd[_0x0282('0x1a')]+_0x5c01cd[_0x0282('0x1c')];var _0x1cd597;if(_0x32e75c>=_0x2962c4){_0x32e75c=_0x2962c4;_0x1cd597=0xc8;}else{_0x1cd597=0xce;}_0x3c4908[_0x0282('0x18')](_0x1cd597);return _0x3c4908[_0x0282('0x1e')]('Content-Range',_0x16b273+'-'+_0x32e75c+'/'+_0x2962c4)[_0x0282('0x19')](_0x32a1cb);}return null;};}function patchUpdates(_0x2db6e4){return function(_0x55022e){try{jsonpatch[_0x0282('0x1f')](_0x55022e,_0x2db6e4,!![]);}catch(_0x5cd825){return BPromise['reject'](_0x5cd825);}return _0x55022e[_0x0282('0x20')]();};}function saveUpdates(_0x19f811,_0x25d37d){return function(_0x48070c){if(_0x48070c){return _0x48070c[_0x0282('0x21')](_0x19f811)[_0x0282('0x22')](function(_0x35cef9){return _0x35cef9;});}return null;};}function removeEntity(_0x2e033d,_0x41237e){return function(_0x11d4d6){if(_0x11d4d6){return _0x11d4d6[_0x0282('0x23')]()['then'](function(){var _0x28046e=_0x11d4d6[_0x0282('0x24')]({'plain':!![]});var _0x5d8388=_0x0282('0x25');return db[_0x0282('0x26')][_0x0282('0x23')]({'where':{'type':_0x5d8388,'resourceId':_0x28046e['id']}})[_0x0282('0x22')](function(){return _0x11d4d6;});})[_0x0282('0x22')](function(){_0x2e033d[_0x0282('0x18')](0xcc)[_0x0282('0x27')]();});}};}function handleEntityNotFound(_0x19d145,_0x3f28b8){return function(_0x55bbda){if(!_0x55bbda){_0x19d145[_0x0282('0x17')](0x194);}return _0x55bbda;};}function handleError(_0x18143f,_0x4c5416){_0x4c5416=_0x4c5416||0x1f4;return function(_0x1e0601){logger['error'](_0x1e0601[_0x0282('0x28')]);if(_0x1e0601['name']){delete _0x1e0601[_0x0282('0x29')];}_0x18143f[_0x0282('0x18')](_0x4c5416)[_0x0282('0x2a')](_0x1e0601);};}exports[_0x0282('0x2b')]=function(_0x8c953f,_0x435896){var _0x302077={},_0x2b4136={},_0x13076f={'count':0x0,'rows':[]};var _0x43552d=_[_0x0282('0x2c')](db[_0x0282('0x2d')]['rawAttributes'],function(_0x1cd4a6){return{'name':_0x1cd4a6[_0x0282('0x2e')],'type':_0x1cd4a6['type'][_0x0282('0x2f')]};});_0x2b4136[_0x0282('0x30')]=_[_0x0282('0x2c')](_0x43552d,'name');_0x2b4136['query']=_[_0x0282('0x31')](_0x8c953f[_0x0282('0x32')]);_0x2b4136['filters']=_[_0x0282('0x33')](_0x2b4136[_0x0282('0x30')],_0x2b4136[_0x0282('0x32')]);_0x302077['attributes']=_[_0x0282('0x33')](_0x2b4136[_0x0282('0x30')],qs[_0x0282('0x34')](_0x8c953f[_0x0282('0x32')][_0x0282('0x34')]));_0x302077[_0x0282('0x35')]=_0x302077['attributes']['length']?_0x302077['attributes']:_0x2b4136[_0x0282('0x30')];if(!_0x8c953f[_0x0282('0x32')][_0x0282('0x36')](_0x0282('0x37'))){_0x302077[_0x0282('0x1c')]=qs[_0x0282('0x1c')](_0x8c953f[_0x0282('0x32')][_0x0282('0x1c')]);_0x302077[_0x0282('0x1a')]=qs[_0x0282('0x1a')](_0x8c953f[_0x0282('0x32')][_0x0282('0x1a')]);}_0x302077[_0x0282('0x38')]=qs['sort'](_0x8c953f[_0x0282('0x32')][_0x0282('0x39')]);_0x302077[_0x0282('0x3a')]=qs[_0x0282('0x3b')](_[_0x0282('0x3c')](_0x8c953f['query'],_0x2b4136[_0x0282('0x3b')]),_0x43552d);if(_0x8c953f['query'][_0x0282('0x3d')]){_0x302077[_0x0282('0x3a')]=_[_0x0282('0x3e')](_0x302077['where'],{'$or':_[_0x0282('0x2c')](_0x43552d,function(_0x493f3e){if(_0x493f3e[_0x0282('0x3f')]!==_0x0282('0x40')){var _0x5dca64={};_0x5dca64[_0x493f3e['name']]={'$like':'%'+_0x8c953f[_0x0282('0x32')]['filter']+'%'};return _0x5dca64;}})});}_0x302077=_['merge']({},_0x302077,_0x8c953f['options']);var _0x459a4c={'where':_0x302077['where']};return db['AnalyticCustomReport']['count'](_0x459a4c)[_0x0282('0x22')](function(_0x1eca73){_0x13076f[_0x0282('0x1d')]=_0x1eca73;if(_0x8c953f[_0x0282('0x32')][_0x0282('0x41')]){_0x302077[_0x0282('0x42')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x0282('0x43')](_0x302077);})[_0x0282('0x22')](function(_0x4305ff){_0x13076f[_0x0282('0x44')]=_0x4305ff;return _0x13076f;})['then'](respondWithFilteredResult(_0x435896,_0x302077))[_0x0282('0x45')](handleError(_0x435896,null));};exports[_0x0282('0x46')]=function(_0x59f608,_0x27dfd0){var _0x377de3={'raw':![],'where':{'id':_0x59f608[_0x0282('0x47')]['id']}},_0x275a08={};_0x275a08[_0x0282('0x30')]=_[_0x0282('0x31')](db[_0x0282('0x2d')][_0x0282('0x48')]);_0x275a08[_0x0282('0x32')]=_[_0x0282('0x31')](_0x59f608[_0x0282('0x32')]);_0x275a08[_0x0282('0x3b')]=_[_0x0282('0x33')](_0x275a08[_0x0282('0x30')],_0x275a08[_0x0282('0x32')]);_0x377de3[_0x0282('0x35')]=_[_0x0282('0x33')](_0x275a08['model'],qs[_0x0282('0x34')](_0x59f608[_0x0282('0x32')]['fields']));_0x377de3['attributes']=_0x377de3[_0x0282('0x35')]['length']?_0x377de3['attributes']:_0x275a08[_0x0282('0x30')];if(_0x59f608[_0x0282('0x32')][_0x0282('0x41')]){_0x377de3[_0x0282('0x42')]=[{'all':!![]}];}_0x377de3=_[_0x0282('0x3e')]({},_0x377de3,_0x59f608[_0x0282('0x49')]);return db[_0x0282('0x2d')]['find'](_0x377de3)['then'](handleEntityNotFound(_0x27dfd0,null))[_0x0282('0x22')](respondWithResult(_0x27dfd0,null))['catch'](handleError(_0x27dfd0,null));};exports['create']=function(_0x23cac5,_0x56cbda){return db[_0x0282('0x2d')]['create'](_0x23cac5[_0x0282('0x4a')],{})[_0x0282('0x22')](function(_0x57ec2b){var _0x35c794=_0x23cac5[_0x0282('0x4b')][_0x0282('0x24')]({'plain':!![]});if(!_0x35c794)throw new Error(_0x0282('0x4c'));if(_0x35c794[_0x0282('0x4d')]===_0x0282('0x4b')){var _0x3c0282=_0x57ec2b[_0x0282('0x24')]({'plain':!![]});var _0xc7d5b7=_0x0282('0x4e');return db[_0x0282('0x4f')][_0x0282('0x50')]({'where':{'name':_0xc7d5b7,'userProfileId':_0x35c794[_0x0282('0x51')]},'raw':!![]})[_0x0282('0x22')](function(_0x50588a){if(_0x50588a&&_0x50588a[_0x0282('0x52')]===0x0){return db[_0x0282('0x26')][_0x0282('0x53')]({'name':_0x3c0282['name'],'resourceId':_0x3c0282['id'],'type':_0x0282('0x25'),'sectionId':_0x50588a['id']},{})['then'](function(){return _0x57ec2b;});}else{return _0x57ec2b;}})[_0x0282('0x45')](function(_0x135cb6){logger[_0x0282('0x54')](_0x0282('0x55'),_0x135cb6);throw _0x135cb6;});}return _0x57ec2b;})['then'](respondWithResult(_0x56cbda,0xc9))[_0x0282('0x45')](handleError(_0x56cbda,null));};exports[_0x0282('0x21')]=function(_0x56ad03,_0x398475){if(_0x56ad03['body']['id']){delete _0x56ad03[_0x0282('0x4a')]['id'];}return db[_0x0282('0x2d')][_0x0282('0x50')]({'where':{'id':_0x56ad03[_0x0282('0x47')]['id']}})[_0x0282('0x22')](handleEntityNotFound(_0x398475,null))[_0x0282('0x22')](saveUpdates(_0x56ad03[_0x0282('0x4a')],null))[_0x0282('0x22')](respondWithResult(_0x398475,null))[_0x0282('0x45')](handleError(_0x398475,null));};exports[_0x0282('0x23')]=function(_0x40ba8a,_0x47b14f){return db['AnalyticCustomReport'][_0x0282('0x50')]({'where':{'id':_0x40ba8a['params']['id']}})[_0x0282('0x22')](handleEntityNotFound(_0x47b14f,null))[_0x0282('0x22')](removeEntity(_0x47b14f,null))['catch'](handleError(_0x47b14f,null));};exports['preview']=function(_0xe1201c,_0x26855c){var _0x1adcb0=0xa;var _0x5ede56=[_0x0282('0x56'),_0x0282('0x57'),'right_join',_0x0282('0x58')];var _0x2767f4={'SUM':_0x0282('0x59'),'COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':_0x0282('0x5c'),'MIN':_0x0282('0x5d'),'AVG':_0x0282('0x5e'),'GROUP_CONCAT':_0x0282('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0282('0x60')};var _0x19ad87={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':_0x0282('0x63'),'ROUND':_0x0282('0x64'),'UNIX_TIMESTAMP':_0x0282('0x65')};var _0x271099=function(_0x231c97){return!_[_0x0282('0x66')]([_0x0282('0x67'),'IS\x20NOT\x20NULL',_0x0282('0x68'),_0x0282('0x69')],_0x231c97);};var _0x3f352b=function(_0x1dd0eb){if(!_0x1dd0eb||!_0x1dd0eb[_0x0282('0x6a')][_0x0282('0x6b')]){return'';}for(var _0x3056f2='(',_0x74dce0=0x0;_0x74dce0<_0x1dd0eb[_0x0282('0x6a')]['length'];_0x74dce0+=0x1){_0x74dce0>0x0&&(_0x3056f2+='\x20'+_0x1dd0eb['operator']+'\x20');_0x3056f2+=_0x1dd0eb['rules'][_0x74dce0][_0x0282('0x6c')]?_0x3f352b(_0x1dd0eb[_0x0282('0x6a')][_0x74dce0]['group']):_0x1dd0eb['rules'][_0x74dce0][_0x0282('0x6d')]+'\x20'+_0x1dd0eb[_0x0282('0x6a')][_0x74dce0][_0x0282('0x6e')]+(_0x271099(_0x1dd0eb['rules'][_0x74dce0]['condition'])?'\x20'+_0x1dd0eb[_0x0282('0x6a')][_0x74dce0][_0x0282('0x6f')]:'');}return _0x3056f2+')';};var _0x22addb={'where':{'id':_0xe1201c[_0x0282('0x47')]['id']}},_0x34ea76,_0x1e0974,_0x4c0ecc,_0x39ea71,_0x1226e6;_0x22addb=_['merge']({},_0x22addb,_0xe1201c[_0x0282('0x49')]);return db[_0x0282('0x2d')][_0x0282('0x50')](_0x22addb)[_0x0282('0x22')](function(_0x3a4711){if(_0x3a4711){_0x34ea76=_0x3a4711;return _0x3a4711['getFields']();}return null;})['then'](function(_0x4b5d9c){if(_0x4b5d9c){if(!_0x4b5d9c[_0x0282('0x6b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x0282('0x70'),0x193);}_0x1e0974=_0x4b5d9c;return db[_0x0282('0x71')][_0x0282('0x43')]({'raw':!![]});}return null;})['then'](function(_0x56d46a){if(_0x56d46a){_0x4c0ecc=_['keyBy'](_0x56d46a,'id');var _0x4c481b;var _0x3c6c56=squel[_0x0282('0x72')]();_0x3c6c56['from'](_0x34ea76[_0x0282('0x73')]);for(var _0x413ef2=0x0;_0x413ef2<_0x1e0974[_0x0282('0x6b')];_0x413ef2+=0x1){_0x4c481b=_0x1e0974[_0x413ef2][_0x0282('0x74')]?_0x4c0ecc[_0x1e0974[_0x413ef2][_0x0282('0x74')]][_0x0282('0x75')]:_0x1e0974[_0x413ef2][_0x0282('0x6d')];_0x4c481b=_0x1e0974[_0x413ef2]['function']?_[_0x0282('0x76')](_0x2767f4[_0x1e0974[_0x413ef2][_0x0282('0x77')]],'%s',_0x4c481b):_0x4c481b;_0x4c481b=_0x1e0974[_0x413ef2]['format']?_[_0x0282('0x76')](_0x19ad87[_0x1e0974[_0x413ef2][_0x0282('0x78')]],'%s',_0x4c481b):_0x4c481b;if(_0x1e0974[_0x413ef2][_0x0282('0x79')]){_0x3c6c56[_0x0282('0x6c')](_0x4c481b);}_0x1e0974[_0x413ef2][_0x0282('0x7a')]&&_0x3c6c56[_0x0282('0x38')](_0x4c481b,_0x1e0974[_0x413ef2][_0x0282('0x7a')]===_0x0282('0x7b')?![]:!![]);_0x3c6c56['field'](_0x4c481b,_0x1e0974[_0x413ef2][_0x0282('0x7c')]||_0x4c481b);}if(_0x34ea76[_0x0282('0x7d')]){_0x34ea76['joins']=JSON[_0x0282('0x7e')](_0x34ea76[_0x0282('0x7d')]);for(var _0x593b54=0x0;_0x593b54<_0x34ea76['joins']['length'];_0x593b54+=0x1){if(_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x3f')]&&_[_0x0282('0x66')](_0x5ede56,_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x3f')])&&_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x7f')]&&_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x80')]&&_0x34ea76[_0x0282('0x7d')][_0x593b54]['foreignKey']){_0x3c6c56[_0x34ea76[_0x0282('0x7d')][_0x593b54]['type']](_0x34ea76[_0x0282('0x7d')][_0x593b54]['foreignTable'],null,util['format'](_0x0282('0x81'),_0x34ea76[_0x0282('0x73')],_0x34ea76[_0x0282('0x7d')][_0x593b54][_0x0282('0x7f')],_0x34ea76['joins'][_0x593b54][_0x0282('0x80')],_0x34ea76['joins'][_0x593b54][_0x0282('0x82')]));}}}if(_0x34ea76['conditions']){_0x34ea76['conditions']=JSON[_0x0282('0x7e')](_0x34ea76[_0x0282('0x83')]);_0x3c6c56['where'](_0x3f352b(_0x34ea76[_0x0282('0x83')][_0x0282('0x6c')]));}_0x1226e6=_0x3c6c56[_0x0282('0x84')]();_0x3c6c56['limit'](_0x1adcb0);_0x3c6c56[_0x0282('0x1a')](0x0);logger['debug'](_0x0282('0x85'),_0x3c6c56[_0x0282('0x86')]());return dbH['sequelize'][_0x0282('0x32')](_0x3c6c56['toString'](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')][_0x0282('0x89')]});}})[_0x0282('0x22')](respondWithResult(_0x26855c,null))[_0x0282('0x45')](handleError(_0x26855c,null));};function runReport(_0xa999e7,_0x575bf1,_0x293ff0){var _0x3b8a6b=_0x575bf1['name'];var _0x3260bc=0xa;var _0x4f1a9c=[_0x0282('0x56'),_0x0282('0x57'),_0x0282('0x8a'),'cross_join'];var _0x36802a={'SUM':_0x0282('0x59'),'COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':_0x0282('0x5c'),'MIN':_0x0282('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0282('0x5f'),'GROUP_CONCAT ASC':_0x0282('0x8b'),'GROUP_CONCAT DESC':_0x0282('0x60')};var _0x209aca={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0282('0x65')};var _0x197b98=function(_0x11ac49){return!_[_0x0282('0x66')]([_0x0282('0x67'),_0x0282('0x8c'),_0x0282('0x68'),_0x0282('0x69')],_0x11ac49);};var _0x1b1311=function(_0x26c9d8){if(!_0x26c9d8||!_0x26c9d8[_0x0282('0x6a')]['length']){return'';}for(var _0x26b9dd='(',_0x2b1511=0x0;_0x2b1511<_0x26c9d8[_0x0282('0x6a')][_0x0282('0x6b')];_0x2b1511+=0x1){_0x2b1511>0x0&&(_0x26b9dd+='\x20'+_0x26c9d8[_0x0282('0x8d')]+'\x20');_0x26b9dd+=_0x26c9d8[_0x0282('0x6a')][_0x2b1511][_0x0282('0x6c')]?_0x1b1311(_0x26c9d8[_0x0282('0x6a')][_0x2b1511][_0x0282('0x6c')]):_0x26c9d8['rules'][_0x2b1511][_0x0282('0x6d')]+'\x20'+_0x26c9d8['rules'][_0x2b1511]['condition']+(_0x197b98(_0x26c9d8[_0x0282('0x6a')][_0x2b1511]['condition'])?'\x20'+_0x26c9d8['rules'][_0x2b1511][_0x0282('0x6f')]:'');}return _0x26b9dd+')';};var _0x481df9={'where':{'id':_0xa999e7['id']}},_0x2774f4,_0x4531e2,_0x234ac0,_0x915294,_0xd11573;_0x481df9=_[_0x0282('0x3e')]({},_0x481df9,_0x293ff0);return db[_0x0282('0x2d')][_0x0282('0x50')](_0x481df9)['then'](function(_0x23edd0){if(_0x23edd0){_0x2774f4=_0x23edd0;return _0x23edd0[_0x0282('0x8e')]();}return null;})[_0x0282('0x22')](function(_0x54dc0f){if(_0x54dc0f){if(!_0x54dc0f[_0x0282('0x6b')]){throw new db[(_0x0282('0x8f'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4531e2=_0x54dc0f;return db[_0x0282('0x71')][_0x0282('0x43')]({'raw':!![]});}return null;})['then'](function(_0x5d06e6){if(_0x5d06e6){_0x234ac0=_[_0x0282('0x90')](_0x5d06e6,'id');var _0x5e7577;var _0x5025de=squel['select']();_0x5025de[_0x0282('0x91')](_0x2774f4[_0x0282('0x73')]);for(var _0x237293=0x0;_0x237293<_0x4531e2[_0x0282('0x6b')];_0x237293+=0x1){_0x5e7577=_0x4531e2[_0x237293][_0x0282('0x74')]?_0x234ac0[_0x4531e2[_0x237293][_0x0282('0x74')]][_0x0282('0x75')]:_0x4531e2[_0x237293][_0x0282('0x6d')];_0x5e7577=_0x4531e2[_0x237293][_0x0282('0x77')]?_['replace'](_0x36802a[_0x4531e2[_0x237293]['function']],'%s',_0x5e7577):_0x5e7577;_0x5e7577=_0x4531e2[_0x237293]['format']?_[_0x0282('0x76')](_0x209aca[_0x4531e2[_0x237293][_0x0282('0x78')]],'%s',_0x5e7577):_0x5e7577;if(_0x4531e2[_0x237293]['groupBy']){_0x5025de[_0x0282('0x6c')](_0x5e7577);}_0x4531e2[_0x237293][_0x0282('0x7a')]&&_0x5025de[_0x0282('0x38')](_0x5e7577,_0x4531e2[_0x237293][_0x0282('0x7a')]==='DESC'?![]:!![]);_0x5025de[_0x0282('0x6d')](_0x5e7577,_0x4531e2[_0x237293][_0x0282('0x7c')]||_0x5e7577);}if(_0x2774f4[_0x0282('0x7d')]){_0x2774f4[_0x0282('0x7d')]=JSON[_0x0282('0x7e')](_0x2774f4[_0x0282('0x7d')]);for(var _0x4e8ff8=0x0;_0x4e8ff8<_0x2774f4['joins']['length'];_0x4e8ff8+=0x1){if(_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')]&&_[_0x0282('0x66')](_0x4f1a9c,_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')])&&_0x2774f4['joins'][_0x4e8ff8][_0x0282('0x7f')]&&_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')]&&_0x2774f4[_0x0282('0x7d')][_0x4e8ff8]['foreignKey']){_0x5025de[_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x3f')]](_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')],null,util[_0x0282('0x78')](_0x0282('0x81'),_0x2774f4['table'],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x7f')],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x80')],_0x2774f4[_0x0282('0x7d')][_0x4e8ff8][_0x0282('0x82')]));}}}if(_0x2774f4['conditions']){_0x2774f4[_0x0282('0x83')]=JSON[_0x0282('0x7e')](_0x2774f4[_0x0282('0x83')]);_0x5025de[_0x0282('0x3a')](_0x1b1311(_0x2774f4[_0x0282('0x83')][_0x0282('0x6c')]));}_0xd11573=_0x5025de[_0x0282('0x84')]();_0x5025de[_0x0282('0x1c')](_0x3260bc);_0x5025de[_0x0282('0x1a')](0x0);return;}})[_0x0282('0x22')](function(){if(_0x575bf1[_0x0282('0x92')]===_0x0282('0x93')){return null;}var _0x893cbe=_['merge'](_0x575bf1,{'name':_0x575bf1[_0x0282('0x94')]||_0x575bf1[_0x0282('0x29')]||_0x2774f4[_0x0282('0x29')],'basename':_0x3b8a6b,'savename':util[_0x0282('0x78')]('%s-%s.%s',_0x575bf1['name']||_0x2774f4['name'],require(_0x0282('0x95'))[_0x0282('0x96')](0x4),_0x575bf1['output']||'csv'),'reportId':_0x2774f4['id'],'reportType':_0x0282('0x97')});return db[_0x0282('0x98')][_0x0282('0x53')](_0x893cbe,{'raw':!![]});})[_0x0282('0x22')](function(_0x1aa218){if(_0x2774f4[_0x0282('0x73')]==='cdr'){_0xd11573[_0x0282('0x3a')](_0x2774f4[_0x0282('0x73')]+_0x0282('0x99'),_0x575bf1['startDate'],_0x575bf1[_0x0282('0x9a')]);}else{_0xd11573[_0x0282('0x3a')](_0x2774f4[_0x0282('0x73')]+_0x0282('0x9b'),_0x575bf1[_0x0282('0x9c')],_0x575bf1['endDate']);}if(_0x1aa218){logger[_0x0282('0x9d')](_0x0282('0x9e'),_0xd11573[_0x0282('0x86')]());require(_0x0282('0x9f'))[_0x0282('0xa0')](path[_0x0282('0x56')](__dirname,'../../components/export/',_0x1aa218[_0x0282('0x92')]),[_0x1aa218['id'],_0xd11573[_0x0282('0x86')](),path['join'](__dirname,_0x0282('0xa1'),_0x1aa218[_0x0282('0xa2')]),_0x3b8a6b]);return _0x1aa218;}else{var _0x2fb8cf=squel[_0x0282('0x72')]();_0x2fb8cf[_0x0282('0x91')]('('+_0xd11573['toString']()+')',_0x0282('0xa3'));_0x2fb8cf[_0x0282('0x6d')]('COUNT(*)',_0x0282('0x1d'));_0xd11573[_0x0282('0x1c')](_0x575bf1[_0x0282('0x1c')]||_0x3260bc);_0xd11573[_0x0282('0x1a')](_0x575bf1[_0x0282('0x1a')]||0x0);return dbH['sequelize'][_0x0282('0x32')](_0x2fb8cf[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')]['SELECT']})[_0x0282('0x22')](function(_0x41ffdb){if(!_0x41ffdb['length']){_0x915294=0x0;}else{_0x915294=_0x41ffdb[0x0][_0x0282('0x1d')]||0x0;}return dbH[_0x0282('0x87')][_0x0282('0x32')](_0xd11573[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')][_0x0282('0x88')][_0x0282('0x89')]});})[_0x0282('0x22')](function(_0xef882e){return{'rows':_0xef882e||[],'count':_0x915294};});}});}exports[_0x0282('0xa4')]=function(_0x3c2a61,_0x5bbd85){return runReport(_0x3c2a61['params'],_0x3c2a61[_0x0282('0x32')],_0x3c2a61[_0x0282('0x49')])[_0x0282('0x22')](respondWithResult(_0x5bbd85,null))['catch'](handleError(_0x5bbd85,null));};exports[_0x0282('0xa5')]=runReport;exports[_0x0282('0x32')]=function(_0x34c5b5,_0xfed5e8){var _0x5032c6=0xa;var _0x2ac471=[_0x0282('0x56'),_0x0282('0x57'),_0x0282('0x8a'),'cross_join'];var _0x8082f2={'SUM':'SUM(%s)','COUNT':_0x0282('0x5a'),'COUNT DISTINCT':_0x0282('0x5b'),'MAX':'MAX(%s)','MIN':_0x0282('0x5d'),'AVG':_0x0282('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0282('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x31e03a={'SEC_TO_TIME':_0x0282('0x61'),'DATE':_0x0282('0x62'),'HOUR':_0x0282('0x63'),'ROUND':_0x0282('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1096a5=function(_0x8a2f49){return!_[_0x0282('0x66')]([_0x0282('0x67'),_0x0282('0x8c'),_0x0282('0x68'),_0x0282('0x69')],_0x8a2f49);};var _0x42a117=function(_0xa4c9a5){if(!_0xa4c9a5||!_0xa4c9a5[_0x0282('0x6a')][_0x0282('0x6b')]){return'';}for(var _0x186569='(',_0x4cf2da=0x0;_0x4cf2da<_0xa4c9a5[_0x0282('0x6a')][_0x0282('0x6b')];_0x4cf2da+=0x1){_0x4cf2da>0x0&&(_0x186569+='\x20'+_0xa4c9a5[_0x0282('0x8d')]+'\x20');_0x186569+=_0xa4c9a5['rules'][_0x4cf2da][_0x0282('0x6c')]?_0x42a117(_0xa4c9a5['rules'][_0x4cf2da][_0x0282('0x6c')]):_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da]['field']+'\x20'+_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da]['condition']+(_0x1096a5(_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da][_0x0282('0x6e')])?'\x20'+_0xa4c9a5[_0x0282('0x6a')][_0x4cf2da][_0x0282('0x6f')]:'');}return _0x186569+')';};var _0x5ed494={'where':{'id':_0x34c5b5[_0x0282('0x47')]['id']}},_0x30b026,_0x5638d8,_0x5b21d3,_0x38ca76,_0x2a4a5e;_0x5ed494=_[_0x0282('0x3e')]({},_0x5ed494,_0x34c5b5[_0x0282('0x49')]);return db['AnalyticCustomReport'][_0x0282('0x50')](_0x5ed494)['then'](function(_0x19461c){if(_0x19461c){_0x30b026=_0x19461c;return _0x19461c[_0x0282('0x8e')]();}return null;})[_0x0282('0x22')](function(_0x58dcc3){if(_0x58dcc3){if(!_0x58dcc3[_0x0282('0x6b')]){throw new db[(_0x0282('0x8f'))][(_0x0282('0xa6'))](_0x0282('0x70'),0x193);}_0x5638d8=_0x58dcc3;return db['AnalyticMetric'][_0x0282('0x43')]({'raw':!![]});}return null;})[_0x0282('0x22')](function(_0x1202c3){if(_0x1202c3){_0x5b21d3=_[_0x0282('0x90')](_0x1202c3,'id');var _0x39b44b;var _0x38cb34=squel[_0x0282('0x72')]();_0x38cb34['from'](_0x30b026[_0x0282('0x73')]);for(var _0x54096c=0x0;_0x54096c<_0x5638d8['length'];_0x54096c+=0x1){_0x39b44b=_0x5638d8[_0x54096c][_0x0282('0x74')]?_0x5b21d3[_0x5638d8[_0x54096c][_0x0282('0x74')]][_0x0282('0x75')]:_0x5638d8[_0x54096c][_0x0282('0x6d')];_0x39b44b=_0x5638d8[_0x54096c]['function']?_[_0x0282('0x76')](_0x8082f2[_0x5638d8[_0x54096c][_0x0282('0x77')]],'%s',_0x39b44b):_0x39b44b;_0x39b44b=_0x5638d8[_0x54096c][_0x0282('0x78')]?_[_0x0282('0x76')](_0x31e03a[_0x5638d8[_0x54096c][_0x0282('0x78')]],'%s',_0x39b44b):_0x39b44b;if(_0x5638d8[_0x54096c]['groupBy']){_0x38cb34[_0x0282('0x6c')](_0x39b44b);}_0x5638d8[_0x54096c][_0x0282('0x7a')]&&_0x38cb34['order'](_0x39b44b,_0x5638d8[_0x54096c][_0x0282('0x7a')]===_0x0282('0x7b')?![]:!![]);_0x38cb34[_0x0282('0x6d')](_0x39b44b,_0x5638d8[_0x54096c][_0x0282('0x7c')]||_0x39b44b);}if(_0x30b026[_0x0282('0x7d')]){_0x30b026[_0x0282('0x7d')]=JSON[_0x0282('0x7e')](_0x30b026[_0x0282('0x7d')]);for(var _0x276107=0x0;_0x276107<_0x30b026[_0x0282('0x7d')][_0x0282('0x6b')];_0x276107+=0x1){if(_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')]&&_['includes'](_0x2ac471,_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')])&&_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x7f')]&&_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x80')]&&_0x30b026['joins'][_0x276107][_0x0282('0x82')]){_0x38cb34[_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x3f')]](_0x30b026['joins'][_0x276107][_0x0282('0x80')],null,util[_0x0282('0x78')](_0x0282('0x81'),_0x30b026[_0x0282('0x73')],_0x30b026['joins'][_0x276107][_0x0282('0x7f')],_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x80')],_0x30b026[_0x0282('0x7d')][_0x276107][_0x0282('0x82')]));}}}if(_0x30b026[_0x0282('0x83')]){_0x30b026[_0x0282('0x83')]=JSON[_0x0282('0x7e')](_0x30b026[_0x0282('0x83')]);_0x38cb34[_0x0282('0x3a')](_0x42a117(_0x30b026[_0x0282('0x83')][_0x0282('0x6c')]));}_0x2a4a5e=_0x38cb34[_0x0282('0x84')]();_0x38cb34[_0x0282('0x1c')](_0x5032c6);_0x38cb34['offset'](0x0);logger['debug']('Limited\x20Query:',_0x38cb34[_0x0282('0x86')]());return dbH[_0x0282('0x87')][_0x0282('0x32')](_0x38cb34[_0x0282('0x86')](),{'type':dbH[_0x0282('0x87')]['QueryTypes'][_0x0282('0x89')]});}})[_0x0282('0x22')](function(){return{'sql':_0x2a4a5e['toString']()};})[_0x0282('0x22')](respondWithResult(_0xfed5e8,null))['catch'](handleError(_0xfed5e8,null));};
\ No newline at end of file
+var _0x09ba=['web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','clone','Limited\x20Query:','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','count','Content-Range','save','then','destroy','get','CustomReports','UserProfileResource','end','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','format','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','SUM(%s)','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','IS\x20NULL','getFields','%s.%s\x20=\x20%s.%s','output'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x09ba,0xbd));var _0xa09b=function(_0x5e3bb1,_0x3cfe7c){_0x5e3bb1=_0x5e3bb1-0x0;var _0x4c1278=_0x09ba[_0x5e3bb1];return _0x4c1278;};'use strict';var emlformat=require(_0xa09b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa09b('0x1'));var rp=require('request-promise');var moment=require(_0xa09b('0x2'));var BPromise=require(_0xa09b('0x3'));var Mustache=require(_0xa09b('0x4'));var util=require(_0xa09b('0x5'));var path=require('path');var sox=require(_0xa09b('0x6'));var csv=require(_0xa09b('0x7'));var ejs=require(_0xa09b('0x8'));var fs=require('fs');var fs_extra=require(_0xa09b('0x9'));var _=require(_0xa09b('0xa'));var squel=require(_0xa09b('0xb'));var crypto=require(_0xa09b('0xc'));var jsforce=require(_0xa09b('0xd'));var deskjs=require(_0xa09b('0xe'));var toCsv=require(_0xa09b('0x7'));var querystring=require(_0xa09b('0xf'));var Papa=require(_0xa09b('0x10'));var Redis=require(_0xa09b('0x11'));var authService=require(_0xa09b('0x12'));var qs=require(_0xa09b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa09b('0x14'));var logger=require(_0xa09b('0x15'))(_0xa09b('0x16'));var utils=require(_0xa09b('0x17'));var config=require(_0xa09b('0x18'));var licenseUtil=require(_0xa09b('0x19'));var db=require(_0xa09b('0x1a'))['db'];var dbH=require(_0xa09b('0x1a'))[_0xa09b('0x1b')];function respondWithStatusCode(_0x37d24e,_0x73a4e4){_0x73a4e4=_0x73a4e4||0xcc;return function(_0x2c25b6){if(_0x2c25b6){return _0x37d24e['sendStatus'](_0x73a4e4);}return _0x37d24e['status'](_0x73a4e4)['end']();};}function respondWithResult(_0x1396ec,_0xf60ce2){_0xf60ce2=_0xf60ce2||0xc8;return function(_0x56b299){if(_0x56b299){return _0x1396ec[_0xa09b('0x1c')](_0xf60ce2)[_0xa09b('0x1d')](_0x56b299);}};}function respondWithFilteredResult(_0x4e48a7,_0x4910e0){return function(_0x4440ab){if(_0x4440ab){var _0x5b2285=typeof _0x4910e0[_0xa09b('0x1e')]===_0xa09b('0x1f')&&typeof _0x4910e0[_0xa09b('0x20')]==='undefined';var _0x508273=_0x4440ab[_0xa09b('0x21')];var _0x1ea2c2=_0x5b2285?0x0:_0x4910e0[_0xa09b('0x1e')];var _0x3e4d14=_0x5b2285?_0x4440ab[_0xa09b('0x21')]:_0x4910e0['offset']+_0x4910e0[_0xa09b('0x20')];var _0x453aae;if(_0x3e4d14>=_0x508273){_0x3e4d14=_0x508273;_0x453aae=0xc8;}else{_0x453aae=0xce;}_0x4e48a7[_0xa09b('0x1c')](_0x453aae);return _0x4e48a7['set'](_0xa09b('0x22'),_0x1ea2c2+'-'+_0x3e4d14+'/'+_0x508273)[_0xa09b('0x1d')](_0x4440ab);}return null;};}function patchUpdates(_0xa3957d){return function(_0x185596){try{jsonpatch['apply'](_0x185596,_0xa3957d,!![]);}catch(_0x5ecdc1){return BPromise['reject'](_0x5ecdc1);}return _0x185596[_0xa09b('0x23')]();};}function saveUpdates(_0x27a6b4,_0x46cf42){return function(_0x45b04b){if(_0x45b04b){return _0x45b04b['update'](_0x27a6b4)[_0xa09b('0x24')](function(_0x135ab8){return _0x135ab8;});}return null;};}function removeEntity(_0x253494,_0x2641aa){return function(_0x4be099){if(_0x4be099){return _0x4be099[_0xa09b('0x25')]()[_0xa09b('0x24')](function(){var _0x250944=_0x4be099[_0xa09b('0x26')]({'plain':!![]});var _0x57a4cf=_0xa09b('0x27');return db[_0xa09b('0x28')][_0xa09b('0x25')]({'where':{'type':_0x57a4cf,'resourceId':_0x250944['id']}})[_0xa09b('0x24')](function(){return _0x4be099;});})[_0xa09b('0x24')](function(){_0x253494['status'](0xcc)[_0xa09b('0x29')]();});}};}function handleEntityNotFound(_0x1c1803,_0x35678a){return function(_0x4fb15c){if(!_0x4fb15c){_0x1c1803['sendStatus'](0x194);}return _0x4fb15c;};}function handleError(_0x713ab0,_0x558e53){_0x558e53=_0x558e53||0x1f4;return function(_0x219d7f){logger['error'](_0x219d7f[_0xa09b('0x2a')]);if(_0x219d7f[_0xa09b('0x2b')]){delete _0x219d7f['name'];}_0x713ab0[_0xa09b('0x1c')](_0x558e53)['send'](_0x219d7f);};}exports[_0xa09b('0x2c')]=function(_0x1c6c95,_0x1e161d){var _0x11c896={},_0x3845c4={},_0x5a6737={'count':0x0,'rows':[]};var _0x2b53e5=_[_0xa09b('0x2d')](db[_0xa09b('0x2e')][_0xa09b('0x2f')],function(_0xeebcab){return{'name':_0xeebcab[_0xa09b('0x30')],'type':_0xeebcab[_0xa09b('0x31')][_0xa09b('0x32')]};});_0x3845c4['model']=_[_0xa09b('0x2d')](_0x2b53e5,_0xa09b('0x2b'));_0x3845c4[_0xa09b('0x33')]=_[_0xa09b('0x34')](_0x1c6c95[_0xa09b('0x33')]);_0x3845c4[_0xa09b('0x35')]=_[_0xa09b('0x36')](_0x3845c4['model'],_0x3845c4[_0xa09b('0x33')]);_0x11c896['attributes']=_[_0xa09b('0x36')](_0x3845c4[_0xa09b('0x37')],qs[_0xa09b('0x38')](_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x38')]));_0x11c896[_0xa09b('0x39')]=_0x11c896[_0xa09b('0x39')]['length']?_0x11c896[_0xa09b('0x39')]:_0x3845c4[_0xa09b('0x37')];if(!_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x3a')](_0xa09b('0x3b'))){_0x11c896[_0xa09b('0x20')]=qs['limit'](_0x1c6c95[_0xa09b('0x33')]['limit']);_0x11c896['offset']=qs[_0xa09b('0x1e')](_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x1e')]);}_0x11c896[_0xa09b('0x3c')]=qs[_0xa09b('0x3d')](_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x3d')]);_0x11c896[_0xa09b('0x3e')]=qs[_0xa09b('0x35')](_[_0xa09b('0x3f')](_0x1c6c95[_0xa09b('0x33')],_0x3845c4['filters']),_0x2b53e5);if(_0x1c6c95['query']['filter']){_0x11c896[_0xa09b('0x3e')]=_[_0xa09b('0x40')](_0x11c896[_0xa09b('0x3e')],{'$or':_['map'](_0x2b53e5,function(_0x41439a){if(_0x41439a[_0xa09b('0x31')]!==_0xa09b('0x41')){var _0x192cc8={};_0x192cc8[_0x41439a[_0xa09b('0x2b')]]={'$like':'%'+_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x42')]+'%'};return _0x192cc8;}})});}_0x11c896=_[_0xa09b('0x40')]({},_0x11c896,_0x1c6c95[_0xa09b('0x43')]);var _0x273d77={'where':_0x11c896[_0xa09b('0x3e')]};return db[_0xa09b('0x2e')][_0xa09b('0x21')](_0x273d77)['then'](function(_0x558569){_0x5a6737[_0xa09b('0x21')]=_0x558569;if(_0x1c6c95[_0xa09b('0x33')][_0xa09b('0x44')]){_0x11c896[_0xa09b('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xa09b('0x46')](_0x11c896);})[_0xa09b('0x24')](function(_0x4601c8){_0x5a6737[_0xa09b('0x47')]=_0x4601c8;return _0x5a6737;})['then'](respondWithFilteredResult(_0x1e161d,_0x11c896))[_0xa09b('0x48')](handleError(_0x1e161d,null));};exports[_0xa09b('0x49')]=function(_0x484907,_0x1f4e6e){var _0x46cc35={'raw':![],'where':{'id':_0x484907[_0xa09b('0x4a')]['id']}},_0x1d7d9e={};_0x1d7d9e[_0xa09b('0x37')]=_[_0xa09b('0x34')](db['AnalyticCustomReport'][_0xa09b('0x2f')]);_0x1d7d9e[_0xa09b('0x33')]=_['keys'](_0x484907[_0xa09b('0x33')]);_0x1d7d9e['filters']=_['intersection'](_0x1d7d9e['model'],_0x1d7d9e['query']);_0x46cc35[_0xa09b('0x39')]=_[_0xa09b('0x36')](_0x1d7d9e[_0xa09b('0x37')],qs[_0xa09b('0x38')](_0x484907[_0xa09b('0x33')][_0xa09b('0x38')]));_0x46cc35[_0xa09b('0x39')]=_0x46cc35[_0xa09b('0x39')]['length']?_0x46cc35[_0xa09b('0x39')]:_0x1d7d9e[_0xa09b('0x37')];if(_0x484907['query'][_0xa09b('0x44')]){_0x46cc35[_0xa09b('0x45')]=[{'all':!![]}];}_0x46cc35=_['merge']({},_0x46cc35,_0x484907[_0xa09b('0x43')]);return db['AnalyticCustomReport'][_0xa09b('0x4b')](_0x46cc35)[_0xa09b('0x24')](handleEntityNotFound(_0x1f4e6e,null))[_0xa09b('0x24')](respondWithResult(_0x1f4e6e,null))['catch'](handleError(_0x1f4e6e,null));};exports[_0xa09b('0x4c')]=function(_0x3cfa89,_0x174026){return db[_0xa09b('0x2e')][_0xa09b('0x4c')](_0x3cfa89[_0xa09b('0x4d')],{})[_0xa09b('0x24')](function(_0x41ae83){var _0x42b1af=_0x3cfa89[_0xa09b('0x4e')][_0xa09b('0x26')]({'plain':!![]});if(!_0x42b1af)throw new Error(_0xa09b('0x4f'));if(_0x42b1af[_0xa09b('0x50')]===_0xa09b('0x4e')){var _0x56a979=_0x41ae83[_0xa09b('0x26')]({'plain':!![]});var _0x16a73d=_0xa09b('0x51');return db[_0xa09b('0x52')][_0xa09b('0x4b')]({'where':{'name':_0x16a73d,'userProfileId':_0x42b1af[_0xa09b('0x53')]},'raw':!![]})[_0xa09b('0x24')](function(_0x1189f7){if(_0x1189f7&&_0x1189f7['autoAssociation']===0x0){return db[_0xa09b('0x28')][_0xa09b('0x4c')]({'name':_0x56a979[_0xa09b('0x2b')],'resourceId':_0x56a979['id'],'type':_0xa09b('0x27'),'sectionId':_0x1189f7['id']},{})[_0xa09b('0x24')](function(){return _0x41ae83;});}else{return _0x41ae83;}})['catch'](function(_0x475157){logger[_0xa09b('0x54')](_0xa09b('0x55'),_0x475157);throw _0x475157;});}return _0x41ae83;})[_0xa09b('0x24')](respondWithResult(_0x174026,0xc9))[_0xa09b('0x48')](handleError(_0x174026,null));};exports[_0xa09b('0x56')]=function(_0x11cc73,_0x43b445){if(_0x11cc73['body']['id']){delete _0x11cc73['body']['id'];}return db[_0xa09b('0x2e')]['find']({'where':{'id':_0x11cc73['params']['id']}})[_0xa09b('0x24')](handleEntityNotFound(_0x43b445,null))[_0xa09b('0x24')](saveUpdates(_0x11cc73[_0xa09b('0x4d')],null))['then'](respondWithResult(_0x43b445,null))[_0xa09b('0x48')](handleError(_0x43b445,null));};exports[_0xa09b('0x25')]=function(_0x100b32,_0x2ea1d6){return db[_0xa09b('0x2e')][_0xa09b('0x4b')]({'where':{'id':_0x100b32[_0xa09b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2ea1d6,null))[_0xa09b('0x24')](removeEntity(_0x2ea1d6,null))['catch'](handleError(_0x2ea1d6,null));};exports[_0xa09b('0x57')]=function(_0xd6b261,_0x7ac2da){var _0x174632=0xa;var _0x2f1c32=[_0xa09b('0x58'),_0xa09b('0x59'),_0xa09b('0x5a'),_0xa09b('0x5b')];var _0x3d6a12={'SUM':'SUM(%s)','COUNT':_0xa09b('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa09b('0x5d'),'MIN':_0xa09b('0x5e'),'AVG':_0xa09b('0x5f'),'GROUP_CONCAT':_0xa09b('0x60'),'GROUP_CONCAT ASC':_0xa09b('0x61'),'GROUP_CONCAT DESC':_0xa09b('0x62')};var _0x2dc7a3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa09b('0x63'),'HOUR':_0xa09b('0x64'),'ROUND':_0xa09b('0x65'),'UNIX_TIMESTAMP':_0xa09b('0x66')};var _0x24ffb2=function(_0x50fea5){return!_[_0xa09b('0x67')](['IS\x20NULL',_0xa09b('0x68'),_0xa09b('0x69'),_0xa09b('0x6a')],_0x50fea5);};var _0x272785=function(_0x2f7da1){if(!_0x2f7da1||!_0x2f7da1[_0xa09b('0x6b')]['length']){return'';}for(var _0x1010f9='(',_0x5505e4=0x0;_0x5505e4<_0x2f7da1[_0xa09b('0x6b')][_0xa09b('0x6c')];_0x5505e4+=0x1){_0x5505e4>0x0&&(_0x1010f9+='\x20'+_0x2f7da1[_0xa09b('0x6d')]+'\x20');_0x1010f9+=_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x6e')]?_0x272785(_0x2f7da1[_0xa09b('0x6b')][_0x5505e4]['group']):_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x6f')]+'\x20'+_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x70')]+(_0x24ffb2(_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x70')])?'\x20'+_0x2f7da1[_0xa09b('0x6b')][_0x5505e4][_0xa09b('0x71')]:'');}return _0x1010f9+')';};var _0x1ccdb0={'where':{'id':_0xd6b261['params']['id']}},_0x1aa59f,_0x11d3ed,_0x1fe3f6,_0x4f1b42,_0x193d59;_0x1ccdb0=_[_0xa09b('0x40')]({},_0x1ccdb0,_0xd6b261[_0xa09b('0x43')]);return db[_0xa09b('0x2e')][_0xa09b('0x4b')](_0x1ccdb0)[_0xa09b('0x24')](function(_0x4de164){if(_0x4de164){_0x1aa59f=_0x4de164;return _0x4de164['getFields']();}return null;})[_0xa09b('0x24')](function(_0x3de64e){if(_0x3de64e){if(!_0x3de64e[_0xa09b('0x6c')]){throw new db[(_0xa09b('0x72'))][(_0xa09b('0x73'))](_0xa09b('0x74'),0x193);}_0x11d3ed=_0x3de64e;return db[_0xa09b('0x75')][_0xa09b('0x46')]({'raw':!![]});}return null;})[_0xa09b('0x24')](function(_0x22f369){if(_0x22f369){_0x1fe3f6=_[_0xa09b('0x76')](_0x22f369,'id');var _0x5ceb8d;var _0x1613c9=squel[_0xa09b('0x77')]();_0x1613c9[_0xa09b('0x78')](_0x1aa59f[_0xa09b('0x79')]);for(var _0x1a4971=0x0;_0x1a4971<_0x11d3ed['length'];_0x1a4971+=0x1){_0x5ceb8d=_0x11d3ed[_0x1a4971]['MetricId']?_0x1fe3f6[_0x11d3ed[_0x1a4971][_0xa09b('0x7a')]][_0xa09b('0x7b')]:_0x11d3ed[_0x1a4971]['field'];_0x5ceb8d=_0x11d3ed[_0x1a4971]['function']?_[_0xa09b('0x7c')](_0x3d6a12[_0x11d3ed[_0x1a4971][_0xa09b('0x7d')]],'%s',_0x5ceb8d):_0x5ceb8d;_0x5ceb8d=_0x11d3ed[_0x1a4971]['format']?_['replace'](_0x2dc7a3[_0x11d3ed[_0x1a4971]['format']],'%s',_0x5ceb8d):_0x5ceb8d;if(_0x11d3ed[_0x1a4971][_0xa09b('0x7e')]){_0x1613c9[_0xa09b('0x6e')](_0x5ceb8d);}_0x11d3ed[_0x1a4971][_0xa09b('0x7f')]&&_0x1613c9[_0xa09b('0x3c')](_0x5ceb8d,_0x11d3ed[_0x1a4971][_0xa09b('0x7f')]===_0xa09b('0x80')?![]:!![]);_0x1613c9[_0xa09b('0x6f')](_0x5ceb8d,_0x11d3ed[_0x1a4971][_0xa09b('0x81')]||_0x5ceb8d);}if(_0x1aa59f['joins']){_0x1aa59f[_0xa09b('0x82')]=JSON[_0xa09b('0x83')](_0x1aa59f[_0xa09b('0x82')]);for(var _0x4c3ee5=0x0;_0x4c3ee5<_0x1aa59f[_0xa09b('0x82')]['length'];_0x4c3ee5+=0x1){if(_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x31')]&&_[_0xa09b('0x67')](_0x2f1c32,_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5]['type'])&&_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x84')]&&_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x85')]&&_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5]['foreignKey']){_0x1613c9[_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5]['type']](_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x85')],null,util[_0xa09b('0x86')]('%s.%s\x20=\x20%s.%s',_0x1aa59f['table'],_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x84')],_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x85')],_0x1aa59f[_0xa09b('0x82')][_0x4c3ee5][_0xa09b('0x87')]));}}}if(_0x1aa59f[_0xa09b('0x88')]){_0x1aa59f[_0xa09b('0x88')]=JSON['parse'](_0x1aa59f[_0xa09b('0x88')]);_0x1613c9[_0xa09b('0x3e')](_0x272785(_0x1aa59f[_0xa09b('0x88')][_0xa09b('0x6e')]));}_0x193d59=_0x1613c9['clone']();_0x1613c9['limit'](_0x174632);_0x1613c9[_0xa09b('0x1e')](0x0);logger[_0xa09b('0x89')]('Limited\x20Query:',_0x1613c9[_0xa09b('0x8a')]());return dbH[_0xa09b('0x8b')][_0xa09b('0x33')](_0x1613c9['toString'](),{'type':dbH[_0xa09b('0x8b')][_0xa09b('0x8c')][_0xa09b('0x8d')]});}})[_0xa09b('0x24')](respondWithResult(_0x7ac2da,null))['catch'](handleError(_0x7ac2da,null));};function runReport(_0x1caef1,_0x4abfa6,_0x60de88){var _0x21a15a=_0x4abfa6[_0xa09b('0x2b')];var _0x57a9c6=0xa;var _0xcc354=['join','left_join',_0xa09b('0x5a'),_0xa09b('0x5b')];var _0x499843={'SUM':_0xa09b('0x8e'),'COUNT':_0xa09b('0x5c'),'COUNT DISTINCT':_0xa09b('0x8f'),'MAX':'MAX(%s)','MIN':_0xa09b('0x5e'),'AVG':_0xa09b('0x5f'),'GROUP_CONCAT':_0xa09b('0x60'),'GROUP_CONCAT ASC':_0xa09b('0x61'),'GROUP_CONCAT DESC':_0xa09b('0x62')};var _0xeb4dad={'SEC_TO_TIME':_0xa09b('0x90'),'DATE':_0xa09b('0x63'),'HOUR':_0xa09b('0x64'),'ROUND':_0xa09b('0x65'),'UNIX_TIMESTAMP':_0xa09b('0x66')};var _0x563b94=function(_0x4b0699){return!_[_0xa09b('0x67')]([_0xa09b('0x91'),_0xa09b('0x68'),'IS\x20EMPTY',_0xa09b('0x6a')],_0x4b0699);};var _0x3f1516=function(_0x11d199){if(!_0x11d199||!_0x11d199[_0xa09b('0x6b')][_0xa09b('0x6c')]){return'';}for(var _0x47ac70='(',_0x2d8e34=0x0;_0x2d8e34<_0x11d199[_0xa09b('0x6b')][_0xa09b('0x6c')];_0x2d8e34+=0x1){_0x2d8e34>0x0&&(_0x47ac70+='\x20'+_0x11d199['operator']+'\x20');_0x47ac70+=_0x11d199[_0xa09b('0x6b')][_0x2d8e34]['group']?_0x3f1516(_0x11d199[_0xa09b('0x6b')][_0x2d8e34][_0xa09b('0x6e')]):_0x11d199['rules'][_0x2d8e34][_0xa09b('0x6f')]+'\x20'+_0x11d199[_0xa09b('0x6b')][_0x2d8e34][_0xa09b('0x70')]+(_0x563b94(_0x11d199[_0xa09b('0x6b')][_0x2d8e34][_0xa09b('0x70')])?'\x20'+_0x11d199[_0xa09b('0x6b')][_0x2d8e34][_0xa09b('0x71')]:'');}return _0x47ac70+')';};var _0x16c50f={'where':{'id':_0x1caef1['id']}},_0x11fab5,_0x85ad4d,_0x35ad1d,_0x4251a8,_0x3a0456;_0x16c50f=_[_0xa09b('0x40')]({},_0x16c50f,_0x60de88);return db[_0xa09b('0x2e')][_0xa09b('0x4b')](_0x16c50f)[_0xa09b('0x24')](function(_0x3f0398){if(_0x3f0398){_0x11fab5=_0x3f0398;return _0x3f0398[_0xa09b('0x92')]();}return null;})[_0xa09b('0x24')](function(_0x3d45ef){if(_0x3d45ef){if(!_0x3d45ef[_0xa09b('0x6c')]){throw new db[(_0xa09b('0x72'))][(_0xa09b('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x85ad4d=_0x3d45ef;return db[_0xa09b('0x75')][_0xa09b('0x46')]({'raw':!![]});}return null;})[_0xa09b('0x24')](function(_0x252f44){if(_0x252f44){_0x35ad1d=_['keyBy'](_0x252f44,'id');var _0x17e453;var _0x36e396=squel[_0xa09b('0x77')]();_0x36e396[_0xa09b('0x78')](_0x11fab5['table']);for(var _0x395917=0x0;_0x395917<_0x85ad4d[_0xa09b('0x6c')];_0x395917+=0x1){_0x17e453=_0x85ad4d[_0x395917][_0xa09b('0x7a')]?_0x35ad1d[_0x85ad4d[_0x395917][_0xa09b('0x7a')]][_0xa09b('0x7b')]:_0x85ad4d[_0x395917][_0xa09b('0x6f')];_0x17e453=_0x85ad4d[_0x395917][_0xa09b('0x7d')]?_[_0xa09b('0x7c')](_0x499843[_0x85ad4d[_0x395917]['function']],'%s',_0x17e453):_0x17e453;_0x17e453=_0x85ad4d[_0x395917][_0xa09b('0x86')]?_[_0xa09b('0x7c')](_0xeb4dad[_0x85ad4d[_0x395917][_0xa09b('0x86')]],'%s',_0x17e453):_0x17e453;if(_0x85ad4d[_0x395917]['groupBy']){_0x36e396[_0xa09b('0x6e')](_0x17e453);}_0x85ad4d[_0x395917]['orderBy']&&_0x36e396[_0xa09b('0x3c')](_0x17e453,_0x85ad4d[_0x395917]['orderBy']===_0xa09b('0x80')?![]:!![]);_0x36e396['field'](_0x17e453,_0x85ad4d[_0x395917][_0xa09b('0x81')]||_0x17e453);}if(_0x11fab5['joins']){_0x11fab5[_0xa09b('0x82')]=JSON[_0xa09b('0x83')](_0x11fab5[_0xa09b('0x82')]);for(var _0x12dad1=0x0;_0x12dad1<_0x11fab5[_0xa09b('0x82')][_0xa09b('0x6c')];_0x12dad1+=0x1){if(_0x11fab5['joins'][_0x12dad1][_0xa09b('0x31')]&&_[_0xa09b('0x67')](_0xcc354,_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x31')])&&_0x11fab5[_0xa09b('0x82')][_0x12dad1]['parentKey']&&_0x11fab5['joins'][_0x12dad1][_0xa09b('0x85')]&&_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x87')]){_0x36e396[_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x31')]](_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x85')],null,util['format'](_0xa09b('0x93'),_0x11fab5[_0xa09b('0x79')],_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x84')],_0x11fab5[_0xa09b('0x82')][_0x12dad1][_0xa09b('0x85')],_0x11fab5[_0xa09b('0x82')][_0x12dad1]['foreignKey']));}}}if(_0x11fab5[_0xa09b('0x88')]){_0x11fab5['conditions']=JSON[_0xa09b('0x83')](_0x11fab5[_0xa09b('0x88')]);_0x36e396[_0xa09b('0x3e')](_0x3f1516(_0x11fab5['conditions'][_0xa09b('0x6e')]));}_0x3a0456=_0x36e396['clone']();_0x36e396[_0xa09b('0x20')](_0x57a9c6);_0x36e396['offset'](0x0);return;}})[_0xa09b('0x24')](function(){if(_0x4abfa6[_0xa09b('0x94')]===_0xa09b('0x95')){return null;}var _0x527f56=_['merge'](_0x4abfa6,{'name':_0x4abfa6[_0xa09b('0x96')]||_0x4abfa6[_0xa09b('0x2b')]||_0x11fab5[_0xa09b('0x2b')],'basename':_0x21a15a,'savename':util['format'](_0xa09b('0x97'),_0x4abfa6[_0xa09b('0x2b')]||_0x11fab5[_0xa09b('0x2b')],require(_0xa09b('0x98'))['generate'](0x4),_0x4abfa6[_0xa09b('0x94')]||_0xa09b('0x99')),'reportId':_0x11fab5['id'],'reportType':_0xa09b('0x9a')});return db[_0xa09b('0x9b')][_0xa09b('0x4c')](_0x527f56,{'raw':!![]});})['then'](function(_0x1c2ff2){if(_0x11fab5[_0xa09b('0x79')]==='cdr'){_0x3a0456['where'](_0x11fab5[_0xa09b('0x79')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4abfa6[_0xa09b('0x9c')],_0x4abfa6[_0xa09b('0x9d')]);}else{_0x3a0456[_0xa09b('0x3e')](_0x11fab5[_0xa09b('0x79')]+_0xa09b('0x9e'),_0x4abfa6[_0xa09b('0x9c')],_0x4abfa6['endDate']);}if(_0x1c2ff2){logger[_0xa09b('0x9f')](_0xa09b('0xa0'),_0x3a0456[_0xa09b('0x8a')]());require('child_process')['fork'](path[_0xa09b('0x58')](__dirname,_0xa09b('0xa1'),_0x1c2ff2['output']),[_0x1c2ff2['id'],_0x3a0456[_0xa09b('0x8a')](),path['join'](__dirname,_0xa09b('0xa2'),_0x1c2ff2[_0xa09b('0xa3')]),_0x21a15a]);return _0x1c2ff2;}else{var _0x459ce4=squel['select']();_0x459ce4['from']('('+_0x3a0456[_0xa09b('0x8a')]()+')','countTable');_0x459ce4[_0xa09b('0x6f')](_0xa09b('0xa4'),_0xa09b('0x21'));_0x3a0456[_0xa09b('0x20')](_0x4abfa6[_0xa09b('0x20')]||_0x57a9c6);_0x3a0456[_0xa09b('0x1e')](_0x4abfa6[_0xa09b('0x1e')]||0x0);return dbH[_0xa09b('0x8b')]['query'](_0x459ce4[_0xa09b('0x8a')](),{'type':dbH[_0xa09b('0x8b')][_0xa09b('0x8c')][_0xa09b('0x8d')]})['then'](function(_0xc3f27){if(!_0xc3f27['length']){_0x4251a8=0x0;}else{_0x4251a8=_0xc3f27[0x0][_0xa09b('0x21')]||0x0;}return dbH[_0xa09b('0x8b')][_0xa09b('0x33')](_0x3a0456[_0xa09b('0x8a')](),{'type':dbH[_0xa09b('0x8b')]['QueryTypes'][_0xa09b('0x8d')]});})['then'](function(_0x589608){return{'rows':_0x589608||[],'count':_0x4251a8};});}});}exports[_0xa09b('0xa5')]=function(_0x1929f2,_0x2e8b34){return runReport(_0x1929f2[_0xa09b('0x4a')],_0x1929f2[_0xa09b('0x33')],_0x1929f2['options'])[_0xa09b('0x24')](respondWithResult(_0x2e8b34,null))['catch'](handleError(_0x2e8b34,null));};exports[_0xa09b('0xa6')]=runReport;exports[_0xa09b('0x33')]=function(_0x360cb,_0x14d844){var _0x3852fa=0xa;var _0x429aff=[_0xa09b('0x58'),_0xa09b('0x59'),'right_join',_0xa09b('0x5b')];var _0x33c75e={'SUM':_0xa09b('0x8e'),'COUNT':_0xa09b('0x5c'),'COUNT DISTINCT':_0xa09b('0x8f'),'MAX':_0xa09b('0x5d'),'MIN':_0xa09b('0x5e'),'AVG':_0xa09b('0x5f'),'GROUP_CONCAT':_0xa09b('0x60'),'GROUP_CONCAT ASC':_0xa09b('0x61'),'GROUP_CONCAT DESC':_0xa09b('0x62')};var _0x4773f5={'SEC_TO_TIME':_0xa09b('0x90'),'DATE':_0xa09b('0x63'),'HOUR':'HOUR(%s)','ROUND':_0xa09b('0x65'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x11b528=function(_0x33d164){return!_[_0xa09b('0x67')]([_0xa09b('0x91'),_0xa09b('0x68'),'IS\x20EMPTY',_0xa09b('0x6a')],_0x33d164);};var _0x59313c=function(_0x311563){if(!_0x311563||!_0x311563[_0xa09b('0x6b')]['length']){return'';}for(var _0x53cfd6='(',_0x4e66b2=0x0;_0x4e66b2<_0x311563[_0xa09b('0x6b')][_0xa09b('0x6c')];_0x4e66b2+=0x1){_0x4e66b2>0x0&&(_0x53cfd6+='\x20'+_0x311563[_0xa09b('0x6d')]+'\x20');_0x53cfd6+=_0x311563[_0xa09b('0x6b')][_0x4e66b2][_0xa09b('0x6e')]?_0x59313c(_0x311563['rules'][_0x4e66b2][_0xa09b('0x6e')]):_0x311563['rules'][_0x4e66b2][_0xa09b('0x6f')]+'\x20'+_0x311563['rules'][_0x4e66b2][_0xa09b('0x70')]+(_0x11b528(_0x311563[_0xa09b('0x6b')][_0x4e66b2][_0xa09b('0x70')])?'\x20'+_0x311563[_0xa09b('0x6b')][_0x4e66b2][_0xa09b('0x71')]:'');}return _0x53cfd6+')';};var _0x304e55={'where':{'id':_0x360cb[_0xa09b('0x4a')]['id']}},_0x11695f,_0x4ed85e,_0x2cdcf0,_0x4d6fea,_0x158bdf;_0x304e55=_[_0xa09b('0x40')]({},_0x304e55,_0x360cb[_0xa09b('0x43')]);return db[_0xa09b('0x2e')][_0xa09b('0x4b')](_0x304e55)[_0xa09b('0x24')](function(_0x225886){if(_0x225886){_0x11695f=_0x225886;return _0x225886[_0xa09b('0x92')]();}return null;})['then'](function(_0x40345b){if(_0x40345b){if(!_0x40345b[_0xa09b('0x6c')]){throw new db[(_0xa09b('0x72'))][(_0xa09b('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed85e=_0x40345b;return db[_0xa09b('0x75')][_0xa09b('0x46')]({'raw':!![]});}return null;})['then'](function(_0x237fbf){if(_0x237fbf){_0x2cdcf0=_[_0xa09b('0x76')](_0x237fbf,'id');var _0xeea10d;var _0x45632d=squel['select']();_0x45632d[_0xa09b('0x78')](_0x11695f[_0xa09b('0x79')]);for(var _0x14c882=0x0;_0x14c882<_0x4ed85e[_0xa09b('0x6c')];_0x14c882+=0x1){_0xeea10d=_0x4ed85e[_0x14c882][_0xa09b('0x7a')]?_0x2cdcf0[_0x4ed85e[_0x14c882]['MetricId']][_0xa09b('0x7b')]:_0x4ed85e[_0x14c882][_0xa09b('0x6f')];_0xeea10d=_0x4ed85e[_0x14c882]['function']?_['replace'](_0x33c75e[_0x4ed85e[_0x14c882][_0xa09b('0x7d')]],'%s',_0xeea10d):_0xeea10d;_0xeea10d=_0x4ed85e[_0x14c882]['format']?_[_0xa09b('0x7c')](_0x4773f5[_0x4ed85e[_0x14c882][_0xa09b('0x86')]],'%s',_0xeea10d):_0xeea10d;if(_0x4ed85e[_0x14c882][_0xa09b('0x7e')]){_0x45632d[_0xa09b('0x6e')](_0xeea10d);}_0x4ed85e[_0x14c882][_0xa09b('0x7f')]&&_0x45632d[_0xa09b('0x3c')](_0xeea10d,_0x4ed85e[_0x14c882][_0xa09b('0x7f')]===_0xa09b('0x80')?![]:!![]);_0x45632d['field'](_0xeea10d,_0x4ed85e[_0x14c882]['alias']||_0xeea10d);}if(_0x11695f[_0xa09b('0x82')]){_0x11695f[_0xa09b('0x82')]=JSON['parse'](_0x11695f[_0xa09b('0x82')]);for(var _0x26a850=0x0;_0x26a850<_0x11695f[_0xa09b('0x82')]['length'];_0x26a850+=0x1){if(_0x11695f[_0xa09b('0x82')][_0x26a850][_0xa09b('0x31')]&&_[_0xa09b('0x67')](_0x429aff,_0x11695f[_0xa09b('0x82')][_0x26a850][_0xa09b('0x31')])&&_0x11695f[_0xa09b('0x82')][_0x26a850][_0xa09b('0x84')]&&_0x11695f[_0xa09b('0x82')][_0x26a850]['foreignTable']&&_0x11695f[_0xa09b('0x82')][_0x26a850]['foreignKey']){_0x45632d[_0x11695f[_0xa09b('0x82')][_0x26a850][_0xa09b('0x31')]](_0x11695f[_0xa09b('0x82')][_0x26a850]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x11695f[_0xa09b('0x79')],_0x11695f[_0xa09b('0x82')][_0x26a850]['parentKey'],_0x11695f['joins'][_0x26a850][_0xa09b('0x85')],_0x11695f['joins'][_0x26a850]['foreignKey']));}}}if(_0x11695f[_0xa09b('0x88')]){_0x11695f[_0xa09b('0x88')]=JSON[_0xa09b('0x83')](_0x11695f[_0xa09b('0x88')]);_0x45632d['where'](_0x59313c(_0x11695f[_0xa09b('0x88')][_0xa09b('0x6e')]));}_0x158bdf=_0x45632d[_0xa09b('0xa7')]();_0x45632d[_0xa09b('0x20')](_0x3852fa);_0x45632d[_0xa09b('0x1e')](0x0);logger[_0xa09b('0x89')](_0xa09b('0xa8'),_0x45632d['toString']());return dbH['sequelize'][_0xa09b('0x33')](_0x45632d['toString'](),{'type':dbH['sequelize'][_0xa09b('0x8c')]['SELECT']});}})[_0xa09b('0x24')](function(){return{'sql':_0x158bdf['toString']()};})[_0xa09b('0x24')](respondWithResult(_0x14d844,null))[_0xa09b('0x48')](handleError(_0x14d844,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 4ef6857..f05cf5c 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 _0x35bc=['rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x35bc,0x10e));var _0xc35b=function(_0xcb0eb2,_0x3906bf){_0xcb0eb2=_0xcb0eb2-0x0;var _0xbab9b8=_0x35bc[_0xcb0eb2];return _0xbab9b8;};'use strict';var _=require(_0xc35b('0x0'));var util=require(_0xc35b('0x1'));var logger=require(_0xc35b('0x2'))(_0xc35b('0x3'));var moment=require(_0xc35b('0x4'));var BPromise=require('bluebird');var rp=require(_0xc35b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc35b('0x6'));var config=require(_0xc35b('0x7'));var attributes=require(_0xc35b('0x8'));module[_0xc35b('0x9')]=function(_0x5ee40b,_0x90f53a){return _0x5ee40b[_0xc35b('0xa')](_0xc35b('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfc5=['moment','request-promise','path','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','api'];(function(_0x30f9ed,_0x292d34){var _0x13dc35=function(_0x239060){while(--_0x239060){_0x30f9ed['push'](_0x30f9ed['shift']());}};_0x13dc35(++_0x292d34);}(_0xcfc5,0x1ac));var _0x5cfc=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xcfc5[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0x5cfc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5cfc('0x1'));var moment=require(_0x5cfc('0x2'));var BPromise=require('bluebird');var rp=require(_0x5cfc('0x3'));var fs=require('fs');var path=require(_0x5cfc('0x4'));var rimraf=require('rimraf');var config=require(_0x5cfc('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0x5cfc('0x6')]=function(_0x1c114c,_0x39961c){return _0x1c114c[_0x5cfc('0x7')](_0x5cfc('0x8'),attributes,{'tableName':_0x5cfc('0x9'),'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 c95912f..bdfe51f 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 _0xa11c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','moment','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa11c,0xa4));var _0xca11=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xa11c[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xca11('0x0'));var util=require(_0xca11('0x1'));var moment=require(_0xca11('0x2'));var BPromise=require('bluebird');var rs=require(_0xca11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca11('0x4'))['db'];var utils=require(_0xca11('0x5'));var logger=require(_0xca11('0x6'))(_0xca11('0x7'));var config=require(_0xca11('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca11('0x9')][_0xca11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3760f7,_0x11e38f,_0x93187d){return new BPromise(function(_0x2b94d2,_0x3b4bdf){return client['request'](_0x3760f7,_0x93187d)[_0xca11('0xb')](function(_0x50d763){logger[_0xca11('0xc')](_0xca11('0xd'),_0x11e38f,_0xca11('0xe'));logger[_0xca11('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x11e38f,_0xca11('0xe'),JSON[_0xca11('0x10')](_0x50d763));if(_0x50d763['error']){if(_0x50d763['error'][_0xca11('0x11')]===0x1f4){logger[_0xca11('0x12')](_0xca11('0xd'),_0x11e38f,_0x50d763[_0xca11('0x12')][_0xca11('0x13')]);return _0x3b4bdf(_0x50d763[_0xca11('0x12')][_0xca11('0x13')]);}logger['error'](_0xca11('0xd'),_0x11e38f,_0x50d763['error'][_0xca11('0x13')]);return _0x2b94d2(_0x50d763[_0xca11('0x12')]['message']);}else{logger['info'](_0xca11('0xd'),_0x11e38f,_0xca11('0xe'));_0x2b94d2(_0x50d763['result'][_0xca11('0x13')]);}})[_0xca11('0x14')](function(_0x4b04e9){logger[_0xca11('0x12')](_0xca11('0xd'),_0x11e38f,_0x4b04e9);_0x3b4bdf(_0x4b04e9);});});}
\ No newline at end of file
+var _0x3e2f=['info','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x545d7c,_0x2ed9e6){var _0x364159=function(_0x479da4){while(--_0x479da4){_0x545d7c['push'](_0x545d7c['shift']());}};_0x364159(++_0x2ed9e6);}(_0x3e2f,0x1df));var _0xf3e2=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0x3e2f[_0x1ee351];return _0x245aaf;};'use strict';var _=require('lodash');var util=require(_0xf3e2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3e2('0x1'));var db=require(_0xf3e2('0x2'))['db'];var utils=require(_0xf3e2('0x3'));var logger=require(_0xf3e2('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xddccad,_0x174128,_0x4819be){return new BPromise(function(_0x90e366,_0x254d80){return client['request'](_0xddccad,_0x4819be)[_0xf3e2('0x5')](function(_0xe31baa){logger['info'](_0xf3e2('0x6'),_0x174128,_0xf3e2('0x7'));logger[_0xf3e2('0x8')](_0xf3e2('0x9'),_0x174128,'request\x20sent',JSON[_0xf3e2('0xa')](_0xe31baa));if(_0xe31baa[_0xf3e2('0xb')]){if(_0xe31baa[_0xf3e2('0xb')][_0xf3e2('0xc')]===0x1f4){logger['error'](_0xf3e2('0x6'),_0x174128,_0xe31baa[_0xf3e2('0xb')][_0xf3e2('0xd')]);return _0x254d80(_0xe31baa[_0xf3e2('0xb')]['message']);}logger[_0xf3e2('0xb')](_0xf3e2('0x6'),_0x174128,_0xe31baa['error']['message']);return _0x90e366(_0xe31baa[_0xf3e2('0xb')][_0xf3e2('0xd')]);}else{logger[_0xf3e2('0xe')](_0xf3e2('0x6'),_0x174128,'request\x20sent');_0x90e366(_0xe31baa[_0xf3e2('0xf')][_0xf3e2('0xd')]);}})[_0xf3e2('0x10')](function(_0x224720){logger[_0xf3e2('0xb')](_0xf3e2('0x6'),_0x174128,_0x224720);_0x254d80(_0x224720);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 5886df0..a65040d 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 _0x2976=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','query','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0xbbcada,_0x341b04){var _0x4f51de=function(_0x508d6c){while(--_0x508d6c){_0xbbcada['push'](_0xbbcada['shift']());}};_0x4f51de(++_0x341b04);}(_0x2976,0x1d5));var _0x6297=function(_0x1255d8,_0xb523fd){_0x1255d8=_0x1255d8-0x0;var _0x34ad49=_0x2976[_0x1255d8];return _0x34ad49;};'use strict';var multer=require(_0x6297('0x0'));var util=require(_0x6297('0x1'));var path=require(_0x6297('0x2'));var timeout=require(_0x6297('0x3'));var express=require('express');var router=express[_0x6297('0x4')]();var fs_extra=require(_0x6297('0x5'));var auth=require(_0x6297('0x6'));var interaction=require(_0x6297('0x7'));var config=require(_0x6297('0x8'));var controller=require(_0x6297('0x9'));router[_0x6297('0xa')]('/',auth['isAuthenticated'](),controller[_0x6297('0xb')]);router['get'](_0x6297('0xc'),auth[_0x6297('0xd')](),controller[_0x6297('0xe')]);router[_0x6297('0xa')](_0x6297('0xf'),auth[_0x6297('0xd')](),controller[_0x6297('0x10')]);router[_0x6297('0xa')](_0x6297('0x11'),auth['isAuthenticated'](),controller['run']);router[_0x6297('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0x6297('0x12')]);router[_0x6297('0x13')]('/',auth['isAuthenticated'](),controller[_0x6297('0x14')]);router['put'](_0x6297('0xc'),auth[_0x6297('0xd')](),controller[_0x6297('0x15')]);router[_0x6297('0x16')]('/:id',auth[_0x6297('0xd')](),controller[_0x6297('0x17')]);module[_0x6297('0x18')]=router;
\ No newline at end of file
+var _0x56c2=['./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x47abbc,_0x5a8c7a){var _0x55a157=function(_0x1e3f32){while(--_0x1e3f32){_0x47abbc['push'](_0x47abbc['shift']());}};_0x55a157(++_0x5a8c7a);}(_0x56c2,0xe1));var _0x256c=function(_0x5eaae7,_0x577c09){_0x5eaae7=_0x5eaae7-0x0;var _0x591743=_0x56c2[_0x5eaae7];return _0x591743;};'use strict';var multer=require(_0x256c('0x0'));var util=require(_0x256c('0x1'));var path=require(_0x256c('0x2'));var timeout=require(_0x256c('0x3'));var express=require(_0x256c('0x4'));var router=express['Router']();var fs_extra=require(_0x256c('0x5'));var auth=require(_0x256c('0x6'));var interaction=require(_0x256c('0x7'));var config=require(_0x256c('0x8'));var controller=require(_0x256c('0x9'));router[_0x256c('0xa')]('/',auth[_0x256c('0xb')](),controller[_0x256c('0xc')]);router[_0x256c('0xa')](_0x256c('0xd'),auth[_0x256c('0xb')](),controller[_0x256c('0xe')]);router[_0x256c('0xa')](_0x256c('0xf'),auth[_0x256c('0xb')](),controller[_0x256c('0x10')]);router[_0x256c('0xa')](_0x256c('0x11'),auth['isAuthenticated'](),controller[_0x256c('0x12')]);router[_0x256c('0xa')](_0x256c('0x13'),auth[_0x256c('0xb')](),controller[_0x256c('0x14')]);router[_0x256c('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x256c('0x16')](_0x256c('0xd'),auth[_0x256c('0xb')](),controller['update']);router[_0x256c('0x17')]('/:id',auth[_0x256c('0xb')](),controller[_0x256c('0x18')]);module[_0x256c('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index fe3d8d9..a014092 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x46ed,0x168));var _0xd46e=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x46ed[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0x5c8643,_0x4f7c4d){var _0x546259=function(_0x2e1d6e){while(--_0x2e1d6e){_0x5c8643['push'](_0x5c8643['shift']());}};_0x546259(++_0x4f7c4d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 25666bf..3248dad 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabce[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));};
\ No newline at end of file
+var _0x2542=['getFields','ValidationErrorItem','metric','format','DESC','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','sequelize','SELECT','run','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','save','destroy','then','get','end','error','stack','name','send','index','map','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','field','replace','function','groupBy','orderBy','alias','parse','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','value'];(function(_0x366280,_0x4e0c44){var _0x213351=function(_0x1f2ec1){while(--_0x1f2ec1){_0x366280['push'](_0x366280['shift']());}};_0x213351(++_0x4e0c44);}(_0x2542,0x169));var _0x2254=function(_0x3c4e73,_0x1a5a6b){_0x3c4e73=_0x3c4e73-0x0;var _0x1dc209=_0x2542[_0x3c4e73];return _0x1dc209;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];var dbH=require(_0x2254('0x19'))[_0x2254('0x1a')];function respondWithStatusCode(_0x3c326b,_0x381efe){_0x381efe=_0x381efe||0xcc;return function(_0x592a4f){if(_0x592a4f){return _0x3c326b[_0x2254('0x1b')](_0x381efe);}return _0x3c326b[_0x2254('0x1c')](_0x381efe)['end']();};}function respondWithResult(_0x2f4de,_0x1e582d){_0x1e582d=_0x1e582d||0xc8;return function(_0xfb23cb){if(_0xfb23cb){return _0x2f4de[_0x2254('0x1c')](_0x1e582d)[_0x2254('0x1d')](_0xfb23cb);}};}function respondWithFilteredResult(_0xbc5548,_0x50f137){return function(_0x18baf4){if(_0x18baf4){var _0x57247a=typeof _0x50f137[_0x2254('0x1e')]===_0x2254('0x1f')&&typeof _0x50f137[_0x2254('0x20')]===_0x2254('0x1f');var _0x1ae11e=_0x18baf4[_0x2254('0x21')];var _0x497724=_0x57247a?0x0:_0x50f137['offset'];var _0x5ec98d=_0x57247a?_0x18baf4[_0x2254('0x21')]:_0x50f137[_0x2254('0x1e')]+_0x50f137[_0x2254('0x20')];var _0x1f1163;if(_0x5ec98d>=_0x1ae11e){_0x5ec98d=_0x1ae11e;_0x1f1163=0xc8;}else{_0x1f1163=0xce;}_0xbc5548[_0x2254('0x1c')](_0x1f1163);return _0xbc5548[_0x2254('0x22')]('Content-Range',_0x497724+'-'+_0x5ec98d+'/'+_0x1ae11e)[_0x2254('0x1d')](_0x18baf4);}return null;};}function patchUpdates(_0x16148d){return function(_0x906cde){try{jsonpatch['apply'](_0x906cde,_0x16148d,!![]);}catch(_0x52fedc){return BPromise['reject'](_0x52fedc);}return _0x906cde[_0x2254('0x23')]();};}function saveUpdates(_0x559af4,_0xf88b56){return function(_0x56b91e){if(_0x56b91e){return _0x56b91e['update'](_0x559af4)['then'](function(_0x540020){return _0x540020;});}return null;};}function removeEntity(_0x5e5edb,_0x4f797d){return function(_0x1aa71f){if(_0x1aa71f){return _0x1aa71f[_0x2254('0x24')]()[_0x2254('0x25')](function(){var _0x265467=_0x1aa71f[_0x2254('0x26')]({'plain':!![]});var _0x1349c9='DefaultReports';return db['UserProfileResource'][_0x2254('0x24')]({'where':{'type':_0x1349c9,'resourceId':_0x265467['id']}})['then'](function(){return _0x1aa71f;});})[_0x2254('0x25')](function(){_0x5e5edb[_0x2254('0x1c')](0xcc)[_0x2254('0x27')]();});}};}function handleEntityNotFound(_0x3aa0bd,_0x19043b){return function(_0x482688){if(!_0x482688){_0x3aa0bd[_0x2254('0x1b')](0x194);}return _0x482688;};}function handleError(_0x2a789b,_0x21285d){_0x21285d=_0x21285d||0x1f4;return function(_0x37af8b){logger[_0x2254('0x28')](_0x37af8b[_0x2254('0x29')]);if(_0x37af8b[_0x2254('0x2a')]){delete _0x37af8b[_0x2254('0x2a')];}_0x2a789b[_0x2254('0x1c')](_0x21285d)[_0x2254('0x2b')](_0x37af8b);};}exports[_0x2254('0x2c')]=function(_0xad7774,_0x220f2a){var _0x27d30a={},_0x4577f4={},_0x1b16c8={'count':0x0,'rows':[]};var _0x2c929f=_[_0x2254('0x2d')](db[_0x2254('0x2e')]['rawAttributes'],function(_0xe29526){return{'name':_0xe29526[_0x2254('0x2f')],'type':_0xe29526[_0x2254('0x30')][_0x2254('0x31')]};});_0x4577f4[_0x2254('0x32')]=_[_0x2254('0x2d')](_0x2c929f,_0x2254('0x2a'));_0x4577f4[_0x2254('0x33')]=_[_0x2254('0x34')](_0xad7774['query']);_0x4577f4[_0x2254('0x35')]=_[_0x2254('0x36')](_0x4577f4['model'],_0x4577f4[_0x2254('0x33')]);_0x27d30a[_0x2254('0x37')]=_[_0x2254('0x36')](_0x4577f4[_0x2254('0x32')],qs['fields'](_0xad7774['query'][_0x2254('0x38')]));_0x27d30a['attributes']=_0x27d30a[_0x2254('0x37')][_0x2254('0x39')]?_0x27d30a[_0x2254('0x37')]:_0x4577f4[_0x2254('0x32')];if(!_0xad7774[_0x2254('0x33')][_0x2254('0x3a')](_0x2254('0x3b'))){_0x27d30a['limit']=qs[_0x2254('0x20')](_0xad7774[_0x2254('0x33')][_0x2254('0x20')]);_0x27d30a[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0xad7774[_0x2254('0x33')][_0x2254('0x1e')]);}_0x27d30a[_0x2254('0x3c')]=qs[_0x2254('0x3d')](_0xad7774[_0x2254('0x33')]['sort']);_0x27d30a[_0x2254('0x3e')]=qs[_0x2254('0x35')](_[_0x2254('0x3f')](_0xad7774[_0x2254('0x33')],_0x4577f4['filters']),_0x2c929f);if(_0xad7774[_0x2254('0x33')][_0x2254('0x40')]){_0x27d30a[_0x2254('0x3e')]=_[_0x2254('0x41')](_0x27d30a[_0x2254('0x3e')],{'$or':_[_0x2254('0x2d')](_0x2c929f,function(_0x423377){if(_0x423377[_0x2254('0x30')]!=='VIRTUAL'){var _0x362ad1={};_0x362ad1[_0x423377['name']]={'$like':'%'+_0xad7774[_0x2254('0x33')][_0x2254('0x40')]+'%'};return _0x362ad1;}})});}_0x27d30a=_[_0x2254('0x41')]({},_0x27d30a,_0xad7774[_0x2254('0x42')]);var _0x460bb3={'where':_0x27d30a[_0x2254('0x3e')]};return db[_0x2254('0x2e')]['count'](_0x460bb3)[_0x2254('0x25')](function(_0x2f1ff9){_0x1b16c8[_0x2254('0x21')]=_0x2f1ff9;if(_0xad7774[_0x2254('0x33')][_0x2254('0x43')]){_0x27d30a['include']=[{'all':!![]}];}return db[_0x2254('0x2e')][_0x2254('0x44')](_0x27d30a);})[_0x2254('0x25')](function(_0x135ed8){_0x1b16c8[_0x2254('0x45')]=_0x135ed8;return _0x1b16c8;})['then'](respondWithFilteredResult(_0x220f2a,_0x27d30a))[_0x2254('0x46')](handleError(_0x220f2a,null));};exports['show']=function(_0x91e091,_0x1ded9a){var _0xb4d042={'raw':!![],'where':{'id':_0x91e091[_0x2254('0x47')]['id']}},_0x31c31e={};_0x31c31e[_0x2254('0x32')]=_[_0x2254('0x34')](db[_0x2254('0x2e')][_0x2254('0x48')]);_0x31c31e[_0x2254('0x33')]=_[_0x2254('0x34')](_0x91e091[_0x2254('0x33')]);_0x31c31e[_0x2254('0x35')]=_['intersection'](_0x31c31e[_0x2254('0x32')],_0x31c31e[_0x2254('0x33')]);_0xb4d042[_0x2254('0x37')]=_['intersection'](_0x31c31e[_0x2254('0x32')],qs[_0x2254('0x38')](_0x91e091[_0x2254('0x33')][_0x2254('0x38')]));_0xb4d042[_0x2254('0x37')]=_0xb4d042[_0x2254('0x37')][_0x2254('0x39')]?_0xb4d042[_0x2254('0x37')]:_0x31c31e[_0x2254('0x32')];if(_0x91e091['query'][_0x2254('0x43')]){_0xb4d042[_0x2254('0x49')]=[{'all':!![]}];}_0xb4d042=_[_0x2254('0x41')]({},_0xb4d042,_0x91e091[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0xb4d042)[_0x2254('0x25')](handleEntityNotFound(_0x1ded9a,null))[_0x2254('0x25')](respondWithResult(_0x1ded9a,null))[_0x2254('0x46')](handleError(_0x1ded9a,null));};exports[_0x2254('0x4b')]=function(_0x5b14c5,_0x36b977){return db[_0x2254('0x2e')]['create'](_0x5b14c5[_0x2254('0x4c')],{})[_0x2254('0x25')](function(_0x12e2ff){var _0x4331a9=_0x5b14c5['user'][_0x2254('0x26')]({'plain':!![]});if(!_0x4331a9)throw new Error(_0x2254('0x4d'));if(_0x4331a9['role']===_0x2254('0x4e')){var _0x3f0670=_0x12e2ff[_0x2254('0x26')]({'plain':!![]});var _0x43bb88='Reports';return db[_0x2254('0x4f')][_0x2254('0x4a')]({'where':{'name':_0x43bb88,'userProfileId':_0x4331a9[_0x2254('0x50')]},'raw':!![]})['then'](function(_0x4cc18a){if(_0x4cc18a&&_0x4cc18a[_0x2254('0x51')]===0x0){return db[_0x2254('0x52')]['create']({'name':_0x3f0670[_0x2254('0x2a')],'resourceId':_0x3f0670['id'],'type':'DefaultReports','sectionId':_0x4cc18a['id']},{})['then'](function(){return _0x12e2ff;});}else{return _0x12e2ff;}})[_0x2254('0x46')](function(_0x135962){logger[_0x2254('0x28')](_0x2254('0x53'),_0x135962);throw _0x135962;});}return _0x12e2ff;})[_0x2254('0x25')](respondWithResult(_0x36b977,0xc9))['catch'](handleError(_0x36b977,null));};exports['update']=function(_0x1bd988,_0x5e3fbc){if(_0x1bd988[_0x2254('0x4c')]['id']){delete _0x1bd988[_0x2254('0x4c')]['id'];}return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x1bd988['params']['id']}})[_0x2254('0x25')](handleEntityNotFound(_0x5e3fbc,null))[_0x2254('0x25')](saveUpdates(_0x1bd988['body'],null))['then'](respondWithResult(_0x5e3fbc,null))[_0x2254('0x46')](handleError(_0x5e3fbc,null));};exports['destroy']=function(_0x2cc59c,_0x305ace){return db[_0x2254('0x2e')][_0x2254('0x4a')]({'where':{'id':_0x2cc59c[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x305ace,null))['then'](removeEntity(_0x305ace,null))[_0x2254('0x46')](handleError(_0x305ace,null));};exports['preview']=function(_0x335c66,_0x510fe0){var _0x4da493=0xa;var _0x5999c8=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x13606e={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':_0x2254('0x5b'),'MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f391d={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x329378=function(_0xae171c){return!_[_0x2254('0x65')]([_0x2254('0x66'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2254('0x67')],_0xae171c);};var _0x423c17=function(_0x1d73a3){if(!_0x1d73a3||!_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x53b55b='(',_0x45b7bd=0x0;_0x45b7bd<_0x1d73a3[_0x2254('0x68')][_0x2254('0x39')];_0x45b7bd+=0x1){_0x45b7bd>0x0&&(_0x53b55b+='\x20'+_0x1d73a3['operator']+'\x20');_0x53b55b+=_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]?_0x423c17(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x69')]):_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['field']+'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd][_0x2254('0x6a')]+(_0x329378(_0x1d73a3['rules'][_0x45b7bd][_0x2254('0x6a')])?'\x20'+_0x1d73a3[_0x2254('0x68')][_0x45b7bd]['value']:'');}return _0x53b55b+')';};var _0x5cc6bd={'where':{'id':_0x335c66['params']['id']}},_0xde4e7,_0xa159a4,_0x486b82,_0x506d95,_0x48406e;_0x5cc6bd=_[_0x2254('0x41')]({},_0x5cc6bd,_0x335c66['options']);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x5cc6bd)[_0x2254('0x25')](function(_0x1ed6b9){if(_0x1ed6b9){_0xde4e7=_0x1ed6b9;return _0x1ed6b9['getFields']();}return null;})[_0x2254('0x25')](function(_0x5ecf82){if(_0x5ecf82){if(!_0x5ecf82[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xa159a4=_0x5ecf82;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x3b3b20){if(_0x3b3b20){_0x486b82=_[_0x2254('0x6e')](_0x3b3b20,'id');var _0x3cefbe;var _0x4f77e5=squel[_0x2254('0x6f')]();_0x4f77e5[_0x2254('0x70')](_0xde4e7['table']);for(var _0x1ac8ff=0x0;_0x1ac8ff<_0xa159a4[_0x2254('0x39')];_0x1ac8ff+=0x1){_0x3cefbe=_0xa159a4[_0x1ac8ff]['MetricId']?_0x486b82[_0xa159a4[_0x1ac8ff][_0x2254('0x71')]]['metric']:_0xa159a4[_0x1ac8ff][_0x2254('0x72')];_0x3cefbe=_0xa159a4[_0x1ac8ff]['function']?_[_0x2254('0x73')](_0x13606e[_0xa159a4[_0x1ac8ff][_0x2254('0x74')]],'%s',_0x3cefbe):_0x3cefbe;_0x3cefbe=_0xa159a4[_0x1ac8ff]['format']?_[_0x2254('0x73')](_0x2f391d[_0xa159a4[_0x1ac8ff]['format']],'%s',_0x3cefbe):_0x3cefbe;if(_0xa159a4[_0x1ac8ff][_0x2254('0x75')]){_0x4f77e5[_0x2254('0x69')](_0x3cefbe);}_0xa159a4[_0x1ac8ff][_0x2254('0x76')]&&_0x4f77e5['order'](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x76')]==='DESC'?![]:!![]);_0x4f77e5[_0x2254('0x72')](_0x3cefbe,_0xa159a4[_0x1ac8ff][_0x2254('0x77')]||_0x3cefbe);}if(_0xde4e7['joins']){_0xde4e7['joins']=JSON[_0x2254('0x78')](_0xde4e7[_0x2254('0x79')]);for(var _0x451520=0x0;_0x451520<_0xde4e7[_0x2254('0x79')]['length'];_0x451520+=0x1){if(_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x5999c8,_0xde4e7[_0x2254('0x79')][_0x451520]['type'])&&_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7a')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7b')]&&_0xde4e7['joins'][_0x451520][_0x2254('0x7c')]){_0x4f77e5[_0xde4e7['joins'][_0x451520]['type']](_0xde4e7['joins'][_0x451520][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0xde4e7[_0x2254('0x7e')],_0xde4e7['joins'][_0x451520][_0x2254('0x7a')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7b')],_0xde4e7[_0x2254('0x79')][_0x451520][_0x2254('0x7c')]));}}}if(_0xde4e7[_0x2254('0x7f')]){_0xde4e7['conditions']=JSON['parse'](_0xde4e7[_0x2254('0x7f')]);_0x4f77e5[_0x2254('0x3e')](_0x423c17(_0xde4e7[_0x2254('0x7f')][_0x2254('0x69')]));}_0x48406e=_0x4f77e5[_0x2254('0x80')]();_0x4f77e5[_0x2254('0x20')](_0x4da493);_0x4f77e5[_0x2254('0x1e')](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4f77e5[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4f77e5[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')]['SELECT']});}})[_0x2254('0x25')](respondWithResult(_0x510fe0,null))[_0x2254('0x46')](handleError(_0x510fe0,null));};function runReport(_0x4dfcb4,_0x1c317b,_0x4e699c){var _0x2ad519=_0x1c317b[_0x2254('0x2a')];var _0x30f2c9=0xa;var _0x1f7a48=['join',_0x2254('0x55'),_0x2254('0x56'),_0x2254('0x57')];var _0x3a8d4f={'SUM':'SUM(%s)','COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2254('0x60')};var _0x2f3650={'SEC_TO_TIME':_0x2254('0x61'),'DATE':_0x2254('0x62'),'HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x251d70=function(_0x2c7705){return!_['includes']([_0x2254('0x66'),'IS\x20NOT\x20NULL',_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x2c7705);};var _0x36d121=function(_0x207a09){if(!_0x207a09||!_0x207a09[_0x2254('0x68')]['length']){return'';}for(var _0x8a3656='(',_0x1554f1=0x0;_0x1554f1<_0x207a09[_0x2254('0x68')][_0x2254('0x39')];_0x1554f1+=0x1){_0x1554f1>0x0&&(_0x8a3656+='\x20'+_0x207a09[_0x2254('0x87')]+'\x20');_0x8a3656+=_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]?_0x36d121(_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x69')]):_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x72')]+'\x20'+_0x207a09[_0x2254('0x68')][_0x1554f1][_0x2254('0x6a')]+(_0x251d70(_0x207a09['rules'][_0x1554f1][_0x2254('0x6a')])?'\x20'+_0x207a09['rules'][_0x1554f1][_0x2254('0x88')]:'');}return _0x8a3656+')';};var _0xb98b40={'where':{'id':_0x4dfcb4['id']}},_0x3b1d5c,_0x2c907a,_0x23b78c,_0x2b5dba,_0x30307a;_0xb98b40=_['merge']({},_0xb98b40,_0x4e699c);return db[_0x2254('0x2e')]['find'](_0xb98b40)[_0x2254('0x25')](function(_0x52712d){if(_0x52712d){_0x3b1d5c=_0x52712d;return _0x52712d[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x1d0c8f){if(_0x1d0c8f){if(!_0x1d0c8f['length']){throw new db[(_0x2254('0x6b'))][(_0x2254('0x8a'))](_0x2254('0x6c'),0x193);}_0x2c907a=_0x1d0c8f;return db[_0x2254('0x6d')][_0x2254('0x44')]({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x34185c){if(_0x34185c){_0x23b78c=_[_0x2254('0x6e')](_0x34185c,'id');var _0x5e94b6;var _0x56239e=squel[_0x2254('0x6f')]();_0x56239e['from'](_0x3b1d5c[_0x2254('0x7e')]);for(var _0x3a1365=0x0;_0x3a1365<_0x2c907a[_0x2254('0x39')];_0x3a1365+=0x1){_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x71')]?_0x23b78c[_0x2c907a[_0x3a1365][_0x2254('0x71')]][_0x2254('0x8b')]:_0x2c907a[_0x3a1365][_0x2254('0x72')];_0x5e94b6=_0x2c907a[_0x3a1365]['function']?_[_0x2254('0x73')](_0x3a8d4f[_0x2c907a[_0x3a1365][_0x2254('0x74')]],'%s',_0x5e94b6):_0x5e94b6;_0x5e94b6=_0x2c907a[_0x3a1365][_0x2254('0x8c')]?_['replace'](_0x2f3650[_0x2c907a[_0x3a1365][_0x2254('0x8c')]],'%s',_0x5e94b6):_0x5e94b6;if(_0x2c907a[_0x3a1365][_0x2254('0x75')]){_0x56239e[_0x2254('0x69')](_0x5e94b6);}_0x2c907a[_0x3a1365][_0x2254('0x76')]&&_0x56239e[_0x2254('0x3c')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x56239e[_0x2254('0x72')](_0x5e94b6,_0x2c907a[_0x3a1365][_0x2254('0x77')]||_0x5e94b6);}if(_0x3b1d5c['joins']){_0x3b1d5c[_0x2254('0x79')]=JSON[_0x2254('0x78')](_0x3b1d5c['joins']);for(var _0x4cec5b=0x0;_0x4cec5b<_0x3b1d5c[_0x2254('0x79')]['length'];_0x4cec5b+=0x1){if(_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]&&_[_0x2254('0x65')](_0x1f7a48,_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')])&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7a')]&&_0x3b1d5c[_0x2254('0x79')][_0x4cec5b]['foreignTable']&&_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7c')]){_0x56239e[_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x30')]](_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3b1d5c[_0x2254('0x7e')],_0x3b1d5c['joins'][_0x4cec5b][_0x2254('0x7a')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7b')],_0x3b1d5c[_0x2254('0x79')][_0x4cec5b][_0x2254('0x7c')]));}}}if(_0x3b1d5c[_0x2254('0x7f')]){_0x3b1d5c[_0x2254('0x7f')]=JSON['parse'](_0x3b1d5c[_0x2254('0x7f')]);_0x56239e[_0x2254('0x3e')](_0x36d121(_0x3b1d5c['conditions'][_0x2254('0x69')]));}_0x30307a=_0x56239e[_0x2254('0x80')]();_0x56239e[_0x2254('0x20')](_0x30f2c9);_0x56239e[_0x2254('0x1e')](0x0);return;}})[_0x2254('0x25')](function(){if(_0x1c317b[_0x2254('0x8e')]===_0x2254('0x8f')){return null;}var _0x38e2df=_[_0x2254('0x41')](_0x1c317b,{'name':_0x1c317b[_0x2254('0x90')]||_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c['name'],'basename':_0x2ad519,'savename':util[_0x2254('0x8c')](_0x2254('0x91'),_0x1c317b[_0x2254('0x2a')]||_0x3b1d5c[_0x2254('0x2a')],require(_0x2254('0x92'))[_0x2254('0x93')](0x4),_0x1c317b[_0x2254('0x8e')]||'csv'),'reportId':_0x3b1d5c['id'],'reportType':_0x2254('0x94')});return db[_0x2254('0x95')][_0x2254('0x4b')](_0x38e2df,{'raw':!![]});})['then'](function(_0x60f5ac){if(_0x3b1d5c[_0x2254('0x7e')]===_0x2254('0x96')){_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x97'),_0x1c317b['startDate'],_0x1c317b[_0x2254('0x98')]);}else{_0x30307a[_0x2254('0x3e')](_0x3b1d5c[_0x2254('0x7e')]+_0x2254('0x99'),_0x1c317b[_0x2254('0x9a')],_0x1c317b['endDate']);}if(_0x60f5ac){logger['info'](_0x2254('0x9b'),_0x30307a['toString']());require(_0x2254('0x9c'))[_0x2254('0x9d')](path[_0x2254('0x54')](__dirname,_0x2254('0x9e'),_0x60f5ac[_0x2254('0x8e')]),[_0x60f5ac['id'],_0x30307a[_0x2254('0x83')](),path['join'](__dirname,'../../files/reports',_0x60f5ac[_0x2254('0x9f')]),_0x2ad519]);return _0x60f5ac;}else{var _0x3317d4=squel[_0x2254('0x6f')]();_0x3317d4[_0x2254('0x70')]('('+_0x30307a['toString']()+')',_0x2254('0xa0'));_0x3317d4[_0x2254('0x72')](_0x2254('0xa1'),_0x2254('0x21'));_0x30307a[_0x2254('0x20')](_0x1c317b[_0x2254('0x20')]||_0x30f2c9);_0x30307a[_0x2254('0x1e')](_0x1c317b[_0x2254('0x1e')]||0x0);return dbH[_0x2254('0xa2')]['query'](_0x3317d4[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')]['SELECT']})[_0x2254('0x25')](function(_0xe38a28){if(!_0xe38a28[_0x2254('0x39')]){_0x2b5dba=0x0;}else{_0x2b5dba=_0xe38a28[0x0]['count']||0x0;}return dbH['sequelize'][_0x2254('0x33')](_0x30307a[_0x2254('0x83')](),{'type':dbH[_0x2254('0xa2')][_0x2254('0x84')][_0x2254('0xa3')]});})[_0x2254('0x25')](function(_0x4011de){return{'rows':_0x4011de||[],'count':_0x2b5dba};});}});}exports[_0x2254('0xa4')]=function(_0x5cb3d1,_0x1d8238){return runReport(_0x5cb3d1[_0x2254('0x47')],_0x5cb3d1[_0x2254('0x33')],_0x5cb3d1[_0x2254('0x42')])[_0x2254('0x25')](respondWithResult(_0x1d8238,null))[_0x2254('0x46')](handleError(_0x1d8238,null));};exports['runReport']=runReport;exports['query']=function(_0x40339d,_0x4b3b96){var _0x59b8af=0xa;var _0x408695=[_0x2254('0x54'),_0x2254('0x55'),_0x2254('0x56'),'cross_join'];var _0x596eae={'SUM':_0x2254('0x58'),'COUNT':_0x2254('0x59'),'COUNT DISTINCT':_0x2254('0x5a'),'MAX':'MAX(%s)','MIN':_0x2254('0x5c'),'AVG':_0x2254('0x5d'),'GROUP_CONCAT':_0x2254('0x5e'),'GROUP_CONCAT ASC':_0x2254('0x5f'),'GROUP_CONCAT DESC':_0x2254('0x60')};var _0x739a29={'SEC_TO_TIME':_0x2254('0x61'),'DATE':'DATE(%s)','HOUR':_0x2254('0x63'),'ROUND':_0x2254('0x64'),'UNIX_TIMESTAMP':_0x2254('0x85')};var _0x243466=function(_0x1b8587){return!_[_0x2254('0x65')]([_0x2254('0x66'),_0x2254('0xa5'),_0x2254('0x86'),'IS\x20NOT\x20EMPTY'],_0x1b8587);};var _0xbec5d0=function(_0x18f841){if(!_0x18f841||!_0x18f841[_0x2254('0x68')][_0x2254('0x39')]){return'';}for(var _0x275b56='(',_0x315add=0x0;_0x315add<_0x18f841['rules']['length'];_0x315add+=0x1){_0x315add>0x0&&(_0x275b56+='\x20'+_0x18f841[_0x2254('0x87')]+'\x20');_0x275b56+=_0x18f841['rules'][_0x315add][_0x2254('0x69')]?_0xbec5d0(_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x69')]):_0x18f841[_0x2254('0x68')][_0x315add]['field']+'\x20'+_0x18f841[_0x2254('0x68')][_0x315add][_0x2254('0x6a')]+(_0x243466(_0x18f841[_0x2254('0x68')][_0x315add]['condition'])?'\x20'+_0x18f841['rules'][_0x315add][_0x2254('0x88')]:'');}return _0x275b56+')';};var _0x51b02a={'where':{'id':_0x40339d[_0x2254('0x47')]['id']}},_0x3e7642,_0xe1abb6,_0x1a44d0,_0x4af6a7,_0x539aba;_0x51b02a=_[_0x2254('0x41')]({},_0x51b02a,_0x40339d[_0x2254('0x42')]);return db[_0x2254('0x2e')][_0x2254('0x4a')](_0x51b02a)['then'](function(_0x34e28b){if(_0x34e28b){_0x3e7642=_0x34e28b;return _0x34e28b[_0x2254('0x89')]();}return null;})[_0x2254('0x25')](function(_0x5d373){if(_0x5d373){if(!_0x5d373[_0x2254('0x39')]){throw new db[(_0x2254('0x6b'))]['ValidationErrorItem'](_0x2254('0x6c'),0x193);}_0xe1abb6=_0x5d373;return db[_0x2254('0x6d')]['findAll']({'raw':!![]});}return null;})[_0x2254('0x25')](function(_0x56a7ce){if(_0x56a7ce){_0x1a44d0=_[_0x2254('0x6e')](_0x56a7ce,'id');var _0x34bf19;var _0x4965c7=squel[_0x2254('0x6f')]();_0x4965c7[_0x2254('0x70')](_0x3e7642[_0x2254('0x7e')]);for(var _0x45541b=0x0;_0x45541b<_0xe1abb6[_0x2254('0x39')];_0x45541b+=0x1){_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x71')]?_0x1a44d0[_0xe1abb6[_0x45541b][_0x2254('0x71')]][_0x2254('0x8b')]:_0xe1abb6[_0x45541b][_0x2254('0x72')];_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x74')]?_[_0x2254('0x73')](_0x596eae[_0xe1abb6[_0x45541b][_0x2254('0x74')]],'%s',_0x34bf19):_0x34bf19;_0x34bf19=_0xe1abb6[_0x45541b][_0x2254('0x8c')]?_[_0x2254('0x73')](_0x739a29[_0xe1abb6[_0x45541b]['format']],'%s',_0x34bf19):_0x34bf19;if(_0xe1abb6[_0x45541b][_0x2254('0x75')]){_0x4965c7[_0x2254('0x69')](_0x34bf19);}_0xe1abb6[_0x45541b]['orderBy']&&_0x4965c7['order'](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x76')]===_0x2254('0x8d')?![]:!![]);_0x4965c7[_0x2254('0x72')](_0x34bf19,_0xe1abb6[_0x45541b][_0x2254('0x77')]||_0x34bf19);}if(_0x3e7642['joins']){_0x3e7642[_0x2254('0x79')]=JSON['parse'](_0x3e7642['joins']);for(var _0x40fec0=0x0;_0x40fec0<_0x3e7642[_0x2254('0x79')][_0x2254('0x39')];_0x40fec0+=0x1){if(_0x3e7642[_0x2254('0x79')][_0x40fec0]['type']&&_[_0x2254('0x65')](_0x408695,_0x3e7642['joins'][_0x40fec0][_0x2254('0x30')])&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')]&&_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]){_0x4965c7[_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x30')]](_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],null,util['format'](_0x2254('0x7d'),_0x3e7642[_0x2254('0x7e')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7a')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7b')],_0x3e7642[_0x2254('0x79')][_0x40fec0][_0x2254('0x7c')]));}}}if(_0x3e7642['conditions']){_0x3e7642[_0x2254('0x7f')]=JSON[_0x2254('0x78')](_0x3e7642[_0x2254('0x7f')]);_0x4965c7[_0x2254('0x3e')](_0xbec5d0(_0x3e7642[_0x2254('0x7f')]['group']));}_0x539aba=_0x4965c7[_0x2254('0x80')]();_0x4965c7[_0x2254('0x20')](_0x59b8af);_0x4965c7['offset'](0x0);logger[_0x2254('0x81')](_0x2254('0x82'),_0x4965c7[_0x2254('0x83')]());return dbH['sequelize'][_0x2254('0x33')](_0x4965c7[_0x2254('0x83')](),{'type':dbH['sequelize'][_0x2254('0x84')][_0x2254('0xa3')]});}})[_0x2254('0x25')](function(){return{'sql':_0x539aba[_0x2254('0x83')]()};})['then'](respondWithResult(_0x4b3b96,null))[_0x2254('0x46')](handleError(_0x4b3b96,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index a8a3ad0..9d14d3e 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 _0x0eaf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','analytics_default_reports','lodash','util'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x0eaf,0x143));var _0xf0ea=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0eaf[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xf0ea('0x0'));var util=require(_0xf0ea('0x1'));var logger=require(_0xf0ea('0x2'))(_0xf0ea('0x3'));var moment=require(_0xf0ea('0x4'));var BPromise=require(_0xf0ea('0x5'));var rp=require(_0xf0ea('0x6'));var fs=require('fs');var path=require(_0xf0ea('0x7'));var rimraf=require(_0xf0ea('0x8'));var config=require(_0xf0ea('0x9'));var attributes=require(_0xf0ea('0xa'));module['exports']=function(_0x5aea5e,_0x469183){return _0x5aea5e[_0xf0ea('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0xf0ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc0e7=['bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','lodash','../../config/logger'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xc0e7,0xd0));var _0x7c0e=function(_0x1178a5,_0x316ffe){_0x1178a5=_0x1178a5-0x0;var _0x3df8c7=_0xc0e7[_0x1178a5];return _0x3df8c7;};'use strict';var _=require(_0x7c0e('0x0'));var util=require('util');var logger=require(_0x7c0e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7c0e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7c0e('0x3'));var config=require(_0x7c0e('0x4'));var attributes=require(_0x7c0e('0x5'));module[_0x7c0e('0x6')]=function(_0x49f0aa,_0x17493e){return _0x49f0aa['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 30628e8..20fcfc5 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 _0x3548=['AnalyticDefaultReport,\x20%s,\x20%s','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','message','result'];(function(_0x1a205d,_0x4c54f0){var _0xd32727=function(_0x3b3bc4){while(--_0x3b3bc4){_0x1a205d['push'](_0x1a205d['shift']());}};_0xd32727(++_0x4c54f0);}(_0x3548,0x10f));var _0x8354=function(_0x518461,_0x59c0bd){_0x518461=_0x518461-0x0;var _0x457a1c=_0x3548[_0x518461];return _0x457a1c;};'use strict';var _=require(_0x8354('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8354('0x1'));var rs=require(_0x8354('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8354('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8354('0x4'))('rpc');var config=require(_0x8354('0x5'));var jayson=require(_0x8354('0x6'));var client=jayson[_0x8354('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5958b1,_0x978001,_0x2781fb){return new BPromise(function(_0x52a6e7,_0x2fc0ad){return client[_0x8354('0x8')](_0x5958b1,_0x2781fb)[_0x8354('0x9')](function(_0x577012){logger[_0x8354('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x8354('0xb'));logger[_0x8354('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x978001,'request\x20sent',JSON[_0x8354('0xd')](_0x577012));if(_0x577012['error']){if(_0x577012[_0x8354('0xe')]['code']===0x1f4){logger[_0x8354('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x577012[_0x8354('0xe')][_0x8354('0xf')]);return _0x2fc0ad(_0x577012[_0x8354('0xe')][_0x8354('0xf')]);}logger[_0x8354('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,_0x577012[_0x8354('0xe')][_0x8354('0xf')]);return _0x52a6e7(_0x577012[_0x8354('0xe')][_0x8354('0xf')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x978001,'request\x20sent');_0x52a6e7(_0x577012[_0x8354('0x10')][_0x8354('0xf')]);}})['catch'](function(_0x546822){logger[_0x8354('0xe')](_0x8354('0x11'),_0x978001,_0x546822);_0x2fc0ad(_0x546822);});});}
\ No newline at end of file
+var _0x886d=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3e7df1,_0x4ebe06){var _0x428385=function(_0x1c23e8){while(--_0x1c23e8){_0x3e7df1['push'](_0x3e7df1['shift']());}};_0x428385(++_0x4ebe06);}(_0x886d,0xff));var _0xd886=function(_0x459d7d,_0x55db19){_0x459d7d=_0x459d7d-0x0;var _0x26abf1=_0x886d[_0x459d7d];return _0x26abf1;};'use strict';var _=require(_0xd886('0x0'));var util=require(_0xd886('0x1'));var moment=require(_0xd886('0x2'));var BPromise=require(_0xd886('0x3'));var rs=require(_0xd886('0x4'));var fs=require('fs');var Redis=require(_0xd886('0x5'));var db=require(_0xd886('0x6'))['db'];var utils=require(_0xd886('0x7'));var logger=require(_0xd886('0x8'))(_0xd886('0x9'));var config=require(_0xd886('0xa'));var jayson=require(_0xd886('0xb'));var client=jayson[_0xd886('0xc')][_0xd886('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x10da73,_0x5f4c6b,_0x2ae17e){return new BPromise(function(_0x4e1784,_0x5459f1){return client[_0xd886('0xe')](_0x10da73,_0x2ae17e)[_0xd886('0xf')](function(_0x4f456c){logger[_0xd886('0x10')](_0xd886('0x11'),_0x5f4c6b,_0xd886('0x12'));logger[_0xd886('0x13')](_0xd886('0x14'),_0x5f4c6b,'request\x20sent',JSON[_0xd886('0x15')](_0x4f456c));if(_0x4f456c[_0xd886('0x16')]){if(_0x4f456c[_0xd886('0x16')][_0xd886('0x17')]===0x1f4){logger['error'](_0xd886('0x11'),_0x5f4c6b,_0x4f456c[_0xd886('0x16')][_0xd886('0x18')]);return _0x5459f1(_0x4f456c[_0xd886('0x16')]['message']);}logger[_0xd886('0x16')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5f4c6b,_0x4f456c['error'][_0xd886('0x18')]);return _0x4e1784(_0x4f456c['error']['message']);}else{logger[_0xd886('0x10')](_0xd886('0x11'),_0x5f4c6b,'request\x20sent');_0x4e1784(_0x4f456c['result'][_0xd886('0x18')]);}})['catch'](function(_0x45bdd5){logger[_0xd886('0x16')](_0xd886('0x11'),_0x5f4c6b,_0x45bdd5);_0x5459f1(_0x45bdd5);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 82ce0a0..d7caa20 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 _0x9ade=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post'];(function(_0x30c95b,_0x5beb11){var _0xc5810c=function(_0x3b8809){while(--_0x3b8809){_0x30c95b['push'](_0x30c95b['shift']());}};_0xc5810c(++_0x5beb11);}(_0x9ade,0xde));var _0xe9ad=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x9ade[_0x1f7201];return _0x289fd2;};'use strict';var multer=require(_0xe9ad('0x0'));var util=require(_0xe9ad('0x1'));var path=require(_0xe9ad('0x2'));var timeout=require(_0xe9ad('0x3'));var express=require('express');var router=express[_0xe9ad('0x4')]();var fs_extra=require(_0xe9ad('0x5'));var auth=require(_0xe9ad('0x6'));var interaction=require(_0xe9ad('0x7'));var config=require(_0xe9ad('0x8'));var controller=require(_0xe9ad('0x9'));router[_0xe9ad('0xa')]('/',auth[_0xe9ad('0xb')](),controller[_0xe9ad('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe9ad('0xd')]);router[_0xe9ad('0xa')](_0xe9ad('0xe'),auth[_0xe9ad('0xb')](),controller[_0xe9ad('0xf')]);router[_0xe9ad('0xa')](_0xe9ad('0x10'),auth['isAuthenticated'](),controller[_0xe9ad('0x11')]);router[_0xe9ad('0xa')](_0xe9ad('0x12'),auth['isAuthenticated'](),controller[_0xe9ad('0x13')]);router[_0xe9ad('0x14')]('/',auth[_0xe9ad('0xb')](),controller['create']);router[_0xe9ad('0x15')](_0xe9ad('0x16'),auth['isAuthenticated'](),controller[_0xe9ad('0x17')]);router[_0xe9ad('0x18')](_0xe9ad('0x16'),auth[_0xe9ad('0xb')](),controller[_0xe9ad('0x19')]);module[_0xe9ad('0x1a')]=router;
\ No newline at end of file
+var _0x0b29=['Router','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','exports','multer','util','express'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0b29,0x11b));var _0x90b2=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x0b29[_0x3daa8c];return _0x2b1bd7;};'use strict';var multer=require(_0x90b2('0x0'));var util=require(_0x90b2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x90b2('0x2'));var router=express[_0x90b2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x90b2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x90b2('0x5'));router[_0x90b2('0x6')]('/',auth[_0x90b2('0x7')](),controller[_0x90b2('0x8')]);router[_0x90b2('0x6')](_0x90b2('0x9'),auth[_0x90b2('0x7')](),controller[_0x90b2('0xa')]);router[_0x90b2('0x6')](_0x90b2('0xb'),auth[_0x90b2('0x7')](),controller[_0x90b2('0xc')]);router[_0x90b2('0x6')](_0x90b2('0xd'),auth[_0x90b2('0x7')](),controller[_0x90b2('0xe')]);router[_0x90b2('0x6')](_0x90b2('0xf'),auth['isAuthenticated'](),controller[_0x90b2('0x10')]);router[_0x90b2('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x90b2('0x12')](_0x90b2('0x9'),auth[_0x90b2('0x7')](),controller[_0x90b2('0x13')]);router[_0x90b2('0x14')](_0x90b2('0x9'),auth[_0x90b2('0x7')](),controller['destroy']);module[_0x90b2('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 d26b140..35988e6 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 _0xe51c=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','csv','xlsx','DATE'];(function(_0x1f2b2b,_0x20baed){var _0x1da0c8=function(_0x37fa60){while(--_0x37fa60){_0x1f2b2b['push'](_0x1f2b2b['shift']());}};_0x1da0c8(++_0x20baed);}(_0xe51c,0xdd));var _0xce51=function(_0x30a02e,_0x1338e8){_0x30a02e=_0x30a02e-0x0;var _0x36102a=_0xe51c[_0x30a02e];return _0x36102a;};'use strict';var Sequelize=require(_0xce51('0x0'));var moment=require(_0xce51('0x1'));module[_0xce51('0x2')]={'name':{'type':Sequelize[_0xce51('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xce51('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xce51('0x4'),'pdf',_0xce51('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xce51('0x6')]},'endDate':{'type':Sequelize[_0xce51('0x6')]},'status':{'type':Sequelize[_0xce51('0x3')],'defaultValue':_0xce51('0x7')},'type':{'type':Sequelize['ENUM'](_0xce51('0x8'),_0xce51('0x9')),'allowNull':![],'defaultValue':_0xce51('0x8')},'reportId':{'type':Sequelize[_0xce51('0xa')](0xb)[_0xce51('0xb')]},'reportType':{'type':Sequelize[_0xce51('0x3')]}};
\ No newline at end of file
+var _0x0290=['moment','exports','STRING','ENUM','csv','xlsx','DATE','Loading','scheduled','manual','sequelize'];(function(_0xabe7e4,_0x288e85){var _0xb1891a=function(_0xe84ff6){while(--_0xe84ff6){_0xabe7e4['push'](_0xabe7e4['shift']());}};_0xb1891a(++_0x288e85);}(_0x0290,0xaf));var _0x0029=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x0290[_0x23e7c1];return _0x1add43;};'use strict';var Sequelize=require(_0x0029('0x0'));var moment=require(_0x0029('0x1'));module[_0x0029('0x2')]={'name':{'type':Sequelize[_0x0029('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x0029('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0029('0x4')](_0x0029('0x5'),'pdf',_0x0029('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x0029('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0029('0x7')]},'endDate':{'type':Sequelize[_0x0029('0x7')]},'status':{'type':Sequelize[_0x0029('0x3')],'defaultValue':_0x0029('0x8')},'type':{'type':Sequelize[_0x0029('0x4')]('manual',_0x0029('0x9')),'allowNull':![],'defaultValue':_0x0029('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x0029('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index c26872c..d740367 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 _0x9a3c=['error','stack','name','send','map','AnalyticExtractedReport','fieldName','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','sendStatus'];(function(_0x50811d,_0x17d91c){var _0x4f1582=function(_0x8450cc){while(--_0x8450cc){_0x50811d['push'](_0x50811d['shift']());}};_0x4f1582(++_0x17d91c);}(_0x9a3c,0x95));var _0xc9a3=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x9a3c[_0x4b7b62];return _0x2280df;};'use strict';var emlformat=require(_0xc9a3('0x0'));var rimraf=require(_0xc9a3('0x1'));var zipdir=require(_0xc9a3('0x2'));var jsonpatch=require(_0xc9a3('0x3'));var rp=require(_0xc9a3('0x4'));var moment=require(_0xc9a3('0x5'));var BPromise=require(_0xc9a3('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc9a3('0x7'));var sox=require(_0xc9a3('0x8'));var csv=require(_0xc9a3('0x9'));var ejs=require(_0xc9a3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9a3('0xb'));var squel=require(_0xc9a3('0xc'));var crypto=require(_0xc9a3('0xd'));var jsforce=require(_0xc9a3('0xe'));var deskjs=require(_0xc9a3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc9a3('0x10'));var Papa=require(_0xc9a3('0x11'));var Redis=require(_0xc9a3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc9a3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc9a3('0x14'));var logger=require(_0xc9a3('0x15'))(_0xc9a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc9a3('0x17'))['db'];function respondWithStatusCode(_0x195ca3,_0x5195ce){_0x5195ce=_0x5195ce||0xcc;return function(_0x59f8bc){if(_0x59f8bc){return _0x195ca3['sendStatus'](_0x5195ce);}return _0x195ca3[_0xc9a3('0x18')](_0x5195ce)[_0xc9a3('0x19')]();};}function respondWithResult(_0x40ce57,_0x2428a3){_0x2428a3=_0x2428a3||0xc8;return function(_0x5bf20e){if(_0x5bf20e){return _0x40ce57[_0xc9a3('0x18')](_0x2428a3)['json'](_0x5bf20e);}};}function respondWithFilteredResult(_0x13bf9a,_0x5cdb88){return function(_0x4dba10){if(_0x4dba10){var _0x16a5fc=typeof _0x5cdb88[_0xc9a3('0x1a')]===_0xc9a3('0x1b')&&typeof _0x5cdb88[_0xc9a3('0x1c')]==='undefined';var _0x42ff8b=_0x4dba10[_0xc9a3('0x1d')];var _0x462399=_0x16a5fc?0x0:_0x5cdb88[_0xc9a3('0x1a')];var _0x5831fd=_0x16a5fc?_0x4dba10[_0xc9a3('0x1d')]:_0x5cdb88['offset']+_0x5cdb88['limit'];var _0x30df79;if(_0x5831fd>=_0x42ff8b){_0x5831fd=_0x42ff8b;_0x30df79=0xc8;}else{_0x30df79=0xce;}_0x13bf9a['status'](_0x30df79);return _0x13bf9a[_0xc9a3('0x1e')](_0xc9a3('0x1f'),_0x462399+'-'+_0x5831fd+'/'+_0x42ff8b)[_0xc9a3('0x20')](_0x4dba10);}return null;};}function patchUpdates(_0x6a3d10){return function(_0x403a8a){try{jsonpatch[_0xc9a3('0x21')](_0x403a8a,_0x6a3d10,!![]);}catch(_0x2eeef2){return BPromise[_0xc9a3('0x22')](_0x2eeef2);}return _0x403a8a[_0xc9a3('0x23')]();};}function saveUpdates(_0x5bf8af,_0x5c4659){return function(_0x318ca7){if(_0x318ca7){return _0x318ca7[_0xc9a3('0x24')](_0x5bf8af)[_0xc9a3('0x25')](function(_0x371b68){return _0x371b68;});}return null;};}function removeEntity(_0x2d86be,_0x29a59f){return function(_0x2c9a94){if(_0x2c9a94){return _0x2c9a94[_0xc9a3('0x26')]()['then'](function(){var _0x200dde=_0x2c9a94[_0xc9a3('0x27')]({'plain':!![]});var _0x372b22='ExtractedReports';return db['UserProfileResource'][_0xc9a3('0x26')]({'where':{'type':_0x372b22,'resourceId':_0x200dde['id']}})[_0xc9a3('0x25')](function(){return _0x2c9a94;});})[_0xc9a3('0x25')](function(){_0x2d86be[_0xc9a3('0x18')](0xcc)[_0xc9a3('0x19')]();});}};}function handleEntityNotFound(_0x16cc54,_0x13ab37){return function(_0x23f03b){if(!_0x23f03b){_0x16cc54[_0xc9a3('0x28')](0x194);}return _0x23f03b;};}function handleError(_0x54b8f8,_0x1f794c){_0x1f794c=_0x1f794c||0x1f4;return function(_0x2bfe87){logger[_0xc9a3('0x29')](_0x2bfe87[_0xc9a3('0x2a')]);if(_0x2bfe87[_0xc9a3('0x2b')]){delete _0x2bfe87[_0xc9a3('0x2b')];}_0x54b8f8[_0xc9a3('0x18')](_0x1f794c)[_0xc9a3('0x2c')](_0x2bfe87);};}exports['index']=function(_0x4302a2,_0x877aa8){var _0x1a0c47={},_0x166b3e={},_0x1bbbf4={'count':0x0,'rows':[]};var _0x17b56c=_[_0xc9a3('0x2d')](db[_0xc9a3('0x2e')]['rawAttributes'],function(_0x33ade8){return{'name':_0x33ade8[_0xc9a3('0x2f')],'type':_0x33ade8['type']['key']};});_0x166b3e[_0xc9a3('0x30')]=_['map'](_0x17b56c,_0xc9a3('0x2b'));_0x166b3e[_0xc9a3('0x31')]=_[_0xc9a3('0x32')](_0x4302a2[_0xc9a3('0x31')]);_0x166b3e[_0xc9a3('0x33')]=_['intersection'](_0x166b3e['model'],_0x166b3e[_0xc9a3('0x31')]);_0x1a0c47[_0xc9a3('0x34')]=_['intersection'](_0x166b3e[_0xc9a3('0x30')],qs[_0xc9a3('0x35')](_0x4302a2[_0xc9a3('0x31')][_0xc9a3('0x35')]));_0x1a0c47[_0xc9a3('0x34')]=_0x1a0c47[_0xc9a3('0x34')][_0xc9a3('0x36')]?_0x1a0c47['attributes']:_0x166b3e[_0xc9a3('0x30')];if(!_0x4302a2[_0xc9a3('0x31')]['hasOwnProperty'](_0xc9a3('0x37'))){_0x1a0c47[_0xc9a3('0x1c')]=qs[_0xc9a3('0x1c')](_0x4302a2['query'][_0xc9a3('0x1c')]);_0x1a0c47[_0xc9a3('0x1a')]=qs['offset'](_0x4302a2[_0xc9a3('0x31')]['offset']);}_0x1a0c47[_0xc9a3('0x38')]=qs[_0xc9a3('0x39')](_0x4302a2['query'][_0xc9a3('0x39')]);_0x1a0c47['where']=qs['filters'](_[_0xc9a3('0x3a')](_0x4302a2[_0xc9a3('0x31')],_0x166b3e[_0xc9a3('0x33')]),_0x17b56c);if(_0x4302a2[_0xc9a3('0x31')]['filter']){_0x1a0c47[_0xc9a3('0x3b')]=_[_0xc9a3('0x3c')](_0x1a0c47[_0xc9a3('0x3b')],{'$or':_[_0xc9a3('0x2d')](_0x17b56c,function(_0x1ca906){if(_0x1ca906[_0xc9a3('0x3d')]!==_0xc9a3('0x3e')){var _0x11cb35={};_0x11cb35[_0x1ca906[_0xc9a3('0x2b')]]={'$like':'%'+_0x4302a2[_0xc9a3('0x31')][_0xc9a3('0x3f')]+'%'};return _0x11cb35;}})});}_0x1a0c47=_[_0xc9a3('0x3c')]({},_0x1a0c47,_0x4302a2[_0xc9a3('0x40')]);var _0x371ab9={'where':_0x1a0c47[_0xc9a3('0x3b')]};return db[_0xc9a3('0x2e')][_0xc9a3('0x1d')](_0x371ab9)[_0xc9a3('0x25')](function(_0x5ecb34){_0x1bbbf4['count']=_0x5ecb34;if(_0x4302a2['query']['includeAll']){_0x1a0c47[_0xc9a3('0x41')]=[{'all':!![]}];}return db[_0xc9a3('0x2e')][_0xc9a3('0x42')](_0x1a0c47);})['then'](function(_0x2d62a6){_0x1bbbf4[_0xc9a3('0x43')]=_0x2d62a6;return _0x1bbbf4;})[_0xc9a3('0x25')](respondWithFilteredResult(_0x877aa8,_0x1a0c47))[_0xc9a3('0x44')](handleError(_0x877aa8,null));};exports['show']=function(_0xf8ed3d,_0x125f78){var _0xd2f882={'raw':!![],'where':{'id':_0xf8ed3d[_0xc9a3('0x45')]['id']}},_0x536da5={};_0x536da5[_0xc9a3('0x30')]=_[_0xc9a3('0x32')](db[_0xc9a3('0x2e')][_0xc9a3('0x46')]);_0x536da5[_0xc9a3('0x31')]=_[_0xc9a3('0x32')](_0xf8ed3d['query']);_0x536da5[_0xc9a3('0x33')]=_['intersection'](_0x536da5[_0xc9a3('0x30')],_0x536da5[_0xc9a3('0x31')]);_0xd2f882[_0xc9a3('0x34')]=_['intersection'](_0x536da5[_0xc9a3('0x30')],qs[_0xc9a3('0x35')](_0xf8ed3d[_0xc9a3('0x31')][_0xc9a3('0x35')]));_0xd2f882[_0xc9a3('0x34')]=_0xd2f882['attributes'][_0xc9a3('0x36')]?_0xd2f882[_0xc9a3('0x34')]:_0x536da5['model'];if(_0xf8ed3d[_0xc9a3('0x31')][_0xc9a3('0x47')]){_0xd2f882[_0xc9a3('0x41')]=[{'all':!![]}];}_0xd2f882=_[_0xc9a3('0x3c')]({},_0xd2f882,_0xf8ed3d['options']);return db[_0xc9a3('0x2e')][_0xc9a3('0x48')](_0xd2f882)['then'](handleEntityNotFound(_0x125f78,null))[_0xc9a3('0x25')](respondWithResult(_0x125f78,null))[_0xc9a3('0x44')](handleError(_0x125f78,null));};exports[_0xc9a3('0x49')]=function(_0x4f8e67,_0x3dd609){return db[_0xc9a3('0x2e')][_0xc9a3('0x49')](_0x4f8e67[_0xc9a3('0x4a')],{})[_0xc9a3('0x25')](function(_0x7efff5){var _0x3df796=_0x4f8e67[_0xc9a3('0x4b')]['get']({'plain':!![]});if(!_0x3df796)throw new Error(_0xc9a3('0x4c'));if(_0x3df796['role']===_0xc9a3('0x4b')){var _0x571bae=_0x7efff5[_0xc9a3('0x27')]({'plain':!![]});var _0x57bae9='ExtractedReports';return db['UserProfileSection'][_0xc9a3('0x48')]({'where':{'name':_0x57bae9,'userProfileId':_0x3df796[_0xc9a3('0x4d')]},'raw':!![]})['then'](function(_0x49baa2){if(_0x49baa2&&_0x49baa2[_0xc9a3('0x4e')]===0x0){return db[_0xc9a3('0x4f')][_0xc9a3('0x49')]({'name':_0x571bae[_0xc9a3('0x2b')],'resourceId':_0x571bae['id'],'type':_0x49baa2[_0xc9a3('0x2b')],'sectionId':_0x49baa2['id']},{})['then'](function(){return _0x7efff5;});}else{return _0x7efff5;}})[_0xc9a3('0x44')](function(_0x16de1e){logger[_0xc9a3('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16de1e);throw _0x16de1e;});}return _0x7efff5;})['then'](respondWithResult(_0x3dd609,0xc9))['catch'](handleError(_0x3dd609,null));};exports[_0xc9a3('0x24')]=function(_0x24ad95,_0x6e10f9){if(_0x24ad95['body']['id']){delete _0x24ad95[_0xc9a3('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0xc9a3('0x48')]({'where':{'id':_0x24ad95['params']['id']}})[_0xc9a3('0x25')](handleEntityNotFound(_0x6e10f9,null))[_0xc9a3('0x25')](saveUpdates(_0x24ad95[_0xc9a3('0x4a')],null))[_0xc9a3('0x25')](respondWithResult(_0x6e10f9,null))[_0xc9a3('0x44')](handleError(_0x6e10f9,null));};exports[_0xc9a3('0x26')]=function(_0x4c5251,_0x4d14a8){return db['AnalyticExtractedReport'][_0xc9a3('0x48')]({'where':{'id':_0x4c5251[_0xc9a3('0x45')]['id']}})[_0xc9a3('0x25')](handleEntityNotFound(_0x4d14a8,null))['then'](removeEntity(_0x4d14a8,null))['catch'](handleError(_0x4d14a8,null));};exports[_0xc9a3('0x50')]=function(_0x259621,_0xa899b1,_0x1497d1){return db[_0xc9a3('0x2e')][_0xc9a3('0x48')]({'where':{'id':_0x259621['params']['id']},'attributes':['name',_0xc9a3('0x51'),_0xc9a3('0x52'),_0xc9a3('0x53')],'raw':!![]})[_0xc9a3('0x25')](handleEntityNotFound(_0xa899b1,null))[_0xc9a3('0x25')](function(_0x1f5df7){if(_0x1f5df7){if(!fs[_0xc9a3('0x54')](path[_0xc9a3('0x55')](config[_0xc9a3('0x56')],_0xc9a3('0x57'),_0x1f5df7[_0xc9a3('0x52')]))){throw new db[(_0xc9a3('0x58'))][(_0xc9a3('0x59'))](_0xc9a3('0x5a'));}if(_0x259621[_0xc9a3('0x31')][_0xc9a3('0x5b')]){return _0xa899b1[_0xc9a3('0x28')](0xc8);}return _0xa899b1['download'](path[_0xc9a3('0x55')](config['root'],_0xc9a3('0x57'),_0x1f5df7[_0xc9a3('0x52')]),util[_0xc9a3('0x5c')](_0xc9a3('0x5d'),_0x1f5df7[_0xc9a3('0x51')]||_0x1f5df7['name'],_0x1f5df7['output'][_0xc9a3('0x5e')]()));}})['catch'](handleError(_0xa899b1,null));};
\ No newline at end of file
+var _0x0d49=['create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','existsSync','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','root','format','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','model','query','intersection','fields','attributes','length','limit','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','rows','catch','find'];(function(_0xfb3b3,_0x10db7a){var _0x36cae7=function(_0x183814){while(--_0x183814){_0xfb3b3['push'](_0xfb3b3['shift']());}};_0x36cae7(++_0x10db7a);}(_0x0d49,0x19c));var _0x90d4=function(_0x5b532e,_0x5369c4){_0x5b532e=_0x5b532e-0x0;var _0x15f83e=_0x0d49[_0x5b532e];return _0x15f83e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90d4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90d4('0x1'));var rp=require(_0x90d4('0x2'));var moment=require(_0x90d4('0x3'));var BPromise=require(_0x90d4('0x4'));var Mustache=require('mustache');var util=require(_0x90d4('0x5'));var path=require(_0x90d4('0x6'));var sox=require(_0x90d4('0x7'));var csv=require(_0x90d4('0x8'));var ejs=require(_0x90d4('0x9'));var fs=require('fs');var fs_extra=require(_0x90d4('0xa'));var _=require(_0x90d4('0xb'));var squel=require(_0x90d4('0xc'));var crypto=require(_0x90d4('0xd'));var jsforce=require(_0x90d4('0xe'));var deskjs=require(_0x90d4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x90d4('0x10'));var Papa=require(_0x90d4('0x11'));var Redis=require('ioredis');var authService=require(_0x90d4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x90d4('0x13'));var hardwareService=require(_0x90d4('0x14'));var logger=require(_0x90d4('0x15'))(_0x90d4('0x16'));var utils=require(_0x90d4('0x17'));var config=require(_0x90d4('0x18'));var licenseUtil=require(_0x90d4('0x19'));var db=require(_0x90d4('0x1a'))['db'];function respondWithStatusCode(_0x301bbb,_0x13ce7e){_0x13ce7e=_0x13ce7e||0xcc;return function(_0x18caa1){if(_0x18caa1){return _0x301bbb[_0x90d4('0x1b')](_0x13ce7e);}return _0x301bbb[_0x90d4('0x1c')](_0x13ce7e)[_0x90d4('0x1d')]();};}function respondWithResult(_0xef29af,_0xa06d78){_0xa06d78=_0xa06d78||0xc8;return function(_0xb5ee7c){if(_0xb5ee7c){return _0xef29af[_0x90d4('0x1c')](_0xa06d78)[_0x90d4('0x1e')](_0xb5ee7c);}};}function respondWithFilteredResult(_0x2dc8f3,_0xb44d66){return function(_0xab7598){if(_0xab7598){var _0x47f53e=typeof _0xb44d66[_0x90d4('0x1f')]==='undefined'&&typeof _0xb44d66['limit']===_0x90d4('0x20');var _0x1ad8cc=_0xab7598[_0x90d4('0x21')];var _0x39ddcc=_0x47f53e?0x0:_0xb44d66[_0x90d4('0x1f')];var _0x2d88a1=_0x47f53e?_0xab7598[_0x90d4('0x21')]:_0xb44d66[_0x90d4('0x1f')]+_0xb44d66['limit'];var _0x663f27;if(_0x2d88a1>=_0x1ad8cc){_0x2d88a1=_0x1ad8cc;_0x663f27=0xc8;}else{_0x663f27=0xce;}_0x2dc8f3[_0x90d4('0x1c')](_0x663f27);return _0x2dc8f3[_0x90d4('0x22')](_0x90d4('0x23'),_0x39ddcc+'-'+_0x2d88a1+'/'+_0x1ad8cc)[_0x90d4('0x1e')](_0xab7598);}return null;};}function patchUpdates(_0x59c83e){return function(_0x119cc6){try{jsonpatch[_0x90d4('0x24')](_0x119cc6,_0x59c83e,!![]);}catch(_0x3c3e58){return BPromise[_0x90d4('0x25')](_0x3c3e58);}return _0x119cc6[_0x90d4('0x26')]();};}function saveUpdates(_0x12a57e,_0x4b8eef){return function(_0x20a2a3){if(_0x20a2a3){return _0x20a2a3[_0x90d4('0x27')](_0x12a57e)[_0x90d4('0x28')](function(_0x37954d){return _0x37954d;});}return null;};}function removeEntity(_0x4a6593,_0x42d39c){return function(_0x1a6c6f){if(_0x1a6c6f){return _0x1a6c6f[_0x90d4('0x29')]()[_0x90d4('0x28')](function(){var _0x17164b=_0x1a6c6f['get']({'plain':!![]});var _0xa7e465='ExtractedReports';return db[_0x90d4('0x2a')]['destroy']({'where':{'type':_0xa7e465,'resourceId':_0x17164b['id']}})[_0x90d4('0x28')](function(){return _0x1a6c6f;});})[_0x90d4('0x28')](function(){_0x4a6593[_0x90d4('0x1c')](0xcc)[_0x90d4('0x1d')]();});}};}function handleEntityNotFound(_0x124ba4,_0x51323c){return function(_0x48b4c7){if(!_0x48b4c7){_0x124ba4['sendStatus'](0x194);}return _0x48b4c7;};}function handleError(_0x3ae887,_0x385c9a){_0x385c9a=_0x385c9a||0x1f4;return function(_0x3c3644){logger[_0x90d4('0x2b')](_0x3c3644['stack']);if(_0x3c3644[_0x90d4('0x2c')]){delete _0x3c3644['name'];}_0x3ae887[_0x90d4('0x1c')](_0x385c9a)[_0x90d4('0x2d')](_0x3c3644);};}exports[_0x90d4('0x2e')]=function(_0x5667f4,_0x452db8){var _0x354f55={},_0x460186={},_0x3f2c99={'count':0x0,'rows':[]};var _0x1b75f2=_[_0x90d4('0x2f')](db['AnalyticExtractedReport'][_0x90d4('0x30')],function(_0x72acc0){return{'name':_0x72acc0[_0x90d4('0x31')],'type':_0x72acc0[_0x90d4('0x32')][_0x90d4('0x33')]};});_0x460186['model']=_['map'](_0x1b75f2,_0x90d4('0x2c'));_0x460186['query']=_[_0x90d4('0x34')](_0x5667f4['query']);_0x460186[_0x90d4('0x35')]=_['intersection'](_0x460186[_0x90d4('0x36')],_0x460186[_0x90d4('0x37')]);_0x354f55['attributes']=_[_0x90d4('0x38')](_0x460186['model'],qs[_0x90d4('0x39')](_0x5667f4[_0x90d4('0x37')][_0x90d4('0x39')]));_0x354f55[_0x90d4('0x3a')]=_0x354f55[_0x90d4('0x3a')][_0x90d4('0x3b')]?_0x354f55[_0x90d4('0x3a')]:_0x460186[_0x90d4('0x36')];if(!_0x5667f4['query']['hasOwnProperty']('nolimit')){_0x354f55[_0x90d4('0x3c')]=qs[_0x90d4('0x3c')](_0x5667f4[_0x90d4('0x37')][_0x90d4('0x3c')]);_0x354f55[_0x90d4('0x1f')]=qs[_0x90d4('0x1f')](_0x5667f4[_0x90d4('0x37')][_0x90d4('0x1f')]);}_0x354f55['order']=qs['sort'](_0x5667f4[_0x90d4('0x37')][_0x90d4('0x3d')]);_0x354f55[_0x90d4('0x3e')]=qs[_0x90d4('0x35')](_[_0x90d4('0x3f')](_0x5667f4[_0x90d4('0x37')],_0x460186['filters']),_0x1b75f2);if(_0x5667f4['query']['filter']){_0x354f55[_0x90d4('0x3e')]=_[_0x90d4('0x40')](_0x354f55[_0x90d4('0x3e')],{'$or':_[_0x90d4('0x2f')](_0x1b75f2,function(_0x1a3250){if(_0x1a3250['type']!==_0x90d4('0x41')){var _0xc76f2f={};_0xc76f2f[_0x1a3250[_0x90d4('0x2c')]]={'$like':'%'+_0x5667f4[_0x90d4('0x37')][_0x90d4('0x42')]+'%'};return _0xc76f2f;}})});}_0x354f55=_[_0x90d4('0x40')]({},_0x354f55,_0x5667f4[_0x90d4('0x43')]);var _0x57d3e0={'where':_0x354f55[_0x90d4('0x3e')]};return db[_0x90d4('0x44')][_0x90d4('0x21')](_0x57d3e0)[_0x90d4('0x28')](function(_0x15c68f){_0x3f2c99['count']=_0x15c68f;if(_0x5667f4[_0x90d4('0x37')][_0x90d4('0x45')]){_0x354f55['include']=[{'all':!![]}];}return db[_0x90d4('0x44')]['findAll'](_0x354f55);})[_0x90d4('0x28')](function(_0x3a50ac){_0x3f2c99[_0x90d4('0x46')]=_0x3a50ac;return _0x3f2c99;})[_0x90d4('0x28')](respondWithFilteredResult(_0x452db8,_0x354f55))[_0x90d4('0x47')](handleError(_0x452db8,null));};exports['show']=function(_0x8f5180,_0x37b43d){var _0x90c4a1={'raw':!![],'where':{'id':_0x8f5180['params']['id']}},_0x24983a={};_0x24983a[_0x90d4('0x36')]=_[_0x90d4('0x34')](db[_0x90d4('0x44')][_0x90d4('0x30')]);_0x24983a[_0x90d4('0x37')]=_[_0x90d4('0x34')](_0x8f5180[_0x90d4('0x37')]);_0x24983a[_0x90d4('0x35')]=_[_0x90d4('0x38')](_0x24983a[_0x90d4('0x36')],_0x24983a[_0x90d4('0x37')]);_0x90c4a1[_0x90d4('0x3a')]=_['intersection'](_0x24983a['model'],qs['fields'](_0x8f5180[_0x90d4('0x37')][_0x90d4('0x39')]));_0x90c4a1[_0x90d4('0x3a')]=_0x90c4a1[_0x90d4('0x3a')]['length']?_0x90c4a1[_0x90d4('0x3a')]:_0x24983a[_0x90d4('0x36')];if(_0x8f5180['query'][_0x90d4('0x45')]){_0x90c4a1['include']=[{'all':!![]}];}_0x90c4a1=_[_0x90d4('0x40')]({},_0x90c4a1,_0x8f5180[_0x90d4('0x43')]);return db[_0x90d4('0x44')][_0x90d4('0x48')](_0x90c4a1)[_0x90d4('0x28')](handleEntityNotFound(_0x37b43d,null))[_0x90d4('0x28')](respondWithResult(_0x37b43d,null))[_0x90d4('0x47')](handleError(_0x37b43d,null));};exports[_0x90d4('0x49')]=function(_0x26cb77,_0x1f93a4){return db[_0x90d4('0x44')][_0x90d4('0x49')](_0x26cb77['body'],{})[_0x90d4('0x28')](function(_0x366661){var _0x3b1a22=_0x26cb77['user'][_0x90d4('0x4a')]({'plain':!![]});if(!_0x3b1a22)throw new Error(_0x90d4('0x4b'));if(_0x3b1a22[_0x90d4('0x4c')]==='user'){var _0x234e27=_0x366661[_0x90d4('0x4a')]({'plain':!![]});var _0x4ff479='ExtractedReports';return db[_0x90d4('0x4d')][_0x90d4('0x48')]({'where':{'name':_0x4ff479,'userProfileId':_0x3b1a22[_0x90d4('0x4e')]},'raw':!![]})[_0x90d4('0x28')](function(_0x47e5a7){if(_0x47e5a7&&_0x47e5a7[_0x90d4('0x4f')]===0x0){return db['UserProfileResource'][_0x90d4('0x49')]({'name':_0x234e27['name'],'resourceId':_0x234e27['id'],'type':_0x47e5a7['name'],'sectionId':_0x47e5a7['id']},{})[_0x90d4('0x28')](function(){return _0x366661;});}else{return _0x366661;}})[_0x90d4('0x47')](function(_0x7eec25){logger['error'](_0x90d4('0x50'),_0x7eec25);throw _0x7eec25;});}return _0x366661;})[_0x90d4('0x28')](respondWithResult(_0x1f93a4,0xc9))[_0x90d4('0x47')](handleError(_0x1f93a4,null));};exports['update']=function(_0x65f786,_0x566d7f){if(_0x65f786[_0x90d4('0x51')]['id']){delete _0x65f786['body']['id'];}return db[_0x90d4('0x44')][_0x90d4('0x48')]({'where':{'id':_0x65f786[_0x90d4('0x52')]['id']}})[_0x90d4('0x28')](handleEntityNotFound(_0x566d7f,null))[_0x90d4('0x28')](saveUpdates(_0x65f786['body'],null))[_0x90d4('0x28')](respondWithResult(_0x566d7f,null))[_0x90d4('0x47')](handleError(_0x566d7f,null));};exports['destroy']=function(_0x46ca31,_0x4bffb3){return db['AnalyticExtractedReport'][_0x90d4('0x48')]({'where':{'id':_0x46ca31['params']['id']}})['then'](handleEntityNotFound(_0x4bffb3,null))[_0x90d4('0x28')](removeEntity(_0x4bffb3,null))[_0x90d4('0x47')](handleError(_0x4bffb3,null));};exports[_0x90d4('0x53')]=function(_0x3e3ef0,_0x2fd2d4,_0x5cb7ad){return db[_0x90d4('0x44')]['find']({'where':{'id':_0x3e3ef0['params']['id']},'attributes':[_0x90d4('0x2c'),_0x90d4('0x54'),_0x90d4('0x55'),_0x90d4('0x56')],'raw':!![]})[_0x90d4('0x28')](handleEntityNotFound(_0x2fd2d4,null))['then'](function(_0x560bff){if(_0x560bff){if(!fs[_0x90d4('0x57')](path['join'](config['root'],_0x90d4('0x58'),_0x560bff[_0x90d4('0x55')]))){throw new db[(_0x90d4('0x59'))][(_0x90d4('0x5a'))](_0x90d4('0x5b'));}if(_0x3e3ef0[_0x90d4('0x37')][_0x90d4('0x5c')]){return _0x2fd2d4[_0x90d4('0x1b')](0xc8);}return _0x2fd2d4['download'](path[_0x90d4('0x5d')](config[_0x90d4('0x5e')],'server/files/reports',_0x560bff[_0x90d4('0x55')]),util[_0x90d4('0x5f')]('%s.%s',_0x560bff[_0x90d4('0x54')]||_0x560bff['name'],_0x560bff[_0x90d4('0x56')][_0x90d4('0x60')]()));}})[_0x90d4('0x47')](handleError(_0x2fd2d4,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index c16d603..7736bbf 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 _0x0ea1=['analytics_extracted_reports','util','api','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x45c55e,_0x18002b){var _0x5a9dd8=function(_0x389e52){while(--_0x389e52){_0x45c55e['push'](_0x45c55e['shift']());}};_0x5a9dd8(++_0x18002b);}(_0x0ea1,0xb5));var _0x10ea=function(_0x54b9e2,_0x47b06c){_0x54b9e2=_0x54b9e2-0x0;var _0x4859cc=_0x0ea1[_0x54b9e2];return _0x4859cc;};'use strict';var _=require('lodash');var util=require(_0x10ea('0x0'));var logger=require('../../config/logger')(_0x10ea('0x1'));var moment=require('moment');var BPromise=require(_0x10ea('0x2'));var rp=require(_0x10ea('0x3'));var fs=require('fs');var path=require(_0x10ea('0x4'));var rimraf=require('rimraf');var config=require(_0x10ea('0x5'));var attributes=require(_0x10ea('0x6'));module[_0x10ea('0x7')]=function(_0x4dfafc,_0x405754){return _0x4dfafc[_0x10ea('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0x10ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe4c1=['rimraf','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','moment','bluebird','request-promise','path'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xe4c1,0x126));var _0x1e4c=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xe4c1[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x1e4c('0x0'));var util=require(_0x1e4c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1e4c('0x2'));var BPromise=require(_0x1e4c('0x3'));var rp=require(_0x1e4c('0x4'));var fs=require('fs');var path=require(_0x1e4c('0x5'));var rimraf=require(_0x1e4c('0x6'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x1e4c('0x7')]=function(_0x2b00bd,_0x2ce50a){return _0x2b00bd['define'](_0x1e4c('0x8'),attributes,{'tableName':_0x1e4c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 971deca..0250042 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 _0x1137=['request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x46aa9c,_0x518160){var _0xf19a0b=function(_0x353d73){while(--_0x353d73){_0x46aa9c['push'](_0x46aa9c['shift']());}};_0xf19a0b(++_0x518160);}(_0x1137,0x183));var _0x7113=function(_0x9307ea,_0x38968a){_0x9307ea=_0x9307ea-0x0;var _0x295554=_0x1137[_0x9307ea];return _0x295554;};'use strict';var _=require(_0x7113('0x0'));var util=require(_0x7113('0x1'));var moment=require(_0x7113('0x2'));var BPromise=require(_0x7113('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7113('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7113('0x5'));var logger=require('../../config/logger')(_0x7113('0x6'));var config=require(_0x7113('0x7'));var jayson=require(_0x7113('0x8'));var client=jayson[_0x7113('0x9')][_0x7113('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x518610,_0x4ae605,_0x532fa1){return new BPromise(function(_0x4ac528,_0x2fc982){return client['request'](_0x518610,_0x532fa1)['then'](function(_0xfe7490){logger[_0x7113('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4ae605,_0x7113('0xc'));logger[_0x7113('0xd')](_0x7113('0xe'),_0x4ae605,_0x7113('0xc'),JSON[_0x7113('0xf')](_0xfe7490));if(_0xfe7490[_0x7113('0x10')]){if(_0xfe7490[_0x7113('0x10')][_0x7113('0x11')]===0x1f4){logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0xfe7490[_0x7113('0x10')]['message']);return _0x2fc982(_0xfe7490[_0x7113('0x10')]['message']);}logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0xfe7490[_0x7113('0x10')]['message']);return _0x4ac528(_0xfe7490[_0x7113('0x10')][_0x7113('0x13')]);}else{logger[_0x7113('0xb')](_0x7113('0x12'),_0x4ae605,'request\x20sent');_0x4ac528(_0xfe7490[_0x7113('0x14')]['message']);}})['catch'](function(_0x215e01){logger[_0x7113('0x10')](_0x7113('0x12'),_0x4ae605,_0x215e01);_0x2fc982(_0x215e01);});});}
\ No newline at end of file
+var _0x7ef2=['http','request','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x2ef789,_0x26a493){var _0xf29e80=function(_0x392fbe){while(--_0x392fbe){_0x2ef789['push'](_0x2ef789['shift']());}};_0xf29e80(++_0x26a493);}(_0x7ef2,0x15d));var _0x27ef=function(_0x22a993,_0x221191){_0x22a993=_0x22a993-0x0;var _0x4f9ca0=_0x7ef2[_0x22a993];return _0x4f9ca0;};'use strict';var _=require(_0x27ef('0x0'));var util=require('util');var moment=require(_0x27ef('0x1'));var BPromise=require(_0x27ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27ef('0x3'));var db=require(_0x27ef('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x27ef('0x5'));var config=require(_0x27ef('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x27ef('0x7')][_0x27ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x285292,_0x563446,_0x133d91){return new BPromise(function(_0x3bbb83,_0x38dcbc){return client[_0x27ef('0x9')](_0x285292,_0x133d91)[_0x27ef('0xa')](function(_0x4ec4e5){logger[_0x27ef('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x563446,_0x27ef('0xc'));logger['debug'](_0x27ef('0xd'),_0x563446,'request\x20sent',JSON[_0x27ef('0xe')](_0x4ec4e5));if(_0x4ec4e5[_0x27ef('0xf')]){if(_0x4ec4e5[_0x27ef('0xf')][_0x27ef('0x10')]===0x1f4){logger[_0x27ef('0xf')](_0x27ef('0x11'),_0x563446,_0x4ec4e5[_0x27ef('0xf')]['message']);return _0x38dcbc(_0x4ec4e5[_0x27ef('0xf')][_0x27ef('0x12')]);}logger[_0x27ef('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x563446,_0x4ec4e5[_0x27ef('0xf')]['message']);return _0x3bbb83(_0x4ec4e5[_0x27ef('0xf')][_0x27ef('0x12')]);}else{logger[_0x27ef('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x563446,_0x27ef('0xc'));_0x3bbb83(_0x4ec4e5[_0x27ef('0x13')][_0x27ef('0x12')]);}})[_0x27ef('0x14')](function(_0x1d2803){logger[_0x27ef('0xf')](_0x27ef('0x11'),_0x563446,_0x1d2803);_0x38dcbc(_0x1d2803);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 37b5306..709b8ba 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 _0x3588=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','delete','multer','util','path','connect-timeout'];(function(_0x2a2a4a,_0x30e750){var _0xbd4c98=function(_0x2b6339){while(--_0x2b6339){_0x2a2a4a['push'](_0x2a2a4a['shift']());}};_0xbd4c98(++_0x30e750);}(_0x3588,0xf8));var _0x8358=function(_0x4310e8,_0x3ba783){_0x4310e8=_0x4310e8-0x0;var _0x301445=_0x3588[_0x4310e8];return _0x301445;};'use strict';var multer=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var path=require(_0x8358('0x2'));var timeout=require(_0x8358('0x3'));var express=require(_0x8358('0x4'));var router=express[_0x8358('0x5')]();var fs_extra=require(_0x8358('0x6'));var auth=require(_0x8358('0x7'));var interaction=require(_0x8358('0x8'));var config=require('../../config/environment');var controller=require(_0x8358('0x9'));router['get']('/',auth[_0x8358('0xa')](),controller[_0x8358('0xb')]);router[_0x8358('0xc')](_0x8358('0xd'),auth[_0x8358('0xa')](),controller[_0x8358('0xe')]);router[_0x8358('0xc')](_0x8358('0xf'),auth[_0x8358('0xa')](),controller[_0x8358('0x10')]);router[_0x8358('0x11')]('/',auth['isAuthenticated'](),controller[_0x8358('0x12')]);router[_0x8358('0x13')]('/:id',auth[_0x8358('0xa')](),controller['update']);router[_0x8358('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x88c5=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x88c5,0x1e3));var _0x588c=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x88c5[_0x7ad123];return _0x37d073;};'use strict';var multer=require(_0x588c('0x0'));var util=require(_0x588c('0x1'));var path=require(_0x588c('0x2'));var timeout=require(_0x588c('0x3'));var express=require(_0x588c('0x4'));var router=express[_0x588c('0x5')]();var fs_extra=require(_0x588c('0x6'));var auth=require(_0x588c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x588c('0x8'));var controller=require(_0x588c('0x9'));router[_0x588c('0xa')]('/',auth['isAuthenticated'](),controller[_0x588c('0xb')]);router[_0x588c('0xa')](_0x588c('0xc'),auth[_0x588c('0xd')](),controller[_0x588c('0xe')]);router['get'](_0x588c('0xf'),auth[_0x588c('0xd')](),controller[_0x588c('0x10')]);router[_0x588c('0x11')]('/',auth[_0x588c('0xd')](),controller[_0x588c('0x12')]);router[_0x588c('0x13')](_0x588c('0xc'),auth[_0x588c('0xd')](),controller[_0x588c('0x14')]);router[_0x588c('0x15')]('/:id',auth[_0x588c('0xd')](),controller[_0x588c('0x16')]);module[_0x588c('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index cd27679..e0df11e 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 _0xcba5=['STRING','BOOLEAN','exports','TEXT'];(function(_0x5e0aed,_0x46575e){var _0x23cb81=function(_0x1afb92){while(--_0x1afb92){_0x5e0aed['push'](_0x5e0aed['shift']());}};_0x23cb81(++_0x46575e);}(_0xcba5,0xee));var _0x5cba=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xcba5[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require('sequelize');module[_0x5cba('0x0')]={'field':{'type':Sequelize[_0x5cba('0x1')]},'alias':{'type':Sequelize[_0x5cba('0x2')]},'function':{'type':Sequelize[_0x5cba('0x2')]},'format':{'type':Sequelize[_0x5cba('0x2')]},'groupBy':{'type':Sequelize[_0x5cba('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x5cba('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xd677=['TEXT','STRING','BOOLEAN','exports'];(function(_0x57fda8,_0x5e80a0){var _0x11c895=function(_0xd08d0e){while(--_0xd08d0e){_0x57fda8['push'](_0x57fda8['shift']());}};_0x11c895(++_0x5e80a0);}(_0xd677,0x9b));var _0x7d67=function(_0x29beb2,_0x37dc64){_0x29beb2=_0x29beb2-0x0;var _0x1d66d7=_0xd677[_0x29beb2];return _0x1d66d7;};'use strict';var Sequelize=require('sequelize');module[_0x7d67('0x0')]={'field':{'type':Sequelize[_0x7d67('0x1')]},'alias':{'type':Sequelize[_0x7d67('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7d67('0x2')]},'groupBy':{'type':Sequelize[_0x7d67('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7d67('0x2')]},'custom':{'type':Sequelize[_0x7d67('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index da3e6b0..8b9a0f3 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 _0xad1b=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','bulkCreate','addFields','sequelize','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','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','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes'];(function(_0x5a0119,_0x5659d8){var _0x2f835a=function(_0xaf917c){while(--_0xaf917c){_0x5a0119['push'](_0x5a0119['shift']());}};_0x2f835a(++_0x5659d8);}(_0xad1b,0x164));var _0xbad1=function(_0x3520f7,_0x541650){_0x3520f7=_0x3520f7-0x0;var _0x14b6db=_0xad1b[_0x3520f7];return _0x14b6db;};'use strict';var emlformat=require(_0xbad1('0x0'));var rimraf=require(_0xbad1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbad1('0x2'));var rp=require('request-promise');var moment=require(_0xbad1('0x3'));var BPromise=require(_0xbad1('0x4'));var Mustache=require(_0xbad1('0x5'));var util=require('util');var path=require(_0xbad1('0x6'));var sox=require(_0xbad1('0x7'));var csv=require(_0xbad1('0x8'));var ejs=require(_0xbad1('0x9'));var fs=require('fs');var fs_extra=require(_0xbad1('0xa'));var _=require(_0xbad1('0xb'));var squel=require(_0xbad1('0xc'));var crypto=require(_0xbad1('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbad1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbad1('0xf'));var Papa=require(_0xbad1('0x10'));var Redis=require(_0xbad1('0x11'));var authService=require(_0xbad1('0x12'));var qs=require(_0xbad1('0x13'));var as=require(_0xbad1('0x14'));var hardwareService=require(_0xbad1('0x15'));var logger=require(_0xbad1('0x16'))(_0xbad1('0x17'));var utils=require(_0xbad1('0x18'));var config=require(_0xbad1('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7be4bf,_0x43ac7a){_0x43ac7a=_0x43ac7a||0xcc;return function(_0x6dabee){if(_0x6dabee){return _0x7be4bf[_0xbad1('0x1a')](_0x43ac7a);}return _0x7be4bf[_0xbad1('0x1b')](_0x43ac7a)[_0xbad1('0x1c')]();};}function respondWithResult(_0x52d00a,_0x388335){_0x388335=_0x388335||0xc8;return function(_0x55e839){if(_0x55e839){return _0x52d00a[_0xbad1('0x1b')](_0x388335)[_0xbad1('0x1d')](_0x55e839);}};}function respondWithFilteredResult(_0x2747e0,_0x3d6aaa){return function(_0x2df816){if(_0x2df816){var _0x1d0d81=typeof _0x3d6aaa[_0xbad1('0x1e')]===_0xbad1('0x1f')&&typeof _0x3d6aaa[_0xbad1('0x20')]===_0xbad1('0x1f');var _0x24361a=_0x2df816[_0xbad1('0x21')];var _0x1d4364=_0x1d0d81?0x0:_0x3d6aaa[_0xbad1('0x1e')];var _0x495de6=_0x1d0d81?_0x2df816[_0xbad1('0x21')]:_0x3d6aaa['offset']+_0x3d6aaa[_0xbad1('0x20')];var _0xc2de25;if(_0x495de6>=_0x24361a){_0x495de6=_0x24361a;_0xc2de25=0xc8;}else{_0xc2de25=0xce;}_0x2747e0[_0xbad1('0x1b')](_0xc2de25);return _0x2747e0[_0xbad1('0x22')]('Content-Range',_0x1d4364+'-'+_0x495de6+'/'+_0x24361a)[_0xbad1('0x1d')](_0x2df816);}return null;};}function patchUpdates(_0x453e15){return function(_0x2caf92){try{jsonpatch['apply'](_0x2caf92,_0x453e15,!![]);}catch(_0x3840ab){return BPromise['reject'](_0x3840ab);}return _0x2caf92['save']();};}function saveUpdates(_0x206456,_0x4b6abd){return function(_0x1c98bd){if(_0x1c98bd){return _0x1c98bd[_0xbad1('0x23')](_0x206456)[_0xbad1('0x24')](function(_0x1c8e7b){return _0x1c8e7b;});}return null;};}function removeEntity(_0x1a0925,_0x2b3eee){return function(_0x5c4a4e){if(_0x5c4a4e){return _0x5c4a4e[_0xbad1('0x25')]()[_0xbad1('0x24')](function(){_0x1a0925['status'](0xcc)[_0xbad1('0x1c')]();});}};}function handleEntityNotFound(_0x10fd11,_0x18d313){return function(_0x42bfdf){if(!_0x42bfdf){_0x10fd11[_0xbad1('0x1a')](0x194);}return _0x42bfdf;};}function handleError(_0x105dbd,_0x3f6b04){_0x3f6b04=_0x3f6b04||0x1f4;return function(_0x133ee2){logger['error'](_0x133ee2[_0xbad1('0x26')]);if(_0x133ee2[_0xbad1('0x27')]){delete _0x133ee2[_0xbad1('0x27')];}_0x105dbd[_0xbad1('0x1b')](_0x3f6b04)[_0xbad1('0x28')](_0x133ee2);};}exports[_0xbad1('0x29')]=function(_0x498f23,_0x3e386b){var _0x4d71f1={},_0x41907a={},_0x16d034={'count':0x0,'rows':[]};var _0x208f45=_['map'](db[_0xbad1('0x2a')][_0xbad1('0x2b')],function(_0x28f65a){return{'name':_0x28f65a[_0xbad1('0x2c')],'type':_0x28f65a[_0xbad1('0x2d')][_0xbad1('0x2e')]};});_0x41907a[_0xbad1('0x2f')]=_[_0xbad1('0x30')](_0x208f45,_0xbad1('0x27'));_0x41907a[_0xbad1('0x31')]=_[_0xbad1('0x32')](_0x498f23['query']);_0x41907a[_0xbad1('0x33')]=_[_0xbad1('0x34')](_0x41907a[_0xbad1('0x2f')],_0x41907a[_0xbad1('0x31')]);_0x4d71f1[_0xbad1('0x35')]=_[_0xbad1('0x34')](_0x41907a[_0xbad1('0x2f')],qs[_0xbad1('0x36')](_0x498f23[_0xbad1('0x31')][_0xbad1('0x36')]));_0x4d71f1[_0xbad1('0x35')]=_0x4d71f1[_0xbad1('0x35')]['length']?_0x4d71f1[_0xbad1('0x35')]:_0x41907a[_0xbad1('0x2f')];if(!_0x498f23[_0xbad1('0x31')][_0xbad1('0x37')](_0xbad1('0x38'))){_0x4d71f1[_0xbad1('0x20')]=qs[_0xbad1('0x20')](_0x498f23[_0xbad1('0x31')][_0xbad1('0x20')]);_0x4d71f1[_0xbad1('0x1e')]=qs['offset'](_0x498f23[_0xbad1('0x31')][_0xbad1('0x1e')]);}_0x4d71f1['order']=qs[_0xbad1('0x39')](_0x498f23[_0xbad1('0x31')]['sort']);_0x4d71f1[_0xbad1('0x3a')]=qs[_0xbad1('0x33')](_[_0xbad1('0x3b')](_0x498f23['query'],_0x41907a[_0xbad1('0x33')]),_0x208f45);if(_0x498f23['query'][_0xbad1('0x3c')]){_0x4d71f1[_0xbad1('0x3a')]=_[_0xbad1('0x3d')](_0x4d71f1[_0xbad1('0x3a')],{'$or':_[_0xbad1('0x30')](_0x208f45,function(_0x3b4dde){if(_0x3b4dde['type']!==_0xbad1('0x3e')){var _0x48f7b7={};_0x48f7b7[_0x3b4dde[_0xbad1('0x27')]]={'$like':'%'+_0x498f23[_0xbad1('0x31')][_0xbad1('0x3c')]+'%'};return _0x48f7b7;}})});}_0x4d71f1=_['merge']({},_0x4d71f1,_0x498f23[_0xbad1('0x3f')]);var _0x386f5f={'where':_0x4d71f1[_0xbad1('0x3a')]};return db[_0xbad1('0x2a')][_0xbad1('0x21')](_0x386f5f)['then'](function(_0x5af18e){_0x16d034['count']=_0x5af18e;if(_0x498f23[_0xbad1('0x31')][_0xbad1('0x40')]){_0x4d71f1[_0xbad1('0x41')]=[{'all':!![]}];}return db[_0xbad1('0x2a')][_0xbad1('0x42')](_0x4d71f1);})[_0xbad1('0x24')](function(_0x267321){_0x16d034[_0xbad1('0x43')]=_0x267321;return _0x16d034;})[_0xbad1('0x24')](respondWithFilteredResult(_0x3e386b,_0x4d71f1))[_0xbad1('0x44')](handleError(_0x3e386b,null));};exports[_0xbad1('0x45')]=function(_0x2659a1,_0x582c0f){var _0x595350={'raw':![],'where':{'id':_0x2659a1[_0xbad1('0x46')]['id']}},_0x2add3d={};_0x2add3d[_0xbad1('0x2f')]=_['keys'](db['AnalyticFieldReport'][_0xbad1('0x2b')]);_0x2add3d['query']=_[_0xbad1('0x32')](_0x2659a1[_0xbad1('0x31')]);_0x2add3d[_0xbad1('0x33')]=_['intersection'](_0x2add3d[_0xbad1('0x2f')],_0x2add3d['query']);_0x595350[_0xbad1('0x35')]=_['intersection'](_0x2add3d[_0xbad1('0x2f')],qs[_0xbad1('0x36')](_0x2659a1[_0xbad1('0x31')]['fields']));_0x595350[_0xbad1('0x35')]=_0x595350[_0xbad1('0x35')][_0xbad1('0x47')]?_0x595350[_0xbad1('0x35')]:_0x2add3d[_0xbad1('0x2f')];if(_0x2659a1[_0xbad1('0x31')][_0xbad1('0x40')]){_0x595350['include']=[{'all':!![]}];}_0x595350=_['merge']({},_0x595350,_0x2659a1[_0xbad1('0x3f')]);return db[_0xbad1('0x2a')][_0xbad1('0x48')](_0x595350)[_0xbad1('0x24')](handleEntityNotFound(_0x582c0f,null))[_0xbad1('0x24')](respondWithResult(_0x582c0f,null))[_0xbad1('0x44')](handleError(_0x582c0f,null));};exports[_0xbad1('0x49')]=function(_0x26d9bc,_0x5b3a17){return db[_0xbad1('0x2a')][_0xbad1('0x49')](_0x26d9bc[_0xbad1('0x4a')],{})['then'](respondWithResult(_0x5b3a17,0xc9))['catch'](handleError(_0x5b3a17,null));};exports[_0xbad1('0x4b')]=function(_0x10c0a8,_0x3e61dc){return db['AnalyticFieldReport'][_0xbad1('0x4b')](_0x10c0a8[_0xbad1('0x4a')],{'raw':![],'individualHooks':!![]})[_0xbad1('0x24')](respondWithResult(_0x3e61dc,0xc9))[_0xbad1('0x44')](handleError(_0x3e61dc,null));};exports[_0xbad1('0x23')]=function(_0x53a00b,_0x5a46b4){if(_0x53a00b['body']['id']){delete _0x53a00b['body']['id'];}return db[_0xbad1('0x2a')][_0xbad1('0x48')]({'where':{'id':_0x53a00b['params']['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x5a46b4,null))[_0xbad1('0x24')](saveUpdates(_0x53a00b[_0xbad1('0x4a')],null))[_0xbad1('0x24')](respondWithResult(_0x5a46b4,null))[_0xbad1('0x44')](handleError(_0x5a46b4,null));};exports[_0xbad1('0x25')]=function(_0x40a309,_0x184435){return db[_0xbad1('0x2a')][_0xbad1('0x48')]({'where':{'id':_0x40a309[_0xbad1('0x46')]['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x184435,null))[_0xbad1('0x24')](removeEntity(_0x184435,null))[_0xbad1('0x44')](handleError(_0x184435,null));};exports['bulkDestroy']=function(_0x2210ea,_0xe32c1a){return db[_0xbad1('0x2a')]['destroy']({'where':{'id':_0x2210ea[_0xbad1('0x31')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xbad1('0x24')](respondWithResult(_0xe32c1a,0xcc))[_0xbad1('0x44')](handleError(_0xe32c1a,null));};exports[_0xbad1('0x4c')]=function(_0x538eef,_0x20bd4f,_0x5d33dc){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x538eef[_0xbad1('0x46')]['id']}})[_0xbad1('0x24')](handleEntityNotFound(_0x20bd4f,null))[_0xbad1('0x24')](function(_0x216f1b){if(_0x216f1b){return db[_0xbad1('0x4d')][_0xbad1('0x4e')](function(_0xaeda4e){return db[_0xbad1('0x2a')][_0xbad1('0x25')]({'where':{'CustomReportId':_0x538eef[_0xbad1('0x46')]['id']},'transaction':_0xaeda4e})[_0xbad1('0x24')](function(_0x5f6be3){var _0x1449c2=_[_0xbad1('0x30')](_0x538eef[_0xbad1('0x4a')],function(_0x31f9ef){delete _0x31f9ef['id'];_0x31f9ef[_0xbad1('0x4f')]=_0x538eef[_0xbad1('0x46')]['id'];return _0x31f9ef;});return db['AnalyticFieldReport'][_0xbad1('0x4b')](_0x1449c2,{'transaction':_0xaeda4e});});})[_0xbad1('0x24')](function(){return db['AnalyticFieldReport'][_0xbad1('0x42')]({'where':{'CustomReportId':_0x538eef[_0xbad1('0x46')]['id']}});});}})[_0xbad1('0x24')](respondWithResult(_0x20bd4f,null))[_0xbad1('0x44')](handleError(_0x20bd4f,null));};
\ No newline at end of file
+var _0xd4bd=['catch','create','body','bulkCreate','update','ids','addFields','AnalyticCustomReport','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','AnalyticFieldReport','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','where','filters','pick','type','VIRTUAL','filter','merge','includeAll','include','findAll','show','params','keys','rawAttributes','options','find'];(function(_0x172f2e,_0x270e87){var _0x34390a=function(_0x6dc1b9){while(--_0x6dc1b9){_0x172f2e['push'](_0x172f2e['shift']());}};_0x34390a(++_0x270e87);}(_0xd4bd,0x1a3));var _0xdd4b=function(_0x2ddd5a,_0x132cea){_0x2ddd5a=_0x2ddd5a-0x0;var _0x35a682=_0xd4bd[_0x2ddd5a];return _0x35a682;};'use strict';var emlformat=require(_0xdd4b('0x0'));var rimraf=require(_0xdd4b('0x1'));var zipdir=require(_0xdd4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdd4b('0x3'));var moment=require(_0xdd4b('0x4'));var BPromise=require(_0xdd4b('0x5'));var Mustache=require(_0xdd4b('0x6'));var util=require(_0xdd4b('0x7'));var path=require('path');var sox=require(_0xdd4b('0x8'));var csv=require(_0xdd4b('0x9'));var ejs=require(_0xdd4b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd4b('0xb'));var squel=require(_0xdd4b('0xc'));var crypto=require(_0xdd4b('0xd'));var jsforce=require(_0xdd4b('0xe'));var deskjs=require(_0xdd4b('0xf'));var toCsv=require(_0xdd4b('0x9'));var querystring=require(_0xdd4b('0x10'));var Papa=require(_0xdd4b('0x11'));var Redis=require(_0xdd4b('0x12'));var authService=require(_0xdd4b('0x13'));var qs=require(_0xdd4b('0x14'));var as=require(_0xdd4b('0x15'));var hardwareService=require(_0xdd4b('0x16'));var logger=require(_0xdd4b('0x17'))('api');var utils=require(_0xdd4b('0x18'));var config=require(_0xdd4b('0x19'));var licenseUtil=require(_0xdd4b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219bc1,_0x2a5b91){_0x2a5b91=_0x2a5b91||0xcc;return function(_0x137b08){if(_0x137b08){return _0x219bc1['sendStatus'](_0x2a5b91);}return _0x219bc1[_0xdd4b('0x1b')](_0x2a5b91)[_0xdd4b('0x1c')]();};}function respondWithResult(_0xd4cbb2,_0x5aa922){_0x5aa922=_0x5aa922||0xc8;return function(_0x41463c){if(_0x41463c){return _0xd4cbb2[_0xdd4b('0x1b')](_0x5aa922)[_0xdd4b('0x1d')](_0x41463c);}};}function respondWithFilteredResult(_0x278b85,_0x971ce7){return function(_0x503cc0){if(_0x503cc0){var _0x35b067=typeof _0x971ce7[_0xdd4b('0x1e')]===_0xdd4b('0x1f')&&typeof _0x971ce7[_0xdd4b('0x20')]==='undefined';var _0x1dd579=_0x503cc0[_0xdd4b('0x21')];var _0x13c075=_0x35b067?0x0:_0x971ce7[_0xdd4b('0x1e')];var _0xdd9229=_0x35b067?_0x503cc0[_0xdd4b('0x21')]:_0x971ce7[_0xdd4b('0x1e')]+_0x971ce7[_0xdd4b('0x20')];var _0x1d7045;if(_0xdd9229>=_0x1dd579){_0xdd9229=_0x1dd579;_0x1d7045=0xc8;}else{_0x1d7045=0xce;}_0x278b85[_0xdd4b('0x1b')](_0x1d7045);return _0x278b85[_0xdd4b('0x22')](_0xdd4b('0x23'),_0x13c075+'-'+_0xdd9229+'/'+_0x1dd579)['json'](_0x503cc0);}return null;};}function patchUpdates(_0x5d7eec){return function(_0x8a21b0){try{jsonpatch[_0xdd4b('0x24')](_0x8a21b0,_0x5d7eec,!![]);}catch(_0x252b5a){return BPromise[_0xdd4b('0x25')](_0x252b5a);}return _0x8a21b0[_0xdd4b('0x26')]();};}function saveUpdates(_0x35f334,_0x39d542){return function(_0x3526ea){if(_0x3526ea){return _0x3526ea['update'](_0x35f334)[_0xdd4b('0x27')](function(_0x1c76c5){return _0x1c76c5;});}return null;};}function removeEntity(_0x50afdf,_0x316aed){return function(_0x1cd417){if(_0x1cd417){return _0x1cd417[_0xdd4b('0x28')]()[_0xdd4b('0x27')](function(){_0x50afdf['status'](0xcc)[_0xdd4b('0x1c')]();});}};}function handleEntityNotFound(_0x24a5df,_0x4314a7){return function(_0x57e3e3){if(!_0x57e3e3){_0x24a5df[_0xdd4b('0x29')](0x194);}return _0x57e3e3;};}function handleError(_0x3daba9,_0x35fdfc){_0x35fdfc=_0x35fdfc||0x1f4;return function(_0xd7c3cc){logger[_0xdd4b('0x2a')](_0xd7c3cc[_0xdd4b('0x2b')]);if(_0xd7c3cc[_0xdd4b('0x2c')]){delete _0xd7c3cc[_0xdd4b('0x2c')];}_0x3daba9[_0xdd4b('0x1b')](_0x35fdfc)[_0xdd4b('0x2d')](_0xd7c3cc);};}exports['index']=function(_0x38bab5,_0x4017a2){var _0x41bee3={},_0x3fc4f1={},_0x42f306={'count':0x0,'rows':[]};var _0x154567=_[_0xdd4b('0x2e')](db[_0xdd4b('0x2f')]['rawAttributes'],function(_0x463485){return{'name':_0x463485['fieldName'],'type':_0x463485['type'][_0xdd4b('0x30')]};});_0x3fc4f1['model']=_[_0xdd4b('0x2e')](_0x154567,_0xdd4b('0x2c'));_0x3fc4f1['query']=_['keys'](_0x38bab5[_0xdd4b('0x31')]);_0x3fc4f1['filters']=_[_0xdd4b('0x32')](_0x3fc4f1[_0xdd4b('0x33')],_0x3fc4f1['query']);_0x41bee3[_0xdd4b('0x34')]=_['intersection'](_0x3fc4f1['model'],qs[_0xdd4b('0x35')](_0x38bab5[_0xdd4b('0x31')][_0xdd4b('0x35')]));_0x41bee3[_0xdd4b('0x34')]=_0x41bee3[_0xdd4b('0x34')][_0xdd4b('0x36')]?_0x41bee3[_0xdd4b('0x34')]:_0x3fc4f1[_0xdd4b('0x33')];if(!_0x38bab5[_0xdd4b('0x31')][_0xdd4b('0x37')]('nolimit')){_0x41bee3['limit']=qs[_0xdd4b('0x20')](_0x38bab5[_0xdd4b('0x31')][_0xdd4b('0x20')]);_0x41bee3[_0xdd4b('0x1e')]=qs['offset'](_0x38bab5['query'][_0xdd4b('0x1e')]);}_0x41bee3[_0xdd4b('0x38')]=qs['sort'](_0x38bab5['query']['sort']);_0x41bee3[_0xdd4b('0x39')]=qs[_0xdd4b('0x3a')](_[_0xdd4b('0x3b')](_0x38bab5[_0xdd4b('0x31')],_0x3fc4f1['filters']),_0x154567);if(_0x38bab5['query']['filter']){_0x41bee3['where']=_['merge'](_0x41bee3['where'],{'$or':_[_0xdd4b('0x2e')](_0x154567,function(_0x237e4c){if(_0x237e4c[_0xdd4b('0x3c')]!==_0xdd4b('0x3d')){var _0x4821dd={};_0x4821dd[_0x237e4c[_0xdd4b('0x2c')]]={'$like':'%'+_0x38bab5['query'][_0xdd4b('0x3e')]+'%'};return _0x4821dd;}})});}_0x41bee3=_[_0xdd4b('0x3f')]({},_0x41bee3,_0x38bab5['options']);var _0x157eca={'where':_0x41bee3[_0xdd4b('0x39')]};return db[_0xdd4b('0x2f')][_0xdd4b('0x21')](_0x157eca)[_0xdd4b('0x27')](function(_0x4d5fdb){_0x42f306[_0xdd4b('0x21')]=_0x4d5fdb;if(_0x38bab5[_0xdd4b('0x31')][_0xdd4b('0x40')]){_0x41bee3[_0xdd4b('0x41')]=[{'all':!![]}];}return db[_0xdd4b('0x2f')][_0xdd4b('0x42')](_0x41bee3);})[_0xdd4b('0x27')](function(_0x292d95){_0x42f306['rows']=_0x292d95;return _0x42f306;})[_0xdd4b('0x27')](respondWithFilteredResult(_0x4017a2,_0x41bee3))['catch'](handleError(_0x4017a2,null));};exports[_0xdd4b('0x43')]=function(_0x4cac98,_0x2e7efc){var _0x2874f7={'raw':![],'where':{'id':_0x4cac98[_0xdd4b('0x44')]['id']}},_0x1de4a3={};_0x1de4a3[_0xdd4b('0x33')]=_[_0xdd4b('0x45')](db[_0xdd4b('0x2f')][_0xdd4b('0x46')]);_0x1de4a3[_0xdd4b('0x31')]=_[_0xdd4b('0x45')](_0x4cac98['query']);_0x1de4a3[_0xdd4b('0x3a')]=_[_0xdd4b('0x32')](_0x1de4a3['model'],_0x1de4a3[_0xdd4b('0x31')]);_0x2874f7[_0xdd4b('0x34')]=_[_0xdd4b('0x32')](_0x1de4a3['model'],qs[_0xdd4b('0x35')](_0x4cac98[_0xdd4b('0x31')][_0xdd4b('0x35')]));_0x2874f7[_0xdd4b('0x34')]=_0x2874f7[_0xdd4b('0x34')]['length']?_0x2874f7[_0xdd4b('0x34')]:_0x1de4a3[_0xdd4b('0x33')];if(_0x4cac98[_0xdd4b('0x31')][_0xdd4b('0x40')]){_0x2874f7['include']=[{'all':!![]}];}_0x2874f7=_[_0xdd4b('0x3f')]({},_0x2874f7,_0x4cac98[_0xdd4b('0x47')]);return db[_0xdd4b('0x2f')][_0xdd4b('0x48')](_0x2874f7)['then'](handleEntityNotFound(_0x2e7efc,null))[_0xdd4b('0x27')](respondWithResult(_0x2e7efc,null))[_0xdd4b('0x49')](handleError(_0x2e7efc,null));};exports['create']=function(_0x9bd654,_0x370383){return db[_0xdd4b('0x2f')][_0xdd4b('0x4a')](_0x9bd654[_0xdd4b('0x4b')],{})[_0xdd4b('0x27')](respondWithResult(_0x370383,0xc9))[_0xdd4b('0x49')](handleError(_0x370383,null));};exports['bulkCreate']=function(_0x1aa94b,_0x200b26){return db[_0xdd4b('0x2f')][_0xdd4b('0x4c')](_0x1aa94b[_0xdd4b('0x4b')],{'raw':![],'individualHooks':!![]})[_0xdd4b('0x27')](respondWithResult(_0x200b26,0xc9))[_0xdd4b('0x49')](handleError(_0x200b26,null));};exports[_0xdd4b('0x4d')]=function(_0x120241,_0x3c5420){if(_0x120241[_0xdd4b('0x4b')]['id']){delete _0x120241[_0xdd4b('0x4b')]['id'];}return db[_0xdd4b('0x2f')][_0xdd4b('0x48')]({'where':{'id':_0x120241[_0xdd4b('0x44')]['id']}})[_0xdd4b('0x27')](handleEntityNotFound(_0x3c5420,null))[_0xdd4b('0x27')](saveUpdates(_0x120241[_0xdd4b('0x4b')],null))['then'](respondWithResult(_0x3c5420,null))[_0xdd4b('0x49')](handleError(_0x3c5420,null));};exports[_0xdd4b('0x28')]=function(_0x5cfc8a,_0x2f7768){return db[_0xdd4b('0x2f')][_0xdd4b('0x48')]({'where':{'id':_0x5cfc8a[_0xdd4b('0x44')]['id']}})[_0xdd4b('0x27')](handleEntityNotFound(_0x2f7768,null))[_0xdd4b('0x27')](removeEntity(_0x2f7768,null))[_0xdd4b('0x49')](handleError(_0x2f7768,null));};exports['bulkDestroy']=function(_0x454c3e,_0x1cf2fc){return db[_0xdd4b('0x2f')]['destroy']({'where':{'id':_0x454c3e[_0xdd4b('0x31')][_0xdd4b('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xdd4b('0x27')](respondWithResult(_0x1cf2fc,0xcc))['catch'](handleError(_0x1cf2fc,null));};exports[_0xdd4b('0x4f')]=function(_0x41b9a6,_0x38a7db,_0x6764eb){return db[_0xdd4b('0x50')][_0xdd4b('0x51')]({'where':{'id':_0x41b9a6['params']['id']}})[_0xdd4b('0x27')](handleEntityNotFound(_0x38a7db,null))[_0xdd4b('0x27')](function(_0x10ad1b){if(_0x10ad1b){return db['sequelize']['transaction'](function(_0xf6ae24){return db[_0xdd4b('0x2f')][_0xdd4b('0x28')]({'where':{'CustomReportId':_0x41b9a6['params']['id']},'transaction':_0xf6ae24})[_0xdd4b('0x27')](function(_0x297878){var _0x1cc00c=_[_0xdd4b('0x2e')](_0x41b9a6['body'],function(_0x9e65ce){delete _0x9e65ce['id'];_0x9e65ce['CustomReportId']=_0x41b9a6['params']['id'];return _0x9e65ce;});return db['AnalyticFieldReport'][_0xdd4b('0x4c')](_0x1cc00c,{'transaction':_0xf6ae24});});})[_0xdd4b('0x27')](function(){return db[_0xdd4b('0x2f')]['findAll']({'where':{'CustomReportId':_0x41b9a6[_0xdd4b('0x44')]['id']}});});}})['then'](respondWithResult(_0x38a7db,null))['catch'](handleError(_0x38a7db,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 20260cf..0ac8485 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 _0xf663=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0xf663,0xff));var _0x3f66=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0xf663[_0x3f3a47];return _0x57a682;};'use strict';var _=require(_0x3f66('0x0'));var util=require(_0x3f66('0x1'));var logger=require(_0x3f66('0x2'))('api');var moment=require(_0x3f66('0x3'));var BPromise=require(_0x3f66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f66('0x5'));var rimraf=require(_0x3f66('0x6'));var config=require(_0x3f66('0x7'));var attributes=require(_0x3f66('0x8'));module[_0x3f66('0x9')]=function(_0x28e10f,_0x48e49a){return _0x28e10f[_0x3f66('0xa')](_0x3f66('0xb'),attributes,{'tableName':_0x3f66('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d30=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0x6d30,0xa2));var _0x06d3=function(_0x354fc7,_0x10bd45){_0x354fc7=_0x354fc7-0x0;var _0x462135=_0x6d30[_0x354fc7];return _0x462135;};'use strict';var _=require(_0x06d3('0x0'));var util=require(_0x06d3('0x1'));var logger=require('../../config/logger')(_0x06d3('0x2'));var moment=require('moment');var BPromise=require(_0x06d3('0x3'));var rp=require(_0x06d3('0x4'));var fs=require('fs');var path=require(_0x06d3('0x5'));var rimraf=require(_0x06d3('0x6'));var config=require(_0x06d3('0x7'));var attributes=require(_0x06d3('0x8'));module[_0x06d3('0x9')]=function(_0x3b512a,_0x299388){return _0x3b512a[_0x06d3('0xa')](_0x06d3('0xb'),attributes,{'tableName':_0x06d3('0xc'),'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 98741c8..17b3909 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 _0x360a=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3f9f46,_0x49f6d2){var _0x2c9e54=function(_0x2f41a5){while(--_0x2f41a5){_0x3f9f46['push'](_0x3f9f46['shift']());}};_0x2c9e54(++_0x49f6d2);}(_0x360a,0x169));var _0xa360=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x360a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa360('0x0'));var util=require(_0xa360('0x1'));var moment=require(_0xa360('0x2'));var BPromise=require(_0xa360('0x3'));var rs=require(_0xa360('0x4'));var fs=require('fs');var Redis=require(_0xa360('0x5'));var db=require(_0xa360('0x6'))['db'];var utils=require(_0xa360('0x7'));var logger=require(_0xa360('0x8'))(_0xa360('0x9'));var config=require(_0xa360('0xa'));var jayson=require(_0xa360('0xb'));var client=jayson[_0xa360('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11855c,_0x408cf2,_0xe64fbf){return new BPromise(function(_0x5926b7,_0x5583e){return client['request'](_0x11855c,_0xe64fbf)[_0xa360('0xd')](function(_0xa4b13e){logger[_0xa360('0xe')](_0xa360('0xf'),_0x408cf2,_0xa360('0x10'));logger[_0xa360('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x408cf2,_0xa360('0x10'),JSON[_0xa360('0x12')](_0xa4b13e));if(_0xa4b13e[_0xa360('0x13')]){if(_0xa4b13e[_0xa360('0x13')][_0xa360('0x14')]===0x1f4){logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0xa4b13e['error']['message']);return _0x5583e(_0xa4b13e[_0xa360('0x13')][_0xa360('0x15')]);}logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0xa4b13e[_0xa360('0x13')][_0xa360('0x15')]);return _0x5926b7(_0xa4b13e['error']['message']);}else{logger['info'](_0xa360('0xf'),_0x408cf2,'request\x20sent');_0x5926b7(_0xa4b13e[_0xa360('0x16')]['message']);}})['catch'](function(_0x3254c5){logger[_0xa360('0x13')](_0xa360('0xf'),_0x408cf2,_0x3254c5);_0x5583e(_0x3254c5);});});}
\ No newline at end of file
+var _0x3a7b=['rpc','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x561134,_0x287a49){var _0x5587f3=function(_0x4c8214){while(--_0x4c8214){_0x561134['push'](_0x561134['shift']());}};_0x5587f3(++_0x287a49);}(_0x3a7b,0xcb));var _0xb3a7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x3a7b[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xb3a7('0x0'));var moment=require(_0xb3a7('0x1'));var BPromise=require(_0xb3a7('0x2'));var rs=require(_0xb3a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3a7('0x4'))['db'];var utils=require(_0xb3a7('0x5'));var logger=require(_0xb3a7('0x6'))(_0xb3a7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb3a7('0x8')][_0xb3a7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41546a,_0x21eb63,_0x57e4cf){return new BPromise(function(_0x10e3e4,_0x5ec03d){return client[_0xb3a7('0xa')](_0x41546a,_0x57e4cf)['then'](function(_0x4ac4f3){logger[_0xb3a7('0xb')](_0xb3a7('0xc'),_0x21eb63,'request\x20sent');logger[_0xb3a7('0xd')](_0xb3a7('0xe'),_0x21eb63,_0xb3a7('0xf'),JSON[_0xb3a7('0x10')](_0x4ac4f3));if(_0x4ac4f3['error']){if(_0x4ac4f3[_0xb3a7('0x11')][_0xb3a7('0x12')]===0x1f4){logger[_0xb3a7('0x11')](_0xb3a7('0xc'),_0x21eb63,_0x4ac4f3[_0xb3a7('0x11')][_0xb3a7('0x13')]);return _0x5ec03d(_0x4ac4f3[_0xb3a7('0x11')][_0xb3a7('0x13')]);}logger[_0xb3a7('0x11')](_0xb3a7('0xc'),_0x21eb63,_0x4ac4f3[_0xb3a7('0x11')]['message']);return _0x10e3e4(_0x4ac4f3[_0xb3a7('0x11')][_0xb3a7('0x13')]);}else{logger[_0xb3a7('0xb')](_0xb3a7('0xc'),_0x21eb63,_0xb3a7('0xf'));_0x10e3e4(_0x4ac4f3[_0xb3a7('0x14')][_0xb3a7('0x13')]);}})['catch'](function(_0x5264b8){logger[_0xb3a7('0x11')](_0xb3a7('0xc'),_0x21eb63,_0x5264b8);_0x5ec03d(_0x5264b8);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index b4a9ec7..781763b 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(_0x12e09c,_0x41e3f2){var _0x559e70=function(_0x3fb2da){while(--_0x3fb2da){_0x12e09c['push'](_0x12e09c['shift']());}};_0x559e70(++_0x41e3f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x3aa041,_0x56b55c){var _0x3b6837=function(_0x24b142){while(--_0x24b142){_0x3aa041['push'](_0x3aa041['shift']());}};_0x3b6837(++_0x56b55c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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 75f3655..ba85f07 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 _0xbdb7=['name','TEXT','sequelize','exports','STRING'];(function(_0x5c8736,_0x2a2a03){var _0x142bdb=function(_0x406951){while(--_0x406951){_0x5c8736['push'](_0x5c8736['shift']());}};_0x142bdb(++_0x2a2a03);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0xbdb7[_0x1d29f6];return _0x491093;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'allowNull':![],'unique':_0x7bdb('0x3')},'table':{'type':Sequelize[_0x7bdb('0x2')]},'metric':{'type':Sequelize[_0x7bdb('0x4')]},'description':{'type':Sequelize[_0x7bdb('0x2')]}};
\ No newline at end of file
+var _0x50c1=['TEXT','sequelize','name','STRING'];(function(_0x396245,_0x22c863){var _0x353760=function(_0x80d10c){while(--_0x80d10c){_0x396245['push'](_0x396245['shift']());}};_0x353760(++_0x22c863);}(_0x50c1,0x1a5));var _0x150c=function(_0x171595,_0x5cf384){_0x171595=_0x171595-0x0;var _0x209861=_0x50c1[_0x171595];return _0x209861;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x150c('0x1')},'table':{'type':Sequelize[_0x150c('0x2')]},'metric':{'type':Sequelize[_0x150c('0x3')]},'description':{'type':Sequelize[_0x150c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index ff4f405..653cf9f 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 _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x504d47,_0x5e604b){var _0x55cba4=function(_0xb7e707){while(--_0xb7e707){_0x504d47['push'](_0x504d47['shift']());}};_0x55cba4(++_0x5e604b);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xf2ca[_0x143a91];return _0x1906f5;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
+var _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','status','end','json','offset','undefined','limit','count','set'];(function(_0x3d2aaf,_0x208755){var _0x7bc601=function(_0xa0e936){while(--_0xa0e936){_0x3d2aaf['push'](_0x3d2aaf['shift']());}};_0x7bc601(++_0x208755);}(_0x7217,0x19e));var _0x7721=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7217[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 1f98fc4..5fd9115 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 _0xb2ad=['path','../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','util','api','moment','bluebird','request-promise'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x15afeb,_0x3eb360){_0x15afeb=_0x15afeb-0x0;var _0x3ce58d=_0xb2ad[_0x15afeb];return _0x3ce58d;};'use strict';var _=require('lodash');var util=require(_0xdb2a('0x0'));var logger=require('../../config/logger')(_0xdb2a('0x1'));var moment=require(_0xdb2a('0x2'));var BPromise=require(_0xdb2a('0x3'));var rp=require(_0xdb2a('0x4'));var fs=require('fs');var path=require(_0xdb2a('0x5'));var rimraf=require('rimraf');var config=require(_0xdb2a('0x6'));var attributes=require(_0xdb2a('0x7'));module[_0xdb2a('0x8')]=function(_0x1f9551,_0x5c69b1){return _0x1f9551['define']('AnalyticMetric',attributes,{'tableName':_0xdb2a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0650=['bluebird','path','rimraf','../../config/environment','exports','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x0650,0xed));var _0x0065=function(_0x33a140,_0x477198){_0x33a140=_0x33a140-0x0;var _0x47157e=_0x0650[_0x33a140];return _0x47157e;};'use strict';var _=require(_0x0065('0x0'));var util=require('util');var logger=require(_0x0065('0x1'))(_0x0065('0x2'));var moment=require('moment');var BPromise=require(_0x0065('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0065('0x4'));var rimraf=require(_0x0065('0x5'));var config=require(_0x0065('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x0065('0x7')]=function(_0x507ed3,_0x5cf16e){return _0x507ed3['define'](_0x0065('0x8'),attributes,{'tableName':_0x0065('0x9'),'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 e2d7584..d803c31 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 _0x7f9c=['error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','code'];(function(_0x23c73d,_0x357b21){var _0x36ba47=function(_0x317b8e){while(--_0x317b8e){_0x23c73d['push'](_0x23c73d['shift']());}};_0x36ba47(++_0x357b21);}(_0x7f9c,0x9e));var _0xc7f9=function(_0x33e5e2,_0x10d7a8){_0x33e5e2=_0x33e5e2-0x0;var _0x21e5af=_0x7f9c[_0x33e5e2];return _0x21e5af;};'use strict';var _=require('lodash');var util=require(_0xc7f9('0x0'));var moment=require(_0xc7f9('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7f9('0x2'));var fs=require('fs');var Redis=require(_0xc7f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc7f9('0x4'));var logger=require(_0xc7f9('0x5'))(_0xc7f9('0x6'));var config=require(_0xc7f9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc7f9('0x8')][_0xc7f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e7d17,_0x3e7d2a,_0x494665){return new BPromise(function(_0x32e53a,_0x5b3e36){return client[_0xc7f9('0xa')](_0x3e7d17,_0x494665)[_0xc7f9('0xb')](function(_0x4004fb){logger[_0xc7f9('0xc')](_0xc7f9('0xd'),_0x3e7d2a,_0xc7f9('0xe'));logger[_0xc7f9('0xf')](_0xc7f9('0x10'),_0x3e7d2a,_0xc7f9('0xe'),JSON['stringify'](_0x4004fb));if(_0x4004fb['error']){if(_0x4004fb['error'][_0xc7f9('0x11')]===0x1f4){logger['error'](_0xc7f9('0xd'),_0x3e7d2a,_0x4004fb[_0xc7f9('0x12')]['message']);return _0x5b3e36(_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);}logger[_0xc7f9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3e7d2a,_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);return _0x32e53a(_0x4004fb[_0xc7f9('0x12')][_0xc7f9('0x13')]);}else{logger[_0xc7f9('0xc')](_0xc7f9('0xd'),_0x3e7d2a,'request\x20sent');_0x32e53a(_0x4004fb[_0xc7f9('0x14')][_0xc7f9('0x13')]);}})[_0xc7f9('0x15')](function(_0x53efd2){logger[_0xc7f9('0x12')](_0xc7f9('0xd'),_0x3e7d2a,_0x53efd2);_0x5b3e36(_0x53efd2);});});}
\ No newline at end of file
+var _0xcb5c=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x3c42c6,_0x4e0d2e){var _0x1ddfc6=function(_0x38291f){while(--_0x38291f){_0x3c42c6['push'](_0x3c42c6['shift']());}};_0x1ddfc6(++_0x4e0d2e);}(_0xcb5c,0x179));var _0xccb5=function(_0x57f601,_0x35d28a){_0x57f601=_0x57f601-0x0;var _0x208e78=_0xcb5c[_0x57f601];return _0x208e78;};'use strict';var _=require('lodash');var util=require(_0xccb5('0x0'));var moment=require(_0xccb5('0x1'));var BPromise=require('bluebird');var rs=require(_0xccb5('0x2'));var fs=require('fs');var Redis=require(_0xccb5('0x3'));var db=require(_0xccb5('0x4'))['db'];var utils=require(_0xccb5('0x5'));var logger=require('../../config/logger')(_0xccb5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xccb5('0x7')][_0xccb5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69e238,_0x47979,_0x3a190e){return new BPromise(function(_0x5b70c2,_0x1430a7){return client[_0xccb5('0x9')](_0x69e238,_0x3a190e)[_0xccb5('0xa')](function(_0x364266){logger[_0xccb5('0xb')](_0xccb5('0xc'),_0x47979,_0xccb5('0xd'));logger[_0xccb5('0xe')](_0xccb5('0xf'),_0x47979,_0xccb5('0xd'),JSON[_0xccb5('0x10')](_0x364266));if(_0x364266[_0xccb5('0x11')]){if(_0x364266['error'][_0xccb5('0x12')]===0x1f4){logger[_0xccb5('0x11')](_0xccb5('0xc'),_0x47979,_0x364266['error']['message']);return _0x1430a7(_0x364266['error'][_0xccb5('0x13')]);}logger[_0xccb5('0x11')](_0xccb5('0xc'),_0x47979,_0x364266[_0xccb5('0x11')][_0xccb5('0x13')]);return _0x5b70c2(_0x364266['error'][_0xccb5('0x13')]);}else{logger[_0xccb5('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x47979,'request\x20sent');_0x5b70c2(_0x364266['result'][_0xccb5('0x13')]);}})[_0xccb5('0x14')](function(_0x3bb50e){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x47979,_0x3bb50e);_0x1430a7(_0x3bb50e);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index a62a576..16644f2 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 _0x624c=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy'];(function(_0x542641,_0x7615ab){var _0x26a17a=function(_0x340089){while(--_0x340089){_0x542641['push'](_0x542641['shift']());}};_0x26a17a(++_0x7615ab);}(_0x624c,0x1ee));var _0xc624=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x624c[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0xc624('0x0'));var path=require(_0xc624('0x1'));var timeout=require(_0xc624('0x2'));var express=require(_0xc624('0x3'));var router=express[_0xc624('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc624('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc624('0x6'));var controller=require('./analyticMetric.controller');router[_0xc624('0x7')]('/',auth[_0xc624('0x8')](),controller[_0xc624('0x9')]);router[_0xc624('0x7')](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xb')]);router['post']('/',auth[_0xc624('0x8')](),controller[_0xc624('0xc')]);router[_0xc624('0xd')]('/:id',auth[_0xc624('0x8')](),controller[_0xc624('0xe')]);router['delete'](_0xc624('0xa'),auth[_0xc624('0x8')](),controller[_0xc624('0xf')]);module[_0xc624('0x10')]=router;
\ No newline at end of file
+var _0x1134=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2b5cc4,_0x3de7f8){var _0x3c7a90=function(_0x5477e7){while(--_0x5477e7){_0x2b5cc4['push'](_0x2b5cc4['shift']());}};_0x3c7a90(++_0x3de7f8);}(_0x1134,0x19c));var _0x4113=function(_0x536c97,_0x5d0742){_0x536c97=_0x536c97-0x0;var _0x12081c=_0x1134[_0x536c97];return _0x12081c;};'use strict';var multer=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var path=require('path');var timeout=require(_0x4113('0x2'));var express=require(_0x4113('0x3'));var router=express['Router']();var fs_extra=require(_0x4113('0x4'));var auth=require(_0x4113('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4113('0x6'));var controller=require('./analyticMetric.controller');router[_0x4113('0x7')]('/',auth['isAuthenticated'](),controller[_0x4113('0x8')]);router['get'](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0xb')]);router[_0x4113('0xc')]('/',auth[_0x4113('0xa')](),controller[_0x4113('0xd')]);router[_0x4113('0xe')](_0x4113('0x9'),auth['isAuthenticated'](),controller[_0x4113('0xf')]);router[_0x4113('0x10')](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0x11')]);module[_0x4113('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 852cf4b..39ee626 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 _0x7717=['exports','TEXT','sequelize'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x7717,0x11f));var _0x7771=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7717[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7771('0x0'));module[_0x7771('0x1')]={'tree':{'type':Sequelize[_0x7771('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7846=['exports','TEXT'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7846,0xf4));var _0x6784=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0x7846[_0x5f12fd];return _0x58bd80;};'use strict';var Sequelize=require('sequelize');module[_0x6784('0x0')]={'tree':{'type':Sequelize[_0x6784('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index a9a7a48..f3004e8 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 _0x6584=['Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x6584,0xc9));var _0x4658=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x6584[_0x1b349a];return _0x5d1f7c;};'use strict';var emlformat=require(_0x4658('0x0'));var rimraf=require(_0x4658('0x1'));var zipdir=require(_0x4658('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4658('0x3'));var moment=require(_0x4658('0x4'));var BPromise=require(_0x4658('0x5'));var Mustache=require(_0x4658('0x6'));var util=require(_0x4658('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4658('0x8'));var ejs=require(_0x4658('0x9'));var fs=require('fs');var fs_extra=require(_0x4658('0xa'));var _=require(_0x4658('0xb'));var squel=require(_0x4658('0xc'));var crypto=require(_0x4658('0xd'));var jsforce=require(_0x4658('0xe'));var deskjs=require(_0x4658('0xf'));var toCsv=require(_0x4658('0x8'));var querystring=require(_0x4658('0x10'));var Papa=require(_0x4658('0x11'));var Redis=require(_0x4658('0x12'));var authService=require(_0x4658('0x13'));var qs=require(_0x4658('0x14'));var as=require(_0x4658('0x15'));var hardwareService=require(_0x4658('0x16'));var logger=require(_0x4658('0x17'))('api');var utils=require(_0x4658('0x18'));var config=require(_0x4658('0x19'));var licenseUtil=require(_0x4658('0x1a'));var db=require(_0x4658('0x1b'))['db'];function respondWithStatusCode(_0x172dd0,_0x1d634b){_0x1d634b=_0x1d634b||0xcc;return function(_0x3e720e){if(_0x3e720e){return _0x172dd0['sendStatus'](_0x1d634b);}return _0x172dd0[_0x4658('0x1c')](_0x1d634b)[_0x4658('0x1d')]();};}function respondWithResult(_0x277607,_0x2e1e01){_0x2e1e01=_0x2e1e01||0xc8;return function(_0x5d3daf){if(_0x5d3daf){return _0x277607[_0x4658('0x1c')](_0x2e1e01)[_0x4658('0x1e')](_0x5d3daf);}};}function respondWithFilteredResult(_0x289e30,_0x48c219){return function(_0x996259){if(_0x996259){var _0x4dc572=typeof _0x48c219[_0x4658('0x1f')]==='undefined'&&typeof _0x48c219['limit']===_0x4658('0x20');var _0x1b13ec=_0x996259[_0x4658('0x21')];var _0x388331=_0x4dc572?0x0:_0x48c219[_0x4658('0x1f')];var _0x264729=_0x4dc572?_0x996259[_0x4658('0x21')]:_0x48c219[_0x4658('0x1f')]+_0x48c219[_0x4658('0x22')];var _0x256584;if(_0x264729>=_0x1b13ec){_0x264729=_0x1b13ec;_0x256584=0xc8;}else{_0x256584=0xce;}_0x289e30[_0x4658('0x1c')](_0x256584);return _0x289e30[_0x4658('0x23')](_0x4658('0x24'),_0x388331+'-'+_0x264729+'/'+_0x1b13ec)['json'](_0x996259);}return null;};}function patchUpdates(_0x54c1ce){return function(_0x39878a){try{jsonpatch[_0x4658('0x25')](_0x39878a,_0x54c1ce,!![]);}catch(_0x5bb225){return BPromise[_0x4658('0x26')](_0x5bb225);}return _0x39878a[_0x4658('0x27')]();};}function saveUpdates(_0x5943f1,_0x2eeb44){return function(_0xc1852b){if(_0xc1852b){return _0xc1852b[_0x4658('0x28')](_0x5943f1)[_0x4658('0x29')](function(_0x281773){return _0x281773;});}return null;};}function removeEntity(_0x109270,_0x420c0a){return function(_0x513a7a){if(_0x513a7a){return _0x513a7a[_0x4658('0x2a')]()[_0x4658('0x29')](function(){_0x109270[_0x4658('0x1c')](0xcc)[_0x4658('0x1d')]();});}};}function handleEntityNotFound(_0x1f971c,_0x5b6a2d){return function(_0x52935f){if(!_0x52935f){_0x1f971c['sendStatus'](0x194);}return _0x52935f;};}function handleError(_0x59a953,_0x4dff03){_0x4dff03=_0x4dff03||0x1f4;return function(_0x562967){logger[_0x4658('0x2b')](_0x562967['stack']);if(_0x562967[_0x4658('0x2c')]){delete _0x562967[_0x4658('0x2c')];}_0x59a953[_0x4658('0x1c')](_0x4dff03)[_0x4658('0x2d')](_0x562967);};}exports[_0x4658('0x2e')]=function(_0x457090,_0x260d4e){var _0x6e361a={},_0x1d5274={},_0x37f5cd={'count':0x0,'rows':[]};var _0x5e1ed8=_[_0x4658('0x2f')](db[_0x4658('0x30')][_0x4658('0x31')],function(_0x57949e){return{'name':_0x57949e[_0x4658('0x32')],'type':_0x57949e[_0x4658('0x33')]['key']};});_0x1d5274[_0x4658('0x34')]=_[_0x4658('0x2f')](_0x5e1ed8,_0x4658('0x2c'));_0x1d5274[_0x4658('0x35')]=_[_0x4658('0x36')](_0x457090['query']);_0x1d5274[_0x4658('0x37')]=_[_0x4658('0x38')](_0x1d5274[_0x4658('0x34')],_0x1d5274[_0x4658('0x35')]);_0x6e361a[_0x4658('0x39')]=_['intersection'](_0x1d5274['model'],qs[_0x4658('0x3a')](_0x457090[_0x4658('0x35')][_0x4658('0x3a')]));_0x6e361a[_0x4658('0x39')]=_0x6e361a[_0x4658('0x39')][_0x4658('0x3b')]?_0x6e361a[_0x4658('0x39')]:_0x1d5274[_0x4658('0x34')];if(!_0x457090[_0x4658('0x35')][_0x4658('0x3c')](_0x4658('0x3d'))){_0x6e361a[_0x4658('0x22')]=qs[_0x4658('0x22')](_0x457090[_0x4658('0x35')]['limit']);_0x6e361a[_0x4658('0x1f')]=qs[_0x4658('0x1f')](_0x457090[_0x4658('0x35')]['offset']);}_0x6e361a[_0x4658('0x3e')]=qs['sort'](_0x457090[_0x4658('0x35')][_0x4658('0x3f')]);_0x6e361a[_0x4658('0x40')]=qs[_0x4658('0x37')](_[_0x4658('0x41')](_0x457090[_0x4658('0x35')],_0x1d5274[_0x4658('0x37')]),_0x5e1ed8);if(_0x457090[_0x4658('0x35')]['filter']){_0x6e361a[_0x4658('0x40')]=_['merge'](_0x6e361a[_0x4658('0x40')],{'$or':_[_0x4658('0x2f')](_0x5e1ed8,function(_0x2bec7c){if(_0x2bec7c[_0x4658('0x33')]!==_0x4658('0x42')){var _0x235965={};_0x235965[_0x2bec7c[_0x4658('0x2c')]]={'$like':'%'+_0x457090['query'][_0x4658('0x43')]+'%'};return _0x235965;}})});}_0x6e361a=_[_0x4658('0x44')]({},_0x6e361a,_0x457090[_0x4658('0x45')]);var _0x232e37={'where':_0x6e361a['where']};return db[_0x4658('0x30')][_0x4658('0x21')](_0x232e37)[_0x4658('0x29')](function(_0xb27599){_0x37f5cd[_0x4658('0x21')]=_0xb27599;if(_0x457090[_0x4658('0x35')][_0x4658('0x46')]){_0x6e361a[_0x4658('0x47')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x6e361a);})[_0x4658('0x29')](function(_0x1a52fd){_0x37f5cd[_0x4658('0x48')]=_0x1a52fd;return _0x37f5cd;})[_0x4658('0x29')](respondWithFilteredResult(_0x260d4e,_0x6e361a))[_0x4658('0x49')](handleError(_0x260d4e,null));};exports[_0x4658('0x4a')]=function(_0x7ee94e,_0x348536){var _0x57e3bc={'raw':!![],'where':{'id':_0x7ee94e[_0x4658('0x4b')]['id']}},_0xa9c056={};_0xa9c056['model']=_[_0x4658('0x36')](db[_0x4658('0x30')][_0x4658('0x31')]);_0xa9c056[_0x4658('0x35')]=_[_0x4658('0x36')](_0x7ee94e[_0x4658('0x35')]);_0xa9c056['filters']=_[_0x4658('0x38')](_0xa9c056[_0x4658('0x34')],_0xa9c056[_0x4658('0x35')]);_0x57e3bc[_0x4658('0x39')]=_[_0x4658('0x38')](_0xa9c056[_0x4658('0x34')],qs[_0x4658('0x3a')](_0x7ee94e[_0x4658('0x35')][_0x4658('0x3a')]));_0x57e3bc[_0x4658('0x39')]=_0x57e3bc[_0x4658('0x39')][_0x4658('0x3b')]?_0x57e3bc[_0x4658('0x39')]:_0xa9c056[_0x4658('0x34')];if(_0x7ee94e[_0x4658('0x35')][_0x4658('0x46')]){_0x57e3bc[_0x4658('0x47')]=[{'all':!![]}];}_0x57e3bc=_[_0x4658('0x44')]({},_0x57e3bc,_0x7ee94e[_0x4658('0x45')]);return db[_0x4658('0x30')][_0x4658('0x4c')](_0x57e3bc)['then'](handleEntityNotFound(_0x348536,null))['then'](respondWithResult(_0x348536,null))[_0x4658('0x49')](handleError(_0x348536,null));};exports['create']=function(_0x434e97,_0x3b4713){return db[_0x4658('0x30')][_0x4658('0x4d')](_0x434e97[_0x4658('0x4e')],{})[_0x4658('0x29')](respondWithResult(_0x3b4713,0xc9))[_0x4658('0x49')](handleError(_0x3b4713,null));};exports[_0x4658('0x28')]=function(_0x3854ab,_0x9ea70c){if(_0x3854ab['body']['id']){delete _0x3854ab[_0x4658('0x4e')]['id'];}return db[_0x4658('0x30')][_0x4658('0x4c')]({'where':{'id':_0x3854ab[_0x4658('0x4b')]['id']}})[_0x4658('0x29')](handleEntityNotFound(_0x9ea70c,null))[_0x4658('0x29')](saveUpdates(_0x3854ab[_0x4658('0x4e')],null))[_0x4658('0x29')](respondWithResult(_0x9ea70c,null))[_0x4658('0x49')](handleError(_0x9ea70c,null));};exports[_0x4658('0x2a')]=function(_0x546a38,_0x506a98){return db[_0x4658('0x30')]['find']({'where':{'id':_0x546a38[_0x4658('0x4b')]['id']}})['then'](handleEntityNotFound(_0x506a98,null))[_0x4658('0x29')](removeEntity(_0x506a98,null))[_0x4658('0x49')](handleError(_0x506a98,null));};
\ No newline at end of file
+var _0xfd1a=['fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','update','destroy','then','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x4cec95,_0x276dfa){var _0x5a6c41=function(_0x3b818a){while(--_0x3b818a){_0x4cec95['push'](_0x4cec95['shift']());}};_0x5a6c41(++_0x276dfa);}(_0xfd1a,0x129));var _0xafd1=function(_0x279dfe,_0x39674f){_0x279dfe=_0x279dfe-0x0;var _0x569667=_0xfd1a[_0x279dfe];return _0x569667;};'use strict';var emlformat=require(_0xafd1('0x0'));var rimraf=require(_0xafd1('0x1'));var zipdir=require(_0xafd1('0x2'));var jsonpatch=require(_0xafd1('0x3'));var rp=require(_0xafd1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xafd1('0x5'));var util=require(_0xafd1('0x6'));var path=require('path');var sox=require(_0xafd1('0x7'));var csv=require(_0xafd1('0x8'));var ejs=require(_0xafd1('0x9'));var fs=require('fs');var fs_extra=require(_0xafd1('0xa'));var _=require(_0xafd1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xafd1('0xc'));var deskjs=require(_0xafd1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xafd1('0xe'));var Papa=require(_0xafd1('0xf'));var Redis=require(_0xafd1('0x10'));var authService=require(_0xafd1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xafd1('0x12'));var hardwareService=require(_0xafd1('0x13'));var logger=require(_0xafd1('0x14'))(_0xafd1('0x15'));var utils=require(_0xafd1('0x16'));var config=require(_0xafd1('0x17'));var licenseUtil=require(_0xafd1('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x425ef8,_0xa6cf17){_0xa6cf17=_0xa6cf17||0xcc;return function(_0x14fe51){if(_0x14fe51){return _0x425ef8[_0xafd1('0x19')](_0xa6cf17);}return _0x425ef8[_0xafd1('0x1a')](_0xa6cf17)[_0xafd1('0x1b')]();};}function respondWithResult(_0x4a80e0,_0x212c23){_0x212c23=_0x212c23||0xc8;return function(_0x4d8134){if(_0x4d8134){return _0x4a80e0[_0xafd1('0x1a')](_0x212c23)['json'](_0x4d8134);}};}function respondWithFilteredResult(_0x205217,_0x3b8aea){return function(_0xcf5b13){if(_0xcf5b13){var _0x80df7f=typeof _0x3b8aea[_0xafd1('0x1c')]===_0xafd1('0x1d')&&typeof _0x3b8aea[_0xafd1('0x1e')]===_0xafd1('0x1d');var _0x3ca89f=_0xcf5b13[_0xafd1('0x1f')];var _0x42ab24=_0x80df7f?0x0:_0x3b8aea[_0xafd1('0x1c')];var _0x49e217=_0x80df7f?_0xcf5b13[_0xafd1('0x1f')]:_0x3b8aea[_0xafd1('0x1c')]+_0x3b8aea[_0xafd1('0x1e')];var _0x5c055f;if(_0x49e217>=_0x3ca89f){_0x49e217=_0x3ca89f;_0x5c055f=0xc8;}else{_0x5c055f=0xce;}_0x205217[_0xafd1('0x1a')](_0x5c055f);return _0x205217[_0xafd1('0x20')]('Content-Range',_0x42ab24+'-'+_0x49e217+'/'+_0x3ca89f)[_0xafd1('0x21')](_0xcf5b13);}return null;};}function patchUpdates(_0x23dbc4){return function(_0x2821d5){try{jsonpatch[_0xafd1('0x22')](_0x2821d5,_0x23dbc4,!![]);}catch(_0x4875d0){return BPromise[_0xafd1('0x23')](_0x4875d0);}return _0x2821d5['save']();};}function saveUpdates(_0x285a3c,_0x1640cf){return function(_0x3236c3){if(_0x3236c3){return _0x3236c3[_0xafd1('0x24')](_0x285a3c)['then'](function(_0x62b566){return _0x62b566;});}return null;};}function removeEntity(_0x3e0d2f,_0x49c5b7){return function(_0x161e4e){if(_0x161e4e){return _0x161e4e[_0xafd1('0x25')]()[_0xafd1('0x26')](function(){_0x3e0d2f[_0xafd1('0x1a')](0xcc)[_0xafd1('0x1b')]();});}};}function handleEntityNotFound(_0x5c0b21,_0x3c7ad6){return function(_0x3f1044){if(!_0x3f1044){_0x5c0b21['sendStatus'](0x194);}return _0x3f1044;};}function handleError(_0x7eaab4,_0x1d9550){_0x1d9550=_0x1d9550||0x1f4;return function(_0x32ed82){logger[_0xafd1('0x27')](_0x32ed82['stack']);if(_0x32ed82[_0xafd1('0x28')]){delete _0x32ed82['name'];}_0x7eaab4[_0xafd1('0x1a')](_0x1d9550)[_0xafd1('0x29')](_0x32ed82);};}exports[_0xafd1('0x2a')]=function(_0x42b689,_0x38ab36){var _0x3cbcc5={},_0x4a3338={},_0x53554e={'count':0x0,'rows':[]};var _0x3be47a=_[_0xafd1('0x2b')](db[_0xafd1('0x2c')][_0xafd1('0x2d')],function(_0x3f6bb6){return{'name':_0x3f6bb6[_0xafd1('0x2e')],'type':_0x3f6bb6[_0xafd1('0x2f')][_0xafd1('0x30')]};});_0x4a3338['model']=_['map'](_0x3be47a,_0xafd1('0x28'));_0x4a3338[_0xafd1('0x31')]=_[_0xafd1('0x32')](_0x42b689[_0xafd1('0x31')]);_0x4a3338['filters']=_[_0xafd1('0x33')](_0x4a3338[_0xafd1('0x34')],_0x4a3338['query']);_0x3cbcc5[_0xafd1('0x35')]=_[_0xafd1('0x33')](_0x4a3338['model'],qs[_0xafd1('0x36')](_0x42b689[_0xafd1('0x31')][_0xafd1('0x36')]));_0x3cbcc5[_0xafd1('0x35')]=_0x3cbcc5[_0xafd1('0x35')][_0xafd1('0x37')]?_0x3cbcc5[_0xafd1('0x35')]:_0x4a3338[_0xafd1('0x34')];if(!_0x42b689[_0xafd1('0x31')]['hasOwnProperty']('nolimit')){_0x3cbcc5['limit']=qs[_0xafd1('0x1e')](_0x42b689[_0xafd1('0x31')]['limit']);_0x3cbcc5[_0xafd1('0x1c')]=qs[_0xafd1('0x1c')](_0x42b689[_0xafd1('0x31')][_0xafd1('0x1c')]);}_0x3cbcc5[_0xafd1('0x38')]=qs[_0xafd1('0x39')](_0x42b689['query']['sort']);_0x3cbcc5[_0xafd1('0x3a')]=qs[_0xafd1('0x3b')](_[_0xafd1('0x3c')](_0x42b689[_0xafd1('0x31')],_0x4a3338['filters']),_0x3be47a);if(_0x42b689[_0xafd1('0x31')][_0xafd1('0x3d')]){_0x3cbcc5['where']=_[_0xafd1('0x3e')](_0x3cbcc5[_0xafd1('0x3a')],{'$or':_[_0xafd1('0x2b')](_0x3be47a,function(_0x1d89c3){if(_0x1d89c3[_0xafd1('0x2f')]!==_0xafd1('0x3f')){var _0x4fa6de={};_0x4fa6de[_0x1d89c3[_0xafd1('0x28')]]={'$like':'%'+_0x42b689['query']['filter']+'%'};return _0x4fa6de;}})});}_0x3cbcc5=_[_0xafd1('0x3e')]({},_0x3cbcc5,_0x42b689[_0xafd1('0x40')]);var _0x320b5b={'where':_0x3cbcc5['where']};return db[_0xafd1('0x2c')][_0xafd1('0x1f')](_0x320b5b)[_0xafd1('0x26')](function(_0x2c88f2){_0x53554e[_0xafd1('0x1f')]=_0x2c88f2;if(_0x42b689[_0xafd1('0x31')]['includeAll']){_0x3cbcc5[_0xafd1('0x41')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xafd1('0x42')](_0x3cbcc5);})[_0xafd1('0x26')](function(_0x27b1fa){_0x53554e[_0xafd1('0x43')]=_0x27b1fa;return _0x53554e;})[_0xafd1('0x26')](respondWithFilteredResult(_0x38ab36,_0x3cbcc5))[_0xafd1('0x44')](handleError(_0x38ab36,null));};exports[_0xafd1('0x45')]=function(_0x3c03b4,_0x9efb46){var _0x485b83={'raw':!![],'where':{'id':_0x3c03b4[_0xafd1('0x46')]['id']}},_0x47b5d3={};_0x47b5d3[_0xafd1('0x34')]=_[_0xafd1('0x32')](db[_0xafd1('0x2c')][_0xafd1('0x2d')]);_0x47b5d3[_0xafd1('0x31')]=_[_0xafd1('0x32')](_0x3c03b4[_0xafd1('0x31')]);_0x47b5d3['filters']=_[_0xafd1('0x33')](_0x47b5d3['model'],_0x47b5d3[_0xafd1('0x31')]);_0x485b83['attributes']=_[_0xafd1('0x33')](_0x47b5d3[_0xafd1('0x34')],qs['fields'](_0x3c03b4[_0xafd1('0x31')][_0xafd1('0x36')]));_0x485b83[_0xafd1('0x35')]=_0x485b83['attributes'][_0xafd1('0x37')]?_0x485b83[_0xafd1('0x35')]:_0x47b5d3['model'];if(_0x3c03b4[_0xafd1('0x31')][_0xafd1('0x47')]){_0x485b83['include']=[{'all':!![]}];}_0x485b83=_['merge']({},_0x485b83,_0x3c03b4[_0xafd1('0x40')]);return db['AnalyticTreeReport'][_0xafd1('0x48')](_0x485b83)[_0xafd1('0x26')](handleEntityNotFound(_0x9efb46,null))[_0xafd1('0x26')](respondWithResult(_0x9efb46,null))[_0xafd1('0x44')](handleError(_0x9efb46,null));};exports[_0xafd1('0x49')]=function(_0x4ccb45,_0x828524){return db[_0xafd1('0x2c')][_0xafd1('0x49')](_0x4ccb45['body'],{})[_0xafd1('0x26')](respondWithResult(_0x828524,0xc9))[_0xafd1('0x44')](handleError(_0x828524,null));};exports['update']=function(_0x2a05a0,_0x28d2e9){if(_0x2a05a0[_0xafd1('0x4a')]['id']){delete _0x2a05a0['body']['id'];}return db[_0xafd1('0x2c')][_0xafd1('0x48')]({'where':{'id':_0x2a05a0[_0xafd1('0x46')]['id']}})[_0xafd1('0x26')](handleEntityNotFound(_0x28d2e9,null))['then'](saveUpdates(_0x2a05a0['body'],null))['then'](respondWithResult(_0x28d2e9,null))[_0xafd1('0x44')](handleError(_0x28d2e9,null));};exports[_0xafd1('0x25')]=function(_0x14fd36,_0x27f3bf){return db[_0xafd1('0x2c')]['find']({'where':{'id':_0x14fd36[_0xafd1('0x46')]['id']}})['then'](handleEntityNotFound(_0x27f3bf,null))[_0xafd1('0x26')](removeEntity(_0x27f3bf,null))[_0xafd1('0x44')](handleError(_0x27f3bf,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 1ccb4d7..a35ecda 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 _0xd17d=['rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','bluebird'];(function(_0x29f3e0,_0x486ad1){var _0x32fa40=function(_0x452c1c){while(--_0x452c1c){_0x29f3e0['push'](_0x29f3e0['shift']());}};_0x32fa40(++_0x486ad1);}(_0xd17d,0x1c8));var _0xdd17=function(_0x6dd9,_0x58c745){_0x6dd9=_0x6dd9-0x0;var _0x29423f=_0xd17d[_0x6dd9];return _0x29423f;};'use strict';var _=require(_0xdd17('0x0'));var util=require(_0xdd17('0x1'));var logger=require(_0xdd17('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdd17('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdd17('0x4'));var config=require('../../config/environment');var attributes=require(_0xdd17('0x5'));module[_0xdd17('0x6')]=function(_0x530891,_0x44f6c2){return _0x530891[_0xdd17('0x7')](_0xdd17('0x8'),attributes,{'tableName':_0xdd17('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6299=['../../config/environment','./analyticTreeReport.attributes','exports','define','util','moment','bluebird','request-promise'];(function(_0x1069f5,_0x51cc78){var _0x5c211d=function(_0x1d527f){while(--_0x1d527f){_0x1069f5['push'](_0x1069f5['shift']());}};_0x5c211d(++_0x51cc78);}(_0x6299,0x64));var _0x9629=function(_0x30946f,_0x13e356){_0x30946f=_0x30946f-0x0;var _0x2d3b5f=_0x6299[_0x30946f];return _0x2d3b5f;};'use strict';var _=require('lodash');var util=require(_0x9629('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9629('0x1'));var BPromise=require(_0x9629('0x2'));var rp=require(_0x9629('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9629('0x4'));var attributes=require(_0x9629('0x5'));module[_0x9629('0x6')]=function(_0x4daf4c,_0x46da4a){return _0x4daf4c[_0x9629('0x7')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','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 b1c2fd3..4a063cd 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3df935,_0x2f6877){var _0x152412=function(_0x213b98){while(--_0x213b98){_0x3df935['push'](_0x3df935['shift']());}};_0x152412(++_0x2f6877);}(_0xadb5,0xad));var _0x5adb=function(_0x110f97,_0x643432){_0x110f97=_0x110f97-0x0;var _0x19cf55=_0xadb5[_0x110f97];return _0x19cf55;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _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(_0x58bf7c,_0x1ab137){var _0x292f7f=function(_0x20a4d5){while(--_0x20a4d5){_0x58bf7c['push'](_0x58bf7c['shift']());}};_0x292f7f(++_0x1ab137);}(_0x2ef3,0xba));var _0x32ef=function(_0x55d63a,_0x4cc997){_0x55d63a=_0x55d63a-0x0;var _0xd2f439=_0x2ef3[_0x55d63a];return _0xd2f439;};'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 0731082..ded256e 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 _0xb4c7=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x146312,_0x5bd7af){var _0x1b0b27=function(_0x46d1ec){while(--_0x46d1ec){_0x146312['push'](_0x146312['shift']());}};_0x1b0b27(++_0x5bd7af);}(_0xb4c7,0x1eb));var _0x7b4c=function(_0x41ebe4,_0x2c44b5){_0x41ebe4=_0x41ebe4-0x0;var _0x164bef=_0xb4c7[_0x41ebe4];return _0x164bef;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express[_0x7b4c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x7b4c('0x9')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router['get'](_0x7b4c('0xc'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router[_0x7b4c('0xe')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7b4c('0x10')]);router[_0x7b4c('0x11')]('/:id',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x12')]);module[_0x7b4c('0x13')]=router;
\ No newline at end of file
+var _0xa0bb=['../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','create','put','update','delete','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3d0fa4,_0x18be0f){var _0x34178c=function(_0x55209c){while(--_0x55209c){_0x3d0fa4['push'](_0x3d0fa4['shift']());}};_0x34178c(++_0x18be0f);}(_0xa0bb,0x190));var _0xba0b=function(_0x3d5103,_0x524622){_0x3d5103=_0x3d5103-0x0;var _0x5b98d5=_0xa0bb[_0x3d5103];return _0x5b98d5;};'use strict';var multer=require(_0xba0b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba0b('0x1'));var express=require(_0xba0b('0x2'));var router=express['Router']();var fs_extra=require(_0xba0b('0x3'));var auth=require(_0xba0b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xba0b('0x5'));var controller=require(_0xba0b('0x6'));router[_0xba0b('0x7')]('/',auth['isAuthenticated'](),controller[_0xba0b('0x8')]);router[_0xba0b('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xba0b('0x9')](),controller[_0xba0b('0xa')]);router[_0xba0b('0xb')]('/:id',auth[_0xba0b('0x9')](),controller[_0xba0b('0xc')]);router[_0xba0b('0xd')]('/:id',auth[_0xba0b('0x9')](),controller[_0xba0b('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 65eb767..4d8e813 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 _0x8f7d=['exports','STRING','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x52eca4,_0x2afd62){_0x52eca4=_0x52eca4-0x0;var _0x1366b9=_0x8f7d[_0x52eca4];return _0x1366b9;};'use strict';var Sequelize=require(_0xd8f7('0x0'));module[_0xd8f7('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd8f7('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8ce3=['sequelize','exports','STRING'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x8ce3,0xc3));var _0x38ce=function(_0x56a020,_0x3065c6){_0x56a020=_0x56a020-0x0;var _0xc4220c=_0x8ce3[_0x56a020];return _0xc4220c;};'use strict';var Sequelize=require(_0x38ce('0x0'));module[_0x38ce('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x38ce('0x2')]},'type':{'type':Sequelize[_0x38ce('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 6d69efe..44a7485 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 _0xf2a3=['apply','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','type','filter','includeAll','findAll','catch','show','include','options','find','clone','params','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','ChatOfflineMessageId','join','server/files/attachments/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range'];(function(_0x27a929,_0x19068d){var _0x43ac7c=function(_0x86455b){while(--_0x86455b){_0x27a929['push'](_0x27a929['shift']());}};_0x43ac7c(++_0x19068d);}(_0xf2a3,0x1a8));var _0x3f2a=function(_0xb3275c,_0x2623c3){_0xb3275c=_0xb3275c-0x0;var _0x58e50b=_0xf2a3[_0xb3275c];return _0x58e50b;};'use strict';var emlformat=require(_0x3f2a('0x0'));var rimraf=require(_0x3f2a('0x1'));var zipdir=require(_0x3f2a('0x2'));var jsonpatch=require(_0x3f2a('0x3'));var rp=require(_0x3f2a('0x4'));var moment=require('moment');var BPromise=require(_0x3f2a('0x5'));var Mustache=require(_0x3f2a('0x6'));var util=require(_0x3f2a('0x7'));var path=require(_0x3f2a('0x8'));var sox=require(_0x3f2a('0x9'));var csv=require(_0x3f2a('0xa'));var ejs=require(_0x3f2a('0xb'));var fs=require('fs');var fs_extra=require(_0x3f2a('0xc'));var _=require(_0x3f2a('0xd'));var squel=require(_0x3f2a('0xe'));var crypto=require('crypto');var jsforce=require(_0x3f2a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3f2a('0xa'));var querystring=require(_0x3f2a('0x10'));var Papa=require(_0x3f2a('0x11'));var Redis=require(_0x3f2a('0x12'));var authService=require(_0x3f2a('0x13'));var qs=require(_0x3f2a('0x14'));var as=require(_0x3f2a('0x15'));var hardwareService=require(_0x3f2a('0x16'));var logger=require(_0x3f2a('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x3f2a('0x18'));var licenseUtil=require(_0x3f2a('0x19'));var db=require(_0x3f2a('0x1a'))['db'];function respondWithStatusCode(_0x4db237,_0x5a6033){_0x5a6033=_0x5a6033||0xcc;return function(_0x423b63){if(_0x423b63){return _0x4db237[_0x3f2a('0x1b')](_0x5a6033);}return _0x4db237[_0x3f2a('0x1c')](_0x5a6033)[_0x3f2a('0x1d')]();};}function respondWithResult(_0x502a8f,_0x4d3bd1){_0x4d3bd1=_0x4d3bd1||0xc8;return function(_0x4c491c){if(_0x4c491c){return _0x502a8f[_0x3f2a('0x1c')](_0x4d3bd1)[_0x3f2a('0x1e')](_0x4c491c);}};}function respondWithFilteredResult(_0x18cf00,_0x28b4a5){return function(_0x5839fc){if(_0x5839fc){var _0x23ea38=typeof _0x28b4a5[_0x3f2a('0x1f')]===_0x3f2a('0x20')&&typeof _0x28b4a5['limit']===_0x3f2a('0x20');var _0x65aed9=_0x5839fc['count'];var _0xc445ba=_0x23ea38?0x0:_0x28b4a5[_0x3f2a('0x1f')];var _0x5af7d4=_0x23ea38?_0x5839fc[_0x3f2a('0x21')]:_0x28b4a5[_0x3f2a('0x1f')]+_0x28b4a5['limit'];var _0x2b72c7;if(_0x5af7d4>=_0x65aed9){_0x5af7d4=_0x65aed9;_0x2b72c7=0xc8;}else{_0x2b72c7=0xce;}_0x18cf00[_0x3f2a('0x1c')](_0x2b72c7);return _0x18cf00[_0x3f2a('0x22')](_0x3f2a('0x23'),_0xc445ba+'-'+_0x5af7d4+'/'+_0x65aed9)[_0x3f2a('0x1e')](_0x5839fc);}return null;};}function patchUpdates(_0x246d08){return function(_0x23b0a4){try{jsonpatch[_0x3f2a('0x24')](_0x23b0a4,_0x246d08,!![]);}catch(_0x255d82){return BPromise['reject'](_0x255d82);}return _0x23b0a4[_0x3f2a('0x25')]();};}function saveUpdates(_0x4ec9b8,_0x416cff){return function(_0x3c4168){if(_0x3c4168){return _0x3c4168[_0x3f2a('0x26')](_0x4ec9b8)[_0x3f2a('0x27')](function(_0x15341b){return _0x15341b;});}return null;};}function removeEntity(_0x5c685b,_0x8ecc6e){return function(_0x25642d){if(_0x25642d){return _0x25642d[_0x3f2a('0x28')]()[_0x3f2a('0x27')](function(){_0x5c685b[_0x3f2a('0x1c')](0xcc)[_0x3f2a('0x1d')]();});}};}function handleEntityNotFound(_0x23145d,_0x1c3773){return function(_0x47b038){if(!_0x47b038){_0x23145d['sendStatus'](0x194);}return _0x47b038;};}function handleError(_0x442b1e,_0xde22d2){_0xde22d2=_0xde22d2||0x1f4;return function(_0x46e857){logger[_0x3f2a('0x29')](_0x46e857[_0x3f2a('0x2a')]);if(_0x46e857[_0x3f2a('0x2b')]){delete _0x46e857[_0x3f2a('0x2b')];}_0x442b1e[_0x3f2a('0x1c')](_0xde22d2)[_0x3f2a('0x2c')](_0x46e857);};}exports[_0x3f2a('0x2d')]=function(_0x281bbe,_0x5f3ee0){var _0xbc311b={},_0x5bfb2f={},_0x4a80e3={'count':0x0,'rows':[]};var _0x32d3af=_[_0x3f2a('0x2e')](db[_0x3f2a('0x2f')][_0x3f2a('0x30')],function(_0x698e21){return{'name':_0x698e21[_0x3f2a('0x31')],'type':_0x698e21['type'][_0x3f2a('0x32')]};});_0x5bfb2f[_0x3f2a('0x33')]=_[_0x3f2a('0x2e')](_0x32d3af,_0x3f2a('0x2b'));_0x5bfb2f[_0x3f2a('0x34')]=_[_0x3f2a('0x35')](_0x281bbe['query']);_0x5bfb2f[_0x3f2a('0x36')]=_[_0x3f2a('0x37')](_0x5bfb2f['model'],_0x5bfb2f['query']);_0xbc311b['attributes']=_[_0x3f2a('0x37')](_0x5bfb2f[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x38')]));_0xbc311b[_0x3f2a('0x39')]=_0xbc311b[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0xbc311b[_0x3f2a('0x39')]:_0x5bfb2f[_0x3f2a('0x33')];if(!_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x3b')](_0x3f2a('0x3c'))){_0xbc311b[_0x3f2a('0x3d')]=qs[_0x3f2a('0x3d')](_0x281bbe['query']['limit']);_0xbc311b[_0x3f2a('0x1f')]=qs[_0x3f2a('0x1f')](_0x281bbe[_0x3f2a('0x34')]['offset']);}_0xbc311b[_0x3f2a('0x3e')]=qs[_0x3f2a('0x3f')](_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x3f')]);_0xbc311b[_0x3f2a('0x40')]=qs[_0x3f2a('0x36')](_['pick'](_0x281bbe[_0x3f2a('0x34')],_0x5bfb2f[_0x3f2a('0x36')]),_0x32d3af);if(_0x281bbe[_0x3f2a('0x34')]['filter']){_0xbc311b[_0x3f2a('0x40')]=_[_0x3f2a('0x41')](_0xbc311b['where'],{'$or':_[_0x3f2a('0x2e')](_0x32d3af,function(_0x13ab33){if(_0x13ab33[_0x3f2a('0x42')]!=='VIRTUAL'){var _0x458640={};_0x458640[_0x13ab33[_0x3f2a('0x2b')]]={'$like':'%'+_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x43')]+'%'};return _0x458640;}})});}_0xbc311b=_[_0x3f2a('0x41')]({},_0xbc311b,_0x281bbe['options']);var _0xb994c5={'where':_0xbc311b[_0x3f2a('0x40')]};return db[_0x3f2a('0x2f')]['count'](_0xb994c5)['then'](function(_0x50e9c0){_0x4a80e3[_0x3f2a('0x21')]=_0x50e9c0;if(_0x281bbe[_0x3f2a('0x34')][_0x3f2a('0x44')]){_0xbc311b['include']=[{'all':!![]}];}return db[_0x3f2a('0x2f')][_0x3f2a('0x45')](_0xbc311b);})[_0x3f2a('0x27')](function(_0x455c79){_0x4a80e3['rows']=_0x455c79;return _0x4a80e3;})[_0x3f2a('0x27')](respondWithFilteredResult(_0x5f3ee0,_0xbc311b))[_0x3f2a('0x46')](handleError(_0x5f3ee0,null));};exports[_0x3f2a('0x47')]=function(_0x502231,_0x143ff7){var _0x26fde0={'raw':!![],'where':{'id':_0x502231['params']['id']}},_0x489a4b={};_0x489a4b[_0x3f2a('0x33')]=_[_0x3f2a('0x35')](db[_0x3f2a('0x2f')][_0x3f2a('0x30')]);_0x489a4b[_0x3f2a('0x34')]=_[_0x3f2a('0x35')](_0x502231[_0x3f2a('0x34')]);_0x489a4b[_0x3f2a('0x36')]=_[_0x3f2a('0x37')](_0x489a4b[_0x3f2a('0x33')],_0x489a4b[_0x3f2a('0x34')]);_0x26fde0[_0x3f2a('0x39')]=_[_0x3f2a('0x37')](_0x489a4b[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x502231['query'][_0x3f2a('0x38')]));_0x26fde0['attributes']=_0x26fde0[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0x26fde0[_0x3f2a('0x39')]:_0x489a4b[_0x3f2a('0x33')];if(_0x502231['query'][_0x3f2a('0x44')]){_0x26fde0[_0x3f2a('0x48')]=[{'all':!![]}];}_0x26fde0=_[_0x3f2a('0x41')]({},_0x26fde0,_0x502231[_0x3f2a('0x49')]);return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')](_0x26fde0)[_0x3f2a('0x27')](handleEntityNotFound(_0x143ff7,null))[_0x3f2a('0x27')](respondWithResult(_0x143ff7,null))[_0x3f2a('0x46')](handleError(_0x143ff7,null));};exports[_0x3f2a('0x4b')]=function(_0x139310,_0x330403){var _0x207369={'where':{'id':_0x139310[_0x3f2a('0x4c')]['id']}},_0x456eec={};_0x456eec['model']=_['keys'](db['Attachment'][_0x3f2a('0x30')]);_0x207369['attributes']=_[_0x3f2a('0x37')](_0x456eec[_0x3f2a('0x33')],qs[_0x3f2a('0x38')](_0x139310[_0x3f2a('0x34')][_0x3f2a('0x38')]));_0x207369[_0x3f2a('0x39')]=_0x207369[_0x3f2a('0x39')][_0x3f2a('0x3a')]?_0x207369[_0x3f2a('0x39')]:_0x456eec[_0x3f2a('0x33')];if(_0x139310[_0x3f2a('0x34')]['includeAll']){_0x207369[_0x3f2a('0x48')]=[{'all':!![]}];}_0x207369=_[_0x3f2a('0x41')]({},_0x207369,_0x139310[_0x3f2a('0x49')]);return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')](_0x207369)[_0x3f2a('0x27')](handleEntityNotFound(_0x330403,null))[_0x3f2a('0x27')](function(_0x5e3470){if(_0x5e3470){var _0x5f51d9=_0x5e3470[_0x3f2a('0x4d')]({'plain':!![]});_0x5f51d9=qs[_0x3f2a('0x4e')](_0x5f51d9,['id',_0x3f2a('0x4f'),_0x3f2a('0x50')]);_0x139310[_0x3f2a('0x51')]=_['omit'](_0x139310[_0x3f2a('0x51')],['id',_0x3f2a('0x4f'),_0x3f2a('0x50')]);return db['Attachment'][_0x3f2a('0x52')](_[_0x3f2a('0x41')](_0x5f51d9,_0x139310[_0x3f2a('0x51')]),{'include':_0x139310['query'][_0x3f2a('0x44')]?[{'all':!![]}]:undefined});}})[_0x3f2a('0x27')](respondWithResult(_0x330403,0xc9))[_0x3f2a('0x46')](handleError(_0x330403,null));};exports[_0x3f2a('0x26')]=function(_0x3a6fa6,_0x419d95){if(_0x3a6fa6[_0x3f2a('0x51')]['id']){delete _0x3a6fa6[_0x3f2a('0x51')]['id'];}return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')]({'where':{'id':_0x3a6fa6[_0x3f2a('0x4c')]['id']}})[_0x3f2a('0x27')](handleEntityNotFound(_0x419d95,null))[_0x3f2a('0x27')](saveUpdates(_0x3a6fa6['body'],null))['then'](respondWithResult(_0x419d95,null))[_0x3f2a('0x46')](handleError(_0x419d95,null));};exports[_0x3f2a('0x28')]=function(_0xdb27a3,_0xa20df9){return db[_0x3f2a('0x2f')][_0x3f2a('0x4a')]({'where':{'id':_0xdb27a3[_0x3f2a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa20df9,null))[_0x3f2a('0x27')](removeEntity(_0xa20df9,null))[_0x3f2a('0x46')](handleError(_0xa20df9,null));};exports[_0x3f2a('0x52')]=function(_0x5e0933,_0x5b9da2,_0x11426c){_0x5e0933[_0x3f2a('0x51')][_0x3f2a('0x2b')]=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x54')];_0x5e0933['body']['basename']=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x55')];_0x5e0933[_0x3f2a('0x51')]['type']=_0x5e0933[_0x3f2a('0x53')][_0x3f2a('0x56')];return db[_0x3f2a('0x2f')][_0x3f2a('0x52')](_0x5e0933['body'])[_0x3f2a('0x27')](respondWithResult(_0x5b9da2,0xc9))['catch'](handleError(_0x5b9da2,null));};exports['download']=function(_0x8009ec,_0x4fe88d,_0x482762){return db[_0x3f2a('0x2f')]['findOne']({'where':{'id':_0x8009ec['params']['id']},'raw':!![]})[_0x3f2a('0x27')](handleEntityNotFound(_0x4fe88d,null))[_0x3f2a('0x27')](function(_0x1b5ce1){if(_0x1b5ce1){var _0x250467=_0x1b5ce1[_0x3f2a('0x57')]!==null;var _0x4b1cd8=path[_0x3f2a('0x58')](config['root'],_0x3f2a('0x59'));if(_0x250467){_0x4b1cd8=path['join'](_0x4b1cd8,'offline-chat/');}var _0x29929f=path[_0x3f2a('0x58')](_0x4b1cd8,_0x1b5ce1[_0x3f2a('0x5a')]);return _0x4fe88d[_0x3f2a('0x5b')](_0x29929f);}})['catch'](handleError(_0x4fe88d,null));};
\ No newline at end of file
+var _0xca45=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Attachment','rawAttributes','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','clone','params','get','omit','createdAt','updatedAt','body','create','file','originalname','filename','mimetype','join','root','server/files/attachments/','download','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x4ee57e,_0x11bba0){var _0x1daf30=function(_0x52b45d){while(--_0x52b45d){_0x4ee57e['push'](_0x4ee57e['shift']());}};_0x1daf30(++_0x11bba0);}(_0xca45,0x92));var _0x5ca4=function(_0x5c1de9,_0x16b37a){_0x5c1de9=_0x5c1de9-0x0;var _0x452529=_0xca45[_0x5c1de9];return _0x452529;};'use strict';var emlformat=require(_0x5ca4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5ca4('0x1'));var moment=require(_0x5ca4('0x2'));var BPromise=require(_0x5ca4('0x3'));var Mustache=require('mustache');var util=require(_0x5ca4('0x4'));var path=require(_0x5ca4('0x5'));var sox=require(_0x5ca4('0x6'));var csv=require(_0x5ca4('0x7'));var ejs=require(_0x5ca4('0x8'));var fs=require('fs');var fs_extra=require(_0x5ca4('0x9'));var _=require('lodash');var squel=require(_0x5ca4('0xa'));var crypto=require(_0x5ca4('0xb'));var jsforce=require(_0x5ca4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5ca4('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5ca4('0xd'));var authService=require(_0x5ca4('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ca4('0xf'));var logger=require(_0x5ca4('0x10'))(_0x5ca4('0x11'));var utils=require(_0x5ca4('0x12'));var config=require(_0x5ca4('0x13'));var licenseUtil=require(_0x5ca4('0x14'));var db=require(_0x5ca4('0x15'))['db'];function respondWithStatusCode(_0x320338,_0x29c5f9){_0x29c5f9=_0x29c5f9||0xcc;return function(_0x591970){if(_0x591970){return _0x320338[_0x5ca4('0x16')](_0x29c5f9);}return _0x320338['status'](_0x29c5f9)[_0x5ca4('0x17')]();};}function respondWithResult(_0x515fb1,_0x2ca85e){_0x2ca85e=_0x2ca85e||0xc8;return function(_0x55357c){if(_0x55357c){return _0x515fb1[_0x5ca4('0x18')](_0x2ca85e)[_0x5ca4('0x19')](_0x55357c);}};}function respondWithFilteredResult(_0xcdf7b1,_0x52cb5d){return function(_0x56a6c0){if(_0x56a6c0){var _0x5ad14c=typeof _0x52cb5d[_0x5ca4('0x1a')]===_0x5ca4('0x1b')&&typeof _0x52cb5d[_0x5ca4('0x1c')]===_0x5ca4('0x1b');var _0x484e3c=_0x56a6c0[_0x5ca4('0x1d')];var _0x54ee18=_0x5ad14c?0x0:_0x52cb5d[_0x5ca4('0x1a')];var _0xa2f539=_0x5ad14c?_0x56a6c0[_0x5ca4('0x1d')]:_0x52cb5d[_0x5ca4('0x1a')]+_0x52cb5d[_0x5ca4('0x1c')];var _0x4fa7ec;if(_0xa2f539>=_0x484e3c){_0xa2f539=_0x484e3c;_0x4fa7ec=0xc8;}else{_0x4fa7ec=0xce;}_0xcdf7b1[_0x5ca4('0x18')](_0x4fa7ec);return _0xcdf7b1[_0x5ca4('0x1e')](_0x5ca4('0x1f'),_0x54ee18+'-'+_0xa2f539+'/'+_0x484e3c)[_0x5ca4('0x19')](_0x56a6c0);}return null;};}function patchUpdates(_0x4d697e){return function(_0x133b50){try{jsonpatch[_0x5ca4('0x20')](_0x133b50,_0x4d697e,!![]);}catch(_0x3504e3){return BPromise[_0x5ca4('0x21')](_0x3504e3);}return _0x133b50[_0x5ca4('0x22')]();};}function saveUpdates(_0x4c01c9,_0x8c7a96){return function(_0x59a25a){if(_0x59a25a){return _0x59a25a[_0x5ca4('0x23')](_0x4c01c9)[_0x5ca4('0x24')](function(_0x377ae0){return _0x377ae0;});}return null;};}function removeEntity(_0x355fa3,_0x26e05f){return function(_0x35aa12){if(_0x35aa12){return _0x35aa12[_0x5ca4('0x25')]()['then'](function(){_0x355fa3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x338fc3,_0x1e2edf){return function(_0x37e846){if(!_0x37e846){_0x338fc3['sendStatus'](0x194);}return _0x37e846;};}function handleError(_0xe8d0d1,_0x35d405){_0x35d405=_0x35d405||0x1f4;return function(_0x4f4b76){logger[_0x5ca4('0x26')](_0x4f4b76[_0x5ca4('0x27')]);if(_0x4f4b76['name']){delete _0x4f4b76[_0x5ca4('0x28')];}_0xe8d0d1['status'](_0x35d405)['send'](_0x4f4b76);};}exports[_0x5ca4('0x29')]=function(_0x240151,_0xd0b574){var _0x39d1dc={},_0x541fe3={},_0x1eeb39={'count':0x0,'rows':[]};var _0x5feff5=_['map'](db[_0x5ca4('0x2a')][_0x5ca4('0x2b')],function(_0x595213){return{'name':_0x595213['fieldName'],'type':_0x595213['type'][_0x5ca4('0x2c')]};});_0x541fe3['model']=_[_0x5ca4('0x2d')](_0x5feff5,_0x5ca4('0x28'));_0x541fe3[_0x5ca4('0x2e')]=_[_0x5ca4('0x2f')](_0x240151[_0x5ca4('0x2e')]);_0x541fe3[_0x5ca4('0x30')]=_[_0x5ca4('0x31')](_0x541fe3['model'],_0x541fe3[_0x5ca4('0x2e')]);_0x39d1dc[_0x5ca4('0x32')]=_[_0x5ca4('0x31')](_0x541fe3[_0x5ca4('0x33')],qs[_0x5ca4('0x34')](_0x240151[_0x5ca4('0x2e')]['fields']));_0x39d1dc[_0x5ca4('0x32')]=_0x39d1dc['attributes'][_0x5ca4('0x35')]?_0x39d1dc[_0x5ca4('0x32')]:_0x541fe3[_0x5ca4('0x33')];if(!_0x240151[_0x5ca4('0x2e')][_0x5ca4('0x36')](_0x5ca4('0x37'))){_0x39d1dc['limit']=qs[_0x5ca4('0x1c')](_0x240151['query'][_0x5ca4('0x1c')]);_0x39d1dc[_0x5ca4('0x1a')]=qs[_0x5ca4('0x1a')](_0x240151[_0x5ca4('0x2e')][_0x5ca4('0x1a')]);}_0x39d1dc[_0x5ca4('0x38')]=qs['sort'](_0x240151[_0x5ca4('0x2e')][_0x5ca4('0x39')]);_0x39d1dc['where']=qs[_0x5ca4('0x30')](_[_0x5ca4('0x3a')](_0x240151['query'],_0x541fe3[_0x5ca4('0x30')]),_0x5feff5);if(_0x240151[_0x5ca4('0x2e')]['filter']){_0x39d1dc['where']=_['merge'](_0x39d1dc[_0x5ca4('0x3b')],{'$or':_[_0x5ca4('0x2d')](_0x5feff5,function(_0x5ed023){if(_0x5ed023[_0x5ca4('0x3c')]!==_0x5ca4('0x3d')){var _0x1f5440={};_0x1f5440[_0x5ed023[_0x5ca4('0x28')]]={'$like':'%'+_0x240151['query']['filter']+'%'};return _0x1f5440;}})});}_0x39d1dc=_[_0x5ca4('0x3e')]({},_0x39d1dc,_0x240151[_0x5ca4('0x3f')]);var _0x4c5bdf={'where':_0x39d1dc[_0x5ca4('0x3b')]};return db[_0x5ca4('0x2a')]['count'](_0x4c5bdf)[_0x5ca4('0x24')](function(_0x2ad100){_0x1eeb39[_0x5ca4('0x1d')]=_0x2ad100;if(_0x240151['query'][_0x5ca4('0x40')]){_0x39d1dc[_0x5ca4('0x41')]=[{'all':!![]}];}return db[_0x5ca4('0x2a')][_0x5ca4('0x42')](_0x39d1dc);})['then'](function(_0x58213b){_0x1eeb39[_0x5ca4('0x43')]=_0x58213b;return _0x1eeb39;})[_0x5ca4('0x24')](respondWithFilteredResult(_0xd0b574,_0x39d1dc))[_0x5ca4('0x44')](handleError(_0xd0b574,null));};exports[_0x5ca4('0x45')]=function(_0x4ac9c1,_0x301769){var _0x5cb3fa={'raw':!![],'where':{'id':_0x4ac9c1['params']['id']}},_0x497a5d={};_0x497a5d['model']=_['keys'](db[_0x5ca4('0x2a')][_0x5ca4('0x2b')]);_0x497a5d[_0x5ca4('0x2e')]=_[_0x5ca4('0x2f')](_0x4ac9c1[_0x5ca4('0x2e')]);_0x497a5d['filters']=_['intersection'](_0x497a5d[_0x5ca4('0x33')],_0x497a5d[_0x5ca4('0x2e')]);_0x5cb3fa[_0x5ca4('0x32')]=_[_0x5ca4('0x31')](_0x497a5d[_0x5ca4('0x33')],qs[_0x5ca4('0x34')](_0x4ac9c1[_0x5ca4('0x2e')][_0x5ca4('0x34')]));_0x5cb3fa['attributes']=_0x5cb3fa[_0x5ca4('0x32')]['length']?_0x5cb3fa[_0x5ca4('0x32')]:_0x497a5d['model'];if(_0x4ac9c1[_0x5ca4('0x2e')]['includeAll']){_0x5cb3fa[_0x5ca4('0x41')]=[{'all':!![]}];}_0x5cb3fa=_['merge']({},_0x5cb3fa,_0x4ac9c1['options']);return db[_0x5ca4('0x2a')][_0x5ca4('0x46')](_0x5cb3fa)['then'](handleEntityNotFound(_0x301769,null))[_0x5ca4('0x24')](respondWithResult(_0x301769,null))[_0x5ca4('0x44')](handleError(_0x301769,null));};exports[_0x5ca4('0x47')]=function(_0xcc1697,_0x256946){var _0x28aea2={'where':{'id':_0xcc1697[_0x5ca4('0x48')]['id']}},_0x5733={};_0x5733[_0x5ca4('0x33')]=_['keys'](db['Attachment'][_0x5ca4('0x2b')]);_0x28aea2[_0x5ca4('0x32')]=_[_0x5ca4('0x31')](_0x5733[_0x5ca4('0x33')],qs[_0x5ca4('0x34')](_0xcc1697[_0x5ca4('0x2e')]['fields']));_0x28aea2[_0x5ca4('0x32')]=_0x28aea2[_0x5ca4('0x32')][_0x5ca4('0x35')]?_0x28aea2[_0x5ca4('0x32')]:_0x5733['model'];if(_0xcc1697[_0x5ca4('0x2e')][_0x5ca4('0x40')]){_0x28aea2[_0x5ca4('0x41')]=[{'all':!![]}];}_0x28aea2=_['merge']({},_0x28aea2,_0xcc1697[_0x5ca4('0x3f')]);return db[_0x5ca4('0x2a')][_0x5ca4('0x46')](_0x28aea2)[_0x5ca4('0x24')](handleEntityNotFound(_0x256946,null))[_0x5ca4('0x24')](function(_0x42ba25){if(_0x42ba25){var _0x228b35=_0x42ba25[_0x5ca4('0x49')]({'plain':!![]});_0x228b35=qs[_0x5ca4('0x4a')](_0x228b35,['id',_0x5ca4('0x4b'),_0x5ca4('0x4c')]);_0xcc1697[_0x5ca4('0x4d')]=_[_0x5ca4('0x4a')](_0xcc1697[_0x5ca4('0x4d')],['id','createdAt','updatedAt']);return db[_0x5ca4('0x2a')][_0x5ca4('0x4e')](_[_0x5ca4('0x3e')](_0x228b35,_0xcc1697[_0x5ca4('0x4d')]),{'include':_0xcc1697[_0x5ca4('0x2e')][_0x5ca4('0x40')]?[{'all':!![]}]:undefined});}})[_0x5ca4('0x24')](respondWithResult(_0x256946,0xc9))[_0x5ca4('0x44')](handleError(_0x256946,null));};exports['update']=function(_0x495fc8,_0x58980d){if(_0x495fc8[_0x5ca4('0x4d')]['id']){delete _0x495fc8[_0x5ca4('0x4d')]['id'];}return db[_0x5ca4('0x2a')]['find']({'where':{'id':_0x495fc8[_0x5ca4('0x48')]['id']}})['then'](handleEntityNotFound(_0x58980d,null))['then'](saveUpdates(_0x495fc8[_0x5ca4('0x4d')],null))['then'](respondWithResult(_0x58980d,null))[_0x5ca4('0x44')](handleError(_0x58980d,null));};exports['destroy']=function(_0x4b0f4e,_0x1dbbf9){return db[_0x5ca4('0x2a')][_0x5ca4('0x46')]({'where':{'id':_0x4b0f4e[_0x5ca4('0x48')]['id']}})[_0x5ca4('0x24')](handleEntityNotFound(_0x1dbbf9,null))['then'](removeEntity(_0x1dbbf9,null))[_0x5ca4('0x44')](handleError(_0x1dbbf9,null));};exports[_0x5ca4('0x4e')]=function(_0xa054ac,_0x19d84f,_0xace4bf){_0xa054ac[_0x5ca4('0x4d')][_0x5ca4('0x28')]=_0xa054ac[_0x5ca4('0x4f')][_0x5ca4('0x50')];_0xa054ac[_0x5ca4('0x4d')]['basename']=_0xa054ac[_0x5ca4('0x4f')][_0x5ca4('0x51')];_0xa054ac[_0x5ca4('0x4d')][_0x5ca4('0x3c')]=_0xa054ac[_0x5ca4('0x4f')][_0x5ca4('0x52')];return db['Attachment'][_0x5ca4('0x4e')](_0xa054ac[_0x5ca4('0x4d')])[_0x5ca4('0x24')](respondWithResult(_0x19d84f,0xc9))[_0x5ca4('0x44')](handleError(_0x19d84f,null));};exports['download']=function(_0x2ffab2,_0x5f49a0,_0x3681e3){return db[_0x5ca4('0x2a')]['findOne']({'where':{'id':_0x2ffab2['params']['id']},'raw':!![]})[_0x5ca4('0x24')](handleEntityNotFound(_0x5f49a0,null))['then'](function(_0x2ca35a){if(_0x2ca35a){var _0x302ed1=_0x2ca35a['ChatOfflineMessageId']!==null;var _0x2e8f14=path[_0x5ca4('0x53')](config[_0x5ca4('0x54')],_0x5ca4('0x55'));if(_0x302ed1){_0x2e8f14=path[_0x5ca4('0x53')](_0x2e8f14,'offline-chat/');}var _0x4d460d=path['join'](_0x2e8f14,_0x2ca35a['basename']);return _0x5f49a0[_0x5ca4('0x56')](_0x4d460d);}})['catch'](handleError(_0x5f49a0,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index be22592..00cdb68 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 _0x3583=['../../config/environment','./attachment.attributes','define','Attachment','attachments','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3583,0xc0));var _0x3358=function(_0x7a56c,_0x4c8ece){_0x7a56c=_0x7a56c-0x0;var _0x14f77a=_0x3583[_0x7a56c];return _0x14f77a;};'use strict';var _=require('lodash');var util=require(_0x3358('0x0'));var logger=require(_0x3358('0x1'))('api');var moment=require(_0x3358('0x2'));var BPromise=require('bluebird');var rp=require(_0x3358('0x3'));var fs=require('fs');var path=require(_0x3358('0x4'));var rimraf=require(_0x3358('0x5'));var config=require(_0x3358('0x6'));var attributes=require(_0x3358('0x7'));module['exports']=function(_0xae929e,_0x5e6250){return _0xae929e[_0x3358('0x8')](_0x3358('0x9'),attributes,{'tableName':_0x3358('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x60bb=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment'];(function(_0x29dfc1,_0x367174){var _0x4cafe6=function(_0x33db32){while(--_0x33db32){_0x29dfc1['push'](_0x29dfc1['shift']());}};_0x4cafe6(++_0x367174);}(_0x60bb,0x13f));var _0xb60b=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0x60bb[_0x1bf809];return _0x1caa4e;};'use strict';var _=require(_0xb60b('0x0'));var util=require(_0xb60b('0x1'));var logger=require(_0xb60b('0x2'))(_0xb60b('0x3'));var moment=require('moment');var BPromise=require(_0xb60b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb60b('0x5'));var rimraf=require(_0xb60b('0x6'));var config=require(_0xb60b('0x7'));var attributes=require(_0xb60b('0x8'));module['exports']=function(_0x222945,_0xcc826a){return _0x222945[_0xb60b('0x9')](_0xb60b('0xa'),attributes,{'tableName':'attachments','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 c154125..0fe1eb6 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 _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x4ba9d2,_0x2ecfdd){var _0x29188d=function(_0x5c3a3d){while(--_0x5c3a3d){_0x4ba9d2['push'](_0x4ba9d2['shift']());}};_0x29188d(++_0x2ecfdd);}(_0x07c3,0x1bf));var _0x307c=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x07c3[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});};
\ No newline at end of file
+var _0x7b6b=['body','options','raw','stringify','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateAttachment','Attachment'];(function(_0x157ec6,_0x39e0ff){var _0x3d4aef=function(_0x4a2f4a){while(--_0x4a2f4a){_0x157ec6['push'](_0x157ec6['shift']());}};_0x3d4aef(++_0x39e0ff);}(_0x7b6b,0xac));var _0xb7b6=function(_0x1f2f3d,_0x3e34f4){_0x1f2f3d=_0x1f2f3d-0x0;var _0x567817=_0x7b6b[_0x1f2f3d];return _0x567817;};'use strict';var _=require(_0xb7b6('0x0'));var util=require('util');var moment=require(_0xb7b6('0x1'));var BPromise=require(_0xb7b6('0x2'));var rs=require(_0xb7b6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7b6('0x5'))(_0xb7b6('0x6'));var config=require(_0xb7b6('0x7'));var jayson=require(_0xb7b6('0x8'));var client=jayson[_0xb7b6('0x9')][_0xb7b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e81f,_0x318dfb,_0x36cd51){return new BPromise(function(_0x31809b,_0xb5b26f){return client[_0xb7b6('0xb')](_0x19e81f,_0x36cd51)[_0xb7b6('0xc')](function(_0x313aa8){logger[_0xb7b6('0xd')](_0xb7b6('0xe'),_0x318dfb,_0xb7b6('0xf'));logger[_0xb7b6('0x10')](_0xb7b6('0x11'),_0x318dfb,_0xb7b6('0xf'),JSON['stringify'](_0x313aa8));if(_0x313aa8[_0xb7b6('0x12')]){if(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x13')]===0x1f4){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);return _0xb5b26f(_0x313aa8[_0xb7b6('0x12')][_0xb7b6('0x14')]);}logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0x313aa8[_0xb7b6('0x12')]['message']);return _0x31809b(_0x313aa8['error'][_0xb7b6('0x14')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x318dfb,_0xb7b6('0xf'));_0x31809b(_0x313aa8['result'][_0xb7b6('0x14')]);}})[_0xb7b6('0x15')](function(_0xa99f35){logger[_0xb7b6('0x12')](_0xb7b6('0xe'),_0x318dfb,_0xa99f35);_0xb5b26f(_0xa99f35);});});}exports[_0xb7b6('0x16')]=function(_0x3dc0f8){var _0x7bb633=this;return new Promise(function(_0x5667d9,_0x314049){return db[_0xb7b6('0x17')]['create'](_0x3dc0f8[_0xb7b6('0x18')],{'raw':_0x3dc0f8[_0xb7b6('0x19')]?_0x3dc0f8['options'][_0xb7b6('0x1a')]===undefined?!![]:![]:!![]})[_0xb7b6('0xc')](function(_0x5deaac){logger['info'](_0xb7b6('0x16'),_0x3dc0f8);logger['debug'](_0xb7b6('0x16'),_0x3dc0f8,JSON[_0xb7b6('0x1b')](_0x5deaac));_0x5667d9(_0x5deaac);})[_0xb7b6('0x15')](function(_0x230aa6){logger[_0xb7b6('0x12')](_0xb7b6('0x16'),_0x230aa6[_0xb7b6('0x14')],_0x3dc0f8);_0x314049(_0x7bb633[_0xb7b6('0x12')](0x1f4,_0x230aa6[_0xb7b6('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 1617ac4..9303525 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x106b3c,_0xb1b5d7){var _0x37eeb1=function(_0x406d3c){while(--_0x406d3c){_0x106b3c['push'](_0x106b3c['shift']());}};_0x37eeb1(++_0xb1b5d7);}(_0xadb5,0xad));var _0x5adb=function(_0x5a5f75,_0x29ee82){_0x5a5f75=_0x5a5f75-0x0;var _0x41ce5f=_0xadb5[_0x5a5f75];return _0x41ce5f;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _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(_0x3c9699,_0x544d86){var _0x3e5a87=function(_0x4c1986){while(--_0x4c1986){_0x3c9699['push'](_0x3c9699['shift']());}};_0x3e5a87(++_0x544d86);}(_0xb10b,0x12a));var _0xbb10=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb10b[_0x46698a];return _0x356db0;};'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 3613b26..37b4bbb 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 _0x7246=['json','online','use','ad-login','password','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','admin','agent','then','add','clearBlockUser','getLicense','catch','send','message','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x263fe3,_0x216b34){var _0x578222=function(_0x1e48ab){while(--_0x1e48ab){_0x263fe3['push'](_0x263fe3['shift']());}};_0x578222(++_0x216b34);}(_0x7246,0x10a));var _0x6724=function(_0x5b0ae9,_0x5ad060){_0x5b0ae9=_0x5b0ae9-0x0;var _0x336c7f=_0x7246[_0x5b0ae9];return _0x336c7f;};'use strict';var passport=require(_0x6724('0x0'));var LocalStrategy=require(_0x6724('0x1'))[_0x6724('0x2')];var moment=require(_0x6724('0x3'));var ActiveDirectory=require(_0x6724('0x4'));var BPromise=require(_0x6724('0x5'));var util=require(_0x6724('0x6'));var db=require(_0x6724('0x7'))['db'];var authService=require(_0x6724('0x8'));var utils=require(_0x6724('0x9'));var config=require(_0x6724('0xa'));var logger=require(_0x6724('0xb'))(_0x6724('0xc'));function isActiveDirectoryConfigured(_0x50b18f){var _0x1d9319=![];if(typeof _0x50b18f[_0x6724('0xd')]!==_0x6724('0xe')){_0x1d9319=_0x50b18f[_0x6724('0xd')][_0x6724('0xf')]&&_0x50b18f[_0x6724('0xd')]['url']&&_0x50b18f['activedirectory'][_0x6724('0x10')];}return _0x1d9319;}function adAuthenticate(_0x16a229,_0x503ae4,_0x30dbf0){return new BPromise(function(_0x322c81,_0x2fa2ed){try{var _0x219e2c=new ActiveDirectory(_0x16a229);_0x219e2c[_0x6724('0x11')](_0x503ae4,_0x30dbf0,function(_0x417679,_0x586236){if(_0x417679){logger[_0x6724('0x12')](_0x6724('0x13'),_0x503ae4,util[_0x6724('0x14')](_0x417679,{'showHidden':![],'depth':null}));_0x2fa2ed('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x586236){logger['error'](_0x6724('0x15'),_0x503ae4);_0x2fa2ed(_0x6724('0x16'));}else{_0x322c81(_0x586236);}});}catch(_0x10ef06){_0x2fa2ed(_0x10ef06);}});}function ActiveDirectoryAuthenticate(_0x38f8a2,_0x43d283,_0x579503,_0x23179d){var _0x2d88b6,_0x428d28;if(!isActiveDirectoryConfigured(config)){logger[_0x6724('0x12')](_0x6724('0x17'),_0x43d283);return _0x23179d(null,![],{'message':_0x6724('0x16')});}return db[_0x6724('0x18')][_0x6724('0x19')]({'where':{'id':0x1},'attributes':[_0x6724('0x1a'),_0x6724('0x1b')],'raw':!![]})['then'](function(_0x7fc5e1){_0x2d88b6=_0x7fc5e1;if(!_0x2d88b6[_0x6724('0x1a')]){logger[_0x6724('0x12')](_0x6724('0x1c'),_0x43d283);throw new Error(_0x6724('0x16'));}return _0x38f8a2[_0x6724('0x19')]({'logging':!![],'attributes':['id',_0x6724('0x1d'),'password',_0x6724('0x1e'),_0x6724('0x1f'),_0x6724('0x20'),_0x6724('0x21'),_0x6724('0x22'),'online'],'where':{'name':_0x43d283,'role':{'$or':[_0x6724('0x23'),'user',_0x6724('0x24')]},'adSsoEnabled':!![]}});})[_0x6724('0x25')](function(_0x4eacf0){if(!_0x4eacf0||_0x4eacf0&&_0x4eacf0[_0x6724('0x1d')]!==_0x43d283){throw new Error(_0x6724('0x16'));}_0x428d28=_0x4eacf0;var _0x2a4d6c=_0x428d28[_0x6724('0x1d')]+'@'+config['activedirectory'][_0x6724('0x10')];return adAuthenticate(config[_0x6724('0xd')],_0x2a4d6c,_0x579503);})[_0x6724('0x25')](function(_0x554eeb){if(_0x428d28[_0x6724('0x20')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x2d88b6['blockDuration']>0x0){if(_0x428d28['blocked']){if(moment(_0x428d28[_0x6724('0x22')])[_0x6724('0x26')](_0x2d88b6[_0x6724('0x1b')],'minutes')>moment()){throw new Error(_0x6724('0x16'));}return utils[_0x6724('0x27')](_0x428d28,0x0,![],null)[_0x6724('0x25')](function(){return utils[_0x6724('0x28')](_0x428d28);})[_0x6724('0x25')](function(){return _0x23179d(null,_0x428d28);});}else{return utils[_0x6724('0x28')](_0x428d28)['then'](function(){return _0x23179d(null,_0x428d28);});}}else{return utils[_0x6724('0x28')](_0x428d28)[_0x6724('0x25')](function(){return _0x23179d(null,_0x428d28);});}})[_0x6724('0x29')](function(_0x44d07f){return _0x23179d(null,![],_0x44d07f);});}function handleError(_0x35a93f,_0x14a102,_0x4e9502){return _0x35a93f['status'](_0x14a102||0x1f4)[_0x6724('0x2a')]({'message':_0x4e9502?_0x4e9502[_0x6724('0x2b')]||_0x4e9502:''});}exports['login']=function(_0x6fd2aa,_0x596295,_0x3fbd8f){passport[_0x6724('0x11')]('ad-login',function(_0x12163a,_0x30357e,_0x572c4a){var _0x51ea72=_0x12163a||_0x572c4a;if(_0x51ea72){return handleError(_0x596295,0x191,_0x51ea72);}if(!_0x30357e){return handleError(_0x596295,0x194,{'message':_0x6724('0x2c')});}else{var _0x32a5b0={'payload':{'id':_0x30357e['id'],'role':_0x30357e[_0x6724('0x1f')]},'options':{'expiresIn':0x15180}};return authService[_0x6724('0x2d')](_0x32a5b0)[_0x6724('0x25')](function(_0x47bbf0){_0x596295[_0x6724('0x2e')]({'id':_0x30357e['id'],'token':_0x47bbf0,'statusCall':'','isAlreadyLogged':_0x30357e[_0x6724('0x2f')]});});}})(_0x6fd2aa,_0x596295,_0x3fbd8f);};passport[_0x6724('0x30')](_0x6724('0x31'),new LocalStrategy({'usernameField':_0x6724('0x1d'),'passwordField':_0x6724('0x32')},function(_0x1ff595,_0x2cd2c5,_0x13f1c4){return ActiveDirectoryAuthenticate(db[_0x6724('0x33')],_0x1ff595,_0x2cd2c5,_0x13f1c4);}));
\ No newline at end of file
+var _0xaa4d=['Error\x20authenticate\x20%s:\x20%s','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','password','salt','role','disabled','blocked','blockedAt','online','agent','name','domain','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','error'];(function(_0x4fb862,_0x58cde2){var _0x3a3d45=function(_0x130023){while(--_0x130023){_0x4fb862['push'](_0x4fb862['shift']());}};_0x3a3d45(++_0x58cde2);}(_0xaa4d,0x83));var _0xdaa4=function(_0x5794dd,_0x37af14){_0x5794dd=_0x5794dd-0x0;var _0x1a32a7=_0xaa4d[_0x5794dd];return _0x1a32a7;};'use strict';var passport=require(_0xdaa4('0x0'));var LocalStrategy=require(_0xdaa4('0x1'))[_0xdaa4('0x2')];var moment=require(_0xdaa4('0x3'));var ActiveDirectory=require(_0xdaa4('0x4'));var BPromise=require(_0xdaa4('0x5'));var util=require(_0xdaa4('0x6'));var db=require(_0xdaa4('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xdaa4('0x8'));var config=require(_0xdaa4('0x9'));var logger=require(_0xdaa4('0xa'))(_0xdaa4('0xb'));function isActiveDirectoryConfigured(_0xbe5d6){var _0x3798aa=![];if(typeof _0xbe5d6[_0xdaa4('0xc')]!=='undefined'){_0x3798aa=_0xbe5d6[_0xdaa4('0xc')][_0xdaa4('0xd')]&&_0xbe5d6[_0xdaa4('0xc')][_0xdaa4('0xe')]&&_0xbe5d6[_0xdaa4('0xc')]['domain'];}return _0x3798aa;}function adAuthenticate(_0x59a1fc,_0x3d884f,_0x497c70){return new BPromise(function(_0x67bac4,_0x5260d3){try{var _0xe668d5=new ActiveDirectory(_0x59a1fc);_0xe668d5['authenticate'](_0x3d884f,_0x497c70,function(_0x413602,_0x46d06c){if(_0x413602){logger[_0xdaa4('0xf')](_0xdaa4('0x10'),_0x3d884f,util['inspect'](_0x413602,{'showHidden':![],'depth':null}));_0x5260d3(_0xdaa4('0x11'));}else if(!_0x46d06c){logger['error'](_0xdaa4('0x12'),_0x3d884f);_0x5260d3(_0xdaa4('0x11'));}else{_0x67bac4(_0x46d06c);}});}catch(_0x2a3853){_0x5260d3(_0x2a3853);}});}function ActiveDirectoryAuthenticate(_0x1c3c92,_0xe82ab7,_0x285a21,_0x354485){var _0x386af5,_0x31c21d;if(!isActiveDirectoryConfigured(config)){logger[_0xdaa4('0xf')](_0xdaa4('0x13'),_0xe82ab7);return _0x354485(null,![],{'message':_0xdaa4('0x11')});}return db[_0xdaa4('0x14')][_0xdaa4('0x15')]({'where':{'id':0x1},'attributes':[_0xdaa4('0x16'),_0xdaa4('0x17')],'raw':!![]})[_0xdaa4('0x18')](function(_0x17fd7a){_0x386af5=_0x17fd7a;if(!_0x386af5['adSsoEnabled']){logger[_0xdaa4('0xf')](_0xdaa4('0x19'),_0xe82ab7);throw new Error(_0xdaa4('0x11'));}return _0x1c3c92[_0xdaa4('0x15')]({'logging':!![],'attributes':['id','name',_0xdaa4('0x1a'),_0xdaa4('0x1b'),_0xdaa4('0x1c'),_0xdaa4('0x1d'),_0xdaa4('0x1e'),_0xdaa4('0x1f'),_0xdaa4('0x20')],'where':{'name':_0xe82ab7,'role':{'$or':['admin','user',_0xdaa4('0x21')]},'adSsoEnabled':!![]}});})[_0xdaa4('0x18')](function(_0x78d17f){if(!_0x78d17f||_0x78d17f&&_0x78d17f[_0xdaa4('0x22')]!==_0xe82ab7){throw new Error(_0xdaa4('0x11'));}_0x31c21d=_0x78d17f;var _0x280b70=_0x31c21d['name']+'@'+config[_0xdaa4('0xc')][_0xdaa4('0x23')];return adAuthenticate(config[_0xdaa4('0xc')],_0x280b70,_0x285a21);})['then'](function(_0x571bc9){if(_0x31c21d[_0xdaa4('0x1d')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x386af5[_0xdaa4('0x17')]>0x0){if(_0x31c21d[_0xdaa4('0x1e')]){if(moment(_0x31c21d[_0xdaa4('0x1f')])[_0xdaa4('0x24')](_0x386af5[_0xdaa4('0x17')],_0xdaa4('0x25'))>moment()){throw new Error(_0xdaa4('0x11'));}return utils[_0xdaa4('0x26')](_0x31c21d,0x0,![],null)[_0xdaa4('0x18')](function(){return utils[_0xdaa4('0x27')](_0x31c21d);})[_0xdaa4('0x18')](function(){return _0x354485(null,_0x31c21d);});}else{return utils[_0xdaa4('0x27')](_0x31c21d)[_0xdaa4('0x18')](function(){return _0x354485(null,_0x31c21d);});}}else{return utils[_0xdaa4('0x27')](_0x31c21d)['then'](function(){return _0x354485(null,_0x31c21d);});}})[_0xdaa4('0x28')](function(_0x1b42e0){return _0x354485(null,![],_0x1b42e0);});}function handleError(_0x5a0efe,_0x232bb5,_0x1f78b8){return _0x5a0efe[_0xdaa4('0x29')](_0x232bb5||0x1f4)[_0xdaa4('0x2a')]({'message':_0x1f78b8?_0x1f78b8[_0xdaa4('0x2b')]||_0x1f78b8:''});}exports[_0xdaa4('0x2c')]=function(_0x10fbaf,_0x46e312,_0x23747d){passport['authenticate'](_0xdaa4('0x2d'),function(_0x39401f,_0x380d31,_0x571fa4){var _0x1d0bbc=_0x39401f||_0x571fa4;if(_0x1d0bbc){return handleError(_0x46e312,0x191,_0x1d0bbc);}if(!_0x380d31){return handleError(_0x46e312,0x194,{'message':_0xdaa4('0x2e')});}else{var _0x47524c={'payload':{'id':_0x380d31['id'],'role':_0x380d31['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x47524c)[_0xdaa4('0x18')](function(_0x439208){_0x46e312['json']({'id':_0x380d31['id'],'token':_0x439208,'statusCall':'','isAlreadyLogged':_0x380d31[_0xdaa4('0x20')]});});}})(_0x10fbaf,_0x46e312,_0x23747d);};passport[_0xdaa4('0x2f')](_0xdaa4('0x2d'),new LocalStrategy({'usernameField':_0xdaa4('0x22'),'passwordField':_0xdaa4('0x1a')},function(_0x2d3935,_0x16720b,_0x8c63ac){return ActiveDirectoryAuthenticate(db[_0xdaa4('0x30')],_0x2d3935,_0x16720b,_0x8c63ac);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index b08cf7f..a9cc90e 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 _0xa179=['Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xa179,0x16d));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x9a17('0x0')]();var controller=require(_0x9a17('0x1'));router[_0x9a17('0x2')]('/',controller[_0x9a17('0x3')]);module[_0x9a17('0x4')]=router;
\ No newline at end of file
+var _0x4ceb=['post','exports','express','Router','./authActiveDirectory.controller'];(function(_0x2967da,_0x19ef62){var _0x34e04b=function(_0x477b75){while(--_0x477b75){_0x2967da['push'](_0x2967da['shift']());}};_0x34e04b(++_0x19ef62);}(_0x4ceb,0x1c4));var _0xb4ce=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x4ceb[_0x37bd26];return _0xe83dc4;};'use strict';var express=require(_0xb4ce('0x0'));var router=express[_0xb4ce('0x1')]();var controller=require(_0xb4ce('0x2'));router[_0xb4ce('0x3')]('/',controller['login']);module[_0xb4ce('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 0e61886..233d7d7 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(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x7a54,0x106));var _0x47a5=function(_0x18a9bc,_0x2457fc){_0x18a9bc=_0x18a9bc-0x0;var _0x14c6ae=_0x7a54[_0x18a9bc];return _0x14c6ae;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x1b9c11,_0x2d3e06){var _0x425019=function(_0x455b8b){while(--_0x455b8b){_0x1b9c11['push'](_0x1b9c11['shift']());}};_0x425019(++_0x2d3e06);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index a0ca8a8..374444e 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 _0x7111=['express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','callback','login','setTokenCookie','exports'];(function(_0x8afdd0,_0x548ad1){var _0x3de7ac=function(_0x2dc2c4){while(--_0x2dc2c4){_0x8afdd0['push'](_0x8afdd0['shift']());}};_0x3de7ac(++_0x548ad1);}(_0x7111,0x19a));var _0x1711=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x7111[_0x209ec9];return _0x129b1b;};'use strict';var express=require(_0x1711('0x0'));var passport=require(_0x1711('0x1'));var router=express['Router']();var controller=require(_0x1711('0x2'));var userController=require(_0x1711('0x3'));var authService=require(_0x1711('0x4'));router[_0x1711('0x5')]('/',controller['login']);router[_0x1711('0x5')]('/callback',controller[_0x1711('0x6')],authService['isMiddleware'],userController[_0x1711('0x7')],authService[_0x1711('0x8')]);module[_0x1711('0x9')]=router;
\ No newline at end of file
+var _0x5080=['passport','./authGoogle.controller','../../components/auth/service','get','login','/callback'];(function(_0x54026e,_0x162a33){var _0x4a3bdd=function(_0x1fde62){while(--_0x1fde62){_0x54026e['push'](_0x54026e['shift']());}};_0x4a3bdd(++_0x162a33);}(_0x5080,0x66));var _0x0508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5080[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var passport=require(_0x0508('0x0'));var router=express['Router']();var controller=require(_0x0508('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x0508('0x2'));router[_0x0508('0x3')]('/',controller[_0x0508('0x4')]);router['get'](_0x0508('0x5'),controller['callback'],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 5143285..c861b89 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 _0x351c=['The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','lodash','randomstring','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','blockedAt','admin','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blocked','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','merge','format','\x22%s\x22\x20<%s>','user','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.'];(function(_0x22cf12,_0x2807f7){var _0x2e47e2=function(_0x41ad94){while(--_0x41ad94){_0x22cf12['push'](_0x22cf12['shift']());}};_0x2e47e2(++_0x2807f7);}(_0x351c,0xff));var _0xc351=function(_0x4625c1,_0x186658){_0x4625c1=_0x4625c1-0x0;var _0x57635c=_0x351c[_0x4625c1];return _0x57635c;};'use strict';var util=require(_0xc351('0x0'));var passport=require(_0xc351('0x1'));var LocalStrategy=require(_0xc351('0x2'))['Strategy'];var jayson=require(_0xc351('0x3'));var _=require(_0xc351('0x4'));var rs=require(_0xc351('0x5'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xc351('0x6'));var utils=require(_0xc351('0x7'));var client=jayson[_0xc351('0x8')][_0xc351('0x9')]({'port':0x232b});function localAuthenticate(_0x57f226,_0x250f72,_0x5e148e,_0x244cf2){var _0x21a1e4,_0x5c78d0;return db[_0xc351('0xa')][_0xc351('0xb')]({'where':{'id':0x1},'attributes':[_0xc351('0xc'),_0xc351('0xd')],'raw':!![]})['then'](function(_0x3ca29e){_0x21a1e4=_0x3ca29e;return _0x57f226['findOne']({'attributes':['id','name',_0xc351('0xe'),_0xc351('0xf'),_0xc351('0x10'),_0xc351('0x11'),'blocked',_0xc351('0x12'),'loginAttempts'],'where':{'name':_0x250f72,'role':{'$or':[_0xc351('0x13'),'user',_0xc351('0x14')]}}});})[_0xc351('0x15')](function(_0x36ffeb){if(!_0x36ffeb||_0x36ffeb&&_0x36ffeb[_0xc351('0x16')]!==_0x250f72){throw new Error(_0xc351('0x17'));}else{_0x5c78d0=_0x36ffeb;return _0x5c78d0;}})['then'](function(){_0x5c78d0[_0xc351('0x18')](_0x5e148e,function(_0x4ec80b,_0x40c441){var _0x2a4e9e=_0x5c78d0[_0xc351('0x19')]+0x1;if(_0x4ec80b){return _0x244cf2(_0x4ec80b);}else if(!_0x40c441){if(_0x5c78d0[_0xc351('0x11')]){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else if(_0x21a1e4[_0xc351('0xc')]>0x0){if(_0x5c78d0['blocked']){if(_0x21a1e4['blockDuration']>0x0){if(moment(_0x5c78d0[_0xc351('0x12')])[_0xc351('0x1a')](_0x21a1e4[_0xc351('0xd')],_0xc351('0x1b'))>moment()){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else{return utils['clearBlockUser'](_0x5c78d0,_0x2a4e9e,![],null)[_0xc351('0x15')](function(){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x244cf2(null,![],{'message':_0xc351('0x17')});}}else{if(_0x2a4e9e>=_0x21a1e4['allowedLoginAttempts']){return utils[_0xc351('0x1c')](_0x5c78d0,0x0,!![],moment())[_0xc351('0x15')](function(){return _0x244cf2(null,![],{'message':_0xc351('0x17')});});}else{return utils[_0xc351('0x1c')](_0x5c78d0,_0x2a4e9e,![],null)['then'](function(){return _0x244cf2(null,![],{'message':_0xc351('0x17')});});}}}else{return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5c78d0[_0xc351('0x11')]){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x21a1e4[_0xc351('0xc')]>0x0){if(_0x5c78d0[_0xc351('0x1d')]){if(_0x21a1e4[_0xc351('0xd')]>0x0){if(moment(_0x5c78d0['blockedAt'])[_0xc351('0x1a')](_0x21a1e4['blockDuration'],'minutes')>moment()){return _0x244cf2(null,![],{'message':_0xc351('0x17')});}else{return utils[_0xc351('0x1c')](_0x5c78d0,0x0,![],null)['then'](function(){return utils[_0xc351('0x1e')](_0x5c78d0);})['then'](function(){return _0x244cf2(null,_0x5c78d0);});}}else{return _0x244cf2(null,![],{'message':_0xc351('0x17')});}}else{return utils[_0xc351('0x1c')](_0x5c78d0,0x0,![],null)[_0xc351('0x15')](function(){return utils[_0xc351('0x1e')](_0x5c78d0);})[_0xc351('0x15')](function(){return _0x244cf2(null,_0x5c78d0);})['catch'](function(_0x8e2e2c){return _0x244cf2(null,![],_0x8e2e2c);});}}else{if(_0x5c78d0['blocked']){return _0x244cf2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x5c78d0)['then'](function(){return _0x244cf2(null,_0x5c78d0);});}}}});})[_0xc351('0x1f')](function(_0xfd9a15){return _0x244cf2(null,![],_0xfd9a15);});}function sendServiceMail(_0x2846d2){return db['MailAccount'][_0xc351('0x20')]({'where':{'service':!![]},'attributes':['id',_0xc351('0x16'),_0xc351('0x21')],'include':[{'model':db[_0xc351('0x22')],'as':_0xc351('0x23'),'include':[{'model':db[_0xc351('0x24')],'as':_0xc351('0x24')}]}]})[_0xc351('0x15')](function(_0x519abb){if(!_0x519abb){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5c4dd5=_0x519abb['getSmtpOptions']();var _0x437bb6={'account':_0x5c4dd5,'message':_[_0xc351('0x25')]({'from':util[_0xc351('0x26')](_0xc351('0x27'),_0x519abb[_0xc351('0x16')],_0x519abb[_0xc351('0x21')]||_0x519abb['Smtp'][_0xc351('0x28')])},_0x2846d2)};return client['request']('SendMail',_0x437bb6);})[_0xc351('0x15')](function(_0x3303d7){if(_0x3303d7[_0xc351('0x29')]){throw new Error(util[_0xc351('0x26')](_0xc351('0x2a'),_0x3303d7[_0xc351('0x29')][_0xc351('0x2b')]||JSON[_0xc351('0x2c')](_0x3303d7[_0xc351('0x29')])));}return!![];});}function handleError(_0x12b683,_0xc3596b,_0x5c58a5){return _0x12b683[_0xc351('0x2d')](_0xc3596b||0x1f4)[_0xc351('0x2e')]({'message':_0x5c58a5?_0x5c58a5[_0xc351('0x2b')]||_0x5c58a5:''});}exports[_0xc351('0x2f')]=function(_0x5a3bc9,_0x50a70a,_0x396c32){passport[_0xc351('0x18')]('local-login',function(_0x3b6ab1,_0x6165b6,_0x4eb174){var _0x3e0b4a=_0x3b6ab1||_0x4eb174;if(_0x3e0b4a){return handleError(_0x50a70a,0x191,_0x3e0b4a);}if(!_0x6165b6){return handleError(_0x50a70a,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x531b17={'payload':{'id':_0x6165b6['id'],'role':_0x6165b6[_0xc351('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x531b17)[_0xc351('0x15')](function(_0xaea516){_0x50a70a[_0xc351('0x30')]({'id':_0x6165b6['id'],'token':_0xaea516,'statusCall':'','isAlreadyLogged':_0x6165b6[_0xc351('0x31')]});});}})(_0x5a3bc9,_0x50a70a,_0x396c32);};exports[_0xc351('0x32')]=function(_0x802d8,_0x3fbf0c){if(!_0x802d8[_0xc351('0x33')]['email']){return handleError(_0x3fbf0c,0x1f4,{'message':_0xc351('0x34')});}var _0x375718=rs[_0xc351('0x35')]();_0x802d8[_0xc351('0x33')][_0xc351('0x21')]=_0x802d8['body'][_0xc351('0x21')]['trim']()[_0xc351('0x36')]();var _0x417c3d;return db[_0xc351('0xa')][_0xc351('0xb')]({'where':{'id':0x1},'attributes':[_0xc351('0xc'),_0xc351('0xd')],'raw':!![]})[_0xc351('0x15')](function(_0x2f0f22){_0x417c3d=_0x2f0f22;return db[_0xc351('0x37')]['find']({'where':{'email':_0x802d8['body'][_0xc351('0x21')]}});})[_0xc351('0x15')](function(_0x433946){if(!_0x433946){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x433946['disabled']){throw new Error(_0xc351('0x38'));}if(_0x433946['blocked']){if(moment(_0x433946['blockedAt'])[_0xc351('0x1a')](_0x417c3d[_0xc351('0xd')],_0xc351('0x1b'))>moment()){throw new Error(_0xc351('0x39'));}else{_0x433946['blocked']=![];_0x433946[_0xc351('0x12')]=null;}}_0x433946[_0xc351('0x3a')]=_0x375718;_0x433946[_0xc351('0x3b')]=Date['now']()+0x36ee80;return _0x433946['save']();})[_0xc351('0x15')](function(){return sendServiceMail({'to':_0x802d8[_0xc351('0x33')][_0xc351('0x21')],'subject':_0xc351('0x3c'),'text':_0xc351('0x3d')+_0xc351('0x3e')+'https://'+_0x802d8['headers'][_0xc351('0x3f')]+'/reset/'+_0x375718+'\x0a\x0a'+_0xc351('0x40')});})['then'](function(){_0x3fbf0c[_0xc351('0x2d')](0xc8)[_0xc351('0x2e')]({'message':_0xc351('0x41')});})[_0xc351('0x1f')](function(_0x52064d){return handleError(_0x3fbf0c,0x1f4,_0x52064d);});};exports['reset']=function(_0x4465cc,_0x7a77d1){return db['User'][_0xc351('0x20')]({'where':{'resetPasswordToken':_0x4465cc[_0xc351('0x42')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc351('0x43')]()}}})[_0xc351('0x15')](function(_0x276538){if(!_0x276538){throw new Error(_0xc351('0x44'));}return db[_0xc351('0xa')][_0xc351('0xb')]({'attributes':['id',_0xc351('0x45'),_0xc351('0x46'),_0xc351('0x47')]})['then'](function(_0x431235){if(_0x431235['securePassword'])authService[_0xc351('0x48')](_0x4465cc['body'][_0xc351('0xe')]);if(!_0x431235[_0xc351('0x46')]||!_0x276538[_0xc351('0x49')])return _0x276538;authService['validatePasswordHistory'](_0x4465cc[_0xc351('0x33')][_0xc351('0xe')],_0x276538[_0xc351('0x49')],_0x431235[_0xc351('0x47')]);return _0x276538;})[_0xc351('0x15')](function(){_0x276538[_0xc351('0xe')]=_0x4465cc[_0xc351('0x33')]['password'];_0x276538[_0xc351('0x3a')]=null;_0x276538[_0xc351('0x3b')]=null;return _0x276538[_0xc351('0x4a')]();});})['then'](function(){_0x7a77d1[_0xc351('0x2d')](0xc8)[_0xc351('0x2e')]({'message':_0xc351('0x4b')});})[_0xc351('0x1f')](function(_0x226252){return handleError(_0x7a77d1,0x1f4,_0x226252);});};passport[_0xc351('0x4c')](_0xc351('0x4d'),new LocalStrategy({'usernameField':_0xc351('0x16'),'passwordField':_0xc351('0xe')},function(_0x4aeaf5,_0x46bbb8,_0x2b6419){return localAuthenticate(db[_0xc351('0x37')],_0x4aeaf5,_0x46bbb8,_0x2b6419);}));
\ No newline at end of file
+var _0x283a=['generate','trim','toLowerCase','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','User','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','resetPasswordExpires','status','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','message','send','local-login','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing'];(function(_0x2a6490,_0x1adf0f){var _0x1b31df=function(_0x51eeb7){while(--_0x51eeb7){_0x2a6490['push'](_0x2a6490['shift']());}};_0x1b31df(++_0x1adf0f);}(_0x283a,0x169));var _0xa283=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x283a[_0x4bfac3];return _0x15f0f2;};'use strict';var util=require(_0xa283('0x0'));var passport=require(_0xa283('0x1'));var LocalStrategy=require(_0xa283('0x2'))[_0xa283('0x3')];var jayson=require(_0xa283('0x4'));var _=require('lodash');var rs=require(_0xa283('0x5'));var moment=require(_0xa283('0x6'));var db=require(_0xa283('0x7'))['db'];var authService=require(_0xa283('0x8'));var utils=require('../../config/utils');var client=jayson[_0xa283('0x9')][_0xa283('0xa')]({'port':0x232b});function localAuthenticate(_0x90bbf2,_0xb36cb,_0x723a95,_0x32afdd){var _0x29a0e0,_0x51c968;return db['Setting'][_0xa283('0xb')]({'where':{'id':0x1},'attributes':[_0xa283('0xc'),_0xa283('0xd')],'raw':!![]})[_0xa283('0xe')](function(_0x2d9988){_0x29a0e0=_0x2d9988;return _0x90bbf2[_0xa283('0xb')]({'attributes':['id',_0xa283('0xf'),_0xa283('0x10'),_0xa283('0x11'),_0xa283('0x12'),_0xa283('0x13'),_0xa283('0x14'),_0xa283('0x15'),_0xa283('0x16')],'where':{'name':_0xb36cb,'role':{'$or':[_0xa283('0x17'),_0xa283('0x18'),_0xa283('0x19')]}}});})[_0xa283('0xe')](function(_0x432367){if(!_0x432367||_0x432367&&_0x432367['name']!==_0xb36cb){throw new Error(_0xa283('0x1a'));}else{_0x51c968=_0x432367;return _0x51c968;}})[_0xa283('0xe')](function(){_0x51c968[_0xa283('0x1b')](_0x723a95,function(_0x5b5f98,_0x3f1d70){var _0x2055e0=_0x51c968[_0xa283('0x16')]+0x1;if(_0x5b5f98){return _0x32afdd(_0x5b5f98);}else if(!_0x3f1d70){if(_0x51c968['disabled']){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}else if(_0x29a0e0[_0xa283('0xc')]>0x0){if(_0x51c968[_0xa283('0x14')]){if(_0x29a0e0[_0xa283('0xd')]>0x0){if(moment(_0x51c968[_0xa283('0x15')])[_0xa283('0x1c')](_0x29a0e0[_0xa283('0xd')],_0xa283('0x1d'))>moment()){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}else{return utils[_0xa283('0x1e')](_0x51c968,_0x2055e0,![],null)[_0xa283('0xe')](function(){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});});}}else{return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}}else{if(_0x2055e0>=_0x29a0e0[_0xa283('0xc')]){return utils[_0xa283('0x1e')](_0x51c968,0x0,!![],moment())[_0xa283('0xe')](function(){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});});}else{return utils['clearBlockUser'](_0x51c968,_0x2055e0,![],null)[_0xa283('0xe')](function(){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});});}}}else{return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}}else{if(_0x51c968[_0xa283('0x13')]){return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}else if(_0x29a0e0[_0xa283('0xc')]>0x0){if(_0x51c968[_0xa283('0x14')]){if(_0x29a0e0[_0xa283('0xd')]>0x0){if(moment(_0x51c968['blockedAt'])[_0xa283('0x1c')](_0x29a0e0[_0xa283('0xd')],_0xa283('0x1d'))>moment()){return _0x32afdd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x51c968,0x0,![],null)[_0xa283('0xe')](function(){return utils[_0xa283('0x1f')](_0x51c968);})[_0xa283('0xe')](function(){return _0x32afdd(null,_0x51c968);});}}else{return _0x32afdd(null,![],{'message':_0xa283('0x1a')});}}else{return utils[_0xa283('0x1e')](_0x51c968,0x0,![],null)[_0xa283('0xe')](function(){return utils[_0xa283('0x1f')](_0x51c968);})[_0xa283('0xe')](function(){return _0x32afdd(null,_0x51c968);})[_0xa283('0x20')](function(_0x3eafbc){return _0x32afdd(null,![],_0x3eafbc);});}}else{if(_0x51c968['blocked']){return _0x32afdd(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa283('0x1f')](_0x51c968)[_0xa283('0xe')](function(){return _0x32afdd(null,_0x51c968);});}}}});})[_0xa283('0x20')](function(_0x35b6bf){return _0x32afdd(null,![],_0x35b6bf);});}function sendServiceMail(_0x5532e6){return db['MailAccount'][_0xa283('0x21')]({'where':{'service':!![]},'attributes':['id',_0xa283('0xf'),'email'],'include':[{'model':db[_0xa283('0x22')],'as':_0xa283('0x23'),'include':[{'model':db['CloudProvider'],'as':_0xa283('0x24')}]}]})[_0xa283('0xe')](function(_0x160a2b){if(!_0x160a2b){throw new Error(_0xa283('0x25'));}var _0x391324=_0x160a2b[_0xa283('0x26')]();var _0x5f3a85={'account':_0x391324,'message':_[_0xa283('0x27')]({'from':util['format'](_0xa283('0x28'),_0x160a2b[_0xa283('0xf')],_0x160a2b[_0xa283('0x29')]||_0x160a2b['Smtp'][_0xa283('0x18')])},_0x5532e6)};return client[_0xa283('0x2a')](_0xa283('0x2b'),_0x5f3a85);})[_0xa283('0xe')](function(_0x1af0d8){if(_0x1af0d8[_0xa283('0x2c')]){throw new Error(util[_0xa283('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1af0d8[_0xa283('0x2c')][_0xa283('0x2e')]||JSON['stringify'](_0x1af0d8[_0xa283('0x2c')])));}return!![];});}function handleError(_0x3c39e1,_0x44be4c,_0x55cb6b){return _0x3c39e1['status'](_0x44be4c||0x1f4)[_0xa283('0x2f')]({'message':_0x55cb6b?_0x55cb6b[_0xa283('0x2e')]||_0x55cb6b:''});}exports['login']=function(_0x4dcd65,_0x21bab0,_0x14157c){passport[_0xa283('0x1b')](_0xa283('0x30'),function(_0x44202e,_0x124c4c,_0x26ebb5){var _0x330188=_0x44202e||_0x26ebb5;if(_0x330188){return handleError(_0x21bab0,0x191,_0x330188);}if(!_0x124c4c){return handleError(_0x21bab0,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2440b3={'payload':{'id':_0x124c4c['id'],'role':_0x124c4c['role']},'options':{'expiresIn':0x15180}};return authService[_0xa283('0x31')](_0x2440b3)[_0xa283('0xe')](function(_0x4e7e16){_0x21bab0['json']({'id':_0x124c4c['id'],'token':_0x4e7e16,'statusCall':'','isAlreadyLogged':_0x124c4c[_0xa283('0x32')]});});}})(_0x4dcd65,_0x21bab0,_0x14157c);};exports[_0xa283('0x33')]=function(_0x469366,_0x4031e6){if(!_0x469366[_0xa283('0x34')][_0xa283('0x29')]){return handleError(_0x4031e6,0x1f4,{'message':_0xa283('0x35')});}var _0x22ad97=rs[_0xa283('0x36')]();_0x469366['body'][_0xa283('0x29')]=_0x469366['body']['email'][_0xa283('0x37')]()[_0xa283('0x38')]();var _0x27e5e1;return db[_0xa283('0x39')][_0xa283('0xb')]({'where':{'id':0x1},'attributes':[_0xa283('0xc'),_0xa283('0xd')],'raw':!![]})[_0xa283('0xe')](function(_0x746f09){_0x27e5e1=_0x746f09;return db['User'][_0xa283('0x21')]({'where':{'email':_0x469366[_0xa283('0x34')][_0xa283('0x29')]}});})['then'](function(_0x3fee1e){if(!_0x3fee1e){throw new Error(_0xa283('0x3a'));}if(_0x3fee1e[_0xa283('0x13')]){throw new Error(_0xa283('0x3b'));}if(_0x3fee1e[_0xa283('0x14')]){if(moment(_0x3fee1e['blockedAt'])[_0xa283('0x1c')](_0x27e5e1[_0xa283('0xd')],_0xa283('0x1d'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3fee1e[_0xa283('0x14')]=![];_0x3fee1e[_0xa283('0x15')]=null;}}_0x3fee1e[_0xa283('0x3c')]=_0x22ad97;_0x3fee1e['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x3fee1e[_0xa283('0x3d')]();})[_0xa283('0xe')](function(){return sendServiceMail({'to':_0x469366['body'][_0xa283('0x29')],'subject':_0xa283('0x3e'),'text':'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'+_0xa283('0x3f')+_0x469366[_0xa283('0x40')][_0xa283('0x41')]+_0xa283('0x42')+_0x22ad97+'\x0a\x0a'+_0xa283('0x43')});})[_0xa283('0xe')](function(){_0x4031e6['status'](0xc8)[_0xa283('0x2f')]({'message':_0xa283('0x44')});})[_0xa283('0x20')](function(_0x5af46c){return handleError(_0x4031e6,0x1f4,_0x5af46c);});};exports[_0xa283('0x45')]=function(_0x58d087,_0x4b728a){return db[_0xa283('0x46')]['find']({'where':{'resetPasswordToken':_0x58d087['params'][_0xa283('0x47')],'resetPasswordExpires':{'$gt':Date[_0xa283('0x48')]()}}})['then'](function(_0x1665ca){if(!_0x1665ca){throw new Error(_0xa283('0x49'));}return db[_0xa283('0x39')]['findOne']({'attributes':['id',_0xa283('0x4a'),'enforcePasswordHistory',_0xa283('0x4b')]})['then'](function(_0x52c589){if(_0x52c589[_0xa283('0x4a')])authService[_0xa283('0x4c')](_0x58d087['body']['password']);if(!_0x52c589[_0xa283('0x4d')]||!_0x1665ca[_0xa283('0x4e')])return _0x1665ca;authService['validatePasswordHistory'](_0x58d087[_0xa283('0x34')]['password'],_0x1665ca[_0xa283('0x4e')],_0x52c589[_0xa283('0x4b')]);return _0x1665ca;})['then'](function(){_0x1665ca['password']=_0x58d087['body']['password'];_0x1665ca[_0xa283('0x3c')]=null;_0x1665ca[_0xa283('0x4f')]=null;return _0x1665ca[_0xa283('0x3d')]();});})['then'](function(){_0x4b728a[_0xa283('0x50')](0xc8)[_0xa283('0x2f')]({'message':_0xa283('0x51')});})[_0xa283('0x20')](function(_0x5c4752){return handleError(_0x4b728a,0x1f4,_0x5c4752);});};passport[_0xa283('0x52')](_0xa283('0x30'),new LocalStrategy({'usernameField':_0xa283('0xf'),'passwordField':_0xa283('0x10')},function(_0x199a02,_0x432447,_0x104f55){return localAuthenticate(db[_0xa283('0x46')],_0x199a02,_0x432447,_0x104f55);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 3c3bd48..c266f8b 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 _0xe82b=['login','/forgot','forgot','/reset/:token','reset','express','Router','./authLocal.controller','post'];(function(_0x1737a0,_0x11fb16){var _0x48d830=function(_0x5dc5a0){while(--_0x5dc5a0){_0x1737a0['push'](_0x1737a0['shift']());}};_0x48d830(++_0x11fb16);}(_0xe82b,0x125));var _0xbe82=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xe82b[_0x30ae5e];return _0x1f2e93;};'use strict';var express=require(_0xbe82('0x0'));var router=express[_0xbe82('0x1')]();var controller=require(_0xbe82('0x2'));router[_0xbe82('0x3')]('/',controller[_0xbe82('0x4')]);router[_0xbe82('0x3')](_0xbe82('0x5'),controller[_0xbe82('0x6')]);router[_0xbe82('0x3')](_0xbe82('0x7'),controller[_0xbe82('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x3f99=['post','login','/forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f99,0x14e));var _0x93f9=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0x3f99[_0x20cb20];return _0x2fcf4b;};'use strict';var express=require(_0x93f9('0x0'));var router=express['Router']();var controller=require(_0x93f9('0x1'));router[_0x93f9('0x2')]('/',controller[_0x93f9('0x3')]);router[_0x93f9('0x2')](_0x93f9('0x4'),controller['forgot']);router[_0x93f9('0x2')](_0x93f9('0x5'),controller[_0x93f9('0x6')]);module[_0x93f9('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 01772d8..c16ed79 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 _0xd0df=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x3c25d7,_0x50ebd0){var _0xd8d3a6=function(_0xfa4124){while(--_0xfa4124){_0x3c25d7['push'](_0x3c25d7['shift']());}};_0xd8d3a6(++_0x50ebd0);}(_0xd0df,0x1df));var _0xfd0d=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xd0df[_0x43f881];return _0x365c14;};'use strict';var Sequelize=require(_0xfd0d('0x0'));module[_0xfd0d('0x1')]={'name':{'type':Sequelize[_0xfd0d('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xfd0d('0x2')]},'description':{'type':Sequelize[_0xfd0d('0x2')]},'status':{'type':Sequelize[_0xfd0d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfd0d('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xc4ff=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x1945e3,_0x4efd74){var _0x5bf682=function(_0x43a175){while(--_0x43a175){_0x1945e3['push'](_0x1945e3['shift']());}};_0x5bf682(++_0x4efd74);}(_0xc4ff,0xf7));var _0xfc4f=function(_0x47042c,_0x339d8b){_0x47042c=_0x47042c-0x0;var _0x542e56=_0xc4ff[_0x47042c];return _0x542e56;};'use strict';var Sequelize=require('sequelize');module[_0xfc4f('0x0')]={'name':{'type':Sequelize[_0xfc4f('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xfc4f('0x1')]},'description':{'type':Sequelize[_0xfc4f('0x1')]},'status':{'type':Sequelize[_0xfc4f('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfc4f('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index cf031c3..ef189c6 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 _0x5994=['update','then','destroy','error','stack','name','index','Automation','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','length','find','create','body','params','addConditions','omit','ids','getConditions','findOne','Condition','addActions','getActions','Action','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save'];(function(_0x4c9efc,_0x416853){var _0x58197d=function(_0x2ee00d){while(--_0x2ee00d){_0x4c9efc['push'](_0x4c9efc['shift']());}};_0x58197d(++_0x416853);}(_0x5994,0x11d));var _0x4599=function(_0x1c463b,_0x5fd405){_0x1c463b=_0x1c463b-0x0;var _0x39f8a4=_0x5994[_0x1c463b];return _0x39f8a4;};'use strict';var emlformat=require(_0x4599('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4599('0x1'));var moment=require(_0x4599('0x2'));var BPromise=require(_0x4599('0x3'));var Mustache=require(_0x4599('0x4'));var util=require(_0x4599('0x5'));var path=require(_0x4599('0x6'));var sox=require(_0x4599('0x7'));var csv=require(_0x4599('0x8'));var ejs=require(_0x4599('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4599('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4599('0xb'));var toCsv=require(_0x4599('0x8'));var querystring=require(_0x4599('0xc'));var Papa=require(_0x4599('0xd'));var Redis=require(_0x4599('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4599('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4599('0x10'))(_0x4599('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4599('0x12'));var db=require(_0x4599('0x13'))['db'];function respondWithStatusCode(_0x4abbe7,_0x4cd02e){_0x4cd02e=_0x4cd02e||0xcc;return function(_0x5aa1f6){if(_0x5aa1f6){return _0x4abbe7[_0x4599('0x14')](_0x4cd02e);}return _0x4abbe7[_0x4599('0x15')](_0x4cd02e)['end']();};}function respondWithResult(_0x29fa17,_0xd7642b){_0xd7642b=_0xd7642b||0xc8;return function(_0x531780){if(_0x531780){return _0x29fa17[_0x4599('0x15')](_0xd7642b)['json'](_0x531780);}};}function respondWithFilteredResult(_0x196080,_0x4168cf){return function(_0x40abdc){if(_0x40abdc){var _0x521058=typeof _0x4168cf[_0x4599('0x16')]===_0x4599('0x17')&&typeof _0x4168cf['limit']===_0x4599('0x17');var _0x1f968f=_0x40abdc[_0x4599('0x18')];var _0x4ed79a=_0x521058?0x0:_0x4168cf[_0x4599('0x16')];var _0x58f343=_0x521058?_0x40abdc['count']:_0x4168cf[_0x4599('0x16')]+_0x4168cf[_0x4599('0x19')];var _0x8304c1;if(_0x58f343>=_0x1f968f){_0x58f343=_0x1f968f;_0x8304c1=0xc8;}else{_0x8304c1=0xce;}_0x196080[_0x4599('0x15')](_0x8304c1);return _0x196080[_0x4599('0x1a')](_0x4599('0x1b'),_0x4ed79a+'-'+_0x58f343+'/'+_0x1f968f)[_0x4599('0x1c')](_0x40abdc);}return null;};}function patchUpdates(_0x4586a9){return function(_0x2eee2f){try{jsonpatch['apply'](_0x2eee2f,_0x4586a9,!![]);}catch(_0x360ab2){return BPromise[_0x4599('0x1d')](_0x360ab2);}return _0x2eee2f[_0x4599('0x1e')]();};}function saveUpdates(_0x14c89d,_0x5d7b4e){return function(_0x541030){if(_0x541030){return _0x541030[_0x4599('0x1f')](_0x14c89d)[_0x4599('0x20')](function(_0x2cd75a){return _0x2cd75a;});}return null;};}function removeEntity(_0x51ff32,_0x270cf7){return function(_0x1f090d){if(_0x1f090d){return _0x1f090d[_0x4599('0x21')]()[_0x4599('0x20')](function(){_0x51ff32[_0x4599('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e50e9,_0x281b66){return function(_0x3f3fcc){if(!_0x3f3fcc){_0x1e50e9['sendStatus'](0x194);}return _0x3f3fcc;};}function handleError(_0x30c1c3,_0xbed598){_0xbed598=_0xbed598||0x1f4;return function(_0x525369){logger[_0x4599('0x22')](_0x525369[_0x4599('0x23')]);if(_0x525369[_0x4599('0x24')]){delete _0x525369[_0x4599('0x24')];}_0x30c1c3['status'](_0xbed598)['send'](_0x525369);};}exports[_0x4599('0x25')]=function(_0x344ea7,_0x4f25cc){var _0xec3151={},_0x5d5c11={},_0x44eb43={'count':0x0,'rows':[]};var _0x427dca=_['map'](db[_0x4599('0x26')][_0x4599('0x27')],function(_0x45f4d3){return{'name':_0x45f4d3[_0x4599('0x28')],'type':_0x45f4d3[_0x4599('0x29')]['key']};});_0x5d5c11[_0x4599('0x2a')]=_[_0x4599('0x2b')](_0x427dca,'name');_0x5d5c11['query']=_['keys'](_0x344ea7[_0x4599('0x2c')]);_0x5d5c11[_0x4599('0x2d')]=_[_0x4599('0x2e')](_0x5d5c11[_0x4599('0x2a')],_0x5d5c11[_0x4599('0x2c')]);_0xec3151[_0x4599('0x2f')]=_[_0x4599('0x2e')](_0x5d5c11['model'],qs[_0x4599('0x30')](_0x344ea7['query'][_0x4599('0x30')]));_0xec3151[_0x4599('0x2f')]=_0xec3151['attributes']['length']?_0xec3151[_0x4599('0x2f')]:_0x5d5c11[_0x4599('0x2a')];if(!_0x344ea7['query'][_0x4599('0x31')](_0x4599('0x32'))){_0xec3151[_0x4599('0x19')]=qs[_0x4599('0x19')](_0x344ea7[_0x4599('0x2c')][_0x4599('0x19')]);_0xec3151[_0x4599('0x16')]=qs[_0x4599('0x16')](_0x344ea7[_0x4599('0x2c')][_0x4599('0x16')]);}_0xec3151[_0x4599('0x33')]=qs['sort'](_0x344ea7[_0x4599('0x2c')][_0x4599('0x34')]);_0xec3151[_0x4599('0x35')]=qs['filters'](_[_0x4599('0x36')](_0x344ea7[_0x4599('0x2c')],_0x5d5c11[_0x4599('0x2d')]),_0x427dca);if(_0x344ea7[_0x4599('0x2c')]['filter']){_0xec3151[_0x4599('0x35')]=_[_0x4599('0x37')](_0xec3151[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x427dca,function(_0x3cbf6b){if(_0x3cbf6b[_0x4599('0x29')]!==_0x4599('0x38')){var _0x48b78a={};_0x48b78a[_0x3cbf6b['name']]={'$like':'%'+_0x344ea7[_0x4599('0x2c')][_0x4599('0x39')]+'%'};return _0x48b78a;}})});}_0xec3151=_['merge']({},_0xec3151,_0x344ea7[_0x4599('0x3a')]);var _0xeb7a18={'where':_0xec3151[_0x4599('0x35')]};return db[_0x4599('0x26')][_0x4599('0x18')](_0xeb7a18)['then'](function(_0x65b12){_0x44eb43['count']=_0x65b12;if(_0x344ea7['query'][_0x4599('0x3b')]){_0xec3151['include']=[{'all':!![]}];}return db[_0x4599('0x26')][_0x4599('0x3c')](_0xec3151);})[_0x4599('0x20')](function(_0xf92e20){_0x44eb43[_0x4599('0x3d')]=_0xf92e20;return _0x44eb43;})[_0x4599('0x20')](respondWithFilteredResult(_0x4f25cc,_0xec3151))[_0x4599('0x3e')](handleError(_0x4f25cc,null));};exports[_0x4599('0x3f')]=function(_0x5b34fc,_0x13f4f7){var _0x5214c0={'raw':![],'where':{'id':_0x5b34fc['params']['id']}},_0x32a7a5={};_0x32a7a5['model']=_['keys'](db['Automation']['rawAttributes']);_0x32a7a5[_0x4599('0x2c')]=_[_0x4599('0x40')](_0x5b34fc[_0x4599('0x2c')]);_0x32a7a5[_0x4599('0x2d')]=_[_0x4599('0x2e')](_0x32a7a5[_0x4599('0x2a')],_0x32a7a5[_0x4599('0x2c')]);_0x5214c0[_0x4599('0x2f')]=_['intersection'](_0x32a7a5['model'],qs[_0x4599('0x30')](_0x5b34fc[_0x4599('0x2c')][_0x4599('0x30')]));_0x5214c0[_0x4599('0x2f')]=_0x5214c0[_0x4599('0x2f')][_0x4599('0x41')]?_0x5214c0[_0x4599('0x2f')]:_0x32a7a5[_0x4599('0x2a')];if(_0x5b34fc[_0x4599('0x2c')][_0x4599('0x3b')]){_0x5214c0['include']=[{'all':!![]}];}_0x5214c0=_[_0x4599('0x37')]({},_0x5214c0,_0x5b34fc[_0x4599('0x3a')]);return db[_0x4599('0x26')][_0x4599('0x42')](_0x5214c0)[_0x4599('0x20')](handleEntityNotFound(_0x13f4f7,null))[_0x4599('0x20')](respondWithResult(_0x13f4f7,null))[_0x4599('0x3e')](handleError(_0x13f4f7,null));};exports[_0x4599('0x43')]=function(_0x2c3ff1,_0x26f544){return db['Automation'][_0x4599('0x43')](_0x2c3ff1['body'],{})[_0x4599('0x20')](respondWithResult(_0x26f544,0xc9))[_0x4599('0x3e')](handleError(_0x26f544,null));};exports['update']=function(_0x3ae371,_0x169df3){if(_0x3ae371[_0x4599('0x44')]['id']){delete _0x3ae371[_0x4599('0x44')]['id'];}return db['Automation'][_0x4599('0x42')]({'where':{'id':_0x3ae371['params']['id']}})['then'](handleEntityNotFound(_0x169df3,null))[_0x4599('0x20')](saveUpdates(_0x3ae371[_0x4599('0x44')],null))[_0x4599('0x20')](respondWithResult(_0x169df3,null))[_0x4599('0x3e')](handleError(_0x169df3,null));};exports[_0x4599('0x21')]=function(_0xbca1b8,_0x10761f){return db['Automation'][_0x4599('0x42')]({'where':{'id':_0xbca1b8[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x10761f,null))[_0x4599('0x20')](removeEntity(_0x10761f,null))[_0x4599('0x3e')](handleError(_0x10761f,null));};exports[_0x4599('0x46')]=function(_0x101854,_0xb57f07,_0x2fc88b){return db['Condition'][_0x4599('0x42')]({'where':{'id':_0x101854['params']['id']}})[_0x4599('0x20')](handleEntityNotFound(_0xb57f07,null))[_0x4599('0x20')](function(_0x265f9b){if(_0x265f9b){return _0x265f9b[_0x4599('0x46')](_0x101854['body']['ids'],_[_0x4599('0x47')](_0x101854[_0x4599('0x44')],[_0x4599('0x48'),'id'])||{});}})[_0x4599('0x20')](respondWithResult(_0xb57f07,null))[_0x4599('0x3e')](handleError(_0xb57f07,null));};exports[_0x4599('0x49')]=function(_0xd4b04b,_0x42522e,_0x5ece82){var _0x3f0c3c={};var _0x32e312={};var _0x5e0c45;var _0x3463e3;return db[_0x4599('0x26')][_0x4599('0x4a')]({'where':{'id':_0xd4b04b[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x42522e,null))['then'](function(_0x4c60a4){if(_0x4c60a4){_0x5e0c45=_0x4c60a4;_0x32e312[_0x4599('0x2a')]=_['keys'](db[_0x4599('0x4b')][_0x4599('0x27')]);_0x32e312[_0x4599('0x2c')]=_[_0x4599('0x40')](_0xd4b04b[_0x4599('0x2c')]);_0x32e312[_0x4599('0x2d')]=_['intersection'](_0x32e312[_0x4599('0x2a')],_0x32e312[_0x4599('0x2c')]);_0x3f0c3c['attributes']=_[_0x4599('0x2e')](_0x32e312[_0x4599('0x2a')],qs['fields'](_0xd4b04b[_0x4599('0x2c')][_0x4599('0x30')]));_0x3f0c3c[_0x4599('0x2f')]=_0x3f0c3c['attributes'][_0x4599('0x41')]?_0x3f0c3c[_0x4599('0x2f')]:_0x32e312[_0x4599('0x2a')];_0x3f0c3c[_0x4599('0x33')]=qs[_0x4599('0x34')](_0xd4b04b[_0x4599('0x2c')][_0x4599('0x34')]);_0x3f0c3c['where']=qs[_0x4599('0x2d')](_[_0x4599('0x36')](_0xd4b04b[_0x4599('0x2c')],_0x32e312[_0x4599('0x2d')]));if(_0xd4b04b[_0x4599('0x2c')]['filter']){_0x3f0c3c['where']=_[_0x4599('0x37')](_0x3f0c3c[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x3f0c3c['attributes'],function(_0xa448da){var _0x111d4c={};_0x111d4c[_0xa448da]={'$like':'%'+_0xd4b04b[_0x4599('0x2c')][_0x4599('0x39')]+'%'};return _0x111d4c;})});}_0x3f0c3c=_['merge']({},_0x3f0c3c,_0xd4b04b[_0x4599('0x3a')]);return _0x5e0c45['getConditions'](_0x3f0c3c);}})['then'](function(_0x261999){if(_0x261999){_0x3463e3=_0x261999['length'];if(!_0xd4b04b[_0x4599('0x2c')][_0x4599('0x31')](_0x4599('0x32'))){_0x3f0c3c[_0x4599('0x19')]=qs[_0x4599('0x19')](_0xd4b04b['query'][_0x4599('0x19')]);_0x3f0c3c[_0x4599('0x16')]=qs[_0x4599('0x16')](_0xd4b04b[_0x4599('0x2c')]['offset']);}return _0x5e0c45[_0x4599('0x49')](_0x3f0c3c);}})[_0x4599('0x20')](function(_0x502b5b){if(_0x502b5b){return _0x502b5b?{'count':_0x3463e3,'rows':_0x502b5b}:null;}})[_0x4599('0x20')](respondWithResult(_0x42522e,null))[_0x4599('0x3e')](handleError(_0x42522e,null));};exports[_0x4599('0x4c')]=function(_0x10fcd7,_0x21d4c2,_0x14163f){return db['Action']['find']({'where':{'id':_0x10fcd7[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x21d4c2,null))[_0x4599('0x20')](function(_0x357dfb){if(_0x357dfb){return _0x357dfb['addActions'](_0x10fcd7[_0x4599('0x44')][_0x4599('0x48')],_[_0x4599('0x47')](_0x10fcd7[_0x4599('0x44')],[_0x4599('0x48'),'id'])||{});}})[_0x4599('0x20')](respondWithResult(_0x21d4c2,null))[_0x4599('0x3e')](handleError(_0x21d4c2,null));};exports[_0x4599('0x4d')]=function(_0x137476,_0x1c52b6,_0x2902ef){var _0x4b29b4={};var _0x58e542={};var _0x2e2b6b;var _0x43cdf7;return db[_0x4599('0x26')][_0x4599('0x4a')]({'where':{'id':_0x137476[_0x4599('0x45')]['id']}})[_0x4599('0x20')](handleEntityNotFound(_0x1c52b6,null))[_0x4599('0x20')](function(_0x304e5a){if(_0x304e5a){_0x2e2b6b=_0x304e5a;_0x58e542['model']=_[_0x4599('0x40')](db[_0x4599('0x4e')][_0x4599('0x27')]);_0x58e542[_0x4599('0x2c')]=_[_0x4599('0x40')](_0x137476['query']);_0x58e542[_0x4599('0x2d')]=_['intersection'](_0x58e542[_0x4599('0x2a')],_0x58e542[_0x4599('0x2c')]);_0x4b29b4[_0x4599('0x2f')]=_[_0x4599('0x2e')](_0x58e542[_0x4599('0x2a')],qs['fields'](_0x137476[_0x4599('0x2c')]['fields']));_0x4b29b4[_0x4599('0x2f')]=_0x4b29b4[_0x4599('0x2f')]['length']?_0x4b29b4[_0x4599('0x2f')]:_0x58e542[_0x4599('0x2a')];_0x4b29b4[_0x4599('0x33')]=qs['sort'](_0x137476[_0x4599('0x2c')][_0x4599('0x34')]);_0x4b29b4['where']=qs['filters'](_[_0x4599('0x36')](_0x137476[_0x4599('0x2c')],_0x58e542[_0x4599('0x2d')]));if(_0x137476['query'][_0x4599('0x39')]){_0x4b29b4[_0x4599('0x35')]=_[_0x4599('0x37')](_0x4b29b4[_0x4599('0x35')],{'$or':_[_0x4599('0x2b')](_0x4b29b4['attributes'],function(_0x1ab15d){var _0x1cfef4={};_0x1cfef4[_0x1ab15d]={'$like':'%'+_0x137476['query'][_0x4599('0x39')]+'%'};return _0x1cfef4;})});}_0x4b29b4=_['merge']({},_0x4b29b4,_0x137476[_0x4599('0x3a')]);return _0x2e2b6b[_0x4599('0x4d')](_0x4b29b4);}})['then'](function(_0x5c86ec){if(_0x5c86ec){_0x43cdf7=_0x5c86ec['length'];if(!_0x137476[_0x4599('0x2c')][_0x4599('0x31')](_0x4599('0x32'))){_0x4b29b4[_0x4599('0x19')]=qs['limit'](_0x137476[_0x4599('0x2c')][_0x4599('0x19')]);_0x4b29b4[_0x4599('0x16')]=qs[_0x4599('0x16')](_0x137476[_0x4599('0x2c')][_0x4599('0x16')]);}return _0x2e2b6b[_0x4599('0x4d')](_0x4b29b4);}})['then'](function(_0x4704d8){if(_0x4704d8){return _0x4704d8?{'count':_0x43cdf7,'rows':_0x4704d8}:null;}})[_0x4599('0x20')](respondWithResult(_0x1c52b6,null))[_0x4599('0x3e')](handleError(_0x1c52b6,null));};
\ No newline at end of file
+var _0xe62c=['hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','update','then','destroy','name','send','map','Automation','rawAttributes','type','key','model','keys','filters','intersection','query','fields','length','attributes','nolimit','sort','where','pick','filter','merge','options','include','catch','show','includeAll','find','create','body','params','Condition','addConditions','ids','omit','getConditions','findOne','order'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0xe62c,0xd9));var _0xce62=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xe62c[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0xce62('0x0'));var rimraf=require(_0xce62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce62('0x2'));var moment=require(_0xce62('0x3'));var BPromise=require(_0xce62('0x4'));var Mustache=require('mustache');var util=require(_0xce62('0x5'));var path=require(_0xce62('0x6'));var sox=require('sox');var csv=require(_0xce62('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce62('0x8'));var _=require(_0xce62('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce62('0x7'));var querystring=require(_0xce62('0xa'));var Papa=require(_0xce62('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xce62('0xc'));var as=require(_0xce62('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xce62('0xe'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xce62('0xf'))['db'];function respondWithStatusCode(_0x197a5b,_0x2bea96){_0x2bea96=_0x2bea96||0xcc;return function(_0x516db4){if(_0x516db4){return _0x197a5b[_0xce62('0x10')](_0x2bea96);}return _0x197a5b[_0xce62('0x11')](_0x2bea96)[_0xce62('0x12')]();};}function respondWithResult(_0x2eb809,_0x255a52){_0x255a52=_0x255a52||0xc8;return function(_0x2f9921){if(_0x2f9921){return _0x2eb809['status'](_0x255a52)[_0xce62('0x13')](_0x2f9921);}};}function respondWithFilteredResult(_0x33a094,_0x212bcb){return function(_0x53c27c){if(_0x53c27c){var _0x2249a0=typeof _0x212bcb['offset']===_0xce62('0x14')&&typeof _0x212bcb['limit']===_0xce62('0x14');var _0x1f00e4=_0x53c27c[_0xce62('0x15')];var _0x3fab63=_0x2249a0?0x0:_0x212bcb[_0xce62('0x16')];var _0x154923=_0x2249a0?_0x53c27c[_0xce62('0x15')]:_0x212bcb['offset']+_0x212bcb[_0xce62('0x17')];var _0x543ccd;if(_0x154923>=_0x1f00e4){_0x154923=_0x1f00e4;_0x543ccd=0xc8;}else{_0x543ccd=0xce;}_0x33a094[_0xce62('0x11')](_0x543ccd);return _0x33a094[_0xce62('0x18')]('Content-Range',_0x3fab63+'-'+_0x154923+'/'+_0x1f00e4)[_0xce62('0x13')](_0x53c27c);}return null;};}function patchUpdates(_0x1f3b39){return function(_0x9f50d){try{jsonpatch[_0xce62('0x19')](_0x9f50d,_0x1f3b39,!![]);}catch(_0x5dd43d){return BPromise[_0xce62('0x1a')](_0x5dd43d);}return _0x9f50d['save']();};}function saveUpdates(_0x208871,_0x22f1f1){return function(_0x4d7b8f){if(_0x4d7b8f){return _0x4d7b8f[_0xce62('0x1b')](_0x208871)[_0xce62('0x1c')](function(_0x4a4703){return _0x4a4703;});}return null;};}function removeEntity(_0x391b03,_0x645d5b){return function(_0x4091bf){if(_0x4091bf){return _0x4091bf[_0xce62('0x1d')]()[_0xce62('0x1c')](function(){_0x391b03[_0xce62('0x11')](0xcc)[_0xce62('0x12')]();});}};}function handleEntityNotFound(_0x2b4b1f,_0x4e8075){return function(_0x5f2f02){if(!_0x5f2f02){_0x2b4b1f['sendStatus'](0x194);}return _0x5f2f02;};}function handleError(_0x6709ae,_0x373d58){_0x373d58=_0x373d58||0x1f4;return function(_0x1d445e){logger['error'](_0x1d445e['stack']);if(_0x1d445e['name']){delete _0x1d445e[_0xce62('0x1e')];}_0x6709ae[_0xce62('0x11')](_0x373d58)[_0xce62('0x1f')](_0x1d445e);};}exports['index']=function(_0x20f71a,_0x4114f2){var _0x1504ce={},_0x174c5b={},_0x7598f4={'count':0x0,'rows':[]};var _0x15f172=_[_0xce62('0x20')](db[_0xce62('0x21')][_0xce62('0x22')],function(_0xa47858){return{'name':_0xa47858['fieldName'],'type':_0xa47858[_0xce62('0x23')][_0xce62('0x24')]};});_0x174c5b[_0xce62('0x25')]=_[_0xce62('0x20')](_0x15f172,_0xce62('0x1e'));_0x174c5b['query']=_[_0xce62('0x26')](_0x20f71a['query']);_0x174c5b[_0xce62('0x27')]=_[_0xce62('0x28')](_0x174c5b[_0xce62('0x25')],_0x174c5b[_0xce62('0x29')]);_0x1504ce['attributes']=_['intersection'](_0x174c5b[_0xce62('0x25')],qs[_0xce62('0x2a')](_0x20f71a[_0xce62('0x29')][_0xce62('0x2a')]));_0x1504ce['attributes']=_0x1504ce['attributes'][_0xce62('0x2b')]?_0x1504ce[_0xce62('0x2c')]:_0x174c5b[_0xce62('0x25')];if(!_0x20f71a['query']['hasOwnProperty'](_0xce62('0x2d'))){_0x1504ce[_0xce62('0x17')]=qs[_0xce62('0x17')](_0x20f71a['query']['limit']);_0x1504ce[_0xce62('0x16')]=qs['offset'](_0x20f71a[_0xce62('0x29')]['offset']);}_0x1504ce['order']=qs[_0xce62('0x2e')](_0x20f71a[_0xce62('0x29')][_0xce62('0x2e')]);_0x1504ce[_0xce62('0x2f')]=qs['filters'](_[_0xce62('0x30')](_0x20f71a['query'],_0x174c5b['filters']),_0x15f172);if(_0x20f71a[_0xce62('0x29')][_0xce62('0x31')]){_0x1504ce[_0xce62('0x2f')]=_[_0xce62('0x32')](_0x1504ce[_0xce62('0x2f')],{'$or':_[_0xce62('0x20')](_0x15f172,function(_0x15d2b5){if(_0x15d2b5[_0xce62('0x23')]!=='VIRTUAL'){var _0x402e02={};_0x402e02[_0x15d2b5[_0xce62('0x1e')]]={'$like':'%'+_0x20f71a[_0xce62('0x29')]['filter']+'%'};return _0x402e02;}})});}_0x1504ce=_[_0xce62('0x32')]({},_0x1504ce,_0x20f71a[_0xce62('0x33')]);var _0x52dd3a={'where':_0x1504ce[_0xce62('0x2f')]};return db[_0xce62('0x21')]['count'](_0x52dd3a)[_0xce62('0x1c')](function(_0x2374d0){_0x7598f4['count']=_0x2374d0;if(_0x20f71a[_0xce62('0x29')]['includeAll']){_0x1504ce[_0xce62('0x34')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x1504ce);})[_0xce62('0x1c')](function(_0x544e41){_0x7598f4['rows']=_0x544e41;return _0x7598f4;})['then'](respondWithFilteredResult(_0x4114f2,_0x1504ce))[_0xce62('0x35')](handleError(_0x4114f2,null));};exports[_0xce62('0x36')]=function(_0x15a7e7,_0x2a6916){var _0x1712f7={'raw':![],'where':{'id':_0x15a7e7['params']['id']}},_0xce5a9={};_0xce5a9[_0xce62('0x25')]=_['keys'](db[_0xce62('0x21')][_0xce62('0x22')]);_0xce5a9['query']=_[_0xce62('0x26')](_0x15a7e7[_0xce62('0x29')]);_0xce5a9['filters']=_['intersection'](_0xce5a9['model'],_0xce5a9['query']);_0x1712f7[_0xce62('0x2c')]=_[_0xce62('0x28')](_0xce5a9[_0xce62('0x25')],qs['fields'](_0x15a7e7['query'][_0xce62('0x2a')]));_0x1712f7['attributes']=_0x1712f7['attributes'][_0xce62('0x2b')]?_0x1712f7['attributes']:_0xce5a9['model'];if(_0x15a7e7['query'][_0xce62('0x37')]){_0x1712f7['include']=[{'all':!![]}];}_0x1712f7=_[_0xce62('0x32')]({},_0x1712f7,_0x15a7e7['options']);return db[_0xce62('0x21')][_0xce62('0x38')](_0x1712f7)[_0xce62('0x1c')](handleEntityNotFound(_0x2a6916,null))[_0xce62('0x1c')](respondWithResult(_0x2a6916,null))[_0xce62('0x35')](handleError(_0x2a6916,null));};exports['create']=function(_0x32b7fa,_0x4fb2b4){return db['Automation'][_0xce62('0x39')](_0x32b7fa[_0xce62('0x3a')],{})[_0xce62('0x1c')](respondWithResult(_0x4fb2b4,0xc9))['catch'](handleError(_0x4fb2b4,null));};exports[_0xce62('0x1b')]=function(_0x20f77a,_0xd9d0a9){if(_0x20f77a[_0xce62('0x3a')]['id']){delete _0x20f77a['body']['id'];}return db[_0xce62('0x21')]['find']({'where':{'id':_0x20f77a[_0xce62('0x3b')]['id']}})['then'](handleEntityNotFound(_0xd9d0a9,null))[_0xce62('0x1c')](saveUpdates(_0x20f77a[_0xce62('0x3a')],null))[_0xce62('0x1c')](respondWithResult(_0xd9d0a9,null))['catch'](handleError(_0xd9d0a9,null));};exports[_0xce62('0x1d')]=function(_0x2ad5ca,_0x44239d){return db[_0xce62('0x21')]['find']({'where':{'id':_0x2ad5ca[_0xce62('0x3b')]['id']}})[_0xce62('0x1c')](handleEntityNotFound(_0x44239d,null))[_0xce62('0x1c')](removeEntity(_0x44239d,null))[_0xce62('0x35')](handleError(_0x44239d,null));};exports['addConditions']=function(_0x4a280f,_0x315ad8,_0x151f45){return db[_0xce62('0x3c')][_0xce62('0x38')]({'where':{'id':_0x4a280f[_0xce62('0x3b')]['id']}})[_0xce62('0x1c')](handleEntityNotFound(_0x315ad8,null))[_0xce62('0x1c')](function(_0x590f04){if(_0x590f04){return _0x590f04[_0xce62('0x3d')](_0x4a280f[_0xce62('0x3a')][_0xce62('0x3e')],_[_0xce62('0x3f')](_0x4a280f[_0xce62('0x3a')],[_0xce62('0x3e'),'id'])||{});}})[_0xce62('0x1c')](respondWithResult(_0x315ad8,null))[_0xce62('0x35')](handleError(_0x315ad8,null));};exports[_0xce62('0x40')]=function(_0x230e8a,_0x1ae580,_0x5027e5){var _0x1cb832={};var _0x2b593c={};var _0x20e0a4;var _0x3b4aea;return db['Automation'][_0xce62('0x41')]({'where':{'id':_0x230e8a[_0xce62('0x3b')]['id']}})[_0xce62('0x1c')](handleEntityNotFound(_0x1ae580,null))[_0xce62('0x1c')](function(_0x568a0d){if(_0x568a0d){_0x20e0a4=_0x568a0d;_0x2b593c['model']=_[_0xce62('0x26')](db[_0xce62('0x3c')][_0xce62('0x22')]);_0x2b593c[_0xce62('0x29')]=_[_0xce62('0x26')](_0x230e8a[_0xce62('0x29')]);_0x2b593c[_0xce62('0x27')]=_[_0xce62('0x28')](_0x2b593c['model'],_0x2b593c[_0xce62('0x29')]);_0x1cb832[_0xce62('0x2c')]=_[_0xce62('0x28')](_0x2b593c[_0xce62('0x25')],qs[_0xce62('0x2a')](_0x230e8a[_0xce62('0x29')][_0xce62('0x2a')]));_0x1cb832[_0xce62('0x2c')]=_0x1cb832['attributes'][_0xce62('0x2b')]?_0x1cb832[_0xce62('0x2c')]:_0x2b593c[_0xce62('0x25')];_0x1cb832[_0xce62('0x42')]=qs[_0xce62('0x2e')](_0x230e8a[_0xce62('0x29')][_0xce62('0x2e')]);_0x1cb832[_0xce62('0x2f')]=qs[_0xce62('0x27')](_['pick'](_0x230e8a['query'],_0x2b593c['filters']));if(_0x230e8a[_0xce62('0x29')][_0xce62('0x31')]){_0x1cb832[_0xce62('0x2f')]=_[_0xce62('0x32')](_0x1cb832['where'],{'$or':_['map'](_0x1cb832[_0xce62('0x2c')],function(_0x17b151){var _0x16f11b={};_0x16f11b[_0x17b151]={'$like':'%'+_0x230e8a[_0xce62('0x29')][_0xce62('0x31')]+'%'};return _0x16f11b;})});}_0x1cb832=_[_0xce62('0x32')]({},_0x1cb832,_0x230e8a[_0xce62('0x33')]);return _0x20e0a4[_0xce62('0x40')](_0x1cb832);}})[_0xce62('0x1c')](function(_0x41994b){if(_0x41994b){_0x3b4aea=_0x41994b[_0xce62('0x2b')];if(!_0x230e8a[_0xce62('0x29')][_0xce62('0x43')](_0xce62('0x2d'))){_0x1cb832[_0xce62('0x17')]=qs[_0xce62('0x17')](_0x230e8a[_0xce62('0x29')][_0xce62('0x17')]);_0x1cb832['offset']=qs[_0xce62('0x16')](_0x230e8a[_0xce62('0x29')][_0xce62('0x16')]);}return _0x20e0a4[_0xce62('0x40')](_0x1cb832);}})['then'](function(_0x4909e8){if(_0x4909e8){return _0x4909e8?{'count':_0x3b4aea,'rows':_0x4909e8}:null;}})[_0xce62('0x1c')](respondWithResult(_0x1ae580,null))[_0xce62('0x35')](handleError(_0x1ae580,null));};exports[_0xce62('0x44')]=function(_0x14f8cc,_0x1b6280,_0x339cab){return db[_0xce62('0x45')][_0xce62('0x38')]({'where':{'id':_0x14f8cc['params']['id']}})['then'](handleEntityNotFound(_0x1b6280,null))[_0xce62('0x1c')](function(_0x8e3547){if(_0x8e3547){return _0x8e3547[_0xce62('0x44')](_0x14f8cc[_0xce62('0x3a')][_0xce62('0x3e')],_[_0xce62('0x3f')](_0x14f8cc[_0xce62('0x3a')],['ids','id'])||{});}})[_0xce62('0x1c')](respondWithResult(_0x1b6280,null))[_0xce62('0x35')](handleError(_0x1b6280,null));};exports[_0xce62('0x46')]=function(_0x3fd24d,_0x4d35c0,_0x20d33a){var _0x19757b={};var _0x50420c={};var _0x253124;var _0x16dbcf;return db[_0xce62('0x21')][_0xce62('0x41')]({'where':{'id':_0x3fd24d[_0xce62('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4d35c0,null))[_0xce62('0x1c')](function(_0x478686){if(_0x478686){_0x253124=_0x478686;_0x50420c[_0xce62('0x25')]=_['keys'](db[_0xce62('0x45')][_0xce62('0x22')]);_0x50420c[_0xce62('0x29')]=_[_0xce62('0x26')](_0x3fd24d[_0xce62('0x29')]);_0x50420c[_0xce62('0x27')]=_[_0xce62('0x28')](_0x50420c[_0xce62('0x25')],_0x50420c[_0xce62('0x29')]);_0x19757b[_0xce62('0x2c')]=_[_0xce62('0x28')](_0x50420c[_0xce62('0x25')],qs[_0xce62('0x2a')](_0x3fd24d[_0xce62('0x29')][_0xce62('0x2a')]));_0x19757b[_0xce62('0x2c')]=_0x19757b[_0xce62('0x2c')][_0xce62('0x2b')]?_0x19757b[_0xce62('0x2c')]:_0x50420c[_0xce62('0x25')];_0x19757b[_0xce62('0x42')]=qs['sort'](_0x3fd24d[_0xce62('0x29')][_0xce62('0x2e')]);_0x19757b[_0xce62('0x2f')]=qs['filters'](_[_0xce62('0x30')](_0x3fd24d[_0xce62('0x29')],_0x50420c[_0xce62('0x27')]));if(_0x3fd24d[_0xce62('0x29')][_0xce62('0x31')]){_0x19757b[_0xce62('0x2f')]=_['merge'](_0x19757b[_0xce62('0x2f')],{'$or':_[_0xce62('0x20')](_0x19757b['attributes'],function(_0x547757){var _0x13e7a6={};_0x13e7a6[_0x547757]={'$like':'%'+_0x3fd24d[_0xce62('0x29')][_0xce62('0x31')]+'%'};return _0x13e7a6;})});}_0x19757b=_['merge']({},_0x19757b,_0x3fd24d[_0xce62('0x33')]);return _0x253124[_0xce62('0x46')](_0x19757b);}})[_0xce62('0x1c')](function(_0xc3da6b){if(_0xc3da6b){_0x16dbcf=_0xc3da6b[_0xce62('0x2b')];if(!_0x3fd24d[_0xce62('0x29')][_0xce62('0x43')](_0xce62('0x2d'))){_0x19757b[_0xce62('0x17')]=qs[_0xce62('0x17')](_0x3fd24d['query'][_0xce62('0x17')]);_0x19757b[_0xce62('0x16')]=qs[_0xce62('0x16')](_0x3fd24d[_0xce62('0x29')][_0xce62('0x16')]);}return _0x253124[_0xce62('0x46')](_0x19757b);}})[_0xce62('0x1c')](function(_0x4b1ece){if(_0x4b1ece){return _0x4b1ece?{'count':_0x16dbcf,'rows':_0x4b1ece}:null;}})[_0xce62('0x1c')](respondWithResult(_0x4d35c0,null))[_0xce62('0x35')](handleError(_0x4d35c0,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index df8b804..9548d52 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 _0xdd34=['api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','define','tools_automations','util'];(function(_0x286634,_0xac4607){var _0x577003=function(_0x23bca7){while(--_0x23bca7){_0x286634['push'](_0x286634['shift']());}};_0x577003(++_0xac4607);}(_0xdd34,0x15f));var _0x4dd3=function(_0x524d5e,_0x269f75){_0x524d5e=_0x524d5e-0x0;var _0x3a1eca=_0xdd34[_0x524d5e];return _0x3a1eca;};'use strict';var _=require('lodash');var util=require(_0x4dd3('0x0'));var logger=require('../../config/logger')(_0x4dd3('0x1'));var moment=require(_0x4dd3('0x2'));var BPromise=require(_0x4dd3('0x3'));var rp=require(_0x4dd3('0x4'));var fs=require('fs');var path=require(_0x4dd3('0x5'));var rimraf=require('rimraf');var config=require(_0x4dd3('0x6'));var attributes=require(_0x4dd3('0x7'));module[_0x4dd3('0x8')]=function(_0x2b4148,_0x74864f){return _0x2b4148[_0x4dd3('0x9')]('Automation',attributes,{'tableName':_0x4dd3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf9c0=['rimraf','../../config/environment','exports','define','tools_automations','util','../../config/logger','moment','request-promise'];(function(_0x173df4,_0x5016fb){var _0x3ac206=function(_0x532cbb){while(--_0x532cbb){_0x173df4['push'](_0x173df4['shift']());}};_0x3ac206(++_0x5016fb);}(_0xf9c0,0x176));var _0x0f9c=function(_0x5c3e51,_0xfeaf8){_0x5c3e51=_0x5c3e51-0x0;var _0xd53ad5=_0xf9c0[_0x5c3e51];return _0xd53ad5;};'use strict';var _=require('lodash');var util=require(_0x0f9c('0x0'));var logger=require(_0x0f9c('0x1'))('api');var moment=require(_0x0f9c('0x2'));var BPromise=require('bluebird');var rp=require(_0x0f9c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f9c('0x4'));var config=require(_0x0f9c('0x5'));var attributes=require('./automation.attributes');module[_0x0f9c('0x6')]=function(_0xb63435,_0x1835f2){return _0xb63435[_0x0f9c('0x7')]('Automation',attributes,{'tableName':_0x0f9c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 849201d..ac8fd62 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 _0x6bab=['../../config/logger','rpc','jayson/promise','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x136a0d,_0x476fe2){_0x136a0d=_0x136a0d-0x0;var _0x212ea5=_0x6bab[_0x136a0d];return _0x212ea5;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var moment=require(_0xb6ba('0x2'));var BPromise=require(_0xb6ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ba('0x4'));var db=require(_0xb6ba('0x5'))['db'];var utils=require(_0xb6ba('0x6'));var logger=require(_0xb6ba('0x7'))(_0xb6ba('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6ba('0x9'));var client=jayson['client'][_0xb6ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x389a0d,_0x3fd283,_0xbce6f){return new BPromise(function(_0xa0b5c7,_0x469e81){return client[_0xb6ba('0xb')](_0x389a0d,_0xbce6f)[_0xb6ba('0xc')](function(_0x36bdc2){logger['info'](_0xb6ba('0xd'),_0x3fd283,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3fd283,_0xb6ba('0xe'),JSON[_0xb6ba('0xf')](_0x36bdc2));if(_0x36bdc2[_0xb6ba('0x10')]){if(_0x36bdc2['error'][_0xb6ba('0x11')]===0x1f4){logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0x469e81(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}logger[_0xb6ba('0x10')](_0xb6ba('0xd'),_0x3fd283,_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);return _0xa0b5c7(_0x36bdc2[_0xb6ba('0x10')][_0xb6ba('0x12')]);}else{logger[_0xb6ba('0x13')](_0xb6ba('0xd'),_0x3fd283,_0xb6ba('0xe'));_0xa0b5c7(_0x36bdc2[_0xb6ba('0x14')][_0xb6ba('0x12')]);}})[_0xb6ba('0x15')](function(_0x5313d4){logger[_0xb6ba('0x10')]('Automation,\x20%s,\x20%s',_0x3fd283,_0x5313d4);_0x469e81(_0x5313d4);});});}
\ No newline at end of file
+var _0xfff0=['../../config/environment','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4c4ce4,_0x50d3d8){var _0x2bdcc8=function(_0x4801d2){while(--_0x4801d2){_0x4c4ce4['push'](_0x4c4ce4['shift']());}};_0x2bdcc8(++_0x50d3d8);}(_0xfff0,0x139));var _0x0fff=function(_0x11be98,_0x2a9bf1){_0x11be98=_0x11be98-0x0;var _0x3359a5=_0xfff0[_0x11be98];return _0x3359a5;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('Automation,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 9305bde..9f248c9 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 _0x6505=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','delete','destroy','exports'];(function(_0x1bafb1,_0x3f4d43){var _0x1e9aa9=function(_0x34c867){while(--_0x34c867){_0x1bafb1['push'](_0x1bafb1['shift']());}};_0x1e9aa9(++_0x3f4d43);}(_0x6505,0x8c));var _0x5650=function(_0x5e16cf,_0x23b912){_0x5e16cf=_0x5e16cf-0x0;var _0x5201e5=_0x6505[_0x5e16cf];return _0x5201e5;};'use strict';var multer=require(_0x5650('0x0'));var util=require(_0x5650('0x1'));var path=require(_0x5650('0x2'));var timeout=require(_0x5650('0x3'));var express=require(_0x5650('0x4'));var router=express[_0x5650('0x5')]();var fs_extra=require(_0x5650('0x6'));var auth=require(_0x5650('0x7'));var interaction=require(_0x5650('0x8'));var config=require(_0x5650('0x9'));var controller=require(_0x5650('0xa'));router['get']('/',auth[_0x5650('0xb')](),controller[_0x5650('0xc')]);router[_0x5650('0xd')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0xf')]);router[_0x5650('0xd')]('/:id/conditions',auth[_0x5650('0xb')](),controller['getConditions']);router[_0x5650('0xd')](_0x5650('0x10'),auth[_0x5650('0xb')](),controller[_0x5650('0x11')]);router[_0x5650('0x12')]('/',auth[_0x5650('0xb')](),controller[_0x5650('0x13')]);router[_0x5650('0x12')](_0x5650('0x14'),auth[_0x5650('0xb')](),controller[_0x5650('0x15')]);router[_0x5650('0x12')](_0x5650('0x10'),auth[_0x5650('0xb')](),controller[_0x5650('0x16')]);router[_0x5650('0x17')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0x18')]);router[_0x5650('0x19')]('/:id',auth[_0x5650('0xb')](),controller[_0x5650('0x1a')]);module[_0x5650('0x1b')]=router;
\ No newline at end of file
+var _0x323f=['get','/:id','show','/:id/conditions','post','create','/:id/actions','addActions','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index'];(function(_0xfefda5,_0x38d020){var _0x2bac82=function(_0xaa512){while(--_0xaa512){_0xfefda5['push'](_0xfefda5['shift']());}};_0x2bac82(++_0x38d020);}(_0x323f,0xde));var _0xf323=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x323f[_0x4154a6];return _0x3b2786;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require('express');var router=express[_0xf323('0x2')]();var fs_extra=require(_0xf323('0x3'));var auth=require(_0xf323('0x4'));var interaction=require(_0xf323('0x5'));var config=require('../../config/environment');var controller=require(_0xf323('0x6'));router['get']('/',auth[_0xf323('0x7')](),controller[_0xf323('0x8')]);router[_0xf323('0x9')](_0xf323('0xa'),auth[_0xf323('0x7')](),controller[_0xf323('0xb')]);router[_0xf323('0x9')](_0xf323('0xc'),auth[_0xf323('0x7')](),controller['getConditions']);router[_0xf323('0x9')]('/:id/actions',auth['isAuthenticated'](),controller['getActions']);router[_0xf323('0xd')]('/',auth[_0xf323('0x7')](),controller[_0xf323('0xe')]);router['post'](_0xf323('0xc'),auth[_0xf323('0x7')](),controller['addConditions']);router[_0xf323('0xd')](_0xf323('0xf'),auth[_0xf323('0x7')](),controller[_0xf323('0x10')]);router[_0xf323('0x11')](_0xf323('0xa'),auth['isAuthenticated'](),controller[_0xf323('0x12')]);router[_0xf323('0x13')](_0xf323('0xa'),auth[_0xf323('0x7')](),controller['destroy']);module[_0xf323('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index e40935c..bd4116a 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 _0x770f=['never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','ivr','BOOLEAN','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always'];(function(_0xdd5244,_0x26242c){var _0x3d086d=function(_0x6a9652){while(--_0x6a9652){_0xdd5244['push'](_0xdd5244['shift']());}};_0x3d086d(++_0x26242c);}(_0x770f,0x7e));var _0xf770=function(_0xba1760,_0x191969){_0xba1760=_0xba1760-0x0;var _0x1f3143=_0x770f[_0xba1760];return _0x1f3143;};'use strict';var Sequelize=require('sequelize');module[_0xf770('0x0')]={'name':{'type':Sequelize[_0xf770('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf770('0x2')),'allowNull':![],'defaultValue':_0xf770('0x2')},'description':{'type':Sequelize[_0xf770('0x1')]},'active':{'type':Sequelize[_0xf770('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0xf770('0x4')](0x4)[_0xf770('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf770('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x6')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf770('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xf770('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf770('0x1')],'defaultValue':_0xf770('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0xf770('0xc')](_0xf770('0xd'),_0xf770('0xe'),_0xf770('0xf')),'defaultValue':_0xf770('0xd')},'dialAMDActive':{'type':Sequelize[_0xf770('0x3')],'defaultValue':0x0,'comment':_0xf770('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf770('0x11')},'dialAMDGreeting':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf770('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf770('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0xf770('0x4')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf770('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf770('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf770('0x4')](0x9)[_0xf770('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf770('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0xf770('0x17')),'defaultValue':_0xf770('0x18')},'dialPrefix':{'type':Sequelize[_0xf770('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xf770('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf770('0x19')},'dialCutDigit':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf770('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x1b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0xf770('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xf770('0x4')](0x3)[_0xf770('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf770('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf770('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf770('0x22')}};
\ No newline at end of file
+var _0x20d3=['DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','name','ENUM','ivr','STRING','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x20d3,0xb9));var _0x320d=function(_0x25b738,_0x5c3de6){_0x25b738=_0x25b738-0x0;var _0x2c1051=_0x20d3[_0x25b738];return _0x2c1051;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x320d('0x0'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x320d('0x1')](_0x320d('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x320d('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x320d('0x4')](0x4)[_0x320d('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x320d('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x320d('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x320d('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x320d('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)[_0x320d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'comment':_0x320d('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x320d('0xc')},'dialCheckDuplicateType':{'type':Sequelize[_0x320d('0x1')](_0x320d('0xd'),_0x320d('0xe'),_0x320d('0xf')),'defaultValue':_0x320d('0xd')},'dialAMDActive':{'type':Sequelize[_0x320d('0x10')],'defaultValue':0x0,'comment':_0x320d('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x320d('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x320d('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x320d('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x320d('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x320d('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x320d('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x320d('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x320d('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x320d('0x4')](0x9)[_0x320d('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x320d('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x320d('0x1')](_0x320d('0x19'),_0x320d('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x320d('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x320d('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x320d('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x320d('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)[_0x320d('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x320d('0x4')](0x3)[_0x320d('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x320d('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x320d('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x320d('0x22')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 2246e0e..9a8c4bf 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 _0x667f=['attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Campaign','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','role','params','getHoppers','findOne','keys','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','ListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','insert','cm_contacts','COALESCE(phone,\x27\x27)','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x3a096c,_0x440950){var _0x25173a=function(_0x341a97){while(--_0x341a97){_0x3a096c['push'](_0x3a096c['shift']());}};_0x25173a(++_0x440950);}(_0x667f,0xd7));var _0xf667=function(_0x2936d8,_0x2e415a){_0x2936d8=_0x2936d8-0x0;var _0x194e7b=_0x667f[_0x2936d8];return _0x194e7b;};'use strict';var emlformat=require(_0xf667('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf667('0x1'));var moment=require(_0xf667('0x2'));var BPromise=require(_0xf667('0x3'));var Mustache=require(_0xf667('0x4'));var util=require(_0xf667('0x5'));var path=require(_0xf667('0x6'));var sox=require('sox');var csv=require(_0xf667('0x7'));var ejs=require(_0xf667('0x8'));var fs=require('fs');var fs_extra=require(_0xf667('0x9'));var _=require(_0xf667('0xa'));var squel=require(_0xf667('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf667('0x7'));var querystring=require(_0xf667('0xc'));var Papa=require('papaparse');var Redis=require(_0xf667('0xd'));var authService=require(_0xf667('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xf667('0xf'));var hardwareService=require(_0xf667('0x10'));var logger=require(_0xf667('0x11'))(_0xf667('0x12'));var utils=require(_0xf667('0x13'));var config=require(_0xf667('0x14'));var licenseUtil=require(_0xf667('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18191c,_0xd26c39){_0xd26c39=_0xd26c39||0xcc;return function(_0x40d3f4){if(_0x40d3f4){return _0x18191c[_0xf667('0x16')](_0xd26c39);}return _0x18191c[_0xf667('0x17')](_0xd26c39)[_0xf667('0x18')]();};}function respondWithResult(_0x42291d,_0xacafb3){_0xacafb3=_0xacafb3||0xc8;return function(_0x4cf66f){if(_0x4cf66f){return _0x42291d[_0xf667('0x17')](_0xacafb3)[_0xf667('0x19')](_0x4cf66f);}};}function respondWithFilteredResult(_0x32d0c7,_0x53d2c8){return function(_0x5c7b45){if(_0x5c7b45){var _0x11ac7f=typeof _0x53d2c8[_0xf667('0x1a')]===_0xf667('0x1b')&&typeof _0x53d2c8['limit']===_0xf667('0x1b');var _0x2dbacb=_0x5c7b45[_0xf667('0x1c')];var _0x2a3ca1=_0x11ac7f?0x0:_0x53d2c8[_0xf667('0x1a')];var _0x43d1d9=_0x11ac7f?_0x5c7b45['count']:_0x53d2c8[_0xf667('0x1a')]+_0x53d2c8[_0xf667('0x1d')];var _0x1023d3;if(_0x43d1d9>=_0x2dbacb){_0x43d1d9=_0x2dbacb;_0x1023d3=0xc8;}else{_0x1023d3=0xce;}_0x32d0c7[_0xf667('0x17')](_0x1023d3);return _0x32d0c7[_0xf667('0x1e')](_0xf667('0x1f'),_0x2a3ca1+'-'+_0x43d1d9+'/'+_0x2dbacb)[_0xf667('0x19')](_0x5c7b45);}return null;};}function patchUpdates(_0x2df328){return function(_0x47b20b){try{jsonpatch[_0xf667('0x20')](_0x47b20b,_0x2df328,!![]);}catch(_0x2518e5){return BPromise[_0xf667('0x21')](_0x2518e5);}return _0x47b20b[_0xf667('0x22')]();};}function saveUpdates(_0x356fda,_0x3526e5){return function(_0x365599){if(_0x365599){return _0x365599['update'](_0x356fda)[_0xf667('0x23')](function(_0x591fba){return _0x591fba;});}return null;};}function removeEntity(_0x88efc1,_0x27b29a){return function(_0x113dbc){if(_0x113dbc){return _0x113dbc[_0xf667('0x24')]()[_0xf667('0x23')](function(){var _0x5771e3=_0x113dbc[_0xf667('0x25')]({'plain':!![]});var _0x1ecb84=_0xf667('0x26');return db[_0xf667('0x27')]['destroy']({'where':{'type':_0x1ecb84,'resourceId':_0x5771e3['id']}})['then'](function(){return _0x113dbc;});})['then'](function(){_0x88efc1[_0xf667('0x17')](0xcc)[_0xf667('0x18')]();});}};}function handleEntityNotFound(_0x38abea,_0xa306e1){return function(_0x155668){if(!_0x155668){_0x38abea[_0xf667('0x16')](0x194);}return _0x155668;};}function handleError(_0x10476a,_0x48fa0a){_0x48fa0a=_0x48fa0a||0x1f4;return function(_0x3ed845){logger[_0xf667('0x28')](_0x3ed845[_0xf667('0x29')]);if(_0x3ed845[_0xf667('0x2a')]){delete _0x3ed845[_0xf667('0x2a')];}_0x10476a['status'](_0x48fa0a)[_0xf667('0x2b')](_0x3ed845);};}exports['index']=function(_0x32a781,_0x38684f){var _0x2dd6a1={},_0x42de82={},_0x546fd5={'count':0x0,'rows':[]};var _0xc89eea=_[_0xf667('0x2c')](db['Campaign'][_0xf667('0x2d')],function(_0x424cff){return{'name':_0x424cff[_0xf667('0x2e')],'type':_0x424cff[_0xf667('0x2f')][_0xf667('0x30')]};});_0x42de82[_0xf667('0x31')]=_[_0xf667('0x2c')](_0xc89eea,_0xf667('0x2a'));_0x42de82[_0xf667('0x32')]=_['keys'](_0x32a781['query']);_0x42de82[_0xf667('0x33')]=_[_0xf667('0x34')](_0x42de82[_0xf667('0x31')],_0x42de82[_0xf667('0x32')]);_0x2dd6a1[_0xf667('0x35')]=_[_0xf667('0x34')](_0x42de82['model'],qs['fields'](_0x32a781[_0xf667('0x32')][_0xf667('0x36')]));_0x2dd6a1[_0xf667('0x35')]=_0x2dd6a1[_0xf667('0x35')][_0xf667('0x37')]?_0x2dd6a1[_0xf667('0x35')]:_0x42de82[_0xf667('0x31')];if(!_0x32a781['query'][_0xf667('0x38')]('nolimit')){_0x2dd6a1[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x32a781[_0xf667('0x32')][_0xf667('0x1d')]);_0x2dd6a1[_0xf667('0x1a')]=qs['offset'](_0x32a781['query'][_0xf667('0x1a')]);}_0x2dd6a1[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x32a781['query'][_0xf667('0x3a')]);_0x2dd6a1[_0xf667('0x3b')]=qs[_0xf667('0x33')](_[_0xf667('0x3c')](_0x32a781['query'],_0x42de82[_0xf667('0x33')]),_0xc89eea);if(_0x32a781[_0xf667('0x32')][_0xf667('0x3d')]){_0x2dd6a1[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x2dd6a1['where'],{'$or':_['map'](_0xc89eea,function(_0x16243d){if(_0x16243d[_0xf667('0x2f')]!==_0xf667('0x3f')){var _0x278704={};_0x278704[_0x16243d[_0xf667('0x2a')]]={'$like':'%'+_0x32a781['query']['filter']+'%'};return _0x278704;}})});}_0x2dd6a1=_[_0xf667('0x3e')]({},_0x2dd6a1,_0x32a781[_0xf667('0x40')]);var _0x4a17d1={'where':_0x2dd6a1[_0xf667('0x3b')]};return db['Campaign'][_0xf667('0x1c')](_0x4a17d1)[_0xf667('0x23')](function(_0x2b0ec9){_0x546fd5['count']=_0x2b0ec9;if(_0x32a781[_0xf667('0x32')][_0xf667('0x41')]){_0x2dd6a1[_0xf667('0x42')]=[{'all':!![]}];}return db['Campaign'][_0xf667('0x43')](_0x2dd6a1);})[_0xf667('0x23')](function(_0x524bc9){_0x546fd5[_0xf667('0x44')]=_0x524bc9;return _0x546fd5;})[_0xf667('0x23')](respondWithFilteredResult(_0x38684f,_0x2dd6a1))['catch'](handleError(_0x38684f,null));};exports[_0xf667('0x45')]=function(_0x5cebe8,_0x103097){var _0x1b0ab7={'raw':![],'where':{'id':_0x5cebe8['params']['id']}},_0x53b86b={};_0x53b86b['model']=_['keys'](db[_0xf667('0x46')][_0xf667('0x2d')]);_0x53b86b[_0xf667('0x32')]=_['keys'](_0x5cebe8[_0xf667('0x32')]);_0x53b86b[_0xf667('0x33')]=_['intersection'](_0x53b86b[_0xf667('0x31')],_0x53b86b['query']);_0x1b0ab7[_0xf667('0x35')]=_[_0xf667('0x34')](_0x53b86b['model'],qs['fields'](_0x5cebe8['query']['fields']));_0x1b0ab7[_0xf667('0x35')]=_0x1b0ab7[_0xf667('0x35')]['length']?_0x1b0ab7['attributes']:_0x53b86b['model'];if(_0x5cebe8[_0xf667('0x32')][_0xf667('0x41')]){_0x1b0ab7[_0xf667('0x42')]=[{'all':!![]}];}_0x1b0ab7=_[_0xf667('0x3e')]({},_0x1b0ab7,_0x5cebe8[_0xf667('0x40')]);return db['Campaign']['find'](_0x1b0ab7)[_0xf667('0x23')](handleEntityNotFound(_0x103097,null))[_0xf667('0x23')](respondWithResult(_0x103097,null))['catch'](handleError(_0x103097,null));};exports['create']=function(_0x2bd50b,_0x38b07b){return db['Campaign']['create'](_0x2bd50b[_0xf667('0x47')],{})[_0xf667('0x23')](function(_0x4c0e35){var _0x51800f=_0x2bd50b[_0xf667('0x48')][_0xf667('0x25')]({'plain':!![]});if(!_0x51800f)throw new Error(_0xf667('0x49'));if(_0x51800f['role']===_0xf667('0x48')){var _0x53a69b=_0x4c0e35['get']({'plain':!![]});var _0x1f6e5e=_0xf667('0x26');return db[_0xf667('0x4a')]['find']({'where':{'name':_0x1f6e5e,'userProfileId':_0x51800f[_0xf667('0x4b')]},'raw':!![]})[_0xf667('0x23')](function(_0x3c2109){if(_0x3c2109&&_0x3c2109[_0xf667('0x4c')]===0x0){return db['UserProfileResource'][_0xf667('0x4d')]({'name':_0x53a69b[_0xf667('0x2a')],'resourceId':_0x53a69b['id'],'type':_0x3c2109[_0xf667('0x2a')],'sectionId':_0x3c2109['id']},{})[_0xf667('0x23')](function(){return _0x4c0e35;});}else{return _0x4c0e35;}})[_0xf667('0x4e')](function(_0x1488f4){logger[_0xf667('0x28')](_0xf667('0x4f'),_0x1488f4);throw _0x1488f4;});}return _0x4c0e35;})[_0xf667('0x23')](respondWithResult(_0x38b07b,0xc9))[_0xf667('0x4e')](handleError(_0x38b07b,null));};exports[_0xf667('0x50')]=function(_0x54c42c,_0x5793d1){var _0x47331e={'where':{'id':_0x54c42c['params']['id']}},_0xf17602={};_0xf17602['model']=_['keys'](db[_0xf667('0x46')][_0xf667('0x2d')]);_0x47331e[_0xf667('0x35')]=_[_0xf667('0x34')](_0xf17602[_0xf667('0x31')],qs[_0xf667('0x36')](_0x54c42c[_0xf667('0x32')][_0xf667('0x36')]));_0x47331e[_0xf667('0x35')]=_0x47331e[_0xf667('0x35')][_0xf667('0x37')]?_0x47331e[_0xf667('0x35')]:_0xf17602[_0xf667('0x31')];if(_0x54c42c[_0xf667('0x32')][_0xf667('0x41')]){_0x47331e[_0xf667('0x42')]=[{'all':!![]}];}_0x47331e=_[_0xf667('0x3e')]({},_0x47331e,_0x54c42c[_0xf667('0x40')]);return db['Campaign'][_0xf667('0x51')](_0x47331e)[_0xf667('0x23')](handleEntityNotFound(_0x5793d1,null))[_0xf667('0x23')](function(_0x2c2019){if(_0x2c2019){var _0x2f5f98=_0x2c2019['get']({'plain':!![]});_0x2f5f98=qs[_0xf667('0x52')](_0x2f5f98,['id',_0xf667('0x53'),_0xf667('0x54')]);_0x54c42c[_0xf667('0x47')]=_[_0xf667('0x52')](_0x54c42c[_0xf667('0x47')],['id',_0xf667('0x53'),_0xf667('0x54')]);return db[_0xf667('0x46')][_0xf667('0x4d')](_[_0xf667('0x3e')](_0x2f5f98,_0x54c42c[_0xf667('0x47')]),{'include':_0x54c42c[_0xf667('0x32')][_0xf667('0x41')]?[{'all':!![]}]:undefined})[_0xf667('0x23')](function(_0xd60942){var _0x492910=_0x54c42c[_0xf667('0x48')]['get']({'plain':!![]});if(!_0x492910)throw new Error(_0xf667('0x49'));if(_0x492910[_0xf667('0x55')]===_0xf667('0x48')){var _0x545eed=_0xd60942[_0xf667('0x25')]({'plain':!![]});var _0xbe9ac5='IvrCampaigns';return db[_0xf667('0x4a')][_0xf667('0x51')]({'where':{'name':_0xbe9ac5,'userProfileId':_0x492910[_0xf667('0x4b')]},'raw':!![]})[_0xf667('0x23')](function(_0x27afc5){if(_0x27afc5&&_0x27afc5[_0xf667('0x4c')]===0x0){return db[_0xf667('0x27')][_0xf667('0x4d')]({'name':_0x545eed[_0xf667('0x2a')],'resourceId':_0x545eed['id'],'type':_0x27afc5[_0xf667('0x2a')],'sectionId':_0x27afc5['id']},{})[_0xf667('0x23')](function(){return _0xd60942;});}else{return _0xd60942;}})[_0xf667('0x4e')](function(_0x27f0e4){logger[_0xf667('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27f0e4);throw _0x27f0e4;});}return _0xd60942;});}})[_0xf667('0x23')](respondWithResult(_0x5793d1,0xc9))[_0xf667('0x4e')](handleError(_0x5793d1,null));};exports['update']=function(_0x356967,_0xc4a95a){if(_0x356967[_0xf667('0x47')]['id']){delete _0x356967[_0xf667('0x47')]['id'];}return db['Campaign'][_0xf667('0x51')]({'where':{'id':_0x356967[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0xc4a95a,null))[_0xf667('0x23')](saveUpdates(_0x356967[_0xf667('0x47')],null))[_0xf667('0x23')](respondWithResult(_0xc4a95a,null))[_0xf667('0x4e')](handleError(_0xc4a95a,null));};exports[_0xf667('0x24')]=function(_0x5ec5bd,_0x4d1c9f){return db[_0xf667('0x46')]['find']({'where':{'id':_0x5ec5bd[_0xf667('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d1c9f,null))[_0xf667('0x23')](removeEntity(_0x4d1c9f,null))[_0xf667('0x4e')](handleError(_0x4d1c9f,null));};exports[_0xf667('0x57')]=function(_0x1292ac,_0x41a531,_0x29e344){var _0x4f696c={'raw':!![],'where':{}};var _0x4ba6ad={};var _0x53d070={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x1292ac[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x41a531,null))[_0xf667('0x23')](function(_0x2a82e0){if(_0x2a82e0){_0x4ba6ad['model']=_[_0xf667('0x59')](db['CmHopper'][_0xf667('0x2d')]);_0x4ba6ad[_0xf667('0x32')]=_[_0xf667('0x59')](_0x1292ac[_0xf667('0x32')]);_0x4ba6ad[_0xf667('0x33')]=_[_0xf667('0x34')](_0x4ba6ad[_0xf667('0x31')],_0x4ba6ad['query']);_0x4f696c['attributes']=_[_0xf667('0x34')](_0x4ba6ad['model'],qs[_0xf667('0x36')](_0x1292ac['query']['fields']));_0x4f696c['attributes']=_0x4f696c['attributes'][_0xf667('0x37')]?_0x4f696c[_0xf667('0x35')]:_0x4ba6ad[_0xf667('0x31')];if(!_0x1292ac['query'][_0xf667('0x38')](_0xf667('0x5a'))){_0x4f696c[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x1292ac[_0xf667('0x32')][_0xf667('0x1d')]);_0x4f696c[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x1292ac[_0xf667('0x32')][_0xf667('0x1a')]);}_0x4f696c[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x1292ac[_0xf667('0x32')][_0xf667('0x3a')]);_0x4f696c[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x1292ac[_0xf667('0x32')],_0x4ba6ad['filters']));_0x4f696c[_0xf667('0x3b')][_0xf667('0x5b')]=_0x2a82e0['id'];if(_0x1292ac[_0xf667('0x32')][_0xf667('0x3d')]){_0x4f696c[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x4f696c['where'],{'$or':_[_0xf667('0x2c')](_0x4f696c['attributes'],function(_0x486a2b){var _0x58c798={};_0x58c798[_0x486a2b]={'$like':'%'+_0x1292ac[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x58c798;})});}_0x4f696c=_[_0xf667('0x3e')]({},_0x4f696c,_0x1292ac[_0xf667('0x40')]);return db[_0xf667('0x5c')][_0xf667('0x1c')]({'where':_0x4f696c['where']})[_0xf667('0x23')](function(_0xeadd64){_0x53d070[_0xf667('0x1c')]=_0xeadd64;if(_0x1292ac[_0xf667('0x32')][_0xf667('0x41')]){_0x4f696c[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5c')][_0xf667('0x43')](_0x4f696c);})[_0xf667('0x23')](function(_0x3741c9){_0x53d070[_0xf667('0x44')]=_0x3741c9;return _0x53d070;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x41a531,_0x4f696c))[_0xf667('0x4e')](handleError(_0x41a531,null));};exports[_0xf667('0x5d')]=function(_0x269bea,_0x263c78,_0x1ca672){var _0x28f356={'raw':!![],'where':{}};var _0x1e44c1={};var _0x25fe40={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x269bea[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x263c78,null))[_0xf667('0x23')](function(_0x3c70f2){if(_0x3c70f2){_0x1e44c1['model']=_[_0xf667('0x59')](db[_0xf667('0x5e')][_0xf667('0x2d')]);_0x1e44c1['query']=_['keys'](_0x269bea[_0xf667('0x32')]);_0x1e44c1[_0xf667('0x33')]=_[_0xf667('0x34')](_0x1e44c1[_0xf667('0x31')],_0x1e44c1['query']);_0x28f356[_0xf667('0x35')]=_[_0xf667('0x34')](_0x1e44c1['model'],qs[_0xf667('0x36')](_0x269bea['query']['fields']));_0x28f356['attributes']=_0x28f356[_0xf667('0x35')][_0xf667('0x37')]?_0x28f356[_0xf667('0x35')]:_0x1e44c1[_0xf667('0x31')];if(!_0x269bea['query'][_0xf667('0x38')](_0xf667('0x5a'))){_0x28f356[_0xf667('0x1d')]=qs['limit'](_0x269bea[_0xf667('0x32')][_0xf667('0x1d')]);_0x28f356[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x269bea['query'][_0xf667('0x1a')]);}_0x28f356[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x269bea['query'][_0xf667('0x3a')]);_0x28f356['where']=qs[_0xf667('0x33')](_['pick'](_0x269bea[_0xf667('0x32')],_0x1e44c1[_0xf667('0x33')]));_0x28f356[_0xf667('0x3b')][_0xf667('0x5b')]=_0x3c70f2['id'];if(_0x269bea[_0xf667('0x32')][_0xf667('0x3d')]){_0x28f356[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x28f356[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x28f356[_0xf667('0x35')],function(_0x47e677){var _0x2ba145={};_0x2ba145[_0x47e677]={'$like':'%'+_0x269bea[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x2ba145;})});}_0x28f356=_[_0xf667('0x3e')]({},_0x28f356,_0x269bea[_0xf667('0x40')]);return db[_0xf667('0x5e')][_0xf667('0x1c')]({'where':_0x28f356['where']})[_0xf667('0x23')](function(_0x5175dd){_0x25fe40[_0xf667('0x1c')]=_0x5175dd;if(_0x269bea['query'][_0xf667('0x41')]){_0x28f356[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5e')][_0xf667('0x43')](_0x28f356);})[_0xf667('0x23')](function(_0x54cb54){_0x25fe40[_0xf667('0x44')]=_0x54cb54;return _0x25fe40;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x263c78,_0x28f356))['catch'](handleError(_0x263c78,null));};exports['getHopperFinals']=function(_0x49f523,_0x461c01,_0x503745){var _0x5c6d8e={'raw':!![],'where':{}};var _0xe16cc={};var _0x327947={'count':0x0,'rows':[]};return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x49f523[_0xf667('0x56')]['id']}})['then'](handleEntityNotFound(_0x461c01,null))['then'](function(_0x3ba57c){if(_0x3ba57c){_0xe16cc[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x5f')][_0xf667('0x2d')]);_0xe16cc[_0xf667('0x32')]=_['keys'](_0x49f523[_0xf667('0x32')]);_0xe16cc[_0xf667('0x33')]=_[_0xf667('0x34')](_0xe16cc[_0xf667('0x31')],_0xe16cc[_0xf667('0x32')]);_0x5c6d8e[_0xf667('0x35')]=_[_0xf667('0x34')](_0xe16cc[_0xf667('0x31')],qs[_0xf667('0x36')](_0x49f523[_0xf667('0x32')]['fields']));_0x5c6d8e[_0xf667('0x35')]=_0x5c6d8e['attributes']['length']?_0x5c6d8e[_0xf667('0x35')]:_0xe16cc['model'];if(!_0x49f523[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x5c6d8e[_0xf667('0x1d')]=qs['limit'](_0x49f523[_0xf667('0x32')][_0xf667('0x1d')]);_0x5c6d8e[_0xf667('0x1a')]=qs['offset'](_0x49f523[_0xf667('0x32')]['offset']);}_0x5c6d8e[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x49f523[_0xf667('0x32')][_0xf667('0x3a')]);_0x5c6d8e[_0xf667('0x3b')]=qs[_0xf667('0x33')](_['pick'](_0x49f523['query'],_0xe16cc[_0xf667('0x33')]));_0x5c6d8e[_0xf667('0x3b')][_0xf667('0x5b')]=_0x3ba57c['id'];if(_0x49f523[_0xf667('0x32')][_0xf667('0x3d')]){_0x5c6d8e[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x5c6d8e[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x5c6d8e['attributes'],function(_0x522627){var _0x54b807={};_0x54b807[_0x522627]={'$like':'%'+_0x49f523[_0xf667('0x32')][_0xf667('0x3d')]+'%'};return _0x54b807;})});}_0x5c6d8e=_[_0xf667('0x3e')]({},_0x5c6d8e,_0x49f523[_0xf667('0x40')]);return db[_0xf667('0x5f')][_0xf667('0x1c')]({'where':_0x5c6d8e[_0xf667('0x3b')]})['then'](function(_0x5c8995){_0x327947['count']=_0x5c8995;if(_0x49f523[_0xf667('0x32')][_0xf667('0x41')]){_0x5c6d8e[_0xf667('0x42')]=[{'all':!![]}];}return db[_0xf667('0x5f')][_0xf667('0x43')](_0x5c6d8e);})[_0xf667('0x23')](function(_0xcd18c5){_0x327947[_0xf667('0x44')]=_0xcd18c5;return _0x327947;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x461c01,_0x5c6d8e))[_0xf667('0x4e')](handleError(_0x461c01,null));};exports['getHopperBlacks']=function(_0x2071c8,_0x56a540,_0x5bb40b){var _0x118db7={'raw':!![],'where':{}};var _0x2a57b2={};var _0x100365={'count':0x0,'rows':[]};return db['Campaign'][_0xf667('0x58')]({'where':{'id':_0x2071c8[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x56a540,null))[_0xf667('0x23')](function(_0x5211dc){if(_0x5211dc){_0x2a57b2[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x60')][_0xf667('0x2d')]);_0x2a57b2[_0xf667('0x32')]=_['keys'](_0x2071c8[_0xf667('0x32')]);_0x2a57b2['filters']=_[_0xf667('0x34')](_0x2a57b2[_0xf667('0x31')],_0x2a57b2[_0xf667('0x32')]);_0x118db7[_0xf667('0x35')]=_['intersection'](_0x2a57b2['model'],qs[_0xf667('0x36')](_0x2071c8[_0xf667('0x32')][_0xf667('0x36')]));_0x118db7[_0xf667('0x35')]=_0x118db7[_0xf667('0x35')][_0xf667('0x37')]?_0x118db7[_0xf667('0x35')]:_0x2a57b2[_0xf667('0x31')];if(!_0x2071c8[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x118db7['limit']=qs['limit'](_0x2071c8['query'][_0xf667('0x1d')]);_0x118db7[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x2071c8[_0xf667('0x32')][_0xf667('0x1a')]);}_0x118db7[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x2071c8[_0xf667('0x32')][_0xf667('0x3a')]);_0x118db7[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x2071c8['query'],_0x2a57b2[_0xf667('0x33')]));_0x118db7[_0xf667('0x3b')][_0xf667('0x5b')]=_0x5211dc['id'];if(_0x2071c8[_0xf667('0x32')][_0xf667('0x3d')]){_0x118db7['where']=_[_0xf667('0x3e')](_0x118db7['where'],{'$or':_[_0xf667('0x2c')](_0x118db7[_0xf667('0x35')],function(_0x586c58){var _0x542bf2={};_0x542bf2[_0x586c58]={'$like':'%'+_0x2071c8[_0xf667('0x32')]['filter']+'%'};return _0x542bf2;})});}_0x118db7=_[_0xf667('0x3e')]({},_0x118db7,_0x2071c8[_0xf667('0x40')]);return db[_0xf667('0x60')]['count']({'where':_0x118db7[_0xf667('0x3b')]})[_0xf667('0x23')](function(_0x18d7d3){_0x100365[_0xf667('0x1c')]=_0x18d7d3;if(_0x2071c8[_0xf667('0x32')]['includeAll']){_0x118db7['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x118db7);})[_0xf667('0x23')](function(_0x4c7c59){_0x100365[_0xf667('0x44')]=_0x4c7c59;return _0x100365;});}})[_0xf667('0x23')](respondWithFilteredResult(_0x56a540,_0x118db7))[_0xf667('0x4e')](handleError(_0x56a540,null));};exports[_0xf667('0x61')]=function(_0x68faf,_0x17b77d,_0x590071){var _0x101816={};var _0x3c9d22={};var _0x495d98;var _0x1ecc9e;return db['Campaign']['findOne']({'where':{'id':_0x68faf[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x17b77d,null))[_0xf667('0x23')](function(_0x31a4b1){if(_0x31a4b1){_0x495d98=_0x31a4b1;_0x3c9d22[_0xf667('0x31')]=_['keys'](db[_0xf667('0x62')][_0xf667('0x2d')]);_0x3c9d22['query']=_[_0xf667('0x59')](_0x68faf[_0xf667('0x32')]);_0x3c9d22[_0xf667('0x33')]=_[_0xf667('0x34')](_0x3c9d22['model'],_0x3c9d22[_0xf667('0x32')]);_0x101816[_0xf667('0x35')]=_[_0xf667('0x34')](_0x3c9d22['model'],qs[_0xf667('0x36')](_0x68faf[_0xf667('0x32')][_0xf667('0x36')]));_0x101816[_0xf667('0x35')]=_0x101816[_0xf667('0x35')]['length']?_0x101816[_0xf667('0x35')]:_0x3c9d22[_0xf667('0x31')];_0x101816['order']=qs[_0xf667('0x3a')](_0x68faf[_0xf667('0x32')]['sort']);_0x101816[_0xf667('0x3b')]=qs['filters'](_[_0xf667('0x3c')](_0x68faf['query'],_0x3c9d22['filters']));if(_0x68faf['query'][_0xf667('0x3d')]){_0x101816[_0xf667('0x3b')]=_['merge'](_0x101816[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x101816[_0xf667('0x35')],function(_0x28ec85){var _0x47e073={};_0x47e073[_0x28ec85]={'$like':'%'+_0x68faf[_0xf667('0x32')]['filter']+'%'};return _0x47e073;})});}_0x101816=_[_0xf667('0x3e')]({},_0x101816,_0x68faf['options']);return _0x495d98['getLists'](_0x101816);}})[_0xf667('0x23')](function(_0x199873){if(_0x199873){_0x1ecc9e=_0x199873[_0xf667('0x37')];if(!_0x68faf[_0xf667('0x32')]['hasOwnProperty']('nolimit')){_0x101816[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x68faf[_0xf667('0x32')][_0xf667('0x1d')]);_0x101816[_0xf667('0x1a')]=qs[_0xf667('0x1a')](_0x68faf['query']['offset']);}return _0x495d98['getLists'](_0x101816);}})[_0xf667('0x23')](function(_0x4c1ea4){if(_0x4c1ea4){return _0x4c1ea4?{'count':_0x1ecc9e,'rows':_0x4c1ea4}:null;}})[_0xf667('0x23')](respondWithResult(_0x17b77d,null))['catch'](handleError(_0x17b77d,null));};exports['addLists']=function(_0x442b9c,_0xdce0c1,_0xb64b2f){var _0x3708f1,_0xba81b5;return db[_0xf667('0x46')]['find']({'where':{'id':_0x442b9c['params']['id']}})[_0xf667('0x23')](handleEntityNotFound(_0xdce0c1,null))[_0xf667('0x23')](function(_0x53077e){if(_0x53077e){_0xba81b5=_0x53077e;return _0x53077e[_0xf667('0x63')](_0x442b9c['body'][_0xf667('0x64')],_[_0xf667('0x52')](_0x442b9c['body'],['ids','id'])||{});}return null;})[_0xf667('0x65')](function(_0x11058d){var _0x456a1d;_0x3708f1=_0x11058d||[];var _0x2ad40b=[];if(_0x11058d){for(var _0x44753b=0x0;_0x44753b<_0x11058d['length'];_0x44753b+=0x1){var _0x524b9c=_0x11058d[_0x44753b]['get']({'plain':!![]});_0xba81b5[_0xf667('0x66')]=_0x442b9c[_0xf667('0x47')][_0xf667('0x66')]?_0x442b9c[_0xf667('0x47')][_0xf667('0x66')]:_0xba81b5[_0xf667('0x66')];switch(_0xba81b5['dialCheckDuplicateType']){case _0xf667('0x67'):_0x456a1d=squel['insert']()[_0xf667('0x68')]('cm_hopper')[_0xf667('0x69')]([_0xf667('0x6a'),'scheduledAt',_0xf667('0x6b'),'ListId','CampaignId','createdAt',_0xf667('0x54')],squel[_0xf667('0x6c')]()['field']('phone','phone')[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))[_0xf667('0x6d')]('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')][_0xf667('0x71')](),_0xf667('0x72'))[_0xf667('0x6d')](_0x442b9c[_0xf667('0x56')]['id']['toString'](),_0xf667('0x5b'))[_0xf667('0x6d')]('NOW()',_0xf667('0x53'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x54'))[_0xf667('0x73')]('cm_contacts')[_0xf667('0x3b')](_0xf667('0x74'))[_0xf667('0x3b')](_0xf667('0x75'),_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())[_0xf667('0x3b')](_0xf667('0x76'))[_0xf667('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0xf667('0x73')](_0xf667('0x77'))[_0xf667('0x3b')](_0xf667('0x78'),_0x442b9c['params']['id'][_0xf667('0x71')]()))[_0xf667('0x3b')](_0xf667('0x79'),squel[_0xf667('0x6c')]()[_0xf667('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0xf667('0x7a'))[_0xf667('0x3b')](_0xf667('0x78'),_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')]())))[_0xf667('0x71')]();break;case'onlyIfOpen':_0x456a1d=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x7a'))[_0xf667('0x69')]([_0xf667('0x6a'),_0xf667('0x6f'),_0xf667('0x6b'),_0xf667('0x72'),'CampaignId',_0xf667('0x53'),_0xf667('0x54')],squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x6a'),_0xf667('0x6a'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))['field']('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')]['toString'](),_0xf667('0x72'))['field'](_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')](),'CampaignId')[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x53'))['field'](_0xf667('0x6e'),'updatedAt')[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')](_0xf667('0x74'))['where']('ListId\x20=\x20?',_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())['where'](_0xf667('0x76'))[_0xf667('0x3b')](_0xf667('0x79'),squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x7d'))[_0xf667('0x73')](_0xf667('0x7a'))['where'](_0xf667('0x78'),_0x442b9c[_0xf667('0x56')]['id'][_0xf667('0x71')]())))['toString']();break;default:_0x456a1d=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x7a'))[_0xf667('0x69')](['phone',_0xf667('0x6f'),_0xf667('0x6b'),_0xf667('0x72'),_0xf667('0x5b'),_0xf667('0x53'),_0xf667('0x54')],squel[_0xf667('0x6c')]()[_0xf667('0x6d')](_0xf667('0x6a'),_0xf667('0x6a'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x6f'))[_0xf667('0x6d')]('id',_0xf667('0x6b'))[_0xf667('0x6d')](_0x524b9c[_0xf667('0x70')][_0xf667('0x71')](),'ListId')[_0xf667('0x6d')](_0x442b9c[_0xf667('0x56')]['id']['toString'](),_0xf667('0x5b'))[_0xf667('0x6d')](_0xf667('0x6e'),_0xf667('0x53'))[_0xf667('0x6d')](_0xf667('0x6e'),'updatedAt')[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')](_0xf667('0x74'))['where'](_0xf667('0x75'),_0x524b9c[_0xf667('0x70')][_0xf667('0x71')]())[_0xf667('0x3b')](_0xf667('0x76')))[_0xf667('0x71')]();}_0x2ad40b[_0xf667('0x7e')](db[_0xf667('0x7f')][_0xf667('0x32')](_0x456a1d));}return BPromise[_0xf667('0x80')](_0x2ad40b);}})[_0xf667('0x23')](function(){return _0x3708f1;})[_0xf667('0x23')](respondWithResult(_0xdce0c1,null))[_0xf667('0x4e')](handleError(_0xdce0c1,null));};exports[_0xf667('0x81')]=function(_0x5e518c,_0x1a2112,_0x2365ab){return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0x5e518c[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x1a2112,null))[_0xf667('0x23')](function(_0xfc3906){if(_0xfc3906){return _0xfc3906[_0xf667('0x81')](_0x5e518c[_0xf667('0x32')][_0xf667('0x64')]);}})[_0xf667('0x23')](function(_0x95d991){if(_0x95d991){return db[_0xf667('0x5c')][_0xf667('0x24')]({'where':{'ListId':_0x5e518c['query'][_0xf667('0x64')],'CampaignId':_0x5e518c[_0xf667('0x56')]['id']}})['then'](function(){return _0x95d991;});}})[_0xf667('0x23')](respondWithStatusCode(_0x1a2112,null))['catch'](handleError(_0x1a2112,null));};exports[_0xf667('0x82')]=function(_0x436cbd,_0x24a455,_0x5589f4){var _0x118ae9={};var _0x89e182={};var _0x4648df;var _0x1f7ec9;return db[_0xf667('0x46')][_0xf667('0x58')]({'where':{'id':_0x436cbd[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x24a455,null))[_0xf667('0x23')](function(_0x2d4358){if(_0x2d4358){_0x4648df=_0x2d4358;_0x89e182[_0xf667('0x31')]=_[_0xf667('0x59')](db[_0xf667('0x62')][_0xf667('0x2d')]);_0x89e182[_0xf667('0x32')]=_[_0xf667('0x59')](_0x436cbd[_0xf667('0x32')]);_0x89e182['filters']=_[_0xf667('0x34')](_0x89e182[_0xf667('0x31')],_0x89e182[_0xf667('0x32')]);_0x118ae9[_0xf667('0x35')]=_['intersection'](_0x89e182[_0xf667('0x31')],qs['fields'](_0x436cbd[_0xf667('0x32')]['fields']));_0x118ae9[_0xf667('0x35')]=_0x118ae9['attributes'][_0xf667('0x37')]?_0x118ae9['attributes']:_0x89e182[_0xf667('0x31')];_0x118ae9[_0xf667('0x39')]=qs[_0xf667('0x3a')](_0x436cbd['query'][_0xf667('0x3a')]);_0x118ae9['where']=qs[_0xf667('0x33')](_[_0xf667('0x3c')](_0x436cbd[_0xf667('0x32')],_0x89e182[_0xf667('0x33')]));if(_0x436cbd[_0xf667('0x32')][_0xf667('0x3d')]){_0x118ae9[_0xf667('0x3b')]=_[_0xf667('0x3e')](_0x118ae9[_0xf667('0x3b')],{'$or':_[_0xf667('0x2c')](_0x118ae9['attributes'],function(_0x55dec4){var _0x1625fc={};_0x1625fc[_0x55dec4]={'$like':'%'+_0x436cbd[_0xf667('0x32')]['filter']+'%'};return _0x1625fc;})});}_0x118ae9=_[_0xf667('0x3e')]({},_0x118ae9,_0x436cbd[_0xf667('0x40')]);return _0x4648df[_0xf667('0x82')](_0x118ae9);}})[_0xf667('0x23')](function(_0x43c99b){if(_0x43c99b){_0x1f7ec9=_0x43c99b[_0xf667('0x37')];if(!_0x436cbd[_0xf667('0x32')][_0xf667('0x38')](_0xf667('0x5a'))){_0x118ae9[_0xf667('0x1d')]=qs[_0xf667('0x1d')](_0x436cbd[_0xf667('0x32')][_0xf667('0x1d')]);_0x118ae9['offset']=qs['offset'](_0x436cbd[_0xf667('0x32')]['offset']);}return _0x4648df['getBlackLists'](_0x118ae9);}})[_0xf667('0x23')](function(_0x434844){if(_0x434844){return _0x434844?{'count':_0x1f7ec9,'rows':_0x434844}:null;}})[_0xf667('0x23')](respondWithResult(_0x24a455,null))[_0xf667('0x4e')](handleError(_0x24a455,null));};exports[_0xf667('0x83')]=function(_0xd209de,_0x10ecec,_0x89a5fd){var _0x4cf10e,_0x31550e;return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0xd209de['params']['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x10ecec,null))[_0xf667('0x23')](function(_0x4b06f0){if(_0x4b06f0){_0x31550e=_0x4b06f0;return _0x4b06f0[_0xf667('0x83')](_0xd209de['body']['ids'],_[_0xf667('0x52')](_0xd209de[_0xf667('0x47')],[_0xf667('0x64'),'id'])||{});}return null;})['spread'](function(_0x15b5c0){var _0x44c602;_0x4cf10e=_0x15b5c0||[];var _0x5bb609=[];if(_0x15b5c0){for(var _0x3c8ec0=0x0;_0x3c8ec0<_0x15b5c0[_0xf667('0x37')];_0x3c8ec0+=0x1){var _0x3cdbb0=_0x15b5c0[_0x3c8ec0][_0xf667('0x25')]({'plain':!![]});_0x44c602=squel[_0xf667('0x7b')]()[_0xf667('0x68')](_0xf667('0x84'))[_0xf667('0x69')]([_0xf667('0x6a'),_0xf667('0x6b'),_0xf667('0x72'),_0xf667('0x5b'),_0xf667('0x53'),_0xf667('0x54')],squel['select']()['field'](_0xf667('0x6a'),'phone')[_0xf667('0x6d')]('id','ContactId')['field'](_0x3cdbb0[_0xf667('0x70')][_0xf667('0x71')](),_0xf667('0x72'))[_0xf667('0x6d')](_0xd209de[_0xf667('0x56')]['id'][_0xf667('0x71')](),_0xf667('0x5b'))[_0xf667('0x6d')](_0xf667('0x6e'),'createdAt')[_0xf667('0x6d')]('NOW()',_0xf667('0x54'))[_0xf667('0x73')](_0xf667('0x7c'))[_0xf667('0x3b')]('deletedAt\x20IS\x20NULL')[_0xf667('0x3b')](_0xf667('0x75'),_0x3cdbb0[_0xf667('0x70')][_0xf667('0x71')]())['where'](_0xf667('0x76')))['toString']();_0x5bb609[_0xf667('0x7e')](db[_0xf667('0x7f')][_0xf667('0x32')](_0x44c602));}return BPromise[_0xf667('0x80')](_0x5bb609);}})['then'](function(){return _0x4cf10e;})[_0xf667('0x23')](respondWithResult(_0x10ecec,null))['catch'](handleError(_0x10ecec,null));};exports[_0xf667('0x85')]=function(_0x36d850,_0x42b038,_0x12a6ec){return db[_0xf667('0x46')][_0xf667('0x51')]({'where':{'id':_0x36d850[_0xf667('0x56')]['id']}})[_0xf667('0x23')](handleEntityNotFound(_0x42b038,null))[_0xf667('0x23')](function(_0x47a4de){if(_0x47a4de){return _0x47a4de[_0xf667('0x85')](_0x36d850[_0xf667('0x32')][_0xf667('0x64')]);}})[_0xf667('0x23')](function(_0x5c5434){if(_0x5c5434){return db[_0xf667('0x60')][_0xf667('0x24')]({'where':{'ListId':_0x36d850['query'][_0xf667('0x64')],'CampaignId':_0x36d850[_0xf667('0x56')]['id']}})[_0xf667('0x23')](function(){return _0x5c5434;});}})[_0xf667('0x23')](respondWithStatusCode(_0x42b038,null))['catch'](handleError(_0x42b038,null));};
\ No newline at end of file
+var _0x4e62=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','clone','length','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','into','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','sequelize','removeLists','getBlackLists','addBlackLists','all','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','catch','show','params','find','create','body','user'];(function(_0x475a91,_0x299ed2){var _0x3eea6e=function(_0x490b66){while(--_0x490b66){_0x475a91['push'](_0x475a91['shift']());}};_0x3eea6e(++_0x299ed2);}(_0x4e62,0x1d1));var _0x24e6=function(_0xadadf3,_0x24e12d){_0xadadf3=_0xadadf3-0x0;var _0x58b72e=_0x4e62[_0xadadf3];return _0x58b72e;};'use strict';var emlformat=require(_0x24e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x24e6('0x1'));var jsonpatch=require(_0x24e6('0x2'));var rp=require(_0x24e6('0x3'));var moment=require(_0x24e6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x24e6('0x5'));var util=require('util');var path=require(_0x24e6('0x6'));var sox=require(_0x24e6('0x7'));var csv=require(_0x24e6('0x8'));var ejs=require(_0x24e6('0x9'));var fs=require('fs');var fs_extra=require(_0x24e6('0xa'));var _=require(_0x24e6('0xb'));var squel=require(_0x24e6('0xc'));var crypto=require(_0x24e6('0xd'));var jsforce=require(_0x24e6('0xe'));var deskjs=require(_0x24e6('0xf'));var toCsv=require(_0x24e6('0x8'));var querystring=require('querystring');var Papa=require(_0x24e6('0x10'));var Redis=require(_0x24e6('0x11'));var authService=require(_0x24e6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x24e6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24e6('0x14'))(_0x24e6('0x15'));var utils=require('../../config/utils');var config=require(_0x24e6('0x16'));var licenseUtil=require(_0x24e6('0x17'));var db=require(_0x24e6('0x18'))['db'];function respondWithStatusCode(_0x310951,_0x22656a){_0x22656a=_0x22656a||0xcc;return function(_0x2aa8bc){if(_0x2aa8bc){return _0x310951['sendStatus'](_0x22656a);}return _0x310951[_0x24e6('0x19')](_0x22656a)['end']();};}function respondWithResult(_0x86132c,_0x399a1d){_0x399a1d=_0x399a1d||0xc8;return function(_0x5f40e6){if(_0x5f40e6){return _0x86132c[_0x24e6('0x19')](_0x399a1d)[_0x24e6('0x1a')](_0x5f40e6);}};}function respondWithFilteredResult(_0xfb9817,_0x2efa21){return function(_0xad2759){if(_0xad2759){var _0x4d6812=typeof _0x2efa21[_0x24e6('0x1b')]===_0x24e6('0x1c')&&typeof _0x2efa21[_0x24e6('0x1d')]===_0x24e6('0x1c');var _0x3fd860=_0xad2759[_0x24e6('0x1e')];var _0x4d0c16=_0x4d6812?0x0:_0x2efa21[_0x24e6('0x1b')];var _0x417f19=_0x4d6812?_0xad2759['count']:_0x2efa21['offset']+_0x2efa21[_0x24e6('0x1d')];var _0x16696c;if(_0x417f19>=_0x3fd860){_0x417f19=_0x3fd860;_0x16696c=0xc8;}else{_0x16696c=0xce;}_0xfb9817['status'](_0x16696c);return _0xfb9817[_0x24e6('0x1f')](_0x24e6('0x20'),_0x4d0c16+'-'+_0x417f19+'/'+_0x3fd860)[_0x24e6('0x1a')](_0xad2759);}return null;};}function patchUpdates(_0x3db125){return function(_0x357392){try{jsonpatch[_0x24e6('0x21')](_0x357392,_0x3db125,!![]);}catch(_0x3dd7ba){return BPromise[_0x24e6('0x22')](_0x3dd7ba);}return _0x357392[_0x24e6('0x23')]();};}function saveUpdates(_0x1c84f9,_0x148475){return function(_0x318684){if(_0x318684){return _0x318684['update'](_0x1c84f9)[_0x24e6('0x24')](function(_0x277566){return _0x277566;});}return null;};}function removeEntity(_0x4953ed,_0x1ddfc3){return function(_0x2ade79){if(_0x2ade79){return _0x2ade79[_0x24e6('0x25')]()[_0x24e6('0x24')](function(){var _0x31241f=_0x2ade79[_0x24e6('0x26')]({'plain':!![]});var _0x270755=_0x24e6('0x27');return db[_0x24e6('0x28')][_0x24e6('0x25')]({'where':{'type':_0x270755,'resourceId':_0x31241f['id']}})[_0x24e6('0x24')](function(){return _0x2ade79;});})[_0x24e6('0x24')](function(){_0x4953ed[_0x24e6('0x19')](0xcc)[_0x24e6('0x29')]();});}};}function handleEntityNotFound(_0x3c2c05,_0x4a6aef){return function(_0x6bcfd9){if(!_0x6bcfd9){_0x3c2c05[_0x24e6('0x2a')](0x194);}return _0x6bcfd9;};}function handleError(_0x35c2b6,_0xa15ed9){_0xa15ed9=_0xa15ed9||0x1f4;return function(_0x3ffebb){logger[_0x24e6('0x2b')](_0x3ffebb[_0x24e6('0x2c')]);if(_0x3ffebb[_0x24e6('0x2d')]){delete _0x3ffebb[_0x24e6('0x2d')];}_0x35c2b6['status'](_0xa15ed9)['send'](_0x3ffebb);};}exports[_0x24e6('0x2e')]=function(_0x2fd4e0,_0x59c830){var _0x15107e={},_0x1155bb={},_0x523298={'count':0x0,'rows':[]};var _0x469f47=_[_0x24e6('0x2f')](db['Campaign'][_0x24e6('0x30')],function(_0x209682){return{'name':_0x209682['fieldName'],'type':_0x209682['type'][_0x24e6('0x31')]};});_0x1155bb[_0x24e6('0x32')]=_['map'](_0x469f47,_0x24e6('0x2d'));_0x1155bb[_0x24e6('0x33')]=_[_0x24e6('0x34')](_0x2fd4e0[_0x24e6('0x33')]);_0x1155bb[_0x24e6('0x35')]=_[_0x24e6('0x36')](_0x1155bb['model'],_0x1155bb[_0x24e6('0x33')]);_0x15107e[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x1155bb[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x2fd4e0[_0x24e6('0x33')]['fields']));_0x15107e[_0x24e6('0x37')]=_0x15107e[_0x24e6('0x37')]['length']?_0x15107e[_0x24e6('0x37')]:_0x1155bb[_0x24e6('0x32')];if(!_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x39')](_0x24e6('0x3a'))){_0x15107e['limit']=qs[_0x24e6('0x1d')](_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x1d')]);_0x15107e[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x1b')]);}_0x15107e[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x15107e['where']=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x2fd4e0[_0x24e6('0x33')],_0x1155bb[_0x24e6('0x35')]),_0x469f47);if(_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x15107e[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0x15107e[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x469f47,function(_0x2c5734){if(_0x2c5734['type']!==_0x24e6('0x41')){var _0x449614={};_0x449614[_0x2c5734['name']]={'$like':'%'+_0x2fd4e0['query'][_0x24e6('0x3e')]+'%'};return _0x449614;}})});}_0x15107e=_[_0x24e6('0x40')]({},_0x15107e,_0x2fd4e0[_0x24e6('0x42')]);var _0x278fe5={'where':_0x15107e[_0x24e6('0x3f')]};return db[_0x24e6('0x43')][_0x24e6('0x1e')](_0x278fe5)[_0x24e6('0x24')](function(_0x4e2ce0){_0x523298['count']=_0x4e2ce0;if(_0x2fd4e0[_0x24e6('0x33')][_0x24e6('0x44')]){_0x15107e[_0x24e6('0x45')]=[{'all':!![]}];}return db[_0x24e6('0x43')][_0x24e6('0x46')](_0x15107e);})[_0x24e6('0x24')](function(_0x338c7a){_0x523298[_0x24e6('0x47')]=_0x338c7a;return _0x523298;})[_0x24e6('0x24')](respondWithFilteredResult(_0x59c830,_0x15107e))[_0x24e6('0x48')](handleError(_0x59c830,null));};exports[_0x24e6('0x49')]=function(_0xad3cef,_0x22550e){var _0x239c02={'raw':![],'where':{'id':_0xad3cef[_0x24e6('0x4a')]['id']}},_0x175dd9={};_0x175dd9['model']=_[_0x24e6('0x34')](db[_0x24e6('0x43')][_0x24e6('0x30')]);_0x175dd9['query']=_['keys'](_0xad3cef[_0x24e6('0x33')]);_0x175dd9[_0x24e6('0x35')]=_['intersection'](_0x175dd9[_0x24e6('0x32')],_0x175dd9[_0x24e6('0x33')]);_0x239c02[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x175dd9[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0xad3cef[_0x24e6('0x33')]['fields']));_0x239c02[_0x24e6('0x37')]=_0x239c02['attributes']['length']?_0x239c02['attributes']:_0x175dd9[_0x24e6('0x32')];if(_0xad3cef[_0x24e6('0x33')][_0x24e6('0x44')]){_0x239c02[_0x24e6('0x45')]=[{'all':!![]}];}_0x239c02=_[_0x24e6('0x40')]({},_0x239c02,_0xad3cef['options']);return db[_0x24e6('0x43')][_0x24e6('0x4b')](_0x239c02)['then'](handleEntityNotFound(_0x22550e,null))[_0x24e6('0x24')](respondWithResult(_0x22550e,null))[_0x24e6('0x48')](handleError(_0x22550e,null));};exports[_0x24e6('0x4c')]=function(_0x4ef050,_0x57aaf0){return db[_0x24e6('0x43')][_0x24e6('0x4c')](_0x4ef050[_0x24e6('0x4d')],{})[_0x24e6('0x24')](function(_0x4a481d){var _0x1ae248=_0x4ef050[_0x24e6('0x4e')][_0x24e6('0x26')]({'plain':!![]});if(!_0x1ae248)throw new Error(_0x24e6('0x4f'));if(_0x1ae248['role']===_0x24e6('0x4e')){var _0x467076=_0x4a481d[_0x24e6('0x26')]({'plain':!![]});var _0x401f88='IvrCampaigns';return db[_0x24e6('0x50')][_0x24e6('0x4b')]({'where':{'name':_0x401f88,'userProfileId':_0x1ae248['userProfileId']},'raw':!![]})['then'](function(_0x19ed45){if(_0x19ed45&&_0x19ed45['autoAssociation']===0x0){return db[_0x24e6('0x28')][_0x24e6('0x4c')]({'name':_0x467076[_0x24e6('0x2d')],'resourceId':_0x467076['id'],'type':_0x19ed45[_0x24e6('0x2d')],'sectionId':_0x19ed45['id']},{})[_0x24e6('0x24')](function(){return _0x4a481d;});}else{return _0x4a481d;}})['catch'](function(_0x507c29){logger[_0x24e6('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x507c29);throw _0x507c29;});}return _0x4a481d;})[_0x24e6('0x24')](respondWithResult(_0x57aaf0,0xc9))[_0x24e6('0x48')](handleError(_0x57aaf0,null));};exports[_0x24e6('0x51')]=function(_0x215640,_0x368bc3){var _0x567abf={'where':{'id':_0x215640[_0x24e6('0x4a')]['id']}},_0x292934={};_0x292934['model']=_[_0x24e6('0x34')](db[_0x24e6('0x43')][_0x24e6('0x30')]);_0x567abf['attributes']=_[_0x24e6('0x36')](_0x292934[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x215640[_0x24e6('0x33')][_0x24e6('0x38')]));_0x567abf[_0x24e6('0x37')]=_0x567abf[_0x24e6('0x37')][_0x24e6('0x52')]?_0x567abf['attributes']:_0x292934[_0x24e6('0x32')];if(_0x215640[_0x24e6('0x33')][_0x24e6('0x44')]){_0x567abf[_0x24e6('0x45')]=[{'all':!![]}];}_0x567abf=_['merge']({},_0x567abf,_0x215640['options']);return db[_0x24e6('0x43')]['find'](_0x567abf)[_0x24e6('0x24')](handleEntityNotFound(_0x368bc3,null))['then'](function(_0x406bcd){if(_0x406bcd){var _0x42701a=_0x406bcd[_0x24e6('0x26')]({'plain':!![]});_0x42701a=qs[_0x24e6('0x53')](_0x42701a,['id','createdAt','updatedAt']);_0x215640[_0x24e6('0x4d')]=_[_0x24e6('0x53')](_0x215640[_0x24e6('0x4d')],['id',_0x24e6('0x54'),_0x24e6('0x55')]);return db[_0x24e6('0x43')]['create'](_[_0x24e6('0x40')](_0x42701a,_0x215640[_0x24e6('0x4d')]),{'include':_0x215640[_0x24e6('0x33')][_0x24e6('0x44')]?[{'all':!![]}]:undefined})[_0x24e6('0x24')](function(_0x51c3b9){var _0x59706b=_0x215640['user']['get']({'plain':!![]});if(!_0x59706b)throw new Error(_0x24e6('0x4f'));if(_0x59706b['role']===_0x24e6('0x4e')){var _0x325f89=_0x51c3b9[_0x24e6('0x26')]({'plain':!![]});var _0x4330dc=_0x24e6('0x27');return db[_0x24e6('0x50')][_0x24e6('0x4b')]({'where':{'name':_0x4330dc,'userProfileId':_0x59706b[_0x24e6('0x56')]},'raw':!![]})[_0x24e6('0x24')](function(_0x1760b6){if(_0x1760b6&&_0x1760b6[_0x24e6('0x57')]===0x0){return db[_0x24e6('0x28')][_0x24e6('0x4c')]({'name':_0x325f89[_0x24e6('0x2d')],'resourceId':_0x325f89['id'],'type':_0x1760b6['name'],'sectionId':_0x1760b6['id']},{})['then'](function(){return _0x51c3b9;});}else{return _0x51c3b9;}})[_0x24e6('0x48')](function(_0x157f42){logger[_0x24e6('0x2b')](_0x24e6('0x58'),_0x157f42);throw _0x157f42;});}return _0x51c3b9;});}})[_0x24e6('0x24')](respondWithResult(_0x368bc3,0xc9))[_0x24e6('0x48')](handleError(_0x368bc3,null));};exports[_0x24e6('0x59')]=function(_0x41debd,_0x4303d4){if(_0x41debd[_0x24e6('0x4d')]['id']){delete _0x41debd[_0x24e6('0x4d')]['id'];}return db[_0x24e6('0x43')]['find']({'where':{'id':_0x41debd[_0x24e6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4303d4,null))[_0x24e6('0x24')](saveUpdates(_0x41debd['body'],null))[_0x24e6('0x24')](respondWithResult(_0x4303d4,null))[_0x24e6('0x48')](handleError(_0x4303d4,null));};exports[_0x24e6('0x25')]=function(_0x31d4db,_0x4c489e){return db[_0x24e6('0x43')][_0x24e6('0x4b')]({'where':{'id':_0x31d4db[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x4c489e,null))['then'](removeEntity(_0x4c489e,null))[_0x24e6('0x48')](handleError(_0x4c489e,null));};exports[_0x24e6('0x5a')]=function(_0x17626d,_0x6e59f2,_0x29fbfd){var _0xe12cdc={'raw':!![],'where':{}};var _0x47bf99={};var _0x2ec732={'count':0x0,'rows':[]};return db[_0x24e6('0x43')]['findOne']({'where':{'id':_0x17626d[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x6e59f2,null))[_0x24e6('0x24')](function(_0x3fbf9e){if(_0x3fbf9e){_0x47bf99['model']=_[_0x24e6('0x34')](db[_0x24e6('0x5b')][_0x24e6('0x30')]);_0x47bf99['query']=_['keys'](_0x17626d[_0x24e6('0x33')]);_0x47bf99[_0x24e6('0x35')]=_['intersection'](_0x47bf99[_0x24e6('0x32')],_0x47bf99['query']);_0xe12cdc[_0x24e6('0x37')]=_['intersection'](_0x47bf99[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x17626d[_0x24e6('0x33')]['fields']));_0xe12cdc[_0x24e6('0x37')]=_0xe12cdc[_0x24e6('0x37')][_0x24e6('0x52')]?_0xe12cdc[_0x24e6('0x37')]:_0x47bf99[_0x24e6('0x32')];if(!_0x17626d[_0x24e6('0x33')][_0x24e6('0x39')](_0x24e6('0x3a'))){_0xe12cdc[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x17626d[_0x24e6('0x33')][_0x24e6('0x1d')]);_0xe12cdc[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x17626d[_0x24e6('0x33')][_0x24e6('0x1b')]);}_0xe12cdc['order']=qs[_0x24e6('0x3c')](_0x17626d[_0x24e6('0x33')][_0x24e6('0x3c')]);_0xe12cdc[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x17626d['query'],_0x47bf99[_0x24e6('0x35')]));_0xe12cdc['where'][_0x24e6('0x5c')]=_0x3fbf9e['id'];if(_0x17626d[_0x24e6('0x33')][_0x24e6('0x3e')]){_0xe12cdc[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0xe12cdc['where'],{'$or':_[_0x24e6('0x2f')](_0xe12cdc[_0x24e6('0x37')],function(_0x1590cc){var _0x5841f1={};_0x5841f1[_0x1590cc]={'$like':'%'+_0x17626d[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x5841f1;})});}_0xe12cdc=_[_0x24e6('0x40')]({},_0xe12cdc,_0x17626d[_0x24e6('0x42')]);return db[_0x24e6('0x5b')][_0x24e6('0x1e')]({'where':_0xe12cdc[_0x24e6('0x3f')]})[_0x24e6('0x24')](function(_0x2a1b5c){_0x2ec732[_0x24e6('0x1e')]=_0x2a1b5c;if(_0x17626d[_0x24e6('0x33')][_0x24e6('0x44')]){_0xe12cdc[_0x24e6('0x45')]=[{'all':!![]}];}return db[_0x24e6('0x5b')]['findAll'](_0xe12cdc);})[_0x24e6('0x24')](function(_0x38eda0){_0x2ec732['rows']=_0x38eda0;return _0x2ec732;});}})[_0x24e6('0x24')](respondWithFilteredResult(_0x6e59f2,_0xe12cdc))['catch'](handleError(_0x6e59f2,null));};exports[_0x24e6('0x5d')]=function(_0x16c5b2,_0x20cd56,_0x13a616){var _0x624440={'raw':!![],'where':{}};var _0x3bb31e={};var _0xc63b61={'count':0x0,'rows':[]};return db[_0x24e6('0x43')][_0x24e6('0x5e')]({'where':{'id':_0x16c5b2[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x20cd56,null))[_0x24e6('0x24')](function(_0x49e6fa){if(_0x49e6fa){_0x3bb31e['model']=_['keys'](db['CmHopperHistory'][_0x24e6('0x30')]);_0x3bb31e[_0x24e6('0x33')]=_[_0x24e6('0x34')](_0x16c5b2[_0x24e6('0x33')]);_0x3bb31e[_0x24e6('0x35')]=_[_0x24e6('0x36')](_0x3bb31e['model'],_0x3bb31e[_0x24e6('0x33')]);_0x624440[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x3bb31e['model'],qs[_0x24e6('0x38')](_0x16c5b2[_0x24e6('0x33')]['fields']));_0x624440['attributes']=_0x624440[_0x24e6('0x37')]['length']?_0x624440[_0x24e6('0x37')]:_0x3bb31e[_0x24e6('0x32')];if(!_0x16c5b2[_0x24e6('0x33')]['hasOwnProperty'](_0x24e6('0x3a'))){_0x624440[_0x24e6('0x1d')]=qs['limit'](_0x16c5b2[_0x24e6('0x33')][_0x24e6('0x1d')]);_0x624440[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x16c5b2['query'][_0x24e6('0x1b')]);}_0x624440[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x16c5b2[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x624440[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_['pick'](_0x16c5b2[_0x24e6('0x33')],_0x3bb31e[_0x24e6('0x35')]));_0x624440[_0x24e6('0x3f')][_0x24e6('0x5c')]=_0x49e6fa['id'];if(_0x16c5b2[_0x24e6('0x33')]['filter']){_0x624440['where']=_[_0x24e6('0x40')](_0x624440[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x624440[_0x24e6('0x37')],function(_0x59e87f){var _0x2f3c0a={};_0x2f3c0a[_0x59e87f]={'$like':'%'+_0x16c5b2[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x2f3c0a;})});}_0x624440=_[_0x24e6('0x40')]({},_0x624440,_0x16c5b2['options']);return db[_0x24e6('0x5f')][_0x24e6('0x1e')]({'where':_0x624440[_0x24e6('0x3f')]})[_0x24e6('0x24')](function(_0x12c299){_0xc63b61[_0x24e6('0x1e')]=_0x12c299;if(_0x16c5b2['query'][_0x24e6('0x44')]){_0x624440['include']=[{'all':!![]}];}return db[_0x24e6('0x5f')][_0x24e6('0x46')](_0x624440);})[_0x24e6('0x24')](function(_0x4fc862){_0xc63b61[_0x24e6('0x47')]=_0x4fc862;return _0xc63b61;});}})[_0x24e6('0x24')](respondWithFilteredResult(_0x20cd56,_0x624440))['catch'](handleError(_0x20cd56,null));};exports[_0x24e6('0x60')]=function(_0x29d0bf,_0x337187,_0x13e93b){var _0x5a3277={'raw':!![],'where':{}};var _0x5aeaae={};var _0x3da5db={'count':0x0,'rows':[]};return db['Campaign'][_0x24e6('0x5e')]({'where':{'id':_0x29d0bf[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x337187,null))[_0x24e6('0x24')](function(_0x1f9b88){if(_0x1f9b88){_0x5aeaae[_0x24e6('0x32')]=_[_0x24e6('0x34')](db[_0x24e6('0x61')][_0x24e6('0x30')]);_0x5aeaae['query']=_[_0x24e6('0x34')](_0x29d0bf['query']);_0x5aeaae[_0x24e6('0x35')]=_['intersection'](_0x5aeaae[_0x24e6('0x32')],_0x5aeaae[_0x24e6('0x33')]);_0x5a3277[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x5aeaae[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x38')]));_0x5a3277[_0x24e6('0x37')]=_0x5a3277[_0x24e6('0x37')][_0x24e6('0x52')]?_0x5a3277[_0x24e6('0x37')]:_0x5aeaae[_0x24e6('0x32')];if(!_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x39')]('nolimit')){_0x5a3277[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x29d0bf['query'][_0x24e6('0x1d')]);_0x5a3277[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x1b')]);}_0x5a3277[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x5a3277[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x29d0bf[_0x24e6('0x33')],_0x5aeaae[_0x24e6('0x35')]));_0x5a3277[_0x24e6('0x3f')][_0x24e6('0x5c')]=_0x1f9b88['id'];if(_0x29d0bf[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x5a3277[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0x5a3277[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x5a3277[_0x24e6('0x37')],function(_0x507686){var _0x6f6d92={};_0x6f6d92[_0x507686]={'$like':'%'+_0x29d0bf['query'][_0x24e6('0x3e')]+'%'};return _0x6f6d92;})});}_0x5a3277=_['merge']({},_0x5a3277,_0x29d0bf[_0x24e6('0x42')]);return db[_0x24e6('0x61')][_0x24e6('0x1e')]({'where':_0x5a3277[_0x24e6('0x3f')]})['then'](function(_0x3b4bb5){_0x3da5db['count']=_0x3b4bb5;if(_0x29d0bf[_0x24e6('0x33')]['includeAll']){_0x5a3277['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x24e6('0x46')](_0x5a3277);})[_0x24e6('0x24')](function(_0xc90e30){_0x3da5db[_0x24e6('0x47')]=_0xc90e30;return _0x3da5db;});}})['then'](respondWithFilteredResult(_0x337187,_0x5a3277))[_0x24e6('0x48')](handleError(_0x337187,null));};exports[_0x24e6('0x62')]=function(_0x5df3d3,_0x3784da,_0x3bea97){var _0x1c9005={'raw':!![],'where':{}};var _0x5d906b={};var _0x4b70b6={'count':0x0,'rows':[]};return db[_0x24e6('0x43')][_0x24e6('0x5e')]({'where':{'id':_0x5df3d3[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x3784da,null))[_0x24e6('0x24')](function(_0x42908e){if(_0x42908e){_0x5d906b['model']=_[_0x24e6('0x34')](db[_0x24e6('0x63')][_0x24e6('0x30')]);_0x5d906b[_0x24e6('0x33')]=_[_0x24e6('0x34')](_0x5df3d3[_0x24e6('0x33')]);_0x5d906b[_0x24e6('0x35')]=_[_0x24e6('0x36')](_0x5d906b[_0x24e6('0x32')],_0x5d906b[_0x24e6('0x33')]);_0x1c9005[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x5d906b[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x38')]));_0x1c9005['attributes']=_0x1c9005[_0x24e6('0x37')][_0x24e6('0x52')]?_0x1c9005[_0x24e6('0x37')]:_0x5d906b[_0x24e6('0x32')];if(!_0x5df3d3['query'][_0x24e6('0x39')](_0x24e6('0x3a'))){_0x1c9005[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x1d')]);_0x1c9005[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x1b')]);}_0x1c9005['order']=qs[_0x24e6('0x3c')](_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x1c9005[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x5df3d3[_0x24e6('0x33')],_0x5d906b['filters']));_0x1c9005['where'][_0x24e6('0x5c')]=_0x42908e['id'];if(_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x1c9005[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0x1c9005[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x1c9005['attributes'],function(_0xd3dc7b){var _0x44f429={};_0x44f429[_0xd3dc7b]={'$like':'%'+_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x44f429;})});}_0x1c9005=_[_0x24e6('0x40')]({},_0x1c9005,_0x5df3d3[_0x24e6('0x42')]);return db['CmHopperBlack']['count']({'where':_0x1c9005['where']})[_0x24e6('0x24')](function(_0x3c996c){_0x4b70b6[_0x24e6('0x1e')]=_0x3c996c;if(_0x5df3d3[_0x24e6('0x33')][_0x24e6('0x44')]){_0x1c9005[_0x24e6('0x45')]=[{'all':!![]}];}return db[_0x24e6('0x63')][_0x24e6('0x46')](_0x1c9005);})[_0x24e6('0x24')](function(_0x38cdc7){_0x4b70b6[_0x24e6('0x47')]=_0x38cdc7;return _0x4b70b6;});}})['then'](respondWithFilteredResult(_0x3784da,_0x1c9005))[_0x24e6('0x48')](handleError(_0x3784da,null));};exports[_0x24e6('0x64')]=function(_0x37c07f,_0x4f3008,_0x2b0f99){var _0x39c3d6={};var _0x3d271={};var _0x413aac;var _0x48fa61;return db[_0x24e6('0x43')][_0x24e6('0x5e')]({'where':{'id':_0x37c07f[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x4f3008,null))[_0x24e6('0x24')](function(_0x2bc73d){if(_0x2bc73d){_0x413aac=_0x2bc73d;_0x3d271[_0x24e6('0x32')]=_[_0x24e6('0x34')](db[_0x24e6('0x65')][_0x24e6('0x30')]);_0x3d271[_0x24e6('0x33')]=_[_0x24e6('0x34')](_0x37c07f[_0x24e6('0x33')]);_0x3d271['filters']=_[_0x24e6('0x36')](_0x3d271[_0x24e6('0x32')],_0x3d271['query']);_0x39c3d6['attributes']=_['intersection'](_0x3d271['model'],qs[_0x24e6('0x38')](_0x37c07f['query'][_0x24e6('0x38')]));_0x39c3d6['attributes']=_0x39c3d6[_0x24e6('0x37')][_0x24e6('0x52')]?_0x39c3d6[_0x24e6('0x37')]:_0x3d271[_0x24e6('0x32')];_0x39c3d6[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x37c07f[_0x24e6('0x33')][_0x24e6('0x3c')]);_0x39c3d6['where']=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x37c07f[_0x24e6('0x33')],_0x3d271['filters']));if(_0x37c07f[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x39c3d6['where']=_[_0x24e6('0x40')](_0x39c3d6[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x39c3d6[_0x24e6('0x37')],function(_0x58968e){var _0x2ca9fa={};_0x2ca9fa[_0x58968e]={'$like':'%'+_0x37c07f[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x2ca9fa;})});}_0x39c3d6=_[_0x24e6('0x40')]({},_0x39c3d6,_0x37c07f['options']);return _0x413aac['getLists'](_0x39c3d6);}})[_0x24e6('0x24')](function(_0x383683){if(_0x383683){_0x48fa61=_0x383683[_0x24e6('0x52')];if(!_0x37c07f[_0x24e6('0x33')][_0x24e6('0x39')]('nolimit')){_0x39c3d6[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x37c07f['query'][_0x24e6('0x1d')]);_0x39c3d6[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x37c07f[_0x24e6('0x33')][_0x24e6('0x1b')]);}return _0x413aac[_0x24e6('0x64')](_0x39c3d6);}})[_0x24e6('0x24')](function(_0x421811){if(_0x421811){return _0x421811?{'count':_0x48fa61,'rows':_0x421811}:null;}})[_0x24e6('0x24')](respondWithResult(_0x4f3008,null))['catch'](handleError(_0x4f3008,null));};exports[_0x24e6('0x66')]=function(_0x395d7c,_0xbd271,_0x4a99e7){var _0x555d48,_0x21d57e;return db[_0x24e6('0x43')]['find']({'where':{'id':_0x395d7c[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0xbd271,null))['then'](function(_0x210136){if(_0x210136){_0x21d57e=_0x210136;return _0x210136['addLists'](_0x395d7c[_0x24e6('0x4d')][_0x24e6('0x67')],_['omit'](_0x395d7c['body'],[_0x24e6('0x67'),'id'])||{});}return null;})[_0x24e6('0x68')](function(_0x5edc3c){var _0xfaf720;_0x555d48=_0x5edc3c||[];var _0x400056=[];if(_0x5edc3c){for(var _0x2c0768=0x0;_0x2c0768<_0x5edc3c[_0x24e6('0x52')];_0x2c0768+=0x1){var _0x965f9b=_0x5edc3c[_0x2c0768][_0x24e6('0x26')]({'plain':!![]});_0x21d57e[_0x24e6('0x69')]=_0x395d7c[_0x24e6('0x4d')]['dialCheckDuplicateType']?_0x395d7c[_0x24e6('0x4d')]['dialCheckDuplicateType']:_0x21d57e[_0x24e6('0x69')];switch(_0x21d57e[_0x24e6('0x69')]){case _0x24e6('0x6a'):_0xfaf720=squel['insert']()['into'](_0x24e6('0x6b'))[_0x24e6('0x6c')]([_0x24e6('0x6d'),'scheduledAt',_0x24e6('0x6e'),_0x24e6('0x6f'),_0x24e6('0x5c'),_0x24e6('0x54'),_0x24e6('0x55')],squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x6d'),_0x24e6('0x6d'))['field'](_0x24e6('0x72'),_0x24e6('0x73'))[_0x24e6('0x71')]('id',_0x24e6('0x6e'))[_0x24e6('0x71')](_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')](),_0x24e6('0x6f'))[_0x24e6('0x71')](_0x395d7c['params']['id'][_0x24e6('0x75')](),_0x24e6('0x5c'))[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x54'))[_0x24e6('0x71')](_0x24e6('0x72'),'updatedAt')[_0x24e6('0x76')](_0x24e6('0x77'))[_0x24e6('0x3f')](_0x24e6('0x78'))[_0x24e6('0x3f')]('ListId\x20=\x20?',_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')]())[_0x24e6('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x24e6('0x79'),squel['select']()['field'](_0x24e6('0x7a'))['from']('cm_hopper_final')[_0x24e6('0x3f')](_0x24e6('0x7b'),_0x395d7c[_0x24e6('0x4a')]['id'][_0x24e6('0x75')]()))[_0x24e6('0x3f')](_0x24e6('0x79'),squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x7c'))[_0x24e6('0x76')](_0x24e6('0x6b'))[_0x24e6('0x3f')](_0x24e6('0x7b'),_0x395d7c['params']['id']['toString']())))[_0x24e6('0x75')]();break;case'onlyIfOpen':_0xfaf720=squel[_0x24e6('0x7d')]()[_0x24e6('0x7e')](_0x24e6('0x6b'))[_0x24e6('0x6c')]([_0x24e6('0x6d'),_0x24e6('0x73'),'ContactId','ListId',_0x24e6('0x5c'),_0x24e6('0x54'),_0x24e6('0x55')],squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x6d'),_0x24e6('0x6d'))['field'](_0x24e6('0x72'),'scheduledAt')[_0x24e6('0x71')]('id',_0x24e6('0x6e'))[_0x24e6('0x71')](_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')](),_0x24e6('0x6f'))['field'](_0x395d7c[_0x24e6('0x4a')]['id'][_0x24e6('0x75')](),'CampaignId')[_0x24e6('0x71')]('NOW()',_0x24e6('0x54'))[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x55'))[_0x24e6('0x76')](_0x24e6('0x77'))[_0x24e6('0x3f')]('deletedAt\x20IS\x20NULL')[_0x24e6('0x3f')](_0x24e6('0x7f'),_0x965f9b['CmListId'][_0x24e6('0x75')]())[_0x24e6('0x3f')](_0x24e6('0x80'))['where'](_0x24e6('0x79'),squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x7c'))[_0x24e6('0x76')](_0x24e6('0x6b'))[_0x24e6('0x3f')](_0x24e6('0x7b'),_0x395d7c[_0x24e6('0x4a')]['id']['toString']())))[_0x24e6('0x75')]();break;default:_0xfaf720=squel[_0x24e6('0x7d')]()[_0x24e6('0x7e')](_0x24e6('0x6b'))[_0x24e6('0x6c')]([_0x24e6('0x6d'),_0x24e6('0x73'),'ContactId',_0x24e6('0x6f'),_0x24e6('0x5c'),_0x24e6('0x54'),_0x24e6('0x55')],squel[_0x24e6('0x70')]()[_0x24e6('0x71')](_0x24e6('0x6d'),_0x24e6('0x6d'))[_0x24e6('0x71')]('NOW()','scheduledAt')[_0x24e6('0x71')]('id',_0x24e6('0x6e'))[_0x24e6('0x71')](_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')](),_0x24e6('0x6f'))['field'](_0x395d7c[_0x24e6('0x4a')]['id'][_0x24e6('0x75')](),'CampaignId')[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x54'))[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x55'))[_0x24e6('0x76')](_0x24e6('0x77'))['where'](_0x24e6('0x78'))[_0x24e6('0x3f')]('ListId\x20=\x20?',_0x965f9b[_0x24e6('0x74')][_0x24e6('0x75')]())[_0x24e6('0x3f')](_0x24e6('0x80')))['toString']();}_0x400056[_0x24e6('0x81')](db[_0x24e6('0x82')]['query'](_0xfaf720));}return BPromise['all'](_0x400056);}})[_0x24e6('0x24')](function(){return _0x555d48;})[_0x24e6('0x24')](respondWithResult(_0xbd271,null))[_0x24e6('0x48')](handleError(_0xbd271,null));};exports['removeLists']=function(_0x3ed2f3,_0x30b8c6,_0x288b7c){return db[_0x24e6('0x43')][_0x24e6('0x4b')]({'where':{'id':_0x3ed2f3[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x30b8c6,null))[_0x24e6('0x24')](function(_0x46fe82){if(_0x46fe82){return _0x46fe82[_0x24e6('0x83')](_0x3ed2f3[_0x24e6('0x33')]['ids']);}})[_0x24e6('0x24')](function(_0x1697ab){if(_0x1697ab){return db[_0x24e6('0x5b')]['destroy']({'where':{'ListId':_0x3ed2f3[_0x24e6('0x33')][_0x24e6('0x67')],'CampaignId':_0x3ed2f3[_0x24e6('0x4a')]['id']}})['then'](function(){return _0x1697ab;});}})[_0x24e6('0x24')](respondWithStatusCode(_0x30b8c6,null))['catch'](handleError(_0x30b8c6,null));};exports['getBlackLists']=function(_0x5d4361,_0xd0a4e8,_0x39128c){var _0x26726={};var _0x10cb22={};var _0x53adac;var _0x589add;return db[_0x24e6('0x43')][_0x24e6('0x5e')]({'where':{'id':_0x5d4361['params']['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0xd0a4e8,null))[_0x24e6('0x24')](function(_0x4c05fa){if(_0x4c05fa){_0x53adac=_0x4c05fa;_0x10cb22[_0x24e6('0x32')]=_[_0x24e6('0x34')](db[_0x24e6('0x65')][_0x24e6('0x30')]);_0x10cb22['query']=_[_0x24e6('0x34')](_0x5d4361[_0x24e6('0x33')]);_0x10cb22[_0x24e6('0x35')]=_['intersection'](_0x10cb22[_0x24e6('0x32')],_0x10cb22[_0x24e6('0x33')]);_0x26726[_0x24e6('0x37')]=_[_0x24e6('0x36')](_0x10cb22[_0x24e6('0x32')],qs[_0x24e6('0x38')](_0x5d4361[_0x24e6('0x33')]['fields']));_0x26726[_0x24e6('0x37')]=_0x26726[_0x24e6('0x37')][_0x24e6('0x52')]?_0x26726['attributes']:_0x10cb22[_0x24e6('0x32')];_0x26726[_0x24e6('0x3b')]=qs[_0x24e6('0x3c')](_0x5d4361[_0x24e6('0x33')]['sort']);_0x26726[_0x24e6('0x3f')]=qs[_0x24e6('0x35')](_[_0x24e6('0x3d')](_0x5d4361[_0x24e6('0x33')],_0x10cb22[_0x24e6('0x35')]));if(_0x5d4361[_0x24e6('0x33')][_0x24e6('0x3e')]){_0x26726[_0x24e6('0x3f')]=_[_0x24e6('0x40')](_0x26726[_0x24e6('0x3f')],{'$or':_[_0x24e6('0x2f')](_0x26726[_0x24e6('0x37')],function(_0x5e2dbb){var _0x223073={};_0x223073[_0x5e2dbb]={'$like':'%'+_0x5d4361[_0x24e6('0x33')][_0x24e6('0x3e')]+'%'};return _0x223073;})});}_0x26726=_[_0x24e6('0x40')]({},_0x26726,_0x5d4361[_0x24e6('0x42')]);return _0x53adac[_0x24e6('0x84')](_0x26726);}})[_0x24e6('0x24')](function(_0x2b494c){if(_0x2b494c){_0x589add=_0x2b494c[_0x24e6('0x52')];if(!_0x5d4361['query']['hasOwnProperty'](_0x24e6('0x3a'))){_0x26726[_0x24e6('0x1d')]=qs[_0x24e6('0x1d')](_0x5d4361[_0x24e6('0x33')][_0x24e6('0x1d')]);_0x26726[_0x24e6('0x1b')]=qs[_0x24e6('0x1b')](_0x5d4361[_0x24e6('0x33')][_0x24e6('0x1b')]);}return _0x53adac[_0x24e6('0x84')](_0x26726);}})[_0x24e6('0x24')](function(_0xb0b334){if(_0xb0b334){return _0xb0b334?{'count':_0x589add,'rows':_0xb0b334}:null;}})[_0x24e6('0x24')](respondWithResult(_0xd0a4e8,null))[_0x24e6('0x48')](handleError(_0xd0a4e8,null));};exports['addBlackLists']=function(_0x590aec,_0x18c51f,_0x218b38){var _0x192993,_0x2316b5;return db[_0x24e6('0x43')][_0x24e6('0x4b')]({'where':{'id':_0x590aec[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x18c51f,null))['then'](function(_0x242da4){if(_0x242da4){_0x2316b5=_0x242da4;return _0x242da4[_0x24e6('0x85')](_0x590aec[_0x24e6('0x4d')][_0x24e6('0x67')],_[_0x24e6('0x53')](_0x590aec['body'],[_0x24e6('0x67'),'id'])||{});}return null;})['spread'](function(_0xc3413e){var _0x1dc9fa;_0x192993=_0xc3413e||[];var _0x57d513=[];if(_0xc3413e){for(var _0x103ddd=0x0;_0x103ddd<_0xc3413e[_0x24e6('0x52')];_0x103ddd+=0x1){var _0x4aac8f=_0xc3413e[_0x103ddd][_0x24e6('0x26')]({'plain':!![]});_0x1dc9fa=squel[_0x24e6('0x7d')]()[_0x24e6('0x7e')]('cm_hopper_black')[_0x24e6('0x6c')]([_0x24e6('0x6d'),_0x24e6('0x6e'),'ListId','CampaignId','createdAt',_0x24e6('0x55')],squel['select']()[_0x24e6('0x71')]('phone',_0x24e6('0x6d'))[_0x24e6('0x71')]('id','ContactId')[_0x24e6('0x71')](_0x4aac8f[_0x24e6('0x74')][_0x24e6('0x75')](),_0x24e6('0x6f'))[_0x24e6('0x71')](_0x590aec[_0x24e6('0x4a')]['id'][_0x24e6('0x75')](),'CampaignId')[_0x24e6('0x71')](_0x24e6('0x72'),'createdAt')[_0x24e6('0x71')](_0x24e6('0x72'),_0x24e6('0x55'))[_0x24e6('0x76')](_0x24e6('0x77'))[_0x24e6('0x3f')](_0x24e6('0x78'))['where'](_0x24e6('0x7f'),_0x4aac8f['CmListId'][_0x24e6('0x75')]())[_0x24e6('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0x24e6('0x75')]();_0x57d513[_0x24e6('0x81')](db[_0x24e6('0x82')][_0x24e6('0x33')](_0x1dc9fa));}return BPromise[_0x24e6('0x86')](_0x57d513);}})['then'](function(){return _0x192993;})[_0x24e6('0x24')](respondWithResult(_0x18c51f,null))[_0x24e6('0x48')](handleError(_0x18c51f,null));};exports[_0x24e6('0x87')]=function(_0x584c97,_0x5cf782,_0x4b4193){return db[_0x24e6('0x43')]['find']({'where':{'id':_0x584c97[_0x24e6('0x4a')]['id']}})[_0x24e6('0x24')](handleEntityNotFound(_0x5cf782,null))['then'](function(_0x2482ec){if(_0x2482ec){return _0x2482ec[_0x24e6('0x87')](_0x584c97['query'][_0x24e6('0x67')]);}})[_0x24e6('0x24')](function(_0xa92694){if(_0xa92694){return db[_0x24e6('0x63')]['destroy']({'where':{'ListId':_0x584c97[_0x24e6('0x33')][_0x24e6('0x67')],'CampaignId':_0x584c97['params']['id']}})[_0x24e6('0x24')](function(){return _0xa92694;});}})[_0x24e6('0x24')](respondWithStatusCode(_0x5cf782,null))['catch'](handleError(_0x5cf782,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 151f989..ee07702 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1e0bd3,_0x8ba362){var _0x2d3f81=function(_0x2580cc){while(--_0x2580cc){_0x1e0bd3['push'](_0x1e0bd3['shift']());}};_0x2d3f81(++_0x8ba362);}(_0x7a54,0x106));var _0x47a5=function(_0x3bc90f,_0xbcaf71){_0x3bc90f=_0x3bc90f-0x0;var _0x17b522=_0x7a54[_0x3bc90f];return _0x17b522;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4147b1,_0x34bf45){var _0x5b1d00=function(_0x287950){while(--_0x287950){_0x4147b1['push'](_0x4147b1['shift']());}};_0x5b1d00(++_0x34bf45);}(_0x7a54,0x106));var _0x47a5=function(_0x185035,_0x5c0a3c){_0x185035=_0x185035-0x0;var _0xaae8f3=_0x7a54[_0x185035];return _0xaae8f3;};'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 46f747b..df6d538 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 _0xc041=['GetCampaign','options','raw','where','attributes','limit','include','model','map','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4f8a41,_0x2799f1){var _0x2b6e84=function(_0x53d4dc){while(--_0x53d4dc){_0x4f8a41['push'](_0x4f8a41['shift']());}};_0x2b6e84(++_0x2799f1);}(_0xc041,0x1ea));var _0x1c04=function(_0x40bfc2,_0x538e26){_0x40bfc2=_0x40bfc2-0x0;var _0x14d1db=_0xc041[_0x40bfc2];return _0x14d1db;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var moment=require('moment');var BPromise=require(_0x1c04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c04('0x3'));var db=require(_0x1c04('0x4'))['db'];var utils=require(_0x1c04('0x5'));var logger=require(_0x1c04('0x6'))(_0x1c04('0x7'));var config=require(_0x1c04('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1c04('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524f85,_0x9507a,_0x3613fe){return new BPromise(function(_0x41a0d3,_0x1c2e7e){return client[_0x1c04('0xa')](_0x524f85,_0x3613fe)['then'](function(_0x536a46){logger[_0x1c04('0xb')](_0x1c04('0xc'),_0x9507a,_0x1c04('0xd'));logger[_0x1c04('0xe')](_0x1c04('0xf'),_0x9507a,_0x1c04('0xd'),JSON[_0x1c04('0x10')](_0x536a46));if(_0x536a46[_0x1c04('0x11')]){if(_0x536a46['error'][_0x1c04('0x12')]===0x1f4){logger['error'](_0x1c04('0xc'),_0x9507a,_0x536a46[_0x1c04('0x11')]['message']);return _0x1c2e7e(_0x536a46[_0x1c04('0x11')][_0x1c04('0x13')]);}logger[_0x1c04('0x11')](_0x1c04('0xc'),_0x9507a,_0x536a46[_0x1c04('0x11')][_0x1c04('0x13')]);return _0x41a0d3(_0x536a46[_0x1c04('0x11')]['message']);}else{logger[_0x1c04('0xb')](_0x1c04('0xc'),_0x9507a,_0x1c04('0xd'));_0x41a0d3(_0x536a46['result'][_0x1c04('0x13')]);}})['catch'](function(_0x26cbfa){logger[_0x1c04('0x11')](_0x1c04('0xc'),_0x9507a,_0x26cbfa);_0x1c2e7e(_0x26cbfa);});});}exports[_0x1c04('0x14')]=function(_0x2b3a8b){var _0x12e227=this;return new Promise(function(_0x3e2bd9,_0x46e892){return db['Campaign']['findAll']({'raw':_0x2b3a8b['options']?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x16')]===undefined?!![]:![]:!![],'where':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x17')]||null:null,'attributes':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x18')]||null:null,'limit':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x19')]||null:null,'include':_0x2b3a8b[_0x1c04('0x15')]?_0x2b3a8b[_0x1c04('0x15')][_0x1c04('0x1a')]?_['map'](_0x2b3a8b[_0x1c04('0x15')]['include'],function(_0x247116){return{'model':db[_0x247116[_0x1c04('0x1b')]],'as':_0x247116['as'],'attributes':_0x247116[_0x1c04('0x18')],'include':_0x247116[_0x1c04('0x1a')]?_[_0x1c04('0x1c')](_0x247116['include'],function(_0x5101e2){return{'model':db[_0x5101e2[_0x1c04('0x1b')]],'as':_0x5101e2['as'],'attributes':_0x5101e2[_0x1c04('0x18')],'include':_0x5101e2[_0x1c04('0x1a')]?_[_0x1c04('0x1c')](_0x5101e2[_0x1c04('0x1a')],function(_0x1e2daa){return{'model':db[_0x1e2daa[_0x1c04('0x1b')]],'as':_0x1e2daa['as'],'attributes':_0x1e2daa[_0x1c04('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bdd27){logger[_0x1c04('0xb')]('GetCampaign',_0x2b3a8b);logger[_0x1c04('0xe')](_0x1c04('0x14'),_0x2b3a8b,JSON[_0x1c04('0x10')](_0x4bdd27));_0x3e2bd9(_0x4bdd27);})[_0x1c04('0x1d')](function(_0x3bf4fd){logger[_0x1c04('0x11')](_0x1c04('0x14'),_0x3bf4fd['message'],_0x2b3a8b);_0x46e892(_0x12e227['error'](0x1f4,_0x3bf4fd['message']));});});};
\ No newline at end of file
+var _0xde64=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','map','include','model','attributes','debug','lodash','util','moment','bluebird'];(function(_0x49c451,_0x30e41d){var _0x2a470d=function(_0x4c0b41){while(--_0x4c0b41){_0x49c451['push'](_0x49c451['shift']());}};_0x2a470d(++_0x30e41d);}(_0xde64,0x17c));var _0x4de6=function(_0x59a6ef,_0xe0cbdd){_0x59a6ef=_0x59a6ef-0x0;var _0x1809cf=_0xde64[_0x59a6ef];return _0x1809cf;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var moment=require(_0x4de6('0x2'));var BPromise=require(_0x4de6('0x3'));var rs=require(_0x4de6('0x4'));var fs=require('fs');var Redis=require(_0x4de6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4de6('0x6'));var logger=require(_0x4de6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4de6('0x8'));var client=jayson[_0x4de6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568496,_0x24edef,_0x35ae72){return new BPromise(function(_0x475fb9,_0x248e39){return client[_0x4de6('0xa')](_0x568496,_0x35ae72)[_0x4de6('0xb')](function(_0x48a974){logger[_0x4de6('0xc')](_0x4de6('0xd'),_0x24edef,_0x4de6('0xe'));logger['debug'](_0x4de6('0xf'),_0x24edef,_0x4de6('0xe'),JSON[_0x4de6('0x10')](_0x48a974));if(_0x48a974[_0x4de6('0x11')]){if(_0x48a974[_0x4de6('0x11')]['code']===0x1f4){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974[_0x4de6('0x11')]['message']);return _0x248e39(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974['error'][_0x4de6('0x12')]);return _0x475fb9(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}else{logger['info'](_0x4de6('0xd'),_0x24edef,'request\x20sent');_0x475fb9(_0x48a974['result'][_0x4de6('0x12')]);}})[_0x4de6('0x13')](function(_0x6dbcf3){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x6dbcf3);_0x248e39(_0x6dbcf3);});});}exports[_0x4de6('0x14')]=function(_0x324202){var _0x5aacb4=this;return new Promise(function(_0x420f7c,_0xea1610){return db[_0x4de6('0x15')][_0x4de6('0x16')]({'raw':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x18')]===undefined?!![]:![]:!![],'where':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x19')]||null:null,'attributes':_0x324202['options']?_0x324202[_0x4de6('0x17')]['attributes']||null:null,'limit':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x1a')]||null:null,'include':_0x324202['options']?_0x324202[_0x4de6('0x17')]['include']?_[_0x4de6('0x1b')](_0x324202[_0x4de6('0x17')][_0x4de6('0x1c')],function(_0x5ddbab){return{'model':db[_0x5ddbab[_0x4de6('0x1d')]],'as':_0x5ddbab['as'],'attributes':_0x5ddbab[_0x4de6('0x1e')],'include':_0x5ddbab[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x5ddbab[_0x4de6('0x1c')],function(_0x25a76b){return{'model':db[_0x25a76b[_0x4de6('0x1d')]],'as':_0x25a76b['as'],'attributes':_0x25a76b['attributes'],'include':_0x25a76b[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x25a76b[_0x4de6('0x1c')],function(_0x327215){return{'model':db[_0x327215[_0x4de6('0x1d')]],'as':_0x327215['as'],'attributes':_0x327215[_0x4de6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4de6('0xb')](function(_0x7bc61e){logger[_0x4de6('0xc')]('GetCampaign',_0x324202);logger[_0x4de6('0x1f')](_0x4de6('0x14'),_0x324202,JSON[_0x4de6('0x10')](_0x7bc61e));_0x420f7c(_0x7bc61e);})[_0x4de6('0x13')](function(_0x24a0a7){logger['error'](_0x4de6('0x14'),_0x24a0a7['message'],_0x324202);_0xea1610(_0x5aacb4[_0x4de6('0x11')](0x1f4,_0x24a0a7[_0x4de6('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index dd5df08..7743958 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 _0x849e=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','post','/:id/clone','addLists','/:id/blacklists','addBlackLists','put','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x849e,0x187));var _0xe849=function(_0x52d0d3,_0x552ba6){_0x52d0d3=_0x52d0d3-0x0;var _0x1b4978=_0x849e[_0x52d0d3];return _0x1b4978;};'use strict';var multer=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var path=require(_0xe849('0x2'));var timeout=require(_0xe849('0x3'));var express=require(_0xe849('0x4'));var router=express[_0xe849('0x5')]();var fs_extra=require(_0xe849('0x6'));var auth=require(_0xe849('0x7'));var interaction=require(_0xe849('0x8'));var config=require(_0xe849('0x9'));var controller=require(_0xe849('0xa'));router[_0xe849('0xb')]('/',auth[_0xe849('0xc')](),controller['index']);router[_0xe849('0xb')](_0xe849('0xd'),auth[_0xe849('0xc')](),controller[_0xe849('0xe')]);router[_0xe849('0xb')](_0xe849('0xf'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xe849('0xb')](_0xe849('0x10'),auth['isAuthenticated'](),controller[_0xe849('0x11')]);router[_0xe849('0xb')]('/:id/hopper_finals',auth[_0xe849('0xc')](),controller[_0xe849('0x12')]);router[_0xe849('0xb')](_0xe849('0x13'),auth[_0xe849('0xc')](),controller[_0xe849('0x14')]);router['get'](_0xe849('0x15'),auth[_0xe849('0xc')](),controller[_0xe849('0x16')]);router['get']('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0xe849('0x17')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xe849('0x18'),auth[_0xe849('0xc')](),controller['clone']);router[_0xe849('0x17')](_0xe849('0x15'),auth[_0xe849('0xc')](),controller[_0xe849('0x19')]);router[_0xe849('0x17')](_0xe849('0x1a'),auth['isAuthenticated'](),controller[_0xe849('0x1b')]);router[_0xe849('0x1c')]('/:id',auth[_0xe849('0xc')](),controller['update']);router['delete'](_0xe849('0xd'),auth[_0xe849('0xc')](),controller[_0xe849('0x1d')]);router[_0xe849('0x1e')]('/:id/lists',auth['isAuthenticated'](),controller[_0xe849('0x1f')]);router['delete'](_0xe849('0x1a'),auth[_0xe849('0xc')](),controller[_0xe849('0x20')]);module[_0xe849('0x21')]=router;
\ No newline at end of file
+var _0xf7cb=['../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','/:id/lists','addLists','addBlackLists','put','update','/:id','delete','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x452c94,_0xeddd6c){var _0x150446=function(_0x5eef33){while(--_0x5eef33){_0x452c94['push'](_0x452c94['shift']());}};_0x150446(++_0xeddd6c);}(_0xf7cb,0x1a9));var _0xbf7c=function(_0x355388,_0x3d00c1){_0x355388=_0x355388-0x0;var _0x324e01=_0xf7cb[_0x355388];return _0x324e01;};'use strict';var multer=require('multer');var util=require(_0xbf7c('0x0'));var path=require(_0xbf7c('0x1'));var timeout=require(_0xbf7c('0x2'));var express=require(_0xbf7c('0x3'));var router=express[_0xbf7c('0x4')]();var fs_extra=require(_0xbf7c('0x5'));var auth=require(_0xbf7c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbf7c('0x7'));var controller=require(_0xbf7c('0x8'));router['get']('/',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0xa')]);router[_0xbf7c('0xb')]('/:id',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0xc')]);router[_0xbf7c('0xb')](_0xbf7c('0xd'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0xe')]);router[_0xbf7c('0xb')](_0xbf7c('0xf'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x10')]);router[_0xbf7c('0xb')](_0xbf7c('0x11'),auth['isAuthenticated'](),controller[_0xbf7c('0x12')]);router[_0xbf7c('0xb')]('/:id/hopper_black',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x13')]);router[_0xbf7c('0xb')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbf7c('0x14')]);router['get'](_0xbf7c('0x15'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x16')]);router[_0xbf7c('0x17')]('/',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x18')]);router[_0xbf7c('0x17')](_0xbf7c('0x19'),auth[_0xbf7c('0x9')](),controller['clone']);router[_0xbf7c('0x17')](_0xbf7c('0x1a'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x1b')]);router[_0xbf7c('0x17')]('/:id/blacklists',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x1c')]);router[_0xbf7c('0x1d')]('/:id',auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x1e')]);router['delete'](_0xbf7c('0x1f'),auth[_0xbf7c('0x9')](),controller['destroy']);router[_0xbf7c('0x20')](_0xbf7c('0x1a'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x21')]);router['delete'](_0xbf7c('0x15'),auth[_0xbf7c('0x9')](),controller[_0xbf7c('0x22')]);module[_0xbf7c('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index c3e90eb..01833d6 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 _0xfd1e=['VIRTUAL','getDataValue','key','exports','TEXT','STRING'];(function(_0x53f4e3,_0x62f760){var _0x25c1ef=function(_0x4e4e95){while(--_0x4e4e95){_0x53f4e3['push'](_0x53f4e3['shift']());}};_0x25c1ef(++_0x62f760);}(_0xfd1e,0xff));var _0xefd1=function(_0x246d80,_0x3ebb30){_0x246d80=_0x246d80-0x0;var _0x214f35=_0xfd1e[_0x246d80];return _0x214f35;};'use strict';var Sequelize=require('sequelize');module[_0xefd1('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xefd1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xefd1('0x2')]},'name':{'type':Sequelize[_0xefd1('0x3')],'get':function(){return this[_0xefd1('0x4')](_0xefd1('0x5'));}}};
\ No newline at end of file
+var _0x9864=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0x4f6329,_0x253a75){var _0x2238bd=function(_0x2dfa77){while(--_0x2dfa77){_0x4f6329['push'](_0x4f6329['shift']());}};_0x2238bd(++_0x253a75);}(_0x9864,0x84));var _0x4986=function(_0x163838,_0x58a700){_0x163838=_0x163838-0x0;var _0xe51f37=_0x9864[_0x163838];return _0xe51f37;};'use strict';var Sequelize=require(_0x4986('0x0'));module[_0x4986('0x1')]={'key':{'type':Sequelize[_0x4986('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x4986('0x2')]},'name':{'type':Sequelize[_0x4986('0x3')],'get':function(){return this[_0x4986('0x4')](_0x4986('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 4c94d11..761b581 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 _0x1299=['body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','reject','update','then','get','CannedAnswers','destroy','error','stack','name','index','CannedAnswer','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find'];(function(_0x430185,_0xb3bd00){var _0x412b86=function(_0x5ac609){while(--_0x5ac609){_0x430185['push'](_0x430185['shift']());}};_0x412b86(++_0xb3bd00);}(_0x1299,0x1c9));var _0x9129=function(_0x9fa60,_0x4df300){_0x9fa60=_0x9fa60-0x0;var _0x391006=_0x1299[_0x9fa60];return _0x391006;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9129('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9129('0x1'));var moment=require(_0x9129('0x2'));var BPromise=require(_0x9129('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9129('0x4'));var sox=require('sox');var csv=require(_0x9129('0x5'));var ejs=require(_0x9129('0x6'));var fs=require('fs');var fs_extra=require(_0x9129('0x7'));var _=require(_0x9129('0x8'));var squel=require(_0x9129('0x9'));var crypto=require(_0x9129('0xa'));var jsforce=require(_0x9129('0xb'));var deskjs=require(_0x9129('0xc'));var toCsv=require(_0x9129('0x5'));var querystring=require('querystring');var Papa=require(_0x9129('0xd'));var Redis=require(_0x9129('0xe'));var authService=require(_0x9129('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9129('0x10'));var hardwareService=require(_0x9129('0x11'));var logger=require(_0x9129('0x12'))(_0x9129('0x13'));var utils=require(_0x9129('0x14'));var config=require(_0x9129('0x15'));var licenseUtil=require(_0x9129('0x16'));var db=require(_0x9129('0x17'))['db'];function respondWithStatusCode(_0x354efc,_0x410378){_0x410378=_0x410378||0xcc;return function(_0x1aa3db){if(_0x1aa3db){return _0x354efc[_0x9129('0x18')](_0x410378);}return _0x354efc['status'](_0x410378)[_0x9129('0x19')]();};}function respondWithResult(_0x2a590f,_0x4eea6d){_0x4eea6d=_0x4eea6d||0xc8;return function(_0x267ecf){if(_0x267ecf){return _0x2a590f[_0x9129('0x1a')](_0x4eea6d)[_0x9129('0x1b')](_0x267ecf);}};}function respondWithFilteredResult(_0x1cf47b,_0x60edc2){return function(_0x18ae7d){if(_0x18ae7d){var _0x1addb6=typeof _0x60edc2[_0x9129('0x1c')]===_0x9129('0x1d')&&typeof _0x60edc2[_0x9129('0x1e')]===_0x9129('0x1d');var _0x5bbf46=_0x18ae7d['count'];var _0x50e089=_0x1addb6?0x0:_0x60edc2[_0x9129('0x1c')];var _0x4278ba=_0x1addb6?_0x18ae7d['count']:_0x60edc2[_0x9129('0x1c')]+_0x60edc2[_0x9129('0x1e')];var _0x53c112;if(_0x4278ba>=_0x5bbf46){_0x4278ba=_0x5bbf46;_0x53c112=0xc8;}else{_0x53c112=0xce;}_0x1cf47b[_0x9129('0x1a')](_0x53c112);return _0x1cf47b[_0x9129('0x1f')]('Content-Range',_0x50e089+'-'+_0x4278ba+'/'+_0x5bbf46)[_0x9129('0x1b')](_0x18ae7d);}return null;};}function patchUpdates(_0x1a238c){return function(_0x5bbb08){try{jsonpatch['apply'](_0x5bbb08,_0x1a238c,!![]);}catch(_0x4fcb60){return BPromise[_0x9129('0x20')](_0x4fcb60);}return _0x5bbb08['save']();};}function saveUpdates(_0x54d8f1,_0x249778){return function(_0x2c8ea8){if(_0x2c8ea8){return _0x2c8ea8[_0x9129('0x21')](_0x54d8f1)['then'](function(_0x3d91ee){return _0x3d91ee;});}return null;};}function removeEntity(_0x4a255c,_0x40f4a4){return function(_0x5b56c1){if(_0x5b56c1){return _0x5b56c1['destroy']()[_0x9129('0x22')](function(){var _0x12cb38=_0x5b56c1[_0x9129('0x23')]({'plain':!![]});var _0xe5099e=_0x9129('0x24');return db['UserProfileResource'][_0x9129('0x25')]({'where':{'type':_0xe5099e,'resourceId':_0x12cb38['id']}})[_0x9129('0x22')](function(){return _0x5b56c1;});})['then'](function(){_0x4a255c[_0x9129('0x1a')](0xcc)[_0x9129('0x19')]();});}};}function handleEntityNotFound(_0x3b522a,_0x55b126){return function(_0x50665b){if(!_0x50665b){_0x3b522a['sendStatus'](0x194);}return _0x50665b;};}function handleError(_0x53ff8e,_0x1d6511){_0x1d6511=_0x1d6511||0x1f4;return function(_0x88acf4){logger[_0x9129('0x26')](_0x88acf4[_0x9129('0x27')]);if(_0x88acf4[_0x9129('0x28')]){delete _0x88acf4['name'];}_0x53ff8e['status'](_0x1d6511)['send'](_0x88acf4);};}exports[_0x9129('0x29')]=function(_0x38dd11,_0x3e6a86){var _0x452753={},_0x5ee1fe={},_0x3dcfe1={'count':0x0,'rows':[]};var _0x59ae17=_['map'](db[_0x9129('0x2a')][_0x9129('0x2b')],function(_0xf3b59f){return{'name':_0xf3b59f[_0x9129('0x2c')],'type':_0xf3b59f['type'][_0x9129('0x2d')]};});_0x5ee1fe[_0x9129('0x2e')]=_[_0x9129('0x2f')](_0x59ae17,'name');_0x5ee1fe[_0x9129('0x30')]=_[_0x9129('0x31')](_0x38dd11[_0x9129('0x30')]);_0x5ee1fe[_0x9129('0x32')]=_[_0x9129('0x33')](_0x5ee1fe[_0x9129('0x2e')],_0x5ee1fe['query']);_0x452753[_0x9129('0x34')]=_[_0x9129('0x33')](_0x5ee1fe[_0x9129('0x2e')],qs[_0x9129('0x35')](_0x38dd11['query'][_0x9129('0x35')]));_0x452753[_0x9129('0x34')]=_0x452753[_0x9129('0x34')][_0x9129('0x36')]?_0x452753[_0x9129('0x34')]:_0x5ee1fe[_0x9129('0x2e')];if(!_0x38dd11['query'][_0x9129('0x37')](_0x9129('0x38'))){_0x452753[_0x9129('0x1e')]=qs[_0x9129('0x1e')](_0x38dd11[_0x9129('0x30')][_0x9129('0x1e')]);_0x452753['offset']=qs[_0x9129('0x1c')](_0x38dd11[_0x9129('0x30')][_0x9129('0x1c')]);}_0x452753[_0x9129('0x39')]=qs[_0x9129('0x3a')](_0x38dd11['query'][_0x9129('0x3a')]);_0x452753[_0x9129('0x3b')]=qs['filters'](_[_0x9129('0x3c')](_0x38dd11[_0x9129('0x30')],_0x5ee1fe['filters']),_0x59ae17);if(_0x38dd11[_0x9129('0x30')][_0x9129('0x3d')]){_0x452753[_0x9129('0x3b')]=_[_0x9129('0x3e')](_0x452753[_0x9129('0x3b')],{'$or':[{'key':{'$like':'%'+_0x38dd11['query']['filter']+'%'}},{'value':{'$like':'%'+_0x38dd11[_0x9129('0x30')]['filter']+'%'}}]});}_0x452753=_[_0x9129('0x3e')]({},_0x452753,_0x38dd11[_0x9129('0x3f')]);var _0x565f9c={'where':_0x452753[_0x9129('0x3b')]};return db[_0x9129('0x2a')]['count'](_0x565f9c)[_0x9129('0x22')](function(_0x5adfb7){_0x3dcfe1['count']=_0x5adfb7;if(_0x38dd11[_0x9129('0x30')][_0x9129('0x40')]){_0x452753[_0x9129('0x41')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9129('0x42')](_0x452753);})[_0x9129('0x22')](function(_0x2b81c5){_0x3dcfe1[_0x9129('0x43')]=_0x2b81c5;return _0x3dcfe1;})[_0x9129('0x22')](respondWithFilteredResult(_0x3e6a86,_0x452753))[_0x9129('0x44')](handleError(_0x3e6a86,null));};exports[_0x9129('0x45')]=function(_0x554988,_0x4851be){var _0x1accb8={'raw':!![],'where':{'id':_0x554988['params']['id']}},_0x2dd2a1={};_0x2dd2a1['model']=_[_0x9129('0x31')](db[_0x9129('0x2a')][_0x9129('0x2b')]);_0x2dd2a1[_0x9129('0x30')]=_[_0x9129('0x31')](_0x554988[_0x9129('0x30')]);_0x2dd2a1[_0x9129('0x32')]=_['intersection'](_0x2dd2a1[_0x9129('0x2e')],_0x2dd2a1['query']);_0x1accb8[_0x9129('0x34')]=_[_0x9129('0x33')](_0x2dd2a1[_0x9129('0x2e')],qs[_0x9129('0x35')](_0x554988[_0x9129('0x30')][_0x9129('0x35')]));_0x1accb8[_0x9129('0x34')]=_0x1accb8[_0x9129('0x34')][_0x9129('0x36')]?_0x1accb8[_0x9129('0x34')]:_0x2dd2a1[_0x9129('0x2e')];if(_0x554988[_0x9129('0x30')][_0x9129('0x40')]){_0x1accb8[_0x9129('0x41')]=[{'all':!![]}];}_0x1accb8=_[_0x9129('0x3e')]({},_0x1accb8,_0x554988[_0x9129('0x3f')]);return db[_0x9129('0x2a')][_0x9129('0x46')](_0x1accb8)[_0x9129('0x22')](handleEntityNotFound(_0x4851be,null))['then'](respondWithResult(_0x4851be,null))[_0x9129('0x44')](handleError(_0x4851be,null));};exports[_0x9129('0x21')]=function(_0x640fd0,_0x16287c){if(_0x640fd0[_0x9129('0x47')]['id']){delete _0x640fd0[_0x9129('0x47')]['id'];}return db[_0x9129('0x2a')]['find']({'where':{'id':_0x640fd0[_0x9129('0x48')]['id']}})[_0x9129('0x22')](handleEntityNotFound(_0x16287c,null))[_0x9129('0x22')](saveUpdates(_0x640fd0[_0x9129('0x47')],null))[_0x9129('0x22')](respondWithResult(_0x16287c,null))[_0x9129('0x44')](handleError(_0x16287c,null));};exports['destroy']=function(_0x1a6e42,_0x39265b){return db[_0x9129('0x2a')]['find']({'where':{'id':_0x1a6e42[_0x9129('0x48')]['id']}})[_0x9129('0x22')](handleEntityNotFound(_0x39265b,null))[_0x9129('0x22')](removeEntity(_0x39265b,null))[_0x9129('0x44')](handleError(_0x39265b,null));};exports[_0x9129('0x49')]=function(_0x1d1c62,_0x580700){var _0x223afa={'key':_0x1d1c62[_0x9129('0x47')]['key']};if(_0x1d1c62[_0x9129('0x47')][_0x9129('0x4a')]){_0x223afa[_0x9129('0x4a')]=_0x1d1c62[_0x9129('0x47')]['MailAccountId'];}else if(_0x1d1c62[_0x9129('0x47')][_0x9129('0x4b')]){_0x223afa[_0x9129('0x4b')]=_0x1d1c62[_0x9129('0x47')]['SmsAccountId'];}else if(_0x1d1c62['body'][_0x9129('0x4c')]){_0x223afa[_0x9129('0x4c')]=_0x1d1c62['body']['OpenchannelAccountId'];}else if(_0x1d1c62['body'][_0x9129('0x4d')]){_0x223afa[_0x9129('0x4d')]=_0x1d1c62[_0x9129('0x47')][_0x9129('0x4d')];}return db[_0x9129('0x2a')][_0x9129('0x46')]({'where':_0x223afa})['then'](function(_0x35de2c){if(_0x35de2c){throw new db[(_0x9129('0x4e'))][(_0x9129('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x9129('0x49')](_0x1d1c62[_0x9129('0x47')]);})[_0x9129('0x22')](function(_0x262762){var _0x44d121=_0x1d1c62[_0x9129('0x50')][_0x9129('0x23')]({'plain':!![]});if(!_0x44d121)throw new Error(_0x9129('0x51'));if(_0x44d121[_0x9129('0x52')]===_0x9129('0x50')){var _0x325614=_0x262762[_0x9129('0x23')]({'plain':!![]});return db[_0x9129('0x53')][_0x9129('0x46')]({'where':{'name':_0x9129('0x24'),'userProfileId':_0x44d121[_0x9129('0x54')]},'raw':!![]})[_0x9129('0x22')](function(_0x23420b){if(_0x23420b&&_0x23420b[_0x9129('0x55')]===0x0){return db[_0x9129('0x56')][_0x9129('0x49')]({'name':_0x325614[_0x9129('0x28')],'resourceId':_0x325614['id'],'type':_0x23420b[_0x9129('0x28')],'sectionId':_0x23420b['id']},{})['then'](function(){return _0x262762;});}else{return _0x262762;}})['catch'](function(_0x338114){logger[_0x9129('0x26')](_0x9129('0x57'),_0x338114);throw _0x338114;});}return _0x262762;})[_0x9129('0x22')](respondWithResult(_0x580700,0xc9))[_0x9129('0x44')](handleError(_0x580700,null));};
\ No newline at end of file
+var _0x5e75=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','CannedAnswers','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','where','merge','filter','options','CannedAnswer','includeAll','include','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.'];(function(_0x54f253,_0x13acb1){var _0x207e8d=function(_0x32b855){while(--_0x32b855){_0x54f253['push'](_0x54f253['shift']());}};_0x207e8d(++_0x13acb1);}(_0x5e75,0x108));var _0x55e7=function(_0x398cb4,_0x4971c1){_0x398cb4=_0x398cb4-0x0;var _0x1825d1=_0x5e75[_0x398cb4];return _0x1825d1;};'use strict';var emlformat=require(_0x55e7('0x0'));var rimraf=require(_0x55e7('0x1'));var zipdir=require(_0x55e7('0x2'));var jsonpatch=require(_0x55e7('0x3'));var rp=require(_0x55e7('0x4'));var moment=require(_0x55e7('0x5'));var BPromise=require(_0x55e7('0x6'));var Mustache=require(_0x55e7('0x7'));var util=require(_0x55e7('0x8'));var path=require(_0x55e7('0x9'));var sox=require(_0x55e7('0xa'));var csv=require(_0x55e7('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x55e7('0xc'));var _=require(_0x55e7('0xd'));var squel=require(_0x55e7('0xe'));var crypto=require(_0x55e7('0xf'));var jsforce=require(_0x55e7('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x55e7('0xb'));var querystring=require(_0x55e7('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x55e7('0x12'));var as=require(_0x55e7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x55e7('0x14'));var utils=require(_0x55e7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x55e7('0x16'));var db=require(_0x55e7('0x17'))['db'];function respondWithStatusCode(_0x4cab61,_0x115623){_0x115623=_0x115623||0xcc;return function(_0x16242b){if(_0x16242b){return _0x4cab61[_0x55e7('0x18')](_0x115623);}return _0x4cab61[_0x55e7('0x19')](_0x115623)[_0x55e7('0x1a')]();};}function respondWithResult(_0x21e392,_0x1ea59d){_0x1ea59d=_0x1ea59d||0xc8;return function(_0x1cc004){if(_0x1cc004){return _0x21e392['status'](_0x1ea59d)[_0x55e7('0x1b')](_0x1cc004);}};}function respondWithFilteredResult(_0x382e7a,_0x491a3a){return function(_0x523f4b){if(_0x523f4b){var _0x531deb=typeof _0x491a3a['offset']===_0x55e7('0x1c')&&typeof _0x491a3a[_0x55e7('0x1d')]==='undefined';var _0x109cd6=_0x523f4b[_0x55e7('0x1e')];var _0x5338a7=_0x531deb?0x0:_0x491a3a[_0x55e7('0x1f')];var _0x23f477=_0x531deb?_0x523f4b['count']:_0x491a3a[_0x55e7('0x1f')]+_0x491a3a[_0x55e7('0x1d')];var _0x3aed30;if(_0x23f477>=_0x109cd6){_0x23f477=_0x109cd6;_0x3aed30=0xc8;}else{_0x3aed30=0xce;}_0x382e7a[_0x55e7('0x19')](_0x3aed30);return _0x382e7a[_0x55e7('0x20')](_0x55e7('0x21'),_0x5338a7+'-'+_0x23f477+'/'+_0x109cd6)[_0x55e7('0x1b')](_0x523f4b);}return null;};}function patchUpdates(_0x34ca96){return function(_0x397412){try{jsonpatch[_0x55e7('0x22')](_0x397412,_0x34ca96,!![]);}catch(_0x35eff8){return BPromise[_0x55e7('0x23')](_0x35eff8);}return _0x397412[_0x55e7('0x24')]();};}function saveUpdates(_0xe8f6f9,_0x2cf4df){return function(_0x8746e2){if(_0x8746e2){return _0x8746e2[_0x55e7('0x25')](_0xe8f6f9)[_0x55e7('0x26')](function(_0x55748c){return _0x55748c;});}return null;};}function removeEntity(_0x18197e,_0x5dea39){return function(_0x27c842){if(_0x27c842){return _0x27c842['destroy']()[_0x55e7('0x26')](function(){var _0x42c737=_0x27c842[_0x55e7('0x27')]({'plain':!![]});var _0x478953=_0x55e7('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x478953,'resourceId':_0x42c737['id']}})['then'](function(){return _0x27c842;});})[_0x55e7('0x26')](function(){_0x18197e[_0x55e7('0x19')](0xcc)[_0x55e7('0x1a')]();});}};}function handleEntityNotFound(_0x289e87,_0x439642){return function(_0x376025){if(!_0x376025){_0x289e87[_0x55e7('0x18')](0x194);}return _0x376025;};}function handleError(_0x10beb3,_0x25fc2a){_0x25fc2a=_0x25fc2a||0x1f4;return function(_0x44245c){logger[_0x55e7('0x29')](_0x44245c[_0x55e7('0x2a')]);if(_0x44245c['name']){delete _0x44245c[_0x55e7('0x2b')];}_0x10beb3['status'](_0x25fc2a)[_0x55e7('0x2c')](_0x44245c);};}exports[_0x55e7('0x2d')]=function(_0x1e3c75,_0x3d0eec){var _0x82951a={},_0x1cd43d={},_0x2daf01={'count':0x0,'rows':[]};var _0xef5a92=_[_0x55e7('0x2e')](db['CannedAnswer'][_0x55e7('0x2f')],function(_0xc108be){return{'name':_0xc108be[_0x55e7('0x30')],'type':_0xc108be[_0x55e7('0x31')][_0x55e7('0x32')]};});_0x1cd43d[_0x55e7('0x33')]=_[_0x55e7('0x2e')](_0xef5a92,_0x55e7('0x2b'));_0x1cd43d[_0x55e7('0x34')]=_['keys'](_0x1e3c75[_0x55e7('0x34')]);_0x1cd43d[_0x55e7('0x35')]=_['intersection'](_0x1cd43d[_0x55e7('0x33')],_0x1cd43d['query']);_0x82951a[_0x55e7('0x36')]=_[_0x55e7('0x37')](_0x1cd43d['model'],qs[_0x55e7('0x38')](_0x1e3c75['query'][_0x55e7('0x38')]));_0x82951a[_0x55e7('0x36')]=_0x82951a[_0x55e7('0x36')][_0x55e7('0x39')]?_0x82951a[_0x55e7('0x36')]:_0x1cd43d[_0x55e7('0x33')];if(!_0x1e3c75['query']['hasOwnProperty'](_0x55e7('0x3a'))){_0x82951a['limit']=qs[_0x55e7('0x1d')](_0x1e3c75['query'][_0x55e7('0x1d')]);_0x82951a['offset']=qs[_0x55e7('0x1f')](_0x1e3c75[_0x55e7('0x34')][_0x55e7('0x1f')]);}_0x82951a['order']=qs['sort'](_0x1e3c75[_0x55e7('0x34')]['sort']);_0x82951a[_0x55e7('0x3b')]=qs[_0x55e7('0x35')](_['pick'](_0x1e3c75[_0x55e7('0x34')],_0x1cd43d[_0x55e7('0x35')]),_0xef5a92);if(_0x1e3c75[_0x55e7('0x34')]['filter']){_0x82951a[_0x55e7('0x3b')]=_[_0x55e7('0x3c')](_0x82951a['where'],{'$or':[{'key':{'$like':'%'+_0x1e3c75[_0x55e7('0x34')][_0x55e7('0x3d')]+'%'}},{'value':{'$like':'%'+_0x1e3c75[_0x55e7('0x34')][_0x55e7('0x3d')]+'%'}}]});}_0x82951a=_[_0x55e7('0x3c')]({},_0x82951a,_0x1e3c75[_0x55e7('0x3e')]);var _0x4fe243={'where':_0x82951a[_0x55e7('0x3b')]};return db[_0x55e7('0x3f')][_0x55e7('0x1e')](_0x4fe243)['then'](function(_0x3edaf3){_0x2daf01['count']=_0x3edaf3;if(_0x1e3c75['query'][_0x55e7('0x40')]){_0x82951a[_0x55e7('0x41')]=[{'all':!![]}];}return db[_0x55e7('0x3f')]['findAll'](_0x82951a);})[_0x55e7('0x26')](function(_0x37284a){_0x2daf01[_0x55e7('0x42')]=_0x37284a;return _0x2daf01;})['then'](respondWithFilteredResult(_0x3d0eec,_0x82951a))[_0x55e7('0x43')](handleError(_0x3d0eec,null));};exports[_0x55e7('0x44')]=function(_0x4ad656,_0x33794b){var _0x2f1a41={'raw':!![],'where':{'id':_0x4ad656[_0x55e7('0x45')]['id']}},_0x574a9c={};_0x574a9c[_0x55e7('0x33')]=_[_0x55e7('0x46')](db['CannedAnswer']['rawAttributes']);_0x574a9c[_0x55e7('0x34')]=_[_0x55e7('0x46')](_0x4ad656[_0x55e7('0x34')]);_0x574a9c[_0x55e7('0x35')]=_['intersection'](_0x574a9c[_0x55e7('0x33')],_0x574a9c['query']);_0x2f1a41[_0x55e7('0x36')]=_['intersection'](_0x574a9c[_0x55e7('0x33')],qs[_0x55e7('0x38')](_0x4ad656[_0x55e7('0x34')][_0x55e7('0x38')]));_0x2f1a41['attributes']=_0x2f1a41[_0x55e7('0x36')][_0x55e7('0x39')]?_0x2f1a41[_0x55e7('0x36')]:_0x574a9c[_0x55e7('0x33')];if(_0x4ad656[_0x55e7('0x34')]['includeAll']){_0x2f1a41[_0x55e7('0x41')]=[{'all':!![]}];}_0x2f1a41=_['merge']({},_0x2f1a41,_0x4ad656[_0x55e7('0x3e')]);return db['CannedAnswer'][_0x55e7('0x47')](_0x2f1a41)[_0x55e7('0x26')](handleEntityNotFound(_0x33794b,null))['then'](respondWithResult(_0x33794b,null))[_0x55e7('0x43')](handleError(_0x33794b,null));};exports['update']=function(_0x2dc31a,_0x266f90){if(_0x2dc31a['body']['id']){delete _0x2dc31a[_0x55e7('0x48')]['id'];}return db[_0x55e7('0x3f')]['find']({'where':{'id':_0x2dc31a[_0x55e7('0x45')]['id']}})[_0x55e7('0x26')](handleEntityNotFound(_0x266f90,null))[_0x55e7('0x26')](saveUpdates(_0x2dc31a[_0x55e7('0x48')],null))['then'](respondWithResult(_0x266f90,null))['catch'](handleError(_0x266f90,null));};exports['destroy']=function(_0x251dbc,_0x19878e){return db['CannedAnswer']['find']({'where':{'id':_0x251dbc[_0x55e7('0x45')]['id']}})[_0x55e7('0x26')](handleEntityNotFound(_0x19878e,null))[_0x55e7('0x26')](removeEntity(_0x19878e,null))[_0x55e7('0x43')](handleError(_0x19878e,null));};exports[_0x55e7('0x49')]=function(_0x4bfe4d,_0x3c46fc){var _0x4b59d7={'key':_0x4bfe4d[_0x55e7('0x48')]['key']};if(_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4a')]){_0x4b59d7[_0x55e7('0x4a')]=_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4a')];}else if(_0x4bfe4d[_0x55e7('0x48')]['SmsAccountId']){_0x4b59d7[_0x55e7('0x4b')]=_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4b')];}else if(_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4c')]){_0x4b59d7['OpenchannelAccountId']=_0x4bfe4d[_0x55e7('0x48')]['OpenchannelAccountId'];}else if(_0x4bfe4d['body']['ChatWebsiteId']){_0x4b59d7[_0x55e7('0x4d')]=_0x4bfe4d[_0x55e7('0x48')][_0x55e7('0x4d')];}return db[_0x55e7('0x3f')]['find']({'where':_0x4b59d7})['then'](function(_0x34054d){if(_0x34054d){throw new db['Sequelize'][(_0x55e7('0x4e'))](_0x55e7('0x4f'));}return db['CannedAnswer'][_0x55e7('0x49')](_0x4bfe4d[_0x55e7('0x48')]);})['then'](function(_0x1c28ee){var _0x273c6d=_0x4bfe4d['user'][_0x55e7('0x27')]({'plain':!![]});if(!_0x273c6d)throw new Error(_0x55e7('0x50'));if(_0x273c6d[_0x55e7('0x51')]===_0x55e7('0x52')){var _0x2c2331=_0x1c28ee[_0x55e7('0x27')]({'plain':!![]});return db[_0x55e7('0x53')][_0x55e7('0x47')]({'where':{'name':_0x55e7('0x28'),'userProfileId':_0x273c6d[_0x55e7('0x54')]},'raw':!![]})[_0x55e7('0x26')](function(_0x3fa422){if(_0x3fa422&&_0x3fa422['autoAssociation']===0x0){return db[_0x55e7('0x55')][_0x55e7('0x49')]({'name':_0x2c2331[_0x55e7('0x2b')],'resourceId':_0x2c2331['id'],'type':_0x3fa422[_0x55e7('0x2b')],'sectionId':_0x3fa422['id']},{})['then'](function(){return _0x1c28ee;});}else{return _0x1c28ee;}})[_0x55e7('0x43')](function(_0x2ba902){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ba902);throw _0x2ba902;});}return _0x1c28ee;})[_0x55e7('0x26')](respondWithResult(_0x3c46fc,0xc9))['catch'](handleError(_0x3c46fc,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 9720dc8..7b41075 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 _0x6e7a=['lodash','util','api','moment','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x401fdf,_0x1a3185){var _0x2198a6=function(_0x3fe20b){while(--_0x3fe20b){_0x401fdf['push'](_0x401fdf['shift']());}};_0x2198a6(++_0x1a3185);}(_0x6e7a,0x145));var _0xa6e7=function(_0x19c6a6,_0x36701d){_0x19c6a6=_0x19c6a6-0x0;var _0x29014=_0x6e7a[_0x19c6a6];return _0x29014;};'use strict';var _=require(_0xa6e7('0x0'));var util=require(_0xa6e7('0x1'));var logger=require('../../config/logger')(_0xa6e7('0x2'));var moment=require(_0xa6e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa6e7('0x4'));var rimraf=require(_0xa6e7('0x5'));var config=require('../../config/environment');var attributes=require(_0xa6e7('0x6'));module[_0xa6e7('0x7')]=function(_0x2cc300,_0x54bb45){return _0x2cc300[_0xa6e7('0x8')](_0xa6e7('0x9'),attributes,{'tableName':_0xa6e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6e7('0xb'),'collate':_0xa6e7('0xc')});};
\ No newline at end of file
+var _0xfc73=['./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa1ceef,_0x184856){var _0x4797c1=function(_0xc253e0){while(--_0xc253e0){_0xa1ceef['push'](_0xa1ceef['shift']());}};_0x4797c1(++_0x184856);}(_0xfc73,0x8d));var _0x3fc7=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xfc73[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var logger=require('../../config/logger')(_0x3fc7('0x2'));var moment=require(_0x3fc7('0x3'));var BPromise=require(_0x3fc7('0x4'));var rp=require(_0x3fc7('0x5'));var fs=require('fs');var path=require(_0x3fc7('0x6'));var rimraf=require(_0x3fc7('0x7'));var config=require(_0x3fc7('0x8'));var attributes=require(_0x3fc7('0x9'));module[_0x3fc7('0xa')]=function(_0x1039e0,_0x262417){return _0x1039e0[_0x3fc7('0xb')]('CannedAnswer',attributes,{'tableName':_0x3fc7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3fc7('0xd'),'collate':_0x3fc7('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 73c7936..9638676 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(_0x4f63b2,_0x473573){var _0x3b93bd=function(_0x167b0d){while(--_0x167b0d){_0x4f63b2['push'](_0x4f63b2['shift']());}};_0x3b93bd(++_0x473573);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x2ed4ae,_0x4d9445){var _0x4c59d2=function(_0xd503f8){while(--_0xd503f8){_0x2ed4ae['push'](_0x2ed4ae['shift']());}};_0x4c59d2(++_0x4d9445);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 102bdb6..f83a7bc 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 _0x6e12=['update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','create','put','/:id'];(function(_0x1858e0,_0x16386c){var _0x38af40=function(_0x26e183){while(--_0x26e183){_0x1858e0['push'](_0x1858e0['shift']());}};_0x38af40(++_0x16386c);}(_0x6e12,0x1df));var _0x26e1=function(_0x43434f,_0x220ac7){_0x43434f=_0x43434f-0x0;var _0x5e7af7=_0x6e12[_0x43434f];return _0x5e7af7;};'use strict';var multer=require(_0x26e1('0x0'));var util=require(_0x26e1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x26e1('0x2'));var router=express['Router']();var fs_extra=require(_0x26e1('0x3'));var auth=require(_0x26e1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x26e1('0x5'));var controller=require(_0x26e1('0x6'));router[_0x26e1('0x7')]('/',auth[_0x26e1('0x8')](),controller[_0x26e1('0x9')]);router[_0x26e1('0x7')]('/:id',auth[_0x26e1('0x8')](),controller[_0x26e1('0xa')]);router['post']('/',auth[_0x26e1('0x8')](),controller[_0x26e1('0xb')]);router[_0x26e1('0xc')](_0x26e1('0xd'),auth['isAuthenticated'](),controller[_0x26e1('0xe')]);router[_0x26e1('0xf')]('/:id',auth[_0x26e1('0x8')](),controller[_0x26e1('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xfc71=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra'];(function(_0x261a64,_0x56415a){var _0x11fcf4=function(_0x524d80){while(--_0x524d80){_0x261a64['push'](_0x261a64['shift']());}};_0x11fcf4(++_0x56415a);}(_0xfc71,0xd3));var _0x1fc7=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0xfc71[_0x41c381];return _0x427981;};'use strict';var multer=require('multer');var util=require(_0x1fc7('0x0'));var path=require(_0x1fc7('0x1'));var timeout=require(_0x1fc7('0x2'));var express=require('express');var router=express[_0x1fc7('0x3')]();var fs_extra=require(_0x1fc7('0x4'));var auth=require(_0x1fc7('0x5'));var interaction=require(_0x1fc7('0x6'));var config=require(_0x1fc7('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1fc7('0x8')]);router[_0x1fc7('0x9')]('/:id',auth[_0x1fc7('0xa')](),controller[_0x1fc7('0xb')]);router[_0x1fc7('0xc')]('/',auth[_0x1fc7('0xa')](),controller[_0x1fc7('0xd')]);router[_0x1fc7('0xe')]('/:id',auth[_0x1fc7('0xa')](),controller[_0x1fc7('0xf')]);router['delete']('/:id',auth[_0x1fc7('0xa')](),controller[_0x1fc7('0x10')]);module[_0x1fc7('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 0b7473d..b88c8ff 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 _0x53a6=['DATE','STRING','INTEGER','sequelize'];(function(_0x243243,_0x448f1a){var _0x3c3a78=function(_0x27a7e9){while(--_0x27a7e9){_0x243243['push'](_0x243243['shift']());}};_0x3c3a78(++_0x448f1a);}(_0x53a6,0x18f));var _0x653a=function(_0x58d89e,_0x532333){_0x58d89e=_0x58d89e-0x0;var _0x572cb5=_0x53a6[_0x58d89e];return _0x572cb5;};'use strict';var Sequelize=require(_0x653a('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x653a('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x653a('0x2')]},'src':{'type':Sequelize[_0x653a('0x2')]},'dst':{'type':Sequelize[_0x653a('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x653a('0x2')]},'dstchannel':{'type':Sequelize[_0x653a('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x653a('0x2')]},'amaflags':{'type':Sequelize[_0x653a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x653a('0x2')]},'userfield':{'type':Sequelize[_0x653a('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x653a('0x2')]},'sequence':{'type':Sequelize[_0x653a('0x2')]},'peeraccount':{'type':Sequelize[_0x653a('0x2')]},'type':{'type':Sequelize[_0x653a('0x2')]},'tag':{'type':Sequelize[_0x653a('0x2')]}};
\ No newline at end of file
+var _0x36f9=['INTEGER','sequelize','DATE','STRING'];(function(_0x5be83a,_0x4578a8){var _0x44d447=function(_0x533b2e){while(--_0x533b2e){_0x5be83a['push'](_0x5be83a['shift']());}};_0x44d447(++_0x4578a8);}(_0x36f9,0x151));var _0x936f=function(_0x44257e,_0x428c8f){_0x44257e=_0x44257e-0x0;var _0x185d78=_0x36f9[_0x44257e];return _0x185d78;};'use strict';var Sequelize=require(_0x936f('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x936f('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x936f('0x2')]},'dst':{'type':Sequelize[_0x936f('0x2')]},'dcontext':{'type':Sequelize[_0x936f('0x2')]},'channel':{'type':Sequelize[_0x936f('0x2')]},'dstchannel':{'type':Sequelize[_0x936f('0x2')]},'lastapp':{'type':Sequelize[_0x936f('0x2')]},'lastdata':{'type':Sequelize[_0x936f('0x2')]},'duration':{'type':Sequelize[_0x936f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x936f('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x936f('0x2')]},'amaflags':{'type':Sequelize[_0x936f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x936f('0x2')]},'uniqueid':{'type':Sequelize[_0x936f('0x2')]},'linkedid':{'type':Sequelize[_0x936f('0x2')]},'sequence':{'type':Sequelize[_0x936f('0x2')]},'peeraccount':{'type':Sequelize[_0x936f('0x2')]},'type':{'type':Sequelize[_0x936f('0x2')]},'tag':{'type':Sequelize[_0x936f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index e022eeb..6fa1058 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 _0x3435=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','count','includeAll','include','findAll','catch','params','rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','send','map','fieldName','type','key','name','query','keys'];(function(_0x497d3c,_0x2205fa){var _0x3174ac=function(_0xbcf466){while(--_0xbcf466){_0x497d3c['push'](_0x497d3c['shift']());}};_0x3174ac(++_0x2205fa);}(_0x3435,0xfa));var _0x5343=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x3435[_0x46ae5a];return _0x434986;};'use strict';var emlformat=require(_0x5343('0x0'));var rimraf=require(_0x5343('0x1'));var zipdir=require(_0x5343('0x2'));var jsonpatch=require(_0x5343('0x3'));var rp=require(_0x5343('0x4'));var moment=require(_0x5343('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5343('0x6'));var util=require(_0x5343('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5343('0x8'));var ejs=require(_0x5343('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5343('0xa'));var crypto=require(_0x5343('0xb'));var jsforce=require(_0x5343('0xc'));var deskjs=require(_0x5343('0xd'));var toCsv=require(_0x5343('0x8'));var querystring=require('querystring');var Papa=require(_0x5343('0xe'));var Redis=require('ioredis');var authService=require(_0x5343('0xf'));var qs=require(_0x5343('0x10'));var as=require(_0x5343('0x11'));var hardwareService=require(_0x5343('0x12'));var logger=require(_0x5343('0x13'))('api');var utils=require(_0x5343('0x14'));var config=require(_0x5343('0x15'));var licenseUtil=require(_0x5343('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ddeb7,_0x5f473f){_0x5f473f=_0x5f473f||0xcc;return function(_0x82074d){if(_0x82074d){return _0x2ddeb7[_0x5343('0x17')](_0x5f473f);}return _0x2ddeb7['status'](_0x5f473f)[_0x5343('0x18')]();};}function respondWithResult(_0x4cdfae,_0x13066f){_0x13066f=_0x13066f||0xc8;return function(_0x46c3d7){if(_0x46c3d7){return _0x4cdfae[_0x5343('0x19')](_0x13066f)[_0x5343('0x1a')](_0x46c3d7);}};}function respondWithFilteredResult(_0x4dbff1,_0x446e90){return function(_0x588a96){if(_0x588a96){var _0x1df724=typeof _0x446e90[_0x5343('0x1b')]===_0x5343('0x1c')&&typeof _0x446e90[_0x5343('0x1d')]===_0x5343('0x1c');var _0x4b5852=_0x588a96['count'];var _0x432992=_0x1df724?0x0:_0x446e90[_0x5343('0x1b')];var _0x1f5098=_0x1df724?_0x588a96['count']:_0x446e90[_0x5343('0x1b')]+_0x446e90[_0x5343('0x1d')];var _0x376c35;if(_0x1f5098>=_0x4b5852){_0x1f5098=_0x4b5852;_0x376c35=0xc8;}else{_0x376c35=0xce;}_0x4dbff1[_0x5343('0x19')](_0x376c35);return _0x4dbff1[_0x5343('0x1e')](_0x5343('0x1f'),_0x432992+'-'+_0x1f5098+'/'+_0x4b5852)[_0x5343('0x1a')](_0x588a96);}return null;};}function patchUpdates(_0x40ba38){return function(_0x35d41d){try{jsonpatch['apply'](_0x35d41d,_0x40ba38,!![]);}catch(_0x287304){return BPromise[_0x5343('0x20')](_0x287304);}return _0x35d41d[_0x5343('0x21')]();};}function saveUpdates(_0x42f92d,_0xd95a5b){return function(_0x4e7c0f){if(_0x4e7c0f){return _0x4e7c0f[_0x5343('0x22')](_0x42f92d)[_0x5343('0x23')](function(_0x24c250){return _0x24c250;});}return null;};}function removeEntity(_0x380aae,_0x290ce8){return function(_0x486597){if(_0x486597){return _0x486597[_0x5343('0x24')]()[_0x5343('0x23')](function(){_0x380aae['status'](0xcc)[_0x5343('0x18')]();});}};}function handleEntityNotFound(_0x96bbf6,_0x1ab5eb){return function(_0x5e4344){if(!_0x5e4344){_0x96bbf6['sendStatus'](0x194);}return _0x5e4344;};}function handleError(_0x462cb6,_0x5871de){_0x5871de=_0x5871de||0x1f4;return function(_0x14d05a){logger['error'](_0x14d05a[_0x5343('0x25')]);if(_0x14d05a['name']){delete _0x14d05a['name'];}_0x462cb6[_0x5343('0x19')](_0x5871de)[_0x5343('0x26')](_0x14d05a);};}exports['index']=function(_0x5d597e,_0x1202bb){var _0x5d0853={},_0x2ed8c9={},_0x47d49a={'count':0x0,'rows':[]};var _0x5c689e=_[_0x5343('0x27')](db['Cdr']['rawAttributes'],function(_0x125e4c){return{'name':_0x125e4c[_0x5343('0x28')],'type':_0x125e4c[_0x5343('0x29')][_0x5343('0x2a')]};});_0x2ed8c9['model']=_['map'](_0x5c689e,_0x5343('0x2b'));_0x2ed8c9[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x5d597e[_0x5343('0x2c')]);_0x2ed8c9[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],_0x2ed8c9[_0x5343('0x2c')]);_0x5d0853[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x2ed8c9[_0x5343('0x30')],qs[_0x5343('0x32')](_0x5d597e['query']['fields']));_0x5d0853[_0x5343('0x31')]=_0x5d0853[_0x5343('0x31')]['length']?_0x5d0853[_0x5343('0x31')]:_0x2ed8c9['model'];if(!_0x5d597e[_0x5343('0x2c')][_0x5343('0x33')](_0x5343('0x34'))){_0x5d0853[_0x5343('0x1d')]=qs['limit'](_0x5d597e['query'][_0x5343('0x1d')]);_0x5d0853['offset']=qs[_0x5343('0x1b')](_0x5d597e[_0x5343('0x2c')]['offset']);}_0x5d0853[_0x5343('0x35')]=qs['sort'](_0x5d597e['query'][_0x5343('0x36')]);_0x5d0853[_0x5343('0x37')]=qs[_0x5343('0x2e')](_[_0x5343('0x38')](_0x5d597e['query'],_0x2ed8c9['filters']),_0x5c689e);if(_0x5d597e['query']['filter']){_0x5d0853[_0x5343('0x37')]=_[_0x5343('0x39')](_0x5d0853[_0x5343('0x37')],{'$or':_[_0x5343('0x27')](_0x5c689e,function(_0x3c517a){if(_0x3c517a[_0x5343('0x29')]!==_0x5343('0x3a')){var _0x4d2951={};_0x4d2951[_0x3c517a[_0x5343('0x2b')]]={'$like':'%'+_0x5d597e['query'][_0x5343('0x3b')]+'%'};return _0x4d2951;}})});}_0x5d0853=_[_0x5343('0x39')]({},_0x5d0853,_0x5d597e[_0x5343('0x3c')]);var _0x2f004a={'where':_0x5d0853[_0x5343('0x37')]};return db[_0x5343('0x3d')][_0x5343('0x3e')](_0x2f004a)['then'](function(_0xb93d9){_0x47d49a['count']=_0xb93d9;if(_0x5d597e[_0x5343('0x2c')][_0x5343('0x3f')]){_0x5d0853[_0x5343('0x40')]=[{'all':!![]}];}return db[_0x5343('0x3d')][_0x5343('0x41')](_0x5d0853);})[_0x5343('0x23')](function(_0x2c75bd){_0x47d49a['rows']=_0x2c75bd;return _0x47d49a;})[_0x5343('0x23')](respondWithFilteredResult(_0x1202bb,_0x5d0853))[_0x5343('0x42')](handleError(_0x1202bb,null));};exports['show']=function(_0x41df61,_0x16c880){var _0x4c576d={'raw':!![],'where':{'id':_0x41df61[_0x5343('0x43')]['id']}},_0x53c3c7={};_0x53c3c7[_0x5343('0x30')]=_[_0x5343('0x2d')](db['Cdr'][_0x5343('0x44')]);_0x53c3c7[_0x5343('0x2c')]=_[_0x5343('0x2d')](_0x41df61[_0x5343('0x2c')]);_0x53c3c7[_0x5343('0x2e')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],_0x53c3c7['query']);_0x4c576d[_0x5343('0x31')]=_[_0x5343('0x2f')](_0x53c3c7[_0x5343('0x30')],qs[_0x5343('0x32')](_0x41df61[_0x5343('0x2c')][_0x5343('0x32')]));_0x4c576d[_0x5343('0x31')]=_0x4c576d[_0x5343('0x31')][_0x5343('0x45')]?_0x4c576d[_0x5343('0x31')]:_0x53c3c7[_0x5343('0x30')];if(_0x41df61[_0x5343('0x2c')][_0x5343('0x3f')]){_0x4c576d[_0x5343('0x40')]=[{'all':!![]}];}_0x4c576d=_[_0x5343('0x39')]({},_0x4c576d,_0x41df61['options']);return db[_0x5343('0x3d')][_0x5343('0x46')](_0x4c576d)['then'](handleEntityNotFound(_0x16c880,null))[_0x5343('0x23')](respondWithResult(_0x16c880,null))[_0x5343('0x42')](handleError(_0x16c880,null));};exports[_0x5343('0x47')]=function(_0x1da1b7,_0x194316){return db['Cdr'][_0x5343('0x47')](_0x1da1b7['body'],{})['then'](respondWithResult(_0x194316,0xc9))[_0x5343('0x42')](handleError(_0x194316,null));};exports[_0x5343('0x22')]=function(_0x10329c,_0x1cd4ed){if(_0x10329c['body']['id']){delete _0x10329c[_0x5343('0x48')]['id'];}return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x10329c[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cd4ed,null))[_0x5343('0x23')](saveUpdates(_0x10329c[_0x5343('0x48')],null))[_0x5343('0x23')](respondWithResult(_0x1cd4ed,null))[_0x5343('0x42')](handleError(_0x1cd4ed,null));};exports[_0x5343('0x24')]=function(_0x566d71,_0x1cbf7c){return db[_0x5343('0x3d')][_0x5343('0x46')]({'where':{'id':_0x566d71[_0x5343('0x43')]['id']}})[_0x5343('0x23')](handleEntityNotFound(_0x1cbf7c,null))[_0x5343('0x23')](removeEntity(_0x1cbf7c,null))[_0x5343('0x42')](handleError(_0x1cbf7c,null));};exports[_0x5343('0x49')]=function(_0x3b3c64,_0xad51f4){return db['Cdr'][_0x5343('0x49')]()['then'](respondWithResult(_0xad51f4,null))['catch'](handleError(_0xad51f4,null));};
\ No newline at end of file
+var _0x85d0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x85d0,0x164));var _0x085d=function(_0x2fca78,_0x19171a){_0x2fca78=_0x2fca78-0x0;var _0x41c8a6=_0x85d0[_0x2fca78];return _0x41c8a6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=_['map'](db[_0x085d('0x2a')][_0x085d('0x2b')],function(_0x494070){return{'name':_0x494070[_0x085d('0x2c')],'type':_0x494070[_0x085d('0x2d')]['key']};});_0x2eae2c[_0x085d('0x2e')]=_[_0x085d('0x2f')](_0x26aa90,_0x085d('0x27'));_0x2eae2c['query']=_[_0x085d('0x30')](_0x3faf6b[_0x085d('0x31')]);_0x2eae2c[_0x085d('0x32')]=_['intersection'](_0x2eae2c[_0x085d('0x2e')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x33')]=_[_0x085d('0x34')](_0x2eae2c[_0x085d('0x2e')],qs[_0x085d('0x35')](_0x3faf6b['query'][_0x085d('0x35')]));_0x2f670c[_0x085d('0x33')]=_0x2f670c[_0x085d('0x33')][_0x085d('0x36')]?_0x2f670c['attributes']:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x31')][_0x085d('0x37')](_0x085d('0x38'))){_0x2f670c[_0x085d('0x1b')]=qs[_0x085d('0x1b')](_0x3faf6b[_0x085d('0x31')][_0x085d('0x1b')]);_0x2f670c[_0x085d('0x1a')]=qs[_0x085d('0x1a')](_0x3faf6b['query'][_0x085d('0x1a')]);}_0x2f670c[_0x085d('0x39')]=qs['sort'](_0x3faf6b[_0x085d('0x31')]['sort']);_0x2f670c[_0x085d('0x3a')]=qs[_0x085d('0x32')](_['pick'](_0x3faf6b[_0x085d('0x31')],_0x2eae2c[_0x085d('0x32')]),_0x26aa90);if(_0x3faf6b[_0x085d('0x31')][_0x085d('0x3b')]){_0x2f670c[_0x085d('0x3a')]=_['merge'](_0x2f670c[_0x085d('0x3a')],{'$or':_['map'](_0x26aa90,function(_0x5d52be){if(_0x5d52be[_0x085d('0x2d')]!==_0x085d('0x3c')){var _0x31ee22={};_0x31ee22[_0x5d52be[_0x085d('0x27')]]={'$like':'%'+_0x3faf6b[_0x085d('0x31')]['filter']+'%'};return _0x31ee22;}})});}_0x2f670c=_[_0x085d('0x3d')]({},_0x2f670c,_0x3faf6b['options']);var _0x3a8646={'where':_0x2f670c[_0x085d('0x3a')]};return db[_0x085d('0x2a')]['count'](_0x3a8646)[_0x085d('0x24')](function(_0x55d81a){_0x3f905d[_0x085d('0x1d')]=_0x55d81a;if(_0x3faf6b[_0x085d('0x31')]['includeAll']){_0x2f670c[_0x085d('0x3e')]=[{'all':!![]}];}return db[_0x085d('0x2a')][_0x085d('0x3f')](_0x2f670c);})['then'](function(_0x56428e){_0x3f905d[_0x085d('0x40')]=_0x56428e;return _0x3f905d;})[_0x085d('0x24')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x41')](handleError(_0x5c7849,null));};exports[_0x085d('0x42')]=function(_0x177f7d,_0x367a32){var _0x27e1c7={'raw':!![],'where':{'id':_0x177f7d[_0x085d('0x43')]['id']}},_0x120980={};_0x120980[_0x085d('0x2e')]=_['keys'](db['Cdr'][_0x085d('0x2b')]);_0x120980[_0x085d('0x31')]=_[_0x085d('0x30')](_0x177f7d[_0x085d('0x31')]);_0x120980[_0x085d('0x32')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],_0x120980[_0x085d('0x31')]);_0x27e1c7[_0x085d('0x33')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],qs['fields'](_0x177f7d[_0x085d('0x31')][_0x085d('0x35')]));_0x27e1c7[_0x085d('0x33')]=_0x27e1c7[_0x085d('0x33')][_0x085d('0x36')]?_0x27e1c7['attributes']:_0x120980[_0x085d('0x2e')];if(_0x177f7d['query'][_0x085d('0x44')]){_0x27e1c7['include']=[{'all':!![]}];}_0x27e1c7=_['merge']({},_0x27e1c7,_0x177f7d[_0x085d('0x45')]);return db[_0x085d('0x2a')][_0x085d('0x46')](_0x27e1c7)[_0x085d('0x24')](handleEntityNotFound(_0x367a32,null))[_0x085d('0x24')](respondWithResult(_0x367a32,null))['catch'](handleError(_0x367a32,null));};exports['create']=function(_0x547723,_0x580b91){return db['Cdr'][_0x085d('0x47')](_0x547723[_0x085d('0x48')],{})['then'](respondWithResult(_0x580b91,0xc9))[_0x085d('0x41')](handleError(_0x580b91,null));};exports['update']=function(_0x5df4cf,_0x415a4b){if(_0x5df4cf[_0x085d('0x48')]['id']){delete _0x5df4cf[_0x085d('0x48')]['id'];}return db[_0x085d('0x2a')]['find']({'where':{'id':_0x5df4cf[_0x085d('0x43')]['id']}})['then'](handleEntityNotFound(_0x415a4b,null))[_0x085d('0x24')](saveUpdates(_0x5df4cf[_0x085d('0x48')],null))['then'](respondWithResult(_0x415a4b,null))[_0x085d('0x41')](handleError(_0x415a4b,null));};exports[_0x085d('0x25')]=function(_0x298f6f,_0x37b56c){return db['Cdr'][_0x085d('0x46')]({'where':{'id':_0x298f6f['params']['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x37b56c,null))['then'](removeEntity(_0x37b56c,null))['catch'](handleError(_0x37b56c,null));};exports[_0x085d('0x49')]=function(_0x41e3e0,_0x236368){return db[_0x085d('0x2a')][_0x085d('0x49')]()[_0x085d('0x24')](respondWithResult(_0x236368,null))[_0x085d('0x41')](handleError(_0x236368,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index d8fed5e..fbc0598 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(_0x39cf37,_0x4dd4ab){var _0x310d01=function(_0x548e3a){while(--_0x548e3a){_0x39cf37['push'](_0x39cf37['shift']());}};_0x310d01(++_0x4dd4ab);}(_0x7a54,0x106));var _0x47a5=function(_0xbdd2ee,_0x3c6be1){_0xbdd2ee=_0xbdd2ee-0x0;var _0x3b9fe4=_0x7a54[_0xbdd2ee];return _0x3b9fe4;};'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(_0x214566,_0x37b582){var _0x201a23=function(_0x2c245f){while(--_0x2c245f){_0x214566['push'](_0x214566['shift']());}};_0x201a23(++_0x37b582);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 5dbbc05..5539dc9 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 _0xc16b=['moment','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x37af2e,_0x355e49){var _0x357f12=function(_0x40671c){while(--_0x40671c){_0x37af2e['push'](_0x37af2e['shift']());}};_0x357f12(++_0x355e49);}(_0xc16b,0xb2));var _0xbc16=function(_0xe391aa,_0x255528){_0xe391aa=_0xe391aa-0x0;var _0x793c4d=_0xc16b[_0xe391aa];return _0x793c4d;};'use strict';var _=require(_0xbc16('0x0'));var util=require(_0xbc16('0x1'));var moment=require(_0xbc16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc16('0x3'));var logger=require('../../config/logger')(_0xbc16('0x4'));var config=require(_0xbc16('0x5'));var jayson=require(_0xbc16('0x6'));var client=jayson['client'][_0xbc16('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x490598,_0x528309,_0x1ab9d2){return new BPromise(function(_0x126312,_0x16ce18){return client[_0xbc16('0x8')](_0x490598,_0x1ab9d2)[_0xbc16('0x9')](function(_0x2c2a35){logger[_0xbc16('0xa')]('Cdr,\x20%s,\x20%s',_0x528309,_0xbc16('0xb'));logger[_0xbc16('0xc')](_0xbc16('0xd'),_0x528309,'request\x20sent',JSON['stringify'](_0x2c2a35));if(_0x2c2a35[_0xbc16('0xe')]){if(_0x2c2a35[_0xbc16('0xe')][_0xbc16('0xf')]===0x1f4){logger['error'](_0xbc16('0x10'),_0x528309,_0x2c2a35[_0xbc16('0xe')][_0xbc16('0x11')]);return _0x16ce18(_0x2c2a35['error'][_0xbc16('0x11')]);}logger[_0xbc16('0xe')](_0xbc16('0x10'),_0x528309,_0x2c2a35[_0xbc16('0xe')]['message']);return _0x126312(_0x2c2a35['error'][_0xbc16('0x11')]);}else{logger[_0xbc16('0xa')](_0xbc16('0x10'),_0x528309,_0xbc16('0xb'));_0x126312(_0x2c2a35[_0xbc16('0x12')][_0xbc16('0x11')]);}})[_0xbc16('0x13')](function(_0x2405a9){logger[_0xbc16('0xe')]('Cdr,\x20%s,\x20%s',_0x528309,_0x2405a9);_0x16ce18(_0x2405a9);});});}
\ No newline at end of file
+var _0xcf78=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','lodash'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xcf78,0x68));var _0x8cf7=function(_0x231091,_0x319528){_0x231091=_0x231091-0x0;var _0x2eace3=_0xcf78[_0x231091];return _0x2eace3;};'use strict';var _=require(_0x8cf7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8cf7('0x1'));var rs=require(_0x8cf7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cf7('0x3'))['db'];var utils=require(_0x8cf7('0x4'));var logger=require(_0x8cf7('0x5'))(_0x8cf7('0x6'));var config=require(_0x8cf7('0x7'));var jayson=require(_0x8cf7('0x8'));var client=jayson[_0x8cf7('0x9')][_0x8cf7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41f126,_0x4840b9,_0x53a575){return new BPromise(function(_0x55e5dd,_0x4414c1){return client[_0x8cf7('0xb')](_0x41f126,_0x53a575)[_0x8cf7('0xc')](function(_0x21ea1e){logger[_0x8cf7('0xd')]('Cdr,\x20%s,\x20%s',_0x4840b9,_0x8cf7('0xe'));logger[_0x8cf7('0xf')](_0x8cf7('0x10'),_0x4840b9,_0x8cf7('0xe'),JSON[_0x8cf7('0x11')](_0x21ea1e));if(_0x21ea1e[_0x8cf7('0x12')]){if(_0x21ea1e[_0x8cf7('0x12')]['code']===0x1f4){logger[_0x8cf7('0x12')](_0x8cf7('0x13'),_0x4840b9,_0x21ea1e[_0x8cf7('0x12')][_0x8cf7('0x14')]);return _0x4414c1(_0x21ea1e['error'][_0x8cf7('0x14')]);}logger['error'](_0x8cf7('0x13'),_0x4840b9,_0x21ea1e[_0x8cf7('0x12')]['message']);return _0x55e5dd(_0x21ea1e[_0x8cf7('0x12')][_0x8cf7('0x14')]);}else{logger[_0x8cf7('0xd')]('Cdr,\x20%s,\x20%s',_0x4840b9,_0x8cf7('0xe'));_0x55e5dd(_0x21ea1e['result'][_0x8cf7('0x14')]);}})['catch'](function(_0x3e20ab){logger[_0x8cf7('0x12')]('Cdr,\x20%s,\x20%s',_0x4840b9,_0x3e20ab);_0x4414c1(_0x3e20ab);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 386e85f..d2f1b61 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(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x39ce6f,_0x9b38dc){var _0x5e9e04=function(_0x8b9d39){while(--_0x8b9d39){_0x39ce6f['push'](_0x39ce6f['shift']());}};_0x5e9e04(++_0x9b38dc);}(_0xb10b,0x12a));var _0xbb10=function(_0x5de818,_0x7c4485){_0x5de818=_0x5de818-0x0;var _0x345670=_0xb10b[_0x5de818];return _0x345670;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 2aa41e2..04e38ec 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 _0x5226=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x2646ad,_0x2915ba){var _0x350cbb=function(_0x48a62c){while(--_0x48a62c){_0x2646ad['push'](_0x2646ad['shift']());}};_0x350cbb(++_0x2915ba);}(_0x5226,0x1b2));var _0x6522=function(_0x3c538f,_0x467bbf){_0x3c538f=_0x3c538f-0x0;var _0x44b0a8=_0x5226[_0x3c538f];return _0x44b0a8;};'use strict';var Sequelize=require(_0x6522('0x0'));module[_0x6522('0x1')]={'priority':{'type':Sequelize[_0x6522('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6522('0x3')],'allowNull':![],'defaultValue':_0x6522('0x4')},'appdata':{'type':Sequelize[_0x6522('0x5')]()},'description':{'type':Sequelize[_0x6522('0x3')]},'interval':{'type':Sequelize[_0x6522('0x3')],'defaultValue':_0x6522('0x6')}};
\ No newline at end of file
+var _0x2404=['TEXT','STRING','*,*,*,*','sequelize','exports','noop'];(function(_0x3c8914,_0x362abe){var _0x14a4d0=function(_0x3b7352){while(--_0x3b7352){_0x3c8914['push'](_0x3c8914['shift']());}};_0x14a4d0(++_0x362abe);}(_0x2404,0x189));var _0x4240=function(_0x4ad34f,_0x275a71){_0x4ad34f=_0x4ad34f-0x0;var _0x1b6e04=_0x2404[_0x4ad34f];return _0x1b6e04;};'use strict';var Sequelize=require(_0x4240('0x0'));module[_0x4240('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4240('0x2')},'appdata':{'type':Sequelize[_0x4240('0x3')]()},'description':{'type':Sequelize[_0x4240('0x4')]},'interval':{'type':Sequelize[_0x4240('0x4')],'defaultValue':_0x4240('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index b6cd8cd..2d954df 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 _0xc2af=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','update','params','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0x9c123e,_0x2c8bff){var _0x2157df=function(_0x13080a){while(--_0x13080a){_0x9c123e['push'](_0x9c123e['shift']());}};_0x2157df(++_0x2c8bff);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x1cbc64,_0x55fecc){_0x1cbc64=_0x1cbc64-0x0;var _0x1a601f=_0xc2af[_0x1cbc64];return _0x1a601f;};'use strict';var emlformat=require(_0xfc2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc2a('0x2'));var moment=require(_0xfc2a('0x3'));var BPromise=require(_0xfc2a('0x4'));var Mustache=require(_0xfc2a('0x5'));var util=require(_0xfc2a('0x6'));var path=require(_0xfc2a('0x7'));var sox=require(_0xfc2a('0x8'));var csv=require(_0xfc2a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc2a('0xa'));var _=require('lodash');var squel=require(_0xfc2a('0xb'));var crypto=require('crypto');var jsforce=require(_0xfc2a('0xc'));var deskjs=require(_0xfc2a('0xd'));var toCsv=require(_0xfc2a('0x9'));var querystring=require(_0xfc2a('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfc2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc2a('0x11'));var logger=require(_0xfc2a('0x12'))(_0xfc2a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc2a('0x14'));var db=require(_0xfc2a('0x15'))['db'];function respondWithStatusCode(_0x771766,_0x41395e){_0x41395e=_0x41395e||0xcc;return function(_0x268993){if(_0x268993){return _0x771766[_0xfc2a('0x16')](_0x41395e);}return _0x771766[_0xfc2a('0x17')](_0x41395e)[_0xfc2a('0x18')]();};}function respondWithResult(_0xe4b058,_0x55574a){_0x55574a=_0x55574a||0xc8;return function(_0x4e6b7e){if(_0x4e6b7e){return _0xe4b058[_0xfc2a('0x17')](_0x55574a)[_0xfc2a('0x19')](_0x4e6b7e);}};}function respondWithFilteredResult(_0x594a59,_0x12dd07){return function(_0x2f311c){if(_0x2f311c){var _0x21654f=typeof _0x12dd07[_0xfc2a('0x1a')]===_0xfc2a('0x1b')&&typeof _0x12dd07[_0xfc2a('0x1c')]===_0xfc2a('0x1b');var _0x678f8d=_0x2f311c[_0xfc2a('0x1d')];var _0x1e1524=_0x21654f?0x0:_0x12dd07[_0xfc2a('0x1a')];var _0x39bcb2=_0x21654f?_0x2f311c[_0xfc2a('0x1d')]:_0x12dd07['offset']+_0x12dd07[_0xfc2a('0x1c')];var _0x15ff6d;if(_0x39bcb2>=_0x678f8d){_0x39bcb2=_0x678f8d;_0x15ff6d=0xc8;}else{_0x15ff6d=0xce;}_0x594a59['status'](_0x15ff6d);return _0x594a59[_0xfc2a('0x1e')]('Content-Range',_0x1e1524+'-'+_0x39bcb2+'/'+_0x678f8d)['json'](_0x2f311c);}return null;};}function patchUpdates(_0x3e88fe){return function(_0x2b7f5c){try{jsonpatch[_0xfc2a('0x1f')](_0x2b7f5c,_0x3e88fe,!![]);}catch(_0x40ed0b){return BPromise[_0xfc2a('0x20')](_0x40ed0b);}return _0x2b7f5c['save']();};}function saveUpdates(_0x722009,_0x4908d7){return function(_0x5432f2){if(_0x5432f2){return _0x5432f2['update'](_0x722009)[_0xfc2a('0x21')](function(_0x57b67c){return _0x57b67c;});}return null;};}function removeEntity(_0x4d6b68,_0x43e237){return function(_0x10396d){if(_0x10396d){return _0x10396d[_0xfc2a('0x22')]()[_0xfc2a('0x21')](function(){_0x4d6b68['status'](0xcc)[_0xfc2a('0x18')]();});}};}function handleEntityNotFound(_0x192f0b,_0x33574a){return function(_0x5ea9f8){if(!_0x5ea9f8){_0x192f0b[_0xfc2a('0x16')](0x194);}return _0x5ea9f8;};}function handleError(_0x24ff4e,_0x542c9e){_0x542c9e=_0x542c9e||0x1f4;return function(_0x55c0bc){logger[_0xfc2a('0x23')](_0x55c0bc['stack']);if(_0x55c0bc[_0xfc2a('0x24')]){delete _0x55c0bc[_0xfc2a('0x24')];}_0x24ff4e[_0xfc2a('0x17')](_0x542c9e)[_0xfc2a('0x25')](_0x55c0bc);};}exports['show']=function(_0x4fe30d,_0x5f4165){var _0x3bf69f={'raw':!![],'where':{'id':_0x4fe30d['params']['id']}},_0x1f91f5={};_0x1f91f5[_0xfc2a('0x26')]=_[_0xfc2a('0x27')](db[_0xfc2a('0x28')][_0xfc2a('0x29')]);_0x1f91f5[_0xfc2a('0x2a')]=_[_0xfc2a('0x27')](_0x4fe30d[_0xfc2a('0x2a')]);_0x1f91f5[_0xfc2a('0x2b')]=_[_0xfc2a('0x2c')](_0x1f91f5['model'],_0x1f91f5[_0xfc2a('0x2a')]);_0x3bf69f[_0xfc2a('0x2d')]=_[_0xfc2a('0x2c')](_0x1f91f5[_0xfc2a('0x26')],qs[_0xfc2a('0x2e')](_0x4fe30d[_0xfc2a('0x2a')][_0xfc2a('0x2e')]));_0x3bf69f[_0xfc2a('0x2d')]=_0x3bf69f[_0xfc2a('0x2d')][_0xfc2a('0x2f')]?_0x3bf69f[_0xfc2a('0x2d')]:_0x1f91f5[_0xfc2a('0x26')];if(_0x4fe30d['query'][_0xfc2a('0x30')]){_0x3bf69f[_0xfc2a('0x31')]=[{'all':!![]}];}_0x3bf69f=_[_0xfc2a('0x32')]({},_0x3bf69f,_0x4fe30d[_0xfc2a('0x33')]);return db['ChatApplication'][_0xfc2a('0x34')](_0x3bf69f)['then'](handleEntityNotFound(_0x5f4165,null))[_0xfc2a('0x21')](respondWithResult(_0x5f4165,null))['catch'](handleError(_0x5f4165,null));};exports[_0xfc2a('0x35')]=function(_0x1a423d,_0x53491a){if(_0x1a423d['body']['id']){delete _0x1a423d['body']['id'];}return db['ChatApplication'][_0xfc2a('0x34')]({'where':{'id':_0x1a423d[_0xfc2a('0x36')]['id']}})['then'](handleEntityNotFound(_0x53491a,null))['then'](saveUpdates(_0x1a423d[_0xfc2a('0x37')],null))[_0xfc2a('0x21')](respondWithResult(_0x53491a,null))[_0xfc2a('0x38')](handleError(_0x53491a,null));};exports[_0xfc2a('0x22')]=function(_0x30a32a,_0x5dde47){return db[_0xfc2a('0x28')][_0xfc2a('0x34')]({'where':{'id':_0x30a32a['params']['id']}})[_0xfc2a('0x21')](handleEntityNotFound(_0x5dde47,null))[_0xfc2a('0x21')](removeEntity(_0x5dde47,null))[_0xfc2a('0x38')](handleError(_0x5dde47,null));};
\ No newline at end of file
+var _0x49e9=['count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','show','params','ChatApplication','rawAttributes','query','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit'];(function(_0x180432,_0x255ac1){var _0x3fc15e=function(_0x5c320c){while(--_0x5c320c){_0x180432['push'](_0x180432['shift']());}};_0x3fc15e(++_0x255ac1);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x949e('0x0'));var rimraf=require(_0x949e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x949e('0x2'));var rp=require(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x949e('0x5'));var path=require('path');var sox=require(_0x949e('0x6'));var csv=require(_0x949e('0x7'));var ejs=require(_0x949e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x949e('0x9'));var squel=require(_0x949e('0xa'));var crypto=require(_0x949e('0xb'));var jsforce=require(_0x949e('0xc'));var deskjs=require(_0x949e('0xd'));var toCsv=require(_0x949e('0x7'));var querystring=require(_0x949e('0xe'));var Papa=require('papaparse');var Redis=require(_0x949e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x949e('0x10'));var as=require(_0x949e('0x11'));var hardwareService=require(_0x949e('0x12'));var logger=require('../../config/logger')(_0x949e('0x13'));var utils=require(_0x949e('0x14'));var config=require(_0x949e('0x15'));var licenseUtil=require(_0x949e('0x16'));var db=require(_0x949e('0x17'))['db'];function respondWithStatusCode(_0x253d5e,_0x1871a5){_0x1871a5=_0x1871a5||0xcc;return function(_0x17d1f3){if(_0x17d1f3){return _0x253d5e[_0x949e('0x18')](_0x1871a5);}return _0x253d5e[_0x949e('0x19')](_0x1871a5)[_0x949e('0x1a')]();};}function respondWithResult(_0x7a8954,_0x3e0e54){_0x3e0e54=_0x3e0e54||0xc8;return function(_0x7f8be2){if(_0x7f8be2){return _0x7a8954[_0x949e('0x19')](_0x3e0e54)['json'](_0x7f8be2);}};}function respondWithFilteredResult(_0x257981,_0x3d81cd){return function(_0x587bff){if(_0x587bff){var _0xf1f41a=typeof _0x3d81cd['offset']===_0x949e('0x1b')&&typeof _0x3d81cd[_0x949e('0x1c')]==='undefined';var _0x37fd96=_0x587bff[_0x949e('0x1d')];var _0x43498d=_0xf1f41a?0x0:_0x3d81cd[_0x949e('0x1e')];var _0x20333c=_0xf1f41a?_0x587bff['count']:_0x3d81cd[_0x949e('0x1e')]+_0x3d81cd[_0x949e('0x1c')];var _0x476fa8;if(_0x20333c>=_0x37fd96){_0x20333c=_0x37fd96;_0x476fa8=0xc8;}else{_0x476fa8=0xce;}_0x257981[_0x949e('0x19')](_0x476fa8);return _0x257981[_0x949e('0x1f')](_0x949e('0x20'),_0x43498d+'-'+_0x20333c+'/'+_0x37fd96)[_0x949e('0x21')](_0x587bff);}return null;};}function patchUpdates(_0x2f21bd){return function(_0x104740){try{jsonpatch[_0x949e('0x22')](_0x104740,_0x2f21bd,!![]);}catch(_0x23fc20){return BPromise[_0x949e('0x23')](_0x23fc20);}return _0x104740[_0x949e('0x24')]();};}function saveUpdates(_0x1927ab,_0x199d53){return function(_0x2e81f2){if(_0x2e81f2){return _0x2e81f2['update'](_0x1927ab)[_0x949e('0x25')](function(_0x44ffb4){return _0x44ffb4;});}return null;};}function removeEntity(_0x5572ae,_0x48a1d1){return function(_0x23b38e){if(_0x23b38e){return _0x23b38e[_0x949e('0x26')]()[_0x949e('0x25')](function(){_0x5572ae[_0x949e('0x19')](0xcc)[_0x949e('0x1a')]();});}};}function handleEntityNotFound(_0x1185b3,_0x29e07b){return function(_0x255b11){if(!_0x255b11){_0x1185b3[_0x949e('0x18')](0x194);}return _0x255b11;};}function handleError(_0x20258c,_0x5dcc46){_0x5dcc46=_0x5dcc46||0x1f4;return function(_0x212224){logger[_0x949e('0x27')](_0x212224['stack']);if(_0x212224[_0x949e('0x28')]){delete _0x212224[_0x949e('0x28')];}_0x20258c['status'](_0x5dcc46)[_0x949e('0x29')](_0x212224);};}exports[_0x949e('0x2a')]=function(_0x5b9f28,_0x1867d9){var _0x5b2b0b={'raw':!![],'where':{'id':_0x5b9f28[_0x949e('0x2b')]['id']}},_0x5e6e34={};_0x5e6e34['model']=_['keys'](db[_0x949e('0x2c')][_0x949e('0x2d')]);_0x5e6e34[_0x949e('0x2e')]=_['keys'](_0x5b9f28['query']);_0x5e6e34['filters']=_['intersection'](_0x5e6e34[_0x949e('0x2f')],_0x5e6e34[_0x949e('0x2e')]);_0x5b2b0b[_0x949e('0x30')]=_[_0x949e('0x31')](_0x5e6e34['model'],qs[_0x949e('0x32')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x32')]));_0x5b2b0b['attributes']=_0x5b2b0b[_0x949e('0x30')][_0x949e('0x33')]?_0x5b2b0b[_0x949e('0x30')]:_0x5e6e34['model'];if(_0x5b9f28['query'][_0x949e('0x34')]){_0x5b2b0b[_0x949e('0x35')]=[{'all':!![]}];}_0x5b2b0b=_[_0x949e('0x36')]({},_0x5b2b0b,_0x5b9f28[_0x949e('0x37')]);return db['ChatApplication'][_0x949e('0x38')](_0x5b2b0b)[_0x949e('0x25')](handleEntityNotFound(_0x1867d9,null))[_0x949e('0x25')](respondWithResult(_0x1867d9,null))[_0x949e('0x39')](handleError(_0x1867d9,null));};exports[_0x949e('0x3a')]=function(_0x356eab,_0x3d84ba){if(_0x356eab[_0x949e('0x3b')]['id']){delete _0x356eab['body']['id'];}return db['ChatApplication'][_0x949e('0x38')]({'where':{'id':_0x356eab['params']['id']}})['then'](handleEntityNotFound(_0x3d84ba,null))[_0x949e('0x25')](saveUpdates(_0x356eab[_0x949e('0x3b')],null))[_0x949e('0x25')](respondWithResult(_0x3d84ba,null))[_0x949e('0x39')](handleError(_0x3d84ba,null));};exports[_0x949e('0x26')]=function(_0x461a8a,_0x3eaed5){return db[_0x949e('0x2c')][_0x949e('0x38')]({'where':{'id':_0x461a8a[_0x949e('0x2b')]['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x3eaed5,null))[_0x949e('0x25')](removeEntity(_0x3eaed5,null))[_0x949e('0x39')](handleError(_0x3eaed5,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 385f911..3e1b58e 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 _0x1d9d=['moment','bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x196189,_0x1a5b61){var _0x5a2bc1=function(_0x5e014b){while(--_0x5e014b){_0x196189['push'](_0x196189['shift']());}};_0x5a2bc1(++_0x1a5b61);}(_0x1d9d,0x6d));var _0xd1d9=function(_0x5afaea,_0x168909){_0x5afaea=_0x5afaea-0x0;var _0x1707e0=_0x1d9d[_0x5afaea];return _0x1707e0;};'use strict';var _=require(_0xd1d9('0x0'));var util=require(_0xd1d9('0x1'));var logger=require(_0xd1d9('0x2'))('api');var moment=require(_0xd1d9('0x3'));var BPromise=require(_0xd1d9('0x4'));var rp=require(_0xd1d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d9('0x6'));var config=require(_0xd1d9('0x7'));var attributes=require(_0xd1d9('0x8'));module[_0xd1d9('0x9')]=function(_0x5cc987,_0x286cd0){return _0x5cc987[_0xd1d9('0xa')](_0xd1d9('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd1d9('0xc'),'collate':_0xd1d9('0xd')});};
\ No newline at end of file
+var _0x85a8=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','ChatApplication','chat_applications'];(function(_0x12b9b7,_0x2a4948){var _0x1e2a73=function(_0x5e4965){while(--_0x5e4965){_0x12b9b7['push'](_0x12b9b7['shift']());}};_0x1e2a73(++_0x2a4948);}(_0x85a8,0xc6));var _0x885a=function(_0x1db176,_0xa98b8e){_0x1db176=_0x1db176-0x0;var _0xd09d79=_0x85a8[_0x1db176];return _0xd09d79;};'use strict';var _=require(_0x885a('0x0'));var util=require(_0x885a('0x1'));var logger=require('../../config/logger')(_0x885a('0x2'));var moment=require(_0x885a('0x3'));var BPromise=require(_0x885a('0x4'));var rp=require(_0x885a('0x5'));var fs=require('fs');var path=require(_0x885a('0x6'));var rimraf=require(_0x885a('0x7'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x885a('0x8')]=function(_0x12f4bb,_0x1d37a8){return _0x12f4bb[_0x885a('0x9')](_0x885a('0xa'),attributes,{'tableName':_0x885a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x885a('0xc'),'collate':_0x885a('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 8daaa50..4169278 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 _0x58e4=['../../config/utils','rpc','../../config/environment','client','http','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment','randomstring','ioredis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x58e4,0x188));var _0x458e=function(_0xeb27e7,_0x4ca640){_0xeb27e7=_0xeb27e7-0x0;var _0x281f7f=_0x58e4[_0xeb27e7];return _0x281f7f;};'use strict';var _=require('lodash');var util=require(_0x458e('0x0'));var moment=require(_0x458e('0x1'));var BPromise=require('bluebird');var rs=require(_0x458e('0x2'));var fs=require('fs');var Redis=require(_0x458e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x458e('0x4'));var logger=require('../../config/logger')(_0x458e('0x5'));var config=require(_0x458e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x458e('0x7')][_0x458e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52f085,_0x2028f6,_0x277249){return new BPromise(function(_0x4e2383,_0x50edc3){return client['request'](_0x52f085,_0x277249)[_0x458e('0x9')](function(_0x158ebc){logger[_0x458e('0xa')](_0x458e('0xb'),_0x2028f6,_0x458e('0xc'));logger[_0x458e('0xd')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x2028f6,_0x458e('0xc'),JSON['stringify'](_0x158ebc));if(_0x158ebc[_0x458e('0xe')]){if(_0x158ebc[_0x458e('0xe')][_0x458e('0xf')]===0x1f4){logger[_0x458e('0xe')](_0x458e('0xb'),_0x2028f6,_0x158ebc['error'][_0x458e('0x10')]);return _0x50edc3(_0x158ebc[_0x458e('0xe')][_0x458e('0x10')]);}logger[_0x458e('0xe')](_0x458e('0xb'),_0x2028f6,_0x158ebc[_0x458e('0xe')]['message']);return _0x4e2383(_0x158ebc[_0x458e('0xe')][_0x458e('0x10')]);}else{logger['info'](_0x458e('0xb'),_0x2028f6,_0x458e('0xc'));_0x4e2383(_0x158ebc[_0x458e('0x11')][_0x458e('0x10')]);}})['catch'](function(_0x2de057){logger['error'](_0x458e('0xb'),_0x2028f6,_0x2de057);_0x50edc3(_0x2de057);});});}
\ No newline at end of file
+var _0x8e21=['error','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x42f3a5,_0x3a4470){var _0x1a7d74=function(_0x43cc36){while(--_0x43cc36){_0x42f3a5['push'](_0x42f3a5['shift']());}};_0x1a7d74(++_0x3a4470);}(_0x8e21,0x1d0));var _0x18e2=function(_0xb65e77,_0x238c3d){_0xb65e77=_0xb65e77-0x0;var _0x38134b=_0x8e21[_0xb65e77];return _0x38134b;};'use strict';var _=require(_0x18e2('0x0'));var util=require(_0x18e2('0x1'));var moment=require(_0x18e2('0x2'));var BPromise=require(_0x18e2('0x3'));var rs=require(_0x18e2('0x4'));var fs=require('fs');var Redis=require(_0x18e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x18e2('0x6'));var logger=require(_0x18e2('0x7'))(_0x18e2('0x8'));var config=require(_0x18e2('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cc8c0,_0x5ee915,_0x3491c2){return new BPromise(function(_0x4eb63f,_0xc10ffe){return client['request'](_0x5cc8c0,_0x3491c2)['then'](function(_0x3170d6){logger[_0x18e2('0xa')]('ChatApplication,\x20%s,\x20%s',_0x5ee915,_0x18e2('0xb'));logger[_0x18e2('0xc')](_0x18e2('0xd'),_0x5ee915,_0x18e2('0xb'),JSON[_0x18e2('0xe')](_0x3170d6));if(_0x3170d6['error']){if(_0x3170d6['error'][_0x18e2('0xf')]===0x1f4){logger[_0x18e2('0x10')](_0x18e2('0x11'),_0x5ee915,_0x3170d6['error'][_0x18e2('0x12')]);return _0xc10ffe(_0x3170d6['error']['message']);}logger['error'](_0x18e2('0x11'),_0x5ee915,_0x3170d6[_0x18e2('0x10')][_0x18e2('0x12')]);return _0x4eb63f(_0x3170d6[_0x18e2('0x10')][_0x18e2('0x12')]);}else{logger[_0x18e2('0xa')](_0x18e2('0x11'),_0x5ee915,_0x18e2('0xb'));_0x4eb63f(_0x3170d6['result'][_0x18e2('0x12')]);}})[_0x18e2('0x13')](function(_0x1ffe66){logger[_0x18e2('0x10')](_0x18e2('0x11'),_0x5ee915,_0x1ffe66);_0xc10ffe(_0x1ffe66);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 2effbe7..e14ade8 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 _0x7b4a=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x43d42c,_0x463065){var _0x30bee9=function(_0x453f1c){while(--_0x453f1c){_0x43d42c['push'](_0x43d42c['shift']());}};_0x30bee9(++_0x463065);}(_0x7b4a,0x1df));var _0xa7b4=function(_0x3c3021,_0x189015){_0x3c3021=_0x3c3021-0x0;var _0x347432=_0x7b4a[_0x3c3021];return _0x347432;};'use strict';var multer=require(_0xa7b4('0x0'));var util=require('util');var path=require(_0xa7b4('0x1'));var timeout=require(_0xa7b4('0x2'));var express=require(_0xa7b4('0x3'));var router=express[_0xa7b4('0x4')]();var fs_extra=require(_0xa7b4('0x5'));var auth=require(_0xa7b4('0x6'));var interaction=require(_0xa7b4('0x7'));var config=require(_0xa7b4('0x8'));var controller=require(_0xa7b4('0x9'));router[_0xa7b4('0xa')](_0xa7b4('0xb'),auth[_0xa7b4('0xc')](),controller[_0xa7b4('0xd')]);router[_0xa7b4('0xe')](_0xa7b4('0xb'),auth['isAuthenticated'](),controller[_0xa7b4('0xf')]);router['delete'](_0xa7b4('0xb'),auth[_0xa7b4('0xc')](),controller[_0xa7b4('0x10')]);module[_0xa7b4('0x11')]=router;
\ No newline at end of file
+var _0xaf08=['destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','delete'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0xaf08,0x1be));var _0x8af0=function(_0x3dbd6d,_0x3ee9d7){_0x3dbd6d=_0x3dbd6d-0x0;var _0x1216f1=_0xaf08[_0x3dbd6d];return _0x1216f1;};'use strict';var multer=require(_0x8af0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8af0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8af0('0x2'));var auth=require(_0x8af0('0x3'));var interaction=require(_0x8af0('0x4'));var config=require('../../config/environment');var controller=require(_0x8af0('0x5'));router[_0x8af0('0x6')](_0x8af0('0x7'),auth['isAuthenticated'](),controller['show']);router['put'](_0x8af0('0x7'),auth[_0x8af0('0x8')](),controller['update']);router[_0x8af0('0x9')](_0x8af0('0x7'),auth[_0x8af0('0x8')](),controller[_0x8af0('0xa')]);module[_0x8af0('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 53b8f42..3c19cb0 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 _0xd9ce=['exports','STRING','BOOLEAN','sequelize'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0xd9ce,0xeb));var _0xed9c=function(_0x37fb3a,_0x5a14ee){_0x37fb3a=_0x37fb3a-0x0;var _0x1e5c8f=_0xd9ce[_0x37fb3a];return _0x1e5c8f;};'use strict';var Sequelize=require(_0xed9c('0x0'));module[_0xed9c('0x1')]={'name':{'type':Sequelize[_0xed9c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xed9c('0x2')]},'write':{'type':Sequelize[_0xed9c('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xf072=['exports','STRING','BOOLEAN','sequelize'];(function(_0x15ff2d,_0x14ee50){var _0x4ec84c=function(_0x2b54a3){while(--_0x2b54a3){_0x15ff2d['push'](_0x15ff2d['shift']());}};_0x4ec84c(++_0x14ee50);}(_0xf072,0x1cf));var _0x2f07=function(_0x44ab9d,_0x3d060c){_0x44ab9d=_0x44ab9d-0x0;var _0x279648=_0xf072[_0x44ab9d];return _0x279648;};'use strict';var Sequelize=require(_0x2f07('0x0'));module[_0x2f07('0x1')]={'name':{'type':Sequelize[_0x2f07('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x2f07('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index ee3b723..3085878 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 _0x5e4e=['removeMembers','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatGroup','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','catch','rawAttributes','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne'];(function(_0x2dab5a,_0xb1fc8d){var _0x1f4e38=function(_0x47a7df){while(--_0x47a7df){_0x2dab5a['push'](_0x2dab5a['shift']());}};_0x1f4e38(++_0xb1fc8d);}(_0x5e4e,0xbf));var _0xe5e4=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5e4e[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xe5e4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5e4('0x1'));var jsonpatch=require(_0xe5e4('0x2'));var rp=require(_0xe5e4('0x3'));var moment=require('moment');var BPromise=require(_0xe5e4('0x4'));var Mustache=require(_0xe5e4('0x5'));var util=require(_0xe5e4('0x6'));var path=require(_0xe5e4('0x7'));var sox=require(_0xe5e4('0x8'));var csv=require(_0xe5e4('0x9'));var ejs=require(_0xe5e4('0xa'));var fs=require('fs');var fs_extra=require(_0xe5e4('0xb'));var _=require(_0xe5e4('0xc'));var squel=require(_0xe5e4('0xd'));var crypto=require(_0xe5e4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe5e4('0xf'));var toCsv=require(_0xe5e4('0x9'));var querystring=require('querystring');var Papa=require(_0xe5e4('0x10'));var Redis=require(_0xe5e4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe5e4('0x12'));var as=require(_0xe5e4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5e4('0x14'))(_0xe5e4('0x15'));var utils=require(_0xe5e4('0x16'));var config=require(_0xe5e4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe5e4('0x18')]=_['defaults'](config[_0xe5e4('0x18')],{'host':_0xe5e4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5e4('0x18')]));require('./chatGroup.socket')[_0xe5e4('0x1a')](socket);function respondWithStatusCode(_0x48a0a4,_0x5c5953){_0x5c5953=_0x5c5953||0xcc;return function(_0x29fcab){if(_0x29fcab){return _0x48a0a4[_0xe5e4('0x1b')](_0x5c5953);}return _0x48a0a4[_0xe5e4('0x1c')](_0x5c5953)[_0xe5e4('0x1d')]();};}function respondWithResult(_0x149930,_0x2683b8){_0x2683b8=_0x2683b8||0xc8;return function(_0x1f9c72){if(_0x1f9c72){return _0x149930['status'](_0x2683b8)[_0xe5e4('0x1e')](_0x1f9c72);}};}function respondWithFilteredResult(_0x4f6b18,_0x2519a7){return function(_0x4cf0bd){if(_0x4cf0bd){var _0x4f18b3=typeof _0x2519a7[_0xe5e4('0x1f')]==='undefined'&&typeof _0x2519a7[_0xe5e4('0x20')]==='undefined';var _0x467cb1=_0x4cf0bd[_0xe5e4('0x21')];var _0x489aae=_0x4f18b3?0x0:_0x2519a7['offset'];var _0x31637d=_0x4f18b3?_0x4cf0bd[_0xe5e4('0x21')]:_0x2519a7[_0xe5e4('0x1f')]+_0x2519a7['limit'];var _0x19c6a4;if(_0x31637d>=_0x467cb1){_0x31637d=_0x467cb1;_0x19c6a4=0xc8;}else{_0x19c6a4=0xce;}_0x4f6b18['status'](_0x19c6a4);return _0x4f6b18[_0xe5e4('0x22')](_0xe5e4('0x23'),_0x489aae+'-'+_0x31637d+'/'+_0x467cb1)[_0xe5e4('0x1e')](_0x4cf0bd);}return null;};}function patchUpdates(_0x50ffcc){return function(_0x598418){try{jsonpatch[_0xe5e4('0x24')](_0x598418,_0x50ffcc,!![]);}catch(_0x5d7929){return BPromise[_0xe5e4('0x25')](_0x5d7929);}return _0x598418['save']();};}function saveUpdates(_0x285f2e,_0x30e1a8){return function(_0x35c0c5){if(_0x35c0c5){return _0x35c0c5[_0xe5e4('0x26')](_0x285f2e)[_0xe5e4('0x27')](function(_0xf4f9c1){return _0xf4f9c1;});}return null;};}function removeEntity(_0x3f567c,_0x738b8){return function(_0x1cf725){if(_0x1cf725){return _0x1cf725[_0xe5e4('0x28')]()[_0xe5e4('0x27')](function(){_0x3f567c[_0xe5e4('0x1c')](0xcc)[_0xe5e4('0x1d')]();});}};}function handleEntityNotFound(_0xd1d437,_0x4146de){return function(_0x1ad134){if(!_0x1ad134){_0xd1d437[_0xe5e4('0x1b')](0x194);}return _0x1ad134;};}function handleError(_0x1d260b,_0x3ba9e2){_0x3ba9e2=_0x3ba9e2||0x1f4;return function(_0x3252d6){logger[_0xe5e4('0x29')](_0x3252d6[_0xe5e4('0x2a')]);if(_0x3252d6[_0xe5e4('0x2b')]){delete _0x3252d6[_0xe5e4('0x2b')];}_0x1d260b[_0xe5e4('0x1c')](_0x3ba9e2)['send'](_0x3252d6);};}exports[_0xe5e4('0x2c')]=function(_0x1ffa81,_0x4c94eb){var _0x74a51f={},_0x2783ac={},_0x5aa1ec={'count':0x0,'rows':[]};var _0x3f4f33=_[_0xe5e4('0x2d')](db[_0xe5e4('0x2e')]['rawAttributes'],function(_0x20f83c){return{'name':_0x20f83c[_0xe5e4('0x2f')],'type':_0x20f83c[_0xe5e4('0x30')][_0xe5e4('0x31')]};});_0x2783ac[_0xe5e4('0x32')]=_[_0xe5e4('0x2d')](_0x3f4f33,_0xe5e4('0x2b'));_0x2783ac[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x1ffa81[_0xe5e4('0x33')]);_0x2783ac['filters']=_['intersection'](_0x2783ac[_0xe5e4('0x32')],_0x2783ac[_0xe5e4('0x33')]);_0x74a51f[_0xe5e4('0x35')]=_[_0xe5e4('0x36')](_0x2783ac[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x1ffa81['query'][_0xe5e4('0x37')]));_0x74a51f[_0xe5e4('0x35')]=_0x74a51f[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x74a51f['attributes']:_0x2783ac[_0xe5e4('0x32')];if(!_0x1ffa81['query'][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x74a51f[_0xe5e4('0x20')]=qs['limit'](_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x74a51f['offset']=qs[_0xe5e4('0x1f')](_0x1ffa81['query'][_0xe5e4('0x1f')]);}_0x74a51f[_0xe5e4('0x3b')]=qs[_0xe5e4('0x3c')](_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x74a51f['where']=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x1ffa81['query'],_0x2783ac[_0xe5e4('0x3d')]),_0x3f4f33);if(_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x3f')]){_0x74a51f['where']=_[_0xe5e4('0x40')](_0x74a51f[_0xe5e4('0x41')],{'$or':_[_0xe5e4('0x2d')](_0x3f4f33,function(_0x8a65f){if(_0x8a65f[_0xe5e4('0x30')]!==_0xe5e4('0x42')){var _0x34a5de={};_0x34a5de[_0x8a65f[_0xe5e4('0x2b')]]={'$like':'%'+_0x1ffa81['query'][_0xe5e4('0x3f')]+'%'};return _0x34a5de;}})});}_0x74a51f=_['merge']({},_0x74a51f,_0x1ffa81[_0xe5e4('0x43')]);var _0x4bc367={'where':_0x74a51f[_0xe5e4('0x41')]};return db[_0xe5e4('0x2e')][_0xe5e4('0x21')](_0x4bc367)[_0xe5e4('0x27')](function(_0x38e8f5){_0x5aa1ec[_0xe5e4('0x21')]=_0x38e8f5;if(_0x1ffa81[_0xe5e4('0x33')][_0xe5e4('0x44')]){_0x74a51f[_0xe5e4('0x45')]=[{'all':!![]}];}return db[_0xe5e4('0x2e')]['findAll'](_0x74a51f);})[_0xe5e4('0x27')](function(_0x5ae0ee){_0x5aa1ec['rows']=_0x5ae0ee;return _0x5aa1ec;})[_0xe5e4('0x27')](respondWithFilteredResult(_0x4c94eb,_0x74a51f))[_0xe5e4('0x46')](handleError(_0x4c94eb,null));};exports['show']=function(_0x33bd3f,_0x2d1be0){var _0x3b5b6b={'raw':!![],'where':{'id':_0x33bd3f['params']['id']}},_0x14a2e9={};_0x14a2e9[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db[_0xe5e4('0x2e')][_0xe5e4('0x47')]);_0x14a2e9['query']=_['keys'](_0x33bd3f[_0xe5e4('0x33')]);_0x14a2e9['filters']=_[_0xe5e4('0x36')](_0x14a2e9[_0xe5e4('0x32')],_0x14a2e9[_0xe5e4('0x33')]);_0x3b5b6b[_0xe5e4('0x35')]=_['intersection'](_0x14a2e9['model'],qs[_0xe5e4('0x37')](_0x33bd3f[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x3b5b6b[_0xe5e4('0x35')]=_0x3b5b6b[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x3b5b6b['attributes']:_0x14a2e9[_0xe5e4('0x32')];if(_0x33bd3f['query'][_0xe5e4('0x44')]){_0x3b5b6b[_0xe5e4('0x45')]=[{'all':!![]}];}_0x3b5b6b=_[_0xe5e4('0x40')]({},_0x3b5b6b,_0x33bd3f['options']);return db[_0xe5e4('0x2e')][_0xe5e4('0x48')](_0x3b5b6b)[_0xe5e4('0x27')](handleEntityNotFound(_0x2d1be0,null))['then'](respondWithResult(_0x2d1be0,null))['catch'](handleError(_0x2d1be0,null));};exports['create']=function(_0x44ec4b,_0x3948a3){return db[_0xe5e4('0x2e')][_0xe5e4('0x49')](_0x44ec4b[_0xe5e4('0x4a')],{})['then'](respondWithResult(_0x3948a3,0xc9))['catch'](handleError(_0x3948a3,null));};exports[_0xe5e4('0x26')]=function(_0x4a0081,_0x269434){if(_0x4a0081[_0xe5e4('0x4a')]['id']){delete _0x4a0081[_0xe5e4('0x4a')]['id'];}return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x4a0081[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x269434,null))[_0xe5e4('0x27')](saveUpdates(_0x4a0081['body'],null))[_0xe5e4('0x27')](respondWithResult(_0x269434,null))[_0xe5e4('0x46')](handleError(_0x269434,null));};exports[_0xe5e4('0x28')]=function(_0x436457,_0x399970){return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x436457[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x399970,null))[_0xe5e4('0x27')](removeEntity(_0x399970,null))[_0xe5e4('0x46')](handleError(_0x399970,null));};exports[_0xe5e4('0x4c')]=function(_0x416f87,_0x21efe7){return db[_0xe5e4('0x2e')][_0xe5e4('0x4c')]()[_0xe5e4('0x27')](respondWithResult(_0x21efe7,null))[_0xe5e4('0x46')](handleError(_0x21efe7,null));};exports[_0xe5e4('0x4d')]=function(_0xe9cf34,_0x5d0baa,_0x1d9c95){return db[_0xe5e4('0x4e')][_0xe5e4('0x21')]({'where':{'ChatGroupId':_0xe9cf34['params']['id'],'ToId':_0xe9cf34[_0xe5e4('0x4f')]['id'],'read':![]}})[_0xe5e4('0x27')](function(_0x1488c3){return{'id':_[_0xe5e4('0x50')](_0xe9cf34['params']['id']),'count':_0x1488c3};})['then'](respondWithResult(_0x5d0baa,null))[_0xe5e4('0x46')](handleError(_0x5d0baa,null));};exports[_0xe5e4('0x51')]=function(_0x89e5f9,_0x325732,_0x23e2a){return db['ChatGroup'][_0xe5e4('0x48')]({'where':{'id':_0x89e5f9[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x325732,null))[_0xe5e4('0x27')](function(_0x3fe061){if(_0x3fe061){return _0x3fe061[_0xe5e4('0x51')](_0x89e5f9[_0xe5e4('0x4a')]['ids'],_['omit'](_0x89e5f9['body'],[_0xe5e4('0x52'),'id'])||{});}})[_0xe5e4('0x27')](respondWithResult(_0x325732,null))['catch'](handleError(_0x325732,null));};exports[_0xe5e4('0x53')]=function(_0x5ad69b,_0x38b1fc,_0x3d8f52){var _0x446cd7={};var _0xbc93fa={};var _0x27218a;var _0x556abe;return db[_0xe5e4('0x2e')][_0xe5e4('0x54')]({'where':{'id':_0x5ad69b[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x38b1fc,null))['then'](function(_0xc88923){if(_0xc88923){_0x27218a=_0xc88923;_0xbc93fa[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db['User'][_0xe5e4('0x47')]);_0xbc93fa[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x5ad69b[_0xe5e4('0x33')]);_0xbc93fa[_0xe5e4('0x3d')]=_[_0xe5e4('0x36')](_0xbc93fa[_0xe5e4('0x32')],_0xbc93fa[_0xe5e4('0x33')]);_0x446cd7[_0xe5e4('0x35')]=_['intersection'](_0xbc93fa[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x446cd7[_0xe5e4('0x35')]=_0x446cd7['attributes']['length']?_0x446cd7[_0xe5e4('0x35')]:_0xbc93fa[_0xe5e4('0x32')];_0x446cd7[_0xe5e4('0x3b')]=qs['sort'](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x446cd7[_0xe5e4('0x41')]=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x5ad69b[_0xe5e4('0x33')],_0xbc93fa[_0xe5e4('0x3d')]));if(_0x5ad69b[_0xe5e4('0x33')]['filter']){_0x446cd7[_0xe5e4('0x41')]=_[_0xe5e4('0x40')](_0x446cd7['where'],{'$or':_[_0xe5e4('0x2d')](_0x446cd7[_0xe5e4('0x35')],function(_0x2be762){var _0x165ca0={};_0x165ca0[_0x2be762]={'$like':'%'+_0x5ad69b[_0xe5e4('0x33')]['filter']+'%'};return _0x165ca0;})});}_0x446cd7=_[_0xe5e4('0x40')]({},_0x446cd7,_0x5ad69b[_0xe5e4('0x43')]);return _0x27218a[_0xe5e4('0x53')](_0x446cd7);}})[_0xe5e4('0x27')](function(_0x225fb7){if(_0x225fb7){_0x556abe=_0x225fb7[_0xe5e4('0x38')];if(!_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x446cd7[_0xe5e4('0x20')]=qs[_0xe5e4('0x20')](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x446cd7[_0xe5e4('0x1f')]=qs['offset'](_0x5ad69b[_0xe5e4('0x33')][_0xe5e4('0x1f')]);}return _0x27218a[_0xe5e4('0x53')](_0x446cd7);}})[_0xe5e4('0x27')](function(_0x3308d9){if(_0x3308d9){return _0x3308d9?{'count':_0x556abe,'rows':_0x3308d9}:null;}})[_0xe5e4('0x27')](respondWithResult(_0x38b1fc,null))[_0xe5e4('0x46')](handleError(_0x38b1fc,null));};exports['removeMembers']=function(_0x4a8a68,_0x51709a,_0x48e8c2){return db[_0xe5e4('0x2e')][_0xe5e4('0x48')]({'where':{'id':_0x4a8a68[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x51709a,null))[_0xe5e4('0x27')](function(_0x2976af){if(_0x2976af){return _0x2976af[_0xe5e4('0x55')](_0x4a8a68[_0xe5e4('0x33')][_0xe5e4('0x52')]);}})[_0xe5e4('0x27')](respondWithStatusCode(_0x51709a,null))[_0xe5e4('0x46')](handleError(_0x51709a,null));};exports['addMessage']=function(_0x281758,_0x1f2c44,_0x4e7fbf){if(_0x281758[_0xe5e4('0x4a')]['id']){delete _0x281758['body']['id'];}return db[_0xe5e4('0x2e')]['find']({'where':{'id':_0x281758[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x1f2c44,null))[_0xe5e4('0x27')](function(_0x208f3a){if(_0x208f3a){_0x281758['body'][_0xe5e4('0x56')]=_0x208f3a['id'];return db['ChatInternalMessage'][_0xe5e4('0x49')](_0x281758[_0xe5e4('0x4a')]);}})[_0xe5e4('0x27')](respondWithResult(_0x1f2c44,null))[_0xe5e4('0x46')](handleError(_0x1f2c44,null));};exports[_0xe5e4('0x57')]=function(_0x2f7426,_0x39b419,_0x4aad5a){var _0x46e8fb={};var _0x376f72={};var _0x120a33;var _0x5ec36c;return db[_0xe5e4('0x2e')][_0xe5e4('0x54')]({'where':{'id':_0x2f7426[_0xe5e4('0x4b')]['id']}})[_0xe5e4('0x27')](handleEntityNotFound(_0x39b419,null))['then'](function(_0x2df7fa){if(_0x2df7fa){_0x120a33=_0x2df7fa;_0x376f72[_0xe5e4('0x32')]=_[_0xe5e4('0x34')](db[_0xe5e4('0x4e')][_0xe5e4('0x47')]);_0x376f72[_0xe5e4('0x33')]=_[_0xe5e4('0x34')](_0x2f7426[_0xe5e4('0x33')]);_0x376f72[_0xe5e4('0x3d')]=_['intersection'](_0x376f72[_0xe5e4('0x32')],_0x376f72[_0xe5e4('0x33')]);_0x46e8fb[_0xe5e4('0x35')]=_[_0xe5e4('0x36')](_0x376f72[_0xe5e4('0x32')],qs[_0xe5e4('0x37')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x37')]));_0x46e8fb[_0xe5e4('0x35')]=_0x46e8fb[_0xe5e4('0x35')][_0xe5e4('0x38')]?_0x46e8fb['attributes']:_0x376f72[_0xe5e4('0x32')];_0x46e8fb[_0xe5e4('0x3b')]=qs[_0xe5e4('0x3c')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x3c')]);_0x46e8fb[_0xe5e4('0x41')]=qs[_0xe5e4('0x3d')](_[_0xe5e4('0x3e')](_0x2f7426[_0xe5e4('0x33')],_0x376f72[_0xe5e4('0x3d')]));if(_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x3f')]){_0x46e8fb[_0xe5e4('0x41')]=_['merge'](_0x46e8fb[_0xe5e4('0x41')],{'$or':_[_0xe5e4('0x2d')](_0x46e8fb[_0xe5e4('0x35')],function(_0x21f467){var _0x538ab3={};_0x538ab3[_0x21f467]={'$like':'%'+_0x2f7426['query'][_0xe5e4('0x3f')]+'%'};return _0x538ab3;})});}if(_0x2f7426[_0xe5e4('0x33')]['$gte']){var _0x5579be=_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x58')][_0xe5e4('0x59')](',');var _0x2dde0c={};_0x2dde0c[_0x5579be[0x0]]={'$gte':moment(_0x5579be[0x1])[_0xe5e4('0x5a')](_0xe5e4('0x5b'))};_0x46e8fb[_0xe5e4('0x41')]=_[_0xe5e4('0x40')](_0x46e8fb[_0xe5e4('0x41')],_0x2dde0c);}_0x46e8fb=_['merge']({},_0x46e8fb,_0x2f7426['options']);return _0x120a33[_0xe5e4('0x57')](_0x46e8fb);}})['then'](function(_0x5504fe){if(_0x5504fe){_0x5ec36c=_0x5504fe[_0xe5e4('0x38')];if(!_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x39')](_0xe5e4('0x3a'))){_0x46e8fb[_0xe5e4('0x20')]=qs[_0xe5e4('0x20')](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x20')]);_0x46e8fb[_0xe5e4('0x1f')]=qs['offset'](_0x2f7426[_0xe5e4('0x33')][_0xe5e4('0x1f')]);}return _0x120a33[_0xe5e4('0x57')](_0x46e8fb);}})[_0xe5e4('0x27')](function(_0x94d389){if(_0x94d389){return _0x94d389?{'count':_0x5ec36c,'rows':_0x94d389}:null;}})[_0xe5e4('0x27')](respondWithResult(_0x39b419,null))['catch'](handleError(_0x39b419,null));};
\ No newline at end of file
+var _0x742c=['show','params','keys','merge','find','create','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','hasOwnProperty','removeMembers','ChatGroupId','$gte','split','format','getMessages','nolimit','eml-format','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatGroup','rawAttributes','type','key','model','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x185133,_0x29a472){var _0x862f7f=function(_0x25ea87){while(--_0x25ea87){_0x185133['push'](_0x185133['shift']());}};_0x862f7f(++_0x29a472);}(_0x742c,0xd5));var _0xc742=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0x742c[_0x30f07a];return _0xb38461;};'use strict';var emlformat=require(_0xc742('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc742('0x1'));var moment=require(_0xc742('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xc742('0x3'));var util=require('util');var path=require('path');var sox=require(_0xc742('0x4'));var csv=require(_0xc742('0x5'));var ejs=require(_0xc742('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc742('0x7'));var squel=require(_0xc742('0x8'));var crypto=require(_0xc742('0x9'));var jsforce=require(_0xc742('0xa'));var deskjs=require(_0xc742('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc742('0xc'));var Papa=require(_0xc742('0xd'));var Redis=require(_0xc742('0xe'));var authService=require(_0xc742('0xf'));var qs=require(_0xc742('0x10'));var as=require(_0xc742('0x11'));var hardwareService=require(_0xc742('0x12'));var logger=require(_0xc742('0x13'))(_0xc742('0x14'));var utils=require(_0xc742('0x15'));var config=require(_0xc742('0x16'));var licenseUtil=require(_0xc742('0x17'));var db=require(_0xc742('0x18'))['db'];config['redis']=_[_0xc742('0x19')](config[_0xc742('0x1a')],{'host':_0xc742('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc742('0x1a')]));require('./chatGroup.socket')[_0xc742('0x1c')](socket);function respondWithStatusCode(_0x308619,_0x502044){_0x502044=_0x502044||0xcc;return function(_0x4d22af){if(_0x4d22af){return _0x308619[_0xc742('0x1d')](_0x502044);}return _0x308619[_0xc742('0x1e')](_0x502044)[_0xc742('0x1f')]();};}function respondWithResult(_0x2cdc1c,_0x472d2c){_0x472d2c=_0x472d2c||0xc8;return function(_0x1f83f3){if(_0x1f83f3){return _0x2cdc1c['status'](_0x472d2c)[_0xc742('0x20')](_0x1f83f3);}};}function respondWithFilteredResult(_0x46d8bc,_0x46e01a){return function(_0x205e56){if(_0x205e56){var _0x21abd0=typeof _0x46e01a[_0xc742('0x21')]===_0xc742('0x22')&&typeof _0x46e01a[_0xc742('0x23')]===_0xc742('0x22');var _0x3e86bb=_0x205e56[_0xc742('0x24')];var _0x356ba0=_0x21abd0?0x0:_0x46e01a[_0xc742('0x21')];var _0x5ec569=_0x21abd0?_0x205e56[_0xc742('0x24')]:_0x46e01a[_0xc742('0x21')]+_0x46e01a[_0xc742('0x23')];var _0x4f0f13;if(_0x5ec569>=_0x3e86bb){_0x5ec569=_0x3e86bb;_0x4f0f13=0xc8;}else{_0x4f0f13=0xce;}_0x46d8bc[_0xc742('0x1e')](_0x4f0f13);return _0x46d8bc[_0xc742('0x25')](_0xc742('0x26'),_0x356ba0+'-'+_0x5ec569+'/'+_0x3e86bb)[_0xc742('0x20')](_0x205e56);}return null;};}function patchUpdates(_0x5c8505){return function(_0x44b0b8){try{jsonpatch[_0xc742('0x27')](_0x44b0b8,_0x5c8505,!![]);}catch(_0x262f7d){return BPromise[_0xc742('0x28')](_0x262f7d);}return _0x44b0b8[_0xc742('0x29')]();};}function saveUpdates(_0x385eb5,_0x38e9c0){return function(_0x179342){if(_0x179342){return _0x179342[_0xc742('0x2a')](_0x385eb5)[_0xc742('0x2b')](function(_0x416278){return _0x416278;});}return null;};}function removeEntity(_0x294a61,_0x5eecc6){return function(_0x313edb){if(_0x313edb){return _0x313edb[_0xc742('0x2c')]()['then'](function(){_0x294a61[_0xc742('0x1e')](0xcc)[_0xc742('0x1f')]();});}};}function handleEntityNotFound(_0x21a32f,_0x3bb38e){return function(_0x303bf6){if(!_0x303bf6){_0x21a32f[_0xc742('0x1d')](0x194);}return _0x303bf6;};}function handleError(_0x49c2bc,_0x3741e4){_0x3741e4=_0x3741e4||0x1f4;return function(_0x575e79){logger[_0xc742('0x2d')](_0x575e79[_0xc742('0x2e')]);if(_0x575e79[_0xc742('0x2f')]){delete _0x575e79[_0xc742('0x2f')];}_0x49c2bc['status'](_0x3741e4)['send'](_0x575e79);};}exports[_0xc742('0x30')]=function(_0x581dfc,_0x3a5db7){var _0x27598b={},_0x3cabcd={},_0x35348b={'count':0x0,'rows':[]};var _0xa442a=_[_0xc742('0x31')](db[_0xc742('0x32')][_0xc742('0x33')],function(_0x43250b){return{'name':_0x43250b['fieldName'],'type':_0x43250b[_0xc742('0x34')][_0xc742('0x35')]};});_0x3cabcd[_0xc742('0x36')]=_[_0xc742('0x31')](_0xa442a,_0xc742('0x2f'));_0x3cabcd[_0xc742('0x37')]=_['keys'](_0x581dfc[_0xc742('0x37')]);_0x3cabcd['filters']=_[_0xc742('0x38')](_0x3cabcd[_0xc742('0x36')],_0x3cabcd[_0xc742('0x37')]);_0x27598b[_0xc742('0x39')]=_['intersection'](_0x3cabcd['model'],qs[_0xc742('0x3a')](_0x581dfc[_0xc742('0x37')][_0xc742('0x3a')]));_0x27598b['attributes']=_0x27598b[_0xc742('0x39')][_0xc742('0x3b')]?_0x27598b[_0xc742('0x39')]:_0x3cabcd[_0xc742('0x36')];if(!_0x581dfc[_0xc742('0x37')]['hasOwnProperty']('nolimit')){_0x27598b['limit']=qs['limit'](_0x581dfc[_0xc742('0x37')][_0xc742('0x23')]);_0x27598b[_0xc742('0x21')]=qs[_0xc742('0x21')](_0x581dfc[_0xc742('0x37')]['offset']);}_0x27598b[_0xc742('0x3c')]=qs[_0xc742('0x3d')](_0x581dfc[_0xc742('0x37')][_0xc742('0x3d')]);_0x27598b[_0xc742('0x3e')]=qs[_0xc742('0x3f')](_[_0xc742('0x40')](_0x581dfc[_0xc742('0x37')],_0x3cabcd[_0xc742('0x3f')]),_0xa442a);if(_0x581dfc[_0xc742('0x37')][_0xc742('0x41')]){_0x27598b[_0xc742('0x3e')]=_['merge'](_0x27598b[_0xc742('0x3e')],{'$or':_['map'](_0xa442a,function(_0x1516b3){if(_0x1516b3[_0xc742('0x34')]!==_0xc742('0x42')){var _0x5c1856={};_0x5c1856[_0x1516b3[_0xc742('0x2f')]]={'$like':'%'+_0x581dfc[_0xc742('0x37')][_0xc742('0x41')]+'%'};return _0x5c1856;}})});}_0x27598b=_['merge']({},_0x27598b,_0x581dfc[_0xc742('0x43')]);var _0x14fc10={'where':_0x27598b[_0xc742('0x3e')]};return db[_0xc742('0x32')][_0xc742('0x24')](_0x14fc10)[_0xc742('0x2b')](function(_0x586fe5){_0x35348b['count']=_0x586fe5;if(_0x581dfc[_0xc742('0x37')][_0xc742('0x44')]){_0x27598b[_0xc742('0x45')]=[{'all':!![]}];}return db[_0xc742('0x32')]['findAll'](_0x27598b);})[_0xc742('0x2b')](function(_0x26c368){_0x35348b[_0xc742('0x46')]=_0x26c368;return _0x35348b;})['then'](respondWithFilteredResult(_0x3a5db7,_0x27598b))[_0xc742('0x47')](handleError(_0x3a5db7,null));};exports[_0xc742('0x48')]=function(_0x191e03,_0x516a5b){var _0x4a3bc8={'raw':!![],'where':{'id':_0x191e03[_0xc742('0x49')]['id']}},_0x112778={};_0x112778[_0xc742('0x36')]=_[_0xc742('0x4a')](db[_0xc742('0x32')]['rawAttributes']);_0x112778[_0xc742('0x37')]=_[_0xc742('0x4a')](_0x191e03[_0xc742('0x37')]);_0x112778[_0xc742('0x3f')]=_[_0xc742('0x38')](_0x112778[_0xc742('0x36')],_0x112778['query']);_0x4a3bc8[_0xc742('0x39')]=_['intersection'](_0x112778['model'],qs[_0xc742('0x3a')](_0x191e03[_0xc742('0x37')][_0xc742('0x3a')]));_0x4a3bc8['attributes']=_0x4a3bc8['attributes']['length']?_0x4a3bc8[_0xc742('0x39')]:_0x112778[_0xc742('0x36')];if(_0x191e03[_0xc742('0x37')]['includeAll']){_0x4a3bc8[_0xc742('0x45')]=[{'all':!![]}];}_0x4a3bc8=_[_0xc742('0x4b')]({},_0x4a3bc8,_0x191e03[_0xc742('0x43')]);return db['ChatGroup'][_0xc742('0x4c')](_0x4a3bc8)[_0xc742('0x2b')](handleEntityNotFound(_0x516a5b,null))[_0xc742('0x2b')](respondWithResult(_0x516a5b,null))['catch'](handleError(_0x516a5b,null));};exports[_0xc742('0x4d')]=function(_0x19df21,_0x5e2db7){return db['ChatGroup'][_0xc742('0x4d')](_0x19df21[_0xc742('0x4e')],{})['then'](respondWithResult(_0x5e2db7,0xc9))[_0xc742('0x47')](handleError(_0x5e2db7,null));};exports[_0xc742('0x2a')]=function(_0x329580,_0x5ccdbd){if(_0x329580[_0xc742('0x4e')]['id']){delete _0x329580[_0xc742('0x4e')]['id'];}return db[_0xc742('0x32')][_0xc742('0x4c')]({'where':{'id':_0x329580[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x5ccdbd,null))[_0xc742('0x2b')](saveUpdates(_0x329580[_0xc742('0x4e')],null))[_0xc742('0x2b')](respondWithResult(_0x5ccdbd,null))['catch'](handleError(_0x5ccdbd,null));};exports['destroy']=function(_0xfcba44,_0x2b45f3){return db[_0xc742('0x32')]['find']({'where':{'id':_0xfcba44[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x2b45f3,null))[_0xc742('0x2b')](removeEntity(_0x2b45f3,null))[_0xc742('0x47')](handleError(_0x2b45f3,null));};exports[_0xc742('0x4f')]=function(_0x368e75,_0x1b8aa7){return db['ChatGroup'][_0xc742('0x4f')]()[_0xc742('0x2b')](respondWithResult(_0x1b8aa7,null))['catch'](handleError(_0x1b8aa7,null));};exports[_0xc742('0x50')]=function(_0x5d1ba9,_0x2f8f32,_0x50a521){return db[_0xc742('0x51')]['count']({'where':{'ChatGroupId':_0x5d1ba9[_0xc742('0x49')]['id'],'ToId':_0x5d1ba9['user']['id'],'read':![]}})['then'](function(_0xf9db3e){return{'id':_[_0xc742('0x52')](_0x5d1ba9[_0xc742('0x49')]['id']),'count':_0xf9db3e};})['then'](respondWithResult(_0x2f8f32,null))[_0xc742('0x47')](handleError(_0x2f8f32,null));};exports[_0xc742('0x53')]=function(_0x131b2a,_0x24e322,_0x3cf7ce){return db[_0xc742('0x32')]['find']({'where':{'id':_0x131b2a['params']['id']}})['then'](handleEntityNotFound(_0x24e322,null))[_0xc742('0x2b')](function(_0x5b4ade){if(_0x5b4ade){return _0x5b4ade[_0xc742('0x53')](_0x131b2a[_0xc742('0x4e')][_0xc742('0x54')],_['omit'](_0x131b2a[_0xc742('0x4e')],[_0xc742('0x54'),'id'])||{});}})[_0xc742('0x2b')](respondWithResult(_0x24e322,null))['catch'](handleError(_0x24e322,null));};exports[_0xc742('0x55')]=function(_0x3627f7,_0x17cc82,_0x31b8be){var _0x9816f4={};var _0x3508ad={};var _0x49bc50;var _0x407d5f;return db[_0xc742('0x32')][_0xc742('0x56')]({'where':{'id':_0x3627f7[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x17cc82,null))[_0xc742('0x2b')](function(_0x3fc085){if(_0x3fc085){_0x49bc50=_0x3fc085;_0x3508ad['model']=_[_0xc742('0x4a')](db['User'][_0xc742('0x33')]);_0x3508ad[_0xc742('0x37')]=_[_0xc742('0x4a')](_0x3627f7[_0xc742('0x37')]);_0x3508ad[_0xc742('0x3f')]=_[_0xc742('0x38')](_0x3508ad[_0xc742('0x36')],_0x3508ad[_0xc742('0x37')]);_0x9816f4[_0xc742('0x39')]=_[_0xc742('0x38')](_0x3508ad[_0xc742('0x36')],qs['fields'](_0x3627f7[_0xc742('0x37')][_0xc742('0x3a')]));_0x9816f4[_0xc742('0x39')]=_0x9816f4[_0xc742('0x39')][_0xc742('0x3b')]?_0x9816f4[_0xc742('0x39')]:_0x3508ad[_0xc742('0x36')];_0x9816f4[_0xc742('0x3c')]=qs['sort'](_0x3627f7[_0xc742('0x37')]['sort']);_0x9816f4['where']=qs[_0xc742('0x3f')](_['pick'](_0x3627f7[_0xc742('0x37')],_0x3508ad[_0xc742('0x3f')]));if(_0x3627f7[_0xc742('0x37')][_0xc742('0x41')]){_0x9816f4['where']=_['merge'](_0x9816f4['where'],{'$or':_[_0xc742('0x31')](_0x9816f4[_0xc742('0x39')],function(_0x36b439){var _0x19e788={};_0x19e788[_0x36b439]={'$like':'%'+_0x3627f7[_0xc742('0x37')]['filter']+'%'};return _0x19e788;})});}_0x9816f4=_[_0xc742('0x4b')]({},_0x9816f4,_0x3627f7[_0xc742('0x43')]);return _0x49bc50['getMembers'](_0x9816f4);}})[_0xc742('0x2b')](function(_0x5ad41b){if(_0x5ad41b){_0x407d5f=_0x5ad41b['length'];if(!_0x3627f7[_0xc742('0x37')][_0xc742('0x57')]('nolimit')){_0x9816f4['limit']=qs[_0xc742('0x23')](_0x3627f7[_0xc742('0x37')][_0xc742('0x23')]);_0x9816f4[_0xc742('0x21')]=qs[_0xc742('0x21')](_0x3627f7[_0xc742('0x37')][_0xc742('0x21')]);}return _0x49bc50[_0xc742('0x55')](_0x9816f4);}})[_0xc742('0x2b')](function(_0x17ebad){if(_0x17ebad){return _0x17ebad?{'count':_0x407d5f,'rows':_0x17ebad}:null;}})[_0xc742('0x2b')](respondWithResult(_0x17cc82,null))[_0xc742('0x47')](handleError(_0x17cc82,null));};exports[_0xc742('0x58')]=function(_0x575755,_0x3702fc,_0x3fb538){return db[_0xc742('0x32')][_0xc742('0x4c')]({'where':{'id':_0x575755['params']['id']}})['then'](handleEntityNotFound(_0x3702fc,null))['then'](function(_0xa10061){if(_0xa10061){return _0xa10061[_0xc742('0x58')](_0x575755[_0xc742('0x37')][_0xc742('0x54')]);}})[_0xc742('0x2b')](respondWithStatusCode(_0x3702fc,null))['catch'](handleError(_0x3702fc,null));};exports['addMessage']=function(_0x3d5611,_0xa91f01,_0x5663b2){if(_0x3d5611['body']['id']){delete _0x3d5611[_0xc742('0x4e')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3d5611[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0xa91f01,null))[_0xc742('0x2b')](function(_0x184376){if(_0x184376){_0x3d5611[_0xc742('0x4e')][_0xc742('0x59')]=_0x184376['id'];return db[_0xc742('0x51')]['create'](_0x3d5611[_0xc742('0x4e')]);}})[_0xc742('0x2b')](respondWithResult(_0xa91f01,null))[_0xc742('0x47')](handleError(_0xa91f01,null));};exports['getMessages']=function(_0x579163,_0x5c2ad6,_0xe55cff){var _0x372fc0={};var _0x33390e={};var _0x19e53c;var _0x74f476;return db[_0xc742('0x32')]['findOne']({'where':{'id':_0x579163[_0xc742('0x49')]['id']}})[_0xc742('0x2b')](handleEntityNotFound(_0x5c2ad6,null))['then'](function(_0x572666){if(_0x572666){_0x19e53c=_0x572666;_0x33390e[_0xc742('0x36')]=_[_0xc742('0x4a')](db[_0xc742('0x51')][_0xc742('0x33')]);_0x33390e[_0xc742('0x37')]=_[_0xc742('0x4a')](_0x579163[_0xc742('0x37')]);_0x33390e[_0xc742('0x3f')]=_['intersection'](_0x33390e[_0xc742('0x36')],_0x33390e[_0xc742('0x37')]);_0x372fc0['attributes']=_[_0xc742('0x38')](_0x33390e[_0xc742('0x36')],qs[_0xc742('0x3a')](_0x579163[_0xc742('0x37')][_0xc742('0x3a')]));_0x372fc0[_0xc742('0x39')]=_0x372fc0[_0xc742('0x39')][_0xc742('0x3b')]?_0x372fc0['attributes']:_0x33390e[_0xc742('0x36')];_0x372fc0[_0xc742('0x3c')]=qs['sort'](_0x579163[_0xc742('0x37')][_0xc742('0x3d')]);_0x372fc0[_0xc742('0x3e')]=qs[_0xc742('0x3f')](_[_0xc742('0x40')](_0x579163[_0xc742('0x37')],_0x33390e[_0xc742('0x3f')]));if(_0x579163[_0xc742('0x37')][_0xc742('0x41')]){_0x372fc0[_0xc742('0x3e')]=_['merge'](_0x372fc0[_0xc742('0x3e')],{'$or':_[_0xc742('0x31')](_0x372fc0[_0xc742('0x39')],function(_0x428ce8){var _0x41e420={};_0x41e420[_0x428ce8]={'$like':'%'+_0x579163[_0xc742('0x37')]['filter']+'%'};return _0x41e420;})});}if(_0x579163[_0xc742('0x37')][_0xc742('0x5a')]){var _0x13bd8f=_0x579163['query'][_0xc742('0x5a')][_0xc742('0x5b')](',');var _0x28b8bc={};_0x28b8bc[_0x13bd8f[0x0]]={'$gte':moment(_0x13bd8f[0x1])[_0xc742('0x5c')]('YYYY-MM-DD\x20HH:mm:ss')};_0x372fc0[_0xc742('0x3e')]=_[_0xc742('0x4b')](_0x372fc0[_0xc742('0x3e')],_0x28b8bc);}_0x372fc0=_[_0xc742('0x4b')]({},_0x372fc0,_0x579163[_0xc742('0x43')]);return _0x19e53c[_0xc742('0x5d')](_0x372fc0);}})['then'](function(_0x32889e){if(_0x32889e){_0x74f476=_0x32889e[_0xc742('0x3b')];if(!_0x579163['query'][_0xc742('0x57')](_0xc742('0x5e'))){_0x372fc0[_0xc742('0x23')]=qs['limit'](_0x579163[_0xc742('0x37')]['limit']);_0x372fc0['offset']=qs[_0xc742('0x21')](_0x579163[_0xc742('0x37')]['offset']);}return _0x19e53c[_0xc742('0x5d')](_0x372fc0);}})[_0xc742('0x2b')](function(_0x1ca806){if(_0x1ca806){return _0x1ca806?{'count':_0x74f476,'rows':_0x1ca806}:null;}})[_0xc742('0x2b')](respondWithResult(_0x5c2ad6,null))[_0xc742('0x47')](handleError(_0x5c2ad6,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index ff51591..6c1e081 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 _0x3c8e=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x49bd3e,_0x2e6e2d){var _0x247ba6=function(_0x46a7d1){while(--_0x46a7d1){_0x49bd3e['push'](_0x49bd3e['shift']());}};_0x247ba6(++_0x2e6e2d);}(_0x3c8e,0x89));var _0xe3c8=function(_0x269ab2,_0x5e2aa0){_0x269ab2=_0x269ab2-0x0;var _0x16a0f8=_0x3c8e[_0x269ab2];return _0x16a0f8;};'use strict';var EventEmitter=require(_0xe3c8('0x0'));var ChatGroup=require(_0xe3c8('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe3c8('0x2'),'afterUpdate':_0xe3c8('0x3'),'afterDestroy':_0xe3c8('0x4')};function emitEvent(_0x563970){return function(_0x3f8a4b,_0x21efc9,_0xbd43ef){ChatGroupEvents[_0xe3c8('0x5')](_0x563970+':'+_0x3f8a4b['id'],_0x3f8a4b);ChatGroupEvents['emit'](_0x563970,_0x3f8a4b);_0xbd43ef(null);};}for(var e in events){if(events[_0xe3c8('0x6')](e)){var event=events[e];ChatGroup[_0xe3c8('0x7')](e,emitEvent(event));}}module[_0xe3c8('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xd0ce=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x40da26,_0x23369c){var _0x2a49a7=function(_0x3faa99){while(--_0x3faa99){_0x40da26['push'](_0x40da26['shift']());}};_0x2a49a7(++_0x23369c);}(_0xd0ce,0x105));var _0xed0c=function(_0x28286e,_0xd8c672){_0x28286e=_0x28286e-0x0;var _0x3a253e=_0xd0ce[_0x28286e];return _0x3a253e;};'use strict';var EventEmitter=require(_0xed0c('0x0'));var ChatGroup=require(_0xed0c('0x1'))['db'][_0xed0c('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xed0c('0x3')](0x0);var events={'afterCreate':_0xed0c('0x4'),'afterUpdate':_0xed0c('0x5'),'afterDestroy':_0xed0c('0x6')};function emitEvent(_0x8b6679){return function(_0x13b003,_0x330d3e,_0x5b7a5f){ChatGroupEvents[_0xed0c('0x7')](_0x8b6679+':'+_0x13b003['id'],_0x13b003);ChatGroupEvents['emit'](_0x8b6679,_0x13b003);_0x5b7a5f(null);};}for(var e in events){if(events[_0xed0c('0x8')](e)){var event=events[e];ChatGroup[_0xed0c('0x9')](e,emitEvent(event));}}module[_0xed0c('0xa')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 0b1250d..3116cc4 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 _0x3be3=['../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api','request-promise','path'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x3be3,0xaf));var _0x33be=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0x3be3[_0x452968];return _0xb6f9ae;};'use strict';var _=require(_0x33be('0x0'));var util=require('util');var logger=require(_0x33be('0x1'))(_0x33be('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x33be('0x3'));var fs=require('fs');var path=require(_0x33be('0x4'));var rimraf=require('rimraf');var config=require(_0x33be('0x5'));var attributes=require(_0x33be('0x6'));module['exports']=function(_0x3a12ea,_0x46c10a){return _0x3a12ea[_0x33be('0x7')](_0x33be('0x8'),attributes,{'tableName':_0x33be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x54c3=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x26f935,_0x17b8c3){var _0x3b9713=function(_0x2a892c){while(--_0x2a892c){_0x26f935['push'](_0x26f935['shift']());}};_0x3b9713(++_0x17b8c3);}(_0x54c3,0x1b9));var _0x354c=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0x54c3[_0x1af5b2];return _0xf1aa2d;};'use strict';var _=require(_0x354c('0x0'));var util=require(_0x354c('0x1'));var logger=require(_0x354c('0x2'))(_0x354c('0x3'));var moment=require(_0x354c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x354c('0x5'));var rimraf=require(_0x354c('0x6'));var config=require(_0x354c('0x7'));var attributes=require(_0x354c('0x8'));module[_0x354c('0x9')]=function(_0x3102a7,_0x7beaa1){return _0x3102a7[_0x354c('0xa')](_0x354c('0xb'),attributes,{'tableName':_0x354c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 1d33cb9..c3f94bc 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 _0x87cb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message'];(function(_0x55f5b7,_0x2dcdcc){var _0x34762d=function(_0x53fd0b){while(--_0x53fd0b){_0x55f5b7['push'](_0x55f5b7['shift']());}};_0x34762d(++_0x2dcdcc);}(_0x87cb,0xaa));var _0xb87c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x87cb[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xb87c('0x0'));var util=require(_0xb87c('0x1'));var moment=require(_0xb87c('0x2'));var BPromise=require(_0xb87c('0x3'));var rs=require(_0xb87c('0x4'));var fs=require('fs');var Redis=require(_0xb87c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb87c('0x6'))(_0xb87c('0x7'));var config=require(_0xb87c('0x8'));var jayson=require(_0xb87c('0x9'));var client=jayson[_0xb87c('0xa')][_0xb87c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb87c('0xc')],{'host':_0xb87c('0xd'),'port':0x18eb});var socket=require(_0xb87c('0xe'))(new Redis(config[_0xb87c('0xc')]));require(_0xb87c('0xf'))['register'](socket);function respondWithRpcPromise(_0x10517c,_0x484d49,_0x260a20){return new BPromise(function(_0x5229a4,_0x37b8e7){return client[_0xb87c('0x10')](_0x10517c,_0x260a20)[_0xb87c('0x11')](function(_0xa4095f){logger[_0xb87c('0x12')]('ChatGroup,\x20%s,\x20%s',_0x484d49,'request\x20sent');logger[_0xb87c('0x13')](_0xb87c('0x14'),_0x484d49,_0xb87c('0x15'),JSON['stringify'](_0xa4095f));if(_0xa4095f[_0xb87c('0x16')]){if(_0xa4095f[_0xb87c('0x16')][_0xb87c('0x17')]===0x1f4){logger[_0xb87c('0x16')](_0xb87c('0x18'),_0x484d49,_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);return _0x37b8e7(_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);}logger['error'](_0xb87c('0x18'),_0x484d49,_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);return _0x5229a4(_0xa4095f[_0xb87c('0x16')]['message']);}else{logger[_0xb87c('0x12')]('ChatGroup,\x20%s,\x20%s',_0x484d49,'request\x20sent');_0x5229a4(_0xa4095f[_0xb87c('0x1a')][_0xb87c('0x19')]);}})[_0xb87c('0x1b')](function(_0x581c9e){logger['error']('ChatGroup,\x20%s,\x20%s',_0x484d49,_0x581c9e);_0x37b8e7(_0x581c9e);});});}
\ No newline at end of file
+var _0x7e63=['http','redis','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e63,0x74));var _0x37e6=function(_0x1ff146,_0x5176bc){_0x1ff146=_0x1ff146-0x0;var _0x11d9b1=_0x7e63[_0x1ff146];return _0x11d9b1;};'use strict';var _=require(_0x37e6('0x0'));var util=require(_0x37e6('0x1'));var moment=require(_0x37e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x37e6('0x3'));var fs=require('fs');var Redis=require(_0x37e6('0x4'));var db=require(_0x37e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x37e6('0x6'))(_0x37e6('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x37e6('0x8')][_0x37e6('0x9')]({'port':0x232a});config[_0x37e6('0xa')]=_['defaults'](config[_0x37e6('0xa')],{'host':_0x37e6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37e6('0xa')]));require(_0x37e6('0xc'))[_0x37e6('0xd')](socket);function respondWithRpcPromise(_0xfdc255,_0x5ea219,_0x676035){return new BPromise(function(_0x1f5d30,_0x10eb16){return client['request'](_0xfdc255,_0x676035)[_0x37e6('0xe')](function(_0x3f3158){logger[_0x37e6('0xf')](_0x37e6('0x10'),_0x5ea219,_0x37e6('0x11'));logger[_0x37e6('0x12')](_0x37e6('0x13'),_0x5ea219,_0x37e6('0x11'),JSON[_0x37e6('0x14')](_0x3f3158));if(_0x3f3158[_0x37e6('0x15')]){if(_0x3f3158[_0x37e6('0x15')]['code']===0x1f4){logger[_0x37e6('0x15')]('ChatGroup,\x20%s,\x20%s',_0x5ea219,_0x3f3158['error'][_0x37e6('0x16')]);return _0x10eb16(_0x3f3158['error'][_0x37e6('0x16')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5ea219,_0x3f3158[_0x37e6('0x15')][_0x37e6('0x16')]);return _0x1f5d30(_0x3f3158[_0x37e6('0x15')]['message']);}else{logger[_0x37e6('0xf')](_0x37e6('0x10'),_0x5ea219,_0x37e6('0x11'));_0x1f5d30(_0x3f3158[_0x37e6('0x17')][_0x37e6('0x16')]);}})[_0x37e6('0x18')](function(_0x3cfebd){logger[_0x37e6('0x15')](_0x37e6('0x10'),_0x5ea219,_0x3cfebd);_0x10eb16(_0x3cfebd);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index dba5924..32808d5 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 _0x4b7e=['remove','update','emit','removeListener','register','length','./chatGroup.events'];(function(_0x4f484c,_0x9bccb4){var _0x276e95=function(_0x32e002){while(--_0x32e002){_0x4f484c['push'](_0x4f484c['shift']());}};_0x276e95(++_0x9bccb4);}(_0x4b7e,0x1e9));var _0xe4b7=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4b7e[_0x21a9d9];return _0x46adce;};'use strict';var ChatGroupEvents=require(_0xe4b7('0x0'));var events=['save',_0xe4b7('0x1'),_0xe4b7('0x2')];function createListener(_0xcd485e,_0x548b2e){return function(_0x36aebf){_0x548b2e[_0xe4b7('0x3')](_0xcd485e,_0x36aebf);};}function removeListener(_0x157112,_0x498c82){return function(){ChatGroupEvents[_0xe4b7('0x4')](_0x157112,_0x498c82);};}exports[_0xe4b7('0x5')]=function(_0x5cfec6){for(var _0xccaf26=0x0,_0x426ab3=events[_0xe4b7('0x6')];_0xccaf26<_0x426ab3;_0xccaf26++){var _0x733538=events[_0xccaf26];var _0x32fa2e=createListener('chatGroup:'+_0x733538,_0x5cfec6);ChatGroupEvents['on'](_0x733538,_0x32fa2e);}};
\ No newline at end of file
+var _0x09b7=['emit','length','chatGroup:','./chatGroup.events','remove'];(function(_0x1ad418,_0x1a6ef4){var _0x557e31=function(_0xfd9e76){while(--_0xfd9e76){_0x1ad418['push'](_0x1ad418['shift']());}};_0x557e31(++_0x1a6ef4);}(_0x09b7,0x1c0));var _0x709b=function(_0x430ea6,_0x58db3b){_0x430ea6=_0x430ea6-0x0;var _0x8c837=_0x09b7[_0x430ea6];return _0x8c837;};'use strict';var ChatGroupEvents=require(_0x709b('0x0'));var events=['save',_0x709b('0x1'),'update'];function createListener(_0x16a449,_0x5d79a2){return function(_0x171edb){_0x5d79a2[_0x709b('0x2')](_0x16a449,_0x171edb);};}function removeListener(_0x3acde2,_0x3ac998){return function(){ChatGroupEvents['removeListener'](_0x3acde2,_0x3ac998);};}exports['register']=function(_0x13812c){for(var _0x4dc2d2=0x0,_0x245701=events[_0x709b('0x3')];_0x4dc2d2<_0x245701;_0x4dc2d2++){var _0x21f28d=events[_0x4dc2d2];var _0x4dfe48=createListener(_0x709b('0x4')+_0x21f28d,_0x13812c);ChatGroupEvents['on'](_0x21f28d,_0x4dfe48);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 40a41c6..fddcde9 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 _0xbea8=['isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','update','destroy','delete','removeMembers','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe'];(function(_0x3b460b,_0x4e2058){var _0x3807fa=function(_0x115e88){while(--_0x115e88){_0x3b460b['push'](_0x3b460b['shift']());}};_0x3807fa(++_0x4e2058);}(_0xbea8,0x7c));var _0x8bea=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0xbea8[_0x5550b3];return _0x4b8fc4;};'use strict';var multer=require(_0x8bea('0x0'));var util=require(_0x8bea('0x1'));var path=require(_0x8bea('0x2'));var timeout=require(_0x8bea('0x3'));var express=require('express');var router=express[_0x8bea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8bea('0x5'));var config=require(_0x8bea('0x6'));var controller=require(_0x8bea('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8bea('0x8')]);router[_0x8bea('0x9')](_0x8bea('0xa'),auth[_0x8bea('0xb')](),controller[_0x8bea('0xc')]);router[_0x8bea('0x9')](_0x8bea('0xd'),auth[_0x8bea('0xb')](),controller[_0x8bea('0xe')]);router[_0x8bea('0x9')](_0x8bea('0xf'),auth['isAuthenticated'](),controller[_0x8bea('0x10')]);router[_0x8bea('0x9')](_0x8bea('0x11'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x12')]);router[_0x8bea('0x9')](_0x8bea('0x13'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x14')]);router[_0x8bea('0x15')]('/',auth[_0x8bea('0xb')](),controller['create']);router[_0x8bea('0x15')]('/:id/members',auth[_0x8bea('0xb')](),controller[_0x8bea('0x16')]);router['post'](_0x8bea('0x13'),auth['isAuthenticated'](),controller['addMessage']);router['put'](_0x8bea('0xd'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8bea('0x18')]);router[_0x8bea('0x19')](_0x8bea('0x11'),auth[_0x8bea('0xb')](),controller[_0x8bea('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x3270=['/:id','getUnread','/:id/members','getMembers','getMessages','create','post','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x628de9,_0x8d0187){var _0x412d0b=function(_0x2ed322){while(--_0x2ed322){_0x628de9['push'](_0x628de9['shift']());}};_0x412d0b(++_0x8d0187);}(_0x3270,0x1bf));var _0x0327=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x3270[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require('multer');var util=require(_0x0327('0x0'));var path=require(_0x0327('0x1'));var timeout=require(_0x0327('0x2'));var express=require(_0x0327('0x3'));var router=express[_0x0327('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0327('0x5'));var config=require(_0x0327('0x6'));var controller=require('./chatGroup.controller');router[_0x0327('0x7')]('/',auth[_0x0327('0x8')](),controller[_0x0327('0x9')]);router[_0x0327('0x7')](_0x0327('0xa'),auth['isAuthenticated'](),controller[_0x0327('0xb')]);router[_0x0327('0x7')](_0x0327('0xc'),auth[_0x0327('0x8')](),controller['show']);router[_0x0327('0x7')]('/:id/unread',auth[_0x0327('0x8')](),controller[_0x0327('0xd')]);router[_0x0327('0x7')](_0x0327('0xe'),auth['isAuthenticated'](),controller[_0x0327('0xf')]);router[_0x0327('0x7')]('/:id/messages',auth[_0x0327('0x8')](),controller[_0x0327('0x10')]);router['post']('/',auth[_0x0327('0x8')](),controller[_0x0327('0x11')]);router[_0x0327('0x12')](_0x0327('0xe'),auth['isAuthenticated'](),controller[_0x0327('0x13')]);router['post']('/:id/messages',auth[_0x0327('0x8')](),controller[_0x0327('0x14')]);router[_0x0327('0x15')](_0x0327('0xc'),auth[_0x0327('0x8')](),controller[_0x0327('0x16')]);router[_0x0327('0x17')](_0x0327('0xc'),auth[_0x0327('0x8')](),controller[_0x0327('0x18')]);router[_0x0327('0x17')](_0x0327('0xe'),auth[_0x0327('0x8')](),controller[_0x0327('0x19')]);module[_0x0327('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f3d652b..16b1ca5 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 _0xe9e8=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize'];(function(_0x3a05eb,_0x1715d6){var _0x485e33=function(_0x5a37eb){while(--_0x5a37eb){_0x3a05eb['push'](_0x3a05eb['shift']());}};_0x485e33(++_0x1715d6);}(_0xe9e8,0x6b));var _0x8e9e=function(_0x36686a,_0x38cc45){_0x36686a=_0x36686a-0x0;var _0x7e74ab=_0xe9e8[_0x36686a];return _0x7e74ab;};'use strict';var Sequelize=require(_0x8e9e('0x0'));module[_0x8e9e('0x1')]={'closed':{'type':Sequelize[_0x8e9e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8e9e('0x3')]},'ratingType':{'type':Sequelize[_0x8e9e('0x4')](_0x8e9e('0x5'),_0x8e9e('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8e9e('0x7')]},'pathTranscript':{'type':Sequelize[_0x8e9e('0x7')]},'mailTranscript':{'type':Sequelize[_0x8e9e('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8e9e('0x8')]},'secondDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'thirdDisposition':{'type':Sequelize[_0x8e9e('0x8')]},'note':{'type':Sequelize[_0x8e9e('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x8e9e('0x8')]},'osName':{'type':Sequelize[_0x8e9e('0x8')]},'osVersion':{'type':Sequelize[_0x8e9e('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8e9e('0x8')]},'deviceType':{'type':Sequelize[_0x8e9e('0x8')]},'referer':{'type':Sequelize[_0x8e9e('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x8e9e('0x7')](_0x8e9e('0x9'))},'read1stAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgAt':{'type':Sequelize[_0x8e9e('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x8e9e('0x4')]('in',_0x8e9e('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8e9e('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x8e9e('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x2547=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports'];(function(_0x20a635,_0x2ac662){var _0x4582dd=function(_0xef0daa){while(--_0xef0daa){_0x20a635['push'](_0x20a635['shift']());}};_0x4582dd(++_0x2ac662);}(_0x2547,0x1cd));var _0x7254=function(_0x462df0,_0x4f1f46){_0x462df0=_0x462df0-0x0;var _0x640c67=_0x2547[_0x462df0];return _0x640c67;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'closed':{'type':Sequelize[_0x7254('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7254('0x2')]},'ratingType':{'type':Sequelize[_0x7254('0x3')](_0x7254('0x4'),_0x7254('0x5')),'defaultValue':_0x7254('0x4')},'ratingMessage':{'type':Sequelize[_0x7254('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7254('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7254('0x8')]},'disposition':{'type':Sequelize[_0x7254('0x7')]},'secondDisposition':{'type':Sequelize[_0x7254('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7254('0x7')]},'browserName':{'type':Sequelize[_0x7254('0x7')]},'browserVersion':{'type':Sequelize[_0x7254('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x7254('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x7254('0x6')]},'customerIp':{'type':Sequelize[_0x7254('0x7')]},'formData':{'type':Sequelize[_0x7254('0x6')](_0x7254('0x9'))},'read1stAt':{'type':Sequelize[_0x7254('0x8')]},'lastMsgAt':{'type':Sequelize[_0x7254('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x7254('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x7254('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x7254('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 1872527..f2fb0e9 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 _0xa9e0=['createPdfFromHTML','err','rimraf','zip-dir','request-promise','mustache','path','ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','render','merge','body','contact','agent','account','Users','fullname','Tags','TagIds','split','forEach','push','catch','waiting','answered','unmanaged','abandoned','closed','UserId','talking','disposition','total','index','map','ChatInteraction','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','select','field','from','u.fullname','user_has_chat_interactions','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','keys','compact','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','group','i.id','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','options','create','describe','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','attachmentUpload','file','originalname','filename','Attachment','Unauthorized','findOne','attachId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','hasOwnProperty','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','spread','color','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x1f21bc,_0x4b89b8){var _0x115182=function(_0x366734){while(--_0x366734){_0x1f21bc['push'](_0x1f21bc['shift']());}};_0x115182(++_0x4b89b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var rimraf=require(_0x0a9e('0x0'));var zipdir=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x3'));var util=require('util');var path=require(_0x0a9e('0x4'));var ejs=require(_0x0a9e('0x5'));var fs=require('fs');var _=require(_0x0a9e('0x6'));var squel=require(_0x0a9e('0x7'));var Redis=require(_0x0a9e('0x8'));var qs=require('../../components/parsers/qs');var as=require(_0x0a9e('0x9'));var pdf=require(_0x0a9e('0xa'));var logger=require(_0x0a9e('0xb'))('api');var config=require('../../config/environment');var db=require(_0x0a9e('0xc'))['db'];config['redis']=_['defaults'](config[_0x0a9e('0xd')],{'host':_0x0a9e('0xe'),'port':0x18eb});var socket=require(_0x0a9e('0xf'))(new Redis(config[_0x0a9e('0xd')]));require(_0x0a9e('0x10'))[_0x0a9e('0x11')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0x0a9e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x13')](_0x36471c,_0x26d672)[_0x0a9e('0x14')](function(_0x281129){logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x17')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x18'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x19')]){if(_0x281129[_0x0a9e('0x19')]['code']===0x1f4){logger[_0x0a9e('0x19')]('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x5db4b0(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}logger[_0x0a9e('0x19')](_0x0a9e('0x16'),_0xd5b662,_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);return _0x69aeb7(_0x281129[_0x0a9e('0x19')][_0x0a9e('0x1a')]);}else{logger[_0x0a9e('0x15')](_0x0a9e('0x16'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1b')][_0x0a9e('0x1a')]);}})['catch'](function(_0x20f109){logger['error']('ChatInteraction,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1c')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1d')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1e')](_0x3b45bc)[_0x0a9e('0x1f')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x20')]===_0x0a9e('0x21')&&typeof _0x5ea472[_0x0a9e('0x22')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x23')]:_0x5ea472[_0x0a9e('0x20')]+_0x5ea472[_0x0a9e('0x22')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1e')](_0x140511);return _0x16b1ca[_0x0a9e('0x24')](_0x0a9e('0x25'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x26')](_0x3652a7)[_0x0a9e('0x14')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x27')]()[_0x0a9e('0x14')](function(){_0x15b200[_0x0a9e('0x1e')](0xcc)[_0x0a9e('0x1d')]();});}};}function handleEntityNotFound(_0x296f41){return function(_0x2e8759){if(!_0x2e8759){_0x296f41[_0x0a9e('0x1c')](0x194);}return _0x2e8759;};}function handleError(_0x540530,_0x426950){_0x426950=_0x426950||0x1f4;return function(_0x5d1e0e){logger[_0x0a9e('0x19')](_0x5d1e0e[_0x0a9e('0x28')]);if(_0x5d1e0e[_0x0a9e('0x29')]){delete _0x5d1e0e[_0x0a9e('0x29')];}_0x540530[_0x0a9e('0x1e')](_0x426950)['send'](_0x5d1e0e);};}function getMustacheRender(_0x66c1d2,_0x46f0a5){return Mustache[_0x0a9e('0x2a')](_0x66c1d2,_[_0x0a9e('0x2b')](_0x46f0a5[_0x0a9e('0x2c')],{'contact':_0x46f0a5[_0x0a9e('0x2d')],'message':_0x46f0a5[_0x0a9e('0x1a')],'agent':_0x46f0a5[_0x0a9e('0x2e')],'interaction':_0x46f0a5['interaction'],'account':_0x46f0a5[_0x0a9e('0x2f')]}))||'';}function getInteractionUsers(_0x5e7238,_0x2cc7a0){return new BPromise(function(_0x14b13f,_0x2b7e7f){try{if(_0x2cc7a0[_0x5e7238['id']]){_0x5e7238[_0x0a9e('0x30')]=_['map'](_0x2cc7a0[_0x5e7238['id']],function(_0x191e91){return{'id':_0x191e91['id'],'fullname':_0x191e91[_0x0a9e('0x31')]};});}}catch(_0x1fa90d){_0x2b7e7f(_0x1fa90d);}_0x14b13f(_0x5e7238);});}function getInteractionTags(_0x15de0e,_0x4853b1){return new BPromise(function(_0x54135e,_0x1e8694){try{if(_0x15de0e['TagIds']){_0x15de0e[_0x0a9e('0x32')]=[];_0x15de0e[_0x0a9e('0x33')][_0x0a9e('0x34')](',')[_0x0a9e('0x35')](function(_0x4f41ae){_0x15de0e[_0x0a9e('0x32')][_0x0a9e('0x36')](_0x4853b1[_0x4f41ae]);});}delete _0x15de0e[_0x0a9e('0x33')];}catch(_0x533942){_0x1e8694(_0x533942);}_0x54135e(_0x15de0e);});}function updateChatInteraction(_0x1dbf74,_0x1a180b,_0x289467){return new BPromise(function(_0x4c1c0e,_0x546ef8){return getInteractionUsers(_0x1dbf74,_0x289467)[_0x0a9e('0x14')](function(_0x40d766){return getInteractionTags(_0x40d766,_0x1a180b);})['then'](function(_0x2b814e){return getStateInteraction(_0x2b814e);})[_0x0a9e('0x14')](function(_0x2e1b3a){_0x4c1c0e(_0x2e1b3a);})[_0x0a9e('0x37')](function(_0x4b38d9){_0x546ef8(_0x4b38d9);});});}function getStateInteraction(_0x5a594b){return new BPromise(function(_0x15e37d){_0x5a594b[_0x0a9e('0x38')]=0x0;_0x5a594b['talking']=0x0;_0x5a594b[_0x0a9e('0x39')]=0x0;_0x5a594b[_0x0a9e('0x3a')]=0x0;_0x5a594b[_0x0a9e('0x3b')]=0x0;_0x5a594b['total']=0x0;if(!_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x38')]+=0x1;}if(!_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x3e')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3f')]===_0x0a9e('0x3b')){_0x5a594b[_0x0a9e('0x3b')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&!_0x5a594b['UserId']&&_0x5a594b['disposition']){_0x5a594b[_0x0a9e('0x3a')]+=0x1;if(_0x5a594b[_0x0a9e('0x38')]){_0x5a594b[_0x0a9e('0x38')]-=0x1;}}else if(_0x5a594b[_0x0a9e('0x3c')]&&_0x5a594b[_0x0a9e('0x3d')]){_0x5a594b[_0x0a9e('0x39')]+=0x1;if(_0x5a594b[_0x0a9e('0x3e')]){_0x5a594b[_0x0a9e('0x3e')]-=0x1;}}_0x5a594b[_0x0a9e('0x40')]+=0x1;_0x15e37d(_0x5a594b);});}exports[_0x0a9e('0x41')]=function(_0x2c2cb0,_0x35ed4a){var _0x5026aa={},_0x117c99={},_0x138b8b={'count':0x0,'rows':[]};var _0xdd268f=_[_0x0a9e('0x42')](db[_0x0a9e('0x43')][_0x0a9e('0x44')],function(_0x21eb86){return{'name':_0x21eb86[_0x0a9e('0x45')],'type':_0x21eb86['type'][_0x0a9e('0x46')]};});_0x117c99['model']=_[_0x0a9e('0x42')](_0xdd268f,_0x0a9e('0x29'));_0x117c99[_0x0a9e('0x47')]=_['keys'](_0x2c2cb0[_0x0a9e('0x47')]);_0x117c99[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x117c99[_0x0a9e('0x4a')],_0x117c99[_0x0a9e('0x47')]);_0x5026aa[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x117c99['model'],qs[_0x0a9e('0x4c')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x5026aa[_0x0a9e('0x4b')]=_0x5026aa[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x5026aa[_0x0a9e('0x4b')]:_0x117c99[_0x0a9e('0x4a')];if(!_0x2c2cb0[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x5026aa[_0x0a9e('0x22')]=qs['limit'](_0x2c2cb0['query']['limit']);_0x5026aa[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x5026aa[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x5026aa['where']=qs['filters'](_['pick'](_0x2c2cb0[_0x0a9e('0x47')],_0x117c99[_0x0a9e('0x48')]),_0xdd268f);var _0x14d602=[];var _0x5bb3ed=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('id')['field']('name')[_0x0a9e('0x52')]('color')[_0x0a9e('0x53')]('tools_tags');var _0x2e5e62=squel[_0x0a9e('0x51')]()[_0x0a9e('0x52')]('u.id')[_0x0a9e('0x52')](_0x0a9e('0x54'))['field']('ui.ChatInteractionId')[_0x0a9e('0x53')](_0x0a9e('0x55'),'ui')['left_join'](_0x0a9e('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x211ef9=squel['select']()[_0x0a9e('0x53')]('chat_interactions','i')['left_join']('cm_contacts','c',_0x0a9e('0x57'))['left_join'](_0x0a9e('0x56'),'o',_0x0a9e('0x58'))[_0x0a9e('0x59')](_0x0a9e('0x5a'),'a',_0x0a9e('0x5b'))[_0x0a9e('0x59')](_0x0a9e('0x5c'),'me',_0x0a9e('0x5d'))['left_join'](_0x0a9e('0x5e'),'it',_0x0a9e('0x5f'))[_0x0a9e('0x59')](_0x0a9e('0x60'),'t',_0x0a9e('0x61'));var _0x156662=squel['expr']();var _0x956fbe=[];var _0x26bc80=squel['expr']();var _0x3649cc;if(_0x2c2cb0['query'][_0x0a9e('0x62')]){_0x3649cc=as['parseSearch'](_0x2c2cb0['query']['search']);var _0x273cb5=_0x3649cc['sqlOperator'];for(var _0x2244d6=0x0;_0x2244d6<_0x3649cc[_0x0a9e('0x63')][_0x0a9e('0x4d')];_0x2244d6++){var _0x7be420=_0x3649cc[_0x0a9e('0x63')][_0x2244d6];var _0x26d7db='i';var _0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x7be420[_0x0a9e('0x52')]]);if(!_0x49eed0){switch(_0x7be420[_0x0a9e('0x52')]){case _0x0a9e('0x65'):if(_0x7be420['value']==0x1){_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420[_0x0a9e('0x52')]+_0x0a9e('0x67'));}else{_0x211ef9[_0x0a9e('0x66')]('`'+_0x7be420['field']+_0x0a9e('0x68'));}break;case _0x0a9e('0x69'):if(_0x7be420['operator']===_0x0a9e('0x6a')){if(_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')]('\x20')[_0x0a9e('0x4d')]>0x1){_0x156662[_0x273cb5](_0x0a9e('0x6c'),qs['getFullTextValue'](_0x7be420[_0x0a9e('0x6b')]),null);}else{var _0x2937e0='%'+_0x7be420[_0x0a9e('0x6b')]+'%';_0x156662[_0x273cb5]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2937e0,_0x2937e0,_0x2937e0);}}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name','ContactId']);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x6d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x72'):var _0x2e89b7=_0x7be420[_0x0a9e('0x6b')][_0x0a9e('0x34')](',')[_0x0a9e('0x42')](function(_0x320898){return Number(_0x320898);});_0x2e89b7[_0x0a9e('0x35')](function(_0x2a28c0){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x2a28c0+',%');});_0x956fbe=_['union'](_0x956fbe,_0x2e89b7);break;case _0x0a9e('0x74'):if(_0x7be420[_0x0a9e('0x75')]===_0x0a9e('0x6a')){_0x156662[_0x273cb5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x7be420[_0x0a9e('0x6b')]+'%',null);}else{_0x49eed0=_[_0x0a9e('0x64')](_0xdd268f,['name',_0x0a9e('0x3d')]);_0x7be420[_0x0a9e('0x52')]=_0x0a9e('0x3d');_0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f['value']['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}break;case _0x0a9e('0x2c'):_0x235f8f=as[_0x0a9e('0x6e')]('me',null,_0x7be420);_0x156662[_0x273cb5](_0x235f8f[_0x0a9e('0x70')],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x71')],_0x235f8f[_0x0a9e('0x6b')]['end']);break;}}else{var _0x235f8f=as[_0x0a9e('0x6e')](_0x26d7db,_0x49eed0[_0x0a9e('0x6f')],_0x7be420);_0x156662[_0x273cb5](_0x235f8f['text'],_0x235f8f[_0x0a9e('0x6b')]['start'],_0x235f8f[_0x0a9e('0x6b')][_0x0a9e('0x1d')]);}}}else{var _0x4c46c1=_(_0x2c2cb0[_0x0a9e('0x47')])[_0x0a9e('0x76')]()[_0x0a9e('0x42')](function(_0x317c0c){return _['some'](_0xdd268f,[_0x0a9e('0x29'),_0x317c0c])?_0x317c0c:undefined;})[_0x0a9e('0x77')]()[_0x0a9e('0x6b')]();if(!_[_0x0a9e('0x78')](_0x4c46c1)){_0x4c46c1['forEach'](function(_0x109ccb){if(_0x109ccb===_0x0a9e('0x79')){_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),[]['concat'](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]));}else if(_0x109ccb===_0x0a9e('0x7c')){var _0x30a4c7=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7e')];var _0x40fc56=JSON[_0x0a9e('0x7d')](_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb])[_0x0a9e('0x7f')];_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x80'),_0x30a4c7,_0x40fc56);}else{if(_0x2c2cb0[_0x0a9e('0x47')][_0x109ccb]===_0x0a9e('0x81')){_0x211ef9['where']('i.'+_0x109ccb+_0x0a9e('0x82'));}else{_0x211ef9[_0x0a9e('0x7a')]('i.'+_0x109ccb+_0x0a9e('0x83'),_0x2c2cb0['query'][_0x109ccb]);}}});}if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x84')]==0x1){_0x211ef9['having']('`unreadMessages`\x20=\x200');}else{_0x211ef9[_0x0a9e('0x66')](_0x0a9e('0x85'));}}if(_0x2c2cb0['query'][_0x0a9e('0x86')]){_0x956fbe=_['isArray'](_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')])?_0x2c2cb0['query'][_0x0a9e('0x86')]:new Array(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x86')]);_0x956fbe[_0x0a9e('0x35')](function(_0x3755fe){_0x26bc80['or'](_0x0a9e('0x73'),'%,'+_0x3755fe+',%');});}if(_0x2c2cb0[_0x0a9e('0x47')]['filter']){var _0x2973d3=_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x87')][_0x0a9e('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x0a9e('0x89')](_0x2973d3)){_0x156662['or'](_0x0a9e('0x8a'),_0x2973d3+'%');}else{_0x156662['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x8b')](_0x2973d3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x2973d3+'%');}}}_0x211ef9[_0x0a9e('0x7a')](_0x156662);_0x211ef9[_0x0a9e('0x8c')](_0x0a9e('0x8d'));var _0x385d52={'type':db['Sequelize']['QueryTypes'][_0x0a9e('0x8e')],'raw':!![]};var _0x2b9c01=_0x211ef9[_0x0a9e('0x8f')]();_0x2b9c01['field'](_0x0a9e('0x8d'));_0x2b9c01[_0x0a9e('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x5026aa[_0x0a9e('0x4f')]){_0x5026aa['order']['forEach'](function(_0x4dc6b3){var _0x81d748=_0x4dc6b3[0x0]===_0x0a9e('0x90')?_0x4dc6b3[0x0]:'i.'+_0x4dc6b3[0x0];_0x211ef9[_0x0a9e('0x4f')](_0x81d748,_0x4dc6b3[0x1]===_0x0a9e('0x91')?![]:!![]);});}if(!_[_0x0a9e('0x78')](_0x956fbe)){_0x211ef9[_0x0a9e('0x66')](_0x26bc80);_0x2b9c01['where'](_0x0a9e('0x92'),_0x956fbe);}BPromise['resolve']()[_0x0a9e('0x14')](function(){if(!_0x3649cc){if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return;_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x93'));return;}if(_0x2c2cb0[_0x0a9e('0x94')]['role']!==_0x0a9e('0x2e'))return;return _0x2c2cb0[_0x0a9e('0x94')][_0x0a9e('0x95')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x14')](function(_0x255e49){if(_[_0x0a9e('0x78')](_0x255e49)){_0x2b9c01[_0x0a9e('0x7a')](_0x0a9e('0x96'));_0x211ef9['where'](_0x0a9e('0x96'));}else{_0x2b9c01[_0x0a9e('0x7a')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0a9e('0x42')](_0x255e49,'id'));_0x211ef9[_0x0a9e('0x7a')](_0x0a9e('0x7b'),_['map'](_0x255e49,'id'));}});})[_0x0a9e('0x14')](function(){if(_0x2c2cb0['user'][_0x0a9e('0x97')]===_0x0a9e('0x2e')&&!_0x3649cc&&!_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x79')])return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x2b9c01[_0x0a9e('0x99')](),_0x385d52);})[_0x0a9e('0x14')](function(_0x501050){_0x138b8b[_0x0a9e('0x23')]=_0x501050[_0x0a9e('0x4d')];if(_0x138b8b[_0x0a9e('0x23')]===0x0)return[];return db[_0x0a9e('0x98')][_0x0a9e('0x47')](_0x5bb3ed[_0x0a9e('0x99')](),_0x385d52)[_0x0a9e('0x14')](function(_0x33f0c9){_0x14d602=_[_0x0a9e('0x9a')](_0x33f0c9,'id');_0x385d52=_[_0x0a9e('0x2b')](_0x385d52,{'model':db[_0x0a9e('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2c2cb0[_0x0a9e('0x47')][_0x0a9e('0x4c')]){_0x5026aa['attributes'][_0x0a9e('0x35')](function(_0x23e2bd){_0x211ef9[_0x0a9e('0x52')]('i.'+_0x23e2bd);});}else{_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9b'),'unreadMessages');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9c'),'Account.key');_0x211ef9[_0x0a9e('0x52')]('a.mandatoryDisposition',_0x0a9e('0x9d'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0x9e'),_0x0a9e('0x90'));_0x211ef9['field'](_0x0a9e('0x9f'));_0x211ef9['field'](_0x0a9e('0xa0'),_0x0a9e('0xa1'));_0x211ef9['field'](_0x0a9e('0xa2'),_0x0a9e('0xa3'));_0x211ef9[_0x0a9e('0x52')]('c.email','Contact.email');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa4'),_0x0a9e('0xa5'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x211ef9['field'](_0x0a9e('0xaa'),'Owner.fullname');_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xab'),_0x0a9e('0xac'));_0x211ef9[_0x0a9e('0x52')](_0x0a9e('0xad'),'TagIds');}if(_0x5026aa[_0x0a9e('0x22')])_0x211ef9[_0x0a9e('0x22')](_0x5026aa[_0x0a9e('0x22')]);if(_0x5026aa[_0x0a9e('0x20')])_0x211ef9[_0x0a9e('0x20')](_0x5026aa['offset']);return db['sequelize'][_0x0a9e('0x47')](_0x211ef9['toString'](),_0x385d52);})[_0x0a9e('0x14')](function(_0x4658df){if(_0x4658df[_0x0a9e('0x4d')]>0x0)_0x2e5e62[_0x0a9e('0x7a')](_0x0a9e('0xae'),_[_0x0a9e('0x42')](_0x4658df,'id'));return db['sequelize']['query'](_0x2e5e62[_0x0a9e('0x99')](),_0x385d52)['then'](function(_0x2469d1){var _0x5c689c=_[_0x0a9e('0xaf')](_0x2469d1,'ChatInteractionId');var _0x558d60=[];_0x4658df[_0x0a9e('0x35')](function(_0xb8db59){_0x558d60['push'](updateChatInteraction(_0xb8db59,_0x14d602,_0x5c689c));});return BPromise[_0x0a9e('0xb0')](_0x558d60);});});})[_0x0a9e('0x14')](function(_0x15c6b9){_0x138b8b[_0x0a9e('0xb1')]=_0x15c6b9;return _0x138b8b;})[_0x0a9e('0x14')](respondWithFilteredResult(_0x35ed4a,_0x5026aa))['catch'](handleError(_0x35ed4a,null));};exports['show']=function(_0x16449b,_0x22286c){var _0x41c8cd={'raw':![],'where':{'id':_0x16449b[_0x0a9e('0xb2')]['id']}},_0x24beb6={};_0x24beb6['model']=_[_0x0a9e('0x76')](db[_0x0a9e('0x43')]['rawAttributes']);_0x24beb6[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x16449b[_0x0a9e('0x47')]);_0x24beb6[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],_0x24beb6[_0x0a9e('0x47')]);_0x41c8cd[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x24beb6[_0x0a9e('0x4a')],qs['fields'](_0x16449b[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x41c8cd[_0x0a9e('0x4b')]=_0x41c8cd[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x41c8cd['attributes']:_0x24beb6['model'];if(_0x16449b[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x41c8cd[_0x0a9e('0xb4')]=[{'all':!![]}];}_0x41c8cd=_[_0x0a9e('0x2b')]({},_0x41c8cd,_0x16449b[_0x0a9e('0xb5')]);return db['ChatInteraction'][_0x0a9e('0x64')](_0x41c8cd)[_0x0a9e('0x14')](handleEntityNotFound(_0x22286c,null))[_0x0a9e('0x14')](respondWithResult(_0x22286c,null))['catch'](handleError(_0x22286c,null));};exports[_0x0a9e('0xb6')]=function(_0x59aa7b,_0x2144ca){return db['ChatInteraction'][_0x0a9e('0xb6')](_0x59aa7b[_0x0a9e('0x2c')],{})[_0x0a9e('0x14')](respondWithResult(_0x2144ca,0xc9))['catch'](handleError(_0x2144ca,null));};exports[_0x0a9e('0x26')]=function(_0x5ed560,_0x4383da){if(_0x5ed560[_0x0a9e('0x2c')]['id']){delete _0x5ed560[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x5ed560[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x14')](saveUpdates(_0x5ed560[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x4383da,null))[_0x0a9e('0x37')](handleError(_0x4383da,null));};exports[_0x0a9e('0x27')]=function(_0x2415fe,_0x399def){return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x2415fe['params']['id']}})['then'](handleEntityNotFound(_0x399def,null))[_0x0a9e('0x14')](removeEntity(_0x399def,null))['catch'](handleError(_0x399def,null));};exports[_0x0a9e('0xb7')]=function(_0x3428c9,_0x5d6b69){return db[_0x0a9e('0x43')][_0x0a9e('0xb7')]()[_0x0a9e('0x14')](respondWithResult(_0x5d6b69,null))[_0x0a9e('0x37')](handleError(_0x5d6b69,null));};exports['createVidaooSession']=function(_0x148fd9,_0x26cb76){var _0x374f0b=_0x148fd9[_0x0a9e('0xb2')]['id'];var _0x5d0e1f;var _0x19e9ed;var _0x1a0b08;return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x374f0b}})[_0x0a9e('0x14')](function(_0x270df8){_0x5d0e1f=_0x270df8;return db[_0x0a9e('0xb8')]['findOne']({'where':{'id':_0x270df8[_0x0a9e('0x79')]},'attributes':['id',_0x0a9e('0xb9'),_0x0a9e('0xba'),_0x0a9e('0xbb'),_0x0a9e('0xbc'),'vidaooMetadata'],'raw':!![]});})[_0x0a9e('0x14')](function(_0x289e65){if(_0x289e65&&_0x289e65['vidaooApiKey']&&_0x289e65[_0x0a9e('0xba')]){_0x19e9ed=_0x289e65;var _0x1fcfe6={'interaction':{'id':_0x374f0b},'agent':{'id':_0x148fd9[_0x0a9e('0x94')]['id'],'name':_0x148fd9['user']['name'],'fullname':_0x148fd9['user'][_0x0a9e('0x31')],'email':_0x148fd9[_0x0a9e('0x94')]['email']},'contact':_0x148fd9[_0x0a9e('0x2c')][_0x0a9e('0x2d')],'account':_0x148fd9[_0x0a9e('0x2c')]['account']};var _0x9fc93e={'rejectUnauthorized':![],'method':_0x0a9e('0xbd'),'url':_0x0a9e('0xbe'),'headers':{'X-APIKEY':_0x289e65[_0x0a9e('0xb9')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x148fd9[_0x0a9e('0x94')][_0x0a9e('0xbf')]],'buttons':null,'topic':_0x19e9ed[_0x0a9e('0xbb')],'note':_[_0x0a9e('0xc0')](_0x19e9ed[_0x0a9e('0xbc')])?null:getMustacheRender(_0x19e9ed['vidaooNote'],_0x1fcfe6),'metadata':null},'redirect':_0x0a9e('0xc1'),'json':!![]};try{if(!_['isNull'](_0x19e9ed[_0x0a9e('0xc2')])){var _0x4093e6=getMustacheRender(_0x19e9ed[_0x0a9e('0xc2')],_0x1fcfe6);var _0x3cf222=JSON[_0x0a9e('0x7d')](_0x4093e6);_0x9fc93e[_0x0a9e('0x2c')]['metadata']=_0x3cf222;}}catch(_0x1a0314){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))](_0x0a9e('0xc5'));}return rp(_0x9fc93e);}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xc6'));}})[_0x0a9e('0x14')](function(_0x1c9539){_0x1a0b08=_0x1c9539;if(_0x1a0b08['id']){var _0xc2e7b={'body':_0x1a0b08[_0x0a9e('0xc7')],'ChatWebsiteId':_0x19e9ed['id'],'ChatInteractionId':_0x5d0e1f['id'],'direction':_0x0a9e('0xc8'),'UserId':_0x148fd9[_0x0a9e('0x94')]['id']};return db[_0x0a9e('0xc9')][_0x0a9e('0xb6')](_0xc2e7b,{});}else{throw new db['Sequelize'][(_0x0a9e('0xc4'))](_0x0a9e('0xca'));}})[_0x0a9e('0x14')](function(){return _0x5d0e1f[_0x0a9e('0xcb')]({'vidaooSessionId':_0x1a0b08['id']});})[_0x0a9e('0x14')](respondWithResult(_0x26cb76,null))[_0x0a9e('0x37')](handleError(_0x26cb76,null));};exports[_0x0a9e('0xcc')]=function(_0x20ae21,_0x566b90){if(_0x20ae21[_0x0a9e('0x2c')]['id']){delete _0x20ae21[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x20ae21[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69')}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x566b90,null))[_0x0a9e('0x14')](saveUpdates(_0x20ae21[_0x0a9e('0x2c')],null))[_0x0a9e('0x14')](respondWithResult(_0x566b90,null))[_0x0a9e('0x37')](handleError(_0x566b90,null));};exports[_0x0a9e('0xce')]=function(_0x451010,_0x5a7dad){if(_0x451010[_0x0a9e('0x2c')]['id']){delete _0x451010[_0x0a9e('0x2c')]['id'];}return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x451010[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](function(_0x5cb48d){if(!_0x5cb48d){logger[_0x0a9e('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,'entity\x20not\x20found');_0x5a7dad[_0x0a9e('0x1c')](0x194);}else{if(_0x5cb48d[_0x0a9e('0x3d')]){throw new db[(_0x0a9e('0xc3'))][(_0x0a9e('0xc4'))]('Interaction\x20already\x20assigned');}}return _0x5cb48d;})[_0x0a9e('0x14')](function(_0x309fa9){if(_0x309fa9){return _0x309fa9[_0x0a9e('0x26')]({'closed':_0x451010[_0x0a9e('0x2c')][_0x0a9e('0x3c')],'disposition':_0x451010['body']['disposition']})[_0x0a9e('0x14')](function(_0x33bcb2){return _0x33bcb2;});}})[_0x0a9e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x0a9e('0xce'),_0x451010[_0x0a9e('0x2c')],client9004);})[_0x0a9e('0x14')](respondWithResult(_0x5a7dad,null))['catch'](handleError(_0x5a7dad,null));};exports[_0x0a9e('0xcf')]=function(_0x2bf85d,_0x15ba6b){_0x2bf85d['body'][_0x0a9e('0x29')]=_0x2bf85d[_0x0a9e('0xd0')][_0x0a9e('0xd1')];_0x2bf85d['body']['basename']=_0x2bf85d['file'][_0x0a9e('0xd2')];_0x2bf85d[_0x0a9e('0x2c')][_0x0a9e('0x6f')]=_0x2bf85d[_0x0a9e('0xd0')]['mimetype'];return db[_0x0a9e('0xd3')]['create'](_0x2bf85d[_0x0a9e('0x2c')])[_0x0a9e('0x14')](respondWithResult(_0x15ba6b,0xc9))[_0x0a9e('0x37')](handleError(_0x15ba6b,null));};exports['attachmentDownload']=function(_0x33b4b3,_0x33a26c){return db[_0x0a9e('0x43')]['findOne']({'where':{'id':_0x33b4b3[_0x0a9e('0xb2')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x33a26c,null))[_0x0a9e('0x14')](function(_0x5c57e1){if(_0x5c57e1){if(_0x5c57e1[_0x0a9e('0x3c')]){return _0x33a26c['status'](0x193)[_0x0a9e('0x1f')]({'status':0x193,'message':_0x0a9e('0xd4')});}return db[_0x0a9e('0xd3')][_0x0a9e('0xd5')]({'where':{'id':_0x33b4b3[_0x0a9e('0x47')][_0x0a9e('0xd6')]},'raw':!![]})[_0x0a9e('0x14')](handleEntityNotFound(_0x33a26c,null));}})['then'](function(_0x35ace3){if(_0x35ace3){var _0x1c9ea2=_0x35ace3['ChatOfflineMessageId']!==null;var _0xf4fb77=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0xd8'));if(_0x1c9ea2){_0xf4fb77=path[_0x0a9e('0xd7')](_0xf4fb77,_0x0a9e('0xd9'));}var _0x569528=path[_0x0a9e('0xd7')](_0xf4fb77,_0x35ace3[_0x0a9e('0xda')]);return _0x33a26c[_0x0a9e('0xdb')](_0x569528);}})[_0x0a9e('0x37')](handleError(_0x33a26c,null));};exports[_0x0a9e('0xdc')]=function(_0x29fdfe,_0x3ba897){var _0x74d9b8=null;var _0x22767f=null;var _0x426c3c=null;if(_0x29fdfe['body']['id']){delete _0x29fdfe[_0x0a9e('0x2c')]['id'];}if(_0x29fdfe['body'][_0x0a9e('0xdd')]){_0x426c3c=path[_0x0a9e('0xd7')](config[_0x0a9e('0xde')],_0x0a9e('0xdf'),util[_0x0a9e('0xe0')](_0x0a9e('0xe1'),Date['now']()));_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe2')]=_0x426c3c;}return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x29fdfe[_0x0a9e('0xb2')]['id']},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xe3'),'include':[{'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74')}]}]})[_0x0a9e('0x14')](handleEntityNotFound(_0x3ba897,null))[_0x0a9e('0x14')](saveUpdates(_0x29fdfe['body'],null))[_0x0a9e('0x14')](function(_0x228c10){if(_0x228c10){_0x74d9b8=_0x228c10;return db[_0x0a9e('0xb8')][_0x0a9e('0x64')]({'where':{'id':_0x74d9b8[_0x0a9e('0x79')]}});}})[_0x0a9e('0x14')](function(_0x8120e){if(_0x8120e){_0x22767f=_0x8120e;return db['CmContact']['find']({'where':{'id':_0x74d9b8[_0x0a9e('0x6d')]}});}})[_0x0a9e('0x14')](function(_0x1f4929){if(_0x1f4929){if(_0x426c3c){var _0x1bf692=null;for(var _0x40e2da=0x1;_0x40e2da<_0x74d9b8[_0x0a9e('0xe3')][_0x0a9e('0x4d')];++_0x40e2da){_0x1bf692=_0x74d9b8['Messages'][_0x40e2da];var _0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');var _0x54f0b8=_0x29fdfe[_0x0a9e('0x2c')][_0x0a9e('0xe7')]||util[_0x0a9e('0xe0')]('%s%d',_0x0a9e('0xe8'),_0x1bf692[_0x0a9e('0x6d')]);switch(_0x22767f[_0x0a9e('0xe9')]){case _0x0a9e('0xea'):_0x39ea62=_0x1bf692['UserId']?util[_0x0a9e('0xe0')](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692[_0x0a9e('0x3d')]):_0x0a9e('0xe6');break;case _0x0a9e('0xeb'):_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?_0x1bf692[_0x0a9e('0x74')]['alias']||_0x1bf692[_0x0a9e('0x74')][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;case _0x0a9e('0xec'):_0x39ea62=_0x1bf692['UserId']?_0x1bf692['User'][_0x0a9e('0x31')]:_0x0a9e('0xe6');break;default:_0x39ea62=_0x1bf692[_0x0a9e('0x3d')]?util['format'](_0x0a9e('0xe4'),_0x22767f[_0x0a9e('0xe5')],_0x1bf692['UserId']):_0x0a9e('0xe6');}var _0x5d19b1=util[_0x0a9e('0xe0')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1bf692['createdAt'])['format'](_0x0a9e('0xed')),_0x1bf692[_0x0a9e('0xee')]==='in'?_0x54f0b8:_0x39ea62,_0x1bf692[_0x0a9e('0x2c')]);if(!_0x1bf692[_0x0a9e('0xef')]){fs[_0x0a9e('0xf0')](_0x426c3c,_0x5d19b1);}}return db[_0x0a9e('0xf1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0a9e('0xf2')],'as':_0x0a9e('0xf3'),'raw':!![],'include':[{'model':db[_0x0a9e('0xf4')],'as':_0x0a9e('0xf4'),'raw':!![]}]}]});}}})[_0x0a9e('0x14')](function(_0x18dccf){if(!_0x18dccf||!_0x18dccf[_0x0a9e('0xf3')]||!_0x29fdfe['body'])return _0x74d9b8;var _0x49baaa=_0x18dccf[_0x0a9e('0xf5')]();return respondWithRpcPromise('SendMail',_0x0a9e('0xf6'),{'account':_0x49baaa,'message':{'from':util[_0x0a9e('0xe0')](_0x0a9e('0xf7'),_0x18dccf[_0x0a9e('0x29')],_0x18dccf[_0x0a9e('0xbf')]||_0x18dccf[_0x0a9e('0xf3')]['user']),'to':_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x0a9e('0xe0')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x29fdfe[_0x0a9e('0x2c')]['mailTranscript']),'attachments':[{'path':_0x426c3c}]}})['then'](function(){return _0x74d9b8;})[_0x0a9e('0x37')](function(_0x4a7a3c){logger[_0x0a9e('0x19')](_0x4a7a3c);});})[_0x0a9e('0x14')](respondWithStatusCode(_0x3ba897,0xc8))[_0x0a9e('0x37')](handleError(_0x3ba897,null));};exports['addMessage']=function(_0x4152cd,_0x1209c4){return db[_0x0a9e('0xc9')]['find']({'where':{'id':_0x4152cd['params']['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1209c4,null))[_0x0a9e('0x14')](function(_0x89d2cb){if(_0x89d2cb){return _0x89d2cb[_0x0a9e('0xf8')](_0x4152cd[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x4152cd[_0x0a9e('0x2c')],[_0x0a9e('0xf9'),'id'])||{});}})[_0x0a9e('0x14')](respondWithResult(_0x1209c4,null))['catch'](handleError(_0x1209c4,null));};exports['getMessages']=function(_0x558171,_0x5975fa){var _0x19dcc2={'raw':![],'where':{}};var _0x2ce30f={};var _0x2d21c7={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x558171[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5975fa,null))['then'](function(_0x5c3ecf){if(_0x5c3ecf){_0x2ce30f[_0x0a9e('0x4a')]=_[_0x0a9e('0x76')](db['ChatMessage'][_0x0a9e('0x44')]);_0x2ce30f[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x558171[_0x0a9e('0x47')]);_0x2ce30f[_0x0a9e('0x48')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],_0x2ce30f[_0x0a9e('0x47')]);_0x19dcc2[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0x2ce30f[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x558171['query'][_0x0a9e('0x4c')]));_0x19dcc2[_0x0a9e('0x4b')]=_0x19dcc2[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x19dcc2[_0x0a9e('0x4b')]:_0x2ce30f[_0x0a9e('0x4a')];if(!_0x558171[_0x0a9e('0x47')][_0x0a9e('0xfb')](_0x0a9e('0x4e'))){_0x19dcc2[_0x0a9e('0x22')]=qs[_0x0a9e('0x22')](_0x558171[_0x0a9e('0x47')]['limit']);_0x19dcc2['offset']=qs[_0x0a9e('0x20')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x20')]);}_0x19dcc2[_0x0a9e('0x4f')]=qs[_0x0a9e('0x50')](_0x558171[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x19dcc2['where']=qs[_0x0a9e('0x48')](_['pick'](_0x558171[_0x0a9e('0x47')],_0x2ce30f[_0x0a9e('0x48')]));_0x19dcc2[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x5c3ecf['id'];if(_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x19dcc2[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x19dcc2[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x19dcc2[_0x0a9e('0x4b')],function(_0x8231e5){var _0x43111e={};_0x43111e[_0x8231e5]={'$like':'%'+_0x558171[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x43111e;})});}if(_0x558171[_0x0a9e('0x47')]['$gte']){var _0x54cf62=_0x558171[_0x0a9e('0x47')][_0x0a9e('0x7e')]['split'](',');var _0x5500de={};_0x5500de[_0x54cf62[0x0]]={'$gte':moment(_0x54cf62[0x1])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))};_0x19dcc2[_0x0a9e('0x7a')]=_['merge'](_0x19dcc2[_0x0a9e('0x7a')],_0x5500de);}_0x19dcc2=_['merge']({},_0x19dcc2,_0x558171[_0x0a9e('0xb5')]);return db['ChatMessage'][_0x0a9e('0x23')]({'where':_0x19dcc2['where']})[_0x0a9e('0x14')](function(_0x21e210){_0x2d21c7[_0x0a9e('0x23')]=_0x21e210;if(_0x558171['query'][_0x0a9e('0xb3')]){_0x19dcc2['include']=[{'all':!![]}];}return db['ChatMessage'][_0x0a9e('0xfe')](_0x19dcc2);})[_0x0a9e('0x14')](function(_0x3c691f){_0x2d21c7[_0x0a9e('0xb1')]=_0x3c691f;return _0x2d21c7;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x5975fa,_0x19dcc2))[_0x0a9e('0x37')](handleError(_0x5975fa,null));};exports[_0x0a9e('0xff')]=function(_0x82504f,_0x1a3143){var _0x151f16={'where':{}},_0xd6938={},_0x98bf26={'count':0x0,'rows':[]};return db[_0x0a9e('0x43')][_0x0a9e('0xd5')]({'where':{'id':_0x82504f[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x1a3143,null))[_0x0a9e('0x14')](function(_0x643f66){if(_0x643f66){_0xd6938[_0x0a9e('0x4a')]=_['keys'](db[_0x0a9e('0xc9')][_0x0a9e('0x44')]);_0xd6938[_0x0a9e('0x47')]=_[_0x0a9e('0x76')](_0x82504f['query']);_0xd6938['filters']=_['intersection'](_0xd6938[_0x0a9e('0x4a')],_0xd6938['query']);_0x151f16[_0x0a9e('0x4b')]=_[_0x0a9e('0x49')](_0xd6938[_0x0a9e('0x4a')],qs[_0x0a9e('0x4c')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x4c')]));_0x151f16[_0x0a9e('0x4b')]=_0x151f16[_0x0a9e('0x4b')][_0x0a9e('0x4d')]?_0x151f16[_0x0a9e('0x4b')]:_0xd6938['model'];if(!_0x82504f[_0x0a9e('0x47')]['hasOwnProperty'](_0x0a9e('0x4e'))){_0x151f16['limit']=qs[_0x0a9e('0x22')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x22')]);_0x151f16['offset']=qs[_0x0a9e('0x20')](_0x82504f[_0x0a9e('0x47')]['offset']);}_0x151f16['order']=qs[_0x0a9e('0x50')](_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x50')]);_0x151f16['where']=qs['filters'](_['pick'](_0x82504f[_0x0a9e('0x47')],_0xd6938[_0x0a9e('0x48')]));_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xfc')]=_0x643f66['id'];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]){_0x151f16[_0x0a9e('0x7a')]=_[_0x0a9e('0x2b')](_0x151f16[_0x0a9e('0x7a')],{'$or':_[_0x0a9e('0x42')](_0x151f16[_0x0a9e('0x4b')],function(_0x2f4de1){var _0x13215c={};_0x13215c[_0x2f4de1]={'$like':'%'+_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x87')]+'%'};return _0x13215c;})});}_0x151f16[_0x0a9e('0x7a')][_0x0a9e('0xef')]=![];if(_0x82504f[_0x0a9e('0x47')]['id']){_0x151f16['where']['id']={'$gt':_0x82504f[_0x0a9e('0x47')]['id']};}_0x151f16=_[_0x0a9e('0x2b')]({},_0x151f16,_0x82504f[_0x0a9e('0xb5')]);return db[_0x0a9e('0xc9')][_0x0a9e('0x23')]({'where':_0x151f16[_0x0a9e('0x7a')]})['then'](function(_0x4739ed){_0x98bf26[_0x0a9e('0x23')]=_0x4739ed;_0x151f16[_0x0a9e('0xb4')]=[];if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0x100')]){_0x151f16[_0x0a9e('0xb4')][_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id','fullname','alias']});}if(_0x82504f[_0x0a9e('0x47')][_0x0a9e('0xb3')]){_0x151f16['include']=[{'all':!![]}];}return db[_0x0a9e('0xc9')][_0x0a9e('0xfe')](_0x151f16);})['then'](function(_0x1ca7c8){_0x98bf26['rows']=_0x1ca7c8;return _0x98bf26;});}})[_0x0a9e('0x14')](respondWithFilteredResult(_0x1a3143,_0x151f16))[_0x0a9e('0x37')](handleError(_0x1a3143,null));};exports['addTags']=function(_0x27a41c,_0x31ab12){return db['ChatInteraction'][_0x0a9e('0x64')]({'where':{'id':_0x27a41c[_0x0a9e('0xb2')]['id']}})['then'](handleEntityNotFound(_0x31ab12,null))[_0x0a9e('0x14')](function(_0x237994){if(_0x237994){return _0x237994[_0x0a9e('0x101')](_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')],_[_0x0a9e('0xfa')](_0x27a41c['body'],[_0x0a9e('0xf9'),'id'])||{})[_0x0a9e('0x102')](function(){return db['Tag'][_0x0a9e('0xfe')]({'attributes':['id',_0x0a9e('0x29'),_0x0a9e('0x103')],'where':{'id':_0x27a41c[_0x0a9e('0x2c')][_0x0a9e('0xf9')]}});})[_0x0a9e('0x14')](function(_0x368a12){socket['emit']('chatInteractionTags:save',{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]});return{'id':Number(_0x27a41c['params']['id']),'tags':_0x368a12||[]};});}})['then'](respondWithResult(_0x31ab12,null))[_0x0a9e('0x37')](handleError(_0x31ab12,null));};exports[_0x0a9e('0x104')]=function(_0x556344,_0x5c23aa){return db[_0x0a9e('0x43')]['find']({'where':{'id':_0x556344[_0x0a9e('0xb2')]['id']}})[_0x0a9e('0x14')](handleEntityNotFound(_0x5c23aa,null))[_0x0a9e('0x14')](function(_0x175c97){if(_0x175c97){return _0x175c97[_0x0a9e('0x104')](_0x556344[_0x0a9e('0x47')]['ids']);}})[_0x0a9e('0x14')](respondWithStatusCode(_0x5c23aa,null))[_0x0a9e('0x37')](handleError(_0x5c23aa,null));};exports['download']=function(_0x44cdb8,_0x1c0d54){var _0x2e0e9b=moment()[_0x0a9e('0x105')]()[_0x0a9e('0x99')]();var _0x2f1cc0=path[_0x0a9e('0xd7')](config['root'],_0x0a9e('0x106'),'files',_0x0a9e('0x107'));var _0xd456e6=path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'files',_0x0a9e('0x108'));var _0x4e03f5=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x2e0e9b);var _0x9c686f=util['format'](_0x0a9e('0x109'),_0x44cdb8['params']['id'],_0x2e0e9b);var _0x1d046c=path[_0x0a9e('0xd7')](_0x2f1cc0,_0x9c686f);var _0x732141=[];_0x732141[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':_0x0a9e('0x74'),'attributes':['id',_0x0a9e('0x31')],'raw':!![]});_0x732141['push']({'model':db[_0x0a9e('0xcd')],'as':_0x0a9e('0x69'),'attributes':['id',_0x0a9e('0x10a'),_0x0a9e('0x10b')],'raw':!![]});if(_0x44cdb8[_0x0a9e('0x47')]['attachments']){_0x732141[_0x0a9e('0x36')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3a459c=[{'model':db['ChatMessage'],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2c'),'createdAt',_0x0a9e('0xee'),_0x0a9e('0xef'),_0x0a9e('0x84')],'include':_0x732141}];_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0xb8')],'as':_0x0a9e('0x10c'),'attributes':['id',_0x0a9e('0x29')]});_0x3a459c[_0x0a9e('0x36')]({'model':db[_0x0a9e('0x74')],'as':'Owner','attributes':['id',_0x0a9e('0x31')]});return db[_0x0a9e('0x43')][_0x0a9e('0x64')]({'where':{'id':_0x44cdb8[_0x0a9e('0xb2')]['id']},'include':_0x3a459c})['then'](handleEntityNotFound(_0x1c0d54,null))[_0x0a9e('0x14')](function(_0x439f25){if(_0x439f25){var _0x333d3c=_0x439f25['get']({'plain':!![]});fs[_0x0a9e('0x10d')](_0x4e03f5);var _0x2191c6={'channel':_0x0a9e('0x10e'),'account':_0x333d3c['Account'][_0x0a9e('0x29')],'agent':_0x333d3c['Owner']?_0x333d3c[_0x0a9e('0x10f')][_0x0a9e('0x31')]:_0x0a9e('0x110'),'createdAt':moment(_0x333d3c[_0x0a9e('0x7c')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'closedAt':_0x333d3c['closed']?moment(_0x333d3c[_0x0a9e('0x111')])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')]():'','disposition':_0x333d3c[_0x0a9e('0x3f')],'chatInfo':{'browser':_0x333d3c[_0x0a9e('0x112')],'os':_0x333d3c[_0x0a9e('0x113')],'referer':_0x333d3c[_0x0a9e('0x114')],'customerIp':_0x333d3c[_0x0a9e('0x115')],'customerPort':_0x333d3c[_0x0a9e('0x116')]?_0x333d3c[_0x0a9e('0x116')]:_0x0a9e('0x110')},'messages':_(_0x333d3c[_0x0a9e('0xe3')])[_0x0a9e('0x117')]()[_0x0a9e('0x87')]({'secret':![]})[_0x0a9e('0x42')](function(_0x1008a1){if(_0x1008a1[_0x0a9e('0xd3')]){var _0x6276a4=path[_0x0a9e('0xd7')](_0xd456e6,_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]);if(fs[_0x0a9e('0x118')](_0x6276a4)){fs['createReadStream'](_0x6276a4)[_0x0a9e('0x119')](fs[_0x0a9e('0x11a')](path[_0x0a9e('0xd7')](_0x4e03f5,_0x1008a1['Attachment'][_0x0a9e('0xda')])));}}return{'date':moment(_0x1008a1['createdAt'])[_0x0a9e('0xe0')](_0x0a9e('0xfd'))[_0x0a9e('0x99')](),'sender':_0x1008a1[_0x0a9e('0xee')]===_0x0a9e('0xc8')?_0x1008a1[_0x0a9e('0x74')]?_0x1008a1[_0x0a9e('0x74')][_0x0a9e('0x31')]:'System':_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10a')]+(_0x1008a1['Contact'][_0x0a9e('0x10b')]?'\x20'+_0x1008a1[_0x0a9e('0x69')][_0x0a9e('0x10b')]:''),'body':_0x1008a1['Attachment']?_0x1008a1[_0x0a9e('0xd3')][_0x0a9e('0xda')]:_0x1008a1[_0x0a9e('0x2c')],'direction':_0x1008a1[_0x0a9e('0xee')]==='out'?'A':'C','secret':_0x1008a1[_0x0a9e('0xef')],'read':_0x1008a1[_0x0a9e('0x84')],'attachment':_0x1008a1[_0x0a9e('0xd3')]};})[_0x0a9e('0x6b')]()};return ejs[_0x0a9e('0x11b')](path['join'](config[_0x0a9e('0xde')],_0x0a9e('0x106'),'views',_0x0a9e('0x11c')),{'interaction':_0x2191c6})[_0x0a9e('0x14')](function(_0x38284a){var _0x54246a=path['join'](_0x4e03f5,_0x0a9e('0x11d')+_0x333d3c['id']+'-'+_0x2e0e9b+_0x0a9e('0x11e'));var _0x271485={'path':_0x54246a,'channel':_0x0a9e('0x10e'),'interactionId':_0x333d3c['id']};return pdf[_0x0a9e('0x11f')](_0x38284a,_0x271485);})[_0x0a9e('0x14')](function(){return new Promise(function(_0x312e02,_0x221274){zipdir(_0x4e03f5,{'saveTo':_0x1d046c},function(_0x54c9d6,_0x5cc8cb){if(_0x54c9d6)return _0x221274(_0x54c9d6);return _0x312e02(_0x5cc8cb);});})[_0x0a9e('0x14')](function(){return new BPromise(function(_0x5330c2,_0x803bc){rimraf(_0x4e03f5,function(_0xef29b6){if(_0xef29b6)_0x803bc(_0xef29b6);return _0x5330c2();});});})[_0x0a9e('0x14')](function(){return _0x1c0d54[_0x0a9e('0xdb')](_0x1d046c,_0x9c686f,function(_0x57b11b){if(_0x57b11b){logger[_0x0a9e('0x19')](_0x0a9e('0x120'),_0x57b11b);}else{fs['unlinkSync'](_0x1d046c);}});});});}else{return _0x1c0d54[_0x0a9e('0x1c')](0xc8);}})['catch'](handleError(_0x1c0d54,null));};
\ No newline at end of file
+var _0xf109=['nolimit','order','sort','pick','select','field','color','from','u.fullname','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','left_join','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','rawAttributes','includeAll','include','options','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','POST','email','isNull','follow','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','file','basename','filename','mimetype','Attachment','create','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','alias','direction','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','sendMail','Mail\x20Transcript','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','setTags','spread','emit','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','secret','ChatWebsite','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createWriteStream','lastName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','http','client','then','request\x20sent','debug','error','ChatInteraction,\x20%s,\x20%s','message','info','result','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','update','destroy','stack','name','send','render','merge','body','contact','interaction','account','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','total','UserId','closed','disposition','unmanaged','answered','index','ChatInteraction','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x21b8f2,_0x485cb8){var _0x1d000c=function(_0x597ec1){while(--_0x597ec1){_0x21b8f2['push'](_0x21b8f2['shift']());}};_0x1d000c(++_0x485cb8);}(_0xf109,0xce));var _0x9f10=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xf109[_0x32f7d7];return _0x133d09;};'use strict';var rimraf=require(_0x9f10('0x0'));var zipdir=require(_0x9f10('0x1'));var rp=require(_0x9f10('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f10('0x3'));var path=require(_0x9f10('0x4'));var ejs=require(_0x9f10('0x5'));var fs=require('fs');var _=require(_0x9f10('0x6'));var squel=require(_0x9f10('0x7'));var Redis=require(_0x9f10('0x8'));var qs=require(_0x9f10('0x9'));var as=require(_0x9f10('0xa'));var pdf=require(_0x9f10('0xb'));var logger=require(_0x9f10('0xc'))(_0x9f10('0xd'));var config=require('../../config/environment');var db=require(_0x9f10('0xe'))['db'];config[_0x9f10('0xf')]=_[_0x9f10('0x10')](config[_0x9f10('0xf')],{'host':_0x9f10('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f10('0xf')]));require(_0x9f10('0x12'))[_0x9f10('0x13')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9f10('0x14')]({'port':0x232b});var client9004=jayson[_0x9f10('0x15')][_0x9f10('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x56780e,_0x289164,_0x260606,_0x35c529){return new BPromise(function(_0x58067f,_0x9a3ae6){var _0x309f27=_0x35c529||client;return _0x309f27['request'](_0x56780e,_0x260606)[_0x9f10('0x16')](function(_0x236e28){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x289164,_0x9f10('0x17'));logger[_0x9f10('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x289164,_0x9f10('0x17'),JSON['stringify'](_0x236e28));if(_0x236e28[_0x9f10('0x19')]){if(_0x236e28[_0x9f10('0x19')]['code']===0x1f4){logger[_0x9f10('0x19')](_0x9f10('0x1a'),_0x289164,_0x236e28['error'][_0x9f10('0x1b')]);return _0x9a3ae6(_0x236e28['error'][_0x9f10('0x1b')]);}logger['error'](_0x9f10('0x1a'),_0x289164,_0x236e28['error']['message']);return _0x58067f(_0x236e28[_0x9f10('0x19')][_0x9f10('0x1b')]);}else{logger[_0x9f10('0x1c')](_0x9f10('0x1a'),_0x289164,_0x9f10('0x17'));_0x58067f(_0x236e28[_0x9f10('0x1d')][_0x9f10('0x1b')]);}})['catch'](function(_0x366044){logger['error'](_0x9f10('0x1a'),_0x289164,_0x366044);_0x9a3ae6(_0x366044);});});}function respondWithStatusCode(_0x36ace4,_0x3d25cb){_0x3d25cb=_0x3d25cb||0xcc;return function(_0x4adbda){if(_0x4adbda){return _0x36ace4[_0x9f10('0x1e')](_0x3d25cb);}return _0x36ace4[_0x9f10('0x1f')](_0x3d25cb)[_0x9f10('0x20')]();};}function respondWithResult(_0x4d21c5,_0x36821e){_0x36821e=_0x36821e||0xc8;return function(_0x37e9ac){if(_0x37e9ac){return _0x4d21c5[_0x9f10('0x1f')](_0x36821e)['json'](_0x37e9ac);}};}function respondWithFilteredResult(_0x2ec07d,_0x23c2e7){return function(_0x11cae7){if(_0x11cae7){var _0x1647c0=typeof _0x23c2e7['offset']==='undefined'&&typeof _0x23c2e7['limit']===_0x9f10('0x21');var _0x4a0407=_0x11cae7[_0x9f10('0x22')];var _0x1de75a=_0x1647c0?0x0:_0x23c2e7[_0x9f10('0x23')];var _0x2ed95b=_0x1647c0?_0x11cae7[_0x9f10('0x22')]:_0x23c2e7['offset']+_0x23c2e7[_0x9f10('0x24')];var _0x22814f;if(_0x2ed95b>=_0x4a0407){_0x2ed95b=_0x4a0407;_0x22814f=0xc8;}else{_0x22814f=0xce;}_0x2ec07d[_0x9f10('0x1f')](_0x22814f);return _0x2ec07d[_0x9f10('0x25')](_0x9f10('0x26'),_0x1de75a+'-'+_0x2ed95b+'/'+_0x4a0407)[_0x9f10('0x27')](_0x11cae7);}return null;};}function saveUpdates(_0x581b1d){return function(_0x358d3f){if(_0x358d3f){return _0x358d3f[_0x9f10('0x28')](_0x581b1d)[_0x9f10('0x16')](function(_0x1b03ee){return _0x1b03ee;});}return null;};}function removeEntity(_0x49b3f4){return function(_0x44f0a0){if(_0x44f0a0){return _0x44f0a0[_0x9f10('0x29')]()[_0x9f10('0x16')](function(){_0x49b3f4['status'](0xcc)[_0x9f10('0x20')]();});}};}function handleEntityNotFound(_0x5af399){return function(_0x1069ba){if(!_0x1069ba){_0x5af399[_0x9f10('0x1e')](0x194);}return _0x1069ba;};}function handleError(_0x13532b,_0x5944e5){_0x5944e5=_0x5944e5||0x1f4;return function(_0x3ac139){logger[_0x9f10('0x19')](_0x3ac139[_0x9f10('0x2a')]);if(_0x3ac139[_0x9f10('0x2b')]){delete _0x3ac139[_0x9f10('0x2b')];}_0x13532b['status'](_0x5944e5)[_0x9f10('0x2c')](_0x3ac139);};}function getMustacheRender(_0x4b54b7,_0x24d21d){return Mustache[_0x9f10('0x2d')](_0x4b54b7,_[_0x9f10('0x2e')](_0x24d21d[_0x9f10('0x2f')],{'contact':_0x24d21d[_0x9f10('0x30')],'message':_0x24d21d[_0x9f10('0x1b')],'agent':_0x24d21d['agent'],'interaction':_0x24d21d[_0x9f10('0x31')],'account':_0x24d21d[_0x9f10('0x32')]}))||'';}function getInteractionUsers(_0x1b8018,_0x5e63b1){return new BPromise(function(_0x2310d0,_0x1f01a7){try{if(_0x5e63b1[_0x1b8018['id']]){_0x1b8018['Users']=_[_0x9f10('0x33')](_0x5e63b1[_0x1b8018['id']],function(_0x5671fe){return{'id':_0x5671fe['id'],'fullname':_0x5671fe[_0x9f10('0x34')]};});}}catch(_0x1b7a66){_0x1f01a7(_0x1b7a66);}_0x2310d0(_0x1b8018);});}function getInteractionTags(_0x26df66,_0xc17ea2){return new BPromise(function(_0x20605a,_0x1ba4be){try{if(_0x26df66[_0x9f10('0x35')]){_0x26df66[_0x9f10('0x36')]=[];_0x26df66['TagIds'][_0x9f10('0x37')](',')[_0x9f10('0x38')](function(_0x2fa4bf){_0x26df66['Tags'][_0x9f10('0x39')](_0xc17ea2[_0x2fa4bf]);});}delete _0x26df66[_0x9f10('0x35')];}catch(_0x52914c){_0x1ba4be(_0x52914c);}_0x20605a(_0x26df66);});}function updateChatInteraction(_0x30b04b,_0x26f0ba,_0x433c7a){return new BPromise(function(_0x5a1b2b,_0x5c516c){return getInteractionUsers(_0x30b04b,_0x433c7a)[_0x9f10('0x16')](function(_0x2ff98d){return getInteractionTags(_0x2ff98d,_0x26f0ba);})[_0x9f10('0x16')](function(_0x433e70){return getStateInteraction(_0x433e70);})[_0x9f10('0x16')](function(_0x227425){_0x5a1b2b(_0x227425);})[_0x9f10('0x3a')](function(_0x34869c){_0x5c516c(_0x34869c);});});}function getStateInteraction(_0x7fe320){return new BPromise(function(_0x149f8f){_0x7fe320[_0x9f10('0x3b')]=0x0;_0x7fe320[_0x9f10('0x3c')]=0x0;_0x7fe320['answered']=0x0;_0x7fe320['unmanaged']=0x0;_0x7fe320['abandoned']=0x0;_0x7fe320[_0x9f10('0x3d')]=0x0;if(!_0x7fe320['closed']&&!_0x7fe320[_0x9f10('0x3e')]){_0x7fe320[_0x9f10('0x3b')]+=0x1;}if(!_0x7fe320[_0x9f10('0x3f')]&&_0x7fe320['UserId']){_0x7fe320[_0x9f10('0x3c')]+=0x1;if(_0x7fe320[_0x9f10('0x3b')]){_0x7fe320[_0x9f10('0x3b')]-=0x1;}}if(_0x7fe320[_0x9f10('0x3f')]&&_0x7fe320[_0x9f10('0x40')]==='abandoned'){_0x7fe320['abandoned']+=0x1;if(_0x7fe320['waiting']){_0x7fe320[_0x9f10('0x3b')]-=0x1;}}else if(_0x7fe320['closed']&&!_0x7fe320[_0x9f10('0x3e')]&&_0x7fe320['disposition']){_0x7fe320[_0x9f10('0x41')]+=0x1;if(_0x7fe320[_0x9f10('0x3b')]){_0x7fe320[_0x9f10('0x3b')]-=0x1;}}else if(_0x7fe320[_0x9f10('0x3f')]&&_0x7fe320['UserId']){_0x7fe320[_0x9f10('0x42')]+=0x1;if(_0x7fe320[_0x9f10('0x3c')]){_0x7fe320['talking']-=0x1;}}_0x7fe320[_0x9f10('0x3d')]+=0x1;_0x149f8f(_0x7fe320);});}exports[_0x9f10('0x43')]=function(_0x3c64a9,_0x1bd37c){var _0x1b3529={},_0x3b3002={},_0x4bedbe={'count':0x0,'rows':[]};var _0x281da4=_[_0x9f10('0x33')](db[_0x9f10('0x44')]['rawAttributes'],function(_0x181eab){return{'name':_0x181eab[_0x9f10('0x45')],'type':_0x181eab['type'][_0x9f10('0x46')]};});_0x3b3002[_0x9f10('0x47')]=_[_0x9f10('0x33')](_0x281da4,_0x9f10('0x2b'));_0x3b3002['query']=_[_0x9f10('0x48')](_0x3c64a9[_0x9f10('0x49')]);_0x3b3002[_0x9f10('0x4a')]=_[_0x9f10('0x4b')](_0x3b3002[_0x9f10('0x47')],_0x3b3002[_0x9f10('0x49')]);_0x1b3529['attributes']=_[_0x9f10('0x4b')](_0x3b3002[_0x9f10('0x47')],qs[_0x9f10('0x4c')](_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x4c')]));_0x1b3529[_0x9f10('0x4d')]=_0x1b3529['attributes'][_0x9f10('0x4e')]?_0x1b3529[_0x9f10('0x4d')]:_0x3b3002[_0x9f10('0x47')];if(!_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x4f')](_0x9f10('0x50'))){_0x1b3529[_0x9f10('0x24')]=qs[_0x9f10('0x24')](_0x3c64a9['query'][_0x9f10('0x24')]);_0x1b3529['offset']=qs[_0x9f10('0x23')](_0x3c64a9['query'][_0x9f10('0x23')]);}_0x1b3529[_0x9f10('0x51')]=qs[_0x9f10('0x52')](_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x52')]);_0x1b3529['where']=qs[_0x9f10('0x4a')](_[_0x9f10('0x53')](_0x3c64a9[_0x9f10('0x49')],_0x3b3002[_0x9f10('0x4a')]),_0x281da4);var _0x500e51=[];var _0x53ec45=squel[_0x9f10('0x54')]()[_0x9f10('0x55')]('id')['field']('name')[_0x9f10('0x55')](_0x9f10('0x56'))[_0x9f10('0x57')]('tools_tags');var _0x3d7b33=squel[_0x9f10('0x54')]()[_0x9f10('0x55')]('u.id')[_0x9f10('0x55')](_0x9f10('0x58'))[_0x9f10('0x55')]('ui.ChatInteractionId')[_0x9f10('0x57')](_0x9f10('0x59'),'ui')['left_join'](_0x9f10('0x5a'),'u',_0x9f10('0x5b'));var _0xcd8ae7=squel[_0x9f10('0x54')]()[_0x9f10('0x57')]('chat_interactions','i')[_0x9f10('0x5c')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x9f10('0x5c')](_0x9f10('0x5a'),'o',_0x9f10('0x5d'))[_0x9f10('0x5c')](_0x9f10('0x5e'),'a',_0x9f10('0x5f'))[_0x9f10('0x5c')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x9f10('0x5c')](_0x9f10('0x60'),'it',_0x9f10('0x61'))[_0x9f10('0x5c')](_0x9f10('0x62'),'t',_0x9f10('0x63'));var _0x35460a=squel['expr']();var _0x29bc1d=[];var _0x3ca18c=squel['expr']();var _0x29589e;if(_0x3c64a9[_0x9f10('0x49')]['search']){_0x29589e=as[_0x9f10('0x64')](_0x3c64a9[_0x9f10('0x49')]['search']);var _0x45ab35=_0x29589e['sqlOperator'];for(var _0xa93328=0x0;_0xa93328<_0x29589e[_0x9f10('0x65')][_0x9f10('0x4e')];_0xa93328++){var _0x208d48=_0x29589e[_0x9f10('0x65')][_0xa93328];var _0x4bf4d6='i';var _0x4c5fbf=_[_0x9f10('0x66')](_0x281da4,[_0x9f10('0x2b'),_0x208d48['field']]);if(!_0x4c5fbf){switch(_0x208d48['field']){case _0x9f10('0x67'):if(_0x208d48[_0x9f10('0x68')]==0x1){_0xcd8ae7[_0x9f10('0x69')]('`'+_0x208d48[_0x9f10('0x55')]+_0x9f10('0x6a'));}else{_0xcd8ae7[_0x9f10('0x69')]('`'+_0x208d48[_0x9f10('0x55')]+'`\x20>\x200');}break;case _0x9f10('0x6b'):if(_0x208d48[_0x9f10('0x6c')]==='$substring'){if(_0x208d48[_0x9f10('0x68')]['split']('\x20')[_0x9f10('0x4e')]>0x1){_0x35460a[_0x45ab35](_0x9f10('0x6d'),qs['getFullTextValue'](_0x208d48[_0x9f10('0x68')]),null);}else{var _0x4cbe80='%'+_0x208d48[_0x9f10('0x68')]+'%';_0x35460a[_0x45ab35](_0x9f10('0x6e'),_0x4cbe80,_0x4cbe80,_0x4cbe80);}}else{_0x4c5fbf=_[_0x9f10('0x66')](_0x281da4,['name',_0x9f10('0x6f')]);_0x208d48['field']=_0x9f10('0x6f');_0x16b217=as[_0x9f10('0x70')](_0x4bf4d6,_0x4c5fbf[_0x9f10('0x71')],_0x208d48);_0x35460a[_0x45ab35](_0x16b217['text'],_0x16b217[_0x9f10('0x68')]['start'],_0x16b217['value'][_0x9f10('0x20')]);}break;case _0x9f10('0x72'):var _0x6b3eb6=_0x208d48['value'][_0x9f10('0x37')](',')['map'](function(_0x48ce93){return Number(_0x48ce93);});_0x6b3eb6[_0x9f10('0x38')](function(_0x551a5d){_0x3ca18c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x551a5d+',%');});_0x29bc1d=_[_0x9f10('0x73')](_0x29bc1d,_0x6b3eb6);break;case'User':if(_0x208d48[_0x9f10('0x6c')]===_0x9f10('0x74')){_0x35460a[_0x45ab35](_0x9f10('0x75'),'%'+_0x208d48['value']+'%',null);}else{_0x4c5fbf=_[_0x9f10('0x66')](_0x281da4,[_0x9f10('0x2b'),'UserId']);_0x208d48[_0x9f10('0x55')]='UserId';_0x16b217=as['buildExpression'](_0x4bf4d6,_0x4c5fbf[_0x9f10('0x71')],_0x208d48);_0x35460a[_0x45ab35](_0x16b217[_0x9f10('0x76')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x77')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x20')]);}break;case _0x9f10('0x2f'):_0x16b217=as['buildExpression']('me',null,_0x208d48);_0x35460a[_0x45ab35](_0x16b217[_0x9f10('0x76')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x77')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x20')]);break;}}else{var _0x16b217=as[_0x9f10('0x70')](_0x4bf4d6,_0x4c5fbf[_0x9f10('0x71')],_0x208d48);_0x35460a[_0x45ab35](_0x16b217[_0x9f10('0x76')],_0x16b217['value'][_0x9f10('0x77')],_0x16b217[_0x9f10('0x68')][_0x9f10('0x20')]);}}}else{var _0x1c3b52=_(_0x3c64a9['query'])[_0x9f10('0x48')]()[_0x9f10('0x33')](function(_0x13d232){return _[_0x9f10('0x78')](_0x281da4,['name',_0x13d232])?_0x13d232:undefined;})['compact']()[_0x9f10('0x68')]();if(!_[_0x9f10('0x79')](_0x1c3b52)){_0x1c3b52[_0x9f10('0x38')](function(_0x2a656f){if(_0x2a656f===_0x9f10('0x7a')){_0xcd8ae7[_0x9f10('0x7b')](_0x9f10('0x7c'),[][_0x9f10('0x7d')](_0x3c64a9[_0x9f10('0x49')][_0x2a656f]));}else if(_0x2a656f===_0x9f10('0x7e')){var _0x108e98=JSON[_0x9f10('0x7f')](_0x3c64a9[_0x9f10('0x49')][_0x2a656f])[_0x9f10('0x80')];var _0x3903c5=JSON['parse'](_0x3c64a9[_0x9f10('0x49')][_0x2a656f])[_0x9f10('0x81')];_0xcd8ae7['where'](_0x9f10('0x82'),_0x108e98,_0x3903c5);}else{if(_0x3c64a9[_0x9f10('0x49')][_0x2a656f]===_0x9f10('0x83')){_0xcd8ae7[_0x9f10('0x7b')]('i.'+_0x2a656f+'\x20IS\x20NULL');}else{_0xcd8ae7[_0x9f10('0x7b')]('i.'+_0x2a656f+'\x20=\x20?',_0x3c64a9[_0x9f10('0x49')][_0x2a656f]);}}});}if(_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x84')]){if(_0x3c64a9['query'][_0x9f10('0x84')]==0x1){_0xcd8ae7[_0x9f10('0x69')](_0x9f10('0x85'));}else{_0xcd8ae7['having'](_0x9f10('0x86'));}}if(_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x87')]){_0x29bc1d=_['isArray'](_0x3c64a9['query']['tag'])?_0x3c64a9['query']['tag']:new Array(_0x3c64a9['query']['tag']);_0x29bc1d[_0x9f10('0x38')](function(_0x2571a6){_0x3ca18c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2571a6+',%');});}if(_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x88')]){var _0x454506=_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x88')][_0x9f10('0x89')]('\x5c','\x5c\x5c')[_0x9f10('0x89')](/'/g,'\x27\x27');if(qs[_0x9f10('0x8a')](_0x454506)){_0x35460a['or'](_0x9f10('0x8b'),_0x454506+'%');}else{_0x35460a['or'](_0x9f10('0x8c'),qs['getFullTextValue'](_0x454506))['or'](_0x9f10('0x8d'),_0x454506+'%');}}}_0xcd8ae7[_0x9f10('0x7b')](_0x35460a);_0xcd8ae7['group'](_0x9f10('0x8e'));var _0x5b2f86={'type':db['Sequelize'][_0x9f10('0x8f')][_0x9f10('0x90')],'raw':!![]};var _0x5ae22e=_0xcd8ae7[_0x9f10('0x91')]();_0x5ae22e[_0x9f10('0x55')]('i.id');_0x5ae22e[_0x9f10('0x55')](_0x9f10('0x92'),_0x9f10('0x67'));if(_0x1b3529['order']){_0x1b3529[_0x9f10('0x51')][_0x9f10('0x38')](function(_0x5c9d68){var _0x48c017=_0x5c9d68[0x0]===_0x9f10('0x93')?_0x5c9d68[0x0]:'i.'+_0x5c9d68[0x0];_0xcd8ae7[_0x9f10('0x51')](_0x48c017,_0x5c9d68[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9f10('0x79')](_0x29bc1d)){_0xcd8ae7[_0x9f10('0x69')](_0x3ca18c);_0x5ae22e['where']('t.id\x20IN\x20?',_0x29bc1d);}BPromise[_0x9f10('0x94')]()[_0x9f10('0x16')](function(){if(!_0x29589e){if(_0x3c64a9['query']['ChatWebsiteId'])return;_0x5ae22e[_0x9f10('0x7b')](_0x9f10('0x95'));_0xcd8ae7['where'](_0x9f10('0x95'));return;}if(_0x3c64a9[_0x9f10('0x96')][_0x9f10('0x97')]!==_0x9f10('0x98'))return;return _0x3c64a9[_0x9f10('0x96')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x5a51c7){if(_[_0x9f10('0x79')](_0x5a51c7)){_0x5ae22e[_0x9f10('0x7b')](_0x9f10('0x99'));_0xcd8ae7['where'](_0x9f10('0x99'));}else{_0x5ae22e['where'](_0x9f10('0x7c'),_['map'](_0x5a51c7,'id'));_0xcd8ae7['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x9f10('0x33')](_0x5a51c7,'id'));}});})[_0x9f10('0x16')](function(){if(_0x3c64a9[_0x9f10('0x96')][_0x9f10('0x97')]===_0x9f10('0x98')&&!_0x29589e&&!_0x3c64a9[_0x9f10('0x49')][_0x9f10('0x7a')])return[];return db[_0x9f10('0x9a')]['query'](_0x5ae22e[_0x9f10('0x9b')](),_0x5b2f86);})[_0x9f10('0x16')](function(_0x426fa4){_0x4bedbe['count']=_0x426fa4[_0x9f10('0x4e')];if(_0x4bedbe[_0x9f10('0x22')]===0x0)return[];return db[_0x9f10('0x9a')][_0x9f10('0x49')](_0x53ec45[_0x9f10('0x9b')](),_0x5b2f86)['then'](function(_0x14ea3c){_0x500e51=_['keyBy'](_0x14ea3c,'id');_0x5b2f86=_[_0x9f10('0x2e')](_0x5b2f86,{'model':db[_0x9f10('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c64a9['query'][_0x9f10('0x4c')]){_0x1b3529[_0x9f10('0x4d')][_0x9f10('0x38')](function(_0x3bc386){_0xcd8ae7['field']('i.'+_0x3bc386);});}else{_0xcd8ae7[_0x9f10('0x55')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9f10('0x67'));_0xcd8ae7[_0x9f10('0x55')]('a.key','Account.key');_0xcd8ae7[_0x9f10('0x55')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xcd8ae7['field'](_0x9f10('0x9c'),_0x9f10('0x93'));_0xcd8ae7['field'](_0x9f10('0x9d'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0x9e'),_0x9f10('0x9f'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0xa0'),_0x9f10('0xa1'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0xa2'),_0x9f10('0xa3'));_0xcd8ae7['field']('c.phone','Contact.phone');_0xcd8ae7['field'](_0x9f10('0xa4'),_0x9f10('0xa5'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0xa6'),_0x9f10('0xa7'));_0xcd8ae7['field'](_0x9f10('0xa8'),_0x9f10('0xa9'));_0xcd8ae7['field'](_0x9f10('0xaa'),_0x9f10('0xab'));_0xcd8ae7[_0x9f10('0x55')](_0x9f10('0xac'),_0x9f10('0x35'));}if(_0x1b3529[_0x9f10('0x24')])_0xcd8ae7[_0x9f10('0x24')](_0x1b3529[_0x9f10('0x24')]);if(_0x1b3529[_0x9f10('0x23')])_0xcd8ae7['offset'](_0x1b3529['offset']);return db[_0x9f10('0x9a')][_0x9f10('0x49')](_0xcd8ae7[_0x9f10('0x9b')](),_0x5b2f86);})[_0x9f10('0x16')](function(_0x537de0){if(_0x537de0[_0x9f10('0x4e')]>0x0)_0x3d7b33[_0x9f10('0x7b')](_0x9f10('0xad'),_[_0x9f10('0x33')](_0x537de0,'id'));return db[_0x9f10('0x9a')][_0x9f10('0x49')](_0x3d7b33['toString'](),_0x5b2f86)['then'](function(_0x5044bc){var _0x44bbd5=_[_0x9f10('0xae')](_0x5044bc,_0x9f10('0xaf'));var _0x37a44d=[];_0x537de0[_0x9f10('0x38')](function(_0x164264){_0x37a44d[_0x9f10('0x39')](updateChatInteraction(_0x164264,_0x500e51,_0x44bbd5));});return BPromise[_0x9f10('0xb0')](_0x37a44d);});});})[_0x9f10('0x16')](function(_0x527cb4){_0x4bedbe[_0x9f10('0xb1')]=_0x527cb4;return _0x4bedbe;})[_0x9f10('0x16')](respondWithFilteredResult(_0x1bd37c,_0x1b3529))[_0x9f10('0x3a')](handleError(_0x1bd37c,null));};exports['show']=function(_0x12372d,_0x53dfa3){var _0xf95893={'raw':![],'where':{'id':_0x12372d['params']['id']}},_0x257daa={};_0x257daa[_0x9f10('0x47')]=_[_0x9f10('0x48')](db[_0x9f10('0x44')][_0x9f10('0xb2')]);_0x257daa[_0x9f10('0x49')]=_['keys'](_0x12372d[_0x9f10('0x49')]);_0x257daa['filters']=_[_0x9f10('0x4b')](_0x257daa['model'],_0x257daa['query']);_0xf95893[_0x9f10('0x4d')]=_[_0x9f10('0x4b')](_0x257daa[_0x9f10('0x47')],qs[_0x9f10('0x4c')](_0x12372d[_0x9f10('0x49')][_0x9f10('0x4c')]));_0xf95893['attributes']=_0xf95893[_0x9f10('0x4d')][_0x9f10('0x4e')]?_0xf95893[_0x9f10('0x4d')]:_0x257daa[_0x9f10('0x47')];if(_0x12372d[_0x9f10('0x49')][_0x9f10('0xb3')]){_0xf95893[_0x9f10('0xb4')]=[{'all':!![]}];}_0xf95893=_[_0x9f10('0x2e')]({},_0xf95893,_0x12372d[_0x9f10('0xb5')]);return db[_0x9f10('0x44')][_0x9f10('0x66')](_0xf95893)[_0x9f10('0x16')](handleEntityNotFound(_0x53dfa3,null))['then'](respondWithResult(_0x53dfa3,null))[_0x9f10('0x3a')](handleError(_0x53dfa3,null));};exports['create']=function(_0x38ddb1,_0x14d4cc){return db[_0x9f10('0x44')]['create'](_0x38ddb1[_0x9f10('0x2f')],{})[_0x9f10('0x16')](respondWithResult(_0x14d4cc,0xc9))[_0x9f10('0x3a')](handleError(_0x14d4cc,null));};exports[_0x9f10('0x28')]=function(_0x2f805f,_0x417b25){if(_0x2f805f['body']['id']){delete _0x2f805f[_0x9f10('0x2f')]['id'];}return db[_0x9f10('0x44')]['find']({'where':{'id':_0x2f805f[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x417b25,null))[_0x9f10('0x16')](saveUpdates(_0x2f805f[_0x9f10('0x2f')],null))['then'](respondWithResult(_0x417b25,null))['catch'](handleError(_0x417b25,null));};exports[_0x9f10('0x29')]=function(_0x5a4c18,_0xccb669){return db[_0x9f10('0x44')]['find']({'where':{'id':_0x5a4c18[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0xccb669,null))[_0x9f10('0x16')](removeEntity(_0xccb669,null))[_0x9f10('0x3a')](handleError(_0xccb669,null));};exports['describe']=function(_0x3a894e,_0x2eeb02){return db['ChatInteraction'][_0x9f10('0xb7')]()['then'](respondWithResult(_0x2eeb02,null))['catch'](handleError(_0x2eeb02,null));};exports[_0x9f10('0xb8')]=function(_0x254354,_0x11e26f){var _0x49406f=_0x254354[_0x9f10('0xb6')]['id'];var _0x4e7496;var _0x3a1f83;var _0x5e4144;return db[_0x9f10('0x44')][_0x9f10('0xb9')]({'where':{'id':_0x49406f}})['then'](function(_0x3d5f3f){_0x4e7496=_0x3d5f3f;return db['ChatWebsite'][_0x9f10('0xb9')]({'where':{'id':_0x3d5f3f[_0x9f10('0x7a')]},'attributes':['id',_0x9f10('0xba'),_0x9f10('0xbb'),_0x9f10('0xbc'),_0x9f10('0xbd'),_0x9f10('0xbe')],'raw':!![]});})[_0x9f10('0x16')](function(_0x5ea087){if(_0x5ea087&&_0x5ea087[_0x9f10('0xba')]&&_0x5ea087[_0x9f10('0xbb')]){_0x3a1f83=_0x5ea087;var _0x35e05f={'interaction':{'id':_0x49406f},'agent':{'id':_0x254354[_0x9f10('0x96')]['id'],'name':_0x254354[_0x9f10('0x96')][_0x9f10('0x2b')],'fullname':_0x254354[_0x9f10('0x96')][_0x9f10('0x34')],'email':_0x254354[_0x9f10('0x96')]['email']},'contact':_0x254354['body']['contact'],'account':_0x254354[_0x9f10('0x2f')]['account']};var _0x3c412e={'rejectUnauthorized':![],'method':_0x9f10('0xbf'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5ea087[_0x9f10('0xba')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x254354[_0x9f10('0x96')][_0x9f10('0xc0')]],'buttons':null,'topic':_0x3a1f83[_0x9f10('0xbc')],'note':_[_0x9f10('0xc1')](_0x3a1f83[_0x9f10('0xbd')])?null:getMustacheRender(_0x3a1f83[_0x9f10('0xbd')],_0x35e05f),'metadata':null},'redirect':_0x9f10('0xc2'),'json':!![]};try{if(!_[_0x9f10('0xc1')](_0x3a1f83[_0x9f10('0xbe')])){var _0x1bb7f5=getMustacheRender(_0x3a1f83['vidaooMetadata'],_0x35e05f);var _0x20c974=JSON[_0x9f10('0x7f')](_0x1bb7f5);_0x3c412e[_0x9f10('0x2f')][_0x9f10('0xc3')]=_0x20c974;}}catch(_0x494ca9){throw new db[(_0x9f10('0xc4'))][(_0x9f10('0xc5'))](_0x9f10('0xc6'));}return rp(_0x3c412e);}else{throw new db[(_0x9f10('0xc4'))][(_0x9f10('0xc5'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x9f10('0x16')](function(_0x36ec7d){_0x5e4144=_0x36ec7d;if(_0x5e4144['id']){var _0x119e9c={'body':_0x5e4144[_0x9f10('0xc7')],'ChatWebsiteId':_0x3a1f83['id'],'ChatInteractionId':_0x4e7496['id'],'direction':_0x9f10('0xc8'),'UserId':_0x254354[_0x9f10('0x96')]['id']};return db[_0x9f10('0xc9')]['create'](_0x119e9c,{});}else{throw new db[(_0x9f10('0xc4'))]['ValidationError'](_0x9f10('0xca'));}})[_0x9f10('0x16')](function(){return _0x4e7496[_0x9f10('0xcb')]({'vidaooSessionId':_0x5e4144['id']});})[_0x9f10('0x16')](respondWithResult(_0x11e26f,null))['catch'](handleError(_0x11e26f,null));};exports['customUpdate']=function(_0x1b71f3,_0x23d1a3){if(_0x1b71f3['body']['id']){delete _0x1b71f3[_0x9f10('0x2f')]['id'];}return db['ChatInteraction'][_0x9f10('0x66')]({'where':{'id':_0x1b71f3[_0x9f10('0xb6')]['id']},'include':[{'model':db[_0x9f10('0xcc')],'as':_0x9f10('0x6b')}]})[_0x9f10('0x16')](handleEntityNotFound(_0x23d1a3,null))[_0x9f10('0x16')](saveUpdates(_0x1b71f3[_0x9f10('0x2f')],null))[_0x9f10('0x16')](respondWithResult(_0x23d1a3,null))[_0x9f10('0x3a')](handleError(_0x23d1a3,null));};exports[_0x9f10('0xcd')]=function(_0x53998e,_0x5f531c){if(_0x53998e['body']['id']){delete _0x53998e[_0x9f10('0x2f')]['id'];}return db[_0x9f10('0x44')][_0x9f10('0x66')]({'where':{'id':_0x53998e['params']['id']}})[_0x9f10('0x16')](function(_0x1374b4){if(!_0x1374b4){logger['error'](_0x9f10('0xce'),_0x9f10('0xcd'),0x194,_0x9f10('0xcf'));_0x5f531c[_0x9f10('0x1e')](0x194);}else{if(_0x1374b4[_0x9f10('0x3e')]){throw new db[(_0x9f10('0xc4'))][(_0x9f10('0xc5'))](_0x9f10('0xd0'));}}return _0x1374b4;})[_0x9f10('0x16')](function(_0x579d2d){if(_0x579d2d){return _0x579d2d[_0x9f10('0x28')]({'closed':_0x53998e[_0x9f10('0x2f')][_0x9f10('0x3f')],'disposition':_0x53998e['body'][_0x9f10('0x40')]})[_0x9f10('0x16')](function(_0x430782){return _0x430782;});}})[_0x9f10('0x16')](function(){return respondWithRpcPromise(_0x9f10('0xd1'),_0x9f10('0xcd'),_0x53998e['body'],client9004);})[_0x9f10('0x16')](respondWithResult(_0x5f531c,null))[_0x9f10('0x3a')](handleError(_0x5f531c,null));};exports['attachmentUpload']=function(_0xf4fd93,_0x4fd3d4){_0xf4fd93[_0x9f10('0x2f')][_0x9f10('0x2b')]=_0xf4fd93[_0x9f10('0xd2')]['originalname'];_0xf4fd93['body'][_0x9f10('0xd3')]=_0xf4fd93[_0x9f10('0xd2')][_0x9f10('0xd4')];_0xf4fd93[_0x9f10('0x2f')][_0x9f10('0x71')]=_0xf4fd93[_0x9f10('0xd2')][_0x9f10('0xd5')];return db[_0x9f10('0xd6')][_0x9f10('0xd7')](_0xf4fd93['body'])[_0x9f10('0x16')](respondWithResult(_0x4fd3d4,0xc9))[_0x9f10('0x3a')](handleError(_0x4fd3d4,null));};exports[_0x9f10('0xd8')]=function(_0x3195cd,_0x3f06ac){return db[_0x9f10('0x44')][_0x9f10('0xb9')]({'where':{'id':_0x3195cd[_0x9f10('0xb6')]['id']},'raw':!![]})[_0x9f10('0x16')](handleEntityNotFound(_0x3f06ac,null))[_0x9f10('0x16')](function(_0x9a3870){if(_0x9a3870){if(_0x9a3870[_0x9f10('0x3f')]){return _0x3f06ac['status'](0x193)[_0x9f10('0x27')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x9f10('0xb9')]({'where':{'id':_0x3195cd[_0x9f10('0x49')][_0x9f10('0xd9')]},'raw':!![]})[_0x9f10('0x16')](handleEntityNotFound(_0x3f06ac,null));}})[_0x9f10('0x16')](function(_0x53dbab){if(_0x53dbab){var _0x481078=_0x53dbab[_0x9f10('0xda')]!==null;var _0x1a2a20=path[_0x9f10('0xdb')](config[_0x9f10('0xdc')],'server/files/attachments/');if(_0x481078){_0x1a2a20=path['join'](_0x1a2a20,_0x9f10('0xdd'));}var _0x293349=path[_0x9f10('0xdb')](_0x1a2a20,_0x53dbab[_0x9f10('0xd3')]);return _0x3f06ac[_0x9f10('0xde')](_0x293349);}})[_0x9f10('0x3a')](handleError(_0x3f06ac,null));};exports['close']=function(_0x364c46,_0x311ef6){var _0x364168=null;var _0x427d85=null;var _0x495833=null;if(_0x364c46[_0x9f10('0x2f')]['id']){delete _0x364c46[_0x9f10('0x2f')]['id'];}if(_0x364c46[_0x9f10('0x2f')][_0x9f10('0xdf')]){_0x495833=path[_0x9f10('0xdb')](config[_0x9f10('0xdc')],_0x9f10('0xe0'),util[_0x9f10('0xe1')]('transcript-%s.txt',Date[_0x9f10('0xe2')]()));_0x364c46[_0x9f10('0x2f')][_0x9f10('0xe3')]=_0x495833;}return db[_0x9f10('0x44')]['find']({'where':{'id':_0x364c46[_0x9f10('0xb6')]['id']},'include':[{'model':db[_0x9f10('0xc9')],'as':_0x9f10('0xe4'),'include':[{'model':db['User'],'as':_0x9f10('0xe5')}]}]})[_0x9f10('0x16')](handleEntityNotFound(_0x311ef6,null))[_0x9f10('0x16')](saveUpdates(_0x364c46['body'],null))[_0x9f10('0x16')](function(_0x267abb){if(_0x267abb){_0x364168=_0x267abb;return db['ChatWebsite']['find']({'where':{'id':_0x364168['ChatWebsiteId']}});}})[_0x9f10('0x16')](function(_0x36e6e4){if(_0x36e6e4){_0x427d85=_0x36e6e4;return db[_0x9f10('0xcc')][_0x9f10('0x66')]({'where':{'id':_0x364168[_0x9f10('0x6f')]}});}})['then'](function(_0x154548){if(_0x154548){if(_0x495833){var _0x54e40b=null;for(var _0xb28c2e=0x1;_0xb28c2e<_0x364168[_0x9f10('0xe4')]['length'];++_0xb28c2e){_0x54e40b=_0x364168[_0x9f10('0xe4')][_0xb28c2e];var _0xef1054=_0x54e40b[_0x9f10('0x3e')]?util[_0x9f10('0xe1')](_0x9f10('0xe6'),_0x427d85[_0x9f10('0xe7')],_0x54e40b['UserId']):_0x9f10('0xe8');var _0x427cef=_0x364c46[_0x9f10('0x2f')][_0x9f10('0xe9')]||util[_0x9f10('0xe1')](_0x9f10('0xe6'),_0x9f10('0xea'),_0x54e40b[_0x9f10('0x6f')]);switch(_0x427d85[_0x9f10('0xeb')]){case'website_alias':_0xef1054=_0x54e40b[_0x9f10('0x3e')]?util[_0x9f10('0xe1')]('%s%d',_0x427d85[_0x9f10('0xe7')],_0x54e40b[_0x9f10('0x3e')]):_0x9f10('0xe8');break;case'agent_alias':_0xef1054=_0x54e40b[_0x9f10('0x3e')]?_0x54e40b[_0x9f10('0xe5')][_0x9f10('0xec')]||_0x54e40b[_0x9f10('0xe5')]['fullname']:'System';break;case'agent_fullname':_0xef1054=_0x54e40b[_0x9f10('0x3e')]?_0x54e40b[_0x9f10('0xe5')]['fullname']:'System';break;default:_0xef1054=_0x54e40b[_0x9f10('0x3e')]?util['format']('%s%d',_0x427d85[_0x9f10('0xe7')],_0x54e40b[_0x9f10('0x3e')]):_0x9f10('0xe8');}var _0x1c0c1f=util[_0x9f10('0xe1')]('[%s]\x20%s:\x20%s\x0a',moment(_0x54e40b[_0x9f10('0x7e')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x54e40b[_0x9f10('0xed')]==='in'?_0x427cef:_0xef1054,_0x54e40b[_0x9f10('0x2f')]);if(!_0x54e40b['secret']){fs['appendFileSync'](_0x495833,_0x1c0c1f);}}return db[_0x9f10('0xee')][_0x9f10('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x9f10('0xef')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9f10('0xf0'),'raw':!![]}]}]});}}})[_0x9f10('0x16')](function(_0x3f13d7){if(!_0x3f13d7||!_0x3f13d7[_0x9f10('0xf1')]||!_0x364c46[_0x9f10('0x2f')])return _0x364168;var _0x4636fc=_0x3f13d7[_0x9f10('0xf2')]();return respondWithRpcPromise('SendMail',_0x9f10('0xf3'),{'account':_0x4636fc,'message':{'from':util[_0x9f10('0xe1')]('\x22%s\x22\x20<%s>',_0x3f13d7[_0x9f10('0x2b')],_0x3f13d7[_0x9f10('0xc0')]||_0x3f13d7['Smtp'][_0x9f10('0x96')]),'to':_0x364c46[_0x9f10('0x2f')][_0x9f10('0xdf')],'subject':_0x9f10('0xf4'),'text':util[_0x9f10('0xe1')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x364c46['body'][_0x9f10('0xdf')]),'attachments':[{'path':_0x495833}]}})[_0x9f10('0x16')](function(){return _0x364168;})[_0x9f10('0x3a')](function(_0x598774){logger['error'](_0x598774);});})[_0x9f10('0x16')](respondWithStatusCode(_0x311ef6,0xc8))[_0x9f10('0x3a')](handleError(_0x311ef6,null));};exports['addMessage']=function(_0x50507b,_0x580a4b){return db['ChatMessage'][_0x9f10('0x66')]({'where':{'id':_0x50507b[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x580a4b,null))[_0x9f10('0x16')](function(_0x34962c){if(_0x34962c){return _0x34962c[_0x9f10('0xf5')](_0x50507b['body'][_0x9f10('0xf6')],_[_0x9f10('0xf7')](_0x50507b[_0x9f10('0x2f')],[_0x9f10('0xf6'),'id'])||{});}})[_0x9f10('0x16')](respondWithResult(_0x580a4b,null))[_0x9f10('0x3a')](handleError(_0x580a4b,null));};exports[_0x9f10('0xf8')]=function(_0x49e4b7,_0x162f72){var _0xdae524={'raw':![],'where':{}};var _0x24b022={};var _0x3aab50={'count':0x0,'rows':[]};return db[_0x9f10('0x44')][_0x9f10('0xb9')]({'where':{'id':_0x49e4b7[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x162f72,null))[_0x9f10('0x16')](function(_0x483403){if(_0x483403){_0x24b022[_0x9f10('0x47')]=_[_0x9f10('0x48')](db[_0x9f10('0xc9')][_0x9f10('0xb2')]);_0x24b022['query']=_[_0x9f10('0x48')](_0x49e4b7[_0x9f10('0x49')]);_0x24b022[_0x9f10('0x4a')]=_['intersection'](_0x24b022[_0x9f10('0x47')],_0x24b022['query']);_0xdae524[_0x9f10('0x4d')]=_['intersection'](_0x24b022['model'],qs[_0x9f10('0x4c')](_0x49e4b7['query'][_0x9f10('0x4c')]));_0xdae524[_0x9f10('0x4d')]=_0xdae524[_0x9f10('0x4d')][_0x9f10('0x4e')]?_0xdae524['attributes']:_0x24b022[_0x9f10('0x47')];if(!_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x4f')]('nolimit')){_0xdae524[_0x9f10('0x24')]=qs[_0x9f10('0x24')](_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x24')]);_0xdae524[_0x9f10('0x23')]=qs[_0x9f10('0x23')](_0x49e4b7[_0x9f10('0x49')]['offset']);}_0xdae524['order']=qs['sort'](_0x49e4b7['query'][_0x9f10('0x52')]);_0xdae524[_0x9f10('0x7b')]=qs[_0x9f10('0x4a')](_[_0x9f10('0x53')](_0x49e4b7[_0x9f10('0x49')],_0x24b022[_0x9f10('0x4a')]));_0xdae524[_0x9f10('0x7b')][_0x9f10('0xaf')]=_0x483403['id'];if(_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x88')]){_0xdae524[_0x9f10('0x7b')]=_[_0x9f10('0x2e')](_0xdae524[_0x9f10('0x7b')],{'$or':_[_0x9f10('0x33')](_0xdae524['attributes'],function(_0x153357){var _0x5a57e9={};_0x5a57e9[_0x153357]={'$like':'%'+_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x88')]+'%'};return _0x5a57e9;})});}if(_0x49e4b7[_0x9f10('0x49')]['$gte']){var _0x52c3df=_0x49e4b7[_0x9f10('0x49')][_0x9f10('0x80')][_0x9f10('0x37')](',');var _0xd6a04a={};_0xd6a04a[_0x52c3df[0x0]]={'$gte':moment(_0x52c3df[0x1])[_0x9f10('0xe1')](_0x9f10('0xf9'))};_0xdae524[_0x9f10('0x7b')]=_[_0x9f10('0x2e')](_0xdae524[_0x9f10('0x7b')],_0xd6a04a);}_0xdae524=_[_0x9f10('0x2e')]({},_0xdae524,_0x49e4b7[_0x9f10('0xb5')]);return db[_0x9f10('0xc9')][_0x9f10('0x22')]({'where':_0xdae524[_0x9f10('0x7b')]})[_0x9f10('0x16')](function(_0x121d0d){_0x3aab50[_0x9f10('0x22')]=_0x121d0d;if(_0x49e4b7[_0x9f10('0x49')]['includeAll']){_0xdae524[_0x9f10('0xb4')]=[{'all':!![]}];}return db[_0x9f10('0xc9')][_0x9f10('0xfa')](_0xdae524);})['then'](function(_0x1f7081){_0x3aab50[_0x9f10('0xb1')]=_0x1f7081;return _0x3aab50;});}})[_0x9f10('0x16')](respondWithFilteredResult(_0x162f72,_0xdae524))['catch'](handleError(_0x162f72,null));};exports[_0x9f10('0xfb')]=function(_0xc11c03,_0x249595){var _0x2f54aa={'where':{}},_0x5566c4={},_0x2da6a8={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x9f10('0xb9')]({'where':{'id':_0xc11c03[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x249595,null))[_0x9f10('0x16')](function(_0x575861){if(_0x575861){_0x5566c4[_0x9f10('0x47')]=_[_0x9f10('0x48')](db[_0x9f10('0xc9')][_0x9f10('0xb2')]);_0x5566c4[_0x9f10('0x49')]=_[_0x9f10('0x48')](_0xc11c03[_0x9f10('0x49')]);_0x5566c4[_0x9f10('0x4a')]=_[_0x9f10('0x4b')](_0x5566c4['model'],_0x5566c4['query']);_0x2f54aa[_0x9f10('0x4d')]=_[_0x9f10('0x4b')](_0x5566c4[_0x9f10('0x47')],qs['fields'](_0xc11c03[_0x9f10('0x49')]['fields']));_0x2f54aa[_0x9f10('0x4d')]=_0x2f54aa[_0x9f10('0x4d')][_0x9f10('0x4e')]?_0x2f54aa['attributes']:_0x5566c4['model'];if(!_0xc11c03[_0x9f10('0x49')]['hasOwnProperty'](_0x9f10('0x50'))){_0x2f54aa[_0x9f10('0x24')]=qs['limit'](_0xc11c03[_0x9f10('0x49')]['limit']);_0x2f54aa['offset']=qs[_0x9f10('0x23')](_0xc11c03[_0x9f10('0x49')][_0x9f10('0x23')]);}_0x2f54aa['order']=qs[_0x9f10('0x52')](_0xc11c03['query'][_0x9f10('0x52')]);_0x2f54aa[_0x9f10('0x7b')]=qs[_0x9f10('0x4a')](_['pick'](_0xc11c03[_0x9f10('0x49')],_0x5566c4[_0x9f10('0x4a')]));_0x2f54aa[_0x9f10('0x7b')]['ChatInteractionId']=_0x575861['id'];if(_0xc11c03[_0x9f10('0x49')][_0x9f10('0x88')]){_0x2f54aa[_0x9f10('0x7b')]=_[_0x9f10('0x2e')](_0x2f54aa[_0x9f10('0x7b')],{'$or':_[_0x9f10('0x33')](_0x2f54aa[_0x9f10('0x4d')],function(_0x91c6c){var _0x52da55={};_0x52da55[_0x91c6c]={'$like':'%'+_0xc11c03[_0x9f10('0x49')][_0x9f10('0x88')]+'%'};return _0x52da55;})});}_0x2f54aa['where']['secret']=![];if(_0xc11c03['query']['id']){_0x2f54aa[_0x9f10('0x7b')]['id']={'$gt':_0xc11c03[_0x9f10('0x49')]['id']};}_0x2f54aa=_['merge']({},_0x2f54aa,_0xc11c03[_0x9f10('0xb5')]);return db[_0x9f10('0xc9')][_0x9f10('0x22')]({'where':_0x2f54aa[_0x9f10('0x7b')]})[_0x9f10('0x16')](function(_0x27386b){_0x2da6a8[_0x9f10('0x22')]=_0x27386b;_0x2f54aa['include']=[];if(_0xc11c03[_0x9f10('0x49')][_0x9f10('0xfc')]){_0x2f54aa[_0x9f10('0xb4')][_0x9f10('0x39')]({'model':db[_0x9f10('0xe5')],'as':'User','attributes':['id','fullname',_0x9f10('0xec')]});}if(_0xc11c03[_0x9f10('0x49')]['includeAll']){_0x2f54aa[_0x9f10('0xb4')]=[{'all':!![]}];}return db[_0x9f10('0xc9')][_0x9f10('0xfa')](_0x2f54aa);})[_0x9f10('0x16')](function(_0x1671e0){_0x2da6a8[_0x9f10('0xb1')]=_0x1671e0;return _0x2da6a8;});}})['then'](respondWithFilteredResult(_0x249595,_0x2f54aa))[_0x9f10('0x3a')](handleError(_0x249595,null));};exports[_0x9f10('0xfd')]=function(_0x3c6f1b,_0x175b74){return db['ChatInteraction'][_0x9f10('0x66')]({'where':{'id':_0x3c6f1b[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x175b74,null))[_0x9f10('0x16')](function(_0x15c5df){if(_0x15c5df){return _0x15c5df[_0x9f10('0xfe')](_0x3c6f1b[_0x9f10('0x2f')]['ids'],_[_0x9f10('0xf7')](_0x3c6f1b[_0x9f10('0x2f')],[_0x9f10('0xf6'),'id'])||{})[_0x9f10('0xff')](function(){return db['Tag'][_0x9f10('0xfa')]({'attributes':['id','name','color'],'where':{'id':_0x3c6f1b[_0x9f10('0x2f')][_0x9f10('0xf6')]}});})['then'](function(_0x4943c3){socket[_0x9f10('0x100')]('chatInteractionTags:save',{'id':Number(_0x3c6f1b[_0x9f10('0xb6')]['id']),'tags':_0x4943c3||[]});return{'id':Number(_0x3c6f1b[_0x9f10('0xb6')]['id']),'tags':_0x4943c3||[]};});}})['then'](respondWithResult(_0x175b74,null))[_0x9f10('0x3a')](handleError(_0x175b74,null));};exports[_0x9f10('0x101')]=function(_0x4a77d2,_0x1c68d7){return db['ChatInteraction'][_0x9f10('0x66')]({'where':{'id':_0x4a77d2[_0x9f10('0xb6')]['id']}})[_0x9f10('0x16')](handleEntityNotFound(_0x1c68d7,null))[_0x9f10('0x16')](function(_0x3a58c4){if(_0x3a58c4){return _0x3a58c4['removeTags'](_0x4a77d2[_0x9f10('0x49')][_0x9f10('0xf6')]);}})[_0x9f10('0x16')](respondWithStatusCode(_0x1c68d7,null))[_0x9f10('0x3a')](handleError(_0x1c68d7,null));};exports[_0x9f10('0xde')]=function(_0x2e3239,_0x1135ce){var _0x492aaf=moment()[_0x9f10('0x102')]()['toString']();var _0x56b209=path[_0x9f10('0xdb')](config['root'],_0x9f10('0x103'),'files',_0x9f10('0x104'));var _0x2ce940=path[_0x9f10('0xdb')](config[_0x9f10('0xdc')],_0x9f10('0x103'),'files',_0x9f10('0x105'));var _0x274ea7=path[_0x9f10('0xdb')](_0x56b209,_0x492aaf);var _0x2b0199=util['format'](_0x9f10('0x106'),_0x2e3239['params']['id'],_0x492aaf);var _0x1511b7=path[_0x9f10('0xdb')](_0x56b209,_0x2b0199);var _0xa72487=[];_0xa72487[_0x9f10('0x39')]({'model':db['User'],'as':_0x9f10('0xe5'),'attributes':['id',_0x9f10('0x34')],'raw':!![]});_0xa72487[_0x9f10('0x39')]({'model':db['CmContact'],'as':_0x9f10('0x6b'),'attributes':['id',_0x9f10('0x107'),'lastName'],'raw':!![]});if(_0x2e3239[_0x9f10('0x49')][_0x9f10('0x105')]){_0xa72487[_0x9f10('0x39')]({'model':db[_0x9f10('0xd6')],'as':_0x9f10('0xd6'),'raw':!![]});}var _0x4bbfa5=[{'model':db[_0x9f10('0xc9')],'as':'Messages','attributes':['id',_0x9f10('0x2f'),'createdAt','direction',_0x9f10('0x108'),_0x9f10('0x84')],'include':_0xa72487}];_0x4bbfa5['push']({'model':db[_0x9f10('0x109')],'as':_0x9f10('0x10a'),'attributes':['id',_0x9f10('0x2b')]});_0x4bbfa5[_0x9f10('0x39')]({'model':db[_0x9f10('0xe5')],'as':_0x9f10('0x10b'),'attributes':['id',_0x9f10('0x34')]});return db[_0x9f10('0x44')][_0x9f10('0x66')]({'where':{'id':_0x2e3239[_0x9f10('0xb6')]['id']},'include':_0x4bbfa5})[_0x9f10('0x16')](handleEntityNotFound(_0x1135ce,null))[_0x9f10('0x16')](function(_0x502a15){if(_0x502a15){var _0x2faafe=_0x502a15[_0x9f10('0x10c')]({'plain':!![]});fs[_0x9f10('0x10d')](_0x274ea7);var _0x46de3d={'channel':_0x9f10('0x10e'),'account':_0x2faafe[_0x9f10('0x10a')]['name'],'agent':_0x2faafe[_0x9f10('0x10b')]?_0x2faafe[_0x9f10('0x10b')][_0x9f10('0x34')]:_0x9f10('0x10f'),'createdAt':moment(_0x2faafe[_0x9f10('0x7e')])[_0x9f10('0xe1')](_0x9f10('0xf9'))['toString'](),'closedAt':_0x2faafe[_0x9f10('0x3f')]?moment(_0x2faafe[_0x9f10('0x110')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x9f10('0x9b')]():'','disposition':_0x2faafe[_0x9f10('0x40')],'chatInfo':{'browser':_0x2faafe[_0x9f10('0x111')],'os':_0x2faafe[_0x9f10('0x112')],'referer':_0x2faafe['referer'],'customerIp':_0x2faafe[_0x9f10('0x113')],'customerPort':_0x2faafe[_0x9f10('0x114')]?_0x2faafe[_0x9f10('0x114')]:_0x9f10('0x10f')},'messages':_(_0x2faafe[_0x9f10('0xe4')])[_0x9f10('0x115')]()[_0x9f10('0x88')]({'secret':![]})[_0x9f10('0x33')](function(_0xddbe2b){if(_0xddbe2b['Attachment']){var _0x32e5fd=path['join'](_0x2ce940,_0xddbe2b[_0x9f10('0xd6')][_0x9f10('0xd3')]);if(fs[_0x9f10('0x116')](_0x32e5fd)){fs['createReadStream'](_0x32e5fd)['pipe'](fs[_0x9f10('0x117')](path[_0x9f10('0xdb')](_0x274ea7,_0xddbe2b[_0x9f10('0xd6')][_0x9f10('0xd3')])));}}return{'date':moment(_0xddbe2b[_0x9f10('0x7e')])[_0x9f10('0xe1')](_0x9f10('0xf9'))[_0x9f10('0x9b')](),'sender':_0xddbe2b['direction']===_0x9f10('0xc8')?_0xddbe2b['User']?_0xddbe2b[_0x9f10('0xe5')][_0x9f10('0x34')]:_0x9f10('0xe8'):_0xddbe2b['Contact']['firstName']+(_0xddbe2b['Contact']['lastName']?'\x20'+_0xddbe2b['Contact'][_0x9f10('0x118')]:''),'body':_0xddbe2b[_0x9f10('0xd6')]?_0xddbe2b['Attachment'][_0x9f10('0xd3')]:_0xddbe2b[_0x9f10('0x2f')],'direction':_0xddbe2b['direction']===_0x9f10('0xc8')?'A':'C','secret':_0xddbe2b[_0x9f10('0x108')],'read':_0xddbe2b[_0x9f10('0x84')],'attachment':_0xddbe2b['Attachment']};})[_0x9f10('0x68')]()};return ejs[_0x9f10('0x119')](path['join'](config[_0x9f10('0xdc')],_0x9f10('0x103'),'views',_0x9f10('0x11a')),{'interaction':_0x46de3d})[_0x9f10('0x16')](function(_0xf35cbd){var _0x59dcf3=path[_0x9f10('0xdb')](_0x274ea7,'transcript-'+_0x2faafe['id']+'-'+_0x492aaf+_0x9f10('0x11b'));var _0x531ae6={'path':_0x59dcf3,'channel':_0x9f10('0x10e'),'interactionId':_0x2faafe['id']};return pdf[_0x9f10('0x11c')](_0xf35cbd,_0x531ae6);})['then'](function(){return new Promise(function(_0x2809b5,_0x44d12b){zipdir(_0x274ea7,{'saveTo':_0x1511b7},function(_0x3518e4,_0x208926){if(_0x3518e4)return _0x44d12b(_0x3518e4);return _0x2809b5(_0x208926);});})[_0x9f10('0x16')](function(){return new BPromise(function(_0x5b9746,_0x208341){rimraf(_0x274ea7,function(_0x41134f){if(_0x41134f)_0x208341(_0x41134f);return _0x5b9746();});});})[_0x9f10('0x16')](function(){return _0x1135ce[_0x9f10('0xde')](_0x1511b7,_0x2b0199,function(_0x6b6e72){if(_0x6b6e72){logger['error']('err',_0x6b6e72);}else{fs[_0x9f10('0x11d')](_0x1511b7);}});});});}else{return _0x1135ce[_0x9f10('0x1e')](0xc8);}})[_0x9f10('0x3a')](handleError(_0x1135ce,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 0362169..9eda2b1 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 _0x86b3=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','map','findAll','then','length','emit','catch','hasOwnProperty','hook','events'];(function(_0x5a6474,_0x4678e1){var _0x485021=function(_0x24dffd){while(--_0x24dffd){_0x5a6474['push'](_0x5a6474['shift']());}};_0x485021(++_0x4678e1);}(_0x86b3,0xc5));var _0x386b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x86b3[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x386b('0x0'));var ChatInteraction=require(_0x386b('0x1'))['db'][_0x386b('0x2')];var ChatMessage=require(_0x386b('0x1'))['db'][_0x386b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x386b('0x4')](0x0);var events={'afterCreate':_0x386b('0x5'),'afterUpdate':_0x386b('0x6'),'afterDestroy':_0x386b('0x7')};function emitEvent(_0x186701){return function(_0x3d2431,_0x476b3b,_0x51972d){_0x3d2431[_0x386b('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3f653d){_0x3d2431[_0x386b('0x9')]('Users',_0x3f653d[_0x386b('0xa')](function(_0x18922b){return{'id':_0x18922b['id']};}));return ChatMessage[_0x386b('0xb')]({'where':{'ChatInteractionId':_0x3d2431['id'],'direction':'in','read':![]},'raw':!![]});})[_0x386b('0xc')](function(_0x39b255){_0x3d2431[_0x386b('0x9')]('unreadMessages',_0x39b255[_0x386b('0xd')]);ChatInteractionEvents[_0x386b('0xe')](_0x186701+':'+_0x3d2431['id'],_0x3d2431);ChatInteractionEvents[_0x386b('0xe')](_0x186701,_0x3d2431);_0x51972d(null);})[_0x386b('0xf')](_0x51972d(null));};}for(var e in events){if(events[_0x386b('0x10')](e)){var event=events[e];ChatInteraction[_0x386b('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x5ab0=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','emit','catch','hook','events'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5ab0,0x1ef));var _0x05ab=function(_0x131f6d,_0x5765ef){_0x131f6d=_0x131f6d-0x0;var _0x1741a8=_0x5ab0[_0x131f6d];return _0x1741a8;};'use strict';var EventEmitter=require(_0x05ab('0x0'));var ChatInteraction=require(_0x05ab('0x1'))['db'][_0x05ab('0x2')];var ChatMessage=require(_0x05ab('0x1'))['db'][_0x05ab('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x05ab('0x4')](0x0);var events={'afterCreate':_0x05ab('0x5'),'afterUpdate':_0x05ab('0x6'),'afterDestroy':_0x05ab('0x7')};function emitEvent(_0x30b733){return function(_0x315f52,_0x4de3bf,_0x3ebd7a){_0x315f52['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x24d45a){_0x315f52[_0x05ab('0x8')](_0x05ab('0x9'),_0x24d45a[_0x05ab('0xa')](function(_0x6cbc57){return{'id':_0x6cbc57['id']};}));return ChatMessage[_0x05ab('0xb')]({'where':{'ChatInteractionId':_0x315f52['id'],'direction':'in','read':![]},'raw':!![]});})[_0x05ab('0xc')](function(_0x1042de){_0x315f52[_0x05ab('0x8')]('unreadMessages',_0x1042de['length']);ChatInteractionEvents[_0x05ab('0xd')](_0x30b733+':'+_0x315f52['id'],_0x315f52);ChatInteractionEvents[_0x05ab('0xd')](_0x30b733,_0x315f52);_0x3ebd7a(null);})[_0x05ab('0xe')](_0x3ebd7a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x05ab('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index f48168e..ace4c99 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 _0xd8eb=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd8eb,0x11b));var _0xbd8e=function(_0x2601b4,_0x315e78){_0x2601b4=_0x2601b4-0x0;var _0x3e3661=_0xd8eb[_0x2601b4];return _0x3e3661;};'use strict';var _=require(_0xbd8e('0x0'));var util=require(_0xbd8e('0x1'));var logger=require(_0xbd8e('0x2'))(_0xbd8e('0x3'));var moment=require(_0xbd8e('0x4'));var BPromise=require(_0xbd8e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8e('0x6'));var rimraf=require(_0xbd8e('0x7'));var config=require(_0xbd8e('0x8'));var attributes=require(_0xbd8e('0x9'));module[_0xbd8e('0xa')]=function(_0x5be2b7,_0x36f891){return _0x5be2b7[_0xbd8e('0xb')]('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a3bf4,_0x4d08dc,_0x271da6){if(_0x5a3bf4[_0xbd8e('0xc')]('closed')){_0x5a3bf4['closedAt']=moment()[_0xbd8e('0xd')](_0xbd8e('0xe'));}_0x271da6(null,_0x5a3bf4);}},'charset':_0xbd8e('0xf'),'collate':_0xbd8e('0x10')});};
\ No newline at end of file
+var _0xee1d=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports','define','chat_interactions'];(function(_0x1308ec,_0x32c99e){var _0x1a43c8=function(_0x18ff62){while(--_0x18ff62){_0x1308ec['push'](_0x1308ec['shift']());}};_0x1a43c8(++_0x32c99e);}(_0xee1d,0x1b6));var _0xdee1=function(_0x54eef5,_0x2da6b4){_0x54eef5=_0x54eef5-0x0;var _0x342329=_0xee1d[_0x54eef5];return _0x342329;};'use strict';var _=require(_0xdee1('0x0'));var util=require(_0xdee1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdee1('0x2'));var BPromise=require(_0xdee1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdee1('0x4'));var rimraf=require(_0xdee1('0x5'));var config=require(_0xdee1('0x6'));var attributes=require('./chatInteraction.attributes');module[_0xdee1('0x7')]=function(_0x5ccc94,_0x176c55){return _0x5ccc94[_0xdee1('0x8')]('ChatInteraction',attributes,{'tableName':_0xdee1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e134b,_0x15694c,_0x1c18a5){if(_0x3e134b[_0xdee1('0xa')]('closed')){_0x3e134b[_0xdee1('0xb')]=moment()[_0xdee1('0xc')](_0xdee1('0xd'));}_0x1c18a5(null,_0x3e134b);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 40868f7..2dae279 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 _0x2c9f=['error','code','message','catch','UpdateChatInteraction','update','raw','options','attributes','limit','ChatInteraction','find','addTags','body','omit','spread','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ec7f2,_0x3d92d2){var _0x118004=function(_0x1ac4fb){while(--_0x1ac4fb){_0x4ec7f2['push'](_0x4ec7f2['shift']());}};_0x118004(++_0x3d92d2);}(_0x2c9f,0x1c9));var _0xf2c9=function(_0x11d44b,_0x1c8de0){_0x11d44b=_0x11d44b-0x0;var _0x7af8aa=_0x2c9f[_0x11d44b];return _0x7af8aa;};'use strict';var _=require(_0xf2c9('0x0'));var util=require(_0xf2c9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf2c9('0x2'));var fs=require('fs');var Redis=require(_0xf2c9('0x3'));var db=require(_0xf2c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf2c9('0x5'))(_0xf2c9('0x6'));var config=require(_0xf2c9('0x7'));var jayson=require(_0xf2c9('0x8'));var client=jayson[_0xf2c9('0x9')]['http']({'port':0x232a});config[_0xf2c9('0xa')]=_[_0xf2c9('0xb')](config[_0xf2c9('0xa')],{'host':_0xf2c9('0xc'),'port':0x18eb});var socket=require(_0xf2c9('0xd'))(new Redis(config[_0xf2c9('0xa')]));require(_0xf2c9('0xe'))['register'](socket);function respondWithRpcPromise(_0x2861ab,_0x424058,_0xf74184){return new BPromise(function(_0x2b60f6,_0x265174){return client[_0xf2c9('0xf')](_0x2861ab,_0xf74184)[_0xf2c9('0x10')](function(_0x3f0ba4){logger[_0xf2c9('0x11')](_0xf2c9('0x12'),_0x424058,_0xf2c9('0x13'));logger[_0xf2c9('0x14')](_0xf2c9('0x15'),_0x424058,_0xf2c9('0x13'),JSON[_0xf2c9('0x16')](_0x3f0ba4));if(_0x3f0ba4[_0xf2c9('0x17')]){if(_0x3f0ba4[_0xf2c9('0x17')][_0xf2c9('0x18')]===0x1f4){logger[_0xf2c9('0x17')](_0xf2c9('0x12'),_0x424058,_0x3f0ba4['error'][_0xf2c9('0x19')]);return _0x265174(_0x3f0ba4[_0xf2c9('0x17')]['message']);}logger[_0xf2c9('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x424058,_0x3f0ba4[_0xf2c9('0x17')]['message']);return _0x2b60f6(_0x3f0ba4[_0xf2c9('0x17')][_0xf2c9('0x19')]);}else{logger['info'](_0xf2c9('0x12'),_0x424058,_0xf2c9('0x13'));_0x2b60f6(_0x3f0ba4['result'][_0xf2c9('0x19')]);}})[_0xf2c9('0x1a')](function(_0x44d362){logger[_0xf2c9('0x17')](_0xf2c9('0x12'),_0x424058,_0x44d362);_0x265174(_0x44d362);});});}exports[_0xf2c9('0x1b')]=function(_0x1fd3ac){var _0xb839db=this;return new Promise(function(_0x90743a,_0x1e006a){return db['ChatInteraction'][_0xf2c9('0x1c')](_0x1fd3ac['body'],{'raw':_0x1fd3ac['options']?_0x1fd3ac['options'][_0xf2c9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fd3ac[_0xf2c9('0x1e')]?_0x1fd3ac['options']['where']||null:null,'attributes':_0x1fd3ac['options']?_0x1fd3ac[_0xf2c9('0x1e')][_0xf2c9('0x1f')]||null:null,'limit':_0x1fd3ac['options']?_0x1fd3ac['options'][_0xf2c9('0x20')]||null:null})[_0xf2c9('0x10')](function(_0x4bb35f){logger[_0xf2c9('0x11')](_0xf2c9('0x1b'),_0x1fd3ac);logger[_0xf2c9('0x14')]('UpdateChatInteraction',_0x1fd3ac,JSON[_0xf2c9('0x16')](_0x4bb35f));_0x90743a(_0x4bb35f);})[_0xf2c9('0x1a')](function(_0x31beb2){logger[_0xf2c9('0x17')](_0xf2c9('0x1b'),_0x31beb2[_0xf2c9('0x19')],_0x1fd3ac);_0x1e006a(_0xb839db[_0xf2c9('0x17')](0x1f4,_0x31beb2[_0xf2c9('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x512d10){return new Promise(function(_0x3b1cfe,_0x17c1b8){return db[_0xf2c9('0x21')][_0xf2c9('0x22')]({'where':_0x512d10[_0xf2c9('0x1e')]?_0x512d10[_0xf2c9('0x1e')]['where']||null:null})[_0xf2c9('0x10')](function(_0x1d0d3b){if(_0x1d0d3b){return _0x1d0d3b[_0xf2c9('0x23')](_0x512d10[_0xf2c9('0x24')]['ids'],_[_0xf2c9('0x25')](_0x512d10['body'],['ids','id'])||{});}})[_0xf2c9('0x26')](function(_0x5ccb69){logger[_0xf2c9('0x11')](_0xf2c9('0x27'),_0x512d10);logger[_0xf2c9('0x14')]('AddTags',_0x512d10,JSON[_0xf2c9('0x16')](_0x5ccb69));_0x3b1cfe(_0x5ccb69);})[_0xf2c9('0x1a')](function(_0x4ebaab){logger[_0xf2c9('0x17')]('AddTags',_0x4ebaab[_0xf2c9('0x19')],_0x512d10);_0x17c1b8(_this[_0xf2c9('0x17')](0x1f4,_0x4ebaab[_0xf2c9('0x19')]));});});};
\ No newline at end of file
+var _0x7ebd=['ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','addTags','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','register','request','info'];(function(_0x3d8857,_0x5777c8){var _0x26ee98=function(_0x357885){while(--_0x357885){_0x3d8857['push'](_0x3d8857['shift']());}};_0x26ee98(++_0x5777c8);}(_0x7ebd,0x159));var _0xd7eb=function(_0x47b504,_0x2b6163){_0x47b504=_0x47b504-0x0;var _0x16ffa9=_0x7ebd[_0x47b504];return _0x16ffa9;};'use strict';var _=require(_0xd7eb('0x0'));var util=require(_0xd7eb('0x1'));var moment=require(_0xd7eb('0x2'));var BPromise=require(_0xd7eb('0x3'));var rs=require(_0xd7eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd7eb('0x5'));var logger=require('../../config/logger')(_0xd7eb('0x6'));var config=require(_0xd7eb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7eb('0x8')]({'port':0x232a});config['redis']=_[_0xd7eb('0x9')](config[_0xd7eb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xd7eb('0xb'))(new Redis(config[_0xd7eb('0xa')]));require('./chatInteraction.socket')[_0xd7eb('0xc')](socket);function respondWithRpcPromise(_0x1bb373,_0x54f3b7,_0x56e0d1){return new BPromise(function(_0x3efd44,_0x279c7e){return client[_0xd7eb('0xd')](_0x1bb373,_0x56e0d1)['then'](function(_0x4cb6e1){logger[_0xd7eb('0xe')](_0xd7eb('0xf'),_0x54f3b7,'request\x20sent');logger[_0xd7eb('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x54f3b7,_0xd7eb('0x11'),JSON[_0xd7eb('0x12')](_0x4cb6e1));if(_0x4cb6e1['error']){if(_0x4cb6e1[_0xd7eb('0x13')][_0xd7eb('0x14')]===0x1f4){logger[_0xd7eb('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x54f3b7,_0x4cb6e1[_0xd7eb('0x13')]['message']);return _0x279c7e(_0x4cb6e1['error'][_0xd7eb('0x15')]);}logger[_0xd7eb('0x13')](_0xd7eb('0xf'),_0x54f3b7,_0x4cb6e1[_0xd7eb('0x13')][_0xd7eb('0x15')]);return _0x3efd44(_0x4cb6e1['error'][_0xd7eb('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x54f3b7,_0xd7eb('0x11'));_0x3efd44(_0x4cb6e1['result'][_0xd7eb('0x15')]);}})[_0xd7eb('0x16')](function(_0x368b35){logger['error'](_0xd7eb('0xf'),_0x54f3b7,_0x368b35);_0x279c7e(_0x368b35);});});}exports[_0xd7eb('0x17')]=function(_0x131684){var _0x42ca46=this;return new Promise(function(_0x3dabf2,_0x383bce){return db[_0xd7eb('0x18')][_0xd7eb('0x19')](_0x131684[_0xd7eb('0x1a')],{'raw':_0x131684[_0xd7eb('0x1b')]?_0x131684['options'][_0xd7eb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x131684[_0xd7eb('0x1b')]?_0x131684['options']['where']||null:null,'attributes':_0x131684[_0xd7eb('0x1b')]?_0x131684['options'][_0xd7eb('0x1d')]||null:null,'limit':_0x131684[_0xd7eb('0x1b')]?_0x131684[_0xd7eb('0x1b')][_0xd7eb('0x1e')]||null:null})['then'](function(_0x58233e){logger[_0xd7eb('0xe')]('UpdateChatInteraction',_0x131684);logger[_0xd7eb('0x10')]('UpdateChatInteraction',_0x131684,JSON[_0xd7eb('0x12')](_0x58233e));_0x3dabf2(_0x58233e);})[_0xd7eb('0x16')](function(_0x526bf0){logger[_0xd7eb('0x13')]('UpdateChatInteraction',_0x526bf0[_0xd7eb('0x15')],_0x131684);_0x383bce(_0x42ca46[_0xd7eb('0x13')](0x1f4,_0x526bf0[_0xd7eb('0x15')]));});});};exports[_0xd7eb('0x1f')]=function(_0x5c9627){return new Promise(function(_0x2f4279,_0x465bd6){return db[_0xd7eb('0x18')][_0xd7eb('0x20')]({'where':_0x5c9627[_0xd7eb('0x1b')]?_0x5c9627[_0xd7eb('0x1b')][_0xd7eb('0x21')]||null:null})['then'](function(_0x59b12b){if(_0x59b12b){return _0x59b12b[_0xd7eb('0x22')](_0x5c9627[_0xd7eb('0x1a')]['ids'],_['omit'](_0x5c9627[_0xd7eb('0x1a')],['ids','id'])||{});}})['spread'](function(_0x1113f5){logger['info'](_0xd7eb('0x23'),_0x5c9627);logger[_0xd7eb('0x10')]('AddTags',_0x5c9627,JSON['stringify'](_0x1113f5));_0x2f4279(_0x1113f5);})['catch'](function(_0x199136){logger[_0xd7eb('0x13')]('AddTags',_0x199136['message'],_0x5c9627);_0x465bd6(_this[_0xd7eb('0x13')](0x1f4,_0x199136[_0xd7eb('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index ed9f07e..7faa5e0 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 _0x2ebe=['save','remove','update','emit','removeListener','register'];(function(_0x335826,_0x5053f2){var _0xa07893=function(_0x357bdf){while(--_0x357bdf){_0x335826['push'](_0x335826['shift']());}};_0xa07893(++_0x5053f2);}(_0x2ebe,0x174));var _0xe2eb=function(_0x23b000,_0x204d41){_0x23b000=_0x23b000-0x0;var _0x3ad41a=_0x2ebe[_0x23b000];return _0x3ad41a;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xe2eb('0x0'),_0xe2eb('0x1'),_0xe2eb('0x2')];function createListener(_0x10d2ee,_0x30b644){return function(_0x3e52ac){_0x30b644[_0xe2eb('0x3')](_0x10d2ee,_0x3e52ac);};}function removeListener(_0x146a00,_0x5ad308){return function(){ChatInteractionEvents[_0xe2eb('0x4')](_0x146a00,_0x5ad308);};}exports[_0xe2eb('0x5')]=function(_0x370d0a){for(var _0x6f5dc0=0x0,_0x3d048e=events['length'];_0x6f5dc0<_0x3d048e;_0x6f5dc0++){var _0x33af3b=events[_0x6f5dc0];var _0x403fbd=createListener('chatInteraction:'+_0x33af3b,_0x370d0a);ChatInteractionEvents['on'](_0x33af3b,_0x403fbd);}};
\ No newline at end of file
+var _0xa79a=['register','chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener'];(function(_0x53961f,_0x4533eb){var _0x42067f=function(_0x43422d){while(--_0x43422d){_0x53961f['push'](_0x53961f['shift']());}};_0x42067f(++_0x4533eb);}(_0xa79a,0x12f));var _0xaa79=function(_0x13d481,_0x17bc03){_0x13d481=_0x13d481-0x0;var _0x11de99=_0xa79a[_0x13d481];return _0x11de99;};'use strict';var ChatInteractionEvents=require(_0xaa79('0x0'));var events=['save',_0xaa79('0x1'),_0xaa79('0x2')];function createListener(_0x18ba57,_0x442e30){return function(_0x4e13cf){_0x442e30[_0xaa79('0x3')](_0x18ba57,_0x4e13cf);};}function removeListener(_0x12dd39,_0x29f871){return function(){ChatInteractionEvents[_0xaa79('0x4')](_0x12dd39,_0x29f871);};}exports[_0xaa79('0x5')]=function(_0x844d0c){for(var _0x4d456f=0x0,_0x257971=events['length'];_0x4d456f<_0x257971;_0x4d456f++){var _0x21ee25=events[_0x4d456f];var _0x3833ee=createListener(_0xaa79('0x6')+_0x21ee25,_0x844d0c);ChatInteractionEvents['on'](_0x21ee25,_0x3833ee);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index a61774c..b67fbc5 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 _0xbde3=['/:id/abandon','abandon','/:id/close','close','delete','/:id','tracked','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','download','post','create','diskStorage','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate'];(function(_0x3068cb,_0x3441b8){var _0x4f2d79=function(_0xb8ae7e){while(--_0xb8ae7e){_0x3068cb['push'](_0x3068cb['shift']());}};_0x4f2d79(++_0x3441b8);}(_0xbde3,0x130));var _0x3bde=function(_0x442ae6,_0x58743b){_0x442ae6=_0x442ae6-0x0;var _0x581317=_0xbde3[_0x442ae6];return _0x581317;};'use strict';var multer=require('multer');var util=require(_0x3bde('0x0'));var path=require(_0x3bde('0x1'));var timeout=require(_0x3bde('0x2'));var express=require(_0x3bde('0x3'));var router=express[_0x3bde('0x4')]();var fs_extra=require(_0x3bde('0x5'));var auth=require(_0x3bde('0x6'));var interaction=require(_0x3bde('0x7'));var config=require(_0x3bde('0x8'));var controller=require(_0x3bde('0x9'));router[_0x3bde('0xa')]('/',auth[_0x3bde('0xb')](),controller['index']);router['get'](_0x3bde('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x3bde('0xa')]('/:id',auth[_0x3bde('0xd')](),controller[_0x3bde('0xe')]);router[_0x3bde('0xa')](_0x3bde('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x3bde('0x10')]);router['get']('/:id/messages',auth[_0x3bde('0xb')](),controller['getMessages']);router[_0x3bde('0xa')]('/:id/my_messages',auth[_0x3bde('0xd')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x3bde('0xb')](),controller[_0x3bde('0x11')]);router[_0x3bde('0x12')]('/',auth[_0x3bde('0xb')](),controller[_0x3bde('0x13')]);router['post']('/:id/vidaoo',auth[_0x3bde('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x3bde('0x14')]({'destination':function(_0x53a27e,_0x324c0e,_0x53588e){_0x53588e(null,path['join'](config['root'],_0x3bde('0x15')));},'filename':function(_0x5b3e28,_0x2af720,_0x22e9b1){_0x22e9b1(null,util[_0x3bde('0x16')](_0x3bde('0x17'),Date['now'](),_0x2af720[_0x3bde('0x18')][_0x3bde('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3bde('0x12')](_0x3bde('0x1a'),upload[_0x3bde('0x1b')]('file'),controller[_0x3bde('0x1c')]);router[_0x3bde('0x12')](_0x3bde('0x1d'),auth[_0x3bde('0xd')](),controller['addMessage']);router['post'](_0x3bde('0x1e'),auth[_0x3bde('0xb')](),interaction['tracked'](_0x3bde('0x1f'),_0x3bde('0x20')),controller[_0x3bde('0x21')]);router[_0x3bde('0x22')]('/:id',auth[_0x3bde('0xb')](),interaction['tracked'](_0x3bde('0x1f'),_0x3bde('0x23')),controller[_0x3bde('0x24')]);router['put'](_0x3bde('0x25'),controller[_0x3bde('0x26')]);router[_0x3bde('0x22')](_0x3bde('0x27'),auth[_0x3bde('0xd')](),controller[_0x3bde('0x28')]);router['put'](_0x3bde('0x29'),controller[_0x3bde('0x2a')]);router[_0x3bde('0x2b')](_0x3bde('0x2c'),auth[_0x3bde('0xb')](),interaction[_0x3bde('0x2d')](_0x3bde('0x1f'),'chatinteraction:destroy'),controller[_0x3bde('0x2e')]);router[_0x3bde('0x2b')](_0x3bde('0x1e'),auth['isAuthenticated'](),controller[_0x3bde('0x2f')]);module[_0x3bde('0x30')]=router;
\ No newline at end of file
+var _0xe09c=['diskStorage','join','root','server/files/attachments/','format','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','removeTags','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession'];(function(_0x2f922f,_0x34a14f){var _0x4a63d4=function(_0x251b57){while(--_0x251b57){_0x2f922f['push'](_0x2f922f['shift']());}};_0x4a63d4(++_0x34a14f);}(_0xe09c,0x123));var _0xce09=function(_0x1118d3,_0x15bb5f){_0x1118d3=_0x1118d3-0x0;var _0x190edc=_0xe09c[_0x1118d3];return _0x190edc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xce09('0x0'));var timeout=require(_0xce09('0x1'));var express=require(_0xce09('0x2'));var router=express[_0xce09('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce09('0x4'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xce09('0x5')]('/',auth[_0xce09('0x6')](),controller[_0xce09('0x7')]);router[_0xce09('0x5')]('/describe',auth[_0xce09('0x6')](),controller[_0xce09('0x8')]);router[_0xce09('0x5')]('/:id',auth[_0xce09('0x9')](),controller[_0xce09('0xa')]);router['get'](_0xce09('0xb'),auth['isChatInteractionAuthorized'](),controller[_0xce09('0xc')]);router[_0xce09('0x5')](_0xce09('0xd'),auth[_0xce09('0x6')](),controller[_0xce09('0xe')]);router[_0xce09('0x5')](_0xce09('0xf'),auth[_0xce09('0x9')](),controller[_0xce09('0x10')]);router[_0xce09('0x5')](_0xce09('0x11'),auth[_0xce09('0x6')](),controller[_0xce09('0x12')]);router[_0xce09('0x13')]('/',auth[_0xce09('0x6')](),controller['create']);router[_0xce09('0x13')]('/:id/vidaoo',auth[_0xce09('0x6')](),controller[_0xce09('0x14')]);var upload=multer({'storage':multer[_0xce09('0x15')]({'destination':function(_0x1a2de8,_0x4945dc,_0x5813ef){_0x5813ef(null,path[_0xce09('0x16')](config[_0xce09('0x17')],_0xce09('0x18')));},'filename':function(_0x2a1b45,_0x349029,_0x130492){_0x130492(null,util[_0xce09('0x19')]('%s-%s',Date['now'](),_0x349029[_0xce09('0x1a')][_0xce09('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xce09('0x13')](_0xce09('0x1c'),upload[_0xce09('0x1d')](_0xce09('0x1e')),controller[_0xce09('0x1f')]);router[_0xce09('0x13')](_0xce09('0xd'),auth[_0xce09('0x9')](),controller[_0xce09('0x20')]);router[_0xce09('0x13')](_0xce09('0x21'),auth[_0xce09('0x6')](),interaction[_0xce09('0x22')]('chat',_0xce09('0x23')),controller[_0xce09('0x24')]);router[_0xce09('0x25')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xce09('0x26'),_0xce09('0x27')),controller[_0xce09('0x28')]);router[_0xce09('0x25')](_0xce09('0x29'),controller[_0xce09('0x2a')]);router[_0xce09('0x25')](_0xce09('0x2b'),auth[_0xce09('0x9')](),controller[_0xce09('0x2c')]);router['put'](_0xce09('0x2d'),controller[_0xce09('0x2e')]);router[_0xce09('0x2f')](_0xce09('0x30'),auth[_0xce09('0x6')](),interaction[_0xce09('0x22')]('chat',_0xce09('0x31')),controller[_0xce09('0x32')]);router[_0xce09('0x2f')](_0xce09('0x21'),auth[_0xce09('0x6')](),controller[_0xce09('0x33')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index e983155..da11504 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 _0xdc2d=['INTEGER','sequelize','BOOLEAN'];(function(_0xdecc07,_0x54ee6d){var _0x2ad019=function(_0x49f7fa){while(--_0x49f7fa){_0xdecc07['push'](_0xdecc07['shift']());}};_0x2ad019(++_0x54ee6d);}(_0xdc2d,0xa9));var _0xddc2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdc2d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xddc2('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xddc2('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xddc2('0x2')]}};
\ No newline at end of file
+var _0xd787=['INTEGER','sequelize','TEXT','medium','BOOLEAN'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0xd787,0x1a0));var _0x7d78=function(_0x46d4c1,_0x2d0dca){_0x46d4c1=_0x46d4c1-0x0;var _0xf2a962=_0xd787[_0x46d4c1];return _0xf2a962;};'use strict';var Sequelize=require(_0x7d78('0x0'));module['exports']={'body':{'type':Sequelize[_0x7d78('0x1')](_0x7d78('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7d78('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7d78('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 3f2d660..0a1bdad 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 _0xc16f=['create','body','params','describe','createdAt','lastMessageAt','format','lastMessage','getUsers','agent','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find'];(function(_0x42ed03,_0x18b558){var _0x1a0126=function(_0xe74416){while(--_0xe74416){_0x42ed03['push'](_0x42ed03['shift']());}};_0x1a0126(++_0x18b558);}(_0xc16f,0x1eb));var _0xfc16=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc16f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfc16('0x0'));var rimraf=require(_0xfc16('0x1'));var zipdir=require(_0xfc16('0x2'));var jsonpatch=require(_0xfc16('0x3'));var rp=require(_0xfc16('0x4'));var moment=require(_0xfc16('0x5'));var BPromise=require(_0xfc16('0x6'));var Mustache=require(_0xfc16('0x7'));var util=require('util');var path=require(_0xfc16('0x8'));var sox=require(_0xfc16('0x9'));var csv=require(_0xfc16('0xa'));var ejs=require(_0xfc16('0xb'));var fs=require('fs');var fs_extra=require(_0xfc16('0xc'));var _=require('lodash');var squel=require(_0xfc16('0xd'));var crypto=require(_0xfc16('0xe'));var jsforce=require(_0xfc16('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfc16('0xa'));var querystring=require('querystring');var Papa=require(_0xfc16('0x10'));var Redis=require(_0xfc16('0x11'));var authService=require(_0xfc16('0x12'));var qs=require(_0xfc16('0x13'));var as=require(_0xfc16('0x14'));var hardwareService=require(_0xfc16('0x15'));var logger=require(_0xfc16('0x16'))(_0xfc16('0x17'));var utils=require('../../config/utils');var config=require(_0xfc16('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfc16('0x19')]=_[_0xfc16('0x1a')](config[_0xfc16('0x19')],{'host':_0xfc16('0x1b'),'port':0x18eb});var socket=require(_0xfc16('0x1c'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xfc16('0x1d')](socket);function respondWithStatusCode(_0x17be7d,_0x46fbdc){_0x46fbdc=_0x46fbdc||0xcc;return function(_0x4f8e75){if(_0x4f8e75){return _0x17be7d['sendStatus'](_0x46fbdc);}return _0x17be7d[_0xfc16('0x1e')](_0x46fbdc)[_0xfc16('0x1f')]();};}function respondWithResult(_0x58b894,_0x24eab5){_0x24eab5=_0x24eab5||0xc8;return function(_0x4b84d7){if(_0x4b84d7){return _0x58b894[_0xfc16('0x1e')](_0x24eab5)[_0xfc16('0x20')](_0x4b84d7);}};}function respondWithFilteredResult(_0x433804,_0x2f4ecf){return function(_0x48fa2e){if(_0x48fa2e){var _0x4bb7ff=typeof _0x2f4ecf[_0xfc16('0x21')]==='undefined'&&typeof _0x2f4ecf[_0xfc16('0x22')]===_0xfc16('0x23');var _0x5d5145=_0x48fa2e[_0xfc16('0x24')];var _0x3f78f3=_0x4bb7ff?0x0:_0x2f4ecf[_0xfc16('0x21')];var _0x1138fb=_0x4bb7ff?_0x48fa2e[_0xfc16('0x24')]:_0x2f4ecf[_0xfc16('0x21')]+_0x2f4ecf['limit'];var _0x3beaab;if(_0x1138fb>=_0x5d5145){_0x1138fb=_0x5d5145;_0x3beaab=0xc8;}else{_0x3beaab=0xce;}_0x433804['status'](_0x3beaab);return _0x433804[_0xfc16('0x25')](_0xfc16('0x26'),_0x3f78f3+'-'+_0x1138fb+'/'+_0x5d5145)[_0xfc16('0x20')](_0x48fa2e);}return null;};}function patchUpdates(_0x52e86f){return function(_0x5831cc){try{jsonpatch['apply'](_0x5831cc,_0x52e86f,!![]);}catch(_0x30df21){return BPromise[_0xfc16('0x27')](_0x30df21);}return _0x5831cc[_0xfc16('0x28')]();};}function saveUpdates(_0x53413c,_0x5b6102){return function(_0x5ad189){if(_0x5ad189){return _0x5ad189[_0xfc16('0x29')](_0x53413c)[_0xfc16('0x2a')](function(_0x5cd5af){return _0x5cd5af;});}return null;};}function removeEntity(_0x46f5c4,_0x4a7201){return function(_0x3777f7){if(_0x3777f7){return _0x3777f7[_0xfc16('0x2b')]()['then'](function(){_0x46f5c4[_0xfc16('0x1e')](0xcc)[_0xfc16('0x1f')]();});}};}function handleEntityNotFound(_0x5bc2a5,_0x4d302f){return function(_0x182686){if(!_0x182686){_0x5bc2a5[_0xfc16('0x2c')](0x194);}return _0x182686;};}function handleError(_0x31974c,_0x17d9d5){_0x17d9d5=_0x17d9d5||0x1f4;return function(_0xee267d){logger[_0xfc16('0x2d')](_0xee267d[_0xfc16('0x2e')]);if(_0xee267d['name']){delete _0xee267d[_0xfc16('0x2f')];}_0x31974c[_0xfc16('0x1e')](_0x17d9d5)[_0xfc16('0x30')](_0xee267d);};}exports[_0xfc16('0x31')]=function(_0x54ad95,_0xcd880d){var _0x5dde2d={},_0x468c71={},_0x5d879e={'count':0x0,'rows':[]};var _0xdbecab=_[_0xfc16('0x32')](db[_0xfc16('0x33')]['rawAttributes'],function(_0x51ffd9){return{'name':_0x51ffd9['fieldName'],'type':_0x51ffd9[_0xfc16('0x34')][_0xfc16('0x35')]};});_0x468c71['model']=_[_0xfc16('0x32')](_0xdbecab,_0xfc16('0x2f'));_0x468c71[_0xfc16('0x36')]=_[_0xfc16('0x37')](_0x54ad95[_0xfc16('0x36')]);_0x468c71['filters']=_[_0xfc16('0x38')](_0x468c71[_0xfc16('0x39')],_0x468c71['query']);_0x5dde2d['attributes']=_[_0xfc16('0x38')](_0x468c71[_0xfc16('0x39')],qs[_0xfc16('0x3a')](_0x54ad95[_0xfc16('0x36')][_0xfc16('0x3a')]));_0x5dde2d[_0xfc16('0x3b')]=_0x5dde2d['attributes'][_0xfc16('0x3c')]?_0x5dde2d[_0xfc16('0x3b')]:_0x468c71[_0xfc16('0x39')];if(!_0x54ad95[_0xfc16('0x36')][_0xfc16('0x3d')](_0xfc16('0x3e'))){_0x5dde2d[_0xfc16('0x22')]=qs[_0xfc16('0x22')](_0x54ad95[_0xfc16('0x36')][_0xfc16('0x22')]);_0x5dde2d['offset']=qs[_0xfc16('0x21')](_0x54ad95['query']['offset']);}_0x5dde2d[_0xfc16('0x3f')]=qs[_0xfc16('0x40')](_0x54ad95['query'][_0xfc16('0x40')]);_0x5dde2d[_0xfc16('0x41')]=qs['filters'](_[_0xfc16('0x42')](_0x54ad95[_0xfc16('0x36')],_0x468c71[_0xfc16('0x43')]),_0xdbecab);if(_0x54ad95[_0xfc16('0x36')]['filter']){_0x5dde2d[_0xfc16('0x41')]=_[_0xfc16('0x44')](_0x5dde2d[_0xfc16('0x41')],{'$or':_[_0xfc16('0x32')](_0xdbecab,function(_0x2437d9){if(_0x2437d9['type']!==_0xfc16('0x45')){var _0x5af1a5={};_0x5af1a5[_0x2437d9[_0xfc16('0x2f')]]={'$like':'%'+_0x54ad95[_0xfc16('0x36')][_0xfc16('0x46')]+'%'};return _0x5af1a5;}})});}_0x5dde2d=_['merge']({},_0x5dde2d,_0x54ad95[_0xfc16('0x47')]);var _0x245b48={'where':_0x5dde2d['where']};return db[_0xfc16('0x33')][_0xfc16('0x24')](_0x245b48)[_0xfc16('0x2a')](function(_0x55614f){_0x5d879e['count']=_0x55614f;if(_0x54ad95[_0xfc16('0x36')][_0xfc16('0x48')]){_0x5dde2d[_0xfc16('0x49')]=[{'all':!![]}];}return db[_0xfc16('0x33')][_0xfc16('0x4a')](_0x5dde2d);})['then'](function(_0x5e3baf){_0x5d879e[_0xfc16('0x4b')]=_0x5e3baf;return _0x5d879e;})['then'](respondWithFilteredResult(_0xcd880d,_0x5dde2d))[_0xfc16('0x4c')](handleError(_0xcd880d,null));};exports[_0xfc16('0x4d')]=function(_0x34ae54,_0x2efca5){var _0xf1b7e3={'raw':!![],'where':{'id':_0x34ae54['params']['id']}},_0x43e09f={};_0x43e09f[_0xfc16('0x39')]=_[_0xfc16('0x37')](db['ChatInternalMessage']['rawAttributes']);_0x43e09f['query']=_[_0xfc16('0x37')](_0x34ae54[_0xfc16('0x36')]);_0x43e09f[_0xfc16('0x43')]=_[_0xfc16('0x38')](_0x43e09f['model'],_0x43e09f['query']);_0xf1b7e3['attributes']=_[_0xfc16('0x38')](_0x43e09f[_0xfc16('0x39')],qs['fields'](_0x34ae54[_0xfc16('0x36')][_0xfc16('0x3a')]));_0xf1b7e3[_0xfc16('0x3b')]=_0xf1b7e3[_0xfc16('0x3b')][_0xfc16('0x3c')]?_0xf1b7e3[_0xfc16('0x3b')]:_0x43e09f[_0xfc16('0x39')];if(_0x34ae54[_0xfc16('0x36')][_0xfc16('0x48')]){_0xf1b7e3[_0xfc16('0x49')]=[{'all':!![]}];}_0xf1b7e3=_[_0xfc16('0x44')]({},_0xf1b7e3,_0x34ae54['options']);return db[_0xfc16('0x33')][_0xfc16('0x4e')](_0xf1b7e3)[_0xfc16('0x2a')](handleEntityNotFound(_0x2efca5,null))[_0xfc16('0x2a')](respondWithResult(_0x2efca5,null))[_0xfc16('0x4c')](handleError(_0x2efca5,null));};exports[_0xfc16('0x4f')]=function(_0x134b81,_0x3f75df){return db['ChatInternalMessage'][_0xfc16('0x4f')](_0x134b81[_0xfc16('0x50')],{})['then'](respondWithResult(_0x3f75df,0xc9))[_0xfc16('0x4c')](handleError(_0x3f75df,null));};exports['update']=function(_0x3bf86e,_0x2fc137){if(_0x3bf86e[_0xfc16('0x50')]['id']){delete _0x3bf86e[_0xfc16('0x50')]['id'];}return db['ChatInternalMessage'][_0xfc16('0x4e')]({'where':{'id':_0x3bf86e[_0xfc16('0x51')]['id']}})[_0xfc16('0x2a')](handleEntityNotFound(_0x2fc137,null))[_0xfc16('0x2a')](saveUpdates(_0x3bf86e[_0xfc16('0x50')],null))[_0xfc16('0x2a')](respondWithResult(_0x2fc137,null))[_0xfc16('0x4c')](handleError(_0x2fc137,null));};exports[_0xfc16('0x2b')]=function(_0x417565,_0x4c6624){return db['ChatInternalMessage'][_0xfc16('0x4e')]({'where':{'id':_0x417565[_0xfc16('0x51')]['id']}})[_0xfc16('0x2a')](handleEntityNotFound(_0x4c6624,null))[_0xfc16('0x2a')](removeEntity(_0x4c6624,null))[_0xfc16('0x4c')](handleError(_0x4c6624,null));};exports[_0xfc16('0x52')]=function(_0x57c963,_0x4939fe){return db['ChatInternalMessage'][_0xfc16('0x52')]()[_0xfc16('0x2a')](respondWithResult(_0x4939fe,null))[_0xfc16('0x4c')](handleError(_0x4939fe,null));};function wrapUser(_0xabeaf2){return function(_0x6542d5){var _0x3f11f3=_0xabeaf2['get']({'plain':!![]});_0x3f11f3['messages']=[];if(_0x6542d5){_0x3f11f3['lastMessageAt']=_0x6542d5[_0xfc16('0x53')];_0x3f11f3['lastMessage']=_0x6542d5;}else{_0x3f11f3[_0xfc16('0x54')]=moment(0x0)[_0xfc16('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f11f3[_0xfc16('0x56')]={};}return _0x3f11f3;};}exports[_0xfc16('0x57')]=function(_0x2c413a,_0xdbc166,_0x2d47b5){var _0x4b33ab=[];return db['User'][_0xfc16('0x4a')]({'where':{'role':[_0xfc16('0x58'),'admin',_0xfc16('0x59')]},'attributes':['id',_0xfc16('0x5a'),'name',_0xfc16('0x5b'),_0xfc16('0x5c'),_0xfc16('0x5d'),_0xfc16('0x5e'),'lastLoginAt',_0xfc16('0x5f'),_0xfc16('0x60')],'order':qs[_0xfc16('0x40')](_0xfc16('0x61')),'include':[{'model':db[_0xfc16('0x62')],'as':_0xfc16('0x63'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0xfc16('0x2a')](function(_0x4f9385){if(_0x4f9385){var _0x4afa3d=_0x2c413a[_0xfc16('0x59')][_0xfc16('0x64')]({'plain':!![]});if(!_0x4afa3d)throw new Error(_0xfc16('0x65'));if(_0x4afa3d['role']===_0xfc16('0x59')){return db[_0xfc16('0x66')][_0xfc16('0x4e')]({'where':{'name':_0xfc16('0x67'),'userProfileId':_0x4afa3d['userProfileId']},'raw':!![]})[_0xfc16('0x2a')](function(_0x34ed86){if(_0x34ed86){if(_0x34ed86[_0xfc16('0x68')]===0x0){return db[_0xfc16('0x69')][_0xfc16('0x4a')]({'where':{'sectionId':_0x34ed86['id']},'raw':!![]})[_0xfc16('0x2a')](function(_0x2c7b44){var _0x6d8471=[];if(_[_0xfc16('0x6a')](_0x2c7b44)){_0x6d8471=_['filter'](_0x4f9385,function(_0x3e40ea){if(_0x3e40ea[_0xfc16('0x5b')]!==_0xfc16('0x58')){return _0x3e40ea;}});return _0x6d8471;}else{for(var _0x1226b6=0x0;_0x1226b6<_0x4f9385['length'];_0x1226b6++){var _0x6dfe5f=_0x4f9385[_0x1226b6];if(_0x6dfe5f['role']===_0xfc16('0x58')){var _0x2344ca=_['find'](_0x2c7b44,function(_0xf4b20d){return _0xf4b20d[_0xfc16('0x6b')]===_0x6dfe5f['id'];});if(_0x2344ca)_0x6d8471[_0xfc16('0x6c')](_0x6dfe5f);}else{_0x6d8471[_0xfc16('0x6c')](_0x6dfe5f);}}return _0x6d8471;}});}else{return _0x4f9385;}}else{var _0x1efdca=_[_0xfc16('0x46')](_0x4f9385,function(_0x31b61b){if(_0x31b61b[_0xfc16('0x5b')]!=='agent'){return _0x31b61b;}});return _0x1efdca;}});}else{return _0x4f9385;}}})[_0xfc16('0x2a')](function(_0x402c50){var _0x383738=[];if(_0x402c50){_0x4b33ab=_0x402c50;for(var _0x312194=0x0;_0x312194<_0x402c50[_0xfc16('0x3c')];_0x312194+=0x1){_0x4b33ab[_0x312194][_0xfc16('0x6d')]=[];_0x383738[_0xfc16('0x6c')](db[_0xfc16('0x33')][_0xfc16('0x4e')]({'where':{'FromId':[_0x2c413a['user']['id'],_0x402c50[_0x312194]['id']],'ToId':[_0x2c413a[_0xfc16('0x59')]['id'],_0x402c50[_0x312194]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xfc16('0x6e'),_0xfc16('0x6f'),_0xfc16('0x50')],'order':qs[_0xfc16('0x40')](_0xfc16('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfc16('0x2a')](wrapUser(_0x402c50[_0x312194])));}return BPromise[_0xfc16('0x71')](_0x383738);}return[];})['then'](function(_0x443371){return{'rows':_0x443371,'count':_0x443371[_0xfc16('0x3c')]};})['then'](respondWithResult(_0xdbc166,null))[_0xfc16('0x4c')](handleError(_0xdbc166,null));};
\ No newline at end of file
+var _0x5a4d=['isEmpty','agent','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','options','rows','catch','show','params','includeAll','include','find','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource'];(function(_0xd27ded,_0x1164e2){var _0x5ef850=function(_0x582e7d){while(--_0x582e7d){_0xd27ded['push'](_0xd27ded['shift']());}};_0x5ef850(++_0x1164e2);}(_0x5a4d,0x15e));var _0xd5a4=function(_0x35b6ab,_0x3992e8){_0x35b6ab=_0x35b6ab-0x0;var _0x3a7697=_0x5a4d[_0x35b6ab];return _0x3a7697;};'use strict';var emlformat=require(_0xd5a4('0x0'));var rimraf=require(_0xd5a4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd5a4('0x2'));var rp=require('request-promise');var moment=require(_0xd5a4('0x3'));var BPromise=require(_0xd5a4('0x4'));var Mustache=require(_0xd5a4('0x5'));var util=require(_0xd5a4('0x6'));var path=require('path');var sox=require(_0xd5a4('0x7'));var csv=require('to-csv');var ejs=require(_0xd5a4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd5a4('0x9'));var squel=require(_0xd5a4('0xa'));var crypto=require(_0xd5a4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd5a4('0xc'));var toCsv=require(_0xd5a4('0xd'));var querystring=require(_0xd5a4('0xe'));var Papa=require(_0xd5a4('0xf'));var Redis=require('ioredis');var authService=require(_0xd5a4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd5a4('0x11'));var hardwareService=require(_0xd5a4('0x12'));var logger=require(_0xd5a4('0x13'))('api');var utils=require(_0xd5a4('0x14'));var config=require(_0xd5a4('0x15'));var licenseUtil=require(_0xd5a4('0x16'));var db=require(_0xd5a4('0x17'))['db'];config[_0xd5a4('0x18')]=_['defaults'](config[_0xd5a4('0x18')],{'host':_0xd5a4('0x19'),'port':0x18eb});var socket=require(_0xd5a4('0x1a'))(new Redis(config[_0xd5a4('0x18')]));require('./chatInternalMessage.socket')[_0xd5a4('0x1b')](socket);function respondWithStatusCode(_0x106304,_0x511641){_0x511641=_0x511641||0xcc;return function(_0x13ea20){if(_0x13ea20){return _0x106304[_0xd5a4('0x1c')](_0x511641);}return _0x106304[_0xd5a4('0x1d')](_0x511641)[_0xd5a4('0x1e')]();};}function respondWithResult(_0x57b254,_0xb1eafc){_0xb1eafc=_0xb1eafc||0xc8;return function(_0x500846){if(_0x500846){return _0x57b254['status'](_0xb1eafc)[_0xd5a4('0x1f')](_0x500846);}};}function respondWithFilteredResult(_0x102c59,_0x283d70){return function(_0xf188c9){if(_0xf188c9){var _0xfae717=typeof _0x283d70[_0xd5a4('0x20')]===_0xd5a4('0x21')&&typeof _0x283d70[_0xd5a4('0x22')]==='undefined';var _0x4a8395=_0xf188c9[_0xd5a4('0x23')];var _0x5f4517=_0xfae717?0x0:_0x283d70[_0xd5a4('0x20')];var _0x3e35cd=_0xfae717?_0xf188c9['count']:_0x283d70[_0xd5a4('0x20')]+_0x283d70[_0xd5a4('0x22')];var _0x3ca2fb;if(_0x3e35cd>=_0x4a8395){_0x3e35cd=_0x4a8395;_0x3ca2fb=0xc8;}else{_0x3ca2fb=0xce;}_0x102c59[_0xd5a4('0x1d')](_0x3ca2fb);return _0x102c59[_0xd5a4('0x24')](_0xd5a4('0x25'),_0x5f4517+'-'+_0x3e35cd+'/'+_0x4a8395)['json'](_0xf188c9);}return null;};}function patchUpdates(_0x15c5c2){return function(_0x287fd8){try{jsonpatch[_0xd5a4('0x26')](_0x287fd8,_0x15c5c2,!![]);}catch(_0x132893){return BPromise[_0xd5a4('0x27')](_0x132893);}return _0x287fd8[_0xd5a4('0x28')]();};}function saveUpdates(_0x3d337b,_0x5a042c){return function(_0x4fe350){if(_0x4fe350){return _0x4fe350[_0xd5a4('0x29')](_0x3d337b)[_0xd5a4('0x2a')](function(_0x3861f4){return _0x3861f4;});}return null;};}function removeEntity(_0x57bc22,_0x5ab317){return function(_0x3498ca){if(_0x3498ca){return _0x3498ca['destroy']()[_0xd5a4('0x2a')](function(){_0x57bc22[_0xd5a4('0x1d')](0xcc)[_0xd5a4('0x1e')]();});}};}function handleEntityNotFound(_0x34a756,_0x5fa1b0){return function(_0x46bcd9){if(!_0x46bcd9){_0x34a756[_0xd5a4('0x1c')](0x194);}return _0x46bcd9;};}function handleError(_0x5bee7a,_0x379086){_0x379086=_0x379086||0x1f4;return function(_0x3b4586){logger[_0xd5a4('0x2b')](_0x3b4586[_0xd5a4('0x2c')]);if(_0x3b4586[_0xd5a4('0x2d')]){delete _0x3b4586[_0xd5a4('0x2d')];}_0x5bee7a[_0xd5a4('0x1d')](_0x379086)[_0xd5a4('0x2e')](_0x3b4586);};}exports['index']=function(_0x115c46,_0x573873){var _0x3d46dc={},_0x47c75f={},_0x2a4f59={'count':0x0,'rows':[]};var _0x329bf8=_['map'](db[_0xd5a4('0x2f')][_0xd5a4('0x30')],function(_0x581df2){return{'name':_0x581df2[_0xd5a4('0x31')],'type':_0x581df2['type'][_0xd5a4('0x32')]};});_0x47c75f[_0xd5a4('0x33')]=_['map'](_0x329bf8,_0xd5a4('0x2d'));_0x47c75f[_0xd5a4('0x34')]=_[_0xd5a4('0x35')](_0x115c46[_0xd5a4('0x34')]);_0x47c75f['filters']=_[_0xd5a4('0x36')](_0x47c75f['model'],_0x47c75f[_0xd5a4('0x34')]);_0x3d46dc[_0xd5a4('0x37')]=_[_0xd5a4('0x36')](_0x47c75f[_0xd5a4('0x33')],qs['fields'](_0x115c46[_0xd5a4('0x34')][_0xd5a4('0x38')]));_0x3d46dc[_0xd5a4('0x37')]=_0x3d46dc[_0xd5a4('0x37')][_0xd5a4('0x39')]?_0x3d46dc[_0xd5a4('0x37')]:_0x47c75f['model'];if(!_0x115c46[_0xd5a4('0x34')]['hasOwnProperty'](_0xd5a4('0x3a'))){_0x3d46dc['limit']=qs[_0xd5a4('0x22')](_0x115c46[_0xd5a4('0x34')][_0xd5a4('0x22')]);_0x3d46dc[_0xd5a4('0x20')]=qs[_0xd5a4('0x20')](_0x115c46[_0xd5a4('0x34')][_0xd5a4('0x20')]);}_0x3d46dc[_0xd5a4('0x3b')]=qs[_0xd5a4('0x3c')](_0x115c46[_0xd5a4('0x34')]['sort']);_0x3d46dc[_0xd5a4('0x3d')]=qs[_0xd5a4('0x3e')](_[_0xd5a4('0x3f')](_0x115c46[_0xd5a4('0x34')],_0x47c75f['filters']),_0x329bf8);if(_0x115c46[_0xd5a4('0x34')][_0xd5a4('0x40')]){_0x3d46dc[_0xd5a4('0x3d')]=_[_0xd5a4('0x41')](_0x3d46dc['where'],{'$or':_[_0xd5a4('0x42')](_0x329bf8,function(_0x23000d){if(_0x23000d['type']!=='VIRTUAL'){var _0x23a7b8={};_0x23a7b8[_0x23000d['name']]={'$like':'%'+_0x115c46[_0xd5a4('0x34')]['filter']+'%'};return _0x23a7b8;}})});}_0x3d46dc=_['merge']({},_0x3d46dc,_0x115c46[_0xd5a4('0x43')]);var _0xa435ef={'where':_0x3d46dc[_0xd5a4('0x3d')]};return db[_0xd5a4('0x2f')][_0xd5a4('0x23')](_0xa435ef)['then'](function(_0x1a8333){_0x2a4f59[_0xd5a4('0x23')]=_0x1a8333;if(_0x115c46[_0xd5a4('0x34')]['includeAll']){_0x3d46dc['include']=[{'all':!![]}];}return db[_0xd5a4('0x2f')]['findAll'](_0x3d46dc);})['then'](function(_0x5e24d7){_0x2a4f59[_0xd5a4('0x44')]=_0x5e24d7;return _0x2a4f59;})[_0xd5a4('0x2a')](respondWithFilteredResult(_0x573873,_0x3d46dc))[_0xd5a4('0x45')](handleError(_0x573873,null));};exports[_0xd5a4('0x46')]=function(_0x4b61c0,_0x318777){var _0x55075b={'raw':!![],'where':{'id':_0x4b61c0[_0xd5a4('0x47')]['id']}},_0x3ff601={};_0x3ff601[_0xd5a4('0x33')]=_[_0xd5a4('0x35')](db[_0xd5a4('0x2f')][_0xd5a4('0x30')]);_0x3ff601['query']=_[_0xd5a4('0x35')](_0x4b61c0['query']);_0x3ff601[_0xd5a4('0x3e')]=_[_0xd5a4('0x36')](_0x3ff601['model'],_0x3ff601[_0xd5a4('0x34')]);_0x55075b[_0xd5a4('0x37')]=_['intersection'](_0x3ff601[_0xd5a4('0x33')],qs[_0xd5a4('0x38')](_0x4b61c0['query']['fields']));_0x55075b[_0xd5a4('0x37')]=_0x55075b[_0xd5a4('0x37')][_0xd5a4('0x39')]?_0x55075b[_0xd5a4('0x37')]:_0x3ff601['model'];if(_0x4b61c0[_0xd5a4('0x34')][_0xd5a4('0x48')]){_0x55075b[_0xd5a4('0x49')]=[{'all':!![]}];}_0x55075b=_['merge']({},_0x55075b,_0x4b61c0[_0xd5a4('0x43')]);return db[_0xd5a4('0x2f')][_0xd5a4('0x4a')](_0x55075b)['then'](handleEntityNotFound(_0x318777,null))['then'](respondWithResult(_0x318777,null))['catch'](handleError(_0x318777,null));};exports[_0xd5a4('0x4b')]=function(_0x1c6832,_0x2c2a2f){return db[_0xd5a4('0x2f')][_0xd5a4('0x4b')](_0x1c6832[_0xd5a4('0x4c')],{})[_0xd5a4('0x2a')](respondWithResult(_0x2c2a2f,0xc9))['catch'](handleError(_0x2c2a2f,null));};exports[_0xd5a4('0x29')]=function(_0x1bdc02,_0x282b61){if(_0x1bdc02[_0xd5a4('0x4c')]['id']){delete _0x1bdc02[_0xd5a4('0x4c')]['id'];}return db[_0xd5a4('0x2f')]['find']({'where':{'id':_0x1bdc02['params']['id']}})[_0xd5a4('0x2a')](handleEntityNotFound(_0x282b61,null))['then'](saveUpdates(_0x1bdc02[_0xd5a4('0x4c')],null))[_0xd5a4('0x2a')](respondWithResult(_0x282b61,null))[_0xd5a4('0x45')](handleError(_0x282b61,null));};exports[_0xd5a4('0x4d')]=function(_0x1f762e,_0x2e0b1f){return db['ChatInternalMessage'][_0xd5a4('0x4a')]({'where':{'id':_0x1f762e['params']['id']}})[_0xd5a4('0x2a')](handleEntityNotFound(_0x2e0b1f,null))[_0xd5a4('0x2a')](removeEntity(_0x2e0b1f,null))[_0xd5a4('0x45')](handleError(_0x2e0b1f,null));};exports[_0xd5a4('0x4e')]=function(_0x30bd63,_0x339fe6){return db['ChatInternalMessage'][_0xd5a4('0x4e')]()[_0xd5a4('0x2a')](respondWithResult(_0x339fe6,null))[_0xd5a4('0x45')](handleError(_0x339fe6,null));};function wrapUser(_0x1adf89){return function(_0x418060){var _0x408099=_0x1adf89[_0xd5a4('0x4f')]({'plain':!![]});_0x408099[_0xd5a4('0x50')]=[];if(_0x418060){_0x408099[_0xd5a4('0x51')]=_0x418060[_0xd5a4('0x52')];_0x408099[_0xd5a4('0x53')]=_0x418060;}else{_0x408099['lastMessageAt']=moment(0x0)[_0xd5a4('0x54')](_0xd5a4('0x55'));_0x408099[_0xd5a4('0x53')]={};}return _0x408099;};}exports[_0xd5a4('0x56')]=function(_0x25c931,_0x433a18,_0x53edf2){var _0x14b1fc=[];return db[_0xd5a4('0x57')][_0xd5a4('0x58')]({'where':{'role':['agent',_0xd5a4('0x59'),_0xd5a4('0x5a')]},'attributes':['id',_0xd5a4('0x5b'),'name',_0xd5a4('0x5c'),_0xd5a4('0x5d'),_0xd5a4('0x5e'),'online',_0xd5a4('0x5f'),_0xd5a4('0x60'),_0xd5a4('0x61')],'order':qs[_0xd5a4('0x3c')]('-online'),'include':[{'model':db[_0xd5a4('0x62')],'as':_0xd5a4('0x63'),'attributes':['id',_0xd5a4('0x2d'),_0xd5a4('0x64')],'through':{'attributes':[]}}]})[_0xd5a4('0x2a')](function(_0x40a2b5){if(_0x40a2b5){var _0x15e3a9=_0x25c931['user'][_0xd5a4('0x4f')]({'plain':!![]});if(!_0x15e3a9)throw new Error(_0xd5a4('0x65'));if(_0x15e3a9[_0xd5a4('0x5c')]===_0xd5a4('0x5a')){return db[_0xd5a4('0x66')][_0xd5a4('0x4a')]({'where':{'name':_0xd5a4('0x67'),'userProfileId':_0x15e3a9[_0xd5a4('0x68')]},'raw':!![]})[_0xd5a4('0x2a')](function(_0x4ec04e){if(_0x4ec04e){if(_0x4ec04e['autoAssociation']===0x0){return db[_0xd5a4('0x69')]['findAll']({'where':{'sectionId':_0x4ec04e['id']},'raw':!![]})[_0xd5a4('0x2a')](function(_0xae3ca7){var _0x2e2bbd=[];if(_[_0xd5a4('0x6a')](_0xae3ca7)){_0x2e2bbd=_['filter'](_0x40a2b5,function(_0x2d09b1){if(_0x2d09b1[_0xd5a4('0x5c')]!==_0xd5a4('0x6b')){return _0x2d09b1;}});return _0x2e2bbd;}else{for(var _0x59ae7e=0x0;_0x59ae7e<_0x40a2b5[_0xd5a4('0x39')];_0x59ae7e++){var _0x37f566=_0x40a2b5[_0x59ae7e];if(_0x37f566[_0xd5a4('0x5c')]===_0xd5a4('0x6b')){var _0x30c563=_[_0xd5a4('0x4a')](_0xae3ca7,function(_0x474efa){return _0x474efa[_0xd5a4('0x6c')]===_0x37f566['id'];});if(_0x30c563)_0x2e2bbd[_0xd5a4('0x6d')](_0x37f566);}else{_0x2e2bbd[_0xd5a4('0x6d')](_0x37f566);}}return _0x2e2bbd;}});}else{return _0x40a2b5;}}else{var _0x159439=_['filter'](_0x40a2b5,function(_0x4a7046){if(_0x4a7046[_0xd5a4('0x5c')]!=='agent'){return _0x4a7046;}});return _0x159439;}});}else{return _0x40a2b5;}}})[_0xd5a4('0x2a')](function(_0x58c15a){var _0x2d83df=[];if(_0x58c15a){_0x14b1fc=_0x58c15a;for(var _0x359f17=0x0;_0x359f17<_0x58c15a[_0xd5a4('0x39')];_0x359f17+=0x1){_0x14b1fc[_0x359f17][_0xd5a4('0x50')]=[];_0x2d83df['push'](db[_0xd5a4('0x2f')][_0xd5a4('0x4a')]({'where':{'FromId':[_0x25c931['user']['id'],_0x58c15a[_0x359f17]['id']],'ToId':[_0x25c931['user']['id'],_0x58c15a[_0x359f17]['id']],'ChatGroupId':null},'attributes':['id',_0xd5a4('0x52'),_0xd5a4('0x6e'),'ToId',_0xd5a4('0x6f'),_0xd5a4('0x4c')],'order':qs[_0xd5a4('0x3c')](_0xd5a4('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd5a4('0x2a')](wrapUser(_0x58c15a[_0x359f17])));}return BPromise[_0xd5a4('0x71')](_0x2d83df);}return[];})['then'](function(_0x59f44b){return{'rows':_0x59f44b,'count':_0x59f44b[_0xd5a4('0x39')]};})[_0xd5a4('0x2a')](respondWithResult(_0x433a18,null))[_0xd5a4('0x45')](handleError(_0x433a18,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 2c2766b..051cf94 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 _0x3804=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x7bd370,_0x4bb7fa){var _0xdfa30b=function(_0x17d6b4){while(--_0x17d6b4){_0x7bd370['push'](_0x7bd370['shift']());}};_0xdfa30b(++_0x4bb7fa);}(_0x3804,0xe0));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4380('0x0'));var ChatInternalMessage=require(_0x4380('0x1'))['db'][_0x4380('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4380('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4380('0x4'),'afterDestroy':_0x4380('0x5')};function emitEvent(_0x9e8495){return function(_0x321ec5,_0x137af3,_0x160b47){ChatInternalMessageEvents['emit'](_0x9e8495+':'+_0x321ec5['id'],_0x321ec5);ChatInternalMessageEvents[_0x4380('0x6')](_0x9e8495,_0x321ec5);_0x160b47(null);};}for(var e in events){if(events[_0x4380('0x7')](e)){var event=events[e];ChatInternalMessage[_0x4380('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x56cc=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x56cc,0x161));var _0xc56c=function(_0x309d87,_0x5730d9){_0x309d87=_0x309d87-0x0;var _0x7729ab=_0x56cc[_0x309d87];return _0x7729ab;};'use strict';var EventEmitter=require(_0xc56c('0x0'));var ChatInternalMessage=require(_0xc56c('0x1'))['db'][_0xc56c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xc56c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc56c('0x4'),'afterDestroy':_0xc56c('0x5')};function emitEvent(_0x193b22){return function(_0x1f2f75,_0x117034,_0x5d8188){ChatInternalMessageEvents['emit'](_0x193b22+':'+_0x1f2f75['id'],_0x1f2f75);ChatInternalMessageEvents[_0xc56c('0x6')](_0x193b22,_0x1f2f75);_0x5d8188(null);};}for(var e in events){if(events[_0xc56c('0x7')](e)){var event=events[e];ChatInternalMessage[_0xc56c('0x8')](e,emitEvent(event));}}module[_0xc56c('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 15d4e45..df763a3 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 _0x5752=['exports','chat_internal_messages','utf8mb4','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./chatInternalMessage.attributes'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5752,0x1cf));var _0x2575=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x5752[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x2575('0x0'));var util=require('util');var logger=require(_0x2575('0x1'))('api');var moment=require(_0x2575('0x2'));var BPromise=require(_0x2575('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2575('0x4'));var rimraf=require('rimraf');var config=require(_0x2575('0x5'));var attributes=require(_0x2575('0x6'));module[_0x2575('0x7')]=function(_0x4d5738,_0x5b1f39){return _0x4d5738['define']('ChatInternalMessage',attributes,{'tableName':_0x2575('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2575('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2600=['ChatInternalMessage','chat_internal_messages','utf8mb4','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0x2600,0x92));var _0x0260=function(_0x30be95,_0x4dcfad){_0x30be95=_0x30be95-0x0;var _0x354116=_0x2600[_0x30be95];return _0x354116;};'use strict';var _=require('lodash');var util=require(_0x0260('0x0'));var logger=require(_0x0260('0x1'))('api');var moment=require(_0x0260('0x2'));var BPromise=require(_0x0260('0x3'));var rp=require(_0x0260('0x4'));var fs=require('fs');var path=require(_0x0260('0x5'));var rimraf=require(_0x0260('0x6'));var config=require(_0x0260('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x0260('0x8')]=function(_0x3eaaf8,_0x36c654){return _0x3eaaf8[_0x0260('0x9')](_0x0260('0xa'),attributes,{'tableName':_0x0260('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0260('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index e8a5248..96fe4fd 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 _0xc61e=['ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info'];(function(_0x3584a6,_0x1ee812){var _0x2b6c76=function(_0x4c2c64){while(--_0x4c2c64){_0x3584a6['push'](_0x3584a6['shift']());}};_0x2b6c76(++_0x1ee812);}(_0xc61e,0x152));var _0xec61=function(_0x23ec60,_0x10b243){_0x23ec60=_0x23ec60-0x0;var _0x1ffa00=_0xc61e[_0x23ec60];return _0x1ffa00;};'use strict';var _=require(_0xec61('0x0'));var util=require(_0xec61('0x1'));var moment=require(_0xec61('0x2'));var BPromise=require(_0xec61('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec61('0x4'));var db=require(_0xec61('0x5'))['db'];var utils=require(_0xec61('0x6'));var logger=require(_0xec61('0x7'))(_0xec61('0x8'));var config=require(_0xec61('0x9'));var jayson=require(_0xec61('0xa'));var client=jayson[_0xec61('0xb')][_0xec61('0xc')]({'port':0x232a});config[_0xec61('0xd')]=_[_0xec61('0xe')](config[_0xec61('0xd')],{'host':_0xec61('0xf'),'port':0x18eb});var socket=require(_0xec61('0x10'))(new Redis(config[_0xec61('0xd')]));require(_0xec61('0x11'))[_0xec61('0x12')](socket);function respondWithRpcPromise(_0x14ad4f,_0x1b0bd9,_0x4d60a9){return new BPromise(function(_0x3926fb,_0x40013f){return client[_0xec61('0x13')](_0x14ad4f,_0x4d60a9)[_0xec61('0x14')](function(_0x54ac6b){logger[_0xec61('0x15')](_0xec61('0x16'),_0x1b0bd9,_0xec61('0x17'));logger[_0xec61('0x18')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1b0bd9,_0xec61('0x17'),JSON[_0xec61('0x19')](_0x54ac6b));if(_0x54ac6b[_0xec61('0x1a')]){if(_0x54ac6b['error'][_0xec61('0x1b')]===0x1f4){logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x54ac6b['error'][_0xec61('0x1c')]);return _0x40013f(_0x54ac6b['error']['message']);}logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x54ac6b['error'][_0xec61('0x1c')]);return _0x3926fb(_0x54ac6b[_0xec61('0x1a')][_0xec61('0x1c')]);}else{logger[_0xec61('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1b0bd9,_0xec61('0x17'));_0x3926fb(_0x54ac6b[_0xec61('0x1d')][_0xec61('0x1c')]);}})['catch'](function(_0x56ab00){logger[_0xec61('0x1a')](_0xec61('0x16'),_0x1b0bd9,_0x56ab00);_0x40013f(_0x56ab00);});});}
\ No newline at end of file
+var _0xebef=['ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x20afc3,_0x2f189a){var _0x4cbb43=function(_0x647042){while(--_0x647042){_0x20afc3['push'](_0x20afc3['shift']());}};_0x4cbb43(++_0x2f189a);}(_0xebef,0xb2));var _0xfebe=function(_0x1115fc,_0x47b2ca){_0x1115fc=_0x1115fc-0x0;var _0x4d7b9f=_0xebef[_0x1115fc];return _0x4d7b9f;};'use strict';var _=require(_0xfebe('0x0'));var util=require(_0xfebe('0x1'));var moment=require(_0xfebe('0x2'));var BPromise=require(_0xfebe('0x3'));var rs=require(_0xfebe('0x4'));var fs=require('fs');var Redis=require(_0xfebe('0x5'));var db=require(_0xfebe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfebe('0x7'))(_0xfebe('0x8'));var config=require(_0xfebe('0x9'));var jayson=require(_0xfebe('0xa'));var client=jayson[_0xfebe('0xb')][_0xfebe('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfebe('0xd')],{'host':_0xfebe('0xe'),'port':0x18eb});var socket=require(_0xfebe('0xf'))(new Redis(config[_0xfebe('0xd')]));require(_0xfebe('0x10'))['register'](socket);function respondWithRpcPromise(_0x160c6a,_0x40e3bc,_0x19c1f8){return new BPromise(function(_0x5a69fb,_0x596c39){return client[_0xfebe('0x11')](_0x160c6a,_0x19c1f8)[_0xfebe('0x12')](function(_0x4773f0){logger[_0xfebe('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x40e3bc,'request\x20sent');logger[_0xfebe('0x14')](_0xfebe('0x15'),_0x40e3bc,_0xfebe('0x16'),JSON['stringify'](_0x4773f0));if(_0x4773f0['error']){if(_0x4773f0[_0xfebe('0x17')][_0xfebe('0x18')]===0x1f4){logger[_0xfebe('0x17')](_0xfebe('0x19'),_0x40e3bc,_0x4773f0['error'][_0xfebe('0x1a')]);return _0x596c39(_0x4773f0[_0xfebe('0x17')][_0xfebe('0x1a')]);}logger['error'](_0xfebe('0x19'),_0x40e3bc,_0x4773f0[_0xfebe('0x17')][_0xfebe('0x1a')]);return _0x5a69fb(_0x4773f0['error'][_0xfebe('0x1a')]);}else{logger[_0xfebe('0x13')](_0xfebe('0x19'),_0x40e3bc,_0xfebe('0x16'));_0x5a69fb(_0x4773f0[_0xfebe('0x1b')][_0xfebe('0x1a')]);}})[_0xfebe('0x1c')](function(_0x5ea3a1){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x40e3bc,_0x5ea3a1);_0x596c39(_0x5ea3a1);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index ef5fe0a..04592e9 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 _0x1607=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0x28eb88,_0x659a98){var _0x5e00bd=function(_0x2a0b9f){while(--_0x2a0b9f){_0x28eb88['push'](_0x28eb88['shift']());}};_0x5e00bd(++_0x659a98);}(_0x1607,0x1d5));var _0x7160=function(_0x4d8a45,_0xf33997){_0x4d8a45=_0x4d8a45-0x0;var _0x9e1583=_0x1607[_0x4d8a45];return _0x9e1583;};'use strict';var ChatInternalMessageEvents=require(_0x7160('0x0'));var events=['save',_0x7160('0x1'),_0x7160('0x2')];function createListener(_0x4fbee3,_0xd33417){return function(_0x462417){_0xd33417[_0x7160('0x3')](_0x4fbee3,_0x462417);};}function removeListener(_0x33ef50,_0x566408){return function(){ChatInternalMessageEvents[_0x7160('0x4')](_0x33ef50,_0x566408);};}exports[_0x7160('0x5')]=function(_0x42ee4f){for(var _0x760fe4=0x0,_0x568726=events[_0x7160('0x6')];_0x760fe4<_0x568726;_0x760fe4++){var _0x4dfdfd=events[_0x760fe4];var _0xb57ef8=createListener(_0x7160('0x7')+_0x4dfdfd,_0x42ee4f);ChatInternalMessageEvents['on'](_0x4dfdfd,_0xb57ef8);}};
\ No newline at end of file
+var _0x5ff2=['chatInternalMessage:','./chatInternalMessage.events','remove','emit','removeListener','register','length'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0x5ff2,0x189));var _0x25ff=function(_0x3a2bc6,_0xb3d543){_0x3a2bc6=_0x3a2bc6-0x0;var _0x2781d8=_0x5ff2[_0x3a2bc6];return _0x2781d8;};'use strict';var ChatInternalMessageEvents=require(_0x25ff('0x0'));var events=['save',_0x25ff('0x1'),'update'];function createListener(_0x238f91,_0x427bcf){return function(_0x3c0055){_0x427bcf[_0x25ff('0x2')](_0x238f91,_0x3c0055);};}function removeListener(_0x3fb5be,_0x282435){return function(){ChatInternalMessageEvents[_0x25ff('0x3')](_0x3fb5be,_0x282435);};}exports[_0x25ff('0x4')]=function(_0x29ec4f){for(var _0x37b20b=0x0,_0x20318d=events[_0x25ff('0x5')];_0x37b20b<_0x20318d;_0x37b20b++){var _0x102ed2=events[_0x37b20b];var _0x1b6c7e=createListener(_0x25ff('0x6')+_0x102ed2,_0x29ec4f);ChatInternalMessageEvents['on'](_0x102ed2,_0x1b6c7e);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 370fc7c..d3887a1 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 _0x4d85=['/describe','describe','/users','getUsers','/:id','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x534c0f,_0x60b439){var _0x159559=function(_0x19ee5b){while(--_0x19ee5b){_0x534c0f['push'](_0x534c0f['shift']());}};_0x159559(++_0x60b439);}(_0x4d85,0xb2));var _0x54d8=function(_0x2a5476,_0xd8ec70){_0x2a5476=_0x2a5476-0x0;var _0x279820=_0x4d85[_0x2a5476];return _0x279820;};'use strict';var multer=require(_0x54d8('0x0'));var util=require(_0x54d8('0x1'));var path=require(_0x54d8('0x2'));var timeout=require('connect-timeout');var express=require(_0x54d8('0x3'));var router=express['Router']();var fs_extra=require(_0x54d8('0x4'));var auth=require(_0x54d8('0x5'));var interaction=require(_0x54d8('0x6'));var config=require('../../config/environment');var controller=require(_0x54d8('0x7'));router[_0x54d8('0x8')]('/',auth[_0x54d8('0x9')](),controller[_0x54d8('0xa')]);router[_0x54d8('0x8')](_0x54d8('0xb'),auth[_0x54d8('0x9')](),controller[_0x54d8('0xc')]);router['get'](_0x54d8('0xd'),auth['isAuthenticated'](),controller[_0x54d8('0xe')]);router[_0x54d8('0x8')](_0x54d8('0xf'),auth[_0x54d8('0x9')](),controller['show']);router['post']('/',auth[_0x54d8('0x9')](),controller[_0x54d8('0x10')]);router[_0x54d8('0x11')](_0x54d8('0xf'),controller['update']);router[_0x54d8('0x12')]('/:id',auth[_0x54d8('0x9')](),controller[_0x54d8('0x13')]);module[_0x54d8('0x14')]=router;
\ No newline at end of file
+var _0x491a=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','create','put','update'];(function(_0xed715a,_0x2eb934){var _0x55ce9b=function(_0x4d3d7a){while(--_0x4d3d7a){_0xed715a['push'](_0xed715a['shift']());}};_0x55ce9b(++_0x2eb934);}(_0x491a,0xdd));var _0xa491=function(_0x4da382,_0x4cfc5d){_0x4da382=_0x4da382-0x0;var _0x10073f=_0x491a[_0x4da382];return _0x10073f;};'use strict';var multer=require(_0xa491('0x0'));var util=require(_0xa491('0x1'));var path=require(_0xa491('0x2'));var timeout=require(_0xa491('0x3'));var express=require(_0xa491('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa491('0x5'));var interaction=require(_0xa491('0x6'));var config=require(_0xa491('0x7'));var controller=require(_0xa491('0x8'));router[_0xa491('0x9')]('/',auth[_0xa491('0xa')](),controller['index']);router[_0xa491('0x9')](_0xa491('0xb'),auth[_0xa491('0xa')](),controller['describe']);router['get'](_0xa491('0xc'),auth[_0xa491('0xa')](),controller['getUsers']);router[_0xa491('0x9')](_0xa491('0xd'),auth[_0xa491('0xa')](),controller['show']);router['post']('/',auth[_0xa491('0xa')](),controller[_0xa491('0xe')]);router[_0xa491('0xf')](_0xa491('0xd'),controller[_0xa491('0x10')]);router['delete'](_0xa491('0xd'),auth[_0xa491('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 1108b5c..ab57ed3 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 _0x97e6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x1c2386,_0x22eb79){var _0x322990=function(_0x27eed4){while(--_0x27eed4){_0x1c2386['push'](_0x1c2386['shift']());}};_0x322990(++_0x22eb79);}(_0x97e6,0x159));var _0x697e=function(_0x196e16,_0x168729){_0x196e16=_0x196e16-0x0;var _0x37531f=_0x97e6[_0x196e16];return _0x37531f;};'use strict';var Sequelize=require(_0x697e('0x0'));module['exports']={'body':{'type':Sequelize[_0x697e('0x1')](_0x697e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x697e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x697e('0x4')]('in',_0x697e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x697e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x697e('0x1')]}};
\ No newline at end of file
+var _0x0102=['exports','TEXT','medium','BOOLEAN','STRING'];(function(_0x4b8dec,_0x1744f2){var _0x1b11b6=function(_0x4dca89){while(--_0x4dca89){_0x4b8dec['push'](_0x4b8dec['shift']());}};_0x1b11b6(++_0x1744f2);}(_0x0102,0x186));var _0x2010=function(_0x144297,_0x29ca79){_0x144297=_0x144297-0x0;var _0x1e22bf=_0x0102[_0x144297];return _0x1e22bf;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'body':{'type':Sequelize[_0x2010('0x1')](_0x2010('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2010('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2010('0x4')]},'providerResponse':{'type':Sequelize[_0x2010('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 732a4d9..8aa2500 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 _0xf77e=['mustache','util','path','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/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','debug','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','end','undefined','limit','count','offset','status','set','Content-Range','json','apply','save','update','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','ChatMessage','include','params','fields','length','includeAll','merge','find','create','body','describe','chat-interactions','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','parse','formData','../../config/logger','ChatInteraction','RejectMessage','rejectMessage','QueryTypes','contact','rejectmessage','eml-format','fast-json-patch','moment','bluebird'];(function(_0x2cc57f,_0x31ded7){var _0x3cfb7a=function(_0x11b6f3){while(--_0x11b6f3){_0x2cc57f['push'](_0x2cc57f['shift']());}};_0x3cfb7a(++_0x31ded7);}(_0xf77e,0x7e));var _0xef77=function(_0x1b67c3,_0x58acbc){_0x1b67c3=_0x1b67c3-0x0;var _0x23e14e=_0xf77e[_0x1b67c3];return _0x23e14e;};'use strict';var emlformat=require(_0xef77('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xef77('0x1'));var rp=require('request-promise');var moment=require(_0xef77('0x2'));var BPromise=require(_0xef77('0x3'));var Mustache=require(_0xef77('0x4'));var util=require(_0xef77('0x5'));var path=require(_0xef77('0x6'));var sox=require(_0xef77('0x7'));var csv=require(_0xef77('0x8'));var ejs=require(_0xef77('0x9'));var fs=require('fs');var fs_extra=require(_0xef77('0xa'));var _=require(_0xef77('0xb'));var squel=require(_0xef77('0xc'));var crypto=require('crypto');var jsforce=require(_0xef77('0xd'));var deskjs=require(_0xef77('0xe'));var toCsv=require('to-csv');var querystring=require(_0xef77('0xf'));var Papa=require(_0xef77('0x10'));var Redis=require(_0xef77('0x11'));var authService=require(_0xef77('0x12'));var qs=require(_0xef77('0x13'));var as=require(_0xef77('0x14'));var hardwareService=require(_0xef77('0x15'));var logger=require('../../config/logger')(_0xef77('0x16'));var utils=require(_0xef77('0x17'));var config=require(_0xef77('0x18'));var licenseUtil=require(_0xef77('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xef77('0x1a')](config['redis'],{'host':_0xef77('0x1b'),'port':0x18eb});var socket=require(_0xef77('0x1c'))(new Redis(config[_0xef77('0x1d')]));require(_0xef77('0x1e'))[_0xef77('0x1f')](socket);var jayson=require(_0xef77('0x20'));var client=jayson['client'][_0xef77('0x21')]({'port':0x232c});var client9002=jayson[_0xef77('0x22')][_0xef77('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x20cb49,_0x51a55c,_0x2e2f8e,_0x43499f){return new BPromise(function(_0x5d9f20,_0x29653d){var _0xb9ae25=_0x43499f||client;return _0xb9ae25[_0xef77('0x23')](_0x20cb49,_0x2e2f8e)[_0xef77('0x24')](function(_0x3b1469){logger[_0xef77('0x25')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,'request\x20sent');logger[_0xef77('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x51a55c,'request\x20sent',JSON[_0xef77('0x27')](_0x3b1469));if(_0x3b1469[_0xef77('0x28')]){if(_0x3b1469[_0xef77('0x28')][_0xef77('0x29')]===0x1f4){logger[_0xef77('0x28')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,_0x3b1469['error'][_0xef77('0x2a')]);return _0x29653d(_0x3b1469[_0xef77('0x28')][_0xef77('0x2a')]);}logger[_0xef77('0x28')]('ChatMessage,\x20%s,\x20%s',_0x51a55c,_0x3b1469['error'][_0xef77('0x2a')]);return _0x5d9f20(_0x3b1469[_0xef77('0x28')]['message']);}else{logger[_0xef77('0x25')](_0xef77('0x2b'),_0x51a55c,'request\x20sent');_0x5d9f20(_0x3b1469['result'][_0xef77('0x2a')]);}})[_0xef77('0x2c')](function(_0x3da969){logger[_0xef77('0x28')](_0xef77('0x2b'),_0x51a55c,_0x3da969);_0x29653d(_0x3da969);});});}function respondWithStatusCode(_0x180491,_0x363b68){_0x363b68=_0x363b68||0xcc;return function(_0x95ef79){if(_0x95ef79){return _0x180491['sendStatus'](_0x363b68);}return _0x180491['status'](_0x363b68)[_0xef77('0x2d')]();};}function respondWithResult(_0x2cf87a,_0x3737ca){_0x3737ca=_0x3737ca||0xc8;return function(_0x2bd6c6){if(_0x2bd6c6){return _0x2cf87a['status'](_0x3737ca)['json'](_0x2bd6c6);}};}function respondWithFilteredResult(_0x30f8bb,_0x103de8){return function(_0x2120a6){if(_0x2120a6){var _0x5de358=typeof _0x103de8['offset']===_0xef77('0x2e')&&typeof _0x103de8[_0xef77('0x2f')]==='undefined';var _0x1bc8d1=_0x2120a6[_0xef77('0x30')];var _0x50daca=_0x5de358?0x0:_0x103de8[_0xef77('0x31')];var _0x5dceed=_0x5de358?_0x2120a6[_0xef77('0x30')]:_0x103de8[_0xef77('0x31')]+_0x103de8[_0xef77('0x2f')];var _0x2cd1ed;if(_0x5dceed>=_0x1bc8d1){_0x5dceed=_0x1bc8d1;_0x2cd1ed=0xc8;}else{_0x2cd1ed=0xce;}_0x30f8bb[_0xef77('0x32')](_0x2cd1ed);return _0x30f8bb[_0xef77('0x33')](_0xef77('0x34'),_0x50daca+'-'+_0x5dceed+'/'+_0x1bc8d1)[_0xef77('0x35')](_0x2120a6);}return null;};}function patchUpdates(_0x4cb289){return function(_0x7b7efe){try{jsonpatch[_0xef77('0x36')](_0x7b7efe,_0x4cb289,!![]);}catch(_0x3030eb){return BPromise['reject'](_0x3030eb);}return _0x7b7efe[_0xef77('0x37')]();};}function saveUpdates(_0x5da4ea,_0x4300ba){return function(_0x429ebf){if(_0x429ebf){return _0x429ebf[_0xef77('0x38')](_0x5da4ea)[_0xef77('0x24')](function(_0x3ed317){return _0x3ed317;});}return null;};}function removeEntity(_0x5a1bc1,_0x5e6346){return function(_0x433da9){if(_0x433da9){return _0x433da9[_0xef77('0x39')]()[_0xef77('0x24')](function(){_0x5a1bc1[_0xef77('0x32')](0xcc)[_0xef77('0x2d')]();});}};}function handleEntityNotFound(_0xde970d,_0x2a43a6){return function(_0x47ecfa){if(!_0x47ecfa){_0xde970d[_0xef77('0x3a')](0x194);}return _0x47ecfa;};}function handleError(_0x46ae5e,_0x330bbd){_0x330bbd=_0x330bbd||0x1f4;return function(_0x24551e){logger['error'](_0x24551e[_0xef77('0x3b')]);if(_0x24551e[_0xef77('0x3c')]){delete _0x24551e[_0xef77('0x3c')];}_0x46ae5e['status'](_0x330bbd)[_0xef77('0x3d')](_0x24551e);};}exports['index']=function(_0x561def,_0x35c4ef){var _0x442963={},_0x3b729c={},_0x3590d2={'count':0x0,'rows':[]};var _0x17fc45=_[_0xef77('0x3e')](db['ChatMessage'][_0xef77('0x3f')],function(_0x41491c){return{'name':_0x41491c[_0xef77('0x40')],'type':_0x41491c[_0xef77('0x41')][_0xef77('0x42')]};});_0x3b729c[_0xef77('0x43')]=_[_0xef77('0x3e')](_0x17fc45,_0xef77('0x3c'));_0x3b729c[_0xef77('0x44')]=_[_0xef77('0x45')](_0x561def[_0xef77('0x44')]);_0x3b729c[_0xef77('0x46')]=_[_0xef77('0x47')](_0x3b729c[_0xef77('0x43')],_0x3b729c[_0xef77('0x44')]);_0x442963[_0xef77('0x48')]=_[_0xef77('0x47')](_0x3b729c['model'],qs['fields'](_0x561def['query']['fields']));_0x442963[_0xef77('0x48')]=_0x442963[_0xef77('0x48')]['length']?_0x442963[_0xef77('0x48')]:_0x3b729c[_0xef77('0x43')];if(!_0x561def[_0xef77('0x44')][_0xef77('0x49')]('nolimit')){_0x442963[_0xef77('0x2f')]=qs['limit'](_0x561def[_0xef77('0x44')][_0xef77('0x2f')]);_0x442963[_0xef77('0x31')]=qs[_0xef77('0x31')](_0x561def['query'][_0xef77('0x31')]);}_0x442963[_0xef77('0x4a')]=qs[_0xef77('0x4b')](_0x561def['query'][_0xef77('0x4b')]);_0x442963['where']=qs[_0xef77('0x46')](_['pick'](_0x561def[_0xef77('0x44')],_0x3b729c[_0xef77('0x46')]),_0x17fc45);if(_0x561def[_0xef77('0x44')][_0xef77('0x4c')]){_0x442963['where']=_['merge'](_0x442963[_0xef77('0x4d')],{'$or':_['map'](_0x17fc45,function(_0x57c80e){if(_0x57c80e[_0xef77('0x41')]!==_0xef77('0x4e')){var _0x46e303={};_0x46e303[_0x57c80e[_0xef77('0x3c')]]={'$like':'%'+_0x561def[_0xef77('0x44')][_0xef77('0x4c')]+'%'};return _0x46e303;}})});}_0x442963=_['merge']({},_0x442963,_0x561def[_0xef77('0x4f')]);var _0x58f750={'where':_0x442963['where']};return db[_0xef77('0x50')][_0xef77('0x30')](_0x58f750)[_0xef77('0x24')](function(_0x56946e){_0x3590d2[_0xef77('0x30')]=_0x56946e;if(_0x561def[_0xef77('0x44')]['includeAll']){_0x442963[_0xef77('0x51')]=[{'all':!![]}];}return db[_0xef77('0x50')]['findAll'](_0x442963);})[_0xef77('0x24')](function(_0x5efdce){_0x3590d2['rows']=_0x5efdce;return _0x3590d2;})[_0xef77('0x24')](respondWithFilteredResult(_0x35c4ef,_0x442963))[_0xef77('0x2c')](handleError(_0x35c4ef,null));};exports['show']=function(_0x27ded0,_0x4d7d7b){var _0x21970c={'raw':!![],'where':{'id':_0x27ded0[_0xef77('0x52')]['id']}},_0x36ddf5={};_0x36ddf5[_0xef77('0x43')]=_['keys'](db['ChatMessage'][_0xef77('0x3f')]);_0x36ddf5[_0xef77('0x44')]=_['keys'](_0x27ded0['query']);_0x36ddf5[_0xef77('0x46')]=_[_0xef77('0x47')](_0x36ddf5['model'],_0x36ddf5[_0xef77('0x44')]);_0x21970c[_0xef77('0x48')]=_['intersection'](_0x36ddf5[_0xef77('0x43')],qs['fields'](_0x27ded0['query'][_0xef77('0x53')]));_0x21970c[_0xef77('0x48')]=_0x21970c[_0xef77('0x48')][_0xef77('0x54')]?_0x21970c[_0xef77('0x48')]:_0x36ddf5[_0xef77('0x43')];if(_0x27ded0[_0xef77('0x44')][_0xef77('0x55')]){_0x21970c[_0xef77('0x51')]=[{'all':!![]}];}_0x21970c=_[_0xef77('0x56')]({},_0x21970c,_0x27ded0[_0xef77('0x4f')]);return db['ChatMessage'][_0xef77('0x57')](_0x21970c)[_0xef77('0x24')](handleEntityNotFound(_0x4d7d7b,null))['then'](respondWithResult(_0x4d7d7b,null))[_0xef77('0x2c')](handleError(_0x4d7d7b,null));};exports[_0xef77('0x58')]=function(_0x1315a0,_0x36f21b){return db['ChatMessage'][_0xef77('0x58')](_0x1315a0[_0xef77('0x59')],{})['then'](respondWithResult(_0x36f21b,0xc9))[_0xef77('0x2c')](handleError(_0x36f21b,null));};exports[_0xef77('0x38')]=function(_0x3d125f,_0xc7ebff){if(_0x3d125f[_0xef77('0x59')]['id']){delete _0x3d125f['body']['id'];}return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0x3d125f[_0xef77('0x52')]['id']}})[_0xef77('0x24')](handleEntityNotFound(_0xc7ebff,null))[_0xef77('0x24')](saveUpdates(_0x3d125f[_0xef77('0x59')],null))[_0xef77('0x24')](respondWithResult(_0xc7ebff,null))[_0xef77('0x2c')](handleError(_0xc7ebff,null));};exports[_0xef77('0x39')]=function(_0xb6ad45,_0x58e350){return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0xb6ad45[_0xef77('0x52')]['id']}})[_0xef77('0x24')](handleEntityNotFound(_0x58e350,null))['then'](removeEntity(_0x58e350,null))[_0xef77('0x2c')](handleError(_0x58e350,null));};exports[_0xef77('0x5a')]=function(_0xacd52,_0x43b35c){return db[_0xef77('0x50')]['describe']()[_0xef77('0x24')](respondWithResult(_0x43b35c,null))[_0xef77('0x2c')](handleError(_0x43b35c,null));};var interaction_log=require('../../config/logger')(_0xef77('0x5b'));exports['accept']=function(_0x592304,_0x30dd00,_0x41002d){var _0x2618a0={'agent':{},'channel':'chat'};if(_0x592304[_0xef77('0x59')]['id']){delete _0x592304[_0xef77('0x59')]['id'];}_0x592304[_0xef77('0x59')]['read']=!![];_0x592304['body'][_0xef77('0x5c')]=moment()[_0xef77('0x5d')](_0xef77('0x5e'));_0x592304[_0xef77('0x59')][_0xef77('0x5f')]=_0x592304[_0xef77('0x59')][_0xef77('0x5f')]||_0x592304['user']['id'];_0x2618a0[_0xef77('0x60')]['id']=_0x592304['body'][_0xef77('0x5f')];return db['ChatMessage'][_0xef77('0x57')]({'where':{'id':_0x592304[_0xef77('0x52')]['id'],'UserId':null}})[_0xef77('0x24')](handleEntityNotFound(_0x30dd00,null))[_0xef77('0x24')](saveUpdates(_0x592304[_0xef77('0x59')],null))[_0xef77('0x24')](function(_0x1c83c5){if(_0x1c83c5){_0x2618a0['message']=_0x1c83c5[_0xef77('0x61')]({'plain':!![]});return db['ChatInteraction'][_0xef77('0x57')]({'where':{'id':_0x1c83c5[_0xef77('0x62')]}});}return null;})[_0xef77('0x24')](handleEntityNotFound(_0x30dd00,null))[_0xef77('0x24')](function(_0x592709){if(_0x592709){return _0x592709[_0xef77('0x38')]({'UserId':_0x592304['body']['UserId'],'read1stAt':_[_0xef77('0x63')](_0x592709['read1stAt'])?moment()[_0xef77('0x5d')](_0xef77('0x5e')):undefined});}return null;})[_0xef77('0x24')](function(_0x46b544){if(_0x46b544){_0x2618a0[_0xef77('0x64')]=_0x46b544[_0xef77('0x61')]({'plain':!![]});interaction_log[_0xef77('0x25')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x592304[_0xef77('0x65')]['id'],_0x592304['user'][_0xef77('0x3c')],_0x592304[_0xef77('0x65')][_0xef77('0x66')],_0x2618a0['interaction']['id'],_0x592304[_0xef77('0x59')]?JSON['stringify'](_0x592304[_0xef77('0x59')]):_0xef77('0x67'));return respondWithRpcPromise(_0xef77('0x68'),_0xef77('0x69'),_0x2618a0);}return null;})['then'](function(_0x31c22d){var _0x3ba986=_0xef77('0x6a')+_0x31c22d['message'][_0xef77('0x6b')];return db[_0xef77('0x6c')][_0xef77('0x44')](_0x3ba986,{'type':db[_0xef77('0x6d')]['QueryTypes'][_0xef77('0x6e')],'raw':!![]})[_0xef77('0x24')](function(_0x5a9a2d){return _0x5a9a2d;});})[_0xef77('0x24')](function(_0x4b574f){if(_0x4b574f){_0x2618a0[_0xef77('0x2a')]['contact']=_0x4b574f[0x0];if(!_0x592304['body'][_0xef77('0x5f')])return;return db[_0xef77('0x6f')][_0xef77('0x57')]({'where':{'id':_0x592304[_0xef77('0x59')]['UserId'],'role':'agent'},'attributes':['id','name',_0xef77('0x70'),_0xef77('0x71'),_0xef77('0x72')],'raw':!![]});}return null;})[_0xef77('0x24')](function(_0x158c7e){if(!_0x158c7e)return null;_0x2618a0[_0xef77('0x2a')][_0xef77('0x60')]=_0x158c7e;return _0x2618a0;})[_0xef77('0x24')](function(_0x2c1ef7){if(_0x2c1ef7){if(_0x592304['body'][_0xef77('0x73')]){_0x2618a0[_0xef77('0x2a')][_0xef77('0x74')]=util['format']('SIP/%s',_0x592304[_0xef77('0x65')]['name']);_0x2618a0[_0xef77('0x2a')][_0xef77('0x75')]=_0x2618a0['channel'];_0x2618a0[_0xef77('0x2a')][_0xef77('0x76')]=_0x2618a0['channel'];_0x2618a0['message']['event']='accept';return respondWithRpcPromise(_0xef77('0x77'),'EventManager',{'event':_0xef77('0x78'),'message':_[_0xef77('0x56')](_0x2618a0['message'],JSON[_0xef77('0x79')](_0x2618a0[_0xef77('0x64')][_0xef77('0x7a')]))},client9002)[_0xef77('0x24')](function(){return _0x2618a0;});}return _0x2618a0;}return null;})[_0xef77('0x24')](respondWithResult(_0x30dd00,null))[_0xef77('0x2c')](handleError(_0x30dd00,null));};var interaction_log=require(_0xef77('0x7b'))(_0xef77('0x5b'));exports['reject']=function(_0x418595,_0x3389d3,_0x34ff37){var _0x26ce0b={'agent':{},'channel':'chat'};if(_0x418595[_0xef77('0x59')]['id']){delete _0x418595[_0xef77('0x59')]['id'];}_0x418595['body'][_0xef77('0x5f')]=_0x418595[_0xef77('0x59')]['UserId']||_0x418595['user']['id'];_0x26ce0b['agent']['id']=_0x418595[_0xef77('0x59')]['UserId'];return db[_0xef77('0x50')][_0xef77('0x57')]({'where':{'id':_0x418595[_0xef77('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3389d3,null))[_0xef77('0x24')](function(_0x22fe6e){if(_0x22fe6e){_0x26ce0b[_0xef77('0x2a')]=_0x22fe6e[_0xef77('0x61')]({'plain':!![]});return db[_0xef77('0x7c')][_0xef77('0x57')]({'where':{'id':_0x22fe6e[_0xef77('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3389d3,null))[_0xef77('0x24')](function(_0x1a4a72){if(_0x1a4a72){_0x26ce0b[_0xef77('0x64')]=_0x1a4a72['get']({'plain':!![]});interaction_log[_0xef77('0x25')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x418595[_0xef77('0x65')]['id'],_0x418595[_0xef77('0x65')]['name'],_0x418595[_0xef77('0x65')]['role'],_0x26ce0b[_0xef77('0x64')]['id'],_0x418595['body']?JSON[_0xef77('0x27')](_0x418595['body']):_0xef77('0x67'));return respondWithRpcPromise(_0xef77('0x7d'),_0xef77('0x7e'),_0x26ce0b);}return null;})[_0xef77('0x24')](function(_0x551486){var _0xaa7683='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x551486[_0xef77('0x2a')][_0xef77('0x6b')];return db['sequelize']['query'](_0xaa7683,{'type':db['Sequelize'][_0xef77('0x7f')][_0xef77('0x6e')],'raw':!![]})[_0xef77('0x24')](function(_0x5e36e2){return _0x5e36e2;});})[_0xef77('0x24')](function(_0x383c44){if(_0x383c44){_0x26ce0b[_0xef77('0x2a')][_0xef77('0x80')]=_0x383c44[0x0];if(!_0x418595['body'][_0xef77('0x5f')])return;return db[_0xef77('0x6f')][_0xef77('0x57')]({'where':{'id':_0x418595['body']['UserId'],'role':_0xef77('0x60')},'attributes':['id',_0xef77('0x3c'),_0xef77('0x70'),'email',_0xef77('0x72')],'raw':!![]});}return null;})[_0xef77('0x24')](function(_0xc68613){if(!_0xc68613)return null;_0x26ce0b[_0xef77('0x2a')][_0xef77('0x60')]=_0xc68613;return _0x26ce0b;})['then'](function(_0x2a28c7){if(_0x2a28c7){_0x2a28c7[_0xef77('0x2a')][_0xef77('0x74')]=util[_0xef77('0x5d')]('SIP/%s',_0x418595['user'][_0xef77('0x3c')]);_0x2a28c7[_0xef77('0x2a')][_0xef77('0x75')]=_0x26ce0b['channel'];_0x2a28c7[_0xef77('0x2a')]['motionChannel']=_0x26ce0b[_0xef77('0x75')];_0x2a28c7[_0xef77('0x2a')]['event']='reject';respondWithRpcPromise(_0xef77('0x77'),_0xef77('0x77'),{'event':_0xef77('0x81'),'message':_[_0xef77('0x56')](_0x26ce0b[_0xef77('0x2a')],JSON[_0xef77('0x79')](_0x26ce0b[_0xef77('0x64')][_0xef77('0x7a')]))},client9002);return _0x26ce0b;}return null;})[_0xef77('0x24')](respondWithResult(_0x3389d3,null))[_0xef77('0x2c')](handleError(_0x3389d3,null));};
\ No newline at end of file
+var _0xa0c5=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','catch','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','name','send','index','map','ChatMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','rawAttributes','include','create','body','update','find','params','describe','accept','chat','readAt','format','UserId','agent','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','formData','chat-interactions','get','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','QueryTypes','SELECT','event','EventManager','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','fs-extra','lodash','squel','crypto','to-csv'];(function(_0x28b754,_0x5a1158){var _0x2e0534=function(_0x4685f0){while(--_0x4685f0){_0x28b754['push'](_0x28b754['shift']());}};_0x2e0534(++_0x5a1158);}(_0xa0c5,0x174));var _0x5a0c=function(_0x372a57,_0x9aa407){_0x372a57=_0x372a57-0x0;var _0x358f6d=_0xa0c5[_0x372a57];return _0x358f6d;};'use strict';var emlformat=require(_0x5a0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a0c('0x1'));var jsonpatch=require(_0x5a0c('0x2'));var rp=require(_0x5a0c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5a0c('0x4'));var util=require('util');var path=require(_0x5a0c('0x5'));var sox=require(_0x5a0c('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a0c('0x7'));var _=require(_0x5a0c('0x8'));var squel=require(_0x5a0c('0x9'));var crypto=require(_0x5a0c('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a0c('0xb'));var querystring=require(_0x5a0c('0xc'));var Papa=require(_0x5a0c('0xd'));var Redis=require(_0x5a0c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5a0c('0xf'));var as=require(_0x5a0c('0x10'));var hardwareService=require(_0x5a0c('0x11'));var logger=require(_0x5a0c('0x12'))(_0x5a0c('0x13'));var utils=require(_0x5a0c('0x14'));var config=require(_0x5a0c('0x15'));var licenseUtil=require(_0x5a0c('0x16'));var db=require(_0x5a0c('0x17'))['db'];config[_0x5a0c('0x18')]=_[_0x5a0c('0x19')](config[_0x5a0c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a0c('0x1a'))(new Redis(config[_0x5a0c('0x18')]));require(_0x5a0c('0x1b'))[_0x5a0c('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5a0c('0x1d')]({'port':0x232c});var client9002=jayson[_0x5a0c('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc76c65,_0x3a3c68,_0x4fd323,_0x32d4f1){return new BPromise(function(_0x3078fe,_0x1d885b){var _0x413a15=_0x32d4f1||client;return _0x413a15[_0x5a0c('0x1f')](_0xc76c65,_0x4fd323)[_0x5a0c('0x20')](function(_0x42d921){logger['info'](_0x5a0c('0x21'),_0x3a3c68,_0x5a0c('0x22'));logger[_0x5a0c('0x23')](_0x5a0c('0x24'),_0x3a3c68,_0x5a0c('0x22'),JSON['stringify'](_0x42d921));if(_0x42d921['error']){if(_0x42d921[_0x5a0c('0x25')]['code']===0x1f4){logger['error'](_0x5a0c('0x21'),_0x3a3c68,_0x42d921[_0x5a0c('0x25')][_0x5a0c('0x26')]);return _0x1d885b(_0x42d921['error'][_0x5a0c('0x26')]);}logger['error'](_0x5a0c('0x21'),_0x3a3c68,_0x42d921['error'][_0x5a0c('0x26')]);return _0x3078fe(_0x42d921[_0x5a0c('0x25')][_0x5a0c('0x26')]);}else{logger[_0x5a0c('0x27')](_0x5a0c('0x21'),_0x3a3c68,_0x5a0c('0x22'));_0x3078fe(_0x42d921['result']['message']);}})[_0x5a0c('0x28')](function(_0x50847e){logger['error'](_0x5a0c('0x21'),_0x3a3c68,_0x50847e);_0x1d885b(_0x50847e);});});}function respondWithStatusCode(_0x8c8028,_0x7aaa89){_0x7aaa89=_0x7aaa89||0xcc;return function(_0x356e1c){if(_0x356e1c){return _0x8c8028['sendStatus'](_0x7aaa89);}return _0x8c8028[_0x5a0c('0x29')](_0x7aaa89)[_0x5a0c('0x2a')]();};}function respondWithResult(_0x5c2124,_0x27ef11){_0x27ef11=_0x27ef11||0xc8;return function(_0x21e99b){if(_0x21e99b){return _0x5c2124[_0x5a0c('0x29')](_0x27ef11)[_0x5a0c('0x2b')](_0x21e99b);}};}function respondWithFilteredResult(_0x3b6119,_0x1841e7){return function(_0x3c206b){if(_0x3c206b){var _0x2ab511=typeof _0x1841e7[_0x5a0c('0x2c')]===_0x5a0c('0x2d')&&typeof _0x1841e7['limit']===_0x5a0c('0x2d');var _0x3da1f4=_0x3c206b[_0x5a0c('0x2e')];var _0x25271f=_0x2ab511?0x0:_0x1841e7[_0x5a0c('0x2c')];var _0x3a1575=_0x2ab511?_0x3c206b['count']:_0x1841e7['offset']+_0x1841e7[_0x5a0c('0x2f')];var _0x1ae1ec;if(_0x3a1575>=_0x3da1f4){_0x3a1575=_0x3da1f4;_0x1ae1ec=0xc8;}else{_0x1ae1ec=0xce;}_0x3b6119[_0x5a0c('0x29')](_0x1ae1ec);return _0x3b6119[_0x5a0c('0x30')]('Content-Range',_0x25271f+'-'+_0x3a1575+'/'+_0x3da1f4)[_0x5a0c('0x2b')](_0x3c206b);}return null;};}function patchUpdates(_0xc9e28b){return function(_0x332d8e){try{jsonpatch[_0x5a0c('0x31')](_0x332d8e,_0xc9e28b,!![]);}catch(_0xda4914){return BPromise[_0x5a0c('0x32')](_0xda4914);}return _0x332d8e[_0x5a0c('0x33')]();};}function saveUpdates(_0x599d46,_0x44d1b8){return function(_0xf8e124){if(_0xf8e124){return _0xf8e124['update'](_0x599d46)[_0x5a0c('0x20')](function(_0x261032){return _0x261032;});}return null;};}function removeEntity(_0x112d7f,_0x15b5e4){return function(_0x33e61c){if(_0x33e61c){return _0x33e61c[_0x5a0c('0x34')]()[_0x5a0c('0x20')](function(){_0x112d7f[_0x5a0c('0x29')](0xcc)[_0x5a0c('0x2a')]();});}};}function handleEntityNotFound(_0x467a80,_0x269ddd){return function(_0x288a7e){if(!_0x288a7e){_0x467a80['sendStatus'](0x194);}return _0x288a7e;};}function handleError(_0x45451c,_0x3107e2){_0x3107e2=_0x3107e2||0x1f4;return function(_0x31f741){logger[_0x5a0c('0x25')](_0x31f741['stack']);if(_0x31f741[_0x5a0c('0x35')]){delete _0x31f741[_0x5a0c('0x35')];}_0x45451c[_0x5a0c('0x29')](_0x3107e2)[_0x5a0c('0x36')](_0x31f741);};}exports[_0x5a0c('0x37')]=function(_0x9ac285,_0x4c0269){var _0x7d048d={},_0x21982a={},_0x234247={'count':0x0,'rows':[]};var _0x311356=_[_0x5a0c('0x38')](db[_0x5a0c('0x39')]['rawAttributes'],function(_0x3f4441){return{'name':_0x3f4441[_0x5a0c('0x3a')],'type':_0x3f4441[_0x5a0c('0x3b')]['key']};});_0x21982a[_0x5a0c('0x3c')]=_[_0x5a0c('0x38')](_0x311356,_0x5a0c('0x35'));_0x21982a[_0x5a0c('0x3d')]=_[_0x5a0c('0x3e')](_0x9ac285['query']);_0x21982a[_0x5a0c('0x3f')]=_[_0x5a0c('0x40')](_0x21982a[_0x5a0c('0x3c')],_0x21982a[_0x5a0c('0x3d')]);_0x7d048d[_0x5a0c('0x41')]=_['intersection'](_0x21982a['model'],qs[_0x5a0c('0x42')](_0x9ac285['query'][_0x5a0c('0x42')]));_0x7d048d[_0x5a0c('0x41')]=_0x7d048d[_0x5a0c('0x41')][_0x5a0c('0x43')]?_0x7d048d['attributes']:_0x21982a[_0x5a0c('0x3c')];if(!_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x44')](_0x5a0c('0x45'))){_0x7d048d['limit']=qs[_0x5a0c('0x2f')](_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x2f')]);_0x7d048d['offset']=qs[_0x5a0c('0x2c')](_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x2c')]);}_0x7d048d['order']=qs[_0x5a0c('0x46')](_0x9ac285[_0x5a0c('0x3d')]['sort']);_0x7d048d[_0x5a0c('0x47')]=qs[_0x5a0c('0x3f')](_['pick'](_0x9ac285['query'],_0x21982a[_0x5a0c('0x3f')]),_0x311356);if(_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x48')]){_0x7d048d[_0x5a0c('0x47')]=_[_0x5a0c('0x49')](_0x7d048d[_0x5a0c('0x47')],{'$or':_[_0x5a0c('0x38')](_0x311356,function(_0xe3cd14){if(_0xe3cd14[_0x5a0c('0x3b')]!==_0x5a0c('0x4a')){var _0x12700b={};_0x12700b[_0xe3cd14['name']]={'$like':'%'+_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x48')]+'%'};return _0x12700b;}})});}_0x7d048d=_['merge']({},_0x7d048d,_0x9ac285[_0x5a0c('0x4b')]);var _0x54bbba={'where':_0x7d048d[_0x5a0c('0x47')]};return db[_0x5a0c('0x39')][_0x5a0c('0x2e')](_0x54bbba)[_0x5a0c('0x20')](function(_0x38a66e){_0x234247[_0x5a0c('0x2e')]=_0x38a66e;if(_0x9ac285[_0x5a0c('0x3d')][_0x5a0c('0x4c')]){_0x7d048d['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x7d048d);})['then'](function(_0x8b5f45){_0x234247['rows']=_0x8b5f45;return _0x234247;})['then'](respondWithFilteredResult(_0x4c0269,_0x7d048d))[_0x5a0c('0x28')](handleError(_0x4c0269,null));};exports['show']=function(_0x4dc94d,_0x5d81e2){var _0x109f98={'raw':!![],'where':{'id':_0x4dc94d['params']['id']}},_0x351d60={};_0x351d60['model']=_[_0x5a0c('0x3e')](db[_0x5a0c('0x39')][_0x5a0c('0x4d')]);_0x351d60[_0x5a0c('0x3d')]=_[_0x5a0c('0x3e')](_0x4dc94d[_0x5a0c('0x3d')]);_0x351d60[_0x5a0c('0x3f')]=_[_0x5a0c('0x40')](_0x351d60[_0x5a0c('0x3c')],_0x351d60['query']);_0x109f98[_0x5a0c('0x41')]=_[_0x5a0c('0x40')](_0x351d60[_0x5a0c('0x3c')],qs[_0x5a0c('0x42')](_0x4dc94d[_0x5a0c('0x3d')][_0x5a0c('0x42')]));_0x109f98['attributes']=_0x109f98[_0x5a0c('0x41')]['length']?_0x109f98[_0x5a0c('0x41')]:_0x351d60[_0x5a0c('0x3c')];if(_0x4dc94d[_0x5a0c('0x3d')][_0x5a0c('0x4c')]){_0x109f98[_0x5a0c('0x4e')]=[{'all':!![]}];}_0x109f98=_[_0x5a0c('0x49')]({},_0x109f98,_0x4dc94d[_0x5a0c('0x4b')]);return db[_0x5a0c('0x39')]['find'](_0x109f98)['then'](handleEntityNotFound(_0x5d81e2,null))[_0x5a0c('0x20')](respondWithResult(_0x5d81e2,null))[_0x5a0c('0x28')](handleError(_0x5d81e2,null));};exports['create']=function(_0x5af3cd,_0x3c0798){return db[_0x5a0c('0x39')][_0x5a0c('0x4f')](_0x5af3cd[_0x5a0c('0x50')],{})[_0x5a0c('0x20')](respondWithResult(_0x3c0798,0xc9))[_0x5a0c('0x28')](handleError(_0x3c0798,null));};exports[_0x5a0c('0x51')]=function(_0x3789ac,_0x54335d){if(_0x3789ac[_0x5a0c('0x50')]['id']){delete _0x3789ac['body']['id'];}return db[_0x5a0c('0x39')][_0x5a0c('0x52')]({'where':{'id':_0x3789ac[_0x5a0c('0x53')]['id']}})[_0x5a0c('0x20')](handleEntityNotFound(_0x54335d,null))[_0x5a0c('0x20')](saveUpdates(_0x3789ac[_0x5a0c('0x50')],null))[_0x5a0c('0x20')](respondWithResult(_0x54335d,null))['catch'](handleError(_0x54335d,null));};exports[_0x5a0c('0x34')]=function(_0x542517,_0x259ff){return db[_0x5a0c('0x39')][_0x5a0c('0x52')]({'where':{'id':_0x542517['params']['id']}})['then'](handleEntityNotFound(_0x259ff,null))['then'](removeEntity(_0x259ff,null))[_0x5a0c('0x28')](handleError(_0x259ff,null));};exports[_0x5a0c('0x54')]=function(_0xcc925b,_0x27f115){return db['ChatMessage'][_0x5a0c('0x54')]()['then'](respondWithResult(_0x27f115,null))[_0x5a0c('0x28')](handleError(_0x27f115,null));};var interaction_log=require(_0x5a0c('0x12'))('chat-interactions');exports[_0x5a0c('0x55')]=function(_0x1aef2a,_0x285c09,_0xf33045){var _0xb705c7={'agent':{},'channel':_0x5a0c('0x56')};if(_0x1aef2a['body']['id']){delete _0x1aef2a[_0x5a0c('0x50')]['id'];}_0x1aef2a['body']['read']=!![];_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x57')]=moment()[_0x5a0c('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x1aef2a['body'][_0x5a0c('0x59')]=_0x1aef2a[_0x5a0c('0x50')]['UserId']||_0x1aef2a['user']['id'];_0xb705c7[_0x5a0c('0x5a')]['id']=_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x59')];return db[_0x5a0c('0x39')]['find']({'where':{'id':_0x1aef2a[_0x5a0c('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x285c09,null))[_0x5a0c('0x20')](saveUpdates(_0x1aef2a[_0x5a0c('0x50')],null))[_0x5a0c('0x20')](function(_0x364cbb){if(_0x364cbb){_0xb705c7['message']=_0x364cbb['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x364cbb['ChatInteractionId']}});}return null;})[_0x5a0c('0x20')](handleEntityNotFound(_0x285c09,null))['then'](function(_0x27a371){if(_0x27a371){return _0x27a371[_0x5a0c('0x51')]({'UserId':_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x59')],'read1stAt':_[_0x5a0c('0x5b')](_0x27a371[_0x5a0c('0x5c')])?moment()[_0x5a0c('0x58')](_0x5a0c('0x5d')):undefined});}return null;})[_0x5a0c('0x20')](function(_0x433f3e){if(_0x433f3e){_0xb705c7[_0x5a0c('0x5e')]=_0x433f3e['get']({'plain':!![]});interaction_log[_0x5a0c('0x27')](_0x5a0c('0x5f'),_0x1aef2a['user']['id'],_0x1aef2a[_0x5a0c('0x60')][_0x5a0c('0x35')],_0x1aef2a[_0x5a0c('0x60')][_0x5a0c('0x61')],_0xb705c7[_0x5a0c('0x5e')]['id'],_0x1aef2a['body']?JSON[_0x5a0c('0x62')](_0x1aef2a[_0x5a0c('0x50')]):_0x5a0c('0x63'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0xb705c7);}return null;})[_0x5a0c('0x20')](function(_0x23d412){var _0x1fc6df=_0x5a0c('0x64')+_0x23d412['message'][_0x5a0c('0x65')];return db['sequelize'][_0x5a0c('0x3d')](_0x1fc6df,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x5a0c('0x20')](function(_0x2d1b42){return _0x2d1b42;});})[_0x5a0c('0x20')](function(_0x363bf2){if(_0x363bf2){_0xb705c7[_0x5a0c('0x26')][_0x5a0c('0x66')]=_0x363bf2[0x0];if(!_0x1aef2a[_0x5a0c('0x50')]['UserId'])return;return db[_0x5a0c('0x67')][_0x5a0c('0x52')]({'where':{'id':_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x59')],'role':_0x5a0c('0x5a')},'attributes':['id',_0x5a0c('0x35'),_0x5a0c('0x68'),_0x5a0c('0x69'),_0x5a0c('0x6a')],'raw':!![]});}return null;})[_0x5a0c('0x20')](function(_0x33e091){if(!_0x33e091)return null;_0xb705c7[_0x5a0c('0x26')][_0x5a0c('0x5a')]=_0x33e091;return _0xb705c7;})[_0x5a0c('0x20')](function(_0xf0d675){if(_0xf0d675){if(_0x1aef2a[_0x5a0c('0x50')][_0x5a0c('0x6b')]){_0xb705c7[_0x5a0c('0x26')][_0x5a0c('0x6c')]=util['format'](_0x5a0c('0x6d'),_0x1aef2a[_0x5a0c('0x60')][_0x5a0c('0x35')]);_0xb705c7[_0x5a0c('0x26')]['channel']=_0xb705c7[_0x5a0c('0x6e')];_0xb705c7[_0x5a0c('0x26')][_0x5a0c('0x6f')]=_0xb705c7[_0x5a0c('0x6e')];_0xb705c7[_0x5a0c('0x26')]['event']=_0x5a0c('0x55');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5a0c('0x70'),'message':_[_0x5a0c('0x49')](_0xb705c7[_0x5a0c('0x26')],JSON['parse'](_0xb705c7[_0x5a0c('0x5e')][_0x5a0c('0x71')]))},client9002)['then'](function(){return _0xb705c7;});}return _0xb705c7;}return null;})[_0x5a0c('0x20')](respondWithResult(_0x285c09,null))[_0x5a0c('0x28')](handleError(_0x285c09,null));};var interaction_log=require(_0x5a0c('0x12'))(_0x5a0c('0x72'));exports[_0x5a0c('0x32')]=function(_0x3d0542,_0x48bc63,_0x3c7331){var _0x4063c7={'agent':{},'channel':'chat'};if(_0x3d0542[_0x5a0c('0x50')]['id']){delete _0x3d0542['body']['id'];}_0x3d0542[_0x5a0c('0x50')][_0x5a0c('0x59')]=_0x3d0542['body'][_0x5a0c('0x59')]||_0x3d0542['user']['id'];_0x4063c7['agent']['id']=_0x3d0542['body'][_0x5a0c('0x59')];return db['ChatMessage'][_0x5a0c('0x52')]({'where':{'id':_0x3d0542['params']['id'],'UserId':null}})[_0x5a0c('0x20')](handleEntityNotFound(_0x48bc63,null))[_0x5a0c('0x20')](function(_0x4ecee2){if(_0x4ecee2){_0x4063c7[_0x5a0c('0x26')]=_0x4ecee2[_0x5a0c('0x73')]({'plain':!![]});return db[_0x5a0c('0x74')][_0x5a0c('0x52')]({'where':{'id':_0x4ecee2[_0x5a0c('0x75')]}});}return null;})[_0x5a0c('0x20')](handleEntityNotFound(_0x48bc63,null))['then'](function(_0x144eb3){if(_0x144eb3){_0x4063c7['interaction']=_0x144eb3[_0x5a0c('0x73')]({'plain':!![]});interaction_log[_0x5a0c('0x27')](_0x5a0c('0x76'),_0x3d0542[_0x5a0c('0x60')]['id'],_0x3d0542[_0x5a0c('0x60')]['name'],_0x3d0542[_0x5a0c('0x60')][_0x5a0c('0x61')],_0x4063c7[_0x5a0c('0x5e')]['id'],_0x3d0542[_0x5a0c('0x50')]?JSON[_0x5a0c('0x62')](_0x3d0542['body']):'null');return respondWithRpcPromise(_0x5a0c('0x77'),_0x5a0c('0x78'),_0x4063c7);}return null;})[_0x5a0c('0x20')](function(_0x3ea36b){var _0x9984bf='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ea36b[_0x5a0c('0x26')][_0x5a0c('0x65')];return db[_0x5a0c('0x79')][_0x5a0c('0x3d')](_0x9984bf,{'type':db['Sequelize'][_0x5a0c('0x7a')][_0x5a0c('0x7b')],'raw':!![]})[_0x5a0c('0x20')](function(_0x30cc2c){return _0x30cc2c;});})[_0x5a0c('0x20')](function(_0x5dd298){if(_0x5dd298){_0x4063c7[_0x5a0c('0x26')][_0x5a0c('0x66')]=_0x5dd298[0x0];if(!_0x3d0542[_0x5a0c('0x50')][_0x5a0c('0x59')])return;return db[_0x5a0c('0x67')]['find']({'where':{'id':_0x3d0542[_0x5a0c('0x50')][_0x5a0c('0x59')],'role':_0x5a0c('0x5a')},'attributes':['id','name',_0x5a0c('0x68'),_0x5a0c('0x69'),'internal'],'raw':!![]});}return null;})[_0x5a0c('0x20')](function(_0x44b2db){if(!_0x44b2db)return null;_0x4063c7['message'][_0x5a0c('0x5a')]=_0x44b2db;return _0x4063c7;})['then'](function(_0x35d34b){if(_0x35d34b){_0x35d34b[_0x5a0c('0x26')]['interface']=util[_0x5a0c('0x58')](_0x5a0c('0x6d'),_0x3d0542[_0x5a0c('0x60')][_0x5a0c('0x35')]);_0x35d34b[_0x5a0c('0x26')]['channel']=_0x4063c7[_0x5a0c('0x6e')];_0x35d34b[_0x5a0c('0x26')][_0x5a0c('0x6f')]=_0x4063c7['channel'];_0x35d34b[_0x5a0c('0x26')][_0x5a0c('0x7c')]=_0x5a0c('0x32');respondWithRpcPromise(_0x5a0c('0x7d'),_0x5a0c('0x7d'),{'event':_0x5a0c('0x7e'),'message':_['merge'](_0x4063c7[_0x5a0c('0x26')],JSON[_0x5a0c('0x7f')](_0x4063c7['interaction'][_0x5a0c('0x71')]))},client9002);return _0x4063c7;}return null;})['then'](respondWithResult(_0x48bc63,null))[_0x5a0c('0x28')](handleError(_0x48bc63,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 2e523b2..4cd7bcf 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 _0xcfe1=['events','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x4c86d2,_0x591baf){var _0x437a4b=function(_0x462901){while(--_0x462901){_0x4c86d2['push'](_0x4c86d2['shift']());}};_0x437a4b(++_0x591baf);}(_0xcfe1,0x126));var _0x1cfe=function(_0x43dd06,_0x2b2592){_0x43dd06=_0x43dd06-0x0;var _0x416968=_0xcfe1[_0x43dd06];return _0x416968;};'use strict';var EventEmitter=require(_0x1cfe('0x0'));var ChatMessage=require(_0x1cfe('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1cfe('0x2')](0x0);var events={'afterCreate':_0x1cfe('0x3'),'afterUpdate':_0x1cfe('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6da306){return function(_0x25523d,_0x1b2365,_0x15cf6d){ChatMessageEvents[_0x1cfe('0x5')](_0x6da306+':'+_0x25523d['id'],_0x25523d);ChatMessageEvents[_0x1cfe('0x5')](_0x6da306,_0x25523d);_0x15cf6d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1cfe('0x6')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x673e=['save','remove','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x50e440,_0x274af9){var _0x4257f0=function(_0x1dd4dd){while(--_0x1dd4dd){_0x50e440['push'](_0x50e440['shift']());}};_0x4257f0(++_0x274af9);}(_0x673e,0x1d4));var _0xe673=function(_0x21e4e6,_0x24c576){_0x21e4e6=_0x21e4e6-0x0;var _0x204b2d=_0x673e[_0x21e4e6];return _0x204b2d;};'use strict';var EventEmitter=require(_0xe673('0x0'));var ChatMessage=require(_0xe673('0x1'))['db'][_0xe673('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe673('0x3')](0x0);var events={'afterCreate':_0xe673('0x4'),'afterUpdate':'update','afterDestroy':_0xe673('0x5')};function emitEvent(_0x33b435){return function(_0x5449cf,_0x3353af,_0x13a544){ChatMessageEvents[_0xe673('0x6')](_0x33b435+':'+_0x5449cf['id'],_0x5449cf);ChatMessageEvents[_0xe673('0x6')](_0x33b435,_0x5449cf);_0x13a544(null);};}for(var e in events){if(events[_0xe673('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 2c5ec24..b6aaa39 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 _0x826e=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','then','createdAt','catch'];(function(_0x22e69b,_0x1f32b0){var _0x2c2db7=function(_0x5b670c){while(--_0x5b670c){_0x22e69b['push'](_0x22e69b['shift']());}};_0x2c2db7(++_0x1f32b0);}(_0x826e,0x163));var _0xe826=function(_0x189ffc,_0x3bc69d){_0x189ffc=_0x189ffc-0x0;var _0xa0f1ed=_0x826e[_0x189ffc];return _0xa0f1ed;};'use strict';var _=require('lodash');var util=require(_0xe826('0x0'));var logger=require(_0xe826('0x1'))(_0xe826('0x2'));var moment=require(_0xe826('0x3'));var BPromise=require(_0xe826('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe826('0x5'));var attributes=require(_0xe826('0x6'));module[_0xe826('0x7')]=function(_0x21d118,_0x4a2658){return _0x21d118['define'](_0xe826('0x8'),attributes,{'tableName':_0xe826('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xe826('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50b311,_0x11f53d,_0x34da53){var _0x63554f=_0x21d118[_0xe826('0xb')];var _0x1a4915=_0x50b311['get']({'plain':!![]});if(_0x1a4915[_0xe826('0xc')][_0xe826('0xd')]()==='in'||_0x1a4915[_0xe826('0xc')]['toLowerCase']()==='out'&&!_0x1a4915[_0xe826('0xe')]&&!_[_0xe826('0xf')](_0x1a4915['UserId'])){_0x63554f['ChatInteraction']['findOne']({'where':{'id':_0x1a4915['ChatInteractionId']}})[_0xe826('0x10')](function(_0x200eb6){if(_0x200eb6){_0x200eb6['update']({'lastMsgAt':_0x1a4915[_0xe826('0x11')],'lastMsgDirection':_0x1a4915[_0xe826('0xc')][_0xe826('0xd')]()});}})[_0xe826('0x12')](function(_0x48e03f){console[_0xe826('0x13')](_0x48e03f);});}_0x34da53();}},'charset':_0xe826('0x14'),'collate':_0xe826('0x15')});};
\ No newline at end of file
+var _0x1521=['out','secret','UserId','ChatInteraction','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','get','direction','toLowerCase'];(function(_0x5f0a31,_0x2d3496){var _0x37ef20=function(_0x468b03){while(--_0x468b03){_0x5f0a31['push'](_0x5f0a31['shift']());}};_0x37ef20(++_0x2d3496);}(_0x1521,0x11c));var _0x1152=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0x1521[_0x36b037];return _0x409194;};'use strict';var _=require('lodash');var util=require(_0x1152('0x0'));var logger=require(_0x1152('0x1'))(_0x1152('0x2'));var moment=require(_0x1152('0x3'));var BPromise=require(_0x1152('0x4'));var rp=require(_0x1152('0x5'));var fs=require('fs');var path=require(_0x1152('0x6'));var rimraf=require('rimraf');var config=require(_0x1152('0x7'));var attributes=require('./chatMessage.attributes');module[_0x1152('0x8')]=function(_0xf59dec,_0x10a765){return _0xf59dec['define'](_0x1152('0x9'),attributes,{'tableName':_0x1152('0xa'),'paranoid':![],'indexes':[{'name':_0x1152('0xb'),'fields':['body'],'type':_0x1152('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45f68d,_0x999933,_0x13e967){var _0x4730fb=_0xf59dec['models'];var _0xc472c7=_0x45f68d[_0x1152('0xd')]({'plain':!![]});if(_0xc472c7[_0x1152('0xe')][_0x1152('0xf')]()==='in'||_0xc472c7[_0x1152('0xe')][_0x1152('0xf')]()===_0x1152('0x10')&&!_0xc472c7[_0x1152('0x11')]&&!_['isNil'](_0xc472c7[_0x1152('0x12')])){_0x4730fb[_0x1152('0x13')]['findOne']({'where':{'id':_0xc472c7['ChatInteractionId']}})['then'](function(_0x1b88bf){if(_0x1b88bf){_0x1b88bf['update']({'lastMsgAt':_0xc472c7[_0x1152('0x14')],'lastMsgDirection':_0xc472c7['direction'][_0x1152('0xf')]()});}})[_0x1152('0x15')](function(_0x535afe){console[_0x1152('0x16')](_0x535afe);});}_0x13e967();}},'charset':_0x1152('0x17'),'collate':_0x1152('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 90951b2..365aaab 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 _0x7157=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','request','then','info'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x7157,0x1b0));var _0x7715=function(_0x27c2b1,_0x39a48c){_0x27c2b1=_0x27c2b1-0x0;var _0x423cb6=_0x7157[_0x27c2b1];return _0x423cb6;};'use strict';var _=require(_0x7715('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7715('0x1'));var rs=require(_0x7715('0x2'));var fs=require('fs');var Redis=require(_0x7715('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7715('0x4'));var logger=require(_0x7715('0x5'))(_0x7715('0x6'));var config=require(_0x7715('0x7'));var jayson=require(_0x7715('0x8'));var client=jayson[_0x7715('0x9')][_0x7715('0xa')]({'port':0x232a});config[_0x7715('0xb')]=_['defaults'](config[_0x7715('0xb')],{'host':_0x7715('0xc'),'port':0x18eb});var socket=require(_0x7715('0xd'))(new Redis(config[_0x7715('0xb')]));require(_0x7715('0xe'))['register'](socket);function respondWithRpcPromise(_0x24919f,_0x3028c7,_0x196fcb){return new BPromise(function(_0x3b54a1,_0x5bbc71){return client[_0x7715('0xf')](_0x24919f,_0x196fcb)[_0x7715('0x10')](function(_0x4c939b){logger[_0x7715('0x11')](_0x7715('0x12'),_0x3028c7,_0x7715('0x13'));logger[_0x7715('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3028c7,_0x7715('0x13'),JSON[_0x7715('0x15')](_0x4c939b));if(_0x4c939b[_0x7715('0x16')]){if(_0x4c939b[_0x7715('0x16')]['code']===0x1f4){logger[_0x7715('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3028c7,_0x4c939b[_0x7715('0x16')]['message']);return _0x5bbc71(_0x4c939b[_0x7715('0x16')][_0x7715('0x17')]);}logger[_0x7715('0x16')]('ChatMessage,\x20%s,\x20%s',_0x3028c7,_0x4c939b[_0x7715('0x16')][_0x7715('0x17')]);return _0x3b54a1(_0x4c939b['error'][_0x7715('0x17')]);}else{logger['info'](_0x7715('0x12'),_0x3028c7,_0x7715('0x13'));_0x3b54a1(_0x4c939b[_0x7715('0x18')][_0x7715('0x17')]);}})[_0x7715('0x19')](function(_0x3e1072){logger['error'](_0x7715('0x12'),_0x3028c7,_0x3e1072);_0x5bbc71(_0x3e1072);});});}exports[_0x7715('0x1a')]=function(_0x524c7f){var _0x30f71d=this;return new Promise(function(_0x12120b,_0x2530de){return db[_0x7715('0x1b')][_0x7715('0x1c')](_0x524c7f[_0x7715('0x1d')],{'raw':_0x524c7f['options']?_0x524c7f['options']['raw']===undefined?!![]:![]:!![]})[_0x7715('0x10')](function(_0x1c4f9b){logger[_0x7715('0x11')](_0x7715('0x1a'),_0x524c7f);logger[_0x7715('0x14')](_0x7715('0x1a'),_0x524c7f,JSON['stringify'](_0x1c4f9b));_0x12120b(_0x1c4f9b);})[_0x7715('0x19')](function(_0x3191d0){logger[_0x7715('0x16')](_0x7715('0x1a'),_0x3191d0[_0x7715('0x17')],_0x524c7f);_0x2530de(_0x30f71d[_0x7715('0x16')](0x1f4,_0x3191d0[_0x7715('0x17')]));});});};
\ No newline at end of file
+var _0x0842=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x375f40,_0x511157){var _0x27a221=function(_0x131feb){while(--_0x131feb){_0x375f40['push'](_0x375f40['shift']());}};_0x27a221(++_0x511157);}(_0x0842,0xeb));var _0x2084=function(_0x160136,_0x2ca160){_0x160136=_0x160136-0x0;var _0x5d5eff=_0x0842[_0x160136];return _0x5d5eff;};'use strict';var _=require(_0x2084('0x0'));var util=require('util');var moment=require(_0x2084('0x1'));var BPromise=require(_0x2084('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2084('0x3'))['db'];var utils=require(_0x2084('0x4'));var logger=require(_0x2084('0x5'))('rpc');var config=require(_0x2084('0x6'));var jayson=require(_0x2084('0x7'));var client=jayson[_0x2084('0x8')][_0x2084('0x9')]({'port':0x232a});config[_0x2084('0xa')]=_[_0x2084('0xb')](config[_0x2084('0xa')],{'host':_0x2084('0xc'),'port':0x18eb});var socket=require(_0x2084('0xd'))(new Redis(config[_0x2084('0xa')]));require(_0x2084('0xe'))[_0x2084('0xf')](socket);function respondWithRpcPromise(_0x3a9bc3,_0xc7431a,_0x19dd5a){return new BPromise(function(_0x5e1066,_0x4cb8ea){return client[_0x2084('0x10')](_0x3a9bc3,_0x19dd5a)['then'](function(_0x5659da){logger[_0x2084('0x11')](_0x2084('0x12'),_0xc7431a,_0x2084('0x13'));logger['debug'](_0x2084('0x14'),_0xc7431a,_0x2084('0x13'),JSON[_0x2084('0x15')](_0x5659da));if(_0x5659da[_0x2084('0x16')]){if(_0x5659da[_0x2084('0x16')][_0x2084('0x17')]===0x1f4){logger[_0x2084('0x16')](_0x2084('0x12'),_0xc7431a,_0x5659da[_0x2084('0x16')][_0x2084('0x18')]);return _0x4cb8ea(_0x5659da[_0x2084('0x16')]['message']);}logger[_0x2084('0x16')](_0x2084('0x12'),_0xc7431a,_0x5659da['error']['message']);return _0x5e1066(_0x5659da[_0x2084('0x16')]['message']);}else{logger[_0x2084('0x11')](_0x2084('0x12'),_0xc7431a,_0x2084('0x13'));_0x5e1066(_0x5659da[_0x2084('0x19')][_0x2084('0x18')]);}})[_0x2084('0x1a')](function(_0x444031){logger[_0x2084('0x16')](_0x2084('0x12'),_0xc7431a,_0x444031);_0x4cb8ea(_0x444031);});});}exports[_0x2084('0x1b')]=function(_0x360079){var _0x5a6777=this;return new Promise(function(_0x9f7abd,_0x3ad78e){return db[_0x2084('0x1c')][_0x2084('0x1d')](_0x360079[_0x2084('0x1e')],{'raw':_0x360079['options']?_0x360079[_0x2084('0x1f')][_0x2084('0x20')]===undefined?!![]:![]:!![]})[_0x2084('0x21')](function(_0x42c845){logger[_0x2084('0x11')](_0x2084('0x1b'),_0x360079);logger[_0x2084('0x22')](_0x2084('0x1b'),_0x360079,JSON[_0x2084('0x15')](_0x42c845));_0x9f7abd(_0x42c845);})[_0x2084('0x1a')](function(_0x308db7){logger[_0x2084('0x16')](_0x2084('0x1b'),_0x308db7[_0x2084('0x18')],_0x360079);_0x3ad78e(_0x5a6777[_0x2084('0x16')](0x1f4,_0x308db7['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index fae1344..56c01b8 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 _0x0207=['emit','removeListener','length','chatMessage:','save'];(function(_0x1d75d0,_0x666556){var _0x3607bf=function(_0x407781){while(--_0x407781){_0x1d75d0['push'](_0x1d75d0['shift']());}};_0x3607bf(++_0x666556);}(_0x0207,0x162));var _0x7020=function(_0x2178fa,_0x284a29){_0x2178fa=_0x2178fa-0x0;var _0x47012f=_0x0207[_0x2178fa];return _0x47012f;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x7020('0x0'),'remove','update'];function createListener(_0x1a481c,_0x28ab1d){return function(_0x2213ca){_0x28ab1d[_0x7020('0x1')](_0x1a481c,_0x2213ca);};}function removeListener(_0x2e62fd,_0x25174b){return function(){ChatMessageEvents[_0x7020('0x2')](_0x2e62fd,_0x25174b);};}exports['register']=function(_0x5074d7){for(var _0x38c320=0x0,_0x39263c=events[_0x7020('0x3')];_0x38c320<_0x39263c;_0x38c320++){var _0x17deac=events[_0x38c320];var _0x42bc79=createListener(_0x7020('0x4')+_0x17deac,_0x5074d7);ChatMessageEvents['on'](_0x17deac,_0x42bc79);}};
\ No newline at end of file
+var _0xa63f=['./chatMessage.events','save','remove','update','emit','length'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa63f,0x1b6));var _0xfa63=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xa63f[_0x4ff09b];return _0x3f5c2e;};'use strict';var ChatMessageEvents=require(_0xfa63('0x0'));var events=[_0xfa63('0x1'),_0xfa63('0x2'),_0xfa63('0x3')];function createListener(_0x3103ba,_0x2bbc5a){return function(_0x401dbf){_0x2bbc5a[_0xfa63('0x4')](_0x3103ba,_0x401dbf);};}function removeListener(_0x37e644,_0x138518){return function(){ChatMessageEvents['removeListener'](_0x37e644,_0x138518);};}exports['register']=function(_0x20d4f6){for(var _0x41efce=0x0,_0xb35bc5=events[_0xfa63('0x5')];_0x41efce<_0xb35bc5;_0x41efce++){var _0x486050=events[_0x41efce];var _0x505e1a=createListener('chatMessage:'+_0x486050,_0x20d4f6);ChatMessageEvents['on'](_0x486050,_0x505e1a);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ed95831..1f00b2e 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 _0x2471=['put','update','/:id/accept','/:id/reject','reject','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','tracked','chat','chatmessage:create'];(function(_0x4109d7,_0xc7e23b){var _0x468d71=function(_0x14ad80){while(--_0x14ad80){_0x4109d7['push'](_0x4109d7['shift']());}};_0x468d71(++_0xc7e23b);}(_0x2471,0xde));var _0x1247=function(_0x4087cc,_0x2b2f48){_0x4087cc=_0x4087cc-0x0;var _0x52874a=_0x2471[_0x4087cc];return _0x52874a;};'use strict';var multer=require(_0x1247('0x0'));var util=require(_0x1247('0x1'));var path=require('path');var timeout=require(_0x1247('0x2'));var express=require('express');var router=express[_0x1247('0x3')]();var fs_extra=require(_0x1247('0x4'));var auth=require(_0x1247('0x5'));var interaction=require(_0x1247('0x6'));var config=require(_0x1247('0x7'));var controller=require(_0x1247('0x8'));router['get']('/',auth[_0x1247('0x9')](),controller['index']);router[_0x1247('0xa')](_0x1247('0xb'),auth[_0x1247('0x9')](),controller[_0x1247('0xc')]);router['get'](_0x1247('0xd'),auth[_0x1247('0x9')](),controller[_0x1247('0xe')]);router['post']('/',auth[_0x1247('0x9')](),interaction[_0x1247('0xf')](_0x1247('0x10'),_0x1247('0x11')),controller['create']);router[_0x1247('0x12')]('/:id',controller[_0x1247('0x13')]);router[_0x1247('0x12')](_0x1247('0x14'),auth[_0x1247('0x9')](),controller['accept']);router[_0x1247('0x12')](_0x1247('0x15'),auth[_0x1247('0x9')](),controller[_0x1247('0x16')]);router['delete'](_0x1247('0xd'),auth[_0x1247('0x9')](),controller['destroy']);module[_0x1247('0x17')]=router;
\ No newline at end of file
+var _0xae35=['put','update','/:id/reject','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','describe','show','post','tracked','chat','create'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0xae35,0xd7));var _0x5ae3=function(_0x17a67c,_0x8fa232){_0x17a67c=_0x17a67c-0x0;var _0x1c5c11=_0xae35[_0x17a67c];return _0x1c5c11;};'use strict';var multer=require(_0x5ae3('0x0'));var util=require(_0x5ae3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5ae3('0x2'));var router=express[_0x5ae3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5ae3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ae3('0x5'));var controller=require(_0x5ae3('0x6'));router[_0x5ae3('0x7')]('/',auth[_0x5ae3('0x8')](),controller[_0x5ae3('0x9')]);router[_0x5ae3('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x5ae3('0xa')]);router[_0x5ae3('0x7')]('/:id',auth[_0x5ae3('0x8')](),controller[_0x5ae3('0xb')]);router[_0x5ae3('0xc')]('/',auth[_0x5ae3('0x8')](),interaction[_0x5ae3('0xd')](_0x5ae3('0xe'),'chatmessage:create'),controller[_0x5ae3('0xf')]);router[_0x5ae3('0x10')]('/:id',controller[_0x5ae3('0x11')]);router[_0x5ae3('0x10')]('/:id/accept',auth[_0x5ae3('0x8')](),controller['accept']);router[_0x5ae3('0x10')](_0x5ae3('0x12'),auth[_0x5ae3('0x8')](),controller['reject']);router[_0x5ae3('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5ae3('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 95a18bc..495fb0f 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x1e2373,_0x4aec50){var _0x8efd57=function(_0x54f7dc){while(--_0x54f7dc){_0x1e2373['push'](_0x1e2373['shift']());}};_0x8efd57(++_0x4aec50);}(_0x5f2f,0x73));var _0xf5f2=function(_0x57a402,_0x40596b){_0x57a402=_0x57a402-0x0;var _0x753a36=_0x5f2f[_0x57a402];return _0x753a36;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0x0b0e[_0x3e182f];return _0x23edc9;};'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 c2a41eb..77a5bbd 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(_0x328fa9,_0x2ad630){var _0x32cf6f=function(_0x4602b3){while(--_0x4602b3){_0x328fa9['push'](_0x328fa9['shift']());}};_0x32cf6f(++_0x2ad630);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x24a9c5,_0x34be29){var _0x59422d=function(_0x244090){while(--_0x244090){_0x24a9c5['push'](_0x24a9c5['shift']());}};_0x59422d(++_0x34be29);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 8059830..0e68a1a 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 _0x5153=['remove','emit','exports','events','save','update'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x5153,0x159));var _0x3515=function(_0x3988c7,_0x1dab2f){_0x3988c7=_0x3988c7-0x0;var _0x19d631=_0x5153[_0x3988c7];return _0x19d631;};'use strict';var EventEmitter=require(_0x3515('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3515('0x1'),'afterUpdate':_0x3515('0x2'),'afterDestroy':_0x3515('0x3')};function emitEvent(_0x4a3292){return function(_0xb829be,_0x113fd9,_0x257f85){ChatOfflineMessageEvents['emit'](_0x4a3292+':'+_0xb829be['id'],_0xb829be);ChatOfflineMessageEvents[_0x3515('0x4')](_0x4a3292,_0xb829be);_0x257f85(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x3515('0x5')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x711c=['update','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x337a31,_0xb1bb23){var _0x30b8f2=function(_0x2f1d65){while(--_0x2f1d65){_0x337a31['push'](_0x337a31['shift']());}};_0x30b8f2(++_0xb1bb23);}(_0x711c,0x74));var _0xc711=function(_0x336d06,_0x39bd81){_0x336d06=_0x336d06-0x0;var _0x55984b=_0x711c[_0x336d06];return _0x55984b;};'use strict';var EventEmitter=require(_0xc711('0x0'));var ChatOfflineMessage=require(_0xc711('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xc711('0x2')](0x0);var events={'afterCreate':_0xc711('0x3'),'afterUpdate':_0xc711('0x4'),'afterDestroy':'remove'};function emitEvent(_0x588b21){return function(_0x59c6a8,_0x1294ff,_0x272abd){ChatOfflineMessageEvents[_0xc711('0x5')](_0x588b21+':'+_0x59c6a8['id'],_0x59c6a8);ChatOfflineMessageEvents[_0xc711('0x5')](_0x588b21,_0x59c6a8);_0x272abd(null);};}for(var e in events){if(events[_0xc711('0x6')](e)){var event=events[e];ChatOfflineMessage[_0xc711('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 6e9a6cc..8a2a228 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 _0x9e87=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x9e87,0x14b));var _0x79e8=function(_0x503e25,_0xb8a860){_0x503e25=_0x503e25-0x0;var _0x47c27a=_0x9e87[_0x503e25];return _0x47c27a;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x79e8('0x0')]=function(_0x1facfe){return _0x1facfe['define'](_0x79e8('0x1'),attributes,{'tableName':_0x79e8('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x79e8('0x3')});};
\ No newline at end of file
+var _0xd3d4=['chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x540c61,_0x16f596){var _0x181e21=function(_0x158b4b){while(--_0x158b4b){_0x540c61['push'](_0x540c61['shift']());}};_0x181e21(++_0x16f596);}(_0xd3d4,0x188));var _0x4d3d=function(_0x30839a,_0x6cd6f4){_0x30839a=_0x30839a-0x0;var _0x21ab5b=_0xd3d4[_0x30839a];return _0x21ab5b;};'use strict';var attributes=require(_0x4d3d('0x0'));module[_0x4d3d('0x1')]=function(_0x17c5ab){return _0x17c5ab[_0x4d3d('0x2')](_0x4d3d('0x3'),attributes,{'tableName':_0x4d3d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4d3d('0x5')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 0f9a535..05b3629 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 _0x6922=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x59ee91,_0x5ca1ef){var _0x51b0b7=function(_0x55517f){while(--_0x55517f){_0x59ee91['push'](_0x59ee91['shift']());}};_0x51b0b7(++_0x5ca1ef);}(_0x6922,0x169));var _0x2692=function(_0x326a25,_0x15c086){_0x326a25=_0x326a25-0x0;var _0xe38041=_0x6922[_0x326a25];return _0xe38041;};'use strict';var _=require(_0x2692('0x0'));var util=require(_0x2692('0x1'));var moment=require(_0x2692('0x2'));var BPromise=require('bluebird');var rs=require(_0x2692('0x3'));var fs=require('fs');var Redis=require(_0x2692('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2692('0x5'));var logger=require('../../config/logger')(_0x2692('0x6'));var config=require(_0x2692('0x7'));var jayson=require(_0x2692('0x8'));var client=jayson[_0x2692('0x9')][_0x2692('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x537d30,_0xe04f91,_0x48be8b){return new BPromise(function(_0x2726b7,_0x510bff){return client[_0x2692('0xb')](_0x537d30,_0x48be8b)['then'](function(_0x560248){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xe04f91,'request\x20sent');logger[_0x2692('0xc')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xe04f91,_0x2692('0xd'),JSON[_0x2692('0xe')](_0x560248));if(_0x560248[_0x2692('0xf')]){if(_0x560248[_0x2692('0xf')]['code']===0x1f4){logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x560248[_0x2692('0xf')][_0x2692('0x11')]);return _0x510bff(_0x560248[_0x2692('0xf')][_0x2692('0x11')]);}logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x560248[_0x2692('0xf')][_0x2692('0x11')]);return _0x2726b7(_0x560248['error'][_0x2692('0x11')]);}else{logger[_0x2692('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0xe04f91,_0x2692('0xd'));_0x2726b7(_0x560248[_0x2692('0x13')][_0x2692('0x11')]);}})[_0x2692('0x14')](function(_0x5b1b0e){logger[_0x2692('0xf')](_0x2692('0x10'),_0xe04f91,_0x5b1b0e);_0x510bff(_0x5b1b0e);});});}
\ No newline at end of file
+var _0xfe43=['../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3205dd,_0x147e2c){var _0x4fb353=function(_0x196998){while(--_0x196998){_0x3205dd['push'](_0x3205dd['shift']());}};_0x4fb353(++_0x147e2c);}(_0xfe43,0x120));var _0x3fe4=function(_0x196bc1,_0x38b037){_0x196bc1=_0x196bc1-0x0;var _0x35a231=_0xfe43[_0x196bc1];return _0x35a231;};'use strict';var _=require(_0x3fe4('0x0'));var util=require('util');var moment=require(_0x3fe4('0x1'));var BPromise=require(_0x3fe4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fe4('0x3'));var db=require(_0x3fe4('0x4'))['db'];var utils=require(_0x3fe4('0x5'));var logger=require(_0x3fe4('0x6'))('rpc');var config=require(_0x3fe4('0x7'));var jayson=require(_0x3fe4('0x8'));var client=jayson['client'][_0x3fe4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15dc3c,_0x53413b,_0x1311ec){return new BPromise(function(_0x36027e,_0x2aa775){return client['request'](_0x15dc3c,_0x1311ec)[_0x3fe4('0xa')](function(_0x5ace2f){logger[_0x3fe4('0xb')](_0x3fe4('0xc'),_0x53413b,_0x3fe4('0xd'));logger[_0x3fe4('0xe')](_0x3fe4('0xf'),_0x53413b,_0x3fe4('0xd'),JSON[_0x3fe4('0x10')](_0x5ace2f));if(_0x5ace2f[_0x3fe4('0x11')]){if(_0x5ace2f['error'][_0x3fe4('0x12')]===0x1f4){logger['error'](_0x3fe4('0xc'),_0x53413b,_0x5ace2f[_0x3fe4('0x11')][_0x3fe4('0x13')]);return _0x2aa775(_0x5ace2f['error'][_0x3fe4('0x13')]);}logger['error'](_0x3fe4('0xc'),_0x53413b,_0x5ace2f[_0x3fe4('0x11')][_0x3fe4('0x13')]);return _0x36027e(_0x5ace2f[_0x3fe4('0x11')][_0x3fe4('0x13')]);}else{logger[_0x3fe4('0xb')](_0x3fe4('0xc'),_0x53413b,_0x3fe4('0xd'));_0x36027e(_0x5ace2f[_0x3fe4('0x14')][_0x3fe4('0x13')]);}})['catch'](function(_0x15017e){logger[_0x3fe4('0x11')](_0x3fe4('0xc'),_0x53413b,_0x15017e);_0x2aa775(_0x15017e);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index d5130f3..67090ec 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 _0x0070=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0xf02b64,_0x5e76fc){var _0x334b5f=function(_0x1e9650){while(--_0x1e9650){_0xf02b64['push'](_0xf02b64['shift']());}};_0x334b5f(++_0x5e76fc);}(_0x0070,0xb4));var _0x0007=function(_0x505b1,_0x3f2a5d){_0x505b1=_0x505b1-0x0;var _0x6f5380=_0x0070[_0x505b1];return _0x6f5380;};'use strict';var multer=require(_0x0007('0x0'));var util=require(_0x0007('0x1'));var path=require(_0x0007('0x2'));var timeout=require(_0x0007('0x3'));var express=require(_0x0007('0x4'));var router=express[_0x0007('0x5')]();var fs_extra=require(_0x0007('0x6'));var auth=require(_0x0007('0x7'));var interaction=require(_0x0007('0x8'));var config=require(_0x0007('0x9'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x0007('0xa')](),controller[_0x0007('0xb')]);router[_0x0007('0xc')]('/describe',auth[_0x0007('0xa')](),controller['describe']);router['get'](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0xe')]);router[_0x0007('0xf')]('/',auth[_0x0007('0xa')](),controller[_0x0007('0x10')]);router[_0x0007('0x11')](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0x12')]);router[_0x0007('0x13')](_0x0007('0xd'),auth[_0x0007('0xa')](),controller[_0x0007('0x14')]);module[_0x0007('0x15')]=router;
\ No newline at end of file
+var _0xdc77=['delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x30d7bd,_0x521a33){var _0x4bd842=function(_0x3fa21e){while(--_0x3fa21e){_0x30d7bd['push'](_0x30d7bd['shift']());}};_0x4bd842(++_0x521a33);}(_0xdc77,0x1cf));var _0x7dc7=function(_0x1f8591,_0x5396ac){_0x1f8591=_0x1f8591-0x0;var _0x50f0ce=_0xdc77[_0x1f8591];return _0x50f0ce;};'use strict';var multer=require(_0x7dc7('0x0'));var util=require('util');var path=require(_0x7dc7('0x1'));var timeout=require(_0x7dc7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7dc7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7dc7('0x4'));var config=require(_0x7dc7('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x7dc7('0x6')]('/',auth['isAuthenticated'](),controller[_0x7dc7('0x7')]);router['get'](_0x7dc7('0x8'),auth[_0x7dc7('0x9')](),controller[_0x7dc7('0xa')]);router[_0x7dc7('0x6')](_0x7dc7('0xb'),auth[_0x7dc7('0x9')](),controller[_0x7dc7('0xc')]);router[_0x7dc7('0xd')]('/',auth[_0x7dc7('0x9')](),controller[_0x7dc7('0xe')]);router[_0x7dc7('0xf')](_0x7dc7('0xb'),auth[_0x7dc7('0x9')](),controller[_0x7dc7('0x10')]);router[_0x7dc7('0x11')](_0x7dc7('0xb'),auth[_0x7dc7('0x9')](),controller[_0x7dc7('0x12')]);module[_0x7dc7('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 5a8b23b..389925b 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 _0x30a1=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x30a1,0x1bd));var _0x130a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x30a1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x130a('0x0'));module[_0x130a('0x1')]={'name':{'type':Sequelize[_0x130a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x130a('0x3'),_0x130a('0x4')),'defaultValue':_0x130a('0x3')},'selector':{'type':Sequelize[_0x130a('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x3526=['mouseOver','sequelize','exports','STRING','ENUM','timeout'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0x3526,0x16f));var _0x6352=function(_0x202965,_0xebb2c4){_0x202965=_0x202965-0x0;var _0x1c105d=_0x3526[_0x202965];return _0x1c105d;};'use strict';var Sequelize=require(_0x6352('0x0'));module[_0x6352('0x1')]={'name':{'type':Sequelize[_0x6352('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6352('0x3')]('mouseOver',_0x6352('0x4')),'defaultValue':_0x6352('0x5')},'selector':{'type':Sequelize[_0x6352('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index f391dea..66f6b64 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 _0x3351=['attributes','length','include','options','find','create','body','catch','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','reject','save','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','fields'];(function(_0x5983c7,_0x415ba8){var _0x555815=function(_0x193cc2){while(--_0x193cc2){_0x5983c7['push'](_0x5983c7['shift']());}};_0x555815(++_0x415ba8);}(_0x3351,0x1b4));var _0x1335=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x3351[_0x1ddedd];return _0xa3e1ac;};'use strict';var emlformat=require(_0x1335('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1335('0x1'));var rp=require(_0x1335('0x2'));var moment=require(_0x1335('0x3'));var BPromise=require(_0x1335('0x4'));var Mustache=require(_0x1335('0x5'));var util=require(_0x1335('0x6'));var path=require(_0x1335('0x7'));var sox=require('sox');var csv=require(_0x1335('0x8'));var ejs=require(_0x1335('0x9'));var fs=require('fs');var fs_extra=require(_0x1335('0xa'));var _=require(_0x1335('0xb'));var squel=require(_0x1335('0xc'));var crypto=require(_0x1335('0xd'));var jsforce=require(_0x1335('0xe'));var deskjs=require(_0x1335('0xf'));var toCsv=require(_0x1335('0x8'));var querystring=require(_0x1335('0x10'));var Papa=require(_0x1335('0x11'));var Redis=require('ioredis');var authService=require(_0x1335('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1335('0x13'));var hardwareService=require(_0x1335('0x14'));var logger=require(_0x1335('0x15'))(_0x1335('0x16'));var utils=require(_0x1335('0x17'));var config=require(_0x1335('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1335('0x19'))['db'];function respondWithStatusCode(_0x55a85e,_0x425cd8){_0x425cd8=_0x425cd8||0xcc;return function(_0x5699f4){if(_0x5699f4){return _0x55a85e[_0x1335('0x1a')](_0x425cd8);}return _0x55a85e['status'](_0x425cd8)[_0x1335('0x1b')]();};}function respondWithResult(_0x4c8964,_0x4f9625){_0x4f9625=_0x4f9625||0xc8;return function(_0xc333ce){if(_0xc333ce){return _0x4c8964[_0x1335('0x1c')](_0x4f9625)['json'](_0xc333ce);}};}function respondWithFilteredResult(_0x5ee59d,_0x3bd6b0){return function(_0x565686){if(_0x565686){var _0x431433=typeof _0x3bd6b0[_0x1335('0x1d')]===_0x1335('0x1e')&&typeof _0x3bd6b0['limit']===_0x1335('0x1e');var _0x4da3b8=_0x565686[_0x1335('0x1f')];var _0x4d5b17=_0x431433?0x0:_0x3bd6b0[_0x1335('0x1d')];var _0x36123c=_0x431433?_0x565686[_0x1335('0x1f')]:_0x3bd6b0['offset']+_0x3bd6b0[_0x1335('0x20')];var _0xbebdea;if(_0x36123c>=_0x4da3b8){_0x36123c=_0x4da3b8;_0xbebdea=0xc8;}else{_0xbebdea=0xce;}_0x5ee59d[_0x1335('0x1c')](_0xbebdea);return _0x5ee59d[_0x1335('0x21')]('Content-Range',_0x4d5b17+'-'+_0x36123c+'/'+_0x4da3b8)[_0x1335('0x22')](_0x565686);}return null;};}function patchUpdates(_0x4ae091){return function(_0x5c10d3){try{jsonpatch['apply'](_0x5c10d3,_0x4ae091,!![]);}catch(_0x12e01b){return BPromise[_0x1335('0x23')](_0x12e01b);}return _0x5c10d3[_0x1335('0x24')]();};}function saveUpdates(_0x5c4c24,_0x4c01c9){return function(_0x25aacb){if(_0x25aacb){return _0x25aacb['update'](_0x5c4c24)[_0x1335('0x25')](function(_0x47eaa7){return _0x47eaa7;});}return null;};}function removeEntity(_0x35432b,_0x1c13a8){return function(_0x383d19){if(_0x383d19){return _0x383d19[_0x1335('0x26')]()[_0x1335('0x25')](function(){_0x35432b[_0x1335('0x1c')](0xcc)[_0x1335('0x1b')]();});}};}function handleEntityNotFound(_0x48a0f9,_0x37efee){return function(_0x26ba20){if(!_0x26ba20){_0x48a0f9[_0x1335('0x1a')](0x194);}return _0x26ba20;};}function handleError(_0x1e0019,_0x4cf375){_0x4cf375=_0x4cf375||0x1f4;return function(_0x1498e6){logger[_0x1335('0x27')](_0x1498e6[_0x1335('0x28')]);if(_0x1498e6[_0x1335('0x29')]){delete _0x1498e6[_0x1335('0x29')];}_0x1e0019[_0x1335('0x1c')](_0x4cf375)[_0x1335('0x2a')](_0x1498e6);};}exports[_0x1335('0x2b')]=function(_0x23b5cc,_0xdc07ab){var _0x233298={'raw':!![],'where':{'id':_0x23b5cc['params']['id']}},_0x19950c={};_0x19950c[_0x1335('0x2c')]=_['keys'](db[_0x1335('0x2d')][_0x1335('0x2e')]);_0x19950c[_0x1335('0x2f')]=_[_0x1335('0x30')](_0x23b5cc['query']);_0x19950c[_0x1335('0x31')]=_[_0x1335('0x32')](_0x19950c[_0x1335('0x2c')],_0x19950c[_0x1335('0x2f')]);_0x233298['attributes']=_[_0x1335('0x32')](_0x19950c[_0x1335('0x2c')],qs[_0x1335('0x33')](_0x23b5cc[_0x1335('0x2f')][_0x1335('0x33')]));_0x233298[_0x1335('0x34')]=_0x233298['attributes'][_0x1335('0x35')]?_0x233298[_0x1335('0x34')]:_0x19950c[_0x1335('0x2c')];if(_0x23b5cc[_0x1335('0x2f')]['includeAll']){_0x233298[_0x1335('0x36')]=[{'all':!![]}];}_0x233298=_['merge']({},_0x233298,_0x23b5cc[_0x1335('0x37')]);return db['ChatProactiveAction'][_0x1335('0x38')](_0x233298)[_0x1335('0x25')](handleEntityNotFound(_0xdc07ab,null))[_0x1335('0x25')](respondWithResult(_0xdc07ab,null))['catch'](handleError(_0xdc07ab,null));};exports[_0x1335('0x39')]=function(_0x5f311e,_0x3b82be){return db[_0x1335('0x2d')][_0x1335('0x39')](_0x5f311e[_0x1335('0x3a')],{})[_0x1335('0x25')](respondWithResult(_0x3b82be,0xc9))[_0x1335('0x3b')](handleError(_0x3b82be,null));};exports['update']=function(_0x31be79,_0x213815){if(_0x31be79[_0x1335('0x3a')]['id']){delete _0x31be79['body']['id'];}return db[_0x1335('0x2d')]['find']({'where':{'id':_0x31be79[_0x1335('0x3c')]['id']}})['then'](handleEntityNotFound(_0x213815,null))[_0x1335('0x25')](saveUpdates(_0x31be79[_0x1335('0x3a')],null))['then'](respondWithResult(_0x213815,null))[_0x1335('0x3b')](handleError(_0x213815,null));};exports[_0x1335('0x26')]=function(_0x524252,_0x21f5bb){return db[_0x1335('0x2d')][_0x1335('0x38')]({'where':{'id':_0x524252[_0x1335('0x3c')]['id']}})['then'](handleEntityNotFound(_0x21f5bb,null))[_0x1335('0x25')](removeEntity(_0x21f5bb,null))[_0x1335('0x3b')](handleError(_0x21f5bb,null));};
\ No newline at end of file
+var _0x2b83=['path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','include','merge','options','find','catch','create','body','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x5d784f,_0x2d352c){var _0x2e0f32=function(_0x1b66f5){while(--_0x1b66f5){_0x5d784f['push'](_0x5d784f['shift']());}};_0x2e0f32(++_0x2d352c);}(_0x2b83,0x1d3));var _0x32b8=function(_0x260391,_0x2eda13){_0x260391=_0x260391-0x0;var _0x30abef=_0x2b83[_0x260391];return _0x30abef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32b8('0x0'));var zipdir=require(_0x32b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b8('0x2'));var moment=require(_0x32b8('0x3'));var BPromise=require(_0x32b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x32b8('0x5'));var sox=require(_0x32b8('0x6'));var csv=require('to-csv');var ejs=require(_0x32b8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32b8('0x8'));var squel=require(_0x32b8('0x9'));var crypto=require(_0x32b8('0xa'));var jsforce=require(_0x32b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x32b8('0xc'));var querystring=require(_0x32b8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x32b8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x32b8('0xf'));var hardwareService=require(_0x32b8('0x10'));var logger=require(_0x32b8('0x11'))(_0x32b8('0x12'));var utils=require('../../config/utils');var config=require(_0x32b8('0x13'));var licenseUtil=require(_0x32b8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49c337,_0x30d00a){_0x30d00a=_0x30d00a||0xcc;return function(_0x5a0ef2){if(_0x5a0ef2){return _0x49c337[_0x32b8('0x15')](_0x30d00a);}return _0x49c337['status'](_0x30d00a)[_0x32b8('0x16')]();};}function respondWithResult(_0x6b533e,_0x3b0fac){_0x3b0fac=_0x3b0fac||0xc8;return function(_0xdf56fb){if(_0xdf56fb){return _0x6b533e[_0x32b8('0x17')](_0x3b0fac)['json'](_0xdf56fb);}};}function respondWithFilteredResult(_0x4c8fc9,_0x5e7b4f){return function(_0x5e49d1){if(_0x5e49d1){var _0x4e0d7a=typeof _0x5e7b4f['offset']===_0x32b8('0x18')&&typeof _0x5e7b4f['limit']==='undefined';var _0x2828fc=_0x5e49d1[_0x32b8('0x19')];var _0x2ba4eb=_0x4e0d7a?0x0:_0x5e7b4f[_0x32b8('0x1a')];var _0x599bc3=_0x4e0d7a?_0x5e49d1['count']:_0x5e7b4f['offset']+_0x5e7b4f[_0x32b8('0x1b')];var _0x2ffea2;if(_0x599bc3>=_0x2828fc){_0x599bc3=_0x2828fc;_0x2ffea2=0xc8;}else{_0x2ffea2=0xce;}_0x4c8fc9[_0x32b8('0x17')](_0x2ffea2);return _0x4c8fc9[_0x32b8('0x1c')]('Content-Range',_0x2ba4eb+'-'+_0x599bc3+'/'+_0x2828fc)[_0x32b8('0x1d')](_0x5e49d1);}return null;};}function patchUpdates(_0x3ddc5f){return function(_0xb51551){try{jsonpatch[_0x32b8('0x1e')](_0xb51551,_0x3ddc5f,!![]);}catch(_0xb9dd1d){return BPromise[_0x32b8('0x1f')](_0xb9dd1d);}return _0xb51551[_0x32b8('0x20')]();};}function saveUpdates(_0xcd4b26,_0x52347c){return function(_0x567055){if(_0x567055){return _0x567055[_0x32b8('0x21')](_0xcd4b26)['then'](function(_0x1ec58d){return _0x1ec58d;});}return null;};}function removeEntity(_0x4bc4a8,_0x1a4c2b){return function(_0x21ee32){if(_0x21ee32){return _0x21ee32[_0x32b8('0x22')]()[_0x32b8('0x23')](function(){_0x4bc4a8[_0x32b8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1360,_0x25a917){return function(_0x3eea54){if(!_0x3eea54){_0x4e1360[_0x32b8('0x15')](0x194);}return _0x3eea54;};}function handleError(_0x23e195,_0x29988d){_0x29988d=_0x29988d||0x1f4;return function(_0x57a6a3){logger[_0x32b8('0x24')](_0x57a6a3[_0x32b8('0x25')]);if(_0x57a6a3[_0x32b8('0x26')]){delete _0x57a6a3[_0x32b8('0x26')];}_0x23e195[_0x32b8('0x17')](_0x29988d)[_0x32b8('0x27')](_0x57a6a3);};}exports[_0x32b8('0x28')]=function(_0x39ce15,_0x3fa029){var _0xa225ec={'raw':!![],'where':{'id':_0x39ce15[_0x32b8('0x29')]['id']}},_0x3e0548={};_0x3e0548[_0x32b8('0x2a')]=_['keys'](db[_0x32b8('0x2b')][_0x32b8('0x2c')]);_0x3e0548[_0x32b8('0x2d')]=_[_0x32b8('0x2e')](_0x39ce15[_0x32b8('0x2d')]);_0x3e0548[_0x32b8('0x2f')]=_[_0x32b8('0x30')](_0x3e0548[_0x32b8('0x2a')],_0x3e0548[_0x32b8('0x2d')]);_0xa225ec[_0x32b8('0x31')]=_['intersection'](_0x3e0548[_0x32b8('0x2a')],qs[_0x32b8('0x32')](_0x39ce15[_0x32b8('0x2d')][_0x32b8('0x32')]));_0xa225ec['attributes']=_0xa225ec['attributes'][_0x32b8('0x33')]?_0xa225ec[_0x32b8('0x31')]:_0x3e0548[_0x32b8('0x2a')];if(_0x39ce15[_0x32b8('0x2d')]['includeAll']){_0xa225ec[_0x32b8('0x34')]=[{'all':!![]}];}_0xa225ec=_[_0x32b8('0x35')]({},_0xa225ec,_0x39ce15[_0x32b8('0x36')]);return db[_0x32b8('0x2b')][_0x32b8('0x37')](_0xa225ec)[_0x32b8('0x23')](handleEntityNotFound(_0x3fa029,null))[_0x32b8('0x23')](respondWithResult(_0x3fa029,null))[_0x32b8('0x38')](handleError(_0x3fa029,null));};exports['create']=function(_0x10f17e,_0x5e8af2){return db[_0x32b8('0x2b')][_0x32b8('0x39')](_0x10f17e[_0x32b8('0x3a')],{})[_0x32b8('0x23')](respondWithResult(_0x5e8af2,0xc9))[_0x32b8('0x38')](handleError(_0x5e8af2,null));};exports[_0x32b8('0x21')]=function(_0x4c9ab0,_0x152209){if(_0x4c9ab0[_0x32b8('0x3a')]['id']){delete _0x4c9ab0[_0x32b8('0x3a')]['id'];}return db['ChatProactiveAction'][_0x32b8('0x37')]({'where':{'id':_0x4c9ab0['params']['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x152209,null))[_0x32b8('0x23')](saveUpdates(_0x4c9ab0[_0x32b8('0x3a')],null))[_0x32b8('0x23')](respondWithResult(_0x152209,null))['catch'](handleError(_0x152209,null));};exports[_0x32b8('0x22')]=function(_0x10ccf5,_0x2d586f){return db['ChatProactiveAction']['find']({'where':{'id':_0x10ccf5[_0x32b8('0x29')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x2d586f,null))[_0x32b8('0x23')](removeEntity(_0x2d586f,null))['catch'](handleError(_0x2d586f,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2ced68b..0f42f60 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 _0x63cd=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','lodash','util'];(function(_0x546e3b,_0x1d6b2b){var _0x331189=function(_0x1458ca){while(--_0x1458ca){_0x546e3b['push'](_0x546e3b['shift']());}};_0x331189(++_0x1d6b2b);}(_0x63cd,0x166));var _0xd63c=function(_0x8ebbc2,_0xab414a){_0x8ebbc2=_0x8ebbc2-0x0;var _0x2fc072=_0x63cd[_0x8ebbc2];return _0x2fc072;};'use strict';var _=require(_0xd63c('0x0'));var util=require(_0xd63c('0x1'));var logger=require(_0xd63c('0x2'))(_0xd63c('0x3'));var moment=require(_0xd63c('0x4'));var BPromise=require(_0xd63c('0x5'));var rp=require(_0xd63c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd63c('0x7'));var config=require(_0xd63c('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xd63c('0x9')]=function(_0x976082,_0x4005c0){return _0x976082['define']('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb946=['../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','moment','bluebird','request-promise'];(function(_0x13cab0,_0x14d825){var _0x38804f=function(_0x1bffaf){while(--_0x1bffaf){_0x13cab0['push'](_0x13cab0['shift']());}};_0x38804f(++_0x14d825);}(_0xb946,0xd7));var _0x6b94=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xb946[_0x28d18d];return _0x470640;};'use strict';var _=require(_0x6b94('0x0'));var util=require(_0x6b94('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b94('0x2'));var BPromise=require(_0x6b94('0x3'));var rp=require(_0x6b94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b94('0x5'));var attributes=require(_0x6b94('0x6'));module[_0x6b94('0x7')]=function(_0x57880e,_0x58372b){return _0x57880e[_0x6b94('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x6b94('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 ab5aba6..28d3426 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 _0x4012=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment'];(function(_0x516738,_0x1e0210){var _0x5f5d4d=function(_0x5a061e){while(--_0x5a061e){_0x516738['push'](_0x516738['shift']());}};_0x5f5d4d(++_0x1e0210);}(_0x4012,0xd6));var _0x2401=function(_0x130c86,_0x18bb4e){_0x130c86=_0x130c86-0x0;var _0x4f673d=_0x4012[_0x130c86];return _0x4f673d;};'use strict';var _=require(_0x2401('0x0'));var util=require('util');var moment=require(_0x2401('0x1'));var BPromise=require(_0x2401('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2401('0x3'));var db=require(_0x2401('0x4'))['db'];var utils=require(_0x2401('0x5'));var logger=require(_0x2401('0x6'))(_0x2401('0x7'));var config=require(_0x2401('0x8'));var jayson=require(_0x2401('0x9'));var client=jayson[_0x2401('0xa')][_0x2401('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x85f35f,_0x184814,_0x245b35){return new BPromise(function(_0x267711,_0x1fb21f){return client[_0x2401('0xc')](_0x85f35f,_0x245b35)[_0x2401('0xd')](function(_0x4e621c){logger['info'](_0x2401('0xe'),_0x184814,'request\x20sent');logger['debug'](_0x2401('0xf'),_0x184814,_0x2401('0x10'),JSON[_0x2401('0x11')](_0x4e621c));if(_0x4e621c[_0x2401('0x12')]){if(_0x4e621c[_0x2401('0x12')][_0x2401('0x13')]===0x1f4){logger[_0x2401('0x12')](_0x2401('0xe'),_0x184814,_0x4e621c[_0x2401('0x12')]['message']);return _0x1fb21f(_0x4e621c[_0x2401('0x12')][_0x2401('0x14')]);}logger[_0x2401('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x4e621c[_0x2401('0x12')]['message']);return _0x267711(_0x4e621c[_0x2401('0x12')][_0x2401('0x14')]);}else{logger[_0x2401('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x2401('0x10'));_0x267711(_0x4e621c[_0x2401('0x16')][_0x2401('0x14')]);}})[_0x2401('0x17')](function(_0x2fcca1){logger[_0x2401('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x184814,_0x2fcca1);_0x1fb21f(_0x2fcca1);});});}
\ No newline at end of file
+var _0x7a43=['../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x1a9cec,_0x3bf353){var _0x2fa7ef=function(_0x20cc8a){while(--_0x20cc8a){_0x1a9cec['push'](_0x1a9cec['shift']());}};_0x2fa7ef(++_0x3bf353);}(_0x7a43,0x18a));var _0x37a4=function(_0x12fff4,_0x1be32d){_0x12fff4=_0x12fff4-0x0;var _0x5b155a=_0x7a43[_0x12fff4];return _0x5b155a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x37a4('0x0'));var BPromise=require(_0x37a4('0x1'));var rs=require(_0x37a4('0x2'));var fs=require('fs');var Redis=require(_0x37a4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x37a4('0x4'))(_0x37a4('0x5'));var config=require(_0x37a4('0x6'));var jayson=require(_0x37a4('0x7'));var client=jayson['client'][_0x37a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45b055,_0x4481b4,_0xc1e2ee){return new BPromise(function(_0x56aeb5,_0x389b73){return client['request'](_0x45b055,_0xc1e2ee)[_0x37a4('0x9')](function(_0xb36395){logger[_0x37a4('0xa')](_0x37a4('0xb'),_0x4481b4,_0x37a4('0xc'));logger[_0x37a4('0xd')](_0x37a4('0xe'),_0x4481b4,_0x37a4('0xc'),JSON['stringify'](_0xb36395));if(_0xb36395[_0x37a4('0xf')]){if(_0xb36395[_0x37a4('0xf')][_0x37a4('0x10')]===0x1f4){logger['error'](_0x37a4('0xb'),_0x4481b4,_0xb36395[_0x37a4('0xf')][_0x37a4('0x11')]);return _0x389b73(_0xb36395['error'][_0x37a4('0x11')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x4481b4,_0xb36395[_0x37a4('0xf')][_0x37a4('0x11')]);return _0x56aeb5(_0xb36395[_0x37a4('0xf')]['message']);}else{logger[_0x37a4('0xa')](_0x37a4('0xb'),_0x4481b4,'request\x20sent');_0x56aeb5(_0xb36395[_0x37a4('0x12')][_0x37a4('0x11')]);}})[_0x37a4('0x13')](function(_0x24fa87){logger[_0x37a4('0xf')](_0x37a4('0xb'),_0x4481b4,_0x24fa87);_0x389b73(_0x24fa87);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index a28ad93..1a2b37b 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 _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x2bd8,0x130));var _0x82bd=function(_0x3c4c6a,_0x5802dc){_0x3c4c6a=_0x3c4c6a-0x0;var _0x123872=_0x2bd8[_0x3c4c6a];return _0x123872;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router;
\ No newline at end of file
+var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4840f9,_0x734785){_0x4840f9=_0x4840f9-0x0;var _0x4856ff=_0xb4c7[_0x4840f9];return _0x4856ff;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 0f15505..246348e 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 _0x9dd0=['ENUM','beepall','exports','STRING','INTEGER'];(function(_0x208c57,_0x3182e5){var _0x1dda31=function(_0x49e35c){while(--_0x49e35c){_0x208c57['push'](_0x208c57['shift']());}};_0x1dda31(++_0x3182e5);}(_0x9dd0,0x7f));var _0x09dd=function(_0x23c31d,_0x2e8382){_0x23c31d=_0x23c31d-0x0;var _0x4c8e11=_0x9dd0[_0x23c31d];return _0x4c8e11;};'use strict';var Sequelize=require('sequelize');module[_0x09dd('0x0')]={'name':{'type':Sequelize[_0x09dd('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x09dd('0x1')]},'timeout':{'type':Sequelize[_0x09dd('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x09dd('0x3')]('rrmemory',_0x09dd('0x4'),'roundrobin')}};
\ No newline at end of file
+var _0x85c9=['rrmemory','roundrobin','sequelize','exports','name','STRING'];(function(_0x1763ac,_0x17cb2f){var _0x1c55a9=function(_0x5ed9e4){while(--_0x5ed9e4){_0x1763ac['push'](_0x1763ac['shift']());}};_0x1c55a9(++_0x17cb2f);}(_0x85c9,0x8c));var _0x985c=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x85c9[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0x985c('0x0'));module[_0x985c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x985c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x985c('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x985c('0x4'),'beepall',_0x985c('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index b57cae4..3094ea8 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 _0x1fa3=['role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','ChatQueueId','options','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserChatQueue','findOrCreate','emit','userChatQueue:save','Team','findAll','field','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeTeams','ids','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','status','undefined','limit','count','offset','Content-Range','json','reject','update','get','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ChatQueue','includeAll','include','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xa1cdd9,_0x32bc4b){var _0x82f482=function(_0x5e265c){while(--_0x5e265c){_0xa1cdd9['push'](_0xa1cdd9['shift']());}};_0x82f482(++_0x32bc4b);}(_0x1fa3,0xcf));var _0x31fa=function(_0x5c41cb,_0x330705){_0x5c41cb=_0x5c41cb-0x0;var _0x49db41=_0x1fa3[_0x5c41cb];return _0x49db41;};'use strict';var emlformat=require(_0x31fa('0x0'));var rimraf=require(_0x31fa('0x1'));var zipdir=require(_0x31fa('0x2'));var jsonpatch=require(_0x31fa('0x3'));var rp=require(_0x31fa('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x31fa('0x5'));var csv=require(_0x31fa('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31fa('0x7'));var _=require(_0x31fa('0x8'));var squel=require(_0x31fa('0x9'));var crypto=require('crypto');var jsforce=require(_0x31fa('0xa'));var deskjs=require(_0x31fa('0xb'));var toCsv=require(_0x31fa('0x6'));var querystring=require(_0x31fa('0xc'));var Papa=require(_0x31fa('0xd'));var Redis=require(_0x31fa('0xe'));var authService=require(_0x31fa('0xf'));var qs=require(_0x31fa('0x10'));var as=require(_0x31fa('0x11'));var hardwareService=require(_0x31fa('0x12'));var logger=require(_0x31fa('0x13'))('api');var utils=require(_0x31fa('0x14'));var config=require(_0x31fa('0x15'));var licenseUtil=require(_0x31fa('0x16'));var db=require(_0x31fa('0x17'))['db'];config[_0x31fa('0x18')]=_[_0x31fa('0x19')](config[_0x31fa('0x18')],{'host':_0x31fa('0x1a'),'port':0x18eb});var socket=require(_0x31fa('0x1b'))(new Redis(config[_0x31fa('0x18')]));require('./chatQueue.socket')['register'](socket);var jayson=require(_0x31fa('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x401e98,_0x437c87,_0x446b0f,_0x5d3e2f){return new BPromise(function(_0x185f94,_0x51baf2){var _0x16205d=_0x5d3e2f||client;return _0x16205d['request'](_0x401e98,_0x446b0f)[_0x31fa('0x1d')](function(_0x49d4a0){logger[_0x31fa('0x1e')](_0x31fa('0x1f'),_0x437c87,'request\x20sent');logger[_0x31fa('0x20')](_0x31fa('0x21'),_0x437c87,'request\x20sent',JSON[_0x31fa('0x22')](_0x49d4a0));if(_0x49d4a0['error']){if(_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x24')]===0x1f4){logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x25')]);return _0x51baf2(_0x49d4a0[_0x31fa('0x23')][_0x31fa('0x25')]);}logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x49d4a0['error'][_0x31fa('0x25')]);return _0x185f94(_0x49d4a0[_0x31fa('0x23')]['message']);}else{logger[_0x31fa('0x1e')](_0x31fa('0x1f'),_0x437c87,_0x31fa('0x26'));_0x185f94(_0x49d4a0['result'][_0x31fa('0x25')]);}})[_0x31fa('0x27')](function(_0x510825){logger[_0x31fa('0x23')](_0x31fa('0x1f'),_0x437c87,_0x510825);_0x51baf2(_0x510825);});});}function respondWithStatusCode(_0x2d3c06,_0xd4837){_0xd4837=_0xd4837||0xcc;return function(_0x1b4950){if(_0x1b4950){return _0x2d3c06['sendStatus'](_0xd4837);}return _0x2d3c06[_0x31fa('0x28')](_0xd4837)['end']();};}function respondWithResult(_0x366bc0,_0x1f45db){_0x1f45db=_0x1f45db||0xc8;return function(_0x58b166){if(_0x58b166){return _0x366bc0[_0x31fa('0x28')](_0x1f45db)['json'](_0x58b166);}};}function respondWithFilteredResult(_0xac980c,_0x29fea9){return function(_0x4f2c8e){if(_0x4f2c8e){var _0xa35143=typeof _0x29fea9['offset']===_0x31fa('0x29')&&typeof _0x29fea9[_0x31fa('0x2a')]===_0x31fa('0x29');var _0x1dea52=_0x4f2c8e[_0x31fa('0x2b')];var _0x4bac6b=_0xa35143?0x0:_0x29fea9[_0x31fa('0x2c')];var _0x48db78=_0xa35143?_0x4f2c8e['count']:_0x29fea9[_0x31fa('0x2c')]+_0x29fea9[_0x31fa('0x2a')];var _0x54359e;if(_0x48db78>=_0x1dea52){_0x48db78=_0x1dea52;_0x54359e=0xc8;}else{_0x54359e=0xce;}_0xac980c[_0x31fa('0x28')](_0x54359e);return _0xac980c['set'](_0x31fa('0x2d'),_0x4bac6b+'-'+_0x48db78+'/'+_0x1dea52)[_0x31fa('0x2e')](_0x4f2c8e);}return null;};}function patchUpdates(_0x2c1371){return function(_0xd208){try{jsonpatch['apply'](_0xd208,_0x2c1371,!![]);}catch(_0x3bd6f7){return BPromise[_0x31fa('0x2f')](_0x3bd6f7);}return _0xd208['save']();};}function saveUpdates(_0x417a79,_0x3043ab){return function(_0x28bbbd){if(_0x28bbbd){return _0x28bbbd[_0x31fa('0x30')](_0x417a79)[_0x31fa('0x1d')](function(_0x30acc7){return _0x30acc7;});}return null;};}function removeEntity(_0x46590d,_0x3b3875){return function(_0x46cbe1){if(_0x46cbe1){return _0x46cbe1['destroy']()[_0x31fa('0x1d')](function(){var _0x16ea82=_0x46cbe1[_0x31fa('0x31')]({'plain':!![]});var _0x138ac7='ChatQueues';return db[_0x31fa('0x32')]['destroy']({'where':{'type':_0x138ac7,'resourceId':_0x16ea82['id']}})[_0x31fa('0x1d')](function(){return _0x46cbe1;});})[_0x31fa('0x1d')](function(){_0x46590d[_0x31fa('0x28')](0xcc)[_0x31fa('0x33')]();});}};}function handleEntityNotFound(_0x21c514,_0x479034){return function(_0x3eae3a){if(!_0x3eae3a){_0x21c514['sendStatus'](0x194);}return _0x3eae3a;};}function handleError(_0x2d1064,_0x5df9e5){_0x5df9e5=_0x5df9e5||0x1f4;return function(_0x55d4a7){logger[_0x31fa('0x23')](_0x55d4a7[_0x31fa('0x34')]);if(_0x55d4a7[_0x31fa('0x35')]){delete _0x55d4a7[_0x31fa('0x35')];}_0x2d1064[_0x31fa('0x28')](_0x5df9e5)[_0x31fa('0x36')](_0x55d4a7);};}exports[_0x31fa('0x37')]=function(_0x2e4770,_0x462bdd){var _0x5b82e5={},_0x570429={},_0x294af8={'count':0x0,'rows':[]};var _0x59ac71=_[_0x31fa('0x38')](db['ChatQueue'][_0x31fa('0x39')],function(_0x5c5af8){return{'name':_0x5c5af8[_0x31fa('0x3a')],'type':_0x5c5af8[_0x31fa('0x3b')][_0x31fa('0x3c')]};});_0x570429['model']=_['map'](_0x59ac71,_0x31fa('0x35'));_0x570429[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x2e4770[_0x31fa('0x3d')]);_0x570429[_0x31fa('0x3f')]=_['intersection'](_0x570429[_0x31fa('0x40')],_0x570429[_0x31fa('0x3d')]);_0x5b82e5[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x570429[_0x31fa('0x40')],qs['fields'](_0x2e4770['query'][_0x31fa('0x43')]));_0x5b82e5[_0x31fa('0x41')]=_0x5b82e5[_0x31fa('0x41')][_0x31fa('0x44')]?_0x5b82e5[_0x31fa('0x41')]:_0x570429[_0x31fa('0x40')];if(!_0x2e4770['query'][_0x31fa('0x45')](_0x31fa('0x46'))){_0x5b82e5['limit']=qs[_0x31fa('0x2a')](_0x2e4770['query'][_0x31fa('0x2a')]);_0x5b82e5['offset']=qs[_0x31fa('0x2c')](_0x2e4770[_0x31fa('0x3d')]['offset']);}_0x5b82e5[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x2e4770[_0x31fa('0x3d')]['sort']);_0x5b82e5[_0x31fa('0x49')]=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x2e4770[_0x31fa('0x3d')],_0x570429[_0x31fa('0x3f')]),_0x59ac71);if(_0x2e4770[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x5b82e5[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x5b82e5['where'],{'$or':_[_0x31fa('0x38')](_0x59ac71,function(_0x35ff28){if(_0x35ff28[_0x31fa('0x3b')]!==_0x31fa('0x4d')){var _0x6d648d={};_0x6d648d[_0x35ff28[_0x31fa('0x35')]]={'$like':'%'+_0x2e4770[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x6d648d;}})});}_0x5b82e5=_[_0x31fa('0x4c')]({},_0x5b82e5,_0x2e4770['options']);var _0x2456b1={'where':_0x5b82e5['where']};return db[_0x31fa('0x4e')][_0x31fa('0x2b')](_0x2456b1)[_0x31fa('0x1d')](function(_0x25e051){_0x294af8[_0x31fa('0x2b')]=_0x25e051;if(_0x2e4770['query'][_0x31fa('0x4f')]){_0x5b82e5[_0x31fa('0x50')]=[{'all':!![]}];}return db[_0x31fa('0x4e')]['findAll'](_0x5b82e5);})[_0x31fa('0x1d')](function(_0x22746d){_0x294af8[_0x31fa('0x51')]=_0x22746d;return _0x294af8;})[_0x31fa('0x1d')](respondWithFilteredResult(_0x462bdd,_0x5b82e5))[_0x31fa('0x27')](handleError(_0x462bdd,null));};exports[_0x31fa('0x52')]=function(_0x5d72ef,_0x33f48b){var _0x44bba0={'raw':!![],'where':{'id':_0x5d72ef[_0x31fa('0x53')]['id']}},_0x398fe1={};_0x398fe1[_0x31fa('0x40')]=_['keys'](db[_0x31fa('0x4e')][_0x31fa('0x39')]);_0x398fe1['query']=_['keys'](_0x5d72ef['query']);_0x398fe1['filters']=_[_0x31fa('0x42')](_0x398fe1[_0x31fa('0x40')],_0x398fe1['query']);_0x44bba0[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x398fe1[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x5d72ef['query'][_0x31fa('0x43')]));_0x44bba0[_0x31fa('0x41')]=_0x44bba0[_0x31fa('0x41')][_0x31fa('0x44')]?_0x44bba0[_0x31fa('0x41')]:_0x398fe1[_0x31fa('0x40')];if(_0x5d72ef['query'][_0x31fa('0x4f')]){_0x44bba0[_0x31fa('0x50')]=[{'all':!![]}];}_0x44bba0=_[_0x31fa('0x4c')]({},_0x44bba0,_0x5d72ef['options']);return db[_0x31fa('0x4e')][_0x31fa('0x54')](_0x44bba0)[_0x31fa('0x1d')](handleEntityNotFound(_0x33f48b,null))[_0x31fa('0x1d')](respondWithResult(_0x33f48b,null))[_0x31fa('0x27')](handleError(_0x33f48b,null));};exports[_0x31fa('0x55')]=function(_0x2189d8,_0x4b4101){return db[_0x31fa('0x4e')][_0x31fa('0x55')](_0x2189d8[_0x31fa('0x56')],{})[_0x31fa('0x1d')](function(_0x36e194){var _0x1986c8=_0x2189d8[_0x31fa('0x57')][_0x31fa('0x31')]({'plain':!![]});if(!_0x1986c8)throw new Error(_0x31fa('0x58'));if(_0x1986c8[_0x31fa('0x59')]==='user'){var _0x2cdcc4=_0x36e194['get']({'plain':!![]});var _0x3928c2='ChatQueues';return db['UserProfileSection'][_0x31fa('0x54')]({'where':{'name':_0x3928c2,'userProfileId':_0x1986c8['userProfileId']},'raw':!![]})[_0x31fa('0x1d')](function(_0x392fd7){if(_0x392fd7&&_0x392fd7[_0x31fa('0x5a')]===0x0){return db[_0x31fa('0x32')][_0x31fa('0x55')]({'name':_0x2cdcc4[_0x31fa('0x35')],'resourceId':_0x2cdcc4['id'],'type':_0x392fd7[_0x31fa('0x35')],'sectionId':_0x392fd7['id']},{})[_0x31fa('0x1d')](function(){return _0x36e194;});}else{return _0x36e194;}})['catch'](function(_0x20547d){logger['error'](_0x31fa('0x5b'),_0x20547d);throw _0x20547d;});}return _0x36e194;})[_0x31fa('0x1d')](respondWithResult(_0x4b4101,0xc9))[_0x31fa('0x27')](handleError(_0x4b4101,null));};exports[_0x31fa('0x30')]=function(_0x109ab9,_0x5ecdea){if(_0x109ab9[_0x31fa('0x56')]['id']){delete _0x109ab9[_0x31fa('0x56')]['id'];}return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x109ab9[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x5ecdea,null))[_0x31fa('0x1d')](saveUpdates(_0x109ab9[_0x31fa('0x56')],null))['then'](respondWithResult(_0x5ecdea,null))['catch'](handleError(_0x5ecdea,null));};exports['destroy']=function(_0x5c26f0,_0x54573e){return db[_0x31fa('0x4e')]['find']({'where':{'id':_0x5c26f0[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x54573e,null))['then'](removeEntity(_0x54573e,null))['catch'](handleError(_0x54573e,null));};exports[_0x31fa('0x5c')]=function(_0x27672a,_0x5f3240){return db[_0x31fa('0x4e')][_0x31fa('0x5c')]()[_0x31fa('0x1d')](respondWithResult(_0x5f3240,null))['catch'](handleError(_0x5f3240,null));};exports['getMembers']=function(_0x2d9fff,_0x1891ff,_0x125452){var _0x5cb8ab={'raw':!![],'where':{}},_0x2885d2={},_0x5bb2e7;return db[_0x31fa('0x4e')][_0x31fa('0x5d')]({'where':{'id':_0x2d9fff[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x1891ff,null))[_0x31fa('0x1d')](function(_0x1bfff0){if(_0x1bfff0){_0x5bb2e7=_0x1bfff0[_0x31fa('0x31')]({'plain':!![]});_0x2885d2[_0x31fa('0x40')]=_[_0x31fa('0x3e')](db['UserChatQueue'][_0x31fa('0x39')]);_0x2885d2['query']=_[_0x31fa('0x3e')](_0x2d9fff[_0x31fa('0x3d')]);_0x2885d2[_0x31fa('0x3f')]=_[_0x31fa('0x42')](_0x2885d2[_0x31fa('0x40')],_0x2885d2[_0x31fa('0x3d')]);_0x5cb8ab[_0x31fa('0x41')]=_[_0x31fa('0x42')](_0x2885d2[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x5cb8ab[_0x31fa('0x41')]=_0x5cb8ab['attributes'][_0x31fa('0x44')]?_0x5cb8ab['attributes']:_0x2885d2[_0x31fa('0x40')];if(!_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x45')]('nolimit')){_0x5cb8ab[_0x31fa('0x2a')]=qs['limit'](_0x2d9fff['query'][_0x31fa('0x2a')]);_0x5cb8ab[_0x31fa('0x2c')]=qs[_0x31fa('0x2c')](_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x2c')]);}_0x5cb8ab[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x2d9fff[_0x31fa('0x3d')]['sort']);_0x5cb8ab[_0x31fa('0x49')]=qs['filters'](_[_0x31fa('0x4a')](_0x2d9fff['query'],_0x2885d2[_0x31fa('0x3f')]));_0x5cb8ab[_0x31fa('0x49')][_0x31fa('0x5e')]=_0x1bfff0['id'];if(_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x5cb8ab[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x5cb8ab[_0x31fa('0x49')],{'$or':_['map'](_0x5cb8ab[_0x31fa('0x41')],function(_0x30e66d){var _0x5b0ed5={};_0x5b0ed5[_0x30e66d]={'$like':'%'+_0x2d9fff[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x5b0ed5;})});}_0x5cb8ab=_[_0x31fa('0x4c')]({},_0x5cb8ab,_0x2d9fff[_0x31fa('0x5f')]);return db['UserChatQueue']['findAll'](_0x5cb8ab);}})['then'](function(_0x4b1070){if(_0x4b1070){return db['User']['findAndCountAll']({'where':{'id':_[_0x31fa('0x38')](_0x4b1070,_0x31fa('0x60')),'role':_0x31fa('0x61')},'attributes':['id',_0x31fa('0x35'),_0x31fa('0x62'),_0x31fa('0x63'),_0x31fa('0x64')]});}})[_0x31fa('0x1d')](function(_0x16358d){if(_0x16358d){return{'count':_0x16358d[_0x31fa('0x2b')],'rows':_[_0x31fa('0x38')](_0x16358d[_0x31fa('0x51')],function(_0x2b25f2){return{'membername':_0x2b25f2[_0x31fa('0x35')],'UserId':_0x2b25f2['id'],'queue_name':_0x5bb2e7[_0x31fa('0x35')],'ChatQueueId':_0x5bb2e7['id'],'interface':util[_0x31fa('0x65')](_0x31fa('0x66'),_0x31fa('0x67'),_0x2b25f2['name']),'penalty':0x0,'paused':_0x2b25f2['chatPause'],'createdAt':_0x2b25f2[_0x31fa('0x64')],'updatedAt':_0x2b25f2[_0x31fa('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x31fa('0x1d')](respondWithFilteredResult(_0x1891ff,_0x5cb8ab))[_0x31fa('0x27')](handleError(_0x1891ff,null));};exports['getTeams']=function(_0x1861a2,_0x13a441,_0x30afbf){var _0x587a5c={};var _0xaf25c1={};var _0xf08321;var _0x5ac64b;return db[_0x31fa('0x4e')]['findOne']({'where':{'id':_0x1861a2[_0x31fa('0x53')]['id']}})['then'](handleEntityNotFound(_0x13a441,null))[_0x31fa('0x1d')](function(_0x166b52){if(_0x166b52){_0xf08321=_0x166b52;_0xaf25c1[_0x31fa('0x40')]=_[_0x31fa('0x3e')](db['Team']['rawAttributes']);_0xaf25c1[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x1861a2['query']);_0xaf25c1['filters']=_['intersection'](_0xaf25c1[_0x31fa('0x40')],_0xaf25c1[_0x31fa('0x3d')]);_0x587a5c['attributes']=_[_0x31fa('0x42')](_0xaf25c1[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x587a5c[_0x31fa('0x41')]=_0x587a5c['attributes'][_0x31fa('0x44')]?_0x587a5c[_0x31fa('0x41')]:_0xaf25c1[_0x31fa('0x40')];_0x587a5c[_0x31fa('0x47')]=qs['sort'](_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x48')]);_0x587a5c['where']=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x1861a2['query'],_0xaf25c1[_0x31fa('0x3f')]));if(_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x4b')]){_0x587a5c[_0x31fa('0x49')]=_['merge'](_0x587a5c[_0x31fa('0x49')],{'$or':_[_0x31fa('0x38')](_0x587a5c['attributes'],function(_0x355977){var _0x227a1d={};_0x227a1d[_0x355977]={'$like':'%'+_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0x227a1d;})});}_0x587a5c=_[_0x31fa('0x4c')]({},_0x587a5c,_0x1861a2[_0x31fa('0x5f')]);return _0xf08321[_0x31fa('0x68')](_0x587a5c);}})[_0x31fa('0x1d')](function(_0x3005c1){if(_0x3005c1){_0x5ac64b=_0x3005c1[_0x31fa('0x44')];if(!_0x1861a2[_0x31fa('0x3d')][_0x31fa('0x45')](_0x31fa('0x46'))){_0x587a5c[_0x31fa('0x2a')]=qs[_0x31fa('0x2a')](_0x1861a2[_0x31fa('0x3d')]['limit']);_0x587a5c[_0x31fa('0x2c')]=qs[_0x31fa('0x2c')](_0x1861a2[_0x31fa('0x3d')]['offset']);}return _0xf08321[_0x31fa('0x68')](_0x587a5c);}})[_0x31fa('0x1d')](function(_0x3c59c4){if(_0x3c59c4){return _0x3c59c4?{'count':_0x5ac64b,'rows':_0x3c59c4}:null;}})[_0x31fa('0x1d')](respondWithResult(_0x13a441,null))[_0x31fa('0x27')](handleError(_0x13a441,null));};exports[_0x31fa('0x69')]=function(_0x3a96c7,_0x1de1c3,_0x4b8bb6){var _0x5eb67b=_0x3a96c7['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x5eb67b},'attributes':['id'],'include':[{'model':db[_0x31fa('0x6a')],'as':_0x31fa('0x6b'),'attributes':['id',_0x31fa('0x35'),_0x31fa('0x6c'),_0x31fa('0x6d'),_0x31fa('0x6e')],'raw':!![]}]})['then'](function(_0x43b31c){if(_0x43b31c){var _0x46d9cf=_[_0x31fa('0x6f')](_0x43b31c,function(_0x1070fc){var _0x1d760e=_0x1070fc[_0x31fa('0x31')]({'plain':!![]});return _0x1d760e[_0x31fa('0x6b')];});return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x3a96c7[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](function(_0xc73174){return db[_0x31fa('0x70')][_0x31fa('0x71')](function(_0x4dddc7){return _0xc73174['addTeams'](_0x5eb67b,{'transaction':_0x4dddc7})[_0x31fa('0x1d')](function(){return BPromise[_0x31fa('0x72')](_0x46d9cf,function(_0x14a4f7){return db[_0x31fa('0x73')][_0x31fa('0x74')]({'where':{'UserId':_0x14a4f7['id'],'ChatQueueId':_0x3a96c7[_0x31fa('0x53')]['id']},'transaction':_0x4dddc7});});})[_0x31fa('0x1d')](function(){_0x46d9cf['forEach'](function(_0x188e57){socket[_0x31fa('0x75')](_0x31fa('0x76'),{'UserId':_0x188e57['id'],'ChatQueueId':_0xc73174['id']});});});});});}})[_0x31fa('0x1d')](respondWithStatusCode(_0x1de1c3,null))[_0x31fa('0x27')](handleError(_0x1de1c3,null));};exports['removeTeams']=function(_0x3a8abe,_0x17c106,_0x1e7996){return db[_0x31fa('0x77')][_0x31fa('0x78')]({'where':{'id':_0x3a8abe['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x31fa('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x17c106,null))['then'](function(_0x2b6714){var _0x576036=_[_0x31fa('0x38')](_0x2b6714,'id');var _0x2a2acc=[];var _0x44cf62=[];var _0x3d3395=squel['select']();_0x3d3395[_0x31fa('0x79')](_0x31fa('0x7a'))[_0x31fa('0x7b')](_0x31fa('0x7c'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x31fa('0x49')](_0x31fa('0x7d'),_0x3a8abe['params']['id']);for(var _0x85a503=0x0;_0x85a503<_0x2b6714[_0x31fa('0x44')];_0x85a503+=0x1){let _0x2a8318=_0x2b6714[_0x85a503];for(var _0x5de66c=0x0;_0x5de66c<_0x2a8318['Agents']['length'];_0x5de66c+=0x1){let _0x32d0de=_0x2a8318['Agents'][_0x5de66c];var _0x4a7371=_0x3d3395[_0x31fa('0x7e')]();_0x4a7371[_0x31fa('0x49')](_0x31fa('0x7f'),_0x32d0de['id']);_0x44cf62[_0x31fa('0x80')](db[_0x31fa('0x70')][_0x31fa('0x3d')](_0x4a7371[_0x31fa('0x81')](),{'type':db[_0x31fa('0x70')][_0x31fa('0x82')][_0x31fa('0x83')]})['then'](function(_0x58ea0c){if(_0x58ea0c[_0x31fa('0x44')]===0x1){return _0x32d0de['id'];}else{var _0xa51f08=_[_0x31fa('0x84')](_[_0x31fa('0x38')](_0x58ea0c,_0x31fa('0x85')),function(_0x2b97b3){return _[_0x31fa('0x86')](_0x576036,_0x2b97b3);});if(_0xa51f08){return _0x32d0de['id'];}}}));}}return BPromise[_0x31fa('0x87')](_0x44cf62)[_0x31fa('0x1d')](function(_0x3d1ba7){_0x2a2acc=_(_0x2a2acc)[_0x31fa('0x88')](_0x3d1ba7)[_0x31fa('0x89')]()['value']();return db['ChatQueue']['find']({'where':{'id':_0x3a8abe[_0x31fa('0x53')]['id']}})['then'](function(_0x2a88b4){return db[_0x31fa('0x70')][_0x31fa('0x71')](function(_0x5905a1){return _0x2a88b4[_0x31fa('0x8a')](_0x3a8abe[_0x31fa('0x3d')][_0x31fa('0x8b')],{'transaction':_0x5905a1})[_0x31fa('0x1d')](function(){if(!_['isEmpty'](_0x2a2acc)){return _0x2a88b4[_0x31fa('0x8c')](_0x2a2acc,{'transaction':_0x5905a1});}})[_0x31fa('0x1d')](function(){_0x2a2acc[_0x31fa('0x8d')](function(_0xe8ff14){socket[_0x31fa('0x75')](_0x31fa('0x8e'),{'UserId':_0xe8ff14,'ChatQueueId':_0x2a88b4['id']});});});});});});})['then'](respondWithStatusCode(_0x17c106,null))[_0x31fa('0x27')](handleError(_0x17c106,null));};exports[_0x31fa('0x8f')]=function(_0x58328c,_0x33f6f7,_0x507b76){return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x58328c[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x33f6f7,null))[_0x31fa('0x1d')](function(_0x492765){if(_0x492765){return _0x492765[_0x31fa('0x8f')](_0x58328c[_0x31fa('0x56')][_0x31fa('0x8b')],_[_0x31fa('0x90')](_0x58328c[_0x31fa('0x56')],[_0x31fa('0x8b'),'id'])||{})[_0x31fa('0x91')](function(_0x2310fc){for(var _0x2e57da=0x0;_0x2e57da<_0x58328c[_0x31fa('0x56')][_0x31fa('0x8b')][_0x31fa('0x44')];_0x2e57da+=0x1){socket[_0x31fa('0x75')](_0x31fa('0x76'),{'UserId':Number(_0x58328c['body'][_0x31fa('0x8b')][_0x2e57da]),'ChatQueueId':Number(_0x58328c[_0x31fa('0x53')]['id'])});}return _0x2310fc;});}})[_0x31fa('0x1d')](respondWithResult(_0x33f6f7,null))[_0x31fa('0x27')](handleError(_0x33f6f7,null));};exports[_0x31fa('0x8c')]=function(_0x5bcbab,_0x34647e,_0x3032e6){return db[_0x31fa('0x4e')][_0x31fa('0x54')]({'where':{'id':_0x5bcbab[_0x31fa('0x53')]['id']}})[_0x31fa('0x1d')](handleEntityNotFound(_0x34647e,null))[_0x31fa('0x1d')](function(_0x3211fa){if(_0x3211fa){return _0x3211fa[_0x31fa('0x8c')](_0x5bcbab['query'][_0x31fa('0x8b')])[_0x31fa('0x1d')](function(){if(_[_0x31fa('0x92')](_0x5bcbab[_0x31fa('0x3d')]['ids'])){for(var _0x200ec3=0x0;_0x200ec3<_0x5bcbab[_0x31fa('0x3d')][_0x31fa('0x8b')]['length'];_0x200ec3+=0x1){socket[_0x31fa('0x75')]('userChatQueue:remove',{'UserId':Number(_0x5bcbab['query'][_0x31fa('0x8b')][_0x200ec3]),'ChatQueueId':Number(_0x5bcbab['params']['id'])});}}else{socket[_0x31fa('0x75')]('userChatQueue:remove',{'UserId':Number(_0x5bcbab[_0x31fa('0x3d')][_0x31fa('0x8b')]),'ChatQueueId':Number(_0x5bcbab[_0x31fa('0x53')]['id'])});}});}})[_0x31fa('0x1d')](respondWithStatusCode(_0x34647e,null))[_0x31fa('0x27')](handleError(_0x34647e,null));};exports[_0x31fa('0x93')]=function(_0x32e5f4,_0x5027ac,_0x2a2daf){var _0x2e85cc={};var _0x40d189={};var _0x4d709a;var _0x1bb3e1;return db[_0x31fa('0x4e')][_0x31fa('0x5d')]({'where':{'id':_0x32e5f4[_0x31fa('0x53')]['id']}})['then'](handleEntityNotFound(_0x5027ac,null))[_0x31fa('0x1d')](function(_0x36331b){if(_0x36331b){_0x4d709a=_0x36331b;_0x40d189[_0x31fa('0x40')]=_['keys'](db[_0x31fa('0x6a')][_0x31fa('0x39')]);_0x40d189[_0x31fa('0x3d')]=_[_0x31fa('0x3e')](_0x32e5f4[_0x31fa('0x3d')]);_0x40d189['filters']=_[_0x31fa('0x42')](_0x40d189[_0x31fa('0x40')],_0x40d189[_0x31fa('0x3d')]);_0x2e85cc['attributes']=_['intersection'](_0x40d189[_0x31fa('0x40')],qs[_0x31fa('0x43')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x43')]));_0x2e85cc['attributes']=_0x2e85cc[_0x31fa('0x41')][_0x31fa('0x44')]?_0x2e85cc[_0x31fa('0x41')]:_0x40d189[_0x31fa('0x40')];_0x2e85cc[_0x31fa('0x47')]=qs[_0x31fa('0x48')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x48')]);_0x2e85cc[_0x31fa('0x49')]=qs[_0x31fa('0x3f')](_[_0x31fa('0x4a')](_0x32e5f4[_0x31fa('0x3d')],_0x40d189[_0x31fa('0x3f')]));if(_0x32e5f4['query'][_0x31fa('0x4b')]){_0x2e85cc[_0x31fa('0x49')]=_[_0x31fa('0x4c')](_0x2e85cc[_0x31fa('0x49')],{'$or':_[_0x31fa('0x38')](_0x2e85cc[_0x31fa('0x41')],function(_0x1eb988){var _0xce1aca={};_0xce1aca[_0x1eb988]={'$like':'%'+_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x4b')]+'%'};return _0xce1aca;})});}_0x2e85cc=_['merge']({},_0x2e85cc,_0x32e5f4['options']);return _0x4d709a['getAgents'](_0x2e85cc);}})[_0x31fa('0x1d')](function(_0x486ce8){if(_0x486ce8){_0x1bb3e1=_0x486ce8[_0x31fa('0x44')];if(!_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x45')](_0x31fa('0x46'))){_0x2e85cc['limit']=qs[_0x31fa('0x2a')](_0x32e5f4[_0x31fa('0x3d')][_0x31fa('0x2a')]);_0x2e85cc[_0x31fa('0x2c')]=qs['offset'](_0x32e5f4[_0x31fa('0x3d')]['offset']);}return _0x4d709a[_0x31fa('0x93')](_0x2e85cc);}})[_0x31fa('0x1d')](function(_0x197d05){if(_0x197d05){return _0x197d05?{'count':_0x1bb3e1,'rows':_0x197d05}:null;}})[_0x31fa('0x1d')](respondWithResult(_0x5027ac,null))[_0x31fa('0x27')](handleError(_0x5027ac,null));};
\ No newline at end of file
+var _0xb884=['addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','ChatQueues','UserProfileResource','end','sendStatus','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','ChatQueue','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','pick','ChatQueueId','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','transaction','removeAgents','userChatQueue:remove'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb884,0x9b));var _0x4b88=function(_0x450a0d,_0x21839f){_0x450a0d=_0x450a0d-0x0;var _0x41e651=_0xb884[_0x450a0d];return _0x41e651;};'use strict';var emlformat=require(_0x4b88('0x0'));var rimraf=require(_0x4b88('0x1'));var zipdir=require(_0x4b88('0x2'));var jsonpatch=require(_0x4b88('0x3'));var rp=require(_0x4b88('0x4'));var moment=require(_0x4b88('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4b88('0x6'));var sox=require(_0x4b88('0x7'));var csv=require(_0x4b88('0x8'));var ejs=require(_0x4b88('0x9'));var fs=require('fs');var fs_extra=require(_0x4b88('0xa'));var _=require(_0x4b88('0xb'));var squel=require(_0x4b88('0xc'));var crypto=require('crypto');var jsforce=require(_0x4b88('0xd'));var deskjs=require(_0x4b88('0xe'));var toCsv=require(_0x4b88('0x8'));var querystring=require(_0x4b88('0xf'));var Papa=require(_0x4b88('0x10'));var Redis=require('ioredis');var authService=require(_0x4b88('0x11'));var qs=require(_0x4b88('0x12'));var as=require(_0x4b88('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b88('0x14'))(_0x4b88('0x15'));var utils=require('../../config/utils');var config=require(_0x4b88('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4b88('0x17')]=_['defaults'](config['redis'],{'host':_0x4b88('0x18'),'port':0x18eb});var socket=require(_0x4b88('0x19'))(new Redis(config[_0x4b88('0x17')]));require(_0x4b88('0x1a'))['register'](socket);var jayson=require(_0x4b88('0x1b'));var client=jayson[_0x4b88('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19e93c,_0x2d1d5d,_0x50e018,_0xe21a84){return new BPromise(function(_0x368a7e,_0x269e43){var _0x3a060e=_0xe21a84||client;return _0x3a060e[_0x4b88('0x1d')](_0x19e93c,_0x50e018)['then'](function(_0x419724){logger[_0x4b88('0x1e')](_0x4b88('0x1f'),_0x2d1d5d,'request\x20sent');logger['debug'](_0x4b88('0x20'),_0x2d1d5d,_0x4b88('0x21'),JSON[_0x4b88('0x22')](_0x419724));if(_0x419724['error']){if(_0x419724[_0x4b88('0x23')][_0x4b88('0x24')]===0x1f4){logger[_0x4b88('0x23')](_0x4b88('0x1f'),_0x2d1d5d,_0x419724['error']['message']);return _0x269e43(_0x419724[_0x4b88('0x23')][_0x4b88('0x25')]);}logger['error'](_0x4b88('0x1f'),_0x2d1d5d,_0x419724[_0x4b88('0x23')][_0x4b88('0x25')]);return _0x368a7e(_0x419724[_0x4b88('0x23')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2d1d5d,_0x4b88('0x21'));_0x368a7e(_0x419724[_0x4b88('0x26')][_0x4b88('0x25')]);}})['catch'](function(_0x46b052){logger[_0x4b88('0x23')](_0x4b88('0x1f'),_0x2d1d5d,_0x46b052);_0x269e43(_0x46b052);});});}function respondWithStatusCode(_0x56b038,_0xaa27ba){_0xaa27ba=_0xaa27ba||0xcc;return function(_0x5bfbfd){if(_0x5bfbfd){return _0x56b038['sendStatus'](_0xaa27ba);}return _0x56b038['status'](_0xaa27ba)['end']();};}function respondWithResult(_0x22d236,_0x37bdee){_0x37bdee=_0x37bdee||0xc8;return function(_0x3abc50){if(_0x3abc50){return _0x22d236['status'](_0x37bdee)[_0x4b88('0x27')](_0x3abc50);}};}function respondWithFilteredResult(_0xa5643,_0x3c5aa9){return function(_0xb6e8c4){if(_0xb6e8c4){var _0x21012f=typeof _0x3c5aa9[_0x4b88('0x28')]===_0x4b88('0x29')&&typeof _0x3c5aa9[_0x4b88('0x2a')]===_0x4b88('0x29');var _0x1bb386=_0xb6e8c4[_0x4b88('0x2b')];var _0xc7dcc0=_0x21012f?0x0:_0x3c5aa9[_0x4b88('0x28')];var _0x567502=_0x21012f?_0xb6e8c4[_0x4b88('0x2b')]:_0x3c5aa9[_0x4b88('0x28')]+_0x3c5aa9[_0x4b88('0x2a')];var _0x11c6d1;if(_0x567502>=_0x1bb386){_0x567502=_0x1bb386;_0x11c6d1=0xc8;}else{_0x11c6d1=0xce;}_0xa5643['status'](_0x11c6d1);return _0xa5643[_0x4b88('0x2c')](_0x4b88('0x2d'),_0xc7dcc0+'-'+_0x567502+'/'+_0x1bb386)['json'](_0xb6e8c4);}return null;};}function patchUpdates(_0x1422d9){return function(_0x5aade4){try{jsonpatch['apply'](_0x5aade4,_0x1422d9,!![]);}catch(_0x1ebcd5){return BPromise[_0x4b88('0x2e')](_0x1ebcd5);}return _0x5aade4[_0x4b88('0x2f')]();};}function saveUpdates(_0x918a10,_0x947243){return function(_0x40da1b){if(_0x40da1b){return _0x40da1b[_0x4b88('0x30')](_0x918a10)['then'](function(_0x2caf4f){return _0x2caf4f;});}return null;};}function removeEntity(_0x79114a,_0x457548){return function(_0x3e9137){if(_0x3e9137){return _0x3e9137[_0x4b88('0x31')]()[_0x4b88('0x32')](function(){var _0x5930d0=_0x3e9137['get']({'plain':!![]});var _0x3637d2=_0x4b88('0x33');return db[_0x4b88('0x34')][_0x4b88('0x31')]({'where':{'type':_0x3637d2,'resourceId':_0x5930d0['id']}})[_0x4b88('0x32')](function(){return _0x3e9137;});})[_0x4b88('0x32')](function(){_0x79114a['status'](0xcc)[_0x4b88('0x35')]();});}};}function handleEntityNotFound(_0xc938be,_0x3d3393){return function(_0x37276e){if(!_0x37276e){_0xc938be[_0x4b88('0x36')](0x194);}return _0x37276e;};}function handleError(_0xa47ea4,_0x34e95b){_0x34e95b=_0x34e95b||0x1f4;return function(_0x510a5a){logger['error'](_0x510a5a[_0x4b88('0x37')]);if(_0x510a5a['name']){delete _0x510a5a[_0x4b88('0x38')];}_0xa47ea4['status'](_0x34e95b)['send'](_0x510a5a);};}exports[_0x4b88('0x39')]=function(_0x21712f,_0x1aeecc){var _0x28c754={},_0x15882a={},_0x24dac7={'count':0x0,'rows':[]};var _0x328be0=_['map'](db['ChatQueue'][_0x4b88('0x3a')],function(_0x1a270b){return{'name':_0x1a270b[_0x4b88('0x3b')],'type':_0x1a270b[_0x4b88('0x3c')][_0x4b88('0x3d')]};});_0x15882a['model']=_[_0x4b88('0x3e')](_0x328be0,_0x4b88('0x38'));_0x15882a[_0x4b88('0x3f')]=_[_0x4b88('0x40')](_0x21712f[_0x4b88('0x3f')]);_0x15882a[_0x4b88('0x41')]=_[_0x4b88('0x42')](_0x15882a['model'],_0x15882a[_0x4b88('0x3f')]);_0x28c754['attributes']=_['intersection'](_0x15882a['model'],qs['fields'](_0x21712f[_0x4b88('0x3f')][_0x4b88('0x43')]));_0x28c754[_0x4b88('0x44')]=_0x28c754[_0x4b88('0x44')]['length']?_0x28c754['attributes']:_0x15882a[_0x4b88('0x45')];if(!_0x21712f[_0x4b88('0x3f')][_0x4b88('0x46')](_0x4b88('0x47'))){_0x28c754['limit']=qs[_0x4b88('0x2a')](_0x21712f['query'][_0x4b88('0x2a')]);_0x28c754['offset']=qs[_0x4b88('0x28')](_0x21712f[_0x4b88('0x3f')][_0x4b88('0x28')]);}_0x28c754[_0x4b88('0x48')]=qs[_0x4b88('0x49')](_0x21712f['query'][_0x4b88('0x49')]);_0x28c754['where']=qs[_0x4b88('0x41')](_['pick'](_0x21712f[_0x4b88('0x3f')],_0x15882a[_0x4b88('0x41')]),_0x328be0);if(_0x21712f[_0x4b88('0x3f')][_0x4b88('0x4a')]){_0x28c754['where']=_[_0x4b88('0x4b')](_0x28c754[_0x4b88('0x4c')],{'$or':_[_0x4b88('0x3e')](_0x328be0,function(_0x469c89){if(_0x469c89[_0x4b88('0x3c')]!==_0x4b88('0x4d')){var _0x4dee3f={};_0x4dee3f[_0x469c89[_0x4b88('0x38')]]={'$like':'%'+_0x21712f['query']['filter']+'%'};return _0x4dee3f;}})});}_0x28c754=_[_0x4b88('0x4b')]({},_0x28c754,_0x21712f[_0x4b88('0x4e')]);var _0x50a4d0={'where':_0x28c754[_0x4b88('0x4c')]};return db[_0x4b88('0x4f')]['count'](_0x50a4d0)[_0x4b88('0x32')](function(_0x487eaf){_0x24dac7[_0x4b88('0x2b')]=_0x487eaf;if(_0x21712f[_0x4b88('0x3f')][_0x4b88('0x50')]){_0x28c754[_0x4b88('0x51')]=[{'all':!![]}];}return db['ChatQueue'][_0x4b88('0x52')](_0x28c754);})[_0x4b88('0x32')](function(_0x12839a){_0x24dac7[_0x4b88('0x53')]=_0x12839a;return _0x24dac7;})[_0x4b88('0x32')](respondWithFilteredResult(_0x1aeecc,_0x28c754))[_0x4b88('0x54')](handleError(_0x1aeecc,null));};exports[_0x4b88('0x55')]=function(_0x374f1a,_0x1faa6e){var _0x4ce3ee={'raw':!![],'where':{'id':_0x374f1a[_0x4b88('0x56')]['id']}},_0x511abf={};_0x511abf['model']=_[_0x4b88('0x40')](db[_0x4b88('0x4f')][_0x4b88('0x3a')]);_0x511abf[_0x4b88('0x3f')]=_[_0x4b88('0x40')](_0x374f1a[_0x4b88('0x3f')]);_0x511abf[_0x4b88('0x41')]=_[_0x4b88('0x42')](_0x511abf[_0x4b88('0x45')],_0x511abf['query']);_0x4ce3ee[_0x4b88('0x44')]=_[_0x4b88('0x42')](_0x511abf[_0x4b88('0x45')],qs['fields'](_0x374f1a['query']['fields']));_0x4ce3ee[_0x4b88('0x44')]=_0x4ce3ee[_0x4b88('0x44')][_0x4b88('0x57')]?_0x4ce3ee['attributes']:_0x511abf[_0x4b88('0x45')];if(_0x374f1a[_0x4b88('0x3f')][_0x4b88('0x50')]){_0x4ce3ee[_0x4b88('0x51')]=[{'all':!![]}];}_0x4ce3ee=_[_0x4b88('0x4b')]({},_0x4ce3ee,_0x374f1a['options']);return db[_0x4b88('0x4f')]['find'](_0x4ce3ee)['then'](handleEntityNotFound(_0x1faa6e,null))['then'](respondWithResult(_0x1faa6e,null))['catch'](handleError(_0x1faa6e,null));};exports['create']=function(_0x587370,_0x8ef3cd){return db[_0x4b88('0x4f')][_0x4b88('0x58')](_0x587370[_0x4b88('0x59')],{})[_0x4b88('0x32')](function(_0x5b4e1c){var _0x2e2bc6=_0x587370[_0x4b88('0x5a')][_0x4b88('0x5b')]({'plain':!![]});if(!_0x2e2bc6)throw new Error(_0x4b88('0x5c'));if(_0x2e2bc6[_0x4b88('0x5d')]===_0x4b88('0x5a')){var _0x1dab2f=_0x5b4e1c[_0x4b88('0x5b')]({'plain':!![]});var _0x449457=_0x4b88('0x33');return db[_0x4b88('0x5e')][_0x4b88('0x5f')]({'where':{'name':_0x449457,'userProfileId':_0x2e2bc6[_0x4b88('0x60')]},'raw':!![]})[_0x4b88('0x32')](function(_0x568e25){if(_0x568e25&&_0x568e25[_0x4b88('0x61')]===0x0){return db[_0x4b88('0x34')][_0x4b88('0x58')]({'name':_0x1dab2f['name'],'resourceId':_0x1dab2f['id'],'type':_0x568e25[_0x4b88('0x38')],'sectionId':_0x568e25['id']},{})[_0x4b88('0x32')](function(){return _0x5b4e1c;});}else{return _0x5b4e1c;}})[_0x4b88('0x54')](function(_0x1c828f){logger['error'](_0x4b88('0x62'),_0x1c828f);throw _0x1c828f;});}return _0x5b4e1c;})[_0x4b88('0x32')](respondWithResult(_0x8ef3cd,0xc9))[_0x4b88('0x54')](handleError(_0x8ef3cd,null));};exports['update']=function(_0xc5eeaa,_0x2f05f2){if(_0xc5eeaa['body']['id']){delete _0xc5eeaa[_0x4b88('0x59')]['id'];}return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0xc5eeaa['params']['id']}})['then'](handleEntityNotFound(_0x2f05f2,null))[_0x4b88('0x32')](saveUpdates(_0xc5eeaa[_0x4b88('0x59')],null))[_0x4b88('0x32')](respondWithResult(_0x2f05f2,null))[_0x4b88('0x54')](handleError(_0x2f05f2,null));};exports[_0x4b88('0x31')]=function(_0x1e5729,_0x245016){return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0x1e5729[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0x245016,null))[_0x4b88('0x32')](removeEntity(_0x245016,null))[_0x4b88('0x54')](handleError(_0x245016,null));};exports[_0x4b88('0x63')]=function(_0x52716f,_0x148930){return db[_0x4b88('0x4f')][_0x4b88('0x63')]()[_0x4b88('0x32')](respondWithResult(_0x148930,null))[_0x4b88('0x54')](handleError(_0x148930,null));};exports[_0x4b88('0x64')]=function(_0x37bcbd,_0x4e139f,_0x17770a){var _0x580673={'raw':!![],'where':{}},_0x33e340={},_0x4fc926;return db[_0x4b88('0x4f')]['findOne']({'where':{'id':_0x37bcbd[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0x4e139f,null))[_0x4b88('0x32')](function(_0xa06f08){if(_0xa06f08){_0x4fc926=_0xa06f08['get']({'plain':!![]});_0x33e340[_0x4b88('0x45')]=_['keys'](db['UserChatQueue'][_0x4b88('0x3a')]);_0x33e340['query']=_['keys'](_0x37bcbd['query']);_0x33e340[_0x4b88('0x41')]=_['intersection'](_0x33e340['model'],_0x33e340[_0x4b88('0x3f')]);_0x580673['attributes']=_[_0x4b88('0x42')](_0x33e340[_0x4b88('0x45')],qs[_0x4b88('0x43')](_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x43')]));_0x580673[_0x4b88('0x44')]=_0x580673[_0x4b88('0x44')][_0x4b88('0x57')]?_0x580673[_0x4b88('0x44')]:_0x33e340[_0x4b88('0x45')];if(!_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x46')](_0x4b88('0x47'))){_0x580673[_0x4b88('0x2a')]=qs['limit'](_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x2a')]);_0x580673[_0x4b88('0x28')]=qs[_0x4b88('0x28')](_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x28')]);}_0x580673[_0x4b88('0x48')]=qs[_0x4b88('0x49')](_0x37bcbd['query']['sort']);_0x580673[_0x4b88('0x4c')]=qs[_0x4b88('0x41')](_[_0x4b88('0x65')](_0x37bcbd['query'],_0x33e340[_0x4b88('0x41')]));_0x580673[_0x4b88('0x4c')][_0x4b88('0x66')]=_0xa06f08['id'];if(_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x4a')]){_0x580673['where']=_[_0x4b88('0x4b')](_0x580673['where'],{'$or':_[_0x4b88('0x3e')](_0x580673['attributes'],function(_0x713c8a){var _0x23b0b8={};_0x23b0b8[_0x713c8a]={'$like':'%'+_0x37bcbd[_0x4b88('0x3f')][_0x4b88('0x4a')]+'%'};return _0x23b0b8;})});}_0x580673=_[_0x4b88('0x4b')]({},_0x580673,_0x37bcbd[_0x4b88('0x4e')]);return db['UserChatQueue'][_0x4b88('0x52')](_0x580673);}})[_0x4b88('0x32')](function(_0x315bd2){if(_0x315bd2){return db['User']['findAndCountAll']({'where':{'id':_[_0x4b88('0x3e')](_0x315bd2,_0x4b88('0x67')),'role':_0x4b88('0x68')},'attributes':['id','name',_0x4b88('0x69'),_0x4b88('0x6a'),_0x4b88('0x6b')]});}})[_0x4b88('0x32')](function(_0x31a484){if(_0x31a484){return{'count':_0x31a484[_0x4b88('0x2b')],'rows':_['map'](_0x31a484[_0x4b88('0x53')],function(_0x4a502b){return{'membername':_0x4a502b['name'],'UserId':_0x4a502b['id'],'queue_name':_0x4fc926[_0x4b88('0x38')],'ChatQueueId':_0x4fc926['id'],'interface':util[_0x4b88('0x6c')](_0x4b88('0x6d'),'SIP',_0x4a502b[_0x4b88('0x38')]),'penalty':0x0,'paused':_0x4a502b[_0x4b88('0x69')],'createdAt':_0x4a502b[_0x4b88('0x6b')],'updatedAt':_0x4a502b[_0x4b88('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4b88('0x32')](respondWithFilteredResult(_0x4e139f,_0x580673))[_0x4b88('0x54')](handleError(_0x4e139f,null));};exports[_0x4b88('0x6e')]=function(_0x327950,_0xd5f138,_0x4e7597){var _0x2c3ecd={};var _0x5481c8={};var _0x1b4861;var _0x5cbb95;return db[_0x4b88('0x4f')][_0x4b88('0x6f')]({'where':{'id':_0x327950[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0xd5f138,null))['then'](function(_0x30fc7f){if(_0x30fc7f){_0x1b4861=_0x30fc7f;_0x5481c8['model']=_[_0x4b88('0x40')](db[_0x4b88('0x70')][_0x4b88('0x3a')]);_0x5481c8[_0x4b88('0x3f')]=_[_0x4b88('0x40')](_0x327950['query']);_0x5481c8[_0x4b88('0x41')]=_[_0x4b88('0x42')](_0x5481c8['model'],_0x5481c8['query']);_0x2c3ecd[_0x4b88('0x44')]=_[_0x4b88('0x42')](_0x5481c8[_0x4b88('0x45')],qs['fields'](_0x327950['query']['fields']));_0x2c3ecd['attributes']=_0x2c3ecd[_0x4b88('0x44')][_0x4b88('0x57')]?_0x2c3ecd[_0x4b88('0x44')]:_0x5481c8[_0x4b88('0x45')];_0x2c3ecd[_0x4b88('0x48')]=qs[_0x4b88('0x49')](_0x327950['query'][_0x4b88('0x49')]);_0x2c3ecd['where']=qs[_0x4b88('0x41')](_[_0x4b88('0x65')](_0x327950[_0x4b88('0x3f')],_0x5481c8[_0x4b88('0x41')]));if(_0x327950[_0x4b88('0x3f')][_0x4b88('0x4a')]){_0x2c3ecd[_0x4b88('0x4c')]=_['merge'](_0x2c3ecd[_0x4b88('0x4c')],{'$or':_['map'](_0x2c3ecd[_0x4b88('0x44')],function(_0x358010){var _0x4ae8a0={};_0x4ae8a0[_0x358010]={'$like':'%'+_0x327950['query'][_0x4b88('0x4a')]+'%'};return _0x4ae8a0;})});}_0x2c3ecd=_[_0x4b88('0x4b')]({},_0x2c3ecd,_0x327950['options']);return _0x1b4861['getTeams'](_0x2c3ecd);}})[_0x4b88('0x32')](function(_0x133b8e){if(_0x133b8e){_0x5cbb95=_0x133b8e['length'];if(!_0x327950['query'][_0x4b88('0x46')](_0x4b88('0x47'))){_0x2c3ecd['limit']=qs['limit'](_0x327950['query']['limit']);_0x2c3ecd[_0x4b88('0x28')]=qs[_0x4b88('0x28')](_0x327950[_0x4b88('0x3f')][_0x4b88('0x28')]);}return _0x1b4861['getTeams'](_0x2c3ecd);}})[_0x4b88('0x32')](function(_0x43c0aa){if(_0x43c0aa){return _0x43c0aa?{'count':_0x5cbb95,'rows':_0x43c0aa}:null;}})[_0x4b88('0x32')](respondWithResult(_0xd5f138,null))[_0x4b88('0x54')](handleError(_0xd5f138,null));};exports[_0x4b88('0x71')]=function(_0x5b3518,_0x402a8b,_0x55112d){var _0x1703d7=_0x5b3518['body'][_0x4b88('0x72')];return db['Team'][_0x4b88('0x52')]({'where':{'id':_0x1703d7},'attributes':['id'],'include':[{'model':db[_0x4b88('0x73')],'as':_0x4b88('0x74'),'attributes':['id',_0x4b88('0x38'),_0x4b88('0x75'),_0x4b88('0x76'),_0x4b88('0x77')],'raw':!![]}]})[_0x4b88('0x32')](function(_0x2de889){if(_0x2de889){var _0x44224c=_[_0x4b88('0x78')](_0x2de889,function(_0x40ba5b){var _0x47509=_0x40ba5b[_0x4b88('0x5b')]({'plain':!![]});return _0x47509[_0x4b88('0x74')];});return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0x5b3518[_0x4b88('0x56')]['id']}})['then'](function(_0x236fde){return db[_0x4b88('0x79')]['transaction'](function(_0x2cf041){return _0x236fde[_0x4b88('0x71')](_0x1703d7,{'transaction':_0x2cf041})['then'](function(){return BPromise[_0x4b88('0x7a')](_0x44224c,function(_0x3650dc){return db['UserChatQueue'][_0x4b88('0x7b')]({'where':{'UserId':_0x3650dc['id'],'ChatQueueId':_0x5b3518[_0x4b88('0x56')]['id']},'transaction':_0x2cf041});});})[_0x4b88('0x32')](function(){_0x44224c[_0x4b88('0x7c')](function(_0x5b4cf1){socket[_0x4b88('0x7d')]('userChatQueue:save',{'UserId':_0x5b4cf1['id'],'ChatQueueId':_0x236fde['id']});});});});});}})[_0x4b88('0x32')](respondWithStatusCode(_0x402a8b,null))[_0x4b88('0x54')](handleError(_0x402a8b,null));};exports[_0x4b88('0x7e')]=function(_0xc8522,_0x1e5b44,_0x37a4ac){return db[_0x4b88('0x70')][_0x4b88('0x52')]({'where':{'id':_0xc8522[_0x4b88('0x3f')][_0x4b88('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4b88('0x74'),'attributes':['id'],'raw':!![]}]})[_0x4b88('0x32')](handleEntityNotFound(_0x1e5b44,null))[_0x4b88('0x32')](function(_0x1881e7){var _0x38e8ee=_['map'](_0x1881e7,'id');var _0x38ee4e=[];var _0x2c87dc=[];var _0x1dff22=squel[_0x4b88('0x7f')]();_0x1dff22['field'](_0x4b88('0x80'))[_0x4b88('0x81')](_0x4b88('0x82'),'tq')[_0x4b88('0x83')]('user_has_teams','ut',_0x4b88('0x84'))[_0x4b88('0x4c')](_0x4b88('0x85'),_0xc8522[_0x4b88('0x56')]['id']);for(var _0xf0f57a=0x0;_0xf0f57a<_0x1881e7[_0x4b88('0x57')];_0xf0f57a+=0x1){let _0x27b298=_0x1881e7[_0xf0f57a];for(var _0x581588=0x0;_0x581588<_0x27b298['Agents'][_0x4b88('0x57')];_0x581588+=0x1){let _0x2716ee=_0x27b298['Agents'][_0x581588];var _0x2c122d=_0x1dff22[_0x4b88('0x86')]();_0x2c122d[_0x4b88('0x4c')](_0x4b88('0x87'),_0x2716ee['id']);_0x2c87dc['push'](db[_0x4b88('0x79')][_0x4b88('0x3f')](_0x2c122d[_0x4b88('0x88')](),{'type':db[_0x4b88('0x79')][_0x4b88('0x89')][_0x4b88('0x8a')]})[_0x4b88('0x32')](function(_0xf2ad3a){if(_0xf2ad3a[_0x4b88('0x57')]===0x1){return _0x2716ee['id'];}else{var _0x4df595=_[_0x4b88('0x8b')](_[_0x4b88('0x3e')](_0xf2ad3a,_0x4b88('0x8c')),function(_0x307b50){return _[_0x4b88('0x8d')](_0x38e8ee,_0x307b50);});if(_0x4df595){return _0x2716ee['id'];}}}));}}return BPromise['all'](_0x2c87dc)[_0x4b88('0x32')](function(_0x2f05fa){_0x38ee4e=_(_0x38ee4e)['union'](_0x2f05fa)[_0x4b88('0x8e')]()[_0x4b88('0x8f')]();return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0xc8522[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](function(_0x1d71d9){return db[_0x4b88('0x79')][_0x4b88('0x90')](function(_0x512c6a){return _0x1d71d9[_0x4b88('0x7e')](_0xc8522['query'][_0x4b88('0x72')],{'transaction':_0x512c6a})['then'](function(){if(!_['isEmpty'](_0x38ee4e)){return _0x1d71d9[_0x4b88('0x91')](_0x38ee4e,{'transaction':_0x512c6a});}})['then'](function(){_0x38ee4e[_0x4b88('0x7c')](function(_0x344ef1){socket['emit'](_0x4b88('0x92'),{'UserId':_0x344ef1,'ChatQueueId':_0x1d71d9['id']});});});});});});})[_0x4b88('0x32')](respondWithStatusCode(_0x1e5b44,null))[_0x4b88('0x54')](handleError(_0x1e5b44,null));};exports[_0x4b88('0x93')]=function(_0x3d4bbb,_0x51df60,_0x581c4a){return db[_0x4b88('0x4f')][_0x4b88('0x5f')]({'where':{'id':_0x3d4bbb['params']['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0x51df60,null))[_0x4b88('0x32')](function(_0x3a3a5a){if(_0x3a3a5a){return _0x3a3a5a[_0x4b88('0x93')](_0x3d4bbb[_0x4b88('0x59')][_0x4b88('0x72')],_[_0x4b88('0x94')](_0x3d4bbb[_0x4b88('0x59')],[_0x4b88('0x72'),'id'])||{})['spread'](function(_0x946117){for(var _0x18c91b=0x0;_0x18c91b<_0x3d4bbb[_0x4b88('0x59')][_0x4b88('0x72')]['length'];_0x18c91b+=0x1){socket[_0x4b88('0x7d')]('userChatQueue:save',{'UserId':Number(_0x3d4bbb[_0x4b88('0x59')][_0x4b88('0x72')][_0x18c91b]),'ChatQueueId':Number(_0x3d4bbb[_0x4b88('0x56')]['id'])});}return _0x946117;});}})[_0x4b88('0x32')](respondWithResult(_0x51df60,null))['catch'](handleError(_0x51df60,null));};exports[_0x4b88('0x91')]=function(_0x47bba4,_0x1cac27,_0x11408a){return db['ChatQueue'][_0x4b88('0x5f')]({'where':{'id':_0x47bba4[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0x1cac27,null))[_0x4b88('0x32')](function(_0x24a2b8){if(_0x24a2b8){return _0x24a2b8[_0x4b88('0x91')](_0x47bba4['query']['ids'])[_0x4b88('0x32')](function(){if(_[_0x4b88('0x95')](_0x47bba4[_0x4b88('0x3f')][_0x4b88('0x72')])){for(var _0x26489d=0x0;_0x26489d<_0x47bba4[_0x4b88('0x3f')][_0x4b88('0x72')][_0x4b88('0x57')];_0x26489d+=0x1){socket[_0x4b88('0x7d')](_0x4b88('0x92'),{'UserId':Number(_0x47bba4[_0x4b88('0x3f')]['ids'][_0x26489d]),'ChatQueueId':Number(_0x47bba4[_0x4b88('0x56')]['id'])});}}else{socket[_0x4b88('0x7d')](_0x4b88('0x92'),{'UserId':Number(_0x47bba4[_0x4b88('0x3f')][_0x4b88('0x72')]),'ChatQueueId':Number(_0x47bba4[_0x4b88('0x56')]['id'])});}});}})[_0x4b88('0x32')](respondWithStatusCode(_0x1cac27,null))[_0x4b88('0x54')](handleError(_0x1cac27,null));};exports[_0x4b88('0x96')]=function(_0x433e9e,_0xeedcee,_0x518f71){var _0x310ae3={};var _0x4df3ad={};var _0x2fa4ac;var _0x26c7f9;return db[_0x4b88('0x4f')][_0x4b88('0x6f')]({'where':{'id':_0x433e9e[_0x4b88('0x56')]['id']}})[_0x4b88('0x32')](handleEntityNotFound(_0xeedcee,null))[_0x4b88('0x32')](function(_0x132f91){if(_0x132f91){_0x2fa4ac=_0x132f91;_0x4df3ad[_0x4b88('0x45')]=_[_0x4b88('0x40')](db['User'][_0x4b88('0x3a')]);_0x4df3ad['query']=_[_0x4b88('0x40')](_0x433e9e[_0x4b88('0x3f')]);_0x4df3ad['filters']=_[_0x4b88('0x42')](_0x4df3ad['model'],_0x4df3ad['query']);_0x310ae3[_0x4b88('0x44')]=_[_0x4b88('0x42')](_0x4df3ad[_0x4b88('0x45')],qs[_0x4b88('0x43')](_0x433e9e['query'][_0x4b88('0x43')]));_0x310ae3[_0x4b88('0x44')]=_0x310ae3['attributes'][_0x4b88('0x57')]?_0x310ae3[_0x4b88('0x44')]:_0x4df3ad[_0x4b88('0x45')];_0x310ae3[_0x4b88('0x48')]=qs['sort'](_0x433e9e['query']['sort']);_0x310ae3[_0x4b88('0x4c')]=qs[_0x4b88('0x41')](_[_0x4b88('0x65')](_0x433e9e['query'],_0x4df3ad['filters']));if(_0x433e9e[_0x4b88('0x3f')][_0x4b88('0x4a')]){_0x310ae3[_0x4b88('0x4c')]=_[_0x4b88('0x4b')](_0x310ae3[_0x4b88('0x4c')],{'$or':_['map'](_0x310ae3[_0x4b88('0x44')],function(_0x39d5a8){var _0x152b38={};_0x152b38[_0x39d5a8]={'$like':'%'+_0x433e9e['query'][_0x4b88('0x4a')]+'%'};return _0x152b38;})});}_0x310ae3=_[_0x4b88('0x4b')]({},_0x310ae3,_0x433e9e[_0x4b88('0x4e')]);return _0x2fa4ac['getAgents'](_0x310ae3);}})[_0x4b88('0x32')](function(_0x3a54ff){if(_0x3a54ff){_0x26c7f9=_0x3a54ff['length'];if(!_0x433e9e[_0x4b88('0x3f')]['hasOwnProperty'](_0x4b88('0x47'))){_0x310ae3['limit']=qs[_0x4b88('0x2a')](_0x433e9e[_0x4b88('0x3f')]['limit']);_0x310ae3['offset']=qs[_0x4b88('0x28')](_0x433e9e[_0x4b88('0x3f')]['offset']);}return _0x2fa4ac[_0x4b88('0x96')](_0x310ae3);}})['then'](function(_0x416f84){if(_0x416f84){return _0x416f84?{'count':_0x26c7f9,'rows':_0x416f84}:null;}})[_0x4b88('0x32')](respondWithResult(_0xeedcee,null))[_0x4b88('0x54')](handleError(_0xeedcee,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 722948d..d47b68a 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 _0x62b3=['save','update','remove','emit','hasOwnProperty','hook','setMaxListeners'];(function(_0x3c7d06,_0x3a8eb6){var _0x14be70=function(_0x14c343){while(--_0x14c343){_0x3c7d06['push'](_0x3c7d06['shift']());}};_0x14be70(++_0x3a8eb6);}(_0x62b3,0x19c));var _0x362b=function(_0x9723e4,_0x52f61c){_0x9723e4=_0x9723e4-0x0;var _0x3393e9=_0x62b3[_0x9723e4];return _0x3393e9;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x362b('0x0')](0x0);var events={'afterCreate':_0x362b('0x1'),'afterUpdate':_0x362b('0x2'),'afterDestroy':_0x362b('0x3')};function emitEvent(_0x18b4e8){return function(_0x5b65b8,_0x1a5ed3,_0x16557d){ChatQueueEvents[_0x362b('0x4')](_0x18b4e8+':'+_0x5b65b8['id'],_0x5b65b8);ChatQueueEvents[_0x362b('0x4')](_0x18b4e8,_0x5b65b8);_0x16557d(null);};}for(var e in events){if(events[_0x362b('0x5')](e)){var event=events[e];ChatQueue[_0x362b('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0x8fb7=['events','../../mysqldb','ChatQueue','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x3d84b2,_0x566767){var _0x4e6b72=function(_0x9f6318){while(--_0x9f6318){_0x3d84b2['push'](_0x3d84b2['shift']());}};_0x4e6b72(++_0x566767);}(_0x8fb7,0x1a4));var _0x78fb=function(_0x2d6616,_0x37278c){_0x2d6616=_0x2d6616-0x0;var _0x509c8a=_0x8fb7[_0x2d6616];return _0x509c8a;};'use strict';var EventEmitter=require(_0x78fb('0x0'));var ChatQueue=require(_0x78fb('0x1'))['db'][_0x78fb('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x78fb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x78fb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2abc9c){return function(_0x4a96e6,_0x2febcf,_0x2a8416){ChatQueueEvents[_0x78fb('0x5')](_0x2abc9c+':'+_0x4a96e6['id'],_0x4a96e6);ChatQueueEvents[_0x78fb('0x5')](_0x2abc9c,_0x4a96e6);_0x2a8416(null);};}for(var e in events){if(events[_0x78fb('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 44ee8d2..6b3b295 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 _0x2f23=['moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash'];(function(_0x17ebb6,_0x465af7){var _0x32ec22=function(_0x160ff0){while(--_0x160ff0){_0x17ebb6['push'](_0x17ebb6['shift']());}};_0x32ec22(++_0x465af7);}(_0x2f23,0xf9));var _0x32f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f23[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32f2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x32f2('0x1'));var BPromise=require(_0x32f2('0x2'));var rp=require(_0x32f2('0x3'));var fs=require('fs');var path=require(_0x32f2('0x4'));var rimraf=require(_0x32f2('0x5'));var config=require('../../config/environment');var attributes=require(_0x32f2('0x6'));module['exports']=function(_0x35444f,_0x2b04fb){return _0x35444f[_0x32f2('0x7')](_0x32f2('0x8'),attributes,{'tableName':_0x32f2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa870=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x3b2412,_0x3a2652){var _0x47bc00=function(_0x10b986){while(--_0x10b986){_0x3b2412['push'](_0x3b2412['shift']());}};_0x47bc00(++_0x3a2652);}(_0xa870,0xc3));var _0x0a87=function(_0xef7090,_0x9de7dd){_0xef7090=_0xef7090-0x0;var _0x263453=_0xa870[_0xef7090];return _0x263453;};'use strict';var _=require(_0x0a87('0x0'));var util=require(_0x0a87('0x1'));var logger=require(_0x0a87('0x2'))('api');var moment=require(_0x0a87('0x3'));var BPromise=require(_0x0a87('0x4'));var rp=require(_0x0a87('0x5'));var fs=require('fs');var path=require(_0x0a87('0x6'));var rimraf=require(_0x0a87('0x7'));var config=require(_0x0a87('0x8'));var attributes=require(_0x0a87('0x9'));module[_0x0a87('0xa')]=function(_0x3fc538,_0x1e8bae){return _0x3fc538[_0x0a87('0xb')](_0x0a87('0xc'),attributes,{'tableName':'chat_queues','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 c2a9f22..3557705 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 _0xbb35=['include','ShowChatQueue','ChatQueue','find','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','GetChatQueue','findAll','options','where','attributes','limit','map','model'];(function(_0x10bf44,_0x33564a){var _0x542225=function(_0x4d617d){while(--_0x4d617d){_0x10bf44['push'](_0x10bf44['shift']());}};_0x542225(++_0x33564a);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x54d8c5,_0x236001){_0x54d8c5=_0x54d8c5-0x0;var _0x210790=_0xbb35[_0x54d8c5];return _0x210790;};'use strict';var _=require('lodash');var util=require(_0x5bb3('0x0'));var moment=require(_0x5bb3('0x1'));var BPromise=require(_0x5bb3('0x2'));var rs=require(_0x5bb3('0x3'));var fs=require('fs');var Redis=require(_0x5bb3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5bb3('0x5'));var logger=require(_0x5bb3('0x6'))(_0x5bb3('0x7'));var config=require(_0x5bb3('0x8'));var jayson=require(_0x5bb3('0x9'));var client=jayson[_0x5bb3('0xa')][_0x5bb3('0xb')]({'port':0x232a});config[_0x5bb3('0xc')]=_[_0x5bb3('0xd')](config['redis'],{'host':_0x5bb3('0xe'),'port':0x18eb});var socket=require(_0x5bb3('0xf'))(new Redis(config[_0x5bb3('0xc')]));require(_0x5bb3('0x10'))['register'](socket);function respondWithRpcPromise(_0x399f28,_0x5621a8,_0x4035d1){return new BPromise(function(_0x5a8b3b,_0x12513f){return client[_0x5bb3('0x11')](_0x399f28,_0x4035d1)[_0x5bb3('0x12')](function(_0x3212c8){logger[_0x5bb3('0x13')]('ChatQueue,\x20%s,\x20%s',_0x5621a8,_0x5bb3('0x14'));logger[_0x5bb3('0x15')](_0x5bb3('0x16'),_0x5621a8,'request\x20sent',JSON[_0x5bb3('0x17')](_0x3212c8));if(_0x3212c8[_0x5bb3('0x18')]){if(_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x19')]===0x1f4){logger[_0x5bb3('0x18')](_0x5bb3('0x1a'),_0x5621a8,_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);return _0x12513f(_0x3212c8['error']['message']);}logger['error'](_0x5bb3('0x1a'),_0x5621a8,_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);return _0x5a8b3b(_0x3212c8[_0x5bb3('0x18')][_0x5bb3('0x1b')]);}else{logger[_0x5bb3('0x13')](_0x5bb3('0x1a'),_0x5621a8,_0x5bb3('0x14'));_0x5a8b3b(_0x3212c8[_0x5bb3('0x1c')][_0x5bb3('0x1b')]);}})['catch'](function(_0x5a541b){logger[_0x5bb3('0x18')](_0x5bb3('0x1a'),_0x5621a8,_0x5a541b);_0x12513f(_0x5a541b);});});}exports[_0x5bb3('0x1d')]=function(_0x442ee2){var _0x197d38=this;return new Promise(function(_0x3fe551,_0x2630b4){return db['ChatQueue'][_0x5bb3('0x1e')]({'raw':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2['options'][_0x5bb3('0x20')]||null:null,'attributes':_0x442ee2['options']?_0x442ee2[_0x5bb3('0x1f')][_0x5bb3('0x21')]||null:null,'limit':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')][_0x5bb3('0x22')]||null:null,'include':_0x442ee2[_0x5bb3('0x1f')]?_0x442ee2[_0x5bb3('0x1f')]['include']?_[_0x5bb3('0x23')](_0x442ee2[_0x5bb3('0x1f')]['include'],function(_0x439ee4){return{'model':db[_0x439ee4[_0x5bb3('0x24')]],'as':_0x439ee4['as'],'attributes':_0x439ee4[_0x5bb3('0x21')],'include':_0x439ee4[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x439ee4[_0x5bb3('0x25')],function(_0x405eea){return{'model':db[_0x405eea[_0x5bb3('0x24')]],'as':_0x405eea['as'],'attributes':_0x405eea['attributes'],'include':_0x405eea['include']?_[_0x5bb3('0x23')](_0x405eea['include'],function(_0x182516){return{'model':db[_0x182516['model']],'as':_0x182516['as'],'attributes':_0x182516[_0x5bb3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5bb3('0x12')](function(_0x104efe){logger['info'](_0x5bb3('0x1d'),_0x442ee2);logger[_0x5bb3('0x15')](_0x5bb3('0x1d'),_0x442ee2,JSON[_0x5bb3('0x17')](_0x104efe));_0x3fe551(_0x104efe);})['catch'](function(_0x55276b){logger[_0x5bb3('0x18')]('GetChatQueue',_0x55276b[_0x5bb3('0x1b')],_0x442ee2);_0x2630b4(_0x197d38[_0x5bb3('0x18')](0x1f4,_0x55276b['message']));});});};exports[_0x5bb3('0x26')]=function(_0xd935a7){var _0x3d7115=this;return new Promise(function(_0xe5981a,_0x46ba29){return db[_0x5bb3('0x27')][_0x5bb3('0x28')]({'raw':_0xd935a7['options']?_0xd935a7[_0x5bb3('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x20')]||null:null,'attributes':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7['options']['attributes']||null:null,'include':_0xd935a7[_0x5bb3('0x1f')]?_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0xd935a7[_0x5bb3('0x1f')][_0x5bb3('0x25')],function(_0x4a7678){return{'model':db[_0x4a7678[_0x5bb3('0x24')]],'as':_0x4a7678['as'],'attributes':_0x4a7678[_0x5bb3('0x21')],'include':_0x4a7678[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x4a7678[_0x5bb3('0x25')],function(_0x5df4c5){return{'model':db[_0x5df4c5[_0x5bb3('0x24')]],'as':_0x5df4c5['as'],'attributes':_0x5df4c5[_0x5bb3('0x21')],'include':_0x5df4c5[_0x5bb3('0x25')]?_[_0x5bb3('0x23')](_0x5df4c5[_0x5bb3('0x25')],function(_0x24ff2c){return{'model':db[_0x24ff2c[_0x5bb3('0x24')]],'as':_0x24ff2c['as'],'attributes':_0x24ff2c[_0x5bb3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5bb3('0x12')](function(_0x19c820){logger['info'](_0x5bb3('0x26'),_0xd935a7);logger[_0x5bb3('0x15')](_0x5bb3('0x26'),_0xd935a7,JSON[_0x5bb3('0x17')](_0x19c820));_0xe5981a(_0x19c820);})[_0x5bb3('0x29')](function(_0x40cc9d){logger[_0x5bb3('0x18')](_0x5bb3('0x26'),_0x40cc9d[_0x5bb3('0x1b')],_0xd935a7);_0x46ba29(_0x3d7115[_0x5bb3('0x18')](0x1f4,_0x40cc9d[_0x5bb3('0x1b')]));});});};
\ No newline at end of file
+var _0x0f42=['then','GetChatQueue','debug','ShowChatQueue','ChatQueue','where','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','attributes','include','model','map'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0x0f42,0x126));var _0x20f4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0f42[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x20f4('0x0'));var util=require(_0x20f4('0x1'));var moment=require(_0x20f4('0x2'));var BPromise=require(_0x20f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x20f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f4('0x5'));var logger=require('../../config/logger')(_0x20f4('0x6'));var config=require(_0x20f4('0x7'));var jayson=require(_0x20f4('0x8'));var client=jayson['client'][_0x20f4('0x9')]({'port':0x232a});config[_0x20f4('0xa')]=_['defaults'](config[_0x20f4('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x20f4('0xb'))['register'](socket);function respondWithRpcPromise(_0x41c1bb,_0x30f2ef,_0x395fda){return new BPromise(function(_0x1ee8c6,_0x51ab58){return client[_0x20f4('0xc')](_0x41c1bb,_0x395fda)['then'](function(_0x2383ce){logger[_0x20f4('0xd')](_0x20f4('0xe'),_0x30f2ef,_0x20f4('0xf'));logger['debug'](_0x20f4('0x10'),_0x30f2ef,_0x20f4('0xf'),JSON[_0x20f4('0x11')](_0x2383ce));if(_0x2383ce[_0x20f4('0x12')]){if(_0x2383ce[_0x20f4('0x12')][_0x20f4('0x13')]===0x1f4){logger[_0x20f4('0x12')](_0x20f4('0xe'),_0x30f2ef,_0x2383ce[_0x20f4('0x12')][_0x20f4('0x14')]);return _0x51ab58(_0x2383ce[_0x20f4('0x12')]['message']);}logger['error'](_0x20f4('0xe'),_0x30f2ef,_0x2383ce[_0x20f4('0x12')][_0x20f4('0x14')]);return _0x1ee8c6(_0x2383ce[_0x20f4('0x12')][_0x20f4('0x14')]);}else{logger['info'](_0x20f4('0xe'),_0x30f2ef,_0x20f4('0xf'));_0x1ee8c6(_0x2383ce[_0x20f4('0x15')]['message']);}})[_0x20f4('0x16')](function(_0xd8de3b){logger[_0x20f4('0x12')]('ChatQueue,\x20%s,\x20%s',_0x30f2ef,_0xd8de3b);_0x51ab58(_0xd8de3b);});});}exports['GetChatQueue']=function(_0x323d19){var _0x56a89f=this;return new Promise(function(_0x5d646a,_0x83ee22){return db['ChatQueue'][_0x20f4('0x17')]({'raw':_0x323d19[_0x20f4('0x18')]?_0x323d19[_0x20f4('0x18')][_0x20f4('0x19')]===undefined?!![]:![]:!![],'where':_0x323d19[_0x20f4('0x18')]?_0x323d19[_0x20f4('0x18')]['where']||null:null,'attributes':_0x323d19[_0x20f4('0x18')]?_0x323d19[_0x20f4('0x18')][_0x20f4('0x1a')]||null:null,'limit':_0x323d19[_0x20f4('0x18')]?_0x323d19[_0x20f4('0x18')]['limit']||null:null,'include':_0x323d19['options']?_0x323d19[_0x20f4('0x18')][_0x20f4('0x1b')]?_['map'](_0x323d19[_0x20f4('0x18')][_0x20f4('0x1b')],function(_0x50a2c1){return{'model':db[_0x50a2c1[_0x20f4('0x1c')]],'as':_0x50a2c1['as'],'attributes':_0x50a2c1[_0x20f4('0x1a')],'include':_0x50a2c1['include']?_[_0x20f4('0x1d')](_0x50a2c1[_0x20f4('0x1b')],function(_0x104229){return{'model':db[_0x104229[_0x20f4('0x1c')]],'as':_0x104229['as'],'attributes':_0x104229[_0x20f4('0x1a')],'include':_0x104229[_0x20f4('0x1b')]?_[_0x20f4('0x1d')](_0x104229[_0x20f4('0x1b')],function(_0x365e5a){return{'model':db[_0x365e5a[_0x20f4('0x1c')]],'as':_0x365e5a['as'],'attributes':_0x365e5a[_0x20f4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x20f4('0x1e')](function(_0xf47be4){logger[_0x20f4('0xd')](_0x20f4('0x1f'),_0x323d19);logger[_0x20f4('0x20')](_0x20f4('0x1f'),_0x323d19,JSON['stringify'](_0xf47be4));_0x5d646a(_0xf47be4);})['catch'](function(_0x4d4edc){logger[_0x20f4('0x12')](_0x20f4('0x1f'),_0x4d4edc[_0x20f4('0x14')],_0x323d19);_0x83ee22(_0x56a89f['error'](0x1f4,_0x4d4edc['message']));});});};exports[_0x20f4('0x21')]=function(_0x1f85c8){var _0x38ac33=this;return new Promise(function(_0x40e3bb,_0x5d56e8){return db[_0x20f4('0x22')]['find']({'raw':_0x1f85c8[_0x20f4('0x18')]?_0x1f85c8[_0x20f4('0x18')][_0x20f4('0x19')]===undefined?!![]:![]:!![],'where':_0x1f85c8[_0x20f4('0x18')]?_0x1f85c8[_0x20f4('0x18')][_0x20f4('0x23')]||null:null,'attributes':_0x1f85c8[_0x20f4('0x18')]?_0x1f85c8[_0x20f4('0x18')][_0x20f4('0x1a')]||null:null,'include':_0x1f85c8['options']?_0x1f85c8[_0x20f4('0x18')][_0x20f4('0x1b')]?_[_0x20f4('0x1d')](_0x1f85c8['options']['include'],function(_0x24698a){return{'model':db[_0x24698a['model']],'as':_0x24698a['as'],'attributes':_0x24698a['attributes'],'include':_0x24698a['include']?_[_0x20f4('0x1d')](_0x24698a[_0x20f4('0x1b')],function(_0xbc17cc){return{'model':db[_0xbc17cc[_0x20f4('0x1c')]],'as':_0xbc17cc['as'],'attributes':_0xbc17cc['attributes'],'include':_0xbc17cc['include']?_[_0x20f4('0x1d')](_0xbc17cc[_0x20f4('0x1b')],function(_0xd250e7){return{'model':db[_0xd250e7['model']],'as':_0xd250e7['as'],'attributes':_0xd250e7[_0x20f4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x20f4('0x1e')](function(_0x190120){logger[_0x20f4('0xd')](_0x20f4('0x21'),_0x1f85c8);logger[_0x20f4('0x20')](_0x20f4('0x21'),_0x1f85c8,JSON[_0x20f4('0x11')](_0x190120));_0x40e3bb(_0x190120);})[_0x20f4('0x16')](function(_0x35e426){logger['error'](_0x20f4('0x21'),_0x35e426[_0x20f4('0x14')],_0x1f85c8);_0x5d56e8(_0x38ac33[_0x20f4('0x12')](0x1f4,_0x35e426[_0x20f4('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 160499e..9360885 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 _0xf3cd=['remove','update','emit','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3f1b36,_0x205b14){_0x3f1b36=_0x3f1b36-0x0;var _0x56a704=_0xf3cd[_0x3f1b36];return _0x56a704;};'use strict';var ChatQueueEvents=require(_0xdf3c('0x0'));var events=[_0xdf3c('0x1'),_0xdf3c('0x2'),_0xdf3c('0x3')];function createListener(_0x1839ec,_0x433a7f){return function(_0x54db05){_0x433a7f[_0xdf3c('0x4')](_0x1839ec,_0x54db05);};}function removeListener(_0x71b446,_0x9f71cb){return function(){ChatQueueEvents['removeListener'](_0x71b446,_0x9f71cb);};}exports[_0xdf3c('0x5')]=function(_0x17d42a){for(var _0x1313d5=0x0,_0x1f0601=events[_0xdf3c('0x6')];_0x1313d5<_0x1f0601;_0x1313d5++){var _0x28edae=events[_0x1313d5];var _0x52c073=createListener(_0xdf3c('0x7')+_0x28edae,_0x17d42a);ChatQueueEvents['on'](_0x28edae,_0x52c073);}};
\ No newline at end of file
+var _0x80d9=['./chatQueue.events','remove','update','emit','removeListener','chatQueue:'];(function(_0x19f92d,_0x55e990){var _0x4c7457=function(_0x102a61){while(--_0x102a61){_0x19f92d['push'](_0x19f92d['shift']());}};_0x4c7457(++_0x55e990);}(_0x80d9,0x15c));var _0x980d=function(_0x1eedfd,_0x133f0f){_0x1eedfd=_0x1eedfd-0x0;var _0x10be6c=_0x80d9[_0x1eedfd];return _0x10be6c;};'use strict';var ChatQueueEvents=require(_0x980d('0x0'));var events=['save',_0x980d('0x1'),_0x980d('0x2')];function createListener(_0xac96e5,_0x5d4b87){return function(_0x358d0a){_0x5d4b87[_0x980d('0x3')](_0xac96e5,_0x358d0a);};}function removeListener(_0x38d1b9,_0x279d93){return function(){ChatQueueEvents[_0x980d('0x4')](_0x38d1b9,_0x279d93);};}exports['register']=function(_0x4c3533){for(var _0x2fd4b9=0x0,_0x50854e=events['length'];_0x2fd4b9<_0x50854e;_0x2fd4b9++){var _0x7e96f7=events[_0x2fd4b9];var _0x758fc3=createListener(_0x980d('0x5')+_0x7e96f7,_0x4c3533);ChatQueueEvents['on'](_0x7e96f7,_0x758fc3);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index ea45887..276c292 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x15a7c5,_0x64f633){var _0x5aa80d=function(_0x3c4e90){while(--_0x3c4e90){_0x15a7c5['push'](_0x15a7c5['shift']());}};_0x5aa80d(++_0x64f633);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x4b29d4,_0x1a2af7){var _0x4004f5=function(_0x4966a5){while(--_0x4966a5){_0x4b29d4['push'](_0x4b29d4['shift']());}};_0x4004f5(++_0x1a2af7);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 1f85bd4..372ad47 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 _0xfcfc=['DATE','sequelize','exports','STRING'];(function(_0x5c67f9,_0x5f4d01){var _0x3c86b6=function(_0x551c0f){while(--_0x551c0f){_0x5c67f9['push'](_0x5c67f9['shift']());}};_0x3c86b6(++_0x5f4d01);}(_0xfcfc,0xf9));var _0xcfcf=function(_0x35a21d,_0x3c92d9){_0x35a21d=_0x35a21d-0x0;var _0x564e89=_0xfcfc[_0x35a21d];return _0x564e89;};'use strict';var moment=require('moment');var Sequelize=require(_0xcfcf('0x0'));module[_0xcfcf('0x1')]={'uniqueid':{'type':Sequelize[_0xcfcf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xcfcf('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcfcf('0x3')]},'reason':{'type':Sequelize[_0xcfcf('0x2')]}};
\ No newline at end of file
+var _0x1921=['STRING','DATE','moment','sequelize','exports'];(function(_0x10706f,_0x292158){var _0xa40f54=function(_0x2e0468){while(--_0x2e0468){_0x10706f['push'](_0x10706f['shift']());}};_0xa40f54(++_0x292158);}(_0x1921,0xb1));var _0x1192=function(_0x2c2987,_0xa032ab){_0x2c2987=_0x2c2987-0x0;var _0x2ad65d=_0x1921[_0x2c2987];return _0x2ad65d;};'use strict';var moment=require(_0x1192('0x0'));var Sequelize=require(_0x1192('0x1'));module[_0x1192('0x2')]={'uniqueid':{'type':Sequelize[_0x1192('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1192('0x4')]},'leaveAt':{'type':Sequelize[_0x1192('0x4')]},'acceptAt':{'type':Sequelize[_0x1192('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index bbc27af..dbc0dae 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 _0x363e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatQueueReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x5da8b9,_0xd99e62){var _0x2e08d8=function(_0x3844c5){while(--_0x3844c5){_0x5da8b9['push'](_0x5da8b9['shift']());}};_0x2e08d8(++_0xd99e62);}(_0x363e,0x179));var _0xe363=function(_0x27ccfa,_0x4885d1){_0x27ccfa=_0x27ccfa-0x0;var _0x2f4f2=_0x363e[_0x27ccfa];return _0x2f4f2;};'use strict';var emlformat=require(_0xe363('0x0'));var rimraf=require(_0xe363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe363('0x2'));var rp=require(_0xe363('0x3'));var moment=require(_0xe363('0x4'));var BPromise=require(_0xe363('0x5'));var Mustache=require(_0xe363('0x6'));var util=require(_0xe363('0x7'));var path=require(_0xe363('0x8'));var sox=require(_0xe363('0x9'));var csv=require(_0xe363('0xa'));var ejs=require(_0xe363('0xb'));var fs=require('fs');var fs_extra=require(_0xe363('0xc'));var _=require('lodash');var squel=require(_0xe363('0xd'));var crypto=require(_0xe363('0xe'));var jsforce=require(_0xe363('0xf'));var deskjs=require(_0xe363('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe363('0x11'));var Papa=require(_0xe363('0x12'));var Redis=require(_0xe363('0x13'));var authService=require(_0xe363('0x14'));var qs=require(_0xe363('0x15'));var as=require(_0xe363('0x16'));var hardwareService=require(_0xe363('0x17'));var logger=require('../../config/logger')(_0xe363('0x18'));var utils=require(_0xe363('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe363('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1fb0,_0x8b6974){_0x8b6974=_0x8b6974||0xcc;return function(_0x21cb92){if(_0x21cb92){return _0x4e1fb0[_0xe363('0x1b')](_0x8b6974);}return _0x4e1fb0[_0xe363('0x1c')](_0x8b6974)[_0xe363('0x1d')]();};}function respondWithResult(_0x563fbf,_0x17ff61){_0x17ff61=_0x17ff61||0xc8;return function(_0x22b227){if(_0x22b227){return _0x563fbf['status'](_0x17ff61)[_0xe363('0x1e')](_0x22b227);}};}function respondWithFilteredResult(_0x2ad0e9,_0x52e6c6){return function(_0x3c74f9){if(_0x3c74f9){var _0x73ef9a=typeof _0x52e6c6['offset']===_0xe363('0x1f')&&typeof _0x52e6c6[_0xe363('0x20')]==='undefined';var _0xecbe2c=_0x3c74f9[_0xe363('0x21')];var _0x2f2c20=_0x73ef9a?0x0:_0x52e6c6['offset'];var _0x287104=_0x73ef9a?_0x3c74f9[_0xe363('0x21')]:_0x52e6c6['offset']+_0x52e6c6[_0xe363('0x20')];var _0x110e59;if(_0x287104>=_0xecbe2c){_0x287104=_0xecbe2c;_0x110e59=0xc8;}else{_0x110e59=0xce;}_0x2ad0e9[_0xe363('0x1c')](_0x110e59);return _0x2ad0e9[_0xe363('0x22')](_0xe363('0x23'),_0x2f2c20+'-'+_0x287104+'/'+_0xecbe2c)[_0xe363('0x1e')](_0x3c74f9);}return null;};}function patchUpdates(_0x4ee855){return function(_0x3bed39){try{jsonpatch[_0xe363('0x24')](_0x3bed39,_0x4ee855,!![]);}catch(_0x14ff95){return BPromise[_0xe363('0x25')](_0x14ff95);}return _0x3bed39[_0xe363('0x26')]();};}function saveUpdates(_0x42928e,_0x24199a){return function(_0xaff56f){if(_0xaff56f){return _0xaff56f[_0xe363('0x27')](_0x42928e)[_0xe363('0x28')](function(_0x1de673){return _0x1de673;});}return null;};}function removeEntity(_0x441b94,_0x11556d){return function(_0x388223){if(_0x388223){return _0x388223[_0xe363('0x29')]()[_0xe363('0x28')](function(){_0x441b94[_0xe363('0x1c')](0xcc)[_0xe363('0x1d')]();});}};}function handleEntityNotFound(_0x19c7b4,_0x3e24ad){return function(_0x312d75){if(!_0x312d75){_0x19c7b4[_0xe363('0x1b')](0x194);}return _0x312d75;};}function handleError(_0x5b2b3d,_0xbdfae9){_0xbdfae9=_0xbdfae9||0x1f4;return function(_0x12358b){logger[_0xe363('0x2a')](_0x12358b[_0xe363('0x2b')]);if(_0x12358b[_0xe363('0x2c')]){delete _0x12358b['name'];}_0x5b2b3d[_0xe363('0x1c')](_0xbdfae9)[_0xe363('0x2d')](_0x12358b);};}exports['index']=function(_0x3cc130,_0x5a790c){var _0x3ed3e1={},_0x45d664={},_0x4c739d={'count':0x0,'rows':[]};var _0x357b6f=_[_0xe363('0x2e')](db[_0xe363('0x2f')]['rawAttributes'],function(_0x40671e){return{'name':_0x40671e[_0xe363('0x30')],'type':_0x40671e[_0xe363('0x31')][_0xe363('0x32')]};});_0x45d664['model']=_[_0xe363('0x2e')](_0x357b6f,_0xe363('0x2c'));_0x45d664[_0xe363('0x33')]=_[_0xe363('0x34')](_0x3cc130[_0xe363('0x33')]);_0x45d664[_0xe363('0x35')]=_[_0xe363('0x36')](_0x45d664[_0xe363('0x37')],_0x45d664[_0xe363('0x33')]);_0x3ed3e1[_0xe363('0x38')]=_['intersection'](_0x45d664['model'],qs[_0xe363('0x39')](_0x3cc130[_0xe363('0x33')]['fields']));_0x3ed3e1[_0xe363('0x38')]=_0x3ed3e1[_0xe363('0x38')]['length']?_0x3ed3e1[_0xe363('0x38')]:_0x45d664[_0xe363('0x37')];if(!_0x3cc130[_0xe363('0x33')][_0xe363('0x3a')]('nolimit')){_0x3ed3e1['limit']=qs[_0xe363('0x20')](_0x3cc130['query']['limit']);_0x3ed3e1[_0xe363('0x3b')]=qs[_0xe363('0x3b')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3b')]);}_0x3ed3e1[_0xe363('0x3c')]=qs[_0xe363('0x3d')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3d')]);_0x3ed3e1[_0xe363('0x3e')]=qs[_0xe363('0x35')](_[_0xe363('0x3f')](_0x3cc130[_0xe363('0x33')],_0x45d664['filters']),_0x357b6f);if(_0x3cc130['query'][_0xe363('0x40')]){_0x3ed3e1[_0xe363('0x3e')]=_[_0xe363('0x41')](_0x3ed3e1['where'],{'$or':_['map'](_0x357b6f,function(_0x815550){if(_0x815550[_0xe363('0x31')]!==_0xe363('0x42')){var _0x199c78={};_0x199c78[_0x815550['name']]={'$like':'%'+_0x3cc130[_0xe363('0x33')]['filter']+'%'};return _0x199c78;}})});}_0x3ed3e1=_[_0xe363('0x41')]({},_0x3ed3e1,_0x3cc130[_0xe363('0x43')]);var _0xbca95f={'where':_0x3ed3e1[_0xe363('0x3e')]};return db[_0xe363('0x2f')][_0xe363('0x21')](_0xbca95f)[_0xe363('0x28')](function(_0x44f03c){_0x4c739d[_0xe363('0x21')]=_0x44f03c;if(_0x3cc130['query']['includeAll']){_0x3ed3e1[_0xe363('0x44')]=[{'all':!![]}];}return db[_0xe363('0x2f')][_0xe363('0x45')](_0x3ed3e1);})[_0xe363('0x28')](function(_0x2fc2f0){_0x4c739d[_0xe363('0x46')]=_0x2fc2f0;return _0x4c739d;})[_0xe363('0x28')](respondWithFilteredResult(_0x5a790c,_0x3ed3e1))[_0xe363('0x47')](handleError(_0x5a790c,null));};exports[_0xe363('0x48')]=function(_0x4b8238,_0x3da5ba){var _0x58b837={'raw':!![],'where':{'id':_0x4b8238['params']['id']}},_0x41a87c={};_0x41a87c[_0xe363('0x37')]=_[_0xe363('0x34')](db['ChatQueueReport'][_0xe363('0x49')]);_0x41a87c[_0xe363('0x33')]=_[_0xe363('0x34')](_0x4b8238[_0xe363('0x33')]);_0x41a87c[_0xe363('0x35')]=_[_0xe363('0x36')](_0x41a87c['model'],_0x41a87c[_0xe363('0x33')]);_0x58b837[_0xe363('0x38')]=_[_0xe363('0x36')](_0x41a87c[_0xe363('0x37')],qs[_0xe363('0x39')](_0x4b8238['query'][_0xe363('0x39')]));_0x58b837[_0xe363('0x38')]=_0x58b837[_0xe363('0x38')][_0xe363('0x4a')]?_0x58b837[_0xe363('0x38')]:_0x41a87c[_0xe363('0x37')];if(_0x4b8238[_0xe363('0x33')]['includeAll']){_0x58b837['include']=[{'all':!![]}];}_0x58b837=_[_0xe363('0x41')]({},_0x58b837,_0x4b8238[_0xe363('0x43')]);return db[_0xe363('0x2f')]['find'](_0x58b837)[_0xe363('0x28')](handleEntityNotFound(_0x3da5ba,null))[_0xe363('0x28')](respondWithResult(_0x3da5ba,null))['catch'](handleError(_0x3da5ba,null));};exports['create']=function(_0x2a7b42,_0x34e08b){return db[_0xe363('0x2f')][_0xe363('0x4b')](_0x2a7b42['body'],{})[_0xe363('0x28')](respondWithResult(_0x34e08b,0xc9))[_0xe363('0x47')](handleError(_0x34e08b,null));};exports['update']=function(_0x4fbdbb,_0x306afd){if(_0x4fbdbb[_0xe363('0x4c')]['id']){delete _0x4fbdbb['body']['id'];}return db[_0xe363('0x2f')]['find']({'where':{'id':_0x4fbdbb[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x306afd,null))['then'](saveUpdates(_0x4fbdbb[_0xe363('0x4c')],null))[_0xe363('0x28')](respondWithResult(_0x306afd,null))['catch'](handleError(_0x306afd,null));};exports[_0xe363('0x29')]=function(_0x43ee23,_0x55f0e6){return db[_0xe363('0x2f')]['find']({'where':{'id':_0x43ee23[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x55f0e6,null))[_0xe363('0x28')](removeEntity(_0x55f0e6,null))[_0xe363('0x47')](handleError(_0x55f0e6,null));};exports['describe']=function(_0x2ff064,_0x225a43){return db[_0xe363('0x2f')]['describe']()[_0xe363('0x28')](respondWithResult(_0x225a43,null))[_0xe363('0x47')](handleError(_0x225a43,null));};
\ No newline at end of file
+var _0x3fa4=['model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','intersection','length','find','create','body','params','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key'];(function(_0x5a5a7a,_0x571535){var _0xbea751=function(_0x2c64e3){while(--_0x2c64e3){_0x5a5a7a['push'](_0x5a5a7a['shift']());}};_0xbea751(++_0x571535);}(_0x3fa4,0xf0));var _0x43fa=function(_0x2af760,_0x3a142b){_0x2af760=_0x2af760-0x0;var _0x1c4408=_0x3fa4[_0x2af760];return _0x1c4408;};'use strict';var emlformat=require(_0x43fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x43fa('0x1'));var moment=require(_0x43fa('0x2'));var BPromise=require(_0x43fa('0x3'));var Mustache=require(_0x43fa('0x4'));var util=require(_0x43fa('0x5'));var path=require(_0x43fa('0x6'));var sox=require(_0x43fa('0x7'));var csv=require('to-csv');var ejs=require(_0x43fa('0x8'));var fs=require('fs');var fs_extra=require(_0x43fa('0x9'));var _=require(_0x43fa('0xa'));var squel=require('squel');var crypto=require(_0x43fa('0xb'));var jsforce=require(_0x43fa('0xc'));var deskjs=require(_0x43fa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x43fa('0xe'));var Papa=require(_0x43fa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43fa('0x10'));var as=require(_0x43fa('0x11'));var hardwareService=require(_0x43fa('0x12'));var logger=require(_0x43fa('0x13'))(_0x43fa('0x14'));var utils=require('../../config/utils');var config=require(_0x43fa('0x15'));var licenseUtil=require(_0x43fa('0x16'));var db=require(_0x43fa('0x17'))['db'];function respondWithStatusCode(_0x582ec2,_0xfbf89e){_0xfbf89e=_0xfbf89e||0xcc;return function(_0x4353c1){if(_0x4353c1){return _0x582ec2[_0x43fa('0x18')](_0xfbf89e);}return _0x582ec2['status'](_0xfbf89e)[_0x43fa('0x19')]();};}function respondWithResult(_0x4bb4b0,_0x5bc292){_0x5bc292=_0x5bc292||0xc8;return function(_0x4fba54){if(_0x4fba54){return _0x4bb4b0[_0x43fa('0x1a')](_0x5bc292)['json'](_0x4fba54);}};}function respondWithFilteredResult(_0x1a898a,_0x12ae9e){return function(_0x4a07b5){if(_0x4a07b5){var _0x27b87f=typeof _0x12ae9e[_0x43fa('0x1b')]===_0x43fa('0x1c')&&typeof _0x12ae9e[_0x43fa('0x1d')]===_0x43fa('0x1c');var _0x53c04c=_0x4a07b5['count'];var _0x479d81=_0x27b87f?0x0:_0x12ae9e[_0x43fa('0x1b')];var _0x29b8aa=_0x27b87f?_0x4a07b5[_0x43fa('0x1e')]:_0x12ae9e[_0x43fa('0x1b')]+_0x12ae9e[_0x43fa('0x1d')];var _0x15e594;if(_0x29b8aa>=_0x53c04c){_0x29b8aa=_0x53c04c;_0x15e594=0xc8;}else{_0x15e594=0xce;}_0x1a898a[_0x43fa('0x1a')](_0x15e594);return _0x1a898a[_0x43fa('0x1f')](_0x43fa('0x20'),_0x479d81+'-'+_0x29b8aa+'/'+_0x53c04c)['json'](_0x4a07b5);}return null;};}function patchUpdates(_0xfd8d3){return function(_0x551528){try{jsonpatch[_0x43fa('0x21')](_0x551528,_0xfd8d3,!![]);}catch(_0x319cfd){return BPromise[_0x43fa('0x22')](_0x319cfd);}return _0x551528['save']();};}function saveUpdates(_0x2c6075,_0x3c78fb){return function(_0x2db3dd){if(_0x2db3dd){return _0x2db3dd[_0x43fa('0x23')](_0x2c6075)[_0x43fa('0x24')](function(_0x1d3328){return _0x1d3328;});}return null;};}function removeEntity(_0x3b8cb9,_0x241948){return function(_0x427426){if(_0x427426){return _0x427426['destroy']()['then'](function(){_0x3b8cb9[_0x43fa('0x1a')](0xcc)[_0x43fa('0x19')]();});}};}function handleEntityNotFound(_0x28f695,_0x78f105){return function(_0x40969a){if(!_0x40969a){_0x28f695[_0x43fa('0x18')](0x194);}return _0x40969a;};}function handleError(_0x5014fb,_0x4f6101){_0x4f6101=_0x4f6101||0x1f4;return function(_0x1fa077){logger[_0x43fa('0x25')](_0x1fa077[_0x43fa('0x26')]);if(_0x1fa077[_0x43fa('0x27')]){delete _0x1fa077['name'];}_0x5014fb[_0x43fa('0x1a')](_0x4f6101)[_0x43fa('0x28')](_0x1fa077);};}exports[_0x43fa('0x29')]=function(_0x186249,_0x4d6c8c){var _0x3d5abd={},_0x44fdef={},_0x398c44={'count':0x0,'rows':[]};var _0x28b833=_[_0x43fa('0x2a')](db[_0x43fa('0x2b')][_0x43fa('0x2c')],function(_0x41a3cf){return{'name':_0x41a3cf[_0x43fa('0x2d')],'type':_0x41a3cf[_0x43fa('0x2e')][_0x43fa('0x2f')]};});_0x44fdef[_0x43fa('0x30')]=_['map'](_0x28b833,'name');_0x44fdef[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x186249[_0x43fa('0x31')]);_0x44fdef[_0x43fa('0x33')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],_0x44fdef[_0x43fa('0x31')]);_0x3d5abd[_0x43fa('0x34')]=_['intersection'](_0x44fdef[_0x43fa('0x30')],qs[_0x43fa('0x35')](_0x186249[_0x43fa('0x31')][_0x43fa('0x35')]));_0x3d5abd['attributes']=_0x3d5abd[_0x43fa('0x34')]['length']?_0x3d5abd[_0x43fa('0x34')]:_0x44fdef[_0x43fa('0x30')];if(!_0x186249[_0x43fa('0x31')]['hasOwnProperty'](_0x43fa('0x36'))){_0x3d5abd['limit']=qs['limit'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1d')]);_0x3d5abd[_0x43fa('0x1b')]=qs['offset'](_0x186249[_0x43fa('0x31')][_0x43fa('0x1b')]);}_0x3d5abd[_0x43fa('0x37')]=qs[_0x43fa('0x38')](_0x186249[_0x43fa('0x31')]['sort']);_0x3d5abd[_0x43fa('0x39')]=qs[_0x43fa('0x33')](_[_0x43fa('0x3a')](_0x186249[_0x43fa('0x31')],_0x44fdef['filters']),_0x28b833);if(_0x186249['query'][_0x43fa('0x3b')]){_0x3d5abd[_0x43fa('0x39')]=_[_0x43fa('0x3c')](_0x3d5abd[_0x43fa('0x39')],{'$or':_[_0x43fa('0x2a')](_0x28b833,function(_0x595d49){if(_0x595d49[_0x43fa('0x2e')]!=='VIRTUAL'){var _0x4cb1bd={};_0x4cb1bd[_0x595d49[_0x43fa('0x27')]]={'$like':'%'+_0x186249['query'][_0x43fa('0x3b')]+'%'};return _0x4cb1bd;}})});}_0x3d5abd=_[_0x43fa('0x3c')]({},_0x3d5abd,_0x186249[_0x43fa('0x3d')]);var _0x17403c={'where':_0x3d5abd['where']};return db['ChatQueueReport']['count'](_0x17403c)[_0x43fa('0x24')](function(_0x15ef49){_0x398c44['count']=_0x15ef49;if(_0x186249[_0x43fa('0x31')][_0x43fa('0x3e')]){_0x3d5abd[_0x43fa('0x3f')]=[{'all':!![]}];}return db[_0x43fa('0x2b')]['findAll'](_0x3d5abd);})[_0x43fa('0x24')](function(_0x23e156){_0x398c44['rows']=_0x23e156;return _0x398c44;})['then'](respondWithFilteredResult(_0x4d6c8c,_0x3d5abd))[_0x43fa('0x40')](handleError(_0x4d6c8c,null));};exports['show']=function(_0x3a6d39,_0x137ef){var _0x5cef1e={'raw':!![],'where':{'id':_0x3a6d39['params']['id']}},_0x4735d1={};_0x4735d1[_0x43fa('0x30')]=_[_0x43fa('0x32')](db[_0x43fa('0x2b')]['rawAttributes']);_0x4735d1[_0x43fa('0x31')]=_[_0x43fa('0x32')](_0x3a6d39[_0x43fa('0x31')]);_0x4735d1[_0x43fa('0x33')]=_[_0x43fa('0x41')](_0x4735d1[_0x43fa('0x30')],_0x4735d1['query']);_0x5cef1e[_0x43fa('0x34')]=_['intersection'](_0x4735d1[_0x43fa('0x30')],qs['fields'](_0x3a6d39[_0x43fa('0x31')][_0x43fa('0x35')]));_0x5cef1e[_0x43fa('0x34')]=_0x5cef1e[_0x43fa('0x34')][_0x43fa('0x42')]?_0x5cef1e['attributes']:_0x4735d1[_0x43fa('0x30')];if(_0x3a6d39['query']['includeAll']){_0x5cef1e['include']=[{'all':!![]}];}_0x5cef1e=_[_0x43fa('0x3c')]({},_0x5cef1e,_0x3a6d39[_0x43fa('0x3d')]);return db[_0x43fa('0x2b')][_0x43fa('0x43')](_0x5cef1e)[_0x43fa('0x24')](handleEntityNotFound(_0x137ef,null))['then'](respondWithResult(_0x137ef,null))[_0x43fa('0x40')](handleError(_0x137ef,null));};exports[_0x43fa('0x44')]=function(_0x305e90,_0x19b0f0){return db[_0x43fa('0x2b')][_0x43fa('0x44')](_0x305e90[_0x43fa('0x45')],{})[_0x43fa('0x24')](respondWithResult(_0x19b0f0,0xc9))[_0x43fa('0x40')](handleError(_0x19b0f0,null));};exports[_0x43fa('0x23')]=function(_0x1ae6e0,_0x52d66f){if(_0x1ae6e0[_0x43fa('0x45')]['id']){delete _0x1ae6e0[_0x43fa('0x45')]['id'];}return db['ChatQueueReport'][_0x43fa('0x43')]({'where':{'id':_0x1ae6e0['params']['id']}})[_0x43fa('0x24')](handleEntityNotFound(_0x52d66f,null))[_0x43fa('0x24')](saveUpdates(_0x1ae6e0[_0x43fa('0x45')],null))[_0x43fa('0x24')](respondWithResult(_0x52d66f,null))[_0x43fa('0x40')](handleError(_0x52d66f,null));};exports['destroy']=function(_0x1bbae4,_0x4a24f1){return db[_0x43fa('0x2b')][_0x43fa('0x43')]({'where':{'id':_0x1bbae4[_0x43fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a24f1,null))['then'](removeEntity(_0x4a24f1,null))[_0x43fa('0x40')](handleError(_0x4a24f1,null));};exports['describe']=function(_0x2ca431,_0x574076){return db['ChatQueueReport'][_0x43fa('0x47')]()[_0x43fa('0x24')](respondWithResult(_0x574076,null))['catch'](handleError(_0x574076,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 376d82e..c93f5b5 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(_0x4da05f,_0x20a393){var _0x30b926=function(_0x2b16d3){while(--_0x2b16d3){_0x4da05f['push'](_0x4da05f['shift']());}};_0x30b926(++_0x20a393);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xcb91[_0x10291b];return _0x1d5fbe;};'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(_0x1c09cd,_0x1ebc27){var _0x262877=function(_0xca6e96){while(--_0xca6e96){_0x1c09cd['push'](_0x1c09cd['shift']());}};_0x262877(++_0x1ebc27);}(_0x757a,0xde));var _0xa757=function(_0x1675f7,_0x34a548){_0x1675f7=_0x1675f7-0x0;var _0x5bc972=_0x757a[_0x1675f7];return _0x5bc972;};'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 152925b..237a19f 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 _0xecd6=['create','body','options','raw','update','where','attributes','UpdateChatQueueReport','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport'];(function(_0x4bd48b,_0x1a0264){var _0x3ecb8f=function(_0x3a5f2e){while(--_0x3a5f2e){_0x4bd48b['push'](_0x4bd48b['shift']());}};_0x3ecb8f(++_0x1a0264);}(_0xecd6,0xe1));var _0x6ecd=function(_0x2d7213,_0x1e9ce2){_0x2d7213=_0x2d7213-0x0;var _0x4bb328=_0xecd6[_0x2d7213];return _0x4bb328;};'use strict';var _=require(_0x6ecd('0x0'));var util=require('util');var moment=require(_0x6ecd('0x1'));var BPromise=require(_0x6ecd('0x2'));var rs=require(_0x6ecd('0x3'));var fs=require('fs');var Redis=require(_0x6ecd('0x4'));var db=require(_0x6ecd('0x5'))['db'];var utils=require(_0x6ecd('0x6'));var logger=require(_0x6ecd('0x7'))(_0x6ecd('0x8'));var config=require(_0x6ecd('0x9'));var jayson=require(_0x6ecd('0xa'));var client=jayson[_0x6ecd('0xb')][_0x6ecd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4569e9,_0x311902,_0x5f490b){return new BPromise(function(_0x427c4c,_0x5025a8){return client[_0x6ecd('0xd')](_0x4569e9,_0x5f490b)[_0x6ecd('0xe')](function(_0x308871){logger[_0x6ecd('0xf')](_0x6ecd('0x10'),_0x311902,_0x6ecd('0x11'));logger[_0x6ecd('0x12')](_0x6ecd('0x13'),_0x311902,_0x6ecd('0x11'),JSON[_0x6ecd('0x14')](_0x308871));if(_0x308871[_0x6ecd('0x15')]){if(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x16')]===0x1f4){logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);return _0x5025a8(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);}logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);return _0x427c4c(_0x308871[_0x6ecd('0x15')][_0x6ecd('0x17')]);}else{logger[_0x6ecd('0xf')](_0x6ecd('0x10'),_0x311902,_0x6ecd('0x11'));_0x427c4c(_0x308871[_0x6ecd('0x18')][_0x6ecd('0x17')]);}})['catch'](function(_0x44351f){logger[_0x6ecd('0x15')](_0x6ecd('0x10'),_0x311902,_0x44351f);_0x5025a8(_0x44351f);});});}exports[_0x6ecd('0x19')]=function(_0x53cdb9){var _0x17c956=this;return new Promise(function(_0x227fed,_0x29502d){return db[_0x6ecd('0x1a')][_0x6ecd('0x1b')](_0x53cdb9[_0x6ecd('0x1c')],{'raw':_0x53cdb9[_0x6ecd('0x1d')]?_0x53cdb9['options'][_0x6ecd('0x1e')]===undefined?!![]:![]:!![]})[_0x6ecd('0xe')](function(_0x266825){logger[_0x6ecd('0xf')]('CreateChatQueueReport',_0x53cdb9);logger[_0x6ecd('0x12')](_0x6ecd('0x19'),_0x53cdb9,JSON['stringify'](_0x266825));_0x227fed(_0x266825);})['catch'](function(_0xe12cb8){logger[_0x6ecd('0x15')](_0x6ecd('0x19'),_0xe12cb8[_0x6ecd('0x17')],_0x53cdb9);_0x29502d(_0x17c956[_0x6ecd('0x15')](0x1f4,_0xe12cb8[_0x6ecd('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0x599cdd){var _0x3c3814=this;return new Promise(function(_0x36c4c2,_0x36efa7){return db[_0x6ecd('0x1a')][_0x6ecd('0x1f')](_0x599cdd[_0x6ecd('0x1c')],{'raw':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd[_0x6ecd('0x1d')][_0x6ecd('0x20')]||null:null,'attributes':_0x599cdd['options']?_0x599cdd['options'][_0x6ecd('0x21')]||null:null,'limit':_0x599cdd[_0x6ecd('0x1d')]?_0x599cdd[_0x6ecd('0x1d')]['limit']||null:null})['then'](function(_0x5f2431){logger[_0x6ecd('0xf')](_0x6ecd('0x22'),_0x599cdd);logger[_0x6ecd('0x12')](_0x6ecd('0x22'),_0x599cdd,JSON[_0x6ecd('0x14')](_0x5f2431));_0x36c4c2(_0x5f2431);})[_0x6ecd('0x23')](function(_0x3884f4){logger['error'](_0x6ecd('0x22'),_0x3884f4['message'],_0x599cdd);_0x36efa7(_0x3c3814[_0x6ecd('0x15')](0x1f4,_0x3884f4['message']));});});};
\ No newline at end of file
+var _0x88ef=['where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport'];(function(_0x4dd373,_0x122f3a){var _0x468744=function(_0x5069eb){while(--_0x5069eb){_0x4dd373['push'](_0x4dd373['shift']());}};_0x468744(++_0x122f3a);}(_0x88ef,0xea));var _0xf88e=function(_0x4ad218,_0x32e57f){_0x4ad218=_0x4ad218-0x0;var _0x1991c5=_0x88ef[_0x4ad218];return _0x1991c5;};'use strict';var _=require('lodash');var util=require(_0xf88e('0x0'));var moment=require(_0xf88e('0x1'));var BPromise=require(_0xf88e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf88e('0x3'));var db=require(_0xf88e('0x4'))['db'];var utils=require(_0xf88e('0x5'));var logger=require(_0xf88e('0x6'))(_0xf88e('0x7'));var config=require(_0xf88e('0x8'));var jayson=require(_0xf88e('0x9'));var client=jayson[_0xf88e('0xa')][_0xf88e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31fd93,_0x21f3fd,_0xfca89d){return new BPromise(function(_0x33d312,_0x4908f){return client[_0xf88e('0xc')](_0x31fd93,_0xfca89d)[_0xf88e('0xd')](function(_0x29fd05){logger['info'](_0xf88e('0xe'),_0x21f3fd,'request\x20sent');logger[_0xf88e('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x21f3fd,_0xf88e('0x10'),JSON[_0xf88e('0x11')](_0x29fd05));if(_0x29fd05['error']){if(_0x29fd05[_0xf88e('0x12')][_0xf88e('0x13')]===0x1f4){logger[_0xf88e('0x12')](_0xf88e('0xe'),_0x21f3fd,_0x29fd05[_0xf88e('0x12')][_0xf88e('0x14')]);return _0x4908f(_0x29fd05['error']['message']);}logger['error'](_0xf88e('0xe'),_0x21f3fd,_0x29fd05[_0xf88e('0x12')][_0xf88e('0x14')]);return _0x33d312(_0x29fd05[_0xf88e('0x12')][_0xf88e('0x14')]);}else{logger[_0xf88e('0x15')]('ChatQueueReport,\x20%s,\x20%s',_0x21f3fd,_0xf88e('0x10'));_0x33d312(_0x29fd05[_0xf88e('0x16')][_0xf88e('0x14')]);}})[_0xf88e('0x17')](function(_0x4ecd51){logger['error'](_0xf88e('0xe'),_0x21f3fd,_0x4ecd51);_0x4908f(_0x4ecd51);});});}exports[_0xf88e('0x18')]=function(_0x590cb2){var _0x543796=this;return new Promise(function(_0x1509f1,_0x83da9b){return db[_0xf88e('0x19')][_0xf88e('0x1a')](_0x590cb2[_0xf88e('0x1b')],{'raw':_0x590cb2['options']?_0x590cb2[_0xf88e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5eb1aa){logger['info'](_0xf88e('0x18'),_0x590cb2);logger[_0xf88e('0xf')]('CreateChatQueueReport',_0x590cb2,JSON[_0xf88e('0x11')](_0x5eb1aa));_0x1509f1(_0x5eb1aa);})[_0xf88e('0x17')](function(_0x5149ba){logger[_0xf88e('0x12')](_0xf88e('0x18'),_0x5149ba[_0xf88e('0x14')],_0x590cb2);_0x83da9b(_0x543796['error'](0x1f4,_0x5149ba['message']));});});};exports[_0xf88e('0x1d')]=function(_0x44e2bd){var _0x876aa8=this;return new Promise(function(_0x3aede5,_0x73b647){return db[_0xf88e('0x19')]['update'](_0x44e2bd['body'],{'raw':_0x44e2bd[_0xf88e('0x1c')]?_0x44e2bd[_0xf88e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44e2bd[_0xf88e('0x1c')]?_0x44e2bd[_0xf88e('0x1c')][_0xf88e('0x1e')]||null:null,'attributes':_0x44e2bd[_0xf88e('0x1c')]?_0x44e2bd[_0xf88e('0x1c')][_0xf88e('0x1f')]||null:null,'limit':_0x44e2bd[_0xf88e('0x1c')]?_0x44e2bd[_0xf88e('0x1c')][_0xf88e('0x20')]||null:null})[_0xf88e('0xd')](function(_0x24a495){logger[_0xf88e('0x15')](_0xf88e('0x1d'),_0x44e2bd);logger[_0xf88e('0xf')]('UpdateChatQueueReport',_0x44e2bd,JSON[_0xf88e('0x11')](_0x24a495));_0x3aede5(_0x24a495);})['catch'](function(_0x4ab40b){logger['error']('UpdateChatQueueReport',_0x4ab40b[_0xf88e('0x14')],_0x44e2bd);_0x73b647(_0x876aa8[_0xf88e('0x12')](0x1f4,_0x4ab40b[_0xf88e('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index beaf863..5045342 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 _0x6208=['describe','show','post','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','isAuthenticated','index','get','/describe'];(function(_0x47d103,_0xd2df8c){var _0x18e659=function(_0x27a38d){while(--_0x27a38d){_0x47d103['push'](_0x47d103['shift']());}};_0x18e659(++_0xd2df8c);}(_0x6208,0x96));var _0x8620=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x6208[_0x4e93a9];return _0x43013c;};'use strict';var multer=require('multer');var util=require(_0x8620('0x0'));var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require(_0x8620('0x3'));var router=express[_0x8620('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8620('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x8620('0x6')](),controller[_0x8620('0x7')]);router[_0x8620('0x8')](_0x8620('0x9'),auth[_0x8620('0x6')](),controller[_0x8620('0xa')]);router['get']('/:id',auth[_0x8620('0x6')](),controller[_0x8620('0xb')]);router[_0x8620('0xc')]('/',auth[_0x8620('0x6')](),controller[_0x8620('0xd')]);router[_0x8620('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x8620('0xf')]);router[_0x8620('0x10')](_0x8620('0x11'),auth[_0x8620('0x6')](),controller[_0x8620('0x12')]);module[_0x8620('0x13')]=router;
\ No newline at end of file
+var _0x7cd6=['create','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','index','get','/describe','isAuthenticated','/:id','show'];(function(_0x48b964,_0x491840){var _0x527277=function(_0x27bee6){while(--_0x27bee6){_0x48b964['push'](_0x48b964['shift']());}};_0x527277(++_0x491840);}(_0x7cd6,0x1d4));var _0x67cd=function(_0x1dbc76,_0x550bab){_0x1dbc76=_0x1dbc76-0x0;var _0x1daefd=_0x7cd6[_0x1dbc76];return _0x1daefd;};'use strict';var multer=require('multer');var util=require(_0x67cd('0x0'));var path=require(_0x67cd('0x1'));var timeout=require('connect-timeout');var express=require(_0x67cd('0x2'));var router=express[_0x67cd('0x3')]();var fs_extra=require(_0x67cd('0x4'));var auth=require(_0x67cd('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x67cd('0x6')]);router[_0x67cd('0x7')](_0x67cd('0x8'),auth[_0x67cd('0x9')](),controller['describe']);router[_0x67cd('0x7')](_0x67cd('0xa'),auth[_0x67cd('0x9')](),controller[_0x67cd('0xb')]);router['post']('/',auth[_0x67cd('0x9')](),controller[_0x67cd('0xc')]);router['put'](_0x67cd('0xa'),auth[_0x67cd('0x9')](),controller[_0x67cd('0xd')]);router[_0x67cd('0xe')]('/:id',auth[_0x67cd('0x9')](),controller['destroy']);module[_0x67cd('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 16ac573..addf029 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1f004d,_0x4821eb){var _0x48ac0b=function(_0x32dd1e){while(--_0x32dd1e){_0x1f004d['push'](_0x1f004d['shift']());}};_0x48ac0b(++_0x4821eb);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0xf3cd[_0x34b821];return _0x5e00a0;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x42d45c,_0x49ac2a){var _0x1dff4f=function(_0x3f391a){while(--_0x3f391a){_0x42d45c['push'](_0x42d45c['shift']());}};_0x1dff4f(++_0x49ac2a);}(_0xedd9,0xfc));var _0x9edd=function(_0x21df16,_0x425313){_0x21df16=_0x21df16-0x0;var _0x3a06fb=_0xedd9[_0x21df16];return _0x3a06fb;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index c314957..2f517f5 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 _0x411f=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','ChatTransferReport','findAll','show','params','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map'];(function(_0x47d0d7,_0x5cd8b){var _0x5563ec=function(_0x4f607b){while(--_0x4f607b){_0x47d0d7['push'](_0x47d0d7['shift']());}};_0x5563ec(++_0x5cd8b);}(_0x411f,0x1e1));var _0xf411=function(_0x3deed9,_0x5b450c){_0x3deed9=_0x3deed9-0x0;var _0x22aadf=_0x411f[_0x3deed9];return _0x22aadf;};'use strict';var emlformat=require(_0xf411('0x0'));var rimraf=require(_0xf411('0x1'));var zipdir=require(_0xf411('0x2'));var jsonpatch=require(_0xf411('0x3'));var rp=require(_0xf411('0x4'));var moment=require(_0xf411('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf411('0x6'));var util=require(_0xf411('0x7'));var path=require(_0xf411('0x8'));var sox=require(_0xf411('0x9'));var csv=require(_0xf411('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf411('0xb'));var _=require(_0xf411('0xc'));var squel=require(_0xf411('0xd'));var crypto=require(_0xf411('0xe'));var jsforce=require(_0xf411('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf411('0xa'));var querystring=require(_0xf411('0x10'));var Papa=require('papaparse');var Redis=require(_0xf411('0x11'));var authService=require(_0xf411('0x12'));var qs=require(_0xf411('0x13'));var as=require(_0xf411('0x14'));var hardwareService=require(_0xf411('0x15'));var logger=require(_0xf411('0x16'))('api');var utils=require(_0xf411('0x17'));var config=require(_0xf411('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ef3ee,_0x11a6ae){_0x11a6ae=_0x11a6ae||0xcc;return function(_0xe5dc27){if(_0xe5dc27){return _0x1ef3ee[_0xf411('0x19')](_0x11a6ae);}return _0x1ef3ee[_0xf411('0x1a')](_0x11a6ae)[_0xf411('0x1b')]();};}function respondWithResult(_0x4b8ade,_0x1f8715){_0x1f8715=_0x1f8715||0xc8;return function(_0x57f255){if(_0x57f255){return _0x4b8ade['status'](_0x1f8715)[_0xf411('0x1c')](_0x57f255);}};}function respondWithFilteredResult(_0x10ea85,_0x41fc46){return function(_0x58ff91){if(_0x58ff91){var _0x4c70c6=typeof _0x41fc46[_0xf411('0x1d')]===_0xf411('0x1e')&&typeof _0x41fc46[_0xf411('0x1f')]===_0xf411('0x1e');var _0x5f97f0=_0x58ff91[_0xf411('0x20')];var _0x25bab2=_0x4c70c6?0x0:_0x41fc46[_0xf411('0x1d')];var _0x55d0dc=_0x4c70c6?_0x58ff91[_0xf411('0x20')]:_0x41fc46[_0xf411('0x1d')]+_0x41fc46['limit'];var _0x3eb959;if(_0x55d0dc>=_0x5f97f0){_0x55d0dc=_0x5f97f0;_0x3eb959=0xc8;}else{_0x3eb959=0xce;}_0x10ea85['status'](_0x3eb959);return _0x10ea85[_0xf411('0x21')](_0xf411('0x22'),_0x25bab2+'-'+_0x55d0dc+'/'+_0x5f97f0)[_0xf411('0x1c')](_0x58ff91);}return null;};}function patchUpdates(_0x543d14){return function(_0x421dfe){try{jsonpatch[_0xf411('0x23')](_0x421dfe,_0x543d14,!![]);}catch(_0x1a720b){return BPromise[_0xf411('0x24')](_0x1a720b);}return _0x421dfe['save']();};}function saveUpdates(_0xfedf53,_0xf4ece9){return function(_0x3398f7){if(_0x3398f7){return _0x3398f7[_0xf411('0x25')](_0xfedf53)[_0xf411('0x26')](function(_0x2057f8){return _0x2057f8;});}return null;};}function removeEntity(_0x48fb6c,_0xd68f18){return function(_0x365a5b){if(_0x365a5b){return _0x365a5b[_0xf411('0x27')]()[_0xf411('0x26')](function(){_0x48fb6c[_0xf411('0x1a')](0xcc)[_0xf411('0x1b')]();});}};}function handleEntityNotFound(_0x498ec6,_0x34faa2){return function(_0x2f15d9){if(!_0x2f15d9){_0x498ec6[_0xf411('0x19')](0x194);}return _0x2f15d9;};}function handleError(_0x18282a,_0x2bb6dc){_0x2bb6dc=_0x2bb6dc||0x1f4;return function(_0x2b2d49){logger[_0xf411('0x28')](_0x2b2d49[_0xf411('0x29')]);if(_0x2b2d49[_0xf411('0x2a')]){delete _0x2b2d49['name'];}_0x18282a[_0xf411('0x1a')](_0x2bb6dc)['send'](_0x2b2d49);};}exports['index']=function(_0x120900,_0x37e992){var _0x58f32e={},_0x164ea5={},_0x473345={'count':0x0,'rows':[]};var _0x42b6c8=_[_0xf411('0x2b')](db['ChatTransferReport'][_0xf411('0x2c')],function(_0xb9fc99){return{'name':_0xb9fc99['fieldName'],'type':_0xb9fc99[_0xf411('0x2d')][_0xf411('0x2e')]};});_0x164ea5[_0xf411('0x2f')]=_[_0xf411('0x2b')](_0x42b6c8,'name');_0x164ea5[_0xf411('0x30')]=_[_0xf411('0x31')](_0x120900[_0xf411('0x30')]);_0x164ea5[_0xf411('0x32')]=_[_0xf411('0x33')](_0x164ea5[_0xf411('0x2f')],_0x164ea5[_0xf411('0x30')]);_0x58f32e[_0xf411('0x34')]=_[_0xf411('0x33')](_0x164ea5[_0xf411('0x2f')],qs[_0xf411('0x35')](_0x120900[_0xf411('0x30')][_0xf411('0x35')]));_0x58f32e[_0xf411('0x34')]=_0x58f32e[_0xf411('0x34')][_0xf411('0x36')]?_0x58f32e[_0xf411('0x34')]:_0x164ea5['model'];if(!_0x120900[_0xf411('0x30')][_0xf411('0x37')](_0xf411('0x38'))){_0x58f32e[_0xf411('0x1f')]=qs[_0xf411('0x1f')](_0x120900[_0xf411('0x30')]['limit']);_0x58f32e[_0xf411('0x1d')]=qs[_0xf411('0x1d')](_0x120900[_0xf411('0x30')]['offset']);}_0x58f32e[_0xf411('0x39')]=qs[_0xf411('0x3a')](_0x120900[_0xf411('0x30')][_0xf411('0x3a')]);_0x58f32e['where']=qs['filters'](_[_0xf411('0x3b')](_0x120900[_0xf411('0x30')],_0x164ea5['filters']),_0x42b6c8);if(_0x120900[_0xf411('0x30')][_0xf411('0x3c')]){_0x58f32e[_0xf411('0x3d')]=_[_0xf411('0x3e')](_0x58f32e[_0xf411('0x3d')],{'$or':_['map'](_0x42b6c8,function(_0xd851e0){if(_0xd851e0['type']!=='VIRTUAL'){var _0x13dd97={};_0x13dd97[_0xd851e0[_0xf411('0x2a')]]={'$like':'%'+_0x120900['query'][_0xf411('0x3c')]+'%'};return _0x13dd97;}})});}_0x58f32e=_[_0xf411('0x3e')]({},_0x58f32e,_0x120900[_0xf411('0x3f')]);var _0x47d881={'where':_0x58f32e[_0xf411('0x3d')]};return db['ChatTransferReport'][_0xf411('0x20')](_0x47d881)[_0xf411('0x26')](function(_0x11ac30){_0x473345[_0xf411('0x20')]=_0x11ac30;if(_0x120900[_0xf411('0x30')][_0xf411('0x40')]){_0x58f32e[_0xf411('0x41')]=[{'all':!![]}];}return db[_0xf411('0x42')][_0xf411('0x43')](_0x58f32e);})['then'](function(_0x190fa8){_0x473345['rows']=_0x190fa8;return _0x473345;})[_0xf411('0x26')](respondWithFilteredResult(_0x37e992,_0x58f32e))['catch'](handleError(_0x37e992,null));};exports[_0xf411('0x44')]=function(_0x3c6ce1,_0x1a682c){var _0x4a7512={'raw':!![],'where':{'id':_0x3c6ce1[_0xf411('0x45')]['id']}},_0x368b87={};_0x368b87[_0xf411('0x2f')]=_[_0xf411('0x31')](db['ChatTransferReport'][_0xf411('0x2c')]);_0x368b87[_0xf411('0x30')]=_['keys'](_0x3c6ce1[_0xf411('0x30')]);_0x368b87[_0xf411('0x32')]=_[_0xf411('0x33')](_0x368b87[_0xf411('0x2f')],_0x368b87[_0xf411('0x30')]);_0x4a7512[_0xf411('0x34')]=_[_0xf411('0x33')](_0x368b87[_0xf411('0x2f')],qs[_0xf411('0x35')](_0x3c6ce1[_0xf411('0x30')][_0xf411('0x35')]));_0x4a7512['attributes']=_0x4a7512['attributes'][_0xf411('0x36')]?_0x4a7512[_0xf411('0x34')]:_0x368b87[_0xf411('0x2f')];if(_0x3c6ce1[_0xf411('0x30')][_0xf411('0x40')]){_0x4a7512[_0xf411('0x41')]=[{'all':!![]}];}_0x4a7512=_[_0xf411('0x3e')]({},_0x4a7512,_0x3c6ce1[_0xf411('0x3f')]);return db['ChatTransferReport']['find'](_0x4a7512)['then'](handleEntityNotFound(_0x1a682c,null))['then'](respondWithResult(_0x1a682c,null))['catch'](handleError(_0x1a682c,null));};exports[_0xf411('0x46')]=function(_0x533580,_0x1590f5){return db[_0xf411('0x42')][_0xf411('0x46')](_0x533580[_0xf411('0x47')],{})[_0xf411('0x26')](respondWithResult(_0x1590f5,0xc9))['catch'](handleError(_0x1590f5,null));};exports[_0xf411('0x25')]=function(_0x4dcd93,_0x4b698b){if(_0x4dcd93['body']['id']){delete _0x4dcd93[_0xf411('0x47')]['id'];}return db[_0xf411('0x42')]['find']({'where':{'id':_0x4dcd93[_0xf411('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b698b,null))['then'](saveUpdates(_0x4dcd93[_0xf411('0x47')],null))['then'](respondWithResult(_0x4b698b,null))[_0xf411('0x48')](handleError(_0x4b698b,null));};exports[_0xf411('0x27')]=function(_0x234d69,_0x5c09b3){return db[_0xf411('0x42')][_0xf411('0x49')]({'where':{'id':_0x234d69[_0xf411('0x45')]['id']}})['then'](handleEntityNotFound(_0x5c09b3,null))[_0xf411('0x26')](removeEntity(_0x5c09b3,null))[_0xf411('0x48')](handleError(_0x5c09b3,null));};exports[_0xf411('0x4a')]=function(_0x412e30,_0x2d3495){return db[_0xf411('0x42')][_0xf411('0x4a')]()[_0xf411('0x26')](respondWithResult(_0x2d3495,null))[_0xf411('0x48')](handleError(_0x2d3495,null));};
\ No newline at end of file
+var _0x9a79=['pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x573348,_0x303090){var _0x32b200=function(_0x497487){while(--_0x497487){_0x573348['push'](_0x573348['shift']());}};_0x32b200(++_0x303090);}(_0x9a79,0x183));var _0x99a7=function(_0x3e27bf,_0x1351fa){_0x3e27bf=_0x3e27bf-0x0;var _0x3ddb4f=_0x9a79[_0x3e27bf];return _0x3ddb4f;};'use strict';var emlformat=require(_0x99a7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x99a7('0x1'));var jsonpatch=require(_0x99a7('0x2'));var rp=require(_0x99a7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x99a7('0x4'));var util=require('util');var path=require(_0x99a7('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x99a7('0x6'));var fs=require('fs');var fs_extra=require(_0x99a7('0x7'));var _=require('lodash');var squel=require(_0x99a7('0x8'));var crypto=require(_0x99a7('0x9'));var jsforce=require(_0x99a7('0xa'));var deskjs=require(_0x99a7('0xb'));var toCsv=require(_0x99a7('0xc'));var querystring=require(_0x99a7('0xd'));var Papa=require(_0x99a7('0xe'));var Redis=require(_0x99a7('0xf'));var authService=require(_0x99a7('0x10'));var qs=require(_0x99a7('0x11'));var as=require(_0x99a7('0x12'));var hardwareService=require(_0x99a7('0x13'));var logger=require(_0x99a7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x99a7('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x99a7('0x16'))['db'];function respondWithStatusCode(_0x10a1c9,_0x527a03){_0x527a03=_0x527a03||0xcc;return function(_0x2f165b){if(_0x2f165b){return _0x10a1c9[_0x99a7('0x17')](_0x527a03);}return _0x10a1c9[_0x99a7('0x18')](_0x527a03)[_0x99a7('0x19')]();};}function respondWithResult(_0x31757e,_0xaa16fd){_0xaa16fd=_0xaa16fd||0xc8;return function(_0x471a66){if(_0x471a66){return _0x31757e[_0x99a7('0x18')](_0xaa16fd)[_0x99a7('0x1a')](_0x471a66);}};}function respondWithFilteredResult(_0x59f49f,_0x504b25){return function(_0x5d5749){if(_0x5d5749){var _0x365c72=typeof _0x504b25['offset']===_0x99a7('0x1b')&&typeof _0x504b25[_0x99a7('0x1c')]===_0x99a7('0x1b');var _0x50a3e7=_0x5d5749['count'];var _0x5aeee2=_0x365c72?0x0:_0x504b25[_0x99a7('0x1d')];var _0x2958a9=_0x365c72?_0x5d5749[_0x99a7('0x1e')]:_0x504b25['offset']+_0x504b25[_0x99a7('0x1c')];var _0x21cfa3;if(_0x2958a9>=_0x50a3e7){_0x2958a9=_0x50a3e7;_0x21cfa3=0xc8;}else{_0x21cfa3=0xce;}_0x59f49f[_0x99a7('0x18')](_0x21cfa3);return _0x59f49f[_0x99a7('0x1f')](_0x99a7('0x20'),_0x5aeee2+'-'+_0x2958a9+'/'+_0x50a3e7)[_0x99a7('0x1a')](_0x5d5749);}return null;};}function patchUpdates(_0x481fc7){return function(_0x23433b){try{jsonpatch[_0x99a7('0x21')](_0x23433b,_0x481fc7,!![]);}catch(_0x2043c0){return BPromise['reject'](_0x2043c0);}return _0x23433b['save']();};}function saveUpdates(_0x2a3a41,_0x210376){return function(_0x127c9f){if(_0x127c9f){return _0x127c9f[_0x99a7('0x22')](_0x2a3a41)[_0x99a7('0x23')](function(_0x10d0a9){return _0x10d0a9;});}return null;};}function removeEntity(_0x5c61cc,_0x4890e6){return function(_0x379f91){if(_0x379f91){return _0x379f91[_0x99a7('0x24')]()[_0x99a7('0x23')](function(){_0x5c61cc[_0x99a7('0x18')](0xcc)[_0x99a7('0x19')]();});}};}function handleEntityNotFound(_0x1b580f,_0x230849){return function(_0x181561){if(!_0x181561){_0x1b580f[_0x99a7('0x17')](0x194);}return _0x181561;};}function handleError(_0xb1e19c,_0x3344fe){_0x3344fe=_0x3344fe||0x1f4;return function(_0x51d2ac){logger[_0x99a7('0x25')](_0x51d2ac[_0x99a7('0x26')]);if(_0x51d2ac[_0x99a7('0x27')]){delete _0x51d2ac[_0x99a7('0x27')];}_0xb1e19c[_0x99a7('0x18')](_0x3344fe)['send'](_0x51d2ac);};}exports[_0x99a7('0x28')]=function(_0x51650f,_0x55d36e){var _0x47d304={},_0x442051={},_0x41ce98={'count':0x0,'rows':[]};var _0x3f58d3=_[_0x99a7('0x29')](db[_0x99a7('0x2a')][_0x99a7('0x2b')],function(_0x3fb59f){return{'name':_0x3fb59f['fieldName'],'type':_0x3fb59f[_0x99a7('0x2c')][_0x99a7('0x2d')]};});_0x442051[_0x99a7('0x2e')]=_['map'](_0x3f58d3,'name');_0x442051[_0x99a7('0x2f')]=_['keys'](_0x51650f['query']);_0x442051['filters']=_[_0x99a7('0x30')](_0x442051[_0x99a7('0x2e')],_0x442051[_0x99a7('0x2f')]);_0x47d304[_0x99a7('0x31')]=_[_0x99a7('0x30')](_0x442051[_0x99a7('0x2e')],qs[_0x99a7('0x32')](_0x51650f[_0x99a7('0x2f')][_0x99a7('0x32')]));_0x47d304[_0x99a7('0x31')]=_0x47d304[_0x99a7('0x31')][_0x99a7('0x33')]?_0x47d304[_0x99a7('0x31')]:_0x442051[_0x99a7('0x2e')];if(!_0x51650f[_0x99a7('0x2f')][_0x99a7('0x34')](_0x99a7('0x35'))){_0x47d304[_0x99a7('0x1c')]=qs[_0x99a7('0x1c')](_0x51650f[_0x99a7('0x2f')]['limit']);_0x47d304[_0x99a7('0x1d')]=qs[_0x99a7('0x1d')](_0x51650f['query'][_0x99a7('0x1d')]);}_0x47d304[_0x99a7('0x36')]=qs['sort'](_0x51650f[_0x99a7('0x2f')][_0x99a7('0x37')]);_0x47d304[_0x99a7('0x38')]=qs['filters'](_[_0x99a7('0x39')](_0x51650f[_0x99a7('0x2f')],_0x442051[_0x99a7('0x3a')]),_0x3f58d3);if(_0x51650f[_0x99a7('0x2f')][_0x99a7('0x3b')]){_0x47d304[_0x99a7('0x38')]=_[_0x99a7('0x3c')](_0x47d304[_0x99a7('0x38')],{'$or':_['map'](_0x3f58d3,function(_0x34e481){if(_0x34e481['type']!==_0x99a7('0x3d')){var _0xc38799={};_0xc38799[_0x34e481[_0x99a7('0x27')]]={'$like':'%'+_0x51650f[_0x99a7('0x2f')]['filter']+'%'};return _0xc38799;}})});}_0x47d304=_[_0x99a7('0x3c')]({},_0x47d304,_0x51650f['options']);var _0x3b64c4={'where':_0x47d304[_0x99a7('0x38')]};return db[_0x99a7('0x2a')]['count'](_0x3b64c4)[_0x99a7('0x23')](function(_0x6928c0){_0x41ce98[_0x99a7('0x1e')]=_0x6928c0;if(_0x51650f[_0x99a7('0x2f')][_0x99a7('0x3e')]){_0x47d304[_0x99a7('0x3f')]=[{'all':!![]}];}return db[_0x99a7('0x2a')][_0x99a7('0x40')](_0x47d304);})[_0x99a7('0x23')](function(_0x4d3e5e){_0x41ce98['rows']=_0x4d3e5e;return _0x41ce98;})[_0x99a7('0x23')](respondWithFilteredResult(_0x55d36e,_0x47d304))[_0x99a7('0x41')](handleError(_0x55d36e,null));};exports[_0x99a7('0x42')]=function(_0x542c97,_0x3f3c5f){var _0x290d6f={'raw':!![],'where':{'id':_0x542c97['params']['id']}},_0x1b364f={};_0x1b364f['model']=_[_0x99a7('0x43')](db[_0x99a7('0x2a')][_0x99a7('0x2b')]);_0x1b364f[_0x99a7('0x2f')]=_[_0x99a7('0x43')](_0x542c97[_0x99a7('0x2f')]);_0x1b364f['filters']=_[_0x99a7('0x30')](_0x1b364f[_0x99a7('0x2e')],_0x1b364f[_0x99a7('0x2f')]);_0x290d6f[_0x99a7('0x31')]=_['intersection'](_0x1b364f['model'],qs[_0x99a7('0x32')](_0x542c97[_0x99a7('0x2f')]['fields']));_0x290d6f[_0x99a7('0x31')]=_0x290d6f['attributes'][_0x99a7('0x33')]?_0x290d6f[_0x99a7('0x31')]:_0x1b364f[_0x99a7('0x2e')];if(_0x542c97[_0x99a7('0x2f')][_0x99a7('0x3e')]){_0x290d6f[_0x99a7('0x3f')]=[{'all':!![]}];}_0x290d6f=_[_0x99a7('0x3c')]({},_0x290d6f,_0x542c97[_0x99a7('0x44')]);return db[_0x99a7('0x2a')][_0x99a7('0x45')](_0x290d6f)['then'](handleEntityNotFound(_0x3f3c5f,null))[_0x99a7('0x23')](respondWithResult(_0x3f3c5f,null))['catch'](handleError(_0x3f3c5f,null));};exports[_0x99a7('0x46')]=function(_0x696e21,_0x15cbf5){return db[_0x99a7('0x2a')][_0x99a7('0x46')](_0x696e21[_0x99a7('0x47')],{})[_0x99a7('0x23')](respondWithResult(_0x15cbf5,0xc9))[_0x99a7('0x41')](handleError(_0x15cbf5,null));};exports[_0x99a7('0x22')]=function(_0x75a662,_0x54bba9){if(_0x75a662[_0x99a7('0x47')]['id']){delete _0x75a662[_0x99a7('0x47')]['id'];}return db[_0x99a7('0x2a')]['find']({'where':{'id':_0x75a662[_0x99a7('0x48')]['id']}})[_0x99a7('0x23')](handleEntityNotFound(_0x54bba9,null))[_0x99a7('0x23')](saveUpdates(_0x75a662[_0x99a7('0x47')],null))[_0x99a7('0x23')](respondWithResult(_0x54bba9,null))[_0x99a7('0x41')](handleError(_0x54bba9,null));};exports['destroy']=function(_0x298fe5,_0xce8932){return db[_0x99a7('0x2a')]['find']({'where':{'id':_0x298fe5[_0x99a7('0x48')]['id']}})[_0x99a7('0x23')](handleEntityNotFound(_0xce8932,null))['then'](removeEntity(_0xce8932,null))[_0x99a7('0x41')](handleError(_0xce8932,null));};exports[_0x99a7('0x49')]=function(_0x3b3282,_0x45982a){return db[_0x99a7('0x2a')][_0x99a7('0x49')]()[_0x99a7('0x23')](respondWithResult(_0x45982a,null))[_0x99a7('0x41')](handleError(_0x45982a,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 2f2d7fb..166cc32 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 _0x9c1b=['../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x1d5108,_0x55e387){var _0x3cdd9d=function(_0x2330f5){while(--_0x2330f5){_0x1d5108['push'](_0x1d5108['shift']());}};_0x3cdd9d(++_0x55e387);}(_0x9c1b,0x10d));var _0xb9c1=function(_0x120fdb,_0x586aa3){_0x120fdb=_0x120fdb-0x0;var _0xc2f5ba=_0x9c1b[_0x120fdb];return _0xc2f5ba;};'use strict';var _=require(_0xb9c1('0x0'));var util=require(_0xb9c1('0x1'));var logger=require(_0xb9c1('0x2'))('api');var moment=require(_0xb9c1('0x3'));var BPromise=require(_0xb9c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9c1('0x5'));var rimraf=require(_0xb9c1('0x6'));var config=require(_0xb9c1('0x7'));var attributes=require(_0xb9c1('0x8'));module['exports']=function(_0x109fd3,_0x285b29){return _0x109fd3['define'](_0xb9c1('0x9'),attributes,{'tableName':_0xb9c1('0xa'),'paranoid':![],'indexes':[{'name':_0xb9c1('0xb'),'fields':[_0xb9c1('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc7b=['request-promise','path','rimraf','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x4b136a,_0xa8310c){var _0x51a36b=function(_0x35970e){while(--_0x35970e){_0x4b136a['push'](_0x4b136a['shift']());}};_0x51a36b(++_0xa8310c);}(_0xfc7b,0x140));var _0xbfc7=function(_0x593467,_0x14e615){_0x593467=_0x593467-0x0;var _0x67a71b=_0xfc7b[_0x593467];return _0x67a71b;};'use strict';var _=require(_0xbfc7('0x0'));var util=require(_0xbfc7('0x1'));var logger=require(_0xbfc7('0x2'))(_0xbfc7('0x3'));var moment=require('moment');var BPromise=require(_0xbfc7('0x4'));var rp=require(_0xbfc7('0x5'));var fs=require('fs');var path=require(_0xbfc7('0x6'));var rimraf=require(_0xbfc7('0x7'));var config=require('../../config/environment');var attributes=require(_0xbfc7('0x8'));module[_0xbfc7('0x9')]=function(_0xe8fe35,_0x2ac233){return _0xe8fe35[_0xbfc7('0xa')]('ChatTransferReport',attributes,{'tableName':_0xbfc7('0xb'),'paranoid':![],'indexes':[{'name':_0xbfc7('0xc'),'fields':[_0xbfc7('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 65eb0d0..ed5521d 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 _0x9cd4=['ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x50fe34,_0x14a248){var _0x5eab16=function(_0x2f5b6f){while(--_0x2f5b6f){_0x50fe34['push'](_0x50fe34['shift']());}};_0x5eab16(++_0x14a248);}(_0x9cd4,0x171));var _0x49cd=function(_0x4e7af4,_0x758572){_0x4e7af4=_0x4e7af4-0x0;var _0x2548f1=_0x9cd4[_0x4e7af4];return _0x2548f1;};'use strict';var _=require('lodash');var util=require(_0x49cd('0x0'));var moment=require(_0x49cd('0x1'));var BPromise=require(_0x49cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x49cd('0x4'));var logger=require('../../config/logger')(_0x49cd('0x5'));var config=require(_0x49cd('0x6'));var jayson=require(_0x49cd('0x7'));var client=jayson[_0x49cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x521d8b,_0x252487,_0x3b50a1){return new BPromise(function(_0x6b551c,_0x48adb7){return client[_0x49cd('0x9')](_0x521d8b,_0x3b50a1)['then'](function(_0x22126b){logger[_0x49cd('0xa')](_0x49cd('0xb'),_0x252487,'request\x20sent');logger[_0x49cd('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x252487,_0x49cd('0xd'),JSON[_0x49cd('0xe')](_0x22126b));if(_0x22126b[_0x49cd('0xf')]){if(_0x22126b[_0x49cd('0xf')][_0x49cd('0x10')]===0x1f4){logger[_0x49cd('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x252487,_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);return _0x48adb7(_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);}logger['error'](_0x49cd('0xb'),_0x252487,_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);return _0x6b551c(_0x22126b[_0x49cd('0xf')][_0x49cd('0x11')]);}else{logger['info'](_0x49cd('0xb'),_0x252487,_0x49cd('0xd'));_0x6b551c(_0x22126b[_0x49cd('0x12')][_0x49cd('0x11')]);}})[_0x49cd('0x13')](function(_0x2fb397){logger[_0x49cd('0xf')](_0x49cd('0xb'),_0x252487,_0x2fb397);_0x48adb7(_0x2fb397);});});}
\ No newline at end of file
+var _0xa930=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x513254,_0x1305ca){var _0x384c92=function(_0xb22823){while(--_0xb22823){_0x513254['push'](_0x513254['shift']());}};_0x384c92(++_0x1305ca);}(_0xa930,0x1c0));var _0x0a93=function(_0xcb0c01,_0x43ba1c){_0xcb0c01=_0xcb0c01-0x0;var _0x26756d=_0xa930[_0xcb0c01];return _0x26756d;};'use strict';var _=require(_0x0a93('0x0'));var util=require(_0x0a93('0x1'));var moment=require(_0x0a93('0x2'));var BPromise=require(_0x0a93('0x3'));var rs=require(_0x0a93('0x4'));var fs=require('fs');var Redis=require(_0x0a93('0x5'));var db=require(_0x0a93('0x6'))['db'];var utils=require(_0x0a93('0x7'));var logger=require(_0x0a93('0x8'))(_0x0a93('0x9'));var config=require(_0x0a93('0xa'));var jayson=require(_0x0a93('0xb'));var client=jayson['client'][_0x0a93('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x465359,_0x5e3a09,_0x7bb695){return new BPromise(function(_0x23eb3f,_0xba4017){return client[_0x0a93('0xd')](_0x465359,_0x7bb695)[_0x0a93('0xe')](function(_0x3ff0f3){logger[_0x0a93('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x5e3a09,_0x0a93('0x10'));logger[_0x0a93('0x11')](_0x0a93('0x12'),_0x5e3a09,'request\x20sent',JSON['stringify'](_0x3ff0f3));if(_0x3ff0f3[_0x0a93('0x13')]){if(_0x3ff0f3[_0x0a93('0x13')][_0x0a93('0x14')]===0x1f4){logger['error'](_0x0a93('0x15'),_0x5e3a09,_0x3ff0f3[_0x0a93('0x13')][_0x0a93('0x16')]);return _0xba4017(_0x3ff0f3[_0x0a93('0x13')]['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5e3a09,_0x3ff0f3[_0x0a93('0x13')][_0x0a93('0x16')]);return _0x23eb3f(_0x3ff0f3[_0x0a93('0x13')][_0x0a93('0x16')]);}else{logger[_0x0a93('0xf')](_0x0a93('0x15'),_0x5e3a09,_0x0a93('0x10'));_0x23eb3f(_0x3ff0f3[_0x0a93('0x17')][_0x0a93('0x16')]);}})[_0x0a93('0x18')](function(_0x30694d){logger[_0x0a93('0x13')](_0x0a93('0x15'),_0x5e3a09,_0x30694d);_0xba4017(_0x30694d);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index b390975..c983080 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 _0x1823=['exports','util','path','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3a175b,_0x505d13){var _0x9b84fa=function(_0x5533e1){while(--_0x5533e1){_0x3a175b['push'](_0x3a175b['shift']());}};_0x9b84fa(++_0x505d13);}(_0x1823,0x11e));var _0x3182=function(_0x39ce5a,_0x260622){_0x39ce5a=_0x39ce5a-0x0;var _0x46cd9a=_0x1823[_0x39ce5a];return _0x46cd9a;};'use strict';var multer=require('multer');var util=require(_0x3182('0x0'));var path=require(_0x3182('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3182('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3182('0x3'));var config=require(_0x3182('0x4'));var controller=require(_0x3182('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3182('0x6')](_0x3182('0x7'),auth[_0x3182('0x8')](),controller[_0x3182('0x9')]);router[_0x3182('0x6')](_0x3182('0xa'),auth[_0x3182('0x8')](),controller[_0x3182('0xb')]);router[_0x3182('0xc')]('/',auth[_0x3182('0x8')](),controller[_0x3182('0xd')]);router[_0x3182('0xe')](_0x3182('0xa'),auth['isAuthenticated'](),controller[_0x3182('0xf')]);router[_0x3182('0x10')](_0x3182('0xa'),auth[_0x3182('0x8')](),controller[_0x3182('0x11')]);module[_0x3182('0x12')]=router;
\ No newline at end of file
+var _0xe90a=['describe','post','put','update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','isAuthenticated'];(function(_0x5c6c04,_0x4d576a){var _0x403115=function(_0xfdd4ba){while(--_0xfdd4ba){_0x5c6c04['push'](_0x5c6c04['shift']());}};_0x403115(++_0x4d576a);}(_0xe90a,0x6b));var _0xae90=function(_0x549c51,_0x29e6fd){_0x549c51=_0x549c51-0x0;var _0x264861=_0xe90a[_0x549c51];return _0x264861;};'use strict';var multer=require('multer');var util=require(_0xae90('0x0'));var path=require(_0xae90('0x1'));var timeout=require(_0xae90('0x2'));var express=require(_0xae90('0x3'));var router=express[_0xae90('0x4')]();var fs_extra=require(_0xae90('0x5'));var auth=require(_0xae90('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae90('0x7'));var controller=require(_0xae90('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xae90('0x9')]);router[_0xae90('0xa')](_0xae90('0xb'),auth[_0xae90('0xc')](),controller[_0xae90('0xd')]);router[_0xae90('0xa')]('/:id',auth[_0xae90('0xc')](),controller['show']);router[_0xae90('0xe')]('/',auth[_0xae90('0xc')](),controller['create']);router[_0xae90('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xae90('0x10')]);router[_0xae90('0x11')](_0xae90('0x12'),auth[_0xae90('0xc')](),controller[_0xae90('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 9ba5114..b8a0049 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 _0x8283=['#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','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.','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate'];(function(_0x3a4053,_0x5684ee){var _0x42af54=function(_0x97a4b6){while(--_0x97a4b6){_0x3a4053['push'](_0x3a4053['shift']());}};_0x42af54(++_0x5684ee);}(_0x8283,0x173));var _0x3828=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8283[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3828('0x0'));var rs=require('randomstring');module[_0x3828('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3828('0x2')},'description':{'type':Sequelize[_0x3828('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3828('0x3')],'allowNull':![],'defaultValue':_0x3828('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x3828('0xa'),'squared'),'defaultValue':_0x3828('0xa')},'header_online':{'type':Sequelize[_0x3828('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xb')},'offline_chat_button':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'header_offline':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3828('0xf')]},'closingQuestion':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x12')},'noteTitle':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x13')},'placeholderMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x14')},'closingMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x15')},'closingMessageButton':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'skipMessageButton':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x16')},'conditionAgreement':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x17')},'ratingType':{'type':Sequelize[_0x3828('0x18')](_0x3828('0x19'),_0x3828('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return JSON[_0x3828('0x1b')]({'items':[{'type':_0x3828('0x1c'),'variable':null,'config':{'placeholder':_0x3828('0x1d'),'type':'text','required':!![]},'props':{'title':_0x3828('0x1d'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3828('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3828('0x1e')](_0x3828('0x1f'))?JSON[_0x3828('0x20')](this[_0x3828('0x1e')](_0x3828('0x1f'))):{};},'set':function(_0x176b5f){return this[_0x3828('0x21')]('onlineForm',JSON['stringify'](_0x176b5f));}},'offlineForm':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return JSON[_0x3828('0x1b')]({'items':[{'type':_0x3828('0x1c'),'props':{'title':_0x3828('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null},{'type':_0x3828('0x22'),'config':{'placeholder':_0x3828('0x23')},'props':{'title':'Comments','helpText':_0x3828('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x3828('0x1e')](_0x3828('0x25'))?JSON['parse'](this['getDataValue'](_0x3828('0x25'))):{};},'set':function(_0x5b714f){return this['setDataValue']('offlineForm',JSON[_0x3828('0x1b')](_0x5b714f));}},'token':{'type':Sequelize[_0x3828('0x3')],'defaultValue':function(){return rs[_0x3828('0x26')]();}},'autoclose':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3828('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x27')},'waitingMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'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['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x29')},'skipUnmanaged':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x16')},'sendUnmanaged':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3828('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3828('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3828('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3828('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2b')},'verticalAlignment':{'type':Sequelize[_0x3828('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3828('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3828('0x2c')},'defaultTitle':{'type':Sequelize[_0x3828('0x3')]},'customerAvatar':{'type':Sequelize[_0x3828('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3828('0x3')],'allowNull':![],'defaultValue':_0x3828('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3828('0x3')],'defaultValue':_0x3828('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3828('0x8')],'comment':_0x3828('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![],'comment':_0x3828('0x30'),'set':function(_0x2874b0){if(!_0x2874b0)this[_0x3828('0x21')](_0x3828('0x31'),null);this[_0x3828('0x21')]('mandatoryDisposition',_0x2874b0);}},'vidaooEscalation':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3828('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3828('0x32')},'vidaooNote':{'type':Sequelize[_0x3828('0x3')],'defaultValue':function(){return _0x3828('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x3828('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3828('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3828('0xf')]}};
\ No newline at end of file
+var _0x48f7=['onlineForm','parse','setDataValue','textarea','Comments','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.','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Form\x20properly\x20submitted','Note','Skip','Feedback','star','thumb','stringify','input','name','getDataValue'];(function(_0x588e09,_0xdcccdb){var _0x24d9a1=function(_0x22a1ef){while(--_0x22a1ef){_0x588e09['push'](_0x588e09['shift']());}};_0x24d9a1(++_0xdcccdb);}(_0x48f7,0x71));var _0x748f=function(_0x19f4aa,_0x17a0d6){_0x19f4aa=_0x19f4aa-0x0;var _0x2aed12=_0x48f7[_0x19f4aa];return _0x2aed12;};'use strict';var Sequelize=require(_0x748f('0x0'));var rs=require('randomstring');module[_0x748f('0x1')]={'name':{'type':Sequelize[_0x748f('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x748f('0x3')},'description':{'type':Sequelize[_0x748f('0x2')]},'mapKey':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x4')},'mapKeyOffline':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x4')},'key':{'type':Sequelize[_0x748f('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x5')},'customerAlias':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x748f('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x748f('0x2')],'allowNull':![],'defaultValue':_0x748f('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x748f('0x2')],'allowNull':![],'defaultValue':_0x748f('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x748f('0x9')]('rounded',_0x748f('0xa')),'defaultValue':_0x748f('0xb')},'header_online':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xc')},'start_chat_button':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xd')},'offline_chat_button':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xe')},'header_offline':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x748f('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x748f('0x11')]},'closingQuestion':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x13')},'placeholderMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x748f('0xe')},'skipMessageButton':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x748f('0x16'),_0x748f('0x17')),'defaultValue':_0x748f('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x748f('0x18')]({'items':[{'type':_0x748f('0x19'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x748f('0x1a'),'helpText':''}},{'type':_0x748f('0x19'),'props':{'title':_0x748f('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x748f('0x4'),'type':_0x748f('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x748f('0x1b')](_0x748f('0x1c'))?JSON[_0x748f('0x1d')](this[_0x748f('0x1b')](_0x748f('0x1c'))):{};},'set':function(_0x181fdd){return this[_0x748f('0x1e')](_0x748f('0x1c'),JSON[_0x748f('0x18')](_0x181fdd));}},'offlineForm':{'type':Sequelize[_0x748f('0x11')],'defaultValue':function(){return JSON[_0x748f('0x18')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x748f('0x4'),'type':_0x748f('0x4')},'variable':null},{'type':_0x748f('0x1f'),'config':{'placeholder':_0x748f('0x20')},'props':{'title':_0x748f('0x20'),'helpText':_0x748f('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x748f('0x1b')](_0x748f('0x22'))?JSON[_0x748f('0x1d')](this[_0x748f('0x1b')](_0x748f('0x22'))):{};},'set':function(_0x1de9f2){return this[_0x748f('0x1e')](_0x748f('0x22'),JSON[_0x748f('0x18')](_0x1de9f2));}},'token':{'type':Sequelize[_0x748f('0x2')],'defaultValue':function(){return rs[_0x748f('0x23')]();}},'autoclose':{'type':Sequelize[_0x748f('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x748f('0x2')]},'waitingTitle':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x24')},'waitingMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x748f('0x10')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x748f('0x14')},'sendUnmanaged':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x748f('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x748f('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0x748f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x27')},'verticalAlignment':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x748f('0x2')],'defaultValue':_0x748f('0x28')},'messagesAlignment':{'type':Sequelize[_0x748f('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x748f('0x2')]},'customerAvatar':{'type':Sequelize[_0x748f('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x748f('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x748f('0x2')],'allowNull':![],'defaultValue':_0x748f('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x748f('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x748f('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x748f('0x2a')},'systemAvatar':{'type':Sequelize[_0x748f('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x748f('0x2b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5a7071){if(!_0x5a7071)this[_0x748f('0x1e')](_0x748f('0x2c'),null);this[_0x748f('0x1e')]('mandatoryDisposition',_0x5a7071);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x748f('0x2')],'allowNull':![],'defaultValue':_0x748f('0x2d')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x748f('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x748f('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x748f('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index fb7162e..2ba933c 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 _0xa9e0=['fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','bluebird','mustache','util','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','error','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','Pause','map','ChatWebsite','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','keys','find','create','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','file','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','server/files/images/logos/','download','isNil','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','Applications','List','account','applications','list','asc','from','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','*,*,*,*','AttachmentId','UserId','User','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','spread','readFileSync','render','offlineMessageBody','ChatOfflineMessage','fromString','attachments','offline-chat','basename','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','MailAccountId','mimetype','mapValues','subjectOffline','Chat','server','files','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','all','some','x-real-ip','connection','remoteAddress','replace','textColor','color_button','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items'];(function(_0x207b7f,_0x1d1323){var _0x2d6d8e=function(_0x40156f){while(--_0x40156f){_0x207b7f['push'](_0x207b7f['shift']());}};_0x2d6d8e(++_0x1d1323);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var BPromise=require(_0x0a9e('0x0'));var Mustache=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x3'));var _=require('lodash');var querystring=require(_0x0a9e('0x4'));var Redis=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var db=require(_0x0a9e('0x9'))['db'];config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x0a9e('0xd')](socket);var htmlToText=require(_0x0a9e('0xe'));var jayson=require(_0x0a9e('0xf'));var client=jayson[_0x0a9e('0x10')][_0x0a9e('0x11')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x10')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x0a9e('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x36471c,_0xd5b662,_0x26d672,_0x32d742){return new BPromise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_0x32d742||client;return _0x4283ce[_0x0a9e('0x12')](_0x36471c,_0x26d672)[_0x0a9e('0x13')](function(_0x281129){logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');logger[_0x0a9e('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xd5b662,_0x0a9e('0x17'),JSON['stringify'](_0x281129));if(_0x281129[_0x0a9e('0x18')]){if(_0x281129[_0x0a9e('0x18')]['code']===0x1f4){logger[_0x0a9e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x5db4b0(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}logger[_0x0a9e('0x18')](_0x0a9e('0x15'),_0xd5b662,_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);return _0x69aeb7(_0x281129[_0x0a9e('0x18')][_0x0a9e('0x19')]);}else{logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0xd5b662,'request\x20sent');_0x69aeb7(_0x281129[_0x0a9e('0x1a')][_0x0a9e('0x19')]);}})['catch'](function(_0x20f109){logger['error']('ChatWebsite,\x20%s,\x20%s',_0xd5b662,_0x20f109);_0x5db4b0(_0x20f109);});});}function respondWithStatusCode(_0x3a02e1,_0x432e56){_0x432e56=_0x432e56||0xcc;return function(_0x38e7c4){if(_0x38e7c4){return _0x3a02e1[_0x0a9e('0x1b')](_0x432e56);}return _0x3a02e1['status'](_0x432e56)[_0x0a9e('0x1c')]();};}function respondWithResult(_0x2fb0e4,_0x3b45bc){_0x3b45bc=_0x3b45bc||0xc8;return function(_0x4d00e6){if(_0x4d00e6){return _0x2fb0e4[_0x0a9e('0x1d')](_0x3b45bc)[_0x0a9e('0x1e')](_0x4d00e6);}};}function respondWithFilteredResult(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(_0x59181e){var _0x197ec0=typeof _0x5ea472[_0x0a9e('0x1f')]===_0x0a9e('0x20')&&typeof _0x5ea472[_0x0a9e('0x21')]==='undefined';var _0x384319=_0x59181e['count'];var _0x45a1e7=_0x197ec0?0x0:_0x5ea472['offset'];var _0x1dc186=_0x197ec0?_0x59181e[_0x0a9e('0x22')]:_0x5ea472[_0x0a9e('0x1f')]+_0x5ea472[_0x0a9e('0x21')];var _0x140511;if(_0x1dc186>=_0x384319){_0x1dc186=_0x384319;_0x140511=0xc8;}else{_0x140511=0xce;}_0x16b1ca[_0x0a9e('0x1d')](_0x140511);return _0x16b1ca[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x45a1e7+'-'+_0x1dc186+'/'+_0x384319)['json'](_0x59181e);}return null;};}function saveUpdates(_0x3652a7){return function(_0x468813){if(_0x468813){return _0x468813[_0x0a9e('0x25')](_0x3652a7)[_0x0a9e('0x13')](function(_0x5c877d){return _0x5c877d;});}return null;};}function removeEntity(_0x15b200){return function(_0x40e7a3){if(_0x40e7a3){return _0x40e7a3[_0x0a9e('0x26')]()[_0x0a9e('0x13')](function(){var _0x58b06f=_0x40e7a3[_0x0a9e('0x27')]({'plain':!![]});var _0x296f41=_0x0a9e('0x28');return db[_0x0a9e('0x29')]['destroy']({'where':{'type':_0x296f41,'resourceId':_0x58b06f['id']}})[_0x0a9e('0x13')](function(){return _0x40e7a3;});})['then'](function(){_0x15b200[_0x0a9e('0x1d')](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x1122db){return function(_0x33bdb7){if(!_0x33bdb7){_0x1122db[_0x0a9e('0x1b')](0x194);}return _0x33bdb7;};}function handleError(_0x5180f1,_0x66c1d2){_0x66c1d2=_0x66c1d2||0x1f4;return function(_0x46f0a5){logger[_0x0a9e('0x18')](_0x46f0a5[_0x0a9e('0x2a')]);if(_0x46f0a5[_0x0a9e('0x2b')]){delete _0x46f0a5[_0x0a9e('0x2b')];}_0x5180f1[_0x0a9e('0x1d')](_0x66c1d2)[_0x0a9e('0x2c')](_0x46f0a5);};}exports['index']=function(_0x44295a,_0x5e7238){var _0x2cc7a0={'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]},_0x14b13f={},_0x2b7e7f={'count':0x0,'rows':[]};var _0x191e91=_[_0x0a9e('0x2e')](db[_0x0a9e('0x2f')][_0x0a9e('0x30')],function(_0x4853b1){return{'name':_0x4853b1['fieldName'],'type':_0x4853b1[_0x0a9e('0x31')]['key']};});_0x14b13f[_0x0a9e('0x32')]=_[_0x0a9e('0x2e')](_0x191e91,_0x0a9e('0x2b'));_0x14b13f[_0x0a9e('0x33')]=_['keys'](_0x44295a[_0x0a9e('0x33')]);_0x14b13f[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x14b13f['model'],_0x14b13f[_0x0a9e('0x33')]);_0x2cc7a0[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x14b13f['model'],qs['fields'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x2cc7a0['attributes']=_0x2cc7a0[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x2cc7a0[_0x0a9e('0x36')]:_0x14b13f[_0x0a9e('0x32')];if(!_0x44295a['query']['hasOwnProperty'](_0x0a9e('0x39'))){_0x2cc7a0[_0x0a9e('0x21')]=qs['limit'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x2cc7a0[_0x0a9e('0x1f')]=qs['offset'](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x2cc7a0[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x2cc7a0[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x44295a[_0x0a9e('0x33')],_0x14b13f[_0x0a9e('0x34')]),_0x191e91);if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x2cc7a0[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x2cc7a0['where'],{'$or':_['map'](_0x191e91,function(_0x473fdc){if(_0x473fdc[_0x0a9e('0x31')]!==_0x0a9e('0x40')){var _0x315881={};_0x315881[_0x473fdc[_0x0a9e('0x2b')]]={'$like':'%'+_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x315881;}})});}_0x2cc7a0=_[_0x0a9e('0x3f')]({},_0x2cc7a0,_0x44295a[_0x0a9e('0x41')]);var _0x25c6e6={'where':_0x2cc7a0[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2f')]['count'](_0x25c6e6)[_0x0a9e('0x13')](function(_0x138b8b){_0x2b7e7f[_0x0a9e('0x22')]=_0x138b8b;if(_0x44295a[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x2cc7a0[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x2f')][_0x0a9e('0x44')](_0x2cc7a0);})['then'](function(_0x2e9d90){_0x2b7e7f['rows']=_0x2e9d90;return _0x2b7e7f;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x5e7238,_0x2cc7a0))[_0x0a9e('0x45')](handleError(_0x5e7238,null));};exports[_0x0a9e('0x46')]=function(_0x562fb4,_0x14bec2){var _0x7f6eb1={'raw':![],'where':{'id':_0x562fb4[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':_0x0a9e('0x48')}]},_0x4774f4={};_0x4774f4[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x2f')][_0x0a9e('0x30')]);_0x4774f4[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x562fb4[_0x0a9e('0x33')]);_0x4774f4[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],_0x4774f4[_0x0a9e('0x33')]);_0x7f6eb1['attributes']=_[_0x0a9e('0x35')](_0x4774f4[_0x0a9e('0x32')],qs['fields'](_0x562fb4['query']['fields']));_0x7f6eb1[_0x0a9e('0x36')]=_0x7f6eb1[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x7f6eb1[_0x0a9e('0x36')]:_0x4774f4[_0x0a9e('0x32')];if(_0x562fb4[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x7f6eb1[_0x0a9e('0x43')]=[{'all':!![]}];}_0x7f6eb1=_['merge']({},_0x7f6eb1,_0x562fb4['options']);return db['ChatWebsite'][_0x0a9e('0x4a')](_0x7f6eb1)[_0x0a9e('0x13')](handleEntityNotFound(_0x14bec2,null))[_0x0a9e('0x13')](respondWithResult(_0x14bec2,null))['catch'](handleError(_0x14bec2,null));};exports[_0x0a9e('0x4b')]=function(_0x161aa7,_0x53d113){return db['ChatWebsite'][_0x0a9e('0x4b')](_0x161aa7['body'],{})[_0x0a9e('0x13')](function(_0x4c3845){var _0x2e5e62=_0x161aa7[_0x0a9e('0x4c')][_0x0a9e('0x27')]({'plain':!![]});if(!_0x2e5e62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e5e62[_0x0a9e('0x4d')]===_0x0a9e('0x4c')){var _0x508b47=_0x4c3845['get']({'plain':!![]});var _0x128aa6=_0x0a9e('0x28');return db['UserProfileSection'][_0x0a9e('0x4a')]({'where':{'name':_0x128aa6,'userProfileId':_0x2e5e62['userProfileId']},'raw':!![]})[_0x0a9e('0x13')](function(_0x523cd2){if(_0x523cd2&&_0x523cd2[_0x0a9e('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x508b47['name'],'resourceId':_0x508b47['id'],'type':_0x523cd2[_0x0a9e('0x2b')],'sectionId':_0x523cd2['id']},{})['then'](function(){return _0x4c3845;});}else{return _0x4c3845;}})[_0x0a9e('0x45')](function(_0x65432){logger[_0x0a9e('0x18')](_0x0a9e('0x4f'),_0x65432);throw _0x65432;});}return _0x4c3845;})[_0x0a9e('0x13')](respondWithResult(_0x53d113,0xc9))[_0x0a9e('0x45')](handleError(_0x53d113,null));};exports[_0x0a9e('0x25')]=function(_0x28d814,_0x4e67ab){if(_0x28d814[_0x0a9e('0x50')]['id']){delete _0x28d814[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x28d814[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x2d')],'as':'mandatoryDispositionPause'}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x4e67ab,null))[_0x0a9e('0x13')](saveUpdates(_0x28d814['body'],null))[_0x0a9e('0x13')](respondWithResult(_0x4e67ab,null))['catch'](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x26')]=function(_0x5ba1f9,_0x4b3c1a){return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x5ba1f9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x4b3c1a,null))[_0x0a9e('0x13')](removeEntity(_0x4b3c1a,null))[_0x0a9e('0x45')](handleError(_0x4b3c1a,null));};exports[_0x0a9e('0x51')]=function(_0x1cca9f,_0x26d7db){return db['ChatWebsite'][_0x0a9e('0x51')]()['then'](respondWithResult(_0x26d7db,null))[_0x0a9e('0x45')](handleError(_0x26d7db,null));};exports[_0x0a9e('0x52')]=function(_0x51aaf7,_0x5adf8f){if(_0x51aaf7[_0x0a9e('0x50')]['id']){delete _0x51aaf7[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51aaf7['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x5adf8f,null))[_0x0a9e('0x13')](function(_0x54327c){if(_0x54327c){_0x51aaf7[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x54327c['id'];return db[_0x0a9e('0x54')][_0x0a9e('0x4b')](_0x51aaf7[_0x0a9e('0x50')]);}})['then'](respondWithResult(_0x5adf8f,null))[_0x0a9e('0x45')](handleError(_0x5adf8f,null));};exports[_0x0a9e('0x55')]=function(_0x281c7d,_0x47bb43){var _0x3528b7={'raw':![],'where':{}};var _0x4f1e60={};var _0x5211e3={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x281c7d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x47bb43,null))[_0x0a9e('0x13')](function(_0xc8c264){if(_0xc8c264){_0x4f1e60[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x54')][_0x0a9e('0x30')]);_0x4f1e60[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x281c7d[_0x0a9e('0x33')]);_0x4f1e60[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x4f1e60[_0x0a9e('0x32')],_0x4f1e60[_0x0a9e('0x33')]);_0x3528b7[_0x0a9e('0x36')]=_['intersection'](_0x4f1e60[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x281c7d[_0x0a9e('0x33')]['fields']));_0x3528b7[_0x0a9e('0x36')]=_0x3528b7[_0x0a9e('0x36')]['length']?_0x3528b7[_0x0a9e('0x36')]:_0x4f1e60[_0x0a9e('0x32')];if(!_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x3528b7['limit']=qs['limit'](_0x281c7d['query'][_0x0a9e('0x21')]);_0x3528b7[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x3528b7[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x281c7d[_0x0a9e('0x33')]['sort']);_0x3528b7[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x281c7d['query'],_0x4f1e60[_0x0a9e('0x34')]));_0x3528b7['where'][_0x0a9e('0x53')]=_0xc8c264['id'];if(_0x281c7d[_0x0a9e('0x33')]['filter']){_0x3528b7[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x3528b7[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x3528b7['attributes'],function(_0x1d442c){var _0x2e9552={};_0x2e9552[_0x1d442c]={'$like':'%'+_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2e9552;})});}_0x3528b7=_['merge']({},_0x3528b7,_0x281c7d[_0x0a9e('0x41')]);return db[_0x0a9e('0x54')][_0x0a9e('0x22')]({'where':_0x3528b7[_0x0a9e('0x3c')]})['then'](function(_0x290d43){_0x5211e3[_0x0a9e('0x22')]=_0x290d43;if(_0x281c7d[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x3528b7[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x54')][_0x0a9e('0x44')](_0x3528b7);})[_0x0a9e('0x13')](function(_0x1a7b03){_0x5211e3[_0x0a9e('0x58')]=_0x1a7b03;return _0x5211e3;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x47bb43,_0x3528b7))[_0x0a9e('0x45')](handleError(_0x47bb43,null));};exports[_0x0a9e('0x59')]=function(_0xe0749e,_0x5b35db){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0xe0749e[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b35db,null))[_0x0a9e('0x13')](function(_0x33dda0){if(_0x33dda0){return _0x33dda0[_0x0a9e('0x59')](_0xe0749e[_0x0a9e('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x5b35db,null))[_0x0a9e('0x45')](handleError(_0x5b35db,null));};exports[_0x0a9e('0x5a')]=function(_0x4c54fa,_0x45108c){if(_0x4c54fa['body']['id']){delete _0x4c54fa[_0x0a9e('0x50')]['id'];}return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x4c54fa[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45108c,null))[_0x0a9e('0x13')](function(_0x42b959){if(_0x42b959){_0x4c54fa[_0x0a9e('0x50')][_0x0a9e('0x53')]=_0x42b959['id'];return db[_0x0a9e('0x5b')]['create'](_0x4c54fa[_0x0a9e('0x50')]);}})[_0x0a9e('0x13')](respondWithResult(_0x45108c,null))[_0x0a9e('0x45')](handleError(_0x45108c,null));};exports[_0x0a9e('0x5c')]=function(_0x492543,_0xf51744){var _0xf0db1={'raw':![],'where':{}};var _0x4bf3a5={};var _0x1d6834={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x492543[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xf51744,null))[_0x0a9e('0x13')](function(_0x5af453){if(_0x5af453){_0x4bf3a5['model']=_[_0x0a9e('0x49')](db[_0x0a9e('0x5b')][_0x0a9e('0x30')]);_0x4bf3a5['query']=_[_0x0a9e('0x49')](_0x492543[_0x0a9e('0x33')]);_0x4bf3a5['filters']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],_0x4bf3a5['query']);_0xf0db1['attributes']=_['intersection'](_0x4bf3a5[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0xf0db1[_0x0a9e('0x36')]=_0xf0db1[_0x0a9e('0x36')]['length']?_0xf0db1[_0x0a9e('0x36')]:_0x4bf3a5['model'];if(!_0x492543[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0xf0db1[_0x0a9e('0x21')]=qs['limit'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0xf0db1[_0x0a9e('0x1f')]=qs['offset'](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0xf0db1[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0xf0db1[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x492543[_0x0a9e('0x33')],_0x4bf3a5[_0x0a9e('0x34')]));_0xf0db1['where'][_0x0a9e('0x53')]=_0x5af453['id'];if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0xf0db1['where']=_[_0x0a9e('0x3f')](_0xf0db1['where'],{'$or':_[_0x0a9e('0x2e')](_0xf0db1[_0x0a9e('0x36')],function(_0x558a87){var _0x1f29bd={};_0x1f29bd[_0x558a87]={'$like':'%'+_0x492543[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x1f29bd;})});}_0xf0db1=_[_0x0a9e('0x3f')]({},_0xf0db1,_0x492543[_0x0a9e('0x41')]);return db['CannedAnswer'][_0x0a9e('0x22')]({'where':_0xf0db1[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x30ef6e){_0x1d6834[_0x0a9e('0x22')]=_0x30ef6e;if(_0x492543[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0xf0db1[_0x0a9e('0x43')]=[{'all':!![]}];}return db[_0x0a9e('0x5b')][_0x0a9e('0x44')](_0xf0db1);})[_0x0a9e('0x13')](function(_0x3754e2){_0x1d6834[_0x0a9e('0x58')]=_0x3754e2;return _0x1d6834;});}})['then'](respondWithFilteredResult(_0xf51744,_0xf0db1))[_0x0a9e('0x45')](handleError(_0xf51744,null));};exports[_0x0a9e('0x5d')]=function(_0x12843d,_0x2ed526){return db[_0x0a9e('0x2f')]['find']({'where':{'id':_0x12843d[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2ed526,null))['then'](function(_0x23b447){if(_0x23b447){return _0x23b447['removeAnswers'](_0x12843d[_0x0a9e('0x33')][_0x0a9e('0x5e')]);}})[_0x0a9e('0x13')](respondWithStatusCode(_0x2ed526,null))[_0x0a9e('0x45')](handleError(_0x2ed526,null));};exports['addLogo']=function(_0x3ceba6,_0x4cf72d){_0x3ceba6[_0x0a9e('0x50')][_0x0a9e('0x5f')]=_0x3ceba6['file'][_0x0a9e('0x60')];return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x3ceba6['params']['id']}})['then'](handleEntityNotFound(_0x4cf72d,null))[_0x0a9e('0x13')](saveUpdates(_0x3ceba6[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x4cf72d,null))[_0x0a9e('0x45')](handleError(_0x4cf72d,null));};exports[_0x0a9e('0x61')]=function(_0x2450a8,_0x17793e){_0x2450a8[_0x0a9e('0x50')][_0x0a9e('0x62')]=_0x2450a8['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2450a8[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x17793e,null))[_0x0a9e('0x13')](saveUpdates(_0x2450a8[_0x0a9e('0x50')],null))['then'](respondWithResult(_0x17793e,null))[_0x0a9e('0x45')](handleError(_0x17793e,null));};exports[_0x0a9e('0x63')]=function(_0x2791c5,_0x2aa5f2){_0x2791c5[_0x0a9e('0x50')]['customerAvatar']=_0x2791c5['file'][_0x0a9e('0x60')];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x2791c5[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x13')](saveUpdates(_0x2791c5[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports['addSystemAvatar']=function(_0x1889ed,_0x5dfbe2){_0x1889ed[_0x0a9e('0x50')]['systemAvatar']=_0x1889ed[_0x0a9e('0x64')]['filename'];return db['ChatWebsite'][_0x0a9e('0x4a')]({'where':{'id':_0x1889ed[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x5dfbe2,null))[_0x0a9e('0x13')](saveUpdates(_0x1889ed[_0x0a9e('0x50')],null))[_0x0a9e('0x13')](respondWithResult(_0x5dfbe2,null))[_0x0a9e('0x45')](handleError(_0x5dfbe2,null));};exports[_0x0a9e('0x65')]=function(_0x5ab0bc,_0x5505f4){var _0x16449b=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x68'));var _0x59303b={'where':{'id':_0x5ab0bc['params']['id']},'attributes':['id',_0x0a9e('0x5f')],'raw':!![]};var _0xadce3d=![];return require('../../config/license/util')[_0x0a9e('0x69')]()[_0x0a9e('0x13')](function(_0xcacabb){if(_0xcacabb){_0xadce3d=_0xcacabb[_0x0a9e('0x6a')];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x59303b);})[_0x0a9e('0x13')](handleEntityNotFound(_0x5505f4,null))[_0x0a9e('0x13')](function(_0x16afb3){if(_0x16afb3){if(!_['isNil'](_0x16afb3[_0x0a9e('0x5f')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3['sitepic']))&&_0xadce3d){_0x16449b=path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6c'),_0x16afb3[_0x0a9e('0x5f')]);}}return _0x5505f4[_0x0a9e('0x6d')](_0x16449b);}})[_0x0a9e('0x45')](handleError(_0x5505f4,null));};exports['getAvatar']=function(_0x1339d0,_0x3c775a){var _0x3450ae=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/default_avatar.png');var _0x2144ca={'where':{'id':_0x1339d0['params']['id']},'attributes':['id',_0x0a9e('0x62')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x2144ca)['then'](handleEntityNotFound(_0x3c775a,null))[_0x0a9e('0x13')](function(_0x5ed560){if(_0x5ed560){if(!_[_0x0a9e('0x6e')](_0x5ed560[_0x0a9e('0x62')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]))){_0x3450ae=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x5ed560[_0x0a9e('0x62')]);}}return _0x3c775a[_0x0a9e('0x6d')](_0x3450ae);}})[_0x0a9e('0x45')](handleError(_0x3c775a,null));};exports[_0x0a9e('0x70')]=function(_0x98c62c,_0x248368){var _0x5b93dd=path['join'](config[_0x0a9e('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x1d999b={'where':{'id':_0x98c62c[_0x0a9e('0x47')]['id']},'attributes':['id','customerAvatar',_0x0a9e('0x71')],'raw':!![]};return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')](_0x1d999b)[_0x0a9e('0x13')](handleEntityNotFound(_0x248368,null))['then'](function(_0x148fd9){if(_0x148fd9){if(!_[_0x0a9e('0x6e')](_0x148fd9[_0x0a9e('0x72')])){if(fs[_0x0a9e('0x6b')](path['join'](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9[_0x0a9e('0x72')]))&&_0x148fd9['showCustomerAvatar']){_0x5b93dd=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x148fd9['customerAvatar']);}}return _0x248368[_0x0a9e('0x6d')](_0x5b93dd);}})[_0x0a9e('0x45')](handleError(_0x248368,null));};exports[_0x0a9e('0x73')]=function(_0x1a7f58,_0x2394d3){var _0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/images/avatars/system_avatar.png');var _0x3bab3e={'where':{'id':_0x1a7f58[_0x0a9e('0x47')]['id']},'attributes':['id',_0x0a9e('0x74')],'raw':!![]};return db['ChatWebsite']['find'](_0x3bab3e)['then'](handleEntityNotFound(_0x2394d3,null))[_0x0a9e('0x13')](function(_0x4a70ce){if(_0x4a70ce){if(!_['isNil'](_0x4a70ce[_0x0a9e('0x74')])){if(fs[_0x0a9e('0x6b')](path[_0x0a9e('0x66')](config['root'],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]))){_0x555780=path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],_0x0a9e('0x6f'),_0x4a70ce[_0x0a9e('0x74')]);}}return _0x2394d3[_0x0a9e('0x6d')](_0x555780);}})[_0x0a9e('0x45')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x75')]=function(_0x5a1848,_0x43c397){var _0x5526a7=require(_0x0a9e('0x76'));var _0x4093e6=new _0x5526a7();var _0x2097d8=_0x4093e6[_0x0a9e('0x77')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x79')])['getResult']();var _0x1a0314={'body':_0x5a1848[_0x0a9e('0x50')],'channel':_0x0a9e('0x7a')};var _0x1af799=[];var _0x51aa2f=[];var _0x2e4887={};var _0x3c9135=![];return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x2be526){if(!_0x2be526){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x1af799=_[_0x0a9e('0x7f')](_['keys'](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81')]);_0x51aa2f=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x2be526),[_0x0a9e('0x80'),_0x0a9e('0x81'),_0x0a9e('0x82'),_0x0a9e('0x83')]);if(_0x5a1848['body']['id']){delete _0x5a1848[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')]['from'])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x84'));}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0a9e('0x6e')](_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')])){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x86')+_0x51aa2f);}if(!_['includes'](_0x51aa2f,_0x5a1848[_0x0a9e('0x50')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x0a9e('0x87')+_0x51aa2f);}_0x2e4887[_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')]['from'];})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x5a1848[_0x0a9e('0x47')]['id']},'include':[{'model':db[_0x0a9e('0x88')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0a9e('0x89'),'where':_0x2e4887,'limit':0x1,'order':[[_0x0a9e('0x81'),_0x0a9e('0x8a')]]}]},{'model':db['ChatApplication'],'as':_0x0a9e('0x8b')}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x4cee8c){if(_0x4cee8c&&_0x4cee8c[_0x0a9e('0x8c')]){_0x1a0314[_0x0a9e('0x8d')]=_0x4cee8c;_0x1a0314[_0x0a9e('0x8e')]=_0x4cee8c['Applications'];_0x1a0314[_0x0a9e('0x8f')]=_0x4cee8c[_0x0a9e('0x8c')];_0x1a0314[_0x0a9e('0x8e')]=_['orderBy'](_0x1a0314['applications'],['priority'],[_0x0a9e('0x90')]);if(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8b')]){delete _0x1a0314[_0x0a9e('0x8d')]['Applications'];}if(_0x1a0314[_0x0a9e('0x8d')]['List']&&_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')]['length']){return _0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0x8c')][_0x0a9e('0x89')][0x0];}var _0x580dd6=_[_0x0a9e('0xb')](_0x5a1848['body'],{'firstName':_0x5a1848[_0x0a9e('0x50')]['from'],'ListId':_0x4cee8c[_0x0a9e('0x83')]});_0x580dd6[_0x5a1848['body'][_0x0a9e('0x85')]]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0x4b')](_0x580dd6,{'fields':_0x1af799,'raw':!![]});}})[_0x0a9e('0x13')](handleEntityNotFound(_0x43c397,null))[_0x0a9e('0x13')](function(_0x5acdc9){_0x1a0314[_0x0a9e('0x92')]=_0x5acdc9;var _0x1c9ea2=_0x5a1848['body'][_0x0a9e('0x93')];if(_0x5a1848[_0x0a9e('0x78')]['cf-connecting-ip']){_0x1c9ea2=_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x94')];}else if(_0x5a1848[_0x0a9e('0x78')]['x-forwarded-for']){_0x1c9ea2=_[_0x0a9e('0x95')](_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x96')][_0x0a9e('0x97')](','));}if(_0x5acdc9){var _0x2003bc={'ContactId':_0x5acdc9['id'],'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'from':(_0x5acdc9[_0x0a9e('0x98')]||'')+'\x20'+(_0x5acdc9[_0x0a9e('0x99')]||''),'customerIp':_0x1c9ea2,'customerPort':_0x5a1848[_0x0a9e('0x78')][_0x0a9e('0x9a')]?_0x5a1848['headers'][_0x0a9e('0x9a')]:null,'referer':_0x5a1848['body'][_0x0a9e('0x9b')],'browserName':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')]&&_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]?util[_0x0a9e('0x9e')]('%s\x20%s',_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x2b')],_0x2097d8[_0x0a9e('0x9c')]['version']):_0x0a9e('0x9f'),'browserVersion':_0x2097d8[_0x0a9e('0x9c')][_0x0a9e('0x9d')]||_0x0a9e('0x9f'),'osName':util[_0x0a9e('0x9e')](_0x0a9e('0xa0'),_0x2097d8['os'][_0x0a9e('0x2b')],_0x2097d8['os']['version']),'osVersion':_0x2097d8['os'][_0x0a9e('0x9d')],'deviceModel':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x32')]&&_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')]?util[_0x0a9e('0x9e')](_0x0a9e('0xa3'),_0x2097d8['device']['model'],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0x31')]):null,'deviceVendor':_0x2097d8[_0x0a9e('0xa1')][_0x0a9e('0xa2')],'deviceType':_0x2097d8[_0x0a9e('0xa1')]['type'],'formData':JSON[_0x0a9e('0xa4')](_0x5a1848[_0x0a9e('0x50')])};var _0x2d8e91={'ChatWebsiteId':_0x5a1848[_0x0a9e('0x47')]['id'],'closed':![]};if(_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]){_0x2d8e91[_0x0a9e('0xa5')]=_0x5a1848['body'][_0x0a9e('0xa5')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':_0x2d8e91})['then'](function(_0x2b8ad4){if(_0x2b8ad4){return[_0x2b8ad4,![]];}_0x2003bc[_0x0a9e('0xa5')]=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')];_0x2003bc['externalUrl']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa7')];return db[_0x0a9e('0xa6')][_0x0a9e('0x4b')](_0x2003bc)[_0x0a9e('0x13')](function(_0x20c130){return[_0x20c130,!![]];});});}_0x2d8e91[_0x0a9e('0xa8')]=_0x5acdc9['id'];if(_0x5a1848[_0x0a9e('0x50')]['interaction']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id']){_0x2d8e91['id']=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa9')]['id'];return db['ChatInteraction']['find']({'where':_0x2d8e91})[_0x0a9e('0x13')](function(_0x2abe55){if(_0x2abe55){return[_0x2abe55,![]];}return db[_0x0a9e('0xa6')]['create'](_0x2003bc)[_0x0a9e('0x13')](function(_0x40180d){return[_0x40180d,!![]];});});}return db['ChatInteraction'][_0x0a9e('0x4b')](_0x2003bc)['then'](function(_0x35cc2a){return[_0x35cc2a,!![]];});}})['spread'](function(_0x5b42b9,_0x48eaa3){if(_0x5b42b9){_0x3c9135=_0x48eaa3;if(!_0x48eaa3){var _0xad4d10={'from':(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x98')]||'')+'\x20'+(_0x1a0314[_0x0a9e('0x92')][_0x0a9e('0x99')]||'')};if(_0x5a1848[_0x0a9e('0x50')]['threadId']&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]&&_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xa5')]!=_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xaa')]){_0xad4d10[_0x0a9e('0xa5')]=_0x5a1848['body']['messageId'];}return _0x5b42b9[_0x0a9e('0x25')](_0xad4d10);}else{return _0x5b42b9;}}})['then'](function(_0x29537a){_0x1a0314[_0x0a9e('0xa9')]=_0x29537a[_0x0a9e('0x27')]({'plain':!![]});_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xab')]=_0x3c9135;if(_0x1a0314[_0x0a9e('0xa9')]['created']){if(_0x1a0314[_0x0a9e('0x8d')]['autoclose']){_0x1a0314['applications'][_0x0a9e('0xac')]({'id':0x0,'priority':_0x1a0314['applications'][_0x0a9e('0x38')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x0a9e('0xad')});}}return db['ChatMessage'][_0x0a9e('0x4b')]({'body':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0x50')],'ChatWebsiteId':_0x5a1848['params']['id'],'ChatInteractionId':_0x29537a['id'],'direction':'in','ContactId':_0x1a0314[_0x0a9e('0x92')]['id'],'AttachmentId':_0x5a1848[_0x0a9e('0x50')][_0x0a9e('0xae')]});})['then'](function(_0x5236c9){_0x1a0314[_0x0a9e('0x19')]=_0x5236c9;if(_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]){return db[_0x0a9e('0xb0')][_0x0a9e('0x4a')]({'attributes':['id',_0x0a9e('0x2b')],'where':{'id':_0x1a0314[_0x0a9e('0xa9')][_0x0a9e('0xaf')]}})[_0x0a9e('0x13')](function(_0x1020a0){if(_0x1020a0){_0x1a0314['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1020a0[_0x0a9e('0x2b')]+','+(_0x1a0314[_0x0a9e('0x8d')][_0x0a9e('0xb1')]||0xa),'interval':_0x0a9e('0xad')});_0x1a0314[_0x0a9e('0xb2')]=!![];}return respondWithRpcPromise(_0x0a9e('0xb3'),_0x0a9e('0xb4'),_0x1a0314);});}return respondWithRpcPromise(_0x0a9e('0xb3'),'startRouting',_0x1a0314);})['then'](function(_0x2869cc){respondWithRpcPromise(_0x0a9e('0xb5'),'EventManager',{'event':_0x0a9e('0x75'),'message':_0x2869cc},client9002);return _0x2869cc;})[_0x0a9e('0x13')](respondWithResult(_0x43c397,null))[_0x0a9e('0x45')](handleError(_0x43c397,null));};exports[_0x0a9e('0xb6')]=function(_0x2bb549,_0x2683ad){var _0x167196,_0x262281,_0x59f8f7;var _0x400800=[];var _0xbd1af3={};var _0x20e191=_0x2bb549['files']||[];var _0x4412a5=[];var _0x261ef8;return db[_0x0a9e('0x7b')][_0x0a9e('0x51')]()[_0x0a9e('0x13')](function(_0x21ada7){if(!_0x21ada7){throw new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0x7e'));}_0x400800=_[_0x0a9e('0x7f')](_[_0x0a9e('0x49')](_0x21ada7),[_0x0a9e('0x80'),'updatedAt','CompanyId',_0x0a9e('0x83')]);if(_0x2bb549[_0x0a9e('0x50')]['id']){delete _0x2bb549[_0x0a9e('0x50')]['id'];}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)['send'](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0x84')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')])||_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]===''){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))][(_0x0a9e('0x7d'))](_0x0a9e('0xb7')));}if(_[_0x0a9e('0x6e')](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db['Sequelize']['ValidationError'](_0x0a9e('0xb9')+_0x400800));}if(!_[_0x0a9e('0xba')](_0x400800,_0x2bb549['body']['mapKeyOffline'])){throw _0x2683ad[_0x0a9e('0x1d')](0x1f4)[_0x0a9e('0x2c')](new db[(_0x0a9e('0x7c'))]['ValidationError'](_0x0a9e('0xbb')+_0x400800));}_0xbd1af3[_0x2bb549['body'][_0x0a9e('0xb8')]]=_0x2bb549['body'][_0x0a9e('0x91')];})['then'](function(){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x2bb549[_0x0a9e('0x47')]['id']},'include':[{'model':db['CmList'],'as':_0x0a9e('0x8c')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x0a9e('0x13')](handleEntityNotFound(_0x2683ad,null))[_0x0a9e('0x13')](function(_0x3c691f){if(_0x3c691f&&_0x3c691f[_0x0a9e('0x8c')]){_0x262281=_0x3c691f;var _0x1d51fd=_[_0x0a9e('0xb')](_0x2bb549[_0x0a9e('0x50')],{'firstName':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'phone':_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')],'ListId':_0x3c691f[_0x0a9e('0x83')]});_0x1d51fd[_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0xb8')]]=_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x91')];return db[_0x0a9e('0x7b')][_0x0a9e('0xbc')]({'where':_0xbd1af3,'defaults':_0x1d51fd});}})[_0x0a9e('0xbd')](function(_0x51a987){if(_0x51a987){_0x59f8f7=_0x51a987;var _0x233e48=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x54658d=ejs[_0x0a9e('0xbf')](_0x233e48,{'body':_['toPairs'](_0x2bb549[_0x0a9e('0x50')][_0x0a9e('0x50')]),'bodyTitle':_0x262281[_0x0a9e('0xc0')]});return db[_0x0a9e('0xc1')][_0x0a9e('0x4b')]({'body':_0x54658d,'plainBody':htmlToText[_0x0a9e('0xc2')](_0x54658d),'ContactId':_0x51a987['id'],'ChatWebsiteId':_0x262281['id']});}})[_0x0a9e('0x13')](function(_0x1cc73e){_0x261ef8=_0x1cc73e;if(_0x20e191[_0x0a9e('0x38')]){var _0x6b948a=_0x20e191['map'](function(_0x283c59){return{'name':_0x283c59['originalname'],'basename':_0x283c59[_0x0a9e('0x60')],'type':_0x283c59['mimetype'],'ChatOfflineMessageId':_0x1cc73e['id']};});_0x4412a5=_0x6b948a[_0x0a9e('0x2e')](_0x2c5385=>{var _0x216791={'filename':_0x2c5385['name'],'path':path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server','files',_0x0a9e('0xc3'),_0x0a9e('0xc4'),_0x2c5385[_0x0a9e('0xc5')])};return _0x216791;});if(!_0x262281['openNewInteraction']){return db['sequelize']['transaction'](function(_0x374964){return db[_0x0a9e('0xc6')][_0x0a9e('0xc7')](_0x6b948a,{'transaction':_0x374964});});}}})[_0x0a9e('0x13')](function(){if(_0x261ef8){_0x167196=_0x261ef8;return db[_0x0a9e('0xc8')][_0x0a9e('0x56')]({'where':{'active':!![]},'include':[{'model':db[_0x0a9e('0xc9')],'as':_0x0a9e('0xca'),'raw':!![],'include':[{'model':db[_0x0a9e('0xcb')],'as':_0x0a9e('0xcb'),'raw':!![]}]}]});}})[_0x0a9e('0x13')](function(_0x2f4de1){if(_0x2f4de1&&_0x2f4de1[_0x0a9e('0xca')]&&_0x262281[_0x0a9e('0xcc')]&&_0x262281[_0x0a9e('0xcd')]){var _0x1a74c4=_0x2f4de1[_0x0a9e('0xce')]();return respondWithRpcPromise(_0x0a9e('0xcf'),'sendMail',{'account':_0x1a74c4,'message':{'from':util[_0x0a9e('0x9e')](_0x0a9e('0xd0'),_0x2f4de1[_0x0a9e('0x2b')],_0x2f4de1[_0x0a9e('0xd1')]||_0x2f4de1[_0x0a9e('0xca')][_0x0a9e('0x4c')]),'to':_0x262281['forwardOfflineAddress'],'subject':_0x262281[_0x0a9e('0xd2')],'html':_0x167196[_0x0a9e('0x50')],'attachments':_0x4412a5}},client9003)[_0x0a9e('0x13')](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x37390b){logger[_0x0a9e('0x18')](_0x37390b);});}})[_0x0a9e('0x13')](function(){if(_0x262281&&_0x262281[_0x0a9e('0xd3')]&&_0x262281[_0x0a9e('0xd4')]){var _0x541af6=[];if(_0x20e191['length']){_0x541af6=_0x20e191[_0x0a9e('0x2e')](function(_0x3a0b30){return{'name':_0x3a0b30['originalname'],'basename':_0x3a0b30[_0x0a9e('0x60')],'type':_0x3a0b30[_0x0a9e('0xd5')],'ChatOfflineMessageId':_0x261ef8['id']};});}var _0x4c8d75;if(!_[_0x0a9e('0x6e')](_0x262281['subjectOffline'])){var _0x3468a4=_[_0x0a9e('0x2e')](_0x2bb549['body'],function(_0x27a41c){return _0x27a41c;});var _0x31ab12=_['toPairsIn'](_0x3468a4)[0x0];var _0x197d65=_[_0x0a9e('0xd6')](_0x31ab12,function(_0x53ad2b){return _0x53ad2b;});_0x4c8d75=_0x197d65[0x1][_0x262281[_0x0a9e('0xd7')]];}var _0x237994={'from':_0x59f8f7[_0x0a9e('0xd1')],'firstName':_0x59f8f7[_0x0a9e('0x98')],'lastName':_0x59f8f7[_0x0a9e('0x99')],'mapKey':_0x0a9e('0xd1'),'message':{'from':_0x59f8f7['email'],'to':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')],'cc':'','subject':_['isNil'](_0x4c8d75)?_0x262281[_0x0a9e('0xd2')]:_0x4c8d75,'messageId':'','sentAt':new Date(),'attach':_0x541af6[_0x0a9e('0x38')],'attachments':_0x541af6,'originChannel':_0x0a9e('0xd8'),'ChatWebsiteId':_0x262281['id'],'ChatOfflineMessageId':_0x167196['id'],'originTo':_0x262281[_0x0a9e('0xc8')][_0x0a9e('0xd1')]},'body':_0x167196[_0x0a9e('0x50')]};var _0x368a12={'account':{'id':_0x262281['MailAccountId']},'body':_0x237994,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount','notifyMail',_0x368a12,client9001)['then'](function(){return _0x167196;})[_0x0a9e('0x45')](function(_0x23ef4e){logger['error'](_0x23ef4e);});}return;})['then'](function(){if(_0x167196){return _0x167196;}})[_0x0a9e('0x13')](respondWithResult(_0x2683ad,null))['catch'](function(_0x41600e){logger[_0x0a9e('0x18')](_0x0a9e('0x45'),_0x41600e);for(var _0x175c97 of _0x20e191){var _0x336518=path[_0x0a9e('0x66')](config['root'],_0x0a9e('0xd9'),_0x0a9e('0xda'),'attachments',_0x0a9e('0xc4'),_0x175c97[_0x0a9e('0x60')]);fs_extra[_0x0a9e('0xdb')](_0x336518)[_0x0a9e('0x45')](function(_0x1282da){logger[_0x0a9e('0x18')](_0x0a9e('0xdc'),_0x336518,_0x1282da);});}});};exports['addInteraction']=function(_0x331216,_0x508395){return db[_0x0a9e('0xa6')][_0x0a9e('0x4a')]({'where':{'id':_0x331216['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x508395,null))[_0x0a9e('0x13')](function(_0x5061e5){if(_0x5061e5){return _0x5061e5[_0x0a9e('0xdd')](_0x331216['body'][_0x0a9e('0x5e')],_[_0x0a9e('0xde')](_0x331216['body'],[_0x0a9e('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x508395,null))[_0x0a9e('0x45')](handleError(_0x508395,null));};exports[_0x0a9e('0xdf')]=function(_0x732141,_0x37ef45){var _0x288127={'raw':![],'where':{}};var _0x26d010={};var _0xa45906={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x732141[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x37ef45,null))[_0x0a9e('0x13')](function(_0x38e256){if(_0x38e256){_0x26d010['model']=_[_0x0a9e('0x49')](db['ChatInteraction']['rawAttributes']);_0x26d010[_0x0a9e('0x33')]=_['keys'](_0x732141[_0x0a9e('0x33')]);_0x26d010[_0x0a9e('0x34')]=_['intersection'](_0x26d010[_0x0a9e('0x32')],_0x26d010[_0x0a9e('0x33')]);_0x288127[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x26d010[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x288127[_0x0a9e('0x36')]=_0x288127['attributes'][_0x0a9e('0x38')]?_0x288127[_0x0a9e('0x36')]:_0x26d010[_0x0a9e('0x32')];if(!_0x732141[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x288127[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x732141['query'][_0x0a9e('0x21')]);_0x288127[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x732141['query'][_0x0a9e('0x1f')]);}_0x288127['order']=qs[_0x0a9e('0x3b')](_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x288127[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x732141[_0x0a9e('0x33')],_0x26d010['filters']));_0x288127[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x38e256['id'];if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x288127[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x288127[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x288127[_0x0a9e('0x36')],function(_0x4712c9){var _0x4542d3={};_0x4542d3[_0x4712c9]={'$like':'%'+_0x732141[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x4542d3;})});}_0x288127=_[_0x0a9e('0x3f')]({},_0x288127,_0x732141[_0x0a9e('0x41')]);return db[_0x0a9e('0xa6')][_0x0a9e('0x22')]({'where':_0x288127[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x611e46){_0xa45906[_0x0a9e('0x22')]=_0x611e46;if(_0x732141[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x288127['include']=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xb0')],'as':'Owner','attributes':[_0x0a9e('0x2b'),'fullname',_0x0a9e('0xe1')],'required':![]},{'model':db[_0x0a9e('0xe2')],'as':_0x0a9e('0xe3'),'attributes':['id',_0x0a9e('0x2b'),_0x0a9e('0xe4')],'where':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?{'id':_0x732141[_0x0a9e('0x33')]['tag']}:undefined,'required':_0x732141[_0x0a9e('0x33')][_0x0a9e('0xe5')]?!![]:![]}];}return db['ChatInteraction'][_0x0a9e('0x44')](_0x288127);})[_0x0a9e('0x13')](function(_0x579bb0){_0xa45906['rows']=_0x579bb0;return _0xa45906;});}})[_0x0a9e('0x13')](respondWithFilteredResult(_0x37ef45,_0x288127))[_0x0a9e('0x45')](handleError(_0x37ef45,null));};function iftimePromise(_0x315299,_0x1bf053){return respondWithRpcPromise('Command',_0x0a9e('0xe6'),{'command':_0x1bf053[_0x0a9e('0xe7')]?util[_0x0a9e('0x9e')](_0x0a9e('0xe8'),_0x315299[_0x0a9e('0xe9')],_0x1bf053['timezone']):util[_0x0a9e('0x9e')](_0x0a9e('0xea'),_0x315299['interval'])},client9002)[_0x0a9e('0x13')](function(_0x2d20a0){var _0x38284a=_0x2d20a0&&_0x2d20a0['indexOf']('true')>=0x0?!![]:![];logger[_0x0a9e('0x14')](_0x0a9e('0xeb'),_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],_0x38284a?_0x0a9e('0xec'):_0x0a9e('0xed'),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:_0x0a9e('0xee'));return _0x38284a;})['catch'](function(_0x5cc8cb){logger[_0x0a9e('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1bf053['id'],_0x315299['id'],_0x315299[_0x0a9e('0xe9')],util[_0x0a9e('0xef')](_0x5cc8cb,{'showHidden':![],'depth':null}),_0x1bf053[_0x0a9e('0xe7')]?_0x1bf053[_0x0a9e('0xe7')]:'No\x20timezone');return![];});}exports[_0x0a9e('0xe6')]=function(_0x43c1d1,_0x546bc9){var _0x10e370=0x0;var _0x5092af=0x0;var _0x2e1de7=![];var _0x30a77e;var _0xd63c87;return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x43c1d1[_0x0a9e('0x47')]['id']},'include':[{'model':db['Interval'],'as':_0x0a9e('0xf0'),'include':[{'model':db['Interval'],'as':_0x0a9e('0xf1'),'attributes':['id',_0x0a9e('0xe9')],'raw':!![]}]}]})[_0x0a9e('0x13')](handleEntityNotFound(_0x546bc9,null))[_0x0a9e('0x13')](function(_0xa244bc){if(_0xa244bc){_0x30a77e=_0xa244bc;return _0xa244bc[_0x0a9e('0xf2')]({'raw':!![]});}})[_0x0a9e('0x13')](function(_0x5bdba6){if(_0x30a77e){if(_0x5bdba6){_0xd63c87=_0x5bdba6;}}return require(_0x0a9e('0xf3'))[_0x0a9e('0x69')]();})[_0x0a9e('0x13')](function(_0x188231){if(_0x188231){_0x5092af=_0x188231[_0x0a9e('0xf4')];_0x2e1de7=_0x188231['custom'];}})[_0x0a9e('0x13')](function(){return db[_0x0a9e('0xa6')]['count']({'where':{'closed':![]}});})['then'](function(_0x2240ea){_0x10e370=_0x2240ea;if(_0x5092af&&_0x2240ea>_0x5092af){return db[_0x0a9e('0xf5')][_0x0a9e('0x56')]({'where':{'id':0x1}})[_0x0a9e('0x13')](function(_0x380539){if(_0x380539){_0x380539[_0x0a9e('0xf6')]('chatLicenseExceeded');}});}})[_0x0a9e('0x13')](function(){if(_0x30a77e[_0x0a9e('0xf0')]&&_0x30a77e[_0x0a9e('0xf0')]['Intervals']){var _0x294e90=[];for(var _0x1969e3=0x0;_0x1969e3<_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')]['length'];_0x1969e3++){var _0x5d4935=_0x30a77e[_0x0a9e('0xf0')][_0x0a9e('0xf1')][_0x1969e3][_0x0a9e('0x27')]({'plain':!![]});_0x294e90[_0x0a9e('0xac')](iftimePromise(_0x5d4935,_0x30a77e));}return BPromise[_0x0a9e('0xf7')](_0x294e90)[_0x0a9e('0x13')](function(_0x371943){return _[_0x0a9e('0xf8')](_0x371943);});}else{return!![];}})['then'](function(_0x17187c){var _0x4be017=fs[_0x0a9e('0xbe')](path[_0x0a9e('0x66')](config[_0x0a9e('0x67')],'server/files/chat/iframe.ejs'),'utf8');var _0x462ecd={'remote':_0x30a77e['remote'],'query':querystring[_0x0a9e('0xa4')](_['merge'](_0x30a77e['get']({'plain':!![]}),{'customerIp':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x96')]||_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0xf9')]||_0x43c1d1[_0x0a9e('0xfa')][_0x0a9e('0xfb')]||_0x43c1d1['ip'],'referer':_0x43c1d1[_0x0a9e('0x78')][_0x0a9e('0x9b')],'openedInteractions':_0x10e370,'maxInteractions':_0x5092af,'virtual':_0x2e1de7[_0x0a9e('0xf4')],'online':_0x17187c,'custom':_0x2e1de7}))[_0x0a9e('0xfc')](/'/g,'\x5c\x27')};_0x546bc9[_0x0a9e('0x2c')](ejs[_0x0a9e('0xbf')](Mustache[_0x0a9e('0xbf')](_0x4be017,_0x462ecd),{'proactiveActions':_0xd63c87,'alignment':_0x30a77e['alignment'],'verticalAlignment':_0x30a77e['verticalAlignment'],'div_color':_0x30a77e[_0x0a9e('0xe4')],'labelText':_0x30a77e['labelText'],'text_color':_0x30a77e[_0x0a9e('0xfd')],'button_color':_0x30a77e[_0x0a9e('0xfe')],'background_color':_0x30a77e[_0x0a9e('0xff')],'hideWhenOffline':_0x30a77e['hideWhenOffline'],'interval':_0x30a77e['IntervalId']}));})[_0x0a9e('0x45')](handleError(_0x546bc9,null));};exports[_0x0a9e('0x100')]=function(_0x2c316b,_0x142c65){var _0x193e3b=_0x2c316b[_0x0a9e('0x47')]['id'];var _0x36e428=_0x2c316b['body'];var _0x12984a=0xc8;var _0x5799a6=null;return db[_0x0a9e('0x101')][_0x0a9e('0x102')]({'isolationLevel':db['sequelize'][_0x0a9e('0x103')][_0x0a9e('0x104')][_0x0a9e('0x105')]},function(_0x4524b8){return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x193e3b},'transaction':_0x4524b8})['then'](function(_0x475bcd){if(_0x475bcd){return db[_0x0a9e('0x106')][_0x0a9e('0x26')]({'where':{'ChatWebsiteId':_0x193e3b},'transaction':_0x4524b8})['then'](function(){var _0x857983=_[_0x0a9e('0x2e')](_0x36e428,function(_0x24dc3f){_0x24dc3f['ChatWebsiteId']=_0x193e3b;return _0x24dc3f;});return db[_0x0a9e('0x106')][_0x0a9e('0xc7')](_0x857983,{'transaction':_0x4524b8});});}else{_0x12984a=0x194;_0x5799a6=[];}});})[_0x0a9e('0x13')](function(){if(_0x12984a!==0x194){return db[_0x0a9e('0x106')][_0x0a9e('0x107')]({'where':{'ChatWebsiteId':_0x193e3b},'order':_0x0a9e('0x108')})['then'](function(_0x483aed){_0x5799a6=_0x483aed;});}})[_0x0a9e('0x45')](function(_0x1e01af){_0x12984a=0x1f4;logger['error'](_0x1e01af[_0x0a9e('0x2a')]);if(_0x1e01af[_0x0a9e('0x2b')]){delete _0x1e01af[_0x0a9e('0x2b')];}_0x5799a6=_0x1e01af;})[_0x0a9e('0x109')](function(){if(_0x5799a6===null){_0x142c65[_0x0a9e('0x1b')](_0x12984a);}else{if(_0x12984a===0x1f4){_0x142c65[_0x0a9e('0x1d')](_0x12984a)['send'](_0x5799a6);}else{_0x142c65[_0x0a9e('0x1d')](_0x12984a)[_0x0a9e('0x1e')](_0x5799a6);}}});};exports[_0x0a9e('0x10a')]=function(_0x4edb79,_0x45c6ce){var _0x4532de={};var _0x1747ab={};var _0x3afafa;var _0x5beea6;return db['ChatWebsite'][_0x0a9e('0x56')]({'where':{'id':_0x4edb79[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x45c6ce,null))['then'](function(_0x3d75c9){if(_0x3d75c9){_0x3afafa=_0x3d75c9;_0x1747ab[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0x106')][_0x0a9e('0x30')]);_0x1747ab[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x4edb79[_0x0a9e('0x33')]);_0x1747ab['filters']=_['intersection'](_0x1747ab[_0x0a9e('0x32')],_0x1747ab[_0x0a9e('0x33')]);_0x4532de['attributes']=_[_0x0a9e('0x35')](_0x1747ab['model'],qs[_0x0a9e('0x37')](_0x4edb79[_0x0a9e('0x33')]['fields']));_0x4532de[_0x0a9e('0x36')]=_0x4532de[_0x0a9e('0x36')]['length']?_0x4532de[_0x0a9e('0x36')]:_0x1747ab[_0x0a9e('0x32')];_0x4532de[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4532de[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x3d')](_0x4edb79[_0x0a9e('0x33')],_0x1747ab[_0x0a9e('0x34')]));if(_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4532de[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x4532de['where'],{'$or':_['map'](_0x4532de[_0x0a9e('0x36')],function(_0x14c3f1){var _0x1e6bba={};_0x1e6bba[_0x14c3f1]={'$like':'%'+_0x4edb79['query']['filter']+'%'};return _0x1e6bba;})});}_0x4532de=_[_0x0a9e('0x3f')]({},_0x4532de,_0x4edb79['options']);return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x112789){if(_0x112789){_0x5beea6=_0x112789[_0x0a9e('0x38')];if(!_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4532de[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x4edb79['query']['limit']);_0x4532de[_0x0a9e('0x1f')]=qs['offset'](_0x4edb79[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x3afafa[_0x0a9e('0x10a')](_0x4532de);}})[_0x0a9e('0x13')](function(_0x4ad6fc){if(_0x4ad6fc){return _0x4ad6fc?{'count':_0x5beea6,'rows':_0x4ad6fc}:null;}})[_0x0a9e('0x13')](respondWithResult(_0x45c6ce,null))[_0x0a9e('0x45')](handleError(_0x45c6ce,null));};exports[_0x0a9e('0x10b')]=function(_0x5174c5,_0x1ebf20){return db[_0x0a9e('0x10c')][_0x0a9e('0x4a')]({'where':{'id':_0x5174c5['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x1ebf20,null))[_0x0a9e('0x13')](function(_0x459ab7){if(_0x459ab7){return _0x459ab7[_0x0a9e('0x10b')](_0x5174c5[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x5174c5['body'],[_0x0a9e('0x5e'),'id'])||{});}})[_0x0a9e('0x13')](respondWithResult(_0x1ebf20,null))[_0x0a9e('0x45')](handleError(_0x1ebf20,null));};exports['getProactiveActions']=function(_0x5990e1,_0x2a5c2a){var _0x304a57={};var _0x2302a2={};var _0x5f5963;var _0x4b51ff;return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5990e1[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x2a5c2a,null))[_0x0a9e('0x13')](function(_0x4f0bca){if(_0x4f0bca){_0x5f5963=_0x4f0bca;_0x2302a2[_0x0a9e('0x32')]=_['keys'](db[_0x0a9e('0x10d')][_0x0a9e('0x30')]);_0x2302a2['query']=_[_0x0a9e('0x49')](_0x5990e1['query']);_0x2302a2[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x2302a2[_0x0a9e('0x32')],_0x2302a2[_0x0a9e('0x33')]);_0x304a57[_0x0a9e('0x36')]=_['intersection'](_0x2302a2[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5990e1[_0x0a9e('0x33')]['fields']));_0x304a57[_0x0a9e('0x36')]=_0x304a57['attributes'][_0x0a9e('0x38')]?_0x304a57[_0x0a9e('0x36')]:_0x2302a2[_0x0a9e('0x32')];_0x304a57['order']=qs[_0x0a9e('0x3b')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x304a57[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5990e1['query'],_0x2302a2[_0x0a9e('0x34')]));if(_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x304a57[_0x0a9e('0x3c')]=_[_0x0a9e('0x3f')](_0x304a57[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x304a57[_0x0a9e('0x36')],function(_0x597e99){var _0x2dc0de={};_0x2dc0de[_0x597e99]={'$like':'%'+_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2dc0de;})});}_0x304a57=_[_0x0a9e('0x3f')]({},_0x304a57,_0x5990e1['options']);return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})['then'](function(_0xf81cc){if(_0xf81cc){_0x4b51ff=_0xf81cc[_0x0a9e('0x38')];if(!_0x5990e1[_0x0a9e('0x33')]['hasOwnProperty'](_0x0a9e('0x39'))){_0x304a57[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5990e1[_0x0a9e('0x33')]['limit']);_0x304a57[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5990e1[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x5f5963[_0x0a9e('0xf2')](_0x304a57);}})[_0x0a9e('0x13')](function(_0xbdc88e){if(_0xbdc88e){return _0xbdc88e?{'count':_0x4b51ff,'rows':_0xbdc88e}:null;}})['then'](respondWithResult(_0x2a5c2a,null))[_0x0a9e('0x45')](handleError(_0x2a5c2a,null));};exports[_0x0a9e('0x10e')]=function(_0x337c29,_0xa42055){var _0x52cdf4=_0x337c29[_0x0a9e('0x33')]['online']===_0x0a9e('0x10f')?_0x0a9e('0x110'):_0x0a9e('0x111');return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'attributes':['id',_0x52cdf4],'where':{'id':_0x337c29[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xa42055,null))['then'](function(_0x173f03){if(_0x173f03){var _0x4ac7f1=_0x173f03[_0x52cdf4];var _0x382412=_0x4ac7f1&&_0x4ac7f1[_0x0a9e('0x112')]?_0x4ac7f1['items']:[];_0xa42055[_0x0a9e('0x2c')]({'fromKey':_[_0x0a9e('0x6e')](_0x4ac7f1[_0x0a9e('0x113')])?undefined:_0x4ac7f1[_0x0a9e('0x113')],'count':_0x382412['length'],'rows':_0x382412});}})[_0x0a9e('0x45')](handleError(_0xa42055,null));};exports[_0x0a9e('0x114')]=function(_0x5a75d9,_0xcc859d){var _0x4a396c={'raw':![],'where':{}};var _0x58cb87={};var _0x50e7ec={'count':0x0,'rows':[]};return db[_0x0a9e('0x2f')][_0x0a9e('0x56')]({'where':{'id':_0x5a75d9['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xcc859d,null))[_0x0a9e('0x13')](function(_0x5ef7e8){if(_0x5ef7e8){_0x58cb87[_0x0a9e('0x32')]=_[_0x0a9e('0x49')](db[_0x0a9e('0xc1')][_0x0a9e('0x30')]);_0x58cb87[_0x0a9e('0x33')]=_[_0x0a9e('0x49')](_0x5a75d9[_0x0a9e('0x33')]);_0x58cb87['filters']=_[_0x0a9e('0x35')](_0x58cb87['model'],_0x58cb87[_0x0a9e('0x33')]);_0x4a396c[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x58cb87[_0x0a9e('0x32')],qs[_0x0a9e('0x37')](_0x5a75d9[_0x0a9e('0x33')]['fields']));_0x4a396c[_0x0a9e('0x36')]=_0x4a396c[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x4a396c['attributes']:_0x58cb87[_0x0a9e('0x32')];if(!_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x4a396c[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x4a396c[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}_0x4a396c[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3b')]);_0x4a396c['where']=qs[_0x0a9e('0x34')](_[_0x0a9e('0x3d')](_0x5a75d9[_0x0a9e('0x33')],_0x58cb87['filters']));_0x4a396c[_0x0a9e('0x3c')][_0x0a9e('0x53')]=_0x5ef7e8['id'];if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x4a396c['where']=_[_0x0a9e('0x3f')](_0x4a396c[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x2e')](_0x4a396c[_0x0a9e('0x36')],function(_0x4e8eb9){var _0x2b263b={};_0x2b263b[_0x4e8eb9]={'$like':'%'+_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x2b263b;})});}_0x4a396c=_[_0x0a9e('0x3f')]({},_0x4a396c,_0x5a75d9['options']);return db['ChatOfflineMessage'][_0x0a9e('0x22')]({'where':_0x4a396c[_0x0a9e('0x3c')]})[_0x0a9e('0x13')](function(_0x353960){_0x50e7ec[_0x0a9e('0x22')]=_0x353960;if(_0x5a75d9[_0x0a9e('0x33')][_0x0a9e('0x42')]){_0x4a396c[_0x0a9e('0x43')]=[{'all':!![]}];}else{_0x4a396c[_0x0a9e('0x43')]=[{'model':db[_0x0a9e('0x7b')],'as':_0x0a9e('0xe0'),'required':![]},{'model':db[_0x0a9e('0xc6')],'as':_0x0a9e('0x115'),'required':![]}];}return db[_0x0a9e('0xc1')]['findAll'](_0x4a396c);})[_0x0a9e('0x13')](function(_0x5ce227){_0x50e7ec[_0x0a9e('0x58')]=_0x5ce227;return _0x50e7ec;});}})['then'](respondWithFilteredResult(_0xcc859d,_0x4a396c))['catch'](handleError(_0xcc859d,null));};exports[_0x0a9e('0x116')]=function(_0x51ec16,_0x3d2007){return db[_0x0a9e('0x2f')][_0x0a9e('0x4a')]({'where':{'id':_0x51ec16[_0x0a9e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d2007,null))['then'](function(_0x2ad86f){if(_0x2ad86f){return _0x2ad86f[_0x0a9e('0x116')](_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')],_['omit'](_0x51ec16[_0x0a9e('0x50')],[_0x0a9e('0x5e'),'id'])||{})[_0x0a9e('0xbd')](function(_0x25f5fa){for(var _0x193ef7=0x0;_0x193ef7<_0x51ec16['body']['ids'][_0x0a9e('0x38')];_0x193ef7+=0x1){socket[_0x0a9e('0x117')](_0x0a9e('0x118'),{'UserId':Number(_0x51ec16[_0x0a9e('0x50')][_0x0a9e('0x5e')][_0x193ef7]),'ChatWebsiteId':Number(_0x51ec16[_0x0a9e('0x47')]['id'])});}return _0x25f5fa;});}})[_0x0a9e('0x13')](respondWithResult(_0x3d2007,null))['catch'](handleError(_0x3d2007,null));};exports[_0x0a9e('0x119')]=function(_0xd73712,_0x173daf){return db['ChatWebsite']['find']({'where':{'id':_0xd73712['params']['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0x173daf,null))[_0x0a9e('0x13')](function(_0x5448ee){if(_0x5448ee){return _0x5448ee[_0x0a9e('0x119')](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])['then'](function(){if(_['isArray'](_0xd73712[_0x0a9e('0x33')][_0x0a9e('0x5e')])){for(var _0xf10a48=0x0;_0xf10a48<_0xd73712[_0x0a9e('0x33')]['ids'][_0x0a9e('0x38')];_0xf10a48+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0xd73712[_0x0a9e('0x33')]['ids'][_0xf10a48]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}}else{socket[_0x0a9e('0x117')](_0x0a9e('0x11a'),{'UserId':Number(_0xd73712['query'][_0x0a9e('0x5e')]),'ChatWebsiteId':Number(_0xd73712[_0x0a9e('0x47')]['id'])});}});}})[_0x0a9e('0x13')](respondWithStatusCode(_0x173daf,null))['catch'](handleError(_0x173daf,null));};exports['getAgents']=function(_0x3aa901,_0xb3e9cb){var _0x34b05f={};var _0x21fcaa={};var _0x1c3b0e;var _0x1966dd;return db['ChatWebsite']['findOne']({'where':{'id':_0x3aa901[_0x0a9e('0x47')]['id']}})[_0x0a9e('0x13')](handleEntityNotFound(_0xb3e9cb,null))['then'](function(_0x539f84){if(_0x539f84){_0x1c3b0e=_0x539f84;_0x21fcaa['model']=_['keys'](db['User']['rawAttributes']);_0x21fcaa[_0x0a9e('0x33')]=_['keys'](_0x3aa901[_0x0a9e('0x33')]);_0x21fcaa[_0x0a9e('0x34')]=_[_0x0a9e('0x35')](_0x21fcaa[_0x0a9e('0x32')],_0x21fcaa[_0x0a9e('0x33')]);_0x34b05f[_0x0a9e('0x36')]=_[_0x0a9e('0x35')](_0x21fcaa['model'],qs[_0x0a9e('0x37')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x37')]));_0x34b05f[_0x0a9e('0x36')]=_0x34b05f[_0x0a9e('0x36')][_0x0a9e('0x38')]?_0x34b05f[_0x0a9e('0x36')]:_0x21fcaa[_0x0a9e('0x32')];_0x34b05f[_0x0a9e('0x3a')]=qs[_0x0a9e('0x3b')](_0x3aa901[_0x0a9e('0x33')]['sort']);_0x34b05f[_0x0a9e('0x3c')]=qs[_0x0a9e('0x34')](_['pick'](_0x3aa901[_0x0a9e('0x33')],_0x21fcaa['filters']));if(_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]){_0x34b05f['where']=_['merge'](_0x34b05f[_0x0a9e('0x3c')],{'$or':_['map'](_0x34b05f[_0x0a9e('0x36')],function(_0xa8c784){var _0x132f85={};_0x132f85[_0xa8c784]={'$like':'%'+_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x3e')]+'%'};return _0x132f85;})});}_0x34b05f=_['merge']({},_0x34b05f,_0x3aa901[_0x0a9e('0x41')]);return _0x1c3b0e['getAgents'](_0x34b05f);}})['then'](function(_0x398a88){if(_0x398a88){_0x1966dd=_0x398a88[_0x0a9e('0x38')];if(!_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x57')](_0x0a9e('0x39'))){_0x34b05f['limit']=qs[_0x0a9e('0x21')](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x21')]);_0x34b05f[_0x0a9e('0x1f')]=qs['offset'](_0x3aa901[_0x0a9e('0x33')][_0x0a9e('0x1f')]);}return _0x1c3b0e['getAgents'](_0x34b05f);}})[_0x0a9e('0x13')](function(_0x36d8a1){if(_0x36d8a1){return _0x36d8a1?{'count':_0x1966dd,'rows':_0x36d8a1}:null;}})[_0x0a9e('0x13')](respondWithResult(_0xb3e9cb,null))[_0x0a9e('0x45')](handleError(_0xb3e9cb,null));};
\ No newline at end of file
+var _0x1e5d=['device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','messageId','created','push','close','unmanaged','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','notify','files','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','fromString','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','mimetype','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','addInteraction','omit','getInteractions','Contact','User','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','virtual','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','referer','replace','alignment','verticalAlignment','labelText','textColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','ChatWebsites','UserProfileResource','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','order','ChatWebsiteId','filter','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','root','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','getResult','chat','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','headers','cf-connecting-ip','first','x-forwarded-for','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e5d,0x1aa));var _0xd1e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e5d[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xd1e5('0x0'));var Mustache=require(_0xd1e5('0x1'));var util=require(_0xd1e5('0x2'));var path=require(_0xd1e5('0x3'));var ejs=require(_0xd1e5('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xd1e5('0x5'));var Redis=require(_0xd1e5('0x6'));var qs=require(_0xd1e5('0x7'));var logger=require(_0xd1e5('0x8'))(_0xd1e5('0x9'));var config=require('../../config/environment');var db=require(_0xd1e5('0xa'))['db'];config[_0xd1e5('0xb')]=_[_0xd1e5('0xc')](config[_0xd1e5('0xb')],{'host':_0xd1e5('0xd'),'port':0x18eb});var socket=require(_0xd1e5('0xe'))(new Redis(config[_0xd1e5('0xb')]));require(_0xd1e5('0xf'))[_0xd1e5('0x10')](socket);var htmlToText=require(_0xd1e5('0x11'));var jayson=require(_0xd1e5('0x12'));var client=jayson[_0xd1e5('0x13')][_0xd1e5('0x14')]({'port':0x232c});var client9002=jayson[_0xd1e5('0x13')]['http']({'port':0x232a});var client9003=jayson[_0xd1e5('0x13')][_0xd1e5('0x14')]({'port':0x232b});var client9001=jayson[_0xd1e5('0x13')][_0xd1e5('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x282ce2,_0x116426,_0x1e71b7,_0x2375ac){return new BPromise(function(_0x35973c,_0xe87c14){var _0x1a99a7=_0x2375ac||client;return _0x1a99a7[_0xd1e5('0x15')](_0x282ce2,_0x1e71b7)[_0xd1e5('0x16')](function(_0x593ff0){logger[_0xd1e5('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x116426,'request\x20sent');logger[_0xd1e5('0x18')](_0xd1e5('0x19'),_0x116426,_0xd1e5('0x1a'),JSON['stringify'](_0x593ff0));if(_0x593ff0['error']){if(_0x593ff0[_0xd1e5('0x1b')]['code']===0x1f4){logger[_0xd1e5('0x1b')](_0xd1e5('0x1c'),_0x116426,_0x593ff0[_0xd1e5('0x1b')][_0xd1e5('0x1d')]);return _0xe87c14(_0x593ff0['error'][_0xd1e5('0x1d')]);}logger[_0xd1e5('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x116426,_0x593ff0['error']['message']);return _0x35973c(_0x593ff0[_0xd1e5('0x1b')][_0xd1e5('0x1d')]);}else{logger['info'](_0xd1e5('0x1c'),_0x116426,_0xd1e5('0x1a'));_0x35973c(_0x593ff0[_0xd1e5('0x1e')][_0xd1e5('0x1d')]);}})[_0xd1e5('0x1f')](function(_0x32d80c){logger[_0xd1e5('0x1b')](_0xd1e5('0x1c'),_0x116426,_0x32d80c);_0xe87c14(_0x32d80c);});});}function respondWithStatusCode(_0x4dc4e6,_0x425478){_0x425478=_0x425478||0xcc;return function(_0x241d5c){if(_0x241d5c){return _0x4dc4e6[_0xd1e5('0x20')](_0x425478);}return _0x4dc4e6[_0xd1e5('0x21')](_0x425478)['end']();};}function respondWithResult(_0x4f26ef,_0x19783f){_0x19783f=_0x19783f||0xc8;return function(_0x386f13){if(_0x386f13){return _0x4f26ef[_0xd1e5('0x21')](_0x19783f)[_0xd1e5('0x22')](_0x386f13);}};}function respondWithFilteredResult(_0x21604d,_0x46a8b4){return function(_0x18e25a){if(_0x18e25a){var _0x1f5185=typeof _0x46a8b4[_0xd1e5('0x23')]===_0xd1e5('0x24')&&typeof _0x46a8b4[_0xd1e5('0x25')]===_0xd1e5('0x24');var _0x28352d=_0x18e25a[_0xd1e5('0x26')];var _0x30a414=_0x1f5185?0x0:_0x46a8b4[_0xd1e5('0x23')];var _0x2d95de=_0x1f5185?_0x18e25a[_0xd1e5('0x26')]:_0x46a8b4['offset']+_0x46a8b4[_0xd1e5('0x25')];var _0x183c38;if(_0x2d95de>=_0x28352d){_0x2d95de=_0x28352d;_0x183c38=0xc8;}else{_0x183c38=0xce;}_0x21604d[_0xd1e5('0x21')](_0x183c38);return _0x21604d[_0xd1e5('0x27')](_0xd1e5('0x28'),_0x30a414+'-'+_0x2d95de+'/'+_0x28352d)[_0xd1e5('0x22')](_0x18e25a);}return null;};}function saveUpdates(_0x3f18b8){return function(_0x46ad9e){if(_0x46ad9e){return _0x46ad9e[_0xd1e5('0x29')](_0x3f18b8)[_0xd1e5('0x16')](function(_0x943b0e){return _0x943b0e;});}return null;};}function removeEntity(_0x3417de){return function(_0x1fda26){if(_0x1fda26){return _0x1fda26['destroy']()['then'](function(){var _0x2b75cf=_0x1fda26['get']({'plain':!![]});var _0x31321c=_0xd1e5('0x2a');return db[_0xd1e5('0x2b')][_0xd1e5('0x2c')]({'where':{'type':_0x31321c,'resourceId':_0x2b75cf['id']}})[_0xd1e5('0x16')](function(){return _0x1fda26;});})[_0xd1e5('0x16')](function(){_0x3417de[_0xd1e5('0x21')](0xcc)[_0xd1e5('0x2d')]();});}};}function handleEntityNotFound(_0x25cd9f){return function(_0x18cd70){if(!_0x18cd70){_0x25cd9f[_0xd1e5('0x20')](0x194);}return _0x18cd70;};}function handleError(_0x1c02c5,_0x2906ff){_0x2906ff=_0x2906ff||0x1f4;return function(_0x4f4b5f){logger[_0xd1e5('0x1b')](_0x4f4b5f[_0xd1e5('0x2e')]);if(_0x4f4b5f['name']){delete _0x4f4b5f[_0xd1e5('0x2f')];}_0x1c02c5[_0xd1e5('0x21')](_0x2906ff)[_0xd1e5('0x30')](_0x4f4b5f);};}exports[_0xd1e5('0x31')]=function(_0x5415bb,_0x385daf){var _0x33b480={'include':[{'model':db[_0xd1e5('0x32')],'as':_0xd1e5('0x33')}]},_0x50ea31={},_0x252778={'count':0x0,'rows':[]};var _0x272eb7=_['map'](db[_0xd1e5('0x34')][_0xd1e5('0x35')],function(_0x3af150){return{'name':_0x3af150[_0xd1e5('0x36')],'type':_0x3af150[_0xd1e5('0x37')][_0xd1e5('0x38')]};});_0x50ea31[_0xd1e5('0x39')]=_[_0xd1e5('0x3a')](_0x272eb7,_0xd1e5('0x2f'));_0x50ea31['query']=_[_0xd1e5('0x3b')](_0x5415bb[_0xd1e5('0x3c')]);_0x50ea31[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x50ea31[_0xd1e5('0x39')],_0x50ea31['query']);_0x33b480[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x50ea31[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x5415bb[_0xd1e5('0x3c')]['fields']));_0x33b480[_0xd1e5('0x3f')]=_0x33b480[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x33b480[_0xd1e5('0x3f')]:_0x50ea31[_0xd1e5('0x39')];if(!_0x5415bb[_0xd1e5('0x3c')]['hasOwnProperty'](_0xd1e5('0x42'))){_0x33b480[_0xd1e5('0x25')]=qs['limit'](_0x5415bb['query'][_0xd1e5('0x25')]);_0x33b480['offset']=qs[_0xd1e5('0x23')](_0x5415bb[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}_0x33b480['order']=qs[_0xd1e5('0x43')](_0x5415bb[_0xd1e5('0x3c')]['sort']);_0x33b480['where']=qs['filters'](_[_0xd1e5('0x44')](_0x5415bb[_0xd1e5('0x3c')],_0x50ea31[_0xd1e5('0x3d')]),_0x272eb7);if(_0x5415bb[_0xd1e5('0x3c')]['filter']){_0x33b480[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x33b480['where'],{'$or':_[_0xd1e5('0x3a')](_0x272eb7,function(_0xa1ecef){if(_0xa1ecef[_0xd1e5('0x37')]!==_0xd1e5('0x47')){var _0x3faeb5={};_0x3faeb5[_0xa1ecef[_0xd1e5('0x2f')]]={'$like':'%'+_0x5415bb['query']['filter']+'%'};return _0x3faeb5;}})});}_0x33b480=_[_0xd1e5('0x46')]({},_0x33b480,_0x5415bb[_0xd1e5('0x48')]);var _0x2765d6={'where':_0x33b480[_0xd1e5('0x45')]};return db[_0xd1e5('0x34')]['count'](_0x2765d6)[_0xd1e5('0x16')](function(_0x5da948){_0x252778[_0xd1e5('0x26')]=_0x5da948;if(_0x5415bb[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x33b480[_0xd1e5('0x4a')]=[{'all':!![]}];}return db[_0xd1e5('0x34')][_0xd1e5('0x4b')](_0x33b480);})[_0xd1e5('0x16')](function(_0x61de1d){_0x252778[_0xd1e5('0x4c')]=_0x61de1d;return _0x252778;})[_0xd1e5('0x16')](respondWithFilteredResult(_0x385daf,_0x33b480))[_0xd1e5('0x1f')](handleError(_0x385daf,null));};exports[_0xd1e5('0x4d')]=function(_0x580332,_0x42346e){var _0x5cc6ab={'raw':![],'where':{'id':_0x580332[_0xd1e5('0x4e')]['id']},'include':[{'model':db[_0xd1e5('0x32')],'as':_0xd1e5('0x33')}]},_0x120e8f={};_0x120e8f[_0xd1e5('0x39')]=_[_0xd1e5('0x3b')](db[_0xd1e5('0x34')]['rawAttributes']);_0x120e8f['query']=_[_0xd1e5('0x3b')](_0x580332[_0xd1e5('0x3c')]);_0x120e8f[_0xd1e5('0x3d')]=_['intersection'](_0x120e8f['model'],_0x120e8f['query']);_0x5cc6ab[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x120e8f['model'],qs[_0xd1e5('0x40')](_0x580332[_0xd1e5('0x3c')]['fields']));_0x5cc6ab[_0xd1e5('0x3f')]=_0x5cc6ab[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x5cc6ab[_0xd1e5('0x3f')]:_0x120e8f[_0xd1e5('0x39')];if(_0x580332[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x5cc6ab[_0xd1e5('0x4a')]=[{'all':!![]}];}_0x5cc6ab=_[_0xd1e5('0x46')]({},_0x5cc6ab,_0x580332[_0xd1e5('0x48')]);return db[_0xd1e5('0x34')][_0xd1e5('0x4f')](_0x5cc6ab)[_0xd1e5('0x16')](handleEntityNotFound(_0x42346e,null))[_0xd1e5('0x16')](respondWithResult(_0x42346e,null))[_0xd1e5('0x1f')](handleError(_0x42346e,null));};exports[_0xd1e5('0x50')]=function(_0x53d672,_0x2cff3e){return db[_0xd1e5('0x34')][_0xd1e5('0x50')](_0x53d672[_0xd1e5('0x51')],{})['then'](function(_0x157280){var _0x34fb52=_0x53d672['user'][_0xd1e5('0x52')]({'plain':!![]});if(!_0x34fb52)throw new Error(_0xd1e5('0x53'));if(_0x34fb52['role']===_0xd1e5('0x54')){var _0xc719e4=_0x157280['get']({'plain':!![]});var _0x68f7e3=_0xd1e5('0x2a');return db['UserProfileSection'][_0xd1e5('0x4f')]({'where':{'name':_0x68f7e3,'userProfileId':_0x34fb52[_0xd1e5('0x55')]},'raw':!![]})[_0xd1e5('0x16')](function(_0x509318){if(_0x509318&&_0x509318[_0xd1e5('0x56')]===0x0){return db[_0xd1e5('0x2b')]['create']({'name':_0xc719e4[_0xd1e5('0x2f')],'resourceId':_0xc719e4['id'],'type':_0x509318[_0xd1e5('0x2f')],'sectionId':_0x509318['id']},{})[_0xd1e5('0x16')](function(){return _0x157280;});}else{return _0x157280;}})[_0xd1e5('0x1f')](function(_0x1e5e23){logger[_0xd1e5('0x1b')](_0xd1e5('0x57'),_0x1e5e23);throw _0x1e5e23;});}return _0x157280;})[_0xd1e5('0x16')](respondWithResult(_0x2cff3e,0xc9))[_0xd1e5('0x1f')](handleError(_0x2cff3e,null));};exports[_0xd1e5('0x29')]=function(_0x24d7f5,_0x49752b){if(_0x24d7f5['body']['id']){delete _0x24d7f5[_0xd1e5('0x51')]['id'];}return db[_0xd1e5('0x34')]['find']({'where':{'id':_0x24d7f5['params']['id']},'include':[{'model':db['Pause'],'as':_0xd1e5('0x33')}]})[_0xd1e5('0x16')](handleEntityNotFound(_0x49752b,null))[_0xd1e5('0x16')](saveUpdates(_0x24d7f5[_0xd1e5('0x51')],null))[_0xd1e5('0x16')](respondWithResult(_0x49752b,null))['catch'](handleError(_0x49752b,null));};exports[_0xd1e5('0x2c')]=function(_0x337f1b,_0x4a9a9a){return db['ChatWebsite'][_0xd1e5('0x4f')]({'where':{'id':_0x337f1b[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4a9a9a,null))[_0xd1e5('0x16')](removeEntity(_0x4a9a9a,null))[_0xd1e5('0x1f')](handleError(_0x4a9a9a,null));};exports[_0xd1e5('0x58')]=function(_0x3c85bb,_0x494346){return db['ChatWebsite'][_0xd1e5('0x58')]()['then'](respondWithResult(_0x494346,null))[_0xd1e5('0x1f')](handleError(_0x494346,null));};exports[_0xd1e5('0x59')]=function(_0x3ea951,_0x1fc3d3){if(_0x3ea951['body']['id']){delete _0x3ea951[_0xd1e5('0x51')]['id'];}return db[_0xd1e5('0x34')]['find']({'where':{'id':_0x3ea951[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x1fc3d3,null))['then'](function(_0x3e0418){if(_0x3e0418){_0x3ea951[_0xd1e5('0x51')]['ChatWebsiteId']=_0x3e0418['id'];return db[_0xd1e5('0x5a')][_0xd1e5('0x50')](_0x3ea951[_0xd1e5('0x51')]);}})[_0xd1e5('0x16')](respondWithResult(_0x1fc3d3,null))[_0xd1e5('0x1f')](handleError(_0x1fc3d3,null));};exports['getDispositions']=function(_0x457d16,_0x292a8d){var _0x2824cb={'raw':![],'where':{}};var _0x379d75={};var _0x486530={'count':0x0,'rows':[]};return db[_0xd1e5('0x34')][_0xd1e5('0x5b')]({'where':{'id':_0x457d16[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x292a8d,null))[_0xd1e5('0x16')](function(_0x1e4fd7){if(_0x1e4fd7){_0x379d75[_0xd1e5('0x39')]=_[_0xd1e5('0x3b')](db[_0xd1e5('0x5a')][_0xd1e5('0x35')]);_0x379d75[_0xd1e5('0x3c')]=_[_0xd1e5('0x3b')](_0x457d16[_0xd1e5('0x3c')]);_0x379d75[_0xd1e5('0x3d')]=_['intersection'](_0x379d75[_0xd1e5('0x39')],_0x379d75[_0xd1e5('0x3c')]);_0x2824cb[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x379d75[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x457d16[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x2824cb[_0xd1e5('0x3f')]=_0x2824cb[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x2824cb[_0xd1e5('0x3f')]:_0x379d75['model'];if(!_0x457d16['query']['hasOwnProperty']('nolimit')){_0x2824cb[_0xd1e5('0x25')]=qs[_0xd1e5('0x25')](_0x457d16['query']['limit']);_0x2824cb[_0xd1e5('0x23')]=qs[_0xd1e5('0x23')](_0x457d16['query'][_0xd1e5('0x23')]);}_0x2824cb[_0xd1e5('0x5c')]=qs['sort'](_0x457d16[_0xd1e5('0x3c')][_0xd1e5('0x43')]);_0x2824cb[_0xd1e5('0x45')]=qs['filters'](_[_0xd1e5('0x44')](_0x457d16[_0xd1e5('0x3c')],_0x379d75[_0xd1e5('0x3d')]));_0x2824cb['where'][_0xd1e5('0x5d')]=_0x1e4fd7['id'];if(_0x457d16['query'][_0xd1e5('0x5e')]){_0x2824cb[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x2824cb[_0xd1e5('0x45')],{'$or':_[_0xd1e5('0x3a')](_0x2824cb['attributes'],function(_0x5be513){var _0x1a9d0c={};_0x1a9d0c[_0x5be513]={'$like':'%'+_0x457d16[_0xd1e5('0x3c')][_0xd1e5('0x5e')]+'%'};return _0x1a9d0c;})});}_0x2824cb=_['merge']({},_0x2824cb,_0x457d16[_0xd1e5('0x48')]);return db[_0xd1e5('0x5a')][_0xd1e5('0x26')]({'where':_0x2824cb[_0xd1e5('0x45')]})[_0xd1e5('0x16')](function(_0x1d4f4a){_0x486530[_0xd1e5('0x26')]=_0x1d4f4a;if(_0x457d16[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x2824cb[_0xd1e5('0x4a')]=[{'all':!![]}];}return db[_0xd1e5('0x5a')][_0xd1e5('0x4b')](_0x2824cb);})[_0xd1e5('0x16')](function(_0x35561f){_0x486530[_0xd1e5('0x4c')]=_0x35561f;return _0x486530;});}})['then'](respondWithFilteredResult(_0x292a8d,_0x2824cb))['catch'](handleError(_0x292a8d,null));};exports[_0xd1e5('0x5f')]=function(_0x3b06a1,_0x637a31){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x3b06a1['params']['id']}})['then'](handleEntityNotFound(_0x637a31,null))['then'](function(_0x596193){if(_0x596193){return _0x596193[_0xd1e5('0x5f')](_0x3b06a1[_0xd1e5('0x3c')][_0xd1e5('0x60')]);}})[_0xd1e5('0x16')](respondWithStatusCode(_0x637a31,null))[_0xd1e5('0x1f')](handleError(_0x637a31,null));};exports['addAnswer']=function(_0x8b3f83,_0x4dcb09){if(_0x8b3f83[_0xd1e5('0x51')]['id']){delete _0x8b3f83[_0xd1e5('0x51')]['id'];}return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x8b3f83[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4dcb09,null))[_0xd1e5('0x16')](function(_0x440fdd){if(_0x440fdd){_0x8b3f83[_0xd1e5('0x51')][_0xd1e5('0x5d')]=_0x440fdd['id'];return db[_0xd1e5('0x61')]['create'](_0x8b3f83['body']);}})['then'](respondWithResult(_0x4dcb09,null))[_0xd1e5('0x1f')](handleError(_0x4dcb09,null));};exports[_0xd1e5('0x62')]=function(_0x190de6,_0x236dd){var _0x1826c4={'raw':![],'where':{}};var _0x4e6768={};var _0x27922c={'count':0x0,'rows':[]};return db[_0xd1e5('0x34')]['findOne']({'where':{'id':_0x190de6[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x236dd,null))['then'](function(_0x2398bd){if(_0x2398bd){_0x4e6768['model']=_['keys'](db[_0xd1e5('0x61')][_0xd1e5('0x35')]);_0x4e6768[_0xd1e5('0x3c')]=_[_0xd1e5('0x3b')](_0x190de6[_0xd1e5('0x3c')]);_0x4e6768[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x4e6768[_0xd1e5('0x39')],_0x4e6768['query']);_0x1826c4[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x4e6768[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x1826c4[_0xd1e5('0x3f')]=_0x1826c4[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x1826c4[_0xd1e5('0x3f')]:_0x4e6768['model'];if(!_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x63')](_0xd1e5('0x42'))){_0x1826c4['limit']=qs[_0xd1e5('0x25')](_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x25')]);_0x1826c4['offset']=qs[_0xd1e5('0x23')](_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}_0x1826c4[_0xd1e5('0x5c')]=qs[_0xd1e5('0x43')](_0x190de6[_0xd1e5('0x3c')]['sort']);_0x1826c4['where']=qs[_0xd1e5('0x3d')](_[_0xd1e5('0x44')](_0x190de6[_0xd1e5('0x3c')],_0x4e6768[_0xd1e5('0x3d')]));_0x1826c4['where'][_0xd1e5('0x5d')]=_0x2398bd['id'];if(_0x190de6['query']['filter']){_0x1826c4['where']=_[_0xd1e5('0x46')](_0x1826c4[_0xd1e5('0x45')],{'$or':_[_0xd1e5('0x3a')](_0x1826c4[_0xd1e5('0x3f')],function(_0x3ca15c){var _0x3abf5b={};_0x3abf5b[_0x3ca15c]={'$like':'%'+_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x5e')]+'%'};return _0x3abf5b;})});}_0x1826c4=_['merge']({},_0x1826c4,_0x190de6[_0xd1e5('0x48')]);return db['CannedAnswer'][_0xd1e5('0x26')]({'where':_0x1826c4[_0xd1e5('0x45')]})['then'](function(_0xe40d6e){_0x27922c[_0xd1e5('0x26')]=_0xe40d6e;if(_0x190de6[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x1826c4[_0xd1e5('0x4a')]=[{'all':!![]}];}return db[_0xd1e5('0x61')][_0xd1e5('0x4b')](_0x1826c4);})[_0xd1e5('0x16')](function(_0x569f6a){_0x27922c[_0xd1e5('0x4c')]=_0x569f6a;return _0x27922c;});}})['then'](respondWithFilteredResult(_0x236dd,_0x1826c4))[_0xd1e5('0x1f')](handleError(_0x236dd,null));};exports[_0xd1e5('0x64')]=function(_0x1860b5,_0x29517a){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x1860b5[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x29517a,null))[_0xd1e5('0x16')](function(_0x1a7276){if(_0x1a7276){return _0x1a7276[_0xd1e5('0x64')](_0x1860b5[_0xd1e5('0x3c')][_0xd1e5('0x60')]);}})[_0xd1e5('0x16')](respondWithStatusCode(_0x29517a,null))[_0xd1e5('0x1f')](handleError(_0x29517a,null));};exports[_0xd1e5('0x65')]=function(_0x4976c1,_0xb19682){_0x4976c1[_0xd1e5('0x51')]['sitepic']=_0x4976c1[_0xd1e5('0x66')][_0xd1e5('0x67')];return db['ChatWebsite'][_0xd1e5('0x4f')]({'where':{'id':_0x4976c1[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0xb19682,null))[_0xd1e5('0x16')](saveUpdates(_0x4976c1[_0xd1e5('0x51')],null))['then'](respondWithResult(_0xb19682,null))['catch'](handleError(_0xb19682,null));};exports[_0xd1e5('0x68')]=function(_0x484c8c,_0x53c6fb){_0x484c8c[_0xd1e5('0x51')]['agentAvatar']=_0x484c8c[_0xd1e5('0x66')][_0xd1e5('0x67')];return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x484c8c['params']['id']}})['then'](handleEntityNotFound(_0x53c6fb,null))[_0xd1e5('0x16')](saveUpdates(_0x484c8c[_0xd1e5('0x51')],null))['then'](respondWithResult(_0x53c6fb,null))[_0xd1e5('0x1f')](handleError(_0x53c6fb,null));};exports[_0xd1e5('0x69')]=function(_0x1a0b39,_0xdb5579){_0x1a0b39[_0xd1e5('0x51')][_0xd1e5('0x6a')]=_0x1a0b39[_0xd1e5('0x66')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x1a0b39[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0xdb5579,null))[_0xd1e5('0x16')](saveUpdates(_0x1a0b39[_0xd1e5('0x51')],null))[_0xd1e5('0x16')](respondWithResult(_0xdb5579,null))[_0xd1e5('0x1f')](handleError(_0xdb5579,null));};exports[_0xd1e5('0x6b')]=function(_0x4501be,_0x20ac11){_0x4501be[_0xd1e5('0x51')][_0xd1e5('0x6c')]=_0x4501be['file']['filename'];return db[_0xd1e5('0x34')]['find']({'where':{'id':_0x4501be[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x20ac11,null))[_0xd1e5('0x16')](saveUpdates(_0x4501be[_0xd1e5('0x51')],null))['then'](respondWithResult(_0x20ac11,null))[_0xd1e5('0x1f')](handleError(_0x20ac11,null));};exports['getLogo']=function(_0x18b964,_0x1bc64f){var _0x81fcc4=path['join'](config[_0xd1e5('0x6d')],'server/files/images/logos/default_logo.svg');var _0x1d7262={'where':{'id':_0x18b964[_0xd1e5('0x4e')]['id']},'attributes':['id',_0xd1e5('0x6e')],'raw':!![]};var _0x31491c=![];return require(_0xd1e5('0x6f'))[_0xd1e5('0x70')]()[_0xd1e5('0x16')](function(_0x1cb8cc){if(_0x1cb8cc){_0x31491c=_0x1cb8cc[_0xd1e5('0x71')];}})[_0xd1e5('0x16')](function(){return db['ChatWebsite'][_0xd1e5('0x4f')](_0x1d7262);})[_0xd1e5('0x16')](handleEntityNotFound(_0x1bc64f,null))[_0xd1e5('0x16')](function(_0x2cad31){if(_0x2cad31){if(!_[_0xd1e5('0x72')](_0x2cad31[_0xd1e5('0x6e')])){if(fs[_0xd1e5('0x73')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x75'),_0x2cad31['sitepic']))&&_0x31491c){_0x81fcc4=path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x75'),_0x2cad31[_0xd1e5('0x6e')]);}}return _0x1bc64f[_0xd1e5('0x76')](_0x81fcc4);}})['catch'](handleError(_0x1bc64f,null));};exports[_0xd1e5('0x77')]=function(_0x27e6fc,_0x49050e){var _0x5f401d=path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x78'));var _0x3b64cd={'where':{'id':_0x27e6fc['params']['id']},'attributes':['id',_0xd1e5('0x79')],'raw':!![]};return db[_0xd1e5('0x34')]['find'](_0x3b64cd)[_0xd1e5('0x16')](handleEntityNotFound(_0x49050e,null))[_0xd1e5('0x16')](function(_0x9a77f6){if(_0x9a77f6){if(!_[_0xd1e5('0x72')](_0x9a77f6[_0xd1e5('0x79')])){if(fs[_0xd1e5('0x73')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],'server/files/images/avatars/',_0x9a77f6['agentAvatar']))){_0x5f401d=path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x7a'),_0x9a77f6['agentAvatar']);}}return _0x49050e[_0xd1e5('0x76')](_0x5f401d);}})[_0xd1e5('0x1f')](handleError(_0x49050e,null));};exports[_0xd1e5('0x7b')]=function(_0x2f161f,_0x1fff3f){var _0x3547f9=path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x7c'));var _0xfb5766={'where':{'id':_0x2f161f['params']['id']},'attributes':['id',_0xd1e5('0x6a'),_0xd1e5('0x7d')],'raw':!![]};return db[_0xd1e5('0x34')][_0xd1e5('0x4f')](_0xfb5766)['then'](handleEntityNotFound(_0x1fff3f,null))[_0xd1e5('0x16')](function(_0x2f0652){if(_0x2f0652){if(!_[_0xd1e5('0x72')](_0x2f0652[_0xd1e5('0x6a')])){if(fs[_0xd1e5('0x73')](path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x7a'),_0x2f0652[_0xd1e5('0x6a')]))&&_0x2f0652[_0xd1e5('0x7d')]){_0x3547f9=path['join'](config[_0xd1e5('0x6d')],_0xd1e5('0x7a'),_0x2f0652[_0xd1e5('0x6a')]);}}return _0x1fff3f['download'](_0x3547f9);}})[_0xd1e5('0x1f')](handleError(_0x1fff3f,null));};exports['getSystemAvatar']=function(_0x1dd9fd,_0x36d59c){var _0x1050c7=path[_0xd1e5('0x74')](config['root'],_0xd1e5('0x7e'));var _0x4d954c={'where':{'id':_0x1dd9fd[_0xd1e5('0x4e')]['id']},'attributes':['id',_0xd1e5('0x6c')],'raw':!![]};return db[_0xd1e5('0x34')][_0xd1e5('0x4f')](_0x4d954c)[_0xd1e5('0x16')](handleEntityNotFound(_0x36d59c,null))[_0xd1e5('0x16')](function(_0x1ff077){if(_0x1ff077){if(!_['isNil'](_0x1ff077[_0xd1e5('0x6c')])){if(fs[_0xd1e5('0x73')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x7a'),_0x1ff077[_0xd1e5('0x6c')]))){_0x1050c7=path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x7a'),_0x1ff077[_0xd1e5('0x6c')]);}}return _0x36d59c[_0xd1e5('0x76')](_0x1050c7);}})[_0xd1e5('0x1f')](handleError(_0x36d59c,null));};exports['notify']=function(_0x2fc728,_0x34820f){var _0x49986b=require(_0xd1e5('0x7f'));var _0x4abde6=new _0x49986b();var _0x695cef=_0x4abde6[_0xd1e5('0x80')](_0x2fc728['headers']['user-agent'])[_0xd1e5('0x81')]();var _0x18bdc8={'body':_0x2fc728[_0xd1e5('0x51')],'channel':_0xd1e5('0x82')};var _0x5c070a=[];var _0x31a869=[];var _0x4d7702={};var _0x5a20b3=![];return db[_0xd1e5('0x83')][_0xd1e5('0x58')]()[_0xd1e5('0x16')](function(_0x45ef48){if(!_0x45ef48){throw new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))]('no\x20available\x20attributes');}_0x5c070a=_['difference'](_[_0xd1e5('0x3b')](_0x45ef48),[_0xd1e5('0x86'),_0xd1e5('0x87')]);_0x31a869=_[_0xd1e5('0x88')](_[_0xd1e5('0x3b')](_0x45ef48),['createdAt',_0xd1e5('0x87'),_0xd1e5('0x89'),_0xd1e5('0x8a')]);if(_0x2fc728[_0xd1e5('0x51')]['id']){delete _0x2fc728[_0xd1e5('0x51')]['id'];}if(_[_0xd1e5('0x72')](_0x2fc728['body']['from'])){throw new db[(_0xd1e5('0x84'))]['ValidationError'](_0xd1e5('0x8b'));}if(_['isNil'](_0x2fc728['body'][_0xd1e5('0x51')])||_0x2fc728['body'][_0xd1e5('0x51')]===''){throw new db['Sequelize']['ValidationError'](_0xd1e5('0x8c'));}if(_[_0xd1e5('0x72')](_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8d')])){throw new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31a869);}if(!_[_0xd1e5('0x8e')](_0x31a869,_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8d')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31a869);}_0x4d7702[_0x2fc728['body'][_0xd1e5('0x8d')]]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8f')];})['then'](function(){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x2fc728[_0xd1e5('0x4e')]['id']},'include':[{'model':db[_0xd1e5('0x90')],'as':_0xd1e5('0x91'),'include':[{'model':db[_0xd1e5('0x83')],'as':_0xd1e5('0x92'),'where':_0x4d7702,'limit':0x1,'order':[[_0xd1e5('0x87'),_0xd1e5('0x93')]]}]},{'model':db['ChatApplication'],'as':_0xd1e5('0x94')}]});})[_0xd1e5('0x16')](handleEntityNotFound(_0x34820f,null))[_0xd1e5('0x16')](function(_0x308cca){if(_0x308cca&&_0x308cca['List']){_0x18bdc8[_0xd1e5('0x95')]=_0x308cca;_0x18bdc8[_0xd1e5('0x96')]=_0x308cca[_0xd1e5('0x94')];_0x18bdc8[_0xd1e5('0x97')]=_0x308cca[_0xd1e5('0x91')];_0x18bdc8[_0xd1e5('0x96')]=_[_0xd1e5('0x98')](_0x18bdc8[_0xd1e5('0x96')],[_0xd1e5('0x99')],['asc']);if(_0x18bdc8[_0xd1e5('0x95')][_0xd1e5('0x94')]){delete _0x18bdc8[_0xd1e5('0x95')][_0xd1e5('0x94')];}if(_0x18bdc8[_0xd1e5('0x95')][_0xd1e5('0x91')]&&_0x18bdc8[_0xd1e5('0x95')][_0xd1e5('0x91')][_0xd1e5('0x92')][_0xd1e5('0x41')]){return _0x18bdc8[_0xd1e5('0x95')]['List'][_0xd1e5('0x92')][0x0];}var _0x4a9927=_[_0xd1e5('0xc')](_0x2fc728[_0xd1e5('0x51')],{'firstName':_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8f')],'ListId':_0x308cca['ListId']});_0x4a9927[_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8d')]]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x8f')];return db[_0xd1e5('0x83')][_0xd1e5('0x50')](_0x4a9927,{'fields':_0x5c070a,'raw':!![]});}})[_0xd1e5('0x16')](handleEntityNotFound(_0x34820f,null))[_0xd1e5('0x16')](function(_0x342875){_0x18bdc8['contact']=_0x342875;var _0x33e129=_0x2fc728[_0xd1e5('0x51')]['customerIp'];if(_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0x9b')]){_0x33e129=_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0x9b')];}else if(_0x2fc728[_0xd1e5('0x9a')]['x-forwarded-for']){_0x33e129=_[_0xd1e5('0x9c')](_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0x9d')][_0xd1e5('0x9e')](','));}if(_0x342875){var _0x565184={'ContactId':_0x342875['id'],'ChatWebsiteId':_0x2fc728['params']['id'],'from':(_0x342875['firstName']||'')+'\x20'+(_0x342875[_0xd1e5('0x9f')]||''),'customerIp':_0x33e129,'customerPort':_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0xa0')]?_0x2fc728[_0xd1e5('0x9a')][_0xd1e5('0xa0')]:null,'referer':_0x2fc728[_0xd1e5('0x51')]['referer'],'browserName':_0x695cef[_0xd1e5('0xa1')]['name']&&_0x695cef[_0xd1e5('0xa1')][_0xd1e5('0xa2')]?util[_0xd1e5('0xa3')](_0xd1e5('0xa4'),_0x695cef[_0xd1e5('0xa1')][_0xd1e5('0x2f')],_0x695cef['browser'][_0xd1e5('0xa2')]):_0xd1e5('0xa5'),'browserVersion':_0x695cef[_0xd1e5('0xa1')][_0xd1e5('0xa2')]||_0xd1e5('0xa5'),'osName':util['format'](_0xd1e5('0xa4'),_0x695cef['os'][_0xd1e5('0x2f')],_0x695cef['os'][_0xd1e5('0xa2')]),'osVersion':_0x695cef['os']['version'],'deviceModel':_0x695cef[_0xd1e5('0xa6')]['model']&&_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0xa7')]?util[_0xd1e5('0xa3')](_0xd1e5('0xa8'),_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0x39')],_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0xa7')],_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0x37')]):null,'deviceVendor':_0x695cef[_0xd1e5('0xa6')][_0xd1e5('0xa7')],'deviceType':_0x695cef[_0xd1e5('0xa6')]['type'],'formData':JSON[_0xd1e5('0xa9')](_0x2fc728[_0xd1e5('0x51')])};var _0x4de6c3={'ChatWebsiteId':_0x2fc728[_0xd1e5('0x4e')]['id'],'closed':![]};if(_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xaa')]){_0x4de6c3[_0xd1e5('0xaa')]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xaa')];return db[_0xd1e5('0xab')]['find']({'where':_0x4de6c3})['then'](function(_0x10fcaf){if(_0x10fcaf){return[_0x10fcaf,![]];}_0x565184[_0xd1e5('0xaa')]=_0x2fc728['body'][_0xd1e5('0xaa')];_0x565184[_0xd1e5('0xac')]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xac')];return db[_0xd1e5('0xab')]['create'](_0x565184)[_0xd1e5('0x16')](function(_0x171c20){return[_0x171c20,!![]];});});}_0x4de6c3[_0xd1e5('0xad')]=_0x342875['id'];if(_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xae')]&&_0x2fc728[_0xd1e5('0x51')]['interaction']['id']){_0x4de6c3['id']=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xae')]['id'];return db['ChatInteraction']['find']({'where':_0x4de6c3})['then'](function(_0x45b878){if(_0x45b878){return[_0x45b878,![]];}return db[_0xd1e5('0xab')]['create'](_0x565184)[_0xd1e5('0x16')](function(_0xce5172){return[_0xce5172,!![]];});});}return db['ChatInteraction']['create'](_0x565184)[_0xd1e5('0x16')](function(_0x406a58){return[_0x406a58,!![]];});}})[_0xd1e5('0xaf')](function(_0x12f5b4,_0x40c708){if(_0x12f5b4){_0x5a20b3=_0x40c708;if(!_0x40c708){var _0x4d675d={'from':(_0x18bdc8[_0xd1e5('0xb0')][_0xd1e5('0xb1')]||'')+'\x20'+(_0x18bdc8[_0xd1e5('0xb0')][_0xd1e5('0x9f')]||'')};if(_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xaa')]&&_0x2fc728[_0xd1e5('0x51')]['messageId']&&_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xaa')]!=_0x2fc728[_0xd1e5('0x51')]['messageId']){_0x4d675d[_0xd1e5('0xaa')]=_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0xb2')];}return _0x12f5b4[_0xd1e5('0x29')](_0x4d675d);}else{return _0x12f5b4;}}})['then'](function(_0x1b0d06){_0x18bdc8[_0xd1e5('0xae')]=_0x1b0d06[_0xd1e5('0x52')]({'plain':!![]});_0x18bdc8[_0xd1e5('0xae')][_0xd1e5('0xb3')]=_0x5a20b3;if(_0x18bdc8[_0xd1e5('0xae')]['created']){if(_0x18bdc8['account']['autoclose']){_0x18bdc8['applications'][_0xd1e5('0xb4')]({'id':0x0,'priority':_0x18bdc8[_0xd1e5('0x96')][_0xd1e5('0x41')]+0x1,'app':_0xd1e5('0xb5'),'appdata':_0xd1e5('0xb6'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0xd1e5('0x50')]({'body':_0x2fc728[_0xd1e5('0x51')][_0xd1e5('0x51')],'ChatWebsiteId':_0x2fc728[_0xd1e5('0x4e')]['id'],'ChatInteractionId':_0x1b0d06['id'],'direction':'in','ContactId':_0x18bdc8[_0xd1e5('0xb0')]['id'],'AttachmentId':_0x2fc728[_0xd1e5('0x51')]['AttachmentId']});})['then'](function(_0x1b66c7){_0x18bdc8['message']=_0x1b66c7;if(_0x18bdc8[_0xd1e5('0xae')][_0xd1e5('0xb7')]){return db['User'][_0xd1e5('0x4f')]({'attributes':['id',_0xd1e5('0x2f')],'where':{'id':_0x18bdc8[_0xd1e5('0xae')][_0xd1e5('0xb7')]}})[_0xd1e5('0x16')](function(_0x5d2a62){if(_0x5d2a62){_0x18bdc8[_0xd1e5('0x96')][_0xd1e5('0xb8')]({'id':0x0,'priority':0x0,'app':_0xd1e5('0xb9'),'appdata':_0x5d2a62[_0xd1e5('0x2f')]+','+(_0x18bdc8['account'][_0xd1e5('0xba')]||0xa),'interval':_0xd1e5('0xbb')});_0x18bdc8['forcedOwnership']=!![];}return respondWithRpcPromise(_0xd1e5('0xbc'),_0xd1e5('0xbd'),_0x18bdc8);});}return respondWithRpcPromise(_0xd1e5('0xbc'),_0xd1e5('0xbd'),_0x18bdc8);})[_0xd1e5('0x16')](function(_0x1f1ba6){respondWithRpcPromise(_0xd1e5('0xbe'),_0xd1e5('0xbe'),{'event':_0xd1e5('0xbf'),'message':_0x1f1ba6},client9002);return _0x1f1ba6;})['then'](respondWithResult(_0x34820f,null))[_0xd1e5('0x1f')](handleError(_0x34820f,null));};exports['offline']=function(_0x304ac9,_0x360d4b){var _0xa88d8e,_0x36cdee,_0x359a90;var _0x2b70c0=[];var _0x13020d={};var _0x273bcd=_0x304ac9[_0xd1e5('0xc0')]||[];var _0xab2f15=[];var _0x586a7b;return db[_0xd1e5('0x83')][_0xd1e5('0x58')]()[_0xd1e5('0x16')](function(_0x274242){if(!_0x274242){throw new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))](_0xd1e5('0xc1'));}_0x2b70c0=_[_0xd1e5('0x88')](_['keys'](_0x274242),['createdAt','updatedAt','CompanyId',_0xd1e5('0x8a')]);if(_0x304ac9[_0xd1e5('0x51')]['id']){delete _0x304ac9['body']['id'];}if(_[_0xd1e5('0x72')](_0x304ac9[_0xd1e5('0x51')]['from'])){throw _0x360d4b[_0xd1e5('0x21')](0x1f4)[_0xd1e5('0x30')](new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))](_0xd1e5('0x8b')));}if(_[_0xd1e5('0x72')](_0x304ac9[_0xd1e5('0x51')]['body'])||_0x304ac9['body'][_0xd1e5('0x51')]===''){throw _0x360d4b[_0xd1e5('0x21')](0x1f4)[_0xd1e5('0x30')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xd1e5('0x72')](_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0xc2')])){throw _0x360d4b[_0xd1e5('0x21')](0x1f4)['send'](new db[(_0xd1e5('0x84'))]['ValidationError'](_0xd1e5('0xc3')+_0x2b70c0));}if(!_[_0xd1e5('0x8e')](_0x2b70c0,_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0xc2')])){throw _0x360d4b[_0xd1e5('0x21')](0x1f4)['send'](new db[(_0xd1e5('0x84'))][(_0xd1e5('0x85'))](_0xd1e5('0xc4')+_0x2b70c0));}_0x13020d[_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0xc2')]]=_0x304ac9['body'][_0xd1e5('0x8f')];})[_0xd1e5('0x16')](function(){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x304ac9[_0xd1e5('0x4e')]['id']},'include':[{'model':db[_0xd1e5('0x90')],'as':'List'},{'model':db[_0xd1e5('0xc5')],'as':_0xd1e5('0xc5')}]});})['then'](handleEntityNotFound(_0x360d4b,null))[_0xd1e5('0x16')](function(_0x2334b6){if(_0x2334b6&&_0x2334b6[_0xd1e5('0x91')]){_0x36cdee=_0x2334b6;var _0x1a4ee8=_[_0xd1e5('0xc')](_0x304ac9[_0xd1e5('0x51')],{'firstName':_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0x8f')],'phone':_0x304ac9['body'][_0xd1e5('0x8f')],'ListId':_0x2334b6[_0xd1e5('0x8a')]});_0x1a4ee8[_0x304ac9['body'][_0xd1e5('0xc2')]]=_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0x8f')];return db['CmContact']['findOrCreate']({'where':_0x13020d,'defaults':_0x1a4ee8});}})[_0xd1e5('0xaf')](function(_0x49d02d){if(_0x49d02d){_0x359a90=_0x49d02d;var _0x1b5e8e=fs[_0xd1e5('0xc6')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0xc7')),_0xd1e5('0xc8'));var _0x210c08=ejs[_0xd1e5('0xc9')](_0x1b5e8e,{'body':_[_0xd1e5('0xca')](_0x304ac9[_0xd1e5('0x51')][_0xd1e5('0x51')]),'bodyTitle':_0x36cdee['offlineMessageBody']});return db['ChatOfflineMessage'][_0xd1e5('0x50')]({'body':_0x210c08,'plainBody':htmlToText[_0xd1e5('0xcb')](_0x210c08),'ContactId':_0x49d02d['id'],'ChatWebsiteId':_0x36cdee['id']});}})[_0xd1e5('0x16')](function(_0x3c1d68){_0x586a7b=_0x3c1d68;if(_0x273bcd[_0xd1e5('0x41')]){var _0x55d72e=_0x273bcd['map'](function(_0x1cee09){return{'name':_0x1cee09[_0xd1e5('0xcc')],'basename':_0x1cee09[_0xd1e5('0x67')],'type':_0x1cee09['mimetype'],'ChatOfflineMessageId':_0x3c1d68['id']};});_0xab2f15=_0x55d72e[_0xd1e5('0x3a')](_0x283268=>{var _0x52101e={'filename':_0x283268[_0xd1e5('0x2f')],'path':path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],'server',_0xd1e5('0xc0'),_0xd1e5('0xcd'),_0xd1e5('0xce'),_0x283268[_0xd1e5('0xcf')])};return _0x52101e;});if(!_0x36cdee[_0xd1e5('0xd0')]){return db[_0xd1e5('0xd1')][_0xd1e5('0xd2')](function(_0x52a5c8){return db[_0xd1e5('0xd3')][_0xd1e5('0xd4')](_0x55d72e,{'transaction':_0x52a5c8});});}}})[_0xd1e5('0x16')](function(){if(_0x586a7b){_0xa88d8e=_0x586a7b;return db[_0xd1e5('0xc5')][_0xd1e5('0x5b')]({'where':{'active':!![]},'include':[{'model':db[_0xd1e5('0xd5')],'as':_0xd1e5('0xd6'),'raw':!![],'include':[{'model':db[_0xd1e5('0xd7')],'as':_0xd1e5('0xd7'),'raw':!![]}]}]});}})[_0xd1e5('0x16')](function(_0x52b885){if(_0x52b885&&_0x52b885['Smtp']&&_0x36cdee['forwardOffline']&&_0x36cdee[_0xd1e5('0xd8')]){var _0x2f151a=_0x52b885['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xd1e5('0xd9'),{'account':_0x2f151a,'message':{'from':util[_0xd1e5('0xa3')](_0xd1e5('0xda'),_0x52b885[_0xd1e5('0x2f')],_0x52b885[_0xd1e5('0xdb')]||_0x52b885[_0xd1e5('0xd6')]['user']),'to':_0x36cdee[_0xd1e5('0xd8')],'subject':_0x36cdee['offlineMessageSubject'],'html':_0xa88d8e[_0xd1e5('0x51')],'attachments':_0xab2f15}},client9003)[_0xd1e5('0x16')](function(){return _0xa88d8e;})['catch'](function(_0x3a1234){logger['error'](_0x3a1234);});}})[_0xd1e5('0x16')](function(){if(_0x36cdee&&_0x36cdee[_0xd1e5('0xd0')]&&_0x36cdee[_0xd1e5('0xdc')]){var _0x2525a7=[];if(_0x273bcd['length']){_0x2525a7=_0x273bcd[_0xd1e5('0x3a')](function(_0x465fb5){return{'name':_0x465fb5['originalname'],'basename':_0x465fb5[_0xd1e5('0x67')],'type':_0x465fb5[_0xd1e5('0xdd')],'ChatOfflineMessageId':_0x586a7b['id']};});}var _0x2c04b5;if(!_['isNil'](_0x36cdee[_0xd1e5('0xde')])){var _0x18d8f1=_[_0xd1e5('0x3a')](_0x304ac9[_0xd1e5('0x51')],function(_0x8b2bec){return _0x8b2bec;});var _0x20f32f=_[_0xd1e5('0xdf')](_0x18d8f1)[0x0];var _0x152901=_['mapValues'](_0x20f32f,function(_0x4c5408){return _0x4c5408;});_0x2c04b5=_0x152901[0x1][_0x36cdee['subjectOffline']];}var _0x3dca11={'from':_0x359a90[_0xd1e5('0xdb')],'firstName':_0x359a90[_0xd1e5('0xb1')],'lastName':_0x359a90[_0xd1e5('0x9f')],'mapKey':_0xd1e5('0xdb'),'message':{'from':_0x359a90[_0xd1e5('0xdb')],'to':_0x36cdee[_0xd1e5('0xc5')][_0xd1e5('0xdb')],'cc':'','subject':_[_0xd1e5('0x72')](_0x2c04b5)?_0x36cdee[_0xd1e5('0xe0')]:_0x2c04b5,'messageId':'','sentAt':new Date(),'attach':_0x2525a7[_0xd1e5('0x41')],'attachments':_0x2525a7,'originChannel':_0xd1e5('0xe1'),'ChatWebsiteId':_0x36cdee['id'],'ChatOfflineMessageId':_0xa88d8e['id'],'originTo':_0x36cdee[_0xd1e5('0xc5')][_0xd1e5('0xdb')]},'body':_0xa88d8e[_0xd1e5('0x51')]};var _0x214e5e={'account':{'id':_0x36cdee[_0xd1e5('0xdc')]},'body':_0x3dca11,'log':_0xd1e5('0xe2')};return respondWithRpcPromise(_0xd1e5('0xe2'),_0xd1e5('0xe3'),_0x214e5e,client9001)[_0xd1e5('0x16')](function(){return _0xa88d8e;})[_0xd1e5('0x1f')](function(_0x5cecdc){logger[_0xd1e5('0x1b')](_0x5cecdc);});}return;})[_0xd1e5('0x16')](function(){if(_0xa88d8e){return _0xa88d8e;}})[_0xd1e5('0x16')](respondWithResult(_0x360d4b,null))['catch'](function(_0x5bcfcb){logger[_0xd1e5('0x1b')]('catch',_0x5bcfcb);for(var _0x1d17a0 of _0x273bcd){var _0x5a3417=path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0xe4'),_0xd1e5('0xc0'),_0xd1e5('0xcd'),'offline-chat',_0x1d17a0['filename']);fs_extra[_0xd1e5('0xe5')](_0x5a3417)[_0xd1e5('0x1f')](function(_0x162831){logger[_0xd1e5('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x5a3417,_0x162831);});}});};exports[_0xd1e5('0xe6')]=function(_0x5aed11,_0x1738e0){return db[_0xd1e5('0xab')][_0xd1e5('0x4f')]({'where':{'id':_0x5aed11[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1738e0,null))[_0xd1e5('0x16')](function(_0x22a395){if(_0x22a395){return _0x22a395[_0xd1e5('0xe6')](_0x5aed11[_0xd1e5('0x51')]['ids'],_[_0xd1e5('0xe7')](_0x5aed11[_0xd1e5('0x51')],[_0xd1e5('0x60'),'id'])||{});}})['then'](respondWithResult(_0x1738e0,null))['catch'](handleError(_0x1738e0,null));};exports[_0xd1e5('0xe8')]=function(_0x16c5de,_0x2452fb){var _0x2e3dce={'raw':![],'where':{}};var _0x17e3e2={};var _0x58d0c0={'count':0x0,'rows':[]};return db[_0xd1e5('0x34')]['findOne']({'where':{'id':_0x16c5de[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x2452fb,null))['then'](function(_0x206aa2){if(_0x206aa2){_0x17e3e2[_0xd1e5('0x39')]=_['keys'](db[_0xd1e5('0xab')][_0xd1e5('0x35')]);_0x17e3e2[_0xd1e5('0x3c')]=_['keys'](_0x16c5de[_0xd1e5('0x3c')]);_0x17e3e2[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x17e3e2[_0xd1e5('0x39')],_0x17e3e2[_0xd1e5('0x3c')]);_0x2e3dce['attributes']=_[_0xd1e5('0x3e')](_0x17e3e2['model'],qs[_0xd1e5('0x40')](_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x2e3dce[_0xd1e5('0x3f')]=_0x2e3dce['attributes'][_0xd1e5('0x41')]?_0x2e3dce[_0xd1e5('0x3f')]:_0x17e3e2[_0xd1e5('0x39')];if(!_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x63')]('nolimit')){_0x2e3dce[_0xd1e5('0x25')]=qs[_0xd1e5('0x25')](_0x16c5de['query'][_0xd1e5('0x25')]);_0x2e3dce['offset']=qs[_0xd1e5('0x23')](_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}_0x2e3dce['order']=qs['sort'](_0x16c5de['query'][_0xd1e5('0x43')]);_0x2e3dce['where']=qs['filters'](_['pick'](_0x16c5de[_0xd1e5('0x3c')],_0x17e3e2['filters']));_0x2e3dce['where']['ChatWebsiteId']=_0x206aa2['id'];if(_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x5e')]){_0x2e3dce[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x2e3dce[_0xd1e5('0x45')],{'$or':_['map'](_0x2e3dce[_0xd1e5('0x3f')],function(_0x1a88d7){var _0x295d42={};_0x295d42[_0x1a88d7]={'$like':'%'+_0x16c5de[_0xd1e5('0x3c')][_0xd1e5('0x5e')]+'%'};return _0x295d42;})});}_0x2e3dce=_[_0xd1e5('0x46')]({},_0x2e3dce,_0x16c5de[_0xd1e5('0x48')]);return db[_0xd1e5('0xab')][_0xd1e5('0x26')]({'where':_0x2e3dce['where']})[_0xd1e5('0x16')](function(_0x5047f3){_0x58d0c0[_0xd1e5('0x26')]=_0x5047f3;if(_0x16c5de[_0xd1e5('0x3c')]['includeAll']){_0x2e3dce[_0xd1e5('0x4a')]=[{'model':db[_0xd1e5('0x83')],'as':_0xd1e5('0xe9'),'required':![]},{'model':db[_0xd1e5('0xea')],'as':'Owner','attributes':[_0xd1e5('0x2f'),_0xd1e5('0xeb'),_0xd1e5('0xec')],'required':![]},{'model':db[_0xd1e5('0xed')],'as':_0xd1e5('0xee'),'attributes':['id',_0xd1e5('0x2f'),_0xd1e5('0xef')],'where':_0x16c5de['query'][_0xd1e5('0xf0')]?{'id':_0x16c5de[_0xd1e5('0x3c')]['tag']}:undefined,'required':_0x16c5de['query'][_0xd1e5('0xf0')]?!![]:![]}];}return db[_0xd1e5('0xab')][_0xd1e5('0x4b')](_0x2e3dce);})['then'](function(_0x320217){_0x58d0c0[_0xd1e5('0x4c')]=_0x320217;return _0x58d0c0;});}})[_0xd1e5('0x16')](respondWithFilteredResult(_0x2452fb,_0x2e3dce))[_0xd1e5('0x1f')](handleError(_0x2452fb,null));};function iftimePromise(_0x5a3986,_0x174017){return respondWithRpcPromise(_0xd1e5('0xf1'),'getSnippet',{'command':_0x174017[_0xd1e5('0xf2')]?util[_0xd1e5('0xa3')](_0xd1e5('0xf3'),_0x5a3986[_0xd1e5('0xf4')],_0x174017[_0xd1e5('0xf2')]):util[_0xd1e5('0xa3')](_0xd1e5('0xf5'),_0x5a3986[_0xd1e5('0xf4')])},client9002)[_0xd1e5('0x16')](function(_0x368b89){var _0x4319b3=_0x368b89&&_0x368b89[_0xd1e5('0xf6')](_0xd1e5('0xf7'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x174017['id'],_0x5a3986['id'],_0x5a3986[_0xd1e5('0xf4')],_0x4319b3?_0xd1e5('0xf8'):_0xd1e5('0xf9'),_0x174017[_0xd1e5('0xf2')]?_0x174017['timezone']:'No\x20timezone');return _0x4319b3;})[_0xd1e5('0x1f')](function(_0x560cc8){logger[_0xd1e5('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x174017['id'],_0x5a3986['id'],_0x5a3986[_0xd1e5('0xf4')],util[_0xd1e5('0xfa')](_0x560cc8,{'showHidden':![],'depth':null}),_0x174017[_0xd1e5('0xf2')]?_0x174017[_0xd1e5('0xf2')]:_0xd1e5('0xfb'));return![];});}exports[_0xd1e5('0xfc')]=function(_0x5c6074,_0x29d15c){var _0xdd8419=0x0;var _0x29e774=0x0;var _0x3fe214=![];var _0x43891f;var _0x1424e2;return db[_0xd1e5('0x34')]['find']({'where':{'id':_0x5c6074[_0xd1e5('0x4e')]['id']},'include':[{'model':db[_0xd1e5('0xfd')],'as':_0xd1e5('0xfd'),'include':[{'model':db[_0xd1e5('0xfd')],'as':_0xd1e5('0xfe'),'attributes':['id',_0xd1e5('0xf4')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x29d15c,null))['then'](function(_0x3fda98){if(_0x3fda98){_0x43891f=_0x3fda98;return _0x3fda98[_0xd1e5('0xff')]({'raw':!![]});}})[_0xd1e5('0x16')](function(_0x115b27){if(_0x43891f){if(_0x115b27){_0x1424e2=_0x115b27;}}return require(_0xd1e5('0x6f'))['getLicense']();})['then'](function(_0x11308f){if(_0x11308f){_0x29e774=_0x11308f[_0xd1e5('0x100')];_0x3fe214=_0x11308f['custom'];}})[_0xd1e5('0x16')](function(){return db[_0xd1e5('0xab')]['count']({'where':{'closed':![]}});})[_0xd1e5('0x16')](function(_0x50fb45){_0xdd8419=_0x50fb45;if(_0x29e774&&_0x50fb45>_0x29e774){return db['License'][_0xd1e5('0x5b')]({'where':{'id':0x1}})[_0xd1e5('0x16')](function(_0x36ef06){if(_0x36ef06){_0x36ef06['increment'](_0xd1e5('0x101'));}});}})[_0xd1e5('0x16')](function(){if(_0x43891f[_0xd1e5('0xfd')]&&_0x43891f[_0xd1e5('0xfd')][_0xd1e5('0xfe')]){var _0x23fb83=[];for(var _0x30b760=0x0;_0x30b760<_0x43891f[_0xd1e5('0xfd')][_0xd1e5('0xfe')][_0xd1e5('0x41')];_0x30b760++){var _0x41dc07=_0x43891f['Interval'][_0xd1e5('0xfe')][_0x30b760][_0xd1e5('0x52')]({'plain':!![]});_0x23fb83['push'](iftimePromise(_0x41dc07,_0x43891f));}return BPromise[_0xd1e5('0x102')](_0x23fb83)[_0xd1e5('0x16')](function(_0x41cf69){return _[_0xd1e5('0x103')](_0x41cf69);});}else{return!![];}})[_0xd1e5('0x16')](function(_0x2dcd44){var _0x39fd31=fs[_0xd1e5('0xc6')](path[_0xd1e5('0x74')](config[_0xd1e5('0x6d')],_0xd1e5('0x104')),'utf8');var _0x517d61={'remote':_0x43891f[_0xd1e5('0x105')],'query':querystring[_0xd1e5('0xa9')](_[_0xd1e5('0x46')](_0x43891f[_0xd1e5('0x52')]({'plain':!![]}),{'customerIp':_0x5c6074[_0xd1e5('0x9a')]['x-forwarded-for']||_0x5c6074[_0xd1e5('0x9a')][_0xd1e5('0x106')]||_0x5c6074[_0xd1e5('0x107')]['remoteAddress']||_0x5c6074['ip'],'referer':_0x5c6074[_0xd1e5('0x9a')][_0xd1e5('0x108')],'openedInteractions':_0xdd8419,'maxInteractions':_0x29e774,'virtual':_0x3fe214[_0xd1e5('0x100')],'online':_0x2dcd44,'custom':_0x3fe214}))[_0xd1e5('0x109')](/'/g,'\x5c\x27')};_0x29d15c[_0xd1e5('0x30')](ejs[_0xd1e5('0xc9')](Mustache[_0xd1e5('0xc9')](_0x39fd31,_0x517d61),{'proactiveActions':_0x1424e2,'alignment':_0x43891f[_0xd1e5('0x10a')],'verticalAlignment':_0x43891f[_0xd1e5('0x10b')],'div_color':_0x43891f[_0xd1e5('0xef')],'labelText':_0x43891f[_0xd1e5('0x10c')],'text_color':_0x43891f[_0xd1e5('0x10d')],'button_color':_0x43891f['color_button'],'background_color':_0x43891f[_0xd1e5('0x10e')],'hideWhenOffline':_0x43891f['hideWhenOffline'],'interval':_0x43891f[_0xd1e5('0x10f')]}));})['catch'](handleError(_0x29d15c,null));};exports[_0xd1e5('0x110')]=function(_0x1c2b5d,_0x583461){var _0x4f160d=_0x1c2b5d[_0xd1e5('0x4e')]['id'];var _0x1ee32f=_0x1c2b5d[_0xd1e5('0x51')];var _0x4f9f40=0xc8;var _0x3e0573=null;return db[_0xd1e5('0xd1')][_0xd1e5('0xd2')]({'isolationLevel':db[_0xd1e5('0xd1')][_0xd1e5('0x111')][_0xd1e5('0x112')][_0xd1e5('0x113')]},function(_0x2ef09f){return db['ChatWebsite']['findOne']({'where':{'id':_0x4f160d},'transaction':_0x2ef09f})['then'](function(_0x24b4c3){if(_0x24b4c3){return db[_0xd1e5('0x114')][_0xd1e5('0x2c')]({'where':{'ChatWebsiteId':_0x4f160d},'transaction':_0x2ef09f})[_0xd1e5('0x16')](function(){var _0x13d401=_[_0xd1e5('0x3a')](_0x1ee32f,function(_0x483d4f){_0x483d4f[_0xd1e5('0x5d')]=_0x4f160d;return _0x483d4f;});return db['ChatApplication'][_0xd1e5('0xd4')](_0x13d401,{'transaction':_0x2ef09f});});}else{_0x4f9f40=0x194;_0x3e0573=[];}});})[_0xd1e5('0x16')](function(){if(_0x4f9f40!==0x194){return db[_0xd1e5('0x114')][_0xd1e5('0x115')]({'where':{'ChatWebsiteId':_0x4f160d},'order':_0xd1e5('0x99')})[_0xd1e5('0x16')](function(_0x1b89ea){_0x3e0573=_0x1b89ea;});}})[_0xd1e5('0x1f')](function(_0x3a5b99){_0x4f9f40=0x1f4;logger[_0xd1e5('0x1b')](_0x3a5b99[_0xd1e5('0x2e')]);if(_0x3a5b99[_0xd1e5('0x2f')]){delete _0x3a5b99[_0xd1e5('0x2f')];}_0x3e0573=_0x3a5b99;})[_0xd1e5('0x116')](function(){if(_0x3e0573===null){_0x583461[_0xd1e5('0x20')](_0x4f9f40);}else{if(_0x4f9f40===0x1f4){_0x583461[_0xd1e5('0x21')](_0x4f9f40)[_0xd1e5('0x30')](_0x3e0573);}else{_0x583461[_0xd1e5('0x21')](_0x4f9f40)[_0xd1e5('0x22')](_0x3e0573);}}});};exports[_0xd1e5('0x117')]=function(_0xe81d1e,_0xc72656){var _0x342788={};var _0x152fe2={};var _0x2a57f8;var _0x1df0ba;return db[_0xd1e5('0x34')]['findOne']({'where':{'id':_0xe81d1e[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0xc72656,null))[_0xd1e5('0x16')](function(_0x425234){if(_0x425234){_0x2a57f8=_0x425234;_0x152fe2[_0xd1e5('0x39')]=_[_0xd1e5('0x3b')](db[_0xd1e5('0x114')]['rawAttributes']);_0x152fe2[_0xd1e5('0x3c')]=_['keys'](_0xe81d1e[_0xd1e5('0x3c')]);_0x152fe2['filters']=_[_0xd1e5('0x3e')](_0x152fe2[_0xd1e5('0x39')],_0x152fe2[_0xd1e5('0x3c')]);_0x342788[_0xd1e5('0x3f')]=_[_0xd1e5('0x3e')](_0x152fe2[_0xd1e5('0x39')],qs['fields'](_0xe81d1e[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x342788[_0xd1e5('0x3f')]=_0x342788[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x342788[_0xd1e5('0x3f')]:_0x152fe2[_0xd1e5('0x39')];_0x342788[_0xd1e5('0x5c')]=qs['sort'](_0xe81d1e[_0xd1e5('0x3c')]['sort']);_0x342788['where']=qs[_0xd1e5('0x3d')](_['pick'](_0xe81d1e[_0xd1e5('0x3c')],_0x152fe2[_0xd1e5('0x3d')]));if(_0xe81d1e[_0xd1e5('0x3c')][_0xd1e5('0x5e')]){_0x342788[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x342788[_0xd1e5('0x45')],{'$or':_[_0xd1e5('0x3a')](_0x342788['attributes'],function(_0x5e4b67){var _0x482fb4={};_0x482fb4[_0x5e4b67]={'$like':'%'+_0xe81d1e['query']['filter']+'%'};return _0x482fb4;})});}_0x342788=_[_0xd1e5('0x46')]({},_0x342788,_0xe81d1e['options']);return _0x2a57f8[_0xd1e5('0x117')](_0x342788);}})[_0xd1e5('0x16')](function(_0x38a8f9){if(_0x38a8f9){_0x1df0ba=_0x38a8f9[_0xd1e5('0x41')];if(!_0xe81d1e[_0xd1e5('0x3c')]['hasOwnProperty'](_0xd1e5('0x42'))){_0x342788['limit']=qs[_0xd1e5('0x25')](_0xe81d1e[_0xd1e5('0x3c')]['limit']);_0x342788[_0xd1e5('0x23')]=qs['offset'](_0xe81d1e[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}return _0x2a57f8[_0xd1e5('0x117')](_0x342788);}})[_0xd1e5('0x16')](function(_0x2c8e2f){if(_0x2c8e2f){return _0x2c8e2f?{'count':_0x1df0ba,'rows':_0x2c8e2f}:null;}})['then'](respondWithResult(_0xc72656,null))['catch'](handleError(_0xc72656,null));};exports[_0xd1e5('0x118')]=function(_0x59dda3,_0x1e320e){return db[_0xd1e5('0x119')][_0xd1e5('0x4f')]({'where':{'id':_0x59dda3[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x1e320e,null))[_0xd1e5('0x16')](function(_0x4ea63a){if(_0x4ea63a){return _0x4ea63a[_0xd1e5('0x118')](_0x59dda3['body']['ids'],_[_0xd1e5('0xe7')](_0x59dda3[_0xd1e5('0x51')],[_0xd1e5('0x60'),'id'])||{});}})['then'](respondWithResult(_0x1e320e,null))['catch'](handleError(_0x1e320e,null));};exports[_0xd1e5('0xff')]=function(_0x1231f0,_0x56ece0){var _0x5e990a={};var _0x370855={};var _0x1779b3;var _0x2549d8;return db[_0xd1e5('0x34')][_0xd1e5('0x5b')]({'where':{'id':_0x1231f0['params']['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x56ece0,null))['then'](function(_0x1367c3){if(_0x1367c3){_0x1779b3=_0x1367c3;_0x370855['model']=_['keys'](db[_0xd1e5('0x11a')][_0xd1e5('0x35')]);_0x370855[_0xd1e5('0x3c')]=_[_0xd1e5('0x3b')](_0x1231f0[_0xd1e5('0x3c')]);_0x370855[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x370855[_0xd1e5('0x39')],_0x370855[_0xd1e5('0x3c')]);_0x5e990a[_0xd1e5('0x3f')]=_['intersection'](_0x370855[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x1231f0['query']['fields']));_0x5e990a[_0xd1e5('0x3f')]=_0x5e990a[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x5e990a[_0xd1e5('0x3f')]:_0x370855[_0xd1e5('0x39')];_0x5e990a[_0xd1e5('0x5c')]=qs['sort'](_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x43')]);_0x5e990a['where']=qs[_0xd1e5('0x3d')](_[_0xd1e5('0x44')](_0x1231f0[_0xd1e5('0x3c')],_0x370855['filters']));if(_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x5e')]){_0x5e990a[_0xd1e5('0x45')]=_['merge'](_0x5e990a[_0xd1e5('0x45')],{'$or':_[_0xd1e5('0x3a')](_0x5e990a[_0xd1e5('0x3f')],function(_0x2d2dfb){var _0x48bbd6={};_0x48bbd6[_0x2d2dfb]={'$like':'%'+_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x5e')]+'%'};return _0x48bbd6;})});}_0x5e990a=_[_0xd1e5('0x46')]({},_0x5e990a,_0x1231f0[_0xd1e5('0x48')]);return _0x1779b3['getProactiveActions'](_0x5e990a);}})[_0xd1e5('0x16')](function(_0x261b29){if(_0x261b29){_0x2549d8=_0x261b29['length'];if(!_0x1231f0['query'][_0xd1e5('0x63')](_0xd1e5('0x42'))){_0x5e990a[_0xd1e5('0x25')]=qs['limit'](_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x25')]);_0x5e990a[_0xd1e5('0x23')]=qs[_0xd1e5('0x23')](_0x1231f0[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}return _0x1779b3[_0xd1e5('0xff')](_0x5e990a);}})[_0xd1e5('0x16')](function(_0x207326){if(_0x207326){return _0x207326?{'count':_0x2549d8,'rows':_0x207326}:null;}})[_0xd1e5('0x16')](respondWithResult(_0x56ece0,null))[_0xd1e5('0x1f')](handleError(_0x56ece0,null));};exports[_0xd1e5('0x11b')]=function(_0x1a988b,_0x241a53){var _0x45a050=_0x1a988b[_0xd1e5('0x3c')][_0xd1e5('0x11c')]==='false'?_0xd1e5('0x11d'):'onlineForm';return db[_0xd1e5('0x34')]['find']({'attributes':['id',_0x45a050],'where':{'id':_0x1a988b['params']['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x241a53,null))[_0xd1e5('0x16')](function(_0x40c8df){if(_0x40c8df){var _0x3cba02=_0x40c8df[_0x45a050];var _0x49dd8a=_0x3cba02&&_0x3cba02[_0xd1e5('0x11e')]?_0x3cba02[_0xd1e5('0x11e')]:[];_0x241a53[_0xd1e5('0x30')]({'fromKey':_[_0xd1e5('0x72')](_0x3cba02[_0xd1e5('0x11f')])?undefined:_0x3cba02[_0xd1e5('0x11f')],'count':_0x49dd8a[_0xd1e5('0x41')],'rows':_0x49dd8a});}})[_0xd1e5('0x1f')](handleError(_0x241a53,null));};exports['getOfflineMessages']=function(_0x5af8de,_0x59b2d3){var _0x2ac16e={'raw':![],'where':{}};var _0x1a75fa={};var _0x5cbf51={'count':0x0,'rows':[]};return db[_0xd1e5('0x34')]['findOne']({'where':{'id':_0x5af8de[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59b2d3,null))[_0xd1e5('0x16')](function(_0x1a8554){if(_0x1a8554){_0x1a75fa[_0xd1e5('0x39')]=_[_0xd1e5('0x3b')](db[_0xd1e5('0x120')]['rawAttributes']);_0x1a75fa[_0xd1e5('0x3c')]=_['keys'](_0x5af8de['query']);_0x1a75fa[_0xd1e5('0x3d')]=_['intersection'](_0x1a75fa[_0xd1e5('0x39')],_0x1a75fa[_0xd1e5('0x3c')]);_0x2ac16e[_0xd1e5('0x3f')]=_['intersection'](_0x1a75fa[_0xd1e5('0x39')],qs[_0xd1e5('0x40')](_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x2ac16e[_0xd1e5('0x3f')]=_0x2ac16e[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x2ac16e[_0xd1e5('0x3f')]:_0x1a75fa['model'];if(!_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x63')](_0xd1e5('0x42'))){_0x2ac16e[_0xd1e5('0x25')]=qs[_0xd1e5('0x25')](_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x25')]);_0x2ac16e[_0xd1e5('0x23')]=qs[_0xd1e5('0x23')](_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x23')]);}_0x2ac16e['order']=qs[_0xd1e5('0x43')](_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x43')]);_0x2ac16e[_0xd1e5('0x45')]=qs[_0xd1e5('0x3d')](_[_0xd1e5('0x44')](_0x5af8de[_0xd1e5('0x3c')],_0x1a75fa[_0xd1e5('0x3d')]));_0x2ac16e[_0xd1e5('0x45')]['ChatWebsiteId']=_0x1a8554['id'];if(_0x5af8de[_0xd1e5('0x3c')]['filter']){_0x2ac16e[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x2ac16e[_0xd1e5('0x45')],{'$or':_['map'](_0x2ac16e[_0xd1e5('0x3f')],function(_0x350544){var _0x34c0c3={};_0x34c0c3[_0x350544]={'$like':'%'+_0x5af8de[_0xd1e5('0x3c')]['filter']+'%'};return _0x34c0c3;})});}_0x2ac16e=_[_0xd1e5('0x46')]({},_0x2ac16e,_0x5af8de[_0xd1e5('0x48')]);return db[_0xd1e5('0x120')]['count']({'where':_0x2ac16e[_0xd1e5('0x45')]})['then'](function(_0x32c428){_0x5cbf51['count']=_0x32c428;if(_0x5af8de[_0xd1e5('0x3c')][_0xd1e5('0x49')]){_0x2ac16e['include']=[{'all':!![]}];}else{_0x2ac16e[_0xd1e5('0x4a')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xd1e5('0x120')][_0xd1e5('0x4b')](_0x2ac16e);})[_0xd1e5('0x16')](function(_0x55e45d){_0x5cbf51[_0xd1e5('0x4c')]=_0x55e45d;return _0x5cbf51;});}})[_0xd1e5('0x16')](respondWithFilteredResult(_0x59b2d3,_0x2ac16e))[_0xd1e5('0x1f')](handleError(_0x59b2d3,null));};exports[_0xd1e5('0x121')]=function(_0x595d54,_0x5c19bb){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x595d54[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x5c19bb,null))[_0xd1e5('0x16')](function(_0x32281d){if(_0x32281d){return _0x32281d[_0xd1e5('0x121')](_0x595d54['body'][_0xd1e5('0x60')],_[_0xd1e5('0xe7')](_0x595d54[_0xd1e5('0x51')],[_0xd1e5('0x60'),'id'])||{})[_0xd1e5('0xaf')](function(_0x29cacc){for(var _0x58f3a7=0x0;_0x58f3a7<_0x595d54[_0xd1e5('0x51')]['ids']['length'];_0x58f3a7+=0x1){socket[_0xd1e5('0x122')](_0xd1e5('0x123'),{'UserId':Number(_0x595d54[_0xd1e5('0x51')][_0xd1e5('0x60')][_0x58f3a7]),'ChatWebsiteId':Number(_0x595d54[_0xd1e5('0x4e')]['id'])});}return _0x29cacc;});}})[_0xd1e5('0x16')](respondWithResult(_0x5c19bb,null))[_0xd1e5('0x1f')](handleError(_0x5c19bb,null));};exports[_0xd1e5('0x124')]=function(_0x43968d,_0x18b7c2){return db[_0xd1e5('0x34')][_0xd1e5('0x4f')]({'where':{'id':_0x43968d[_0xd1e5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18b7c2,null))[_0xd1e5('0x16')](function(_0x4e1f4){if(_0x4e1f4){return _0x4e1f4[_0xd1e5('0x124')](_0x43968d[_0xd1e5('0x3c')]['ids'])[_0xd1e5('0x16')](function(){if(_[_0xd1e5('0x125')](_0x43968d[_0xd1e5('0x3c')][_0xd1e5('0x60')])){for(var _0x486895=0x0;_0x486895<_0x43968d[_0xd1e5('0x3c')][_0xd1e5('0x60')][_0xd1e5('0x41')];_0x486895+=0x1){socket[_0xd1e5('0x122')](_0xd1e5('0x126'),{'UserId':Number(_0x43968d[_0xd1e5('0x3c')]['ids'][_0x486895]),'ChatWebsiteId':Number(_0x43968d[_0xd1e5('0x4e')]['id'])});}}else{socket['emit'](_0xd1e5('0x126'),{'UserId':Number(_0x43968d[_0xd1e5('0x3c')]['ids']),'ChatWebsiteId':Number(_0x43968d[_0xd1e5('0x4e')]['id'])});}});}})[_0xd1e5('0x16')](respondWithStatusCode(_0x18b7c2,null))['catch'](handleError(_0x18b7c2,null));};exports[_0xd1e5('0x127')]=function(_0x38d5ec,_0x172948){var _0x59fbc8={};var _0x49759a={};var _0x30e32b;var _0x3cdde4;return db['ChatWebsite'][_0xd1e5('0x5b')]({'where':{'id':_0x38d5ec[_0xd1e5('0x4e')]['id']}})[_0xd1e5('0x16')](handleEntityNotFound(_0x172948,null))[_0xd1e5('0x16')](function(_0x39fab2){if(_0x39fab2){_0x30e32b=_0x39fab2;_0x49759a['model']=_[_0xd1e5('0x3b')](db[_0xd1e5('0xea')][_0xd1e5('0x35')]);_0x49759a[_0xd1e5('0x3c')]=_[_0xd1e5('0x3b')](_0x38d5ec[_0xd1e5('0x3c')]);_0x49759a[_0xd1e5('0x3d')]=_[_0xd1e5('0x3e')](_0x49759a[_0xd1e5('0x39')],_0x49759a[_0xd1e5('0x3c')]);_0x59fbc8['attributes']=_[_0xd1e5('0x3e')](_0x49759a[_0xd1e5('0x39')],qs['fields'](_0x38d5ec[_0xd1e5('0x3c')][_0xd1e5('0x40')]));_0x59fbc8[_0xd1e5('0x3f')]=_0x59fbc8[_0xd1e5('0x3f')][_0xd1e5('0x41')]?_0x59fbc8[_0xd1e5('0x3f')]:_0x49759a['model'];_0x59fbc8[_0xd1e5('0x5c')]=qs[_0xd1e5('0x43')](_0x38d5ec[_0xd1e5('0x3c')][_0xd1e5('0x43')]);_0x59fbc8[_0xd1e5('0x45')]=qs[_0xd1e5('0x3d')](_[_0xd1e5('0x44')](_0x38d5ec['query'],_0x49759a[_0xd1e5('0x3d')]));if(_0x38d5ec[_0xd1e5('0x3c')]['filter']){_0x59fbc8[_0xd1e5('0x45')]=_[_0xd1e5('0x46')](_0x59fbc8[_0xd1e5('0x45')],{'$or':_['map'](_0x59fbc8[_0xd1e5('0x3f')],function(_0x46c8bf){var _0x455e5b={};_0x455e5b[_0x46c8bf]={'$like':'%'+_0x38d5ec['query'][_0xd1e5('0x5e')]+'%'};return _0x455e5b;})});}_0x59fbc8=_[_0xd1e5('0x46')]({},_0x59fbc8,_0x38d5ec[_0xd1e5('0x48')]);return _0x30e32b[_0xd1e5('0x127')](_0x59fbc8);}})['then'](function(_0x1f1104){if(_0x1f1104){_0x3cdde4=_0x1f1104['length'];if(!_0x38d5ec[_0xd1e5('0x3c')]['hasOwnProperty']('nolimit')){_0x59fbc8[_0xd1e5('0x25')]=qs[_0xd1e5('0x25')](_0x38d5ec[_0xd1e5('0x3c')][_0xd1e5('0x25')]);_0x59fbc8['offset']=qs[_0xd1e5('0x23')](_0x38d5ec['query'][_0xd1e5('0x23')]);}return _0x30e32b[_0xd1e5('0x127')](_0x59fbc8);}})['then'](function(_0x402de0){if(_0x402de0){return _0x402de0?{'count':_0x3cdde4,'rows':_0x402de0}:null;}})[_0xd1e5('0x16')](respondWithResult(_0x172948,null))[_0xd1e5('0x1f')](handleError(_0x172948,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 11c1e9b..d48d60c 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 _0x8e0f=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x4ab7bb,_0x290191){var _0x2624b3=function(_0x2852f2){while(--_0x2852f2){_0x4ab7bb['push'](_0x4ab7bb['shift']());}};_0x2624b3(++_0x290191);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x5741a3,_0x1258f3){_0x5741a3=_0x5741a3-0x0;var _0x4db4a0=_0x8e0f[_0x5741a3];return _0x4db4a0;};'use strict';var EventEmitter=require(_0xf8e0('0x0'));var ChatWebsite=require(_0xf8e0('0x1'))['db'][_0xf8e0('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf8e0('0x3')](0x0);var events={'afterCreate':_0xf8e0('0x4'),'afterUpdate':_0xf8e0('0x5'),'afterDestroy':_0xf8e0('0x6')};function emitEvent(_0x5e954c){return function(_0x40d121,_0x4a6acb,_0xa0826a){ChatWebsiteEvents[_0xf8e0('0x7')](_0x5e954c+':'+_0x40d121['id'],_0x40d121);ChatWebsiteEvents['emit'](_0x5e954c,_0x40d121);_0xa0826a(null);};}for(var e in events){if(events[_0xf8e0('0x8')](e)){var event=events[e];ChatWebsite[_0xf8e0('0x9')](e,emitEvent(event));}}module[_0xf8e0('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x61df=['emit','hasOwnProperty','hook','setMaxListeners','save','remove'];(function(_0x302e63,_0x2ae115){var _0x57eda1=function(_0x24c3a4){while(--_0x24c3a4){_0x302e63['push'](_0x302e63['shift']());}};_0x57eda1(++_0x2ae115);}(_0x61df,0xbd));var _0xf61d=function(_0x23ebd2,_0x1ab958){_0x23ebd2=_0x23ebd2-0x0;var _0x186752=_0x61df[_0x23ebd2];return _0x186752;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf61d('0x0')](0x0);var events={'afterCreate':_0xf61d('0x1'),'afterUpdate':'update','afterDestroy':_0xf61d('0x2')};function emitEvent(_0x380f27){return function(_0x485a55,_0x3170e7,_0x153a3c){ChatWebsiteEvents[_0xf61d('0x3')](_0x380f27+':'+_0x485a55['id'],_0x485a55);ChatWebsiteEvents[_0xf61d('0x3')](_0x380f27,_0x485a55);_0x153a3c(null);};}for(var e in events){if(events[_0xf61d('0x4')](e)){var event=events[e];ChatWebsite[_0xf61d('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 26b2253..df64daf 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 _0x440b=['define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x9f033e,_0xa9c326){var _0x467993=function(_0x42f7cb){while(--_0x42f7cb){_0x9f033e['push'](_0x9f033e['shift']());}};_0x467993(++_0xa9c326);}(_0x440b,0x18b));var _0xb440=function(_0x1e2c73,_0x12cd55){_0x1e2c73=_0x1e2c73-0x0;var _0x46f8d5=_0x440b[_0x1e2c73];return _0x46f8d5;};'use strict';var _=require(_0xb440('0x0'));var util=require(_0xb440('0x1'));var logger=require(_0xb440('0x2'))(_0xb440('0x3'));var moment=require(_0xb440('0x4'));var BPromise=require(_0xb440('0x5'));var rp=require(_0xb440('0x6'));var fs=require('fs');var path=require(_0xb440('0x7'));var rimraf=require(_0xb440('0x8'));var config=require(_0xb440('0x9'));var attributes=require('./chatWebsite.attributes');module[_0xb440('0xa')]=function(_0x2d856d,_0x16f9d3){return _0x2d856d[_0xb440('0xb')](_0xb440('0xc'),attributes,{'tableName':_0xb440('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xefc3=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','bluebird'];(function(_0x1dfee3,_0x585b79){var _0x37eb5a=function(_0x2e0628){while(--_0x2e0628){_0x1dfee3['push'](_0x1dfee3['shift']());}};_0x37eb5a(++_0x585b79);}(_0xefc3,0x171));var _0x3efc=function(_0x5075f8,_0x421862){_0x5075f8=_0x5075f8-0x0;var _0x78db03=_0xefc3[_0x5075f8];return _0x78db03;};'use strict';var _=require(_0x3efc('0x0'));var util=require(_0x3efc('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3efc('0x2'));var rp=require(_0x3efc('0x3'));var fs=require('fs');var path=require(_0x3efc('0x4'));var rimraf=require(_0x3efc('0x5'));var config=require(_0x3efc('0x6'));var attributes=require(_0x3efc('0x7'));module[_0x3efc('0x8')]=function(_0x42028a,_0x2bf6f6){return _0x42028a[_0x3efc('0x9')](_0x3efc('0xa'),attributes,{'tableName':_0x3efc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 0104292..3a1150a 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 _0xfc57=['info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then'];(function(_0x3f591e,_0xe02469){var _0x41d0c6=function(_0x112622){while(--_0x112622){_0x3f591e['push'](_0x3f591e['shift']());}};_0x41d0c6(++_0xe02469);}(_0xfc57,0xe2));var _0x7fc5=function(_0x22a648,_0x5e884e){_0x22a648=_0x22a648-0x0;var _0x4c0b91=_0xfc57[_0x22a648];return _0x4c0b91;};'use strict';var _=require('lodash');var util=require(_0x7fc5('0x0'));var moment=require(_0x7fc5('0x1'));var BPromise=require(_0x7fc5('0x2'));var rs=require(_0x7fc5('0x3'));var fs=require('fs');var Redis=require(_0x7fc5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7fc5('0x5'));var logger=require(_0x7fc5('0x6'))(_0x7fc5('0x7'));var config=require('../../config/environment');var jayson=require(_0x7fc5('0x8'));var client=jayson[_0x7fc5('0x9')][_0x7fc5('0xa')]({'port':0x232a});config[_0x7fc5('0xb')]=_[_0x7fc5('0xc')](config[_0x7fc5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7fc5('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x7fc5('0xe')](socket);function respondWithRpcPromise(_0xf3d595,_0x11b01b,_0x498d63){return new BPromise(function(_0x6e5da0,_0x305b6c){return client[_0x7fc5('0xf')](_0xf3d595,_0x498d63)[_0x7fc5('0x10')](function(_0x12dbb5){logger[_0x7fc5('0x11')](_0x7fc5('0x12'),_0x11b01b,_0x7fc5('0x13'));logger[_0x7fc5('0x14')](_0x7fc5('0x15'),_0x11b01b,_0x7fc5('0x13'),JSON[_0x7fc5('0x16')](_0x12dbb5));if(_0x12dbb5['error']){if(_0x12dbb5['error'][_0x7fc5('0x17')]===0x1f4){logger['error'](_0x7fc5('0x12'),_0x11b01b,_0x12dbb5[_0x7fc5('0x18')]['message']);return _0x305b6c(_0x12dbb5[_0x7fc5('0x18')]['message']);}logger[_0x7fc5('0x18')](_0x7fc5('0x12'),_0x11b01b,_0x12dbb5[_0x7fc5('0x18')][_0x7fc5('0x19')]);return _0x6e5da0(_0x12dbb5[_0x7fc5('0x18')][_0x7fc5('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x11b01b,_0x7fc5('0x13'));_0x6e5da0(_0x12dbb5[_0x7fc5('0x1a')][_0x7fc5('0x19')]);}})['catch'](function(_0x10ac83){logger[_0x7fc5('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x11b01b,_0x10ac83);_0x305b6c(_0x10ac83);});});}
\ No newline at end of file
+var _0xd99a=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./chatWebsite.socket','register','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x3d4052,_0x502cfb){var _0x45dcd2=function(_0x1d948e){while(--_0x1d948e){_0x3d4052['push'](_0x3d4052['shift']());}};_0x45dcd2(++_0x502cfb);}(_0xd99a,0xdc));var _0xad99=function(_0x399ec8,_0xae6c1b){_0x399ec8=_0x399ec8-0x0;var _0xbd731c=_0xd99a[_0x399ec8];return _0xbd731c;};'use strict';var _=require(_0xad99('0x0'));var util=require(_0xad99('0x1'));var moment=require(_0xad99('0x2'));var BPromise=require(_0xad99('0x3'));var rs=require(_0xad99('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad99('0x5'))['db'];var utils=require(_0xad99('0x6'));var logger=require(_0xad99('0x7'))('rpc');var config=require(_0xad99('0x8'));var jayson=require(_0xad99('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xad99('0xa')]=_[_0xad99('0xb')](config[_0xad99('0xa')],{'host':_0xad99('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad99('0xa')]));require(_0xad99('0xd'))[_0xad99('0xe')](socket);function respondWithRpcPromise(_0x56775f,_0x1439c5,_0x4718b7){return new BPromise(function(_0x1a2f21,_0x23bf63){return client['request'](_0x56775f,_0x4718b7)['then'](function(_0x45100a){logger['info'](_0xad99('0xf'),_0x1439c5,'request\x20sent');logger[_0xad99('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1439c5,_0xad99('0x11'),JSON[_0xad99('0x12')](_0x45100a));if(_0x45100a['error']){if(_0x45100a[_0xad99('0x13')][_0xad99('0x14')]===0x1f4){logger[_0xad99('0x13')](_0xad99('0xf'),_0x1439c5,_0x45100a[_0xad99('0x13')][_0xad99('0x15')]);return _0x23bf63(_0x45100a[_0xad99('0x13')][_0xad99('0x15')]);}logger[_0xad99('0x13')](_0xad99('0xf'),_0x1439c5,_0x45100a[_0xad99('0x13')]['message']);return _0x1a2f21(_0x45100a['error'][_0xad99('0x15')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1439c5,_0xad99('0x11'));_0x1a2f21(_0x45100a[_0xad99('0x16')]['message']);}})[_0xad99('0x17')](function(_0x1455f2){logger[_0xad99('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x1439c5,_0x1455f2);_0x23bf63(_0x1455f2);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index f129a41..b3141ae 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 _0x25b0=['save','remove','update','emit','removeListener','register','length','chatWebsite:'];(function(_0x309381,_0x336fa7){var _0x11f429=function(_0x206cdf){while(--_0x206cdf){_0x309381['push'](_0x309381['shift']());}};_0x11f429(++_0x336fa7);}(_0x25b0,0x170));var _0x025b=function(_0x22e056,_0x2cc7bd){_0x22e056=_0x22e056-0x0;var _0x20d872=_0x25b0[_0x22e056];return _0x20d872;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x025b('0x0'),_0x025b('0x1'),_0x025b('0x2')];function createListener(_0x3be0a0,_0x2fd3fb){return function(_0x4b270f){_0x2fd3fb[_0x025b('0x3')](_0x3be0a0,_0x4b270f);};}function removeListener(_0x2c6c59,_0x438af9){return function(){ChatWebsiteEvents[_0x025b('0x4')](_0x2c6c59,_0x438af9);};}exports[_0x025b('0x5')]=function(_0x2af29a){for(var _0x1da0fb=0x0,_0x4d6eef=events[_0x025b('0x6')];_0x1da0fb<_0x4d6eef;_0x1da0fb++){var _0x4b3877=events[_0x1da0fb];var _0x5bd27f=createListener(_0x025b('0x7')+_0x4b3877,_0x2af29a);ChatWebsiteEvents['on'](_0x4b3877,_0x5bd27f);}};
\ No newline at end of file
+var _0xd890=['register','length','./chatWebsite.events','save','emit','removeListener'];(function(_0x302dd0,_0x46d210){var _0x3cb00f=function(_0x44f775){while(--_0x44f775){_0x302dd0['push'](_0x302dd0['shift']());}};_0x3cb00f(++_0x46d210);}(_0xd890,0x1ac));var _0x0d89=function(_0x2dbce7,_0x57cb8d){_0x2dbce7=_0x2dbce7-0x0;var _0x3a3ed0=_0xd890[_0x2dbce7];return _0x3a3ed0;};'use strict';var ChatWebsiteEvents=require(_0x0d89('0x0'));var events=[_0x0d89('0x1'),'remove','update'];function createListener(_0x42bf76,_0x1fcd6e){return function(_0x344d6f){_0x1fcd6e[_0x0d89('0x2')](_0x42bf76,_0x344d6f);};}function removeListener(_0xd2e389,_0x37f27d){return function(){ChatWebsiteEvents[_0x0d89('0x3')](_0xd2e389,_0x37f27d);};}exports[_0x0d89('0x4')]=function(_0x2ea564){for(var _0xbe8a2d=0x0,_0x25ce65=events[_0x0d89('0x5')];_0xbe8a2d<_0x25ce65;_0xbe8a2d++){var _0x19a9d7=events[_0xbe8a2d];var _0x443ca5=createListener('chatWebsite:'+_0x19a9d7,_0x2ea564);ChatWebsiteEvents['on'](_0x19a9d7,_0x443ca5);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index b7c94e9..b18f497 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 _0x40e8=['/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addAnswer','join','root','server/files/images/logos/','format','originalname','single','file','addLogo','diskStorage','now','addAvatar','server/files/images/avatars/','%s-%s','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x40e8,0x74));var _0x840e=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x40e8[_0x4067ac];return _0x53d74d;};'use strict';var multer=require(_0x840e('0x0'));var util=require('util');var path=require(_0x840e('0x1'));var timeout=require(_0x840e('0x2'));var express=require(_0x840e('0x3'));var router=express[_0x840e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x840e('0x5'));var interaction=require(_0x840e('0x6'));var config=require(_0x840e('0x7'));var controller=require('./chatWebsite.controller');router[_0x840e('0x8')]('/',auth[_0x840e('0x9')](),controller[_0x840e('0xa')]);router[_0x840e('0x8')]('/describe',auth[_0x840e('0x9')](),controller[_0x840e('0xb')]);router[_0x840e('0x8')](_0x840e('0xc'),auth['isAuthenticated'](),controller[_0x840e('0xd')]);router['get'](_0x840e('0xe'),auth[_0x840e('0x9')](),controller[_0x840e('0xf')]);router['get'](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x11')]);router[_0x840e('0x8')](_0x840e('0x12'),controller['getLogo']);router['get'](_0x840e('0x13'),controller[_0x840e('0x14')]);router[_0x840e('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x840e('0x8')](_0x840e('0x15'),controller['getSystemAvatar']);router[_0x840e('0x8')](_0x840e('0x16'),auth[_0x840e('0x9')](),controller[_0x840e('0x17')]);router[_0x840e('0x8')](_0x840e('0x18'),controller[_0x840e('0x19')]);router[_0x840e('0x8')](_0x840e('0x1a'),auth[_0x840e('0x9')](),controller[_0x840e('0x1b')]);router['get'](_0x840e('0x1c'),auth[_0x840e('0x9')](),controller[_0x840e('0x1d')]);router[_0x840e('0x8')](_0x840e('0x1e'),controller[_0x840e('0x1f')]);router[_0x840e('0x8')](_0x840e('0x20'),auth['isAuthenticated'](),controller[_0x840e('0x21')]);router[_0x840e('0x8')](_0x840e('0x22'),auth['isAuthenticated'](),controller[_0x840e('0x23')]);router['post']('/',auth[_0x840e('0x9')](),controller[_0x840e('0x24')]);router[_0x840e('0x25')]('/:id/dispositions',auth[_0x840e('0x9')](),controller['addDisposition']);router[_0x840e('0x25')](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x159950,_0x342627,_0x1ea2e0){_0x1ea2e0(null,path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x29')));},'filename':function(_0x1c7b75,_0x1f5b1f,_0x2fc83e){_0x2fc83e(null,util[_0x840e('0x2a')]('%s-%s',Date['now'](),_0x1f5b1f[_0x840e('0x2b')]));}})});router['post']('/:id/logo',upload[_0x840e('0x2c')](_0x840e('0x2d')),controller[_0x840e('0x2e')]);var upload=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x590d2d,_0x3daf29,_0x54005a){_0x54005a(null,path[_0x840e('0x27')](config[_0x840e('0x28')],'server/files/images/avatars/'));},'filename':function(_0x45968a,_0x3f48f9,_0xbf6eb1){_0xbf6eb1(null,util[_0x840e('0x2a')]('%s-%s',Date[_0x840e('0x30')](),_0x3f48f9['originalname']));}})});router[_0x840e('0x25')]('/:id/avatar',upload['single'](_0x840e('0x2d')),controller[_0x840e('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25d594,_0x1203c5,_0x587b65){_0x587b65(null,path['join'](config[_0x840e('0x28')],_0x840e('0x32')));},'filename':function(_0x2f94d2,_0x3dee4a,_0x333f2d){_0x333f2d(null,util['format'](_0x840e('0x33'),Date[_0x840e('0x30')](),_0x3dee4a[_0x840e('0x2b')]));}})});router[_0x840e('0x25')](_0x840e('0x34'),upload['single'](_0x840e('0x2d')),controller[_0x840e('0x35')]);var upload=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x269015,_0x5a8d81,_0x28fddd){_0x28fddd(null,path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x32')));},'filename':function(_0x432350,_0x3e5608,_0x4412bb){_0x4412bb(null,util['format']('%s-%s',Date[_0x840e('0x30')](),_0x3e5608[_0x840e('0x2b')]));}})});router[_0x840e('0x25')](_0x840e('0x15'),upload['single']('file'),controller[_0x840e('0x36')]);router[_0x840e('0x25')]('/:id/notify',controller[_0x840e('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x840e('0x2f')]({'destination':function(_0x1e6af7,_0x341d02,_0x49b338){const _0x5bad33=path[_0x840e('0x27')](config[_0x840e('0x28')],_0x840e('0x38'),_0x840e('0x39'),'offline-chat');fs_extra[_0x840e('0x3a')](_0x5bad33,function(){_0x49b338(null,_0x5bad33);});},'filename':function(_0x22878f,_0x31e91d,_0x3cbc98){const _0xe1136c=_0x31e91d[_0x840e('0x2b')][_0x840e('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xb08292=path['extname'](_0xe1136c);const _0x193c9c=Date[_0x840e('0x30')]()+'-'+_0xe1136c[_0x840e('0x3b')](_0xb08292,'')+_0xb08292;_0x3cbc98(null,_0x193c9c);}})});router[_0x840e('0x25')](_0x840e('0x3c'),offlineUploadMulter[_0x840e('0x3d')](),controller[_0x840e('0x3e')]);router[_0x840e('0x25')](_0x840e('0x16'),auth['isAuthenticated'](),controller[_0x840e('0x3f')]);router[_0x840e('0x25')](_0x840e('0x1a'),auth[_0x840e('0x9')](),controller[_0x840e('0x40')]);router['post']('/:id/proactive_actions',auth[_0x840e('0x9')](),controller[_0x840e('0x41')]);router[_0x840e('0x25')]('/:id/users',auth[_0x840e('0x9')](),controller[_0x840e('0x42')]);router[_0x840e('0x43')](_0x840e('0xc'),auth[_0x840e('0x9')](),controller[_0x840e('0x44')]);router[_0x840e('0x45')](_0x840e('0xc'),auth['isAuthenticated'](),controller[_0x840e('0x46')]);router[_0x840e('0x45')]('/:id/dispositions',auth[_0x840e('0x9')](),controller[_0x840e('0x47')]);router[_0x840e('0x45')](_0x840e('0x10'),auth[_0x840e('0x9')](),controller[_0x840e('0x48')]);router[_0x840e('0x45')](_0x840e('0x22'),auth[_0x840e('0x9')](),controller[_0x840e('0x49')]);module['exports']=router;
\ No newline at end of file
+var _0xd178=['notify','server/files','offline-chat','extname','replace','/:id/offline','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','update','delete','destroy','removeDispositions','multer','path','Router','fs-extra','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','/:id/avatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd178,0xd8));var _0x8d17=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xd178[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x8d17('0x0'));var util=require('util');var path=require(_0x8d17('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d17('0x2')]();var fs_extra=require(_0x8d17('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8d17('0x4'));var controller=require(_0x8d17('0x5'));router[_0x8d17('0x6')]('/',auth[_0x8d17('0x7')](),controller[_0x8d17('0x8')]);router[_0x8d17('0x6')](_0x8d17('0x9'),auth[_0x8d17('0x7')](),controller[_0x8d17('0xa')]);router[_0x8d17('0x6')](_0x8d17('0xb'),auth[_0x8d17('0x7')](),controller[_0x8d17('0xc')]);router[_0x8d17('0x6')]('/:id/dispositions',auth[_0x8d17('0x7')](),controller[_0x8d17('0xd')]);router[_0x8d17('0x6')](_0x8d17('0xe'),auth[_0x8d17('0x7')](),controller[_0x8d17('0xf')]);router[_0x8d17('0x6')]('/:id/logo',controller[_0x8d17('0x10')]);router['get']('/:id/avatar',controller[_0x8d17('0x11')]);router[_0x8d17('0x6')](_0x8d17('0x12'),controller[_0x8d17('0x13')]);router[_0x8d17('0x6')]('/:id/system_avatar',controller[_0x8d17('0x14')]);router[_0x8d17('0x6')]('/:id/interactions',auth[_0x8d17('0x7')](),controller['getInteractions']);router[_0x8d17('0x6')](_0x8d17('0x15'),controller['getSnippet']);router['get'](_0x8d17('0x16'),auth['isAuthenticated'](),controller[_0x8d17('0x17')]);router[_0x8d17('0x6')](_0x8d17('0x18'),auth['isAuthenticated'](),controller[_0x8d17('0x19')]);router[_0x8d17('0x6')](_0x8d17('0x1a'),controller[_0x8d17('0x1b')]);router['get'](_0x8d17('0x1c'),auth[_0x8d17('0x7')](),controller['getOfflineMessages']);router[_0x8d17('0x6')](_0x8d17('0x1d'),auth['isAuthenticated'](),controller[_0x8d17('0x1e')]);router[_0x8d17('0x1f')]('/',auth[_0x8d17('0x7')](),controller[_0x8d17('0x20')]);router[_0x8d17('0x1f')](_0x8d17('0x21'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x22')]);router['post']('/:id/canned_answers',auth[_0x8d17('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x8d17('0x23')]({'destination':function(_0xe68622,_0x5353cf,_0x2205d7){_0x2205d7(null,path[_0x8d17('0x24')](config[_0x8d17('0x25')],_0x8d17('0x26')));},'filename':function(_0x144c8b,_0x3cb8d9,_0x5d2420){_0x5d2420(null,util[_0x8d17('0x27')](_0x8d17('0x28'),Date[_0x8d17('0x29')](),_0x3cb8d9[_0x8d17('0x2a')]));}})});router['post'](_0x8d17('0x2b'),upload[_0x8d17('0x2c')](_0x8d17('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x323a33,_0x2959b1,_0x1699c1){_0x1699c1(null,path[_0x8d17('0x24')](config['root'],_0x8d17('0x2e')));},'filename':function(_0x59b7a1,_0x2b30a3,_0x57f03b){_0x57f03b(null,util[_0x8d17('0x27')](_0x8d17('0x28'),Date['now'](),_0x2b30a3[_0x8d17('0x2a')]));}})});router[_0x8d17('0x1f')](_0x8d17('0x2f'),upload[_0x8d17('0x2c')](_0x8d17('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f5ec9,_0x16a15f,_0x3d96a0){_0x3d96a0(null,path[_0x8d17('0x24')](config[_0x8d17('0x25')],_0x8d17('0x2e')));},'filename':function(_0x260625,_0x4c8ee2,_0x30296f){_0x30296f(null,util[_0x8d17('0x27')](_0x8d17('0x28'),Date['now'](),_0x4c8ee2['originalname']));}})});router[_0x8d17('0x1f')]('/:id/customer_avatar',upload[_0x8d17('0x2c')]('file'),controller[_0x8d17('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c4a1c,_0x460173,_0x2e4c8a){_0x2e4c8a(null,path[_0x8d17('0x24')](config['root'],_0x8d17('0x2e')));},'filename':function(_0x58e745,_0x18ea69,_0x59e605){_0x59e605(null,util[_0x8d17('0x27')](_0x8d17('0x28'),Date['now'](),_0x18ea69['originalname']));}})});router[_0x8d17('0x1f')](_0x8d17('0x31'),upload[_0x8d17('0x2c')](_0x8d17('0x2d')),controller[_0x8d17('0x32')]);router[_0x8d17('0x1f')](_0x8d17('0x33'),controller[_0x8d17('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x8d17('0x23')]({'destination':function(_0x1c542d,_0x44215c,_0x1d1552){const _0x5de3e9=path[_0x8d17('0x24')](config[_0x8d17('0x25')],_0x8d17('0x35'),'attachments',_0x8d17('0x36'));fs_extra['ensureDir'](_0x5de3e9,function(){_0x1d1552(null,_0x5de3e9);});},'filename':function(_0x14542e,_0x453053,_0x5e1ded){const _0x57fdb8=_0x453053[_0x8d17('0x2a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x210c0f=path[_0x8d17('0x37')](_0x57fdb8);const _0x38413f=Date[_0x8d17('0x29')]()+'-'+_0x57fdb8[_0x8d17('0x38')](_0x210c0f,'')+_0x210c0f;_0x5e1ded(null,_0x38413f);}})});router[_0x8d17('0x1f')](_0x8d17('0x39'),offlineUploadMulter['any'](),controller[_0x8d17('0x3a')]);router['post'](_0x8d17('0x3b'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x3c')]);router[_0x8d17('0x1f')](_0x8d17('0x16'),auth[_0x8d17('0x7')](),controller['addApplications']);router[_0x8d17('0x1f')](_0x8d17('0x18'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x3d')]);router[_0x8d17('0x1f')](_0x8d17('0x1d'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x3e')]);router['put'](_0x8d17('0xb'),auth[_0x8d17('0x7')](),controller[_0x8d17('0x3f')]);router[_0x8d17('0x40')](_0x8d17('0xb'),auth['isAuthenticated'](),controller[_0x8d17('0x41')]);router[_0x8d17('0x40')](_0x8d17('0x21'),auth['isAuthenticated'](),controller[_0x8d17('0x42')]);router[_0x8d17('0x40')](_0x8d17('0xe'),auth[_0x8d17('0x7')](),controller['removeAnswers']);router[_0x8d17('0x40')](_0x8d17('0x1d'),auth[_0x8d17('0x7')](),controller['removeAgents']);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 c934aec..f2d0070 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 _0x55e8=['use','isAuthenticated','../config/environment','Router','env','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55e8,0xe9));var _0x855e=function(_0x50849b,_0x4fe986){_0x50849b=_0x50849b-0x0;var _0x3c5f2a=_0x55e8[_0x50849b];return _0x3c5f2a;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require('../components/auth/service');var config=require(_0x855e('0x0'));var router=express[_0x855e('0x1')]();var isProduction=config[_0x855e('0x2')]===_0x855e('0x3')||![];function clientSideLogs(_0x107649,_0x3e8802,_0x4d590f){var _0x4687e9=_0x107649[_0x855e('0x4')]['get'](_0x855e('0x5'));if(!_0x4687e9){throw new Error(_0x855e('0x6'));}return beaverLogger[_0x855e('0x7')]({'uri':_0x855e('0x8'),'logger':_0x4687e9,'enableCors':!isProduction})(_0x107649,_0x3e8802,_0x4d590f);}router[_0x855e('0x9')](auth[_0x855e('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0xa2ef=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','express','../components/auth/service','Router','env','production','app'];(function(_0x1ba256,_0x4d67c1){var _0x3254b0=function(_0x3e8588){while(--_0x3e8588){_0x1ba256['push'](_0x1ba256['shift']());}};_0x3254b0(++_0x4d67c1);}(_0xa2ef,0x13f));var _0xfa2e=function(_0x23089d,_0x1ac088){_0x23089d=_0x23089d-0x0;var _0x5a0868=_0xa2ef[_0x23089d];return _0x5a0868;};var beaverLogger=require('beaver-logger/server');var express=require(_0xfa2e('0x0'));var auth=require(_0xfa2e('0x1'));var config=require('../config/environment');var router=express[_0xfa2e('0x2')]();var isProduction=config[_0xfa2e('0x3')]===_0xfa2e('0x4')||![];function clientSideLogs(_0x450d35,_0x5e989c,_0x1dcc49){var _0x26f05c=_0x450d35[_0xfa2e('0x5')][_0xfa2e('0x6')](_0xfa2e('0x7'));if(!_0x26f05c){throw new Error(_0xfa2e('0x8'));}return beaverLogger[_0xfa2e('0x9')]({'uri':_0xfa2e('0xa'),'logger':_0x26f05c,'enableCors':!isProduction})(_0x450d35,_0x5e989c,_0x1dcc49);}router['use'](auth[_0xfa2e('0xb')](),clientSideLogs);module[_0xfa2e('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 02fdab3..92ebf7d 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 _0x54b2=['STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0xd911fc,_0x34372f){var _0x531b21=function(_0x23efca){while(--_0x23efca){_0xd911fc['push'](_0xd911fc['shift']());}};_0x531b21(++_0x34372f);}(_0x54b2,0xa6));var _0x254b=function(_0x4add46,_0x40c151){_0x4add46=_0x4add46-0x0;var _0x13fe3d=_0x54b2[_0x4add46];return _0x13fe3d;};'use strict';var Sequelize=require(_0x254b('0x0'));module[_0x254b('0x1')]={'name':{'type':Sequelize[_0x254b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x254b('0x3')](_0x254b('0x4'),_0x254b('0x5'),_0x254b('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x254b('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0x8')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0x9')},'data4':{'type':Sequelize[_0x254b('0x2')],'comment':_0x254b('0xa')},'data5':{'type':Sequelize[_0x254b('0xb')],'comment':_0x254b('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x254b('0xb')],'comment':_0x254b('0xd')}};
\ No newline at end of file
+var _0xa6fa=['exports','STRING','AmazonAWS','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize'];(function(_0x1f5b9e,_0x4331e6){var _0x5947b0=function(_0x398b18){while(--_0x398b18){_0x1f5b9e['push'](_0x1f5b9e['shift']());}};_0x5947b0(++_0x4331e6);}(_0xa6fa,0x81));var _0xaa6f=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xa6fa[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xaa6f('0x0'));module[_0xaa6f('0x1')]={'name':{'type':Sequelize[_0xaa6f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xaa6f('0x3'),'Google','MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xaa6f('0x4')]('Outlook365',_0xaa6f('0x5'))},'data1':{'type':Sequelize[_0xaa6f('0x2')],'comment':_0xaa6f('0x6')},'data2':{'type':Sequelize[_0xaa6f('0x2')],'comment':_0xaa6f('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0xaa6f('0x8')},'data4':{'type':Sequelize[_0xaa6f('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xaa6f('0x9')],'comment':_0xaa6f('0xa')},'data6':{'type':Sequelize[_0xaa6f('0x9')],'comment':_0xaa6f('0xb')},'data7':{'type':Sequelize[_0xaa6f('0x9')],'comment':_0xaa6f('0xc')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 5a87b87..e91b52c 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 _0x91f3=['filter','merge','VIRTUAL','options','where','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','find','create','Service\x20parameter\x20not\x20specified','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','catch','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','id_token','Unable\x20to\x20validate\x20id_token','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','limit','count','set','Content-Range','json','update','destroy','then','error','stack','send','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0x91f3,0x13c));var _0x391f=function(_0x598efc,_0x5e971c){_0x598efc=_0x598efc-0x0;var _0x435e4f=_0x91f3[_0x598efc];return _0x435e4f;};'use strict';var _=require(_0x391f('0x0'));var Redis=require(_0x391f('0x1'));var qs=require(_0x391f('0x2'));var encryptor=require(_0x391f('0x3'));var config=require(_0x391f('0x4'));var logger=require(_0x391f('0x5'))('api');var db=require(_0x391f('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x391f('0x7')]=_['defaults'](config[_0x391f('0x7')],{'host':_0x391f('0x8'),'port':0x18eb});var socket=require(_0x391f('0x9'))(new Redis(config['redis']));var redis=new Redis(config[_0x391f('0x7')]);function respondWithStatusCode(_0x20f60e,_0x32b3bc){_0x32b3bc=_0x32b3bc||0xcc;return function(_0xc568d8){if(_0xc568d8){return _0x20f60e[_0x391f('0xa')](_0x32b3bc);}return _0x20f60e[_0x391f('0xb')](_0x32b3bc)[_0x391f('0xc')]();};}function respondWithResult(_0x3871dd,_0x51bd71){_0x51bd71=_0x51bd71||0xc8;return function(_0x56b8db){if(_0x56b8db){return _0x3871dd['status'](_0x51bd71)['json'](_0x56b8db);}};}function respondWithFilteredResult(_0x59c2e1,_0x479452){return function(_0x57ab95){if(_0x57ab95){var _0x20d0db=typeof _0x479452[_0x391f('0xd')]==='undefined'&&typeof _0x479452[_0x391f('0xe')]==='undefined';var _0x1c93d3=_0x57ab95[_0x391f('0xf')];var _0x673393=_0x20d0db?0x0:_0x479452[_0x391f('0xd')];var _0x30589a=_0x20d0db?_0x57ab95[_0x391f('0xf')]:_0x479452['offset']+_0x479452[_0x391f('0xe')];var _0x1a8891;if(_0x30589a>=_0x1c93d3){_0x30589a=_0x1c93d3;_0x1a8891=0xc8;}else{_0x1a8891=0xce;}_0x59c2e1[_0x391f('0xb')](_0x1a8891);return _0x59c2e1[_0x391f('0x10')](_0x391f('0x11'),_0x673393+'-'+_0x30589a+'/'+_0x1c93d3)[_0x391f('0x12')](_0x57ab95);}return null;};}function saveUpdates(_0x4d17f3){return function(_0xaa9a80){if(_0xaa9a80){return _0xaa9a80[_0x391f('0x13')](_0x4d17f3)['then'](function(_0xe45580){return _0xe45580;});}return null;};}function removeEntity(_0x788a3){return function(_0x19f5aa){if(_0x19f5aa){return _0x19f5aa[_0x391f('0x14')]()[_0x391f('0x15')](function(){_0x788a3[_0x391f('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40c522){return function(_0x5322f0){if(!_0x5322f0){_0x40c522[_0x391f('0xa')](0x194);}return _0x5322f0;};}function handleError(_0x3ddd2b,_0x5e0d95){_0x5e0d95=_0x5e0d95||0x1f4;return function(_0xb3a4c9){logger[_0x391f('0x16')](_0xb3a4c9[_0x391f('0x17')]);if(_0xb3a4c9['name']){delete _0xb3a4c9['name'];}_0x3ddd2b[_0x391f('0xb')](_0x5e0d95)[_0x391f('0x18')](_0xb3a4c9);};}function maskClientSecret(_0x428f32){return _['padEnd'](_0x428f32['slice'](0x0,0x3),0x14,'*');}exports[_0x391f('0x19')]=function(_0x5d179b,_0x57e96a){var _0x565699={},_0xfcadec={},_0xc6622e={'count':0x0,'rows':[]};var _0x713a07=_[_0x391f('0x1a')](db[_0x391f('0x1b')][_0x391f('0x1c')],function(_0x1f87c9){return{'name':_0x1f87c9[_0x391f('0x1d')],'type':_0x1f87c9[_0x391f('0x1e')][_0x391f('0x1f')]};});_0xfcadec[_0x391f('0x20')]=_[_0x391f('0x1a')](_0x713a07,_0x391f('0x21'));_0xfcadec[_0x391f('0x22')]=_[_0x391f('0x23')](_0x5d179b[_0x391f('0x22')]);_0xfcadec[_0x391f('0x24')]=_[_0x391f('0x25')](_0xfcadec['model'],_0xfcadec[_0x391f('0x22')]);_0x565699[_0x391f('0x26')]=_[_0x391f('0x25')](_0xfcadec[_0x391f('0x20')],qs[_0x391f('0x27')](_0x5d179b[_0x391f('0x22')][_0x391f('0x27')]));_0x565699[_0x391f('0x26')]=_0x565699[_0x391f('0x26')][_0x391f('0x28')]?_0x565699[_0x391f('0x26')]:_0xfcadec['model'];if(!_0x5d179b['query']['hasOwnProperty'](_0x391f('0x29'))){_0x565699[_0x391f('0xe')]=qs[_0x391f('0xe')](_0x5d179b['query'][_0x391f('0xe')]);_0x565699[_0x391f('0xd')]=qs[_0x391f('0xd')](_0x5d179b[_0x391f('0x22')]['offset']);}_0x565699[_0x391f('0x2a')]=qs[_0x391f('0x2b')](_0x5d179b[_0x391f('0x22')][_0x391f('0x2b')]);_0x565699['where']=qs[_0x391f('0x24')](_['pick'](_0x5d179b[_0x391f('0x22')],_0xfcadec[_0x391f('0x24')]),_0x713a07);if(_0x5d179b[_0x391f('0x22')][_0x391f('0x2c')]){_0x565699['where']=_[_0x391f('0x2d')](_0x565699['where'],{'$or':_[_0x391f('0x1a')](_0x713a07,function(_0x50721a){if(_0x50721a['type']!==_0x391f('0x2e')){var _0x44295f={};_0x44295f[_0x50721a['name']]={'$like':'%'+_0x5d179b[_0x391f('0x22')][_0x391f('0x2c')]+'%'};return _0x44295f;}})});}_0x565699=_[_0x391f('0x2d')]({},_0x565699,_0x5d179b[_0x391f('0x2f')]);var _0x591564={'where':_0x565699[_0x391f('0x30')]};return db[_0x391f('0x1b')][_0x391f('0xf')](_0x591564)['then'](function(_0x4ed686){_0xc6622e[_0x391f('0xf')]=_0x4ed686;if(_0x5d179b[_0x391f('0x22')][_0x391f('0x31')]){_0x565699['include']=[{'all':!![]}];}return db[_0x391f('0x1b')][_0x391f('0x32')](_0x565699);})[_0x391f('0x15')](function(_0x2cd325){_0xc6622e[_0x391f('0x33')]=_[_0x391f('0x1a')](_0x2cd325,function(_0x449ba9){if(_0x449ba9[_0x391f('0x34')]===_0x391f('0x35')){var _0x2a75d1=encryptor[_0x391f('0x36')](_0x449ba9['data3']);_0x449ba9[_0x391f('0x37')]=maskClientSecret(_0x2a75d1);}return _0x449ba9;});return _0xc6622e;})[_0x391f('0x15')](respondWithFilteredResult(_0x57e96a,_0x565699))['catch'](handleError(_0x57e96a,null));};exports[_0x391f('0x38')]=function(_0x5c883e,_0x5cd244){var _0x43a6f9={'raw':!![],'where':{'id':_0x5c883e[_0x391f('0x39')]['id']}},_0x553006={};_0x553006[_0x391f('0x20')]=_[_0x391f('0x23')](db[_0x391f('0x1b')][_0x391f('0x1c')]);_0x553006['query']=_[_0x391f('0x23')](_0x5c883e[_0x391f('0x22')]);_0x553006[_0x391f('0x24')]=_['intersection'](_0x553006['model'],_0x553006[_0x391f('0x22')]);_0x43a6f9[_0x391f('0x26')]=_[_0x391f('0x25')](_0x553006[_0x391f('0x20')],qs[_0x391f('0x27')](_0x5c883e[_0x391f('0x22')][_0x391f('0x27')]));_0x43a6f9['attributes']=_0x43a6f9['attributes'][_0x391f('0x28')]?_0x43a6f9[_0x391f('0x26')]:_0x553006[_0x391f('0x20')];if(_0x5c883e[_0x391f('0x22')]['includeAll']){_0x43a6f9['include']=[{'all':!![]}];}_0x43a6f9=_[_0x391f('0x2d')]({},_0x43a6f9,_0x5c883e['options']);return db[_0x391f('0x1b')][_0x391f('0x3a')](_0x43a6f9)[_0x391f('0x15')](handleEntityNotFound(_0x5cd244,null))[_0x391f('0x15')](function(_0x1f9ae4){if(_0x1f9ae4[_0x391f('0x34')]===_0x391f('0x35')){var _0x20c4d3=encryptor[_0x391f('0x36')](_0x1f9ae4[_0x391f('0x37')]);_0x1f9ae4[_0x391f('0x37')]=maskClientSecret(_0x20c4d3);}return _0x1f9ae4;})[_0x391f('0x15')](respondWithResult(_0x5cd244,null))['catch'](handleError(_0x5cd244,null));};exports[_0x391f('0x3b')]=function(_0x352d2c,_0x541ba3){if(!_0x352d2c['body'][_0x391f('0x21')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x352d2c['body'][_0x391f('0x34')])throw new Error(_0x391f('0x3c'));var _0xeff2ec=db[_0x391f('0x1b')]['rawAttributes'][_0x391f('0x34')]['values'];if(!_0xeff2ec['includes'](_0x352d2c[_0x391f('0x3d')][_0x391f('0x34')]))throw new Error(_0x391f('0x3e')+_0xeff2ec[_0x391f('0x3f')](',\x20'));if(_0x352d2c[_0x391f('0x3d')][_0x391f('0x34')]===_0x391f('0x35')&&_0x352d2c[_0x391f('0x3d')][_0x391f('0x37')]){_0x352d2c['body'][_0x391f('0x37')]=encryptor['encryptString'](_0x352d2c[_0x391f('0x3d')][_0x391f('0x37')]);}return db[_0x391f('0x1b')][_0x391f('0x3b')](_0x352d2c[_0x391f('0x3d')],{})[_0x391f('0x15')](respondWithResult(_0x541ba3,0xc9))[_0x391f('0x40')](handleError(_0x541ba3,null));};exports[_0x391f('0x13')]=function(_0x1d7bc4,_0x19b9cd){if(_0x1d7bc4[_0x391f('0x3d')]['id']){delete _0x1d7bc4['body']['id'];}return db[_0x391f('0x1b')][_0x391f('0x3a')]({'where':{'id':_0x1d7bc4['params']['id']}})[_0x391f('0x15')](handleEntityNotFound(_0x19b9cd,null))[_0x391f('0x15')](function(_0x255775){if(_0x255775[_0x391f('0x34')]===_0x391f('0x35')&&_0x1d7bc4[_0x391f('0x3d')][_0x391f('0x37')]){_0x1d7bc4[_0x391f('0x3d')][_0x391f('0x37')]=encryptor[_0x391f('0x41')](_0x1d7bc4[_0x391f('0x3d')]['data3']);}return _0x255775;})[_0x391f('0x15')](saveUpdates(_0x1d7bc4[_0x391f('0x3d')],null))[_0x391f('0x15')](respondWithResult(_0x19b9cd,null))[_0x391f('0x40')](handleError(_0x19b9cd,null));};exports[_0x391f('0x14')]=function(_0x3a345e,_0x51613c){return db[_0x391f('0x1b')][_0x391f('0x3a')]({'where':{'id':_0x3a345e[_0x391f('0x39')]['id']}})[_0x391f('0x15')](handleEntityNotFound(_0x51613c,null))[_0x391f('0x15')](removeEntity(_0x51613c,null))['catch'](handleError(_0x51613c,null));};exports[_0x391f('0x42')]=function(_0x55686e,_0x541bc5){return db['CloudProvider'][_0x391f('0x43')]({'where':{'id':_0x55686e[_0x391f('0x39')]['id']},'raw':!![]})[_0x391f('0x15')](function(_0x268bff){if(!_0x268bff)return _0x541bc5['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x268bff,_0x55686e[_0x391f('0x44')]['id'])};})['then'](respondWithResult(_0x541bc5,null))[_0x391f('0x40')](handleError(_0x541bc5,null));};exports[_0x391f('0x45')]=function(_0x2e0aba,_0x295c6f){var _0x3b6296=_0x2e0aba[_0x391f('0x3d')];var _0x35b4dd;var _0x592270;if(_0x3b6296['error'])throw _0x3b6296;redis[_0x391f('0x46')](_0x3b6296[_0x391f('0x47')])['then'](function(_0x1235af){if(!_0x1235af)throw new Error(_0x391f('0x48'));_0x35b4dd=JSON[_0x391f('0x49')](_0x1235af);var _0x3de730=Buffer[_0x391f('0x4a')](_0x3b6296[_0x391f('0x47')],'base64')[_0x391f('0x4b')](_0x391f('0x4c'));_0x592270=JSON['parse'](_0x3de730);if(!oauth['isValidIdToken'](_0x3b6296[_0x391f('0x4d')],_0x35b4dd['oauth2Claims']))throw new Error(_0x391f('0x4e'));redis['del'](_0x3b6296[_0x391f('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x3b6296[_0x391f('0x4f')],_0x35b4dd);})['then'](function(_0x11341f){_0x35b4dd[_0x391f('0x50')]=_0x11341f[_0x391f('0x51')];_0x35b4dd[_0x391f('0x52')]=_0x11341f['refresh_token'];return db['CloudProvider'][_0x391f('0x13')]({'data5':_0x35b4dd[_0x391f('0x50')],'data6':_0x35b4dd[_0x391f('0x52')]},{'where':{'id':_0x35b4dd['id']}});})[_0x391f('0x15')](function(){oauth[_0x391f('0x53')](_0x35b4dd);socket[_0x391f('0x54')]('microsoftAuthorization:success',{'id':_0x592270['id']});return;})[_0x391f('0x15')](respondWithStatusCode(_0x295c6f,null))[_0x391f('0x40')](function(_0x3d65a7){if(_0x592270){socket['emit'](_0x391f('0x55'),{'id':_0x592270['id']});}if(!_0x35b4dd){logger[_0x391f('0x16')](_0x391f('0x56'),_0x3d65a7);return _0x295c6f['status'](0x1f4)['send'](_0x3d65a7[_0x391f('0x57')]);}logger[_0x391f('0x16')](_0x391f('0x58'),_0x35b4dd['id'],JSON[_0x391f('0x59')](_0x3d65a7));});};
\ No newline at end of file
+var _0x54dc=['MicrosoftAzure','data3','find','decryptString','catch','create','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','params','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','isValidIdToken','id_token','code','access_token','data6','refresh_token','data5','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','service'];(function(_0x4654c6,_0x17c4a8){var _0x286118=function(_0x29df7e){while(--_0x29df7e){_0x4654c6['push'](_0x4654c6['shift']());}};_0x286118(++_0x17c4a8);}(_0x54dc,0x1e9));var _0xc54d=function(_0x4383e9,_0xa4b307){_0x4383e9=_0x4383e9-0x0;var _0x355405=_0x54dc[_0x4383e9];return _0x355405;};'use strict';var _=require('lodash');var Redis=require(_0xc54d('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xc54d('0x1'));var config=require('../../config/environment');var logger=require(_0xc54d('0x2'))(_0xc54d('0x3'));var db=require(_0xc54d('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xc54d('0x5')]=_[_0xc54d('0x6')](config[_0xc54d('0x5')],{'host':_0xc54d('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0xc54d('0x5')]);function respondWithStatusCode(_0x4b2507,_0x47db3d){_0x47db3d=_0x47db3d||0xcc;return function(_0x19c3d3){if(_0x19c3d3){return _0x4b2507['sendStatus'](_0x47db3d);}return _0x4b2507[_0xc54d('0x8')](_0x47db3d)[_0xc54d('0x9')]();};}function respondWithResult(_0x53d0e1,_0x336ebf){_0x336ebf=_0x336ebf||0xc8;return function(_0xb0a71a){if(_0xb0a71a){return _0x53d0e1[_0xc54d('0x8')](_0x336ebf)[_0xc54d('0xa')](_0xb0a71a);}};}function respondWithFilteredResult(_0x184c0d,_0x1c73ea){return function(_0x1863b0){if(_0x1863b0){var _0x39c9c7=typeof _0x1c73ea[_0xc54d('0xb')]===_0xc54d('0xc')&&typeof _0x1c73ea[_0xc54d('0xd')]==='undefined';var _0x4a82c0=_0x1863b0['count'];var _0x502497=_0x39c9c7?0x0:_0x1c73ea[_0xc54d('0xb')];var _0x4e8946=_0x39c9c7?_0x1863b0[_0xc54d('0xe')]:_0x1c73ea[_0xc54d('0xb')]+_0x1c73ea[_0xc54d('0xd')];var _0x562729;if(_0x4e8946>=_0x4a82c0){_0x4e8946=_0x4a82c0;_0x562729=0xc8;}else{_0x562729=0xce;}_0x184c0d[_0xc54d('0x8')](_0x562729);return _0x184c0d[_0xc54d('0xf')](_0xc54d('0x10'),_0x502497+'-'+_0x4e8946+'/'+_0x4a82c0)[_0xc54d('0xa')](_0x1863b0);}return null;};}function saveUpdates(_0x4536b8){return function(_0x31c1ab){if(_0x31c1ab){return _0x31c1ab[_0xc54d('0x11')](_0x4536b8)[_0xc54d('0x12')](function(_0x13d596){return _0x13d596;});}return null;};}function removeEntity(_0x12148a){return function(_0x4d01ec){if(_0x4d01ec){return _0x4d01ec['destroy']()[_0xc54d('0x12')](function(){_0x12148a[_0xc54d('0x8')](0xcc)[_0xc54d('0x9')]();});}};}function handleEntityNotFound(_0x366128){return function(_0x41da05){if(!_0x41da05){_0x366128[_0xc54d('0x13')](0x194);}return _0x41da05;};}function handleError(_0x3f49bf,_0x494258){_0x494258=_0x494258||0x1f4;return function(_0x18b092){logger[_0xc54d('0x14')](_0x18b092[_0xc54d('0x15')]);if(_0x18b092[_0xc54d('0x16')]){delete _0x18b092['name'];}_0x3f49bf['status'](_0x494258)[_0xc54d('0x17')](_0x18b092);};}function maskClientSecret(_0x3c165d){return _[_0xc54d('0x18')](_0x3c165d[_0xc54d('0x19')](0x0,0x3),0x14,'*');}exports[_0xc54d('0x1a')]=function(_0x1a6320,_0x13d023){var _0x2478c5={},_0x1b680e={},_0x19ed7d={'count':0x0,'rows':[]};var _0x1ae93b=_[_0xc54d('0x1b')](db[_0xc54d('0x1c')]['rawAttributes'],function(_0x4f6529){return{'name':_0x4f6529['fieldName'],'type':_0x4f6529[_0xc54d('0x1d')][_0xc54d('0x1e')]};});_0x1b680e[_0xc54d('0x1f')]=_[_0xc54d('0x1b')](_0x1ae93b,_0xc54d('0x16'));_0x1b680e[_0xc54d('0x20')]=_[_0xc54d('0x21')](_0x1a6320['query']);_0x1b680e[_0xc54d('0x22')]=_[_0xc54d('0x23')](_0x1b680e['model'],_0x1b680e[_0xc54d('0x20')]);_0x2478c5[_0xc54d('0x24')]=_[_0xc54d('0x23')](_0x1b680e['model'],qs[_0xc54d('0x25')](_0x1a6320['query']['fields']));_0x2478c5[_0xc54d('0x24')]=_0x2478c5[_0xc54d('0x24')]['length']?_0x2478c5[_0xc54d('0x24')]:_0x1b680e['model'];if(!_0x1a6320[_0xc54d('0x20')][_0xc54d('0x26')]('nolimit')){_0x2478c5[_0xc54d('0xd')]=qs['limit'](_0x1a6320[_0xc54d('0x20')][_0xc54d('0xd')]);_0x2478c5[_0xc54d('0xb')]=qs[_0xc54d('0xb')](_0x1a6320['query'][_0xc54d('0xb')]);}_0x2478c5[_0xc54d('0x27')]=qs[_0xc54d('0x28')](_0x1a6320[_0xc54d('0x20')]['sort']);_0x2478c5[_0xc54d('0x29')]=qs[_0xc54d('0x22')](_[_0xc54d('0x2a')](_0x1a6320[_0xc54d('0x20')],_0x1b680e[_0xc54d('0x22')]),_0x1ae93b);if(_0x1a6320[_0xc54d('0x20')][_0xc54d('0x2b')]){_0x2478c5[_0xc54d('0x29')]=_[_0xc54d('0x2c')](_0x2478c5[_0xc54d('0x29')],{'$or':_['map'](_0x1ae93b,function(_0x5934b0){if(_0x5934b0[_0xc54d('0x1d')]!=='VIRTUAL'){var _0x1ac942={};_0x1ac942[_0x5934b0[_0xc54d('0x16')]]={'$like':'%'+_0x1a6320['query'][_0xc54d('0x2b')]+'%'};return _0x1ac942;}})});}_0x2478c5=_[_0xc54d('0x2c')]({},_0x2478c5,_0x1a6320[_0xc54d('0x2d')]);var _0xfa02ed={'where':_0x2478c5[_0xc54d('0x29')]};return db[_0xc54d('0x1c')][_0xc54d('0xe')](_0xfa02ed)[_0xc54d('0x12')](function(_0x3ec02a){_0x19ed7d[_0xc54d('0xe')]=_0x3ec02a;if(_0x1a6320[_0xc54d('0x20')][_0xc54d('0x2e')]){_0x2478c5[_0xc54d('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0xc54d('0x30')](_0x2478c5);})['then'](function(_0x3c01d6){_0x19ed7d[_0xc54d('0x31')]=_[_0xc54d('0x1b')](_0x3c01d6,function(_0x775153){if(_0x775153[_0xc54d('0x32')]===_0xc54d('0x33')){var _0x1832c6=encryptor['decryptString'](_0x775153[_0xc54d('0x34')]);_0x775153['data3']=maskClientSecret(_0x1832c6);}return _0x775153;});return _0x19ed7d;})[_0xc54d('0x12')](respondWithFilteredResult(_0x13d023,_0x2478c5))['catch'](handleError(_0x13d023,null));};exports['show']=function(_0x3980cc,_0x10ee7f){var _0x544acd={'raw':!![],'where':{'id':_0x3980cc['params']['id']}},_0x1c329b={};_0x1c329b['model']=_[_0xc54d('0x21')](db[_0xc54d('0x1c')]['rawAttributes']);_0x1c329b[_0xc54d('0x20')]=_[_0xc54d('0x21')](_0x3980cc[_0xc54d('0x20')]);_0x1c329b['filters']=_[_0xc54d('0x23')](_0x1c329b[_0xc54d('0x1f')],_0x1c329b[_0xc54d('0x20')]);_0x544acd[_0xc54d('0x24')]=_[_0xc54d('0x23')](_0x1c329b['model'],qs[_0xc54d('0x25')](_0x3980cc['query'][_0xc54d('0x25')]));_0x544acd['attributes']=_0x544acd[_0xc54d('0x24')]['length']?_0x544acd['attributes']:_0x1c329b[_0xc54d('0x1f')];if(_0x3980cc[_0xc54d('0x20')]['includeAll']){_0x544acd[_0xc54d('0x2f')]=[{'all':!![]}];}_0x544acd=_[_0xc54d('0x2c')]({},_0x544acd,_0x3980cc['options']);return db[_0xc54d('0x1c')][_0xc54d('0x35')](_0x544acd)[_0xc54d('0x12')](handleEntityNotFound(_0x10ee7f,null))[_0xc54d('0x12')](function(_0x7b7e72){if(_0x7b7e72['service']===_0xc54d('0x33')){var _0x2e11ff=encryptor[_0xc54d('0x36')](_0x7b7e72['data3']);_0x7b7e72[_0xc54d('0x34')]=maskClientSecret(_0x2e11ff);}return _0x7b7e72;})[_0xc54d('0x12')](respondWithResult(_0x10ee7f,null))[_0xc54d('0x37')](handleError(_0x10ee7f,null));};exports[_0xc54d('0x38')]=function(_0x6f0e5f,_0x5f4c60){if(!_0x6f0e5f[_0xc54d('0x39')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x32')])throw new Error(_0xc54d('0x3a'));var _0x31ec55=db['CloudProvider']['rawAttributes']['service'][_0xc54d('0x3b')];if(!_0x31ec55[_0xc54d('0x3c')](_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x32')]))throw new Error(_0xc54d('0x3d')+_0x31ec55[_0xc54d('0x3e')](',\x20'));if(_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x32')]==='MicrosoftAzure'&&_0x6f0e5f[_0xc54d('0x39')]['data3']){_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x34')]=encryptor['encryptString'](_0x6f0e5f[_0xc54d('0x39')][_0xc54d('0x34')]);}return db[_0xc54d('0x1c')][_0xc54d('0x38')](_0x6f0e5f['body'],{})[_0xc54d('0x12')](respondWithResult(_0x5f4c60,0xc9))[_0xc54d('0x37')](handleError(_0x5f4c60,null));};exports[_0xc54d('0x11')]=function(_0x1f0e3b,_0x5a503c){if(_0x1f0e3b[_0xc54d('0x39')]['id']){delete _0x1f0e3b['body']['id'];}return db[_0xc54d('0x1c')]['find']({'where':{'id':_0x1f0e3b[_0xc54d('0x3f')]['id']}})[_0xc54d('0x12')](handleEntityNotFound(_0x5a503c,null))[_0xc54d('0x12')](function(_0xbfd79d){if(_0xbfd79d[_0xc54d('0x32')]===_0xc54d('0x33')&&_0x1f0e3b[_0xc54d('0x39')][_0xc54d('0x34')]){_0x1f0e3b['body'][_0xc54d('0x34')]=encryptor[_0xc54d('0x40')](_0x1f0e3b['body'][_0xc54d('0x34')]);}return _0xbfd79d;})['then'](saveUpdates(_0x1f0e3b[_0xc54d('0x39')],null))[_0xc54d('0x12')](respondWithResult(_0x5a503c,null))[_0xc54d('0x37')](handleError(_0x5a503c,null));};exports['destroy']=function(_0x158baf,_0x2dac7a){return db[_0xc54d('0x1c')][_0xc54d('0x35')]({'where':{'id':_0x158baf[_0xc54d('0x3f')]['id']}})[_0xc54d('0x12')](handleEntityNotFound(_0x2dac7a,null))[_0xc54d('0x12')](removeEntity(_0x2dac7a,null))[_0xc54d('0x37')](handleError(_0x2dac7a,null));};exports[_0xc54d('0x41')]=function(_0x3ed7c3,_0x150ff0){return db['CloudProvider'][_0xc54d('0x42')]({'where':{'id':_0x3ed7c3[_0xc54d('0x3f')]['id']},'raw':!![]})[_0xc54d('0x12')](function(_0x466dd6){if(!_0x466dd6)return _0x150ff0[_0xc54d('0x13')](0x194);return{'url':oauth[_0xc54d('0x43')](_0x466dd6,_0x3ed7c3[_0xc54d('0x44')]['id'])};})['then'](respondWithResult(_0x150ff0,null))['catch'](handleError(_0x150ff0,null));};exports[_0xc54d('0x45')]=function(_0xc5a48c,_0x3cbd04){var _0x33b935=_0xc5a48c['body'];var _0x40ded1;var _0x33ceab;if(_0x33b935[_0xc54d('0x14')])throw _0x33b935;redis['get'](_0x33b935[_0xc54d('0x46')])['then'](function(_0x56eb99){if(!_0x56eb99)throw new Error(_0xc54d('0x47'));_0x40ded1=JSON['parse'](_0x56eb99);var _0x4f6aea=Buffer[_0xc54d('0x48')](_0x33b935[_0xc54d('0x46')],_0xc54d('0x49'))[_0xc54d('0x4a')](_0xc54d('0x4b'));_0x33ceab=JSON['parse'](_0x4f6aea);if(!oauth[_0xc54d('0x4c')](_0x33b935[_0xc54d('0x4d')],_0x40ded1['oauth2Claims']))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x33b935[_0xc54d('0x46')]);return oauth['getOauth2MicrosoftAccessToken'](_0x33b935[_0xc54d('0x4e')],_0x40ded1);})['then'](function(_0x22b91c){_0x40ded1['data5']=_0x22b91c[_0xc54d('0x4f')];_0x40ded1[_0xc54d('0x50')]=_0x22b91c[_0xc54d('0x51')];return db['CloudProvider'][_0xc54d('0x11')]({'data5':_0x40ded1[_0xc54d('0x52')],'data6':_0x40ded1['data6']},{'where':{'id':_0x40ded1['id']}});})[_0xc54d('0x12')](function(){oauth['startRefreshInterval'](_0x40ded1);socket[_0xc54d('0x53')](_0xc54d('0x54'),{'id':_0x33ceab['id']});return;})[_0xc54d('0x12')](respondWithStatusCode(_0x3cbd04,null))[_0xc54d('0x37')](function(_0x2bcbc8){if(_0x33ceab){socket[_0xc54d('0x53')](_0xc54d('0x55'),{'id':_0x33ceab['id']});}if(!_0x40ded1){logger[_0xc54d('0x14')](_0xc54d('0x56'),_0x2bcbc8);return _0x3cbd04[_0xc54d('0x8')](0x1f4)[_0xc54d('0x17')](_0x2bcbc8[_0xc54d('0x57')]);}logger[_0xc54d('0x14')](_0xc54d('0x58'),_0x40ded1['id'],JSON[_0xc54d('0x59')](_0x2bcbc8));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 08fe68b..e98f562 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 _0xa8a3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','../../config/logger'];(function(_0x1ef5f9,_0x44dad1){var _0x25f75b=function(_0x1b9955){while(--_0x1b9955){_0x1ef5f9['push'](_0x1ef5f9['shift']());}};_0x25f75b(++_0x44dad1);}(_0xa8a3,0x197));var _0x3a8a=function(_0x590f55,_0x314c3b){_0x590f55=_0x590f55-0x0;var _0x14142f=_0xa8a3[_0x590f55];return _0x14142f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3a8a('0x0'))('api');var moment=require(_0x3a8a('0x1'));var BPromise=require(_0x3a8a('0x2'));var rp=require(_0x3a8a('0x3'));var fs=require('fs');var path=require(_0x3a8a('0x4'));var rimraf=require(_0x3a8a('0x5'));var config=require(_0x3a8a('0x6'));var attributes=require(_0x3a8a('0x7'));module[_0x3a8a('0x8')]=function(_0x2d9629,_0x570fb3){return _0x2d9629[_0x3a8a('0x9')](_0x3a8a('0xa'),attributes,{'tableName':_0x3a8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4ab=['request-promise','path','rimraf','../../config/environment','define','CloudProvider','cloud_providers','util','../../config/logger','api','bluebird'];(function(_0x37cf36,_0x124489){var _0x4678d5=function(_0x29168b){while(--_0x29168b){_0x37cf36['push'](_0x37cf36['shift']());}};_0x4678d5(++_0x124489);}(_0xb4ab,0x1ca));var _0xbb4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb4ab[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xbb4a('0x0'));var logger=require(_0xbb4a('0x1'))(_0xbb4a('0x2'));var moment=require('moment');var BPromise=require(_0xbb4a('0x3'));var rp=require(_0xbb4a('0x4'));var fs=require('fs');var path=require(_0xbb4a('0x5'));var rimraf=require(_0xbb4a('0x6'));var config=require(_0xbb4a('0x7'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x5ba824,_0x40adb4){return _0x5ba824[_0xbb4a('0x8')](_0xbb4a('0x9'),attributes,{'tableName':_0xbb4a('0xa'),'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 32930d5..703d86f 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 _0x2279=['catch','error','authorization_code','intervals','bind','findAll','all','exports','lodash','crypto','jsonwebtoken','moment','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','openid','/authorize','/token','type','push','data7','join','https://outlook.office365.com/IMAP.AccessAsUser.All','/.default','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','form_post','state','prompt','login','map','key','value','oauth2Claims','oauth2/','set','payload','issuer','aud','audience','nonce','isAfter','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','POST','{TENANT_ID}','update'];(function(_0x514d96,_0x27dc94){var _0x3d1eeb=function(_0x3f0518){while(--_0x3f0518){_0x514d96['push'](_0x514d96['shift']());}};_0x3d1eeb(++_0x27dc94);}(_0x2279,0x18e));var _0x9227=function(_0x3d4a53,_0x41b236){_0x3d4a53=_0x3d4a53-0x0;var _0x4a4279=_0x2279[_0x3d4a53];return _0x4a4279;};'use strict';var _=require(_0x9227('0x0'));var crypto=require(_0x9227('0x1'));var jwt=require(_0x9227('0x2'));var moment=require(_0x9227('0x3'));var Redis=require(_0x9227('0x4'));var rp=require('request-promise');var util=require('util');var encryptor=require(_0x9227('0x5'));var config=require(_0x9227('0x6'));var logger=require(_0x9227('0x7'))(_0x9227('0x8'));var schedule=require(_0x9227('0x9'));var db=require(_0x9227('0xa'))['db'];config[_0x9227('0xb')]=_[_0x9227('0xc')](config[_0x9227('0xb')],{'host':_0x9227('0xd'),'port':0x18eb});var redis=new Redis(config[_0x9227('0xb')]);var MICROSOFT_AUTH_URL=_0x9227('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9227('0xf'),_0x9227('0x10'),_0x9227('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x9227('0x12'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x9227('0x13'),_0x9227('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x9227('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x9227('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2184d7){var _0x5c9d5e=_['map'](AZURE_AUTH_SCOPES[_0x2184d7[_0x9227('0x16')]]);if(_0x2184d7['type']==='Dynamics365')_0x5c9d5e[_0x9227('0x17')](_0x2184d7[_0x9227('0x18')]+'/.default');return _0x5c9d5e[_0x9227('0x19')]('\x20');}function getAccessTokenScope(_0x593597){if(_0x593597['type']==='Outlook365')return _0x9227('0x1a');if(_0x593597[_0x9227('0x16')]==='Dynamics365')return _0x593597[_0x9227('0x18')]+_0x9227('0x1b');}function generateMicrosoftAuthorizationUrl(_0x4239f2,_0x2854f3){var _0xe8b359=MICROSOFT_AUTH_URL[_0x9227('0x1c')]('{TENANT_ID}',_0x4239f2[_0x9227('0x1d')]);var _0x1b889c=[_0x9227('0x1e'),_0x9227('0x1f')];var _0x5af2bf=Buffer[_0x9227('0x20')](JSON[_0x9227('0x21')]({'id':_0x2854f3}))[_0x9227('0x22')](_0x9227('0x23'));var _0x3d1507=crypto[_0x9227('0x24')](0x10)[_0x9227('0x22')](_0x9227('0x25'));var _0x377bbc=getAuthorizationScopes(_0x4239f2);var _0x270c0d=[{'key':_0x9227('0x26'),'value':_0x4239f2[_0x9227('0x27')]},{'key':'response_type','value':encodeURIComponent(_0x1b889c[_0x9227('0x19')]('\x20'))},{'key':_0x9227('0x28'),'value':_0x4239f2[_0x9227('0x29')]},{'key':'response_mode','value':_0x9227('0x2a')},{'key':'scope','value':encodeURIComponent(_0x377bbc)},{'key':_0x9227('0x2b'),'value':_0x5af2bf},{'key':'nonce','value':_0x3d1507},{'key':_0x9227('0x2c'),'value':_0x9227('0x2d')}];var _0x223160=_0xe8b359+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9227('0x2e')](_0x270c0d,function(_0x5ae7fc){return _0x5ae7fc[_0x9227('0x2f')]+'='+_0x5ae7fc[_0x9227('0x30')];})['join']('&');_0x4239f2[_0x9227('0x31')]={'issuer':_0xe8b359[_0x9227('0x1c')](_0x9227('0x32'),''),'audience':_0x4239f2[_0x9227('0x27')],'state':_0x5af2bf,'nonce':_0x3d1507};redis[_0x9227('0x33')](_0x5af2bf,JSON[_0x9227('0x21')](_0x4239f2));return _0x223160;}function isValidIdToken(_0x5436fd,_0x3342be){try{var _0x26bac0=jwt['decode'](_0x5436fd,{'complete':!![]});var _0xe9eb8e=_0x26bac0[_0x9227('0x34')];if(_0xe9eb8e['iss']!==_0x3342be[_0x9227('0x35')])return![];if(_0xe9eb8e[_0x9227('0x36')]!==_0x3342be[_0x9227('0x37')])return![];if(_0xe9eb8e[_0x9227('0x38')]!==_0x3342be[_0x9227('0x38')])return![];if(moment()[_0x9227('0x39')](moment['unix'](_0xe9eb8e[_0x9227('0x3a')])))return![];return!![];}catch(_0x329cfd){throw _0x329cfd;}}function refreshOauth2MicrosoftAccessToken(_0x5dcbe2){return Promise[_0x9227('0x3b')]()[_0x9227('0x3c')](function(){if(_0x5dcbe2['data3'])return _0x5dcbe2;return db[_0x9227('0x3d')][_0x9227('0x3e')]({'where':{'id':_0x5dcbe2['id']},'raw':!![]});})[_0x9227('0x3c')](function(_0x6e2259){var _0x2fe3d5={'grant_type':_0x9227('0x3f'),'refresh_token':_0x6e2259[_0x9227('0x40')],'scope':getAccessTokenScope(_0x6e2259),'redirect_uri':_0x6e2259['data4'],'client_id':_0x6e2259['data1'],'client_secret':encryptor[_0x9227('0x41')](_0x6e2259[_0x9227('0x42')])};var _0x138ed0={'method':_0x9227('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9227('0x1c')](_0x9227('0x44'),_0x6e2259['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2fe3d5,'json':!![]};return rp(_0x138ed0);})[_0x9227('0x3c')](function(_0x3b7e75){_0x5dcbe2['data5']=_0x3b7e75['access_token'];_0x5dcbe2[_0x9227('0x40')]=_0x3b7e75[_0x9227('0x3f')];return db['CloudProvider'][_0x9227('0x45')]({'data5':_0x5dcbe2['data5'],'data6':_0x5dcbe2[_0x9227('0x40')]},{'where':{'id':_0x5dcbe2['id']}});})['then'](function(){return _0x5dcbe2;})[_0x9227('0x46')](function(_0x2f85aa){logger[_0x9227('0x47')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5dcbe2['id'],_0x2f85aa);});}function getOauth2MicrosoftAccessToken(_0x22aae0,_0x33e887){var _0x3a1936={'grant_type':_0x9227('0x48'),'code':_0x22aae0,'scope':getAccessTokenScope(_0x33e887),'redirect_uri':_0x33e887['data4'],'client_id':_0x33e887[_0x9227('0x27')],'client_secret':encryptor['decryptString'](_0x33e887[_0x9227('0x42')])};var _0x4f3e1a={'method':_0x9227('0x43'),'uri':MICROSOFT_AUTH_URL[_0x9227('0x1c')]('{TENANT_ID}',_0x33e887[_0x9227('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3a1936,'json':!![]};return rp(_0x4f3e1a);}function startRefreshInterval(_0x4b66e8){var _0x387e83=schedule[_0x9227('0x49')];if(_0x387e83[_0x4b66e8['id']])clearInterval(_0x387e83[_0x4b66e8['id']]);_0x387e83[_0x4b66e8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x9227('0x4a')](this,{'id':_0x4b66e8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9227('0x49')]=_0x387e83;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x9227('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9227('0x3c')](function(_0x84a2d6){var _0x55f8df=_0x84a2d6[_0x9227('0x2e')](function(_0x4c1ce8){return refreshOauth2MicrosoftAccessToken(_0x4c1ce8)[_0x9227('0x3c')](function(_0x2974dc){startRefreshInterval(_0x2974dc);});});return Promise[_0x9227('0x4c')](_0x55f8df);})[_0x9227('0x46')](function(_0x26c906){var _0x4539fe=_0x26c906?util['inspect'](_0x26c906,{'showHidden':![],'depth':null}):'';logger[_0x9227('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4539fe);});}module[_0x9227('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9485=['https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','id_token','stringify','toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','response_mode','form_post','scope','state','nonce','login','key','value','oauth2Claims','oauth2/','set','decode','iss','aud','audience','isAfter','unix','exp','then','data3','CloudProvider','findOne','refresh_token','decryptString','data2','data5','access_token','data6','update','POST','intervals','findAll','catch','inspect','error','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','profile','email','offline_access'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9485,0x89));var _0x5948=function(_0x5d7686,_0x5d11b1){_0x5d7686=_0x5d7686-0x0;var _0x408ab4=_0x9485[_0x5d7686];return _0x408ab4;};'use strict';var _=require(_0x5948('0x0'));var crypto=require(_0x5948('0x1'));var jwt=require(_0x5948('0x2'));var moment=require(_0x5948('0x3'));var Redis=require('ioredis');var rp=require(_0x5948('0x4'));var util=require(_0x5948('0x5'));var encryptor=require(_0x5948('0x6'));var config=require(_0x5948('0x7'));var logger=require(_0x5948('0x8'))('api');var schedule=require(_0x5948('0x9'));var db=require(_0x5948('0xa'))['db'];config[_0x5948('0xb')]=_['defaults'](config[_0x5948('0xb')],{'host':_0x5948('0xc'),'port':0x18eb});var redis=new Redis(config[_0x5948('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x5948('0xd'),_0x5948('0xe'),_0x5948('0xf'),_0x5948('0x10'),_0x5948('0x11'),_0x5948('0x12'),_0x5948('0x13')],'Dynamics365':['openid',_0x5948('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x5948('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x5948('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x376e6c){var _0x31431d=_[_0x5948('0x16')](AZURE_AUTH_SCOPES[_0x376e6c[_0x5948('0x17')]]);if(_0x376e6c[_0x5948('0x17')]==='Dynamics365')_0x31431d[_0x5948('0x18')](_0x376e6c['data7']+_0x5948('0x19'));return _0x31431d[_0x5948('0x1a')]('\x20');}function getAccessTokenScope(_0x50cbfd){if(_0x50cbfd['type']===_0x5948('0x1b'))return _0x5948('0x11');if(_0x50cbfd['type']===_0x5948('0x1c'))return _0x50cbfd['data7']+_0x5948('0x19');}function generateMicrosoftAuthorizationUrl(_0xc43f8a,_0x4c7e6e){var _0x216205=MICROSOFT_AUTH_URL[_0x5948('0x1d')](_0x5948('0x1e'),_0xc43f8a['data2']);var _0x5c69d3=['code',_0x5948('0x1f')];var _0x103cc9=Buffer['from'](JSON[_0x5948('0x20')]({'id':_0x4c7e6e}))[_0x5948('0x21')](_0x5948('0x22'));var _0x220384=crypto[_0x5948('0x23')](0x10)[_0x5948('0x21')](_0x5948('0x24'));var _0x4fa564=getAuthorizationScopes(_0xc43f8a);var _0x137bb6=[{'key':_0x5948('0x25'),'value':_0xc43f8a[_0x5948('0x26')]},{'key':'response_type','value':encodeURIComponent(_0x5c69d3[_0x5948('0x1a')]('\x20'))},{'key':_0x5948('0x27'),'value':_0xc43f8a[_0x5948('0x28')]},{'key':_0x5948('0x29'),'value':_0x5948('0x2a')},{'key':_0x5948('0x2b'),'value':encodeURIComponent(_0x4fa564)},{'key':_0x5948('0x2c'),'value':_0x103cc9},{'key':_0x5948('0x2d'),'value':_0x220384},{'key':'prompt','value':_0x5948('0x2e')}];var _0x54ced0=_0x216205+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x5948('0x16')](_0x137bb6,function(_0x1daafe){return _0x1daafe[_0x5948('0x2f')]+'='+_0x1daafe[_0x5948('0x30')];})[_0x5948('0x1a')]('&');_0xc43f8a[_0x5948('0x31')]={'issuer':_0x216205[_0x5948('0x1d')](_0x5948('0x32'),''),'audience':_0xc43f8a[_0x5948('0x26')],'state':_0x103cc9,'nonce':_0x220384};redis[_0x5948('0x33')](_0x103cc9,JSON[_0x5948('0x20')](_0xc43f8a));return _0x54ced0;}function isValidIdToken(_0x41c30d,_0xc4baee){try{var _0x24fb27=jwt[_0x5948('0x34')](_0x41c30d,{'complete':!![]});var _0x2f4854=_0x24fb27['payload'];if(_0x2f4854[_0x5948('0x35')]!==_0xc4baee['issuer'])return![];if(_0x2f4854[_0x5948('0x36')]!==_0xc4baee[_0x5948('0x37')])return![];if(_0x2f4854[_0x5948('0x2d')]!==_0xc4baee[_0x5948('0x2d')])return![];if(moment()[_0x5948('0x38')](moment[_0x5948('0x39')](_0x2f4854[_0x5948('0x3a')])))return![];return!![];}catch(_0x1f5b97){throw _0x1f5b97;}}function refreshOauth2MicrosoftAccessToken(_0xa12e4e){return Promise['resolve']()[_0x5948('0x3b')](function(){if(_0xa12e4e[_0x5948('0x3c')])return _0xa12e4e;return db[_0x5948('0x3d')][_0x5948('0x3e')]({'where':{'id':_0xa12e4e['id']},'raw':!![]});})['then'](function(_0x35c098){var _0x1d2a68={'grant_type':_0x5948('0x3f'),'refresh_token':_0x35c098['data6'],'scope':getAccessTokenScope(_0x35c098),'redirect_uri':_0x35c098[_0x5948('0x28')],'client_id':_0x35c098[_0x5948('0x26')],'client_secret':encryptor[_0x5948('0x40')](_0x35c098['data3'])};var _0x297164={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x5948('0x1d')](_0x5948('0x1e'),_0x35c098[_0x5948('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1d2a68,'json':!![]};return rp(_0x297164);})['then'](function(_0x3e949f){_0xa12e4e[_0x5948('0x42')]=_0x3e949f[_0x5948('0x43')];_0xa12e4e[_0x5948('0x44')]=_0x3e949f[_0x5948('0x3f')];return db['CloudProvider'][_0x5948('0x45')]({'data5':_0xa12e4e[_0x5948('0x42')],'data6':_0xa12e4e[_0x5948('0x44')]},{'where':{'id':_0xa12e4e['id']}});})['then'](function(){return _0xa12e4e;})['catch'](function(_0x4b3223){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xa12e4e['id'],_0x4b3223);});}function getOauth2MicrosoftAccessToken(_0x15a15e,_0x5b6991){var _0x3ed588={'grant_type':'authorization_code','code':_0x15a15e,'scope':getAccessTokenScope(_0x5b6991),'redirect_uri':_0x5b6991[_0x5948('0x28')],'client_id':_0x5b6991[_0x5948('0x26')],'client_secret':encryptor['decryptString'](_0x5b6991[_0x5948('0x3c')])};var _0x35201d={'method':_0x5948('0x46'),'uri':MICROSOFT_AUTH_URL['replace'](_0x5948('0x1e'),_0x5b6991[_0x5948('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3ed588,'json':!![]};return rp(_0x35201d);}function startRefreshInterval(_0x185f7e){var _0x3290be=schedule[_0x5948('0x47')];if(_0x3290be[_0x185f7e['id']])clearInterval(_0x3290be[_0x185f7e['id']]);_0x3290be[_0x185f7e['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x185f7e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x5948('0x47')]=_0x3290be;}function startAllRefreshIntervals(){return db[_0x5948('0x3d')][_0x5948('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x5948('0x3b')](function(_0x27702e){var _0x13f03e=_0x27702e[_0x5948('0x16')](function(_0x398033){return refreshOauth2MicrosoftAccessToken(_0x398033)['then'](function(_0x3fb61c){startRefreshInterval(_0x3fb61c);});});return Promise['all'](_0x13f03e);})[_0x5948('0x49')](function(_0x4e5853){var _0x4da144=_0x4e5853?util[_0x5948('0x4a')](_0x4e5853,{'showHidden':![],'depth':null}):'';logger[_0x5948('0x4b')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4da144);});}module[_0x5948('0x4c')]={'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 e91ea56..d899460 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 _0xce62=['code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error'];(function(_0x3dc9ce,_0x3f76b0){var _0x1747f2=function(_0x38ec7d){while(--_0x38ec7d){_0x3dc9ce['push'](_0x3dc9ce['shift']());}};_0x1747f2(++_0x3f76b0);}(_0xce62,0x83));var _0x2ce6=function(_0x45204c,_0x1eefaa){_0x45204c=_0x45204c-0x0;var _0x5dc667=_0xce62[_0x45204c];return _0x5dc667;};'use strict';var _=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var moment=require('moment');var BPromise=require(_0x2ce6('0x2'));var rs=require(_0x2ce6('0x3'));var fs=require('fs');var Redis=require(_0x2ce6('0x4'));var db=require(_0x2ce6('0x5'))['db'];var utils=require(_0x2ce6('0x6'));var logger=require(_0x2ce6('0x7'))('rpc');var config=require(_0x2ce6('0x8'));var jayson=require(_0x2ce6('0x9'));var client=jayson[_0x2ce6('0xa')][_0x2ce6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcf425,_0x2c66c2,_0x5b7f02){return new BPromise(function(_0x46ef52,_0x12f647){return client['request'](_0xcf425,_0x5b7f02)[_0x2ce6('0xc')](function(_0x2e6eae){logger[_0x2ce6('0xd')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'),JSON['stringify'](_0x2e6eae));if(_0x2e6eae[_0x2ce6('0xf')]){if(_0x2e6eae['error'][_0x2ce6('0x10')]===0x1f4){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);return _0x12f647(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}logger[_0x2ce6('0xf')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2e6eae[_0x2ce6('0xf')]['message']);return _0x46ef52(_0x2e6eae[_0x2ce6('0xf')][_0x2ce6('0x12')]);}else{logger[_0x2ce6('0xd')]('CloudProvider,\x20%s,\x20%s',_0x2c66c2,_0x2ce6('0xe'));_0x46ef52(_0x2e6eae[_0x2ce6('0x13')][_0x2ce6('0x12')]);}})[_0x2ce6('0x14')](function(_0x38032e){logger[_0x2ce6('0xf')](_0x2ce6('0x11'),_0x2c66c2,_0x38032e);_0x12f647(_0x38032e);});});}
\ No newline at end of file
+var _0x9db7=['client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x29d524,_0x1df569){var _0x3949fe=function(_0x35ad47){while(--_0x35ad47){_0x29d524['push'](_0x29d524['shift']());}};_0x3949fe(++_0x1df569);}(_0x9db7,0x1bf));var _0x79db=function(_0x540886,_0x4c6eff){_0x540886=_0x540886-0x0;var _0x1ef0b7=_0x9db7[_0x540886];return _0x1ef0b7;};'use strict';var _=require(_0x79db('0x0'));var util=require(_0x79db('0x1'));var moment=require(_0x79db('0x2'));var BPromise=require(_0x79db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79db('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x79db('0x5'));var logger=require(_0x79db('0x6'))('rpc');var config=require(_0x79db('0x7'));var jayson=require(_0x79db('0x8'));var client=jayson[_0x79db('0x9')][_0x79db('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7980b1,_0x395883,_0x214bf9){return new BPromise(function(_0x792510,_0x27d02a){return client[_0x79db('0xb')](_0x7980b1,_0x214bf9)[_0x79db('0xc')](function(_0x145a31){logger['info'](_0x79db('0xd'),_0x395883,_0x79db('0xe'));logger[_0x79db('0xf')](_0x79db('0x10'),_0x395883,_0x79db('0xe'),JSON[_0x79db('0x11')](_0x145a31));if(_0x145a31[_0x79db('0x12')]){if(_0x145a31[_0x79db('0x12')][_0x79db('0x13')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x395883,_0x145a31['error'][_0x79db('0x14')]);return _0x27d02a(_0x145a31['error'][_0x79db('0x14')]);}logger['error'](_0x79db('0xd'),_0x395883,_0x145a31[_0x79db('0x12')][_0x79db('0x14')]);return _0x792510(_0x145a31[_0x79db('0x12')][_0x79db('0x14')]);}else{logger[_0x79db('0x15')](_0x79db('0xd'),_0x395883,_0x79db('0xe'));_0x792510(_0x145a31[_0x79db('0x16')][_0x79db('0x14')]);}})[_0x79db('0x17')](function(_0x365889){logger[_0x79db('0x12')]('CloudProvider,\x20%s,\x20%s',_0x395883,_0x365889);_0x27d02a(_0x365889);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 7e48363..0f3c106 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x4f4365,_0x2aee26){var _0x128f6e=function(_0x72a92f){while(--_0x72a92f){_0x4f4365['push'](_0x4f4365['shift']());}};_0x128f6e(++_0x2aee26);}(_0xadb5,0xad));var _0x5adb=function(_0x321ceb,_0x100a58){_0x321ceb=_0x321ceb-0x0;var _0x512dbc=_0xadb5[_0x321ceb];return _0x512dbc;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x59ba39,_0x1af940){var _0x1ace8e=function(_0x2b64be){while(--_0x2b64be){_0x59ba39['push'](_0x59ba39['shift']());}};_0x1ace8e(++_0x1af940);}(_0x2ef3,0xba));var _0x32ef=function(_0x1c6eef,_0x5830f7){_0x1c6eef=_0x1c6eef-0x0;var _0xa8e6f7=_0x2ef3[_0x1c6eef];return _0xa8e6f7;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 15fb684..35032be 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 _0xec43=['STRING','name','sequelize','exports'];(function(_0x304998,_0x2635c9){var _0x136067=function(_0x519e6e){while(--_0x519e6e){_0x304998['push'](_0x304998['shift']());}};_0x136067(++_0x2635c9);}(_0xec43,0x1c2));var _0x3ec4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec43[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3ec4('0x0'));module[_0x3ec4('0x1')]={'name':{'type':Sequelize[_0x3ec4('0x2')],'unique':_0x3ec4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3ec4('0x2')]},'companyId':{'type':Sequelize[_0x3ec4('0x2')]},'website':{'type':Sequelize[_0x3ec4('0x2')]},'phone':{'type':Sequelize[_0x3ec4('0x2')]},'fax':{'type':Sequelize[_0x3ec4('0x2')]},'type':{'type':Sequelize[_0x3ec4('0x2')]},'street':{'type':Sequelize[_0x3ec4('0x2')]},'postalCode':{'type':Sequelize[_0x3ec4('0x2')]},'city':{'type':Sequelize[_0x3ec4('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3ec4('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3ec4('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3ec4('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb9c5=['STRING','name'];(function(_0x61d9c8,_0x46dc82){var _0x20319e=function(_0x3a9f89){while(--_0x3a9f89){_0x61d9c8['push'](_0x61d9c8['shift']());}};_0x20319e(++_0x46dc82);}(_0xb9c5,0x14c));var _0x5b9c=function(_0x33d0e7,_0x336442){_0x33d0e7=_0x33d0e7-0x0;var _0x4aff0e=_0xb9c5[_0x33d0e7];return _0x4aff0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5b9c('0x0')],'unique':_0x5b9c('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5b9c('0x0')]},'companyId':{'type':Sequelize[_0x5b9c('0x0')]},'website':{'type':Sequelize[_0x5b9c('0x0')]},'phone':{'type':Sequelize[_0x5b9c('0x0')]},'fax':{'type':Sequelize[_0x5b9c('0x0')]},'type':{'type':Sequelize[_0x5b9c('0x0')]},'street':{'type':Sequelize[_0x5b9c('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x5b9c('0x0')]},'country':{'type':Sequelize[_0x5b9c('0x0')]},'email':{'type':Sequelize[_0x5b9c('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x5b9c('0x0')]},'sPostalCode':{'type':Sequelize[_0x5b9c('0x0')]},'sCity':{'type':Sequelize[_0x5b9c('0x0')]},'sCountry':{'type':Sequelize[_0x5b9c('0x0')]},'description':{'type':Sequelize[_0x5b9c('0x0')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 60fe266..7202cc3 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 _0xbcd1=['sendStatus','status','offset','limit','set','json','apply','reject','save','update','then','destroy','UserProfileResource','end','error','name','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','map','options','count','includeAll','findAll','rows','catch','show','rawAttributes','include','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','CmContact','addContacts','ids','findOne','sort','pick','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbcd1,0xe9));var _0x1bcd=function(_0x2e1cd7,_0x293ea1){_0x2e1cd7=_0x2e1cd7-0x0;var _0x515226=_0xbcd1[_0x2e1cd7];return _0x515226;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1bcd('0x0'));var zipdir=require(_0x1bcd('0x1'));var jsonpatch=require(_0x1bcd('0x2'));var rp=require(_0x1bcd('0x3'));var moment=require('moment');var BPromise=require(_0x1bcd('0x4'));var Mustache=require(_0x1bcd('0x5'));var util=require(_0x1bcd('0x6'));var path=require('path');var sox=require(_0x1bcd('0x7'));var csv=require(_0x1bcd('0x8'));var ejs=require(_0x1bcd('0x9'));var fs=require('fs');var fs_extra=require(_0x1bcd('0xa'));var _=require(_0x1bcd('0xb'));var squel=require(_0x1bcd('0xc'));var crypto=require(_0x1bcd('0xd'));var jsforce=require(_0x1bcd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1bcd('0x8'));var querystring=require(_0x1bcd('0xf'));var Papa=require('papaparse');var Redis=require(_0x1bcd('0x10'));var authService=require(_0x1bcd('0x11'));var qs=require(_0x1bcd('0x12'));var as=require(_0x1bcd('0x13'));var hardwareService=require(_0x1bcd('0x14'));var logger=require(_0x1bcd('0x15'))(_0x1bcd('0x16'));var utils=require(_0x1bcd('0x17'));var config=require(_0x1bcd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b3cd0,_0x53a60c){_0x53a60c=_0x53a60c||0xcc;return function(_0x3999da){if(_0x3999da){return _0x5b3cd0[_0x1bcd('0x19')](_0x53a60c);}return _0x5b3cd0[_0x1bcd('0x1a')](_0x53a60c)['end']();};}function respondWithResult(_0x3cb2c0,_0x1f6ad6){_0x1f6ad6=_0x1f6ad6||0xc8;return function(_0x550a41){if(_0x550a41){return _0x3cb2c0[_0x1bcd('0x1a')](_0x1f6ad6)['json'](_0x550a41);}};}function respondWithFilteredResult(_0x413b70,_0x21af94){return function(_0x1876fc){if(_0x1876fc){var _0x408f91=typeof _0x21af94[_0x1bcd('0x1b')]==='undefined'&&typeof _0x21af94[_0x1bcd('0x1c')]==='undefined';var _0x3535da=_0x1876fc['count'];var _0x5a1a38=_0x408f91?0x0:_0x21af94[_0x1bcd('0x1b')];var _0xd64780=_0x408f91?_0x1876fc['count']:_0x21af94[_0x1bcd('0x1b')]+_0x21af94['limit'];var _0x5b5772;if(_0xd64780>=_0x3535da){_0xd64780=_0x3535da;_0x5b5772=0xc8;}else{_0x5b5772=0xce;}_0x413b70[_0x1bcd('0x1a')](_0x5b5772);return _0x413b70[_0x1bcd('0x1d')]('Content-Range',_0x5a1a38+'-'+_0xd64780+'/'+_0x3535da)[_0x1bcd('0x1e')](_0x1876fc);}return null;};}function patchUpdates(_0x581747){return function(_0x4dcfdf){try{jsonpatch[_0x1bcd('0x1f')](_0x4dcfdf,_0x581747,!![]);}catch(_0x14df57){return BPromise[_0x1bcd('0x20')](_0x14df57);}return _0x4dcfdf[_0x1bcd('0x21')]();};}function saveUpdates(_0x14ca60,_0x3c9292){return function(_0x104f4b){if(_0x104f4b){return _0x104f4b[_0x1bcd('0x22')](_0x14ca60)[_0x1bcd('0x23')](function(_0x161fb9){return _0x161fb9;});}return null;};}function removeEntity(_0x1ce295,_0x2c8601){return function(_0x30c468){if(_0x30c468){return _0x30c468[_0x1bcd('0x24')]()['then'](function(){var _0x4729bd=_0x30c468['get']({'plain':!![]});var _0x37ef5b='Companies';return db[_0x1bcd('0x25')][_0x1bcd('0x24')]({'where':{'type':_0x37ef5b,'resourceId':_0x4729bd['id']}})[_0x1bcd('0x23')](function(){return _0x30c468;});})[_0x1bcd('0x23')](function(){_0x1ce295[_0x1bcd('0x1a')](0xcc)[_0x1bcd('0x26')]();});}};}function handleEntityNotFound(_0x3ffbd9,_0x3516d2){return function(_0x15c8a0){if(!_0x15c8a0){_0x3ffbd9['sendStatus'](0x194);}return _0x15c8a0;};}function handleError(_0x54d86a,_0x418815){_0x418815=_0x418815||0x1f4;return function(_0x21e7ff){logger[_0x1bcd('0x27')](_0x21e7ff['stack']);if(_0x21e7ff[_0x1bcd('0x28')]){delete _0x21e7ff[_0x1bcd('0x28')];}_0x54d86a[_0x1bcd('0x1a')](_0x418815)['send'](_0x21e7ff);};}exports[_0x1bcd('0x29')]=function(_0x4a6c8c,_0x2bf5ad){var _0x29615b={},_0x3b3b1d={},_0xb9f698={'count':0x0,'rows':[]};return db[_0x1bcd('0x2a')]['describe']()['then'](function(_0xbbca44){_0x3b3b1d['model']=_[_0x1bcd('0x2b')](_0xbbca44);_0x3b3b1d[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x4a6c8c[_0x1bcd('0x2c')]);_0x3b3b1d[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x3b3b1d[_0x1bcd('0x2f')],_0x3b3b1d[_0x1bcd('0x2c')]);_0x29615b[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x3b3b1d[_0x1bcd('0x2f')],qs[_0x1bcd('0x31')](_0x4a6c8c['query'][_0x1bcd('0x31')]));_0x29615b[_0x1bcd('0x30')]=_0x29615b[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0x29615b[_0x1bcd('0x30')]:_0x3b3b1d[_0x1bcd('0x2f')];if(!_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x33')](_0x1bcd('0x34'))){_0x29615b[_0x1bcd('0x1c')]=qs['limit'](_0x4a6c8c[_0x1bcd('0x2c')]['limit']);_0x29615b[_0x1bcd('0x1b')]=qs[_0x1bcd('0x1b')](_0x4a6c8c['query'][_0x1bcd('0x1b')]);}_0x29615b[_0x1bcd('0x35')]=qs['sort'](_0x4a6c8c[_0x1bcd('0x2c')]['sort']);_0x29615b[_0x1bcd('0x36')]=qs[_0x1bcd('0x2d')](_['pick'](_0x4a6c8c[_0x1bcd('0x2c')],_0x3b3b1d[_0x1bcd('0x2d')]),_0xbbca44);if(_0x4a6c8c['query'][_0x1bcd('0x37')]){_0x29615b[_0x1bcd('0x36')]=_['merge'](_0x29615b[_0x1bcd('0x36')],{'$or':_[_0x1bcd('0x38')](_0x29615b[_0x1bcd('0x30')],function(_0x3a8f27){var _0x43c5c5={};_0x43c5c5[_0x3a8f27]={'$like':'%'+_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x37')]+'%'};return _0x43c5c5;})});}_0x29615b=_['merge']({},_0x29615b,_0x4a6c8c[_0x1bcd('0x39')]);var _0x4cedb8={'where':_0x29615b[_0x1bcd('0x36')]};return db[_0x1bcd('0x2a')]['count'](_0x4cedb8)[_0x1bcd('0x23')](function(_0x4bfe13){_0xb9f698[_0x1bcd('0x3a')]=_0x4bfe13;if(_0x4a6c8c[_0x1bcd('0x2c')][_0x1bcd('0x3b')]){_0x29615b['include']=[{'all':!![]}];}return db[_0x1bcd('0x2a')][_0x1bcd('0x3c')](_0x29615b);})[_0x1bcd('0x23')](function(_0x445497){_0xb9f698[_0x1bcd('0x3d')]=_0x445497;return _0xb9f698;})[_0x1bcd('0x23')](respondWithFilteredResult(_0x2bf5ad,_0x29615b))[_0x1bcd('0x3e')](handleError(_0x2bf5ad,null));})[_0x1bcd('0x3e')](handleError(_0x2bf5ad,null));};exports[_0x1bcd('0x3f')]=function(_0x4dab25,_0x320f84){var _0x1818d9={'raw':![],'where':{'id':_0x4dab25['params']['id']}},_0x23efd7={};_0x23efd7[_0x1bcd('0x2f')]=_[_0x1bcd('0x2b')](db[_0x1bcd('0x2a')][_0x1bcd('0x40')]);_0x23efd7[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x4dab25['query']);_0x23efd7[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x23efd7['model'],_0x23efd7[_0x1bcd('0x2c')]);_0x1818d9[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x23efd7['model'],qs['fields'](_0x4dab25[_0x1bcd('0x2c')][_0x1bcd('0x31')]));_0x1818d9[_0x1bcd('0x30')]=_0x1818d9[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0x1818d9['attributes']:_0x23efd7[_0x1bcd('0x2f')];if(_0x4dab25[_0x1bcd('0x2c')][_0x1bcd('0x3b')]){_0x1818d9[_0x1bcd('0x41')]=[{'all':!![]}];}_0x1818d9=_[_0x1bcd('0x42')]({},_0x1818d9,_0x4dab25[_0x1bcd('0x39')]);return db[_0x1bcd('0x2a')][_0x1bcd('0x43')](_0x1818d9)[_0x1bcd('0x23')](handleEntityNotFound(_0x320f84,null))[_0x1bcd('0x23')](respondWithResult(_0x320f84,null))[_0x1bcd('0x3e')](handleError(_0x320f84,null));};exports[_0x1bcd('0x44')]=function(_0x361977,_0xa04945){return db[_0x1bcd('0x2a')][_0x1bcd('0x44')](_0x361977[_0x1bcd('0x45')],{})['then'](function(_0x5e5a33){var _0x1c115a=_0x361977[_0x1bcd('0x46')][_0x1bcd('0x47')]({'plain':!![]});if(!_0x1c115a)throw new Error(_0x1bcd('0x48'));if(_0x1c115a[_0x1bcd('0x49')]==='user'){var _0x1376c3=_0x5e5a33[_0x1bcd('0x47')]({'plain':!![]});var _0x523da3=_0x1bcd('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x523da3,'userProfileId':_0x1c115a['userProfileId']},'raw':!![]})[_0x1bcd('0x23')](function(_0x34904d){if(_0x34904d&&_0x34904d[_0x1bcd('0x4b')]===0x0){return db[_0x1bcd('0x25')][_0x1bcd('0x44')]({'name':_0x1376c3[_0x1bcd('0x28')],'resourceId':_0x1376c3['id'],'type':_0x34904d[_0x1bcd('0x28')],'sectionId':_0x34904d['id']},{})[_0x1bcd('0x23')](function(){return _0x5e5a33;});}else{return _0x5e5a33;}})[_0x1bcd('0x3e')](function(_0x3d8f83){logger[_0x1bcd('0x27')](_0x1bcd('0x4c'),_0x3d8f83);throw _0x3d8f83;});}return _0x5e5a33;})['then'](respondWithResult(_0xa04945,0xc9))[_0x1bcd('0x3e')](handleError(_0xa04945,null));};exports['update']=function(_0xe1f92,_0xfa2b2f){if(_0xe1f92[_0x1bcd('0x45')]['id']){delete _0xe1f92[_0x1bcd('0x45')]['id'];}return db[_0x1bcd('0x2a')][_0x1bcd('0x43')]({'where':{'id':_0xe1f92[_0x1bcd('0x4d')]['id']}})['then'](handleEntityNotFound(_0xfa2b2f,null))[_0x1bcd('0x23')](saveUpdates(_0xe1f92[_0x1bcd('0x45')],null))[_0x1bcd('0x23')](respondWithResult(_0xfa2b2f,null))[_0x1bcd('0x3e')](handleError(_0xfa2b2f,null));};exports[_0x1bcd('0x24')]=function(_0x4de844,_0x4ac031){return db[_0x1bcd('0x2a')][_0x1bcd('0x43')]({'where':{'id':_0x4de844[_0x1bcd('0x4d')]['id']}})[_0x1bcd('0x23')](handleEntityNotFound(_0x4ac031,null))[_0x1bcd('0x23')](removeEntity(_0x4ac031,null))[_0x1bcd('0x3e')](handleError(_0x4ac031,null));};exports[_0x1bcd('0x4e')]=function(_0x5eb026,_0x5812cb){return db[_0x1bcd('0x2a')][_0x1bcd('0x4e')]()[_0x1bcd('0x23')](respondWithResult(_0x5812cb,null))['catch'](handleError(_0x5812cb,null));};exports['addContacts']=function(_0xe25a7c,_0x51275a,_0x18af40){return db[_0x1bcd('0x4f')][_0x1bcd('0x43')]({'where':{'id':_0xe25a7c[_0x1bcd('0x4d')]['id']}})[_0x1bcd('0x23')](handleEntityNotFound(_0x51275a,null))[_0x1bcd('0x23')](function(_0x418689){if(_0x418689){return _0x418689[_0x1bcd('0x50')](_0xe25a7c[_0x1bcd('0x45')][_0x1bcd('0x51')],_['omit'](_0xe25a7c[_0x1bcd('0x45')],[_0x1bcd('0x51'),'id'])||{});}})['then'](respondWithResult(_0x51275a,null))['catch'](handleError(_0x51275a,null));};exports['getContacts']=function(_0x1f147b,_0x5d6280,_0x3ed84f){var _0xe7c08c={};var _0x29c08f={};var _0x584692;var _0x5c6cfd;return db[_0x1bcd('0x2a')][_0x1bcd('0x52')]({'where':{'id':_0x1f147b['params']['id']}})['then'](handleEntityNotFound(_0x5d6280,null))[_0x1bcd('0x23')](function(_0x4ce427){if(_0x4ce427){_0x584692=_0x4ce427;_0x29c08f[_0x1bcd('0x2f')]=_[_0x1bcd('0x2b')](db[_0x1bcd('0x4f')][_0x1bcd('0x40')]);_0x29c08f[_0x1bcd('0x2c')]=_[_0x1bcd('0x2b')](_0x1f147b[_0x1bcd('0x2c')]);_0x29c08f[_0x1bcd('0x2d')]=_[_0x1bcd('0x2e')](_0x29c08f[_0x1bcd('0x2f')],_0x29c08f[_0x1bcd('0x2c')]);_0xe7c08c[_0x1bcd('0x30')]=_[_0x1bcd('0x2e')](_0x29c08f[_0x1bcd('0x2f')],qs['fields'](_0x1f147b['query'][_0x1bcd('0x31')]));_0xe7c08c['attributes']=_0xe7c08c[_0x1bcd('0x30')][_0x1bcd('0x32')]?_0xe7c08c['attributes']:_0x29c08f['model'];_0xe7c08c[_0x1bcd('0x35')]=qs[_0x1bcd('0x53')](_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x53')]);_0xe7c08c[_0x1bcd('0x36')]=qs['filters'](_[_0x1bcd('0x54')](_0x1f147b[_0x1bcd('0x2c')],_0x29c08f[_0x1bcd('0x2d')]));if(_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x37')]){_0xe7c08c[_0x1bcd('0x36')]=_[_0x1bcd('0x42')](_0xe7c08c['where'],{'$or':_[_0x1bcd('0x38')](_0xe7c08c['attributes'],function(_0x233152){var _0x3774ea={};_0x3774ea[_0x233152]={'$like':'%'+_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x37')]+'%'};return _0x3774ea;})});}_0xe7c08c=_['merge']({},_0xe7c08c,_0x1f147b[_0x1bcd('0x39')]);return _0x584692[_0x1bcd('0x55')](_0xe7c08c);}})[_0x1bcd('0x23')](function(_0x4843ec){if(_0x4843ec){_0x5c6cfd=_0x4843ec[_0x1bcd('0x32')];if(!_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x33')](_0x1bcd('0x34'))){_0xe7c08c[_0x1bcd('0x1c')]=qs['limit'](_0x1f147b[_0x1bcd('0x2c')][_0x1bcd('0x1c')]);_0xe7c08c[_0x1bcd('0x1b')]=qs[_0x1bcd('0x1b')](_0x1f147b['query']['offset']);}return _0x584692['getContacts'](_0xe7c08c);}})[_0x1bcd('0x23')](function(_0x417599){if(_0x417599){return _0x417599?{'count':_0x5c6cfd,'rows':_0x417599}:null;}})[_0x1bcd('0x23')](respondWithResult(_0x5d6280,null))[_0x1bcd('0x3e')](handleError(_0x5d6280,null));};
\ No newline at end of file
+var _0x9f5b=['squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','stack','name','index','CmCompany','describe','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','addContacts','CmContact','ids','findOne','map','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash'];(function(_0x168bf8,_0xb7f2bc){var _0x271322=function(_0x3e30b6){while(--_0x3e30b6){_0x168bf8['push'](_0x168bf8['shift']());}};_0x271322(++_0xb7f2bc);}(_0x9f5b,0x18c));var _0xb9f5=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x9f5b[_0x2b737c];return _0x466ed5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb9f5('0x0'));var jsonpatch=require(_0xb9f5('0x1'));var rp=require(_0xb9f5('0x2'));var moment=require(_0xb9f5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb9f5('0x4'));var path=require('path');var sox=require(_0xb9f5('0x5'));var csv=require(_0xb9f5('0x6'));var ejs=require(_0xb9f5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9f5('0x8'));var squel=require(_0xb9f5('0x9'));var crypto=require(_0xb9f5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xb9f5('0xb'));var toCsv=require(_0xb9f5('0x6'));var querystring=require(_0xb9f5('0xc'));var Papa=require(_0xb9f5('0xd'));var Redis=require('ioredis');var authService=require(_0xb9f5('0xe'));var qs=require(_0xb9f5('0xf'));var as=require(_0xb9f5('0x10'));var hardwareService=require(_0xb9f5('0x11'));var logger=require(_0xb9f5('0x12'))('api');var utils=require(_0xb9f5('0x13'));var config=require(_0xb9f5('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb29c63,_0x22784e){_0x22784e=_0x22784e||0xcc;return function(_0x400dce){if(_0x400dce){return _0xb29c63[_0xb9f5('0x15')](_0x22784e);}return _0xb29c63['status'](_0x22784e)[_0xb9f5('0x16')]();};}function respondWithResult(_0x39190f,_0x963a51){_0x963a51=_0x963a51||0xc8;return function(_0xf9bc23){if(_0xf9bc23){return _0x39190f['status'](_0x963a51)[_0xb9f5('0x17')](_0xf9bc23);}};}function respondWithFilteredResult(_0x12c688,_0x2341f5){return function(_0x474865){if(_0x474865){var _0x57f1c0=typeof _0x2341f5[_0xb9f5('0x18')]===_0xb9f5('0x19')&&typeof _0x2341f5[_0xb9f5('0x1a')]===_0xb9f5('0x19');var _0x207175=_0x474865['count'];var _0x4453f7=_0x57f1c0?0x0:_0x2341f5['offset'];var _0x1aa200=_0x57f1c0?_0x474865[_0xb9f5('0x1b')]:_0x2341f5[_0xb9f5('0x18')]+_0x2341f5[_0xb9f5('0x1a')];var _0x57a7e4;if(_0x1aa200>=_0x207175){_0x1aa200=_0x207175;_0x57a7e4=0xc8;}else{_0x57a7e4=0xce;}_0x12c688[_0xb9f5('0x1c')](_0x57a7e4);return _0x12c688[_0xb9f5('0x1d')](_0xb9f5('0x1e'),_0x4453f7+'-'+_0x1aa200+'/'+_0x207175)[_0xb9f5('0x17')](_0x474865);}return null;};}function patchUpdates(_0x4cc32d){return function(_0x37065d){try{jsonpatch[_0xb9f5('0x1f')](_0x37065d,_0x4cc32d,!![]);}catch(_0x25b2bb){return BPromise[_0xb9f5('0x20')](_0x25b2bb);}return _0x37065d[_0xb9f5('0x21')]();};}function saveUpdates(_0x3af981,_0x2f0284){return function(_0x148f1d){if(_0x148f1d){return _0x148f1d[_0xb9f5('0x22')](_0x3af981)[_0xb9f5('0x23')](function(_0x65f2c3){return _0x65f2c3;});}return null;};}function removeEntity(_0x5ca233,_0x36c7e8){return function(_0x3893e0){if(_0x3893e0){return _0x3893e0['destroy']()[_0xb9f5('0x23')](function(){var _0x1959c3=_0x3893e0[_0xb9f5('0x24')]({'plain':!![]});var _0x3c9928=_0xb9f5('0x25');return db[_0xb9f5('0x26')][_0xb9f5('0x27')]({'where':{'type':_0x3c9928,'resourceId':_0x1959c3['id']}})[_0xb9f5('0x23')](function(){return _0x3893e0;});})['then'](function(){_0x5ca233[_0xb9f5('0x1c')](0xcc)[_0xb9f5('0x16')]();});}};}function handleEntityNotFound(_0x51c325,_0x3bf30d){return function(_0x36c1b3){if(!_0x36c1b3){_0x51c325[_0xb9f5('0x15')](0x194);}return _0x36c1b3;};}function handleError(_0x2b22fa,_0x51b395){_0x51b395=_0x51b395||0x1f4;return function(_0x3be2fd){logger['error'](_0x3be2fd[_0xb9f5('0x28')]);if(_0x3be2fd[_0xb9f5('0x29')]){delete _0x3be2fd[_0xb9f5('0x29')];}_0x2b22fa[_0xb9f5('0x1c')](_0x51b395)['send'](_0x3be2fd);};}exports[_0xb9f5('0x2a')]=function(_0x5dd809,_0x4cbd76){var _0x17688b={},_0x35f630={},_0x4e446e={'count':0x0,'rows':[]};return db[_0xb9f5('0x2b')][_0xb9f5('0x2c')]()[_0xb9f5('0x23')](function(_0x421375){_0x35f630[_0xb9f5('0x2d')]=_['keys'](_0x421375);_0x35f630[_0xb9f5('0x2e')]=_[_0xb9f5('0x2f')](_0x5dd809[_0xb9f5('0x2e')]);_0x35f630[_0xb9f5('0x30')]=_['intersection'](_0x35f630['model'],_0x35f630[_0xb9f5('0x2e')]);_0x17688b[_0xb9f5('0x31')]=_[_0xb9f5('0x32')](_0x35f630[_0xb9f5('0x2d')],qs[_0xb9f5('0x33')](_0x5dd809['query']['fields']));_0x17688b[_0xb9f5('0x31')]=_0x17688b['attributes'][_0xb9f5('0x34')]?_0x17688b['attributes']:_0x35f630[_0xb9f5('0x2d')];if(!_0x5dd809['query'][_0xb9f5('0x35')](_0xb9f5('0x36'))){_0x17688b[_0xb9f5('0x1a')]=qs[_0xb9f5('0x1a')](_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x1a')]);_0x17688b['offset']=qs[_0xb9f5('0x18')](_0x5dd809['query'][_0xb9f5('0x18')]);}_0x17688b[_0xb9f5('0x37')]=qs[_0xb9f5('0x38')](_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x38')]);_0x17688b[_0xb9f5('0x39')]=qs['filters'](_[_0xb9f5('0x3a')](_0x5dd809['query'],_0x35f630[_0xb9f5('0x30')]),_0x421375);if(_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x3b')]){_0x17688b['where']=_[_0xb9f5('0x3c')](_0x17688b[_0xb9f5('0x39')],{'$or':_['map'](_0x17688b['attributes'],function(_0x3b2ef1){var _0x4b1a1b={};_0x4b1a1b[_0x3b2ef1]={'$like':'%'+_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x3b')]+'%'};return _0x4b1a1b;})});}_0x17688b=_[_0xb9f5('0x3c')]({},_0x17688b,_0x5dd809[_0xb9f5('0x3d')]);var _0x20f1b8={'where':_0x17688b[_0xb9f5('0x39')]};return db['CmCompany']['count'](_0x20f1b8)[_0xb9f5('0x23')](function(_0xe0d125){_0x4e446e[_0xb9f5('0x1b')]=_0xe0d125;if(_0x5dd809[_0xb9f5('0x2e')][_0xb9f5('0x3e')]){_0x17688b[_0xb9f5('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0xb9f5('0x40')](_0x17688b);})['then'](function(_0x42d1bf){_0x4e446e['rows']=_0x42d1bf;return _0x4e446e;})[_0xb9f5('0x23')](respondWithFilteredResult(_0x4cbd76,_0x17688b))[_0xb9f5('0x41')](handleError(_0x4cbd76,null));})[_0xb9f5('0x41')](handleError(_0x4cbd76,null));};exports['show']=function(_0x1dc586,_0x570eaf){var _0xa6eaea={'raw':![],'where':{'id':_0x1dc586[_0xb9f5('0x42')]['id']}},_0x2b93cc={};_0x2b93cc['model']=_['keys'](db['CmCompany']['rawAttributes']);_0x2b93cc[_0xb9f5('0x2e')]=_[_0xb9f5('0x2f')](_0x1dc586[_0xb9f5('0x2e')]);_0x2b93cc[_0xb9f5('0x30')]=_['intersection'](_0x2b93cc[_0xb9f5('0x2d')],_0x2b93cc['query']);_0xa6eaea[_0xb9f5('0x31')]=_['intersection'](_0x2b93cc[_0xb9f5('0x2d')],qs[_0xb9f5('0x33')](_0x1dc586['query'][_0xb9f5('0x33')]));_0xa6eaea[_0xb9f5('0x31')]=_0xa6eaea['attributes']['length']?_0xa6eaea['attributes']:_0x2b93cc['model'];if(_0x1dc586['query'][_0xb9f5('0x3e')]){_0xa6eaea[_0xb9f5('0x3f')]=[{'all':!![]}];}_0xa6eaea=_[_0xb9f5('0x3c')]({},_0xa6eaea,_0x1dc586[_0xb9f5('0x3d')]);return db[_0xb9f5('0x2b')][_0xb9f5('0x43')](_0xa6eaea)[_0xb9f5('0x23')](handleEntityNotFound(_0x570eaf,null))['then'](respondWithResult(_0x570eaf,null))[_0xb9f5('0x41')](handleError(_0x570eaf,null));};exports[_0xb9f5('0x44')]=function(_0x3c79dd,_0x207f29){return db[_0xb9f5('0x2b')][_0xb9f5('0x44')](_0x3c79dd[_0xb9f5('0x45')],{})[_0xb9f5('0x23')](function(_0x8bbb5b){var _0x4765f5=_0x3c79dd[_0xb9f5('0x46')][_0xb9f5('0x24')]({'plain':!![]});if(!_0x4765f5)throw new Error(_0xb9f5('0x47'));if(_0x4765f5[_0xb9f5('0x48')]===_0xb9f5('0x46')){var _0x35f8c8=_0x8bbb5b['get']({'plain':!![]});var _0x1b73f1=_0xb9f5('0x25');return db['UserProfileSection'][_0xb9f5('0x43')]({'where':{'name':_0x1b73f1,'userProfileId':_0x4765f5[_0xb9f5('0x49')]},'raw':!![]})[_0xb9f5('0x23')](function(_0x22bb21){if(_0x22bb21&&_0x22bb21[_0xb9f5('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x35f8c8[_0xb9f5('0x29')],'resourceId':_0x35f8c8['id'],'type':_0x22bb21[_0xb9f5('0x29')],'sectionId':_0x22bb21['id']},{})['then'](function(){return _0x8bbb5b;});}else{return _0x8bbb5b;}})[_0xb9f5('0x41')](function(_0x3473ff){logger[_0xb9f5('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3473ff);throw _0x3473ff;});}return _0x8bbb5b;})['then'](respondWithResult(_0x207f29,0xc9))[_0xb9f5('0x41')](handleError(_0x207f29,null));};exports[_0xb9f5('0x22')]=function(_0x43f9a8,_0x4d9ab2){if(_0x43f9a8['body']['id']){delete _0x43f9a8[_0xb9f5('0x45')]['id'];}return db[_0xb9f5('0x2b')][_0xb9f5('0x43')]({'where':{'id':_0x43f9a8[_0xb9f5('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d9ab2,null))['then'](saveUpdates(_0x43f9a8[_0xb9f5('0x45')],null))[_0xb9f5('0x23')](respondWithResult(_0x4d9ab2,null))[_0xb9f5('0x41')](handleError(_0x4d9ab2,null));};exports[_0xb9f5('0x27')]=function(_0x148069,_0x1f97e5){return db['CmCompany'][_0xb9f5('0x43')]({'where':{'id':_0x148069[_0xb9f5('0x42')]['id']}})[_0xb9f5('0x23')](handleEntityNotFound(_0x1f97e5,null))[_0xb9f5('0x23')](removeEntity(_0x1f97e5,null))[_0xb9f5('0x41')](handleError(_0x1f97e5,null));};exports[_0xb9f5('0x2c')]=function(_0x27626c,_0x29937e){return db['CmCompany']['describe']()[_0xb9f5('0x23')](respondWithResult(_0x29937e,null))[_0xb9f5('0x41')](handleError(_0x29937e,null));};exports[_0xb9f5('0x4c')]=function(_0x557615,_0x1c438a,_0x55f0b6){return db[_0xb9f5('0x4d')][_0xb9f5('0x43')]({'where':{'id':_0x557615[_0xb9f5('0x42')]['id']}})[_0xb9f5('0x23')](handleEntityNotFound(_0x1c438a,null))['then'](function(_0xb89cf){if(_0xb89cf){return _0xb89cf['addContacts'](_0x557615[_0xb9f5('0x45')][_0xb9f5('0x4e')],_['omit'](_0x557615[_0xb9f5('0x45')],[_0xb9f5('0x4e'),'id'])||{});}})[_0xb9f5('0x23')](respondWithResult(_0x1c438a,null))[_0xb9f5('0x41')](handleError(_0x1c438a,null));};exports['getContacts']=function(_0x175fdd,_0x542c6a,_0x42098a){var _0x2955bf={};var _0x3e2504={};var _0x4e3cc3;var _0x40076c;return db[_0xb9f5('0x2b')][_0xb9f5('0x4f')]({'where':{'id':_0x175fdd[_0xb9f5('0x42')]['id']}})[_0xb9f5('0x23')](handleEntityNotFound(_0x542c6a,null))['then'](function(_0x19c139){if(_0x19c139){_0x4e3cc3=_0x19c139;_0x3e2504[_0xb9f5('0x2d')]=_[_0xb9f5('0x2f')](db[_0xb9f5('0x4d')]['rawAttributes']);_0x3e2504['query']=_[_0xb9f5('0x2f')](_0x175fdd['query']);_0x3e2504['filters']=_[_0xb9f5('0x32')](_0x3e2504['model'],_0x3e2504[_0xb9f5('0x2e')]);_0x2955bf[_0xb9f5('0x31')]=_[_0xb9f5('0x32')](_0x3e2504['model'],qs[_0xb9f5('0x33')](_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x33')]));_0x2955bf[_0xb9f5('0x31')]=_0x2955bf[_0xb9f5('0x31')]['length']?_0x2955bf['attributes']:_0x3e2504[_0xb9f5('0x2d')];_0x2955bf[_0xb9f5('0x37')]=qs[_0xb9f5('0x38')](_0x175fdd['query']['sort']);_0x2955bf['where']=qs['filters'](_[_0xb9f5('0x3a')](_0x175fdd[_0xb9f5('0x2e')],_0x3e2504['filters']));if(_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x3b')]){_0x2955bf[_0xb9f5('0x39')]=_[_0xb9f5('0x3c')](_0x2955bf[_0xb9f5('0x39')],{'$or':_[_0xb9f5('0x50')](_0x2955bf[_0xb9f5('0x31')],function(_0x406eff){var _0x517880={};_0x517880[_0x406eff]={'$like':'%'+_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x3b')]+'%'};return _0x517880;})});}_0x2955bf=_[_0xb9f5('0x3c')]({},_0x2955bf,_0x175fdd[_0xb9f5('0x3d')]);return _0x4e3cc3['getContacts'](_0x2955bf);}})['then'](function(_0x2b6252){if(_0x2b6252){_0x40076c=_0x2b6252[_0xb9f5('0x34')];if(!_0x175fdd[_0xb9f5('0x2e')]['hasOwnProperty'](_0xb9f5('0x36'))){_0x2955bf[_0xb9f5('0x1a')]=qs[_0xb9f5('0x1a')](_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x1a')]);_0x2955bf['offset']=qs[_0xb9f5('0x18')](_0x175fdd[_0xb9f5('0x2e')][_0xb9f5('0x18')]);}return _0x4e3cc3['getContacts'](_0x2955bf);}})[_0xb9f5('0x23')](function(_0x254e45){if(_0x254e45){return _0x254e45?{'count':_0x40076c,'rows':_0x254e45}:null;}})[_0xb9f5('0x23')](respondWithResult(_0x542c6a,null))['catch'](handleError(_0x542c6a,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 9cfea6a..ff53a95 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 _0xee20=['api','moment','request-promise','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util'];(function(_0x1b7523,_0x51b4e9){var _0x1dc12e=function(_0x2573f3){while(--_0x2573f3){_0x1b7523['push'](_0x1b7523['shift']());}};_0x1dc12e(++_0x51b4e9);}(_0xee20,0x18a));var _0x0ee2=function(_0x999162,_0x289750){_0x999162=_0x999162-0x0;var _0x4f899a=_0xee20[_0x999162];return _0x4f899a;};'use strict';var _=require(_0x0ee2('0x0'));var util=require(_0x0ee2('0x1'));var logger=require('../../config/logger')(_0x0ee2('0x2'));var moment=require(_0x0ee2('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ee2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ee2('0x5'));var config=require('../../config/environment');var attributes=require(_0x0ee2('0x6'));module[_0x0ee2('0x7')]=function(_0x21f993,_0x583cfe){return _0x21f993[_0x0ee2('0x8')](_0x0ee2('0x9'),attributes,{'tableName':_0x0ee2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d8c=['./cmCompany.attributes','exports','define','CmCompany','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x2b3c9d,_0x1c8c0c){var _0x4b8037=function(_0x225327){while(--_0x225327){_0x2b3c9d['push'](_0x2b3c9d['shift']());}};_0x4b8037(++_0x1c8c0c);}(_0x7d8c,0x7d));var _0xc7d8=function(_0x54b0df,_0x5d8e9a){_0x54b0df=_0x54b0df-0x0;var _0x5a0872=_0x7d8c[_0x54b0df];return _0x5a0872;};'use strict';var _=require('lodash');var util=require(_0xc7d8('0x0'));var logger=require(_0xc7d8('0x1'))(_0xc7d8('0x2'));var moment=require(_0xc7d8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7d8('0x4'));var rimraf=require(_0xc7d8('0x5'));var config=require(_0xc7d8('0x6'));var attributes=require(_0xc7d8('0x7'));module[_0xc7d8('0x8')]=function(_0x1c1dfd,_0x228f38){return _0x1c1dfd[_0xc7d8('0x9')](_0xc7d8('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index e87fe5b..de23667 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 _0xde9b=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','CmCompany,\x20%s,\x20%s'];(function(_0x5dbd29,_0xc9dd40){var _0x577f92=function(_0x42b53c){while(--_0x42b53c){_0x5dbd29['push'](_0x5dbd29['shift']());}};_0x577f92(++_0xc9dd40);}(_0xde9b,0xc9));var _0xbde9=function(_0x460e6d,_0x26bbf9){_0x460e6d=_0x460e6d-0x0;var _0x288333=_0xde9b[_0x460e6d];return _0x288333;};'use strict';var _=require(_0xbde9('0x0'));var util=require(_0xbde9('0x1'));var moment=require(_0xbde9('0x2'));var BPromise=require(_0xbde9('0x3'));var rs=require(_0xbde9('0x4'));var fs=require('fs');var Redis=require(_0xbde9('0x5'));var db=require(_0xbde9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbde9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbde9('0x8'));var client=jayson[_0xbde9('0x9')][_0xbde9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe64b86,_0x298185,_0x3760b7){return new BPromise(function(_0x4aacb0,_0x257d52){return client[_0xbde9('0xb')](_0xe64b86,_0x3760b7)[_0xbde9('0xc')](function(_0x3b9036){logger[_0xbde9('0xd')]('CmCompany,\x20%s,\x20%s',_0x298185,_0xbde9('0xe'));logger[_0xbde9('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x298185,'request\x20sent',JSON[_0xbde9('0x10')](_0x3b9036));if(_0x3b9036['error']){if(_0x3b9036['error']['code']===0x1f4){logger[_0xbde9('0x11')](_0xbde9('0x12'),_0x298185,_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);return _0x257d52(_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);}logger[_0xbde9('0x11')](_0xbde9('0x12'),_0x298185,_0x3b9036[_0xbde9('0x11')][_0xbde9('0x13')]);return _0x4aacb0(_0x3b9036[_0xbde9('0x11')]['message']);}else{logger[_0xbde9('0xd')](_0xbde9('0x12'),_0x298185,_0xbde9('0xe'));_0x4aacb0(_0x3b9036[_0xbde9('0x14')]['message']);}})[_0xbde9('0x15')](function(_0x439187){logger[_0xbde9('0x11')]('CmCompany,\x20%s,\x20%s',_0x298185,_0x439187);_0x257d52(_0x439187);});});}
\ No newline at end of file
+var _0xea41=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','error','code','CmCompany,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x25e430,_0xa18ab6){var _0x286e8b=function(_0x4a734a){while(--_0x4a734a){_0x25e430['push'](_0x25e430['shift']());}};_0x286e8b(++_0xa18ab6);}(_0xea41,0x104));var _0x1ea4=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xea41[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x1ea4('0x0'));var util=require(_0x1ea4('0x1'));var moment=require(_0x1ea4('0x2'));var BPromise=require(_0x1ea4('0x3'));var rs=require(_0x1ea4('0x4'));var fs=require('fs');var Redis=require(_0x1ea4('0x5'));var db=require(_0x1ea4('0x6'))['db'];var utils=require(_0x1ea4('0x7'));var logger=require(_0x1ea4('0x8'))(_0x1ea4('0x9'));var config=require(_0x1ea4('0xa'));var jayson=require(_0x1ea4('0xb'));var client=jayson[_0x1ea4('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x337753,_0x4d6f72,_0x4e4cc0){return new BPromise(function(_0x8c7e6,_0x350d38){return client[_0x1ea4('0xd')](_0x337753,_0x4e4cc0)[_0x1ea4('0xe')](function(_0x345ede){logger['info']('CmCompany,\x20%s,\x20%s',_0x4d6f72,_0x1ea4('0xf'));logger[_0x1ea4('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x4d6f72,_0x1ea4('0xf'),JSON['stringify'](_0x345ede));if(_0x345ede[_0x1ea4('0x11')]){if(_0x345ede[_0x1ea4('0x11')][_0x1ea4('0x12')]===0x1f4){logger[_0x1ea4('0x11')](_0x1ea4('0x13'),_0x4d6f72,_0x345ede[_0x1ea4('0x11')][_0x1ea4('0x14')]);return _0x350d38(_0x345ede[_0x1ea4('0x11')][_0x1ea4('0x14')]);}logger[_0x1ea4('0x11')](_0x1ea4('0x13'),_0x4d6f72,_0x345ede['error'][_0x1ea4('0x14')]);return _0x8c7e6(_0x345ede['error'][_0x1ea4('0x14')]);}else{logger[_0x1ea4('0x15')](_0x1ea4('0x13'),_0x4d6f72,_0x1ea4('0xf'));_0x8c7e6(_0x345ede[_0x1ea4('0x16')][_0x1ea4('0x14')]);}})[_0x1ea4('0x17')](function(_0x2d2155){logger[_0x1ea4('0x11')](_0x1ea4('0x13'),_0x4d6f72,_0x2d2155);_0x350d38(_0x2d2155);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 50b3cd8..d32190e 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 _0x06a7=['/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x06a7,0x18f));var _0x706a=function(_0x2e2d89,_0x4bb615){_0x2e2d89=_0x2e2d89-0x0;var _0x3aba90=_0x06a7[_0x2e2d89];return _0x3aba90;};'use strict';var multer=require(_0x706a('0x0'));var util=require(_0x706a('0x1'));var path=require(_0x706a('0x2'));var timeout=require('connect-timeout');var express=require(_0x706a('0x3'));var router=express[_0x706a('0x4')]();var fs_extra=require(_0x706a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x706a('0x6'));var controller=require(_0x706a('0x7'));router[_0x706a('0x8')]('/',auth[_0x706a('0x9')](),controller[_0x706a('0xa')]);router[_0x706a('0x8')](_0x706a('0xb'),auth[_0x706a('0x9')](),controller[_0x706a('0xc')]);router[_0x706a('0x8')](_0x706a('0xd'),auth[_0x706a('0x9')](),controller[_0x706a('0xe')]);router[_0x706a('0x8')](_0x706a('0xf'),auth[_0x706a('0x9')](),controller[_0x706a('0x10')]);router[_0x706a('0x11')]('/',auth[_0x706a('0x9')](),controller['create']);router[_0x706a('0x11')](_0x706a('0xf'),auth['isAuthenticated'](),controller[_0x706a('0x12')]);router[_0x706a('0x13')](_0x706a('0xd'),auth[_0x706a('0x9')](),controller[_0x706a('0x14')]);router[_0x706a('0x15')](_0x706a('0xd'),auth['isAuthenticated'](),controller[_0x706a('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xd634=['index','/describe','/:id/contacts','post','addContacts','put','/:id','update','delete','exports','util','path','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xd634,0xf4));var _0x4d63=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xd634[_0x2aa0e7];return _0x1472c0;};'use strict';var multer=require('multer');var util=require(_0x4d63('0x0'));var path=require(_0x4d63('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d63('0x2')]();var fs_extra=require(_0x4d63('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d63('0x4'));var controller=require(_0x4d63('0x5'));router[_0x4d63('0x6')]('/',auth[_0x4d63('0x7')](),controller[_0x4d63('0x8')]);router[_0x4d63('0x6')](_0x4d63('0x9'),auth[_0x4d63('0x7')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4d63('0x6')](_0x4d63('0xa'),auth[_0x4d63('0x7')](),controller['getContacts']);router[_0x4d63('0xb')]('/',auth[_0x4d63('0x7')](),controller['create']);router['post'](_0x4d63('0xa'),auth['isAuthenticated'](),controller[_0x4d63('0xc')]);router[_0x4d63('0xd')](_0x4d63('0xe'),auth[_0x4d63('0x7')](),controller[_0x4d63('0xf')]);router[_0x4d63('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4d63('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index fdc612c..f5571fc 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 _0xb10b=['TEXT','INTEGER','UNSIGNED','DATE','lodash','exports','STRING'];(function(_0x1fc9da,_0x2675d5){var _0x52065c=function(_0x488ad1){while(--_0x488ad1){_0x1fc9da['push'](_0x1fc9da['shift']());}};_0x52065c(++_0x2675d5);}(_0xb10b,0x12a));var _0xbb10=function(_0x614c88,_0x184f02){_0x614c88=_0x614c88-0x0;var _0x1a768e=_0xb10b[_0x614c88];return _0x1a768e;};'use strict';var _=require(_0xbb10('0x0'));var Sequelize=require('sequelize');module[_0xbb10('0x1')]={'firstName':{'type':Sequelize[_0xbb10('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbb10('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xbb10('0x2')]},'city':{'type':Sequelize[_0xbb10('0x2')]},'country':{'type':Sequelize[_0xbb10('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbb10('0x2')]},'description':{'type':Sequelize[_0xbb10('0x3')]},'phone':{'type':Sequelize[_0xbb10('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb10('0x2')]},'email':{'type':Sequelize[_0xbb10('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xbb10('0x2')]},'fb_data':{'type':Sequelize[_0xbb10('0x2')]},'twitter':{'type':Sequelize[_0xbb10('0x2')]},'skype':{'type':Sequelize[_0xbb10('0x2')]},'teams':{'type':Sequelize[_0xbb10('0x2')]},'viber':{'type':Sequelize[_0xbb10('0x2')]},'line':{'type':Sequelize[_0xbb10('0x2')]},'wechat':{'type':Sequelize[_0xbb10('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0xbb10('0x4')](0x2)[_0xbb10('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xbb10('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x5f66=['sequelize','STRING','INTEGER','DATE'];(function(_0x371f33,_0x278a69){var _0x246c96=function(_0x4f8bad){while(--_0x4f8bad){_0x371f33['push'](_0x371f33['shift']());}};_0x246c96(++_0x278a69);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var Sequelize=require(_0x65f6('0x0'));module['exports']={'firstName':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0x65f6('0x1')]},'street':{'type':Sequelize[_0x65f6('0x1')]},'postalCode':{'type':Sequelize[_0x65f6('0x1')]},'city':{'type':Sequelize[_0x65f6('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x65f6('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x65f6('0x1')]},'mobile':{'type':Sequelize[_0x65f6('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x65f6('0x1')]},'facebook':{'type':Sequelize[_0x65f6('0x1')]},'fb_data':{'type':Sequelize[_0x65f6('0x1')]},'twitter':{'type':Sequelize[_0x65f6('0x1')]},'skype':{'type':Sequelize[_0x65f6('0x1')]},'teams':{'type':Sequelize[_0x65f6('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x65f6('0x1')]},'telegram':{'type':Sequelize[_0x65f6('0x1')]},'UserId':{'type':Sequelize[_0x65f6('0x2')]},'priority':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x65f6('0x3')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x65f6('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index cb6b498..42dde2b 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 _0x5aad=['FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','timezones','utcOffset','each','duplicates','$or','findOrCreate','Tag','$and','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','ContactId','include','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','join','root','server/files/tmp','file','filename','0777','CompanyId','pid','createReadStream','parse','meta','binding','firstName','No\x20firstName\x20column\x20specified','fork','stringify','message','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','voice','resolve','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','findAndCountAll','startCase','secondDisposition','UserId','Account','Owner','fullname','color','chat','customerPort','osName','ratingMessage','ratingType','ratingValue','subject','substatus','externalUrl','threadId','Interaction','all','flatten','sortBy','reverse','bluebird','util','path','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','count','limit','Content-Range','update','then','destroy','end','error','stack','name','send','describe','keys','startsWith','cf_','push','findOne','trimStart','fieldType','type','model','query','filters','attributes','intersection','length','nolimit','order','sort','where','pick','select','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','split','map','forEach','union','and','datetime','castTo','buildExpression','text','start','hasOwnProperty','isNil','Contact','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','clone','DESC','isEmpty','having','user','role','agent','some','User','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','fields','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','CmContact','params','tags','columnName','analytics','CmCustomField','findAll','displayName','alias','custom','values','body','get','mergeWith','isArray','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','MailMessage','MailInteraction','SmsInteraction'];(function(_0x38fae4,_0x2f54ce){var _0x5d0c95=function(_0x4d10ef){while(--_0x4d10ef){_0x38fae4['push'](_0x38fae4['shift']());}};_0x5d0c95(++_0x2f54ce);}(_0x5aad,0x78));var _0xd5aa=function(_0x1c6bbd,_0x467c08){_0x1c6bbd=_0x1c6bbd-0x0;var _0x3cd37f=_0x5aad[_0x1c6bbd];return _0x3cd37f;};'use strict';var moment=require('moment');var BPromise=require(_0xd5aa('0x0'));var util=require(_0xd5aa('0x1'));var path=require(_0xd5aa('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd5aa('0x3'));var Papa=require(_0xd5aa('0x4'));var Redis=require(_0xd5aa('0x5'));var qs=require(_0xd5aa('0x6'));var as=require(_0xd5aa('0x7'));var logger=require('../../config/logger')(_0xd5aa('0x8'));var config=require(_0xd5aa('0x9'));var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xd5aa('0xa')],{'host':_0xd5aa('0xb'),'port':0x18eb});var socket=require(_0xd5aa('0xc'))(new Redis(config[_0xd5aa('0xa')]));require('./cmContact.socket')[_0xd5aa('0xd')](socket);function respondWithResult(_0x517276,_0x330a91){_0x330a91=_0x330a91||0xc8;return function(_0x50fc8c){if(_0x50fc8c){return _0x517276[_0xd5aa('0xe')](_0x330a91)[_0xd5aa('0xf')](_0x50fc8c);}};}function respondWithFilteredResult(_0x46c1f8,_0x2742c4){return function(_0xaa05f1){if(_0xaa05f1){var _0x60e879=typeof _0x2742c4[_0xd5aa('0x10')]===_0xd5aa('0x11')&&typeof _0x2742c4['limit']===_0xd5aa('0x11');var _0x55689a=_0xaa05f1[_0xd5aa('0x12')];var _0x19f4ad=_0x60e879?0x0:_0x2742c4[_0xd5aa('0x10')];var _0x2e2a42=_0x60e879?_0xaa05f1[_0xd5aa('0x12')]:_0x2742c4['offset']+_0x2742c4[_0xd5aa('0x13')];var _0x59d7fd;if(_0x2e2a42>=_0x55689a){_0x2e2a42=_0x55689a;_0x59d7fd=0xc8;}else{_0x59d7fd=0xce;}_0x46c1f8['status'](_0x59d7fd);return _0x46c1f8['set'](_0xd5aa('0x14'),_0x19f4ad+'-'+_0x2e2a42+'/'+_0x55689a)['json'](_0xaa05f1);}return null;};}function saveUpdates(_0x3db918){return function(_0x5b34a3){if(_0x5b34a3){return _0x5b34a3[_0xd5aa('0x15')](_0x3db918)[_0xd5aa('0x16')](function(_0x25845d){return _0x25845d;});}return null;};}function removeEntity(_0x4d75e4){return function(_0x2d91f4){if(_0x2d91f4){return _0x2d91f4[_0xd5aa('0x17')]()[_0xd5aa('0x16')](function(){_0x4d75e4[_0xd5aa('0xe')](0xcc)[_0xd5aa('0x18')]();});}};}function handleEntityNotFound(_0x374df7){return function(_0x422e36){if(!_0x422e36){_0x374df7['sendStatus'](0x194);}return _0x422e36;};}function handleError(_0x3561d2,_0x48dfe9){_0x48dfe9=_0x48dfe9||0x1f4;return function(_0x501c7a){logger[_0xd5aa('0x19')](_0x501c7a[_0xd5aa('0x1a')]);if(_0x501c7a[_0xd5aa('0x1b')]){delete _0x501c7a['name'];}_0x3561d2[_0xd5aa('0xe')](_0x48dfe9)[_0xd5aa('0x1c')](_0x501c7a);};}exports['index']=function(_0xaa96e5,_0x2d8dcd){var _0x5a1d78={},_0x30a9d8={},_0x76b080={'count':0x0,'rows':[]};return db['CmContact'][_0xd5aa('0x1d')]()[_0xd5aa('0x16')](function(_0x713539){var _0x5b5bf2=[];for(var _0x18c1a3=0x0;_0x18c1a3
','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','moment','randomstring','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','@xcally.com','head','name','substring','slice','join','Anonymous','split','pop','isEmpty','anonymous','generate','html','includes','attachments','forEach','filename','replace','_IMG','length','\x20[Attachment:\x20'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x41f7,0x79));var _0x741f=function(_0x4d506c,_0x495426){_0x4d506c=_0x4d506c-0x0;var _0x139058=_0x41f7[_0x4d506c];return _0x139058;};'use strict';var _=require(_0x741f('0x0'));var moment=require(_0x741f('0x1'));var random=require(_0x741f('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x741f('0x3'));var tnef=require(_0x741f('0x4'));var logger=require(_0x741f('0x5'))(_0x741f('0x6'));var config=require(_0x741f('0x7'));function getAddress(_0x35f02c){var _0xfa7ad7=_['head'](_0x35f02c[_0x741f('0x8')]);return _0xfa7ad7&&_0xfa7ad7['address']?_0xfa7ad7[_0x741f('0x9')]:'anonymous'+random['generate'](0x6)+_0x741f('0xa');}function getFirstName(_0x543d59){var _0x1a3b63=_[_0x741f('0xb')](_0x543d59[_0x741f('0x8')]);if(_0x1a3b63&&_0x1a3b63[_0x741f('0xc')]){if(_0x1a3b63[_0x741f('0xc')]==_0x1a3b63[_0x741f('0x9')]){return _0x1a3b63['name'][_0x741f('0xd')](0x0,_0x1a3b63['name']['indexOf']('@'));}var _0x59f6c6=_0x1a3b63[_0x741f('0xc')]['split'](/\s+/);return _0x59f6c6['length']>0x1?_0x59f6c6[_0x741f('0xe')](0x0,-0x1)[_0x741f('0xf')]('\x20'):_0x1a3b63['name'];}return _0x741f('0x10');}function getLastName(_0x1cce7e){var _0x567be8=_[_0x741f('0xb')](_0x1cce7e[_0x741f('0x8')]);if(_0x567be8&&_0x567be8[_0x741f('0xc')]){var _0x5c6b63=_0x567be8['name'][_0x741f('0x11')](/\s+/);return _0x5c6b63['length']>0x1?_0x5c6b63[_0x741f('0x12')]():'';}return'';}function getMails(_0x4ab0fe,_0x172a2b){var _0x39d95b='';for(var _0x56b28e=0x0;_0x56b28e<_0x172a2b[_0x741f('0x8')]['length'];_0x56b28e+=0x1){if(_0x172a2b[_0x741f('0x8')][_0x56b28e][_0x741f('0x9')]!==_0x4ab0fe){if(!_[_0x741f('0x13')](_0x39d95b)){_0x39d95b+=',';}_0x39d95b+=_0x172a2b[_0x741f('0x8')][_0x56b28e][_0x741f('0xc')]||_0x172a2b[_0x741f('0x8')][_0x56b28e]['address']||'';_0x39d95b+='\x20<';_0x39d95b+=_0x172a2b['value'][_0x56b28e][_0x741f('0x9')]?_0x172a2b[_0x741f('0x8')][_0x56b28e][_0x741f('0x9')]:_0x741f('0x14')+random[_0x741f('0x15')](0x6)+_0x741f('0xa');_0x39d95b+='>';}}return _0x39d95b;}function parseEmail(_0x57c61f,_0x55b6d9,_0x347a20){if(_0x55b6d9[_0x741f('0x16')]){var _0x29b37e=/