From 496665afd92e0cb0919cb71887e627f34a6b9150 Mon Sep 17 00:00:00 2001
From: support
Date: Tue, 5 Jul 2022 08:31:22 +0000
Subject: [PATCH] Built motion from commit 5554e4f7.|2.6.12
---
apidoc/api_project.js | 2 +-
apidoc/api_project.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 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/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 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/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 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/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/contacts/index.js | 2 +-
server/components/contacts/sql-utils.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/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.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/api.js | 2 +-
server/errors/index.js | 2 +-
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/events.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/project.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/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.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/voiceQueueSummary.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/realtime/utils.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/cmHopperAdditionalPhone.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/interval.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/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
1203 files changed, 1203 insertions(+), 1203 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 744b0f6..254e9d3 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-05T07:11:01.013Z",
+ "time": "2022-07-05T08:23:27.507Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 2682258..c5859e2 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-07-05T07:11:01.013Z",
+ "time": "2022-07-05T08:23:27.507Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index f78e7d7..92986e9 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 _0x56e3=['urlForward[body]','sequelize','exports','VIRTUAL','action','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[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0x56e3,0xb5));var _0x356e=function(_0x2161fe,_0x160cbb){_0x2161fe=_0x2161fe-0x0;var _0x1758e0=_0x56e3[_0x2161fe];return _0x1758e0;};'use strict';var Sequelize=require(_0x356e('0x0'));module[_0x356e('0x1')]={'name':{'type':Sequelize[_0x356e('0x2')],'get':function(_0x2df176){return this['getDataValue'](_0x356e('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x356e('0x4'),_0x356e('0x5'),'motionbar','jscripty',_0x356e('0x6'),_0x356e('0x7'),_0x356e('0x8'),_0x356e('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x356e('0xa')},'data1':{'type':Sequelize[_0x356e('0xb')](0x1000),'comment':_0x356e('0xc')},'data2':{'type':Sequelize[_0x356e('0xb')](0x1000),'comment':_0x356e('0xd')},'data3':{'type':Sequelize[_0x356e('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[_0x356e('0xb')](0x1000),'comments':_0x356e('0xe')},'data5':{'type':Sequelize[_0x356e('0xb')](0x1000),'comments':_0x356e('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x356e('0x10')],'comments':_0x356e('0x11')}};
\ No newline at end of file
+var _0x5ede=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','sequelize','getDataValue','STRING','contactManager','integration','motionbar','jscripty','script'];(function(_0x273e48,_0x4b4339){var _0x3b8e3f=function(_0x4ec17e){while(--_0x4ec17e){_0x273e48['push'](_0x273e48['shift']());}};_0x3b8e3f(++_0x4b4339);}(_0x5ede,0x13a));var _0xe5ed=function(_0x4386bb,_0x31bdd4){_0x4386bb=_0x4386bb-0x0;var _0xe5e733=_0x5ede[_0x4386bb];return _0xe5e733;};'use strict';var Sequelize=require(_0xe5ed('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2df64a){return this[_0xe5ed('0x1')]('action');}},'action':{'type':Sequelize[_0xe5ed('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe5ed('0x3'),_0xe5ed('0x4'),_0xe5ed('0x5'),_0xe5ed('0x6'),'urlForward','browser','bot',_0xe5ed('0x7')]],'msg':_0xe5ed('0x8')}},'comment':_0xe5ed('0x8')},'data1':{'type':Sequelize[_0xe5ed('0x2')](0x1000),'comment':_0xe5ed('0x9')},'data2':{'type':Sequelize[_0xe5ed('0x2')](0x1000),'comment':_0xe5ed('0xa')},'data3':{'type':Sequelize[_0xe5ed('0x2')](0x1000),'comment':_0xe5ed('0xb')},'data4':{'type':Sequelize[_0xe5ed('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xe5ed('0xc')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xe5ed('0xd')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 090ae27..9e86ea1 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 _0xbb27=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x43aee5,_0x11268b){var _0x76d1d0=function(_0x3faee6){while(--_0x3faee6){_0x43aee5['push'](_0x43aee5['shift']());}};_0x76d1d0(++_0x11268b);}(_0xbb27,0x170));var _0x7bb2=function(_0x2cd1e4,_0x23d906){_0x2cd1e4=_0x2cd1e4-0x0;var _0x167374=_0xbb27[_0x2cd1e4];return _0x167374;};'use strict';var emlformat=require(_0x7bb2('0x0'));var rimraf=require(_0x7bb2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bb2('0x2'));var rp=require(_0x7bb2('0x3'));var moment=require(_0x7bb2('0x4'));var BPromise=require(_0x7bb2('0x5'));var Mustache=require(_0x7bb2('0x6'));var util=require(_0x7bb2('0x7'));var path=require('path');var sox=require(_0x7bb2('0x8'));var csv=require(_0x7bb2('0x9'));var ejs=require(_0x7bb2('0xa'));var fs=require('fs');var fs_extra=require(_0x7bb2('0xb'));var _=require(_0x7bb2('0xc'));var squel=require('squel');var crypto=require(_0x7bb2('0xd'));var jsforce=require(_0x7bb2('0xe'));var deskjs=require(_0x7bb2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7bb2('0x10'));var Papa=require(_0x7bb2('0x11'));var Redis=require(_0x7bb2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7bb2('0x13'));var as=require(_0x7bb2('0x14'));var hardwareService=require(_0x7bb2('0x15'));var logger=require(_0x7bb2('0x16'))('api');var utils=require(_0x7bb2('0x17'));var config=require(_0x7bb2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7bb2('0x19'))['db'];function respondWithStatusCode(_0x53491b,_0x9f000f){_0x9f000f=_0x9f000f||0xcc;return function(_0x41a0b9){if(_0x41a0b9){return _0x53491b['sendStatus'](_0x9f000f);}return _0x53491b[_0x7bb2('0x1a')](_0x9f000f)[_0x7bb2('0x1b')]();};}function respondWithResult(_0x500e2b,_0x409f64){_0x409f64=_0x409f64||0xc8;return function(_0x1c3eb7){if(_0x1c3eb7){return _0x500e2b['status'](_0x409f64)[_0x7bb2('0x1c')](_0x1c3eb7);}};}function respondWithFilteredResult(_0x1fe501,_0x385180){return function(_0x2c9048){if(_0x2c9048){var _0x2a994d=typeof _0x385180[_0x7bb2('0x1d')]==='undefined'&&typeof _0x385180[_0x7bb2('0x1e')]===_0x7bb2('0x1f');var _0x334d1f=_0x2c9048[_0x7bb2('0x20')];var _0x520bc2=_0x2a994d?0x0:_0x385180['offset'];var _0x318118=_0x2a994d?_0x2c9048[_0x7bb2('0x20')]:_0x385180['offset']+_0x385180[_0x7bb2('0x1e')];var _0x19e315;if(_0x318118>=_0x334d1f){_0x318118=_0x334d1f;_0x19e315=0xc8;}else{_0x19e315=0xce;}_0x1fe501[_0x7bb2('0x1a')](_0x19e315);return _0x1fe501['set']('Content-Range',_0x520bc2+'-'+_0x318118+'/'+_0x334d1f)[_0x7bb2('0x1c')](_0x2c9048);}return null;};}function patchUpdates(_0x108b9c){return function(_0x3d6f9f){try{jsonpatch[_0x7bb2('0x21')](_0x3d6f9f,_0x108b9c,!![]);}catch(_0x2ae8ad){return BPromise[_0x7bb2('0x22')](_0x2ae8ad);}return _0x3d6f9f['save']();};}function saveUpdates(_0x564128,_0x405117){return function(_0x5eff19){if(_0x5eff19){return _0x5eff19[_0x7bb2('0x23')](_0x564128)[_0x7bb2('0x24')](function(_0x27f53f){return _0x27f53f;});}return null;};}function removeEntity(_0x4c525d,_0x2df420){return function(_0x6fd6b7){if(_0x6fd6b7){return _0x6fd6b7[_0x7bb2('0x25')]()[_0x7bb2('0x24')](function(){_0x4c525d[_0x7bb2('0x1a')](0xcc)[_0x7bb2('0x1b')]();});}};}function handleEntityNotFound(_0x54254d,_0x375df3){return function(_0x30cbef){if(!_0x30cbef){_0x54254d[_0x7bb2('0x26')](0x194);}return _0x30cbef;};}function handleError(_0x5ea822,_0x389ee5){_0x389ee5=_0x389ee5||0x1f4;return function(_0x43b5ce){logger[_0x7bb2('0x27')](_0x43b5ce[_0x7bb2('0x28')]);if(_0x43b5ce[_0x7bb2('0x29')]){delete _0x43b5ce['name'];}_0x5ea822[_0x7bb2('0x1a')](_0x389ee5)[_0x7bb2('0x2a')](_0x43b5ce);};}exports[_0x7bb2('0x23')]=function(_0x5d3067,_0x2d17c4){if(_0x5d3067[_0x7bb2('0x2b')]['id']){delete _0x5d3067[_0x7bb2('0x2b')]['id'];}return db[_0x7bb2('0x2c')][_0x7bb2('0x2d')]({'where':{'id':_0x5d3067[_0x7bb2('0x2e')]['id']}})[_0x7bb2('0x24')](handleEntityNotFound(_0x2d17c4,null))[_0x7bb2('0x24')](saveUpdates(_0x5d3067[_0x7bb2('0x2b')],null))['then'](respondWithResult(_0x2d17c4,null))[_0x7bb2('0x2f')](handleError(_0x2d17c4,null));};exports[_0x7bb2('0x25')]=function(_0x3f36ea,_0x1bad1f){return db['Action'][_0x7bb2('0x2d')]({'where':{'id':_0x3f36ea[_0x7bb2('0x2e')]['id']}})[_0x7bb2('0x24')](handleEntityNotFound(_0x1bad1f,null))['then'](removeEntity(_0x1bad1f,null))[_0x7bb2('0x2f')](handleError(_0x1bad1f,null));};
\ No newline at end of file
+var _0xee95=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','name','send','update','body','Action','find','catch','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xee95,0x150));var _0x5ee9=function(_0x2d1341,_0x36dce5){_0x2d1341=_0x2d1341-0x0;var _0x112b70=_0xee95[_0x2d1341];return _0x112b70;};'use strict';var emlformat=require(_0x5ee9('0x0'));var rimraf=require(_0x5ee9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ee9('0x2'));var rp=require(_0x5ee9('0x3'));var moment=require(_0x5ee9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5ee9('0x5'));var util=require(_0x5ee9('0x6'));var path=require('path');var sox=require(_0x5ee9('0x7'));var csv=require('to-csv');var ejs=require(_0x5ee9('0x8'));var fs=require('fs');var fs_extra=require(_0x5ee9('0x9'));var _=require(_0x5ee9('0xa'));var squel=require('squel');var crypto=require(_0x5ee9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5ee9('0xc'));var toCsv=require(_0x5ee9('0xd'));var querystring=require('querystring');var Papa=require(_0x5ee9('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ee9('0xf'));var as=require(_0x5ee9('0x10'));var hardwareService=require(_0x5ee9('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5ee9('0x12'));var config=require(_0x5ee9('0x13'));var licenseUtil=require(_0x5ee9('0x14'));var db=require(_0x5ee9('0x15'))['db'];function respondWithStatusCode(_0x58c6ff,_0x37abd2){_0x37abd2=_0x37abd2||0xcc;return function(_0x16e720){if(_0x16e720){return _0x58c6ff[_0x5ee9('0x16')](_0x37abd2);}return _0x58c6ff['status'](_0x37abd2)[_0x5ee9('0x17')]();};}function respondWithResult(_0x1c9362,_0xea5588){_0xea5588=_0xea5588||0xc8;return function(_0xc15afb){if(_0xc15afb){return _0x1c9362[_0x5ee9('0x18')](_0xea5588)[_0x5ee9('0x19')](_0xc15afb);}};}function respondWithFilteredResult(_0xb073fa,_0x58f01d){return function(_0x53622a){if(_0x53622a){var _0x5d6a0d=typeof _0x58f01d[_0x5ee9('0x1a')]===_0x5ee9('0x1b')&&typeof _0x58f01d[_0x5ee9('0x1c')]===_0x5ee9('0x1b');var _0x1ce21b=_0x53622a[_0x5ee9('0x1d')];var _0xa93d5f=_0x5d6a0d?0x0:_0x58f01d[_0x5ee9('0x1a')];var _0x4e8b4a=_0x5d6a0d?_0x53622a['count']:_0x58f01d[_0x5ee9('0x1a')]+_0x58f01d[_0x5ee9('0x1c')];var _0x117caa;if(_0x4e8b4a>=_0x1ce21b){_0x4e8b4a=_0x1ce21b;_0x117caa=0xc8;}else{_0x117caa=0xce;}_0xb073fa[_0x5ee9('0x18')](_0x117caa);return _0xb073fa['set'](_0x5ee9('0x1e'),_0xa93d5f+'-'+_0x4e8b4a+'/'+_0x1ce21b)['json'](_0x53622a);}return null;};}function patchUpdates(_0xc5d143){return function(_0x1e7ec1){try{jsonpatch[_0x5ee9('0x1f')](_0x1e7ec1,_0xc5d143,!![]);}catch(_0x5d13b4){return BPromise[_0x5ee9('0x20')](_0x5d13b4);}return _0x1e7ec1[_0x5ee9('0x21')]();};}function saveUpdates(_0x3eff2a,_0x1cea79){return function(_0x1ba592){if(_0x1ba592){return _0x1ba592['update'](_0x3eff2a)[_0x5ee9('0x22')](function(_0xc43a7b){return _0xc43a7b;});}return null;};}function removeEntity(_0x2545ff,_0x3a8bb9){return function(_0x5c6a4b){if(_0x5c6a4b){return _0x5c6a4b[_0x5ee9('0x23')]()[_0x5ee9('0x22')](function(){_0x2545ff['status'](0xcc)[_0x5ee9('0x17')]();});}};}function handleEntityNotFound(_0x57fc0c,_0x13e6ab){return function(_0x29ca92){if(!_0x29ca92){_0x57fc0c[_0x5ee9('0x16')](0x194);}return _0x29ca92;};}function handleError(_0x16ab6b,_0x1e2dc5){_0x1e2dc5=_0x1e2dc5||0x1f4;return function(_0x515640){logger[_0x5ee9('0x24')](_0x515640['stack']);if(_0x515640[_0x5ee9('0x25')]){delete _0x515640[_0x5ee9('0x25')];}_0x16ab6b[_0x5ee9('0x18')](_0x1e2dc5)[_0x5ee9('0x26')](_0x515640);};}exports[_0x5ee9('0x27')]=function(_0x3626a5,_0x56c29d){if(_0x3626a5[_0x5ee9('0x28')]['id']){delete _0x3626a5[_0x5ee9('0x28')]['id'];}return db[_0x5ee9('0x29')][_0x5ee9('0x2a')]({'where':{'id':_0x3626a5['params']['id']}})[_0x5ee9('0x22')](handleEntityNotFound(_0x56c29d,null))[_0x5ee9('0x22')](saveUpdates(_0x3626a5[_0x5ee9('0x28')],null))[_0x5ee9('0x22')](respondWithResult(_0x56c29d,null))[_0x5ee9('0x2b')](handleError(_0x56c29d,null));};exports[_0x5ee9('0x23')]=function(_0x124702,_0x1bab97){return db[_0x5ee9('0x29')][_0x5ee9('0x2a')]({'where':{'id':_0x124702[_0x5ee9('0x2c')]['id']}})[_0x5ee9('0x22')](handleEntityNotFound(_0x1bab97,null))['then'](removeEntity(_0x1bab97,null))['catch'](handleError(_0x1bab97,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 51fe5b5..c6ce16e 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 _0x318d=['bluebird','request-promise','path','./action.attributes','define','Action','tools_actions','lodash','util'];(function(_0x171f16,_0x25855a){var _0x52b76c=function(_0x310e6d){while(--_0x310e6d){_0x171f16['push'](_0x171f16['shift']());}};_0x52b76c(++_0x25855a);}(_0x318d,0xbb));var _0xd318=function(_0x1f5067,_0x2e995a){_0x1f5067=_0x1f5067-0x0;var _0x4c21d4=_0x318d[_0x1f5067];return _0x4c21d4;};'use strict';var _=require(_0xd318('0x0'));var util=require(_0xd318('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd318('0x2'));var rp=require(_0xd318('0x3'));var fs=require('fs');var path=require(_0xd318('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd318('0x5'));module['exports']=function(_0x5aca2a,_0x4bb064){return _0x5aca2a[_0xd318('0x6')](_0xd318('0x7'),attributes,{'tableName':_0xd318('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x537a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','util'];(function(_0x153d48,_0x13d8bd){var _0x1954cc=function(_0x3152bd){while(--_0x3152bd){_0x153d48['push'](_0x153d48['shift']());}};_0x1954cc(++_0x13d8bd);}(_0x537a,0x1ac));var _0xa537=function(_0x58e35f,_0x105022){_0x58e35f=_0x58e35f-0x0;var _0x475308=_0x537a[_0x58e35f];return _0x475308;};'use strict';var _=require('lodash');var util=require(_0xa537('0x0'));var logger=require(_0xa537('0x1'))(_0xa537('0x2'));var moment=require(_0xa537('0x3'));var BPromise=require(_0xa537('0x4'));var rp=require(_0xa537('0x5'));var fs=require('fs');var path=require(_0xa537('0x6'));var rimraf=require(_0xa537('0x7'));var config=require(_0xa537('0x8'));var attributes=require(_0xa537('0x9'));module[_0xa537('0xa')]=function(_0x5e7487,_0x1f8c26){return _0x5e7487['define'](_0xa537('0xb'),attributes,{'tableName':_0xa537('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 233a19a..5a99baf 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 _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(_0x1d4fb5,_0x205c2f){var _0x566c83=function(_0x33fe30){while(--_0x33fe30){_0x1d4fb5['push'](_0x1d4fb5['shift']());}};_0x566c83(++_0x205c2f);}(_0x5fab,0x177));var _0xb5fa=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0x5fab[_0x4f08dd];return _0x3017ee;};'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
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x53ec,0x192));var _0xc53e=function(_0x3f0b2a,_0x52f963){_0x3f0b2a=_0x3f0b2a-0x0;var _0x23bd63=_0x53ec[_0x3f0b2a];return _0x23bd63;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 4d5d0d4..a5a2a79 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 _0x0495=['../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x3cf5a3,_0x5a4492){var _0x39ba2d=function(_0x3ed989){while(--_0x3ed989){_0x3cf5a3['push'](_0x3cf5a3['shift']());}};_0x39ba2d(++_0x5a4492);}(_0x0495,0x1a9));var _0x5049=function(_0x468a12,_0x4573){_0x468a12=_0x468a12-0x0;var _0x260052=_0x0495[_0x468a12];return _0x260052;};'use strict';var multer=require(_0x5049('0x0'));var util=require(_0x5049('0x1'));var path=require(_0x5049('0x2'));var timeout=require(_0x5049('0x3'));var express=require(_0x5049('0x4'));var router=express['Router']();var fs_extra=require(_0x5049('0x5'));var auth=require(_0x5049('0x6'));var interaction=require(_0x5049('0x7'));var config=require(_0x5049('0x8'));var controller=require(_0x5049('0x9'));router[_0x5049('0xa')](_0x5049('0xb'),auth['isAuthenticated'](),controller[_0x5049('0xc')]);router[_0x5049('0xd')](_0x5049('0xb'),auth[_0x5049('0xe')](),controller['destroy']);module[_0x5049('0xf')]=router;
\ No newline at end of file
+var _0x77ba=['delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','update'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x77ba,0x154));var _0xa77b=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x77ba[_0x207a02];return _0xd995c3;};'use strict';var multer=require(_0xa77b('0x0'));var util=require(_0xa77b('0x1'));var path=require(_0xa77b('0x2'));var timeout=require(_0xa77b('0x3'));var express=require('express');var router=express[_0xa77b('0x4')]();var fs_extra=require(_0xa77b('0x5'));var auth=require(_0xa77b('0x6'));var interaction=require(_0xa77b('0x7'));var config=require(_0xa77b('0x8'));var controller=require('./action.controller');router[_0xa77b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa77b('0xa')]);router[_0xa77b('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xa77b('0xc')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index c76fff3..1a8243e 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x255684,_0x10375e){var _0x54749e=function(_0x226132){while(--_0x226132){_0x255684['push'](_0x255684['shift']());}};_0x54749e(++_0x10375e);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x472918,_0x245ab0){_0x472918=_0x472918-0x0;var _0x17db19=_0xdbf5[_0x472918];return _0x17db19;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x2675,0x75));var _0x5267=function(_0x303f87,_0x1e0f6b){_0x303f87=_0x303f87-0x0;var _0x3c3226=_0x2675[_0x303f87];return _0x3c3226;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index e1249f8..afe0c40 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 _0x0f74=['crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','limit','set','apply','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','end','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','find','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','function','replace','format','orderBy','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','field','keyBy','groupBy','alias','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','COUNT(*)','runReport','ValidationErrorItem','metric','DESC','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel'];(function(_0x3029b5,_0x4e58b7){var _0x2b7372=function(_0x1ec1a2){while(--_0x1ec1a2){_0x3029b5['push'](_0x3029b5['shift']());}};_0x2b7372(++_0x4e58b7);}(_0x0f74,0x13b));var _0x40f7=function(_0x1ab8a5,_0x3556e8){_0x1ab8a5=_0x1ab8a5-0x0;var _0x597912=_0x0f74[_0x1ab8a5];return _0x597912;};'use strict';var emlformat=require(_0x40f7('0x0'));var rimraf=require(_0x40f7('0x1'));var zipdir=require(_0x40f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x40f7('0x3'));var moment=require(_0x40f7('0x4'));var BPromise=require(_0x40f7('0x5'));var Mustache=require(_0x40f7('0x6'));var util=require(_0x40f7('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x40f7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x40f7('0x9'));var squel=require(_0x40f7('0xa'));var crypto=require(_0x40f7('0xb'));var jsforce=require(_0x40f7('0xc'));var deskjs=require(_0x40f7('0xd'));var toCsv=require(_0x40f7('0xe'));var querystring=require('querystring');var Papa=require(_0x40f7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x40f7('0x10'));var as=require(_0x40f7('0x11'));var hardwareService=require(_0x40f7('0x12'));var logger=require('../../config/logger')(_0x40f7('0x13'));var utils=require(_0x40f7('0x14'));var config=require(_0x40f7('0x15'));var licenseUtil=require(_0x40f7('0x16'));var db=require(_0x40f7('0x17'))['db'];var dbH=require(_0x40f7('0x17'))['dbH'];function respondWithStatusCode(_0x105957,_0xe180c1){_0xe180c1=_0xe180c1||0xcc;return function(_0x44976f){if(_0x44976f){return _0x105957[_0x40f7('0x18')](_0xe180c1);}return _0x105957[_0x40f7('0x19')](_0xe180c1)['end']();};}function respondWithResult(_0xa8bd4e,_0x577559){_0x577559=_0x577559||0xc8;return function(_0x5398fa){if(_0x5398fa){return _0xa8bd4e[_0x40f7('0x19')](_0x577559)[_0x40f7('0x1a')](_0x5398fa);}};}function respondWithFilteredResult(_0x4bd5df,_0x5e9843){return function(_0x65f920){if(_0x65f920){var _0x3b4e83=typeof _0x5e9843[_0x40f7('0x1b')]==='undefined'&&typeof _0x5e9843['limit']==='undefined';var _0x397a8e=_0x65f920[_0x40f7('0x1c')];var _0x53f738=_0x3b4e83?0x0:_0x5e9843['offset'];var _0x48ac4f=_0x3b4e83?_0x65f920['count']:_0x5e9843['offset']+_0x5e9843[_0x40f7('0x1d')];var _0x5951ee;if(_0x48ac4f>=_0x397a8e){_0x48ac4f=_0x397a8e;_0x5951ee=0xc8;}else{_0x5951ee=0xce;}_0x4bd5df[_0x40f7('0x19')](_0x5951ee);return _0x4bd5df[_0x40f7('0x1e')]('Content-Range',_0x53f738+'-'+_0x48ac4f+'/'+_0x397a8e)[_0x40f7('0x1a')](_0x65f920);}return null;};}function patchUpdates(_0x132615){return function(_0x3ae7af){try{jsonpatch[_0x40f7('0x1f')](_0x3ae7af,_0x132615,!![]);}catch(_0x4a564e){return BPromise[_0x40f7('0x20')](_0x4a564e);}return _0x3ae7af[_0x40f7('0x21')]();};}function saveUpdates(_0x171bcf,_0x289783){return function(_0x37f83e){if(_0x37f83e){return _0x37f83e[_0x40f7('0x22')](_0x171bcf)[_0x40f7('0x23')](function(_0x8170ca){return _0x8170ca;});}return null;};}function removeEntity(_0xea1ed8,_0x341119){return function(_0x47c95b){if(_0x47c95b){return _0x47c95b['destroy']()['then'](function(){var _0x2f7ba2=_0x47c95b[_0x40f7('0x24')]({'plain':!![]});var _0x2dddee=_0x40f7('0x25');return db[_0x40f7('0x26')][_0x40f7('0x27')]({'where':{'type':_0x2dddee,'resourceId':_0x2f7ba2['id']}})[_0x40f7('0x23')](function(){return _0x47c95b;});})['then'](function(){_0xea1ed8['status'](0xcc)[_0x40f7('0x28')]();});}};}function handleEntityNotFound(_0x240a9c,_0x3ad66f){return function(_0x4e6257){if(!_0x4e6257){_0x240a9c[_0x40f7('0x18')](0x194);}return _0x4e6257;};}function handleError(_0x3d41b9,_0x5e9477){_0x5e9477=_0x5e9477||0x1f4;return function(_0x1c080d){logger[_0x40f7('0x29')](_0x1c080d[_0x40f7('0x2a')]);if(_0x1c080d[_0x40f7('0x2b')]){delete _0x1c080d[_0x40f7('0x2b')];}_0x3d41b9[_0x40f7('0x19')](_0x5e9477)[_0x40f7('0x2c')](_0x1c080d);};}exports[_0x40f7('0x2d')]=function(_0xd90d85,_0x465941){var _0xface3d={},_0x1af7e8={},_0x461d5f={'count':0x0,'rows':[]};var _0x4fb705=_['map'](db['AnalyticCustomReport'][_0x40f7('0x2e')],function(_0x4752b7){return{'name':_0x4752b7['fieldName'],'type':_0x4752b7[_0x40f7('0x2f')][_0x40f7('0x30')]};});_0x1af7e8[_0x40f7('0x31')]=_[_0x40f7('0x32')](_0x4fb705,_0x40f7('0x2b'));_0x1af7e8['query']=_['keys'](_0xd90d85[_0x40f7('0x33')]);_0x1af7e8[_0x40f7('0x34')]=_[_0x40f7('0x35')](_0x1af7e8[_0x40f7('0x31')],_0x1af7e8[_0x40f7('0x33')]);_0xface3d[_0x40f7('0x36')]=_[_0x40f7('0x35')](_0x1af7e8[_0x40f7('0x31')],qs[_0x40f7('0x37')](_0xd90d85['query'][_0x40f7('0x37')]));_0xface3d[_0x40f7('0x36')]=_0xface3d[_0x40f7('0x36')][_0x40f7('0x38')]?_0xface3d[_0x40f7('0x36')]:_0x1af7e8[_0x40f7('0x31')];if(!_0xd90d85[_0x40f7('0x33')]['hasOwnProperty']('nolimit')){_0xface3d['limit']=qs[_0x40f7('0x1d')](_0xd90d85[_0x40f7('0x33')][_0x40f7('0x1d')]);_0xface3d[_0x40f7('0x1b')]=qs['offset'](_0xd90d85['query']['offset']);}_0xface3d[_0x40f7('0x39')]=qs[_0x40f7('0x3a')](_0xd90d85['query']['sort']);_0xface3d[_0x40f7('0x3b')]=qs['filters'](_['pick'](_0xd90d85[_0x40f7('0x33')],_0x1af7e8[_0x40f7('0x34')]),_0x4fb705);if(_0xd90d85[_0x40f7('0x33')][_0x40f7('0x3c')]){_0xface3d[_0x40f7('0x3b')]=_[_0x40f7('0x3d')](_0xface3d['where'],{'$or':_['map'](_0x4fb705,function(_0x43ea35){if(_0x43ea35[_0x40f7('0x2f')]!=='VIRTUAL'){var _0x274bde={};_0x274bde[_0x43ea35[_0x40f7('0x2b')]]={'$like':'%'+_0xd90d85['query'][_0x40f7('0x3c')]+'%'};return _0x274bde;}})});}_0xface3d=_[_0x40f7('0x3d')]({},_0xface3d,_0xd90d85[_0x40f7('0x3e')]);var _0x27a7c2={'where':_0xface3d[_0x40f7('0x3b')]};return db['AnalyticCustomReport']['count'](_0x27a7c2)[_0x40f7('0x23')](function(_0x5a231e){_0x461d5f['count']=_0x5a231e;if(_0xd90d85[_0x40f7('0x33')][_0x40f7('0x3f')]){_0xface3d[_0x40f7('0x40')]=[{'all':!![]}];}return db[_0x40f7('0x41')][_0x40f7('0x42')](_0xface3d);})[_0x40f7('0x23')](function(_0x3e08c3){_0x461d5f[_0x40f7('0x43')]=_0x3e08c3;return _0x461d5f;})[_0x40f7('0x23')](respondWithFilteredResult(_0x465941,_0xface3d))[_0x40f7('0x44')](handleError(_0x465941,null));};exports[_0x40f7('0x45')]=function(_0x592f8f,_0x99ce29){var _0x4c7640={'raw':![],'where':{'id':_0x592f8f[_0x40f7('0x46')]['id']}},_0x2b583f={};_0x2b583f[_0x40f7('0x31')]=_[_0x40f7('0x47')](db[_0x40f7('0x41')]['rawAttributes']);_0x2b583f[_0x40f7('0x33')]=_[_0x40f7('0x47')](_0x592f8f[_0x40f7('0x33')]);_0x2b583f[_0x40f7('0x34')]=_['intersection'](_0x2b583f[_0x40f7('0x31')],_0x2b583f['query']);_0x4c7640[_0x40f7('0x36')]=_[_0x40f7('0x35')](_0x2b583f[_0x40f7('0x31')],qs[_0x40f7('0x37')](_0x592f8f[_0x40f7('0x33')]['fields']));_0x4c7640['attributes']=_0x4c7640[_0x40f7('0x36')]['length']?_0x4c7640[_0x40f7('0x36')]:_0x2b583f['model'];if(_0x592f8f[_0x40f7('0x33')][_0x40f7('0x3f')]){_0x4c7640[_0x40f7('0x40')]=[{'all':!![]}];}_0x4c7640=_[_0x40f7('0x3d')]({},_0x4c7640,_0x592f8f[_0x40f7('0x3e')]);return db[_0x40f7('0x41')]['find'](_0x4c7640)[_0x40f7('0x23')](handleEntityNotFound(_0x99ce29,null))[_0x40f7('0x23')](respondWithResult(_0x99ce29,null))[_0x40f7('0x44')](handleError(_0x99ce29,null));};exports[_0x40f7('0x48')]=function(_0x497287,_0x24d44d){return db[_0x40f7('0x41')]['create'](_0x497287[_0x40f7('0x49')],{})['then'](function(_0x52e2bb){var _0x34233d=_0x497287[_0x40f7('0x4a')][_0x40f7('0x24')]({'plain':!![]});if(!_0x34233d)throw new Error(_0x40f7('0x4b'));if(_0x34233d[_0x40f7('0x4c')]===_0x40f7('0x4a')){var _0x496eec=_0x52e2bb[_0x40f7('0x24')]({'plain':!![]});var _0x204150=_0x40f7('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x204150,'userProfileId':_0x34233d[_0x40f7('0x4e')]},'raw':!![]})[_0x40f7('0x23')](function(_0xef537a){if(_0xef537a&&_0xef537a[_0x40f7('0x4f')]===0x0){return db[_0x40f7('0x26')][_0x40f7('0x48')]({'name':_0x496eec[_0x40f7('0x2b')],'resourceId':_0x496eec['id'],'type':'CustomReports','sectionId':_0xef537a['id']},{})[_0x40f7('0x23')](function(){return _0x52e2bb;});}else{return _0x52e2bb;}})['catch'](function(_0x4ca501){logger[_0x40f7('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ca501);throw _0x4ca501;});}return _0x52e2bb;})[_0x40f7('0x23')](respondWithResult(_0x24d44d,0xc9))[_0x40f7('0x44')](handleError(_0x24d44d,null));};exports[_0x40f7('0x22')]=function(_0x2ec4ed,_0x3e451c){if(_0x2ec4ed['body']['id']){delete _0x2ec4ed[_0x40f7('0x49')]['id'];}return db[_0x40f7('0x41')]['find']({'where':{'id':_0x2ec4ed[_0x40f7('0x46')]['id']}})[_0x40f7('0x23')](handleEntityNotFound(_0x3e451c,null))[_0x40f7('0x23')](saveUpdates(_0x2ec4ed[_0x40f7('0x49')],null))[_0x40f7('0x23')](respondWithResult(_0x3e451c,null))['catch'](handleError(_0x3e451c,null));};exports[_0x40f7('0x27')]=function(_0x46c25e,_0x5c439f){return db[_0x40f7('0x41')][_0x40f7('0x50')]({'where':{'id':_0x46c25e[_0x40f7('0x46')]['id']}})[_0x40f7('0x23')](handleEntityNotFound(_0x5c439f,null))[_0x40f7('0x23')](removeEntity(_0x5c439f,null))['catch'](handleError(_0x5c439f,null));};exports[_0x40f7('0x51')]=function(_0x41d370,_0x5b2ebd){var _0x2ab996=0xa;var _0x47030a=[_0x40f7('0x52'),_0x40f7('0x53'),_0x40f7('0x54'),_0x40f7('0x55')];var _0x446eef={'SUM':_0x40f7('0x56'),'COUNT':_0x40f7('0x57'),'COUNT DISTINCT':_0x40f7('0x58'),'MAX':'MAX(%s)','MIN':_0x40f7('0x59'),'AVG':_0x40f7('0x5a'),'GROUP_CONCAT':_0x40f7('0x5b'),'GROUP_CONCAT ASC':_0x40f7('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f1b26={'SEC_TO_TIME':_0x40f7('0x5d'),'DATE':_0x40f7('0x5e'),'HOUR':_0x40f7('0x5f'),'ROUND':_0x40f7('0x60'),'UNIX_TIMESTAMP':_0x40f7('0x61')};var _0x29ffdc=function(_0x466271){return!_[_0x40f7('0x62')]([_0x40f7('0x63'),_0x40f7('0x64'),_0x40f7('0x65'),_0x40f7('0x66')],_0x466271);};var _0x4c4fa5=function(_0x3a32e0){if(!_0x3a32e0||!_0x3a32e0['rules'][_0x40f7('0x38')]){return'';}for(var _0x3ac0d0='(',_0x4d87da=0x0;_0x4d87da<_0x3a32e0[_0x40f7('0x67')][_0x40f7('0x38')];_0x4d87da+=0x1){_0x4d87da>0x0&&(_0x3ac0d0+='\x20'+_0x3a32e0[_0x40f7('0x68')]+'\x20');_0x3ac0d0+=_0x3a32e0[_0x40f7('0x67')][_0x4d87da]['group']?_0x4c4fa5(_0x3a32e0[_0x40f7('0x67')][_0x4d87da][_0x40f7('0x69')]):_0x3a32e0['rules'][_0x4d87da]['field']+'\x20'+_0x3a32e0[_0x40f7('0x67')][_0x4d87da][_0x40f7('0x6a')]+(_0x29ffdc(_0x3a32e0['rules'][_0x4d87da]['condition'])?'\x20'+_0x3a32e0[_0x40f7('0x67')][_0x4d87da][_0x40f7('0x6b')]:'');}return _0x3ac0d0+')';};var _0x46b095={'where':{'id':_0x41d370[_0x40f7('0x46')]['id']}},_0x317250,_0x4d48a4,_0x4c1e8c,_0x27569e,_0x5e6cab;_0x46b095=_[_0x40f7('0x3d')]({},_0x46b095,_0x41d370[_0x40f7('0x3e')]);return db[_0x40f7('0x41')][_0x40f7('0x50')](_0x46b095)[_0x40f7('0x23')](function(_0x3e3351){if(_0x3e3351){_0x317250=_0x3e3351;return _0x3e3351[_0x40f7('0x6c')]();}return null;})['then'](function(_0x3a63f0){if(_0x3a63f0){if(!_0x3a63f0[_0x40f7('0x38')]){throw new db[(_0x40f7('0x6d'))]['ValidationErrorItem'](_0x40f7('0x6e'),0x193);}_0x4d48a4=_0x3a63f0;return db[_0x40f7('0x6f')][_0x40f7('0x42')]({'raw':!![]});}return null;})[_0x40f7('0x23')](function(_0x1c761a){if(_0x1c761a){_0x4c1e8c=_['keyBy'](_0x1c761a,'id');var _0x283e9e;var _0x4d8353=squel[_0x40f7('0x70')]();_0x4d8353[_0x40f7('0x71')](_0x317250[_0x40f7('0x72')]);for(var _0x31c1c9=0x0;_0x31c1c9<_0x4d48a4[_0x40f7('0x38')];_0x31c1c9+=0x1){_0x283e9e=_0x4d48a4[_0x31c1c9][_0x40f7('0x73')]?_0x4c1e8c[_0x4d48a4[_0x31c1c9][_0x40f7('0x73')]]['metric']:_0x4d48a4[_0x31c1c9]['field'];_0x283e9e=_0x4d48a4[_0x31c1c9][_0x40f7('0x74')]?_[_0x40f7('0x75')](_0x446eef[_0x4d48a4[_0x31c1c9][_0x40f7('0x74')]],'%s',_0x283e9e):_0x283e9e;_0x283e9e=_0x4d48a4[_0x31c1c9][_0x40f7('0x76')]?_[_0x40f7('0x75')](_0x1f1b26[_0x4d48a4[_0x31c1c9]['format']],'%s',_0x283e9e):_0x283e9e;if(_0x4d48a4[_0x31c1c9]['groupBy']){_0x4d8353[_0x40f7('0x69')](_0x283e9e);}_0x4d48a4[_0x31c1c9][_0x40f7('0x77')]&&_0x4d8353[_0x40f7('0x39')](_0x283e9e,_0x4d48a4[_0x31c1c9][_0x40f7('0x77')]==='DESC'?![]:!![]);_0x4d8353['field'](_0x283e9e,_0x4d48a4[_0x31c1c9]['alias']||_0x283e9e);}if(_0x317250[_0x40f7('0x78')]){_0x317250['joins']=JSON[_0x40f7('0x79')](_0x317250[_0x40f7('0x78')]);for(var _0x1ed240=0x0;_0x1ed240<_0x317250[_0x40f7('0x78')][_0x40f7('0x38')];_0x1ed240+=0x1){if(_0x317250[_0x40f7('0x78')][_0x1ed240][_0x40f7('0x2f')]&&_[_0x40f7('0x62')](_0x47030a,_0x317250['joins'][_0x1ed240][_0x40f7('0x2f')])&&_0x317250[_0x40f7('0x78')][_0x1ed240][_0x40f7('0x7a')]&&_0x317250['joins'][_0x1ed240][_0x40f7('0x7b')]&&_0x317250['joins'][_0x1ed240][_0x40f7('0x7c')]){_0x4d8353[_0x317250[_0x40f7('0x78')][_0x1ed240][_0x40f7('0x2f')]](_0x317250[_0x40f7('0x78')][_0x1ed240]['foreignTable'],null,util[_0x40f7('0x76')](_0x40f7('0x7d'),_0x317250['table'],_0x317250['joins'][_0x1ed240]['parentKey'],_0x317250[_0x40f7('0x78')][_0x1ed240]['foreignTable'],_0x317250[_0x40f7('0x78')][_0x1ed240][_0x40f7('0x7c')]));}}}if(_0x317250[_0x40f7('0x7e')]){_0x317250[_0x40f7('0x7e')]=JSON[_0x40f7('0x79')](_0x317250[_0x40f7('0x7e')]);_0x4d8353[_0x40f7('0x3b')](_0x4c4fa5(_0x317250[_0x40f7('0x7e')][_0x40f7('0x69')]));}_0x5e6cab=_0x4d8353['clone']();_0x4d8353['limit'](_0x2ab996);_0x4d8353[_0x40f7('0x1b')](0x0);logger[_0x40f7('0x7f')](_0x40f7('0x80'),_0x4d8353[_0x40f7('0x81')]());return dbH[_0x40f7('0x82')][_0x40f7('0x33')](_0x4d8353[_0x40f7('0x81')](),{'type':dbH[_0x40f7('0x82')][_0x40f7('0x83')][_0x40f7('0x84')]});}})[_0x40f7('0x23')](respondWithResult(_0x5b2ebd,null))['catch'](handleError(_0x5b2ebd,null));};function runReport(_0x1db63c,_0x23e2d1,_0x3d7ca6){var _0x5453e0=_0x23e2d1[_0x40f7('0x2b')];var _0x46e2d5=0xa;var _0x260578=['join',_0x40f7('0x53'),'right_join',_0x40f7('0x55')];var _0x38327f={'SUM':_0x40f7('0x56'),'COUNT':_0x40f7('0x57'),'COUNT DISTINCT':_0x40f7('0x58'),'MAX':_0x40f7('0x85'),'MIN':_0x40f7('0x59'),'AVG':_0x40f7('0x5a'),'GROUP_CONCAT':_0x40f7('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x40f7('0x86')};var _0xbc52a8={'SEC_TO_TIME':_0x40f7('0x5d'),'DATE':_0x40f7('0x5e'),'HOUR':'HOUR(%s)','ROUND':_0x40f7('0x60'),'UNIX_TIMESTAMP':_0x40f7('0x61')};var _0x290fdd=function(_0x56194c){return!_[_0x40f7('0x62')]([_0x40f7('0x63'),_0x40f7('0x64'),_0x40f7('0x65'),'IS\x20NOT\x20EMPTY'],_0x56194c);};var _0x1c8b80=function(_0x8273b8){if(!_0x8273b8||!_0x8273b8['rules'][_0x40f7('0x38')]){return'';}for(var _0x7d8890='(',_0x4f2de7=0x0;_0x4f2de7<_0x8273b8[_0x40f7('0x67')][_0x40f7('0x38')];_0x4f2de7+=0x1){_0x4f2de7>0x0&&(_0x7d8890+='\x20'+_0x8273b8[_0x40f7('0x68')]+'\x20');_0x7d8890+=_0x8273b8['rules'][_0x4f2de7]['group']?_0x1c8b80(_0x8273b8[_0x40f7('0x67')][_0x4f2de7]['group']):_0x8273b8[_0x40f7('0x67')][_0x4f2de7][_0x40f7('0x87')]+'\x20'+_0x8273b8[_0x40f7('0x67')][_0x4f2de7]['condition']+(_0x290fdd(_0x8273b8[_0x40f7('0x67')][_0x4f2de7][_0x40f7('0x6a')])?'\x20'+_0x8273b8['rules'][_0x4f2de7][_0x40f7('0x6b')]:'');}return _0x7d8890+')';};var _0x586c60={'where':{'id':_0x1db63c['id']}},_0x339798,_0x5a00f2,_0x2af3f2,_0x23c3b4,_0x4fa88e;_0x586c60=_['merge']({},_0x586c60,_0x3d7ca6);return db[_0x40f7('0x41')][_0x40f7('0x50')](_0x586c60)[_0x40f7('0x23')](function(_0x3dd2e6){if(_0x3dd2e6){_0x339798=_0x3dd2e6;return _0x3dd2e6[_0x40f7('0x6c')]();}return null;})[_0x40f7('0x23')](function(_0x98f010){if(_0x98f010){if(!_0x98f010['length']){throw new db[(_0x40f7('0x6d'))]['ValidationErrorItem'](_0x40f7('0x6e'),0x193);}_0x5a00f2=_0x98f010;return db[_0x40f7('0x6f')][_0x40f7('0x42')]({'raw':!![]});}return null;})[_0x40f7('0x23')](function(_0x5c551c){if(_0x5c551c){_0x2af3f2=_[_0x40f7('0x88')](_0x5c551c,'id');var _0x1e1a39;var _0x4ad965=squel[_0x40f7('0x70')]();_0x4ad965[_0x40f7('0x71')](_0x339798[_0x40f7('0x72')]);for(var _0x4e2a83=0x0;_0x4e2a83<_0x5a00f2['length'];_0x4e2a83+=0x1){_0x1e1a39=_0x5a00f2[_0x4e2a83][_0x40f7('0x73')]?_0x2af3f2[_0x5a00f2[_0x4e2a83][_0x40f7('0x73')]]['metric']:_0x5a00f2[_0x4e2a83][_0x40f7('0x87')];_0x1e1a39=_0x5a00f2[_0x4e2a83][_0x40f7('0x74')]?_[_0x40f7('0x75')](_0x38327f[_0x5a00f2[_0x4e2a83]['function']],'%s',_0x1e1a39):_0x1e1a39;_0x1e1a39=_0x5a00f2[_0x4e2a83]['format']?_[_0x40f7('0x75')](_0xbc52a8[_0x5a00f2[_0x4e2a83]['format']],'%s',_0x1e1a39):_0x1e1a39;if(_0x5a00f2[_0x4e2a83][_0x40f7('0x89')]){_0x4ad965['group'](_0x1e1a39);}_0x5a00f2[_0x4e2a83][_0x40f7('0x77')]&&_0x4ad965[_0x40f7('0x39')](_0x1e1a39,_0x5a00f2[_0x4e2a83][_0x40f7('0x77')]==='DESC'?![]:!![]);_0x4ad965[_0x40f7('0x87')](_0x1e1a39,_0x5a00f2[_0x4e2a83][_0x40f7('0x8a')]||_0x1e1a39);}if(_0x339798[_0x40f7('0x78')]){_0x339798[_0x40f7('0x78')]=JSON[_0x40f7('0x79')](_0x339798[_0x40f7('0x78')]);for(var _0x4f46ce=0x0;_0x4f46ce<_0x339798[_0x40f7('0x78')][_0x40f7('0x38')];_0x4f46ce+=0x1){if(_0x339798['joins'][_0x4f46ce][_0x40f7('0x2f')]&&_['includes'](_0x260578,_0x339798['joins'][_0x4f46ce][_0x40f7('0x2f')])&&_0x339798[_0x40f7('0x78')][_0x4f46ce][_0x40f7('0x7a')]&&_0x339798[_0x40f7('0x78')][_0x4f46ce][_0x40f7('0x7b')]&&_0x339798[_0x40f7('0x78')][_0x4f46ce]['foreignKey']){_0x4ad965[_0x339798['joins'][_0x4f46ce][_0x40f7('0x2f')]](_0x339798[_0x40f7('0x78')][_0x4f46ce]['foreignTable'],null,util[_0x40f7('0x76')]('%s.%s\x20=\x20%s.%s',_0x339798['table'],_0x339798[_0x40f7('0x78')][_0x4f46ce][_0x40f7('0x7a')],_0x339798[_0x40f7('0x78')][_0x4f46ce][_0x40f7('0x7b')],_0x339798[_0x40f7('0x78')][_0x4f46ce]['foreignKey']));}}}if(_0x339798[_0x40f7('0x7e')]){_0x339798[_0x40f7('0x7e')]=JSON[_0x40f7('0x79')](_0x339798[_0x40f7('0x7e')]);_0x4ad965[_0x40f7('0x3b')](_0x1c8b80(_0x339798['conditions'][_0x40f7('0x69')]));}_0x4fa88e=_0x4ad965[_0x40f7('0x8b')]();_0x4ad965[_0x40f7('0x1d')](_0x46e2d5);_0x4ad965[_0x40f7('0x1b')](0x0);return;}})[_0x40f7('0x23')](function(){if(_0x23e2d1[_0x40f7('0x8c')]===_0x40f7('0x8d')){return null;}var _0x5c30c6=_[_0x40f7('0x3d')](_0x23e2d1,{'name':_0x23e2d1[_0x40f7('0x8e')]||_0x23e2d1[_0x40f7('0x2b')]||_0x339798['name'],'basename':_0x5453e0,'savename':util[_0x40f7('0x76')](_0x40f7('0x8f'),_0x23e2d1[_0x40f7('0x2b')]||_0x339798[_0x40f7('0x2b')],require(_0x40f7('0x90'))[_0x40f7('0x91')](0x4),_0x23e2d1[_0x40f7('0x8c')]||_0x40f7('0x92')),'reportId':_0x339798['id'],'reportType':_0x40f7('0x93')});return db[_0x40f7('0x94')][_0x40f7('0x48')](_0x5c30c6,{'raw':!![]});})['then'](function(_0x5f0e38){if(_0x339798[_0x40f7('0x72')]==='cdr'){_0x4fa88e['where'](_0x339798[_0x40f7('0x72')]+_0x40f7('0x95'),_0x23e2d1[_0x40f7('0x96')],_0x23e2d1[_0x40f7('0x97')]);}else{_0x4fa88e[_0x40f7('0x3b')](_0x339798[_0x40f7('0x72')]+_0x40f7('0x98'),_0x23e2d1[_0x40f7('0x96')],_0x23e2d1[_0x40f7('0x97')]);}if(_0x5f0e38){logger['info'](_0x40f7('0x99'),_0x4fa88e[_0x40f7('0x81')]());require('child_process')[_0x40f7('0x9a')](path[_0x40f7('0x52')](__dirname,_0x40f7('0x9b'),_0x5f0e38[_0x40f7('0x8c')]),[_0x5f0e38['id'],_0x4fa88e[_0x40f7('0x81')](),path[_0x40f7('0x52')](__dirname,_0x40f7('0x9c'),_0x5f0e38[_0x40f7('0x9d')]),_0x5453e0]);return _0x5f0e38;}else{var _0x1b0bc5=squel[_0x40f7('0x70')]();_0x1b0bc5['from']('('+_0x4fa88e[_0x40f7('0x81')]()+')','countTable');_0x1b0bc5['field'](_0x40f7('0x9e'),_0x40f7('0x1c'));_0x4fa88e[_0x40f7('0x1d')](_0x23e2d1[_0x40f7('0x1d')]||_0x46e2d5);_0x4fa88e[_0x40f7('0x1b')](_0x23e2d1[_0x40f7('0x1b')]||0x0);return dbH[_0x40f7('0x82')][_0x40f7('0x33')](_0x1b0bc5[_0x40f7('0x81')](),{'type':dbH[_0x40f7('0x82')][_0x40f7('0x83')]['SELECT']})[_0x40f7('0x23')](function(_0x3950c1){if(!_0x3950c1[_0x40f7('0x38')]){_0x23c3b4=0x0;}else{_0x23c3b4=_0x3950c1[0x0]['count']||0x0;}return dbH[_0x40f7('0x82')][_0x40f7('0x33')](_0x4fa88e['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x40f7('0x84')]});})[_0x40f7('0x23')](function(_0x4c9d1d){return{'rows':_0x4c9d1d||[],'count':_0x23c3b4};});}});}exports['run']=function(_0x45400a,_0x14fd98){return runReport(_0x45400a[_0x40f7('0x46')],_0x45400a[_0x40f7('0x33')],_0x45400a['options'])['then'](respondWithResult(_0x14fd98,null))[_0x40f7('0x44')](handleError(_0x14fd98,null));};exports[_0x40f7('0x9f')]=runReport;exports['query']=function(_0x23aab6,_0x30afe5){var _0x21c592=0xa;var _0x3da7a8=[_0x40f7('0x52'),'left_join',_0x40f7('0x54'),'cross_join'];var _0x416748={'SUM':_0x40f7('0x56'),'COUNT':_0x40f7('0x57'),'COUNT DISTINCT':_0x40f7('0x58'),'MAX':_0x40f7('0x85'),'MIN':_0x40f7('0x59'),'AVG':_0x40f7('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x40f7('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1ad55d={'SEC_TO_TIME':_0x40f7('0x5d'),'DATE':_0x40f7('0x5e'),'HOUR':_0x40f7('0x5f'),'ROUND':_0x40f7('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1cef83=function(_0x52d728){return!_['includes']([_0x40f7('0x63'),'IS\x20NOT\x20NULL',_0x40f7('0x65'),_0x40f7('0x66')],_0x52d728);};var _0x285892=function(_0x4fb462){if(!_0x4fb462||!_0x4fb462[_0x40f7('0x67')]['length']){return'';}for(var _0x2ae7d2='(',_0x1a3aed=0x0;_0x1a3aed<_0x4fb462[_0x40f7('0x67')]['length'];_0x1a3aed+=0x1){_0x1a3aed>0x0&&(_0x2ae7d2+='\x20'+_0x4fb462['operator']+'\x20');_0x2ae7d2+=_0x4fb462[_0x40f7('0x67')][_0x1a3aed][_0x40f7('0x69')]?_0x285892(_0x4fb462['rules'][_0x1a3aed][_0x40f7('0x69')]):_0x4fb462[_0x40f7('0x67')][_0x1a3aed][_0x40f7('0x87')]+'\x20'+_0x4fb462[_0x40f7('0x67')][_0x1a3aed][_0x40f7('0x6a')]+(_0x1cef83(_0x4fb462[_0x40f7('0x67')][_0x1a3aed][_0x40f7('0x6a')])?'\x20'+_0x4fb462[_0x40f7('0x67')][_0x1a3aed]['value']:'');}return _0x2ae7d2+')';};var _0x21dcb0={'where':{'id':_0x23aab6[_0x40f7('0x46')]['id']}},_0x45b3bf,_0x31d571,_0x26baa9,_0x1f4ce,_0x5daef5;_0x21dcb0=_['merge']({},_0x21dcb0,_0x23aab6[_0x40f7('0x3e')]);return db[_0x40f7('0x41')]['find'](_0x21dcb0)[_0x40f7('0x23')](function(_0x23dd2d){if(_0x23dd2d){_0x45b3bf=_0x23dd2d;return _0x23dd2d[_0x40f7('0x6c')]();}return null;})[_0x40f7('0x23')](function(_0x238d93){if(_0x238d93){if(!_0x238d93[_0x40f7('0x38')]){throw new db[(_0x40f7('0x6d'))][(_0x40f7('0xa0'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x31d571=_0x238d93;return db[_0x40f7('0x6f')][_0x40f7('0x42')]({'raw':!![]});}return null;})[_0x40f7('0x23')](function(_0x120c03){if(_0x120c03){_0x26baa9=_['keyBy'](_0x120c03,'id');var _0x1f2212;var _0x338049=squel[_0x40f7('0x70')]();_0x338049[_0x40f7('0x71')](_0x45b3bf[_0x40f7('0x72')]);for(var _0x31491d=0x0;_0x31491d<_0x31d571[_0x40f7('0x38')];_0x31491d+=0x1){_0x1f2212=_0x31d571[_0x31491d][_0x40f7('0x73')]?_0x26baa9[_0x31d571[_0x31491d][_0x40f7('0x73')]][_0x40f7('0xa1')]:_0x31d571[_0x31491d]['field'];_0x1f2212=_0x31d571[_0x31491d][_0x40f7('0x74')]?_[_0x40f7('0x75')](_0x416748[_0x31d571[_0x31491d]['function']],'%s',_0x1f2212):_0x1f2212;_0x1f2212=_0x31d571[_0x31491d][_0x40f7('0x76')]?_[_0x40f7('0x75')](_0x1ad55d[_0x31d571[_0x31491d][_0x40f7('0x76')]],'%s',_0x1f2212):_0x1f2212;if(_0x31d571[_0x31491d]['groupBy']){_0x338049['group'](_0x1f2212);}_0x31d571[_0x31491d]['orderBy']&&_0x338049[_0x40f7('0x39')](_0x1f2212,_0x31d571[_0x31491d]['orderBy']===_0x40f7('0xa2')?![]:!![]);_0x338049[_0x40f7('0x87')](_0x1f2212,_0x31d571[_0x31491d][_0x40f7('0x8a')]||_0x1f2212);}if(_0x45b3bf[_0x40f7('0x78')]){_0x45b3bf[_0x40f7('0x78')]=JSON[_0x40f7('0x79')](_0x45b3bf[_0x40f7('0x78')]);for(var _0x46b102=0x0;_0x46b102<_0x45b3bf[_0x40f7('0x78')][_0x40f7('0x38')];_0x46b102+=0x1){if(_0x45b3bf[_0x40f7('0x78')][_0x46b102]['type']&&_['includes'](_0x3da7a8,_0x45b3bf[_0x40f7('0x78')][_0x46b102][_0x40f7('0x2f')])&&_0x45b3bf['joins'][_0x46b102]['parentKey']&&_0x45b3bf[_0x40f7('0x78')][_0x46b102][_0x40f7('0x7b')]&&_0x45b3bf['joins'][_0x46b102][_0x40f7('0x7c')]){_0x338049[_0x45b3bf[_0x40f7('0x78')][_0x46b102]['type']](_0x45b3bf[_0x40f7('0x78')][_0x46b102][_0x40f7('0x7b')],null,util[_0x40f7('0x76')]('%s.%s\x20=\x20%s.%s',_0x45b3bf['table'],_0x45b3bf['joins'][_0x46b102][_0x40f7('0x7a')],_0x45b3bf['joins'][_0x46b102]['foreignTable'],_0x45b3bf[_0x40f7('0x78')][_0x46b102]['foreignKey']));}}}if(_0x45b3bf[_0x40f7('0x7e')]){_0x45b3bf[_0x40f7('0x7e')]=JSON[_0x40f7('0x79')](_0x45b3bf[_0x40f7('0x7e')]);_0x338049[_0x40f7('0x3b')](_0x285892(_0x45b3bf['conditions']['group']));}_0x5daef5=_0x338049[_0x40f7('0x8b')]();_0x338049['limit'](_0x21c592);_0x338049[_0x40f7('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x338049[_0x40f7('0x81')]());return dbH[_0x40f7('0x82')][_0x40f7('0x33')](_0x338049[_0x40f7('0x81')](),{'type':dbH[_0x40f7('0x82')][_0x40f7('0x83')]['SELECT']});}})[_0x40f7('0x23')](function(){return{'sql':_0x5daef5['toString']()};})[_0x40f7('0x23')](respondWithResult(_0x30afe5,null))[_0x40f7('0x44')](handleError(_0x30afe5,null));};
\ No newline at end of file
+var _0xb2ed=['CustomReports','UserProfileResource','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','filters','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','params','include','find','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','keyBy','select','output','web','fullPath','%s-%s.%s','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','../../files/reports','savename','COUNT(*)','runReport','Limited\x20Query:','rimraf','fast-json-patch','request-promise','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','then','destroy','get'];(function(_0x46f647,_0x33ee02){var _0x4e1af9=function(_0x25f7d7){while(--_0x25f7d7){_0x46f647['push'](_0x46f647['shift']());}};_0x4e1af9(++_0x33ee02);}(_0xb2ed,0x120));var _0xdb2e=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xb2ed[_0xe0b81f];return _0x290e5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb2e('0x1'));var rp=require(_0xdb2e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdb2e('0x3'));var util=require(_0xdb2e('0x4'));var path=require(_0xdb2e('0x5'));var sox=require(_0xdb2e('0x6'));var csv=require(_0xdb2e('0x7'));var ejs=require(_0xdb2e('0x8'));var fs=require('fs');var fs_extra=require(_0xdb2e('0x9'));var _=require(_0xdb2e('0xa'));var squel=require(_0xdb2e('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb2e('0xc'));var deskjs=require(_0xdb2e('0xd'));var toCsv=require(_0xdb2e('0x7'));var querystring=require(_0xdb2e('0xe'));var Papa=require(_0xdb2e('0xf'));var Redis=require(_0xdb2e('0x10'));var authService=require(_0xdb2e('0x11'));var qs=require(_0xdb2e('0x12'));var as=require(_0xdb2e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb2e('0x14'))(_0xdb2e('0x15'));var utils=require(_0xdb2e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdb2e('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0xdb2e('0x18'))[_0xdb2e('0x19')];function respondWithStatusCode(_0x247337,_0x74bdc4){_0x74bdc4=_0x74bdc4||0xcc;return function(_0x3ef2a0){if(_0x3ef2a0){return _0x247337[_0xdb2e('0x1a')](_0x74bdc4);}return _0x247337[_0xdb2e('0x1b')](_0x74bdc4)[_0xdb2e('0x1c')]();};}function respondWithResult(_0x2131c5,_0x9ffbbc){_0x9ffbbc=_0x9ffbbc||0xc8;return function(_0x487e85){if(_0x487e85){return _0x2131c5[_0xdb2e('0x1b')](_0x9ffbbc)[_0xdb2e('0x1d')](_0x487e85);}};}function respondWithFilteredResult(_0x4fa14b,_0x16e416){return function(_0x5a4f4d){if(_0x5a4f4d){var _0x25de74=typeof _0x16e416[_0xdb2e('0x1e')]==='undefined'&&typeof _0x16e416['limit']===_0xdb2e('0x1f');var _0x1eaa89=_0x5a4f4d[_0xdb2e('0x20')];var _0x4e1e9e=_0x25de74?0x0:_0x16e416[_0xdb2e('0x1e')];var _0x37cfe8=_0x25de74?_0x5a4f4d['count']:_0x16e416['offset']+_0x16e416['limit'];var _0x96841a;if(_0x37cfe8>=_0x1eaa89){_0x37cfe8=_0x1eaa89;_0x96841a=0xc8;}else{_0x96841a=0xce;}_0x4fa14b[_0xdb2e('0x1b')](_0x96841a);return _0x4fa14b[_0xdb2e('0x21')](_0xdb2e('0x22'),_0x4e1e9e+'-'+_0x37cfe8+'/'+_0x1eaa89)[_0xdb2e('0x1d')](_0x5a4f4d);}return null;};}function patchUpdates(_0x2b3c08){return function(_0x22256c){try{jsonpatch[_0xdb2e('0x23')](_0x22256c,_0x2b3c08,!![]);}catch(_0x37b042){return BPromise[_0xdb2e('0x24')](_0x37b042);}return _0x22256c['save']();};}function saveUpdates(_0x523262,_0x49d314){return function(_0x4a7ab6){if(_0x4a7ab6){return _0x4a7ab6['update'](_0x523262)[_0xdb2e('0x25')](function(_0x67c853){return _0x67c853;});}return null;};}function removeEntity(_0x22f932,_0x4e99bd){return function(_0x3e8c5f){if(_0x3e8c5f){return _0x3e8c5f[_0xdb2e('0x26')]()[_0xdb2e('0x25')](function(){var _0x5ba45c=_0x3e8c5f[_0xdb2e('0x27')]({'plain':!![]});var _0x40cf5a=_0xdb2e('0x28');return db[_0xdb2e('0x29')][_0xdb2e('0x26')]({'where':{'type':_0x40cf5a,'resourceId':_0x5ba45c['id']}})[_0xdb2e('0x25')](function(){return _0x3e8c5f;});})[_0xdb2e('0x25')](function(){_0x22f932[_0xdb2e('0x1b')](0xcc)[_0xdb2e('0x1c')]();});}};}function handleEntityNotFound(_0x4a5ee1,_0x4274f5){return function(_0x3b393b){if(!_0x3b393b){_0x4a5ee1[_0xdb2e('0x1a')](0x194);}return _0x3b393b;};}function handleError(_0x354c16,_0xaf4631){_0xaf4631=_0xaf4631||0x1f4;return function(_0xa5a88e){logger['error'](_0xa5a88e[_0xdb2e('0x2a')]);if(_0xa5a88e[_0xdb2e('0x2b')]){delete _0xa5a88e[_0xdb2e('0x2b')];}_0x354c16[_0xdb2e('0x1b')](_0xaf4631)['send'](_0xa5a88e);};}exports[_0xdb2e('0x2c')]=function(_0x4c05bd,_0x25ae45){var _0x55c8ac={},_0x9f5b4={},_0x1384a4={'count':0x0,'rows':[]};var _0x5454b0=_[_0xdb2e('0x2d')](db[_0xdb2e('0x2e')][_0xdb2e('0x2f')],function(_0x389f35){return{'name':_0x389f35[_0xdb2e('0x30')],'type':_0x389f35['type'][_0xdb2e('0x31')]};});_0x9f5b4['model']=_[_0xdb2e('0x2d')](_0x5454b0,_0xdb2e('0x2b'));_0x9f5b4['query']=_['keys'](_0x4c05bd['query']);_0x9f5b4[_0xdb2e('0x32')]=_['intersection'](_0x9f5b4[_0xdb2e('0x33')],_0x9f5b4['query']);_0x55c8ac['attributes']=_[_0xdb2e('0x34')](_0x9f5b4[_0xdb2e('0x33')],qs['fields'](_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x36')]));_0x55c8ac[_0xdb2e('0x37')]=_0x55c8ac['attributes'][_0xdb2e('0x38')]?_0x55c8ac['attributes']:_0x9f5b4[_0xdb2e('0x33')];if(!_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x39')](_0xdb2e('0x3a'))){_0x55c8ac['limit']=qs[_0xdb2e('0x3b')](_0x4c05bd['query'][_0xdb2e('0x3b')]);_0x55c8ac[_0xdb2e('0x1e')]=qs[_0xdb2e('0x1e')](_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x1e')]);}_0x55c8ac['order']=qs[_0xdb2e('0x3c')](_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x3c')]);_0x55c8ac[_0xdb2e('0x3d')]=qs[_0xdb2e('0x32')](_[_0xdb2e('0x3e')](_0x4c05bd[_0xdb2e('0x35')],_0x9f5b4[_0xdb2e('0x32')]),_0x5454b0);if(_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x3f')]){_0x55c8ac[_0xdb2e('0x3d')]=_[_0xdb2e('0x40')](_0x55c8ac['where'],{'$or':_[_0xdb2e('0x2d')](_0x5454b0,function(_0x954a4e){if(_0x954a4e[_0xdb2e('0x41')]!==_0xdb2e('0x42')){var _0x13d0f7={};_0x13d0f7[_0x954a4e[_0xdb2e('0x2b')]]={'$like':'%'+_0x4c05bd[_0xdb2e('0x35')][_0xdb2e('0x3f')]+'%'};return _0x13d0f7;}})});}_0x55c8ac=_[_0xdb2e('0x40')]({},_0x55c8ac,_0x4c05bd[_0xdb2e('0x43')]);var _0x2d13ab={'where':_0x55c8ac[_0xdb2e('0x3d')]};return db['AnalyticCustomReport'][_0xdb2e('0x20')](_0x2d13ab)[_0xdb2e('0x25')](function(_0x3437a0){_0x1384a4[_0xdb2e('0x20')]=_0x3437a0;if(_0x4c05bd['query'][_0xdb2e('0x44')]){_0x55c8ac['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x55c8ac);})[_0xdb2e('0x25')](function(_0x13f2fe){_0x1384a4[_0xdb2e('0x45')]=_0x13f2fe;return _0x1384a4;})[_0xdb2e('0x25')](respondWithFilteredResult(_0x25ae45,_0x55c8ac))['catch'](handleError(_0x25ae45,null));};exports['show']=function(_0x111f08,_0x3fc088){var _0x1d99a0={'raw':![],'where':{'id':_0x111f08[_0xdb2e('0x46')]['id']}},_0x552401={};_0x552401[_0xdb2e('0x33')]=_['keys'](db[_0xdb2e('0x2e')][_0xdb2e('0x2f')]);_0x552401['query']=_['keys'](_0x111f08[_0xdb2e('0x35')]);_0x552401['filters']=_[_0xdb2e('0x34')](_0x552401[_0xdb2e('0x33')],_0x552401[_0xdb2e('0x35')]);_0x1d99a0[_0xdb2e('0x37')]=_[_0xdb2e('0x34')](_0x552401[_0xdb2e('0x33')],qs[_0xdb2e('0x36')](_0x111f08[_0xdb2e('0x35')][_0xdb2e('0x36')]));_0x1d99a0[_0xdb2e('0x37')]=_0x1d99a0[_0xdb2e('0x37')][_0xdb2e('0x38')]?_0x1d99a0['attributes']:_0x552401['model'];if(_0x111f08[_0xdb2e('0x35')][_0xdb2e('0x44')]){_0x1d99a0[_0xdb2e('0x47')]=[{'all':!![]}];}_0x1d99a0=_[_0xdb2e('0x40')]({},_0x1d99a0,_0x111f08[_0xdb2e('0x43')]);return db[_0xdb2e('0x2e')][_0xdb2e('0x48')](_0x1d99a0)[_0xdb2e('0x25')](handleEntityNotFound(_0x3fc088,null))[_0xdb2e('0x25')](respondWithResult(_0x3fc088,null))[_0xdb2e('0x49')](handleError(_0x3fc088,null));};exports[_0xdb2e('0x4a')]=function(_0x4ae62a,_0xbbaf63){return db[_0xdb2e('0x2e')]['create'](_0x4ae62a[_0xdb2e('0x4b')],{})[_0xdb2e('0x25')](function(_0x43ba10){var _0x5152e8=_0x4ae62a['user'][_0xdb2e('0x27')]({'plain':!![]});if(!_0x5152e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5152e8['role']===_0xdb2e('0x4c')){var _0x136203=_0x43ba10[_0xdb2e('0x27')]({'plain':!![]});var _0x50a7e5='Reports';return db[_0xdb2e('0x4d')][_0xdb2e('0x48')]({'where':{'name':_0x50a7e5,'userProfileId':_0x5152e8[_0xdb2e('0x4e')]},'raw':!![]})[_0xdb2e('0x25')](function(_0x654a03){if(_0x654a03&&_0x654a03[_0xdb2e('0x4f')]===0x0){return db[_0xdb2e('0x29')][_0xdb2e('0x4a')]({'name':_0x136203['name'],'resourceId':_0x136203['id'],'type':_0xdb2e('0x28'),'sectionId':_0x654a03['id']},{})[_0xdb2e('0x25')](function(){return _0x43ba10;});}else{return _0x43ba10;}})[_0xdb2e('0x49')](function(_0x543e7e){logger[_0xdb2e('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x543e7e);throw _0x543e7e;});}return _0x43ba10;})[_0xdb2e('0x25')](respondWithResult(_0xbbaf63,0xc9))['catch'](handleError(_0xbbaf63,null));};exports['update']=function(_0x6935bc,_0xbbcbeb){if(_0x6935bc[_0xdb2e('0x4b')]['id']){delete _0x6935bc['body']['id'];}return db['AnalyticCustomReport'][_0xdb2e('0x48')]({'where':{'id':_0x6935bc[_0xdb2e('0x46')]['id']}})[_0xdb2e('0x25')](handleEntityNotFound(_0xbbcbeb,null))[_0xdb2e('0x25')](saveUpdates(_0x6935bc['body'],null))['then'](respondWithResult(_0xbbcbeb,null))['catch'](handleError(_0xbbcbeb,null));};exports[_0xdb2e('0x26')]=function(_0x1b876a,_0x9accb6){return db[_0xdb2e('0x2e')]['find']({'where':{'id':_0x1b876a[_0xdb2e('0x46')]['id']}})[_0xdb2e('0x25')](handleEntityNotFound(_0x9accb6,null))[_0xdb2e('0x25')](removeEntity(_0x9accb6,null))[_0xdb2e('0x49')](handleError(_0x9accb6,null));};exports['preview']=function(_0x3d9df1,_0x4e1c83){var _0x296ec2=0xa;var _0x54d8b8=[_0xdb2e('0x51'),_0xdb2e('0x52'),'right_join',_0xdb2e('0x53')];var _0x194672={'SUM':_0xdb2e('0x54'),'COUNT':_0xdb2e('0x55'),'COUNT DISTINCT':_0xdb2e('0x56'),'MAX':_0xdb2e('0x57'),'MIN':'MIN(%s)','AVG':_0xdb2e('0x58'),'GROUP_CONCAT':_0xdb2e('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdb2e('0x5a')};var _0x584168={'SEC_TO_TIME':_0xdb2e('0x5b'),'DATE':_0xdb2e('0x5c'),'HOUR':_0xdb2e('0x5d'),'ROUND':_0xdb2e('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4ade26=function(_0x4af46d){return!_['includes']([_0xdb2e('0x5f'),'IS\x20NOT\x20NULL',_0xdb2e('0x60'),'IS\x20NOT\x20EMPTY'],_0x4af46d);};var _0x2a3936=function(_0x4c8699){if(!_0x4c8699||!_0x4c8699[_0xdb2e('0x61')]['length']){return'';}for(var _0x4cd4f2='(',_0x3a3c9c=0x0;_0x3a3c9c<_0x4c8699[_0xdb2e('0x61')][_0xdb2e('0x38')];_0x3a3c9c+=0x1){_0x3a3c9c>0x0&&(_0x4cd4f2+='\x20'+_0x4c8699[_0xdb2e('0x62')]+'\x20');_0x4cd4f2+=_0x4c8699['rules'][_0x3a3c9c][_0xdb2e('0x63')]?_0x2a3936(_0x4c8699[_0xdb2e('0x61')][_0x3a3c9c][_0xdb2e('0x63')]):_0x4c8699[_0xdb2e('0x61')][_0x3a3c9c][_0xdb2e('0x64')]+'\x20'+_0x4c8699['rules'][_0x3a3c9c][_0xdb2e('0x65')]+(_0x4ade26(_0x4c8699['rules'][_0x3a3c9c]['condition'])?'\x20'+_0x4c8699['rules'][_0x3a3c9c][_0xdb2e('0x66')]:'');}return _0x4cd4f2+')';};var _0x3aef1c={'where':{'id':_0x3d9df1[_0xdb2e('0x46')]['id']}},_0x55d5b6,_0xcd07be,_0x4ae7bf,_0x37410b,_0xf52371;_0x3aef1c=_[_0xdb2e('0x40')]({},_0x3aef1c,_0x3d9df1['options']);return db['AnalyticCustomReport']['find'](_0x3aef1c)[_0xdb2e('0x25')](function(_0x18e31e){if(_0x18e31e){_0x55d5b6=_0x18e31e;return _0x18e31e[_0xdb2e('0x67')]();}return null;})['then'](function(_0x4ef15a){if(_0x4ef15a){if(!_0x4ef15a[_0xdb2e('0x38')]){throw new db[(_0xdb2e('0x68'))][(_0xdb2e('0x69'))](_0xdb2e('0x6a'),0x193);}_0xcd07be=_0x4ef15a;return db[_0xdb2e('0x6b')][_0xdb2e('0x6c')]({'raw':!![]});}return null;})[_0xdb2e('0x25')](function(_0x410137){if(_0x410137){_0x4ae7bf=_['keyBy'](_0x410137,'id');var _0x2e70fb;var _0x39af88=squel['select']();_0x39af88[_0xdb2e('0x6d')](_0x55d5b6[_0xdb2e('0x6e')]);for(var _0x1e95fa=0x0;_0x1e95fa<_0xcd07be[_0xdb2e('0x38')];_0x1e95fa+=0x1){_0x2e70fb=_0xcd07be[_0x1e95fa][_0xdb2e('0x6f')]?_0x4ae7bf[_0xcd07be[_0x1e95fa][_0xdb2e('0x6f')]][_0xdb2e('0x70')]:_0xcd07be[_0x1e95fa]['field'];_0x2e70fb=_0xcd07be[_0x1e95fa][_0xdb2e('0x71')]?_[_0xdb2e('0x72')](_0x194672[_0xcd07be[_0x1e95fa][_0xdb2e('0x71')]],'%s',_0x2e70fb):_0x2e70fb;_0x2e70fb=_0xcd07be[_0x1e95fa][_0xdb2e('0x73')]?_[_0xdb2e('0x72')](_0x584168[_0xcd07be[_0x1e95fa]['format']],'%s',_0x2e70fb):_0x2e70fb;if(_0xcd07be[_0x1e95fa][_0xdb2e('0x74')]){_0x39af88[_0xdb2e('0x63')](_0x2e70fb);}_0xcd07be[_0x1e95fa][_0xdb2e('0x75')]&&_0x39af88[_0xdb2e('0x76')](_0x2e70fb,_0xcd07be[_0x1e95fa][_0xdb2e('0x75')]===_0xdb2e('0x77')?![]:!![]);_0x39af88[_0xdb2e('0x64')](_0x2e70fb,_0xcd07be[_0x1e95fa][_0xdb2e('0x78')]||_0x2e70fb);}if(_0x55d5b6[_0xdb2e('0x79')]){_0x55d5b6['joins']=JSON['parse'](_0x55d5b6[_0xdb2e('0x79')]);for(var _0x5dd40a=0x0;_0x5dd40a<_0x55d5b6[_0xdb2e('0x79')][_0xdb2e('0x38')];_0x5dd40a+=0x1){if(_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x41')]&&_['includes'](_0x54d8b8,_0x55d5b6['joins'][_0x5dd40a][_0xdb2e('0x41')])&&_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7a')]&&_0x55d5b6['joins'][_0x5dd40a][_0xdb2e('0x7b')]&&_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7c')]){_0x39af88[_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x41')]](_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7b')],null,util[_0xdb2e('0x73')](_0xdb2e('0x7d'),_0x55d5b6[_0xdb2e('0x6e')],_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7a')],_0x55d5b6[_0xdb2e('0x79')][_0x5dd40a][_0xdb2e('0x7b')],_0x55d5b6['joins'][_0x5dd40a][_0xdb2e('0x7c')]));}}}if(_0x55d5b6['conditions']){_0x55d5b6[_0xdb2e('0x7e')]=JSON[_0xdb2e('0x7f')](_0x55d5b6[_0xdb2e('0x7e')]);_0x39af88[_0xdb2e('0x3d')](_0x2a3936(_0x55d5b6[_0xdb2e('0x7e')][_0xdb2e('0x63')]));}_0xf52371=_0x39af88[_0xdb2e('0x80')]();_0x39af88[_0xdb2e('0x3b')](_0x296ec2);_0x39af88[_0xdb2e('0x1e')](0x0);logger[_0xdb2e('0x81')]('Limited\x20Query:',_0x39af88[_0xdb2e('0x82')]());return dbH[_0xdb2e('0x83')][_0xdb2e('0x35')](_0x39af88['toString'](),{'type':dbH['sequelize'][_0xdb2e('0x84')][_0xdb2e('0x85')]});}})[_0xdb2e('0x25')](respondWithResult(_0x4e1c83,null))[_0xdb2e('0x49')](handleError(_0x4e1c83,null));};function runReport(_0x383a6b,_0x4f5de4,_0x627b45){var _0xc8aaf1=_0x4f5de4[_0xdb2e('0x2b')];var _0x3f8e5a=0xa;var _0x27df56=[_0xdb2e('0x51'),'left_join',_0xdb2e('0x86'),_0xdb2e('0x53')];var _0x570777={'SUM':_0xdb2e('0x54'),'COUNT':_0xdb2e('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdb2e('0x57'),'MIN':_0xdb2e('0x87'),'AVG':_0xdb2e('0x58'),'GROUP_CONCAT':_0xdb2e('0x59'),'GROUP_CONCAT ASC':_0xdb2e('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x485d3d={'SEC_TO_TIME':_0xdb2e('0x5b'),'DATE':_0xdb2e('0x5c'),'HOUR':_0xdb2e('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xdb2e('0x89')};var _0x3f005a=function(_0x3e7129){return!_[_0xdb2e('0x8a')]([_0xdb2e('0x5f'),_0xdb2e('0x8b'),'IS\x20EMPTY',_0xdb2e('0x8c')],_0x3e7129);};var _0x5dc883=function(_0x3ea83e){if(!_0x3ea83e||!_0x3ea83e[_0xdb2e('0x61')]['length']){return'';}for(var _0x5f2011='(',_0x313267=0x0;_0x313267<_0x3ea83e['rules'][_0xdb2e('0x38')];_0x313267+=0x1){_0x313267>0x0&&(_0x5f2011+='\x20'+_0x3ea83e[_0xdb2e('0x62')]+'\x20');_0x5f2011+=_0x3ea83e['rules'][_0x313267][_0xdb2e('0x63')]?_0x5dc883(_0x3ea83e[_0xdb2e('0x61')][_0x313267][_0xdb2e('0x63')]):_0x3ea83e['rules'][_0x313267][_0xdb2e('0x64')]+'\x20'+_0x3ea83e['rules'][_0x313267]['condition']+(_0x3f005a(_0x3ea83e[_0xdb2e('0x61')][_0x313267][_0xdb2e('0x65')])?'\x20'+_0x3ea83e[_0xdb2e('0x61')][_0x313267][_0xdb2e('0x66')]:'');}return _0x5f2011+')';};var _0x2ab1e1={'where':{'id':_0x383a6b['id']}},_0x2648f6,_0x56b2f6,_0x5041d0,_0x19f61a,_0x13c5d7;_0x2ab1e1=_['merge']({},_0x2ab1e1,_0x627b45);return db[_0xdb2e('0x2e')][_0xdb2e('0x48')](_0x2ab1e1)[_0xdb2e('0x25')](function(_0x2166c3){if(_0x2166c3){_0x2648f6=_0x2166c3;return _0x2166c3[_0xdb2e('0x67')]();}return null;})[_0xdb2e('0x25')](function(_0x5eb83f){if(_0x5eb83f){if(!_0x5eb83f[_0xdb2e('0x38')]){throw new db[(_0xdb2e('0x68'))][(_0xdb2e('0x69'))](_0xdb2e('0x6a'),0x193);}_0x56b2f6=_0x5eb83f;return db[_0xdb2e('0x6b')][_0xdb2e('0x6c')]({'raw':!![]});}return null;})[_0xdb2e('0x25')](function(_0x215b57){if(_0x215b57){_0x5041d0=_[_0xdb2e('0x8d')](_0x215b57,'id');var _0x11d9bb;var _0x4ac2e3=squel[_0xdb2e('0x8e')]();_0x4ac2e3['from'](_0x2648f6[_0xdb2e('0x6e')]);for(var _0x132c8f=0x0;_0x132c8f<_0x56b2f6[_0xdb2e('0x38')];_0x132c8f+=0x1){_0x11d9bb=_0x56b2f6[_0x132c8f][_0xdb2e('0x6f')]?_0x5041d0[_0x56b2f6[_0x132c8f][_0xdb2e('0x6f')]]['metric']:_0x56b2f6[_0x132c8f]['field'];_0x11d9bb=_0x56b2f6[_0x132c8f][_0xdb2e('0x71')]?_[_0xdb2e('0x72')](_0x570777[_0x56b2f6[_0x132c8f][_0xdb2e('0x71')]],'%s',_0x11d9bb):_0x11d9bb;_0x11d9bb=_0x56b2f6[_0x132c8f][_0xdb2e('0x73')]?_[_0xdb2e('0x72')](_0x485d3d[_0x56b2f6[_0x132c8f][_0xdb2e('0x73')]],'%s',_0x11d9bb):_0x11d9bb;if(_0x56b2f6[_0x132c8f][_0xdb2e('0x74')]){_0x4ac2e3['group'](_0x11d9bb);}_0x56b2f6[_0x132c8f][_0xdb2e('0x75')]&&_0x4ac2e3[_0xdb2e('0x76')](_0x11d9bb,_0x56b2f6[_0x132c8f][_0xdb2e('0x75')]==='DESC'?![]:!![]);_0x4ac2e3[_0xdb2e('0x64')](_0x11d9bb,_0x56b2f6[_0x132c8f][_0xdb2e('0x78')]||_0x11d9bb);}if(_0x2648f6['joins']){_0x2648f6[_0xdb2e('0x79')]=JSON[_0xdb2e('0x7f')](_0x2648f6[_0xdb2e('0x79')]);for(var _0x314cf2=0x0;_0x314cf2<_0x2648f6[_0xdb2e('0x79')][_0xdb2e('0x38')];_0x314cf2+=0x1){if(_0x2648f6['joins'][_0x314cf2]['type']&&_[_0xdb2e('0x8a')](_0x27df56,_0x2648f6[_0xdb2e('0x79')][_0x314cf2]['type'])&&_0x2648f6[_0xdb2e('0x79')][_0x314cf2]['parentKey']&&_0x2648f6[_0xdb2e('0x79')][_0x314cf2][_0xdb2e('0x7b')]&&_0x2648f6[_0xdb2e('0x79')][_0x314cf2]['foreignKey']){_0x4ac2e3[_0x2648f6['joins'][_0x314cf2][_0xdb2e('0x41')]](_0x2648f6[_0xdb2e('0x79')][_0x314cf2]['foreignTable'],null,util[_0xdb2e('0x73')](_0xdb2e('0x7d'),_0x2648f6[_0xdb2e('0x6e')],_0x2648f6[_0xdb2e('0x79')][_0x314cf2][_0xdb2e('0x7a')],_0x2648f6['joins'][_0x314cf2]['foreignTable'],_0x2648f6[_0xdb2e('0x79')][_0x314cf2][_0xdb2e('0x7c')]));}}}if(_0x2648f6[_0xdb2e('0x7e')]){_0x2648f6[_0xdb2e('0x7e')]=JSON[_0xdb2e('0x7f')](_0x2648f6[_0xdb2e('0x7e')]);_0x4ac2e3[_0xdb2e('0x3d')](_0x5dc883(_0x2648f6[_0xdb2e('0x7e')][_0xdb2e('0x63')]));}_0x13c5d7=_0x4ac2e3[_0xdb2e('0x80')]();_0x4ac2e3[_0xdb2e('0x3b')](_0x3f8e5a);_0x4ac2e3['offset'](0x0);return;}})[_0xdb2e('0x25')](function(){if(_0x4f5de4[_0xdb2e('0x8f')]===_0xdb2e('0x90')){return null;}var _0x18f6c4=_[_0xdb2e('0x40')](_0x4f5de4,{'name':_0x4f5de4[_0xdb2e('0x91')]||_0x4f5de4[_0xdb2e('0x2b')]||_0x2648f6['name'],'basename':_0xc8aaf1,'savename':util['format'](_0xdb2e('0x92'),_0x4f5de4[_0xdb2e('0x2b')]||_0x2648f6[_0xdb2e('0x2b')],require(_0xdb2e('0x93'))['generate'](0x4),_0x4f5de4['output']||_0xdb2e('0x94')),'reportId':_0x2648f6['id'],'reportType':_0xdb2e('0x95')});return db[_0xdb2e('0x96')][_0xdb2e('0x4a')](_0x18f6c4,{'raw':!![]});})[_0xdb2e('0x25')](function(_0x35a6cd){if(_0x2648f6[_0xdb2e('0x6e')]===_0xdb2e('0x97')){_0x13c5d7[_0xdb2e('0x3d')](_0x2648f6[_0xdb2e('0x6e')]+_0xdb2e('0x98'),_0x4f5de4['startDate'],_0x4f5de4[_0xdb2e('0x99')]);}else{_0x13c5d7[_0xdb2e('0x3d')](_0x2648f6[_0xdb2e('0x6e')]+_0xdb2e('0x9a'),_0x4f5de4[_0xdb2e('0x9b')],_0x4f5de4[_0xdb2e('0x99')]);}if(_0x35a6cd){logger[_0xdb2e('0x9c')](_0xdb2e('0x9d'),_0x13c5d7[_0xdb2e('0x82')]());require(_0xdb2e('0x9e'))['fork'](path[_0xdb2e('0x51')](__dirname,'../../components/export/',_0x35a6cd[_0xdb2e('0x8f')]),[_0x35a6cd['id'],_0x13c5d7[_0xdb2e('0x82')](),path[_0xdb2e('0x51')](__dirname,_0xdb2e('0x9f'),_0x35a6cd[_0xdb2e('0xa0')]),_0xc8aaf1]);return _0x35a6cd;}else{var _0x3796eb=squel[_0xdb2e('0x8e')]();_0x3796eb['from']('('+_0x13c5d7[_0xdb2e('0x82')]()+')','countTable');_0x3796eb[_0xdb2e('0x64')](_0xdb2e('0xa1'),'count');_0x13c5d7[_0xdb2e('0x3b')](_0x4f5de4['limit']||_0x3f8e5a);_0x13c5d7[_0xdb2e('0x1e')](_0x4f5de4['offset']||0x0);return dbH['sequelize'][_0xdb2e('0x35')](_0x3796eb['toString'](),{'type':dbH['sequelize'][_0xdb2e('0x84')][_0xdb2e('0x85')]})['then'](function(_0x52f959){if(!_0x52f959[_0xdb2e('0x38')]){_0x19f61a=0x0;}else{_0x19f61a=_0x52f959[0x0][_0xdb2e('0x20')]||0x0;}return dbH[_0xdb2e('0x83')][_0xdb2e('0x35')](_0x13c5d7['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xdb2e('0x85')]});})[_0xdb2e('0x25')](function(_0x14e7c9){return{'rows':_0x14e7c9||[],'count':_0x19f61a};});}});}exports['run']=function(_0x18b044,_0x561a71){return runReport(_0x18b044['params'],_0x18b044[_0xdb2e('0x35')],_0x18b044[_0xdb2e('0x43')])['then'](respondWithResult(_0x561a71,null))[_0xdb2e('0x49')](handleError(_0x561a71,null));};exports[_0xdb2e('0xa2')]=runReport;exports[_0xdb2e('0x35')]=function(_0x45f862,_0x482d19){var _0x5027c4=0xa;var _0xf30a64=[_0xdb2e('0x51'),_0xdb2e('0x52'),'right_join',_0xdb2e('0x53')];var _0x12cbdb={'SUM':_0xdb2e('0x54'),'COUNT':_0xdb2e('0x55'),'COUNT DISTINCT':_0xdb2e('0x56'),'MAX':_0xdb2e('0x57'),'MIN':_0xdb2e('0x87'),'AVG':_0xdb2e('0x58'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xdb2e('0x88'),'GROUP_CONCAT DESC':_0xdb2e('0x5a')};var _0x35679c={'SEC_TO_TIME':_0xdb2e('0x5b'),'DATE':_0xdb2e('0x5c'),'HOUR':_0xdb2e('0x5d'),'ROUND':_0xdb2e('0x5e'),'UNIX_TIMESTAMP':_0xdb2e('0x89')};var _0x415b46=function(_0x1efd55){return!_[_0xdb2e('0x8a')]([_0xdb2e('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xdb2e('0x8c')],_0x1efd55);};var _0x357939=function(_0x35db1a){if(!_0x35db1a||!_0x35db1a[_0xdb2e('0x61')][_0xdb2e('0x38')]){return'';}for(var _0x455a00='(',_0x56d13c=0x0;_0x56d13c<_0x35db1a['rules'][_0xdb2e('0x38')];_0x56d13c+=0x1){_0x56d13c>0x0&&(_0x455a00+='\x20'+_0x35db1a[_0xdb2e('0x62')]+'\x20');_0x455a00+=_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x63')]?_0x357939(_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x63')]):_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x64')]+'\x20'+_0x35db1a[_0xdb2e('0x61')][_0x56d13c]['condition']+(_0x415b46(_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x65')])?'\x20'+_0x35db1a[_0xdb2e('0x61')][_0x56d13c][_0xdb2e('0x66')]:'');}return _0x455a00+')';};var _0x24b78e={'where':{'id':_0x45f862[_0xdb2e('0x46')]['id']}},_0x967c55,_0x11db14,_0x2cb682,_0x2adaed,_0x96c187;_0x24b78e=_[_0xdb2e('0x40')]({},_0x24b78e,_0x45f862['options']);return db['AnalyticCustomReport']['find'](_0x24b78e)[_0xdb2e('0x25')](function(_0xd0a841){if(_0xd0a841){_0x967c55=_0xd0a841;return _0xd0a841[_0xdb2e('0x67')]();}return null;})[_0xdb2e('0x25')](function(_0x3588dc){if(_0x3588dc){if(!_0x3588dc['length']){throw new db[(_0xdb2e('0x68'))][(_0xdb2e('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x11db14=_0x3588dc;return db[_0xdb2e('0x6b')][_0xdb2e('0x6c')]({'raw':!![]});}return null;})['then'](function(_0x4a992b){if(_0x4a992b){_0x2cb682=_[_0xdb2e('0x8d')](_0x4a992b,'id');var _0x54988b;var _0x127531=squel['select']();_0x127531[_0xdb2e('0x6d')](_0x967c55[_0xdb2e('0x6e')]);for(var _0x402c85=0x0;_0x402c85<_0x11db14[_0xdb2e('0x38')];_0x402c85+=0x1){_0x54988b=_0x11db14[_0x402c85][_0xdb2e('0x6f')]?_0x2cb682[_0x11db14[_0x402c85][_0xdb2e('0x6f')]][_0xdb2e('0x70')]:_0x11db14[_0x402c85][_0xdb2e('0x64')];_0x54988b=_0x11db14[_0x402c85][_0xdb2e('0x71')]?_[_0xdb2e('0x72')](_0x12cbdb[_0x11db14[_0x402c85][_0xdb2e('0x71')]],'%s',_0x54988b):_0x54988b;_0x54988b=_0x11db14[_0x402c85][_0xdb2e('0x73')]?_[_0xdb2e('0x72')](_0x35679c[_0x11db14[_0x402c85][_0xdb2e('0x73')]],'%s',_0x54988b):_0x54988b;if(_0x11db14[_0x402c85]['groupBy']){_0x127531[_0xdb2e('0x63')](_0x54988b);}_0x11db14[_0x402c85]['orderBy']&&_0x127531[_0xdb2e('0x76')](_0x54988b,_0x11db14[_0x402c85]['orderBy']===_0xdb2e('0x77')?![]:!![]);_0x127531[_0xdb2e('0x64')](_0x54988b,_0x11db14[_0x402c85]['alias']||_0x54988b);}if(_0x967c55['joins']){_0x967c55[_0xdb2e('0x79')]=JSON['parse'](_0x967c55[_0xdb2e('0x79')]);for(var _0x341715=0x0;_0x341715<_0x967c55[_0xdb2e('0x79')][_0xdb2e('0x38')];_0x341715+=0x1){if(_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x41')]&&_['includes'](_0xf30a64,_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x41')])&&_0x967c55['joins'][_0x341715]['parentKey']&&_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x7b')]&&_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x7c')]){_0x127531[_0x967c55['joins'][_0x341715]['type']](_0x967c55[_0xdb2e('0x79')][_0x341715]['foreignTable'],null,util[_0xdb2e('0x73')](_0xdb2e('0x7d'),_0x967c55[_0xdb2e('0x6e')],_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x7a')],_0x967c55[_0xdb2e('0x79')][_0x341715][_0xdb2e('0x7b')],_0x967c55['joins'][_0x341715][_0xdb2e('0x7c')]));}}}if(_0x967c55[_0xdb2e('0x7e')]){_0x967c55[_0xdb2e('0x7e')]=JSON[_0xdb2e('0x7f')](_0x967c55[_0xdb2e('0x7e')]);_0x127531[_0xdb2e('0x3d')](_0x357939(_0x967c55[_0xdb2e('0x7e')]['group']));}_0x96c187=_0x127531[_0xdb2e('0x80')]();_0x127531[_0xdb2e('0x3b')](_0x5027c4);_0x127531[_0xdb2e('0x1e')](0x0);logger['debug'](_0xdb2e('0xa3'),_0x127531[_0xdb2e('0x82')]());return dbH['sequelize'][_0xdb2e('0x35')](_0x127531[_0xdb2e('0x82')](),{'type':dbH[_0xdb2e('0x83')][_0xdb2e('0x84')]['SELECT']});}})[_0xdb2e('0x25')](function(){return{'sql':_0x96c187['toString']()};})[_0xdb2e('0x25')](respondWithResult(_0x482d19,null))['catch'](handleError(_0x482d19,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 1703f37..2b0b420 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 _0x5b23=['../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x6a70b6,_0x1cc1ec){var _0x5815c9=function(_0x3e5ed5){while(--_0x3e5ed5){_0x6a70b6['push'](_0x6a70b6['shift']());}};_0x5815c9(++_0x1cc1ec);}(_0x5b23,0x1d8));var _0x35b2=function(_0x3f7e37,_0x32f790){_0x3f7e37=_0x3f7e37-0x0;var _0x2a3ec7=_0x5b23[_0x3f7e37];return _0x2a3ec7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x35b2('0x0'))(_0x35b2('0x1'));var moment=require(_0x35b2('0x2'));var BPromise=require('bluebird');var rp=require(_0x35b2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35b2('0x4'));var config=require(_0x35b2('0x5'));var attributes=require(_0x35b2('0x6'));module[_0x35b2('0x7')]=function(_0x34aead,_0x350ef7){return _0x34aead['define'](_0x35b2('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e06=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util'];(function(_0x473155,_0x2f4730){var _0x57525a=function(_0x14a8f2){while(--_0x14a8f2){_0x473155['push'](_0x473155['shift']());}};_0x57525a(++_0x2f4730);}(_0x9e06,0x106));var _0x69e0=function(_0x422d30,_0x5ec4b1){_0x422d30=_0x422d30-0x0;var _0x236072=_0x9e06[_0x422d30];return _0x236072;};'use strict';var _=require(_0x69e0('0x0'));var util=require(_0x69e0('0x1'));var logger=require(_0x69e0('0x2'))(_0x69e0('0x3'));var moment=require(_0x69e0('0x4'));var BPromise=require('bluebird');var rp=require(_0x69e0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x69e0('0x6'));var config=require(_0x69e0('0x7'));var attributes=require(_0x69e0('0x8'));module[_0x69e0('0x9')]=function(_0x47d2aa,_0x308873){return _0x47d2aa[_0x69e0('0xa')](_0x69e0('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 36a2be3..edafa04 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 _0x5781=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1f31f7,_0x7b0ec3){var _0x512140=function(_0x48cdc4){while(--_0x48cdc4){_0x1f31f7['push'](_0x1f31f7['shift']());}};_0x512140(++_0x7b0ec3);}(_0x5781,0xab));var _0x1578=function(_0x236eb5,_0x50fc4f){_0x236eb5=_0x236eb5-0x0;var _0x20582e=_0x5781[_0x236eb5];return _0x20582e;};'use strict';var _=require(_0x1578('0x0'));var util=require(_0x1578('0x1'));var moment=require(_0x1578('0x2'));var BPromise=require(_0x1578('0x3'));var rs=require(_0x1578('0x4'));var fs=require('fs');var Redis=require(_0x1578('0x5'));var db=require(_0x1578('0x6'))['db'];var utils=require(_0x1578('0x7'));var logger=require(_0x1578('0x8'))('rpc');var config=require(_0x1578('0x9'));var jayson=require(_0x1578('0xa'));var client=jayson['client'][_0x1578('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x447971,_0x14977d,_0x22f6e7){return new BPromise(function(_0x1b9b4d,_0x53ae4e){return client[_0x1578('0xc')](_0x447971,_0x22f6e7)['then'](function(_0x249cdd){logger['info'](_0x1578('0xd'),_0x14977d,'request\x20sent');logger[_0x1578('0xe')](_0x1578('0xf'),_0x14977d,_0x1578('0x10'),JSON[_0x1578('0x11')](_0x249cdd));if(_0x249cdd[_0x1578('0x12')]){if(_0x249cdd[_0x1578('0x12')][_0x1578('0x13')]===0x1f4){logger[_0x1578('0x12')](_0x1578('0xd'),_0x14977d,_0x249cdd[_0x1578('0x12')]['message']);return _0x53ae4e(_0x249cdd[_0x1578('0x12')][_0x1578('0x14')]);}logger[_0x1578('0x12')](_0x1578('0xd'),_0x14977d,_0x249cdd[_0x1578('0x12')][_0x1578('0x14')]);return _0x1b9b4d(_0x249cdd[_0x1578('0x12')][_0x1578('0x14')]);}else{logger[_0x1578('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x14977d,_0x1578('0x10'));_0x1b9b4d(_0x249cdd[_0x1578('0x16')][_0x1578('0x14')]);}})[_0x1578('0x17')](function(_0x519538){logger[_0x1578('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x14977d,_0x519538);_0x53ae4e(_0x519538);});});}
\ No newline at end of file
+var _0xefe6=['rpc','../../config/environment','jayson/promise','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefe6,0x8c));var _0x6efe=function(_0x58e09b,_0x6ef44c){_0x58e09b=_0x58e09b-0x0;var _0x243038=_0xefe6[_0x58e09b];return _0x243038;};'use strict';var _=require('lodash');var util=require(_0x6efe('0x0'));var moment=require(_0x6efe('0x1'));var BPromise=require(_0x6efe('0x2'));var rs=require(_0x6efe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6efe('0x4'))['db'];var utils=require(_0x6efe('0x5'));var logger=require(_0x6efe('0x6'))(_0x6efe('0x7'));var config=require(_0x6efe('0x8'));var jayson=require(_0x6efe('0x9'));var client=jayson['client'][_0x6efe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28e0ae,_0xc70024,_0x4f71ee){return new BPromise(function(_0x2cc472,_0x102471){return client['request'](_0x28e0ae,_0x4f71ee)['then'](function(_0x1c383f){logger[_0x6efe('0xb')](_0x6efe('0xc'),_0xc70024,_0x6efe('0xd'));logger[_0x6efe('0xe')](_0x6efe('0xf'),_0xc70024,_0x6efe('0xd'),JSON[_0x6efe('0x10')](_0x1c383f));if(_0x1c383f[_0x6efe('0x11')]){if(_0x1c383f[_0x6efe('0x11')]['code']===0x1f4){logger[_0x6efe('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc70024,_0x1c383f['error'][_0x6efe('0x12')]);return _0x102471(_0x1c383f['error'][_0x6efe('0x12')]);}logger[_0x6efe('0x11')](_0x6efe('0xc'),_0xc70024,_0x1c383f[_0x6efe('0x11')][_0x6efe('0x12')]);return _0x2cc472(_0x1c383f[_0x6efe('0x11')][_0x6efe('0x12')]);}else{logger[_0x6efe('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc70024,_0x6efe('0xd'));_0x2cc472(_0x1c383f[_0x6efe('0x13')][_0x6efe('0x12')]);}})[_0x6efe('0x14')](function(_0x2f9c19){logger[_0x6efe('0x11')](_0x6efe('0xc'),_0xc70024,_0x2f9c19);_0x102471(_0x2f9c19);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 879c131..a49aa23 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 _0xada0=['create','put','update','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query'];(function(_0x5584ce,_0x341577){var _0x5761ab=function(_0x4bff84){while(--_0x4bff84){_0x5584ce['push'](_0x5584ce['shift']());}};_0x5761ab(++_0x341577);}(_0xada0,0x9f));var _0x0ada=function(_0x55f2ee,_0x52bffa){_0x55f2ee=_0x55f2ee-0x0;var _0x39e718=_0xada0[_0x55f2ee];return _0x39e718;};'use strict';var multer=require(_0x0ada('0x0'));var util=require('util');var path=require(_0x0ada('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0ada('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0ada('0x3'));var interaction=require(_0x0ada('0x4'));var config=require(_0x0ada('0x5'));var controller=require(_0x0ada('0x6'));router['get']('/',auth[_0x0ada('0x7')](),controller[_0x0ada('0x8')]);router[_0x0ada('0x9')](_0x0ada('0xa'),auth[_0x0ada('0x7')](),controller[_0x0ada('0xb')]);router[_0x0ada('0x9')](_0x0ada('0xc'),auth[_0x0ada('0x7')](),controller[_0x0ada('0xd')]);router['get'](_0x0ada('0xe'),auth[_0x0ada('0x7')](),controller['run']);router[_0x0ada('0x9')](_0x0ada('0xf'),auth['isAuthenticated'](),controller[_0x0ada('0x10')]);router['post']('/',auth[_0x0ada('0x7')](),controller[_0x0ada('0x11')]);router[_0x0ada('0x12')](_0x0ada('0xa'),auth[_0x0ada('0x7')](),controller[_0x0ada('0x13')]);router[_0x0ada('0x14')](_0x0ada('0xa'),auth[_0x0ada('0x7')](),controller['destroy']);module[_0x0ada('0x15')]=router;
\ No newline at end of file
+var _0x0211=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','preview','/:id/run','/:id/query','isAuthenticated','query','post','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x23a6c3,_0xcbb1d3){var _0x30c897=function(_0x19168b){while(--_0x19168b){_0x23a6c3['push'](_0x23a6c3['shift']());}};_0x30c897(++_0xcbb1d3);}(_0x0211,0x1b6));var _0x1021=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0211[_0x31e29a];return _0x32d892;};'use strict';var multer=require('multer');var util=require(_0x1021('0x0'));var path=require(_0x1021('0x1'));var timeout=require(_0x1021('0x2'));var express=require(_0x1021('0x3'));var router=express[_0x1021('0x4')]();var fs_extra=require(_0x1021('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1021('0x6'));var config=require(_0x1021('0x7'));var controller=require(_0x1021('0x8'));router[_0x1021('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1021('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1021('0x9')]('/:id/preview',auth['isAuthenticated'](),controller[_0x1021('0xa')]);router[_0x1021('0x9')](_0x1021('0xb'),auth['isAuthenticated'](),controller['run']);router[_0x1021('0x9')](_0x1021('0xc'),auth[_0x1021('0xd')](),controller[_0x1021('0xe')]);router[_0x1021('0xf')]('/',auth[_0x1021('0xd')](),controller['create']);router['put'](_0x1021('0x10'),auth[_0x1021('0xd')](),controller[_0x1021('0x11')]);router[_0x1021('0x12')](_0x1021('0x10'),auth[_0x1021('0xd')](),controller[_0x1021('0x13')]);module[_0x1021('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 75c4eff..8b58f09 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 _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0x258ff0,_0x3efa61){var _0x3ccb77=function(_0x3e850f){while(--_0x3e850f){_0x258ff0['push'](_0x258ff0['shift']());}};_0x3ccb77(++_0x3efa61);}(_0x53ec,0x192));var _0xc53e=function(_0x117b82,_0x13554b){_0x117b82=_0x117b82-0x0;var _0x3a8975=_0x53ec[_0x117b82];return _0x3a8975;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}};
\ No newline at end of file
+var _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x339301,_0x4d9089){_0x339301=_0x339301-0x0;var _0x25a96f=_0xb4c7[_0x339301];return _0x25a96f;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 6655b21..e841ae7 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x371367,_0x1eec1a){var _0x57c4f1=function(_0x369840){while(--_0x369840){_0x371367['push'](_0x371367['shift']());}};_0x57c4f1(++_0x1eec1a);}(_0x31f0,0xb7));var _0x031f=function(_0x25c294,_0x43c6d7){_0x25c294=_0x25c294-0x0;var _0x3724f5=_0x31f0[_0x25c294];return _0x3724f5;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
+var _0x687b=['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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x687b,0x14a));var _0xb687=function(_0x2efe4f,_0x35b3d9){_0x2efe4f=_0x2efe4f-0x0;var _0x251e7e=_0x687b[_0x2efe4f];return _0x251e7e;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index f8dc8cf..a7d7566 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 _0x7ed3=['exports','AnalyticDefaultReport','analytics_default_reports','lodash','path','rimraf','../../config/environment'];(function(_0x276bb7,_0x55b660){var _0x334da4=function(_0x15084d){while(--_0x15084d){_0x276bb7['push'](_0x276bb7['shift']());}};_0x334da4(++_0x55b660);}(_0x7ed3,0x137));var _0x37ed=function(_0x2773b3,_0x302cd8){_0x2773b3=_0x2773b3-0x0;var _0xa113ea=_0x7ed3[_0x2773b3];return _0xa113ea;};'use strict';var _=require(_0x37ed('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x37ed('0x1'));var rimraf=require(_0x37ed('0x2'));var config=require(_0x37ed('0x3'));var attributes=require('./analyticDefaultReport.attributes');module[_0x37ed('0x4')]=function(_0x9e86ee,_0x5ecd6e){return _0x9e86ee['define'](_0x37ed('0x5'),attributes,{'tableName':_0x37ed('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc6f5=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xc6f5,0x197));var _0x5c6f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc6f5[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x5c6f('0x0'));var util=require(_0x5c6f('0x1'));var logger=require(_0x5c6f('0x2'))('api');var moment=require(_0x5c6f('0x3'));var BPromise=require(_0x5c6f('0x4'));var rp=require(_0x5c6f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5c6f('0x6'));var config=require(_0x5c6f('0x7'));var attributes=require(_0x5c6f('0x8'));module[_0x5c6f('0x9')]=function(_0xb1212c,_0x20564b){return _0xb1212c[_0x5c6f('0xa')](_0x5c6f('0xb'),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 70e25bf..2183b2c 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 _0x2a6c=['error','code','message','request\x20sent','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1709e7,_0x2ced21){var _0x402819=function(_0x3637a0){while(--_0x3637a0){_0x1709e7['push'](_0x1709e7['shift']());}};_0x402819(++_0x2ced21);}(_0x2a6c,0x102));var _0xc2a6=function(_0x2ceee7,_0x3c937f){_0x2ceee7=_0x2ceee7-0x0;var _0x4392f9=_0x2a6c[_0x2ceee7];return _0x4392f9;};'use strict';var _=require('lodash');var util=require(_0xc2a6('0x0'));var moment=require(_0xc2a6('0x1'));var BPromise=require(_0xc2a6('0x2'));var rs=require(_0xc2a6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2a6('0x4'))['db'];var utils=require(_0xc2a6('0x5'));var logger=require(_0xc2a6('0x6'))(_0xc2a6('0x7'));var config=require(_0xc2a6('0x8'));var jayson=require(_0xc2a6('0x9'));var client=jayson[_0xc2a6('0xa')][_0xc2a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1829c2,_0x189a87,_0x5aabc5){return new BPromise(function(_0x5d02fe,_0x278e3c){return client[_0xc2a6('0xc')](_0x1829c2,_0x5aabc5)[_0xc2a6('0xd')](function(_0x3739cc){logger['info'](_0xc2a6('0xe'),_0x189a87,'request\x20sent');logger[_0xc2a6('0xf')](_0xc2a6('0x10'),_0x189a87,'request\x20sent',JSON[_0xc2a6('0x11')](_0x3739cc));if(_0x3739cc[_0xc2a6('0x12')]){if(_0x3739cc[_0xc2a6('0x12')][_0xc2a6('0x13')]===0x1f4){logger[_0xc2a6('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x189a87,_0x3739cc[_0xc2a6('0x12')]['message']);return _0x278e3c(_0x3739cc[_0xc2a6('0x12')]['message']);}logger[_0xc2a6('0x12')](_0xc2a6('0xe'),_0x189a87,_0x3739cc[_0xc2a6('0x12')][_0xc2a6('0x14')]);return _0x5d02fe(_0x3739cc[_0xc2a6('0x12')][_0xc2a6('0x14')]);}else{logger['info'](_0xc2a6('0xe'),_0x189a87,_0xc2a6('0x15'));_0x5d02fe(_0x3739cc['result'][_0xc2a6('0x14')]);}})[_0xc2a6('0x16')](function(_0x5caea5){logger[_0xc2a6('0x12')](_0xc2a6('0xe'),_0x189a87,_0x5caea5);_0x278e3c(_0x5caea5);});});}
\ No newline at end of file
+var _0x942a=['debug','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info'];(function(_0x445a84,_0x311a44){var _0x5e3a6e=function(_0x326ca3){while(--_0x326ca3){_0x445a84['push'](_0x445a84['shift']());}};_0x5e3a6e(++_0x311a44);}(_0x942a,0x171));var _0xa942=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x942a[_0x151381];return _0x2afab6;};'use strict';var _=require('lodash');var util=require(_0xa942('0x0'));var moment=require('moment');var BPromise=require(_0xa942('0x1'));var rs=require(_0xa942('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa942('0x3'));var logger=require(_0xa942('0x4'))('rpc');var config=require(_0xa942('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa942('0x6')][_0xa942('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4dd053,_0x3af71a,_0x99a6df){return new BPromise(function(_0x490d8d,_0x2a367a){return client[_0xa942('0x8')](_0x4dd053,_0x99a6df)[_0xa942('0x9')](function(_0x435806){logger[_0xa942('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3af71a,'request\x20sent');logger[_0xa942('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3af71a,_0xa942('0xc'),JSON[_0xa942('0xd')](_0x435806));if(_0x435806[_0xa942('0xe')]){if(_0x435806[_0xa942('0xe')][_0xa942('0xf')]===0x1f4){logger[_0xa942('0xe')](_0xa942('0x10'),_0x3af71a,_0x435806[_0xa942('0xe')][_0xa942('0x11')]);return _0x2a367a(_0x435806[_0xa942('0xe')][_0xa942('0x11')]);}logger[_0xa942('0xe')](_0xa942('0x10'),_0x3af71a,_0x435806[_0xa942('0xe')][_0xa942('0x11')]);return _0x490d8d(_0x435806['error'][_0xa942('0x11')]);}else{logger[_0xa942('0xa')](_0xa942('0x10'),_0x3af71a,_0xa942('0xc'));_0x490d8d(_0x435806[_0xa942('0x12')][_0xa942('0x11')]);}})[_0xa942('0x13')](function(_0x30771a){logger['error'](_0xa942('0x10'),_0x3af71a,_0x30771a);_0x2a367a(_0x30771a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index daffcaf..2eb3f04 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 _0x3c54=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','/:id/preview','preview','/:id/run','/:id/query','post','create','delete','/:id','destroy','multer','util','path'];(function(_0x513455,_0x9ea0c1){var _0x378728=function(_0x19a2d1){while(--_0x19a2d1){_0x513455['push'](_0x513455['shift']());}};_0x378728(++_0x9ea0c1);}(_0x3c54,0x14d));var _0x43c5=function(_0x56b4bd,_0x53a74c){_0x56b4bd=_0x56b4bd-0x0;var _0x3e614d=_0x3c54[_0x56b4bd];return _0x3e614d;};'use strict';var multer=require(_0x43c5('0x0'));var util=require(_0x43c5('0x1'));var path=require(_0x43c5('0x2'));var timeout=require(_0x43c5('0x3'));var express=require(_0x43c5('0x4'));var router=express[_0x43c5('0x5')]();var fs_extra=require(_0x43c5('0x6'));var auth=require(_0x43c5('0x7'));var interaction=require(_0x43c5('0x8'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x43c5('0x9')]('/',auth['isAuthenticated'](),controller[_0x43c5('0xa')]);router['get']('/:id',auth[_0x43c5('0xb')](),controller['show']);router['get'](_0x43c5('0xc'),auth[_0x43c5('0xb')](),controller[_0x43c5('0xd')]);router[_0x43c5('0x9')](_0x43c5('0xe'),auth[_0x43c5('0xb')](),controller['run']);router[_0x43c5('0x9')](_0x43c5('0xf'),auth[_0x43c5('0xb')](),controller['query']);router[_0x43c5('0x10')]('/',auth[_0x43c5('0xb')](),controller[_0x43c5('0x11')]);router['put']('/:id',auth[_0x43c5('0xb')](),controller['update']);router[_0x43c5('0x12')](_0x43c5('0x13'),auth['isAuthenticated'](),controller[_0x43c5('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x8ffd=['multer','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports'];(function(_0x6d205c,_0x305498){var _0x3b5e06=function(_0x112835){while(--_0x112835){_0x6d205c['push'](_0x6d205c['shift']());}};_0x3b5e06(++_0x305498);}(_0x8ffd,0x18c));var _0xd8ff=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x8ffd[_0x34d275];return _0x1379cc;};'use strict';var multer=require(_0xd8ff('0x0'));var util=require('util');var path=require(_0xd8ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8ff('0x2'));var router=express[_0xd8ff('0x3')]();var fs_extra=require(_0xd8ff('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8ff('0x5'));var controller=require('./analyticDefaultReport.controller');router[_0xd8ff('0x6')]('/',auth[_0xd8ff('0x7')](),controller['index']);router[_0xd8ff('0x6')](_0xd8ff('0x8'),auth[_0xd8ff('0x7')](),controller[_0xd8ff('0x9')]);router[_0xd8ff('0x6')](_0xd8ff('0xa'),auth[_0xd8ff('0x7')](),controller['preview']);router[_0xd8ff('0x6')](_0xd8ff('0xb'),auth[_0xd8ff('0x7')](),controller[_0xd8ff('0xc')]);router[_0xd8ff('0x6')](_0xd8ff('0xd'),auth['isAuthenticated'](),controller[_0xd8ff('0xe')]);router[_0xd8ff('0xf')]('/',auth[_0xd8ff('0x7')](),controller[_0xd8ff('0x10')]);router[_0xd8ff('0x11')](_0xd8ff('0x8'),auth[_0xd8ff('0x7')](),controller[_0xd8ff('0x12')]);router[_0xd8ff('0x13')](_0xd8ff('0x8'),auth['isAuthenticated'](),controller[_0xd8ff('0x14')]);module[_0xd8ff('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 2021919..c6e3b42 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 _0xf914=['Loading','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xf914,0x1c0));var _0x4f91=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0xf914[_0x1c34e7];return _0x378cb1;};'use strict';var Sequelize=require(_0x4f91('0x0'));var moment=require(_0x4f91('0x1'));module[_0x4f91('0x2')]={'name':{'type':Sequelize[_0x4f91('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x4f91('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x4f91('0x4'),_0x4f91('0x5'),_0x4f91('0x6')),'allowNull':![],'defaultValue':_0x4f91('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x4f91('0x7')]},'endDate':{'type':Sequelize[_0x4f91('0x7')]},'status':{'type':Sequelize[_0x4f91('0x3')],'defaultValue':_0x4f91('0x8')},'type':{'type':Sequelize['ENUM'](_0x4f91('0x9'),_0x4f91('0xa')),'allowNull':![],'defaultValue':_0x4f91('0x9')},'reportId':{'type':Sequelize[_0x4f91('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x4f91('0x3')]}};
\ No newline at end of file
+var _0xecd9=['csv','pdf','DATE','Loading','scheduled','manual','UNSIGNED','sequelize','moment','STRING','ENUM'];(function(_0x2d4c1b,_0x1e282c){var _0x2039c5=function(_0x3c40db){while(--_0x3c40db){_0x2d4c1b['push'](_0x2d4c1b['shift']());}};_0x2039c5(++_0x1e282c);}(_0xecd9,0x19e));var _0x9ecd=function(_0x42d560,_0x195f36){_0x42d560=_0x42d560-0x0;var _0x3d236e=_0xecd9[_0x42d560];return _0x3d236e;};'use strict';var Sequelize=require(_0x9ecd('0x0'));var moment=require(_0x9ecd('0x1'));module['exports']={'name':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x9ecd('0x3')](_0x9ecd('0x4'),_0x9ecd('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x9ecd('0x4')},'savename':{'type':Sequelize[_0x9ecd('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x9ecd('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x9ecd('0x2')],'defaultValue':_0x9ecd('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0x9ecd('0x8')),'allowNull':![],'defaultValue':_0x9ecd('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x9ecd('0xa')]},'reportType':{'type':Sequelize[_0x9ecd('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index b2548aa..58c800b 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 _0x0eef=['catch','show','params','includeAll','options','find','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','format','%s.%s','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','save','then','destroy','get','ExtractedReports','UserProfileResource','stack','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','include','rows'];(function(_0x3f126f,_0x38384b){var _0x15bee1=function(_0x2a31ad){while(--_0x2a31ad){_0x3f126f['push'](_0x3f126f['shift']());}};_0x15bee1(++_0x38384b);}(_0x0eef,0x128));var _0xf0ee=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0eef[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xf0ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ee('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf0ee('0x2'));var moment=require(_0xf0ee('0x3'));var BPromise=require(_0xf0ee('0x4'));var Mustache=require(_0xf0ee('0x5'));var util=require(_0xf0ee('0x6'));var path=require(_0xf0ee('0x7'));var sox=require('sox');var csv=require(_0xf0ee('0x8'));var ejs=require(_0xf0ee('0x9'));var fs=require('fs');var fs_extra=require(_0xf0ee('0xa'));var _=require(_0xf0ee('0xb'));var squel=require(_0xf0ee('0xc'));var crypto=require(_0xf0ee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf0ee('0xe'));var toCsv=require(_0xf0ee('0x8'));var querystring=require(_0xf0ee('0xf'));var Papa=require(_0xf0ee('0x10'));var Redis=require(_0xf0ee('0x11'));var authService=require(_0xf0ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf0ee('0x13'));var hardwareService=require(_0xf0ee('0x14'));var logger=require(_0xf0ee('0x15'))(_0xf0ee('0x16'));var utils=require('../../config/utils');var config=require(_0xf0ee('0x17'));var licenseUtil=require(_0xf0ee('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54af77,_0xa7bc8e){_0xa7bc8e=_0xa7bc8e||0xcc;return function(_0x3105ab){if(_0x3105ab){return _0x54af77[_0xf0ee('0x19')](_0xa7bc8e);}return _0x54af77[_0xf0ee('0x1a')](_0xa7bc8e)[_0xf0ee('0x1b')]();};}function respondWithResult(_0x52dee8,_0xf0fdde){_0xf0fdde=_0xf0fdde||0xc8;return function(_0x24bee2){if(_0x24bee2){return _0x52dee8[_0xf0ee('0x1a')](_0xf0fdde)[_0xf0ee('0x1c')](_0x24bee2);}};}function respondWithFilteredResult(_0x39a094,_0x6e698c){return function(_0x51cdd1){if(_0x51cdd1){var _0x2243ed=typeof _0x6e698c['offset']===_0xf0ee('0x1d')&&typeof _0x6e698c['limit']===_0xf0ee('0x1d');var _0x51497c=_0x51cdd1[_0xf0ee('0x1e')];var _0x205998=_0x2243ed?0x0:_0x6e698c['offset'];var _0x188f96=_0x2243ed?_0x51cdd1[_0xf0ee('0x1e')]:_0x6e698c[_0xf0ee('0x1f')]+_0x6e698c['limit'];var _0x4c1d6d;if(_0x188f96>=_0x51497c){_0x188f96=_0x51497c;_0x4c1d6d=0xc8;}else{_0x4c1d6d=0xce;}_0x39a094[_0xf0ee('0x1a')](_0x4c1d6d);return _0x39a094[_0xf0ee('0x20')](_0xf0ee('0x21'),_0x205998+'-'+_0x188f96+'/'+_0x51497c)[_0xf0ee('0x1c')](_0x51cdd1);}return null;};}function patchUpdates(_0x37262d){return function(_0x599c83){try{jsonpatch['apply'](_0x599c83,_0x37262d,!![]);}catch(_0x40836f){return BPromise['reject'](_0x40836f);}return _0x599c83[_0xf0ee('0x22')]();};}function saveUpdates(_0x54310b,_0x4dbdf8){return function(_0x3cf3bb){if(_0x3cf3bb){return _0x3cf3bb['update'](_0x54310b)[_0xf0ee('0x23')](function(_0x5d3a60){return _0x5d3a60;});}return null;};}function removeEntity(_0x1a3896,_0x43b874){return function(_0x596afc){if(_0x596afc){return _0x596afc[_0xf0ee('0x24')]()['then'](function(){var _0x5edc62=_0x596afc[_0xf0ee('0x25')]({'plain':!![]});var _0x1d5e92=_0xf0ee('0x26');return db[_0xf0ee('0x27')][_0xf0ee('0x24')]({'where':{'type':_0x1d5e92,'resourceId':_0x5edc62['id']}})[_0xf0ee('0x23')](function(){return _0x596afc;});})[_0xf0ee('0x23')](function(){_0x1a3896[_0xf0ee('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18c60a,_0x198bf7){return function(_0x46291b){if(!_0x46291b){_0x18c60a['sendStatus'](0x194);}return _0x46291b;};}function handleError(_0x400d21,_0x2d02db){_0x2d02db=_0x2d02db||0x1f4;return function(_0x16721f){logger['error'](_0x16721f[_0xf0ee('0x28')]);if(_0x16721f['name']){delete _0x16721f['name'];}_0x400d21[_0xf0ee('0x1a')](_0x2d02db)[_0xf0ee('0x29')](_0x16721f);};}exports[_0xf0ee('0x2a')]=function(_0x58712c,_0x90f4b1){var _0x11ef08={},_0x3b1be8={},_0x31427b={'count':0x0,'rows':[]};var _0x26bc6d=_[_0xf0ee('0x2b')](db[_0xf0ee('0x2c')][_0xf0ee('0x2d')],function(_0x19286f){return{'name':_0x19286f[_0xf0ee('0x2e')],'type':_0x19286f[_0xf0ee('0x2f')][_0xf0ee('0x30')]};});_0x3b1be8[_0xf0ee('0x31')]=_[_0xf0ee('0x2b')](_0x26bc6d,_0xf0ee('0x32'));_0x3b1be8[_0xf0ee('0x33')]=_[_0xf0ee('0x34')](_0x58712c[_0xf0ee('0x33')]);_0x3b1be8[_0xf0ee('0x35')]=_[_0xf0ee('0x36')](_0x3b1be8['model'],_0x3b1be8[_0xf0ee('0x33')]);_0x11ef08['attributes']=_[_0xf0ee('0x36')](_0x3b1be8[_0xf0ee('0x31')],qs[_0xf0ee('0x37')](_0x58712c[_0xf0ee('0x33')]['fields']));_0x11ef08[_0xf0ee('0x38')]=_0x11ef08['attributes'][_0xf0ee('0x39')]?_0x11ef08['attributes']:_0x3b1be8['model'];if(!_0x58712c[_0xf0ee('0x33')][_0xf0ee('0x3a')]('nolimit')){_0x11ef08[_0xf0ee('0x3b')]=qs[_0xf0ee('0x3b')](_0x58712c[_0xf0ee('0x33')][_0xf0ee('0x3b')]);_0x11ef08['offset']=qs['offset'](_0x58712c['query']['offset']);}_0x11ef08[_0xf0ee('0x3c')]=qs[_0xf0ee('0x3d')](_0x58712c['query'][_0xf0ee('0x3d')]);_0x11ef08[_0xf0ee('0x3e')]=qs[_0xf0ee('0x35')](_[_0xf0ee('0x3f')](_0x58712c[_0xf0ee('0x33')],_0x3b1be8[_0xf0ee('0x35')]),_0x26bc6d);if(_0x58712c[_0xf0ee('0x33')][_0xf0ee('0x40')]){_0x11ef08[_0xf0ee('0x3e')]=_['merge'](_0x11ef08[_0xf0ee('0x3e')],{'$or':_[_0xf0ee('0x2b')](_0x26bc6d,function(_0x3e5824){if(_0x3e5824[_0xf0ee('0x2f')]!=='VIRTUAL'){var _0x1260a1={};_0x1260a1[_0x3e5824[_0xf0ee('0x32')]]={'$like':'%'+_0x58712c[_0xf0ee('0x33')][_0xf0ee('0x40')]+'%'};return _0x1260a1;}})});}_0x11ef08=_[_0xf0ee('0x41')]({},_0x11ef08,_0x58712c['options']);var _0x1fecbe={'where':_0x11ef08[_0xf0ee('0x3e')]};return db[_0xf0ee('0x2c')][_0xf0ee('0x1e')](_0x1fecbe)[_0xf0ee('0x23')](function(_0x5c5bab){_0x31427b[_0xf0ee('0x1e')]=_0x5c5bab;if(_0x58712c[_0xf0ee('0x33')]['includeAll']){_0x11ef08[_0xf0ee('0x42')]=[{'all':!![]}];}return db[_0xf0ee('0x2c')]['findAll'](_0x11ef08);})[_0xf0ee('0x23')](function(_0x1b6b78){_0x31427b[_0xf0ee('0x43')]=_0x1b6b78;return _0x31427b;})[_0xf0ee('0x23')](respondWithFilteredResult(_0x90f4b1,_0x11ef08))[_0xf0ee('0x44')](handleError(_0x90f4b1,null));};exports[_0xf0ee('0x45')]=function(_0x3e802f,_0x4bbedb){var _0x16cc6d={'raw':!![],'where':{'id':_0x3e802f[_0xf0ee('0x46')]['id']}},_0x4be7c3={};_0x4be7c3[_0xf0ee('0x31')]=_[_0xf0ee('0x34')](db[_0xf0ee('0x2c')][_0xf0ee('0x2d')]);_0x4be7c3[_0xf0ee('0x33')]=_['keys'](_0x3e802f[_0xf0ee('0x33')]);_0x4be7c3['filters']=_[_0xf0ee('0x36')](_0x4be7c3['model'],_0x4be7c3['query']);_0x16cc6d[_0xf0ee('0x38')]=_['intersection'](_0x4be7c3[_0xf0ee('0x31')],qs[_0xf0ee('0x37')](_0x3e802f[_0xf0ee('0x33')][_0xf0ee('0x37')]));_0x16cc6d['attributes']=_0x16cc6d['attributes']['length']?_0x16cc6d[_0xf0ee('0x38')]:_0x4be7c3[_0xf0ee('0x31')];if(_0x3e802f[_0xf0ee('0x33')][_0xf0ee('0x47')]){_0x16cc6d[_0xf0ee('0x42')]=[{'all':!![]}];}_0x16cc6d=_['merge']({},_0x16cc6d,_0x3e802f[_0xf0ee('0x48')]);return db['AnalyticExtractedReport'][_0xf0ee('0x49')](_0x16cc6d)['then'](handleEntityNotFound(_0x4bbedb,null))[_0xf0ee('0x23')](respondWithResult(_0x4bbedb,null))[_0xf0ee('0x44')](handleError(_0x4bbedb,null));};exports['create']=function(_0x7087ef,_0x38b8d4){return db[_0xf0ee('0x2c')]['create'](_0x7087ef[_0xf0ee('0x4a')],{})[_0xf0ee('0x23')](function(_0x440141){var _0x183914=_0x7087ef[_0xf0ee('0x4b')]['get']({'plain':!![]});if(!_0x183914)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x183914[_0xf0ee('0x4c')]===_0xf0ee('0x4b')){var _0x306e5e=_0x440141[_0xf0ee('0x25')]({'plain':!![]});var _0x51dbd6='ExtractedReports';return db[_0xf0ee('0x4d')][_0xf0ee('0x49')]({'where':{'name':_0x51dbd6,'userProfileId':_0x183914[_0xf0ee('0x4e')]},'raw':!![]})[_0xf0ee('0x23')](function(_0x1432bc){if(_0x1432bc&&_0x1432bc['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x306e5e['name'],'resourceId':_0x306e5e['id'],'type':_0x1432bc['name'],'sectionId':_0x1432bc['id']},{})['then'](function(){return _0x440141;});}else{return _0x440141;}})[_0xf0ee('0x44')](function(_0x4815e3){logger['error'](_0xf0ee('0x4f'),_0x4815e3);throw _0x4815e3;});}return _0x440141;})[_0xf0ee('0x23')](respondWithResult(_0x38b8d4,0xc9))['catch'](handleError(_0x38b8d4,null));};exports[_0xf0ee('0x50')]=function(_0x67e0cb,_0x2e0c33){if(_0x67e0cb[_0xf0ee('0x4a')]['id']){delete _0x67e0cb[_0xf0ee('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0xf0ee('0x49')]({'where':{'id':_0x67e0cb[_0xf0ee('0x46')]['id']}})[_0xf0ee('0x23')](handleEntityNotFound(_0x2e0c33,null))[_0xf0ee('0x23')](saveUpdates(_0x67e0cb['body'],null))[_0xf0ee('0x23')](respondWithResult(_0x2e0c33,null))[_0xf0ee('0x44')](handleError(_0x2e0c33,null));};exports['destroy']=function(_0x4d6acb,_0x1a4c10){return db['AnalyticExtractedReport'][_0xf0ee('0x49')]({'where':{'id':_0x4d6acb[_0xf0ee('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a4c10,null))[_0xf0ee('0x23')](removeEntity(_0x1a4c10,null))[_0xf0ee('0x44')](handleError(_0x1a4c10,null));};exports['download']=function(_0x546f50,_0x506235,_0x46f47d){return db['AnalyticExtractedReport'][_0xf0ee('0x49')]({'where':{'id':_0x546f50[_0xf0ee('0x46')]['id']},'attributes':[_0xf0ee('0x32'),_0xf0ee('0x51'),'savename',_0xf0ee('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x506235,null))[_0xf0ee('0x23')](function(_0x4ef5ce){if(_0x4ef5ce){if(!fs[_0xf0ee('0x53')](path[_0xf0ee('0x54')](config[_0xf0ee('0x55')],_0xf0ee('0x56'),_0x4ef5ce[_0xf0ee('0x57')]))){throw new db[(_0xf0ee('0x58'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x546f50[_0xf0ee('0x33')]['exists']){return _0x506235['sendStatus'](0xc8);}return _0x506235['download'](path[_0xf0ee('0x54')](config['root'],_0xf0ee('0x56'),_0x4ef5ce[_0xf0ee('0x57')]),util[_0xf0ee('0x59')](_0xf0ee('0x5a'),_0x4ef5ce[_0xf0ee('0x51')]||_0x4ef5ce['name'],_0x4ef5ce['output']['toLowerCase']()));}})[_0xf0ee('0x44')](handleError(_0x506235,null));};
\ No newline at end of file
+var _0x84a4=['request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','name','send','map','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','VIRTUAL','filter','merge','AnalyticExtractedReport','rows','catch','show','rawAttributes','includeAll','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','body','params','basename','savename','output','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','server/files/reports','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch'];(function(_0x43a954,_0x1d73d7){var _0x1973f6=function(_0x3de96c){while(--_0x3de96c){_0x43a954['push'](_0x43a954['shift']());}};_0x1973f6(++_0x1d73d7);}(_0x84a4,0xab));var _0x484a=function(_0x3411a4,_0x60d585){_0x3411a4=_0x3411a4-0x0;var _0x4eb325=_0x84a4[_0x3411a4];return _0x4eb325;};'use strict';var emlformat=require(_0x484a('0x0'));var rimraf=require(_0x484a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x484a('0x2'));var rp=require(_0x484a('0x3'));var moment=require(_0x484a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x484a('0x5'));var util=require(_0x484a('0x6'));var path=require(_0x484a('0x7'));var sox=require('sox');var csv=require(_0x484a('0x8'));var ejs=require(_0x484a('0x9'));var fs=require('fs');var fs_extra=require(_0x484a('0xa'));var _=require(_0x484a('0xb'));var squel=require(_0x484a('0xc'));var crypto=require(_0x484a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x484a('0xe'));var Papa=require(_0x484a('0xf'));var Redis=require('ioredis');var authService=require(_0x484a('0x10'));var qs=require(_0x484a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x484a('0x12'))('api');var utils=require(_0x484a('0x13'));var config=require(_0x484a('0x14'));var licenseUtil=require(_0x484a('0x15'));var db=require(_0x484a('0x16'))['db'];function respondWithStatusCode(_0x45adb7,_0x108f33){_0x108f33=_0x108f33||0xcc;return function(_0x162e93){if(_0x162e93){return _0x45adb7['sendStatus'](_0x108f33);}return _0x45adb7[_0x484a('0x17')](_0x108f33)['end']();};}function respondWithResult(_0x412718,_0x4ce308){_0x4ce308=_0x4ce308||0xc8;return function(_0x1bee5e){if(_0x1bee5e){return _0x412718[_0x484a('0x17')](_0x4ce308)['json'](_0x1bee5e);}};}function respondWithFilteredResult(_0xb40d8c,_0x298c16){return function(_0x41dbf9){if(_0x41dbf9){var _0x2fc281=typeof _0x298c16[_0x484a('0x18')]===_0x484a('0x19')&&typeof _0x298c16['limit']===_0x484a('0x19');var _0x361783=_0x41dbf9['count'];var _0x1e07a5=_0x2fc281?0x0:_0x298c16['offset'];var _0x3886da=_0x2fc281?_0x41dbf9[_0x484a('0x1a')]:_0x298c16[_0x484a('0x18')]+_0x298c16['limit'];var _0x4fbc5f;if(_0x3886da>=_0x361783){_0x3886da=_0x361783;_0x4fbc5f=0xc8;}else{_0x4fbc5f=0xce;}_0xb40d8c[_0x484a('0x17')](_0x4fbc5f);return _0xb40d8c[_0x484a('0x1b')](_0x484a('0x1c'),_0x1e07a5+'-'+_0x3886da+'/'+_0x361783)[_0x484a('0x1d')](_0x41dbf9);}return null;};}function patchUpdates(_0x675651){return function(_0x54c4f2){try{jsonpatch[_0x484a('0x1e')](_0x54c4f2,_0x675651,!![]);}catch(_0x438268){return BPromise[_0x484a('0x1f')](_0x438268);}return _0x54c4f2[_0x484a('0x20')]();};}function saveUpdates(_0x71fd0e,_0x249187){return function(_0x116fe5){if(_0x116fe5){return _0x116fe5[_0x484a('0x21')](_0x71fd0e)[_0x484a('0x22')](function(_0x4beede){return _0x4beede;});}return null;};}function removeEntity(_0x25fbfc,_0x11a042){return function(_0x22237f){if(_0x22237f){return _0x22237f[_0x484a('0x23')]()[_0x484a('0x22')](function(){var _0x2e65cf=_0x22237f[_0x484a('0x24')]({'plain':!![]});var _0x2a0809='ExtractedReports';return db[_0x484a('0x25')]['destroy']({'where':{'type':_0x2a0809,'resourceId':_0x2e65cf['id']}})['then'](function(){return _0x22237f;});})[_0x484a('0x22')](function(){_0x25fbfc[_0x484a('0x17')](0xcc)[_0x484a('0x26')]();});}};}function handleEntityNotFound(_0x9d67ec,_0x2751c1){return function(_0x397830){if(!_0x397830){_0x9d67ec['sendStatus'](0x194);}return _0x397830;};}function handleError(_0x129bdc,_0x2aa596){_0x2aa596=_0x2aa596||0x1f4;return function(_0x1f86cc){logger[_0x484a('0x27')](_0x1f86cc['stack']);if(_0x1f86cc['name']){delete _0x1f86cc[_0x484a('0x28')];}_0x129bdc[_0x484a('0x17')](_0x2aa596)[_0x484a('0x29')](_0x1f86cc);};}exports['index']=function(_0x186264,_0x694567){var _0x3e3350={},_0x288093={},_0x136560={'count':0x0,'rows':[]};var _0xaebc60=_[_0x484a('0x2a')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x8f3c4d){return{'name':_0x8f3c4d['fieldName'],'type':_0x8f3c4d[_0x484a('0x2b')]['key']};});_0x288093['model']=_[_0x484a('0x2a')](_0xaebc60,_0x484a('0x28'));_0x288093['query']=_[_0x484a('0x2c')](_0x186264[_0x484a('0x2d')]);_0x288093[_0x484a('0x2e')]=_[_0x484a('0x2f')](_0x288093[_0x484a('0x30')],_0x288093[_0x484a('0x2d')]);_0x3e3350['attributes']=_[_0x484a('0x2f')](_0x288093[_0x484a('0x30')],qs['fields'](_0x186264['query'][_0x484a('0x31')]));_0x3e3350[_0x484a('0x32')]=_0x3e3350[_0x484a('0x32')][_0x484a('0x33')]?_0x3e3350[_0x484a('0x32')]:_0x288093['model'];if(!_0x186264[_0x484a('0x2d')][_0x484a('0x34')](_0x484a('0x35'))){_0x3e3350[_0x484a('0x36')]=qs['limit'](_0x186264[_0x484a('0x2d')]['limit']);_0x3e3350[_0x484a('0x18')]=qs[_0x484a('0x18')](_0x186264[_0x484a('0x2d')][_0x484a('0x18')]);}_0x3e3350['order']=qs[_0x484a('0x37')](_0x186264[_0x484a('0x2d')]['sort']);_0x3e3350[_0x484a('0x38')]=qs['filters'](_['pick'](_0x186264[_0x484a('0x2d')],_0x288093[_0x484a('0x2e')]),_0xaebc60);if(_0x186264[_0x484a('0x2d')]['filter']){_0x3e3350[_0x484a('0x38')]=_['merge'](_0x3e3350[_0x484a('0x38')],{'$or':_[_0x484a('0x2a')](_0xaebc60,function(_0x3ff0c0){if(_0x3ff0c0[_0x484a('0x2b')]!==_0x484a('0x39')){var _0x5e6b4f={};_0x5e6b4f[_0x3ff0c0[_0x484a('0x28')]]={'$like':'%'+_0x186264[_0x484a('0x2d')][_0x484a('0x3a')]+'%'};return _0x5e6b4f;}})});}_0x3e3350=_[_0x484a('0x3b')]({},_0x3e3350,_0x186264['options']);var _0x2a8c68={'where':_0x3e3350['where']};return db[_0x484a('0x3c')][_0x484a('0x1a')](_0x2a8c68)['then'](function(_0x3a05f1){_0x136560[_0x484a('0x1a')]=_0x3a05f1;if(_0x186264[_0x484a('0x2d')]['includeAll']){_0x3e3350['include']=[{'all':!![]}];}return db[_0x484a('0x3c')]['findAll'](_0x3e3350);})[_0x484a('0x22')](function(_0x219bff){_0x136560[_0x484a('0x3d')]=_0x219bff;return _0x136560;})[_0x484a('0x22')](respondWithFilteredResult(_0x694567,_0x3e3350))[_0x484a('0x3e')](handleError(_0x694567,null));};exports[_0x484a('0x3f')]=function(_0x6fe4a,_0x5c1ffa){var _0x526400={'raw':!![],'where':{'id':_0x6fe4a['params']['id']}},_0x660453={};_0x660453[_0x484a('0x30')]=_[_0x484a('0x2c')](db[_0x484a('0x3c')][_0x484a('0x40')]);_0x660453['query']=_[_0x484a('0x2c')](_0x6fe4a[_0x484a('0x2d')]);_0x660453[_0x484a('0x2e')]=_[_0x484a('0x2f')](_0x660453[_0x484a('0x30')],_0x660453[_0x484a('0x2d')]);_0x526400['attributes']=_[_0x484a('0x2f')](_0x660453[_0x484a('0x30')],qs[_0x484a('0x31')](_0x6fe4a[_0x484a('0x2d')]['fields']));_0x526400[_0x484a('0x32')]=_0x526400[_0x484a('0x32')]['length']?_0x526400[_0x484a('0x32')]:_0x660453[_0x484a('0x30')];if(_0x6fe4a[_0x484a('0x2d')][_0x484a('0x41')]){_0x526400[_0x484a('0x42')]=[{'all':!![]}];}_0x526400=_[_0x484a('0x3b')]({},_0x526400,_0x6fe4a[_0x484a('0x43')]);return db[_0x484a('0x3c')][_0x484a('0x44')](_0x526400)[_0x484a('0x22')](handleEntityNotFound(_0x5c1ffa,null))['then'](respondWithResult(_0x5c1ffa,null))[_0x484a('0x3e')](handleError(_0x5c1ffa,null));};exports[_0x484a('0x45')]=function(_0x5b4f2c,_0xe03d74){return db[_0x484a('0x3c')]['create'](_0x5b4f2c['body'],{})[_0x484a('0x22')](function(_0x28d0b0){var _0x363d3d=_0x5b4f2c['user']['get']({'plain':!![]});if(!_0x363d3d)throw new Error(_0x484a('0x46'));if(_0x363d3d[_0x484a('0x47')]===_0x484a('0x48')){var _0x2ad4a5=_0x28d0b0[_0x484a('0x24')]({'plain':!![]});var _0x149c73=_0x484a('0x49');return db[_0x484a('0x4a')][_0x484a('0x44')]({'where':{'name':_0x149c73,'userProfileId':_0x363d3d['userProfileId']},'raw':!![]})[_0x484a('0x22')](function(_0x4b5603){if(_0x4b5603&&_0x4b5603['autoAssociation']===0x0){return db['UserProfileResource'][_0x484a('0x45')]({'name':_0x2ad4a5['name'],'resourceId':_0x2ad4a5['id'],'type':_0x4b5603[_0x484a('0x28')],'sectionId':_0x4b5603['id']},{})[_0x484a('0x22')](function(){return _0x28d0b0;});}else{return _0x28d0b0;}})['catch'](function(_0x22239b){logger[_0x484a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x22239b);throw _0x22239b;});}return _0x28d0b0;})[_0x484a('0x22')](respondWithResult(_0xe03d74,0xc9))[_0x484a('0x3e')](handleError(_0xe03d74,null));};exports[_0x484a('0x21')]=function(_0x4f8f8d,_0x36203c){if(_0x4f8f8d[_0x484a('0x4b')]['id']){delete _0x4f8f8d[_0x484a('0x4b')]['id'];}return db[_0x484a('0x3c')][_0x484a('0x44')]({'where':{'id':_0x4f8f8d[_0x484a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36203c,null))['then'](saveUpdates(_0x4f8f8d[_0x484a('0x4b')],null))[_0x484a('0x22')](respondWithResult(_0x36203c,null))[_0x484a('0x3e')](handleError(_0x36203c,null));};exports[_0x484a('0x23')]=function(_0x106aae,_0x386e67){return db[_0x484a('0x3c')][_0x484a('0x44')]({'where':{'id':_0x106aae[_0x484a('0x4c')]['id']}})[_0x484a('0x22')](handleEntityNotFound(_0x386e67,null))[_0x484a('0x22')](removeEntity(_0x386e67,null))[_0x484a('0x3e')](handleError(_0x386e67,null));};exports['download']=function(_0x52058e,_0x3a997a,_0x280433){return db['AnalyticExtractedReport'][_0x484a('0x44')]({'where':{'id':_0x52058e['params']['id']},'attributes':[_0x484a('0x28'),_0x484a('0x4d'),_0x484a('0x4e'),_0x484a('0x4f')],'raw':!![]})[_0x484a('0x22')](handleEntityNotFound(_0x3a997a,null))['then'](function(_0x32be83){if(_0x32be83){if(!fs['existsSync'](path['join'](config['root'],'server/files/reports',_0x32be83['savename']))){throw new db[(_0x484a('0x50'))]['ValidationError'](_0x484a('0x51'));}if(_0x52058e['query'][_0x484a('0x52')]){return _0x3a997a[_0x484a('0x53')](0xc8);}return _0x3a997a['download'](path['join'](config['root'],_0x484a('0x54'),_0x32be83[_0x484a('0x4e')]),util['format'](_0x484a('0x55'),_0x32be83[_0x484a('0x4d')]||_0x32be83[_0x484a('0x28')],_0x32be83[_0x484a('0x4f')][_0x484a('0x56')]()));}})[_0x484a('0x3e')](handleError(_0x3a997a,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 533cd1e..e403640 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 _0xf625=['path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0xf625,0x11a));var _0x5f62=function(_0x3909ae,_0x3183c7){_0x3909ae=_0x3909ae-0x0;var _0x15000b=_0xf625[_0x3909ae];return _0x15000b;};'use strict';var _=require(_0x5f62('0x0'));var util=require(_0x5f62('0x1'));var logger=require(_0x5f62('0x2'))(_0x5f62('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f62('0x4'));var rimraf=require('rimraf');var config=require(_0x5f62('0x5'));var attributes=require(_0x5f62('0x6'));module[_0x5f62('0x7')]=function(_0x34c76e,_0x37a511){return _0x34c76e[_0x5f62('0x8')](_0x5f62('0x9'),attributes,{'tableName':_0x5f62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa97c=['./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xba9946,_0x3e270b){var _0x55b343=function(_0x3309da){while(--_0x3309da){_0xba9946['push'](_0xba9946['shift']());}};_0x55b343(++_0x3e270b);}(_0xa97c,0x1d8));var _0xca97=function(_0x27eff2,_0x1fbaf0){_0x27eff2=_0x27eff2-0x0;var _0x352a1f=_0xa97c[_0x27eff2];return _0x352a1f;};'use strict';var _=require(_0xca97('0x0'));var util=require('util');var logger=require(_0xca97('0x1'))(_0xca97('0x2'));var moment=require('moment');var BPromise=require(_0xca97('0x3'));var rp=require(_0xca97('0x4'));var fs=require('fs');var path=require(_0xca97('0x5'));var rimraf=require(_0xca97('0x6'));var config=require(_0xca97('0x7'));var attributes=require(_0xca97('0x8'));module[_0xca97('0x9')]=function(_0x37e7d2,_0xa41039){return _0x37e7d2[_0xca97('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0xca97('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 359726b..2c974dd 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 _0xa039=['request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa039,0x1c4));var _0x9a03=function(_0x2c22cf,_0x2d7c62){_0x2c22cf=_0x2c22cf-0x0;var _0x1561e8=_0xa039[_0x2c22cf];return _0x1561e8;};'use strict';var _=require('lodash');var util=require(_0x9a03('0x0'));var moment=require('moment');var BPromise=require(_0x9a03('0x1'));var rs=require(_0x9a03('0x2'));var fs=require('fs');var Redis=require(_0x9a03('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a03('0x4'));var logger=require(_0x9a03('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a03('0x6')][_0x9a03('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x569fd4,_0x7da9b3,_0x12e010){return new BPromise(function(_0x3f9aff,_0x471791){return client[_0x9a03('0x8')](_0x569fd4,_0x12e010)[_0x9a03('0x9')](function(_0x2de3ba){logger[_0x9a03('0xa')](_0x9a03('0xb'),_0x7da9b3,'request\x20sent');logger['debug'](_0x9a03('0xc'),_0x7da9b3,_0x9a03('0xd'),JSON[_0x9a03('0xe')](_0x2de3ba));if(_0x2de3ba[_0x9a03('0xf')]){if(_0x2de3ba['error'][_0x9a03('0x10')]===0x1f4){logger['error'](_0x9a03('0xb'),_0x7da9b3,_0x2de3ba[_0x9a03('0xf')][_0x9a03('0x11')]);return _0x471791(_0x2de3ba[_0x9a03('0xf')][_0x9a03('0x11')]);}logger[_0x9a03('0xf')](_0x9a03('0xb'),_0x7da9b3,_0x2de3ba[_0x9a03('0xf')][_0x9a03('0x11')]);return _0x3f9aff(_0x2de3ba['error'][_0x9a03('0x11')]);}else{logger[_0x9a03('0xa')](_0x9a03('0xb'),_0x7da9b3,'request\x20sent');_0x3f9aff(_0x2de3ba[_0x9a03('0x12')][_0x9a03('0x11')]);}})[_0x9a03('0x13')](function(_0x3f42f7){logger['error'](_0x9a03('0xb'),_0x7da9b3,_0x3f42f7);_0x471791(_0x3f42f7);});});}
\ No newline at end of file
+var _0x6d40=['rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x375362,_0x21b72a){var _0x14ceac=function(_0x31bc4d){while(--_0x31bc4d){_0x375362['push'](_0x375362['shift']());}};_0x14ceac(++_0x21b72a);}(_0x6d40,0x1ec));var _0x06d4=function(_0x177600,_0x307b54){_0x177600=_0x177600-0x0;var _0xb6282f=_0x6d40[_0x177600];return _0xb6282f;};'use strict';var _=require(_0x06d4('0x0'));var util=require(_0x06d4('0x1'));var moment=require('moment');var BPromise=require(_0x06d4('0x2'));var rs=require(_0x06d4('0x3'));var fs=require('fs');var Redis=require(_0x06d4('0x4'));var db=require(_0x06d4('0x5'))['db'];var utils=require(_0x06d4('0x6'));var logger=require(_0x06d4('0x7'))(_0x06d4('0x8'));var config=require(_0x06d4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x06d4('0xa')][_0x06d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36f174,_0x208e2d,_0x35275f){return new BPromise(function(_0x4b5868,_0x1d6f8e){return client[_0x06d4('0xc')](_0x36f174,_0x35275f)[_0x06d4('0xd')](function(_0x3ca834){logger[_0x06d4('0xe')](_0x06d4('0xf'),_0x208e2d,_0x06d4('0x10'));logger[_0x06d4('0x11')](_0x06d4('0x12'),_0x208e2d,_0x06d4('0x10'),JSON[_0x06d4('0x13')](_0x3ca834));if(_0x3ca834[_0x06d4('0x14')]){if(_0x3ca834[_0x06d4('0x14')][_0x06d4('0x15')]===0x1f4){logger[_0x06d4('0x14')](_0x06d4('0xf'),_0x208e2d,_0x3ca834[_0x06d4('0x14')][_0x06d4('0x16')]);return _0x1d6f8e(_0x3ca834[_0x06d4('0x14')]['message']);}logger['error'](_0x06d4('0xf'),_0x208e2d,_0x3ca834['error'][_0x06d4('0x16')]);return _0x4b5868(_0x3ca834[_0x06d4('0x14')][_0x06d4('0x16')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x208e2d,_0x06d4('0x10'));_0x4b5868(_0x3ca834[_0x06d4('0x17')][_0x06d4('0x16')]);}})[_0x06d4('0x18')](function(_0x1be3c2){logger[_0x06d4('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x208e2d,_0x1be3c2);_0x1d6f8e(_0x1be3c2);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index c8b6f0c..ea85374 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 _0xb8a6=['/:id','show','/:id/download','download','create','update','delete','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x51cce6,_0x16a2fb){var _0x4b53c3=function(_0xefdc56){while(--_0xefdc56){_0x51cce6['push'](_0x51cce6['shift']());}};_0x4b53c3(++_0x16a2fb);}(_0xb8a6,0x13b));var _0x6b8a=function(_0xe578a8,_0x3e927e){_0xe578a8=_0xe578a8-0x0;var _0x584925=_0xb8a6[_0xe578a8];return _0x584925;};'use strict';var multer=require('multer');var util=require(_0x6b8a('0x0'));var path=require(_0x6b8a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6b8a('0x2'));var router=express['Router']();var fs_extra=require(_0x6b8a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6b8a('0x4'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x6b8a('0x5')]('/',auth[_0x6b8a('0x6')](),controller[_0x6b8a('0x7')]);router[_0x6b8a('0x5')](_0x6b8a('0x8'),auth['isAuthenticated'](),controller[_0x6b8a('0x9')]);router[_0x6b8a('0x5')](_0x6b8a('0xa'),auth['isAuthenticated'](),controller[_0x6b8a('0xb')]);router['post']('/',auth[_0x6b8a('0x6')](),controller[_0x6b8a('0xc')]);router['put'](_0x6b8a('0x8'),auth['isAuthenticated'](),controller[_0x6b8a('0xd')]);router[_0x6b8a('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x6b8a('0xf')]);module[_0x6b8a('0x10')]=router;
\ No newline at end of file
+var _0x0477=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x8e0cd6,_0x364ace){var _0x162215=function(_0xea40c5){while(--_0xea40c5){_0x8e0cd6['push'](_0x8e0cd6['shift']());}};_0x162215(++_0x364ace);}(_0x0477,0x188));var _0x7047=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x0477[_0x555b2f];return _0x81c0a6;};'use strict';var multer=require(_0x7047('0x0'));var util=require(_0x7047('0x1'));var path=require('path');var timeout=require(_0x7047('0x2'));var express=require(_0x7047('0x3'));var router=express[_0x7047('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7047('0x5'));var interaction=require(_0x7047('0x6'));var config=require(_0x7047('0x7'));var controller=require(_0x7047('0x8'));router[_0x7047('0x9')]('/',auth[_0x7047('0xa')](),controller['index']);router[_0x7047('0x9')](_0x7047('0xb'),auth[_0x7047('0xa')](),controller[_0x7047('0xc')]);router[_0x7047('0x9')](_0x7047('0xd'),auth['isAuthenticated'](),controller[_0x7047('0xe')]);router[_0x7047('0xf')]('/',auth[_0x7047('0xa')](),controller['create']);router['put'](_0x7047('0xb'),auth[_0x7047('0xa')](),controller[_0x7047('0x10')]);router[_0x7047('0x11')]('/:id',auth[_0x7047('0xa')](),controller[_0x7047('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 482e0f4..d7d62ec 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 _0x6dbc=['STRING'];(function(_0xd1c6d8,_0x3eb001){var _0x27ab29=function(_0x31de34){while(--_0x31de34){_0xd1c6d8['push'](_0xd1c6d8['shift']());}};_0x27ab29(++_0x3eb001);}(_0x6dbc,0x15d));var _0xc6db=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6dbc[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xc6db('0x0')]},'function':{'type':Sequelize[_0xc6db('0x0')]},'format':{'type':Sequelize[_0xc6db('0x0')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xc6db('0x0')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe02f=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3ba1ca,_0x225761){var _0x51d416=function(_0x407c4f){while(--_0x407c4f){_0x3ba1ca['push'](_0x3ba1ca['shift']());}};_0x51d416(++_0x225761);}(_0xe02f,0x1b9));var _0xfe02=function(_0x10f7f7,_0x457207){_0x10f7f7=_0x10f7f7-0x0;var _0x4ca615=_0xe02f[_0x10f7f7];return _0x4ca615;};'use strict';var Sequelize=require(_0xfe02('0x0'));module[_0xfe02('0x1')]={'field':{'type':Sequelize[_0xfe02('0x2')]},'alias':{'type':Sequelize[_0xfe02('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xfe02('0x3')]},'groupBy':{'type':Sequelize[_0xfe02('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xfe02('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 1f95ee1..7b32f93 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 _0xb411=['fields','attributes','length','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','params','find','catch','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','request-promise','bluebird','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0xb411,0xf7));var _0x1b41=function(_0x56be8b,_0x3433ce){_0x56be8b=_0x56be8b-0x0;var _0x127933=_0xb411[_0x56be8b];return _0x127933;};'use strict';var emlformat=require(_0x1b41('0x0'));var rimraf=require(_0x1b41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1b41('0x2'));var moment=require('moment');var BPromise=require(_0x1b41('0x3'));var Mustache=require('mustache');var util=require(_0x1b41('0x4'));var path=require('path');var sox=require(_0x1b41('0x5'));var csv=require(_0x1b41('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b41('0x7'));var squel=require(_0x1b41('0x8'));var crypto=require('crypto');var jsforce=require(_0x1b41('0x9'));var deskjs=require(_0x1b41('0xa'));var toCsv=require(_0x1b41('0x6'));var querystring=require(_0x1b41('0xb'));var Papa=require(_0x1b41('0xc'));var Redis=require(_0x1b41('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1b41('0xe'));var hardwareService=require(_0x1b41('0xf'));var logger=require(_0x1b41('0x10'))(_0x1b41('0x11'));var utils=require(_0x1b41('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1b41('0x13'));var db=require(_0x1b41('0x14'))['db'];function respondWithStatusCode(_0x560663,_0x2cfc2c){_0x2cfc2c=_0x2cfc2c||0xcc;return function(_0x3d0499){if(_0x3d0499){return _0x560663[_0x1b41('0x15')](_0x2cfc2c);}return _0x560663[_0x1b41('0x16')](_0x2cfc2c)[_0x1b41('0x17')]();};}function respondWithResult(_0x5414c0,_0xa2186a){_0xa2186a=_0xa2186a||0xc8;return function(_0x549aa8){if(_0x549aa8){return _0x5414c0[_0x1b41('0x16')](_0xa2186a)['json'](_0x549aa8);}};}function respondWithFilteredResult(_0x4df41,_0x2e4685){return function(_0x2cc9b8){if(_0x2cc9b8){var _0x34e56d=typeof _0x2e4685[_0x1b41('0x18')]===_0x1b41('0x19')&&typeof _0x2e4685[_0x1b41('0x1a')]===_0x1b41('0x19');var _0x4281a0=_0x2cc9b8[_0x1b41('0x1b')];var _0x5b580a=_0x34e56d?0x0:_0x2e4685['offset'];var _0x5827c7=_0x34e56d?_0x2cc9b8[_0x1b41('0x1b')]:_0x2e4685[_0x1b41('0x18')]+_0x2e4685[_0x1b41('0x1a')];var _0x27a160;if(_0x5827c7>=_0x4281a0){_0x5827c7=_0x4281a0;_0x27a160=0xc8;}else{_0x27a160=0xce;}_0x4df41['status'](_0x27a160);return _0x4df41['set'](_0x1b41('0x1c'),_0x5b580a+'-'+_0x5827c7+'/'+_0x4281a0)[_0x1b41('0x1d')](_0x2cc9b8);}return null;};}function patchUpdates(_0x3b5441){return function(_0x48f51d){try{jsonpatch[_0x1b41('0x1e')](_0x48f51d,_0x3b5441,!![]);}catch(_0x3c4f2f){return BPromise['reject'](_0x3c4f2f);}return _0x48f51d['save']();};}function saveUpdates(_0x563d19,_0x40e837){return function(_0x4b8028){if(_0x4b8028){return _0x4b8028[_0x1b41('0x1f')](_0x563d19)[_0x1b41('0x20')](function(_0x3cb235){return _0x3cb235;});}return null;};}function removeEntity(_0x5afec0,_0x1d70f1){return function(_0x2da07a){if(_0x2da07a){return _0x2da07a[_0x1b41('0x21')]()[_0x1b41('0x20')](function(){_0x5afec0['status'](0xcc)[_0x1b41('0x17')]();});}};}function handleEntityNotFound(_0x3de17c,_0xb32d70){return function(_0x36b391){if(!_0x36b391){_0x3de17c[_0x1b41('0x15')](0x194);}return _0x36b391;};}function handleError(_0x4ee816,_0x4c2f0b){_0x4c2f0b=_0x4c2f0b||0x1f4;return function(_0x56bae9){logger[_0x1b41('0x22')](_0x56bae9[_0x1b41('0x23')]);if(_0x56bae9[_0x1b41('0x24')]){delete _0x56bae9[_0x1b41('0x24')];}_0x4ee816[_0x1b41('0x16')](_0x4c2f0b)[_0x1b41('0x25')](_0x56bae9);};}exports[_0x1b41('0x26')]=function(_0x27bb60,_0x112b4d){var _0x19f91e={},_0x38a5a0={},_0x5679f0={'count':0x0,'rows':[]};var _0x246b37=_[_0x1b41('0x27')](db[_0x1b41('0x28')][_0x1b41('0x29')],function(_0x1efc13){return{'name':_0x1efc13[_0x1b41('0x2a')],'type':_0x1efc13[_0x1b41('0x2b')]['key']};});_0x38a5a0['model']=_['map'](_0x246b37,_0x1b41('0x24'));_0x38a5a0[_0x1b41('0x2c')]=_[_0x1b41('0x2d')](_0x27bb60[_0x1b41('0x2c')]);_0x38a5a0[_0x1b41('0x2e')]=_[_0x1b41('0x2f')](_0x38a5a0[_0x1b41('0x30')],_0x38a5a0['query']);_0x19f91e['attributes']=_[_0x1b41('0x2f')](_0x38a5a0[_0x1b41('0x30')],qs[_0x1b41('0x31')](_0x27bb60[_0x1b41('0x2c')][_0x1b41('0x31')]));_0x19f91e['attributes']=_0x19f91e[_0x1b41('0x32')][_0x1b41('0x33')]?_0x19f91e[_0x1b41('0x32')]:_0x38a5a0[_0x1b41('0x30')];if(!_0x27bb60[_0x1b41('0x2c')]['hasOwnProperty']('nolimit')){_0x19f91e[_0x1b41('0x1a')]=qs[_0x1b41('0x1a')](_0x27bb60[_0x1b41('0x2c')]['limit']);_0x19f91e[_0x1b41('0x18')]=qs[_0x1b41('0x18')](_0x27bb60[_0x1b41('0x2c')][_0x1b41('0x18')]);}_0x19f91e[_0x1b41('0x34')]=qs[_0x1b41('0x35')](_0x27bb60[_0x1b41('0x2c')][_0x1b41('0x35')]);_0x19f91e['where']=qs[_0x1b41('0x2e')](_['pick'](_0x27bb60[_0x1b41('0x2c')],_0x38a5a0[_0x1b41('0x2e')]),_0x246b37);if(_0x27bb60['query'][_0x1b41('0x36')]){_0x19f91e[_0x1b41('0x37')]=_[_0x1b41('0x38')](_0x19f91e[_0x1b41('0x37')],{'$or':_[_0x1b41('0x27')](_0x246b37,function(_0x3562ac){if(_0x3562ac['type']!=='VIRTUAL'){var _0x14000e={};_0x14000e[_0x3562ac['name']]={'$like':'%'+_0x27bb60[_0x1b41('0x2c')][_0x1b41('0x36')]+'%'};return _0x14000e;}})});}_0x19f91e=_[_0x1b41('0x38')]({},_0x19f91e,_0x27bb60[_0x1b41('0x39')]);var _0x5d36cc={'where':_0x19f91e[_0x1b41('0x37')]};return db[_0x1b41('0x28')][_0x1b41('0x1b')](_0x5d36cc)[_0x1b41('0x20')](function(_0xc2f847){_0x5679f0[_0x1b41('0x1b')]=_0xc2f847;if(_0x27bb60['query'][_0x1b41('0x3a')]){_0x19f91e[_0x1b41('0x3b')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x1b41('0x3c')](_0x19f91e);})[_0x1b41('0x20')](function(_0x562194){_0x5679f0[_0x1b41('0x3d')]=_0x562194;return _0x5679f0;})[_0x1b41('0x20')](respondWithFilteredResult(_0x112b4d,_0x19f91e))['catch'](handleError(_0x112b4d,null));};exports['show']=function(_0x230e8d,_0x1a6e50){var _0x3da44e={'raw':![],'where':{'id':_0x230e8d[_0x1b41('0x3e')]['id']}},_0x2d4669={};_0x2d4669[_0x1b41('0x30')]=_[_0x1b41('0x2d')](db[_0x1b41('0x28')][_0x1b41('0x29')]);_0x2d4669[_0x1b41('0x2c')]=_[_0x1b41('0x2d')](_0x230e8d[_0x1b41('0x2c')]);_0x2d4669[_0x1b41('0x2e')]=_[_0x1b41('0x2f')](_0x2d4669[_0x1b41('0x30')],_0x2d4669['query']);_0x3da44e[_0x1b41('0x32')]=_[_0x1b41('0x2f')](_0x2d4669[_0x1b41('0x30')],qs[_0x1b41('0x31')](_0x230e8d[_0x1b41('0x2c')][_0x1b41('0x31')]));_0x3da44e[_0x1b41('0x32')]=_0x3da44e[_0x1b41('0x32')][_0x1b41('0x33')]?_0x3da44e['attributes']:_0x2d4669[_0x1b41('0x30')];if(_0x230e8d['query']['includeAll']){_0x3da44e[_0x1b41('0x3b')]=[{'all':!![]}];}_0x3da44e=_['merge']({},_0x3da44e,_0x230e8d[_0x1b41('0x39')]);return db[_0x1b41('0x28')][_0x1b41('0x3f')](_0x3da44e)[_0x1b41('0x20')](handleEntityNotFound(_0x1a6e50,null))[_0x1b41('0x20')](respondWithResult(_0x1a6e50,null))[_0x1b41('0x40')](handleError(_0x1a6e50,null));};exports[_0x1b41('0x41')]=function(_0x42fe62,_0x430414){return db['AnalyticFieldReport'][_0x1b41('0x41')](_0x42fe62[_0x1b41('0x42')],{})[_0x1b41('0x20')](respondWithResult(_0x430414,0xc9))[_0x1b41('0x40')](handleError(_0x430414,null));};exports[_0x1b41('0x43')]=function(_0x109827,_0x29d725){return db[_0x1b41('0x28')][_0x1b41('0x43')](_0x109827[_0x1b41('0x42')],{'raw':![],'individualHooks':!![]})[_0x1b41('0x20')](respondWithResult(_0x29d725,0xc9))['catch'](handleError(_0x29d725,null));};exports[_0x1b41('0x1f')]=function(_0x3b053b,_0x3778d6){if(_0x3b053b[_0x1b41('0x42')]['id']){delete _0x3b053b[_0x1b41('0x42')]['id'];}return db[_0x1b41('0x28')][_0x1b41('0x3f')]({'where':{'id':_0x3b053b[_0x1b41('0x3e')]['id']}})[_0x1b41('0x20')](handleEntityNotFound(_0x3778d6,null))['then'](saveUpdates(_0x3b053b[_0x1b41('0x42')],null))[_0x1b41('0x20')](respondWithResult(_0x3778d6,null))['catch'](handleError(_0x3778d6,null));};exports['destroy']=function(_0x29939e,_0x1cee98){return db['AnalyticFieldReport'][_0x1b41('0x3f')]({'where':{'id':_0x29939e['params']['id']}})[_0x1b41('0x20')](handleEntityNotFound(_0x1cee98,null))[_0x1b41('0x20')](removeEntity(_0x1cee98,null))[_0x1b41('0x40')](handleError(_0x1cee98,null));};exports[_0x1b41('0x44')]=function(_0x7cb64,_0x350244){return db[_0x1b41('0x28')][_0x1b41('0x21')]({'where':{'id':_0x7cb64[_0x1b41('0x2c')][_0x1b41('0x45')]||[]},'raw':![],'individualHooks':!![]})[_0x1b41('0x20')](respondWithResult(_0x350244,0xcc))[_0x1b41('0x40')](handleError(_0x350244,null));};exports['addFields']=function(_0x2c51aa,_0x3e0f3e,_0x2d6705){return db[_0x1b41('0x46')]['findOne']({'where':{'id':_0x2c51aa[_0x1b41('0x3e')]['id']}})[_0x1b41('0x20')](handleEntityNotFound(_0x3e0f3e,null))[_0x1b41('0x20')](function(_0xbdf3eb){if(_0xbdf3eb){return db[_0x1b41('0x47')][_0x1b41('0x48')](function(_0x216dd){return db['AnalyticFieldReport'][_0x1b41('0x21')]({'where':{'CustomReportId':_0x2c51aa[_0x1b41('0x3e')]['id']},'transaction':_0x216dd})[_0x1b41('0x20')](function(_0x4ab287){var _0x25fb26=_[_0x1b41('0x27')](_0x2c51aa[_0x1b41('0x42')],function(_0x38412c){delete _0x38412c['id'];_0x38412c[_0x1b41('0x49')]=_0x2c51aa['params']['id'];return _0x38412c;});return db[_0x1b41('0x28')][_0x1b41('0x43')](_0x25fb26,{'transaction':_0x216dd});});})[_0x1b41('0x20')](function(){return db['AnalyticFieldReport'][_0x1b41('0x3c')]({'where':{'CustomReportId':_0x2c51aa[_0x1b41('0x3e')]['id']}});});}})['then'](respondWithResult(_0x3e0f3e,null))[_0x1b41('0x40')](handleError(_0x3e0f3e,null));};
\ No newline at end of file
+var _0xd6a7=['undefined','limit','count','set','apply','reject','save','update','destroy','error','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','then','include','show','params','keys','merge','find','catch','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4583d0,_0x24551f){var _0x7b3c5a=function(_0x14946a){while(--_0x14946a){_0x4583d0['push'](_0x4583d0['shift']());}};_0x7b3c5a(++_0x24551f);}(_0xd6a7,0x11f));var _0x7d6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd6a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7d6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d6a('0x2'));var moment=require('moment');var BPromise=require(_0x7d6a('0x3'));var Mustache=require(_0x7d6a('0x4'));var util=require(_0x7d6a('0x5'));var path=require(_0x7d6a('0x6'));var sox=require(_0x7d6a('0x7'));var csv=require(_0x7d6a('0x8'));var ejs=require(_0x7d6a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d6a('0xa'));var squel=require(_0x7d6a('0xb'));var crypto=require('crypto');var jsforce=require(_0x7d6a('0xc'));var deskjs=require(_0x7d6a('0xd'));var toCsv=require(_0x7d6a('0x8'));var querystring=require('querystring');var Papa=require(_0x7d6a('0xe'));var Redis=require('ioredis');var authService=require(_0x7d6a('0xf'));var qs=require(_0x7d6a('0x10'));var as=require(_0x7d6a('0x11'));var hardwareService=require(_0x7d6a('0x12'));var logger=require(_0x7d6a('0x13'))(_0x7d6a('0x14'));var utils=require(_0x7d6a('0x15'));var config=require(_0x7d6a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d6a('0x17'))['db'];function respondWithStatusCode(_0x58ab9e,_0x135cf7){_0x135cf7=_0x135cf7||0xcc;return function(_0x2bae7b){if(_0x2bae7b){return _0x58ab9e[_0x7d6a('0x18')](_0x135cf7);}return _0x58ab9e[_0x7d6a('0x19')](_0x135cf7)[_0x7d6a('0x1a')]();};}function respondWithResult(_0x442e20,_0x882d0d){_0x882d0d=_0x882d0d||0xc8;return function(_0x5a73dd){if(_0x5a73dd){return _0x442e20[_0x7d6a('0x19')](_0x882d0d)[_0x7d6a('0x1b')](_0x5a73dd);}};}function respondWithFilteredResult(_0x4db851,_0x59d158){return function(_0xc9fa53){if(_0xc9fa53){var _0x281e90=typeof _0x59d158[_0x7d6a('0x1c')]===_0x7d6a('0x1d')&&typeof _0x59d158[_0x7d6a('0x1e')]===_0x7d6a('0x1d');var _0x1f591e=_0xc9fa53[_0x7d6a('0x1f')];var _0x135a0c=_0x281e90?0x0:_0x59d158[_0x7d6a('0x1c')];var _0x28455f=_0x281e90?_0xc9fa53[_0x7d6a('0x1f')]:_0x59d158[_0x7d6a('0x1c')]+_0x59d158[_0x7d6a('0x1e')];var _0x1e3b12;if(_0x28455f>=_0x1f591e){_0x28455f=_0x1f591e;_0x1e3b12=0xc8;}else{_0x1e3b12=0xce;}_0x4db851[_0x7d6a('0x19')](_0x1e3b12);return _0x4db851[_0x7d6a('0x20')]('Content-Range',_0x135a0c+'-'+_0x28455f+'/'+_0x1f591e)[_0x7d6a('0x1b')](_0xc9fa53);}return null;};}function patchUpdates(_0xbbe6ce){return function(_0x34b523){try{jsonpatch[_0x7d6a('0x21')](_0x34b523,_0xbbe6ce,!![]);}catch(_0xa0753b){return BPromise[_0x7d6a('0x22')](_0xa0753b);}return _0x34b523[_0x7d6a('0x23')]();};}function saveUpdates(_0x54f126,_0x4bfd79){return function(_0x3e35ee){if(_0x3e35ee){return _0x3e35ee[_0x7d6a('0x24')](_0x54f126)['then'](function(_0x4c6db3){return _0x4c6db3;});}return null;};}function removeEntity(_0x53f946,_0x376281){return function(_0x3af0e0){if(_0x3af0e0){return _0x3af0e0[_0x7d6a('0x25')]()['then'](function(){_0x53f946[_0x7d6a('0x19')](0xcc)[_0x7d6a('0x1a')]();});}};}function handleEntityNotFound(_0x50f626,_0x51bddd){return function(_0x40425a){if(!_0x40425a){_0x50f626[_0x7d6a('0x18')](0x194);}return _0x40425a;};}function handleError(_0x1e1fa3,_0xe8dd2e){_0xe8dd2e=_0xe8dd2e||0x1f4;return function(_0x58f9a2){logger[_0x7d6a('0x26')](_0x58f9a2['stack']);if(_0x58f9a2[_0x7d6a('0x27')]){delete _0x58f9a2[_0x7d6a('0x27')];}_0x1e1fa3[_0x7d6a('0x19')](_0xe8dd2e)[_0x7d6a('0x28')](_0x58f9a2);};}exports['index']=function(_0x4d55ec,_0x6b4a9f){var _0x3b3963={},_0x4352e4={},_0x37997a={'count':0x0,'rows':[]};var _0x10a147=_['map'](db[_0x7d6a('0x29')][_0x7d6a('0x2a')],function(_0xf94ad){return{'name':_0xf94ad[_0x7d6a('0x2b')],'type':_0xf94ad[_0x7d6a('0x2c')][_0x7d6a('0x2d')]};});_0x4352e4[_0x7d6a('0x2e')]=_[_0x7d6a('0x2f')](_0x10a147,_0x7d6a('0x27'));_0x4352e4[_0x7d6a('0x30')]=_['keys'](_0x4d55ec['query']);_0x4352e4['filters']=_[_0x7d6a('0x31')](_0x4352e4[_0x7d6a('0x2e')],_0x4352e4[_0x7d6a('0x30')]);_0x3b3963[_0x7d6a('0x32')]=_[_0x7d6a('0x31')](_0x4352e4[_0x7d6a('0x2e')],qs[_0x7d6a('0x33')](_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x33')]));_0x3b3963['attributes']=_0x3b3963[_0x7d6a('0x32')][_0x7d6a('0x34')]?_0x3b3963[_0x7d6a('0x32')]:_0x4352e4[_0x7d6a('0x2e')];if(!_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x35')](_0x7d6a('0x36'))){_0x3b3963[_0x7d6a('0x1e')]=qs[_0x7d6a('0x1e')](_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x1e')]);_0x3b3963[_0x7d6a('0x1c')]=qs[_0x7d6a('0x1c')](_0x4d55ec['query'][_0x7d6a('0x1c')]);}_0x3b3963[_0x7d6a('0x37')]=qs[_0x7d6a('0x38')](_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x38')]);_0x3b3963[_0x7d6a('0x39')]=qs[_0x7d6a('0x3a')](_['pick'](_0x4d55ec[_0x7d6a('0x30')],_0x4352e4[_0x7d6a('0x3a')]),_0x10a147);if(_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x3b')]){_0x3b3963[_0x7d6a('0x39')]=_['merge'](_0x3b3963[_0x7d6a('0x39')],{'$or':_[_0x7d6a('0x2f')](_0x10a147,function(_0x44e23a){if(_0x44e23a[_0x7d6a('0x2c')]!=='VIRTUAL'){var _0x1044da={};_0x1044da[_0x44e23a['name']]={'$like':'%'+_0x4d55ec[_0x7d6a('0x30')][_0x7d6a('0x3b')]+'%'};return _0x1044da;}})});}_0x3b3963=_['merge']({},_0x3b3963,_0x4d55ec[_0x7d6a('0x3c')]);var _0x564e30={'where':_0x3b3963[_0x7d6a('0x39')]};return db[_0x7d6a('0x29')]['count'](_0x564e30)[_0x7d6a('0x3d')](function(_0x20e368){_0x37997a[_0x7d6a('0x1f')]=_0x20e368;if(_0x4d55ec['query']['includeAll']){_0x3b3963[_0x7d6a('0x3e')]=[{'all':!![]}];}return db[_0x7d6a('0x29')]['findAll'](_0x3b3963);})[_0x7d6a('0x3d')](function(_0x4feaed){_0x37997a['rows']=_0x4feaed;return _0x37997a;})[_0x7d6a('0x3d')](respondWithFilteredResult(_0x6b4a9f,_0x3b3963))['catch'](handleError(_0x6b4a9f,null));};exports[_0x7d6a('0x3f')]=function(_0x541a38,_0x37ee38){var _0x38febc={'raw':![],'where':{'id':_0x541a38[_0x7d6a('0x40')]['id']}},_0x5d21a8={};_0x5d21a8['model']=_[_0x7d6a('0x41')](db[_0x7d6a('0x29')][_0x7d6a('0x2a')]);_0x5d21a8[_0x7d6a('0x30')]=_[_0x7d6a('0x41')](_0x541a38['query']);_0x5d21a8[_0x7d6a('0x3a')]=_[_0x7d6a('0x31')](_0x5d21a8[_0x7d6a('0x2e')],_0x5d21a8[_0x7d6a('0x30')]);_0x38febc['attributes']=_[_0x7d6a('0x31')](_0x5d21a8['model'],qs[_0x7d6a('0x33')](_0x541a38[_0x7d6a('0x30')][_0x7d6a('0x33')]));_0x38febc[_0x7d6a('0x32')]=_0x38febc[_0x7d6a('0x32')][_0x7d6a('0x34')]?_0x38febc[_0x7d6a('0x32')]:_0x5d21a8[_0x7d6a('0x2e')];if(_0x541a38[_0x7d6a('0x30')]['includeAll']){_0x38febc[_0x7d6a('0x3e')]=[{'all':!![]}];}_0x38febc=_[_0x7d6a('0x42')]({},_0x38febc,_0x541a38[_0x7d6a('0x3c')]);return db[_0x7d6a('0x29')][_0x7d6a('0x43')](_0x38febc)[_0x7d6a('0x3d')](handleEntityNotFound(_0x37ee38,null))[_0x7d6a('0x3d')](respondWithResult(_0x37ee38,null))[_0x7d6a('0x44')](handleError(_0x37ee38,null));};exports[_0x7d6a('0x45')]=function(_0x5d3fd1,_0x40a482){return db[_0x7d6a('0x29')][_0x7d6a('0x45')](_0x5d3fd1['body'],{})[_0x7d6a('0x3d')](respondWithResult(_0x40a482,0xc9))['catch'](handleError(_0x40a482,null));};exports[_0x7d6a('0x46')]=function(_0x484e64,_0x1fd0d0){return db['AnalyticFieldReport']['bulkCreate'](_0x484e64[_0x7d6a('0x47')],{'raw':![],'individualHooks':!![]})[_0x7d6a('0x3d')](respondWithResult(_0x1fd0d0,0xc9))[_0x7d6a('0x44')](handleError(_0x1fd0d0,null));};exports[_0x7d6a('0x24')]=function(_0x111c46,_0x1cf51f){if(_0x111c46[_0x7d6a('0x47')]['id']){delete _0x111c46[_0x7d6a('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7d6a('0x43')]({'where':{'id':_0x111c46[_0x7d6a('0x40')]['id']}})[_0x7d6a('0x3d')](handleEntityNotFound(_0x1cf51f,null))[_0x7d6a('0x3d')](saveUpdates(_0x111c46[_0x7d6a('0x47')],null))['then'](respondWithResult(_0x1cf51f,null))[_0x7d6a('0x44')](handleError(_0x1cf51f,null));};exports[_0x7d6a('0x25')]=function(_0x535947,_0x4aecaf){return db[_0x7d6a('0x29')][_0x7d6a('0x43')]({'where':{'id':_0x535947['params']['id']}})[_0x7d6a('0x3d')](handleEntityNotFound(_0x4aecaf,null))['then'](removeEntity(_0x4aecaf,null))['catch'](handleError(_0x4aecaf,null));};exports[_0x7d6a('0x48')]=function(_0x1fad46,_0x1c82d9){return db[_0x7d6a('0x29')][_0x7d6a('0x25')]({'where':{'id':_0x1fad46['query'][_0x7d6a('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0x7d6a('0x3d')](respondWithResult(_0x1c82d9,0xcc))[_0x7d6a('0x44')](handleError(_0x1c82d9,null));};exports['addFields']=function(_0x2e822d,_0x95e732,_0x223cea){return db[_0x7d6a('0x4a')][_0x7d6a('0x4b')]({'where':{'id':_0x2e822d[_0x7d6a('0x40')]['id']}})[_0x7d6a('0x3d')](handleEntityNotFound(_0x95e732,null))['then'](function(_0x3c0425){if(_0x3c0425){return db[_0x7d6a('0x4c')][_0x7d6a('0x4d')](function(_0x184244){return db[_0x7d6a('0x29')][_0x7d6a('0x25')]({'where':{'CustomReportId':_0x2e822d[_0x7d6a('0x40')]['id']},'transaction':_0x184244})[_0x7d6a('0x3d')](function(_0x511135){var _0x45aee5=_[_0x7d6a('0x2f')](_0x2e822d[_0x7d6a('0x47')],function(_0x52ef2e){delete _0x52ef2e['id'];_0x52ef2e[_0x7d6a('0x4e')]=_0x2e822d[_0x7d6a('0x40')]['id'];return _0x52ef2e;});return db[_0x7d6a('0x29')][_0x7d6a('0x46')](_0x45aee5,{'transaction':_0x184244});});})['then'](function(){return db[_0x7d6a('0x29')]['findAll']({'where':{'CustomReportId':_0x2e822d['params']['id']}});});}})[_0x7d6a('0x3d')](respondWithResult(_0x95e732,null))['catch'](handleError(_0x95e732,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index d2f5dc6..2066901 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 _0x5a61=['moment','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api'];(function(_0x6bc1b,_0x4ec014){var _0x18d074=function(_0x427299){while(--_0x427299){_0x6bc1b['push'](_0x6bc1b['shift']());}};_0x18d074(++_0x4ec014);}(_0x5a61,0xd9));var _0x15a6=function(_0x55018a,_0x4b5296){_0x55018a=_0x55018a-0x0;var _0x2d1dea=_0x5a61[_0x55018a];return _0x2d1dea;};'use strict';var _=require(_0x15a6('0x0'));var util=require('util');var logger=require(_0x15a6('0x1'))(_0x15a6('0x2'));var moment=require(_0x15a6('0x3'));var BPromise=require('bluebird');var rp=require(_0x15a6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15a6('0x5'));var attributes=require(_0x15a6('0x6'));module[_0x15a6('0x7')]=function(_0x23b689,_0x20bf55){return _0x23b689['define'](_0x15a6('0x8'),attributes,{'tableName':_0x15a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0xe706,0x1c6));var _0x6e70=function(_0xef66ed,_0x1a5239){_0xef66ed=_0xef66ed-0x0;var _0xa14f66=_0xe706[_0xef66ed];return _0xa14f66;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x462287,_0x393afd){return _0x462287[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'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 535919a..3b15179 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 _0xa879=['AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa65bc3,_0x2bd50c){var _0x1ab82c=function(_0x4dc6a4){while(--_0x4dc6a4){_0xa65bc3['push'](_0xa65bc3['shift']());}};_0x1ab82c(++_0x2bd50c);}(_0xa879,0xea));var _0x9a87=function(_0x183060,_0x319d29){_0x183060=_0x183060-0x0;var _0x552b8b=_0xa879[_0x183060];return _0x552b8b;};'use strict';var _=require(_0x9a87('0x0'));var util=require('util');var moment=require(_0x9a87('0x1'));var BPromise=require(_0x9a87('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a87('0x3'));var db=require(_0x9a87('0x4'))['db'];var utils=require(_0x9a87('0x5'));var logger=require(_0x9a87('0x6'))(_0x9a87('0x7'));var config=require(_0x9a87('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9a87('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf6e779,_0xb44406,_0x207f6d){return new BPromise(function(_0x572a53,_0x846304){return client[_0x9a87('0xa')](_0xf6e779,_0x207f6d)[_0x9a87('0xb')](function(_0x2f2550){logger[_0x9a87('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0xb44406,_0x9a87('0xd'));logger[_0x9a87('0xe')](_0x9a87('0xf'),_0xb44406,'request\x20sent',JSON[_0x9a87('0x10')](_0x2f2550));if(_0x2f2550[_0x9a87('0x11')]){if(_0x2f2550['error'][_0x9a87('0x12')]===0x1f4){logger[_0x9a87('0x11')](_0x9a87('0x13'),_0xb44406,_0x2f2550['error'][_0x9a87('0x14')]);return _0x846304(_0x2f2550[_0x9a87('0x11')][_0x9a87('0x14')]);}logger[_0x9a87('0x11')](_0x9a87('0x13'),_0xb44406,_0x2f2550[_0x9a87('0x11')]['message']);return _0x572a53(_0x2f2550[_0x9a87('0x11')]['message']);}else{logger[_0x9a87('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0xb44406,'request\x20sent');_0x572a53(_0x2f2550[_0x9a87('0x15')][_0x9a87('0x14')]);}})[_0x9a87('0x16')](function(_0x53e9bf){logger['error'](_0x9a87('0x13'),_0xb44406,_0x53e9bf);_0x846304(_0x53e9bf);});});}
\ No newline at end of file
+var _0x07e2=['request','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x187d1f,_0x2c09c2){var _0x3556e5=function(_0x5d9095){while(--_0x5d9095){_0x187d1f['push'](_0x187d1f['shift']());}};_0x3556e5(++_0x2c09c2);}(_0x07e2,0x131));var _0x207e=function(_0x381781,_0x35257f){_0x381781=_0x381781-0x0;var _0x540ba0=_0x07e2[_0x381781];return _0x540ba0;};'use strict';var _=require('lodash');var util=require(_0x207e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x207e('0x1'));var fs=require('fs');var Redis=require(_0x207e('0x2'));var db=require(_0x207e('0x3'))['db'];var utils=require(_0x207e('0x4'));var logger=require(_0x207e('0x5'))(_0x207e('0x6'));var config=require(_0x207e('0x7'));var jayson=require(_0x207e('0x8'));var client=jayson[_0x207e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ab7ee,_0x5b1b58,_0x3305fa){return new BPromise(function(_0x4e20ac,_0x196a6b){return client[_0x207e('0xa')](_0x2ab7ee,_0x3305fa)['then'](function(_0x5e9eae){logger[_0x207e('0xb')](_0x207e('0xc'),_0x5b1b58,'request\x20sent');logger['debug'](_0x207e('0xd'),_0x5b1b58,'request\x20sent',JSON[_0x207e('0xe')](_0x5e9eae));if(_0x5e9eae[_0x207e('0xf')]){if(_0x5e9eae['error'][_0x207e('0x10')]===0x1f4){logger[_0x207e('0xf')](_0x207e('0xc'),_0x5b1b58,_0x5e9eae[_0x207e('0xf')][_0x207e('0x11')]);return _0x196a6b(_0x5e9eae[_0x207e('0xf')][_0x207e('0x11')]);}logger[_0x207e('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5b1b58,_0x5e9eae['error'][_0x207e('0x11')]);return _0x4e20ac(_0x5e9eae[_0x207e('0xf')][_0x207e('0x11')]);}else{logger['info'](_0x207e('0xc'),_0x5b1b58,_0x207e('0x12'));_0x4e20ac(_0x5e9eae[_0x207e('0x13')]['message']);}})[_0x207e('0x14')](function(_0x108281){logger[_0x207e('0xf')](_0x207e('0xc'),_0x5b1b58,_0x108281);_0x196a6b(_0x108281);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 36307cf..3e4322f 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(_0xac15c3,_0x2451ea){var _0x3ef3db=function(_0x361906){while(--_0x361906){_0xac15c3['push'](_0xac15c3['shift']());}};_0x3ef3db(++_0x2451ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x2c10d1,_0x9a1e2b){var _0x119b4a=function(_0xcee1a5){while(--_0xcee1a5){_0x2c10d1['push'](_0x2c10d1['shift']());}};_0x119b4a(++_0x9a1e2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 29798ce..2b827da 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 _0x84a0=['name','TEXT','sequelize','exports','STRING'];(function(_0x25e293,_0x329321){var _0x294981=function(_0x1320e7){while(--_0x1320e7){_0x25e293['push'](_0x25e293['shift']());}};_0x294981(++_0x329321);}(_0x84a0,0x66));var _0x084a=function(_0x543a43,_0x27240f){_0x543a43=_0x543a43-0x0;var _0x40fbb4=_0x84a0[_0x543a43];return _0x40fbb4;};'use strict';var Sequelize=require(_0x084a('0x0'));module[_0x084a('0x1')]={'name':{'type':Sequelize[_0x084a('0x2')],'allowNull':![],'unique':_0x084a('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x084a('0x4')]},'description':{'type':Sequelize[_0x084a('0x2')]}};
\ No newline at end of file
+var _0xb98f=['STRING','name','sequelize','exports'];(function(_0x330db1,_0x35fc39){var _0xe113f4=function(_0x422608){while(--_0x422608){_0x330db1['push'](_0x330db1['shift']());}};_0xe113f4(++_0x35fc39);}(_0xb98f,0xce));var _0xfb98=function(_0x2790cf,_0x3f8b07){_0x2790cf=_0x2790cf-0x0;var _0xc19833=_0xb98f[_0x2790cf];return _0xc19833;};'use strict';var Sequelize=require(_0xfb98('0x0'));module[_0xfb98('0x1')]={'name':{'type':Sequelize[_0xfb98('0x2')],'allowNull':![],'unique':_0xfb98('0x3')},'table':{'type':Sequelize[_0xfb98('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index bec88c0..787601f 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 _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x4d6d91,_0x427352){var _0x3bf046=function(_0x5b9812){while(--_0x5b9812){_0x4d6d91['push'](_0x4d6d91['shift']());}};_0x3bf046(++_0x427352);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5cddc4,_0x394b2f){_0x5cddc4=_0x5cddc4-0x0;var _0x22e2bb=_0xdc97[_0x5cddc4];return _0x22e2bb;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
+var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x3a2bb7,_0x4ebdce){var _0x4f5f21=function(_0x455d71){while(--_0x455d71){_0x3a2bb7['push'](_0x3a2bb7['shift']());}};_0x4f5f21(++_0x4ebdce);}(_0xe5b3,0x133));var _0x3e5b=function(_0x31b7d7,_0x3de9ed){_0x31b7d7=_0x31b7d7-0x0;var _0x3a376e=_0xe5b3[_0x31b7d7];return _0x3a376e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x374068,_0x20b97b){_0x20b97b=_0x20b97b||0xcc;return function(_0x3c4eb1){if(_0x3c4eb1){return _0x374068[_0x3e5b('0x19')](_0x20b97b);}return _0x374068['status'](_0x20b97b)[_0x3e5b('0x1a')]();};}function respondWithResult(_0x5f2f9c,_0x51a188){_0x51a188=_0x51a188||0xc8;return function(_0x4d71a3){if(_0x4d71a3){return _0x5f2f9c[_0x3e5b('0x1b')](_0x51a188)[_0x3e5b('0x1c')](_0x4d71a3);}};}function respondWithFilteredResult(_0x17aaa3,_0x4fb471){return function(_0x1f81a7){if(_0x1f81a7){var _0x59ddc0=typeof _0x4fb471['offset']===_0x3e5b('0x1d')&&typeof _0x4fb471[_0x3e5b('0x1e')]==='undefined';var _0x3d58a4=_0x1f81a7[_0x3e5b('0x1f')];var _0x555002=_0x59ddc0?0x0:_0x4fb471[_0x3e5b('0x20')];var _0x3365dd=_0x59ddc0?_0x1f81a7['count']:_0x4fb471['offset']+_0x4fb471[_0x3e5b('0x1e')];var _0x20806a;if(_0x3365dd>=_0x3d58a4){_0x3365dd=_0x3d58a4;_0x20806a=0xc8;}else{_0x20806a=0xce;}_0x17aaa3[_0x3e5b('0x1b')](_0x20806a);return _0x17aaa3[_0x3e5b('0x21')](_0x3e5b('0x22'),_0x555002+'-'+_0x3365dd+'/'+_0x3d58a4)[_0x3e5b('0x1c')](_0x1f81a7);}return null;};}function patchUpdates(_0x447d36){return function(_0x21fc32){try{jsonpatch[_0x3e5b('0x23')](_0x21fc32,_0x447d36,!![]);}catch(_0x3d95f3){return BPromise[_0x3e5b('0x24')](_0x3d95f3);}return _0x21fc32[_0x3e5b('0x25')]();};}function saveUpdates(_0x2d77cc,_0x402873){return function(_0x5b46d4){if(_0x5b46d4){return _0x5b46d4[_0x3e5b('0x26')](_0x2d77cc)[_0x3e5b('0x27')](function(_0x2146d4){return _0x2146d4;});}return null;};}function removeEntity(_0x150674,_0x50039b){return function(_0x1eb80f){if(_0x1eb80f){return _0x1eb80f['destroy']()[_0x3e5b('0x27')](function(){var _0x36d960=_0x1eb80f['get']({'plain':!![]});var _0x41b684=_0x3e5b('0x28');return db[_0x3e5b('0x29')][_0x3e5b('0x2a')]({'where':{'type':_0x41b684,'resourceId':_0x36d960['id']}})[_0x3e5b('0x27')](function(){return _0x1eb80f;});})[_0x3e5b('0x27')](function(){_0x150674[_0x3e5b('0x1b')](0xcc)[_0x3e5b('0x1a')]();});}};}function handleEntityNotFound(_0x4c4b89,_0x1c7278){return function(_0x505f40){if(!_0x505f40){_0x4c4b89[_0x3e5b('0x19')](0x194);}return _0x505f40;};}function handleError(_0x4fd64b,_0x101653){_0x101653=_0x101653||0x1f4;return function(_0x1f6473){logger[_0x3e5b('0x2b')](_0x1f6473[_0x3e5b('0x2c')]);if(_0x1f6473[_0x3e5b('0x2d')]){delete _0x1f6473[_0x3e5b('0x2d')];}_0x4fd64b[_0x3e5b('0x1b')](_0x101653)[_0x3e5b('0x2e')](_0x1f6473);};}exports[_0x3e5b('0x2f')]=function(_0x112dc0,_0x1e1565){var _0x489221={},_0x21bc10={},_0x1882aa={'count':0x0,'rows':[]};var _0xa8760b=_[_0x3e5b('0x30')](db[_0x3e5b('0x31')][_0x3e5b('0x32')],function(_0x345927){return{'name':_0x345927['fieldName'],'type':_0x345927[_0x3e5b('0x33')]['key']};});_0x21bc10['model']=_[_0x3e5b('0x30')](_0xa8760b,_0x3e5b('0x2d'));_0x21bc10['query']=_[_0x3e5b('0x34')](_0x112dc0[_0x3e5b('0x35')]);_0x21bc10[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],_0x21bc10[_0x3e5b('0x35')]);_0x489221[_0x3e5b('0x39')]=_[_0x3e5b('0x37')](_0x21bc10[_0x3e5b('0x38')],qs[_0x3e5b('0x3a')](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x489221['attributes']=_0x489221[_0x3e5b('0x39')][_0x3e5b('0x3b')]?_0x489221['attributes']:_0x21bc10['model'];if(!_0x112dc0[_0x3e5b('0x35')]['hasOwnProperty'](_0x3e5b('0x3c'))){_0x489221[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x112dc0[_0x3e5b('0x35')]['limit']);_0x489221[_0x3e5b('0x20')]=qs['offset'](_0x112dc0[_0x3e5b('0x35')]['offset']);}_0x489221['order']=qs['sort'](_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x3d')]);_0x489221[_0x3e5b('0x3e')]=qs[_0x3e5b('0x36')](_[_0x3e5b('0x3f')](_0x112dc0[_0x3e5b('0x35')],_0x21bc10['filters']),_0xa8760b);if(_0x112dc0['query']['filter']){_0x489221['where']=_['merge'](_0x489221['where'],{'$or':_['map'](_0xa8760b,function(_0x182bc4){if(_0x182bc4[_0x3e5b('0x33')]!==_0x3e5b('0x40')){var _0x1aafd5={};_0x1aafd5[_0x182bc4[_0x3e5b('0x2d')]]={'$like':'%'+_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x41')]+'%'};return _0x1aafd5;}})});}_0x489221=_[_0x3e5b('0x42')]({},_0x489221,_0x112dc0[_0x3e5b('0x43')]);var _0xbbc6b={'where':_0x489221[_0x3e5b('0x3e')]};return db['AnalyticMetric'][_0x3e5b('0x1f')](_0xbbc6b)[_0x3e5b('0x27')](function(_0x1e8075){_0x1882aa[_0x3e5b('0x1f')]=_0x1e8075;if(_0x112dc0[_0x3e5b('0x35')][_0x3e5b('0x44')]){_0x489221[_0x3e5b('0x45')]=[{'all':!![]}];}return db[_0x3e5b('0x31')][_0x3e5b('0x46')](_0x489221);})[_0x3e5b('0x27')](function(_0x13c8d5){_0x1882aa['rows']=_0x13c8d5;return _0x1882aa;})['then'](respondWithFilteredResult(_0x1e1565,_0x489221))['catch'](handleError(_0x1e1565,null));};exports['show']=function(_0xa99d75,_0x21ee8a){var _0x9fc025={'raw':!![],'where':{'id':_0xa99d75[_0x3e5b('0x47')]['id']}},_0x24c416={};_0x24c416[_0x3e5b('0x38')]=_[_0x3e5b('0x34')](db[_0x3e5b('0x31')][_0x3e5b('0x32')]);_0x24c416[_0x3e5b('0x35')]=_['keys'](_0xa99d75[_0x3e5b('0x35')]);_0x24c416[_0x3e5b('0x36')]=_[_0x3e5b('0x37')](_0x24c416[_0x3e5b('0x38')],_0x24c416[_0x3e5b('0x35')]);_0x9fc025['attributes']=_['intersection'](_0x24c416['model'],qs[_0x3e5b('0x3a')](_0xa99d75[_0x3e5b('0x35')][_0x3e5b('0x3a')]));_0x9fc025['attributes']=_0x9fc025['attributes'][_0x3e5b('0x3b')]?_0x9fc025[_0x3e5b('0x39')]:_0x24c416[_0x3e5b('0x38')];if(_0xa99d75['query']['includeAll']){_0x9fc025[_0x3e5b('0x45')]=[{'all':!![]}];}_0x9fc025=_['merge']({},_0x9fc025,_0xa99d75[_0x3e5b('0x43')]);return db[_0x3e5b('0x31')][_0x3e5b('0x48')](_0x9fc025)[_0x3e5b('0x27')](handleEntityNotFound(_0x21ee8a,null))[_0x3e5b('0x27')](respondWithResult(_0x21ee8a,null))[_0x3e5b('0x49')](handleError(_0x21ee8a,null));};exports[_0x3e5b('0x4a')]=function(_0x3ea5aa,_0x339852){return db['AnalyticMetric'][_0x3e5b('0x4a')](_0x3ea5aa['body'],{})[_0x3e5b('0x27')](function(_0x2e7047){var _0x26e11e=_0x3ea5aa[_0x3e5b('0x4b')][_0x3e5b('0x4c')]({'plain':!![]});if(!_0x26e11e)throw new Error(_0x3e5b('0x4d'));if(_0x26e11e[_0x3e5b('0x4e')]===_0x3e5b('0x4b')){var _0x2b5d3d=_0x2e7047[_0x3e5b('0x4c')]({'plain':!![]});var _0xf6ca5b=_0x3e5b('0x28');return db[_0x3e5b('0x4f')]['find']({'where':{'name':_0xf6ca5b,'userProfileId':_0x26e11e[_0x3e5b('0x50')]},'raw':!![]})[_0x3e5b('0x27')](function(_0x2ca33b){if(_0x2ca33b&&_0x2ca33b[_0x3e5b('0x51')]===0x0){return db[_0x3e5b('0x29')][_0x3e5b('0x4a')]({'name':_0x2b5d3d['name'],'resourceId':_0x2b5d3d['id'],'type':_0x2ca33b[_0x3e5b('0x2d')],'sectionId':_0x2ca33b['id']},{})[_0x3e5b('0x27')](function(){return _0x2e7047;});}else{return _0x2e7047;}})[_0x3e5b('0x49')](function(_0x314d42){logger[_0x3e5b('0x2b')](_0x3e5b('0x52'),_0x314d42);throw _0x314d42;});}return _0x2e7047;})[_0x3e5b('0x27')](respondWithResult(_0x339852,0xc9))[_0x3e5b('0x49')](handleError(_0x339852,null));};exports['update']=function(_0x1e6403,_0x5e702f){if(_0x1e6403['body']['id']){delete _0x1e6403[_0x3e5b('0x53')]['id'];}return db['AnalyticMetric'][_0x3e5b('0x48')]({'where':{'id':_0x1e6403[_0x3e5b('0x47')]['id']}})[_0x3e5b('0x27')](handleEntityNotFound(_0x5e702f,null))[_0x3e5b('0x27')](saveUpdates(_0x1e6403['body'],null))['then'](respondWithResult(_0x5e702f,null))['catch'](handleError(_0x5e702f,null));};exports['destroy']=function(_0x2ab5f3,_0x999518){return db[_0x3e5b('0x31')][_0x3e5b('0x48')]({'where':{'id':_0x2ab5f3[_0x3e5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x999518,null))['then'](removeEntity(_0x999518,null))[_0x3e5b('0x49')](handleError(_0x999518,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index dde8712..47c6e2a 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 _0x770d=['moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api'];(function(_0x3836ec,_0x4bc915){var _0x4aa699=function(_0x510d08){while(--_0x510d08){_0x3836ec['push'](_0x3836ec['shift']());}};_0x4aa699(++_0x4bc915);}(_0x770d,0x122));var _0xd770=function(_0x37cde3,_0x20109a){_0x37cde3=_0x37cde3-0x0;var _0x2d6530=_0x770d[_0x37cde3];return _0x2d6530;};'use strict';var _=require(_0xd770('0x0'));var util=require(_0xd770('0x1'));var logger=require(_0xd770('0x2'))(_0xd770('0x3'));var moment=require(_0xd770('0x4'));var BPromise=require(_0xd770('0x5'));var rp=require(_0xd770('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd770('0x7'));var config=require(_0xd770('0x8'));var attributes=require(_0xd770('0x9'));module[_0xd770('0xa')]=function(_0x5d3b18,_0x554c5e){return _0x5d3b18[_0xd770('0xb')](_0xd770('0xc'),attributes,{'tableName':_0xd770('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8838=['./analyticMetric.attributes','exports','define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x148e7c,_0x433004){var _0x59da04=function(_0x20d6a6){while(--_0x20d6a6){_0x148e7c['push'](_0x148e7c['shift']());}};_0x59da04(++_0x433004);}(_0x8838,0x90));var _0x8883=function(_0x3f246b,_0x1c8b9a){_0x3f246b=_0x3f246b-0x0;var _0x1a7b27=_0x8838[_0x3f246b];return _0x1a7b27;};'use strict';var _=require(_0x8883('0x0'));var util=require(_0x8883('0x1'));var logger=require(_0x8883('0x2'))(_0x8883('0x3'));var moment=require(_0x8883('0x4'));var BPromise=require(_0x8883('0x5'));var rp=require(_0x8883('0x6'));var fs=require('fs');var path=require(_0x8883('0x7'));var rimraf=require(_0x8883('0x8'));var config=require(_0x8883('0x9'));var attributes=require(_0x8883('0xa'));module[_0x8883('0xb')]=function(_0x5c894f,_0x5061d6){return _0x5c894f[_0x8883('0xc')]('AnalyticMetric',attributes,{'tableName':_0x8883('0xd'),'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 0d50c32..e36926c 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 _0x8d47=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0x4e019c,_0x55ff32){var _0x37dedf=function(_0xfac621){while(--_0xfac621){_0x4e019c['push'](_0x4e019c['shift']());}};_0x37dedf(++_0x55ff32);}(_0x8d47,0x1df));var _0x78d4=function(_0x2eddce,_0x2930d8){_0x2eddce=_0x2eddce-0x0;var _0x5c6cca=_0x8d47[_0x2eddce];return _0x5c6cca;};'use strict';var _=require(_0x78d4('0x0'));var util=require('util');var moment=require(_0x78d4('0x1'));var BPromise=require(_0x78d4('0x2'));var rs=require(_0x78d4('0x3'));var fs=require('fs');var Redis=require(_0x78d4('0x4'));var db=require(_0x78d4('0x5'))['db'];var utils=require(_0x78d4('0x6'));var logger=require(_0x78d4('0x7'))(_0x78d4('0x8'));var config=require(_0x78d4('0x9'));var jayson=require(_0x78d4('0xa'));var client=jayson['client'][_0x78d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21aa99,_0xa168c5,_0x2a4d2c){return new BPromise(function(_0x52d165,_0x19beb9){return client[_0x78d4('0xc')](_0x21aa99,_0x2a4d2c)[_0x78d4('0xd')](function(_0x474d36){logger['info'](_0x78d4('0xe'),_0xa168c5,'request\x20sent');logger[_0x78d4('0xf')](_0x78d4('0x10'),_0xa168c5,_0x78d4('0x11'),JSON[_0x78d4('0x12')](_0x474d36));if(_0x474d36[_0x78d4('0x13')]){if(_0x474d36[_0x78d4('0x13')]['code']===0x1f4){logger[_0x78d4('0x13')](_0x78d4('0xe'),_0xa168c5,_0x474d36[_0x78d4('0x13')][_0x78d4('0x14')]);return _0x19beb9(_0x474d36[_0x78d4('0x13')][_0x78d4('0x14')]);}logger[_0x78d4('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0xa168c5,_0x474d36[_0x78d4('0x13')]['message']);return _0x52d165(_0x474d36[_0x78d4('0x13')][_0x78d4('0x14')]);}else{logger[_0x78d4('0x15')](_0x78d4('0xe'),_0xa168c5,'request\x20sent');_0x52d165(_0x474d36[_0x78d4('0x16')][_0x78d4('0x14')]);}})[_0x78d4('0x17')](function(_0x3044f2){logger[_0x78d4('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0xa168c5,_0x3044f2);_0x19beb9(_0x3044f2);});});}
\ No newline at end of file
+var _0x7da8=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2b4f44,_0x7cc184){var _0xaaebe3=function(_0x11f155){while(--_0x11f155){_0x2b4f44['push'](_0x2b4f44['shift']());}};_0xaaebe3(++_0x7cc184);}(_0x7da8,0x164));var _0x87da=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x7da8[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x87da('0x0'));var util=require(_0x87da('0x1'));var moment=require(_0x87da('0x2'));var BPromise=require('bluebird');var rs=require(_0x87da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87da('0x4'))['db'];var utils=require(_0x87da('0x5'));var logger=require(_0x87da('0x6'))(_0x87da('0x7'));var config=require(_0x87da('0x8'));var jayson=require(_0x87da('0x9'));var client=jayson[_0x87da('0xa')][_0x87da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36856c,_0x20e780,_0x2fd416){return new BPromise(function(_0x3096bb,_0x31b7f2){return client['request'](_0x36856c,_0x2fd416)[_0x87da('0xc')](function(_0x5290ea){logger[_0x87da('0xd')](_0x87da('0xe'),_0x20e780,_0x87da('0xf'));logger[_0x87da('0x10')](_0x87da('0x11'),_0x20e780,_0x87da('0xf'),JSON[_0x87da('0x12')](_0x5290ea));if(_0x5290ea[_0x87da('0x13')]){if(_0x5290ea[_0x87da('0x13')][_0x87da('0x14')]===0x1f4){logger[_0x87da('0x13')](_0x87da('0xe'),_0x20e780,_0x5290ea['error'][_0x87da('0x15')]);return _0x31b7f2(_0x5290ea[_0x87da('0x13')][_0x87da('0x15')]);}logger[_0x87da('0x13')](_0x87da('0xe'),_0x20e780,_0x5290ea['error'][_0x87da('0x15')]);return _0x3096bb(_0x5290ea[_0x87da('0x13')][_0x87da('0x15')]);}else{logger[_0x87da('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x20e780,_0x87da('0xf'));_0x3096bb(_0x5290ea['result']['message']);}})[_0x87da('0x16')](function(_0x233834){logger[_0x87da('0x13')](_0x87da('0xe'),_0x20e780,_0x233834);_0x31b7f2(_0x233834);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index dc05120..f5b1bf6 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 _0x4ce6=['../../components/auth/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4551fd,_0x18ff84){var _0x2adb36=function(_0x30ff46){while(--_0x30ff46){_0x4551fd['push'](_0x4551fd['shift']());}};_0x2adb36(++_0x18ff84);}(_0x4ce6,0x108));var _0x64ce=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x4ce6[_0x5f3905];return _0x2923b1;};'use strict';var multer=require(_0x64ce('0x0'));var util=require('util');var path=require(_0x64ce('0x1'));var timeout=require(_0x64ce('0x2'));var express=require(_0x64ce('0x3'));var router=express[_0x64ce('0x4')]();var fs_extra=require(_0x64ce('0x5'));var auth=require(_0x64ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x64ce('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x64ce('0x8')](),controller[_0x64ce('0x9')]);router['get'](_0x64ce('0xa'),auth[_0x64ce('0x8')](),controller[_0x64ce('0xb')]);router[_0x64ce('0xc')]('/',auth[_0x64ce('0x8')](),controller[_0x64ce('0xd')]);router[_0x64ce('0xe')](_0x64ce('0xa'),auth[_0x64ce('0x8')](),controller[_0x64ce('0xf')]);router['delete'](_0x64ce('0xa'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x10')]);module[_0x64ce('0x11')]=router;
\ No newline at end of file
+var _0xdf98=['isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdf98,0xcf));var _0x8df9=function(_0x1cc060,_0x1afbdc){_0x1cc060=_0x1cc060-0x0;var _0x5c7e10=_0xdf98[_0x1cc060];return _0x5c7e10;};'use strict';var multer=require(_0x8df9('0x0'));var util=require('util');var path=require(_0x8df9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8df9('0x2')]();var fs_extra=require(_0x8df9('0x3'));var auth=require(_0x8df9('0x4'));var interaction=require(_0x8df9('0x5'));var config=require(_0x8df9('0x6'));var controller=require(_0x8df9('0x7'));router[_0x8df9('0x8')]('/',auth[_0x8df9('0x9')](),controller[_0x8df9('0xa')]);router['get'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8df9('0xd')]);router['put'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xe')]);router[_0x8df9('0xf')](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0x10')]);module[_0x8df9('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 7a761ec..161ef42 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 _0x7d53=['exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7d53,0x11d));var _0x37d5=function(_0x23d727,_0x472346){_0x23d727=_0x23d727-0x0;var _0x456ef2=_0x7d53[_0x23d727];return _0x456ef2;};'use strict';var Sequelize=require('sequelize');module[_0x37d5('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xb778=['sequelize','exports','TEXT'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb778,0x1c5));var _0x8b77=function(_0x143a91,_0x235332){_0x143a91=_0x143a91-0x0;var _0x1906f5=_0xb778[_0x143a91];return _0x1906f5;};'use strict';var Sequelize=require(_0x8b77('0x0'));module[_0x8b77('0x1')]={'tree':{'type':Sequelize[_0x8b77('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 6d5a2d8..99d4b29 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 _0x5f7b=['apply','reject','save','destroy','then','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','rows','catch','show','params','includeAll','options','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0x5f7b,0xc3));var _0xb5f7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x5f7b[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xb5f7('0x0'));var rimraf=require(_0xb5f7('0x1'));var zipdir=require(_0xb5f7('0x2'));var jsonpatch=require(_0xb5f7('0x3'));var rp=require(_0xb5f7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb5f7('0x5'));var util=require('util');var path=require(_0xb5f7('0x6'));var sox=require(_0xb5f7('0x7'));var csv=require('to-csv');var ejs=require(_0xb5f7('0x8'));var fs=require('fs');var fs_extra=require(_0xb5f7('0x9'));var _=require('lodash');var squel=require(_0xb5f7('0xa'));var crypto=require(_0xb5f7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb5f7('0xc'));var toCsv=require(_0xb5f7('0xd'));var querystring=require(_0xb5f7('0xe'));var Papa=require(_0xb5f7('0xf'));var Redis=require(_0xb5f7('0x10'));var authService=require(_0xb5f7('0x11'));var qs=require(_0xb5f7('0x12'));var as=require(_0xb5f7('0x13'));var hardwareService=require(_0xb5f7('0x14'));var logger=require(_0xb5f7('0x15'))(_0xb5f7('0x16'));var utils=require(_0xb5f7('0x17'));var config=require(_0xb5f7('0x18'));var licenseUtil=require(_0xb5f7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33d67e,_0x11a98f){_0x11a98f=_0x11a98f||0xcc;return function(_0x3a0402){if(_0x3a0402){return _0x33d67e[_0xb5f7('0x1a')](_0x11a98f);}return _0x33d67e[_0xb5f7('0x1b')](_0x11a98f)['end']();};}function respondWithResult(_0x17dcb4,_0x304a25){_0x304a25=_0x304a25||0xc8;return function(_0x2172f4){if(_0x2172f4){return _0x17dcb4[_0xb5f7('0x1b')](_0x304a25)[_0xb5f7('0x1c')](_0x2172f4);}};}function respondWithFilteredResult(_0x251b81,_0x349e2b){return function(_0x3f1d34){if(_0x3f1d34){var _0x2475d8=typeof _0x349e2b[_0xb5f7('0x1d')]===_0xb5f7('0x1e')&&typeof _0x349e2b[_0xb5f7('0x1f')]===_0xb5f7('0x1e');var _0x35bcbb=_0x3f1d34['count'];var _0x3d6329=_0x2475d8?0x0:_0x349e2b[_0xb5f7('0x1d')];var _0x511873=_0x2475d8?_0x3f1d34[_0xb5f7('0x20')]:_0x349e2b['offset']+_0x349e2b[_0xb5f7('0x1f')];var _0x5d7b40;if(_0x511873>=_0x35bcbb){_0x511873=_0x35bcbb;_0x5d7b40=0xc8;}else{_0x5d7b40=0xce;}_0x251b81[_0xb5f7('0x1b')](_0x5d7b40);return _0x251b81['set']('Content-Range',_0x3d6329+'-'+_0x511873+'/'+_0x35bcbb)[_0xb5f7('0x1c')](_0x3f1d34);}return null;};}function patchUpdates(_0x30bc20){return function(_0x207f5f){try{jsonpatch[_0xb5f7('0x21')](_0x207f5f,_0x30bc20,!![]);}catch(_0x21a9f6){return BPromise[_0xb5f7('0x22')](_0x21a9f6);}return _0x207f5f[_0xb5f7('0x23')]();};}function saveUpdates(_0x4aff0b,_0x383faa){return function(_0x51a1f1){if(_0x51a1f1){return _0x51a1f1['update'](_0x4aff0b)['then'](function(_0x43def5){return _0x43def5;});}return null;};}function removeEntity(_0x258ebd,_0x45a626){return function(_0xd65f7e){if(_0xd65f7e){return _0xd65f7e[_0xb5f7('0x24')]()[_0xb5f7('0x25')](function(){_0x258ebd[_0xb5f7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c884,_0x1d448b){return function(_0x5e1b23){if(!_0x5e1b23){_0x45c884[_0xb5f7('0x1a')](0x194);}return _0x5e1b23;};}function handleError(_0x316d7d,_0x44e9b3){_0x44e9b3=_0x44e9b3||0x1f4;return function(_0x6fc367){logger[_0xb5f7('0x26')](_0x6fc367[_0xb5f7('0x27')]);if(_0x6fc367[_0xb5f7('0x28')]){delete _0x6fc367[_0xb5f7('0x28')];}_0x316d7d['status'](_0x44e9b3)[_0xb5f7('0x29')](_0x6fc367);};}exports[_0xb5f7('0x2a')]=function(_0x13b8ea,_0x586a6d){var _0x2752b8={},_0x388a3f={},_0x73e3f={'count':0x0,'rows':[]};var _0x5caf69=_[_0xb5f7('0x2b')](db[_0xb5f7('0x2c')]['rawAttributes'],function(_0x34eefa){return{'name':_0x34eefa[_0xb5f7('0x2d')],'type':_0x34eefa[_0xb5f7('0x2e')][_0xb5f7('0x2f')]};});_0x388a3f[_0xb5f7('0x30')]=_[_0xb5f7('0x2b')](_0x5caf69,_0xb5f7('0x28'));_0x388a3f[_0xb5f7('0x31')]=_[_0xb5f7('0x32')](_0x13b8ea[_0xb5f7('0x31')]);_0x388a3f[_0xb5f7('0x33')]=_[_0xb5f7('0x34')](_0x388a3f['model'],_0x388a3f[_0xb5f7('0x31')]);_0x2752b8[_0xb5f7('0x35')]=_[_0xb5f7('0x34')](_0x388a3f[_0xb5f7('0x30')],qs['fields'](_0x13b8ea[_0xb5f7('0x31')][_0xb5f7('0x36')]));_0x2752b8[_0xb5f7('0x35')]=_0x2752b8[_0xb5f7('0x35')][_0xb5f7('0x37')]?_0x2752b8[_0xb5f7('0x35')]:_0x388a3f[_0xb5f7('0x30')];if(!_0x13b8ea['query'][_0xb5f7('0x38')](_0xb5f7('0x39'))){_0x2752b8[_0xb5f7('0x1f')]=qs['limit'](_0x13b8ea['query'][_0xb5f7('0x1f')]);_0x2752b8[_0xb5f7('0x1d')]=qs[_0xb5f7('0x1d')](_0x13b8ea[_0xb5f7('0x31')]['offset']);}_0x2752b8[_0xb5f7('0x3a')]=qs[_0xb5f7('0x3b')](_0x13b8ea[_0xb5f7('0x31')][_0xb5f7('0x3b')]);_0x2752b8[_0xb5f7('0x3c')]=qs[_0xb5f7('0x33')](_[_0xb5f7('0x3d')](_0x13b8ea[_0xb5f7('0x31')],_0x388a3f[_0xb5f7('0x33')]),_0x5caf69);if(_0x13b8ea[_0xb5f7('0x31')]['filter']){_0x2752b8[_0xb5f7('0x3c')]=_[_0xb5f7('0x3e')](_0x2752b8['where'],{'$or':_[_0xb5f7('0x2b')](_0x5caf69,function(_0x30ef6d){if(_0x30ef6d[_0xb5f7('0x2e')]!==_0xb5f7('0x3f')){var _0x326314={};_0x326314[_0x30ef6d[_0xb5f7('0x28')]]={'$like':'%'+_0x13b8ea[_0xb5f7('0x31')][_0xb5f7('0x40')]+'%'};return _0x326314;}})});}_0x2752b8=_[_0xb5f7('0x3e')]({},_0x2752b8,_0x13b8ea['options']);var _0x41a083={'where':_0x2752b8[_0xb5f7('0x3c')]};return db[_0xb5f7('0x2c')][_0xb5f7('0x20')](_0x41a083)['then'](function(_0x39dc05){_0x73e3f['count']=_0x39dc05;if(_0x13b8ea[_0xb5f7('0x31')]['includeAll']){_0x2752b8[_0xb5f7('0x41')]=[{'all':!![]}];}return db[_0xb5f7('0x2c')]['findAll'](_0x2752b8);})['then'](function(_0x5c3553){_0x73e3f[_0xb5f7('0x42')]=_0x5c3553;return _0x73e3f;})[_0xb5f7('0x25')](respondWithFilteredResult(_0x586a6d,_0x2752b8))[_0xb5f7('0x43')](handleError(_0x586a6d,null));};exports[_0xb5f7('0x44')]=function(_0x5b3dfd,_0x236e47){var _0x5370d3={'raw':!![],'where':{'id':_0x5b3dfd[_0xb5f7('0x45')]['id']}},_0x39856a={};_0x39856a[_0xb5f7('0x30')]=_['keys'](db[_0xb5f7('0x2c')]['rawAttributes']);_0x39856a['query']=_['keys'](_0x5b3dfd[_0xb5f7('0x31')]);_0x39856a[_0xb5f7('0x33')]=_['intersection'](_0x39856a[_0xb5f7('0x30')],_0x39856a[_0xb5f7('0x31')]);_0x5370d3[_0xb5f7('0x35')]=_[_0xb5f7('0x34')](_0x39856a['model'],qs[_0xb5f7('0x36')](_0x5b3dfd[_0xb5f7('0x31')][_0xb5f7('0x36')]));_0x5370d3[_0xb5f7('0x35')]=_0x5370d3[_0xb5f7('0x35')]['length']?_0x5370d3['attributes']:_0x39856a[_0xb5f7('0x30')];if(_0x5b3dfd[_0xb5f7('0x31')][_0xb5f7('0x46')]){_0x5370d3[_0xb5f7('0x41')]=[{'all':!![]}];}_0x5370d3=_[_0xb5f7('0x3e')]({},_0x5370d3,_0x5b3dfd[_0xb5f7('0x47')]);return db[_0xb5f7('0x2c')]['find'](_0x5370d3)[_0xb5f7('0x25')](handleEntityNotFound(_0x236e47,null))[_0xb5f7('0x25')](respondWithResult(_0x236e47,null))[_0xb5f7('0x43')](handleError(_0x236e47,null));};exports[_0xb5f7('0x48')]=function(_0x19a72d,_0x2d4c21){return db[_0xb5f7('0x2c')]['create'](_0x19a72d[_0xb5f7('0x49')],{})[_0xb5f7('0x25')](respondWithResult(_0x2d4c21,0xc9))['catch'](handleError(_0x2d4c21,null));};exports[_0xb5f7('0x4a')]=function(_0x47ff41,_0x5f500b){if(_0x47ff41['body']['id']){delete _0x47ff41[_0xb5f7('0x49')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x47ff41[_0xb5f7('0x45')]['id']}})[_0xb5f7('0x25')](handleEntityNotFound(_0x5f500b,null))[_0xb5f7('0x25')](saveUpdates(_0x47ff41[_0xb5f7('0x49')],null))[_0xb5f7('0x25')](respondWithResult(_0x5f500b,null))[_0xb5f7('0x43')](handleError(_0x5f500b,null));};exports['destroy']=function(_0x29025e,_0x45dc23){return db[_0xb5f7('0x2c')][_0xb5f7('0x4b')]({'where':{'id':_0x29025e[_0xb5f7('0x45')]['id']}})[_0xb5f7('0x25')](handleEntityNotFound(_0x45dc23,null))[_0xb5f7('0x25')](removeEntity(_0x45dc23,null))[_0xb5f7('0x43')](handleError(_0x45dc23,null));};
\ No newline at end of file
+var _0x21ec=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes'];(function(_0x41c4c5,_0x46953c){var _0x3bd4ef=function(_0x2fd690){while(--_0x2fd690){_0x41c4c5['push'](_0x41c4c5['shift']());}};_0x3bd4ef(++_0x46953c);}(_0x21ec,0xb2));var _0xc21e=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x21ec[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc21e('0x0'));var zipdir=require(_0xc21e('0x1'));var jsonpatch=require(_0xc21e('0x2'));var rp=require('request-promise');var moment=require(_0xc21e('0x3'));var BPromise=require(_0xc21e('0x4'));var Mustache=require(_0xc21e('0x5'));var util=require(_0xc21e('0x6'));var path=require(_0xc21e('0x7'));var sox=require(_0xc21e('0x8'));var csv=require(_0xc21e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc21e('0xa'));var _=require(_0xc21e('0xb'));var squel=require(_0xc21e('0xc'));var crypto=require(_0xc21e('0xd'));var jsforce=require(_0xc21e('0xe'));var deskjs=require(_0xc21e('0xf'));var toCsv=require(_0xc21e('0x9'));var querystring=require(_0xc21e('0x10'));var Papa=require('papaparse');var Redis=require(_0xc21e('0x11'));var authService=require(_0xc21e('0x12'));var qs=require(_0xc21e('0x13'));var as=require(_0xc21e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc21e('0x15'))(_0xc21e('0x16'));var utils=require(_0xc21e('0x17'));var config=require(_0xc21e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc21e('0x19'))['db'];function respondWithStatusCode(_0x33eb3f,_0x6af8c9){_0x6af8c9=_0x6af8c9||0xcc;return function(_0x16401c){if(_0x16401c){return _0x33eb3f[_0xc21e('0x1a')](_0x6af8c9);}return _0x33eb3f['status'](_0x6af8c9)[_0xc21e('0x1b')]();};}function respondWithResult(_0xc3f443,_0x18213b){_0x18213b=_0x18213b||0xc8;return function(_0x3f234a){if(_0x3f234a){return _0xc3f443[_0xc21e('0x1c')](_0x18213b)['json'](_0x3f234a);}};}function respondWithFilteredResult(_0xfaddb2,_0x4fbed5){return function(_0xefd430){if(_0xefd430){var _0x4da0eb=typeof _0x4fbed5[_0xc21e('0x1d')]===_0xc21e('0x1e')&&typeof _0x4fbed5[_0xc21e('0x1f')]===_0xc21e('0x1e');var _0x59d5c7=_0xefd430['count'];var _0xd092df=_0x4da0eb?0x0:_0x4fbed5[_0xc21e('0x1d')];var _0x3a51aa=_0x4da0eb?_0xefd430[_0xc21e('0x20')]:_0x4fbed5['offset']+_0x4fbed5[_0xc21e('0x1f')];var _0x39249b;if(_0x3a51aa>=_0x59d5c7){_0x3a51aa=_0x59d5c7;_0x39249b=0xc8;}else{_0x39249b=0xce;}_0xfaddb2['status'](_0x39249b);return _0xfaddb2[_0xc21e('0x21')](_0xc21e('0x22'),_0xd092df+'-'+_0x3a51aa+'/'+_0x59d5c7)['json'](_0xefd430);}return null;};}function patchUpdates(_0x229102){return function(_0x14cd3f){try{jsonpatch[_0xc21e('0x23')](_0x14cd3f,_0x229102,!![]);}catch(_0x554534){return BPromise[_0xc21e('0x24')](_0x554534);}return _0x14cd3f[_0xc21e('0x25')]();};}function saveUpdates(_0xe0c810,_0x3c44bc){return function(_0x4af573){if(_0x4af573){return _0x4af573['update'](_0xe0c810)[_0xc21e('0x26')](function(_0x108f40){return _0x108f40;});}return null;};}function removeEntity(_0x1d675d,_0x4dec2d){return function(_0x828324){if(_0x828324){return _0x828324[_0xc21e('0x27')]()['then'](function(){_0x1d675d[_0xc21e('0x1c')](0xcc)[_0xc21e('0x1b')]();});}};}function handleEntityNotFound(_0x12cddf,_0x385ce3){return function(_0x178400){if(!_0x178400){_0x12cddf[_0xc21e('0x1a')](0x194);}return _0x178400;};}function handleError(_0x273bfe,_0x4416e4){_0x4416e4=_0x4416e4||0x1f4;return function(_0x2ff2c8){logger[_0xc21e('0x28')](_0x2ff2c8[_0xc21e('0x29')]);if(_0x2ff2c8[_0xc21e('0x2a')]){delete _0x2ff2c8[_0xc21e('0x2a')];}_0x273bfe[_0xc21e('0x1c')](_0x4416e4)[_0xc21e('0x2b')](_0x2ff2c8);};}exports[_0xc21e('0x2c')]=function(_0x97f908,_0x123752){var _0x500443={},_0x30ec49={},_0x19efe3={'count':0x0,'rows':[]};var _0x48a812=_[_0xc21e('0x2d')](db[_0xc21e('0x2e')][_0xc21e('0x2f')],function(_0x81650b){return{'name':_0x81650b[_0xc21e('0x30')],'type':_0x81650b['type'][_0xc21e('0x31')]};});_0x30ec49['model']=_[_0xc21e('0x2d')](_0x48a812,_0xc21e('0x2a'));_0x30ec49[_0xc21e('0x32')]=_[_0xc21e('0x33')](_0x97f908[_0xc21e('0x32')]);_0x30ec49[_0xc21e('0x34')]=_[_0xc21e('0x35')](_0x30ec49[_0xc21e('0x36')],_0x30ec49[_0xc21e('0x32')]);_0x500443[_0xc21e('0x37')]=_[_0xc21e('0x35')](_0x30ec49[_0xc21e('0x36')],qs['fields'](_0x97f908[_0xc21e('0x32')][_0xc21e('0x38')]));_0x500443[_0xc21e('0x37')]=_0x500443[_0xc21e('0x37')][_0xc21e('0x39')]?_0x500443[_0xc21e('0x37')]:_0x30ec49['model'];if(!_0x97f908[_0xc21e('0x32')][_0xc21e('0x3a')](_0xc21e('0x3b'))){_0x500443[_0xc21e('0x1f')]=qs[_0xc21e('0x1f')](_0x97f908[_0xc21e('0x32')][_0xc21e('0x1f')]);_0x500443[_0xc21e('0x1d')]=qs[_0xc21e('0x1d')](_0x97f908[_0xc21e('0x32')]['offset']);}_0x500443[_0xc21e('0x3c')]=qs['sort'](_0x97f908[_0xc21e('0x32')][_0xc21e('0x3d')]);_0x500443[_0xc21e('0x3e')]=qs['filters'](_[_0xc21e('0x3f')](_0x97f908[_0xc21e('0x32')],_0x30ec49[_0xc21e('0x34')]),_0x48a812);if(_0x97f908[_0xc21e('0x32')][_0xc21e('0x40')]){_0x500443[_0xc21e('0x3e')]=_[_0xc21e('0x41')](_0x500443[_0xc21e('0x3e')],{'$or':_[_0xc21e('0x2d')](_0x48a812,function(_0x9f6baf){if(_0x9f6baf[_0xc21e('0x42')]!==_0xc21e('0x43')){var _0x4cecfe={};_0x4cecfe[_0x9f6baf[_0xc21e('0x2a')]]={'$like':'%'+_0x97f908['query'][_0xc21e('0x40')]+'%'};return _0x4cecfe;}})});}_0x500443=_[_0xc21e('0x41')]({},_0x500443,_0x97f908[_0xc21e('0x44')]);var _0x57a598={'where':_0x500443[_0xc21e('0x3e')]};return db[_0xc21e('0x2e')]['count'](_0x57a598)['then'](function(_0x51c204){_0x19efe3[_0xc21e('0x20')]=_0x51c204;if(_0x97f908[_0xc21e('0x32')][_0xc21e('0x45')]){_0x500443[_0xc21e('0x46')]=[{'all':!![]}];}return db[_0xc21e('0x2e')]['findAll'](_0x500443);})[_0xc21e('0x26')](function(_0x3f07af){_0x19efe3[_0xc21e('0x47')]=_0x3f07af;return _0x19efe3;})['then'](respondWithFilteredResult(_0x123752,_0x500443))[_0xc21e('0x48')](handleError(_0x123752,null));};exports[_0xc21e('0x49')]=function(_0x52f509,_0x3f8daa){var _0x2a5581={'raw':!![],'where':{'id':_0x52f509[_0xc21e('0x4a')]['id']}},_0x275500={};_0x275500['model']=_['keys'](db['AnalyticTreeReport'][_0xc21e('0x2f')]);_0x275500[_0xc21e('0x32')]=_[_0xc21e('0x33')](_0x52f509[_0xc21e('0x32')]);_0x275500[_0xc21e('0x34')]=_[_0xc21e('0x35')](_0x275500[_0xc21e('0x36')],_0x275500[_0xc21e('0x32')]);_0x2a5581['attributes']=_[_0xc21e('0x35')](_0x275500['model'],qs[_0xc21e('0x38')](_0x52f509['query'][_0xc21e('0x38')]));_0x2a5581['attributes']=_0x2a5581[_0xc21e('0x37')][_0xc21e('0x39')]?_0x2a5581[_0xc21e('0x37')]:_0x275500[_0xc21e('0x36')];if(_0x52f509[_0xc21e('0x32')][_0xc21e('0x45')]){_0x2a5581[_0xc21e('0x46')]=[{'all':!![]}];}_0x2a5581=_[_0xc21e('0x41')]({},_0x2a5581,_0x52f509['options']);return db[_0xc21e('0x2e')][_0xc21e('0x4b')](_0x2a5581)[_0xc21e('0x26')](handleEntityNotFound(_0x3f8daa,null))[_0xc21e('0x26')](respondWithResult(_0x3f8daa,null))['catch'](handleError(_0x3f8daa,null));};exports[_0xc21e('0x4c')]=function(_0x507ee9,_0x3a59ad){return db['AnalyticTreeReport'][_0xc21e('0x4c')](_0x507ee9['body'],{})[_0xc21e('0x26')](respondWithResult(_0x3a59ad,0xc9))[_0xc21e('0x48')](handleError(_0x3a59ad,null));};exports['update']=function(_0x1c4707,_0x29fac4){if(_0x1c4707['body']['id']){delete _0x1c4707[_0xc21e('0x4d')]['id'];}return db[_0xc21e('0x2e')]['find']({'where':{'id':_0x1c4707[_0xc21e('0x4a')]['id']}})[_0xc21e('0x26')](handleEntityNotFound(_0x29fac4,null))['then'](saveUpdates(_0x1c4707['body'],null))[_0xc21e('0x26')](respondWithResult(_0x29fac4,null))[_0xc21e('0x48')](handleError(_0x29fac4,null));};exports['destroy']=function(_0x5dafce,_0x32a6c8){return db['AnalyticTreeReport'][_0xc21e('0x4b')]({'where':{'id':_0x5dafce['params']['id']}})[_0xc21e('0x26')](handleEntityNotFound(_0x32a6c8,null))[_0xc21e('0x26')](removeEntity(_0x32a6c8,null))[_0xc21e('0x48')](handleError(_0x32a6c8,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 8cc0846..a9f9b12 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 _0x64ee=['../../config/environment','exports','define','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0x64ee,0x1f4));var _0xe64e=function(_0x578120,_0x595de5){_0x578120=_0x578120-0x0;var _0xf1fd0c=_0x64ee[_0x578120];return _0xf1fd0c;};'use strict';var _=require('lodash');var util=require(_0xe64e('0x0'));var logger=require(_0xe64e('0x1'))(_0xe64e('0x2'));var moment=require('moment');var BPromise=require(_0xe64e('0x3'));var rp=require(_0xe64e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe64e('0x5'));var config=require(_0xe64e('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xe64e('0x7')]=function(_0x761852,_0x425f09){return _0x761852[_0xe64e('0x8')](_0xe64e('0x9'),attributes,{'tableName':_0xe64e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2e2=['request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','lodash','util','../../config/logger','api','bluebird'];(function(_0x62ee48,_0x383ffc){var _0x39df44=function(_0x337e10){while(--_0x337e10){_0x62ee48['push'](_0x62ee48['shift']());}};_0x39df44(++_0x383ffc);}(_0xe2e2,0x17b));var _0x2e2e=function(_0x199c55,_0x167d19){_0x199c55=_0x199c55-0x0;var _0x592b02=_0xe2e2[_0x199c55];return _0x592b02;};'use strict';var _=require(_0x2e2e('0x0'));var util=require(_0x2e2e('0x1'));var logger=require(_0x2e2e('0x2'))(_0x2e2e('0x3'));var moment=require('moment');var BPromise=require(_0x2e2e('0x4'));var rp=require(_0x2e2e('0x5'));var fs=require('fs');var path=require(_0x2e2e('0x6'));var rimraf=require(_0x2e2e('0x7'));var config=require(_0x2e2e('0x8'));var attributes=require(_0x2e2e('0x9'));module[_0x2e2e('0xa')]=function(_0x2b76ad,_0x43d5f4){return _0x2b76ad['define']('AnalyticTreeReport',attributes,{'tableName':_0x2e2e('0xb'),'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 5118afd..47942dc 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x387b9d,_0x3c769c){var _0x23a678=function(_0x1e324a){while(--_0x1e324a){_0x387b9d['push'](_0x387b9d['shift']());}};_0x23a678(++_0x3c769c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0xadb5,0xad));var _0x5adb=function(_0x39f212,_0x26826d){_0x39f212=_0x39f212-0x0;var _0x57fd33=_0xadb5[_0x39f212];return _0x57fd33;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 4ea1d14..e5163c4 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 _0xe171=['update','delete','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','post','create','put'];(function(_0x4d341f,_0x744847){var _0x53a0b4=function(_0x4b9108){while(--_0x4b9108){_0x4d341f['push'](_0x4d341f['shift']());}};_0x53a0b4(++_0x744847);}(_0xe171,0x1f3));var _0x1e17=function(_0x73034e,_0x17389c){_0x73034e=_0x73034e-0x0;var _0x2bbbae=_0xe171[_0x73034e];return _0x2bbbae;};'use strict';var multer=require('multer');var util=require(_0x1e17('0x0'));var path=require(_0x1e17('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1e17('0x2')]();var fs_extra=require(_0x1e17('0x3'));var auth=require(_0x1e17('0x4'));var interaction=require(_0x1e17('0x5'));var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x1e17('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e17('0x6')](_0x1e17('0x7'),auth[_0x1e17('0x8')](),controller[_0x1e17('0x9')]);router[_0x1e17('0xa')]('/',auth[_0x1e17('0x8')](),controller[_0x1e17('0xb')]);router[_0x1e17('0xc')](_0x1e17('0x7'),auth[_0x1e17('0x8')](),controller[_0x1e17('0xd')]);router[_0x1e17('0xe')](_0x1e17('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x1e17('0xf')]=router;
\ No newline at end of file
+var _0x1d6d=['/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x290f7a,_0x45e5a6){var _0x8292c4=function(_0xb7d9f4){while(--_0xb7d9f4){_0x290f7a['push'](_0x290f7a['shift']());}};_0x8292c4(++_0x45e5a6);}(_0x1d6d,0xf8));var _0xd1d6=function(_0x7910d0,_0x171616){_0x7910d0=_0x7910d0-0x0;var _0x50c58b=_0x1d6d[_0x7910d0];return _0x50c58b;};'use strict';var multer=require(_0xd1d6('0x0'));var util=require(_0xd1d6('0x1'));var path=require('path');var timeout=require(_0xd1d6('0x2'));var express=require(_0xd1d6('0x3'));var router=express['Router']();var fs_extra=require(_0xd1d6('0x4'));var auth=require(_0xd1d6('0x5'));var interaction=require(_0xd1d6('0x6'));var config=require(_0xd1d6('0x7'));var controller=require(_0xd1d6('0x8'));router[_0xd1d6('0x9')]('/',auth[_0xd1d6('0xa')](),controller[_0xd1d6('0xb')]);router[_0xd1d6('0x9')](_0xd1d6('0xc'),auth['isAuthenticated'](),controller[_0xd1d6('0xd')]);router[_0xd1d6('0xe')]('/',auth['isAuthenticated'](),controller[_0xd1d6('0xf')]);router['put'](_0xd1d6('0xc'),auth[_0xd1d6('0xa')](),controller[_0xd1d6('0x10')]);router[_0xd1d6('0x11')](_0xd1d6('0xc'),auth[_0xd1d6('0xa')](),controller[_0xd1d6('0x12')]);module[_0xd1d6('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 4d94c51..22acda8 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 _0x0851=['sequelize','exports','STRING'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0x0851,0x8a));var _0x1085=function(_0x3f140c,_0x1e74ea){_0x3f140c=_0x3f140c-0x0;var _0xa7d076=_0x0851[_0x3f140c];return _0xa7d076;};'use strict';var Sequelize=require(_0x1085('0x0'));module[_0x1085('0x1')]={'name':{'type':Sequelize[_0x1085('0x2')]},'basename':{'type':Sequelize[_0x1085('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8743=['exports','STRING','sequelize'];(function(_0x4ba3c4,_0x24842d){var _0x2b6605=function(_0xc2698f){while(--_0xc2698f){_0x4ba3c4['push'](_0x4ba3c4['shift']());}};_0x2b6605(++_0x24842d);}(_0x8743,0x7a));var _0x3874=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8743[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0x3874('0x0'));module[_0x3874('0x1')]={'name':{'type':Sequelize[_0x3874('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3874('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index a147f2c..a092102 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 _0xa0d3=['createdAt','updatedAt','body','create','file','mimetype','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','Attachment','findAll','rows','catch','show','params','options','find','clone','get','omit'];(function(_0x5a7f52,_0x2e604d){var _0x188f90=function(_0x4882fe){while(--_0x4882fe){_0x5a7f52['push'](_0x5a7f52['shift']());}};_0x188f90(++_0x2e604d);}(_0xa0d3,0xb8));var _0x3a0d=function(_0x2726ad,_0x5073b1){_0x2726ad=_0x2726ad-0x0;var _0xd87993=_0xa0d3[_0x2726ad];return _0xd87993;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a0d('0x0'));var zipdir=require(_0x3a0d('0x1'));var jsonpatch=require(_0x3a0d('0x2'));var rp=require(_0x3a0d('0x3'));var moment=require('moment');var BPromise=require(_0x3a0d('0x4'));var Mustache=require(_0x3a0d('0x5'));var util=require(_0x3a0d('0x6'));var path=require('path');var sox=require(_0x3a0d('0x7'));var csv=require(_0x3a0d('0x8'));var ejs=require(_0x3a0d('0x9'));var fs=require('fs');var fs_extra=require(_0x3a0d('0xa'));var _=require(_0x3a0d('0xb'));var squel=require('squel');var crypto=require(_0x3a0d('0xc'));var jsforce=require(_0x3a0d('0xd'));var deskjs=require(_0x3a0d('0xe'));var toCsv=require(_0x3a0d('0x8'));var querystring=require(_0x3a0d('0xf'));var Papa=require(_0x3a0d('0x10'));var Redis=require(_0x3a0d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a0d('0x12'));var hardwareService=require(_0x3a0d('0x13'));var logger=require(_0x3a0d('0x14'))(_0x3a0d('0x15'));var utils=require(_0x3a0d('0x16'));var config=require(_0x3a0d('0x17'));var licenseUtil=require(_0x3a0d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4171a0,_0x17a7f6){_0x17a7f6=_0x17a7f6||0xcc;return function(_0x4c5b3f){if(_0x4c5b3f){return _0x4171a0['sendStatus'](_0x17a7f6);}return _0x4171a0[_0x3a0d('0x19')](_0x17a7f6)[_0x3a0d('0x1a')]();};}function respondWithResult(_0x145431,_0x527d49){_0x527d49=_0x527d49||0xc8;return function(_0x190208){if(_0x190208){return _0x145431['status'](_0x527d49)[_0x3a0d('0x1b')](_0x190208);}};}function respondWithFilteredResult(_0x326fe2,_0x30111c){return function(_0x27c327){if(_0x27c327){var _0x14c9a=typeof _0x30111c['offset']===_0x3a0d('0x1c')&&typeof _0x30111c['limit']==='undefined';var _0x3fb59d=_0x27c327[_0x3a0d('0x1d')];var _0x50a10c=_0x14c9a?0x0:_0x30111c[_0x3a0d('0x1e')];var _0xffab65=_0x14c9a?_0x27c327[_0x3a0d('0x1d')]:_0x30111c[_0x3a0d('0x1e')]+_0x30111c[_0x3a0d('0x1f')];var _0x25f8ee;if(_0xffab65>=_0x3fb59d){_0xffab65=_0x3fb59d;_0x25f8ee=0xc8;}else{_0x25f8ee=0xce;}_0x326fe2[_0x3a0d('0x19')](_0x25f8ee);return _0x326fe2['set'](_0x3a0d('0x20'),_0x50a10c+'-'+_0xffab65+'/'+_0x3fb59d)[_0x3a0d('0x1b')](_0x27c327);}return null;};}function patchUpdates(_0x4b5a99){return function(_0x2195ee){try{jsonpatch[_0x3a0d('0x21')](_0x2195ee,_0x4b5a99,!![]);}catch(_0x371def){return BPromise[_0x3a0d('0x22')](_0x371def);}return _0x2195ee['save']();};}function saveUpdates(_0x2029c1,_0x4a79d5){return function(_0x44cbe2){if(_0x44cbe2){return _0x44cbe2[_0x3a0d('0x23')](_0x2029c1)[_0x3a0d('0x24')](function(_0x584b37){return _0x584b37;});}return null;};}function removeEntity(_0x3577be,_0x49bcca){return function(_0x24d5c5){if(_0x24d5c5){return _0x24d5c5[_0x3a0d('0x25')]()['then'](function(){_0x3577be['status'](0xcc)[_0x3a0d('0x1a')]();});}};}function handleEntityNotFound(_0x45fb90,_0x38aafb){return function(_0x1f2c2d){if(!_0x1f2c2d){_0x45fb90[_0x3a0d('0x26')](0x194);}return _0x1f2c2d;};}function handleError(_0x17dc45,_0x5c5f95){_0x5c5f95=_0x5c5f95||0x1f4;return function(_0x55d5c1){logger[_0x3a0d('0x27')](_0x55d5c1[_0x3a0d('0x28')]);if(_0x55d5c1[_0x3a0d('0x29')]){delete _0x55d5c1['name'];}_0x17dc45[_0x3a0d('0x19')](_0x5c5f95)[_0x3a0d('0x2a')](_0x55d5c1);};}exports[_0x3a0d('0x2b')]=function(_0x355708,_0x997adb){var _0x286b38={},_0xb72a19={},_0x5b272d={'count':0x0,'rows':[]};var _0x4e8358=_[_0x3a0d('0x2c')](db['Attachment'][_0x3a0d('0x2d')],function(_0x2d27d1){return{'name':_0x2d27d1[_0x3a0d('0x2e')],'type':_0x2d27d1[_0x3a0d('0x2f')][_0x3a0d('0x30')]};});_0xb72a19[_0x3a0d('0x31')]=_[_0x3a0d('0x2c')](_0x4e8358,_0x3a0d('0x29'));_0xb72a19['query']=_[_0x3a0d('0x32')](_0x355708['query']);_0xb72a19[_0x3a0d('0x33')]=_[_0x3a0d('0x34')](_0xb72a19[_0x3a0d('0x31')],_0xb72a19[_0x3a0d('0x35')]);_0x286b38[_0x3a0d('0x36')]=_[_0x3a0d('0x34')](_0xb72a19[_0x3a0d('0x31')],qs['fields'](_0x355708[_0x3a0d('0x35')][_0x3a0d('0x37')]));_0x286b38[_0x3a0d('0x36')]=_0x286b38[_0x3a0d('0x36')][_0x3a0d('0x38')]?_0x286b38[_0x3a0d('0x36')]:_0xb72a19['model'];if(!_0x355708['query'][_0x3a0d('0x39')]('nolimit')){_0x286b38[_0x3a0d('0x1f')]=qs[_0x3a0d('0x1f')](_0x355708[_0x3a0d('0x35')][_0x3a0d('0x1f')]);_0x286b38[_0x3a0d('0x1e')]=qs[_0x3a0d('0x1e')](_0x355708[_0x3a0d('0x35')][_0x3a0d('0x1e')]);}_0x286b38['order']=qs['sort'](_0x355708[_0x3a0d('0x35')][_0x3a0d('0x3a')]);_0x286b38[_0x3a0d('0x3b')]=qs[_0x3a0d('0x33')](_[_0x3a0d('0x3c')](_0x355708[_0x3a0d('0x35')],_0xb72a19[_0x3a0d('0x33')]),_0x4e8358);if(_0x355708[_0x3a0d('0x35')][_0x3a0d('0x3d')]){_0x286b38['where']=_['merge'](_0x286b38[_0x3a0d('0x3b')],{'$or':_[_0x3a0d('0x2c')](_0x4e8358,function(_0x1c3061){if(_0x1c3061[_0x3a0d('0x2f')]!==_0x3a0d('0x3e')){var _0x131d1d={};_0x131d1d[_0x1c3061[_0x3a0d('0x29')]]={'$like':'%'+_0x355708[_0x3a0d('0x35')]['filter']+'%'};return _0x131d1d;}})});}_0x286b38=_[_0x3a0d('0x3f')]({},_0x286b38,_0x355708['options']);var _0x25bb6b={'where':_0x286b38[_0x3a0d('0x3b')]};return db['Attachment']['count'](_0x25bb6b)[_0x3a0d('0x24')](function(_0x24caec){_0x5b272d['count']=_0x24caec;if(_0x355708[_0x3a0d('0x35')][_0x3a0d('0x40')]){_0x286b38[_0x3a0d('0x41')]=[{'all':!![]}];}return db[_0x3a0d('0x42')][_0x3a0d('0x43')](_0x286b38);})[_0x3a0d('0x24')](function(_0x4b9577){_0x5b272d[_0x3a0d('0x44')]=_0x4b9577;return _0x5b272d;})[_0x3a0d('0x24')](respondWithFilteredResult(_0x997adb,_0x286b38))[_0x3a0d('0x45')](handleError(_0x997adb,null));};exports[_0x3a0d('0x46')]=function(_0x4490c0,_0x1b0026){var _0x2a8857={'raw':!![],'where':{'id':_0x4490c0[_0x3a0d('0x47')]['id']}},_0x48893b={};_0x48893b[_0x3a0d('0x31')]=_['keys'](db[_0x3a0d('0x42')][_0x3a0d('0x2d')]);_0x48893b[_0x3a0d('0x35')]=_[_0x3a0d('0x32')](_0x4490c0[_0x3a0d('0x35')]);_0x48893b[_0x3a0d('0x33')]=_['intersection'](_0x48893b[_0x3a0d('0x31')],_0x48893b[_0x3a0d('0x35')]);_0x2a8857[_0x3a0d('0x36')]=_[_0x3a0d('0x34')](_0x48893b[_0x3a0d('0x31')],qs[_0x3a0d('0x37')](_0x4490c0[_0x3a0d('0x35')][_0x3a0d('0x37')]));_0x2a8857['attributes']=_0x2a8857[_0x3a0d('0x36')][_0x3a0d('0x38')]?_0x2a8857['attributes']:_0x48893b['model'];if(_0x4490c0[_0x3a0d('0x35')][_0x3a0d('0x40')]){_0x2a8857['include']=[{'all':!![]}];}_0x2a8857=_[_0x3a0d('0x3f')]({},_0x2a8857,_0x4490c0[_0x3a0d('0x48')]);return db[_0x3a0d('0x42')][_0x3a0d('0x49')](_0x2a8857)['then'](handleEntityNotFound(_0x1b0026,null))['then'](respondWithResult(_0x1b0026,null))[_0x3a0d('0x45')](handleError(_0x1b0026,null));};exports[_0x3a0d('0x4a')]=function(_0x502bba,_0x56893d){var _0x130742={'where':{'id':_0x502bba[_0x3a0d('0x47')]['id']}},_0xa5cbf4={};_0xa5cbf4[_0x3a0d('0x31')]=_['keys'](db[_0x3a0d('0x42')][_0x3a0d('0x2d')]);_0x130742[_0x3a0d('0x36')]=_[_0x3a0d('0x34')](_0xa5cbf4[_0x3a0d('0x31')],qs[_0x3a0d('0x37')](_0x502bba[_0x3a0d('0x35')][_0x3a0d('0x37')]));_0x130742[_0x3a0d('0x36')]=_0x130742[_0x3a0d('0x36')][_0x3a0d('0x38')]?_0x130742['attributes']:_0xa5cbf4['model'];if(_0x502bba[_0x3a0d('0x35')][_0x3a0d('0x40')]){_0x130742[_0x3a0d('0x41')]=[{'all':!![]}];}_0x130742=_[_0x3a0d('0x3f')]({},_0x130742,_0x502bba[_0x3a0d('0x48')]);return db[_0x3a0d('0x42')][_0x3a0d('0x49')](_0x130742)[_0x3a0d('0x24')](handleEntityNotFound(_0x56893d,null))[_0x3a0d('0x24')](function(_0x1eb919){if(_0x1eb919){var _0x51c566=_0x1eb919[_0x3a0d('0x4b')]({'plain':!![]});_0x51c566=qs[_0x3a0d('0x4c')](_0x51c566,['id',_0x3a0d('0x4d'),_0x3a0d('0x4e')]);_0x502bba[_0x3a0d('0x4f')]=_[_0x3a0d('0x4c')](_0x502bba[_0x3a0d('0x4f')],['id','createdAt',_0x3a0d('0x4e')]);return db['Attachment']['create'](_[_0x3a0d('0x3f')](_0x51c566,_0x502bba[_0x3a0d('0x4f')]),{'include':_0x502bba[_0x3a0d('0x35')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x3a0d('0x24')](respondWithResult(_0x56893d,0xc9))['catch'](handleError(_0x56893d,null));};exports['update']=function(_0x24a76a,_0x5dfcf3){if(_0x24a76a[_0x3a0d('0x4f')]['id']){delete _0x24a76a[_0x3a0d('0x4f')]['id'];}return db['Attachment'][_0x3a0d('0x49')]({'where':{'id':_0x24a76a[_0x3a0d('0x47')]['id']}})[_0x3a0d('0x24')](handleEntityNotFound(_0x5dfcf3,null))[_0x3a0d('0x24')](saveUpdates(_0x24a76a[_0x3a0d('0x4f')],null))[_0x3a0d('0x24')](respondWithResult(_0x5dfcf3,null))[_0x3a0d('0x45')](handleError(_0x5dfcf3,null));};exports[_0x3a0d('0x25')]=function(_0x32bb39,_0x3f30c2){return db[_0x3a0d('0x42')][_0x3a0d('0x49')]({'where':{'id':_0x32bb39[_0x3a0d('0x47')]['id']}})[_0x3a0d('0x24')](handleEntityNotFound(_0x3f30c2,null))[_0x3a0d('0x24')](removeEntity(_0x3f30c2,null))['catch'](handleError(_0x3f30c2,null));};exports[_0x3a0d('0x50')]=function(_0x38f628,_0x302838,_0x19f59b){_0x38f628[_0x3a0d('0x4f')][_0x3a0d('0x29')]=_0x38f628[_0x3a0d('0x51')]['originalname'];_0x38f628['body']['basename']=_0x38f628[_0x3a0d('0x51')]['filename'];_0x38f628[_0x3a0d('0x4f')][_0x3a0d('0x2f')]=_0x38f628[_0x3a0d('0x51')][_0x3a0d('0x52')];return db[_0x3a0d('0x42')][_0x3a0d('0x50')](_0x38f628['body'])[_0x3a0d('0x24')](respondWithResult(_0x302838,0xc9))[_0x3a0d('0x45')](handleError(_0x302838,null));};exports['download']=function(_0x5b50e6,_0x2b97f6,_0x301a4e){return db[_0x3a0d('0x42')]['findOne']({'where':{'id':_0x5b50e6[_0x3a0d('0x47')]['id']},'raw':!![]})[_0x3a0d('0x24')](handleEntityNotFound(_0x2b97f6,null))[_0x3a0d('0x24')](function(_0x445659){if(_0x445659){var _0x1d2e77=_0x445659[_0x3a0d('0x53')]!==null;var _0x379132=path[_0x3a0d('0x54')](config['root'],_0x3a0d('0x55'));if(_0x1d2e77){_0x379132=path[_0x3a0d('0x54')](_0x379132,_0x3a0d('0x56'));}var _0xdad1f8=path[_0x3a0d('0x54')](_0x379132,_0x445659['basename']);return _0x2b97f6['download'](_0xdad1f8);}})[_0x3a0d('0x45')](handleError(_0x2b97f6,null));};
\ No newline at end of file
+var _0x9512=['where','merge','filter','includeAll','include','findAll','rows','catch','length','options','find','clone','params','get','omit','updatedAt','body','createdAt','update','file','originalname','basename','create','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','end','error','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort'];(function(_0x52740f,_0x343961){var _0x1cbe11=function(_0x376976){while(--_0x376976){_0x52740f['push'](_0x52740f['shift']());}};_0x1cbe11(++_0x343961);}(_0x9512,0x10c));var _0x2951=function(_0x36f2b2,_0x4dea08){_0x36f2b2=_0x36f2b2-0x0;var _0x4a0f99=_0x9512[_0x36f2b2];return _0x4a0f99;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2951('0x0'));var zipdir=require(_0x2951('0x1'));var jsonpatch=require(_0x2951('0x2'));var rp=require(_0x2951('0x3'));var moment=require(_0x2951('0x4'));var BPromise=require(_0x2951('0x5'));var Mustache=require('mustache');var util=require(_0x2951('0x6'));var path=require(_0x2951('0x7'));var sox=require('sox');var csv=require(_0x2951('0x8'));var ejs=require(_0x2951('0x9'));var fs=require('fs');var fs_extra=require(_0x2951('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2951('0xb'));var deskjs=require(_0x2951('0xc'));var toCsv=require(_0x2951('0x8'));var querystring=require(_0x2951('0xd'));var Papa=require(_0x2951('0xe'));var Redis=require('ioredis');var authService=require(_0x2951('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2951('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2951('0x11'));var utils=require(_0x2951('0x12'));var config=require(_0x2951('0x13'));var licenseUtil=require(_0x2951('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5817fc,_0x49789f){_0x49789f=_0x49789f||0xcc;return function(_0x5b6ad4){if(_0x5b6ad4){return _0x5817fc[_0x2951('0x15')](_0x49789f);}return _0x5817fc[_0x2951('0x16')](_0x49789f)['end']();};}function respondWithResult(_0x4dd42b,_0x223a4d){_0x223a4d=_0x223a4d||0xc8;return function(_0x5b8789){if(_0x5b8789){return _0x4dd42b[_0x2951('0x16')](_0x223a4d)['json'](_0x5b8789);}};}function respondWithFilteredResult(_0x4c25cf,_0x2afc1e){return function(_0xae8f20){if(_0xae8f20){var _0x19d85f=typeof _0x2afc1e[_0x2951('0x17')]===_0x2951('0x18')&&typeof _0x2afc1e['limit']===_0x2951('0x18');var _0x9f560d=_0xae8f20[_0x2951('0x19')];var _0x13141a=_0x19d85f?0x0:_0x2afc1e[_0x2951('0x17')];var _0x575da8=_0x19d85f?_0xae8f20[_0x2951('0x19')]:_0x2afc1e[_0x2951('0x17')]+_0x2afc1e[_0x2951('0x1a')];var _0x152ade;if(_0x575da8>=_0x9f560d){_0x575da8=_0x9f560d;_0x152ade=0xc8;}else{_0x152ade=0xce;}_0x4c25cf[_0x2951('0x16')](_0x152ade);return _0x4c25cf[_0x2951('0x1b')](_0x2951('0x1c'),_0x13141a+'-'+_0x575da8+'/'+_0x9f560d)['json'](_0xae8f20);}return null;};}function patchUpdates(_0x4efadd){return function(_0x21f03c){try{jsonpatch[_0x2951('0x1d')](_0x21f03c,_0x4efadd,!![]);}catch(_0xafa8b9){return BPromise['reject'](_0xafa8b9);}return _0x21f03c[_0x2951('0x1e')]();};}function saveUpdates(_0x215e15,_0x2973e8){return function(_0x1e7234){if(_0x1e7234){return _0x1e7234['update'](_0x215e15)[_0x2951('0x1f')](function(_0x3e5e3d){return _0x3e5e3d;});}return null;};}function removeEntity(_0x491411,_0x4e4936){return function(_0x794f5){if(_0x794f5){return _0x794f5[_0x2951('0x20')]()[_0x2951('0x1f')](function(){_0x491411[_0x2951('0x16')](0xcc)[_0x2951('0x21')]();});}};}function handleEntityNotFound(_0x2acf63,_0x3af701){return function(_0x5c4987){if(!_0x5c4987){_0x2acf63[_0x2951('0x15')](0x194);}return _0x5c4987;};}function handleError(_0x10fefd,_0x5204f3){_0x5204f3=_0x5204f3||0x1f4;return function(_0x55e129){logger[_0x2951('0x22')](_0x55e129['stack']);if(_0x55e129[_0x2951('0x23')]){delete _0x55e129[_0x2951('0x23')];}_0x10fefd['status'](_0x5204f3)['send'](_0x55e129);};}exports[_0x2951('0x24')]=function(_0x3f2e74,_0x124c8b){var _0x3f936e={},_0x258be7={},_0x30fd2a={'count':0x0,'rows':[]};var _0x12c2f9=_['map'](db[_0x2951('0x25')][_0x2951('0x26')],function(_0x469270){return{'name':_0x469270[_0x2951('0x27')],'type':_0x469270[_0x2951('0x28')][_0x2951('0x29')]};});_0x258be7[_0x2951('0x2a')]=_[_0x2951('0x2b')](_0x12c2f9,'name');_0x258be7['query']=_[_0x2951('0x2c')](_0x3f2e74[_0x2951('0x2d')]);_0x258be7[_0x2951('0x2e')]=_[_0x2951('0x2f')](_0x258be7[_0x2951('0x2a')],_0x258be7[_0x2951('0x2d')]);_0x3f936e[_0x2951('0x30')]=_[_0x2951('0x2f')](_0x258be7['model'],qs[_0x2951('0x31')](_0x3f2e74[_0x2951('0x2d')][_0x2951('0x31')]));_0x3f936e[_0x2951('0x30')]=_0x3f936e[_0x2951('0x30')]['length']?_0x3f936e[_0x2951('0x30')]:_0x258be7['model'];if(!_0x3f2e74['query'][_0x2951('0x32')]('nolimit')){_0x3f936e[_0x2951('0x1a')]=qs[_0x2951('0x1a')](_0x3f2e74[_0x2951('0x2d')]['limit']);_0x3f936e[_0x2951('0x17')]=qs['offset'](_0x3f2e74[_0x2951('0x2d')]['offset']);}_0x3f936e['order']=qs[_0x2951('0x33')](_0x3f2e74[_0x2951('0x2d')][_0x2951('0x33')]);_0x3f936e[_0x2951('0x34')]=qs[_0x2951('0x2e')](_['pick'](_0x3f2e74[_0x2951('0x2d')],_0x258be7['filters']),_0x12c2f9);if(_0x3f2e74['query']['filter']){_0x3f936e[_0x2951('0x34')]=_[_0x2951('0x35')](_0x3f936e['where'],{'$or':_[_0x2951('0x2b')](_0x12c2f9,function(_0x5f2dd3){if(_0x5f2dd3[_0x2951('0x28')]!=='VIRTUAL'){var _0x565832={};_0x565832[_0x5f2dd3[_0x2951('0x23')]]={'$like':'%'+_0x3f2e74[_0x2951('0x2d')][_0x2951('0x36')]+'%'};return _0x565832;}})});}_0x3f936e=_['merge']({},_0x3f936e,_0x3f2e74['options']);var _0x19b3f9={'where':_0x3f936e['where']};return db[_0x2951('0x25')][_0x2951('0x19')](_0x19b3f9)[_0x2951('0x1f')](function(_0xfb67dc){_0x30fd2a[_0x2951('0x19')]=_0xfb67dc;if(_0x3f2e74[_0x2951('0x2d')][_0x2951('0x37')]){_0x3f936e[_0x2951('0x38')]=[{'all':!![]}];}return db[_0x2951('0x25')][_0x2951('0x39')](_0x3f936e);})[_0x2951('0x1f')](function(_0x55ccab){_0x30fd2a[_0x2951('0x3a')]=_0x55ccab;return _0x30fd2a;})[_0x2951('0x1f')](respondWithFilteredResult(_0x124c8b,_0x3f936e))[_0x2951('0x3b')](handleError(_0x124c8b,null));};exports['show']=function(_0x24fc13,_0x30b045){var _0x2fb0a4={'raw':!![],'where':{'id':_0x24fc13['params']['id']}},_0x569772={};_0x569772[_0x2951('0x2a')]=_['keys'](db[_0x2951('0x25')][_0x2951('0x26')]);_0x569772[_0x2951('0x2d')]=_['keys'](_0x24fc13[_0x2951('0x2d')]);_0x569772[_0x2951('0x2e')]=_[_0x2951('0x2f')](_0x569772['model'],_0x569772['query']);_0x2fb0a4[_0x2951('0x30')]=_[_0x2951('0x2f')](_0x569772['model'],qs[_0x2951('0x31')](_0x24fc13[_0x2951('0x2d')][_0x2951('0x31')]));_0x2fb0a4[_0x2951('0x30')]=_0x2fb0a4[_0x2951('0x30')][_0x2951('0x3c')]?_0x2fb0a4[_0x2951('0x30')]:_0x569772[_0x2951('0x2a')];if(_0x24fc13[_0x2951('0x2d')][_0x2951('0x37')]){_0x2fb0a4[_0x2951('0x38')]=[{'all':!![]}];}_0x2fb0a4=_[_0x2951('0x35')]({},_0x2fb0a4,_0x24fc13[_0x2951('0x3d')]);return db[_0x2951('0x25')][_0x2951('0x3e')](_0x2fb0a4)[_0x2951('0x1f')](handleEntityNotFound(_0x30b045,null))[_0x2951('0x1f')](respondWithResult(_0x30b045,null))['catch'](handleError(_0x30b045,null));};exports[_0x2951('0x3f')]=function(_0x2917c1,_0x504aa6){var _0x4af606={'where':{'id':_0x2917c1[_0x2951('0x40')]['id']}},_0x54972a={};_0x54972a[_0x2951('0x2a')]=_[_0x2951('0x2c')](db[_0x2951('0x25')][_0x2951('0x26')]);_0x4af606['attributes']=_[_0x2951('0x2f')](_0x54972a[_0x2951('0x2a')],qs['fields'](_0x2917c1['query'][_0x2951('0x31')]));_0x4af606[_0x2951('0x30')]=_0x4af606['attributes']['length']?_0x4af606['attributes']:_0x54972a['model'];if(_0x2917c1[_0x2951('0x2d')][_0x2951('0x37')]){_0x4af606['include']=[{'all':!![]}];}_0x4af606=_['merge']({},_0x4af606,_0x2917c1['options']);return db[_0x2951('0x25')][_0x2951('0x3e')](_0x4af606)[_0x2951('0x1f')](handleEntityNotFound(_0x504aa6,null))[_0x2951('0x1f')](function(_0x3a0d3e){if(_0x3a0d3e){var _0x420b6=_0x3a0d3e[_0x2951('0x41')]({'plain':!![]});_0x420b6=qs[_0x2951('0x42')](_0x420b6,['id','createdAt',_0x2951('0x43')]);_0x2917c1[_0x2951('0x44')]=_[_0x2951('0x42')](_0x2917c1[_0x2951('0x44')],['id',_0x2951('0x45'),_0x2951('0x43')]);return db[_0x2951('0x25')]['create'](_[_0x2951('0x35')](_0x420b6,_0x2917c1[_0x2951('0x44')]),{'include':_0x2917c1[_0x2951('0x2d')][_0x2951('0x37')]?[{'all':!![]}]:undefined});}})[_0x2951('0x1f')](respondWithResult(_0x504aa6,0xc9))['catch'](handleError(_0x504aa6,null));};exports[_0x2951('0x46')]=function(_0x1657fb,_0x3a86ff){if(_0x1657fb[_0x2951('0x44')]['id']){delete _0x1657fb[_0x2951('0x44')]['id'];}return db[_0x2951('0x25')]['find']({'where':{'id':_0x1657fb[_0x2951('0x40')]['id']}})[_0x2951('0x1f')](handleEntityNotFound(_0x3a86ff,null))[_0x2951('0x1f')](saveUpdates(_0x1657fb[_0x2951('0x44')],null))['then'](respondWithResult(_0x3a86ff,null))[_0x2951('0x3b')](handleError(_0x3a86ff,null));};exports[_0x2951('0x20')]=function(_0x3c675,_0x49a66e){return db[_0x2951('0x25')][_0x2951('0x3e')]({'where':{'id':_0x3c675['params']['id']}})['then'](handleEntityNotFound(_0x49a66e,null))['then'](removeEntity(_0x49a66e,null))[_0x2951('0x3b')](handleError(_0x49a66e,null));};exports['create']=function(_0x399132,_0x2e563c,_0x326b43){_0x399132[_0x2951('0x44')][_0x2951('0x23')]=_0x399132[_0x2951('0x47')][_0x2951('0x48')];_0x399132['body'][_0x2951('0x49')]=_0x399132[_0x2951('0x47')]['filename'];_0x399132[_0x2951('0x44')]['type']=_0x399132[_0x2951('0x47')]['mimetype'];return db[_0x2951('0x25')][_0x2951('0x4a')](_0x399132['body'])[_0x2951('0x1f')](respondWithResult(_0x2e563c,0xc9))[_0x2951('0x3b')](handleError(_0x2e563c,null));};exports[_0x2951('0x4b')]=function(_0x4745bf,_0x1937ca,_0xd070ce){return db[_0x2951('0x25')][_0x2951('0x4c')]({'where':{'id':_0x4745bf['params']['id']},'raw':!![]})[_0x2951('0x1f')](handleEntityNotFound(_0x1937ca,null))[_0x2951('0x1f')](function(_0x520998){if(_0x520998){var _0x37d85f=_0x520998[_0x2951('0x4d')]!==null;var _0x3e778e=path['join'](config['root'],_0x2951('0x4e'));if(_0x37d85f){_0x3e778e=path[_0x2951('0x4f')](_0x3e778e,'offline-chat/');}var _0x49ceb4=path[_0x2951('0x4f')](_0x3e778e,_0x520998[_0x2951('0x49')]);return _0x1937ca['download'](_0x49ceb4);}})[_0x2951('0x3b')](handleError(_0x1937ca,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 552af8d..8e5eb5a 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 _0x53d6=['path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x4c5f3e,_0x3c6f97){var _0x31ca51=function(_0x110c29){while(--_0x110c29){_0x4c5f3e['push'](_0x4c5f3e['shift']());}};_0x31ca51(++_0x3c6f97);}(_0x53d6,0xee));var _0x653d=function(_0x37222f,_0x25a5ab){_0x37222f=_0x37222f-0x0;var _0x5c5a6d=_0x53d6[_0x37222f];return _0x5c5a6d;};'use strict';var _=require(_0x653d('0x0'));var util=require(_0x653d('0x1'));var logger=require(_0x653d('0x2'))(_0x653d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x653d('0x4'));var rimraf=require(_0x653d('0x5'));var config=require('../../config/environment');var attributes=require(_0x653d('0x6'));module[_0x653d('0x7')]=function(_0x164de5,_0x52d5af){return _0x164de5[_0x653d('0x8')](_0x653d('0x9'),attributes,{'tableName':_0x653d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4db4=['../../config/logger','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','attachments','lodash','util'];(function(_0x11973d,_0x68c443){var _0x2875e3=function(_0x597cda){while(--_0x597cda){_0x11973d['push'](_0x11973d['shift']());}};_0x2875e3(++_0x68c443);}(_0x4db4,0x120));var _0x44db=function(_0x290cd2,_0x3c81cc){_0x290cd2=_0x290cd2-0x0;var _0x572a5d=_0x4db4[_0x290cd2];return _0x572a5d;};'use strict';var _=require(_0x44db('0x0'));var util=require(_0x44db('0x1'));var logger=require(_0x44db('0x2'))('api');var moment=require('moment');var BPromise=require(_0x44db('0x3'));var rp=require(_0x44db('0x4'));var fs=require('fs');var path=require(_0x44db('0x5'));var rimraf=require('rimraf');var config=require(_0x44db('0x6'));var attributes=require(_0x44db('0x7'));module[_0x44db('0x8')]=function(_0x5cebe8,_0x1892ce){return _0x5cebe8['define']('Attachment',attributes,{'tableName':_0x44db('0x9'),'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 24059ef..0d01780 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 _0xfc1e=['message','result','CreateAttachment','create','body','options','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x33f5d3,_0x4a6141){var _0x9d677e=function(_0x1ee4a4){while(--_0x1ee4a4){_0x33f5d3['push'](_0x33f5d3['shift']());}};_0x9d677e(++_0x4a6141);}(_0xfc1e,0x1c9));var _0xefc1=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0xfc1e[_0xab9f3d];return _0x5283bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38927c,_0x44d15b,_0x3ff4a7){return new BPromise(function(_0x45bec4,_0x77f637){return client[_0xefc1('0x8')](_0x38927c,_0x3ff4a7)[_0xefc1('0x9')](function(_0x244927){logger[_0xefc1('0xa')](_0xefc1('0xb'),_0x44d15b,'request\x20sent');logger[_0xefc1('0xc')](_0xefc1('0xd'),_0x44d15b,_0xefc1('0xe'),JSON[_0xefc1('0xf')](_0x244927));if(_0x244927[_0xefc1('0x10')]){if(_0x244927[_0xefc1('0x10')][_0xefc1('0x11')]===0x1f4){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x77f637(_0x244927['error'][_0xefc1('0x12')]);}logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x45bec4(_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);}else{logger[_0xefc1('0xa')]('Attachment,\x20%s,\x20%s',_0x44d15b,_0xefc1('0xe'));_0x45bec4(_0x244927[_0xefc1('0x13')][_0xefc1('0x12')]);}})['catch'](function(_0x159adb){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x159adb);_0x77f637(_0x159adb);});});}exports[_0xefc1('0x14')]=function(_0x257914){var _0x38923c=this;return new Promise(function(_0x3b5a6e,_0x126052){return db['Attachment'][_0xefc1('0x15')](_0x257914[_0xefc1('0x16')],{'raw':_0x257914[_0xefc1('0x17')]?_0x257914['options']['raw']===undefined?!![]:![]:!![]})[_0xefc1('0x9')](function(_0x492d7d){logger[_0xefc1('0xa')]('CreateAttachment',_0x257914);logger[_0xefc1('0xc')](_0xefc1('0x14'),_0x257914,JSON['stringify'](_0x492d7d));_0x3b5a6e(_0x492d7d);})[_0xefc1('0x18')](function(_0x2ea108){logger[_0xefc1('0x10')](_0xefc1('0x14'),_0x2ea108[_0xefc1('0x12')],_0x257914);_0x126052(_0x38923c[_0xefc1('0x10')](0x1f4,_0x2ea108['message']));});});};
\ No newline at end of file
+var _0x9567=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateAttachment','create','options','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x16f143,_0x813860){var _0x1fff62=function(_0x39edce){while(--_0x39edce){_0x16f143['push'](_0x16f143['shift']());}};_0x1fff62(++_0x813860);}(_0x9567,0xdc));var _0x7956=function(_0x227c3a,_0x44efb){_0x227c3a=_0x227c3a-0x0;var _0x1535e8=_0x9567[_0x227c3a];return _0x1535e8;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('Attachment,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});}exports[_0x7956('0x15')]=function(_0x5e6b90){var _0x5c3afb=this;return new Promise(function(_0x10b29c,_0x811122){return db['Attachment'][_0x7956('0x16')](_0x5e6b90['body'],{'raw':_0x5e6b90[_0x7956('0x17')]?_0x5e6b90[_0x7956('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x7956('0xa')](function(_0x2e31cd){logger[_0x7956('0xb')]('CreateAttachment',_0x5e6b90);logger[_0x7956('0xd')]('CreateAttachment',_0x5e6b90,JSON[_0x7956('0x18')](_0x2e31cd));_0x10b29c(_0x2e31cd);})['catch'](function(_0x427500){logger[_0x7956('0x10')](_0x7956('0x15'),_0x427500[_0x7956('0x12')],_0x5e6b90);_0x811122(_0x5c3afb['error'](0x1f4,_0x427500[_0x7956('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index f2ffc2c..6badcea 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x5dcca0,_0x2e3385){var _0x522285=function(_0x1f36e0){while(--_0x1f36e0){_0x5dcca0['push'](_0x5dcca0['shift']());}};_0x522285(++_0x2e3385);}(_0xadb5,0xad));var _0x5adb=function(_0x5b45d9,_0x5cd565){_0x5b45d9=_0x5b45d9-0x0;var _0x13f65f=_0xadb5[_0x5b45d9];return _0x13f65f;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 8f096df..39d5733 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 _0x5358=['clearBlockUser','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','undefined','activedirectory','baseDN','authenticate','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','adSsoEnabled','name','password','salt','role','disabled','blocked','blockedAt','online','user','agent','then','add'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x5358,0x67));var _0x8535=function(_0x58729e,_0x3b83cd){_0x58729e=_0x58729e-0x0;var _0x1431ae=_0x5358[_0x58729e];return _0x1431ae;};'use strict';var passport=require(_0x8535('0x0'));var LocalStrategy=require(_0x8535('0x1'))[_0x8535('0x2')];var moment=require(_0x8535('0x3'));var ActiveDirectory=require(_0x8535('0x4'));var BPromise=require(_0x8535('0x5'));var util=require(_0x8535('0x6'));var db=require(_0x8535('0x7'))['db'];var authService=require(_0x8535('0x8'));var utils=require(_0x8535('0x9'));var config=require(_0x8535('0xa'));var logger=require('../../config/logger')(_0x8535('0xb'));function isActiveDirectoryConfigured(_0x146446){var _0x522b1e=![];if(typeof _0x146446['activedirectory']!==_0x8535('0xc')){_0x522b1e=_0x146446[_0x8535('0xd')][_0x8535('0xe')]&&_0x146446[_0x8535('0xd')]['url']&&_0x146446['activedirectory']['domain'];}return _0x522b1e;}function adAuthenticate(_0x53a2d0,_0x3ca508,_0x29456e){return new BPromise(function(_0x1a570d,_0x5a21a7){try{var _0x36bfdf=new ActiveDirectory(_0x53a2d0);_0x36bfdf[_0x8535('0xf')](_0x3ca508,_0x29456e,function(_0x11980e,_0x2797aa){if(_0x11980e){logger[_0x8535('0x10')]('Error\x20authenticate\x20%s:\x20%s',_0x3ca508,util['inspect'](_0x11980e,{'showHidden':![],'depth':null}));_0x5a21a7(_0x8535('0x11'));}else if(!_0x2797aa){logger[_0x8535('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ca508);_0x5a21a7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1a570d(_0x2797aa);}});}catch(_0x459c1d){_0x5a21a7(_0x459c1d);}});}function ActiveDirectoryAuthenticate(_0x29bbd3,_0x3665b2,_0x10638a,_0x7bd8e1){var _0xd6b46d,_0x41593f;if(!isActiveDirectoryConfigured(config)){logger[_0x8535('0x10')](_0x8535('0x12'),_0x3665b2);return _0x7bd8e1(null,![],{'message':_0x8535('0x11')});}return db[_0x8535('0x13')][_0x8535('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x8535('0x15')],'raw':!![]})['then'](function(_0x360a7a){_0xd6b46d=_0x360a7a;if(!_0xd6b46d[_0x8535('0x16')]){logger[_0x8535('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x3665b2);throw new Error(_0x8535('0x11'));}return _0x29bbd3['findOne']({'attributes':['id',_0x8535('0x17'),_0x8535('0x18'),_0x8535('0x19'),_0x8535('0x1a'),_0x8535('0x1b'),_0x8535('0x1c'),_0x8535('0x1d'),_0x8535('0x1e')],'where':{'name':_0x3665b2,'role':{'$or':['admin',_0x8535('0x1f'),_0x8535('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x2ed4f7){if(!_0x2ed4f7||_0x2ed4f7&&_0x2ed4f7[_0x8535('0x17')]!==_0x3665b2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x41593f=_0x2ed4f7;var _0x492618=_0x41593f[_0x8535('0x17')]+'@'+config[_0x8535('0xd')]['domain'];return adAuthenticate(config[_0x8535('0xd')],_0x492618,_0x10638a);})[_0x8535('0x21')](function(_0x43b586){if(_0x41593f['disabled']){throw new Error(_0x8535('0x11'));}if(_0xd6b46d['blockDuration']>0x0){if(_0x41593f[_0x8535('0x1c')]){if(moment(_0x41593f[_0x8535('0x1d')])[_0x8535('0x22')](_0xd6b46d[_0x8535('0x15')],'minutes')>moment()){throw new Error(_0x8535('0x11'));}return utils[_0x8535('0x23')](_0x41593f,0x0,![],null)[_0x8535('0x21')](function(){return utils[_0x8535('0x24')](_0x41593f);})[_0x8535('0x21')](function(){return _0x7bd8e1(null,_0x41593f);});}else{return utils[_0x8535('0x24')](_0x41593f)[_0x8535('0x21')](function(){return _0x7bd8e1(null,_0x41593f);});}}else{return utils[_0x8535('0x24')](_0x41593f)['then'](function(){return _0x7bd8e1(null,_0x41593f);});}})[_0x8535('0x25')](function(_0x4f40d3){return _0x7bd8e1(null,![],_0x4f40d3);});}function handleError(_0x15ef0b,_0x40f2c2,_0x8ede65){return _0x15ef0b[_0x8535('0x26')](_0x40f2c2||0x1f4)[_0x8535('0x27')]({'message':_0x8ede65?_0x8ede65[_0x8535('0x28')]||_0x8ede65:''});}exports['login']=function(_0x41ce3a,_0x57f047,_0x3d68b5){passport[_0x8535('0xf')](_0x8535('0x29'),function(_0x59cf09,_0x3f86bc,_0x273c68){var _0x1a961e=_0x59cf09||_0x273c68;if(_0x1a961e){return handleError(_0x57f047,0x191,_0x1a961e);}if(!_0x3f86bc){return handleError(_0x57f047,0x194,{'message':_0x8535('0x2a')});}else{var _0x24ffa7={'payload':{'id':_0x3f86bc['id'],'role':_0x3f86bc['role']},'options':{'expiresIn':0x15180}};return authService[_0x8535('0x2b')](_0x24ffa7)[_0x8535('0x21')](function(_0x47b9dc){_0x57f047[_0x8535('0x2c')]({'id':_0x3f86bc['id'],'token':_0x47b9dc,'statusCall':'','isAlreadyLogged':_0x3f86bc[_0x8535('0x1e')]});});}})(_0x41ce3a,_0x57f047,_0x3d68b5);};passport[_0x8535('0x2d')](_0x8535('0x29'),new LocalStrategy({'usernameField':_0x8535('0x17'),'passwordField':'password'},function(_0x27a449,_0x3256bc,_0x593e35){return ActiveDirectoryAuthenticate(db['User'],_0x27a449,_0x3256bc,_0x593e35);}));
\ No newline at end of file
+var _0xa894=['disabled','online','admin','user','agent','then','blockDuration','blockedAt','add','getLicense','catch','status','send','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','passport','passport-local','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa894,0x1d6));var _0x4a89=function(_0x5d8987,_0x14d054){_0x5d8987=_0x5d8987-0x0;var _0x2997eb=_0xa894[_0x5d8987];return _0x2997eb;};'use strict';var passport=require(_0x4a89('0x0'));var LocalStrategy=require(_0x4a89('0x1'))['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x4a89('0x2'));var BPromise=require(_0x4a89('0x3'));var util=require(_0x4a89('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x4a89('0x5'));var utils=require(_0x4a89('0x6'));var config=require(_0x4a89('0x7'));var logger=require('../../config/logger')(_0x4a89('0x8'));function isActiveDirectoryConfigured(_0xe7bb63){var _0x7ddb6c=![];if(typeof _0xe7bb63[_0x4a89('0x9')]!==_0x4a89('0xa')){_0x7ddb6c=_0xe7bb63[_0x4a89('0x9')][_0x4a89('0xb')]&&_0xe7bb63[_0x4a89('0x9')]['url']&&_0xe7bb63['activedirectory'][_0x4a89('0xc')];}return _0x7ddb6c;}function adAuthenticate(_0x72d745,_0x1d21eb,_0xe47002){return new BPromise(function(_0x562940,_0x3b429f){try{var _0x109180=new ActiveDirectory(_0x72d745);_0x109180['authenticate'](_0x1d21eb,_0xe47002,function(_0x26cc65,_0x5530d3){if(_0x26cc65){logger[_0x4a89('0xd')](_0x4a89('0xe'),_0x1d21eb,util[_0x4a89('0xf')](_0x26cc65,{'showHidden':![],'depth':null}));_0x3b429f(_0x4a89('0x10'));}else if(!_0x5530d3){logger[_0x4a89('0xd')](_0x4a89('0x11'),_0x1d21eb);_0x3b429f(_0x4a89('0x10'));}else{_0x562940(_0x5530d3);}});}catch(_0x4b1c63){_0x3b429f(_0x4b1c63);}});}function ActiveDirectoryAuthenticate(_0x4a147a,_0x1daf5e,_0x3c48d7,_0x34858c){var _0x1a2b83,_0x1f2762;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x4a89('0x12'),_0x1daf5e);return _0x34858c(null,![],{'message':_0x4a89('0x10')});}return db['Setting'][_0x4a89('0x13')]({'where':{'id':0x1},'attributes':[_0x4a89('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x1c6e23){_0x1a2b83=_0x1c6e23;if(!_0x1a2b83[_0x4a89('0x14')]){logger[_0x4a89('0xd')](_0x4a89('0x15'),_0x1daf5e);throw new Error(_0x4a89('0x10'));}return _0x4a147a[_0x4a89('0x13')]({'attributes':['id',_0x4a89('0x16'),_0x4a89('0x17'),_0x4a89('0x18'),'role',_0x4a89('0x19'),'blocked','blockedAt',_0x4a89('0x1a')],'where':{'name':_0x1daf5e,'role':{'$or':[_0x4a89('0x1b'),_0x4a89('0x1c'),_0x4a89('0x1d')]},'adSsoEnabled':!![]}});})['then'](function(_0x1c1261){if(!_0x1c1261||_0x1c1261&&_0x1c1261[_0x4a89('0x16')]!==_0x1daf5e){throw new Error(_0x4a89('0x10'));}_0x1f2762=_0x1c1261;var _0x561185=_0x1f2762['name']+'@'+config['activedirectory']['domain'];return adAuthenticate(config[_0x4a89('0x9')],_0x561185,_0x3c48d7);})[_0x4a89('0x1e')](function(_0x53eb09){if(_0x1f2762[_0x4a89('0x19')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x1a2b83[_0x4a89('0x1f')]>0x0){if(_0x1f2762['blocked']){if(moment(_0x1f2762[_0x4a89('0x20')])[_0x4a89('0x21')](_0x1a2b83[_0x4a89('0x1f')],'minutes')>moment()){throw new Error(_0x4a89('0x10'));}return utils['clearBlockUser'](_0x1f2762,0x0,![],null)[_0x4a89('0x1e')](function(){return utils[_0x4a89('0x22')](_0x1f2762);})[_0x4a89('0x1e')](function(){return _0x34858c(null,_0x1f2762);});}else{return utils[_0x4a89('0x22')](_0x1f2762)[_0x4a89('0x1e')](function(){return _0x34858c(null,_0x1f2762);});}}else{return utils[_0x4a89('0x22')](_0x1f2762)[_0x4a89('0x1e')](function(){return _0x34858c(null,_0x1f2762);});}})[_0x4a89('0x23')](function(_0x3c8089){return _0x34858c(null,![],_0x3c8089);});}function handleError(_0x42c465,_0x36e2d8,_0x17c0aa){return _0x42c465[_0x4a89('0x24')](_0x36e2d8||0x1f4)[_0x4a89('0x25')]({'message':_0x17c0aa?_0x17c0aa[_0x4a89('0x26')]||_0x17c0aa:''});}exports[_0x4a89('0x27')]=function(_0x59f5ea,_0x4118aa,_0x554e12){passport[_0x4a89('0x28')](_0x4a89('0x29'),function(_0x47045c,_0x23b700,_0x3a40db){var _0x3b5efd=_0x47045c||_0x3a40db;if(_0x3b5efd){return handleError(_0x4118aa,0x191,_0x3b5efd);}if(!_0x23b700){return handleError(_0x4118aa,0x194,{'message':_0x4a89('0x2a')});}else{var _0x55c65a={'payload':{'id':_0x23b700['id'],'role':_0x23b700[_0x4a89('0x2b')]},'options':{'expiresIn':0x15180}};return authService[_0x4a89('0x2c')](_0x55c65a)[_0x4a89('0x1e')](function(_0x5ae2ac){_0x4118aa['json']({'id':_0x23b700['id'],'token':_0x5ae2ac,'statusCall':'','isAlreadyLogged':_0x23b700[_0x4a89('0x1a')]});});}})(_0x59f5ea,_0x4118aa,_0x554e12);};passport['use'](_0x4a89('0x29'),new LocalStrategy({'usernameField':_0x4a89('0x16'),'passwordField':_0x4a89('0x17')},function(_0xfd9a69,_0x4a8881,_0xd3885d){return ActiveDirectoryAuthenticate(db['User'],_0xfd9a69,_0x4a8881,_0xd3885d);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 0c02559..55b722b 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 _0xdc6c=['Router','./authActiveDirectory.controller','exports','express'];(function(_0x38c083,_0x34663e){var _0x32a398=function(_0x3d88cb){while(--_0x3d88cb){_0x38c083['push'](_0x38c083['shift']());}};_0x32a398(++_0x34663e);}(_0xdc6c,0x1b3));var _0xcdc6=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0xdc6c[_0x391c55];return _0xa434e0;};'use strict';var express=require(_0xcdc6('0x0'));var router=express[_0xcdc6('0x1')]();var controller=require(_0xcdc6('0x2'));router['post']('/',controller['login']);module[_0xcdc6('0x3')]=router;
\ No newline at end of file
+var _0x3d29=['login','exports','express'];(function(_0x472208,_0x142120){var _0x26926d=function(_0x17d12e){while(--_0x17d12e){_0x472208['push'](_0x472208['shift']());}};_0x26926d(++_0x142120);}(_0x3d29,0x68));var _0x93d2=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x3d29[_0x4d8ed9];return _0x1e2140;};'use strict';var express=require(_0x93d2('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0x93d2('0x1')]);module[_0x93d2('0x2')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 9f35013..5405914 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x323fa2,_0x4ba631){var _0x277baa=function(_0x4351a6){while(--_0x4351a6){_0x323fa2['push'](_0x323fa2['shift']());}};_0x277baa(++_0x4ba631);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x7a54,0x106));var _0x47a5=function(_0x52f901,_0x53f194){_0x52f901=_0x52f901-0x0;var _0x4da813=_0x7a54[_0x52f901];return _0x4da813;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index d40a97f..0cc4903 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 _0xab6f=['../../components/auth/service','get','/callback','callback','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x3f1d8a,_0x373118){var _0x2f139a=function(_0x5a1457){while(--_0x5a1457){_0x3f1d8a['push'](_0x3f1d8a['shift']());}};_0x2f139a(++_0x373118);}(_0xab6f,0x177));var _0xfab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab6f[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xfab6('0x0'));var passport=require(_0xfab6('0x1'));var router=express[_0xfab6('0x2')]();var controller=require(_0xfab6('0x3'));var userController=require(_0xfab6('0x4'));var authService=require(_0xfab6('0x5'));router['get']('/',controller['login']);router[_0xfab6('0x6')](_0xfab6('0x7'),controller[_0xfab6('0x8')],authService['isMiddleware'],userController['login'],authService[_0xfab6('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0x843f=['exports','passport','Router','../user/user.controller.js','../../components/auth/service','get','isMiddleware','login'];(function(_0x325c4f,_0x5800b4){var _0x431098=function(_0x5be070){while(--_0x5be070){_0x325c4f['push'](_0x325c4f['shift']());}};_0x431098(++_0x5800b4);}(_0x843f,0xd1));var _0xf843=function(_0x14b37c,_0x27d104){_0x14b37c=_0x14b37c-0x0;var _0xc0bc8f=_0x843f[_0x14b37c];return _0xc0bc8f;};'use strict';var express=require('express');var passport=require(_0xf843('0x0'));var router=express[_0xf843('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0xf843('0x2'));var authService=require(_0xf843('0x3'));router['get']('/',controller['login']);router[_0xf843('0x4')]('/callback',controller['callback'],authService[_0xf843('0x5')],userController[_0xf843('0x6')],authService['setTokenCookie']);module[_0xf843('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 4fc3b54..be842cd 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 _0x4332=['admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','status','login','authenticate','local-login','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','send','reset','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordToken','use','passport','passport-local','jayson/promise','lodash','moment','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','loginAttempts'];(function(_0x356b80,_0x308410){var _0x29309c=function(_0x15628b){while(--_0x15628b){_0x356b80['push'](_0x356b80['shift']());}};_0x29309c(++_0x308410);}(_0x4332,0x1c8));var _0x2433=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4332[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var passport=require(_0x2433('0x0'));var LocalStrategy=require(_0x2433('0x1'))['Strategy'];var jayson=require(_0x2433('0x2'));var _=require(_0x2433('0x3'));var rs=require('randomstring');var moment=require(_0x2433('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x2433('0x5'));var utils=require('../../config/utils');var client=jayson[_0x2433('0x6')][_0x2433('0x7')]({'port':0x232b});function localAuthenticate(_0x418e6e,_0x581b21,_0x4fd84a,_0x55dacc){var _0x185644,_0x3c1a29;return db[_0x2433('0x8')][_0x2433('0x9')]({'where':{'id':0x1},'attributes':[_0x2433('0xa'),_0x2433('0xb')],'raw':!![]})['then'](function(_0x59928c){_0x185644=_0x59928c;return _0x418e6e['findOne']({'attributes':['id',_0x2433('0xc'),'password',_0x2433('0xd'),_0x2433('0xe'),_0x2433('0xf'),_0x2433('0x10'),'blockedAt',_0x2433('0x11')],'where':{'name':_0x581b21,'role':{'$or':[_0x2433('0x12'),_0x2433('0x13'),_0x2433('0x14')]}}});})[_0x2433('0x15')](function(_0x37a979){if(!_0x37a979||_0x37a979&&_0x37a979[_0x2433('0xc')]!==_0x581b21){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3c1a29=_0x37a979;return _0x3c1a29;}})[_0x2433('0x15')](function(){_0x3c1a29['authenticate'](_0x4fd84a,function(_0x53caf1,_0x283737){var _0x376c7e=_0x3c1a29[_0x2433('0x11')]+0x1;if(_0x53caf1){return _0x55dacc(_0x53caf1);}else if(!_0x283737){if(_0x3c1a29[_0x2433('0xf')]){return _0x55dacc(null,![],{'message':_0x2433('0x16')});}else if(_0x185644['allowedLoginAttempts']>0x0){if(_0x3c1a29['blocked']){if(_0x185644[_0x2433('0xb')]>0x0){if(moment(_0x3c1a29[_0x2433('0x17')])[_0x2433('0x18')](_0x185644[_0x2433('0xb')],_0x2433('0x19'))>moment()){return _0x55dacc(null,![],{'message':_0x2433('0x16')});}else{return utils[_0x2433('0x1a')](_0x3c1a29,_0x376c7e,![],null)[_0x2433('0x15')](function(){return _0x55dacc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x55dacc(null,![],{'message':_0x2433('0x16')});}}else{if(_0x376c7e>=_0x185644[_0x2433('0xa')]){return utils['clearBlockUser'](_0x3c1a29,0x0,!![],moment())[_0x2433('0x15')](function(){return _0x55dacc(null,![],{'message':_0x2433('0x16')});});}else{return utils[_0x2433('0x1a')](_0x3c1a29,_0x376c7e,![],null)[_0x2433('0x15')](function(){return _0x55dacc(null,![],{'message':_0x2433('0x16')});});}}}else{return _0x55dacc(null,![],{'message':_0x2433('0x16')});}}else{if(_0x3c1a29[_0x2433('0xf')]){return _0x55dacc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x185644[_0x2433('0xa')]>0x0){if(_0x3c1a29[_0x2433('0x10')]){if(_0x185644[_0x2433('0xb')]>0x0){if(moment(_0x3c1a29[_0x2433('0x17')])[_0x2433('0x18')](_0x185644[_0x2433('0xb')],_0x2433('0x19'))>moment()){return _0x55dacc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3c1a29,0x0,![],null)['then'](function(){return utils[_0x2433('0x1b')](_0x3c1a29);})[_0x2433('0x15')](function(){return _0x55dacc(null,_0x3c1a29);});}}else{return _0x55dacc(null,![],{'message':_0x2433('0x16')});}}else{return utils[_0x2433('0x1a')](_0x3c1a29,0x0,![],null)[_0x2433('0x15')](function(){return utils[_0x2433('0x1b')](_0x3c1a29);})['then'](function(){return _0x55dacc(null,_0x3c1a29);})[_0x2433('0x1c')](function(_0x12f5e1){return _0x55dacc(null,![],_0x12f5e1);});}}else{if(_0x3c1a29[_0x2433('0x10')]){return _0x55dacc(null,![],{'message':_0x2433('0x16')});}else{return utils[_0x2433('0x1b')](_0x3c1a29)['then'](function(){return _0x55dacc(null,_0x3c1a29);});}}}});})[_0x2433('0x1c')](function(_0x496482){return _0x55dacc(null,![],_0x496482);});}function sendServiceMail(_0x269300){return db[_0x2433('0x1d')][_0x2433('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x2433('0xc'),_0x2433('0x1f')],'include':[{'model':db[_0x2433('0x20')],'as':_0x2433('0x21'),'include':[{'model':db[_0x2433('0x22')],'as':_0x2433('0x22')}]}]})[_0x2433('0x15')](function(_0x38e7f9){if(!_0x38e7f9){throw new Error(_0x2433('0x23'));}var _0x3e0271=_0x38e7f9['getSmtpOptions']();var _0x5833de={'account':_0x3e0271,'message':_[_0x2433('0x24')]({'from':util[_0x2433('0x25')](_0x2433('0x26'),_0x38e7f9[_0x2433('0xc')],_0x38e7f9[_0x2433('0x1f')]||_0x38e7f9[_0x2433('0x21')][_0x2433('0x13')])},_0x269300)};return client[_0x2433('0x27')](_0x2433('0x28'),_0x5833de);})[_0x2433('0x15')](function(_0x1469f2){if(_0x1469f2[_0x2433('0x29')]){throw new Error(util[_0x2433('0x25')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x1469f2[_0x2433('0x29')][_0x2433('0x2a')]||JSON['stringify'](_0x1469f2['error'])));}return!![];});}function handleError(_0x2fb72f,_0x483a4b,_0x3e4fae){return _0x2fb72f[_0x2433('0x2b')](_0x483a4b||0x1f4)['send']({'message':_0x3e4fae?_0x3e4fae[_0x2433('0x2a')]||_0x3e4fae:''});}exports[_0x2433('0x2c')]=function(_0xc49cf7,_0x5e318d,_0x38e116){passport[_0x2433('0x2d')](_0x2433('0x2e'),function(_0x2ed1ff,_0xf522db,_0x334df8){var _0xf2cbd8=_0x2ed1ff||_0x334df8;if(_0xf2cbd8){return handleError(_0x5e318d,0x191,_0xf2cbd8);}if(!_0xf522db){return handleError(_0x5e318d,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x24fd3b={'payload':{'id':_0xf522db['id'],'role':_0xf522db[_0x2433('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x2433('0x2f')](_0x24fd3b)[_0x2433('0x15')](function(_0x5f2838){_0x5e318d[_0x2433('0x30')]({'id':_0xf522db['id'],'token':_0x5f2838,'statusCall':'','isAlreadyLogged':_0xf522db[_0x2433('0x31')]});});}})(_0xc49cf7,_0x5e318d,_0x38e116);};exports['forgot']=function(_0x2bc8a7,_0x3926d6){if(!_0x2bc8a7['body']['email']){return handleError(_0x3926d6,0x1f4,{'message':_0x2433('0x32')});}var _0x1c7bc3=rs[_0x2433('0x33')]();_0x2bc8a7[_0x2433('0x34')][_0x2433('0x1f')]=_0x2bc8a7[_0x2433('0x34')][_0x2433('0x1f')][_0x2433('0x35')]()[_0x2433('0x36')]();var _0x346768;return db['Setting'][_0x2433('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2433('0xb')],'raw':!![]})['then'](function(_0x42293e){_0x346768=_0x42293e;return db[_0x2433('0x37')][_0x2433('0x1e')]({'where':{'email':_0x2bc8a7['body'][_0x2433('0x1f')]}});})[_0x2433('0x15')](function(_0x315956){if(!_0x315956){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x315956[_0x2433('0xf')]){throw new Error(_0x2433('0x38'));}if(_0x315956[_0x2433('0x10')]){if(moment(_0x315956[_0x2433('0x17')])[_0x2433('0x18')](_0x346768[_0x2433('0xb')],_0x2433('0x19'))>moment()){throw new Error(_0x2433('0x39'));}else{_0x315956[_0x2433('0x10')]=![];_0x315956['blockedAt']=null;}}_0x315956['resetPasswordToken']=_0x1c7bc3;_0x315956[_0x2433('0x3a')]=Date[_0x2433('0x3b')]()+0x36ee80;return _0x315956[_0x2433('0x3c')]();})[_0x2433('0x15')](function(){return sendServiceMail({'to':_0x2bc8a7[_0x2433('0x34')][_0x2433('0x1f')],'subject':_0x2433('0x3d'),'text':_0x2433('0x3e')+_0x2433('0x3f')+_0x2433('0x40')+_0x2bc8a7['headers'][_0x2433('0x41')]+'/reset/'+_0x1c7bc3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x3926d6[_0x2433('0x2b')](0xc8)[_0x2433('0x42')]({'message':'Reset\x20Email\x20sent!'});})[_0x2433('0x1c')](function(_0x58fddf){return handleError(_0x3926d6,0x1f4,_0x58fddf);});};exports[_0x2433('0x43')]=function(_0x236706,_0x2641a0){return db[_0x2433('0x37')][_0x2433('0x1e')]({'where':{'resetPasswordToken':_0x236706[_0x2433('0x44')]['token'],'resetPasswordExpires':{'$gt':Date[_0x2433('0x3b')]()}}})['then'](function(_0x19fa95){if(!_0x19fa95){throw new Error(_0x2433('0x45'));}return db[_0x2433('0x8')][_0x2433('0x9')]({'attributes':['id',_0x2433('0x46'),_0x2433('0x47'),_0x2433('0x48')]})[_0x2433('0x15')](function(_0xceb19f){if(_0xceb19f['securePassword'])authService[_0x2433('0x49')](_0x236706['body'][_0x2433('0x4a')]);if(!_0xceb19f[_0x2433('0x47')]||!_0x19fa95[_0x2433('0x4b')])return _0x19fa95;authService[_0x2433('0x4c')](_0x236706[_0x2433('0x34')][_0x2433('0x4a')],_0x19fa95[_0x2433('0x4b')],_0xceb19f[_0x2433('0x48')]);return _0x19fa95;})[_0x2433('0x15')](function(){_0x19fa95[_0x2433('0x4a')]=_0x236706[_0x2433('0x34')][_0x2433('0x4a')];_0x19fa95[_0x2433('0x4d')]=null;_0x19fa95[_0x2433('0x3a')]=null;return _0x19fa95['save']();});})[_0x2433('0x15')](function(){_0x2641a0[_0x2433('0x2b')](0xc8)[_0x2433('0x42')]({'message':'Password\x20reset!'});})['catch'](function(_0x468437){return handleError(_0x2641a0,0x1f4,_0x468437);});};passport[_0x2433('0x4e')](_0x2433('0x2e'),new LocalStrategy({'usernameField':_0x2433('0xc'),'passwordField':_0x2433('0x4a')},function(_0x57a125,_0x34761d,_0x189dcd){return localAuthenticate(db['User'],_0x57a125,_0x34761d,_0x189dcd);}));
\ No newline at end of file
+var _0x98fa=['status','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','disabled','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','blockDuration','password','salt','role','blocked','loginAttempts','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','then','blockedAt','minutes','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify'];(function(_0x57f3bf,_0x1ec33e){var _0x45176f=function(_0x144ee6){while(--_0x144ee6){_0x57f3bf['push'](_0x57f3bf['shift']());}};_0x45176f(++_0x1ec33e);}(_0x98fa,0xd1));var _0xa98f=function(_0x496377,_0x3a68a4){_0x496377=_0x496377-0x0;var _0x151575=_0x98fa[_0x496377];return _0x151575;};'use strict';var util=require(_0xa98f('0x0'));var passport=require('passport');var LocalStrategy=require(_0xa98f('0x1'))['Strategy'];var jayson=require(_0xa98f('0x2'));var _=require(_0xa98f('0x3'));var rs=require(_0xa98f('0x4'));var moment=require(_0xa98f('0x5'));var db=require(_0xa98f('0x6'))['db'];var authService=require(_0xa98f('0x7'));var utils=require(_0xa98f('0x8'));var client=jayson['client'][_0xa98f('0x9')]({'port':0x232b});function localAuthenticate(_0x693c05,_0x3d90ac,_0x3ba300,_0x1d74e4){var _0x563fcb,_0x2e5fd5;return db['Setting'][_0xa98f('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xa98f('0xb')],'raw':!![]})['then'](function(_0x561ad1){_0x563fcb=_0x561ad1;return _0x693c05[_0xa98f('0xa')]({'attributes':['id','name',_0xa98f('0xc'),_0xa98f('0xd'),_0xa98f('0xe'),'disabled',_0xa98f('0xf'),'blockedAt',_0xa98f('0x10')],'where':{'name':_0x3d90ac,'role':{'$or':[_0xa98f('0x11'),_0xa98f('0x12'),_0xa98f('0x13')]}}});})['then'](function(_0x32cf46){if(!_0x32cf46||_0x32cf46&&_0x32cf46[_0xa98f('0x14')]!==_0x3d90ac){throw new Error(_0xa98f('0x15'));}else{_0x2e5fd5=_0x32cf46;return _0x2e5fd5;}})['then'](function(){_0x2e5fd5['authenticate'](_0x3ba300,function(_0x2253af,_0x1e4a65){var _0x2c988a=_0x2e5fd5[_0xa98f('0x10')]+0x1;if(_0x2253af){return _0x1d74e4(_0x2253af);}else if(!_0x1e4a65){if(_0x2e5fd5['disabled']){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}else if(_0x563fcb[_0xa98f('0x16')]>0x0){if(_0x2e5fd5[_0xa98f('0xf')]){if(_0x563fcb[_0xa98f('0xb')]>0x0){if(moment(_0x2e5fd5['blockedAt'])[_0xa98f('0x17')](_0x563fcb['blockDuration'],'minutes')>moment()){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}else{return utils[_0xa98f('0x18')](_0x2e5fd5,_0x2c988a,![],null)[_0xa98f('0x19')](function(){return _0x1d74e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}}else{if(_0x2c988a>=_0x563fcb[_0xa98f('0x16')]){return utils['clearBlockUser'](_0x2e5fd5,0x0,!![],moment())[_0xa98f('0x19')](function(){return _0x1d74e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xa98f('0x18')](_0x2e5fd5,_0x2c988a,![],null)[_0xa98f('0x19')](function(){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});});}}}else{return _0x1d74e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2e5fd5['disabled']){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}else if(_0x563fcb[_0xa98f('0x16')]>0x0){if(_0x2e5fd5['blocked']){if(_0x563fcb[_0xa98f('0xb')]>0x0){if(moment(_0x2e5fd5[_0xa98f('0x1a')])[_0xa98f('0x17')](_0x563fcb[_0xa98f('0xb')],_0xa98f('0x1b'))>moment()){return _0x1d74e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa98f('0x18')](_0x2e5fd5,0x0,![],null)[_0xa98f('0x19')](function(){return utils['getLicense'](_0x2e5fd5);})['then'](function(){return _0x1d74e4(null,_0x2e5fd5);});}}else{return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}}else{return utils[_0xa98f('0x18')](_0x2e5fd5,0x0,![],null)[_0xa98f('0x19')](function(){return utils[_0xa98f('0x1c')](_0x2e5fd5);})[_0xa98f('0x19')](function(){return _0x1d74e4(null,_0x2e5fd5);})[_0xa98f('0x1d')](function(_0xa819f1){return _0x1d74e4(null,![],_0xa819f1);});}}else{if(_0x2e5fd5[_0xa98f('0xf')]){return _0x1d74e4(null,![],{'message':_0xa98f('0x15')});}else{return utils[_0xa98f('0x1c')](_0x2e5fd5)['then'](function(){return _0x1d74e4(null,_0x2e5fd5);});}}}});})['catch'](function(_0x3343d3){return _0x1d74e4(null,![],_0x3343d3);});}function sendServiceMail(_0xd77ee9){return db[_0xa98f('0x1e')]['find']({'where':{'service':!![]},'attributes':['id','name',_0xa98f('0x1f')],'include':[{'model':db[_0xa98f('0x20')],'as':_0xa98f('0x21'),'include':[{'model':db['CloudProvider'],'as':_0xa98f('0x22')}]}]})['then'](function(_0x111d87){if(!_0x111d87){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x10ef82=_0x111d87['getSmtpOptions']();var _0x2b552b={'account':_0x10ef82,'message':_['merge']({'from':util[_0xa98f('0x23')](_0xa98f('0x24'),_0x111d87[_0xa98f('0x14')],_0x111d87[_0xa98f('0x1f')]||_0x111d87[_0xa98f('0x21')][_0xa98f('0x12')])},_0xd77ee9)};return client[_0xa98f('0x25')](_0xa98f('0x26'),_0x2b552b);})[_0xa98f('0x19')](function(_0x3326a9){if(_0x3326a9[_0xa98f('0x27')]){throw new Error(util[_0xa98f('0x23')](_0xa98f('0x28'),_0x3326a9[_0xa98f('0x27')][_0xa98f('0x29')]||JSON[_0xa98f('0x2a')](_0x3326a9['error'])));}return!![];});}function handleError(_0x29edb6,_0x38f091,_0x4399d4){return _0x29edb6[_0xa98f('0x2b')](_0x38f091||0x1f4)[_0xa98f('0x2c')]({'message':_0x4399d4?_0x4399d4[_0xa98f('0x29')]||_0x4399d4:''});}exports[_0xa98f('0x2d')]=function(_0x2589fc,_0x46e317,_0x2b186d){passport[_0xa98f('0x2e')](_0xa98f('0x2f'),function(_0x5c8298,_0x10e057,_0x39a838){var _0x9571ae=_0x5c8298||_0x39a838;if(_0x9571ae){return handleError(_0x46e317,0x191,_0x9571ae);}if(!_0x10e057){return handleError(_0x46e317,0x194,{'message':_0xa98f('0x30')});}else{var _0x59d3f1={'payload':{'id':_0x10e057['id'],'role':_0x10e057[_0xa98f('0xe')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x59d3f1)[_0xa98f('0x19')](function(_0x48eed1){_0x46e317[_0xa98f('0x31')]({'id':_0x10e057['id'],'token':_0x48eed1,'statusCall':'','isAlreadyLogged':_0x10e057[_0xa98f('0x32')]});});}})(_0x2589fc,_0x46e317,_0x2b186d);};exports['forgot']=function(_0x3ef97c,_0x4511a7){if(!_0x3ef97c[_0xa98f('0x33')][_0xa98f('0x1f')]){return handleError(_0x4511a7,0x1f4,{'message':_0xa98f('0x34')});}var _0x36988c=rs['generate']();_0x3ef97c[_0xa98f('0x33')]['email']=_0x3ef97c[_0xa98f('0x33')][_0xa98f('0x1f')][_0xa98f('0x35')]()[_0xa98f('0x36')]();var _0x3a6871;return db[_0xa98f('0x37')][_0xa98f('0xa')]({'where':{'id':0x1},'attributes':[_0xa98f('0x16'),_0xa98f('0xb')],'raw':!![]})[_0xa98f('0x19')](function(_0xa32c63){_0x3a6871=_0xa32c63;return db[_0xa98f('0x38')][_0xa98f('0x39')]({'where':{'email':_0x3ef97c[_0xa98f('0x33')][_0xa98f('0x1f')]}});})[_0xa98f('0x19')](function(_0x3dc207){if(!_0x3dc207){throw new Error(_0xa98f('0x3a'));}if(_0x3dc207[_0xa98f('0x3b')]){throw new Error(_0xa98f('0x3c'));}if(_0x3dc207[_0xa98f('0xf')]){if(moment(_0x3dc207['blockedAt'])[_0xa98f('0x17')](_0x3a6871[_0xa98f('0xb')],'minutes')>moment()){throw new Error(_0xa98f('0x3d'));}else{_0x3dc207[_0xa98f('0xf')]=![];_0x3dc207['blockedAt']=null;}}_0x3dc207[_0xa98f('0x3e')]=_0x36988c;_0x3dc207[_0xa98f('0x3f')]=Date[_0xa98f('0x40')]()+0x36ee80;return _0x3dc207[_0xa98f('0x41')]();})['then'](function(){return sendServiceMail({'to':_0x3ef97c[_0xa98f('0x33')][_0xa98f('0x1f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xa98f('0x42')+_0xa98f('0x43')+'https://'+_0x3ef97c[_0xa98f('0x44')][_0xa98f('0x45')]+_0xa98f('0x46')+_0x36988c+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xa98f('0x19')](function(){_0x4511a7[_0xa98f('0x2b')](0xc8)[_0xa98f('0x2c')]({'message':_0xa98f('0x47')});})[_0xa98f('0x1d')](function(_0x5e017d){return handleError(_0x4511a7,0x1f4,_0x5e017d);});};exports[_0xa98f('0x48')]=function(_0x384c53,_0x111559){return db[_0xa98f('0x38')][_0xa98f('0x39')]({'where':{'resetPasswordToken':_0x384c53[_0xa98f('0x49')][_0xa98f('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xa98f('0x40')]()}}})[_0xa98f('0x19')](function(_0x3aab11){if(!_0x3aab11){throw new Error(_0xa98f('0x4b'));}return db[_0xa98f('0x37')]['findOne']({'attributes':['id',_0xa98f('0x4c'),'enforcePasswordHistory','passwordHistoryLimit']})[_0xa98f('0x19')](function(_0x1cd747){if(_0x1cd747[_0xa98f('0x4c')])authService[_0xa98f('0x4d')](_0x384c53[_0xa98f('0x33')][_0xa98f('0xc')]);if(!_0x1cd747[_0xa98f('0x4e')]||!_0x3aab11['previousPasswords'])return _0x3aab11;authService[_0xa98f('0x4f')](_0x384c53[_0xa98f('0x33')][_0xa98f('0xc')],_0x3aab11[_0xa98f('0x50')],_0x1cd747[_0xa98f('0x51')]);return _0x3aab11;})[_0xa98f('0x19')](function(){_0x3aab11[_0xa98f('0xc')]=_0x384c53[_0xa98f('0x33')][_0xa98f('0xc')];_0x3aab11[_0xa98f('0x3e')]=null;_0x3aab11[_0xa98f('0x3f')]=null;return _0x3aab11[_0xa98f('0x41')]();});})[_0xa98f('0x19')](function(){_0x111559['status'](0xc8)['send']({'message':_0xa98f('0x52')});})[_0xa98f('0x1d')](function(_0x2e4f4a){return handleError(_0x111559,0x1f4,_0x2e4f4a);});};passport[_0xa98f('0x53')](_0xa98f('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x16c9b2,_0x560ab5,_0x5030f5){return localAuthenticate(db['User'],_0x16c9b2,_0x560ab5,_0x5030f5);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 8673da7..7b58a62 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 _0x46a1=['/reset/:token','exports','express','post','/forgot','forgot'];(function(_0x945db7,_0x292423){var _0x27b299=function(_0x1b3fdf){while(--_0x1b3fdf){_0x945db7['push'](_0x945db7['shift']());}};_0x27b299(++_0x292423);}(_0x46a1,0x8c));var _0x146a=function(_0x372880,_0x4196d8){_0x372880=_0x372880-0x0;var _0x36dfe8=_0x46a1[_0x372880];return _0x36dfe8;};'use strict';var express=require(_0x146a('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router[_0x146a('0x1')]('/',controller['login']);router['post'](_0x146a('0x2'),controller[_0x146a('0x3')]);router['post'](_0x146a('0x4'),controller['reset']);module[_0x146a('0x5')]=router;
\ No newline at end of file
+var _0xc977=['exports','Router','/forgot','forgot','/reset/:token','reset'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0xc977,0xc7));var _0x7c97=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc977[_0x5ddb1c];return _0x354adc;};'use strict';var express=require('express');var router=express[_0x7c97('0x0')]();var controller=require('./authLocal.controller');router['post']('/',controller['login']);router['post'](_0x7c97('0x1'),controller[_0x7c97('0x2')]);router['post'](_0x7c97('0x3'),controller[_0x7c97('0x4')]);module[_0x7c97('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 9d49a58..3fc6dcd 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 _0xe335=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe335,0x113));var _0x5e33=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe335[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require(_0x5e33('0x0'));module[_0x5e33('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x5e33('0x2')]},'description':{'type':Sequelize[_0x5e33('0x2')]},'status':{'type':Sequelize[_0x5e33('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5e33('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xdd26=['BOOLEAN','STRING'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0xdd26,0xe9));var _0x6dd2=function(_0x58ef84,_0x3ecc29){_0x58ef84=_0x58ef84-0x0;var _0x17c84a=_0xdd26[_0x58ef84];return _0x17c84a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6dd2('0x0')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x6dd2('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index dd0995b..fcbfad9 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 _0x7a5f=['name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','catch','create','body','params','addConditions','Condition','find','ids','findOne','getConditions','addActions','Action','omit','getActions','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','stack'];(function(_0x3480e9,_0x491e26){var _0x229a4b=function(_0x576e08){while(--_0x576e08){_0x3480e9['push'](_0x3480e9['shift']());}};_0x229a4b(++_0x491e26);}(_0x7a5f,0x12a));var _0xf7a5=function(_0x412c8f,_0x11ec94){_0x412c8f=_0x412c8f-0x0;var _0x27c005=_0x7a5f[_0x412c8f];return _0x27c005;};'use strict';var emlformat=require(_0xf7a5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf7a5('0x2'));var Mustache=require(_0xf7a5('0x3'));var util=require(_0xf7a5('0x4'));var path=require(_0xf7a5('0x5'));var sox=require(_0xf7a5('0x6'));var csv=require(_0xf7a5('0x7'));var ejs=require(_0xf7a5('0x8'));var fs=require('fs');var fs_extra=require(_0xf7a5('0x9'));var _=require('lodash');var squel=require(_0xf7a5('0xa'));var crypto=require(_0xf7a5('0xb'));var jsforce=require(_0xf7a5('0xc'));var deskjs=require(_0xf7a5('0xd'));var toCsv=require(_0xf7a5('0x7'));var querystring=require(_0xf7a5('0xe'));var Papa=require(_0xf7a5('0xf'));var Redis=require(_0xf7a5('0x10'));var authService=require(_0xf7a5('0x11'));var qs=require(_0xf7a5('0x12'));var as=require(_0xf7a5('0x13'));var hardwareService=require(_0xf7a5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf7a5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf7a5('0x16'))['db'];function respondWithStatusCode(_0x492be4,_0x3f87d2){_0x3f87d2=_0x3f87d2||0xcc;return function(_0x4c1a33){if(_0x4c1a33){return _0x492be4[_0xf7a5('0x17')](_0x3f87d2);}return _0x492be4[_0xf7a5('0x18')](_0x3f87d2)[_0xf7a5('0x19')]();};}function respondWithResult(_0x2aabbc,_0x5b173e){_0x5b173e=_0x5b173e||0xc8;return function(_0x687a76){if(_0x687a76){return _0x2aabbc[_0xf7a5('0x18')](_0x5b173e)['json'](_0x687a76);}};}function respondWithFilteredResult(_0x470946,_0x1ca73c){return function(_0x308375){if(_0x308375){var _0x5495b9=typeof _0x1ca73c[_0xf7a5('0x1a')]==='undefined'&&typeof _0x1ca73c[_0xf7a5('0x1b')]===_0xf7a5('0x1c');var _0x452a8d=_0x308375[_0xf7a5('0x1d')];var _0x4ac815=_0x5495b9?0x0:_0x1ca73c['offset'];var _0x251359=_0x5495b9?_0x308375[_0xf7a5('0x1d')]:_0x1ca73c[_0xf7a5('0x1a')]+_0x1ca73c[_0xf7a5('0x1b')];var _0x50de2d;if(_0x251359>=_0x452a8d){_0x251359=_0x452a8d;_0x50de2d=0xc8;}else{_0x50de2d=0xce;}_0x470946[_0xf7a5('0x18')](_0x50de2d);return _0x470946[_0xf7a5('0x1e')](_0xf7a5('0x1f'),_0x4ac815+'-'+_0x251359+'/'+_0x452a8d)[_0xf7a5('0x20')](_0x308375);}return null;};}function patchUpdates(_0x10babe){return function(_0x9af0bc){try{jsonpatch[_0xf7a5('0x21')](_0x9af0bc,_0x10babe,!![]);}catch(_0x486f67){return BPromise[_0xf7a5('0x22')](_0x486f67);}return _0x9af0bc['save']();};}function saveUpdates(_0x2b6821,_0x85c960){return function(_0x2ce023){if(_0x2ce023){return _0x2ce023[_0xf7a5('0x23')](_0x2b6821)['then'](function(_0x171634){return _0x171634;});}return null;};}function removeEntity(_0x438f8f,_0x193066){return function(_0x1d4cd1){if(_0x1d4cd1){return _0x1d4cd1['destroy']()[_0xf7a5('0x24')](function(){_0x438f8f[_0xf7a5('0x18')](0xcc)[_0xf7a5('0x19')]();});}};}function handleEntityNotFound(_0x24ab0e,_0xe3684){return function(_0x290fd9){if(!_0x290fd9){_0x24ab0e[_0xf7a5('0x17')](0x194);}return _0x290fd9;};}function handleError(_0x3b03c9,_0x6d9b95){_0x6d9b95=_0x6d9b95||0x1f4;return function(_0x59e30a){logger['error'](_0x59e30a[_0xf7a5('0x25')]);if(_0x59e30a['name']){delete _0x59e30a[_0xf7a5('0x26')];}_0x3b03c9[_0xf7a5('0x18')](_0x6d9b95)[_0xf7a5('0x27')](_0x59e30a);};}exports[_0xf7a5('0x28')]=function(_0x399ab0,_0x4e3d9d){var _0x452d6b={},_0x32555b={},_0x465a69={'count':0x0,'rows':[]};var _0x7e46be=_[_0xf7a5('0x29')](db[_0xf7a5('0x2a')][_0xf7a5('0x2b')],function(_0x32b0c3){return{'name':_0x32b0c3[_0xf7a5('0x2c')],'type':_0x32b0c3[_0xf7a5('0x2d')][_0xf7a5('0x2e')]};});_0x32555b[_0xf7a5('0x2f')]=_[_0xf7a5('0x29')](_0x7e46be,_0xf7a5('0x26'));_0x32555b['query']=_[_0xf7a5('0x30')](_0x399ab0[_0xf7a5('0x31')]);_0x32555b[_0xf7a5('0x32')]=_[_0xf7a5('0x33')](_0x32555b[_0xf7a5('0x2f')],_0x32555b['query']);_0x452d6b[_0xf7a5('0x34')]=_[_0xf7a5('0x33')](_0x32555b[_0xf7a5('0x2f')],qs['fields'](_0x399ab0['query'][_0xf7a5('0x35')]));_0x452d6b[_0xf7a5('0x34')]=_0x452d6b[_0xf7a5('0x34')][_0xf7a5('0x36')]?_0x452d6b[_0xf7a5('0x34')]:_0x32555b[_0xf7a5('0x2f')];if(!_0x399ab0[_0xf7a5('0x31')][_0xf7a5('0x37')](_0xf7a5('0x38'))){_0x452d6b[_0xf7a5('0x1b')]=qs[_0xf7a5('0x1b')](_0x399ab0[_0xf7a5('0x31')]['limit']);_0x452d6b['offset']=qs[_0xf7a5('0x1a')](_0x399ab0[_0xf7a5('0x31')]['offset']);}_0x452d6b[_0xf7a5('0x39')]=qs[_0xf7a5('0x3a')](_0x399ab0['query'][_0xf7a5('0x3a')]);_0x452d6b[_0xf7a5('0x3b')]=qs['filters'](_[_0xf7a5('0x3c')](_0x399ab0[_0xf7a5('0x31')],_0x32555b[_0xf7a5('0x32')]),_0x7e46be);if(_0x399ab0['query'][_0xf7a5('0x3d')]){_0x452d6b[_0xf7a5('0x3b')]=_['merge'](_0x452d6b[_0xf7a5('0x3b')],{'$or':_[_0xf7a5('0x29')](_0x7e46be,function(_0x35f9c8){if(_0x35f9c8[_0xf7a5('0x2d')]!==_0xf7a5('0x3e')){var _0x40fff6={};_0x40fff6[_0x35f9c8[_0xf7a5('0x26')]]={'$like':'%'+_0x399ab0[_0xf7a5('0x31')][_0xf7a5('0x3d')]+'%'};return _0x40fff6;}})});}_0x452d6b=_[_0xf7a5('0x3f')]({},_0x452d6b,_0x399ab0[_0xf7a5('0x40')]);var _0x2f6f6f={'where':_0x452d6b['where']};return db[_0xf7a5('0x2a')][_0xf7a5('0x1d')](_0x2f6f6f)[_0xf7a5('0x24')](function(_0x491a52){_0x465a69[_0xf7a5('0x1d')]=_0x491a52;if(_0x399ab0[_0xf7a5('0x31')][_0xf7a5('0x41')]){_0x452d6b[_0xf7a5('0x42')]=[{'all':!![]}];}return db[_0xf7a5('0x2a')][_0xf7a5('0x43')](_0x452d6b);})[_0xf7a5('0x24')](function(_0x4aec5d){_0x465a69[_0xf7a5('0x44')]=_0x4aec5d;return _0x465a69;})[_0xf7a5('0x24')](respondWithFilteredResult(_0x4e3d9d,_0x452d6b))['catch'](handleError(_0x4e3d9d,null));};exports[_0xf7a5('0x45')]=function(_0x5bddb2,_0x14b1f4){var _0x3bdc10={'raw':![],'where':{'id':_0x5bddb2['params']['id']}},_0x2972ea={};_0x2972ea[_0xf7a5('0x2f')]=_[_0xf7a5('0x30')](db['Automation']['rawAttributes']);_0x2972ea[_0xf7a5('0x31')]=_['keys'](_0x5bddb2['query']);_0x2972ea[_0xf7a5('0x32')]=_[_0xf7a5('0x33')](_0x2972ea[_0xf7a5('0x2f')],_0x2972ea[_0xf7a5('0x31')]);_0x3bdc10['attributes']=_[_0xf7a5('0x33')](_0x2972ea[_0xf7a5('0x2f')],qs[_0xf7a5('0x35')](_0x5bddb2[_0xf7a5('0x31')][_0xf7a5('0x35')]));_0x3bdc10[_0xf7a5('0x34')]=_0x3bdc10[_0xf7a5('0x34')][_0xf7a5('0x36')]?_0x3bdc10['attributes']:_0x2972ea[_0xf7a5('0x2f')];if(_0x5bddb2[_0xf7a5('0x31')][_0xf7a5('0x41')]){_0x3bdc10[_0xf7a5('0x42')]=[{'all':!![]}];}_0x3bdc10=_[_0xf7a5('0x3f')]({},_0x3bdc10,_0x5bddb2['options']);return db[_0xf7a5('0x2a')]['find'](_0x3bdc10)[_0xf7a5('0x24')](handleEntityNotFound(_0x14b1f4,null))[_0xf7a5('0x24')](respondWithResult(_0x14b1f4,null))[_0xf7a5('0x46')](handleError(_0x14b1f4,null));};exports[_0xf7a5('0x47')]=function(_0x402566,_0x112a30){return db[_0xf7a5('0x2a')][_0xf7a5('0x47')](_0x402566[_0xf7a5('0x48')],{})[_0xf7a5('0x24')](respondWithResult(_0x112a30,0xc9))[_0xf7a5('0x46')](handleError(_0x112a30,null));};exports[_0xf7a5('0x23')]=function(_0x5d0e16,_0xeb0dab){if(_0x5d0e16[_0xf7a5('0x48')]['id']){delete _0x5d0e16[_0xf7a5('0x48')]['id'];}return db[_0xf7a5('0x2a')]['find']({'where':{'id':_0x5d0e16[_0xf7a5('0x49')]['id']}})[_0xf7a5('0x24')](handleEntityNotFound(_0xeb0dab,null))[_0xf7a5('0x24')](saveUpdates(_0x5d0e16[_0xf7a5('0x48')],null))[_0xf7a5('0x24')](respondWithResult(_0xeb0dab,null))['catch'](handleError(_0xeb0dab,null));};exports['destroy']=function(_0x5e5bf7,_0x27dde6){return db[_0xf7a5('0x2a')]['find']({'where':{'id':_0x5e5bf7[_0xf7a5('0x49')]['id']}})[_0xf7a5('0x24')](handleEntityNotFound(_0x27dde6,null))[_0xf7a5('0x24')](removeEntity(_0x27dde6,null))[_0xf7a5('0x46')](handleError(_0x27dde6,null));};exports[_0xf7a5('0x4a')]=function(_0x1e0d09,_0x837368,_0x4f8a2a){return db[_0xf7a5('0x4b')][_0xf7a5('0x4c')]({'where':{'id':_0x1e0d09[_0xf7a5('0x49')]['id']}})[_0xf7a5('0x24')](handleEntityNotFound(_0x837368,null))['then'](function(_0xe17f0b){if(_0xe17f0b){return _0xe17f0b[_0xf7a5('0x4a')](_0x1e0d09[_0xf7a5('0x48')]['ids'],_['omit'](_0x1e0d09[_0xf7a5('0x48')],[_0xf7a5('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x837368,null))['catch'](handleError(_0x837368,null));};exports['getConditions']=function(_0xc2329a,_0x471312,_0x2f7ba7){var _0x812a16={};var _0x13f613={};var _0x596589;var _0x55cff2;return db[_0xf7a5('0x2a')][_0xf7a5('0x4e')]({'where':{'id':_0xc2329a['params']['id']}})[_0xf7a5('0x24')](handleEntityNotFound(_0x471312,null))[_0xf7a5('0x24')](function(_0x4ed291){if(_0x4ed291){_0x596589=_0x4ed291;_0x13f613[_0xf7a5('0x2f')]=_[_0xf7a5('0x30')](db['Condition'][_0xf7a5('0x2b')]);_0x13f613[_0xf7a5('0x31')]=_[_0xf7a5('0x30')](_0xc2329a[_0xf7a5('0x31')]);_0x13f613[_0xf7a5('0x32')]=_[_0xf7a5('0x33')](_0x13f613[_0xf7a5('0x2f')],_0x13f613['query']);_0x812a16[_0xf7a5('0x34')]=_[_0xf7a5('0x33')](_0x13f613['model'],qs['fields'](_0xc2329a[_0xf7a5('0x31')][_0xf7a5('0x35')]));_0x812a16['attributes']=_0x812a16['attributes'][_0xf7a5('0x36')]?_0x812a16['attributes']:_0x13f613[_0xf7a5('0x2f')];_0x812a16[_0xf7a5('0x39')]=qs[_0xf7a5('0x3a')](_0xc2329a[_0xf7a5('0x31')][_0xf7a5('0x3a')]);_0x812a16['where']=qs[_0xf7a5('0x32')](_[_0xf7a5('0x3c')](_0xc2329a[_0xf7a5('0x31')],_0x13f613['filters']));if(_0xc2329a['query'][_0xf7a5('0x3d')]){_0x812a16[_0xf7a5('0x3b')]=_[_0xf7a5('0x3f')](_0x812a16[_0xf7a5('0x3b')],{'$or':_[_0xf7a5('0x29')](_0x812a16[_0xf7a5('0x34')],function(_0x5459cd){var _0x2a9cab={};_0x2a9cab[_0x5459cd]={'$like':'%'+_0xc2329a[_0xf7a5('0x31')][_0xf7a5('0x3d')]+'%'};return _0x2a9cab;})});}_0x812a16=_[_0xf7a5('0x3f')]({},_0x812a16,_0xc2329a[_0xf7a5('0x40')]);return _0x596589[_0xf7a5('0x4f')](_0x812a16);}})['then'](function(_0x37f059){if(_0x37f059){_0x55cff2=_0x37f059[_0xf7a5('0x36')];if(!_0xc2329a[_0xf7a5('0x31')][_0xf7a5('0x37')](_0xf7a5('0x38'))){_0x812a16[_0xf7a5('0x1b')]=qs[_0xf7a5('0x1b')](_0xc2329a[_0xf7a5('0x31')][_0xf7a5('0x1b')]);_0x812a16[_0xf7a5('0x1a')]=qs[_0xf7a5('0x1a')](_0xc2329a[_0xf7a5('0x31')][_0xf7a5('0x1a')]);}return _0x596589[_0xf7a5('0x4f')](_0x812a16);}})[_0xf7a5('0x24')](function(_0x2940e7){if(_0x2940e7){return _0x2940e7?{'count':_0x55cff2,'rows':_0x2940e7}:null;}})[_0xf7a5('0x24')](respondWithResult(_0x471312,null))['catch'](handleError(_0x471312,null));};exports[_0xf7a5('0x50')]=function(_0x2455e7,_0x4ec00d,_0x349e7d){return db[_0xf7a5('0x51')]['find']({'where':{'id':_0x2455e7[_0xf7a5('0x49')]['id']}})['then'](handleEntityNotFound(_0x4ec00d,null))[_0xf7a5('0x24')](function(_0x36b2d7){if(_0x36b2d7){return _0x36b2d7['addActions'](_0x2455e7[_0xf7a5('0x48')][_0xf7a5('0x4d')],_[_0xf7a5('0x52')](_0x2455e7['body'],[_0xf7a5('0x4d'),'id'])||{});}})[_0xf7a5('0x24')](respondWithResult(_0x4ec00d,null))['catch'](handleError(_0x4ec00d,null));};exports['getActions']=function(_0x5a5afc,_0x54b412,_0x464bf2){var _0x31be36={};var _0x35d419={};var _0x3e6899;var _0x10558a;return db['Automation'][_0xf7a5('0x4e')]({'where':{'id':_0x5a5afc[_0xf7a5('0x49')]['id']}})[_0xf7a5('0x24')](handleEntityNotFound(_0x54b412,null))[_0xf7a5('0x24')](function(_0x1baa1b){if(_0x1baa1b){_0x3e6899=_0x1baa1b;_0x35d419[_0xf7a5('0x2f')]=_[_0xf7a5('0x30')](db[_0xf7a5('0x51')][_0xf7a5('0x2b')]);_0x35d419[_0xf7a5('0x31')]=_['keys'](_0x5a5afc[_0xf7a5('0x31')]);_0x35d419[_0xf7a5('0x32')]=_[_0xf7a5('0x33')](_0x35d419[_0xf7a5('0x2f')],_0x35d419[_0xf7a5('0x31')]);_0x31be36[_0xf7a5('0x34')]=_[_0xf7a5('0x33')](_0x35d419['model'],qs[_0xf7a5('0x35')](_0x5a5afc[_0xf7a5('0x31')][_0xf7a5('0x35')]));_0x31be36['attributes']=_0x31be36[_0xf7a5('0x34')][_0xf7a5('0x36')]?_0x31be36[_0xf7a5('0x34')]:_0x35d419['model'];_0x31be36['order']=qs[_0xf7a5('0x3a')](_0x5a5afc[_0xf7a5('0x31')][_0xf7a5('0x3a')]);_0x31be36[_0xf7a5('0x3b')]=qs[_0xf7a5('0x32')](_[_0xf7a5('0x3c')](_0x5a5afc[_0xf7a5('0x31')],_0x35d419[_0xf7a5('0x32')]));if(_0x5a5afc[_0xf7a5('0x31')][_0xf7a5('0x3d')]){_0x31be36[_0xf7a5('0x3b')]=_[_0xf7a5('0x3f')](_0x31be36[_0xf7a5('0x3b')],{'$or':_[_0xf7a5('0x29')](_0x31be36['attributes'],function(_0x28baa1){var _0x2ef03e={};_0x2ef03e[_0x28baa1]={'$like':'%'+_0x5a5afc['query'][_0xf7a5('0x3d')]+'%'};return _0x2ef03e;})});}_0x31be36=_[_0xf7a5('0x3f')]({},_0x31be36,_0x5a5afc[_0xf7a5('0x40')]);return _0x3e6899[_0xf7a5('0x53')](_0x31be36);}})[_0xf7a5('0x24')](function(_0x225470){if(_0x225470){_0x10558a=_0x225470[_0xf7a5('0x36')];if(!_0x5a5afc['query'][_0xf7a5('0x37')](_0xf7a5('0x38'))){_0x31be36[_0xf7a5('0x1b')]=qs[_0xf7a5('0x1b')](_0x5a5afc['query'][_0xf7a5('0x1b')]);_0x31be36[_0xf7a5('0x1a')]=qs[_0xf7a5('0x1a')](_0x5a5afc[_0xf7a5('0x31')][_0xf7a5('0x1a')]);}return _0x3e6899[_0xf7a5('0x53')](_0x31be36);}})[_0xf7a5('0x24')](function(_0x425b5f){if(_0x425b5f){return _0x425b5f?{'count':_0x10558a,'rows':_0x425b5f}:null;}})['then'](respondWithResult(_0x54b412,null))[_0xf7a5('0x46')](handleError(_0x54b412,null));};
\ No newline at end of file
+var _0x2a29=['to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','name','send','map','Automation','fieldName','type','key','model','query','filters','attributes','intersection','fields','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length','find','catch','create','body','update','destroy','addConditions','Condition','ids','getConditions','findOne','rawAttributes','order','nolimit','addActions','Action','omit','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1c0870,_0xb3e682){var _0x454576=function(_0x545ab5){while(--_0x545ab5){_0x1c0870['push'](_0x1c0870['shift']());}};_0x454576(++_0xb3e682);}(_0x2a29,0x186));var _0x92a2=function(_0x48448d,_0x8acc8c){_0x48448d=_0x48448d-0x0;var _0x2c704e=_0x2a29[_0x48448d];return _0x2c704e;};'use strict';var emlformat=require(_0x92a2('0x0'));var rimraf=require(_0x92a2('0x1'));var zipdir=require(_0x92a2('0x2'));var jsonpatch=require(_0x92a2('0x3'));var rp=require('request-promise');var moment=require(_0x92a2('0x4'));var BPromise=require(_0x92a2('0x5'));var Mustache=require('mustache');var util=require(_0x92a2('0x6'));var path=require(_0x92a2('0x7'));var sox=require(_0x92a2('0x8'));var csv=require('to-csv');var ejs=require(_0x92a2('0x9'));var fs=require('fs');var fs_extra=require(_0x92a2('0xa'));var _=require(_0x92a2('0xb'));var squel=require(_0x92a2('0xc'));var crypto=require(_0x92a2('0xd'));var jsforce=require(_0x92a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x92a2('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x92a2('0x10'));var authService=require(_0x92a2('0x11'));var qs=require(_0x92a2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x92a2('0x13'))(_0x92a2('0x14'));var utils=require('../../config/utils');var config=require(_0x92a2('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x92a2('0x16'))['db'];function respondWithStatusCode(_0x2548cf,_0x16237d){_0x16237d=_0x16237d||0xcc;return function(_0x341966){if(_0x341966){return _0x2548cf[_0x92a2('0x17')](_0x16237d);}return _0x2548cf[_0x92a2('0x18')](_0x16237d)[_0x92a2('0x19')]();};}function respondWithResult(_0x17a794,_0x129d48){_0x129d48=_0x129d48||0xc8;return function(_0x170fa9){if(_0x170fa9){return _0x17a794['status'](_0x129d48)[_0x92a2('0x1a')](_0x170fa9);}};}function respondWithFilteredResult(_0x12ebfe,_0x531a2e){return function(_0x1a9874){if(_0x1a9874){var _0x17dcd9=typeof _0x531a2e[_0x92a2('0x1b')]===_0x92a2('0x1c')&&typeof _0x531a2e[_0x92a2('0x1d')]==='undefined';var _0x42cd6f=_0x1a9874[_0x92a2('0x1e')];var _0x5bb1f6=_0x17dcd9?0x0:_0x531a2e['offset'];var _0x4dfbe7=_0x17dcd9?_0x1a9874[_0x92a2('0x1e')]:_0x531a2e['offset']+_0x531a2e[_0x92a2('0x1d')];var _0x16dd0b;if(_0x4dfbe7>=_0x42cd6f){_0x4dfbe7=_0x42cd6f;_0x16dd0b=0xc8;}else{_0x16dd0b=0xce;}_0x12ebfe[_0x92a2('0x18')](_0x16dd0b);return _0x12ebfe[_0x92a2('0x1f')]('Content-Range',_0x5bb1f6+'-'+_0x4dfbe7+'/'+_0x42cd6f)[_0x92a2('0x1a')](_0x1a9874);}return null;};}function patchUpdates(_0x5da773){return function(_0x22e518){try{jsonpatch[_0x92a2('0x20')](_0x22e518,_0x5da773,!![]);}catch(_0x453d19){return BPromise[_0x92a2('0x21')](_0x453d19);}return _0x22e518[_0x92a2('0x22')]();};}function saveUpdates(_0x36eadc,_0x4f67e4){return function(_0x1a7d71){if(_0x1a7d71){return _0x1a7d71['update'](_0x36eadc)['then'](function(_0x481aa4){return _0x481aa4;});}return null;};}function removeEntity(_0x733a1a,_0x50b608){return function(_0x4bed8a){if(_0x4bed8a){return _0x4bed8a['destroy']()[_0x92a2('0x23')](function(){_0x733a1a[_0x92a2('0x18')](0xcc)[_0x92a2('0x19')]();});}};}function handleEntityNotFound(_0x67dac0,_0x3b97eb){return function(_0x4b0da8){if(!_0x4b0da8){_0x67dac0[_0x92a2('0x17')](0x194);}return _0x4b0da8;};}function handleError(_0x17ae42,_0x5e7029){_0x5e7029=_0x5e7029||0x1f4;return function(_0x11a2e5){logger['error'](_0x11a2e5['stack']);if(_0x11a2e5[_0x92a2('0x24')]){delete _0x11a2e5['name'];}_0x17ae42[_0x92a2('0x18')](_0x5e7029)[_0x92a2('0x25')](_0x11a2e5);};}exports['index']=function(_0x2fb042,_0xf93242){var _0xdcbcfa={},_0x31e9d8={},_0x35a559={'count':0x0,'rows':[]};var _0x2dcae6=_[_0x92a2('0x26')](db[_0x92a2('0x27')]['rawAttributes'],function(_0x475da0){return{'name':_0x475da0[_0x92a2('0x28')],'type':_0x475da0[_0x92a2('0x29')][_0x92a2('0x2a')]};});_0x31e9d8[_0x92a2('0x2b')]=_[_0x92a2('0x26')](_0x2dcae6,_0x92a2('0x24'));_0x31e9d8[_0x92a2('0x2c')]=_['keys'](_0x2fb042[_0x92a2('0x2c')]);_0x31e9d8[_0x92a2('0x2d')]=_['intersection'](_0x31e9d8['model'],_0x31e9d8[_0x92a2('0x2c')]);_0xdcbcfa[_0x92a2('0x2e')]=_[_0x92a2('0x2f')](_0x31e9d8[_0x92a2('0x2b')],qs[_0x92a2('0x30')](_0x2fb042['query'][_0x92a2('0x30')]));_0xdcbcfa[_0x92a2('0x2e')]=_0xdcbcfa[_0x92a2('0x2e')]['length']?_0xdcbcfa['attributes']:_0x31e9d8[_0x92a2('0x2b')];if(!_0x2fb042[_0x92a2('0x2c')]['hasOwnProperty']('nolimit')){_0xdcbcfa[_0x92a2('0x1d')]=qs[_0x92a2('0x1d')](_0x2fb042[_0x92a2('0x2c')][_0x92a2('0x1d')]);_0xdcbcfa['offset']=qs[_0x92a2('0x1b')](_0x2fb042['query'][_0x92a2('0x1b')]);}_0xdcbcfa['order']=qs['sort'](_0x2fb042[_0x92a2('0x2c')][_0x92a2('0x31')]);_0xdcbcfa[_0x92a2('0x32')]=qs['filters'](_['pick'](_0x2fb042[_0x92a2('0x2c')],_0x31e9d8[_0x92a2('0x2d')]),_0x2dcae6);if(_0x2fb042['query'][_0x92a2('0x33')]){_0xdcbcfa[_0x92a2('0x32')]=_[_0x92a2('0x34')](_0xdcbcfa[_0x92a2('0x32')],{'$or':_[_0x92a2('0x26')](_0x2dcae6,function(_0x5e3c31){if(_0x5e3c31[_0x92a2('0x29')]!==_0x92a2('0x35')){var _0x53f6b6={};_0x53f6b6[_0x5e3c31['name']]={'$like':'%'+_0x2fb042['query']['filter']+'%'};return _0x53f6b6;}})});}_0xdcbcfa=_[_0x92a2('0x34')]({},_0xdcbcfa,_0x2fb042[_0x92a2('0x36')]);var _0x4b1667={'where':_0xdcbcfa['where']};return db[_0x92a2('0x27')]['count'](_0x4b1667)[_0x92a2('0x23')](function(_0x1dd14f){_0x35a559[_0x92a2('0x1e')]=_0x1dd14f;if(_0x2fb042[_0x92a2('0x2c')]['includeAll']){_0xdcbcfa[_0x92a2('0x37')]=[{'all':!![]}];}return db['Automation'][_0x92a2('0x38')](_0xdcbcfa);})[_0x92a2('0x23')](function(_0x281598){_0x35a559[_0x92a2('0x39')]=_0x281598;return _0x35a559;})[_0x92a2('0x23')](respondWithFilteredResult(_0xf93242,_0xdcbcfa))['catch'](handleError(_0xf93242,null));};exports[_0x92a2('0x3a')]=function(_0x473da5,_0x322ef1){var _0x43629b={'raw':![],'where':{'id':_0x473da5[_0x92a2('0x3b')]['id']}},_0x3822ee={};_0x3822ee[_0x92a2('0x2b')]=_[_0x92a2('0x3c')](db[_0x92a2('0x27')]['rawAttributes']);_0x3822ee[_0x92a2('0x2c')]=_[_0x92a2('0x3c')](_0x473da5[_0x92a2('0x2c')]);_0x3822ee[_0x92a2('0x2d')]=_[_0x92a2('0x2f')](_0x3822ee['model'],_0x3822ee[_0x92a2('0x2c')]);_0x43629b['attributes']=_['intersection'](_0x3822ee['model'],qs[_0x92a2('0x30')](_0x473da5[_0x92a2('0x2c')]['fields']));_0x43629b[_0x92a2('0x2e')]=_0x43629b[_0x92a2('0x2e')][_0x92a2('0x3d')]?_0x43629b[_0x92a2('0x2e')]:_0x3822ee['model'];if(_0x473da5[_0x92a2('0x2c')]['includeAll']){_0x43629b['include']=[{'all':!![]}];}_0x43629b=_[_0x92a2('0x34')]({},_0x43629b,_0x473da5[_0x92a2('0x36')]);return db[_0x92a2('0x27')][_0x92a2('0x3e')](_0x43629b)[_0x92a2('0x23')](handleEntityNotFound(_0x322ef1,null))['then'](respondWithResult(_0x322ef1,null))[_0x92a2('0x3f')](handleError(_0x322ef1,null));};exports[_0x92a2('0x40')]=function(_0x2a3311,_0x524ba1){return db[_0x92a2('0x27')][_0x92a2('0x40')](_0x2a3311[_0x92a2('0x41')],{})['then'](respondWithResult(_0x524ba1,0xc9))['catch'](handleError(_0x524ba1,null));};exports[_0x92a2('0x42')]=function(_0x2264b8,_0x2346ab){if(_0x2264b8[_0x92a2('0x41')]['id']){delete _0x2264b8['body']['id'];}return db[_0x92a2('0x27')]['find']({'where':{'id':_0x2264b8[_0x92a2('0x3b')]['id']}})[_0x92a2('0x23')](handleEntityNotFound(_0x2346ab,null))[_0x92a2('0x23')](saveUpdates(_0x2264b8['body'],null))[_0x92a2('0x23')](respondWithResult(_0x2346ab,null))['catch'](handleError(_0x2346ab,null));};exports[_0x92a2('0x43')]=function(_0x3b6dc4,_0x218b13){return db[_0x92a2('0x27')][_0x92a2('0x3e')]({'where':{'id':_0x3b6dc4['params']['id']}})[_0x92a2('0x23')](handleEntityNotFound(_0x218b13,null))[_0x92a2('0x23')](removeEntity(_0x218b13,null))['catch'](handleError(_0x218b13,null));};exports[_0x92a2('0x44')]=function(_0x1f53f3,_0x3f8d2e,_0x3b0546){return db[_0x92a2('0x45')][_0x92a2('0x3e')]({'where':{'id':_0x1f53f3['params']['id']}})['then'](handleEntityNotFound(_0x3f8d2e,null))['then'](function(_0x46bb80){if(_0x46bb80){return _0x46bb80[_0x92a2('0x44')](_0x1f53f3[_0x92a2('0x41')][_0x92a2('0x46')],_['omit'](_0x1f53f3[_0x92a2('0x41')],[_0x92a2('0x46'),'id'])||{});}})[_0x92a2('0x23')](respondWithResult(_0x3f8d2e,null))['catch'](handleError(_0x3f8d2e,null));};exports[_0x92a2('0x47')]=function(_0x190051,_0x29ef67,_0x1c2e39){var _0x5083ab={};var _0xc492ba={};var _0x6f0f23;var _0x5ecf79;return db['Automation'][_0x92a2('0x48')]({'where':{'id':_0x190051['params']['id']}})[_0x92a2('0x23')](handleEntityNotFound(_0x29ef67,null))[_0x92a2('0x23')](function(_0x2bf2a4){if(_0x2bf2a4){_0x6f0f23=_0x2bf2a4;_0xc492ba[_0x92a2('0x2b')]=_['keys'](db[_0x92a2('0x45')][_0x92a2('0x49')]);_0xc492ba[_0x92a2('0x2c')]=_[_0x92a2('0x3c')](_0x190051[_0x92a2('0x2c')]);_0xc492ba[_0x92a2('0x2d')]=_[_0x92a2('0x2f')](_0xc492ba[_0x92a2('0x2b')],_0xc492ba[_0x92a2('0x2c')]);_0x5083ab[_0x92a2('0x2e')]=_[_0x92a2('0x2f')](_0xc492ba[_0x92a2('0x2b')],qs[_0x92a2('0x30')](_0x190051[_0x92a2('0x2c')][_0x92a2('0x30')]));_0x5083ab['attributes']=_0x5083ab[_0x92a2('0x2e')][_0x92a2('0x3d')]?_0x5083ab[_0x92a2('0x2e')]:_0xc492ba[_0x92a2('0x2b')];_0x5083ab[_0x92a2('0x4a')]=qs[_0x92a2('0x31')](_0x190051[_0x92a2('0x2c')][_0x92a2('0x31')]);_0x5083ab[_0x92a2('0x32')]=qs[_0x92a2('0x2d')](_['pick'](_0x190051[_0x92a2('0x2c')],_0xc492ba[_0x92a2('0x2d')]));if(_0x190051[_0x92a2('0x2c')]['filter']){_0x5083ab[_0x92a2('0x32')]=_[_0x92a2('0x34')](_0x5083ab[_0x92a2('0x32')],{'$or':_[_0x92a2('0x26')](_0x5083ab['attributes'],function(_0x402944){var _0x28a61e={};_0x28a61e[_0x402944]={'$like':'%'+_0x190051[_0x92a2('0x2c')][_0x92a2('0x33')]+'%'};return _0x28a61e;})});}_0x5083ab=_[_0x92a2('0x34')]({},_0x5083ab,_0x190051[_0x92a2('0x36')]);return _0x6f0f23[_0x92a2('0x47')](_0x5083ab);}})['then'](function(_0x14ef81){if(_0x14ef81){_0x5ecf79=_0x14ef81['length'];if(!_0x190051['query']['hasOwnProperty'](_0x92a2('0x4b'))){_0x5083ab[_0x92a2('0x1d')]=qs['limit'](_0x190051['query']['limit']);_0x5083ab[_0x92a2('0x1b')]=qs[_0x92a2('0x1b')](_0x190051['query'][_0x92a2('0x1b')]);}return _0x6f0f23[_0x92a2('0x47')](_0x5083ab);}})[_0x92a2('0x23')](function(_0xd969d8){if(_0xd969d8){return _0xd969d8?{'count':_0x5ecf79,'rows':_0xd969d8}:null;}})['then'](respondWithResult(_0x29ef67,null))[_0x92a2('0x3f')](handleError(_0x29ef67,null));};exports[_0x92a2('0x4c')]=function(_0xd48d79,_0x1a4d64,_0x47eca0){return db[_0x92a2('0x4d')][_0x92a2('0x3e')]({'where':{'id':_0xd48d79[_0x92a2('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1a4d64,null))[_0x92a2('0x23')](function(_0x3ab2bf){if(_0x3ab2bf){return _0x3ab2bf[_0x92a2('0x4c')](_0xd48d79[_0x92a2('0x41')][_0x92a2('0x46')],_[_0x92a2('0x4e')](_0xd48d79[_0x92a2('0x41')],[_0x92a2('0x46'),'id'])||{});}})[_0x92a2('0x23')](respondWithResult(_0x1a4d64,null))[_0x92a2('0x3f')](handleError(_0x1a4d64,null));};exports[_0x92a2('0x4f')]=function(_0xbbd858,_0x50f3f0,_0x193e98){var _0x28f631={};var _0x418693={};var _0x30c6de;var _0x3a4d2d;return db[_0x92a2('0x27')][_0x92a2('0x48')]({'where':{'id':_0xbbd858[_0x92a2('0x3b')]['id']}})[_0x92a2('0x23')](handleEntityNotFound(_0x50f3f0,null))[_0x92a2('0x23')](function(_0x49c049){if(_0x49c049){_0x30c6de=_0x49c049;_0x418693[_0x92a2('0x2b')]=_[_0x92a2('0x3c')](db[_0x92a2('0x4d')][_0x92a2('0x49')]);_0x418693[_0x92a2('0x2c')]=_['keys'](_0xbbd858[_0x92a2('0x2c')]);_0x418693[_0x92a2('0x2d')]=_['intersection'](_0x418693[_0x92a2('0x2b')],_0x418693[_0x92a2('0x2c')]);_0x28f631['attributes']=_[_0x92a2('0x2f')](_0x418693[_0x92a2('0x2b')],qs['fields'](_0xbbd858[_0x92a2('0x2c')][_0x92a2('0x30')]));_0x28f631[_0x92a2('0x2e')]=_0x28f631[_0x92a2('0x2e')][_0x92a2('0x3d')]?_0x28f631['attributes']:_0x418693[_0x92a2('0x2b')];_0x28f631[_0x92a2('0x4a')]=qs['sort'](_0xbbd858[_0x92a2('0x2c')][_0x92a2('0x31')]);_0x28f631['where']=qs[_0x92a2('0x2d')](_[_0x92a2('0x50')](_0xbbd858['query'],_0x418693[_0x92a2('0x2d')]));if(_0xbbd858[_0x92a2('0x2c')]['filter']){_0x28f631['where']=_[_0x92a2('0x34')](_0x28f631[_0x92a2('0x32')],{'$or':_[_0x92a2('0x26')](_0x28f631['attributes'],function(_0x2ff43c){var _0x27ed01={};_0x27ed01[_0x2ff43c]={'$like':'%'+_0xbbd858[_0x92a2('0x2c')][_0x92a2('0x33')]+'%'};return _0x27ed01;})});}_0x28f631=_['merge']({},_0x28f631,_0xbbd858['options']);return _0x30c6de['getActions'](_0x28f631);}})[_0x92a2('0x23')](function(_0x25a4cb){if(_0x25a4cb){_0x3a4d2d=_0x25a4cb['length'];if(!_0xbbd858['query']['hasOwnProperty'](_0x92a2('0x4b'))){_0x28f631[_0x92a2('0x1d')]=qs[_0x92a2('0x1d')](_0xbbd858[_0x92a2('0x2c')][_0x92a2('0x1d')]);_0x28f631[_0x92a2('0x1b')]=qs[_0x92a2('0x1b')](_0xbbd858[_0x92a2('0x2c')]['offset']);}return _0x30c6de[_0x92a2('0x4f')](_0x28f631);}})[_0x92a2('0x23')](function(_0x1793e3){if(_0x1793e3){return _0x1793e3?{'count':_0x3a4d2d,'rows':_0x1793e3}:null;}})['then'](respondWithResult(_0x50f3f0,null))[_0x92a2('0x3f')](handleError(_0x50f3f0,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 572b007..de4162f 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 _0xc831=['util','api','moment','bluebird','request-promise','../../config/environment','exports','define','Automation'];(function(_0x169c92,_0x215c01){var _0x5f2f5b=function(_0x16928b){while(--_0x16928b){_0x169c92['push'](_0x169c92['shift']());}};_0x5f2f5b(++_0x215c01);}(_0xc831,0x17a));var _0x1c83=function(_0x5a8a7c,_0xe4ed6f){_0x5a8a7c=_0x5a8a7c-0x0;var _0x3d131f=_0xc831[_0x5a8a7c];return _0x3d131f;};'use strict';var _=require('lodash');var util=require(_0x1c83('0x0'));var logger=require('../../config/logger')(_0x1c83('0x1'));var moment=require(_0x1c83('0x2'));var BPromise=require(_0x1c83('0x3'));var rp=require(_0x1c83('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1c83('0x5'));var attributes=require('./automation.attributes');module[_0x1c83('0x6')]=function(_0x3661d7,_0xb77749){return _0x3661d7[_0x1c83('0x7')](_0x1c83('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f24=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x537662,_0x3f1da7){var _0x3bbccf=function(_0x523247){while(--_0x523247){_0x537662['push'](_0x537662['shift']());}};_0x3bbccf(++_0x3f1da7);}(_0x3f24,0x1a2));var _0x43f2=function(_0x5ed0a7,_0x2dc03a){_0x5ed0a7=_0x5ed0a7-0x0;var _0x8378c5=_0x3f24[_0x5ed0a7];return _0x8378c5;};'use strict';var _=require(_0x43f2('0x0'));var util=require(_0x43f2('0x1'));var logger=require(_0x43f2('0x2'))('api');var moment=require(_0x43f2('0x3'));var BPromise=require('bluebird');var rp=require(_0x43f2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x43f2('0x5'));var config=require(_0x43f2('0x6'));var attributes=require('./automation.attributes');module[_0x43f2('0x7')]=function(_0x2d9e02,_0xbaf19e){return _0x2d9e02[_0x43f2('0x8')]('Automation',attributes,{'tableName':'tools_automations','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 5f0863d..43be275 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 _0xbf13=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xbf13,0xe2));var _0x3bf1=function(_0x16314a,_0x398aa2){_0x16314a=_0x16314a-0x0;var _0x51657e=_0xbf13[_0x16314a];return _0x51657e;};'use strict';var _=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var moment=require(_0x3bf1('0x2'));var BPromise=require(_0x3bf1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bf1('0x4'))['db'];var utils=require(_0x3bf1('0x5'));var logger=require('../../config/logger')(_0x3bf1('0x6'));var config=require(_0x3bf1('0x7'));var jayson=require(_0x3bf1('0x8'));var client=jayson[_0x3bf1('0x9')][_0x3bf1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54eada,_0x4d9fa2,_0x4502c5){return new BPromise(function(_0x30bda1,_0x56eb60){return client[_0x3bf1('0xb')](_0x54eada,_0x4502c5)[_0x3bf1('0xc')](function(_0x28906a){logger[_0x3bf1('0xd')](_0x3bf1('0xe'),_0x4d9fa2,_0x3bf1('0xf'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x4d9fa2,_0x3bf1('0xf'),JSON[_0x3bf1('0x10')](_0x28906a));if(_0x28906a['error']){if(_0x28906a[_0x3bf1('0x11')]['code']===0x1f4){logger[_0x3bf1('0x11')](_0x3bf1('0xe'),_0x4d9fa2,_0x28906a[_0x3bf1('0x11')][_0x3bf1('0x12')]);return _0x56eb60(_0x28906a[_0x3bf1('0x11')][_0x3bf1('0x12')]);}logger['error']('Automation,\x20%s,\x20%s',_0x4d9fa2,_0x28906a[_0x3bf1('0x11')][_0x3bf1('0x12')]);return _0x30bda1(_0x28906a[_0x3bf1('0x11')][_0x3bf1('0x12')]);}else{logger[_0x3bf1('0xd')](_0x3bf1('0xe'),_0x4d9fa2,_0x3bf1('0xf'));_0x30bda1(_0x28906a[_0x3bf1('0x13')][_0x3bf1('0x12')]);}})[_0x3bf1('0x14')](function(_0x260440){logger[_0x3bf1('0x11')](_0x3bf1('0xe'),_0x4d9fa2,_0x260440);_0x56eb60(_0x260440);});});}
\ No newline at end of file
+var _0x117c=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','bluebird'];(function(_0x445101,_0x2414bf){var _0x3c3d04=function(_0x249067){while(--_0x249067){_0x445101['push'](_0x445101['shift']());}};_0x3c3d04(++_0x2414bf);}(_0x117c,0x71));var _0xc117=function(_0x41b29e,_0x34b288){_0x41b29e=_0x41b29e-0x0;var _0xacd517=_0x117c[_0x41b29e];return _0xacd517;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc117('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc117('0x1'))['db'];var utils=require(_0xc117('0x2'));var logger=require(_0xc117('0x3'))(_0xc117('0x4'));var config=require(_0xc117('0x5'));var jayson=require(_0xc117('0x6'));var client=jayson['client'][_0xc117('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x389734,_0x48efbb,_0x181a70){return new BPromise(function(_0x56c9bd,_0x451447){return client[_0xc117('0x8')](_0x389734,_0x181a70)[_0xc117('0x9')](function(_0x39e33f){logger[_0xc117('0xa')]('Automation,\x20%s,\x20%s',_0x48efbb,_0xc117('0xb'));logger['debug'](_0xc117('0xc'),_0x48efbb,'request\x20sent',JSON[_0xc117('0xd')](_0x39e33f));if(_0x39e33f[_0xc117('0xe')]){if(_0x39e33f['error'][_0xc117('0xf')]===0x1f4){logger['error'](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x451447(_0x39e33f[_0xc117('0xe')]['message']);}logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);return _0x56c9bd(_0x39e33f[_0xc117('0xe')][_0xc117('0x11')]);}else{logger[_0xc117('0xa')](_0xc117('0x10'),_0x48efbb,_0xc117('0xb'));_0x56c9bd(_0x39e33f['result']['message']);}})[_0xc117('0x12')](function(_0x241ee7){logger[_0xc117('0xe')](_0xc117('0x10'),_0x48efbb,_0x241ee7);_0x451447(_0x241ee7);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 429fae1..0d6aa4f 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 _0x9275=['addActions','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/conditions','getConditions','/:id/actions','getActions','create','post'];(function(_0x19f720,_0x21a60b){var _0xa461b4=function(_0x146cc){while(--_0x146cc){_0x19f720['push'](_0x19f720['shift']());}};_0xa461b4(++_0x21a60b);}(_0x9275,0x130));var _0x5927=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x9275[_0x16dbfd];return _0x382254;};'use strict';var multer=require('multer');var util=require(_0x5927('0x0'));var path=require(_0x5927('0x1'));var timeout=require(_0x5927('0x2'));var express=require('express');var router=express[_0x5927('0x3')]();var fs_extra=require(_0x5927('0x4'));var auth=require(_0x5927('0x5'));var interaction=require(_0x5927('0x6'));var config=require(_0x5927('0x7'));var controller=require('./automation.controller');router[_0x5927('0x8')]('/',auth['isAuthenticated'](),controller[_0x5927('0x9')]);router[_0x5927('0x8')](_0x5927('0xa'),auth[_0x5927('0xb')](),controller['show']);router[_0x5927('0x8')](_0x5927('0xc'),auth[_0x5927('0xb')](),controller[_0x5927('0xd')]);router[_0x5927('0x8')](_0x5927('0xe'),auth[_0x5927('0xb')](),controller[_0x5927('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5927('0x10')]);router[_0x5927('0x11')](_0x5927('0xc'),auth[_0x5927('0xb')](),controller['addConditions']);router[_0x5927('0x11')]('/:id/actions',auth[_0x5927('0xb')](),controller[_0x5927('0x12')]);router[_0x5927('0x13')](_0x5927('0xa'),auth[_0x5927('0xb')](),controller[_0x5927('0x14')]);router['delete']('/:id',auth[_0x5927('0xb')](),controller[_0x5927('0x15')]);module[_0x5927('0x16')]=router;
\ No newline at end of file
+var _0xef1c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','getActions','post','create','/:id/actions','put','/:id','exports','multer','util','connect-timeout','express'];(function(_0x18bebd,_0x32f07a){var _0x42524b=function(_0x2db8d2){while(--_0x2db8d2){_0x18bebd['push'](_0x18bebd['shift']());}};_0x42524b(++_0x32f07a);}(_0xef1c,0x176));var _0xcef1=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xef1c[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xcef1('0x0'));var util=require(_0xcef1('0x1'));var path=require('path');var timeout=require(_0xcef1('0x2'));var express=require(_0xcef1('0x3'));var router=express[_0xcef1('0x4')]();var fs_extra=require(_0xcef1('0x5'));var auth=require(_0xcef1('0x6'));var interaction=require(_0xcef1('0x7'));var config=require('../../config/environment');var controller=require(_0xcef1('0x8'));router[_0xcef1('0x9')]('/',auth[_0xcef1('0xa')](),controller['index']);router[_0xcef1('0x9')]('/:id',auth[_0xcef1('0xa')](),controller[_0xcef1('0xb')]);router[_0xcef1('0x9')](_0xcef1('0xc'),auth['isAuthenticated'](),controller[_0xcef1('0xd')]);router[_0xcef1('0x9')]('/:id/actions',auth[_0xcef1('0xa')](),controller[_0xcef1('0xe')]);router[_0xcef1('0xf')]('/',auth['isAuthenticated'](),controller[_0xcef1('0x10')]);router['post']('/:id/conditions',auth[_0xcef1('0xa')](),controller['addConditions']);router[_0xcef1('0xf')](_0xcef1('0x11'),auth[_0xcef1('0xa')](),controller['addActions']);router[_0xcef1('0x12')](_0xcef1('0x13'),auth[_0xcef1('0xa')](),controller['update']);router['delete'](_0xcef1('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xcef1('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 4a33a88..eca8936 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 _0x4377=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)'];(function(_0x1fe40b,_0xdf9bda){var _0x585a4d=function(_0x40f941){while(--_0x40f941){_0x1fe40b['push'](_0x1fe40b['shift']());}};_0x585a4d(++_0xdf9bda);}(_0x4377,0xcb));var _0x7437=function(_0x13b028,_0x54dc4b){_0x13b028=_0x13b028-0x0;var _0x7ead62=_0x4377[_0x13b028];return _0x7ead62;};'use strict';var Sequelize=require(_0x7437('0x0'));module[_0x7437('0x1')]={'name':{'type':Sequelize[_0x7437('0x2')],'unique':_0x7437('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7437('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x7437('0x5')},'description':{'type':Sequelize[_0x7437('0x2')]},'active':{'type':Sequelize[_0x7437('0x6')],'defaultValue':0x0,'comment':_0x7437('0x7')},'limitCalls':{'type':Sequelize[_0x7437('0x8')](0x4)[_0x7437('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7437('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7437('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x7437('0x8')](0x3)[_0x7437('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7437('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7437('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7437('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7437('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7437('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x7437('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7437('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7437('0x8')](0x5)[_0x7437('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7437('0x8')](0x3)[_0x7437('0x9')],'defaultValue':0x3,'comment':_0x7437('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7437('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7437('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7437('0x8')](0x3)[_0x7437('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7437('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7437('0x2')],'defaultValue':_0x7437('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0x7437('0x4')](_0x7437('0x13'),'never',_0x7437('0x14')),'defaultValue':_0x7437('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7437('0x15')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7437('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7437('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x7437('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7437('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7437('0x8')](0x9)[_0x7437('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7437('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7437('0x8')](0x9)[_0x7437('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7437('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0x7437('0x8')](0x9)[_0x7437('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7437('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7437('0x8')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7437('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7437('0x8')](0x9)[_0x7437('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7437('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7437('0x8')](0x5)[_0x7437('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x7437('0x4')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x7437('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7437('0x8')](0x3)[_0x7437('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7437('0x1d')},'dialCutDigit':{'type':Sequelize[_0x7437('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7437('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7437('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7437('0x8')](0x5)[_0x7437('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7437('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x7437('0x8')](0x3)[_0x7437('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7437('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7437('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7437('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7437('0x8')](0x3)[_0x7437('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7437('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7437('0x8')](0x5)[_0x7437('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7437('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x7437('0x8')](0x3)[_0x7437('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7437('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x7437('0x8')](0x5)[_0x7437('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7437('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7437('0x8')](0x3)[_0x7437('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7437('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7437('0x8')](0x5)[_0x7437('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7437('0x27')}};
\ No newline at end of file
+var _0xc06d=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc06d,0x15a));var _0xdc06=function(_0x5bc37f,_0x50debd){_0x5bc37f=_0x5bc37f-0x0;var _0x583e6d=_0xc06d[_0x5bc37f];return _0x583e6d;};'use strict';var Sequelize=require(_0xdc06('0x0'));module[_0xdc06('0x1')]={'name':{'type':Sequelize[_0xdc06('0x2')],'unique':_0xdc06('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xdc06('0x4')),'allowNull':![],'defaultValue':_0xdc06('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xdc06('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xdc06('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdc06('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'comment':_0xdc06('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xdc06('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xdc06('0x2')],'defaultValue':_0xdc06('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xdc06('0xe')](_0xdc06('0xf'),'never',_0xdc06('0x10')),'defaultValue':_0xdc06('0xf')},'dialAMDActive':{'type':Sequelize[_0xdc06('0x11')],'defaultValue':0x0,'comment':_0xdc06('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xdc06('0x8')](0x9)[_0xdc06('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xdc06('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xdc06('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdc06('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdc06('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdc06('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdc06('0x8')](0x9)[_0xdc06('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdc06('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xdc06('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xdc06('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xdc06('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdc06('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdc06('0x8')](0x9)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdc06('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xdc06('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xdc06('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdc06('0x8')](0x9)[_0xdc06('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdc06('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdc06('0xe')](_0xdc06('0x1c'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdc06('0x1d')},'dialCutDigit':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdc06('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdc06('0x8')](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x25')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdc06('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdc06('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdc06('0x8')](0x5)[_0xdc06('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdc06('0x28')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5abc4eb..df456d7 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 _0xe1fe=['removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','IvrCampaigns','UserProfileResource','error','name','send','index','Campaign','rawAttributes','fieldName','map','query','model','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','clone','find','omit','createdAt','updatedAt','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','CmHopper','keys','hasOwnProperty','order','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','cm_hopper_additional_phones','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','spread'];(function(_0x26ade8,_0x387df1){var _0x1e8070=function(_0x2d5cc7){while(--_0x2d5cc7){_0x26ade8['push'](_0x26ade8['shift']());}};_0x1e8070(++_0x387df1);}(_0xe1fe,0x1c3));var _0xee1f=function(_0x387b58,_0x333ba3){_0x387b58=_0x387b58-0x0;var _0x20e209=_0xe1fe[_0x387b58];return _0x20e209;};'use strict';var emlformat=require(_0xee1f('0x0'));var rimraf=require(_0xee1f('0x1'));var zipdir=require(_0xee1f('0x2'));var jsonpatch=require(_0xee1f('0x3'));var rp=require(_0xee1f('0x4'));var moment=require(_0xee1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xee1f('0x6'));var path=require(_0xee1f('0x7'));var sox=require(_0xee1f('0x8'));var csv=require(_0xee1f('0x9'));var ejs=require(_0xee1f('0xa'));var fs=require('fs');var fs_extra=require(_0xee1f('0xb'));var _=require(_0xee1f('0xc'));var squel=require(_0xee1f('0xd'));var crypto=require(_0xee1f('0xe'));var jsforce=require(_0xee1f('0xf'));var deskjs=require(_0xee1f('0x10'));var toCsv=require(_0xee1f('0x9'));var querystring=require(_0xee1f('0x11'));var Papa=require(_0xee1f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee1f('0x13'));var logger=require(_0xee1f('0x14'))(_0xee1f('0x15'));var utils=require(_0xee1f('0x16'));var config=require(_0xee1f('0x17'));var licenseUtil=require(_0xee1f('0x18'));var db=require(_0xee1f('0x19'))['db'];function respondWithStatusCode(_0xd8408d,_0x31512b){_0x31512b=_0x31512b||0xcc;return function(_0x260d50){if(_0x260d50){return _0xd8408d[_0xee1f('0x1a')](_0x31512b);}return _0xd8408d[_0xee1f('0x1b')](_0x31512b)[_0xee1f('0x1c')]();};}function respondWithResult(_0x39ac58,_0x3302c3){_0x3302c3=_0x3302c3||0xc8;return function(_0x4e1073){if(_0x4e1073){return _0x39ac58['status'](_0x3302c3)[_0xee1f('0x1d')](_0x4e1073);}};}function respondWithFilteredResult(_0x12900a,_0x15d69f){return function(_0x15ebbc){if(_0x15ebbc){var _0x158a8e=typeof _0x15d69f[_0xee1f('0x1e')]===_0xee1f('0x1f')&&typeof _0x15d69f[_0xee1f('0x20')]===_0xee1f('0x1f');var _0x23f77a=_0x15ebbc['count'];var _0x10cbe3=_0x158a8e?0x0:_0x15d69f['offset'];var _0x4fe1b5=_0x158a8e?_0x15ebbc[_0xee1f('0x21')]:_0x15d69f[_0xee1f('0x1e')]+_0x15d69f[_0xee1f('0x20')];var _0x471b57;if(_0x4fe1b5>=_0x23f77a){_0x4fe1b5=_0x23f77a;_0x471b57=0xc8;}else{_0x471b57=0xce;}_0x12900a[_0xee1f('0x1b')](_0x471b57);return _0x12900a[_0xee1f('0x22')]('Content-Range',_0x10cbe3+'-'+_0x4fe1b5+'/'+_0x23f77a)[_0xee1f('0x1d')](_0x15ebbc);}return null;};}function patchUpdates(_0x3ebe79){return function(_0x29dad7){try{jsonpatch[_0xee1f('0x23')](_0x29dad7,_0x3ebe79,!![]);}catch(_0x5c0c43){return BPromise['reject'](_0x5c0c43);}return _0x29dad7[_0xee1f('0x24')]();};}function saveUpdates(_0x2eefbc,_0x361953){return function(_0x4c1fb6){if(_0x4c1fb6){return _0x4c1fb6['update'](_0x2eefbc)[_0xee1f('0x25')](function(_0x1740d8){return _0x1740d8;});}return null;};}function removeEntity(_0x395044,_0x2103ec){return function(_0x44acef){if(_0x44acef){return _0x44acef[_0xee1f('0x26')]()['then'](function(){var _0x408fa5=_0x44acef['get']({'plain':!![]});var _0x510e22=_0xee1f('0x27');return db[_0xee1f('0x28')]['destroy']({'where':{'type':_0x510e22,'resourceId':_0x408fa5['id']}})[_0xee1f('0x25')](function(){return _0x44acef;});})[_0xee1f('0x25')](function(){_0x395044[_0xee1f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b370c,_0x140816){return function(_0x52d835){if(!_0x52d835){_0x1b370c[_0xee1f('0x1a')](0x194);}return _0x52d835;};}function handleError(_0xc5dd52,_0xe62b18){_0xe62b18=_0xe62b18||0x1f4;return function(_0x5be320){logger[_0xee1f('0x29')](_0x5be320['stack']);if(_0x5be320[_0xee1f('0x2a')]){delete _0x5be320['name'];}_0xc5dd52[_0xee1f('0x1b')](_0xe62b18)[_0xee1f('0x2b')](_0x5be320);};}exports[_0xee1f('0x2c')]=function(_0x2fcc3a,_0x3d0a52){var _0x19344b={},_0xdec86f={},_0x4f8c8e={'count':0x0,'rows':[]};var _0x69c6e0=_['map'](db[_0xee1f('0x2d')][_0xee1f('0x2e')],function(_0x1c595a){return{'name':_0x1c595a[_0xee1f('0x2f')],'type':_0x1c595a['type']['key']};});_0xdec86f['model']=_[_0xee1f('0x30')](_0x69c6e0,_0xee1f('0x2a'));_0xdec86f[_0xee1f('0x31')]=_['keys'](_0x2fcc3a[_0xee1f('0x31')]);_0xdec86f['filters']=_['intersection'](_0xdec86f[_0xee1f('0x32')],_0xdec86f[_0xee1f('0x31')]);_0x19344b['attributes']=_[_0xee1f('0x33')](_0xdec86f[_0xee1f('0x32')],qs[_0xee1f('0x34')](_0x2fcc3a[_0xee1f('0x31')][_0xee1f('0x34')]));_0x19344b['attributes']=_0x19344b[_0xee1f('0x35')][_0xee1f('0x36')]?_0x19344b[_0xee1f('0x35')]:_0xdec86f[_0xee1f('0x32')];if(!_0x2fcc3a[_0xee1f('0x31')]['hasOwnProperty'](_0xee1f('0x37'))){_0x19344b[_0xee1f('0x20')]=qs['limit'](_0x2fcc3a['query'][_0xee1f('0x20')]);_0x19344b[_0xee1f('0x1e')]=qs[_0xee1f('0x1e')](_0x2fcc3a[_0xee1f('0x31')][_0xee1f('0x1e')]);}_0x19344b['order']=qs[_0xee1f('0x38')](_0x2fcc3a[_0xee1f('0x31')]['sort']);_0x19344b[_0xee1f('0x39')]=qs[_0xee1f('0x3a')](_[_0xee1f('0x3b')](_0x2fcc3a[_0xee1f('0x31')],_0xdec86f[_0xee1f('0x3a')]),_0x69c6e0);if(_0x2fcc3a[_0xee1f('0x31')][_0xee1f('0x3c')]){_0x19344b[_0xee1f('0x39')]=_[_0xee1f('0x3d')](_0x19344b['where'],{'$or':_['map'](_0x69c6e0,function(_0x2bb920){if(_0x2bb920['type']!==_0xee1f('0x3e')){var _0x505b02={};_0x505b02[_0x2bb920[_0xee1f('0x2a')]]={'$like':'%'+_0x2fcc3a[_0xee1f('0x31')][_0xee1f('0x3c')]+'%'};return _0x505b02;}})});}_0x19344b=_[_0xee1f('0x3d')]({},_0x19344b,_0x2fcc3a[_0xee1f('0x3f')]);var _0x53a52b={'where':_0x19344b[_0xee1f('0x39')]};return db['Campaign']['count'](_0x53a52b)[_0xee1f('0x25')](function(_0x44ec9e){_0x4f8c8e[_0xee1f('0x21')]=_0x44ec9e;if(_0x2fcc3a[_0xee1f('0x31')][_0xee1f('0x40')]){_0x19344b[_0xee1f('0x41')]=[{'all':!![]}];}return db[_0xee1f('0x2d')][_0xee1f('0x42')](_0x19344b);})[_0xee1f('0x25')](function(_0x8a3c3c){_0x4f8c8e[_0xee1f('0x43')]=_0x8a3c3c;return _0x4f8c8e;})[_0xee1f('0x25')](respondWithFilteredResult(_0x3d0a52,_0x19344b))[_0xee1f('0x44')](handleError(_0x3d0a52,null));};exports[_0xee1f('0x45')]=function(_0x144f16,_0xf2fdf3){var _0x2468cb={'raw':![],'where':{'id':_0x144f16[_0xee1f('0x46')]['id']}},_0x29dc1b={};_0x29dc1b[_0xee1f('0x32')]=_['keys'](db[_0xee1f('0x2d')][_0xee1f('0x2e')]);_0x29dc1b['query']=_['keys'](_0x144f16[_0xee1f('0x31')]);_0x29dc1b[_0xee1f('0x3a')]=_[_0xee1f('0x33')](_0x29dc1b[_0xee1f('0x32')],_0x29dc1b['query']);_0x2468cb[_0xee1f('0x35')]=_[_0xee1f('0x33')](_0x29dc1b[_0xee1f('0x32')],qs['fields'](_0x144f16[_0xee1f('0x31')]['fields']));_0x2468cb['attributes']=_0x2468cb[_0xee1f('0x35')][_0xee1f('0x36')]?_0x2468cb[_0xee1f('0x35')]:_0x29dc1b['model'];if(_0x144f16[_0xee1f('0x31')][_0xee1f('0x40')]){_0x2468cb[_0xee1f('0x41')]=[{'all':!![]}];}_0x2468cb=_['merge']({},_0x2468cb,_0x144f16[_0xee1f('0x3f')]);return db[_0xee1f('0x2d')]['find'](_0x2468cb)[_0xee1f('0x25')](handleEntityNotFound(_0xf2fdf3,null))[_0xee1f('0x25')](respondWithResult(_0xf2fdf3,null))['catch'](handleError(_0xf2fdf3,null));};exports['create']=function(_0x55dfb6,_0x5b93d6){return db['Campaign'][_0xee1f('0x47')](_0x55dfb6[_0xee1f('0x48')],{})['then'](function(_0x174a40){var _0x6848b9=_0x55dfb6[_0xee1f('0x49')][_0xee1f('0x4a')]({'plain':!![]});if(!_0x6848b9)throw new Error(_0xee1f('0x4b'));if(_0x6848b9[_0xee1f('0x4c')]===_0xee1f('0x49')){var _0x4ed908=_0x174a40[_0xee1f('0x4a')]({'plain':!![]});var _0x32d7fd=_0xee1f('0x27');return db[_0xee1f('0x4d')]['find']({'where':{'name':_0x32d7fd,'userProfileId':_0x6848b9['userProfileId']},'raw':!![]})['then'](function(_0x57b9af){if(_0x57b9af&&_0x57b9af['autoAssociation']===0x0){return db[_0xee1f('0x28')][_0xee1f('0x47')]({'name':_0x4ed908['name'],'resourceId':_0x4ed908['id'],'type':_0x57b9af[_0xee1f('0x2a')],'sectionId':_0x57b9af['id']},{})[_0xee1f('0x25')](function(){return _0x174a40;});}else{return _0x174a40;}})[_0xee1f('0x44')](function(_0x206371){logger[_0xee1f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x206371);throw _0x206371;});}return _0x174a40;})[_0xee1f('0x25')](respondWithResult(_0x5b93d6,0xc9))[_0xee1f('0x44')](handleError(_0x5b93d6,null));};exports[_0xee1f('0x4e')]=function(_0x4414d8,_0x1dc5f4){var _0x5cff21={'where':{'id':_0x4414d8[_0xee1f('0x46')]['id']}},_0x2de796={};_0x2de796[_0xee1f('0x32')]=_['keys'](db['Campaign'][_0xee1f('0x2e')]);_0x5cff21[_0xee1f('0x35')]=_[_0xee1f('0x33')](_0x2de796[_0xee1f('0x32')],qs[_0xee1f('0x34')](_0x4414d8[_0xee1f('0x31')][_0xee1f('0x34')]));_0x5cff21[_0xee1f('0x35')]=_0x5cff21['attributes'][_0xee1f('0x36')]?_0x5cff21[_0xee1f('0x35')]:_0x2de796[_0xee1f('0x32')];if(_0x4414d8[_0xee1f('0x31')][_0xee1f('0x40')]){_0x5cff21[_0xee1f('0x41')]=[{'all':!![]}];}_0x5cff21=_[_0xee1f('0x3d')]({},_0x5cff21,_0x4414d8[_0xee1f('0x3f')]);return db[_0xee1f('0x2d')][_0xee1f('0x4f')](_0x5cff21)['then'](handleEntityNotFound(_0x1dc5f4,null))[_0xee1f('0x25')](function(_0x1485b4){if(_0x1485b4){var _0x25b380=_0x1485b4[_0xee1f('0x4a')]({'plain':!![]});_0x25b380=qs[_0xee1f('0x50')](_0x25b380,['id',_0xee1f('0x51'),_0xee1f('0x52')]);_0x4414d8[_0xee1f('0x48')]=_[_0xee1f('0x50')](_0x4414d8[_0xee1f('0x48')],['id',_0xee1f('0x51'),_0xee1f('0x52')]);return db[_0xee1f('0x2d')][_0xee1f('0x47')](_['merge'](_0x25b380,_0x4414d8[_0xee1f('0x48')]),{'include':_0x4414d8[_0xee1f('0x31')][_0xee1f('0x40')]?[{'all':!![]}]:undefined})[_0xee1f('0x25')](function(_0x2ce827){var _0x2de2af=_0x4414d8[_0xee1f('0x49')]['get']({'plain':!![]});if(!_0x2de2af)throw new Error(_0xee1f('0x4b'));if(_0x2de2af['role']===_0xee1f('0x49')){var _0x434b7a=_0x2ce827[_0xee1f('0x4a')]({'plain':!![]});var _0xd8812=_0xee1f('0x27');return db[_0xee1f('0x4d')]['find']({'where':{'name':_0xd8812,'userProfileId':_0x2de2af[_0xee1f('0x53')]},'raw':!![]})[_0xee1f('0x25')](function(_0x1809b6){if(_0x1809b6&&_0x1809b6[_0xee1f('0x54')]===0x0){return db['UserProfileResource'][_0xee1f('0x47')]({'name':_0x434b7a[_0xee1f('0x2a')],'resourceId':_0x434b7a['id'],'type':_0x1809b6[_0xee1f('0x2a')],'sectionId':_0x1809b6['id']},{})[_0xee1f('0x25')](function(){return _0x2ce827;});}else{return _0x2ce827;}})['catch'](function(_0x2752cf){logger['error'](_0xee1f('0x55'),_0x2752cf);throw _0x2752cf;});}return _0x2ce827;});}})[_0xee1f('0x25')](respondWithResult(_0x1dc5f4,0xc9))[_0xee1f('0x44')](handleError(_0x1dc5f4,null));};exports[_0xee1f('0x56')]=function(_0x257c80,_0x2ef896){if(_0x257c80[_0xee1f('0x48')]['id']){delete _0x257c80[_0xee1f('0x48')]['id'];}return db[_0xee1f('0x2d')][_0xee1f('0x4f')]({'where':{'id':_0x257c80[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x2ef896,null))[_0xee1f('0x25')](saveUpdates(_0x257c80['body'],null))[_0xee1f('0x25')](respondWithResult(_0x2ef896,null))['catch'](handleError(_0x2ef896,null));};exports['destroy']=function(_0x215d72,_0x53a407){return db[_0xee1f('0x2d')]['find']({'where':{'id':_0x215d72[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x53a407,null))[_0xee1f('0x25')](removeEntity(_0x53a407,null))['catch'](handleError(_0x53a407,null));};exports[_0xee1f('0x57')]=function(_0x1fafcc,_0xfab3f8,_0x6e34a8){var _0x467477={'raw':!![],'where':{}};var _0x479d83={};var _0x4d028d={'count':0x0,'rows':[]};return db[_0xee1f('0x2d')]['findOne']({'where':{'id':_0x1fafcc[_0xee1f('0x46')]['id']}})['then'](handleEntityNotFound(_0xfab3f8,null))[_0xee1f('0x25')](function(_0x3ab991){if(_0x3ab991){_0x479d83['model']=_['keys'](db[_0xee1f('0x58')][_0xee1f('0x2e')]);_0x479d83[_0xee1f('0x31')]=_[_0xee1f('0x59')](_0x1fafcc['query']);_0x479d83[_0xee1f('0x3a')]=_[_0xee1f('0x33')](_0x479d83[_0xee1f('0x32')],_0x479d83[_0xee1f('0x31')]);_0x467477[_0xee1f('0x35')]=_[_0xee1f('0x33')](_0x479d83[_0xee1f('0x32')],qs[_0xee1f('0x34')](_0x1fafcc[_0xee1f('0x31')][_0xee1f('0x34')]));_0x467477[_0xee1f('0x35')]=_0x467477['attributes'][_0xee1f('0x36')]?_0x467477[_0xee1f('0x35')]:_0x479d83['model'];if(!_0x1fafcc['query'][_0xee1f('0x5a')]('nolimit')){_0x467477[_0xee1f('0x20')]=qs[_0xee1f('0x20')](_0x1fafcc['query'][_0xee1f('0x20')]);_0x467477['offset']=qs[_0xee1f('0x1e')](_0x1fafcc['query'][_0xee1f('0x1e')]);}_0x467477[_0xee1f('0x5b')]=qs[_0xee1f('0x38')](_0x1fafcc[_0xee1f('0x31')]['sort']);_0x467477[_0xee1f('0x39')]=qs['filters'](_['pick'](_0x1fafcc[_0xee1f('0x31')],_0x479d83['filters']));_0x467477[_0xee1f('0x39')][_0xee1f('0x5c')]=_0x3ab991['id'];if(_0x1fafcc[_0xee1f('0x31')][_0xee1f('0x3c')]){_0x467477[_0xee1f('0x39')]=_['merge'](_0x467477[_0xee1f('0x39')],{'$or':_[_0xee1f('0x30')](_0x467477[_0xee1f('0x35')],function(_0x3db12d){var _0x49a7a={};_0x49a7a[_0x3db12d]={'$like':'%'+_0x1fafcc['query'][_0xee1f('0x3c')]+'%'};return _0x49a7a;})});}_0x467477=_[_0xee1f('0x3d')]({},_0x467477,_0x1fafcc[_0xee1f('0x3f')]);return db[_0xee1f('0x58')][_0xee1f('0x21')]({'where':_0x467477[_0xee1f('0x39')]})[_0xee1f('0x25')](function(_0x5ece5b){_0x4d028d[_0xee1f('0x21')]=_0x5ece5b;if(_0x1fafcc['query']['includeAll']){_0x467477[_0xee1f('0x41')]=[{'all':!![]}];}return db[_0xee1f('0x58')]['findAll'](_0x467477);})[_0xee1f('0x25')](function(_0x55ad8c){_0x4d028d[_0xee1f('0x43')]=_0x55ad8c;return _0x4d028d;});}})[_0xee1f('0x25')](respondWithFilteredResult(_0xfab3f8,_0x467477))[_0xee1f('0x44')](handleError(_0xfab3f8,null));};exports[_0xee1f('0x5d')]=function(_0x1a02fd,_0x1423d9,_0x556da1){var _0x30f46a={'raw':!![],'where':{}};var _0x20641d={};var _0x2c7403={'count':0x0,'rows':[]};return db[_0xee1f('0x2d')][_0xee1f('0x5e')]({'where':{'id':_0x1a02fd[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x1423d9,null))['then'](function(_0x58bd03){if(_0x58bd03){_0x20641d['model']=_[_0xee1f('0x59')](db['CmHopperHistory'][_0xee1f('0x2e')]);_0x20641d['query']=_[_0xee1f('0x59')](_0x1a02fd[_0xee1f('0x31')]);_0x20641d[_0xee1f('0x3a')]=_[_0xee1f('0x33')](_0x20641d[_0xee1f('0x32')],_0x20641d[_0xee1f('0x31')]);_0x30f46a['attributes']=_['intersection'](_0x20641d['model'],qs[_0xee1f('0x34')](_0x1a02fd[_0xee1f('0x31')][_0xee1f('0x34')]));_0x30f46a[_0xee1f('0x35')]=_0x30f46a['attributes']['length']?_0x30f46a[_0xee1f('0x35')]:_0x20641d[_0xee1f('0x32')];if(!_0x1a02fd[_0xee1f('0x31')][_0xee1f('0x5a')](_0xee1f('0x37'))){_0x30f46a[_0xee1f('0x20')]=qs[_0xee1f('0x20')](_0x1a02fd['query'][_0xee1f('0x20')]);_0x30f46a[_0xee1f('0x1e')]=qs[_0xee1f('0x1e')](_0x1a02fd[_0xee1f('0x31')]['offset']);}_0x30f46a[_0xee1f('0x5b')]=qs[_0xee1f('0x38')](_0x1a02fd[_0xee1f('0x31')]['sort']);_0x30f46a[_0xee1f('0x39')]=qs[_0xee1f('0x3a')](_[_0xee1f('0x3b')](_0x1a02fd[_0xee1f('0x31')],_0x20641d[_0xee1f('0x3a')]));_0x30f46a[_0xee1f('0x39')][_0xee1f('0x5c')]=_0x58bd03['id'];if(_0x1a02fd[_0xee1f('0x31')][_0xee1f('0x3c')]){_0x30f46a[_0xee1f('0x39')]=_['merge'](_0x30f46a[_0xee1f('0x39')],{'$or':_['map'](_0x30f46a[_0xee1f('0x35')],function(_0x19186a){var _0x2575c0={};_0x2575c0[_0x19186a]={'$like':'%'+_0x1a02fd[_0xee1f('0x31')][_0xee1f('0x3c')]+'%'};return _0x2575c0;})});}_0x30f46a=_[_0xee1f('0x3d')]({},_0x30f46a,_0x1a02fd[_0xee1f('0x3f')]);return db['CmHopperHistory']['count']({'where':_0x30f46a[_0xee1f('0x39')]})[_0xee1f('0x25')](function(_0x37430d){_0x2c7403[_0xee1f('0x21')]=_0x37430d;if(_0x1a02fd[_0xee1f('0x31')]['includeAll']){_0x30f46a[_0xee1f('0x41')]=[{'all':!![]}];}return db[_0xee1f('0x5f')][_0xee1f('0x42')](_0x30f46a);})[_0xee1f('0x25')](function(_0x4d3639){_0x2c7403[_0xee1f('0x43')]=_0x4d3639;return _0x2c7403;});}})[_0xee1f('0x25')](respondWithFilteredResult(_0x1423d9,_0x30f46a))[_0xee1f('0x44')](handleError(_0x1423d9,null));};exports[_0xee1f('0x60')]=function(_0x33e4a0,_0x3aaef4,_0x430628){var _0x4bc7f6={'raw':!![],'where':{}};var _0x3d9587={};var _0x127aec={'count':0x0,'rows':[]};return db[_0xee1f('0x2d')][_0xee1f('0x5e')]({'where':{'id':_0x33e4a0[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x3aaef4,null))[_0xee1f('0x25')](function(_0x1c556a){if(_0x1c556a){_0x3d9587[_0xee1f('0x32')]=_[_0xee1f('0x59')](db[_0xee1f('0x61')]['rawAttributes']);_0x3d9587[_0xee1f('0x31')]=_[_0xee1f('0x59')](_0x33e4a0[_0xee1f('0x31')]);_0x3d9587[_0xee1f('0x3a')]=_[_0xee1f('0x33')](_0x3d9587['model'],_0x3d9587['query']);_0x4bc7f6[_0xee1f('0x35')]=_[_0xee1f('0x33')](_0x3d9587['model'],qs['fields'](_0x33e4a0[_0xee1f('0x31')][_0xee1f('0x34')]));_0x4bc7f6[_0xee1f('0x35')]=_0x4bc7f6['attributes'][_0xee1f('0x36')]?_0x4bc7f6[_0xee1f('0x35')]:_0x3d9587[_0xee1f('0x32')];if(!_0x33e4a0[_0xee1f('0x31')][_0xee1f('0x5a')](_0xee1f('0x37'))){_0x4bc7f6[_0xee1f('0x20')]=qs[_0xee1f('0x20')](_0x33e4a0[_0xee1f('0x31')][_0xee1f('0x20')]);_0x4bc7f6['offset']=qs[_0xee1f('0x1e')](_0x33e4a0[_0xee1f('0x31')][_0xee1f('0x1e')]);}_0x4bc7f6['order']=qs['sort'](_0x33e4a0[_0xee1f('0x31')][_0xee1f('0x38')]);_0x4bc7f6[_0xee1f('0x39')]=qs['filters'](_[_0xee1f('0x3b')](_0x33e4a0[_0xee1f('0x31')],_0x3d9587[_0xee1f('0x3a')]));_0x4bc7f6[_0xee1f('0x39')][_0xee1f('0x5c')]=_0x1c556a['id'];if(_0x33e4a0[_0xee1f('0x31')]['filter']){_0x4bc7f6[_0xee1f('0x39')]=_['merge'](_0x4bc7f6['where'],{'$or':_[_0xee1f('0x30')](_0x4bc7f6['attributes'],function(_0x221ff9){var _0xf35cf6={};_0xf35cf6[_0x221ff9]={'$like':'%'+_0x33e4a0[_0xee1f('0x31')][_0xee1f('0x3c')]+'%'};return _0xf35cf6;})});}_0x4bc7f6=_[_0xee1f('0x3d')]({},_0x4bc7f6,_0x33e4a0['options']);return db[_0xee1f('0x61')][_0xee1f('0x21')]({'where':_0x4bc7f6[_0xee1f('0x39')]})[_0xee1f('0x25')](function(_0x1d8aa3){_0x127aec['count']=_0x1d8aa3;if(_0x33e4a0[_0xee1f('0x31')][_0xee1f('0x40')]){_0x4bc7f6[_0xee1f('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xee1f('0x42')](_0x4bc7f6);})[_0xee1f('0x25')](function(_0x1e6866){_0x127aec[_0xee1f('0x43')]=_0x1e6866;return _0x127aec;});}})['then'](respondWithFilteredResult(_0x3aaef4,_0x4bc7f6))['catch'](handleError(_0x3aaef4,null));};exports[_0xee1f('0x62')]=function(_0x3b4c6e,_0x231141,_0x4ddd44){var _0x39656c={'raw':!![],'where':{}};var _0x367ce4={};var _0x25dbb5={'count':0x0,'rows':[]};return db[_0xee1f('0x2d')]['findOne']({'where':{'id':_0x3b4c6e[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x231141,null))[_0xee1f('0x25')](function(_0x11aef6){if(_0x11aef6){_0x367ce4['model']=_[_0xee1f('0x59')](db['CmHopperBlack'][_0xee1f('0x2e')]);_0x367ce4['query']=_[_0xee1f('0x59')](_0x3b4c6e[_0xee1f('0x31')]);_0x367ce4[_0xee1f('0x3a')]=_['intersection'](_0x367ce4[_0xee1f('0x32')],_0x367ce4[_0xee1f('0x31')]);_0x39656c[_0xee1f('0x35')]=_[_0xee1f('0x33')](_0x367ce4[_0xee1f('0x32')],qs['fields'](_0x3b4c6e['query'][_0xee1f('0x34')]));_0x39656c[_0xee1f('0x35')]=_0x39656c['attributes'][_0xee1f('0x36')]?_0x39656c[_0xee1f('0x35')]:_0x367ce4['model'];if(!_0x3b4c6e[_0xee1f('0x31')]['hasOwnProperty'](_0xee1f('0x37'))){_0x39656c[_0xee1f('0x20')]=qs[_0xee1f('0x20')](_0x3b4c6e[_0xee1f('0x31')][_0xee1f('0x20')]);_0x39656c['offset']=qs[_0xee1f('0x1e')](_0x3b4c6e[_0xee1f('0x31')][_0xee1f('0x1e')]);}_0x39656c[_0xee1f('0x5b')]=qs['sort'](_0x3b4c6e[_0xee1f('0x31')][_0xee1f('0x38')]);_0x39656c['where']=qs[_0xee1f('0x3a')](_[_0xee1f('0x3b')](_0x3b4c6e[_0xee1f('0x31')],_0x367ce4[_0xee1f('0x3a')]));_0x39656c[_0xee1f('0x39')]['CampaignId']=_0x11aef6['id'];if(_0x3b4c6e[_0xee1f('0x31')][_0xee1f('0x3c')]){_0x39656c['where']=_[_0xee1f('0x3d')](_0x39656c['where'],{'$or':_[_0xee1f('0x30')](_0x39656c[_0xee1f('0x35')],function(_0x3ed177){var _0x433cfa={};_0x433cfa[_0x3ed177]={'$like':'%'+_0x3b4c6e[_0xee1f('0x31')][_0xee1f('0x3c')]+'%'};return _0x433cfa;})});}_0x39656c=_['merge']({},_0x39656c,_0x3b4c6e[_0xee1f('0x3f')]);return db[_0xee1f('0x63')][_0xee1f('0x21')]({'where':_0x39656c[_0xee1f('0x39')]})[_0xee1f('0x25')](function(_0x538792){_0x25dbb5['count']=_0x538792;if(_0x3b4c6e[_0xee1f('0x31')][_0xee1f('0x40')]){_0x39656c['include']=[{'all':!![]}];}return db[_0xee1f('0x63')]['findAll'](_0x39656c);})[_0xee1f('0x25')](function(_0x468fcc){_0x25dbb5[_0xee1f('0x43')]=_0x468fcc;return _0x25dbb5;});}})[_0xee1f('0x25')](respondWithFilteredResult(_0x231141,_0x39656c))[_0xee1f('0x44')](handleError(_0x231141,null));};exports[_0xee1f('0x64')]=function(_0x109bb0,_0x48113a,_0x4e5c25){var _0x5bc568={};var _0x429110={};var _0x2c3a3a;var _0x3f5878;return db['Campaign'][_0xee1f('0x5e')]({'where':{'id':_0x109bb0['params']['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x48113a,null))[_0xee1f('0x25')](function(_0x1bcbb3){if(_0x1bcbb3){_0x2c3a3a=_0x1bcbb3;_0x429110[_0xee1f('0x32')]=_['keys'](db[_0xee1f('0x65')][_0xee1f('0x2e')]);_0x429110[_0xee1f('0x31')]=_[_0xee1f('0x59')](_0x109bb0[_0xee1f('0x31')]);_0x429110[_0xee1f('0x3a')]=_['intersection'](_0x429110['model'],_0x429110['query']);_0x5bc568[_0xee1f('0x35')]=_[_0xee1f('0x33')](_0x429110[_0xee1f('0x32')],qs['fields'](_0x109bb0[_0xee1f('0x31')][_0xee1f('0x34')]));_0x5bc568[_0xee1f('0x35')]=_0x5bc568['attributes']['length']?_0x5bc568[_0xee1f('0x35')]:_0x429110[_0xee1f('0x32')];_0x5bc568['order']=qs[_0xee1f('0x38')](_0x109bb0[_0xee1f('0x31')][_0xee1f('0x38')]);_0x5bc568['where']=qs['filters'](_[_0xee1f('0x3b')](_0x109bb0[_0xee1f('0x31')],_0x429110[_0xee1f('0x3a')]));if(_0x109bb0[_0xee1f('0x31')][_0xee1f('0x3c')]){_0x5bc568[_0xee1f('0x39')]=_[_0xee1f('0x3d')](_0x5bc568[_0xee1f('0x39')],{'$or':_['map'](_0x5bc568[_0xee1f('0x35')],function(_0x484db4){var _0x2a0e2d={};_0x2a0e2d[_0x484db4]={'$like':'%'+_0x109bb0[_0xee1f('0x31')][_0xee1f('0x3c')]+'%'};return _0x2a0e2d;})});}_0x5bc568=_[_0xee1f('0x3d')]({},_0x5bc568,_0x109bb0[_0xee1f('0x3f')]);return _0x2c3a3a[_0xee1f('0x64')](_0x5bc568);}})['then'](function(_0x5069e6){if(_0x5069e6){_0x3f5878=_0x5069e6[_0xee1f('0x36')];if(!_0x109bb0[_0xee1f('0x31')]['hasOwnProperty'](_0xee1f('0x37'))){_0x5bc568[_0xee1f('0x20')]=qs[_0xee1f('0x20')](_0x109bb0[_0xee1f('0x31')][_0xee1f('0x20')]);_0x5bc568[_0xee1f('0x1e')]=qs[_0xee1f('0x1e')](_0x109bb0[_0xee1f('0x31')][_0xee1f('0x1e')]);}return _0x2c3a3a[_0xee1f('0x64')](_0x5bc568);}})[_0xee1f('0x25')](function(_0x17cf9b){if(_0x17cf9b){return _0x17cf9b?{'count':_0x3f5878,'rows':_0x17cf9b}:null;}})[_0xee1f('0x25')](respondWithResult(_0x48113a,null))[_0xee1f('0x44')](handleError(_0x48113a,null));};exports[_0xee1f('0x66')]=function(_0x1fcfa9,_0xf54268,_0x53652f){var _0x349b0a,_0x247751;var _0x21764b=[];var _0xff01e0=moment()[_0xee1f('0x67')](_0xee1f('0x68'));return db[_0xee1f('0x2d')]['find']({'where':{'id':_0x1fcfa9[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0xf54268,null))[_0xee1f('0x25')](function(_0x1f37d2){if(_0x1f37d2){_0x247751=_0x1f37d2;return _0x1f37d2[_0xee1f('0x66')](_0x1fcfa9[_0xee1f('0x48')]['ids'],_[_0xee1f('0x50')](_0x1fcfa9[_0xee1f('0x48')],[_0xee1f('0x69'),'id'])||{});}return null;})['spread'](function(_0x5bf163){var _0x5b0c28;var _0xa7ad3e;_0x349b0a=_0x5bf163||[];var _0x49e1f0=[];if(_0x5bf163){for(var _0x252fbd=0x0;_0x252fbd<_0x5bf163['length'];_0x252fbd+=0x1){var _0x22a477=_0x5bf163[_0x252fbd][_0xee1f('0x4a')]({'plain':!![]});_0x247751[_0xee1f('0x6a')]=_0x1fcfa9['body']['dialCheckDuplicateType']?_0x1fcfa9[_0xee1f('0x48')][_0xee1f('0x6a')]:_0x247751[_0xee1f('0x6a')];switch(_0x247751['dialCheckDuplicateType']){case _0xee1f('0x6b'):_0x5b0c28=squel[_0xee1f('0x6c')]()[_0xee1f('0x6d')](_0xee1f('0x6e'))[_0xee1f('0x6f')]([_0xee1f('0x70'),_0xee1f('0x71'),_0xee1f('0x72'),_0xee1f('0x73'),_0xee1f('0x5c'),_0xee1f('0x51'),_0xee1f('0x52')],squel[_0xee1f('0x74')]()[_0xee1f('0x75')](_0xee1f('0x70'),'phone')[_0xee1f('0x75')](_0xee1f('0x76'),_0xee1f('0x71'))[_0xee1f('0x75')]('id',_0xee1f('0x72'))['field'](_0x22a477[_0xee1f('0x77')][_0xee1f('0x78')](),_0xee1f('0x73'))[_0xee1f('0x75')](_0x1fcfa9[_0xee1f('0x46')]['id']['toString'](),_0xee1f('0x5c'))[_0xee1f('0x75')]('\x27'+_0xff01e0+'\x27',_0xee1f('0x51'))['field']('\x27'+_0xff01e0+'\x27',_0xee1f('0x52'))['from']('cm_contacts')[_0xee1f('0x39')](_0xee1f('0x79'))['where'](_0xee1f('0x7a'),_0x22a477[_0xee1f('0x77')][_0xee1f('0x78')]())[_0xee1f('0x39')](_0xee1f('0x7b'))[_0xee1f('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xee1f('0x74')]()[_0xee1f('0x75')](_0xee1f('0x7c'))[_0xee1f('0x7d')](_0xee1f('0x7e'))[_0xee1f('0x39')]('CampaignId\x20=\x20?',_0x1fcfa9[_0xee1f('0x46')]['id'][_0xee1f('0x78')]()))[_0xee1f('0x39')](_0xee1f('0x7f'),squel[_0xee1f('0x74')]()[_0xee1f('0x75')](_0xee1f('0x80'))['from'](_0xee1f('0x6e'))[_0xee1f('0x39')](_0xee1f('0x81'),_0x1fcfa9[_0xee1f('0x46')]['id'][_0xee1f('0x78')]())))[_0xee1f('0x78')]();break;case _0xee1f('0x82'):_0x5b0c28=squel[_0xee1f('0x6c')]()[_0xee1f('0x6d')](_0xee1f('0x6e'))[_0xee1f('0x6f')](['phone','scheduledAt',_0xee1f('0x72'),_0xee1f('0x73'),'CampaignId',_0xee1f('0x51'),'updatedAt'],squel[_0xee1f('0x74')]()[_0xee1f('0x75')]('phone',_0xee1f('0x70'))[_0xee1f('0x75')](_0xee1f('0x76'),_0xee1f('0x71'))[_0xee1f('0x75')]('id',_0xee1f('0x72'))[_0xee1f('0x75')](_0x22a477['CmListId'][_0xee1f('0x78')](),_0xee1f('0x73'))[_0xee1f('0x75')](_0x1fcfa9[_0xee1f('0x46')]['id']['toString'](),_0xee1f('0x5c'))['field']('\x27'+_0xff01e0+'\x27',_0xee1f('0x51'))['field']('\x27'+_0xff01e0+'\x27',_0xee1f('0x52'))[_0xee1f('0x7d')](_0xee1f('0x83'))[_0xee1f('0x39')](_0xee1f('0x79'))[_0xee1f('0x39')]('ListId\x20=\x20?',_0x22a477[_0xee1f('0x77')][_0xee1f('0x78')]())[_0xee1f('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0xee1f('0x39')](_0xee1f('0x7f'),squel[_0xee1f('0x74')]()[_0xee1f('0x75')](_0xee1f('0x80'))[_0xee1f('0x7d')](_0xee1f('0x6e'))['where'](_0xee1f('0x81'),_0x1fcfa9['params']['id'][_0xee1f('0x78')]())))[_0xee1f('0x78')]();break;default:_0x5b0c28=squel[_0xee1f('0x6c')]()['into'](_0xee1f('0x6e'))['fromQuery'](['phone','scheduledAt',_0xee1f('0x72'),_0xee1f('0x73'),_0xee1f('0x5c'),_0xee1f('0x51'),'updatedAt'],squel[_0xee1f('0x74')]()['field'](_0xee1f('0x70'),_0xee1f('0x70'))[_0xee1f('0x75')]('NOW()',_0xee1f('0x71'))['field']('id',_0xee1f('0x72'))[_0xee1f('0x75')](_0x22a477[_0xee1f('0x77')][_0xee1f('0x78')](),'ListId')[_0xee1f('0x75')](_0x1fcfa9[_0xee1f('0x46')]['id'][_0xee1f('0x78')](),'CampaignId')[_0xee1f('0x75')]('\x27'+_0xff01e0+'\x27',_0xee1f('0x51'))['field']('\x27'+_0xff01e0+'\x27',_0xee1f('0x52'))[_0xee1f('0x7d')](_0xee1f('0x83'))[_0xee1f('0x39')](_0xee1f('0x79'))[_0xee1f('0x39')](_0xee1f('0x7a'),_0x22a477[_0xee1f('0x77')]['toString']())[_0xee1f('0x39')](_0xee1f('0x7b')))[_0xee1f('0x78')]();}_0xa7ad3e=squel[_0xee1f('0x6c')]()['into'](_0xee1f('0x84'))['fromQuery']([_0xee1f('0x85'),_0xee1f('0x71'),_0xee1f('0x70'),_0xee1f('0x86'),'createdAt',_0xee1f('0x52')],squel['select']()['field']('h.id','id')[_0xee1f('0x75')](_0xee1f('0x76'),_0xee1f('0x71'))[_0xee1f('0x75')](_0xee1f('0x87'),'phone')[_0xee1f('0x75')](_0xee1f('0x88'),_0xee1f('0x86'))['field']('\x27'+_0xff01e0+'\x27',_0xee1f('0x51'))['field']('\x27'+_0xff01e0+'\x27','updatedAt')[_0xee1f('0x7d')](_0xee1f('0x89'),'ci')['join'](_0xee1f('0x6e'),'h',_0xee1f('0x8a'))[_0xee1f('0x39')](_0xee1f('0x8b'),_0x22a477['CmListId'][_0xee1f('0x78')]())[_0xee1f('0x39')](_0xee1f('0x8c'),_0x1fcfa9[_0xee1f('0x46')]['id'][_0xee1f('0x78')]())[_0xee1f('0x39')](_0xee1f('0x8d'),_0xff01e0))[_0xee1f('0x78')]();_0x49e1f0['push'](db[_0xee1f('0x8e')]['query'](_0x5b0c28));_0x21764b[_0xee1f('0x8f')](db[_0xee1f('0x8e')]['query'](_0xa7ad3e));}return BPromise[_0xee1f('0x90')](_0x49e1f0);}})[_0xee1f('0x25')](function(){return BPromise[_0xee1f('0x90')](_0x21764b);})[_0xee1f('0x25')](function(){return _0x349b0a;})['then'](respondWithResult(_0xf54268,null))['catch'](handleError(_0xf54268,null));};exports[_0xee1f('0x91')]=function(_0x211cc3,_0x2c9249,_0xa9daf1){return db[_0xee1f('0x2d')][_0xee1f('0x4f')]({'where':{'id':_0x211cc3[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x2c9249,null))[_0xee1f('0x25')](function(_0x1b56cb){if(_0x1b56cb){return _0x1b56cb[_0xee1f('0x91')](_0x211cc3[_0xee1f('0x31')][_0xee1f('0x69')]);}})[_0xee1f('0x25')](function(_0x5f5cf8){if(_0x5f5cf8){return db[_0xee1f('0x58')][_0xee1f('0x26')]({'where':{'ListId':_0x211cc3[_0xee1f('0x31')]['ids'],'CampaignId':_0x211cc3[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](function(){return _0x5f5cf8;});}})['then'](respondWithStatusCode(_0x2c9249,null))['catch'](handleError(_0x2c9249,null));};exports[_0xee1f('0x92')]=function(_0x3d633a,_0x36829e,_0x4530ee){var _0x5c7b59={};var _0x48b10b={};var _0x4f3d14;var _0x5a512d;return db[_0xee1f('0x2d')][_0xee1f('0x5e')]({'where':{'id':_0x3d633a[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x36829e,null))[_0xee1f('0x25')](function(_0x30cfa6){if(_0x30cfa6){_0x4f3d14=_0x30cfa6;_0x48b10b[_0xee1f('0x32')]=_[_0xee1f('0x59')](db['CmList']['rawAttributes']);_0x48b10b[_0xee1f('0x31')]=_[_0xee1f('0x59')](_0x3d633a[_0xee1f('0x31')]);_0x48b10b['filters']=_[_0xee1f('0x33')](_0x48b10b['model'],_0x48b10b[_0xee1f('0x31')]);_0x5c7b59[_0xee1f('0x35')]=_[_0xee1f('0x33')](_0x48b10b[_0xee1f('0x32')],qs['fields'](_0x3d633a[_0xee1f('0x31')][_0xee1f('0x34')]));_0x5c7b59[_0xee1f('0x35')]=_0x5c7b59[_0xee1f('0x35')]['length']?_0x5c7b59[_0xee1f('0x35')]:_0x48b10b['model'];_0x5c7b59['order']=qs[_0xee1f('0x38')](_0x3d633a['query'][_0xee1f('0x38')]);_0x5c7b59[_0xee1f('0x39')]=qs[_0xee1f('0x3a')](_[_0xee1f('0x3b')](_0x3d633a[_0xee1f('0x31')],_0x48b10b[_0xee1f('0x3a')]));if(_0x3d633a[_0xee1f('0x31')]['filter']){_0x5c7b59[_0xee1f('0x39')]=_['merge'](_0x5c7b59['where'],{'$or':_['map'](_0x5c7b59[_0xee1f('0x35')],function(_0x233fc6){var _0x36927c={};_0x36927c[_0x233fc6]={'$like':'%'+_0x3d633a[_0xee1f('0x31')]['filter']+'%'};return _0x36927c;})});}_0x5c7b59=_[_0xee1f('0x3d')]({},_0x5c7b59,_0x3d633a[_0xee1f('0x3f')]);return _0x4f3d14[_0xee1f('0x92')](_0x5c7b59);}})[_0xee1f('0x25')](function(_0x46dec7){if(_0x46dec7){_0x5a512d=_0x46dec7[_0xee1f('0x36')];if(!_0x3d633a[_0xee1f('0x31')]['hasOwnProperty'](_0xee1f('0x37'))){_0x5c7b59[_0xee1f('0x20')]=qs[_0xee1f('0x20')](_0x3d633a[_0xee1f('0x31')]['limit']);_0x5c7b59[_0xee1f('0x1e')]=qs[_0xee1f('0x1e')](_0x3d633a[_0xee1f('0x31')][_0xee1f('0x1e')]);}return _0x4f3d14[_0xee1f('0x92')](_0x5c7b59);}})[_0xee1f('0x25')](function(_0x4aabb1){if(_0x4aabb1){return _0x4aabb1?{'count':_0x5a512d,'rows':_0x4aabb1}:null;}})['then'](respondWithResult(_0x36829e,null))['catch'](handleError(_0x36829e,null));};exports[_0xee1f('0x93')]=function(_0x4a948a,_0x21453a,_0x11fddc){var _0x3fbc27,_0x550c87;var _0x4e5f5b=[];var _0x282c1b=moment()['format'](_0xee1f('0x68'));return db['Campaign']['find']({'where':{'id':_0x4a948a[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x21453a,null))[_0xee1f('0x25')](function(_0x5c84c3){if(_0x5c84c3){_0x550c87=_0x5c84c3;return _0x5c84c3[_0xee1f('0x93')](_0x4a948a['body']['ids'],_[_0xee1f('0x50')](_0x4a948a[_0xee1f('0x48')],['ids','id'])||{});}return null;})[_0xee1f('0x94')](function(_0x2227aa){var _0x2e61a4;var _0x446295;_0x3fbc27=_0x2227aa||[];var _0x5cfbca=[];if(_0x2227aa){for(var _0x372a41=0x0;_0x372a41<_0x2227aa[_0xee1f('0x36')];_0x372a41+=0x1){var _0x2ef353=_0x2227aa[_0x372a41][_0xee1f('0x4a')]({'plain':!![]});_0x2e61a4=squel[_0xee1f('0x6c')]()['into']('cm_hopper_black')[_0xee1f('0x6f')]([_0xee1f('0x70'),_0xee1f('0x72'),_0xee1f('0x73'),_0xee1f('0x5c'),_0xee1f('0x51'),_0xee1f('0x52')],squel[_0xee1f('0x74')]()[_0xee1f('0x75')]('phone',_0xee1f('0x70'))[_0xee1f('0x75')]('id','ContactId')[_0xee1f('0x75')](_0x2ef353[_0xee1f('0x77')][_0xee1f('0x78')](),_0xee1f('0x73'))['field'](_0x4a948a[_0xee1f('0x46')]['id'][_0xee1f('0x78')](),_0xee1f('0x5c'))[_0xee1f('0x75')](_0xee1f('0x76'),_0xee1f('0x51'))['field']('NOW()','updatedAt')['from'](_0xee1f('0x83'))[_0xee1f('0x39')]('deletedAt\x20IS\x20NULL')[_0xee1f('0x39')](_0xee1f('0x7a'),_0x2ef353[_0xee1f('0x77')][_0xee1f('0x78')]())[_0xee1f('0x39')](_0xee1f('0x7b')))[_0xee1f('0x78')]();_0x5cfbca['push'](db[_0xee1f('0x8e')][_0xee1f('0x31')](_0x2e61a4));}return BPromise[_0xee1f('0x90')](_0x5cfbca);}})[_0xee1f('0x25')](function(){return _0x3fbc27;})['then'](respondWithResult(_0x21453a,null))[_0xee1f('0x44')](handleError(_0x21453a,null));};exports[_0xee1f('0x95')]=function(_0x29bc2c,_0x5559bd,_0x3a81cd){return db[_0xee1f('0x2d')][_0xee1f('0x4f')]({'where':{'id':_0x29bc2c[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](handleEntityNotFound(_0x5559bd,null))['then'](function(_0x6ed336){if(_0x6ed336){return _0x6ed336['removeBlackLists'](_0x29bc2c[_0xee1f('0x31')][_0xee1f('0x69')]);}})[_0xee1f('0x25')](function(_0x5e8c64){if(_0x5e8c64){return db[_0xee1f('0x63')]['destroy']({'where':{'ListId':_0x29bc2c[_0xee1f('0x31')][_0xee1f('0x69')],'CampaignId':_0x29bc2c[_0xee1f('0x46')]['id']}})[_0xee1f('0x25')](function(){return _0x5e8c64;});}})['then'](respondWithStatusCode(_0x5559bd,null))[_0xee1f('0x44')](handleError(_0x5559bd,null));};
\ No newline at end of file
+var _0xf485=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','filter','merge','VIRTUAL','options','Campaign','includeAll','findAll','rows','show','params','fields','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','user','userProfileId','findOne','CmHopper','hasOwnProperty','nolimit','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','CmListId','toString','from','cm_contacts','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cmHopperId','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','ListId\x20=\x20?','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x1722ea,_0x4244ec){var _0x267aa0=function(_0x22cbe3){while(--_0x22cbe3){_0x1722ea['push'](_0x1722ea['shift']());}};_0x267aa0(++_0x4244ec);}(_0xf485,0x1af));var _0x5f48=function(_0x1a4b58,_0x3c8c4a){_0x1a4b58=_0x1a4b58-0x0;var _0x16e54a=_0xf485[_0x1a4b58];return _0x16e54a;};'use strict';var emlformat=require(_0x5f48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f48('0x2'));var moment=require(_0x5f48('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5f48('0x4'));var util=require(_0x5f48('0x5'));var path=require(_0x5f48('0x6'));var sox=require('sox');var csv=require(_0x5f48('0x7'));var ejs=require(_0x5f48('0x8'));var fs=require('fs');var fs_extra=require(_0x5f48('0x9'));var _=require(_0x5f48('0xa'));var squel=require(_0x5f48('0xb'));var crypto=require(_0x5f48('0xc'));var jsforce=require(_0x5f48('0xd'));var deskjs=require(_0x5f48('0xe'));var toCsv=require(_0x5f48('0x7'));var querystring=require('querystring');var Papa=require(_0x5f48('0xf'));var Redis=require(_0x5f48('0x10'));var authService=require(_0x5f48('0x11'));var qs=require(_0x5f48('0x12'));var as=require(_0x5f48('0x13'));var hardwareService=require(_0x5f48('0x14'));var logger=require(_0x5f48('0x15'))('api');var utils=require(_0x5f48('0x16'));var config=require(_0x5f48('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f48('0x18'))['db'];function respondWithStatusCode(_0x3464d3,_0x1f491d){_0x1f491d=_0x1f491d||0xcc;return function(_0x3e634f){if(_0x3e634f){return _0x3464d3[_0x5f48('0x19')](_0x1f491d);}return _0x3464d3['status'](_0x1f491d)['end']();};}function respondWithResult(_0x36a908,_0x16baa0){_0x16baa0=_0x16baa0||0xc8;return function(_0x1a1183){if(_0x1a1183){return _0x36a908[_0x5f48('0x1a')](_0x16baa0)[_0x5f48('0x1b')](_0x1a1183);}};}function respondWithFilteredResult(_0x470562,_0x474620){return function(_0x26ff72){if(_0x26ff72){var _0x49127f=typeof _0x474620[_0x5f48('0x1c')]===_0x5f48('0x1d')&&typeof _0x474620[_0x5f48('0x1e')]===_0x5f48('0x1d');var _0x324f0e=_0x26ff72['count'];var _0x1d6054=_0x49127f?0x0:_0x474620[_0x5f48('0x1c')];var _0x36896c=_0x49127f?_0x26ff72[_0x5f48('0x1f')]:_0x474620[_0x5f48('0x1c')]+_0x474620['limit'];var _0x636218;if(_0x36896c>=_0x324f0e){_0x36896c=_0x324f0e;_0x636218=0xc8;}else{_0x636218=0xce;}_0x470562[_0x5f48('0x1a')](_0x636218);return _0x470562[_0x5f48('0x20')](_0x5f48('0x21'),_0x1d6054+'-'+_0x36896c+'/'+_0x324f0e)[_0x5f48('0x1b')](_0x26ff72);}return null;};}function patchUpdates(_0x1c0e83){return function(_0x13545d){try{jsonpatch[_0x5f48('0x22')](_0x13545d,_0x1c0e83,!![]);}catch(_0x495e94){return BPromise['reject'](_0x495e94);}return _0x13545d[_0x5f48('0x23')]();};}function saveUpdates(_0x30b10b,_0x535830){return function(_0x40ab87){if(_0x40ab87){return _0x40ab87[_0x5f48('0x24')](_0x30b10b)['then'](function(_0x33dec5){return _0x33dec5;});}return null;};}function removeEntity(_0x58487b,_0x205ad3){return function(_0x315b72){if(_0x315b72){return _0x315b72[_0x5f48('0x25')]()['then'](function(){var _0x48520f=_0x315b72[_0x5f48('0x26')]({'plain':!![]});var _0x22c0a9='IvrCampaigns';return db['UserProfileResource'][_0x5f48('0x25')]({'where':{'type':_0x22c0a9,'resourceId':_0x48520f['id']}})['then'](function(){return _0x315b72;});})[_0x5f48('0x27')](function(){_0x58487b[_0x5f48('0x1a')](0xcc)[_0x5f48('0x28')]();});}};}function handleEntityNotFound(_0xe03d5,_0x12d509){return function(_0x12009d){if(!_0x12009d){_0xe03d5[_0x5f48('0x19')](0x194);}return _0x12009d;};}function handleError(_0x2831c8,_0x16a0cd){_0x16a0cd=_0x16a0cd||0x1f4;return function(_0x4731ab){logger[_0x5f48('0x29')](_0x4731ab[_0x5f48('0x2a')]);if(_0x4731ab[_0x5f48('0x2b')]){delete _0x4731ab[_0x5f48('0x2b')];}_0x2831c8['status'](_0x16a0cd)[_0x5f48('0x2c')](_0x4731ab);};}exports[_0x5f48('0x2d')]=function(_0x30e440,_0x4c10fb){var _0x46b41f={},_0x444e9c={},_0x1a244a={'count':0x0,'rows':[]};var _0x467696=_[_0x5f48('0x2e')](db['Campaign'][_0x5f48('0x2f')],function(_0x49816f){return{'name':_0x49816f[_0x5f48('0x30')],'type':_0x49816f[_0x5f48('0x31')][_0x5f48('0x32')]};});_0x444e9c[_0x5f48('0x33')]=_[_0x5f48('0x2e')](_0x467696,_0x5f48('0x2b'));_0x444e9c[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x30e440[_0x5f48('0x34')]);_0x444e9c[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x444e9c[_0x5f48('0x33')],_0x444e9c['query']);_0x46b41f[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x444e9c[_0x5f48('0x33')],qs['fields'](_0x30e440[_0x5f48('0x34')]['fields']));_0x46b41f[_0x5f48('0x38')]=_0x46b41f[_0x5f48('0x38')][_0x5f48('0x39')]?_0x46b41f[_0x5f48('0x38')]:_0x444e9c[_0x5f48('0x33')];if(!_0x30e440[_0x5f48('0x34')]['hasOwnProperty']('nolimit')){_0x46b41f['limit']=qs[_0x5f48('0x1e')](_0x30e440[_0x5f48('0x34')]['limit']);_0x46b41f[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x30e440[_0x5f48('0x34')][_0x5f48('0x1c')]);}_0x46b41f[_0x5f48('0x3a')]=qs[_0x5f48('0x3b')](_0x30e440[_0x5f48('0x34')][_0x5f48('0x3b')]);_0x46b41f[_0x5f48('0x3c')]=qs['filters'](_['pick'](_0x30e440['query'],_0x444e9c[_0x5f48('0x36')]),_0x467696);if(_0x30e440[_0x5f48('0x34')][_0x5f48('0x3d')]){_0x46b41f[_0x5f48('0x3c')]=_[_0x5f48('0x3e')](_0x46b41f['where'],{'$or':_[_0x5f48('0x2e')](_0x467696,function(_0x153267){if(_0x153267[_0x5f48('0x31')]!==_0x5f48('0x3f')){var _0x310af6={};_0x310af6[_0x153267[_0x5f48('0x2b')]]={'$like':'%'+_0x30e440[_0x5f48('0x34')]['filter']+'%'};return _0x310af6;}})});}_0x46b41f=_[_0x5f48('0x3e')]({},_0x46b41f,_0x30e440[_0x5f48('0x40')]);var _0x6c84e1={'where':_0x46b41f[_0x5f48('0x3c')]};return db[_0x5f48('0x41')]['count'](_0x6c84e1)['then'](function(_0x437f44){_0x1a244a[_0x5f48('0x1f')]=_0x437f44;if(_0x30e440['query'][_0x5f48('0x42')]){_0x46b41f['include']=[{'all':!![]}];}return db[_0x5f48('0x41')][_0x5f48('0x43')](_0x46b41f);})['then'](function(_0x1baa73){_0x1a244a[_0x5f48('0x44')]=_0x1baa73;return _0x1a244a;})['then'](respondWithFilteredResult(_0x4c10fb,_0x46b41f))['catch'](handleError(_0x4c10fb,null));};exports[_0x5f48('0x45')]=function(_0x3e955c,_0x244d96){var _0x403a24={'raw':![],'where':{'id':_0x3e955c[_0x5f48('0x46')]['id']}},_0x260fb8={};_0x260fb8[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x41')][_0x5f48('0x2f')]);_0x260fb8[_0x5f48('0x34')]=_['keys'](_0x3e955c[_0x5f48('0x34')]);_0x260fb8[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x260fb8[_0x5f48('0x33')],_0x260fb8['query']);_0x403a24[_0x5f48('0x38')]=_['intersection'](_0x260fb8[_0x5f48('0x33')],qs[_0x5f48('0x47')](_0x3e955c['query'][_0x5f48('0x47')]));_0x403a24[_0x5f48('0x38')]=_0x403a24[_0x5f48('0x38')][_0x5f48('0x39')]?_0x403a24['attributes']:_0x260fb8[_0x5f48('0x33')];if(_0x3e955c[_0x5f48('0x34')][_0x5f48('0x42')]){_0x403a24[_0x5f48('0x48')]=[{'all':!![]}];}_0x403a24=_[_0x5f48('0x3e')]({},_0x403a24,_0x3e955c[_0x5f48('0x40')]);return db[_0x5f48('0x41')][_0x5f48('0x49')](_0x403a24)[_0x5f48('0x27')](handleEntityNotFound(_0x244d96,null))['then'](respondWithResult(_0x244d96,null))[_0x5f48('0x4a')](handleError(_0x244d96,null));};exports[_0x5f48('0x4b')]=function(_0x34132d,_0x2f813a){return db['Campaign'][_0x5f48('0x4b')](_0x34132d[_0x5f48('0x4c')],{})['then'](function(_0xc23d59){var _0x101015=_0x34132d['user'][_0x5f48('0x26')]({'plain':!![]});if(!_0x101015)throw new Error(_0x5f48('0x4d'));if(_0x101015[_0x5f48('0x4e')]==='user'){var _0x5f3b1f=_0xc23d59['get']({'plain':!![]});var _0x55afb4=_0x5f48('0x4f');return db[_0x5f48('0x50')][_0x5f48('0x49')]({'where':{'name':_0x55afb4,'userProfileId':_0x101015['userProfileId']},'raw':!![]})[_0x5f48('0x27')](function(_0x50fae9){if(_0x50fae9&&_0x50fae9[_0x5f48('0x51')]===0x0){return db[_0x5f48('0x52')][_0x5f48('0x4b')]({'name':_0x5f3b1f['name'],'resourceId':_0x5f3b1f['id'],'type':_0x50fae9[_0x5f48('0x2b')],'sectionId':_0x50fae9['id']},{})[_0x5f48('0x27')](function(){return _0xc23d59;});}else{return _0xc23d59;}})[_0x5f48('0x4a')](function(_0x22302c){logger[_0x5f48('0x29')](_0x5f48('0x53'),_0x22302c);throw _0x22302c;});}return _0xc23d59;})[_0x5f48('0x27')](respondWithResult(_0x2f813a,0xc9))[_0x5f48('0x4a')](handleError(_0x2f813a,null));};exports[_0x5f48('0x54')]=function(_0x1a9ebf,_0x2015cb){var _0x45c74a={'where':{'id':_0x1a9ebf['params']['id']}},_0x4ff63e={};_0x4ff63e[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x41')][_0x5f48('0x2f')]);_0x45c74a[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x4ff63e['model'],qs[_0x5f48('0x47')](_0x1a9ebf[_0x5f48('0x34')]['fields']));_0x45c74a['attributes']=_0x45c74a['attributes'][_0x5f48('0x39')]?_0x45c74a[_0x5f48('0x38')]:_0x4ff63e[_0x5f48('0x33')];if(_0x1a9ebf['query'][_0x5f48('0x42')]){_0x45c74a[_0x5f48('0x48')]=[{'all':!![]}];}_0x45c74a=_[_0x5f48('0x3e')]({},_0x45c74a,_0x1a9ebf[_0x5f48('0x40')]);return db[_0x5f48('0x41')][_0x5f48('0x49')](_0x45c74a)[_0x5f48('0x27')](handleEntityNotFound(_0x2015cb,null))[_0x5f48('0x27')](function(_0x4276b8){if(_0x4276b8){var _0x39f162=_0x4276b8[_0x5f48('0x26')]({'plain':!![]});_0x39f162=qs[_0x5f48('0x55')](_0x39f162,['id','createdAt',_0x5f48('0x56')]);_0x1a9ebf[_0x5f48('0x4c')]=_[_0x5f48('0x55')](_0x1a9ebf[_0x5f48('0x4c')],['id',_0x5f48('0x57'),'updatedAt']);return db[_0x5f48('0x41')]['create'](_[_0x5f48('0x3e')](_0x39f162,_0x1a9ebf['body']),{'include':_0x1a9ebf['query'][_0x5f48('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x284bf8){var _0x17e5ee=_0x1a9ebf[_0x5f48('0x58')]['get']({'plain':!![]});if(!_0x17e5ee)throw new Error(_0x5f48('0x4d'));if(_0x17e5ee[_0x5f48('0x4e')]===_0x5f48('0x58')){var _0x21c051=_0x284bf8[_0x5f48('0x26')]({'plain':!![]});var _0x51365b=_0x5f48('0x4f');return db[_0x5f48('0x50')]['find']({'where':{'name':_0x51365b,'userProfileId':_0x17e5ee[_0x5f48('0x59')]},'raw':!![]})[_0x5f48('0x27')](function(_0x340b7e){if(_0x340b7e&&_0x340b7e[_0x5f48('0x51')]===0x0){return db[_0x5f48('0x52')][_0x5f48('0x4b')]({'name':_0x21c051[_0x5f48('0x2b')],'resourceId':_0x21c051['id'],'type':_0x340b7e[_0x5f48('0x2b')],'sectionId':_0x340b7e['id']},{})[_0x5f48('0x27')](function(){return _0x284bf8;});}else{return _0x284bf8;}})[_0x5f48('0x4a')](function(_0x57a38c){logger[_0x5f48('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57a38c);throw _0x57a38c;});}return _0x284bf8;});}})[_0x5f48('0x27')](respondWithResult(_0x2015cb,0xc9))[_0x5f48('0x4a')](handleError(_0x2015cb,null));};exports[_0x5f48('0x24')]=function(_0x4713b1,_0x340988){if(_0x4713b1['body']['id']){delete _0x4713b1[_0x5f48('0x4c')]['id'];}return db[_0x5f48('0x41')]['find']({'where':{'id':_0x4713b1[_0x5f48('0x46')]['id']}})['then'](handleEntityNotFound(_0x340988,null))[_0x5f48('0x27')](saveUpdates(_0x4713b1[_0x5f48('0x4c')],null))[_0x5f48('0x27')](respondWithResult(_0x340988,null))['catch'](handleError(_0x340988,null));};exports[_0x5f48('0x25')]=function(_0x16828b,_0x4775da){return db['Campaign'][_0x5f48('0x49')]({'where':{'id':_0x16828b[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x4775da,null))[_0x5f48('0x27')](removeEntity(_0x4775da,null))[_0x5f48('0x4a')](handleError(_0x4775da,null));};exports['getHoppers']=function(_0x317077,_0x887605,_0x651cfc){var _0xd7d61c={'raw':!![],'where':{}};var _0x450b3b={};var _0x4a264f={'count':0x0,'rows':[]};return db[_0x5f48('0x41')][_0x5f48('0x5a')]({'where':{'id':_0x317077[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x887605,null))['then'](function(_0x5c78bb){if(_0x5c78bb){_0x450b3b[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x5b')]['rawAttributes']);_0x450b3b[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x317077[_0x5f48('0x34')]);_0x450b3b[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x450b3b[_0x5f48('0x33')],_0x450b3b[_0x5f48('0x34')]);_0xd7d61c[_0x5f48('0x38')]=_['intersection'](_0x450b3b[_0x5f48('0x33')],qs[_0x5f48('0x47')](_0x317077[_0x5f48('0x34')]['fields']));_0xd7d61c[_0x5f48('0x38')]=_0xd7d61c[_0x5f48('0x38')][_0x5f48('0x39')]?_0xd7d61c[_0x5f48('0x38')]:_0x450b3b['model'];if(!_0x317077[_0x5f48('0x34')][_0x5f48('0x5c')](_0x5f48('0x5d'))){_0xd7d61c[_0x5f48('0x1e')]=qs['limit'](_0x317077[_0x5f48('0x34')][_0x5f48('0x1e')]);_0xd7d61c[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x317077[_0x5f48('0x34')][_0x5f48('0x1c')]);}_0xd7d61c[_0x5f48('0x3a')]=qs['sort'](_0x317077[_0x5f48('0x34')][_0x5f48('0x3b')]);_0xd7d61c[_0x5f48('0x3c')]=qs['filters'](_[_0x5f48('0x5e')](_0x317077[_0x5f48('0x34')],_0x450b3b[_0x5f48('0x36')]));_0xd7d61c[_0x5f48('0x3c')][_0x5f48('0x5f')]=_0x5c78bb['id'];if(_0x317077[_0x5f48('0x34')][_0x5f48('0x3d')]){_0xd7d61c['where']=_[_0x5f48('0x3e')](_0xd7d61c[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0xd7d61c[_0x5f48('0x38')],function(_0x4b9deb){var _0x2d9b23={};_0x2d9b23[_0x4b9deb]={'$like':'%'+_0x317077[_0x5f48('0x34')][_0x5f48('0x3d')]+'%'};return _0x2d9b23;})});}_0xd7d61c=_[_0x5f48('0x3e')]({},_0xd7d61c,_0x317077[_0x5f48('0x40')]);return db[_0x5f48('0x5b')][_0x5f48('0x1f')]({'where':_0xd7d61c[_0x5f48('0x3c')]})[_0x5f48('0x27')](function(_0x4a5295){_0x4a264f[_0x5f48('0x1f')]=_0x4a5295;if(_0x317077[_0x5f48('0x34')][_0x5f48('0x42')]){_0xd7d61c[_0x5f48('0x48')]=[{'all':!![]}];}return db[_0x5f48('0x5b')][_0x5f48('0x43')](_0xd7d61c);})[_0x5f48('0x27')](function(_0x3f2a3e){_0x4a264f[_0x5f48('0x44')]=_0x3f2a3e;return _0x4a264f;});}})[_0x5f48('0x27')](respondWithFilteredResult(_0x887605,_0xd7d61c))['catch'](handleError(_0x887605,null));};exports[_0x5f48('0x60')]=function(_0x9aeb44,_0x2a7222,_0x29632b){var _0x3a601f={'raw':!![],'where':{}};var _0x2d6705={};var _0x2c39ea={'count':0x0,'rows':[]};return db[_0x5f48('0x41')][_0x5f48('0x5a')]({'where':{'id':_0x9aeb44[_0x5f48('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a7222,null))['then'](function(_0x183e70){if(_0x183e70){_0x2d6705[_0x5f48('0x33')]=_[_0x5f48('0x35')](db['CmHopperHistory'][_0x5f48('0x2f')]);_0x2d6705[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x9aeb44['query']);_0x2d6705[_0x5f48('0x36')]=_['intersection'](_0x2d6705[_0x5f48('0x33')],_0x2d6705['query']);_0x3a601f[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x2d6705[_0x5f48('0x33')],qs[_0x5f48('0x47')](_0x9aeb44[_0x5f48('0x34')][_0x5f48('0x47')]));_0x3a601f['attributes']=_0x3a601f['attributes'][_0x5f48('0x39')]?_0x3a601f['attributes']:_0x2d6705['model'];if(!_0x9aeb44[_0x5f48('0x34')]['hasOwnProperty'](_0x5f48('0x5d'))){_0x3a601f[_0x5f48('0x1e')]=qs[_0x5f48('0x1e')](_0x9aeb44[_0x5f48('0x34')][_0x5f48('0x1e')]);_0x3a601f[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x9aeb44['query']['offset']);}_0x3a601f[_0x5f48('0x3a')]=qs[_0x5f48('0x3b')](_0x9aeb44['query'][_0x5f48('0x3b')]);_0x3a601f[_0x5f48('0x3c')]=qs[_0x5f48('0x36')](_[_0x5f48('0x5e')](_0x9aeb44['query'],_0x2d6705[_0x5f48('0x36')]));_0x3a601f[_0x5f48('0x3c')][_0x5f48('0x5f')]=_0x183e70['id'];if(_0x9aeb44['query']['filter']){_0x3a601f[_0x5f48('0x3c')]=_[_0x5f48('0x3e')](_0x3a601f[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0x3a601f[_0x5f48('0x38')],function(_0x254d4b){var _0xce22a7={};_0xce22a7[_0x254d4b]={'$like':'%'+_0x9aeb44[_0x5f48('0x34')][_0x5f48('0x3d')]+'%'};return _0xce22a7;})});}_0x3a601f=_[_0x5f48('0x3e')]({},_0x3a601f,_0x9aeb44[_0x5f48('0x40')]);return db[_0x5f48('0x61')][_0x5f48('0x1f')]({'where':_0x3a601f['where']})['then'](function(_0x243918){_0x2c39ea[_0x5f48('0x1f')]=_0x243918;if(_0x9aeb44[_0x5f48('0x34')][_0x5f48('0x42')]){_0x3a601f['include']=[{'all':!![]}];}return db[_0x5f48('0x61')][_0x5f48('0x43')](_0x3a601f);})[_0x5f48('0x27')](function(_0x43b1db){_0x2c39ea['rows']=_0x43b1db;return _0x2c39ea;});}})[_0x5f48('0x27')](respondWithFilteredResult(_0x2a7222,_0x3a601f))[_0x5f48('0x4a')](handleError(_0x2a7222,null));};exports[_0x5f48('0x62')]=function(_0x269fa0,_0x6416b7,_0x1e2e81){var _0x316215={'raw':!![],'where':{}};var _0x358764={};var _0x3bf41d={'count':0x0,'rows':[]};return db[_0x5f48('0x41')][_0x5f48('0x5a')]({'where':{'id':_0x269fa0[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x6416b7,null))['then'](function(_0x2baf1d){if(_0x2baf1d){_0x358764[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x63')][_0x5f48('0x2f')]);_0x358764[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x269fa0[_0x5f48('0x34')]);_0x358764['filters']=_['intersection'](_0x358764[_0x5f48('0x33')],_0x358764[_0x5f48('0x34')]);_0x316215[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x358764['model'],qs[_0x5f48('0x47')](_0x269fa0[_0x5f48('0x34')][_0x5f48('0x47')]));_0x316215[_0x5f48('0x38')]=_0x316215[_0x5f48('0x38')][_0x5f48('0x39')]?_0x316215[_0x5f48('0x38')]:_0x358764['model'];if(!_0x269fa0[_0x5f48('0x34')][_0x5f48('0x5c')]('nolimit')){_0x316215['limit']=qs[_0x5f48('0x1e')](_0x269fa0[_0x5f48('0x34')][_0x5f48('0x1e')]);_0x316215[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x269fa0[_0x5f48('0x34')][_0x5f48('0x1c')]);}_0x316215['order']=qs[_0x5f48('0x3b')](_0x269fa0['query'][_0x5f48('0x3b')]);_0x316215[_0x5f48('0x3c')]=qs[_0x5f48('0x36')](_['pick'](_0x269fa0[_0x5f48('0x34')],_0x358764[_0x5f48('0x36')]));_0x316215[_0x5f48('0x3c')][_0x5f48('0x5f')]=_0x2baf1d['id'];if(_0x269fa0[_0x5f48('0x34')]['filter']){_0x316215[_0x5f48('0x3c')]=_[_0x5f48('0x3e')](_0x316215[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0x316215[_0x5f48('0x38')],function(_0x5ad8de){var _0x59b219={};_0x59b219[_0x5ad8de]={'$like':'%'+_0x269fa0[_0x5f48('0x34')]['filter']+'%'};return _0x59b219;})});}_0x316215=_[_0x5f48('0x3e')]({},_0x316215,_0x269fa0[_0x5f48('0x40')]);return db[_0x5f48('0x63')][_0x5f48('0x1f')]({'where':_0x316215[_0x5f48('0x3c')]})[_0x5f48('0x27')](function(_0x2c892d){_0x3bf41d[_0x5f48('0x1f')]=_0x2c892d;if(_0x269fa0[_0x5f48('0x34')][_0x5f48('0x42')]){_0x316215[_0x5f48('0x48')]=[{'all':!![]}];}return db[_0x5f48('0x63')]['findAll'](_0x316215);})[_0x5f48('0x27')](function(_0x5cfc8a){_0x3bf41d[_0x5f48('0x44')]=_0x5cfc8a;return _0x3bf41d;});}})[_0x5f48('0x27')](respondWithFilteredResult(_0x6416b7,_0x316215))[_0x5f48('0x4a')](handleError(_0x6416b7,null));};exports[_0x5f48('0x64')]=function(_0x23f027,_0x29f7f7,_0x56ac1e){var _0x924551={'raw':!![],'where':{}};var _0x2223c1={};var _0x24913b={'count':0x0,'rows':[]};return db[_0x5f48('0x41')][_0x5f48('0x5a')]({'where':{'id':_0x23f027['params']['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x29f7f7,null))[_0x5f48('0x27')](function(_0xe21563){if(_0xe21563){_0x2223c1[_0x5f48('0x33')]=_['keys'](db[_0x5f48('0x65')][_0x5f48('0x2f')]);_0x2223c1[_0x5f48('0x34')]=_['keys'](_0x23f027['query']);_0x2223c1[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x2223c1[_0x5f48('0x33')],_0x2223c1[_0x5f48('0x34')]);_0x924551[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x2223c1['model'],qs[_0x5f48('0x47')](_0x23f027[_0x5f48('0x34')][_0x5f48('0x47')]));_0x924551[_0x5f48('0x38')]=_0x924551['attributes']['length']?_0x924551[_0x5f48('0x38')]:_0x2223c1['model'];if(!_0x23f027[_0x5f48('0x34')]['hasOwnProperty'](_0x5f48('0x5d'))){_0x924551['limit']=qs[_0x5f48('0x1e')](_0x23f027['query']['limit']);_0x924551[_0x5f48('0x1c')]=qs[_0x5f48('0x1c')](_0x23f027[_0x5f48('0x34')][_0x5f48('0x1c')]);}_0x924551[_0x5f48('0x3a')]=qs[_0x5f48('0x3b')](_0x23f027[_0x5f48('0x34')][_0x5f48('0x3b')]);_0x924551[_0x5f48('0x3c')]=qs[_0x5f48('0x36')](_[_0x5f48('0x5e')](_0x23f027[_0x5f48('0x34')],_0x2223c1['filters']));_0x924551['where'][_0x5f48('0x5f')]=_0xe21563['id'];if(_0x23f027[_0x5f48('0x34')][_0x5f48('0x3d')]){_0x924551[_0x5f48('0x3c')]=_[_0x5f48('0x3e')](_0x924551[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0x924551[_0x5f48('0x38')],function(_0x4fb9da){var _0x374e28={};_0x374e28[_0x4fb9da]={'$like':'%'+_0x23f027['query'][_0x5f48('0x3d')]+'%'};return _0x374e28;})});}_0x924551=_[_0x5f48('0x3e')]({},_0x924551,_0x23f027[_0x5f48('0x40')]);return db[_0x5f48('0x65')][_0x5f48('0x1f')]({'where':_0x924551[_0x5f48('0x3c')]})[_0x5f48('0x27')](function(_0x12e9ce){_0x24913b[_0x5f48('0x1f')]=_0x12e9ce;if(_0x23f027[_0x5f48('0x34')][_0x5f48('0x42')]){_0x924551['include']=[{'all':!![]}];}return db[_0x5f48('0x65')][_0x5f48('0x43')](_0x924551);})[_0x5f48('0x27')](function(_0x30966a){_0x24913b[_0x5f48('0x44')]=_0x30966a;return _0x24913b;});}})[_0x5f48('0x27')](respondWithFilteredResult(_0x29f7f7,_0x924551))[_0x5f48('0x4a')](handleError(_0x29f7f7,null));};exports[_0x5f48('0x66')]=function(_0x54aa13,_0x3e67e4,_0x325ee8){var _0x4d4d44={};var _0x1c0bc5={};var _0x169d7e;var _0x40d1af;return db[_0x5f48('0x41')]['findOne']({'where':{'id':_0x54aa13[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x3e67e4,null))[_0x5f48('0x27')](function(_0x1d3323){if(_0x1d3323){_0x169d7e=_0x1d3323;_0x1c0bc5[_0x5f48('0x33')]=_[_0x5f48('0x35')](db[_0x5f48('0x67')][_0x5f48('0x2f')]);_0x1c0bc5['query']=_[_0x5f48('0x35')](_0x54aa13[_0x5f48('0x34')]);_0x1c0bc5[_0x5f48('0x36')]=_['intersection'](_0x1c0bc5[_0x5f48('0x33')],_0x1c0bc5[_0x5f48('0x34')]);_0x4d4d44[_0x5f48('0x38')]=_[_0x5f48('0x37')](_0x1c0bc5[_0x5f48('0x33')],qs['fields'](_0x54aa13[_0x5f48('0x34')][_0x5f48('0x47')]));_0x4d4d44[_0x5f48('0x38')]=_0x4d4d44[_0x5f48('0x38')][_0x5f48('0x39')]?_0x4d4d44[_0x5f48('0x38')]:_0x1c0bc5[_0x5f48('0x33')];_0x4d4d44['order']=qs[_0x5f48('0x3b')](_0x54aa13[_0x5f48('0x34')][_0x5f48('0x3b')]);_0x4d4d44[_0x5f48('0x3c')]=qs[_0x5f48('0x36')](_[_0x5f48('0x5e')](_0x54aa13['query'],_0x1c0bc5[_0x5f48('0x36')]));if(_0x54aa13[_0x5f48('0x34')][_0x5f48('0x3d')]){_0x4d4d44['where']=_[_0x5f48('0x3e')](_0x4d4d44[_0x5f48('0x3c')],{'$or':_['map'](_0x4d4d44[_0x5f48('0x38')],function(_0x480b31){var _0x38d8a4={};_0x38d8a4[_0x480b31]={'$like':'%'+_0x54aa13[_0x5f48('0x34')][_0x5f48('0x3d')]+'%'};return _0x38d8a4;})});}_0x4d4d44=_[_0x5f48('0x3e')]({},_0x4d4d44,_0x54aa13[_0x5f48('0x40')]);return _0x169d7e[_0x5f48('0x66')](_0x4d4d44);}})['then'](function(_0x1f9cfb){if(_0x1f9cfb){_0x40d1af=_0x1f9cfb[_0x5f48('0x39')];if(!_0x54aa13[_0x5f48('0x34')][_0x5f48('0x5c')](_0x5f48('0x5d'))){_0x4d4d44[_0x5f48('0x1e')]=qs[_0x5f48('0x1e')](_0x54aa13[_0x5f48('0x34')][_0x5f48('0x1e')]);_0x4d4d44['offset']=qs[_0x5f48('0x1c')](_0x54aa13['query'][_0x5f48('0x1c')]);}return _0x169d7e[_0x5f48('0x66')](_0x4d4d44);}})[_0x5f48('0x27')](function(_0x49665b){if(_0x49665b){return _0x49665b?{'count':_0x40d1af,'rows':_0x49665b}:null;}})[_0x5f48('0x27')](respondWithResult(_0x3e67e4,null))[_0x5f48('0x4a')](handleError(_0x3e67e4,null));};exports['addLists']=function(_0x55b681,_0x485357,_0xd6e51c){var _0x1a8a8d,_0x4b7bd2;var _0x4f0e39=[];var _0x25ddc7=moment()[_0x5f48('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x5f48('0x41')]['find']({'where':{'id':_0x55b681[_0x5f48('0x46')]['id']}})['then'](handleEntityNotFound(_0x485357,null))[_0x5f48('0x27')](function(_0x1f7ad3){if(_0x1f7ad3){_0x4b7bd2=_0x1f7ad3;return _0x1f7ad3[_0x5f48('0x69')](_0x55b681[_0x5f48('0x4c')]['ids'],_[_0x5f48('0x55')](_0x55b681[_0x5f48('0x4c')],[_0x5f48('0x6a'),'id'])||{});}return null;})[_0x5f48('0x6b')](function(_0x21ed50){var _0xb53a6d;var _0xa9518d;_0x1a8a8d=_0x21ed50||[];var _0x56c9e7=[];if(_0x21ed50){for(var _0x5d25e2=0x0;_0x5d25e2<_0x21ed50[_0x5f48('0x39')];_0x5d25e2+=0x1){var _0xf32f12=_0x21ed50[_0x5d25e2][_0x5f48('0x26')]({'plain':!![]});_0x4b7bd2['dialCheckDuplicateType']=_0x55b681[_0x5f48('0x4c')]['dialCheckDuplicateType']?_0x55b681['body']['dialCheckDuplicateType']:_0x4b7bd2['dialCheckDuplicateType'];switch(_0x4b7bd2[_0x5f48('0x6c')]){case _0x5f48('0x6d'):_0xb53a6d=squel[_0x5f48('0x6e')]()[_0x5f48('0x6f')](_0x5f48('0x70'))[_0x5f48('0x71')](['phone',_0x5f48('0x72'),_0x5f48('0x73'),_0x5f48('0x74'),'CampaignId',_0x5f48('0x57'),_0x5f48('0x56')],squel[_0x5f48('0x75')]()[_0x5f48('0x76')](_0x5f48('0x77'),_0x5f48('0x77'))[_0x5f48('0x76')](_0x5f48('0x78'),_0x5f48('0x72'))['field']('id',_0x5f48('0x73'))[_0x5f48('0x76')](_0xf32f12[_0x5f48('0x79')][_0x5f48('0x7a')](),_0x5f48('0x74'))[_0x5f48('0x76')](_0x55b681[_0x5f48('0x46')]['id']['toString'](),_0x5f48('0x5f'))[_0x5f48('0x76')]('\x27'+_0x25ddc7+'\x27','createdAt')['field']('\x27'+_0x25ddc7+'\x27',_0x5f48('0x56'))[_0x5f48('0x7b')](_0x5f48('0x7c'))['where']('deletedAt\x20IS\x20NULL')[_0x5f48('0x3c')]('ListId\x20=\x20?',_0xf32f12['CmListId'][_0x5f48('0x7a')]())[_0x5f48('0x3c')]('phone\x20IS\x20NOT\x20NULL')[_0x5f48('0x3c')](_0x5f48('0x7d'),squel[_0x5f48('0x75')]()[_0x5f48('0x76')](_0x5f48('0x7e'))[_0x5f48('0x7b')](_0x5f48('0x7f'))[_0x5f48('0x3c')]('CampaignId\x20=\x20?',_0x55b681[_0x5f48('0x46')]['id']['toString']()))[_0x5f48('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5f48('0x76')](_0x5f48('0x80'))[_0x5f48('0x7b')](_0x5f48('0x70'))['where'](_0x5f48('0x81'),_0x55b681[_0x5f48('0x46')]['id']['toString']())))[_0x5f48('0x7a')]();break;case'onlyIfOpen':_0xb53a6d=squel[_0x5f48('0x6e')]()[_0x5f48('0x6f')]('cm_hopper')[_0x5f48('0x71')]([_0x5f48('0x77'),'scheduledAt',_0x5f48('0x73'),_0x5f48('0x74'),'CampaignId',_0x5f48('0x57'),_0x5f48('0x56')],squel[_0x5f48('0x75')]()[_0x5f48('0x76')](_0x5f48('0x77'),'phone')[_0x5f48('0x76')](_0x5f48('0x78'),_0x5f48('0x72'))['field']('id',_0x5f48('0x73'))['field'](_0xf32f12[_0x5f48('0x79')]['toString'](),_0x5f48('0x74'))[_0x5f48('0x76')](_0x55b681[_0x5f48('0x46')]['id']['toString'](),_0x5f48('0x5f'))[_0x5f48('0x76')]('\x27'+_0x25ddc7+'\x27',_0x5f48('0x57'))[_0x5f48('0x76')]('\x27'+_0x25ddc7+'\x27',_0x5f48('0x56'))[_0x5f48('0x7b')](_0x5f48('0x7c'))[_0x5f48('0x3c')](_0x5f48('0x82'))[_0x5f48('0x3c')]('ListId\x20=\x20?',_0xf32f12['CmListId']['toString']())['where'](_0x5f48('0x83'))[_0x5f48('0x3c')](_0x5f48('0x7d'),squel[_0x5f48('0x75')]()[_0x5f48('0x76')]('COALESCE(phone,\x27\x27)')[_0x5f48('0x7b')](_0x5f48('0x70'))['where'](_0x5f48('0x81'),_0x55b681[_0x5f48('0x46')]['id'][_0x5f48('0x7a')]())))['toString']();break;default:_0xb53a6d=squel['insert']()['into'](_0x5f48('0x70'))[_0x5f48('0x71')]([_0x5f48('0x77'),_0x5f48('0x72'),_0x5f48('0x73'),'ListId',_0x5f48('0x5f'),'createdAt',_0x5f48('0x56')],squel[_0x5f48('0x75')]()['field']('phone',_0x5f48('0x77'))[_0x5f48('0x76')]('NOW()',_0x5f48('0x72'))[_0x5f48('0x76')]('id','ContactId')[_0x5f48('0x76')](_0xf32f12[_0x5f48('0x79')][_0x5f48('0x7a')](),_0x5f48('0x74'))['field'](_0x55b681[_0x5f48('0x46')]['id'][_0x5f48('0x7a')](),_0x5f48('0x5f'))['field']('\x27'+_0x25ddc7+'\x27',_0x5f48('0x57'))['field']('\x27'+_0x25ddc7+'\x27',_0x5f48('0x56'))[_0x5f48('0x7b')]('cm_contacts')[_0x5f48('0x3c')](_0x5f48('0x82'))['where']('ListId\x20=\x20?',_0xf32f12[_0x5f48('0x79')][_0x5f48('0x7a')]())[_0x5f48('0x3c')](_0x5f48('0x83')))[_0x5f48('0x7a')]();}_0xa9518d=squel['insert']()[_0x5f48('0x6f')]('cm_hopper_additional_phones')[_0x5f48('0x71')]([_0x5f48('0x84'),_0x5f48('0x72'),_0x5f48('0x77'),_0x5f48('0x85'),_0x5f48('0x57'),_0x5f48('0x56')],squel['select']()['field']('h.id','id')[_0x5f48('0x76')](_0x5f48('0x78'),_0x5f48('0x72'))[_0x5f48('0x76')](_0x5f48('0x86'),_0x5f48('0x77'))[_0x5f48('0x76')](_0x5f48('0x87'),'OrderBy')['field']('\x27'+_0x25ddc7+'\x27',_0x5f48('0x57'))[_0x5f48('0x76')]('\x27'+_0x25ddc7+'\x27','updatedAt')[_0x5f48('0x7b')](_0x5f48('0x88'),'ci')[_0x5f48('0x89')](_0x5f48('0x70'),'h',_0x5f48('0x8a'))[_0x5f48('0x3c')]('h.ListId\x20=\x20?',_0xf32f12[_0x5f48('0x79')][_0x5f48('0x7a')]())[_0x5f48('0x3c')](_0x5f48('0x8b'),_0x55b681[_0x5f48('0x46')]['id'][_0x5f48('0x7a')]())['where'](_0x5f48('0x8c'),_0x25ddc7))[_0x5f48('0x7a')]();_0x56c9e7['push'](db[_0x5f48('0x8d')][_0x5f48('0x34')](_0xb53a6d));_0x4f0e39[_0x5f48('0x8e')](db[_0x5f48('0x8d')][_0x5f48('0x34')](_0xa9518d));}return BPromise['all'](_0x56c9e7);}})[_0x5f48('0x27')](function(){return BPromise[_0x5f48('0x8f')](_0x4f0e39);})['then'](function(){return _0x1a8a8d;})[_0x5f48('0x27')](respondWithResult(_0x485357,null))[_0x5f48('0x4a')](handleError(_0x485357,null));};exports['removeLists']=function(_0x1794a1,_0x111563,_0x8ca4d8){return db[_0x5f48('0x41')][_0x5f48('0x49')]({'where':{'id':_0x1794a1[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x111563,null))[_0x5f48('0x27')](function(_0x4b4ae3){if(_0x4b4ae3){return _0x4b4ae3[_0x5f48('0x90')](_0x1794a1[_0x5f48('0x34')][_0x5f48('0x6a')]);}})['then'](function(_0xf9286d){if(_0xf9286d){return db[_0x5f48('0x5b')]['destroy']({'where':{'ListId':_0x1794a1['query'][_0x5f48('0x6a')],'CampaignId':_0x1794a1[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](function(){return _0xf9286d;});}})[_0x5f48('0x27')](respondWithStatusCode(_0x111563,null))['catch'](handleError(_0x111563,null));};exports[_0x5f48('0x91')]=function(_0x397336,_0x143415,_0x5831ad){var _0x230f56={};var _0x124c74={};var _0x39e373;var _0xbb6661;return db['Campaign'][_0x5f48('0x5a')]({'where':{'id':_0x397336['params']['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x143415,null))['then'](function(_0x2ce105){if(_0x2ce105){_0x39e373=_0x2ce105;_0x124c74[_0x5f48('0x33')]=_[_0x5f48('0x35')](db['CmList'][_0x5f48('0x2f')]);_0x124c74[_0x5f48('0x34')]=_[_0x5f48('0x35')](_0x397336[_0x5f48('0x34')]);_0x124c74[_0x5f48('0x36')]=_[_0x5f48('0x37')](_0x124c74['model'],_0x124c74['query']);_0x230f56[_0x5f48('0x38')]=_['intersection'](_0x124c74[_0x5f48('0x33')],qs[_0x5f48('0x47')](_0x397336[_0x5f48('0x34')][_0x5f48('0x47')]));_0x230f56[_0x5f48('0x38')]=_0x230f56[_0x5f48('0x38')][_0x5f48('0x39')]?_0x230f56['attributes']:_0x124c74[_0x5f48('0x33')];_0x230f56[_0x5f48('0x3a')]=qs['sort'](_0x397336['query'][_0x5f48('0x3b')]);_0x230f56[_0x5f48('0x3c')]=qs['filters'](_[_0x5f48('0x5e')](_0x397336[_0x5f48('0x34')],_0x124c74[_0x5f48('0x36')]));if(_0x397336['query']['filter']){_0x230f56['where']=_[_0x5f48('0x3e')](_0x230f56[_0x5f48('0x3c')],{'$or':_[_0x5f48('0x2e')](_0x230f56[_0x5f48('0x38')],function(_0x453a76){var _0x3952e8={};_0x3952e8[_0x453a76]={'$like':'%'+_0x397336[_0x5f48('0x34')][_0x5f48('0x3d')]+'%'};return _0x3952e8;})});}_0x230f56=_[_0x5f48('0x3e')]({},_0x230f56,_0x397336['options']);return _0x39e373['getBlackLists'](_0x230f56);}})[_0x5f48('0x27')](function(_0x187957){if(_0x187957){_0xbb6661=_0x187957[_0x5f48('0x39')];if(!_0x397336[_0x5f48('0x34')][_0x5f48('0x5c')](_0x5f48('0x5d'))){_0x230f56[_0x5f48('0x1e')]=qs[_0x5f48('0x1e')](_0x397336[_0x5f48('0x34')]['limit']);_0x230f56[_0x5f48('0x1c')]=qs['offset'](_0x397336[_0x5f48('0x34')][_0x5f48('0x1c')]);}return _0x39e373[_0x5f48('0x91')](_0x230f56);}})['then'](function(_0x3387de){if(_0x3387de){return _0x3387de?{'count':_0xbb6661,'rows':_0x3387de}:null;}})[_0x5f48('0x27')](respondWithResult(_0x143415,null))[_0x5f48('0x4a')](handleError(_0x143415,null));};exports[_0x5f48('0x92')]=function(_0x5a727c,_0x50b2d3,_0x42d932){var _0x5e2def,_0x47d9a6;var _0x3e62e0=[];var _0x519a86=moment()[_0x5f48('0x68')](_0x5f48('0x93'));return db[_0x5f48('0x41')][_0x5f48('0x49')]({'where':{'id':_0x5a727c[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x50b2d3,null))[_0x5f48('0x27')](function(_0x31f1a3){if(_0x31f1a3){_0x47d9a6=_0x31f1a3;return _0x31f1a3[_0x5f48('0x92')](_0x5a727c[_0x5f48('0x4c')][_0x5f48('0x6a')],_[_0x5f48('0x55')](_0x5a727c[_0x5f48('0x4c')],[_0x5f48('0x6a'),'id'])||{});}return null;})[_0x5f48('0x6b')](function(_0x24cea8){var _0x4e6102;var _0x1bec6e;_0x5e2def=_0x24cea8||[];var _0x539668=[];if(_0x24cea8){for(var _0x2addc5=0x0;_0x2addc5<_0x24cea8['length'];_0x2addc5+=0x1){var _0x51d212=_0x24cea8[_0x2addc5][_0x5f48('0x26')]({'plain':!![]});_0x4e6102=squel[_0x5f48('0x6e')]()[_0x5f48('0x6f')]('cm_hopper_black')[_0x5f48('0x71')]([_0x5f48('0x77'),_0x5f48('0x73'),'ListId',_0x5f48('0x5f'),_0x5f48('0x57'),_0x5f48('0x56')],squel[_0x5f48('0x75')]()[_0x5f48('0x76')](_0x5f48('0x77'),_0x5f48('0x77'))[_0x5f48('0x76')]('id',_0x5f48('0x73'))['field'](_0x51d212[_0x5f48('0x79')][_0x5f48('0x7a')](),'ListId')[_0x5f48('0x76')](_0x5a727c[_0x5f48('0x46')]['id'][_0x5f48('0x7a')](),_0x5f48('0x5f'))[_0x5f48('0x76')](_0x5f48('0x78'),_0x5f48('0x57'))[_0x5f48('0x76')]('NOW()',_0x5f48('0x56'))[_0x5f48('0x7b')](_0x5f48('0x7c'))[_0x5f48('0x3c')]('deletedAt\x20IS\x20NULL')[_0x5f48('0x3c')](_0x5f48('0x94'),_0x51d212['CmListId'][_0x5f48('0x7a')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x5f48('0x7a')]();_0x539668[_0x5f48('0x8e')](db[_0x5f48('0x8d')][_0x5f48('0x34')](_0x4e6102));}return BPromise['all'](_0x539668);}})[_0x5f48('0x27')](function(){return _0x5e2def;})[_0x5f48('0x27')](respondWithResult(_0x50b2d3,null))[_0x5f48('0x4a')](handleError(_0x50b2d3,null));};exports['removeBlackLists']=function(_0x47abc4,_0x2945da,_0x37f4fb){return db[_0x5f48('0x41')][_0x5f48('0x49')]({'where':{'id':_0x47abc4[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](handleEntityNotFound(_0x2945da,null))[_0x5f48('0x27')](function(_0x1f3535){if(_0x1f3535){return _0x1f3535['removeBlackLists'](_0x47abc4[_0x5f48('0x34')][_0x5f48('0x6a')]);}})[_0x5f48('0x27')](function(_0x37522e){if(_0x37522e){return db['CmHopperBlack'][_0x5f48('0x25')]({'where':{'ListId':_0x47abc4['query'][_0x5f48('0x6a')],'CampaignId':_0x47abc4[_0x5f48('0x46')]['id']}})[_0x5f48('0x27')](function(){return _0x37522e;});}})[_0x5f48('0x27')](respondWithStatusCode(_0x2945da,null))[_0x5f48('0x4a')](handleError(_0x2945da,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index f7c763b..9b86841 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_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':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x4b2a90,_0x27f5ea){var _0x30bee3=function(_0x30fd3e){while(--_0x30fd3e){_0x4b2a90['push'](_0x4b2a90['shift']());}};_0x30bee3(++_0x27f5ea);}(_0x7a54,0x106));var _0x47a5=function(_0x52996c,_0x28d50d){_0x52996c=_0x52996c-0x0;var _0x2e0201=_0x7a54[_0x52996c];return _0x2e0201;};'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 3a2e514..8b04a52 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 _0xa8a8=['Campaign,\x20%s,\x20%s','message','catch','Campaign','findAll','where','options','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3ffd91,_0x432390){_0x3ffd91=_0x3ffd91-0x0;var _0x4dae07=_0xa8a8[_0x3ffd91];return _0x4dae07;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('Campaign,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('Campaign,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});}exports['GetCampaign']=function(_0x9d55f9){var _0x3d165c=this;return new Promise(function(_0x262ca9,_0x2bce13){return db[_0x8a8a('0x17')][_0x8a8a('0x18')]({'raw':_0x9d55f9['options']?_0x9d55f9['options']['raw']===undefined?!![]:![]:!![],'where':_0x9d55f9['options']?_0x9d55f9['options'][_0x8a8a('0x19')]||null:null,'attributes':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1b')]||null:null,'limit':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1c')]||null:null,'include':_0x9d55f9[_0x8a8a('0x1a')]?_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x9d55f9[_0x8a8a('0x1a')][_0x8a8a('0x1d')],function(_0x625c1b){return{'model':db[_0x625c1b[_0x8a8a('0x1f')]],'as':_0x625c1b['as'],'attributes':_0x625c1b['attributes'],'include':_0x625c1b[_0x8a8a('0x1d')]?_[_0x8a8a('0x1e')](_0x625c1b[_0x8a8a('0x1d')],function(_0x7662e){return{'model':db[_0x7662e[_0x8a8a('0x1f')]],'as':_0x7662e['as'],'attributes':_0x7662e[_0x8a8a('0x1b')],'include':_0x7662e[_0x8a8a('0x1d')]?_['map'](_0x7662e[_0x8a8a('0x1d')],function(_0x38c1e0){return{'model':db[_0x38c1e0[_0x8a8a('0x1f')]],'as':_0x38c1e0['as'],'attributes':_0x38c1e0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dafcd){logger[_0x8a8a('0xe')]('GetCampaign',_0x9d55f9);logger['debug']('GetCampaign',_0x9d55f9,JSON[_0x8a8a('0x11')](_0x2dafcd));_0x262ca9(_0x2dafcd);})['catch'](function(_0x10b916){logger[_0x8a8a('0x12')]('GetCampaign',_0x10b916[_0x8a8a('0x15')],_0x9d55f9);_0x2bce13(_0x3d165c[_0x8a8a('0x12')](0x1f4,_0x10b916[_0x8a8a('0x15')]));});});};
\ No newline at end of file
+var _0x44f8=['raw','where','attributes','limit','include','map','model','then','GetCampaign','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','client','http','request\x20sent','error','Campaign,\x20%s,\x20%s','message','result','catch','options'];(function(_0x1e5246,_0x376043){var _0xf4d359=function(_0x5f4eb9){while(--_0x5f4eb9){_0x1e5246['push'](_0x1e5246['shift']());}};_0xf4d359(++_0x376043);}(_0x44f8,0x1de));var _0x844f=function(_0x500a6f,_0xa7042e){_0x500a6f=_0x500a6f-0x0;var _0x1093cc=_0x44f8[_0x500a6f];return _0x1093cc;};'use strict';var _=require(_0x844f('0x0'));var util=require(_0x844f('0x1'));var moment=require(_0x844f('0x2'));var BPromise=require(_0x844f('0x3'));var rs=require(_0x844f('0x4'));var fs=require('fs');var Redis=require(_0x844f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x844f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x844f('0x7')][_0x844f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46eb2c,_0x38a334,_0x37b697){return new BPromise(function(_0x1987a9,_0x188f88){return client['request'](_0x46eb2c,_0x37b697)['then'](function(_0x39416d){logger['info']('Campaign,\x20%s,\x20%s',_0x38a334,_0x844f('0x9'));logger['debug']('Campaign,\x20%s,\x20%s,\x20%s',_0x38a334,'request\x20sent',JSON['stringify'](_0x39416d));if(_0x39416d[_0x844f('0xa')]){if(_0x39416d[_0x844f('0xa')]['code']===0x1f4){logger[_0x844f('0xa')](_0x844f('0xb'),_0x38a334,_0x39416d[_0x844f('0xa')]['message']);return _0x188f88(_0x39416d['error'][_0x844f('0xc')]);}logger['error'](_0x844f('0xb'),_0x38a334,_0x39416d[_0x844f('0xa')][_0x844f('0xc')]);return _0x1987a9(_0x39416d[_0x844f('0xa')][_0x844f('0xc')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x38a334,_0x844f('0x9'));_0x1987a9(_0x39416d[_0x844f('0xd')][_0x844f('0xc')]);}})[_0x844f('0xe')](function(_0x4f7ce4){logger[_0x844f('0xa')]('Campaign,\x20%s,\x20%s',_0x38a334,_0x4f7ce4);_0x188f88(_0x4f7ce4);});});}exports['GetCampaign']=function(_0x1f96d0){var _0x2cca8e=this;return new Promise(function(_0x5cc55c,_0x24e386){return db['Campaign']['findAll']({'raw':_0x1f96d0[_0x844f('0xf')]?_0x1f96d0['options'][_0x844f('0x10')]===undefined?!![]:![]:!![],'where':_0x1f96d0[_0x844f('0xf')]?_0x1f96d0[_0x844f('0xf')][_0x844f('0x11')]||null:null,'attributes':_0x1f96d0[_0x844f('0xf')]?_0x1f96d0['options'][_0x844f('0x12')]||null:null,'limit':_0x1f96d0['options']?_0x1f96d0['options'][_0x844f('0x13')]||null:null,'include':_0x1f96d0[_0x844f('0xf')]?_0x1f96d0[_0x844f('0xf')][_0x844f('0x14')]?_[_0x844f('0x15')](_0x1f96d0['options'][_0x844f('0x14')],function(_0x4bd66d){return{'model':db[_0x4bd66d[_0x844f('0x16')]],'as':_0x4bd66d['as'],'attributes':_0x4bd66d['attributes'],'include':_0x4bd66d[_0x844f('0x14')]?_[_0x844f('0x15')](_0x4bd66d[_0x844f('0x14')],function(_0x7dc0c9){return{'model':db[_0x7dc0c9[_0x844f('0x16')]],'as':_0x7dc0c9['as'],'attributes':_0x7dc0c9[_0x844f('0x12')],'include':_0x7dc0c9[_0x844f('0x14')]?_['map'](_0x7dc0c9[_0x844f('0x14')],function(_0x16d7ad){return{'model':db[_0x16d7ad[_0x844f('0x16')]],'as':_0x16d7ad['as'],'attributes':_0x16d7ad[_0x844f('0x12')]};}):[]};}):[]};}):[]:[]})[_0x844f('0x17')](function(_0x29d224){logger['info'](_0x844f('0x18'),_0x1f96d0);logger[_0x844f('0x19')](_0x844f('0x18'),_0x1f96d0,JSON['stringify'](_0x29d224));_0x5cc55c(_0x29d224);})['catch'](function(_0x1e243c){logger[_0x844f('0xa')](_0x844f('0x18'),_0x1e243c['message'],_0x1f96d0);_0x24e386(_0x2cca8e[_0x844f('0xa')](0x1f4,_0x1e243c['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 9226b1f..a9414be 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 _0x2ed4=['getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','destroy','delete','removeLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','getHoppers','getHopperHistories'];(function(_0xd7b41,_0x17b6ed){var _0x4a74c7=function(_0x273c10){while(--_0x273c10){_0xd7b41['push'](_0xd7b41['shift']());}};_0x4a74c7(++_0x17b6ed);}(_0x2ed4,0x1b3));var _0x42ed=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0x2ed4[_0x1602ef];return _0x5870ee;};'use strict';var multer=require(_0x42ed('0x0'));var util=require('util');var path=require(_0x42ed('0x1'));var timeout=require(_0x42ed('0x2'));var express=require(_0x42ed('0x3'));var router=express[_0x42ed('0x4')]();var fs_extra=require(_0x42ed('0x5'));var auth=require(_0x42ed('0x6'));var interaction=require(_0x42ed('0x7'));var config=require(_0x42ed('0x8'));var controller=require('./campaign.controller');router['get']('/',auth[_0x42ed('0x9')](),controller[_0x42ed('0xa')]);router[_0x42ed('0xb')](_0x42ed('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/hoppers',auth[_0x42ed('0x9')](),controller[_0x42ed('0xd')]);router['get']('/:id/hopper_histories',auth[_0x42ed('0x9')](),controller[_0x42ed('0xe')]);router['get']('/:id/hopper_finals',auth[_0x42ed('0x9')](),controller[_0x42ed('0xf')]);router['get'](_0x42ed('0x10'),auth[_0x42ed('0x9')](),controller[_0x42ed('0x11')]);router[_0x42ed('0xb')](_0x42ed('0x12'),auth['isAuthenticated'](),controller[_0x42ed('0x13')]);router[_0x42ed('0xb')](_0x42ed('0x14'),auth[_0x42ed('0x9')](),controller[_0x42ed('0x15')]);router[_0x42ed('0x16')]('/',auth[_0x42ed('0x9')](),controller[_0x42ed('0x17')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x42ed('0x18')]);router[_0x42ed('0x16')]('/:id/lists',auth[_0x42ed('0x9')](),controller[_0x42ed('0x19')]);router[_0x42ed('0x16')](_0x42ed('0x14'),auth[_0x42ed('0x9')](),controller['addBlackLists']);router['put'](_0x42ed('0xc'),auth[_0x42ed('0x9')](),controller['update']);router['delete']('/:id',auth[_0x42ed('0x9')](),controller[_0x42ed('0x1a')]);router[_0x42ed('0x1b')](_0x42ed('0x12'),auth[_0x42ed('0x9')](),controller[_0x42ed('0x1c')]);router[_0x42ed('0x1b')](_0x42ed('0x14'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x42ed('0x1d')]=router;
\ No newline at end of file
+var _0xdeaf=['/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','removeLists','multer','util','path','Router','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','create','/:id/clone','clone'];(function(_0x316a66,_0x445ebc){var _0x100b8e=function(_0x25e5b8){while(--_0x25e5b8){_0x316a66['push'](_0x316a66['shift']());}};_0x100b8e(++_0x445ebc);}(_0xdeaf,0x19e));var _0xfdea=function(_0x24de71,_0x3af991){_0x24de71=_0x24de71-0x0;var _0x4d0303=_0xdeaf[_0x24de71];return _0x4d0303;};'use strict';var multer=require(_0xfdea('0x0'));var util=require(_0xfdea('0x1'));var path=require(_0xfdea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfdea('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfdea('0x4'));router[_0xfdea('0x5')]('/',auth[_0xfdea('0x6')](),controller[_0xfdea('0x7')]);router['get'](_0xfdea('0x8'),auth[_0xfdea('0x6')](),controller[_0xfdea('0x9')]);router[_0xfdea('0x5')]('/:id/hoppers',auth[_0xfdea('0x6')](),controller['getHoppers']);router[_0xfdea('0x5')](_0xfdea('0xa'),auth[_0xfdea('0x6')](),controller[_0xfdea('0xb')]);router[_0xfdea('0x5')](_0xfdea('0xc'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xfdea('0x5')](_0xfdea('0xd'),auth[_0xfdea('0x6')](),controller[_0xfdea('0xe')]);router['get']('/:id/lists',auth['isAuthenticated'](),controller[_0xfdea('0xf')]);router['get']('/:id/blacklists',auth[_0xfdea('0x6')](),controller[_0xfdea('0x10')]);router[_0xfdea('0x11')]('/',auth[_0xfdea('0x6')](),controller[_0xfdea('0x12')]);router[_0xfdea('0x11')](_0xfdea('0x13'),auth[_0xfdea('0x6')](),controller[_0xfdea('0x14')]);router[_0xfdea('0x11')](_0xfdea('0x15'),auth['isAuthenticated'](),controller[_0xfdea('0x16')]);router[_0xfdea('0x11')](_0xfdea('0x17'),auth[_0xfdea('0x6')](),controller[_0xfdea('0x18')]);router[_0xfdea('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xfdea('0x1a')]);router[_0xfdea('0x1b')](_0xfdea('0x8'),auth[_0xfdea('0x6')](),controller['destroy']);router[_0xfdea('0x1b')](_0xfdea('0x15'),auth['isAuthenticated'](),controller[_0xfdea('0x1c')]);router[_0xfdea('0x1b')](_0xfdea('0x17'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 0cb0807..1c4d89f 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 _0x0078=['getDataValue','key','sequelize','exports','STRING','VIRTUAL'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0078,0x152));var _0x8007=function(_0x2393e9,_0x1101ac){_0x2393e9=_0x2393e9-0x0;var _0x227f67=_0x0078[_0x2393e9];return _0x227f67;};'use strict';var Sequelize=require(_0x8007('0x0'));module[_0x8007('0x1')]={'key':{'type':Sequelize[_0x8007('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x8007('0x2')]},'name':{'type':Sequelize[_0x8007('0x3')],'get':function(){return this[_0x8007('0x4')](_0x8007('0x5'));}}};
\ No newline at end of file
+var _0xbaa1=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x1e3116,_0x3b2e5c){var _0x3a5501=function(_0x51b726){while(--_0x51b726){_0x1e3116['push'](_0x1e3116['shift']());}};_0x3a5501(++_0x3b2e5c);}(_0xbaa1,0x168));var _0x1baa=function(_0x5d9447,_0x642173){_0x5d9447=_0x5d9447-0x0;var _0x11bae2=_0xbaa1[_0x5d9447];return _0x11bae2;};'use strict';var Sequelize=require(_0x1baa('0x0'));module[_0x1baa('0x1')]={'key':{'type':Sequelize[_0x1baa('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x1baa('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x1baa('0x2')]},'name':{'type':Sequelize[_0x1baa('0x4')],'get':function(){return this[_0x1baa('0x5')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index cd8d4e8..1eba068 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 _0x20eb=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','include','find','catch','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','UserProfileSection','userProfileId','autoAssociation','name','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2e195d,_0x229650){var _0x15cf2a=function(_0x1603eb){while(--_0x1603eb){_0x2e195d['push'](_0x2e195d['shift']());}};_0x15cf2a(++_0x229650);}(_0x20eb,0xa0));var _0xb20e=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x20eb[_0x24061a];return _0x82054e;};'use strict';var emlformat=require(_0xb20e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb20e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb20e('0x2'));var moment=require(_0xb20e('0x3'));var BPromise=require(_0xb20e('0x4'));var Mustache=require(_0xb20e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb20e('0x6'));var ejs=require(_0xb20e('0x7'));var fs=require('fs');var fs_extra=require(_0xb20e('0x8'));var _=require(_0xb20e('0x9'));var squel=require(_0xb20e('0xa'));var crypto=require('crypto');var jsforce=require(_0xb20e('0xb'));var deskjs=require(_0xb20e('0xc'));var toCsv=require(_0xb20e('0x6'));var querystring=require(_0xb20e('0xd'));var Papa=require(_0xb20e('0xe'));var Redis=require(_0xb20e('0xf'));var authService=require(_0xb20e('0x10'));var qs=require(_0xb20e('0x11'));var as=require(_0xb20e('0x12'));var hardwareService=require(_0xb20e('0x13'));var logger=require('../../config/logger')(_0xb20e('0x14'));var utils=require('../../config/utils');var config=require(_0xb20e('0x15'));var licenseUtil=require(_0xb20e('0x16'));var db=require(_0xb20e('0x17'))['db'];function respondWithStatusCode(_0x1620e7,_0x3b9151){_0x3b9151=_0x3b9151||0xcc;return function(_0x56f0af){if(_0x56f0af){return _0x1620e7[_0xb20e('0x18')](_0x3b9151);}return _0x1620e7[_0xb20e('0x19')](_0x3b9151)['end']();};}function respondWithResult(_0x461ed4,_0x4030cc){_0x4030cc=_0x4030cc||0xc8;return function(_0x57449b){if(_0x57449b){return _0x461ed4[_0xb20e('0x19')](_0x4030cc)[_0xb20e('0x1a')](_0x57449b);}};}function respondWithFilteredResult(_0x4a74df,_0x281839){return function(_0x2ebbf4){if(_0x2ebbf4){var _0x59a950=typeof _0x281839[_0xb20e('0x1b')]===_0xb20e('0x1c')&&typeof _0x281839[_0xb20e('0x1d')]===_0xb20e('0x1c');var _0xc494e=_0x2ebbf4[_0xb20e('0x1e')];var _0x20e7c7=_0x59a950?0x0:_0x281839[_0xb20e('0x1b')];var _0x2b7606=_0x59a950?_0x2ebbf4[_0xb20e('0x1e')]:_0x281839['offset']+_0x281839['limit'];var _0x325bf3;if(_0x2b7606>=_0xc494e){_0x2b7606=_0xc494e;_0x325bf3=0xc8;}else{_0x325bf3=0xce;}_0x4a74df[_0xb20e('0x19')](_0x325bf3);return _0x4a74df[_0xb20e('0x1f')](_0xb20e('0x20'),_0x20e7c7+'-'+_0x2b7606+'/'+_0xc494e)[_0xb20e('0x1a')](_0x2ebbf4);}return null;};}function patchUpdates(_0x47b962){return function(_0x2a9e04){try{jsonpatch[_0xb20e('0x21')](_0x2a9e04,_0x47b962,!![]);}catch(_0x2a9c95){return BPromise['reject'](_0x2a9c95);}return _0x2a9e04[_0xb20e('0x22')]();};}function saveUpdates(_0xb4e923,_0x3859da){return function(_0x274e1c){if(_0x274e1c){return _0x274e1c[_0xb20e('0x23')](_0xb4e923)[_0xb20e('0x24')](function(_0x48c4f8){return _0x48c4f8;});}return null;};}function removeEntity(_0x96ef01,_0x31517b){return function(_0x38132f){if(_0x38132f){return _0x38132f[_0xb20e('0x25')]()['then'](function(){var _0x366a2e=_0x38132f[_0xb20e('0x26')]({'plain':!![]});var _0x2a047d=_0xb20e('0x27');return db[_0xb20e('0x28')][_0xb20e('0x25')]({'where':{'type':_0x2a047d,'resourceId':_0x366a2e['id']}})[_0xb20e('0x24')](function(){return _0x38132f;});})[_0xb20e('0x24')](function(){_0x96ef01[_0xb20e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x148edb,_0x4926cd){return function(_0x534f60){if(!_0x534f60){_0x148edb[_0xb20e('0x18')](0x194);}return _0x534f60;};}function handleError(_0xefcc5d,_0x46fa3b){_0x46fa3b=_0x46fa3b||0x1f4;return function(_0x374dc5){logger[_0xb20e('0x29')](_0x374dc5[_0xb20e('0x2a')]);if(_0x374dc5['name']){delete _0x374dc5['name'];}_0xefcc5d[_0xb20e('0x19')](_0x46fa3b)[_0xb20e('0x2b')](_0x374dc5);};}exports[_0xb20e('0x2c')]=function(_0x2da454,_0x29e434){var _0x30db90={},_0x500acc={},_0x57081a={'count':0x0,'rows':[]};var _0x40b7d8=_[_0xb20e('0x2d')](db[_0xb20e('0x2e')][_0xb20e('0x2f')],function(_0x3fe16a){return{'name':_0x3fe16a[_0xb20e('0x30')],'type':_0x3fe16a[_0xb20e('0x31')][_0xb20e('0x32')]};});_0x500acc[_0xb20e('0x33')]=_[_0xb20e('0x2d')](_0x40b7d8,'name');_0x500acc[_0xb20e('0x34')]=_[_0xb20e('0x35')](_0x2da454[_0xb20e('0x34')]);_0x500acc[_0xb20e('0x36')]=_['intersection'](_0x500acc['model'],_0x500acc['query']);_0x30db90[_0xb20e('0x37')]=_[_0xb20e('0x38')](_0x500acc[_0xb20e('0x33')],qs[_0xb20e('0x39')](_0x2da454[_0xb20e('0x34')][_0xb20e('0x39')]));_0x30db90[_0xb20e('0x37')]=_0x30db90[_0xb20e('0x37')][_0xb20e('0x3a')]?_0x30db90[_0xb20e('0x37')]:_0x500acc[_0xb20e('0x33')];if(!_0x2da454[_0xb20e('0x34')][_0xb20e('0x3b')](_0xb20e('0x3c'))){_0x30db90[_0xb20e('0x1d')]=qs['limit'](_0x2da454[_0xb20e('0x34')]['limit']);_0x30db90[_0xb20e('0x1b')]=qs['offset'](_0x2da454[_0xb20e('0x34')][_0xb20e('0x1b')]);}_0x30db90[_0xb20e('0x3d')]=qs[_0xb20e('0x3e')](_0x2da454[_0xb20e('0x34')]['sort']);_0x30db90[_0xb20e('0x3f')]=qs[_0xb20e('0x36')](_[_0xb20e('0x40')](_0x2da454[_0xb20e('0x34')],_0x500acc[_0xb20e('0x36')]),_0x40b7d8);if(_0x2da454[_0xb20e('0x34')][_0xb20e('0x41')]){_0x30db90['where']=_[_0xb20e('0x42')](_0x30db90[_0xb20e('0x3f')],{'$or':[{'key':{'$like':'%'+_0x2da454[_0xb20e('0x34')][_0xb20e('0x41')]+'%'}},{'value':{'$like':'%'+_0x2da454[_0xb20e('0x34')]['filter']+'%'}}]});}_0x30db90=_[_0xb20e('0x42')]({},_0x30db90,_0x2da454[_0xb20e('0x43')]);var _0x2eb6d1={'where':_0x30db90[_0xb20e('0x3f')]};return db[_0xb20e('0x2e')]['count'](_0x2eb6d1)[_0xb20e('0x24')](function(_0x5915ea){_0x57081a[_0xb20e('0x1e')]=_0x5915ea;if(_0x2da454[_0xb20e('0x34')][_0xb20e('0x44')]){_0x30db90['include']=[{'all':!![]}];}return db[_0xb20e('0x2e')][_0xb20e('0x45')](_0x30db90);})['then'](function(_0x32f9cb){_0x57081a[_0xb20e('0x46')]=_0x32f9cb;return _0x57081a;})[_0xb20e('0x24')](respondWithFilteredResult(_0x29e434,_0x30db90))['catch'](handleError(_0x29e434,null));};exports['show']=function(_0x168096,_0x5df258){var _0x42868f={'raw':!![],'where':{'id':_0x168096['params']['id']}},_0x5b0325={};_0x5b0325[_0xb20e('0x33')]=_[_0xb20e('0x35')](db[_0xb20e('0x2e')][_0xb20e('0x2f')]);_0x5b0325['query']=_[_0xb20e('0x35')](_0x168096[_0xb20e('0x34')]);_0x5b0325[_0xb20e('0x36')]=_['intersection'](_0x5b0325[_0xb20e('0x33')],_0x5b0325[_0xb20e('0x34')]);_0x42868f['attributes']=_[_0xb20e('0x38')](_0x5b0325[_0xb20e('0x33')],qs[_0xb20e('0x39')](_0x168096[_0xb20e('0x34')][_0xb20e('0x39')]));_0x42868f[_0xb20e('0x37')]=_0x42868f['attributes'][_0xb20e('0x3a')]?_0x42868f[_0xb20e('0x37')]:_0x5b0325[_0xb20e('0x33')];if(_0x168096[_0xb20e('0x34')][_0xb20e('0x44')]){_0x42868f[_0xb20e('0x47')]=[{'all':!![]}];}_0x42868f=_[_0xb20e('0x42')]({},_0x42868f,_0x168096['options']);return db[_0xb20e('0x2e')][_0xb20e('0x48')](_0x42868f)[_0xb20e('0x24')](handleEntityNotFound(_0x5df258,null))[_0xb20e('0x24')](respondWithResult(_0x5df258,null))[_0xb20e('0x49')](handleError(_0x5df258,null));};exports[_0xb20e('0x23')]=function(_0x3d36f2,_0x416782){if(_0x3d36f2['body']['id']){delete _0x3d36f2[_0xb20e('0x4a')]['id'];}return db['CannedAnswer'][_0xb20e('0x48')]({'where':{'id':_0x3d36f2[_0xb20e('0x4b')]['id']}})[_0xb20e('0x24')](handleEntityNotFound(_0x416782,null))[_0xb20e('0x24')](saveUpdates(_0x3d36f2['body'],null))['then'](respondWithResult(_0x416782,null))[_0xb20e('0x49')](handleError(_0x416782,null));};exports[_0xb20e('0x25')]=function(_0x441520,_0xe91ea3){return db[_0xb20e('0x2e')][_0xb20e('0x48')]({'where':{'id':_0x441520[_0xb20e('0x4b')]['id']}})[_0xb20e('0x24')](handleEntityNotFound(_0xe91ea3,null))[_0xb20e('0x24')](removeEntity(_0xe91ea3,null))['catch'](handleError(_0xe91ea3,null));};exports['create']=function(_0x4385ac,_0x11b6ed){var _0x1c6634={'key':_0x4385ac[_0xb20e('0x4a')][_0xb20e('0x32')]};if(_0x4385ac[_0xb20e('0x4a')][_0xb20e('0x4c')]){_0x1c6634['MailAccountId']=_0x4385ac[_0xb20e('0x4a')][_0xb20e('0x4c')];}else if(_0x4385ac['body'][_0xb20e('0x4d')]){_0x1c6634[_0xb20e('0x4d')]=_0x4385ac['body'][_0xb20e('0x4d')];}else if(_0x4385ac['body']['OpenchannelAccountId']){_0x1c6634[_0xb20e('0x4e')]=_0x4385ac[_0xb20e('0x4a')][_0xb20e('0x4e')];}else if(_0x4385ac['body'][_0xb20e('0x4f')]){_0x1c6634['ChatWebsiteId']=_0x4385ac[_0xb20e('0x4a')][_0xb20e('0x4f')];}return db[_0xb20e('0x2e')][_0xb20e('0x48')]({'where':_0x1c6634})[_0xb20e('0x24')](function(_0x6c057d){if(_0x6c057d){throw new db[(_0xb20e('0x50'))][(_0xb20e('0x51'))](_0xb20e('0x52'));}return db[_0xb20e('0x2e')][_0xb20e('0x53')](_0x4385ac[_0xb20e('0x4a')]);})[_0xb20e('0x24')](function(_0x731906){var _0x28e8fa=_0x4385ac[_0xb20e('0x54')]['get']({'plain':!![]});if(!_0x28e8fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28e8fa['role']===_0xb20e('0x54')){var _0x5d7bc0=_0x731906[_0xb20e('0x26')]({'plain':!![]});return db[_0xb20e('0x55')][_0xb20e('0x48')]({'where':{'name':_0xb20e('0x27'),'userProfileId':_0x28e8fa[_0xb20e('0x56')]},'raw':!![]})[_0xb20e('0x24')](function(_0x878b2){if(_0x878b2&&_0x878b2[_0xb20e('0x57')]===0x0){return db['UserProfileResource'][_0xb20e('0x53')]({'name':_0x5d7bc0['name'],'resourceId':_0x5d7bc0['id'],'type':_0x878b2[_0xb20e('0x58')],'sectionId':_0x878b2['id']},{})[_0xb20e('0x24')](function(){return _0x731906;});}else{return _0x731906;}})[_0xb20e('0x49')](function(_0xb9d46c){logger[_0xb20e('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb9d46c);throw _0xb9d46c;});}return _0x731906;})[_0xb20e('0x24')](respondWithResult(_0x11b6ed,0xc9))[_0xb20e('0x49')](handleError(_0x11b6ed,null));};
\ No newline at end of file
+var _0x4fe9=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','include','CannedAnswer','rows','params','find','body','catch','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','UserProfileResource','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x486512,_0x1c4f06){var _0x48e24a=function(_0x18570c){while(--_0x18570c){_0x486512['push'](_0x486512['shift']());}};_0x48e24a(++_0x1c4f06);}(_0x4fe9,0x132));var _0x94fe=function(_0x4dde9f,_0x2de95f){_0x4dde9f=_0x4dde9f-0x0;var _0x429e11=_0x4fe9[_0x4dde9f];return _0x429e11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94fe('0x0'));var zipdir=require(_0x94fe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x94fe('0x2'));var moment=require(_0x94fe('0x3'));var BPromise=require(_0x94fe('0x4'));var Mustache=require(_0x94fe('0x5'));var util=require(_0x94fe('0x6'));var path=require('path');var sox=require(_0x94fe('0x7'));var csv=require(_0x94fe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94fe('0x9'));var squel=require('squel');var crypto=require(_0x94fe('0xa'));var jsforce=require(_0x94fe('0xb'));var deskjs=require(_0x94fe('0xc'));var toCsv=require(_0x94fe('0x8'));var querystring=require(_0x94fe('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x94fe('0xe'));var as=require(_0x94fe('0xf'));var hardwareService=require(_0x94fe('0x10'));var logger=require('../../config/logger')(_0x94fe('0x11'));var utils=require(_0x94fe('0x12'));var config=require(_0x94fe('0x13'));var licenseUtil=require(_0x94fe('0x14'));var db=require(_0x94fe('0x15'))['db'];function respondWithStatusCode(_0x1fcf80,_0x5a57c1){_0x5a57c1=_0x5a57c1||0xcc;return function(_0x43507d){if(_0x43507d){return _0x1fcf80[_0x94fe('0x16')](_0x5a57c1);}return _0x1fcf80[_0x94fe('0x17')](_0x5a57c1)['end']();};}function respondWithResult(_0x379a8a,_0x86a93e){_0x86a93e=_0x86a93e||0xc8;return function(_0x15c5fd){if(_0x15c5fd){return _0x379a8a[_0x94fe('0x17')](_0x86a93e)[_0x94fe('0x18')](_0x15c5fd);}};}function respondWithFilteredResult(_0x74906b,_0x46c917){return function(_0x45f4ef){if(_0x45f4ef){var _0x32aafa=typeof _0x46c917['offset']==='undefined'&&typeof _0x46c917[_0x94fe('0x19')]===_0x94fe('0x1a');var _0x18f2cc=_0x45f4ef[_0x94fe('0x1b')];var _0x3a6c90=_0x32aafa?0x0:_0x46c917[_0x94fe('0x1c')];var _0x47014c=_0x32aafa?_0x45f4ef[_0x94fe('0x1b')]:_0x46c917[_0x94fe('0x1c')]+_0x46c917[_0x94fe('0x19')];var _0x74352b;if(_0x47014c>=_0x18f2cc){_0x47014c=_0x18f2cc;_0x74352b=0xc8;}else{_0x74352b=0xce;}_0x74906b[_0x94fe('0x17')](_0x74352b);return _0x74906b['set']('Content-Range',_0x3a6c90+'-'+_0x47014c+'/'+_0x18f2cc)[_0x94fe('0x18')](_0x45f4ef);}return null;};}function patchUpdates(_0x4ceedd){return function(_0x51248f){try{jsonpatch[_0x94fe('0x1d')](_0x51248f,_0x4ceedd,!![]);}catch(_0x44a9a3){return BPromise[_0x94fe('0x1e')](_0x44a9a3);}return _0x51248f[_0x94fe('0x1f')]();};}function saveUpdates(_0x4e2047,_0x3df344){return function(_0x297a22){if(_0x297a22){return _0x297a22[_0x94fe('0x20')](_0x4e2047)['then'](function(_0x2374b5){return _0x2374b5;});}return null;};}function removeEntity(_0x251418,_0x1e86bc){return function(_0x4238a0){if(_0x4238a0){return _0x4238a0['destroy']()[_0x94fe('0x21')](function(){var _0x12d173=_0x4238a0['get']({'plain':!![]});var _0x99bc5b='CannedAnswers';return db['UserProfileResource'][_0x94fe('0x22')]({'where':{'type':_0x99bc5b,'resourceId':_0x12d173['id']}})[_0x94fe('0x21')](function(){return _0x4238a0;});})[_0x94fe('0x21')](function(){_0x251418[_0x94fe('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x135d15,_0x15dcfe){return function(_0x501aec){if(!_0x501aec){_0x135d15[_0x94fe('0x16')](0x194);}return _0x501aec;};}function handleError(_0x238e49,_0x4864ab){_0x4864ab=_0x4864ab||0x1f4;return function(_0x298435){logger[_0x94fe('0x23')](_0x298435[_0x94fe('0x24')]);if(_0x298435['name']){delete _0x298435[_0x94fe('0x25')];}_0x238e49[_0x94fe('0x17')](_0x4864ab)[_0x94fe('0x26')](_0x298435);};}exports[_0x94fe('0x27')]=function(_0x55ad86,_0x197f3a){var _0x7df08b={},_0x577011={},_0x10640d={'count':0x0,'rows':[]};var _0x18b783=_[_0x94fe('0x28')](db['CannedAnswer'][_0x94fe('0x29')],function(_0xbb7b08){return{'name':_0xbb7b08[_0x94fe('0x2a')],'type':_0xbb7b08[_0x94fe('0x2b')][_0x94fe('0x2c')]};});_0x577011[_0x94fe('0x2d')]=_['map'](_0x18b783,'name');_0x577011['query']=_[_0x94fe('0x2e')](_0x55ad86[_0x94fe('0x2f')]);_0x577011[_0x94fe('0x30')]=_[_0x94fe('0x31')](_0x577011[_0x94fe('0x2d')],_0x577011['query']);_0x7df08b[_0x94fe('0x32')]=_[_0x94fe('0x31')](_0x577011[_0x94fe('0x2d')],qs[_0x94fe('0x33')](_0x55ad86['query'][_0x94fe('0x33')]));_0x7df08b[_0x94fe('0x32')]=_0x7df08b['attributes'][_0x94fe('0x34')]?_0x7df08b[_0x94fe('0x32')]:_0x577011['model'];if(!_0x55ad86[_0x94fe('0x2f')]['hasOwnProperty']('nolimit')){_0x7df08b[_0x94fe('0x19')]=qs[_0x94fe('0x19')](_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x19')]);_0x7df08b[_0x94fe('0x1c')]=qs[_0x94fe('0x1c')](_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x1c')]);}_0x7df08b[_0x94fe('0x35')]=qs[_0x94fe('0x36')](_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x36')]);_0x7df08b[_0x94fe('0x37')]=qs[_0x94fe('0x30')](_['pick'](_0x55ad86[_0x94fe('0x2f')],_0x577011[_0x94fe('0x30')]),_0x18b783);if(_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x38')]){_0x7df08b['where']=_[_0x94fe('0x39')](_0x7df08b['where'],{'$or':[{'key':{'$like':'%'+_0x55ad86['query'][_0x94fe('0x38')]+'%'}},{'value':{'$like':'%'+_0x55ad86[_0x94fe('0x2f')][_0x94fe('0x38')]+'%'}}]});}_0x7df08b=_[_0x94fe('0x39')]({},_0x7df08b,_0x55ad86[_0x94fe('0x3a')]);var _0x1ed0ce={'where':_0x7df08b[_0x94fe('0x37')]};return db['CannedAnswer']['count'](_0x1ed0ce)[_0x94fe('0x21')](function(_0x5c84db){_0x10640d[_0x94fe('0x1b')]=_0x5c84db;if(_0x55ad86[_0x94fe('0x2f')]['includeAll']){_0x7df08b[_0x94fe('0x3b')]=[{'all':!![]}];}return db[_0x94fe('0x3c')]['findAll'](_0x7df08b);})[_0x94fe('0x21')](function(_0x152b07){_0x10640d[_0x94fe('0x3d')]=_0x152b07;return _0x10640d;})[_0x94fe('0x21')](respondWithFilteredResult(_0x197f3a,_0x7df08b))['catch'](handleError(_0x197f3a,null));};exports['show']=function(_0x188e21,_0xfce685){var _0x1b42e3={'raw':!![],'where':{'id':_0x188e21[_0x94fe('0x3e')]['id']}},_0x483fb9={};_0x483fb9[_0x94fe('0x2d')]=_[_0x94fe('0x2e')](db[_0x94fe('0x3c')][_0x94fe('0x29')]);_0x483fb9[_0x94fe('0x2f')]=_[_0x94fe('0x2e')](_0x188e21['query']);_0x483fb9['filters']=_[_0x94fe('0x31')](_0x483fb9['model'],_0x483fb9[_0x94fe('0x2f')]);_0x1b42e3['attributes']=_['intersection'](_0x483fb9['model'],qs[_0x94fe('0x33')](_0x188e21[_0x94fe('0x2f')][_0x94fe('0x33')]));_0x1b42e3[_0x94fe('0x32')]=_0x1b42e3[_0x94fe('0x32')]['length']?_0x1b42e3[_0x94fe('0x32')]:_0x483fb9[_0x94fe('0x2d')];if(_0x188e21[_0x94fe('0x2f')]['includeAll']){_0x1b42e3[_0x94fe('0x3b')]=[{'all':!![]}];}_0x1b42e3=_[_0x94fe('0x39')]({},_0x1b42e3,_0x188e21[_0x94fe('0x3a')]);return db['CannedAnswer'][_0x94fe('0x3f')](_0x1b42e3)[_0x94fe('0x21')](handleEntityNotFound(_0xfce685,null))[_0x94fe('0x21')](respondWithResult(_0xfce685,null))['catch'](handleError(_0xfce685,null));};exports[_0x94fe('0x20')]=function(_0x571be7,_0x486eac){if(_0x571be7[_0x94fe('0x40')]['id']){delete _0x571be7[_0x94fe('0x40')]['id'];}return db['CannedAnswer'][_0x94fe('0x3f')]({'where':{'id':_0x571be7[_0x94fe('0x3e')]['id']}})[_0x94fe('0x21')](handleEntityNotFound(_0x486eac,null))[_0x94fe('0x21')](saveUpdates(_0x571be7[_0x94fe('0x40')],null))[_0x94fe('0x21')](respondWithResult(_0x486eac,null))[_0x94fe('0x41')](handleError(_0x486eac,null));};exports[_0x94fe('0x22')]=function(_0x2fd648,_0x2f1c6b){return db[_0x94fe('0x3c')]['find']({'where':{'id':_0x2fd648['params']['id']}})[_0x94fe('0x21')](handleEntityNotFound(_0x2f1c6b,null))[_0x94fe('0x21')](removeEntity(_0x2f1c6b,null))[_0x94fe('0x41')](handleError(_0x2f1c6b,null));};exports[_0x94fe('0x42')]=function(_0xcd7d4,_0x476e59){var _0x4b74fe={'key':_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x2c')]};if(_0xcd7d4['body'][_0x94fe('0x43')]){_0x4b74fe['MailAccountId']=_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x43')];}else if(_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x44')]){_0x4b74fe[_0x94fe('0x44')]=_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x44')];}else if(_0xcd7d4[_0x94fe('0x40')]['OpenchannelAccountId']){_0x4b74fe['OpenchannelAccountId']=_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x45')];}else if(_0xcd7d4[_0x94fe('0x40')][_0x94fe('0x46')]){_0x4b74fe[_0x94fe('0x46')]=_0xcd7d4[_0x94fe('0x40')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x4b74fe})[_0x94fe('0x21')](function(_0x10d72a){if(_0x10d72a){throw new db[(_0x94fe('0x47'))]['ValidationError'](_0x94fe('0x48'));}return db[_0x94fe('0x3c')][_0x94fe('0x42')](_0xcd7d4[_0x94fe('0x40')]);})['then'](function(_0x473ac9){var _0x35f7e4=_0xcd7d4[_0x94fe('0x49')][_0x94fe('0x4a')]({'plain':!![]});if(!_0x35f7e4)throw new Error(_0x94fe('0x4b'));if(_0x35f7e4[_0x94fe('0x4c')]===_0x94fe('0x49')){var _0x17fe6a=_0x473ac9[_0x94fe('0x4a')]({'plain':!![]});return db[_0x94fe('0x4d')][_0x94fe('0x3f')]({'where':{'name':_0x94fe('0x4e'),'userProfileId':_0x35f7e4['userProfileId']},'raw':!![]})['then'](function(_0x5626e5){if(_0x5626e5&&_0x5626e5[_0x94fe('0x4f')]===0x0){return db[_0x94fe('0x50')][_0x94fe('0x42')]({'name':_0x17fe6a[_0x94fe('0x25')],'resourceId':_0x17fe6a['id'],'type':_0x5626e5['name'],'sectionId':_0x5626e5['id']},{})[_0x94fe('0x21')](function(){return _0x473ac9;});}else{return _0x473ac9;}})[_0x94fe('0x41')](function(_0x1b2bdb){logger[_0x94fe('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b2bdb);throw _0x1b2bdb;});}return _0x473ac9;})[_0x94fe('0x21')](respondWithResult(_0x476e59,0xc9))[_0x94fe('0x41')](handleError(_0x476e59,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 019904e..f3841af 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 _0x43e5=['define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x114ae4,_0x14bdc9){var _0x32f566=function(_0x4f3fd1){while(--_0x4f3fd1){_0x114ae4['push'](_0x114ae4['shift']());}};_0x32f566(++_0x14bdc9);}(_0x43e5,0x160));var _0x543e=function(_0x3ee091,_0x259393){_0x3ee091=_0x3ee091-0x0;var _0x31d6f=_0x43e5[_0x3ee091];return _0x31d6f;};'use strict';var _=require(_0x543e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x543e('0x1'));var BPromise=require(_0x543e('0x2'));var rp=require(_0x543e('0x3'));var fs=require('fs');var path=require(_0x543e('0x4'));var rimraf=require(_0x543e('0x5'));var config=require(_0x543e('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x543e('0x7')]=function(_0x5ad163,_0x2c564a){return _0x5ad163[_0x543e('0x8')](_0x543e('0x9'),attributes,{'tableName':_0x543e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x543e('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7061=['bluebird','request-promise','path','tools_canned_answers','lodash','util','api'];(function(_0x50cb00,_0x1499ef){var _0xd62f39=function(_0x1669fc){while(--_0x1669fc){_0x50cb00['push'](_0x50cb00['shift']());}};_0xd62f39(++_0x1499ef);}(_0x7061,0xac));var _0x1706=function(_0x4f6f04,_0x461ec4){_0x4f6f04=_0x4f6f04-0x0;var _0x311a20=_0x7061[_0x4f6f04];return _0x311a20;};'use strict';var _=require(_0x1706('0x0'));var util=require(_0x1706('0x1'));var logger=require('../../config/logger')(_0x1706('0x2'));var moment=require('moment');var BPromise=require(_0x1706('0x3'));var rp=require(_0x1706('0x4'));var fs=require('fs');var path=require(_0x1706('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x5afb73,_0x5740a6){return _0x5afb73['define']('CannedAnswer',attributes,{'tableName':_0x1706('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 2463dfd..426645a 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(_0x14ca7a,_0x129814){var _0x48a3e0=function(_0x5904ee){while(--_0x5904ee){_0x14ca7a['push'](_0x14ca7a['shift']());}};_0x48a3e0(++_0x129814);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x5e729d,_0x254376){var _0x4efc38=function(_0x3a5a49){while(--_0x3a5a49){_0x5e729d['push'](_0x5e729d['shift']());}};_0x4efc38(++_0x254376);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 2f49d42..f7cc97b 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 _0x4b29=['isAuthenticated','index','get','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4001ad,_0x1e22dd){var _0x4c7ec2=function(_0x24cb8a){while(--_0x24cb8a){_0x4001ad['push'](_0x4001ad['shift']());}};_0x4c7ec2(++_0x1e22dd);}(_0x4b29,0x14a));var _0x94b2=function(_0x418a6c,_0x2f04d2){_0x418a6c=_0x418a6c-0x0;var _0x47b44e=_0x4b29[_0x418a6c];return _0x47b44e;};'use strict';var multer=require(_0x94b2('0x0'));var util=require(_0x94b2('0x1'));var path=require(_0x94b2('0x2'));var timeout=require(_0x94b2('0x3'));var express=require(_0x94b2('0x4'));var router=express[_0x94b2('0x5')]();var fs_extra=require(_0x94b2('0x6'));var auth=require(_0x94b2('0x7'));var interaction=require(_0x94b2('0x8'));var config=require(_0x94b2('0x9'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x94b2('0xa')](),controller[_0x94b2('0xb')]);router[_0x94b2('0xc')](_0x94b2('0xd'),auth['isAuthenticated'](),controller[_0x94b2('0xe')]);router[_0x94b2('0xf')]('/',auth[_0x94b2('0xa')](),controller['create']);router['put'](_0x94b2('0xd'),auth[_0x94b2('0xa')](),controller[_0x94b2('0x10')]);router[_0x94b2('0x11')](_0x94b2('0xd'),auth['isAuthenticated'](),controller[_0x94b2('0x12')]);module[_0x94b2('0x13')]=router;
\ No newline at end of file
+var _0xd286=['../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','/:id','post','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd286,0x181));var _0x6d28=function(_0x5ea3f6,_0x595373){_0x5ea3f6=_0x5ea3f6-0x0;var _0x3fc5a2=_0xd286[_0x5ea3f6];return _0x3fc5a2;};'use strict';var multer=require(_0x6d28('0x0'));var util=require(_0x6d28('0x1'));var path=require(_0x6d28('0x2'));var timeout=require(_0x6d28('0x3'));var express=require(_0x6d28('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d28('0x5'));var config=require('../../config/environment');var controller=require(_0x6d28('0x6'));router['get']('/',auth[_0x6d28('0x7')](),controller['index']);router['get'](_0x6d28('0x8'),auth[_0x6d28('0x7')](),controller['show']);router[_0x6d28('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x6d28('0x7')](),controller['update']);router[_0x6d28('0xa')](_0x6d28('0x8'),auth[_0x6d28('0x7')](),controller[_0x6d28('0xb')]);module[_0x6d28('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 5c417ca..3b72dd6 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 _0xc68d=['STRING','INTEGER','exports','DATE'];(function(_0x1989e2,_0x5a3b47){var _0x218d38=function(_0x572af8){while(--_0x572af8){_0x1989e2['push'](_0x1989e2['shift']());}};_0x218d38(++_0x5a3b47);}(_0xc68d,0x17a));var _0xdc68=function(_0x314737,_0xc0002d){_0x314737=_0x314737-0x0;var _0x19cd9c=_0xc68d[_0x314737];return _0x19cd9c;};'use strict';var Sequelize=require('sequelize');module[_0xdc68('0x0')]={'calldate':{'type':Sequelize[_0xdc68('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xdc68('0x2')]},'dst':{'type':Sequelize[_0xdc68('0x2')]},'dcontext':{'type':Sequelize[_0xdc68('0x2')]},'channel':{'type':Sequelize[_0xdc68('0x2')]},'dstchannel':{'type':Sequelize[_0xdc68('0x2')]},'lastapp':{'type':Sequelize[_0xdc68('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xdc68('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdc68('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xdc68('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xdc68('0x2')]},'userfield':{'type':Sequelize[_0xdc68('0x2')]},'uniqueid':{'type':Sequelize[_0xdc68('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xdc68('0x2')]},'type':{'type':Sequelize[_0xdc68('0x2')]},'tag':{'type':Sequelize[_0xdc68('0x2')]}};
\ No newline at end of file
+var _0xf296=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x4cbfbc,_0x3165d4){var _0x11b285=function(_0x4c5948){while(--_0x4c5948){_0x4cbfbc['push'](_0x4cbfbc['shift']());}};_0x11b285(++_0x3165d4);}(_0xf296,0x94));var _0x6f29=function(_0x614dc5,_0x3dd98e){_0x614dc5=_0x614dc5-0x0;var _0x571e07=_0xf296[_0x614dc5];return _0x571e07;};'use strict';var Sequelize=require(_0x6f29('0x0'));module[_0x6f29('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x6f29('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x6f29('0x3')]},'dcontext':{'type':Sequelize[_0x6f29('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x6f29('0x3')]},'lastapp':{'type':Sequelize[_0x6f29('0x3')]},'lastdata':{'type':Sequelize[_0x6f29('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6f29('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6f29('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6f29('0x3')]},'userfield':{'type':Sequelize[_0x6f29('0x3')]},'uniqueid':{'type':Sequelize[_0x6f29('0x3')]},'linkedid':{'type':Sequelize[_0x6f29('0x3')]},'sequence':{'type':Sequelize[_0x6f29('0x3')]},'peeraccount':{'type':Sequelize[_0x6f29('0x3')]},'type':{'type':Sequelize[_0x6f29('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 2abba2d..3823693 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 _0x5162=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','intersection','find','create','body','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x33b9ac,_0x1cd671){_0x33b9ac=_0x33b9ac-0x0;var _0x4da2a0=_0x5162[_0x33b9ac];return _0x4da2a0;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2516('0x1'));var BPromise=require(_0x2516('0x2'));var Mustache=require(_0x2516('0x3'));var util=require(_0x2516('0x4'));var path=require(_0x2516('0x5'));var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0x7'));var querystring=require(_0x2516('0xc'));var Papa=require(_0x2516('0xd'));var Redis=require('ioredis');var authService=require(_0x2516('0xe'));var qs=require(_0x2516('0xf'));var as=require(_0x2516('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x11'));var licenseUtil=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];function respondWithStatusCode(_0x3ef6ff,_0x56c69c){_0x56c69c=_0x56c69c||0xcc;return function(_0x33496b){if(_0x33496b){return _0x3ef6ff[_0x2516('0x14')](_0x56c69c);}return _0x3ef6ff[_0x2516('0x15')](_0x56c69c)[_0x2516('0x16')]();};}function respondWithResult(_0x42c771,_0x558d20){_0x558d20=_0x558d20||0xc8;return function(_0x3e5e0f){if(_0x3e5e0f){return _0x42c771[_0x2516('0x15')](_0x558d20)[_0x2516('0x17')](_0x3e5e0f);}};}function respondWithFilteredResult(_0x181a28,_0x2637e8){return function(_0x2ec31f){if(_0x2ec31f){var _0x19aacb=typeof _0x2637e8[_0x2516('0x18')]===_0x2516('0x19')&&typeof _0x2637e8['limit']===_0x2516('0x19');var _0x1ced29=_0x2ec31f[_0x2516('0x1a')];var _0x564d05=_0x19aacb?0x0:_0x2637e8[_0x2516('0x18')];var _0x5e96c7=_0x19aacb?_0x2ec31f['count']:_0x2637e8[_0x2516('0x18')]+_0x2637e8[_0x2516('0x1b')];var _0x151168;if(_0x5e96c7>=_0x1ced29){_0x5e96c7=_0x1ced29;_0x151168=0xc8;}else{_0x151168=0xce;}_0x181a28[_0x2516('0x15')](_0x151168);return _0x181a28[_0x2516('0x1c')](_0x2516('0x1d'),_0x564d05+'-'+_0x5e96c7+'/'+_0x1ced29)[_0x2516('0x17')](_0x2ec31f);}return null;};}function patchUpdates(_0x113616){return function(_0x248c5a){try{jsonpatch[_0x2516('0x1e')](_0x248c5a,_0x113616,!![]);}catch(_0x39ba5b){return BPromise[_0x2516('0x1f')](_0x39ba5b);}return _0x248c5a[_0x2516('0x20')]();};}function saveUpdates(_0x4fb7d9,_0x559a3e){return function(_0x12db4d){if(_0x12db4d){return _0x12db4d[_0x2516('0x21')](_0x4fb7d9)[_0x2516('0x22')](function(_0x2d5b1b){return _0x2d5b1b;});}return null;};}function removeEntity(_0x3ffb6d,_0x32de7a){return function(_0x3d906d){if(_0x3d906d){return _0x3d906d[_0x2516('0x23')]()['then'](function(){_0x3ffb6d[_0x2516('0x15')](0xcc)[_0x2516('0x16')]();});}};}function handleEntityNotFound(_0x774b60,_0x434d54){return function(_0x47f4fb){if(!_0x47f4fb){_0x774b60[_0x2516('0x14')](0x194);}return _0x47f4fb;};}function handleError(_0x30eeb9,_0x1f722c){_0x1f722c=_0x1f722c||0x1f4;return function(_0x3d728a){logger[_0x2516('0x24')](_0x3d728a['stack']);if(_0x3d728a[_0x2516('0x25')]){delete _0x3d728a[_0x2516('0x25')];}_0x30eeb9[_0x2516('0x15')](_0x1f722c)[_0x2516('0x26')](_0x3d728a);};}exports[_0x2516('0x27')]=function(_0x285e67,_0x556f01){var _0x136893={},_0x20dc9f={},_0x493a3e={'count':0x0,'rows':[]};var _0x19d90d=_[_0x2516('0x28')](db[_0x2516('0x29')][_0x2516('0x2a')],function(_0x539704){return{'name':_0x539704[_0x2516('0x2b')],'type':_0x539704[_0x2516('0x2c')][_0x2516('0x2d')]};});_0x20dc9f[_0x2516('0x2e')]=_[_0x2516('0x28')](_0x19d90d,_0x2516('0x25'));_0x20dc9f[_0x2516('0x2f')]=_[_0x2516('0x30')](_0x285e67[_0x2516('0x2f')]);_0x20dc9f[_0x2516('0x31')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],_0x20dc9f['query']);_0x136893[_0x2516('0x32')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],qs['fields'](_0x285e67[_0x2516('0x2f')][_0x2516('0x33')]));_0x136893[_0x2516('0x32')]=_0x136893[_0x2516('0x32')][_0x2516('0x34')]?_0x136893[_0x2516('0x32')]:_0x20dc9f[_0x2516('0x2e')];if(!_0x285e67[_0x2516('0x2f')][_0x2516('0x35')]('nolimit')){_0x136893[_0x2516('0x1b')]=qs[_0x2516('0x1b')](_0x285e67[_0x2516('0x2f')][_0x2516('0x1b')]);_0x136893['offset']=qs['offset'](_0x285e67[_0x2516('0x2f')][_0x2516('0x18')]);}_0x136893[_0x2516('0x36')]=qs[_0x2516('0x37')](_0x285e67[_0x2516('0x2f')][_0x2516('0x37')]);_0x136893[_0x2516('0x38')]=qs[_0x2516('0x31')](_[_0x2516('0x39')](_0x285e67[_0x2516('0x2f')],_0x20dc9f['filters']),_0x19d90d);if(_0x285e67['query'][_0x2516('0x3a')]){_0x136893[_0x2516('0x38')]=_['merge'](_0x136893['where'],{'$or':_[_0x2516('0x28')](_0x19d90d,function(_0x3b310f){if(_0x3b310f['type']!==_0x2516('0x3b')){var _0x52ef6b={};_0x52ef6b[_0x3b310f[_0x2516('0x25')]]={'$like':'%'+_0x285e67[_0x2516('0x2f')]['filter']+'%'};return _0x52ef6b;}})});}_0x136893=_[_0x2516('0x3c')]({},_0x136893,_0x285e67[_0x2516('0x3d')]);var _0x155cf7={'where':_0x136893[_0x2516('0x38')]};return db[_0x2516('0x29')][_0x2516('0x1a')](_0x155cf7)[_0x2516('0x22')](function(_0x2371a8){_0x493a3e[_0x2516('0x1a')]=_0x2371a8;if(_0x285e67[_0x2516('0x2f')][_0x2516('0x3e')]){_0x136893[_0x2516('0x3f')]=[{'all':!![]}];}return db[_0x2516('0x29')]['findAll'](_0x136893);})[_0x2516('0x22')](function(_0x1bc0e){_0x493a3e['rows']=_0x1bc0e;return _0x493a3e;})[_0x2516('0x22')](respondWithFilteredResult(_0x556f01,_0x136893))[_0x2516('0x40')](handleError(_0x556f01,null));};exports[_0x2516('0x41')]=function(_0x1afefb,_0x421c58){var _0x582cb6={'raw':!![],'where':{'id':_0x1afefb[_0x2516('0x42')]['id']}},_0x1a8d2d={};_0x1a8d2d[_0x2516('0x2e')]=_[_0x2516('0x30')](db[_0x2516('0x29')][_0x2516('0x2a')]);_0x1a8d2d['query']=_[_0x2516('0x30')](_0x1afefb[_0x2516('0x2f')]);_0x1a8d2d[_0x2516('0x31')]=_[_0x2516('0x43')](_0x1a8d2d[_0x2516('0x2e')],_0x1a8d2d[_0x2516('0x2f')]);_0x582cb6[_0x2516('0x32')]=_['intersection'](_0x1a8d2d[_0x2516('0x2e')],qs['fields'](_0x1afefb[_0x2516('0x2f')]['fields']));_0x582cb6[_0x2516('0x32')]=_0x582cb6[_0x2516('0x32')][_0x2516('0x34')]?_0x582cb6['attributes']:_0x1a8d2d['model'];if(_0x1afefb[_0x2516('0x2f')][_0x2516('0x3e')]){_0x582cb6['include']=[{'all':!![]}];}_0x582cb6=_['merge']({},_0x582cb6,_0x1afefb[_0x2516('0x3d')]);return db[_0x2516('0x29')][_0x2516('0x44')](_0x582cb6)['then'](handleEntityNotFound(_0x421c58,null))[_0x2516('0x22')](respondWithResult(_0x421c58,null))['catch'](handleError(_0x421c58,null));};exports[_0x2516('0x45')]=function(_0x39fd32,_0x318128){return db[_0x2516('0x29')]['create'](_0x39fd32[_0x2516('0x46')],{})[_0x2516('0x22')](respondWithResult(_0x318128,0xc9))[_0x2516('0x40')](handleError(_0x318128,null));};exports[_0x2516('0x21')]=function(_0x43874c,_0x482883){if(_0x43874c[_0x2516('0x46')]['id']){delete _0x43874c[_0x2516('0x46')]['id'];}return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x43874c['params']['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x482883,null))[_0x2516('0x22')](saveUpdates(_0x43874c[_0x2516('0x46')],null))[_0x2516('0x22')](respondWithResult(_0x482883,null))[_0x2516('0x40')](handleError(_0x482883,null));};exports['destroy']=function(_0x1c4be3,_0x1aa854){return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x1c4be3[_0x2516('0x42')]['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x1aa854,null))['then'](removeEntity(_0x1aa854,null))['catch'](handleError(_0x1aa854,null));};exports['describe']=function(_0x323590,_0x4f7eb4){return db['Cdr']['describe']()[_0x2516('0x22')](respondWithResult(_0x4f7eb4,null))[_0x2516('0x40')](handleError(_0x4f7eb4,null));};
\ No newline at end of file
+var _0xa751=['path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','rows','catch','show','params','keys','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x62c646,_0xa08641){var _0x2385f3=function(_0x45b92b){while(--_0x45b92b){_0x62c646['push'](_0x62c646['shift']());}};_0x2385f3(++_0xa08641);}(_0xa751,0x175));var _0x1a75=function(_0x5b10f5,_0x47493e){_0x5b10f5=_0x5b10f5-0x0;var _0x1b5d6a=_0xa751[_0x5b10f5];return _0x1b5d6a;};'use strict';var emlformat=require(_0x1a75('0x0'));var rimraf=require(_0x1a75('0x1'));var zipdir=require(_0x1a75('0x2'));var jsonpatch=require(_0x1a75('0x3'));var rp=require('request-promise');var moment=require(_0x1a75('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a75('0x5'));var util=require(_0x1a75('0x6'));var path=require(_0x1a75('0x7'));var sox=require('sox');var csv=require(_0x1a75('0x8'));var ejs=require(_0x1a75('0x9'));var fs=require('fs');var fs_extra=require(_0x1a75('0xa'));var _=require(_0x1a75('0xb'));var squel=require(_0x1a75('0xc'));var crypto=require(_0x1a75('0xd'));var jsforce=require(_0x1a75('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a75('0xf'));var Redis=require(_0x1a75('0x10'));var authService=require(_0x1a75('0x11'));var qs=require(_0x1a75('0x12'));var as=require(_0x1a75('0x13'));var hardwareService=require(_0x1a75('0x14'));var logger=require(_0x1a75('0x15'))(_0x1a75('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a75('0x17'))['db'];function respondWithStatusCode(_0x24e8dc,_0xae1af0){_0xae1af0=_0xae1af0||0xcc;return function(_0x1220e4){if(_0x1220e4){return _0x24e8dc['sendStatus'](_0xae1af0);}return _0x24e8dc['status'](_0xae1af0)[_0x1a75('0x18')]();};}function respondWithResult(_0xf4a616,_0x48577b){_0x48577b=_0x48577b||0xc8;return function(_0x1c84d3){if(_0x1c84d3){return _0xf4a616[_0x1a75('0x19')](_0x48577b)['json'](_0x1c84d3);}};}function respondWithFilteredResult(_0x1f3c38,_0xb4a245){return function(_0x15a1ec){if(_0x15a1ec){var _0x5883df=typeof _0xb4a245['offset']==='undefined'&&typeof _0xb4a245[_0x1a75('0x1a')]===_0x1a75('0x1b');var _0x2b6f3d=_0x15a1ec[_0x1a75('0x1c')];var _0x1b1af2=_0x5883df?0x0:_0xb4a245[_0x1a75('0x1d')];var _0x47f384=_0x5883df?_0x15a1ec[_0x1a75('0x1c')]:_0xb4a245['offset']+_0xb4a245['limit'];var _0x42df2c;if(_0x47f384>=_0x2b6f3d){_0x47f384=_0x2b6f3d;_0x42df2c=0xc8;}else{_0x42df2c=0xce;}_0x1f3c38[_0x1a75('0x19')](_0x42df2c);return _0x1f3c38['set'](_0x1a75('0x1e'),_0x1b1af2+'-'+_0x47f384+'/'+_0x2b6f3d)['json'](_0x15a1ec);}return null;};}function patchUpdates(_0x4699c9){return function(_0x3e3549){try{jsonpatch[_0x1a75('0x1f')](_0x3e3549,_0x4699c9,!![]);}catch(_0x340750){return BPromise[_0x1a75('0x20')](_0x340750);}return _0x3e3549[_0x1a75('0x21')]();};}function saveUpdates(_0x5a0ad7,_0x3ed5e9){return function(_0x4dc595){if(_0x4dc595){return _0x4dc595[_0x1a75('0x22')](_0x5a0ad7)[_0x1a75('0x23')](function(_0x320413){return _0x320413;});}return null;};}function removeEntity(_0x59e3da,_0x443ff8){return function(_0x5e6617){if(_0x5e6617){return _0x5e6617[_0x1a75('0x24')]()[_0x1a75('0x23')](function(){_0x59e3da[_0x1a75('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9fe9fe,_0x126f40){return function(_0x4dec82){if(!_0x4dec82){_0x9fe9fe[_0x1a75('0x25')](0x194);}return _0x4dec82;};}function handleError(_0x399dae,_0x5a6acc){_0x5a6acc=_0x5a6acc||0x1f4;return function(_0x168e06){logger[_0x1a75('0x26')](_0x168e06[_0x1a75('0x27')]);if(_0x168e06[_0x1a75('0x28')]){delete _0x168e06['name'];}_0x399dae[_0x1a75('0x19')](_0x5a6acc)[_0x1a75('0x29')](_0x168e06);};}exports[_0x1a75('0x2a')]=function(_0x2f5ac9,_0xf33870){var _0x9e66b9={},_0x3b6e1d={},_0x38e885={'count':0x0,'rows':[]};var _0x5518ed=_['map'](db[_0x1a75('0x2b')][_0x1a75('0x2c')],function(_0x1a0359){return{'name':_0x1a0359[_0x1a75('0x2d')],'type':_0x1a0359[_0x1a75('0x2e')][_0x1a75('0x2f')]};});_0x3b6e1d[_0x1a75('0x30')]=_[_0x1a75('0x31')](_0x5518ed,'name');_0x3b6e1d['query']=_['keys'](_0x2f5ac9[_0x1a75('0x32')]);_0x3b6e1d[_0x1a75('0x33')]=_[_0x1a75('0x34')](_0x3b6e1d[_0x1a75('0x30')],_0x3b6e1d['query']);_0x9e66b9['attributes']=_['intersection'](_0x3b6e1d[_0x1a75('0x30')],qs[_0x1a75('0x35')](_0x2f5ac9['query']['fields']));_0x9e66b9[_0x1a75('0x36')]=_0x9e66b9['attributes'][_0x1a75('0x37')]?_0x9e66b9[_0x1a75('0x36')]:_0x3b6e1d[_0x1a75('0x30')];if(!_0x2f5ac9['query']['hasOwnProperty'](_0x1a75('0x38'))){_0x9e66b9[_0x1a75('0x1a')]=qs[_0x1a75('0x1a')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x1a')]);_0x9e66b9[_0x1a75('0x1d')]=qs[_0x1a75('0x1d')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x1d')]);}_0x9e66b9[_0x1a75('0x39')]=qs[_0x1a75('0x3a')](_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x3a')]);_0x9e66b9[_0x1a75('0x3b')]=qs[_0x1a75('0x33')](_[_0x1a75('0x3c')](_0x2f5ac9['query'],_0x3b6e1d[_0x1a75('0x33')]),_0x5518ed);if(_0x2f5ac9['query']['filter']){_0x9e66b9[_0x1a75('0x3b')]=_[_0x1a75('0x3d')](_0x9e66b9[_0x1a75('0x3b')],{'$or':_[_0x1a75('0x31')](_0x5518ed,function(_0x2842d4){if(_0x2842d4['type']!==_0x1a75('0x3e')){var _0xc88c40={};_0xc88c40[_0x2842d4[_0x1a75('0x28')]]={'$like':'%'+_0x2f5ac9[_0x1a75('0x32')][_0x1a75('0x3f')]+'%'};return _0xc88c40;}})});}_0x9e66b9=_['merge']({},_0x9e66b9,_0x2f5ac9[_0x1a75('0x40')]);var _0x481bfe={'where':_0x9e66b9[_0x1a75('0x3b')]};return db[_0x1a75('0x2b')][_0x1a75('0x1c')](_0x481bfe)[_0x1a75('0x23')](function(_0x269ed6){_0x38e885[_0x1a75('0x1c')]=_0x269ed6;if(_0x2f5ac9[_0x1a75('0x32')]['includeAll']){_0x9e66b9['include']=[{'all':!![]}];}return db[_0x1a75('0x2b')]['findAll'](_0x9e66b9);})[_0x1a75('0x23')](function(_0x14abcf){_0x38e885[_0x1a75('0x41')]=_0x14abcf;return _0x38e885;})['then'](respondWithFilteredResult(_0xf33870,_0x9e66b9))[_0x1a75('0x42')](handleError(_0xf33870,null));};exports[_0x1a75('0x43')]=function(_0x21bfae,_0x5a2c51){var _0x292cbc={'raw':!![],'where':{'id':_0x21bfae[_0x1a75('0x44')]['id']}},_0x15fe49={};_0x15fe49[_0x1a75('0x30')]=_[_0x1a75('0x45')](db[_0x1a75('0x2b')][_0x1a75('0x2c')]);_0x15fe49['query']=_[_0x1a75('0x45')](_0x21bfae[_0x1a75('0x32')]);_0x15fe49[_0x1a75('0x33')]=_[_0x1a75('0x34')](_0x15fe49[_0x1a75('0x30')],_0x15fe49['query']);_0x292cbc[_0x1a75('0x36')]=_[_0x1a75('0x34')](_0x15fe49['model'],qs[_0x1a75('0x35')](_0x21bfae['query'][_0x1a75('0x35')]));_0x292cbc['attributes']=_0x292cbc[_0x1a75('0x36')][_0x1a75('0x37')]?_0x292cbc[_0x1a75('0x36')]:_0x15fe49[_0x1a75('0x30')];if(_0x21bfae[_0x1a75('0x32')][_0x1a75('0x46')]){_0x292cbc[_0x1a75('0x47')]=[{'all':!![]}];}_0x292cbc=_['merge']({},_0x292cbc,_0x21bfae[_0x1a75('0x40')]);return db['Cdr'][_0x1a75('0x48')](_0x292cbc)[_0x1a75('0x23')](handleEntityNotFound(_0x5a2c51,null))[_0x1a75('0x23')](respondWithResult(_0x5a2c51,null))[_0x1a75('0x42')](handleError(_0x5a2c51,null));};exports[_0x1a75('0x49')]=function(_0x1bf8a0,_0x2cfacf){return db[_0x1a75('0x2b')]['create'](_0x1bf8a0[_0x1a75('0x4a')],{})[_0x1a75('0x23')](respondWithResult(_0x2cfacf,0xc9))[_0x1a75('0x42')](handleError(_0x2cfacf,null));};exports[_0x1a75('0x22')]=function(_0x385382,_0x1b76d){if(_0x385382[_0x1a75('0x4a')]['id']){delete _0x385382[_0x1a75('0x4a')]['id'];}return db[_0x1a75('0x2b')][_0x1a75('0x48')]({'where':{'id':_0x385382[_0x1a75('0x44')]['id']}})[_0x1a75('0x23')](handleEntityNotFound(_0x1b76d,null))[_0x1a75('0x23')](saveUpdates(_0x385382[_0x1a75('0x4a')],null))[_0x1a75('0x23')](respondWithResult(_0x1b76d,null))['catch'](handleError(_0x1b76d,null));};exports[_0x1a75('0x24')]=function(_0xa20c25,_0x1ae0cb){return db[_0x1a75('0x2b')][_0x1a75('0x48')]({'where':{'id':_0xa20c25[_0x1a75('0x44')]['id']}})[_0x1a75('0x23')](handleEntityNotFound(_0x1ae0cb,null))[_0x1a75('0x23')](removeEntity(_0x1ae0cb,null))['catch'](handleError(_0x1ae0cb,null));};exports[_0x1a75('0x4b')]=function(_0x5f44e3,_0x40e643){return db[_0x1a75('0x2b')][_0x1a75('0x4b')]()['then'](respondWithResult(_0x40e643,null))['catch'](handleError(_0x40e643,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 2461eee..bca49f9 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x222d6f,_0x116849){var _0x1e08bb=function(_0x43943b){while(--_0x43943b){_0x222d6f['push'](_0x222d6f['shift']());}};_0x1e08bb(++_0x116849);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3d2532,_0x2936dc){var _0x1405ce=function(_0x3201d9){while(--_0x3201d9){_0x3d2532['push'](_0x3d2532['shift']());}};_0x1405ce(++_0x2936dc);}(_0x7a54,0x106));var _0x47a5=function(_0xa99e80,_0x1aea8f){_0xa99e80=_0xa99e80-0x0;var _0x5225d6=_0x7a54[_0xa99e80];return _0x5225d6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index aabb283..29fa434 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 _0x6766=['client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x18c9ab,_0x6ba7e7){var _0x17fc37=function(_0x57783c){while(--_0x57783c){_0x18c9ab['push'](_0x18c9ab['shift']());}};_0x17fc37(++_0x6ba7e7);}(_0x6766,0xf5));var _0x6676=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x6766[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require('lodash');var util=require(_0x6676('0x0'));var moment=require(_0x6676('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6676('0x2'))['db'];var utils=require(_0x6676('0x3'));var logger=require(_0x6676('0x4'))('rpc');var config=require(_0x6676('0x5'));var jayson=require(_0x6676('0x6'));var client=jayson[_0x6676('0x7')][_0x6676('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x368418,_0x231998,_0x11e2bd){return new BPromise(function(_0x527775,_0x3b9851){return client[_0x6676('0x9')](_0x368418,_0x11e2bd)[_0x6676('0xa')](function(_0xc67135){logger[_0x6676('0xb')]('Cdr,\x20%s,\x20%s',_0x231998,_0x6676('0xc'));logger[_0x6676('0xd')](_0x6676('0xe'),_0x231998,_0x6676('0xc'),JSON[_0x6676('0xf')](_0xc67135));if(_0xc67135[_0x6676('0x10')]){if(_0xc67135[_0x6676('0x10')][_0x6676('0x11')]===0x1f4){logger[_0x6676('0x10')](_0x6676('0x12'),_0x231998,_0xc67135['error'][_0x6676('0x13')]);return _0x3b9851(_0xc67135['error'][_0x6676('0x13')]);}logger[_0x6676('0x10')](_0x6676('0x12'),_0x231998,_0xc67135['error'][_0x6676('0x13')]);return _0x527775(_0xc67135['error']['message']);}else{logger[_0x6676('0xb')](_0x6676('0x12'),_0x231998,_0x6676('0xc'));_0x527775(_0xc67135['result'][_0x6676('0x13')]);}})[_0x6676('0x14')](function(_0x3bdad8){logger[_0x6676('0x10')](_0x6676('0x12'),_0x231998,_0x3bdad8);_0x3b9851(_0x3bdad8);});});}
\ No newline at end of file
+var _0x2d9c=['http','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','Cdr,\x20%s,\x20%s','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client'];(function(_0x46ae81,_0x16cd38){var _0x5013ca=function(_0x2ad2d2){while(--_0x2ad2d2){_0x46ae81['push'](_0x46ae81['shift']());}};_0x5013ca(++_0x16cd38);}(_0x2d9c,0x185));var _0xc2d9=function(_0x13398d,_0x1a918a){_0x13398d=_0x13398d-0x0;var _0x306118=_0x2d9c[_0x13398d];return _0x306118;};'use strict';var _=require('lodash');var util=require(_0xc2d9('0x0'));var moment=require('moment');var BPromise=require(_0xc2d9('0x1'));var rs=require(_0xc2d9('0x2'));var fs=require('fs');var Redis=require(_0xc2d9('0x3'));var db=require(_0xc2d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc2d9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc2d9('0x6')][_0xc2d9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2e7512,_0x41e810,_0x510655){return new BPromise(function(_0x9063eb,_0x58ea19){return client[_0xc2d9('0x8')](_0x2e7512,_0x510655)[_0xc2d9('0x9')](function(_0x55750e){logger[_0xc2d9('0xa')]('Cdr,\x20%s,\x20%s',_0x41e810,_0xc2d9('0xb'));logger['debug'](_0xc2d9('0xc'),_0x41e810,_0xc2d9('0xb'),JSON[_0xc2d9('0xd')](_0x55750e));if(_0x55750e[_0xc2d9('0xe')]){if(_0x55750e[_0xc2d9('0xe')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x41e810,_0x55750e[_0xc2d9('0xe')]['message']);return _0x58ea19(_0x55750e[_0xc2d9('0xe')][_0xc2d9('0xf')]);}logger[_0xc2d9('0xe')](_0xc2d9('0x10'),_0x41e810,_0x55750e[_0xc2d9('0xe')][_0xc2d9('0xf')]);return _0x9063eb(_0x55750e[_0xc2d9('0xe')][_0xc2d9('0xf')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x41e810,'request\x20sent');_0x9063eb(_0x55750e['result'][_0xc2d9('0xf')]);}})[_0xc2d9('0x11')](function(_0x1f728a){logger['error'](_0xc2d9('0x10'),_0x41e810,_0x1f728a);_0x58ea19(_0x1f728a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index fe31a6f..f0d60a7 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x53bfcf,_0x24937a){var _0x2825e4=function(_0x2ffd0a){while(--_0x2ffd0a){_0x53bfcf['push'](_0x53bfcf['shift']());}};_0x2825e4(++_0x24937a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index a05e39d..6bc1653 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 _0xa5b8=['noop','TEXT','sequelize','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa5b8,0x15e));var _0x8a5b=function(_0x46d422,_0x26c3bb){_0x46d422=_0x46d422-0x0;var _0x696c6c=_0xa5b8[_0x46d422];return _0x696c6c;};'use strict';var Sequelize=require(_0x8a5b('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8a5b('0x1')],'allowNull':![],'defaultValue':_0x8a5b('0x2')},'appdata':{'type':Sequelize[_0x8a5b('0x3')]()},'description':{'type':Sequelize[_0x8a5b('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xa036=['*,*,*,*','exports','INTEGER','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa036,0x101));var _0x6a03=function(_0x305d3f,_0x5b9f83){_0x305d3f=_0x305d3f-0x0;var _0x438449=_0xa036[_0x305d3f];return _0x438449;};'use strict';var Sequelize=require('sequelize');module[_0x6a03('0x0')]={'priority':{'type':Sequelize[_0x6a03('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6a03('0x2')]},'interval':{'type':Sequelize[_0x6a03('0x2')],'defaultValue':_0x6a03('0x3')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f67a0b0..91b2b96 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 _0xc29b=['includeAll','merge','options','find','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','show','keys','ChatApplication','query','filters','intersection','model','attributes','fields'];(function(_0x504368,_0xbce2c7){var _0x2cec15=function(_0x1adc5){while(--_0x1adc5){_0x504368['push'](_0x504368['shift']());}};_0x2cec15(++_0xbce2c7);}(_0xc29b,0x12d));var _0xbc29=function(_0x4e4f72,_0x39b2b2){_0x4e4f72=_0x4e4f72-0x0;var _0x26725c=_0xc29b[_0x4e4f72];return _0x26725c;};'use strict';var emlformat=require(_0xbc29('0x0'));var rimraf=require(_0xbc29('0x1'));var zipdir=require(_0xbc29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc29('0x3'));var moment=require(_0xbc29('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbc29('0x5'));var util=require(_0xbc29('0x6'));var path=require(_0xbc29('0x7'));var sox=require(_0xbc29('0x8'));var csv=require(_0xbc29('0x9'));var ejs=require(_0xbc29('0xa'));var fs=require('fs');var fs_extra=require(_0xbc29('0xb'));var _=require(_0xbc29('0xc'));var squel=require(_0xbc29('0xd'));var crypto=require(_0xbc29('0xe'));var jsforce=require(_0xbc29('0xf'));var deskjs=require(_0xbc29('0x10'));var toCsv=require(_0xbc29('0x9'));var querystring=require(_0xbc29('0x11'));var Papa=require(_0xbc29('0x12'));var Redis=require(_0xbc29('0x13'));var authService=require(_0xbc29('0x14'));var qs=require(_0xbc29('0x15'));var as=require(_0xbc29('0x16'));var hardwareService=require(_0xbc29('0x17'));var logger=require('../../config/logger')(_0xbc29('0x18'));var utils=require(_0xbc29('0x19'));var config=require(_0xbc29('0x1a'));var licenseUtil=require(_0xbc29('0x1b'));var db=require(_0xbc29('0x1c'))['db'];function respondWithStatusCode(_0x2794c6,_0x352c9e){_0x352c9e=_0x352c9e||0xcc;return function(_0x5e581f){if(_0x5e581f){return _0x2794c6[_0xbc29('0x1d')](_0x352c9e);}return _0x2794c6[_0xbc29('0x1e')](_0x352c9e)[_0xbc29('0x1f')]();};}function respondWithResult(_0x515ea8,_0x483fbe){_0x483fbe=_0x483fbe||0xc8;return function(_0x1892fc){if(_0x1892fc){return _0x515ea8['status'](_0x483fbe)[_0xbc29('0x20')](_0x1892fc);}};}function respondWithFilteredResult(_0x3f0264,_0x46eb03){return function(_0x490030){if(_0x490030){var _0x3b31b1=typeof _0x46eb03['offset']===_0xbc29('0x21')&&typeof _0x46eb03[_0xbc29('0x22')]===_0xbc29('0x21');var _0x1e7f15=_0x490030[_0xbc29('0x23')];var _0x42b0be=_0x3b31b1?0x0:_0x46eb03['offset'];var _0x9e84e3=_0x3b31b1?_0x490030[_0xbc29('0x23')]:_0x46eb03['offset']+_0x46eb03['limit'];var _0x30c251;if(_0x9e84e3>=_0x1e7f15){_0x9e84e3=_0x1e7f15;_0x30c251=0xc8;}else{_0x30c251=0xce;}_0x3f0264['status'](_0x30c251);return _0x3f0264['set'](_0xbc29('0x24'),_0x42b0be+'-'+_0x9e84e3+'/'+_0x1e7f15)[_0xbc29('0x20')](_0x490030);}return null;};}function patchUpdates(_0x1912ea){return function(_0x371adc){try{jsonpatch[_0xbc29('0x25')](_0x371adc,_0x1912ea,!![]);}catch(_0x3b6304){return BPromise[_0xbc29('0x26')](_0x3b6304);}return _0x371adc[_0xbc29('0x27')]();};}function saveUpdates(_0x5cdc9e,_0x115592){return function(_0x35920d){if(_0x35920d){return _0x35920d[_0xbc29('0x28')](_0x5cdc9e)[_0xbc29('0x29')](function(_0x1ae3f2){return _0x1ae3f2;});}return null;};}function removeEntity(_0x5c6f6d,_0x24523f){return function(_0x3ca9dc){if(_0x3ca9dc){return _0x3ca9dc[_0xbc29('0x2a')]()[_0xbc29('0x29')](function(){_0x5c6f6d['status'](0xcc)[_0xbc29('0x1f')]();});}};}function handleEntityNotFound(_0x3ad136,_0x536bd2){return function(_0xd3d9a5){if(!_0xd3d9a5){_0x3ad136[_0xbc29('0x1d')](0x194);}return _0xd3d9a5;};}function handleError(_0x511fa7,_0x4983b5){_0x4983b5=_0x4983b5||0x1f4;return function(_0x2c7b63){logger['error'](_0x2c7b63['stack']);if(_0x2c7b63[_0xbc29('0x2b')]){delete _0x2c7b63[_0xbc29('0x2b')];}_0x511fa7[_0xbc29('0x1e')](_0x4983b5)['send'](_0x2c7b63);};}exports[_0xbc29('0x2c')]=function(_0x3febdf,_0x1e11b3){var _0x2f23c2={'raw':!![],'where':{'id':_0x3febdf['params']['id']}},_0x1797c9={};_0x1797c9['model']=_[_0xbc29('0x2d')](db[_0xbc29('0x2e')]['rawAttributes']);_0x1797c9[_0xbc29('0x2f')]=_[_0xbc29('0x2d')](_0x3febdf[_0xbc29('0x2f')]);_0x1797c9[_0xbc29('0x30')]=_[_0xbc29('0x31')](_0x1797c9[_0xbc29('0x32')],_0x1797c9['query']);_0x2f23c2[_0xbc29('0x33')]=_[_0xbc29('0x31')](_0x1797c9[_0xbc29('0x32')],qs[_0xbc29('0x34')](_0x3febdf['query'][_0xbc29('0x34')]));_0x2f23c2[_0xbc29('0x33')]=_0x2f23c2[_0xbc29('0x33')]['length']?_0x2f23c2['attributes']:_0x1797c9[_0xbc29('0x32')];if(_0x3febdf[_0xbc29('0x2f')][_0xbc29('0x35')]){_0x2f23c2['include']=[{'all':!![]}];}_0x2f23c2=_[_0xbc29('0x36')]({},_0x2f23c2,_0x3febdf[_0xbc29('0x37')]);return db[_0xbc29('0x2e')][_0xbc29('0x38')](_0x2f23c2)['then'](handleEntityNotFound(_0x1e11b3,null))['then'](respondWithResult(_0x1e11b3,null))['catch'](handleError(_0x1e11b3,null));};exports[_0xbc29('0x28')]=function(_0x296355,_0xf5d37c){if(_0x296355['body']['id']){delete _0x296355['body']['id'];}return db[_0xbc29('0x2e')][_0xbc29('0x38')]({'where':{'id':_0x296355['params']['id']}})['then'](handleEntityNotFound(_0xf5d37c,null))[_0xbc29('0x29')](saveUpdates(_0x296355[_0xbc29('0x39')],null))[_0xbc29('0x29')](respondWithResult(_0xf5d37c,null))[_0xbc29('0x3a')](handleError(_0xf5d37c,null));};exports[_0xbc29('0x2a')]=function(_0x264331,_0x4a9e50){return db['ChatApplication'][_0xbc29('0x38')]({'where':{'id':_0x264331['params']['id']}})[_0xbc29('0x29')](handleEntityNotFound(_0x4a9e50,null))['then'](removeEntity(_0x4a9e50,null))[_0xbc29('0x3a')](handleError(_0x4a9e50,null));};
\ No newline at end of file
+var _0x18e0=['moment','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','include','merge','options','find','catch','body','rimraf','fast-json-patch','request-promise'];(function(_0x4c1303,_0x4efd70){var _0x2b6af4=function(_0x52ab13){while(--_0x52ab13){_0x4c1303['push'](_0x4c1303['shift']());}};_0x2b6af4(++_0x4efd70);}(_0x18e0,0xa2));var _0x018e=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x18e0[_0x2080a3];return _0x8d7d17;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x018e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x018e('0x1'));var rp=require(_0x018e('0x2'));var moment=require(_0x018e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x018e('0x4'));var util=require('util');var path=require('path');var sox=require(_0x018e('0x5'));var csv=require(_0x018e('0x6'));var ejs=require(_0x018e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x018e('0x8'));var crypto=require(_0x018e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x018e('0xa'));var toCsv=require(_0x018e('0x6'));var querystring=require(_0x018e('0xb'));var Papa=require(_0x018e('0xc'));var Redis=require(_0x018e('0xd'));var authService=require(_0x018e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x018e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x018e('0x10'));var config=require(_0x018e('0x11'));var licenseUtil=require(_0x018e('0x12'));var db=require(_0x018e('0x13'))['db'];function respondWithStatusCode(_0x167572,_0xd16776){_0xd16776=_0xd16776||0xcc;return function(_0xc940bb){if(_0xc940bb){return _0x167572[_0x018e('0x14')](_0xd16776);}return _0x167572[_0x018e('0x15')](_0xd16776)['end']();};}function respondWithResult(_0xec531a,_0x3b1e5e){_0x3b1e5e=_0x3b1e5e||0xc8;return function(_0x2d6aa0){if(_0x2d6aa0){return _0xec531a[_0x018e('0x15')](_0x3b1e5e)[_0x018e('0x16')](_0x2d6aa0);}};}function respondWithFilteredResult(_0x5bfd6e,_0x275c21){return function(_0x142f1e){if(_0x142f1e){var _0x41cbd8=typeof _0x275c21[_0x018e('0x17')]==='undefined'&&typeof _0x275c21[_0x018e('0x18')]===_0x018e('0x19');var _0x4d46aa=_0x142f1e[_0x018e('0x1a')];var _0x237ba1=_0x41cbd8?0x0:_0x275c21[_0x018e('0x17')];var _0xdf15f8=_0x41cbd8?_0x142f1e[_0x018e('0x1a')]:_0x275c21['offset']+_0x275c21[_0x018e('0x18')];var _0x421942;if(_0xdf15f8>=_0x4d46aa){_0xdf15f8=_0x4d46aa;_0x421942=0xc8;}else{_0x421942=0xce;}_0x5bfd6e[_0x018e('0x15')](_0x421942);return _0x5bfd6e[_0x018e('0x1b')](_0x018e('0x1c'),_0x237ba1+'-'+_0xdf15f8+'/'+_0x4d46aa)[_0x018e('0x16')](_0x142f1e);}return null;};}function patchUpdates(_0x15c3fa){return function(_0x4f59e7){try{jsonpatch[_0x018e('0x1d')](_0x4f59e7,_0x15c3fa,!![]);}catch(_0x213989){return BPromise[_0x018e('0x1e')](_0x213989);}return _0x4f59e7[_0x018e('0x1f')]();};}function saveUpdates(_0x23ef86,_0x5d9fef){return function(_0x5cffe9){if(_0x5cffe9){return _0x5cffe9[_0x018e('0x20')](_0x23ef86)[_0x018e('0x21')](function(_0x2c813e){return _0x2c813e;});}return null;};}function removeEntity(_0x1e3106,_0x2ef801){return function(_0x198b0b){if(_0x198b0b){return _0x198b0b[_0x018e('0x22')]()[_0x018e('0x21')](function(){_0x1e3106[_0x018e('0x15')](0xcc)[_0x018e('0x23')]();});}};}function handleEntityNotFound(_0x35f9a3,_0x7596f4){return function(_0x4e7d9a){if(!_0x4e7d9a){_0x35f9a3[_0x018e('0x14')](0x194);}return _0x4e7d9a;};}function handleError(_0x289931,_0x176822){_0x176822=_0x176822||0x1f4;return function(_0x344e2b){logger[_0x018e('0x24')](_0x344e2b[_0x018e('0x25')]);if(_0x344e2b[_0x018e('0x26')]){delete _0x344e2b[_0x018e('0x26')];}_0x289931[_0x018e('0x15')](_0x176822)[_0x018e('0x27')](_0x344e2b);};}exports['show']=function(_0x29455a,_0x1a4726){var _0x4af339={'raw':!![],'where':{'id':_0x29455a[_0x018e('0x28')]['id']}},_0xac43bc={};_0xac43bc[_0x018e('0x29')]=_[_0x018e('0x2a')](db[_0x018e('0x2b')][_0x018e('0x2c')]);_0xac43bc['query']=_[_0x018e('0x2a')](_0x29455a[_0x018e('0x2d')]);_0xac43bc['filters']=_[_0x018e('0x2e')](_0xac43bc[_0x018e('0x29')],_0xac43bc[_0x018e('0x2d')]);_0x4af339[_0x018e('0x2f')]=_[_0x018e('0x2e')](_0xac43bc['model'],qs[_0x018e('0x30')](_0x29455a[_0x018e('0x2d')][_0x018e('0x30')]));_0x4af339['attributes']=_0x4af339[_0x018e('0x2f')]['length']?_0x4af339[_0x018e('0x2f')]:_0xac43bc[_0x018e('0x29')];if(_0x29455a['query']['includeAll']){_0x4af339[_0x018e('0x31')]=[{'all':!![]}];}_0x4af339=_[_0x018e('0x32')]({},_0x4af339,_0x29455a[_0x018e('0x33')]);return db[_0x018e('0x2b')][_0x018e('0x34')](_0x4af339)['then'](handleEntityNotFound(_0x1a4726,null))[_0x018e('0x21')](respondWithResult(_0x1a4726,null))[_0x018e('0x35')](handleError(_0x1a4726,null));};exports[_0x018e('0x20')]=function(_0x55dbda,_0x5a2741){if(_0x55dbda[_0x018e('0x36')]['id']){delete _0x55dbda[_0x018e('0x36')]['id'];}return db[_0x018e('0x2b')][_0x018e('0x34')]({'where':{'id':_0x55dbda[_0x018e('0x28')]['id']}})[_0x018e('0x21')](handleEntityNotFound(_0x5a2741,null))['then'](saveUpdates(_0x55dbda[_0x018e('0x36')],null))[_0x018e('0x21')](respondWithResult(_0x5a2741,null))['catch'](handleError(_0x5a2741,null));};exports['destroy']=function(_0x5c34c9,_0x3b6e6a){return db[_0x018e('0x2b')][_0x018e('0x34')]({'where':{'id':_0x5c34c9[_0x018e('0x28')]['id']}})[_0x018e('0x21')](handleEntityNotFound(_0x3b6e6a,null))['then'](removeEntity(_0x3b6e6a,null))[_0x018e('0x35')](handleError(_0x3b6e6a,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index d60ba52..071b405 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 _0x6752=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5c613a,_0x142f50){var _0x26b2cd=function(_0xfbac12){while(--_0xfbac12){_0x5c613a['push'](_0x5c613a['shift']());}};_0x26b2cd(++_0x142f50);}(_0x6752,0x96));var _0x2675=function(_0x3ef252,_0x235605){_0x3ef252=_0x3ef252-0x0;var _0x7fdb3a=_0x6752[_0x3ef252];return _0x7fdb3a;};'use strict';var _=require(_0x2675('0x0'));var util=require(_0x2675('0x1'));var logger=require(_0x2675('0x2'))(_0x2675('0x3'));var moment=require('moment');var BPromise=require(_0x2675('0x4'));var rp=require(_0x2675('0x5'));var fs=require('fs');var path=require(_0x2675('0x6'));var rimraf=require(_0x2675('0x7'));var config=require(_0x2675('0x8'));var attributes=require(_0x2675('0x9'));module[_0x2675('0xa')]=function(_0x366e62,_0xe2c5e7){return _0x366e62['define'](_0x2675('0xb'),attributes,{'tableName':_0x2675('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2675('0xd'),'collate':_0x2675('0xe')});};
\ No newline at end of file
+var _0xc792=['exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes'];(function(_0x550f8a,_0x1c97d5){var _0x20a27b=function(_0x5ce662){while(--_0x5ce662){_0x550f8a['push'](_0x550f8a['shift']());}};_0x20a27b(++_0x1c97d5);}(_0xc792,0x1e5));var _0x2c79=function(_0x1ee4d6,_0x26a81d){_0x1ee4d6=_0x1ee4d6-0x0;var _0x2cb60e=_0xc792[_0x1ee4d6];return _0x2cb60e;};'use strict';var _=require(_0x2c79('0x0'));var util=require(_0x2c79('0x1'));var logger=require(_0x2c79('0x2'))(_0x2c79('0x3'));var moment=require(_0x2c79('0x4'));var BPromise=require(_0x2c79('0x5'));var rp=require(_0x2c79('0x6'));var fs=require('fs');var path=require(_0x2c79('0x7'));var rimraf=require(_0x2c79('0x8'));var config=require('../../config/environment');var attributes=require(_0x2c79('0x9'));module[_0x2c79('0xa')]=function(_0x4d031c,_0x490807){return _0x4d031c[_0x2c79('0xb')](_0x2c79('0xc'),attributes,{'tableName':_0x2c79('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2c79('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 4acfded..2e8362a 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 _0x4e8d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x553f8c,_0x30e67c){var _0x4707c0=function(_0x29f324){while(--_0x29f324){_0x553f8c['push'](_0x553f8c['shift']());}};_0x4707c0(++_0x30e67c);}(_0x4e8d,0x68));var _0xd4e8=function(_0x46eb93,_0x1ed43f){_0x46eb93=_0x46eb93-0x0;var _0x6d784b=_0x4e8d[_0x46eb93];return _0x6d784b;};'use strict';var _=require(_0xd4e8('0x0'));var util=require('util');var moment=require(_0xd4e8('0x1'));var BPromise=require(_0xd4e8('0x2'));var rs=require(_0xd4e8('0x3'));var fs=require('fs');var Redis=require(_0xd4e8('0x4'));var db=require(_0xd4e8('0x5'))['db'];var utils=require(_0xd4e8('0x6'));var logger=require(_0xd4e8('0x7'))(_0xd4e8('0x8'));var config=require(_0xd4e8('0x9'));var jayson=require(_0xd4e8('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43988a,_0x4327e1,_0x560fda){return new BPromise(function(_0x5e1103,_0x40f6e1){return client[_0xd4e8('0xb')](_0x43988a,_0x560fda)[_0xd4e8('0xc')](function(_0x3a2354){logger[_0xd4e8('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4327e1,_0xd4e8('0xe'));logger[_0xd4e8('0xf')](_0xd4e8('0x10'),_0x4327e1,_0xd4e8('0xe'),JSON[_0xd4e8('0x11')](_0x3a2354));if(_0x3a2354[_0xd4e8('0x12')]){if(_0x3a2354['error']['code']===0x1f4){logger['error'](_0xd4e8('0x13'),_0x4327e1,_0x3a2354['error'][_0xd4e8('0x14')]);return _0x40f6e1(_0x3a2354['error'][_0xd4e8('0x14')]);}logger[_0xd4e8('0x12')]('ChatApplication,\x20%s,\x20%s',_0x4327e1,_0x3a2354['error'][_0xd4e8('0x14')]);return _0x5e1103(_0x3a2354[_0xd4e8('0x12')][_0xd4e8('0x14')]);}else{logger['info'](_0xd4e8('0x13'),_0x4327e1,'request\x20sent');_0x5e1103(_0x3a2354['result'][_0xd4e8('0x14')]);}})[_0xd4e8('0x15')](function(_0x267740){logger[_0xd4e8('0x12')](_0xd4e8('0x13'),_0x4327e1,_0x267740);_0x40f6e1(_0x267740);});});}
\ No newline at end of file
+var _0x00f8=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4b32d5,_0x54b694){var _0x230836=function(_0x3e313d){while(--_0x3e313d){_0x4b32d5['push'](_0x4b32d5['shift']());}};_0x230836(++_0x54b694);}(_0x00f8,0x1b9));var _0x800f=function(_0x14562a,_0x4d3bed){_0x14562a=_0x14562a-0x0;var _0x1d1f9a=_0x00f8[_0x14562a];return _0x1d1f9a;};'use strict';var _=require('lodash');var util=require(_0x800f('0x0'));var moment=require(_0x800f('0x1'));var BPromise=require(_0x800f('0x2'));var rs=require(_0x800f('0x3'));var fs=require('fs');var Redis=require(_0x800f('0x4'));var db=require(_0x800f('0x5'))['db'];var utils=require(_0x800f('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x800f('0x7'));var client=jayson[_0x800f('0x8')][_0x800f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24fd2d,_0x2bb7af,_0x4d20fd){return new BPromise(function(_0xb6f69f,_0x1e3acc){return client[_0x800f('0xa')](_0x24fd2d,_0x4d20fd)[_0x800f('0xb')](function(_0x430d1e){logger['info'](_0x800f('0xc'),_0x2bb7af,_0x800f('0xd'));logger['debug'](_0x800f('0xe'),_0x2bb7af,_0x800f('0xd'),JSON[_0x800f('0xf')](_0x430d1e));if(_0x430d1e['error']){if(_0x430d1e[_0x800f('0x10')][_0x800f('0x11')]===0x1f4){logger[_0x800f('0x10')](_0x800f('0xc'),_0x2bb7af,_0x430d1e[_0x800f('0x10')][_0x800f('0x12')]);return _0x1e3acc(_0x430d1e[_0x800f('0x10')][_0x800f('0x12')]);}logger['error'](_0x800f('0xc'),_0x2bb7af,_0x430d1e[_0x800f('0x10')]['message']);return _0xb6f69f(_0x430d1e[_0x800f('0x10')]['message']);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x2bb7af,'request\x20sent');_0xb6f69f(_0x430d1e[_0x800f('0x13')][_0x800f('0x12')]);}})[_0x800f('0x14')](function(_0x15a7d1){logger['error'](_0x800f('0xc'),_0x2bb7af,_0x15a7d1);_0x1e3acc(_0x15a7d1);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 801a6cb..709bec9 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 _0x39a8=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0x39a8,0xe3));var _0x839a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x39a8[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x839a('0x0'));var util=require(_0x839a('0x1'));var path=require(_0x839a('0x2'));var timeout=require(_0x839a('0x3'));var express=require(_0x839a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x839a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x839a('0x6'));var controller=require(_0x839a('0x7'));router[_0x839a('0x8')](_0x839a('0x9'),auth[_0x839a('0xa')](),controller[_0x839a('0xb')]);router[_0x839a('0xc')]('/:id',auth[_0x839a('0xa')](),controller['update']);router[_0x839a('0xd')](_0x839a('0x9'),auth['isAuthenticated'](),controller[_0x839a('0xe')]);module[_0x839a('0xf')]=router;
\ No newline at end of file
+var _0xc2f7=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','destroy','multer','path','express'];(function(_0x3da4e1,_0x9644d1){var _0x16c20d=function(_0x13c9b4){while(--_0x13c9b4){_0x3da4e1['push'](_0x3da4e1['shift']());}};_0x16c20d(++_0x9644d1);}(_0xc2f7,0xde));var _0x7c2f=function(_0x271883,_0x44642b){_0x271883=_0x271883-0x0;var _0x351f9e=_0xc2f7[_0x271883];return _0x351f9e;};'use strict';var multer=require(_0x7c2f('0x0'));var util=require('util');var path=require(_0x7c2f('0x1'));var timeout=require('connect-timeout');var express=require(_0x7c2f('0x2'));var router=express[_0x7c2f('0x3')]();var fs_extra=require(_0x7c2f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7c2f('0x5'));var config=require(_0x7c2f('0x6'));var controller=require(_0x7c2f('0x7'));router[_0x7c2f('0x8')]('/:id',auth[_0x7c2f('0x9')](),controller[_0x7c2f('0xa')]);router[_0x7c2f('0xb')](_0x7c2f('0xc'),auth[_0x7c2f('0x9')](),controller[_0x7c2f('0xd')]);router['delete'](_0x7c2f('0xc'),auth[_0x7c2f('0x9')](),controller[_0x7c2f('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 5808174..e86fa24 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 _0x9505=['BOOLEAN','sequelize','exports','STRING'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x9505,0x1e5));var _0x5950=function(_0x2f883d,_0x540dce){_0x2f883d=_0x2f883d-0x0;var _0x45bb58=_0x9505[_0x2f883d];return _0x45bb58;};'use strict';var Sequelize=require(_0x5950('0x0'));module[_0x5950('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5950('0x2')]},'write':{'type':Sequelize[_0x5950('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x14c2=['sequelize','STRING','BOOLEAN'];(function(_0x43cfab,_0x543a2c){var _0x2477fe=function(_0x5be5d9){while(--_0x5be5d9){_0x43cfab['push'](_0x43cfab['shift']());}};_0x2477fe(++_0x543a2c);}(_0x14c2,0x180));var _0x214c=function(_0x15fa1e,_0x5fb00e){_0x15fa1e=_0x15fa1e-0x0;var _0x244e23=_0x14c2[_0x15fa1e];return _0x244e23;};'use strict';var Sequelize=require(_0x214c('0x0'));module['exports']={'name':{'type':Sequelize[_0x214c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x214c('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 0986e90..fc14794 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 _0x86e7=['YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','ChatGroup','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format'];(function(_0x108243,_0x1244e1){var _0x6d53bb=function(_0x1df9d7){while(--_0x1df9d7){_0x108243['push'](_0x108243['shift']());}};_0x6d53bb(++_0x1244e1);}(_0x86e7,0x119));var _0x786e=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x86e7[_0x20589d];return _0x422de9;};'use strict';var emlformat=require(_0x786e('0x0'));var rimraf=require(_0x786e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x786e('0x2'));var rp=require(_0x786e('0x3'));var moment=require(_0x786e('0x4'));var BPromise=require(_0x786e('0x5'));var Mustache=require(_0x786e('0x6'));var util=require(_0x786e('0x7'));var path=require(_0x786e('0x8'));var sox=require(_0x786e('0x9'));var csv=require(_0x786e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x786e('0xb'));var _=require(_0x786e('0xc'));var squel=require('squel');var crypto=require(_0x786e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x786e('0xe'));var toCsv=require(_0x786e('0xa'));var querystring=require('querystring');var Papa=require(_0x786e('0xf'));var Redis=require('ioredis');var authService=require(_0x786e('0x10'));var qs=require(_0x786e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x786e('0x12'));var utils=require(_0x786e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x786e('0x14'));var db=require(_0x786e('0x15'))['db'];config[_0x786e('0x16')]=_[_0x786e('0x17')](config[_0x786e('0x16')],{'host':_0x786e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x786e('0x19'))[_0x786e('0x1a')](socket);function respondWithStatusCode(_0x4dedd7,_0x36d514){_0x36d514=_0x36d514||0xcc;return function(_0x58b179){if(_0x58b179){return _0x4dedd7[_0x786e('0x1b')](_0x36d514);}return _0x4dedd7['status'](_0x36d514)[_0x786e('0x1c')]();};}function respondWithResult(_0x516467,_0xc453bb){_0xc453bb=_0xc453bb||0xc8;return function(_0x835ecc){if(_0x835ecc){return _0x516467[_0x786e('0x1d')](_0xc453bb)['json'](_0x835ecc);}};}function respondWithFilteredResult(_0x1ac336,_0x44e068){return function(_0xb4adc9){if(_0xb4adc9){var _0x99e8ce=typeof _0x44e068[_0x786e('0x1e')]===_0x786e('0x1f')&&typeof _0x44e068[_0x786e('0x20')]===_0x786e('0x1f');var _0x16fb06=_0xb4adc9[_0x786e('0x21')];var _0x440a5a=_0x99e8ce?0x0:_0x44e068[_0x786e('0x1e')];var _0x309659=_0x99e8ce?_0xb4adc9[_0x786e('0x21')]:_0x44e068[_0x786e('0x1e')]+_0x44e068['limit'];var _0x5ea686;if(_0x309659>=_0x16fb06){_0x309659=_0x16fb06;_0x5ea686=0xc8;}else{_0x5ea686=0xce;}_0x1ac336[_0x786e('0x1d')](_0x5ea686);return _0x1ac336['set'](_0x786e('0x22'),_0x440a5a+'-'+_0x309659+'/'+_0x16fb06)['json'](_0xb4adc9);}return null;};}function patchUpdates(_0x283820){return function(_0x330a9d){try{jsonpatch[_0x786e('0x23')](_0x330a9d,_0x283820,!![]);}catch(_0x2eb03c){return BPromise[_0x786e('0x24')](_0x2eb03c);}return _0x330a9d['save']();};}function saveUpdates(_0x3b8f03,_0x2b7f05){return function(_0x55ba82){if(_0x55ba82){return _0x55ba82[_0x786e('0x25')](_0x3b8f03)[_0x786e('0x26')](function(_0x2c5c77){return _0x2c5c77;});}return null;};}function removeEntity(_0x27797a,_0x412b83){return function(_0x150396){if(_0x150396){return _0x150396[_0x786e('0x27')]()['then'](function(){_0x27797a[_0x786e('0x1d')](0xcc)[_0x786e('0x1c')]();});}};}function handleEntityNotFound(_0x4d69ca,_0x1cc89a){return function(_0x305cfd){if(!_0x305cfd){_0x4d69ca[_0x786e('0x1b')](0x194);}return _0x305cfd;};}function handleError(_0x514dbd,_0x590ade){_0x590ade=_0x590ade||0x1f4;return function(_0x474f37){logger['error'](_0x474f37[_0x786e('0x28')]);if(_0x474f37[_0x786e('0x29')]){delete _0x474f37[_0x786e('0x29')];}_0x514dbd[_0x786e('0x1d')](_0x590ade)['send'](_0x474f37);};}exports[_0x786e('0x2a')]=function(_0x1379bb,_0x5b98e7){var _0x3e411b={},_0x26050f={},_0x1ec628={'count':0x0,'rows':[]};var _0x5b2096=_[_0x786e('0x2b')](db[_0x786e('0x2c')]['rawAttributes'],function(_0x33d04b){return{'name':_0x33d04b[_0x786e('0x2d')],'type':_0x33d04b[_0x786e('0x2e')][_0x786e('0x2f')]};});_0x26050f[_0x786e('0x30')]=_[_0x786e('0x2b')](_0x5b2096,'name');_0x26050f[_0x786e('0x31')]=_[_0x786e('0x32')](_0x1379bb[_0x786e('0x31')]);_0x26050f[_0x786e('0x33')]=_[_0x786e('0x34')](_0x26050f['model'],_0x26050f[_0x786e('0x31')]);_0x3e411b[_0x786e('0x35')]=_['intersection'](_0x26050f[_0x786e('0x30')],qs['fields'](_0x1379bb[_0x786e('0x31')][_0x786e('0x36')]));_0x3e411b[_0x786e('0x35')]=_0x3e411b[_0x786e('0x35')][_0x786e('0x37')]?_0x3e411b[_0x786e('0x35')]:_0x26050f[_0x786e('0x30')];if(!_0x1379bb[_0x786e('0x31')][_0x786e('0x38')]('nolimit')){_0x3e411b[_0x786e('0x20')]=qs[_0x786e('0x20')](_0x1379bb[_0x786e('0x31')][_0x786e('0x20')]);_0x3e411b['offset']=qs['offset'](_0x1379bb[_0x786e('0x31')][_0x786e('0x1e')]);}_0x3e411b[_0x786e('0x39')]=qs[_0x786e('0x3a')](_0x1379bb[_0x786e('0x31')][_0x786e('0x3a')]);_0x3e411b[_0x786e('0x3b')]=qs[_0x786e('0x33')](_[_0x786e('0x3c')](_0x1379bb[_0x786e('0x31')],_0x26050f[_0x786e('0x33')]),_0x5b2096);if(_0x1379bb[_0x786e('0x31')][_0x786e('0x3d')]){_0x3e411b[_0x786e('0x3b')]=_[_0x786e('0x3e')](_0x3e411b['where'],{'$or':_[_0x786e('0x2b')](_0x5b2096,function(_0x3dc07b){if(_0x3dc07b[_0x786e('0x2e')]!=='VIRTUAL'){var _0x383079={};_0x383079[_0x3dc07b[_0x786e('0x29')]]={'$like':'%'+_0x1379bb[_0x786e('0x31')][_0x786e('0x3d')]+'%'};return _0x383079;}})});}_0x3e411b=_[_0x786e('0x3e')]({},_0x3e411b,_0x1379bb[_0x786e('0x3f')]);var _0x29e5db={'where':_0x3e411b[_0x786e('0x3b')]};return db[_0x786e('0x2c')][_0x786e('0x21')](_0x29e5db)[_0x786e('0x26')](function(_0x2f09e6){_0x1ec628[_0x786e('0x21')]=_0x2f09e6;if(_0x1379bb[_0x786e('0x31')][_0x786e('0x40')]){_0x3e411b[_0x786e('0x41')]=[{'all':!![]}];}return db[_0x786e('0x2c')][_0x786e('0x42')](_0x3e411b);})[_0x786e('0x26')](function(_0x5dd85a){_0x1ec628[_0x786e('0x43')]=_0x5dd85a;return _0x1ec628;})['then'](respondWithFilteredResult(_0x5b98e7,_0x3e411b))[_0x786e('0x44')](handleError(_0x5b98e7,null));};exports['show']=function(_0xac447c,_0x237779){var _0xdd64f9={'raw':!![],'where':{'id':_0xac447c['params']['id']}},_0x3a6a7f={};_0x3a6a7f[_0x786e('0x30')]=_['keys'](db[_0x786e('0x2c')][_0x786e('0x45')]);_0x3a6a7f[_0x786e('0x31')]=_[_0x786e('0x32')](_0xac447c[_0x786e('0x31')]);_0x3a6a7f['filters']=_[_0x786e('0x34')](_0x3a6a7f[_0x786e('0x30')],_0x3a6a7f[_0x786e('0x31')]);_0xdd64f9[_0x786e('0x35')]=_[_0x786e('0x34')](_0x3a6a7f['model'],qs[_0x786e('0x36')](_0xac447c[_0x786e('0x31')][_0x786e('0x36')]));_0xdd64f9[_0x786e('0x35')]=_0xdd64f9['attributes'][_0x786e('0x37')]?_0xdd64f9[_0x786e('0x35')]:_0x3a6a7f[_0x786e('0x30')];if(_0xac447c[_0x786e('0x31')][_0x786e('0x40')]){_0xdd64f9[_0x786e('0x41')]=[{'all':!![]}];}_0xdd64f9=_[_0x786e('0x3e')]({},_0xdd64f9,_0xac447c['options']);return db[_0x786e('0x2c')][_0x786e('0x46')](_0xdd64f9)[_0x786e('0x26')](handleEntityNotFound(_0x237779,null))[_0x786e('0x26')](respondWithResult(_0x237779,null))[_0x786e('0x44')](handleError(_0x237779,null));};exports[_0x786e('0x47')]=function(_0x2365fa,_0x50c0db){return db[_0x786e('0x2c')]['create'](_0x2365fa[_0x786e('0x48')],{})[_0x786e('0x26')](respondWithResult(_0x50c0db,0xc9))[_0x786e('0x44')](handleError(_0x50c0db,null));};exports[_0x786e('0x25')]=function(_0x180f05,_0x7aacfd){if(_0x180f05['body']['id']){delete _0x180f05[_0x786e('0x48')]['id'];}return db[_0x786e('0x2c')][_0x786e('0x46')]({'where':{'id':_0x180f05[_0x786e('0x49')]['id']}})[_0x786e('0x26')](handleEntityNotFound(_0x7aacfd,null))['then'](saveUpdates(_0x180f05[_0x786e('0x48')],null))[_0x786e('0x26')](respondWithResult(_0x7aacfd,null))[_0x786e('0x44')](handleError(_0x7aacfd,null));};exports[_0x786e('0x27')]=function(_0x4e8c1d,_0x409cfa){return db[_0x786e('0x2c')][_0x786e('0x46')]({'where':{'id':_0x4e8c1d[_0x786e('0x49')]['id']}})[_0x786e('0x26')](handleEntityNotFound(_0x409cfa,null))[_0x786e('0x26')](removeEntity(_0x409cfa,null))[_0x786e('0x44')](handleError(_0x409cfa,null));};exports[_0x786e('0x4a')]=function(_0x506d40,_0x3c05e8){return db['ChatGroup'][_0x786e('0x4a')]()[_0x786e('0x26')](respondWithResult(_0x3c05e8,null))[_0x786e('0x44')](handleError(_0x3c05e8,null));};exports[_0x786e('0x4b')]=function(_0x2f44a5,_0x2b3615,_0x4d3ac1){return db[_0x786e('0x4c')][_0x786e('0x21')]({'where':{'ChatGroupId':_0x2f44a5[_0x786e('0x49')]['id'],'ToId':_0x2f44a5[_0x786e('0x4d')]['id'],'read':![]}})[_0x786e('0x26')](function(_0x22f0b8){return{'id':_['toInteger'](_0x2f44a5[_0x786e('0x49')]['id']),'count':_0x22f0b8};})[_0x786e('0x26')](respondWithResult(_0x2b3615,null))['catch'](handleError(_0x2b3615,null));};exports[_0x786e('0x4e')]=function(_0x13fcf1,_0x4a5c7f,_0xda463d){return db[_0x786e('0x2c')][_0x786e('0x46')]({'where':{'id':_0x13fcf1[_0x786e('0x49')]['id']}})[_0x786e('0x26')](handleEntityNotFound(_0x4a5c7f,null))['then'](function(_0x2ef359){if(_0x2ef359){return _0x2ef359[_0x786e('0x4e')](_0x13fcf1[_0x786e('0x48')][_0x786e('0x4f')],_[_0x786e('0x50')](_0x13fcf1[_0x786e('0x48')],['ids','id'])||{});}})[_0x786e('0x26')](respondWithResult(_0x4a5c7f,null))[_0x786e('0x44')](handleError(_0x4a5c7f,null));};exports[_0x786e('0x51')]=function(_0x3d03af,_0x1c0f55,_0x5318c9){var _0x363c64={};var _0xb9e222={};var _0x334aed;var _0x3843f3;return db[_0x786e('0x2c')][_0x786e('0x52')]({'where':{'id':_0x3d03af[_0x786e('0x49')]['id']}})[_0x786e('0x26')](handleEntityNotFound(_0x1c0f55,null))[_0x786e('0x26')](function(_0x170e70){if(_0x170e70){_0x334aed=_0x170e70;_0xb9e222[_0x786e('0x30')]=_['keys'](db[_0x786e('0x53')][_0x786e('0x45')]);_0xb9e222[_0x786e('0x31')]=_[_0x786e('0x32')](_0x3d03af['query']);_0xb9e222[_0x786e('0x33')]=_['intersection'](_0xb9e222[_0x786e('0x30')],_0xb9e222[_0x786e('0x31')]);_0x363c64[_0x786e('0x35')]=_[_0x786e('0x34')](_0xb9e222[_0x786e('0x30')],qs[_0x786e('0x36')](_0x3d03af[_0x786e('0x31')][_0x786e('0x36')]));_0x363c64['attributes']=_0x363c64[_0x786e('0x35')][_0x786e('0x37')]?_0x363c64[_0x786e('0x35')]:_0xb9e222[_0x786e('0x30')];_0x363c64[_0x786e('0x39')]=qs[_0x786e('0x3a')](_0x3d03af[_0x786e('0x31')]['sort']);_0x363c64[_0x786e('0x3b')]=qs[_0x786e('0x33')](_[_0x786e('0x3c')](_0x3d03af[_0x786e('0x31')],_0xb9e222[_0x786e('0x33')]));if(_0x3d03af[_0x786e('0x31')][_0x786e('0x3d')]){_0x363c64[_0x786e('0x3b')]=_['merge'](_0x363c64['where'],{'$or':_[_0x786e('0x2b')](_0x363c64['attributes'],function(_0x1034ad){var _0x1ed194={};_0x1ed194[_0x1034ad]={'$like':'%'+_0x3d03af[_0x786e('0x31')][_0x786e('0x3d')]+'%'};return _0x1ed194;})});}_0x363c64=_[_0x786e('0x3e')]({},_0x363c64,_0x3d03af[_0x786e('0x3f')]);return _0x334aed[_0x786e('0x51')](_0x363c64);}})[_0x786e('0x26')](function(_0x267c57){if(_0x267c57){_0x3843f3=_0x267c57[_0x786e('0x37')];if(!_0x3d03af['query'][_0x786e('0x38')]('nolimit')){_0x363c64['limit']=qs[_0x786e('0x20')](_0x3d03af[_0x786e('0x31')][_0x786e('0x20')]);_0x363c64[_0x786e('0x1e')]=qs[_0x786e('0x1e')](_0x3d03af[_0x786e('0x31')]['offset']);}return _0x334aed[_0x786e('0x51')](_0x363c64);}})[_0x786e('0x26')](function(_0x23611b){if(_0x23611b){return _0x23611b?{'count':_0x3843f3,'rows':_0x23611b}:null;}})[_0x786e('0x26')](respondWithResult(_0x1c0f55,null))['catch'](handleError(_0x1c0f55,null));};exports[_0x786e('0x54')]=function(_0x26bb1d,_0x290349,_0x4ccfc2){return db[_0x786e('0x2c')][_0x786e('0x46')]({'where':{'id':_0x26bb1d[_0x786e('0x49')]['id']}})['then'](handleEntityNotFound(_0x290349,null))[_0x786e('0x26')](function(_0xe0c213){if(_0xe0c213){return _0xe0c213[_0x786e('0x54')](_0x26bb1d[_0x786e('0x31')][_0x786e('0x4f')]);}})[_0x786e('0x26')](respondWithStatusCode(_0x290349,null))[_0x786e('0x44')](handleError(_0x290349,null));};exports[_0x786e('0x55')]=function(_0x42a190,_0x5767ae,_0x4e5c11){if(_0x42a190[_0x786e('0x48')]['id']){delete _0x42a190['body']['id'];}return db[_0x786e('0x2c')][_0x786e('0x46')]({'where':{'id':_0x42a190[_0x786e('0x49')]['id']}})[_0x786e('0x26')](handleEntityNotFound(_0x5767ae,null))[_0x786e('0x26')](function(_0x5010fb){if(_0x5010fb){_0x42a190[_0x786e('0x48')][_0x786e('0x56')]=_0x5010fb['id'];return db[_0x786e('0x4c')][_0x786e('0x47')](_0x42a190['body']);}})[_0x786e('0x26')](respondWithResult(_0x5767ae,null))[_0x786e('0x44')](handleError(_0x5767ae,null));};exports[_0x786e('0x57')]=function(_0x18e27a,_0x4a2b8e,_0xf78707){var _0x3c6a04={};var _0x260e31={};var _0x27953d;var _0x40331d;return db['ChatGroup'][_0x786e('0x52')]({'where':{'id':_0x18e27a[_0x786e('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a2b8e,null))[_0x786e('0x26')](function(_0xb9d1bb){if(_0xb9d1bb){_0x27953d=_0xb9d1bb;_0x260e31[_0x786e('0x30')]=_['keys'](db[_0x786e('0x4c')]['rawAttributes']);_0x260e31[_0x786e('0x31')]=_[_0x786e('0x32')](_0x18e27a[_0x786e('0x31')]);_0x260e31['filters']=_['intersection'](_0x260e31[_0x786e('0x30')],_0x260e31[_0x786e('0x31')]);_0x3c6a04['attributes']=_[_0x786e('0x34')](_0x260e31['model'],qs[_0x786e('0x36')](_0x18e27a['query'][_0x786e('0x36')]));_0x3c6a04['attributes']=_0x3c6a04[_0x786e('0x35')][_0x786e('0x37')]?_0x3c6a04[_0x786e('0x35')]:_0x260e31['model'];_0x3c6a04['order']=qs[_0x786e('0x3a')](_0x18e27a[_0x786e('0x31')]['sort']);_0x3c6a04[_0x786e('0x3b')]=qs[_0x786e('0x33')](_[_0x786e('0x3c')](_0x18e27a[_0x786e('0x31')],_0x260e31['filters']));if(_0x18e27a[_0x786e('0x31')][_0x786e('0x3d')]){_0x3c6a04[_0x786e('0x3b')]=_[_0x786e('0x3e')](_0x3c6a04[_0x786e('0x3b')],{'$or':_[_0x786e('0x2b')](_0x3c6a04[_0x786e('0x35')],function(_0x21c21f){var _0x31e766={};_0x31e766[_0x21c21f]={'$like':'%'+_0x18e27a[_0x786e('0x31')]['filter']+'%'};return _0x31e766;})});}if(_0x18e27a[_0x786e('0x31')][_0x786e('0x58')]){var _0x3dc940=_0x18e27a['query'][_0x786e('0x58')][_0x786e('0x59')](',');var _0x265510={};_0x265510[_0x3dc940[0x0]]={'$gte':moment(_0x3dc940[0x1])[_0x786e('0x5a')](_0x786e('0x5b'))};_0x3c6a04['where']=_['merge'](_0x3c6a04[_0x786e('0x3b')],_0x265510);}_0x3c6a04=_[_0x786e('0x3e')]({},_0x3c6a04,_0x18e27a[_0x786e('0x3f')]);return _0x27953d[_0x786e('0x57')](_0x3c6a04);}})[_0x786e('0x26')](function(_0x20c602){if(_0x20c602){_0x40331d=_0x20c602['length'];if(!_0x18e27a[_0x786e('0x31')][_0x786e('0x38')](_0x786e('0x5c'))){_0x3c6a04[_0x786e('0x20')]=qs[_0x786e('0x20')](_0x18e27a[_0x786e('0x31')]['limit']);_0x3c6a04[_0x786e('0x1e')]=qs[_0x786e('0x1e')](_0x18e27a[_0x786e('0x31')][_0x786e('0x1e')]);}return _0x27953d[_0x786e('0x57')](_0x3c6a04);}})['then'](function(_0x290c89){if(_0x290c89){return _0x290c89?{'count':_0x40331d,'rows':_0x290c89}:null;}})[_0x786e('0x26')](respondWithResult(_0x4a2b8e,null))[_0x786e('0x44')](handleError(_0x4a2b8e,null));};
\ No newline at end of file
+var _0x2f69=['ids','getMembers','User','removeMembers','addMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','describe','ChatInternalMessage','addMembers','omit'];(function(_0x4b84df,_0x347dad){var _0x4ffcd5=function(_0x20ddab){while(--_0x20ddab){_0x4b84df['push'](_0x4b84df['shift']());}};_0x4ffcd5(++_0x347dad);}(_0x2f69,0x12e));var _0x92f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f69[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x92f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x92f6('0x1'));var jsonpatch=require(_0x92f6('0x2'));var rp=require('request-promise');var moment=require(_0x92f6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x92f6('0x4'));var util=require(_0x92f6('0x5'));var path=require(_0x92f6('0x6'));var sox=require(_0x92f6('0x7'));var csv=require(_0x92f6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x92f6('0x9'));var _=require(_0x92f6('0xa'));var squel=require(_0x92f6('0xb'));var crypto=require(_0x92f6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x92f6('0xd'));var toCsv=require(_0x92f6('0x8'));var querystring=require(_0x92f6('0xe'));var Papa=require(_0x92f6('0xf'));var Redis=require(_0x92f6('0x10'));var authService=require(_0x92f6('0x11'));var qs=require(_0x92f6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92f6('0x13'));var logger=require(_0x92f6('0x14'))(_0x92f6('0x15'));var utils=require(_0x92f6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x92f6('0x17'));var db=require(_0x92f6('0x18'))['db'];config[_0x92f6('0x19')]=_['defaults'](config[_0x92f6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x92f6('0x1a'))(new Redis(config[_0x92f6('0x19')]));require(_0x92f6('0x1b'))[_0x92f6('0x1c')](socket);function respondWithStatusCode(_0x29225a,_0x1ddee1){_0x1ddee1=_0x1ddee1||0xcc;return function(_0x1c05ca){if(_0x1c05ca){return _0x29225a[_0x92f6('0x1d')](_0x1ddee1);}return _0x29225a[_0x92f6('0x1e')](_0x1ddee1)[_0x92f6('0x1f')]();};}function respondWithResult(_0x41ae14,_0x3aebf2){_0x3aebf2=_0x3aebf2||0xc8;return function(_0x502051){if(_0x502051){return _0x41ae14['status'](_0x3aebf2)['json'](_0x502051);}};}function respondWithFilteredResult(_0x328b43,_0x3d207a){return function(_0x3e4029){if(_0x3e4029){var _0x14d287=typeof _0x3d207a[_0x92f6('0x20')]===_0x92f6('0x21')&&typeof _0x3d207a[_0x92f6('0x22')]===_0x92f6('0x21');var _0x1d5993=_0x3e4029[_0x92f6('0x23')];var _0x1ab723=_0x14d287?0x0:_0x3d207a['offset'];var _0x4718fa=_0x14d287?_0x3e4029[_0x92f6('0x23')]:_0x3d207a[_0x92f6('0x20')]+_0x3d207a[_0x92f6('0x22')];var _0xac1ed1;if(_0x4718fa>=_0x1d5993){_0x4718fa=_0x1d5993;_0xac1ed1=0xc8;}else{_0xac1ed1=0xce;}_0x328b43[_0x92f6('0x1e')](_0xac1ed1);return _0x328b43[_0x92f6('0x24')](_0x92f6('0x25'),_0x1ab723+'-'+_0x4718fa+'/'+_0x1d5993)[_0x92f6('0x26')](_0x3e4029);}return null;};}function patchUpdates(_0xe7fbbc){return function(_0x8f8d8b){try{jsonpatch[_0x92f6('0x27')](_0x8f8d8b,_0xe7fbbc,!![]);}catch(_0x37dd44){return BPromise['reject'](_0x37dd44);}return _0x8f8d8b['save']();};}function saveUpdates(_0x131489,_0x58f514){return function(_0x336c22){if(_0x336c22){return _0x336c22[_0x92f6('0x28')](_0x131489)[_0x92f6('0x29')](function(_0x29b117){return _0x29b117;});}return null;};}function removeEntity(_0x1a3130,_0x547f7f){return function(_0x2047a6){if(_0x2047a6){return _0x2047a6[_0x92f6('0x2a')]()[_0x92f6('0x29')](function(){_0x1a3130[_0x92f6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42fdd1,_0x583a71){return function(_0x2f63aa){if(!_0x2f63aa){_0x42fdd1['sendStatus'](0x194);}return _0x2f63aa;};}function handleError(_0x4e8fa2,_0x2008db){_0x2008db=_0x2008db||0x1f4;return function(_0x4f174e){logger[_0x92f6('0x2b')](_0x4f174e[_0x92f6('0x2c')]);if(_0x4f174e[_0x92f6('0x2d')]){delete _0x4f174e['name'];}_0x4e8fa2[_0x92f6('0x1e')](_0x2008db)[_0x92f6('0x2e')](_0x4f174e);};}exports[_0x92f6('0x2f')]=function(_0x1e953b,_0x228ef7){var _0x2652d5={},_0x1fdf80={},_0x5f30e8={'count':0x0,'rows':[]};var _0x18c1ff=_[_0x92f6('0x30')](db[_0x92f6('0x31')]['rawAttributes'],function(_0x39c054){return{'name':_0x39c054[_0x92f6('0x32')],'type':_0x39c054[_0x92f6('0x33')][_0x92f6('0x34')]};});_0x1fdf80[_0x92f6('0x35')]=_['map'](_0x18c1ff,_0x92f6('0x2d'));_0x1fdf80[_0x92f6('0x36')]=_[_0x92f6('0x37')](_0x1e953b[_0x92f6('0x36')]);_0x1fdf80[_0x92f6('0x38')]=_[_0x92f6('0x39')](_0x1fdf80[_0x92f6('0x35')],_0x1fdf80['query']);_0x2652d5['attributes']=_[_0x92f6('0x39')](_0x1fdf80[_0x92f6('0x35')],qs['fields'](_0x1e953b['query']['fields']));_0x2652d5[_0x92f6('0x3a')]=_0x2652d5[_0x92f6('0x3a')][_0x92f6('0x3b')]?_0x2652d5[_0x92f6('0x3a')]:_0x1fdf80['model'];if(!_0x1e953b[_0x92f6('0x36')][_0x92f6('0x3c')](_0x92f6('0x3d'))){_0x2652d5[_0x92f6('0x22')]=qs['limit'](_0x1e953b[_0x92f6('0x36')][_0x92f6('0x22')]);_0x2652d5[_0x92f6('0x20')]=qs['offset'](_0x1e953b['query']['offset']);}_0x2652d5[_0x92f6('0x3e')]=qs[_0x92f6('0x3f')](_0x1e953b[_0x92f6('0x36')]['sort']);_0x2652d5[_0x92f6('0x40')]=qs['filters'](_[_0x92f6('0x41')](_0x1e953b[_0x92f6('0x36')],_0x1fdf80['filters']),_0x18c1ff);if(_0x1e953b[_0x92f6('0x36')][_0x92f6('0x42')]){_0x2652d5[_0x92f6('0x40')]=_[_0x92f6('0x43')](_0x2652d5[_0x92f6('0x40')],{'$or':_[_0x92f6('0x30')](_0x18c1ff,function(_0xe417f3){if(_0xe417f3['type']!==_0x92f6('0x44')){var _0x59d319={};_0x59d319[_0xe417f3[_0x92f6('0x2d')]]={'$like':'%'+_0x1e953b[_0x92f6('0x36')]['filter']+'%'};return _0x59d319;}})});}_0x2652d5=_['merge']({},_0x2652d5,_0x1e953b[_0x92f6('0x45')]);var _0x2325fc={'where':_0x2652d5[_0x92f6('0x40')]};return db[_0x92f6('0x31')]['count'](_0x2325fc)[_0x92f6('0x29')](function(_0xa11f60){_0x5f30e8[_0x92f6('0x23')]=_0xa11f60;if(_0x1e953b[_0x92f6('0x36')][_0x92f6('0x46')]){_0x2652d5[_0x92f6('0x47')]=[{'all':!![]}];}return db[_0x92f6('0x31')][_0x92f6('0x48')](_0x2652d5);})['then'](function(_0x3d99c5){_0x5f30e8[_0x92f6('0x49')]=_0x3d99c5;return _0x5f30e8;})[_0x92f6('0x29')](respondWithFilteredResult(_0x228ef7,_0x2652d5))[_0x92f6('0x4a')](handleError(_0x228ef7,null));};exports[_0x92f6('0x4b')]=function(_0x405df9,_0x5f5334){var _0x48aee0={'raw':!![],'where':{'id':_0x405df9[_0x92f6('0x4c')]['id']}},_0x345e27={};_0x345e27['model']=_[_0x92f6('0x37')](db['ChatGroup'][_0x92f6('0x4d')]);_0x345e27[_0x92f6('0x36')]=_['keys'](_0x405df9[_0x92f6('0x36')]);_0x345e27['filters']=_[_0x92f6('0x39')](_0x345e27['model'],_0x345e27[_0x92f6('0x36')]);_0x48aee0[_0x92f6('0x3a')]=_['intersection'](_0x345e27['model'],qs[_0x92f6('0x4e')](_0x405df9['query'][_0x92f6('0x4e')]));_0x48aee0[_0x92f6('0x3a')]=_0x48aee0[_0x92f6('0x3a')][_0x92f6('0x3b')]?_0x48aee0[_0x92f6('0x3a')]:_0x345e27[_0x92f6('0x35')];if(_0x405df9[_0x92f6('0x36')][_0x92f6('0x46')]){_0x48aee0[_0x92f6('0x47')]=[{'all':!![]}];}_0x48aee0=_[_0x92f6('0x43')]({},_0x48aee0,_0x405df9['options']);return db[_0x92f6('0x31')][_0x92f6('0x4f')](_0x48aee0)['then'](handleEntityNotFound(_0x5f5334,null))[_0x92f6('0x29')](respondWithResult(_0x5f5334,null))[_0x92f6('0x4a')](handleError(_0x5f5334,null));};exports[_0x92f6('0x50')]=function(_0x3056fa,_0x5dc85c){return db['ChatGroup']['create'](_0x3056fa[_0x92f6('0x51')],{})[_0x92f6('0x29')](respondWithResult(_0x5dc85c,0xc9))[_0x92f6('0x4a')](handleError(_0x5dc85c,null));};exports[_0x92f6('0x28')]=function(_0x15706b,_0x1fca15){if(_0x15706b[_0x92f6('0x51')]['id']){delete _0x15706b['body']['id'];}return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x15706b[_0x92f6('0x4c')]['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0x1fca15,null))[_0x92f6('0x29')](saveUpdates(_0x15706b['body'],null))[_0x92f6('0x29')](respondWithResult(_0x1fca15,null))[_0x92f6('0x4a')](handleError(_0x1fca15,null));};exports[_0x92f6('0x2a')]=function(_0x179d2e,_0x3d50d7){return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x179d2e['params']['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0x3d50d7,null))[_0x92f6('0x29')](removeEntity(_0x3d50d7,null))['catch'](handleError(_0x3d50d7,null));};exports[_0x92f6('0x52')]=function(_0x330964,_0x42ca91){return db[_0x92f6('0x31')][_0x92f6('0x52')]()[_0x92f6('0x29')](respondWithResult(_0x42ca91,null))[_0x92f6('0x4a')](handleError(_0x42ca91,null));};exports['getUnread']=function(_0x12d33d,_0x220c19,_0xbb0267){return db[_0x92f6('0x53')][_0x92f6('0x23')]({'where':{'ChatGroupId':_0x12d33d[_0x92f6('0x4c')]['id'],'ToId':_0x12d33d['user']['id'],'read':![]}})[_0x92f6('0x29')](function(_0x43e1a0){return{'id':_['toInteger'](_0x12d33d[_0x92f6('0x4c')]['id']),'count':_0x43e1a0};})[_0x92f6('0x29')](respondWithResult(_0x220c19,null))[_0x92f6('0x4a')](handleError(_0x220c19,null));};exports[_0x92f6('0x54')]=function(_0x2dedb5,_0x3a9492,_0x460650){return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x2dedb5[_0x92f6('0x4c')]['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0x3a9492,null))['then'](function(_0x53b46f){if(_0x53b46f){return _0x53b46f[_0x92f6('0x54')](_0x2dedb5[_0x92f6('0x51')]['ids'],_[_0x92f6('0x55')](_0x2dedb5[_0x92f6('0x51')],[_0x92f6('0x56'),'id'])||{});}})[_0x92f6('0x29')](respondWithResult(_0x3a9492,null))[_0x92f6('0x4a')](handleError(_0x3a9492,null));};exports[_0x92f6('0x57')]=function(_0x2be1d4,_0x5880cc,_0x4fc6b3){var _0x5b03d3={};var _0x2d7168={};var _0x5ecbd0;var _0x12ffb3;return db['ChatGroup']['findOne']({'where':{'id':_0x2be1d4['params']['id']}})['then'](handleEntityNotFound(_0x5880cc,null))[_0x92f6('0x29')](function(_0x213701){if(_0x213701){_0x5ecbd0=_0x213701;_0x2d7168[_0x92f6('0x35')]=_['keys'](db[_0x92f6('0x58')]['rawAttributes']);_0x2d7168['query']=_[_0x92f6('0x37')](_0x2be1d4[_0x92f6('0x36')]);_0x2d7168['filters']=_['intersection'](_0x2d7168[_0x92f6('0x35')],_0x2d7168['query']);_0x5b03d3[_0x92f6('0x3a')]=_['intersection'](_0x2d7168[_0x92f6('0x35')],qs[_0x92f6('0x4e')](_0x2be1d4['query'][_0x92f6('0x4e')]));_0x5b03d3[_0x92f6('0x3a')]=_0x5b03d3[_0x92f6('0x3a')][_0x92f6('0x3b')]?_0x5b03d3['attributes']:_0x2d7168[_0x92f6('0x35')];_0x5b03d3[_0x92f6('0x3e')]=qs[_0x92f6('0x3f')](_0x2be1d4[_0x92f6('0x36')][_0x92f6('0x3f')]);_0x5b03d3[_0x92f6('0x40')]=qs[_0x92f6('0x38')](_[_0x92f6('0x41')](_0x2be1d4[_0x92f6('0x36')],_0x2d7168[_0x92f6('0x38')]));if(_0x2be1d4[_0x92f6('0x36')]['filter']){_0x5b03d3[_0x92f6('0x40')]=_[_0x92f6('0x43')](_0x5b03d3['where'],{'$or':_[_0x92f6('0x30')](_0x5b03d3[_0x92f6('0x3a')],function(_0xdb8030){var _0x5e8e90={};_0x5e8e90[_0xdb8030]={'$like':'%'+_0x2be1d4['query']['filter']+'%'};return _0x5e8e90;})});}_0x5b03d3=_[_0x92f6('0x43')]({},_0x5b03d3,_0x2be1d4[_0x92f6('0x45')]);return _0x5ecbd0[_0x92f6('0x57')](_0x5b03d3);}})['then'](function(_0x51ad99){if(_0x51ad99){_0x12ffb3=_0x51ad99[_0x92f6('0x3b')];if(!_0x2be1d4['query'][_0x92f6('0x3c')](_0x92f6('0x3d'))){_0x5b03d3['limit']=qs[_0x92f6('0x22')](_0x2be1d4[_0x92f6('0x36')]['limit']);_0x5b03d3[_0x92f6('0x20')]=qs[_0x92f6('0x20')](_0x2be1d4[_0x92f6('0x36')][_0x92f6('0x20')]);}return _0x5ecbd0[_0x92f6('0x57')](_0x5b03d3);}})['then'](function(_0x5ee27c){if(_0x5ee27c){return _0x5ee27c?{'count':_0x12ffb3,'rows':_0x5ee27c}:null;}})[_0x92f6('0x29')](respondWithResult(_0x5880cc,null))[_0x92f6('0x4a')](handleError(_0x5880cc,null));};exports[_0x92f6('0x59')]=function(_0x1a5232,_0x974605,_0x584e36){return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x1a5232[_0x92f6('0x4c')]['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0x974605,null))[_0x92f6('0x29')](function(_0x3b1119){if(_0x3b1119){return _0x3b1119[_0x92f6('0x59')](_0x1a5232[_0x92f6('0x36')][_0x92f6('0x56')]);}})['then'](respondWithStatusCode(_0x974605,null))[_0x92f6('0x4a')](handleError(_0x974605,null));};exports[_0x92f6('0x5a')]=function(_0x480b8b,_0xa611b0,_0x59d581){if(_0x480b8b['body']['id']){delete _0x480b8b[_0x92f6('0x51')]['id'];}return db[_0x92f6('0x31')][_0x92f6('0x4f')]({'where':{'id':_0x480b8b['params']['id']}})[_0x92f6('0x29')](handleEntityNotFound(_0xa611b0,null))[_0x92f6('0x29')](function(_0x5b5f53){if(_0x5b5f53){_0x480b8b[_0x92f6('0x51')]['ChatGroupId']=_0x5b5f53['id'];return db[_0x92f6('0x53')][_0x92f6('0x50')](_0x480b8b[_0x92f6('0x51')]);}})[_0x92f6('0x29')](respondWithResult(_0xa611b0,null))[_0x92f6('0x4a')](handleError(_0xa611b0,null));};exports[_0x92f6('0x5b')]=function(_0xd43cfa,_0x3782ed,_0x29605f){var _0xb7ec90={};var _0x37eca3={};var _0x42d19c;var _0x604835;return db[_0x92f6('0x31')][_0x92f6('0x5c')]({'where':{'id':_0xd43cfa[_0x92f6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3782ed,null))['then'](function(_0x510bc0){if(_0x510bc0){_0x42d19c=_0x510bc0;_0x37eca3[_0x92f6('0x35')]=_[_0x92f6('0x37')](db[_0x92f6('0x53')][_0x92f6('0x4d')]);_0x37eca3[_0x92f6('0x36')]=_['keys'](_0xd43cfa[_0x92f6('0x36')]);_0x37eca3[_0x92f6('0x38')]=_['intersection'](_0x37eca3['model'],_0x37eca3['query']);_0xb7ec90[_0x92f6('0x3a')]=_[_0x92f6('0x39')](_0x37eca3[_0x92f6('0x35')],qs['fields'](_0xd43cfa[_0x92f6('0x36')][_0x92f6('0x4e')]));_0xb7ec90[_0x92f6('0x3a')]=_0xb7ec90[_0x92f6('0x3a')][_0x92f6('0x3b')]?_0xb7ec90[_0x92f6('0x3a')]:_0x37eca3[_0x92f6('0x35')];_0xb7ec90[_0x92f6('0x3e')]=qs[_0x92f6('0x3f')](_0xd43cfa[_0x92f6('0x36')]['sort']);_0xb7ec90[_0x92f6('0x40')]=qs[_0x92f6('0x38')](_[_0x92f6('0x41')](_0xd43cfa[_0x92f6('0x36')],_0x37eca3[_0x92f6('0x38')]));if(_0xd43cfa['query'][_0x92f6('0x42')]){_0xb7ec90[_0x92f6('0x40')]=_['merge'](_0xb7ec90[_0x92f6('0x40')],{'$or':_[_0x92f6('0x30')](_0xb7ec90[_0x92f6('0x3a')],function(_0x51e91d){var _0x26629b={};_0x26629b[_0x51e91d]={'$like':'%'+_0xd43cfa[_0x92f6('0x36')][_0x92f6('0x42')]+'%'};return _0x26629b;})});}if(_0xd43cfa[_0x92f6('0x36')][_0x92f6('0x5d')]){var _0x1b22ac=_0xd43cfa['query'][_0x92f6('0x5d')][_0x92f6('0x5e')](',');var _0x57f0b9={};_0x57f0b9[_0x1b22ac[0x0]]={'$gte':moment(_0x1b22ac[0x1])[_0x92f6('0x5f')](_0x92f6('0x60'))};_0xb7ec90[_0x92f6('0x40')]=_['merge'](_0xb7ec90['where'],_0x57f0b9);}_0xb7ec90=_['merge']({},_0xb7ec90,_0xd43cfa[_0x92f6('0x45')]);return _0x42d19c[_0x92f6('0x5b')](_0xb7ec90);}})[_0x92f6('0x29')](function(_0x48f867){if(_0x48f867){_0x604835=_0x48f867[_0x92f6('0x3b')];if(!_0xd43cfa['query'][_0x92f6('0x3c')](_0x92f6('0x3d'))){_0xb7ec90[_0x92f6('0x22')]=qs[_0x92f6('0x22')](_0xd43cfa[_0x92f6('0x36')]['limit']);_0xb7ec90[_0x92f6('0x20')]=qs[_0x92f6('0x20')](_0xd43cfa[_0x92f6('0x36')][_0x92f6('0x20')]);}return _0x42d19c[_0x92f6('0x5b')](_0xb7ec90);}})[_0x92f6('0x29')](function(_0x3e89c4){if(_0x3e89c4){return _0x3e89c4?{'count':_0x604835,'rows':_0x3e89c4}:null;}})[_0x92f6('0x29')](respondWithResult(_0x3782ed,null))[_0x92f6('0x4a')](handleError(_0x3782ed,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index a2d174f..c2c7488 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 _0x0137=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0x0137,0x1d8));var _0x7013=function(_0x438e07,_0x590a1b){_0x438e07=_0x438e07-0x0;var _0x28f1a4=_0x0137[_0x438e07];return _0x28f1a4;};'use strict';var EventEmitter=require(_0x7013('0x0'));var ChatGroup=require(_0x7013('0x1'))['db'][_0x7013('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7013('0x3')](0x0);var events={'afterCreate':_0x7013('0x4'),'afterUpdate':'update','afterDestroy':_0x7013('0x5')};function emitEvent(_0x23a553){return function(_0x1d35c3,_0x72e6a9,_0x17462b){ChatGroupEvents[_0x7013('0x6')](_0x23a553+':'+_0x1d35c3['id'],_0x1d35c3);ChatGroupEvents['emit'](_0x23a553,_0x1d35c3);_0x17462b(null);};}for(var e in events){if(events[_0x7013('0x7')](e)){var event=events[e];ChatGroup[_0x7013('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x649e=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hook'];(function(_0xbc902c,_0x1af01b){var _0x5e71e8=function(_0xfdf65b){while(--_0xfdf65b){_0xbc902c['push'](_0xbc902c['shift']());}};_0x5e71e8(++_0x1af01b);}(_0x649e,0xdd));var _0xe649=function(_0x7dec21,_0x84f83c){_0x7dec21=_0x7dec21-0x0;var _0x1b4761=_0x649e[_0x7dec21];return _0x1b4761;};'use strict';var EventEmitter=require(_0xe649('0x0'));var ChatGroup=require(_0xe649('0x1'))['db'][_0xe649('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xe649('0x3')](0x0);var events={'afterCreate':_0xe649('0x4'),'afterUpdate':_0xe649('0x5'),'afterDestroy':_0xe649('0x6')};function emitEvent(_0x1b7d70){return function(_0x173b41,_0x4e9760,_0x371318){ChatGroupEvents[_0xe649('0x7')](_0x1b7d70+':'+_0x173b41['id'],_0x173b41);ChatGroupEvents[_0xe649('0x7')](_0x1b7d70,_0x173b41);_0x371318(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xe649('0x8')](e,emitEvent(event));}}module[_0xe649('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 4b0472e..71d507a 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 _0xe99e=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','chat_groups','lodash'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xe99e,0xd1));var _0xee99=function(_0x8a6255,_0x4f2b24){_0x8a6255=_0x8a6255-0x0;var _0x370434=_0xe99e[_0x8a6255];return _0x370434;};'use strict';var _=require(_0xee99('0x0'));var util=require(_0xee99('0x1'));var logger=require(_0xee99('0x2'))('api');var moment=require('moment');var BPromise=require(_0xee99('0x3'));var rp=require(_0xee99('0x4'));var fs=require('fs');var path=require(_0xee99('0x5'));var rimraf=require('rimraf');var config=require(_0xee99('0x6'));var attributes=require('./chatGroup.attributes');module[_0xee99('0x7')]=function(_0x16a51,_0x23f155){return _0x16a51[_0xee99('0x8')]('ChatGroup',attributes,{'tableName':_0xee99('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2f20=['define','ChatGroup','chat_groups','util','moment','bluebird','rimraf','./chatGroup.attributes'];(function(_0x49136d,_0x3f6127){var _0x40d292=function(_0x3e299c){while(--_0x3e299c){_0x49136d['push'](_0x49136d['shift']());}};_0x40d292(++_0x3f6127);}(_0x2f20,0x6b));var _0x02f2=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x2f20[_0x40a825];return _0x273a54;};'use strict';var _=require('lodash');var util=require(_0x02f2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x02f2('0x1'));var BPromise=require(_0x02f2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x02f2('0x3'));var config=require('../../config/environment');var attributes=require(_0x02f2('0x4'));module['exports']=function(_0x15707d,_0xd4325){return _0x15707d[_0x02f2('0x5')](_0x02f2('0x6'),attributes,{'tableName':_0x02f2('0x7'),'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 adbd617..d5b80bb 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 _0x938a=['jayson/promise','http','redis','socket.io-emitter','./chatGroup.socket','then','info','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','request\x20sent','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3acd23,_0x3d0861){var _0x54e7a9=function(_0xf601e5){while(--_0xf601e5){_0x3acd23['push'](_0x3acd23['shift']());}};_0x54e7a9(++_0x3d0861);}(_0x938a,0x1f2));var _0xa938=function(_0x2265ba,_0x3521bb){_0x2265ba=_0x2265ba-0x0;var _0x51e025=_0x938a[_0x2265ba];return _0x51e025;};'use strict';var _=require(_0xa938('0x0'));var util=require(_0xa938('0x1'));var moment=require(_0xa938('0x2'));var BPromise=require(_0xa938('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa938('0x4'))['db'];var utils=require(_0xa938('0x5'));var logger=require(_0xa938('0x6'))('rpc');var config=require(_0xa938('0x7'));var jayson=require(_0xa938('0x8'));var client=jayson['client'][_0xa938('0x9')]({'port':0x232a});config[_0xa938('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa938('0xb'))(new Redis(config[_0xa938('0xa')]));require(_0xa938('0xc'))['register'](socket);function respondWithRpcPromise(_0x4577fb,_0x24ac33,_0x15cef1){return new BPromise(function(_0x18ba2f,_0x110401){return client['request'](_0x4577fb,_0x15cef1)[_0xa938('0xd')](function(_0x29a19d){logger[_0xa938('0xe')]('ChatGroup,\x20%s,\x20%s',_0x24ac33,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x24ac33,'request\x20sent',JSON[_0xa938('0xf')](_0x29a19d));if(_0x29a19d[_0xa938('0x10')]){if(_0x29a19d['error'][_0xa938('0x11')]===0x1f4){logger[_0xa938('0x10')](_0xa938('0x12'),_0x24ac33,_0x29a19d['error'][_0xa938('0x13')]);return _0x110401(_0x29a19d[_0xa938('0x10')][_0xa938('0x13')]);}logger[_0xa938('0x10')](_0xa938('0x12'),_0x24ac33,_0x29a19d['error'][_0xa938('0x13')]);return _0x18ba2f(_0x29a19d[_0xa938('0x10')][_0xa938('0x13')]);}else{logger[_0xa938('0xe')]('ChatGroup,\x20%s,\x20%s',_0x24ac33,_0xa938('0x14'));_0x18ba2f(_0x29a19d['result'][_0xa938('0x13')]);}})[_0xa938('0x15')](function(_0x2972ac){logger[_0xa938('0x10')](_0xa938('0x12'),_0x24ac33,_0x2972ac);_0x110401(_0x2972ac);});});}
\ No newline at end of file
+var _0xf0db=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0xf0db,0x12b));var _0xbf0d=function(_0xcba257,_0x510ba6){_0xcba257=_0xcba257-0x0;var _0x437e65=_0xf0db[_0xcba257];return _0x437e65;};'use strict';var _=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var moment=require('moment');var BPromise=require(_0xbf0d('0x2'));var rs=require(_0xbf0d('0x3'));var fs=require('fs');var Redis=require(_0xbf0d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf0d('0x5'));var logger=require(_0xbf0d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf0d('0x7'));var client=jayson[_0xbf0d('0x8')][_0xbf0d('0x9')]({'port':0x232a});config[_0xbf0d('0xa')]=_['defaults'](config[_0xbf0d('0xa')],{'host':_0xbf0d('0xb'),'port':0x18eb});var socket=require(_0xbf0d('0xc'))(new Redis(config[_0xbf0d('0xa')]));require(_0xbf0d('0xd'))[_0xbf0d('0xe')](socket);function respondWithRpcPromise(_0x154401,_0xb7715f,_0x55cb8f){return new BPromise(function(_0x5a28a3,_0x170113){return client[_0xbf0d('0xf')](_0x154401,_0x55cb8f)[_0xbf0d('0x10')](function(_0x290a56){logger[_0xbf0d('0x11')](_0xbf0d('0x12'),_0xb7715f,_0xbf0d('0x13'));logger[_0xbf0d('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xb7715f,_0xbf0d('0x13'),JSON[_0xbf0d('0x15')](_0x290a56));if(_0x290a56['error']){if(_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x17')]===0x1f4){logger[_0xbf0d('0x16')](_0xbf0d('0x12'),_0xb7715f,_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x18')]);return _0x170113(_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x18')]);}logger[_0xbf0d('0x16')](_0xbf0d('0x12'),_0xb7715f,_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x18')]);return _0x5a28a3(_0x290a56[_0xbf0d('0x16')][_0xbf0d('0x18')]);}else{logger['info'](_0xbf0d('0x12'),_0xb7715f,_0xbf0d('0x13'));_0x5a28a3(_0x290a56[_0xbf0d('0x19')][_0xbf0d('0x18')]);}})[_0xbf0d('0x1a')](function(_0x35166e){logger[_0xbf0d('0x16')]('ChatGroup,\x20%s,\x20%s',_0xb7715f,_0x35166e);_0x170113(_0x35166e);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index dacdb25..8187890 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 _0xd137=['register','length','./chatGroup.events','save','remove','update','emit','removeListener'];(function(_0x459cfb,_0x26b8f8){var _0x182972=function(_0x31fae5){while(--_0x31fae5){_0x459cfb['push'](_0x459cfb['shift']());}};_0x182972(++_0x26b8f8);}(_0xd137,0xa2));var _0x7d13=function(_0x1ac29c,_0xc36b3f){_0x1ac29c=_0x1ac29c-0x0;var _0x3a9101=_0xd137[_0x1ac29c];return _0x3a9101;};'use strict';var ChatGroupEvents=require(_0x7d13('0x0'));var events=[_0x7d13('0x1'),_0x7d13('0x2'),_0x7d13('0x3')];function createListener(_0x3c2c48,_0x54753a){return function(_0x5a67c6){_0x54753a[_0x7d13('0x4')](_0x3c2c48,_0x5a67c6);};}function removeListener(_0x4b665e,_0xb24c77){return function(){ChatGroupEvents[_0x7d13('0x5')](_0x4b665e,_0xb24c77);};}exports[_0x7d13('0x6')]=function(_0x42c06a){for(var _0x5b0c57=0x0,_0xf5a5fd=events[_0x7d13('0x7')];_0x5b0c57<_0xf5a5fd;_0x5b0c57++){var _0x527116=events[_0x5b0c57];var _0x2ca0a5=createListener('chatGroup:'+_0x527116,_0x42c06a);ChatGroupEvents['on'](_0x527116,_0x2ca0a5);}};
\ No newline at end of file
+var _0x88c6=['chatGroup:','./chatGroup.events','save','update','emit','length'];(function(_0x23dbc3,_0x22d7ae){var _0x5cb9db=function(_0x2cddf7){while(--_0x2cddf7){_0x23dbc3['push'](_0x23dbc3['shift']());}};_0x5cb9db(++_0x22d7ae);}(_0x88c6,0x121));var _0x688c=function(_0x5d67be,_0x73cb7){_0x5d67be=_0x5d67be-0x0;var _0x4ce27a=_0x88c6[_0x5d67be];return _0x4ce27a;};'use strict';var ChatGroupEvents=require(_0x688c('0x0'));var events=[_0x688c('0x1'),'remove',_0x688c('0x2')];function createListener(_0x28e51d,_0x49dfed){return function(_0x1a0d63){_0x49dfed[_0x688c('0x3')](_0x28e51d,_0x1a0d63);};}function removeListener(_0x5b0225,_0x6b40af){return function(){ChatGroupEvents['removeListener'](_0x5b0225,_0x6b40af);};}exports['register']=function(_0x21f689){for(var _0xbb7e41=0x0,_0x3b6140=events[_0x688c('0x4')];_0xbb7e41<_0x3b6140;_0xbb7e41++){var _0x9c2932=events[_0xbb7e41];var _0x426bb8=createListener(_0x688c('0x5')+_0x9c2932,_0x21f689);ChatGroupEvents['on'](_0x9c2932,_0x426bb8);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 877cdcd..e9199ce 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 _0xc3b9=['removeMembers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','index','/describe','describe','/:id','isAuthenticated','getUnread','/:id/members','/:id/messages','post','create','addMembers','addMessage','put','update','delete','destroy'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0xc3b9,0x196));var _0x9c3b=function(_0x5bbae4,_0x2a4a4e){_0x5bbae4=_0x5bbae4-0x0;var _0x338a50=_0xc3b9[_0x5bbae4];return _0x338a50;};'use strict';var multer=require(_0x9c3b('0x0'));var util=require(_0x9c3b('0x1'));var path=require(_0x9c3b('0x2'));var timeout=require(_0x9c3b('0x3'));var express=require(_0x9c3b('0x4'));var router=express['Router']();var fs_extra=require(_0x9c3b('0x5'));var auth=require(_0x9c3b('0x6'));var interaction=require(_0x9c3b('0x7'));var config=require('../../config/environment');var controller=require(_0x9c3b('0x8'));router[_0x9c3b('0x9')]('/',auth['isAuthenticated'](),controller[_0x9c3b('0xa')]);router[_0x9c3b('0x9')](_0x9c3b('0xb'),auth['isAuthenticated'](),controller[_0x9c3b('0xc')]);router['get'](_0x9c3b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x9c3b('0x9')]('/:id/unread',auth[_0x9c3b('0xe')](),controller[_0x9c3b('0xf')]);router[_0x9c3b('0x9')](_0x9c3b('0x10'),auth[_0x9c3b('0xe')](),controller['getMembers']);router[_0x9c3b('0x9')](_0x9c3b('0x11'),auth[_0x9c3b('0xe')](),controller['getMessages']);router[_0x9c3b('0x12')]('/',auth['isAuthenticated'](),controller[_0x9c3b('0x13')]);router[_0x9c3b('0x12')](_0x9c3b('0x10'),auth[_0x9c3b('0xe')](),controller[_0x9c3b('0x14')]);router['post']('/:id/messages',auth[_0x9c3b('0xe')](),controller[_0x9c3b('0x15')]);router[_0x9c3b('0x16')]('/:id',auth[_0x9c3b('0xe')](),controller[_0x9c3b('0x17')]);router[_0x9c3b('0x18')](_0x9c3b('0xd'),auth['isAuthenticated'](),controller[_0x9c3b('0x19')]);router[_0x9c3b('0x18')](_0x9c3b('0x10'),auth[_0x9c3b('0xe')](),controller[_0x9c3b('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0xfc14=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','update','delete','removeMembers','multer'];(function(_0x1e2aae,_0x2349e3){var _0x4d8a43=function(_0x305d4c){while(--_0x305d4c){_0x1e2aae['push'](_0x1e2aae['shift']());}};_0x4d8a43(++_0x2349e3);}(_0xfc14,0x8b));var _0x4fc1=function(_0x1a59ba,_0x2b4ec3){_0x1a59ba=_0x1a59ba-0x0;var _0x3b11bb=_0xfc14[_0x1a59ba];return _0x3b11bb;};'use strict';var multer=require(_0x4fc1('0x0'));var util=require('util');var path=require(_0x4fc1('0x1'));var timeout=require(_0x4fc1('0x2'));var express=require(_0x4fc1('0x3'));var router=express[_0x4fc1('0x4')]();var fs_extra=require(_0x4fc1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4fc1('0x6'));var config=require(_0x4fc1('0x7'));var controller=require(_0x4fc1('0x8'));router[_0x4fc1('0x9')]('/',auth['isAuthenticated'](),controller[_0x4fc1('0xa')]);router[_0x4fc1('0x9')](_0x4fc1('0xb'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0xd')]);router['get'](_0x4fc1('0xe'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0xf')]);router[_0x4fc1('0x9')](_0x4fc1('0x10'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x11')]);router[_0x4fc1('0x9')](_0x4fc1('0x12'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x13')]);router[_0x4fc1('0x9')](_0x4fc1('0x14'),auth['isAuthenticated'](),controller['getMessages']);router[_0x4fc1('0x15')]('/',auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x16')]);router[_0x4fc1('0x15')](_0x4fc1('0x12'),auth['isAuthenticated'](),controller[_0x4fc1('0x17')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x4fc1('0x18')]);router['put'](_0x4fc1('0xe'),auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x19')]);router[_0x4fc1('0x1a')](_0x4fc1('0xe'),auth[_0x4fc1('0xc')](),controller['destroy']);router['delete']('/:id/members',auth[_0x4fc1('0xc')](),controller[_0x4fc1('0x1b')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 5821bff..f3e3c40 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 _0xd2bf=['sequelize','ENUM','star','TEXT','STRING','DATE','long','out','BOOLEAN'];(function(_0x9f7d7a,_0x49c32c){var _0x10a5a8=function(_0x2c33e2){while(--_0x2c33e2){_0x9f7d7a['push'](_0x9f7d7a['shift']());}};_0x10a5a8(++_0x49c32c);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0xd2bf[_0x176d14];return _0x89522c;};'use strict';var Sequelize=require(_0xfd2b('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xfd2b('0x1')](_0xfd2b('0x2'),'thumb'),'defaultValue':_0xfd2b('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xfd2b('0x3')]},'mailTranscript':{'type':Sequelize[_0xfd2b('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfd2b('0x5')]},'disposition':{'type':Sequelize[_0xfd2b('0x4')]},'secondDisposition':{'type':Sequelize[_0xfd2b('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfd2b('0x4')]},'browserName':{'type':Sequelize[_0xfd2b('0x4')]},'browserVersion':{'type':Sequelize[_0xfd2b('0x4')]},'osName':{'type':Sequelize[_0xfd2b('0x4')]},'osVersion':{'type':Sequelize[_0xfd2b('0x4')]},'deviceModel':{'type':Sequelize[_0xfd2b('0x4')]},'deviceVendor':{'type':Sequelize[_0xfd2b('0x4')]},'deviceType':{'type':Sequelize[_0xfd2b('0x4')]},'referer':{'type':Sequelize[_0xfd2b('0x3')]},'customerIp':{'type':Sequelize[_0xfd2b('0x4')]},'formData':{'type':Sequelize[_0xfd2b('0x3')](_0xfd2b('0x6'))},'read1stAt':{'type':Sequelize[_0xfd2b('0x5')]},'lastMsgAt':{'type':Sequelize[_0xfd2b('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfd2b('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfd2b('0x4')]},'customerPort':{'type':Sequelize[_0xfd2b('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xfd2b('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x05b6=['thumb','TEXT','STRING','DATE','long','out','sequelize','BOOLEAN','INTEGER','ENUM','star'];(function(_0x4bb12b,_0x5697df){var _0x2baa7c=function(_0x2e7f4e){while(--_0x2e7f4e){_0x4bb12b['push'](_0x4bb12b['shift']());}};_0x2baa7c(++_0x5697df);}(_0x05b6,0x74));var _0x605b=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0x05b6[_0x2eac4f];return _0x58f73b;};'use strict';var Sequelize=require(_0x605b('0x0'));module['exports']={'closed':{'type':Sequelize[_0x605b('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x605b('0x2')]},'ratingType':{'type':Sequelize[_0x605b('0x3')](_0x605b('0x4'),_0x605b('0x5')),'defaultValue':_0x605b('0x4')},'ratingMessage':{'type':Sequelize[_0x605b('0x6')]},'pathTranscript':{'type':Sequelize[_0x605b('0x6')]},'mailTranscript':{'type':Sequelize[_0x605b('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x605b('0x8')]},'disposition':{'type':Sequelize[_0x605b('0x7')]},'secondDisposition':{'type':Sequelize[_0x605b('0x7')]},'thirdDisposition':{'type':Sequelize[_0x605b('0x7')]},'note':{'type':Sequelize[_0x605b('0x7')]},'browserName':{'type':Sequelize[_0x605b('0x7')]},'browserVersion':{'type':Sequelize[_0x605b('0x7')]},'osName':{'type':Sequelize[_0x605b('0x7')]},'osVersion':{'type':Sequelize[_0x605b('0x7')]},'deviceModel':{'type':Sequelize[_0x605b('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x605b('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x605b('0x9'))},'read1stAt':{'type':Sequelize[_0x605b('0x8')]},'lastMsgAt':{'type':Sequelize[_0x605b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x605b('0x3')]('in',_0x605b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x605b('0x7')]},'customerPort':{'type':Sequelize[_0x605b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x605b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x605b('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 911b78e..79a3618 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 _0x9e8f=['YYYY-MM-DD\x20HH:mm:ss','options','includeAll','include','rows','secret','includeAgent','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','stack','name','send','merge','body','contact','agent','interaction','index','map','ChatInteraction','rawAttributes','fieldName','key','findAll','chat','query','show','keys','intersection','model','attributes','fields','length','create','find','params','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','CloudProvider','Smtp','SendMail','sendMail','Mail\x20Transcript','mailTranscript','ids','omit','getMessages','filters','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x9e8f,0x103));var _0xf9e8=function(_0x46bf15,_0x4813b8){_0x46bf15=_0x46bf15-0x0;var _0x367349=_0x9e8f[_0x46bf15];return _0x367349;};'use strict';var rimraf=require(_0xf9e8('0x0'));var zipdir=require(_0xf9e8('0x1'));var rp=require(_0xf9e8('0x2'));var moment=require(_0xf9e8('0x3'));var BPromise=require(_0xf9e8('0x4'));var Mustache=require(_0xf9e8('0x5'));var util=require(_0xf9e8('0x6'));var path=require('path');var ejs=require(_0xf9e8('0x7'));var fs=require('fs');var _=require(_0xf9e8('0x8'));var Redis=require(_0xf9e8('0x9'));var interaction=require(_0xf9e8('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0xf9e8('0xb'));var logger=require(_0xf9e8('0xc'))(_0xf9e8('0xd'));var config=require(_0xf9e8('0xe'));var db=require(_0xf9e8('0xf'))['db'];config[_0xf9e8('0x10')]=_[_0xf9e8('0x11')](config[_0xf9e8('0x10')],{'host':_0xf9e8('0x12'),'port':0x18eb});var socket=require(_0xf9e8('0x13'))(new Redis(config[_0xf9e8('0x10')]));require(_0xf9e8('0x14'))[_0xf9e8('0x15')](socket);var jayson=require(_0xf9e8('0x16'));var client=jayson[_0xf9e8('0x17')][_0xf9e8('0x18')]({'port':0x232b});var client9004=jayson[_0xf9e8('0x17')][_0xf9e8('0x18')]({'port':0x232c});function respondWithRpcPromise(_0xa318cb,_0x3a1adf,_0x526775,_0x5be6d7){return new BPromise(function(_0x5137fa,_0xd522be){var _0x162f2d=_0x5be6d7||client;return _0x162f2d[_0xf9e8('0x19')](_0xa318cb,_0x526775)[_0xf9e8('0x1a')](function(_0x495740){logger[_0xf9e8('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x3a1adf,_0xf9e8('0x1c'));logger[_0xf9e8('0x1d')](_0xf9e8('0x1e'),_0x3a1adf,_0xf9e8('0x1c'),JSON[_0xf9e8('0x1f')](_0x495740));if(_0x495740[_0xf9e8('0x20')]){if(_0x495740[_0xf9e8('0x20')][_0xf9e8('0x21')]===0x1f4){logger[_0xf9e8('0x20')](_0xf9e8('0x22'),_0x3a1adf,_0x495740[_0xf9e8('0x20')]['message']);return _0xd522be(_0x495740[_0xf9e8('0x20')]['message']);}logger[_0xf9e8('0x20')](_0xf9e8('0x22'),_0x3a1adf,_0x495740['error'][_0xf9e8('0x23')]);return _0x5137fa(_0x495740['error'][_0xf9e8('0x23')]);}else{logger[_0xf9e8('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x3a1adf,_0xf9e8('0x1c'));_0x5137fa(_0x495740[_0xf9e8('0x24')][_0xf9e8('0x23')]);}})[_0xf9e8('0x25')](function(_0x3aba17){logger[_0xf9e8('0x20')](_0xf9e8('0x22'),_0x3a1adf,_0x3aba17);_0xd522be(_0x3aba17);});});}function respondWithStatusCode(_0x3700ca,_0x183cc5){_0x183cc5=_0x183cc5||0xcc;return function(_0x8c6e1){if(_0x8c6e1){return _0x3700ca[_0xf9e8('0x26')](_0x183cc5);}return _0x3700ca[_0xf9e8('0x27')](_0x183cc5)[_0xf9e8('0x28')]();};}function respondWithResult(_0x509fea,_0x51d111){_0x51d111=_0x51d111||0xc8;return function(_0xf75e94){if(_0xf75e94){return _0x509fea[_0xf9e8('0x27')](_0x51d111)[_0xf9e8('0x29')](_0xf75e94);}};}function respondWithFilteredResult(_0x5b117e,_0x390800){return function(_0x4cb2fc){if(_0x4cb2fc){var _0x47d36f=typeof _0x390800[_0xf9e8('0x2a')]===_0xf9e8('0x2b')&&typeof _0x390800[_0xf9e8('0x2c')]===_0xf9e8('0x2b');var _0x391d49=_0x4cb2fc[_0xf9e8('0x2d')];var _0x4c2026=_0x47d36f?0x0:_0x390800[_0xf9e8('0x2a')];var _0x46e3a1=_0x47d36f?_0x4cb2fc[_0xf9e8('0x2d')]:_0x390800[_0xf9e8('0x2a')]+_0x390800[_0xf9e8('0x2c')];var _0x24ccbb;if(_0x46e3a1>=_0x391d49){_0x46e3a1=_0x391d49;_0x24ccbb=0xc8;}else{_0x24ccbb=0xce;}_0x5b117e[_0xf9e8('0x27')](_0x24ccbb);return _0x5b117e['set'](_0xf9e8('0x2e'),_0x4c2026+'-'+_0x46e3a1+'/'+_0x391d49)[_0xf9e8('0x29')](_0x4cb2fc);}return null;};}function saveUpdates(_0x250bc3){return function(_0x605a37){if(_0x605a37){return _0x605a37[_0xf9e8('0x2f')](_0x250bc3)[_0xf9e8('0x1a')](function(_0x4fa590){return _0x4fa590;});}return null;};}function removeEntity(_0x362ed2){return function(_0x384697){if(_0x384697){return _0x384697[_0xf9e8('0x30')]()[_0xf9e8('0x1a')](function(){_0x362ed2[_0xf9e8('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23fa6d){return function(_0x2e6140){if(!_0x2e6140){_0x23fa6d[_0xf9e8('0x26')](0x194);}return _0x2e6140;};}function handleError(_0x158059,_0x4f2a1d){_0x4f2a1d=_0x4f2a1d||0x1f4;return function(_0x655206){logger[_0xf9e8('0x20')](_0x655206[_0xf9e8('0x31')]);if(_0x655206[_0xf9e8('0x32')]){delete _0x655206[_0xf9e8('0x32')];}_0x158059[_0xf9e8('0x27')](_0x4f2a1d)[_0xf9e8('0x33')](_0x655206);};}function getMustacheRender(_0x421bea,_0x20cb30){return Mustache['render'](_0x421bea,_[_0xf9e8('0x34')](_0x20cb30[_0xf9e8('0x35')],{'contact':_0x20cb30[_0xf9e8('0x36')],'message':_0x20cb30[_0xf9e8('0x23')],'agent':_0x20cb30[_0xf9e8('0x37')],'interaction':_0x20cb30[_0xf9e8('0x38')],'account':_0x20cb30['account']}))||'';}exports[_0xf9e8('0x39')]=function(_0x22c70a,_0x42a740){var _0x22fc7c={};var _0x457e87=_[_0xf9e8('0x3a')](db[_0xf9e8('0x3b')][_0xf9e8('0x3c')],function(_0x2c8504){return{'name':_0x2c8504[_0xf9e8('0x3d')],'type':_0x2c8504['type'][_0xf9e8('0x3e')]};});_0x22fc7c=qs['getOptions'](_0x457e87,_0x22c70a);return interaction[_0xf9e8('0x3f')](_0xf9e8('0x40'),_0x22c70a[_0xf9e8('0x41')],_0x22c70a['user'],_0x22fc7c,_0x457e87)['then'](respondWithFilteredResult(_0x42a740,_0x22fc7c))[_0xf9e8('0x25')](handleError(_0x42a740,null));};exports[_0xf9e8('0x42')]=function(_0x3e8641,_0x4130ba){var _0xfba891={'raw':![],'where':{'id':_0x3e8641['params']['id']}},_0xd996cf={};_0xd996cf['model']=_['keys'](db[_0xf9e8('0x3b')][_0xf9e8('0x3c')]);_0xd996cf[_0xf9e8('0x41')]=_[_0xf9e8('0x43')](_0x3e8641[_0xf9e8('0x41')]);_0xd996cf['filters']=_[_0xf9e8('0x44')](_0xd996cf[_0xf9e8('0x45')],_0xd996cf[_0xf9e8('0x41')]);_0xfba891[_0xf9e8('0x46')]=_[_0xf9e8('0x44')](_0xd996cf['model'],qs[_0xf9e8('0x47')](_0x3e8641[_0xf9e8('0x41')]['fields']));_0xfba891[_0xf9e8('0x46')]=_0xfba891[_0xf9e8('0x46')][_0xf9e8('0x48')]?_0xfba891[_0xf9e8('0x46')]:_0xd996cf[_0xf9e8('0x45')];if(_0x3e8641[_0xf9e8('0x41')]['includeAll']){_0xfba891['include']=[{'all':!![]}];}_0xfba891=_[_0xf9e8('0x34')]({},_0xfba891,_0x3e8641['options']);return db[_0xf9e8('0x3b')]['find'](_0xfba891)[_0xf9e8('0x1a')](handleEntityNotFound(_0x4130ba,null))['then'](respondWithResult(_0x4130ba,null))[_0xf9e8('0x25')](handleError(_0x4130ba,null));};exports['create']=function(_0x5e2551,_0x2947a5){return db[_0xf9e8('0x3b')][_0xf9e8('0x49')](_0x5e2551[_0xf9e8('0x35')],{})[_0xf9e8('0x1a')](respondWithResult(_0x2947a5,0xc9))[_0xf9e8('0x25')](handleError(_0x2947a5,null));};exports[_0xf9e8('0x2f')]=function(_0x58ae1a,_0x30f3a8){if(_0x58ae1a[_0xf9e8('0x35')]['id']){delete _0x58ae1a['body']['id'];}return db[_0xf9e8('0x3b')][_0xf9e8('0x4a')]({'where':{'id':_0x58ae1a[_0xf9e8('0x4b')]['id']}})[_0xf9e8('0x1a')](handleEntityNotFound(_0x30f3a8,null))[_0xf9e8('0x1a')](saveUpdates(_0x58ae1a[_0xf9e8('0x35')],null))['then'](respondWithResult(_0x30f3a8,null))['catch'](handleError(_0x30f3a8,null));};exports[_0xf9e8('0x30')]=function(_0x2f3891,_0x3c8c16){return db[_0xf9e8('0x3b')][_0xf9e8('0x4a')]({'where':{'id':_0x2f3891['params']['id']}})[_0xf9e8('0x1a')](handleEntityNotFound(_0x3c8c16,null))[_0xf9e8('0x1a')](removeEntity(_0x3c8c16,null))[_0xf9e8('0x25')](handleError(_0x3c8c16,null));};exports[_0xf9e8('0x4c')]=function(_0x2193fd,_0x435eb4){return db[_0xf9e8('0x3b')][_0xf9e8('0x4c')]()[_0xf9e8('0x1a')](respondWithResult(_0x435eb4,null))['catch'](handleError(_0x435eb4,null));};exports[_0xf9e8('0x4d')]=function(_0x220829,_0x438540){var _0x46c08b=_0x220829[_0xf9e8('0x4b')]['id'];var _0x254759;var _0xa35565;var _0x59b552;return db[_0xf9e8('0x3b')][_0xf9e8('0x4e')]({'where':{'id':_0x46c08b}})['then'](function(_0x502ef5){_0x254759=_0x502ef5;return db[_0xf9e8('0x4f')][_0xf9e8('0x4e')]({'where':{'id':_0x502ef5[_0xf9e8('0x50')]},'attributes':['id',_0xf9e8('0x51'),_0xf9e8('0x52'),'vidaooTopic',_0xf9e8('0x53'),_0xf9e8('0x54')],'raw':!![]});})[_0xf9e8('0x1a')](function(_0x4ba96c){if(_0x4ba96c&&_0x4ba96c[_0xf9e8('0x51')]&&_0x4ba96c[_0xf9e8('0x52')]){_0xa35565=_0x4ba96c;var _0x365e47={'interaction':{'id':_0x46c08b},'agent':{'id':_0x220829['user']['id'],'name':_0x220829[_0xf9e8('0x55')]['name'],'fullname':_0x220829[_0xf9e8('0x55')][_0xf9e8('0x56')],'email':_0x220829[_0xf9e8('0x55')][_0xf9e8('0x57')]},'contact':_0x220829['body'][_0xf9e8('0x36')],'account':_0x220829[_0xf9e8('0x35')]['account']};var _0x1fc2ce={'rejectUnauthorized':![],'method':_0xf9e8('0x58'),'url':_0xf9e8('0x59'),'headers':{'X-APIKEY':_0x4ba96c[_0xf9e8('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x220829[_0xf9e8('0x55')][_0xf9e8('0x57')]],'buttons':null,'topic':_0xa35565[_0xf9e8('0x5a')],'note':_[_0xf9e8('0x5b')](_0xa35565[_0xf9e8('0x53')])?null:getMustacheRender(_0xa35565[_0xf9e8('0x53')],_0x365e47),'metadata':null},'redirect':_0xf9e8('0x5c'),'json':!![]};try{if(!_[_0xf9e8('0x5b')](_0xa35565['vidaooMetadata'])){var _0xe7d082=getMustacheRender(_0xa35565[_0xf9e8('0x54')],_0x365e47);var _0x4c31b7=JSON[_0xf9e8('0x5d')](_0xe7d082);_0x1fc2ce[_0xf9e8('0x35')][_0xf9e8('0x5e')]=_0x4c31b7;}}catch(_0x2a21b8){throw new db[(_0xf9e8('0x5f'))][(_0xf9e8('0x60'))](_0xf9e8('0x61'));}return rp(_0x1fc2ce);}else{throw new db['Sequelize'][(_0xf9e8('0x60'))](_0xf9e8('0x62'));}})[_0xf9e8('0x1a')](function(_0x48b8f4){_0x59b552=_0x48b8f4;if(_0x59b552['id']){var _0x4d186f={'body':_0x59b552['join_url'],'ChatWebsiteId':_0xa35565['id'],'ChatInteractionId':_0x254759['id'],'direction':_0xf9e8('0x63'),'UserId':_0x220829[_0xf9e8('0x55')]['id']};return db[_0xf9e8('0x64')]['create'](_0x4d186f,{});}else{throw new db[(_0xf9e8('0x5f'))][(_0xf9e8('0x60'))](_0xf9e8('0x65'));}})[_0xf9e8('0x1a')](function(){return _0x254759['updateAttributes']({'vidaooSessionId':_0x59b552['id']});})[_0xf9e8('0x1a')](respondWithResult(_0x438540,null))[_0xf9e8('0x25')](handleError(_0x438540,null));};exports[_0xf9e8('0x66')]=function(_0x3fed70,_0x296b54){if(_0x3fed70['body']['id']){delete _0x3fed70['body']['id'];}return db[_0xf9e8('0x3b')]['find']({'where':{'id':_0x3fed70[_0xf9e8('0x4b')]['id']},'include':[{'model':db[_0xf9e8('0x67')],'as':_0xf9e8('0x68')}]})[_0xf9e8('0x1a')](handleEntityNotFound(_0x296b54,null))['then'](saveUpdates(_0x3fed70[_0xf9e8('0x35')],null))[_0xf9e8('0x1a')](respondWithResult(_0x296b54,null))[_0xf9e8('0x25')](handleError(_0x296b54,null));};exports[_0xf9e8('0x69')]=function(_0x39ab94,_0x1cc99d){if(_0x39ab94[_0xf9e8('0x35')]['id']){delete _0x39ab94['body']['id'];}return db['ChatInteraction'][_0xf9e8('0x4a')]({'where':{'id':_0x39ab94[_0xf9e8('0x4b')]['id']}})[_0xf9e8('0x1a')](function(_0x3aa2f6){if(!_0x3aa2f6){logger[_0xf9e8('0x20')](_0xf9e8('0x6a'),_0xf9e8('0x69'),0x194,_0xf9e8('0x6b'));_0x1cc99d[_0xf9e8('0x26')](0x194);}else{if(_0x3aa2f6[_0xf9e8('0x6c')]){throw new db[(_0xf9e8('0x5f'))][(_0xf9e8('0x60'))](_0xf9e8('0x6d'));}}return _0x3aa2f6;})['then'](function(_0x4dba95){if(_0x4dba95){return _0x4dba95['update']({'closed':_0x39ab94[_0xf9e8('0x35')][_0xf9e8('0x6e')],'disposition':_0x39ab94[_0xf9e8('0x35')]['disposition']})[_0xf9e8('0x1a')](function(_0x46d979){return _0x46d979;});}})['then'](function(){return respondWithRpcPromise(_0xf9e8('0x6f'),_0xf9e8('0x69'),_0x39ab94[_0xf9e8('0x35')],client9004);})[_0xf9e8('0x1a')](respondWithResult(_0x1cc99d,null))[_0xf9e8('0x25')](handleError(_0x1cc99d,null));};exports[_0xf9e8('0x70')]=function(_0x3e6cb7,_0xe0e324){_0x3e6cb7[_0xf9e8('0x35')]['name']=_0x3e6cb7[_0xf9e8('0x71')][_0xf9e8('0x72')];_0x3e6cb7[_0xf9e8('0x35')][_0xf9e8('0x73')]=_0x3e6cb7[_0xf9e8('0x71')][_0xf9e8('0x74')];_0x3e6cb7['body'][_0xf9e8('0x75')]=_0x3e6cb7['file']['mimetype'];return db[_0xf9e8('0x76')]['create'](_0x3e6cb7[_0xf9e8('0x35')])[_0xf9e8('0x1a')](respondWithResult(_0xe0e324,0xc9))[_0xf9e8('0x25')](handleError(_0xe0e324,null));};exports['attachmentDownload']=function(_0x4f8072,_0x3844fb){return db[_0xf9e8('0x3b')]['findOne']({'where':{'id':_0x4f8072['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3844fb,null))[_0xf9e8('0x1a')](function(_0x397959){if(_0x397959){if(_0x397959[_0xf9e8('0x6e')]){return _0x3844fb[_0xf9e8('0x27')](0x193)['json']({'status':0x193,'message':_0xf9e8('0x77')});}return db[_0xf9e8('0x76')][_0xf9e8('0x4e')]({'where':{'id':_0x4f8072['query'][_0xf9e8('0x78')]},'raw':!![]})['then'](handleEntityNotFound(_0x3844fb,null));}})[_0xf9e8('0x1a')](function(_0x2a4ab5){if(_0x2a4ab5){var _0x41b74a=_0x2a4ab5[_0xf9e8('0x79')]!==null;var _0x51e067=path[_0xf9e8('0x7a')](config[_0xf9e8('0x7b')],'server/files/attachments/');if(_0x41b74a){_0x51e067=path['join'](_0x51e067,_0xf9e8('0x7c'));}var _0x299a63=path['join'](_0x51e067,_0x2a4ab5['basename']);return _0x3844fb[_0xf9e8('0x7d')](_0x299a63);}})[_0xf9e8('0x25')](handleError(_0x3844fb,null));};exports[_0xf9e8('0x7e')]=function(_0x4ebb67,_0x2a25ff){var _0x8d736a=null;var _0x5d27be=null;var _0x2308bc=null;if(_0x4ebb67[_0xf9e8('0x35')]['id']){delete _0x4ebb67[_0xf9e8('0x35')]['id'];}if(_0x4ebb67[_0xf9e8('0x35')]['mailTranscript']){_0x2308bc=path['join'](config[_0xf9e8('0x7b')],'server/files/chat/upload/',util[_0xf9e8('0x7f')](_0xf9e8('0x80'),Date[_0xf9e8('0x81')]()));_0x4ebb67['body'][_0xf9e8('0x82')]=_0x2308bc;}return db[_0xf9e8('0x3b')][_0xf9e8('0x4a')]({'where':{'id':_0x4ebb67['params']['id']},'include':[{'model':db[_0xf9e8('0x64')],'as':_0xf9e8('0x83'),'include':[{'model':db['User'],'as':_0xf9e8('0x84')}]}]})[_0xf9e8('0x1a')](handleEntityNotFound(_0x2a25ff,null))['then'](saveUpdates(_0x4ebb67[_0xf9e8('0x35')],null))[_0xf9e8('0x1a')](function(_0x497608){if(_0x497608){_0x8d736a=_0x497608;return db['ChatWebsite'][_0xf9e8('0x4a')]({'where':{'id':_0x8d736a[_0xf9e8('0x50')]}});}})['then'](function(_0x160a67){if(_0x160a67){_0x5d27be=_0x160a67;return db['CmContact']['find']({'where':{'id':_0x8d736a[_0xf9e8('0x85')]}});}})[_0xf9e8('0x1a')](function(_0xb8450d){if(_0xb8450d){if(_0x2308bc){var _0x485be8=null;for(var _0x1c7315=0x1;_0x1c7315<_0x8d736a[_0xf9e8('0x83')][_0xf9e8('0x48')];++_0x1c7315){_0x485be8=_0x8d736a[_0xf9e8('0x83')][_0x1c7315];var _0x2364d4=_0x485be8[_0xf9e8('0x6c')]?util[_0xf9e8('0x7f')](_0xf9e8('0x86'),_0x5d27be[_0xf9e8('0x87')],_0x485be8[_0xf9e8('0x6c')]):_0xf9e8('0x88');var _0x52c929=_0x4ebb67[_0xf9e8('0x35')][_0xf9e8('0x89')]||util['format'](_0xf9e8('0x86'),_0xf9e8('0x8a'),_0x485be8[_0xf9e8('0x85')]);switch(_0x5d27be[_0xf9e8('0x8b')]){case _0xf9e8('0x8c'):_0x2364d4=_0x485be8['UserId']?util[_0xf9e8('0x7f')](_0xf9e8('0x86'),_0x5d27be[_0xf9e8('0x87')],_0x485be8[_0xf9e8('0x6c')]):_0xf9e8('0x88');break;case _0xf9e8('0x8d'):_0x2364d4=_0x485be8[_0xf9e8('0x6c')]?_0x485be8[_0xf9e8('0x84')][_0xf9e8('0x8e')]||_0x485be8[_0xf9e8('0x84')][_0xf9e8('0x56')]:_0xf9e8('0x88');break;case _0xf9e8('0x8f'):_0x2364d4=_0x485be8[_0xf9e8('0x6c')]?_0x485be8[_0xf9e8('0x84')]['fullname']:_0xf9e8('0x88');break;default:_0x2364d4=_0x485be8[_0xf9e8('0x6c')]?util[_0xf9e8('0x7f')](_0xf9e8('0x86'),_0x5d27be[_0xf9e8('0x87')],_0x485be8[_0xf9e8('0x6c')]):'System';}var _0x79be27=util['format'](_0xf9e8('0x90'),moment(_0x485be8[_0xf9e8('0x91')])[_0xf9e8('0x7f')]('MM/DD/YYYY\x20HH:mm:ss'),_0x485be8[_0xf9e8('0x92')]==='in'?_0x52c929:_0x2364d4,_0x485be8['body']);if(!_0x485be8['secret']){fs[_0xf9e8('0x93')](_0x2308bc,_0x79be27);}}return db[_0xf9e8('0x94')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf9e8('0x95')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x1a01b2){if(!_0x1a01b2||!_0x1a01b2[_0xf9e8('0x96')]||!_0x4ebb67[_0xf9e8('0x35')])return _0x8d736a;var _0x589770=_0x1a01b2['getSmtpOptions']();return respondWithRpcPromise(_0xf9e8('0x97'),_0xf9e8('0x98'),{'account':_0x589770,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1a01b2[_0xf9e8('0x32')],_0x1a01b2['email']||_0x1a01b2['Smtp'][_0xf9e8('0x55')]),'to':_0x4ebb67[_0xf9e8('0x35')]['mailTranscript'],'subject':_0xf9e8('0x99'),'text':util[_0xf9e8('0x7f')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4ebb67[_0xf9e8('0x35')][_0xf9e8('0x9a')]),'attachments':[{'path':_0x2308bc}]}})[_0xf9e8('0x1a')](function(){return _0x8d736a;})[_0xf9e8('0x25')](function(_0x296839){logger['error'](_0x296839);});})[_0xf9e8('0x1a')](respondWithStatusCode(_0x2a25ff,0xc8))['catch'](handleError(_0x2a25ff,null));};exports['addMessage']=function(_0x3c44c1,_0x2ecbda){return db[_0xf9e8('0x64')][_0xf9e8('0x4a')]({'where':{'id':_0x3c44c1[_0xf9e8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ecbda,null))['then'](function(_0x48cdea){if(_0x48cdea){return _0x48cdea['addMessage'](_0x3c44c1[_0xf9e8('0x35')][_0xf9e8('0x9b')],_[_0xf9e8('0x9c')](_0x3c44c1[_0xf9e8('0x35')],[_0xf9e8('0x9b'),'id'])||{});}})[_0xf9e8('0x1a')](respondWithResult(_0x2ecbda,null))['catch'](handleError(_0x2ecbda,null));};exports[_0xf9e8('0x9d')]=function(_0x20b2f1,_0x5dbcfa){var _0x15cabf={'raw':![],'where':{}};var _0x36f9c1={};var _0x1d76ca={'count':0x0,'rows':[]};return db[_0xf9e8('0x3b')][_0xf9e8('0x4e')]({'where':{'id':_0x20b2f1[_0xf9e8('0x4b')]['id']}})[_0xf9e8('0x1a')](handleEntityNotFound(_0x5dbcfa,null))[_0xf9e8('0x1a')](function(_0x85bbe8){if(_0x85bbe8){_0x36f9c1[_0xf9e8('0x45')]=_[_0xf9e8('0x43')](db[_0xf9e8('0x64')][_0xf9e8('0x3c')]);_0x36f9c1[_0xf9e8('0x41')]=_['keys'](_0x20b2f1[_0xf9e8('0x41')]);_0x36f9c1[_0xf9e8('0x9e')]=_[_0xf9e8('0x44')](_0x36f9c1['model'],_0x36f9c1[_0xf9e8('0x41')]);_0x15cabf[_0xf9e8('0x46')]=_['intersection'](_0x36f9c1[_0xf9e8('0x45')],qs[_0xf9e8('0x47')](_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0x47')]));_0x15cabf[_0xf9e8('0x46')]=_0x15cabf[_0xf9e8('0x46')][_0xf9e8('0x48')]?_0x15cabf['attributes']:_0x36f9c1[_0xf9e8('0x45')];if(!_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0x9f')](_0xf9e8('0xa0'))){_0x15cabf['limit']=qs[_0xf9e8('0x2c')](_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0x2c')]);_0x15cabf[_0xf9e8('0x2a')]=qs[_0xf9e8('0x2a')](_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0x2a')]);}_0x15cabf[_0xf9e8('0xa1')]=qs['sort'](_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0xa2')]);_0x15cabf[_0xf9e8('0xa3')]=qs[_0xf9e8('0x9e')](_[_0xf9e8('0xa4')](_0x20b2f1[_0xf9e8('0x41')],_0x36f9c1[_0xf9e8('0x9e')]));_0x15cabf[_0xf9e8('0xa3')][_0xf9e8('0xa5')]=_0x85bbe8['id'];if(_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0xa6')]){_0x15cabf['where']=_[_0xf9e8('0x34')](_0x15cabf[_0xf9e8('0xa3')],{'$or':_[_0xf9e8('0x3a')](_0x15cabf[_0xf9e8('0x46')],function(_0x433385){var _0x5cc7de={};_0x5cc7de[_0x433385]={'$like':'%'+_0x20b2f1[_0xf9e8('0x41')]['filter']+'%'};return _0x5cc7de;})});}if(_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0xa7')]){var _0x127568=_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0xa7')][_0xf9e8('0xa8')](',');var _0x3375fd={};_0x3375fd[_0x127568[0x0]]={'$gte':moment(_0x127568[0x1])[_0xf9e8('0x7f')](_0xf9e8('0xa9'))};_0x15cabf[_0xf9e8('0xa3')]=_[_0xf9e8('0x34')](_0x15cabf['where'],_0x3375fd);}_0x15cabf=_[_0xf9e8('0x34')]({},_0x15cabf,_0x20b2f1[_0xf9e8('0xaa')]);return db['ChatMessage'][_0xf9e8('0x2d')]({'where':_0x15cabf['where']})['then'](function(_0x31516f){_0x1d76ca[_0xf9e8('0x2d')]=_0x31516f;if(_0x20b2f1[_0xf9e8('0x41')][_0xf9e8('0xab')]){_0x15cabf[_0xf9e8('0xac')]=[{'all':!![]}];}return db[_0xf9e8('0x64')][_0xf9e8('0x3f')](_0x15cabf);})[_0xf9e8('0x1a')](function(_0x20c4c0){_0x1d76ca[_0xf9e8('0xad')]=_0x20c4c0;return _0x1d76ca;});}})[_0xf9e8('0x1a')](respondWithFilteredResult(_0x5dbcfa,_0x15cabf))['catch'](handleError(_0x5dbcfa,null));};exports['getMyMessages']=function(_0x51eb95,_0x42ceb8){var _0x26e8e0={'where':{}},_0x195a5e={},_0x911c7e={'count':0x0,'rows':[]};return db[_0xf9e8('0x3b')][_0xf9e8('0x4e')]({'where':{'id':_0x51eb95['params']['id']}})['then'](handleEntityNotFound(_0x42ceb8,null))[_0xf9e8('0x1a')](function(_0x3febac){if(_0x3febac){_0x195a5e['model']=_[_0xf9e8('0x43')](db['ChatMessage'][_0xf9e8('0x3c')]);_0x195a5e[_0xf9e8('0x41')]=_[_0xf9e8('0x43')](_0x51eb95['query']);_0x195a5e[_0xf9e8('0x9e')]=_[_0xf9e8('0x44')](_0x195a5e[_0xf9e8('0x45')],_0x195a5e[_0xf9e8('0x41')]);_0x26e8e0[_0xf9e8('0x46')]=_[_0xf9e8('0x44')](_0x195a5e[_0xf9e8('0x45')],qs[_0xf9e8('0x47')](_0x51eb95[_0xf9e8('0x41')][_0xf9e8('0x47')]));_0x26e8e0[_0xf9e8('0x46')]=_0x26e8e0[_0xf9e8('0x46')]['length']?_0x26e8e0[_0xf9e8('0x46')]:_0x195a5e[_0xf9e8('0x45')];if(!_0x51eb95[_0xf9e8('0x41')][_0xf9e8('0x9f')](_0xf9e8('0xa0'))){_0x26e8e0[_0xf9e8('0x2c')]=qs[_0xf9e8('0x2c')](_0x51eb95[_0xf9e8('0x41')][_0xf9e8('0x2c')]);_0x26e8e0[_0xf9e8('0x2a')]=qs[_0xf9e8('0x2a')](_0x51eb95['query'][_0xf9e8('0x2a')]);}_0x26e8e0[_0xf9e8('0xa1')]=qs[_0xf9e8('0xa2')](_0x51eb95[_0xf9e8('0x41')][_0xf9e8('0xa2')]);_0x26e8e0['where']=qs[_0xf9e8('0x9e')](_[_0xf9e8('0xa4')](_0x51eb95[_0xf9e8('0x41')],_0x195a5e[_0xf9e8('0x9e')]));_0x26e8e0['where'][_0xf9e8('0xa5')]=_0x3febac['id'];if(_0x51eb95[_0xf9e8('0x41')][_0xf9e8('0xa6')]){_0x26e8e0[_0xf9e8('0xa3')]=_[_0xf9e8('0x34')](_0x26e8e0[_0xf9e8('0xa3')],{'$or':_[_0xf9e8('0x3a')](_0x26e8e0[_0xf9e8('0x46')],function(_0x213c4){var _0x15196e={};_0x15196e[_0x213c4]={'$like':'%'+_0x51eb95[_0xf9e8('0x41')][_0xf9e8('0xa6')]+'%'};return _0x15196e;})});}_0x26e8e0['where'][_0xf9e8('0xae')]=![];if(_0x51eb95[_0xf9e8('0x41')]['id']){_0x26e8e0[_0xf9e8('0xa3')]['id']={'$gt':_0x51eb95['query']['id']};}_0x26e8e0=_[_0xf9e8('0x34')]({},_0x26e8e0,_0x51eb95[_0xf9e8('0xaa')]);return db['ChatMessage'][_0xf9e8('0x2d')]({'where':_0x26e8e0[_0xf9e8('0xa3')]})['then'](function(_0x2e4235){_0x911c7e[_0xf9e8('0x2d')]=_0x2e4235;_0x26e8e0['include']=[];if(_0x51eb95[_0xf9e8('0x41')][_0xf9e8('0xaf')]){_0x26e8e0[_0xf9e8('0xac')]['push']({'model':db['User'],'as':_0xf9e8('0x84'),'attributes':['id',_0xf9e8('0x56'),'alias']});}if(_0x51eb95['query'][_0xf9e8('0xab')]){_0x26e8e0[_0xf9e8('0xac')]=[{'all':!![]}];}return db[_0xf9e8('0x64')][_0xf9e8('0x3f')](_0x26e8e0);})[_0xf9e8('0x1a')](function(_0x15e2df){_0x911c7e['rows']=_0x15e2df;return _0x911c7e;});}})['then'](respondWithFilteredResult(_0x42ceb8,_0x26e8e0))[_0xf9e8('0x25')](handleError(_0x42ceb8,null));};exports['addTags']=function(_0x544b24,_0xdfdfe5){return db[_0xf9e8('0x3b')]['find']({'where':{'id':_0x544b24['params']['id']}})['then'](handleEntityNotFound(_0xdfdfe5,null))[_0xf9e8('0x1a')](function(_0x1ddede){if(_0x1ddede){return _0x1ddede[_0xf9e8('0xb0')](_0x544b24[_0xf9e8('0x35')]['ids'],_['omit'](_0x544b24[_0xf9e8('0x35')],[_0xf9e8('0x9b'),'id'])||{})[_0xf9e8('0xb1')](function(){return db[_0xf9e8('0xb2')][_0xf9e8('0x3f')]({'attributes':['id','name',_0xf9e8('0xb3')],'where':{'id':_0x544b24[_0xf9e8('0x35')][_0xf9e8('0x9b')]}});})[_0xf9e8('0x1a')](function(_0x2450fb){socket['emit'](_0xf9e8('0xb4'),{'id':Number(_0x544b24[_0xf9e8('0x4b')]['id']),'tags':_0x2450fb||[]});return{'id':Number(_0x544b24[_0xf9e8('0x4b')]['id']),'tags':_0x2450fb||[]};});}})[_0xf9e8('0x1a')](respondWithResult(_0xdfdfe5,null))[_0xf9e8('0x25')](handleError(_0xdfdfe5,null));};exports[_0xf9e8('0xb5')]=function(_0x55f798,_0x4a626b){return db[_0xf9e8('0x3b')][_0xf9e8('0x4a')]({'where':{'id':_0x55f798[_0xf9e8('0x4b')]['id']}})[_0xf9e8('0x1a')](handleEntityNotFound(_0x4a626b,null))[_0xf9e8('0x1a')](function(_0xa9915a){if(_0xa9915a){return _0xa9915a['removeTags'](_0x55f798[_0xf9e8('0x41')][_0xf9e8('0x9b')]);}})[_0xf9e8('0x1a')](respondWithStatusCode(_0x4a626b,null))[_0xf9e8('0x25')](handleError(_0x4a626b,null));};exports['download']=function(_0x1f9fe5,_0x1d98ac){var _0x360d80=moment()['unix']()['toString']();var _0x71b4ac=path[_0xf9e8('0x7a')](config['root'],_0xf9e8('0xb6'),_0xf9e8('0xb7'),_0xf9e8('0xb8'));var _0x5a3449=path[_0xf9e8('0x7a')](config[_0xf9e8('0x7b')],_0xf9e8('0xb6'),_0xf9e8('0xb7'),_0xf9e8('0xb9'));var _0x2da2b8=path[_0xf9e8('0x7a')](_0x71b4ac,_0x360d80);var _0x157bd6=util['format'](_0xf9e8('0xba'),_0x1f9fe5[_0xf9e8('0x4b')]['id'],_0x360d80);var _0x1b7542=path[_0xf9e8('0x7a')](_0x71b4ac,_0x157bd6);var _0x142d84=[];_0x142d84[_0xf9e8('0xbb')]({'model':db[_0xf9e8('0x84')],'as':_0xf9e8('0x84'),'attributes':['id','fullname'],'raw':!![]});_0x142d84[_0xf9e8('0xbb')]({'model':db[_0xf9e8('0x67')],'as':_0xf9e8('0x68'),'attributes':['id',_0xf9e8('0xbc'),_0xf9e8('0xbd')],'raw':!![]});if(_0x1f9fe5[_0xf9e8('0x41')][_0xf9e8('0xb9')]){_0x142d84[_0xf9e8('0xbb')]({'model':db['Attachment'],'as':_0xf9e8('0x76'),'raw':!![]});}var _0x3178f5=[{'model':db[_0xf9e8('0x64')],'as':_0xf9e8('0x83'),'attributes':['id','body',_0xf9e8('0x91'),'direction',_0xf9e8('0xae'),_0xf9e8('0xbe')],'include':_0x142d84}];_0x3178f5[_0xf9e8('0xbb')]({'model':db[_0xf9e8('0x4f')],'as':_0xf9e8('0xbf'),'attributes':['id',_0xf9e8('0x32')]});_0x3178f5[_0xf9e8('0xbb')]({'model':db[_0xf9e8('0x84')],'as':_0xf9e8('0xc0'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xf9e8('0x4a')]({'where':{'id':_0x1f9fe5[_0xf9e8('0x4b')]['id']},'include':_0x3178f5})['then'](handleEntityNotFound(_0x1d98ac,null))[_0xf9e8('0x1a')](function(_0x3a8eb2){if(_0x3a8eb2){var _0x503f18=_0x3a8eb2[_0xf9e8('0xc1')]({'plain':!![]});fs[_0xf9e8('0xc2')](_0x2da2b8);var _0x4739e6={'channel':_0xf9e8('0xc3'),'account':_0x503f18[_0xf9e8('0xbf')][_0xf9e8('0x32')],'agent':_0x503f18[_0xf9e8('0xc0')]?_0x503f18[_0xf9e8('0xc0')][_0xf9e8('0x56')]:_0xf9e8('0xc4'),'createdAt':moment(_0x503f18[_0xf9e8('0x91')])[_0xf9e8('0x7f')](_0xf9e8('0xa9'))[_0xf9e8('0xc5')](),'closedAt':_0x503f18[_0xf9e8('0x6e')]?moment(_0x503f18[_0xf9e8('0xc6')])[_0xf9e8('0x7f')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf9e8('0xc5')]():'','disposition':_0x503f18['disposition'],'chatInfo':{'browser':_0x503f18[_0xf9e8('0xc7')],'os':_0x503f18[_0xf9e8('0xc8')],'referer':_0x503f18[_0xf9e8('0xc9')],'customerIp':_0x503f18['customerIp'],'customerPort':_0x503f18[_0xf9e8('0xca')]?_0x503f18[_0xf9e8('0xca')]:_0xf9e8('0xc4')},'messages':_(_0x503f18['Messages'])[_0xf9e8('0xcb')]()['filter']({'secret':![]})[_0xf9e8('0x3a')](function(_0x15f8a9){if(_0x15f8a9['Attachment']){var _0x3b8c5d=path['join'](_0x5a3449,_0x15f8a9[_0xf9e8('0x76')][_0xf9e8('0x73')]);if(fs[_0xf9e8('0xcc')](_0x3b8c5d)){fs[_0xf9e8('0xcd')](_0x3b8c5d)[_0xf9e8('0xce')](fs['createWriteStream'](path[_0xf9e8('0x7a')](_0x2da2b8,_0x15f8a9[_0xf9e8('0x76')]['basename'])));}}return{'date':moment(_0x15f8a9[_0xf9e8('0x91')])[_0xf9e8('0x7f')](_0xf9e8('0xa9'))[_0xf9e8('0xc5')](),'sender':_0x15f8a9[_0xf9e8('0x92')]===_0xf9e8('0x63')?_0x15f8a9['User']?_0x15f8a9[_0xf9e8('0x84')][_0xf9e8('0x56')]:_0xf9e8('0x88'):_0x15f8a9[_0xf9e8('0x68')][_0xf9e8('0xbc')]+(_0x15f8a9[_0xf9e8('0x68')][_0xf9e8('0xbd')]?'\x20'+_0x15f8a9[_0xf9e8('0x68')][_0xf9e8('0xbd')]:''),'body':_0x15f8a9['Attachment']?_0x15f8a9[_0xf9e8('0x76')][_0xf9e8('0x73')]:_0x15f8a9[_0xf9e8('0x35')],'direction':_0x15f8a9[_0xf9e8('0x92')]==='out'?'A':'C','secret':_0x15f8a9['secret'],'read':_0x15f8a9[_0xf9e8('0xbe')],'attachment':_0x15f8a9[_0xf9e8('0x76')]};})[_0xf9e8('0xcf')]()};return ejs[_0xf9e8('0xd0')](path['join'](config['root'],'server',_0xf9e8('0xd1'),_0xf9e8('0xd2')),{'interaction':_0x4739e6})['then'](function(_0x5ef895){var _0x5dead2=path[_0xf9e8('0x7a')](_0x2da2b8,_0xf9e8('0xd3')+_0x503f18['id']+'-'+_0x360d80+'.pdf');var _0x4e4893={'path':_0x5dead2,'channel':_0xf9e8('0xc3'),'interactionId':_0x503f18['id']};return pdf[_0xf9e8('0xd4')](_0x5ef895,_0x4e4893);})[_0xf9e8('0x1a')](function(){return new Promise(function(_0x52d786,_0x208bc3){zipdir(_0x2da2b8,{'saveTo':_0x1b7542},function(_0x33f21d,_0x3e8288){if(_0x33f21d)return _0x208bc3(_0x33f21d);return _0x52d786(_0x3e8288);});})[_0xf9e8('0x1a')](function(){return new BPromise(function(_0x2fb561,_0x5b8dbd){rimraf(_0x2da2b8,function(_0x396318){if(_0x396318)_0x5b8dbd(_0x396318);return _0x2fb561();});});})[_0xf9e8('0x1a')](function(){return _0x1d98ac[_0xf9e8('0x7d')](_0x1b7542,_0x157bd6,function(_0x64a449){if(_0x64a449){logger[_0xf9e8('0x20')](_0xf9e8('0xd5'),_0x64a449);}else{fs['unlinkSync'](_0x1b7542);}});});});}else{return _0x1d98ac['sendStatus'](0xc8);}})[_0xf9e8('0x25')](handleError(_0x1d98ac,null));};
\ No newline at end of file
+var _0x67be=['localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','name','render','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','filters','intersection','fields','attributes','includeAll','include','merge','options','create','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','follow','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','attachmentDownload','closed','Attachment','ChatOfflineMessageId','join','offline-chat/','download','close','mailTranscript','root','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ContactId','length','format','%s%d','agentAlias','System','agentIdentifier','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','sort','where','pick','ChatInteractionId','filter','$gte','rows','getMyMessages','order','includeAgent','push','addTags','setTags','spread','color','emit','chatInteractionTags:save','removeTags','toString','server','tmp','transcript-%d-%s.zip','firstName','read','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerPort','tail','existsSync','createWriteStream','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','defaults','redis'];(function(_0x597fc3,_0x39517c){var _0x2235f4=function(_0x2596f2){while(--_0x2596f2){_0x597fc3['push'](_0x597fc3['shift']());}};_0x2235f4(++_0x39517c);}(_0x67be,0x18a));var _0xe67b=function(_0x40ceb1,_0x970175){_0x40ceb1=_0x40ceb1-0x0;var _0x264e28=_0x67be[_0x40ceb1];return _0x264e28;};'use strict';var rimraf=require(_0xe67b('0x0'));var zipdir=require(_0xe67b('0x1'));var rp=require(_0xe67b('0x2'));var moment=require(_0xe67b('0x3'));var BPromise=require(_0xe67b('0x4'));var Mustache=require(_0xe67b('0x5'));var util=require('util');var path=require(_0xe67b('0x6'));var ejs=require(_0xe67b('0x7'));var fs=require('fs');var _=require(_0xe67b('0x8'));var Redis=require(_0xe67b('0x9'));var interaction=require(_0xe67b('0xa'));var qs=require(_0xe67b('0xb'));var pdf=require(_0xe67b('0xc'));var logger=require('../../config/logger')(_0xe67b('0xd'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xe67b('0xe')](config[_0xe67b('0xf')],{'host':_0xe67b('0x10'),'port':0x18eb});var socket=require(_0xe67b('0x11'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xe67b('0x12')](socket);var jayson=require(_0xe67b('0x13'));var client=jayson['client'][_0xe67b('0x14')]({'port':0x232b});var client9004=jayson[_0xe67b('0x15')][_0xe67b('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x4f9b01,_0x23764d,_0x31b5d2,_0x21eea5){return new BPromise(function(_0x474714,_0x205609){var _0x3da1fd=_0x21eea5||client;return _0x3da1fd[_0xe67b('0x16')](_0x4f9b01,_0x31b5d2)[_0xe67b('0x17')](function(_0x23a583){logger[_0xe67b('0x18')](_0xe67b('0x19'),_0x23764d,_0xe67b('0x1a'));logger[_0xe67b('0x1b')](_0xe67b('0x1c'),_0x23764d,_0xe67b('0x1a'),JSON[_0xe67b('0x1d')](_0x23a583));if(_0x23a583[_0xe67b('0x1e')]){if(_0x23a583[_0xe67b('0x1e')][_0xe67b('0x1f')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x23764d,_0x23a583['error'][_0xe67b('0x20')]);return _0x205609(_0x23a583[_0xe67b('0x1e')][_0xe67b('0x20')]);}logger[_0xe67b('0x1e')](_0xe67b('0x19'),_0x23764d,_0x23a583[_0xe67b('0x1e')][_0xe67b('0x20')]);return _0x474714(_0x23a583[_0xe67b('0x1e')][_0xe67b('0x20')]);}else{logger[_0xe67b('0x18')](_0xe67b('0x19'),_0x23764d,_0xe67b('0x1a'));_0x474714(_0x23a583[_0xe67b('0x21')]['message']);}})[_0xe67b('0x22')](function(_0x124e97){logger[_0xe67b('0x1e')](_0xe67b('0x19'),_0x23764d,_0x124e97);_0x205609(_0x124e97);});});}function respondWithStatusCode(_0x4f0f4b,_0x307518){_0x307518=_0x307518||0xcc;return function(_0x5dca44){if(_0x5dca44){return _0x4f0f4b[_0xe67b('0x23')](_0x307518);}return _0x4f0f4b[_0xe67b('0x24')](_0x307518)[_0xe67b('0x25')]();};}function respondWithResult(_0x5d787b,_0x41e571){_0x41e571=_0x41e571||0xc8;return function(_0x4474e7){if(_0x4474e7){return _0x5d787b['status'](_0x41e571)[_0xe67b('0x26')](_0x4474e7);}};}function respondWithFilteredResult(_0x324cad,_0x1c161f){return function(_0x1ce67f){if(_0x1ce67f){var _0x3ca2a0=typeof _0x1c161f[_0xe67b('0x27')]===_0xe67b('0x28')&&typeof _0x1c161f[_0xe67b('0x29')]===_0xe67b('0x28');var _0x2e6b28=_0x1ce67f[_0xe67b('0x2a')];var _0x241ac4=_0x3ca2a0?0x0:_0x1c161f[_0xe67b('0x27')];var _0x4886cf=_0x3ca2a0?_0x1ce67f[_0xe67b('0x2a')]:_0x1c161f[_0xe67b('0x27')]+_0x1c161f[_0xe67b('0x29')];var _0x856f25;if(_0x4886cf>=_0x2e6b28){_0x4886cf=_0x2e6b28;_0x856f25=0xc8;}else{_0x856f25=0xce;}_0x324cad['status'](_0x856f25);return _0x324cad[_0xe67b('0x2b')](_0xe67b('0x2c'),_0x241ac4+'-'+_0x4886cf+'/'+_0x2e6b28)[_0xe67b('0x26')](_0x1ce67f);}return null;};}function saveUpdates(_0x56b088){return function(_0x1f56fa){if(_0x1f56fa){return _0x1f56fa[_0xe67b('0x2d')](_0x56b088)['then'](function(_0x36d272){return _0x36d272;});}return null;};}function removeEntity(_0x106019){return function(_0x65a1aa){if(_0x65a1aa){return _0x65a1aa['destroy']()[_0xe67b('0x17')](function(){_0x106019[_0xe67b('0x24')](0xcc)[_0xe67b('0x25')]();});}};}function handleEntityNotFound(_0x3125f4){return function(_0x140633){if(!_0x140633){_0x3125f4[_0xe67b('0x23')](0x194);}return _0x140633;};}function handleError(_0x2bf3a7,_0x437b52){_0x437b52=_0x437b52||0x1f4;return function(_0x5dce04){logger[_0xe67b('0x1e')](_0x5dce04['stack']);if(_0x5dce04[_0xe67b('0x2e')]){delete _0x5dce04[_0xe67b('0x2e')];}_0x2bf3a7[_0xe67b('0x24')](_0x437b52)['send'](_0x5dce04);};}function getMustacheRender(_0x4994de,_0x165ce7){return Mustache[_0xe67b('0x2f')](_0x4994de,_['merge'](_0x165ce7[_0xe67b('0x30')],{'contact':_0x165ce7[_0xe67b('0x31')],'message':_0x165ce7[_0xe67b('0x20')],'agent':_0x165ce7[_0xe67b('0x32')],'interaction':_0x165ce7[_0xe67b('0x33')],'account':_0x165ce7[_0xe67b('0x34')]}))||'';}exports[_0xe67b('0x35')]=function(_0x30d40e,_0x2f406d){var _0x99a097={};var _0x9bd45a=_[_0xe67b('0x36')](db[_0xe67b('0x37')][_0xe67b('0x38')],function(_0x56bdcc){return{'name':_0x56bdcc[_0xe67b('0x39')],'type':_0x56bdcc[_0xe67b('0x3a')][_0xe67b('0x3b')]};});_0x99a097=qs[_0xe67b('0x3c')](_0x9bd45a,_0x30d40e);return interaction[_0xe67b('0x3d')](_0xe67b('0x3e'),_0x30d40e[_0xe67b('0x3f')],_0x30d40e[_0xe67b('0x40')],_0x99a097,_0x9bd45a)[_0xe67b('0x17')](respondWithFilteredResult(_0x2f406d,_0x99a097))[_0xe67b('0x22')](handleError(_0x2f406d,null));};exports[_0xe67b('0x41')]=function(_0x3f8447,_0x458bd1){var _0x531932={'raw':![],'where':{'id':_0x3f8447[_0xe67b('0x42')]['id']}},_0x5a2018={};_0x5a2018[_0xe67b('0x43')]=_[_0xe67b('0x44')](db[_0xe67b('0x37')]['rawAttributes']);_0x5a2018['query']=_[_0xe67b('0x44')](_0x3f8447[_0xe67b('0x3f')]);_0x5a2018[_0xe67b('0x45')]=_[_0xe67b('0x46')](_0x5a2018['model'],_0x5a2018[_0xe67b('0x3f')]);_0x531932['attributes']=_['intersection'](_0x5a2018[_0xe67b('0x43')],qs[_0xe67b('0x47')](_0x3f8447[_0xe67b('0x3f')]['fields']));_0x531932[_0xe67b('0x48')]=_0x531932[_0xe67b('0x48')]['length']?_0x531932['attributes']:_0x5a2018[_0xe67b('0x43')];if(_0x3f8447[_0xe67b('0x3f')][_0xe67b('0x49')]){_0x531932[_0xe67b('0x4a')]=[{'all':!![]}];}_0x531932=_[_0xe67b('0x4b')]({},_0x531932,_0x3f8447[_0xe67b('0x4c')]);return db['ChatInteraction']['find'](_0x531932)[_0xe67b('0x17')](handleEntityNotFound(_0x458bd1,null))[_0xe67b('0x17')](respondWithResult(_0x458bd1,null))[_0xe67b('0x22')](handleError(_0x458bd1,null));};exports[_0xe67b('0x4d')]=function(_0x38a67d,_0x29c6f8){return db['ChatInteraction'][_0xe67b('0x4d')](_0x38a67d[_0xe67b('0x30')],{})['then'](respondWithResult(_0x29c6f8,0xc9))['catch'](handleError(_0x29c6f8,null));};exports[_0xe67b('0x2d')]=function(_0x2b1dcb,_0x480197){if(_0x2b1dcb['body']['id']){delete _0x2b1dcb['body']['id'];}return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x2b1dcb['params']['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x480197,null))[_0xe67b('0x17')](saveUpdates(_0x2b1dcb[_0xe67b('0x30')],null))['then'](respondWithResult(_0x480197,null))[_0xe67b('0x22')](handleError(_0x480197,null));};exports[_0xe67b('0x4f')]=function(_0x1a6f03,_0x434e03){return db[_0xe67b('0x37')]['find']({'where':{'id':_0x1a6f03[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x434e03,null))[_0xe67b('0x17')](removeEntity(_0x434e03,null))[_0xe67b('0x22')](handleError(_0x434e03,null));};exports[_0xe67b('0x50')]=function(_0x2e6c0b,_0x27c729){return db[_0xe67b('0x37')][_0xe67b('0x50')]()[_0xe67b('0x17')](respondWithResult(_0x27c729,null))[_0xe67b('0x22')](handleError(_0x27c729,null));};exports[_0xe67b('0x51')]=function(_0x4c5255,_0x1672f7){var _0x22f0c8=_0x4c5255[_0xe67b('0x42')]['id'];var _0x2630f4;var _0x56e46c;var _0x770eed;return db['ChatInteraction'][_0xe67b('0x52')]({'where':{'id':_0x22f0c8}})[_0xe67b('0x17')](function(_0x57529f){_0x2630f4=_0x57529f;return db[_0xe67b('0x53')][_0xe67b('0x52')]({'where':{'id':_0x57529f[_0xe67b('0x54')]},'attributes':['id',_0xe67b('0x55'),_0xe67b('0x56'),_0xe67b('0x57'),_0xe67b('0x58'),_0xe67b('0x59')],'raw':!![]});})[_0xe67b('0x17')](function(_0x2657dc){if(_0x2657dc&&_0x2657dc[_0xe67b('0x55')]&&_0x2657dc[_0xe67b('0x56')]){_0x56e46c=_0x2657dc;var _0x3301a1={'interaction':{'id':_0x22f0c8},'agent':{'id':_0x4c5255[_0xe67b('0x40')]['id'],'name':_0x4c5255[_0xe67b('0x40')][_0xe67b('0x2e')],'fullname':_0x4c5255[_0xe67b('0x40')][_0xe67b('0x5a')],'email':_0x4c5255[_0xe67b('0x40')]['email']},'contact':_0x4c5255['body'][_0xe67b('0x31')],'account':_0x4c5255['body'][_0xe67b('0x34')]};var _0x14f37a={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2657dc[_0xe67b('0x55')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c5255[_0xe67b('0x40')][_0xe67b('0x5b')]],'buttons':null,'topic':_0x56e46c[_0xe67b('0x57')],'note':_['isNull'](_0x56e46c[_0xe67b('0x58')])?null:getMustacheRender(_0x56e46c['vidaooNote'],_0x3301a1),'metadata':null},'redirect':_0xe67b('0x5c'),'json':!![]};try{if(!_[_0xe67b('0x5d')](_0x56e46c[_0xe67b('0x59')])){var _0x4491b8=getMustacheRender(_0x56e46c[_0xe67b('0x59')],_0x3301a1);var _0x443709=JSON[_0xe67b('0x5e')](_0x4491b8);_0x14f37a['body'][_0xe67b('0x5f')]=_0x443709;}}catch(_0x372eaf){throw new db[(_0xe67b('0x60'))][(_0xe67b('0x61'))](_0xe67b('0x62'));}return rp(_0x14f37a);}else{throw new db[(_0xe67b('0x60'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe67b('0x17')](function(_0xf21b79){_0x770eed=_0xf21b79;if(_0x770eed['id']){var _0x2c3a01={'body':_0x770eed[_0xe67b('0x63')],'ChatWebsiteId':_0x56e46c['id'],'ChatInteractionId':_0x2630f4['id'],'direction':_0xe67b('0x64'),'UserId':_0x4c5255[_0xe67b('0x40')]['id']};return db['ChatMessage'][_0xe67b('0x4d')](_0x2c3a01,{});}else{throw new db[(_0xe67b('0x60'))][(_0xe67b('0x61'))](_0xe67b('0x65'));}})[_0xe67b('0x17')](function(){return _0x2630f4[_0xe67b('0x66')]({'vidaooSessionId':_0x770eed['id']});})[_0xe67b('0x17')](respondWithResult(_0x1672f7,null))[_0xe67b('0x22')](handleError(_0x1672f7,null));};exports['customUpdate']=function(_0x227d1f,_0x4fbfef){if(_0x227d1f[_0xe67b('0x30')]['id']){delete _0x227d1f[_0xe67b('0x30')]['id'];}return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x227d1f['params']['id']},'include':[{'model':db[_0xe67b('0x67')],'as':_0xe67b('0x68')}]})[_0xe67b('0x17')](handleEntityNotFound(_0x4fbfef,null))[_0xe67b('0x17')](saveUpdates(_0x227d1f['body'],null))['then'](respondWithResult(_0x4fbfef,null))[_0xe67b('0x22')](handleError(_0x4fbfef,null));};exports['abandon']=function(_0x590270,_0x1267c3){if(_0x590270[_0xe67b('0x30')]['id']){delete _0x590270[_0xe67b('0x30')]['id'];}return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x590270[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](function(_0x40af89){if(!_0x40af89){logger[_0xe67b('0x1e')](_0xe67b('0x69'),'abandon',0x194,_0xe67b('0x6a'));_0x1267c3[_0xe67b('0x23')](0x194);}else{if(_0x40af89[_0xe67b('0x6b')]){throw new db['Sequelize'][(_0xe67b('0x61'))](_0xe67b('0x6c'));}}return _0x40af89;})[_0xe67b('0x17')](function(_0x2a71aa){if(_0x2a71aa){return _0x2a71aa[_0xe67b('0x2d')]({'closed':_0x590270[_0xe67b('0x30')]['closed'],'disposition':_0x590270[_0xe67b('0x30')][_0xe67b('0x6d')]})[_0xe67b('0x17')](function(_0xe2534c){return _0xe2534c;});}})[_0xe67b('0x17')](function(){return respondWithRpcPromise(_0xe67b('0x6e'),_0xe67b('0x6f'),_0x590270[_0xe67b('0x30')],client9004);})['then'](respondWithResult(_0x1267c3,null))['catch'](handleError(_0x1267c3,null));};exports[_0xe67b('0x70')]=function(_0x45a10f,_0x312377){_0x45a10f[_0xe67b('0x30')][_0xe67b('0x2e')]=_0x45a10f[_0xe67b('0x71')][_0xe67b('0x72')];_0x45a10f[_0xe67b('0x30')][_0xe67b('0x73')]=_0x45a10f['file']['filename'];_0x45a10f[_0xe67b('0x30')]['type']=_0x45a10f[_0xe67b('0x71')]['mimetype'];return db['Attachment']['create'](_0x45a10f[_0xe67b('0x30')])[_0xe67b('0x17')](respondWithResult(_0x312377,0xc9))['catch'](handleError(_0x312377,null));};exports[_0xe67b('0x74')]=function(_0x23723d,_0x3c8eaa){return db[_0xe67b('0x37')][_0xe67b('0x52')]({'where':{'id':_0x23723d[_0xe67b('0x42')]['id']},'raw':!![]})[_0xe67b('0x17')](handleEntityNotFound(_0x3c8eaa,null))['then'](function(_0x19dafc){if(_0x19dafc){if(_0x19dafc[_0xe67b('0x75')]){return _0x3c8eaa[_0xe67b('0x24')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xe67b('0x76')][_0xe67b('0x52')]({'where':{'id':_0x23723d[_0xe67b('0x3f')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3c8eaa,null));}})[_0xe67b('0x17')](function(_0x45d39f){if(_0x45d39f){var _0x5f4f56=_0x45d39f[_0xe67b('0x77')]!==null;var _0x50c8cb=path[_0xe67b('0x78')](config['root'],'server/files/attachments/');if(_0x5f4f56){_0x50c8cb=path[_0xe67b('0x78')](_0x50c8cb,_0xe67b('0x79'));}var _0xab5acd=path[_0xe67b('0x78')](_0x50c8cb,_0x45d39f[_0xe67b('0x73')]);return _0x3c8eaa[_0xe67b('0x7a')](_0xab5acd);}})[_0xe67b('0x22')](handleError(_0x3c8eaa,null));};exports[_0xe67b('0x7b')]=function(_0x16d8b7,_0x87bc10){var _0x516450=null;var _0x72bba3=null;var _0x43d47c=null;if(_0x16d8b7['body']['id']){delete _0x16d8b7[_0xe67b('0x30')]['id'];}if(_0x16d8b7[_0xe67b('0x30')][_0xe67b('0x7c')]){_0x43d47c=path[_0xe67b('0x78')](config[_0xe67b('0x7d')],'server/files/chat/upload/',util['format'](_0xe67b('0x7e'),Date[_0xe67b('0x7f')]()));_0x16d8b7['body'][_0xe67b('0x80')]=_0x43d47c;}return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x16d8b7[_0xe67b('0x42')]['id']},'include':[{'model':db[_0xe67b('0x81')],'as':_0xe67b('0x82'),'include':[{'model':db['User'],'as':_0xe67b('0x83')}]}]})[_0xe67b('0x17')](handleEntityNotFound(_0x87bc10,null))[_0xe67b('0x17')](saveUpdates(_0x16d8b7[_0xe67b('0x30')],null))[_0xe67b('0x17')](function(_0x1a348c){if(_0x1a348c){_0x516450=_0x1a348c;return db['ChatWebsite'][_0xe67b('0x4e')]({'where':{'id':_0x516450[_0xe67b('0x54')]}});}})[_0xe67b('0x17')](function(_0x482fd4){if(_0x482fd4){_0x72bba3=_0x482fd4;return db['CmContact'][_0xe67b('0x4e')]({'where':{'id':_0x516450[_0xe67b('0x84')]}});}})[_0xe67b('0x17')](function(_0x4106c7){if(_0x4106c7){if(_0x43d47c){var _0x373f13=null;for(var _0x11a004=0x1;_0x11a004<_0x516450['Messages'][_0xe67b('0x85')];++_0x11a004){_0x373f13=_0x516450[_0xe67b('0x82')][_0x11a004];var _0x5a15f2=_0x373f13['UserId']?util[_0xe67b('0x86')](_0xe67b('0x87'),_0x72bba3[_0xe67b('0x88')],_0x373f13[_0xe67b('0x6b')]):_0xe67b('0x89');var _0x5becfb=_0x16d8b7[_0xe67b('0x30')]['customer']||util[_0xe67b('0x86')](_0xe67b('0x87'),'Visitor',_0x373f13[_0xe67b('0x84')]);switch(_0x72bba3[_0xe67b('0x8a')]){case'website_alias':_0x5a15f2=_0x373f13[_0xe67b('0x6b')]?util[_0xe67b('0x86')]('%s%d',_0x72bba3['agentAlias'],_0x373f13[_0xe67b('0x6b')]):_0xe67b('0x89');break;case _0xe67b('0x8b'):_0x5a15f2=_0x373f13[_0xe67b('0x6b')]?_0x373f13[_0xe67b('0x83')][_0xe67b('0x8c')]||_0x373f13['User'][_0xe67b('0x5a')]:_0xe67b('0x89');break;case'agent_fullname':_0x5a15f2=_0x373f13['UserId']?_0x373f13[_0xe67b('0x83')][_0xe67b('0x5a')]:'System';break;default:_0x5a15f2=_0x373f13[_0xe67b('0x6b')]?util[_0xe67b('0x86')]('%s%d',_0x72bba3[_0xe67b('0x88')],_0x373f13['UserId']):'System';}var _0x1d06c6=util['format'](_0xe67b('0x8d'),moment(_0x373f13[_0xe67b('0x8e')])[_0xe67b('0x86')](_0xe67b('0x8f')),_0x373f13[_0xe67b('0x90')]==='in'?_0x5becfb:_0x5a15f2,_0x373f13[_0xe67b('0x30')]);if(!_0x373f13[_0xe67b('0x91')]){fs[_0xe67b('0x92')](_0x43d47c,_0x1d06c6);}}return db[_0xe67b('0x93')][_0xe67b('0x52')]({'where':{'service':!![]},'include':[{'model':db[_0xe67b('0x94')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xe67b('0x95')],'as':'CloudProvider','raw':!![]}]}]});}}})['then'](function(_0x3b8902){if(!_0x3b8902||!_0x3b8902[_0xe67b('0x96')]||!_0x16d8b7[_0xe67b('0x30')])return _0x516450;var _0x42ef75=_0x3b8902[_0xe67b('0x97')]();return respondWithRpcPromise(_0xe67b('0x98'),'sendMail',{'account':_0x42ef75,'message':{'from':util[_0xe67b('0x86')]('\x22%s\x22\x20<%s>',_0x3b8902[_0xe67b('0x2e')],_0x3b8902[_0xe67b('0x5b')]||_0x3b8902['Smtp'][_0xe67b('0x40')]),'to':_0x16d8b7[_0xe67b('0x30')]['mailTranscript'],'subject':_0xe67b('0x99'),'text':util[_0xe67b('0x86')](_0xe67b('0x9a'),_0x16d8b7['body'][_0xe67b('0x7c')]),'attachments':[{'path':_0x43d47c}]}})[_0xe67b('0x17')](function(){return _0x516450;})[_0xe67b('0x22')](function(_0x25c78b){logger[_0xe67b('0x1e')](_0x25c78b);});})[_0xe67b('0x17')](respondWithStatusCode(_0x87bc10,0xc8))[_0xe67b('0x22')](handleError(_0x87bc10,null));};exports[_0xe67b('0x9b')]=function(_0x55ec55,_0x48a002){return db[_0xe67b('0x81')][_0xe67b('0x4e')]({'where':{'id':_0x55ec55[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x48a002,null))[_0xe67b('0x17')](function(_0x59b165){if(_0x59b165){return _0x59b165[_0xe67b('0x9b')](_0x55ec55[_0xe67b('0x30')]['ids'],_[_0xe67b('0x9c')](_0x55ec55['body'],[_0xe67b('0x9d'),'id'])||{});}})[_0xe67b('0x17')](respondWithResult(_0x48a002,null))['catch'](handleError(_0x48a002,null));};exports[_0xe67b('0x9e')]=function(_0x1be6ed,_0x44f236){var _0x4a304e={'raw':![],'where':{}};var _0x5c959f={};var _0x32fb0b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe67b('0x52')]({'where':{'id':_0x1be6ed['params']['id']}})['then'](handleEntityNotFound(_0x44f236,null))['then'](function(_0x41a12e){if(_0x41a12e){_0x5c959f[_0xe67b('0x43')]=_[_0xe67b('0x44')](db[_0xe67b('0x81')][_0xe67b('0x38')]);_0x5c959f[_0xe67b('0x3f')]=_[_0xe67b('0x44')](_0x1be6ed[_0xe67b('0x3f')]);_0x5c959f['filters']=_[_0xe67b('0x46')](_0x5c959f[_0xe67b('0x43')],_0x5c959f['query']);_0x4a304e[_0xe67b('0x48')]=_['intersection'](_0x5c959f['model'],qs['fields'](_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x47')]));_0x4a304e[_0xe67b('0x48')]=_0x4a304e[_0xe67b('0x48')][_0xe67b('0x85')]?_0x4a304e[_0xe67b('0x48')]:_0x5c959f[_0xe67b('0x43')];if(!_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x9f')]('nolimit')){_0x4a304e[_0xe67b('0x29')]=qs['limit'](_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x29')]);_0x4a304e[_0xe67b('0x27')]=qs['offset'](_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x27')]);}_0x4a304e['order']=qs[_0xe67b('0xa0')](_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0xa0')]);_0x4a304e[_0xe67b('0xa1')]=qs[_0xe67b('0x45')](_[_0xe67b('0xa2')](_0x1be6ed[_0xe67b('0x3f')],_0x5c959f[_0xe67b('0x45')]));_0x4a304e[_0xe67b('0xa1')][_0xe67b('0xa3')]=_0x41a12e['id'];if(_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0xa4')]){_0x4a304e[_0xe67b('0xa1')]=_[_0xe67b('0x4b')](_0x4a304e[_0xe67b('0xa1')],{'$or':_[_0xe67b('0x36')](_0x4a304e[_0xe67b('0x48')],function(_0x595ffd){var _0x351d7f={};_0x351d7f[_0x595ffd]={'$like':'%'+_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0xa4')]+'%'};return _0x351d7f;})});}if(_0x1be6ed[_0xe67b('0x3f')]['$gte']){var _0x3f5218=_0x1be6ed['query'][_0xe67b('0xa5')]['split'](',');var _0x5d1164={};_0x5d1164[_0x3f5218[0x0]]={'$gte':moment(_0x3f5218[0x1])[_0xe67b('0x86')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4a304e[_0xe67b('0xa1')]=_['merge'](_0x4a304e['where'],_0x5d1164);}_0x4a304e=_[_0xe67b('0x4b')]({},_0x4a304e,_0x1be6ed[_0xe67b('0x4c')]);return db[_0xe67b('0x81')][_0xe67b('0x2a')]({'where':_0x4a304e[_0xe67b('0xa1')]})[_0xe67b('0x17')](function(_0x41d5ec){_0x32fb0b[_0xe67b('0x2a')]=_0x41d5ec;if(_0x1be6ed[_0xe67b('0x3f')][_0xe67b('0x49')]){_0x4a304e[_0xe67b('0x4a')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4a304e);})['then'](function(_0x5a092b){_0x32fb0b[_0xe67b('0xa6')]=_0x5a092b;return _0x32fb0b;});}})[_0xe67b('0x17')](respondWithFilteredResult(_0x44f236,_0x4a304e))[_0xe67b('0x22')](handleError(_0x44f236,null));};exports[_0xe67b('0xa7')]=function(_0x1f823d,_0x134851){var _0x3cbb89={'where':{}},_0x26d1ab={},_0x7b3cbd={'count':0x0,'rows':[]};return db[_0xe67b('0x37')]['findOne']({'where':{'id':_0x1f823d[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x134851,null))[_0xe67b('0x17')](function(_0x266450){if(_0x266450){_0x26d1ab[_0xe67b('0x43')]=_[_0xe67b('0x44')](db[_0xe67b('0x81')][_0xe67b('0x38')]);_0x26d1ab[_0xe67b('0x3f')]=_[_0xe67b('0x44')](_0x1f823d['query']);_0x26d1ab['filters']=_[_0xe67b('0x46')](_0x26d1ab[_0xe67b('0x43')],_0x26d1ab[_0xe67b('0x3f')]);_0x3cbb89[_0xe67b('0x48')]=_['intersection'](_0x26d1ab[_0xe67b('0x43')],qs[_0xe67b('0x47')](_0x1f823d[_0xe67b('0x3f')]['fields']));_0x3cbb89['attributes']=_0x3cbb89['attributes'][_0xe67b('0x85')]?_0x3cbb89['attributes']:_0x26d1ab['model'];if(!_0x1f823d[_0xe67b('0x3f')][_0xe67b('0x9f')]('nolimit')){_0x3cbb89[_0xe67b('0x29')]=qs[_0xe67b('0x29')](_0x1f823d[_0xe67b('0x3f')]['limit']);_0x3cbb89[_0xe67b('0x27')]=qs[_0xe67b('0x27')](_0x1f823d[_0xe67b('0x3f')][_0xe67b('0x27')]);}_0x3cbb89[_0xe67b('0xa8')]=qs[_0xe67b('0xa0')](_0x1f823d[_0xe67b('0x3f')][_0xe67b('0xa0')]);_0x3cbb89[_0xe67b('0xa1')]=qs[_0xe67b('0x45')](_[_0xe67b('0xa2')](_0x1f823d['query'],_0x26d1ab[_0xe67b('0x45')]));_0x3cbb89[_0xe67b('0xa1')][_0xe67b('0xa3')]=_0x266450['id'];if(_0x1f823d[_0xe67b('0x3f')][_0xe67b('0xa4')]){_0x3cbb89[_0xe67b('0xa1')]=_[_0xe67b('0x4b')](_0x3cbb89[_0xe67b('0xa1')],{'$or':_[_0xe67b('0x36')](_0x3cbb89[_0xe67b('0x48')],function(_0x5b7119){var _0x1eb116={};_0x1eb116[_0x5b7119]={'$like':'%'+_0x1f823d['query'][_0xe67b('0xa4')]+'%'};return _0x1eb116;})});}_0x3cbb89['where']['secret']=![];if(_0x1f823d[_0xe67b('0x3f')]['id']){_0x3cbb89[_0xe67b('0xa1')]['id']={'$gt':_0x1f823d[_0xe67b('0x3f')]['id']};}_0x3cbb89=_[_0xe67b('0x4b')]({},_0x3cbb89,_0x1f823d[_0xe67b('0x4c')]);return db[_0xe67b('0x81')][_0xe67b('0x2a')]({'where':_0x3cbb89[_0xe67b('0xa1')]})[_0xe67b('0x17')](function(_0x398d14){_0x7b3cbd['count']=_0x398d14;_0x3cbb89[_0xe67b('0x4a')]=[];if(_0x1f823d['query'][_0xe67b('0xa9')]){_0x3cbb89[_0xe67b('0x4a')][_0xe67b('0xaa')]({'model':db['User'],'as':_0xe67b('0x83'),'attributes':['id','fullname',_0xe67b('0x8c')]});}if(_0x1f823d[_0xe67b('0x3f')][_0xe67b('0x49')]){_0x3cbb89[_0xe67b('0x4a')]=[{'all':!![]}];}return db[_0xe67b('0x81')][_0xe67b('0x3d')](_0x3cbb89);})['then'](function(_0xf1502e){_0x7b3cbd[_0xe67b('0xa6')]=_0xf1502e;return _0x7b3cbd;});}})['then'](respondWithFilteredResult(_0x134851,_0x3cbb89))[_0xe67b('0x22')](handleError(_0x134851,null));};exports[_0xe67b('0xab')]=function(_0x158724,_0x5ef299){return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x158724[_0xe67b('0x42')]['id']}})[_0xe67b('0x17')](handleEntityNotFound(_0x5ef299,null))[_0xe67b('0x17')](function(_0x5d25df){if(_0x5d25df){return _0x5d25df[_0xe67b('0xac')](_0x158724[_0xe67b('0x30')][_0xe67b('0x9d')],_[_0xe67b('0x9c')](_0x158724[_0xe67b('0x30')],[_0xe67b('0x9d'),'id'])||{})[_0xe67b('0xad')](function(){return db['Tag']['findAll']({'attributes':['id',_0xe67b('0x2e'),_0xe67b('0xae')],'where':{'id':_0x158724[_0xe67b('0x30')]['ids']}});})[_0xe67b('0x17')](function(_0x385e6a){socket[_0xe67b('0xaf')](_0xe67b('0xb0'),{'id':Number(_0x158724[_0xe67b('0x42')]['id']),'tags':_0x385e6a||[]});return{'id':Number(_0x158724['params']['id']),'tags':_0x385e6a||[]};});}})['then'](respondWithResult(_0x5ef299,null))[_0xe67b('0x22')](handleError(_0x5ef299,null));};exports[_0xe67b('0xb1')]=function(_0x4ef5dd,_0x2f0e4b){return db['ChatInteraction'][_0xe67b('0x4e')]({'where':{'id':_0x4ef5dd[_0xe67b('0x42')]['id']}})['then'](handleEntityNotFound(_0x2f0e4b,null))[_0xe67b('0x17')](function(_0x51423c){if(_0x51423c){return _0x51423c[_0xe67b('0xb1')](_0x4ef5dd['query'][_0xe67b('0x9d')]);}})[_0xe67b('0x17')](respondWithStatusCode(_0x2f0e4b,null))[_0xe67b('0x22')](handleError(_0x2f0e4b,null));};exports[_0xe67b('0x7a')]=function(_0x3ecc1c,_0x1dcdee){var _0x465ee9=moment()['unix']()[_0xe67b('0xb2')]();var _0x50f55e=path[_0xe67b('0x78')](config[_0xe67b('0x7d')],_0xe67b('0xb3'),'files',_0xe67b('0xb4'));var _0x1deb01=path[_0xe67b('0x78')](config[_0xe67b('0x7d')],_0xe67b('0xb3'),'files','attachments');var _0x136dc8=path[_0xe67b('0x78')](_0x50f55e,_0x465ee9);var _0x3802d7=util['format'](_0xe67b('0xb5'),_0x3ecc1c[_0xe67b('0x42')]['id'],_0x465ee9);var _0x5d3803=path[_0xe67b('0x78')](_0x50f55e,_0x3802d7);var _0x42a771=[];_0x42a771['push']({'model':db[_0xe67b('0x83')],'as':_0xe67b('0x83'),'attributes':['id',_0xe67b('0x5a')],'raw':!![]});_0x42a771[_0xe67b('0xaa')]({'model':db[_0xe67b('0x67')],'as':_0xe67b('0x68'),'attributes':['id',_0xe67b('0xb6'),'lastName'],'raw':!![]});if(_0x3ecc1c[_0xe67b('0x3f')]['attachments']){_0x42a771[_0xe67b('0xaa')]({'model':db[_0xe67b('0x76')],'as':'Attachment','raw':!![]});}var _0x4cb3e1=[{'model':db[_0xe67b('0x81')],'as':_0xe67b('0x82'),'attributes':['id',_0xe67b('0x30'),_0xe67b('0x8e'),_0xe67b('0x90'),_0xe67b('0x91'),_0xe67b('0xb7')],'include':_0x42a771}];_0x4cb3e1[_0xe67b('0xaa')]({'model':db['ChatWebsite'],'as':_0xe67b('0xb8'),'attributes':['id','name']});_0x4cb3e1[_0xe67b('0xaa')]({'model':db[_0xe67b('0x83')],'as':_0xe67b('0xb9'),'attributes':['id',_0xe67b('0x5a')]});return db[_0xe67b('0x37')][_0xe67b('0x4e')]({'where':{'id':_0x3ecc1c[_0xe67b('0x42')]['id']},'include':_0x4cb3e1})[_0xe67b('0x17')](handleEntityNotFound(_0x1dcdee,null))[_0xe67b('0x17')](function(_0x4cc105){if(_0x4cc105){var _0x2d89f1=_0x4cc105[_0xe67b('0xba')]({'plain':!![]});fs[_0xe67b('0xbb')](_0x136dc8);var _0x11f602={'channel':_0xe67b('0xbc'),'account':_0x2d89f1[_0xe67b('0xb8')][_0xe67b('0x2e')],'agent':_0x2d89f1[_0xe67b('0xb9')]?_0x2d89f1[_0xe67b('0xb9')][_0xe67b('0x5a')]:_0xe67b('0xbd'),'createdAt':moment(_0x2d89f1[_0xe67b('0x8e')])[_0xe67b('0x86')](_0xe67b('0xbe'))[_0xe67b('0xb2')](),'closedAt':_0x2d89f1[_0xe67b('0x75')]?moment(_0x2d89f1['closedAt'])[_0xe67b('0x86')](_0xe67b('0xbe'))['toString']():'','disposition':_0x2d89f1[_0xe67b('0x6d')],'chatInfo':{'browser':_0x2d89f1[_0xe67b('0xbf')],'os':_0x2d89f1[_0xe67b('0xc0')],'referer':_0x2d89f1[_0xe67b('0xc1')],'customerIp':_0x2d89f1['customerIp'],'customerPort':_0x2d89f1['customerPort']?_0x2d89f1[_0xe67b('0xc2')]:_0xe67b('0xbd')},'messages':_(_0x2d89f1[_0xe67b('0x82')])[_0xe67b('0xc3')]()[_0xe67b('0xa4')]({'secret':![]})['map'](function(_0x35daac){if(_0x35daac[_0xe67b('0x76')]){var _0x37fceb=path['join'](_0x1deb01,_0x35daac['Attachment'][_0xe67b('0x73')]);if(fs[_0xe67b('0xc4')](_0x37fceb)){fs['createReadStream'](_0x37fceb)['pipe'](fs[_0xe67b('0xc5')](path[_0xe67b('0x78')](_0x136dc8,_0x35daac['Attachment'][_0xe67b('0x73')])));}}return{'date':moment(_0x35daac['createdAt'])[_0xe67b('0x86')](_0xe67b('0xbe'))[_0xe67b('0xb2')](),'sender':_0x35daac['direction']===_0xe67b('0x64')?_0x35daac[_0xe67b('0x83')]?_0x35daac['User'][_0xe67b('0x5a')]:_0xe67b('0x89'):_0x35daac[_0xe67b('0x68')][_0xe67b('0xb6')]+(_0x35daac[_0xe67b('0x68')][_0xe67b('0xc6')]?'\x20'+_0x35daac[_0xe67b('0x68')][_0xe67b('0xc6')]:''),'body':_0x35daac[_0xe67b('0x76')]?_0x35daac['Attachment'][_0xe67b('0x73')]:_0x35daac['body'],'direction':_0x35daac[_0xe67b('0x90')]===_0xe67b('0x64')?'A':'C','secret':_0x35daac[_0xe67b('0x91')],'read':_0x35daac[_0xe67b('0xb7')],'attachment':_0x35daac[_0xe67b('0x76')]};})[_0xe67b('0xc7')]()};return ejs[_0xe67b('0xc8')](path[_0xe67b('0x78')](config[_0xe67b('0x7d')],_0xe67b('0xb3'),_0xe67b('0xc9'),_0xe67b('0xca')),{'interaction':_0x11f602})['then'](function(_0x4a2296){var _0xa60784=path[_0xe67b('0x78')](_0x136dc8,_0xe67b('0xcb')+_0x2d89f1['id']+'-'+_0x465ee9+_0xe67b('0xcc'));var _0x4dfcfe={'path':_0xa60784,'channel':'Chat','interactionId':_0x2d89f1['id']};return pdf['createPdfFromHTML'](_0x4a2296,_0x4dfcfe);})[_0xe67b('0x17')](function(){return new Promise(function(_0x4aac29,_0x51044f){zipdir(_0x136dc8,{'saveTo':_0x5d3803},function(_0x355e54,_0x26dafc){if(_0x355e54)return _0x51044f(_0x355e54);return _0x4aac29(_0x26dafc);});})[_0xe67b('0x17')](function(){return new BPromise(function(_0x5607ed,_0x17da85){rimraf(_0x136dc8,function(_0x2506a8){if(_0x2506a8)_0x17da85(_0x2506a8);return _0x5607ed();});});})[_0xe67b('0x17')](function(){return _0x1dcdee[_0xe67b('0x7a')](_0x5d3803,_0x3802d7,function(_0xa0cc4a){if(_0xa0cc4a){logger[_0xe67b('0x1e')]('err',_0xa0cc4a);}else{fs['unlinkSync'](_0x5d3803);}});});});}else{return _0x1dcdee[_0xe67b('0x23')](0xc8);}})[_0xe67b('0x22')](handleError(_0x1dcdee,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index d567b66..42191ca 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 _0xb237=['update','remove','getUsers','then','setDataValue','findAll','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x4c5f2c,_0x5a480c){var _0x1cebc3=function(_0x19877e){while(--_0x19877e){_0x4c5f2c['push'](_0x4c5f2c['shift']());}};_0x1cebc3(++_0x5a480c);}(_0xb237,0x10a));var _0x7b23=function(_0x3baa95,_0x3ae66a){_0x3baa95=_0x3baa95-0x0;var _0x1d447b=_0xb237[_0x3baa95];return _0x1d447b;};'use strict';var EventEmitter=require(_0x7b23('0x0'));var ChatInteraction=require(_0x7b23('0x1'))['db'][_0x7b23('0x2')];var ChatMessage=require(_0x7b23('0x1'))['db'][_0x7b23('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x7b23('0x4')](0x0);var events={'afterCreate':_0x7b23('0x5'),'afterUpdate':_0x7b23('0x6'),'afterDestroy':_0x7b23('0x7')};function emitEvent(_0x395b75){return function(_0x2e993f,_0x144133,_0x1947f7){_0x2e993f[_0x7b23('0x8')]({'attributes':['id'],'raw':!![]})[_0x7b23('0x9')](function(_0x16951a){_0x2e993f[_0x7b23('0xa')]('Users',_0x16951a['map'](function(_0x4f379c){return{'id':_0x4f379c['id']};}));return ChatMessage[_0x7b23('0xb')]({'where':{'ChatInteractionId':_0x2e993f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4f2636){_0x2e993f[_0x7b23('0xa')]('unreadMessages',_0x4f2636['length']);ChatInteractionEvents[_0x7b23('0xc')](_0x395b75+':'+_0x2e993f['id'],_0x2e993f);ChatInteractionEvents['emit'](_0x395b75,_0x2e993f);_0x1947f7(null);})[_0x7b23('0xd')](_0x1947f7(null));};}for(var e in events){if(events[_0x7b23('0xe')](e)){var event=events[e];ChatInteraction[_0x7b23('0xf')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x7d05=['hook','events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x1ac393,_0x52793d){var _0x2b54b2=function(_0x3e4bf0){while(--_0x3e4bf0){_0x1ac393['push'](_0x1ac393['shift']());}};_0x2b54b2(++_0x52793d);}(_0x7d05,0x1d1));var _0x57d0=function(_0x4d75a1,_0x45002a){_0x4d75a1=_0x4d75a1-0x0;var _0x18f98b=_0x7d05[_0x4d75a1];return _0x18f98b;};'use strict';var EventEmitter=require(_0x57d0('0x0'));var ChatInteraction=require(_0x57d0('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x57d0('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x57d0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x57d0('0x4'),'afterDestroy':_0x57d0('0x5')};function emitEvent(_0x30f090){return function(_0xf12a98,_0x4abb2a,_0x57b082){_0xf12a98['getUsers']({'attributes':['id'],'raw':!![]})[_0x57d0('0x6')](function(_0x3e8c72){_0xf12a98[_0x57d0('0x7')](_0x57d0('0x8'),_0x3e8c72[_0x57d0('0x9')](function(_0x569f46){return{'id':_0x569f46['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xf12a98['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57d0('0x6')](function(_0x49cbca){_0xf12a98[_0x57d0('0x7')](_0x57d0('0xa'),_0x49cbca[_0x57d0('0xb')]);ChatInteractionEvents[_0x57d0('0xc')](_0x30f090+':'+_0xf12a98['id'],_0xf12a98);ChatInteractionEvents['emit'](_0x30f090,_0xf12a98);_0x57b082(null);})[_0x57d0('0xd')](_0x57b082(null));};}for(var e in events){if(events[_0x57d0('0xe')](e)){var event=events[e];ChatInteraction[_0x57d0('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 3c87ca8..03cdcf6 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 _0xf4ad=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x33f7ed,_0x35167e){var _0x50ed01=function(_0x2e58cc){while(--_0x2e58cc){_0x33f7ed['push'](_0x33f7ed['shift']());}};_0x50ed01(++_0x35167e);}(_0xf4ad,0xd1));var _0xdf4a=function(_0x22e9a1,_0x1d3a53){_0x22e9a1=_0x22e9a1-0x0;var _0x5bff12=_0xf4ad[_0x22e9a1];return _0x5bff12;};'use strict';var _=require(_0xdf4a('0x0'));var util=require(_0xdf4a('0x1'));var logger=require(_0xdf4a('0x2'))('api');var moment=require(_0xdf4a('0x3'));var BPromise=require(_0xdf4a('0x4'));var rp=require(_0xdf4a('0x5'));var fs=require('fs');var path=require(_0xdf4a('0x6'));var rimraf=require(_0xdf4a('0x7'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x56abb5,_0x263fa0){return _0x56abb5[_0xdf4a('0x8')]('ChatInteraction',attributes,{'tableName':_0xdf4a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e4e17,_0xc43f0e,_0x4f450d){if(_0x5e4e17[_0xdf4a('0xa')](_0xdf4a('0xb'))){_0x5e4e17['closedAt']=moment()['format'](_0xdf4a('0xc'));}_0x4f450d(null,_0x5e4e17);}},'charset':_0xdf4a('0xd'),'collate':_0xdf4a('0xe')});};
\ No newline at end of file
+var _0x3fa1=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed','format'];(function(_0x44f12f,_0x3f3957){var _0x34d474=function(_0x368f02){while(--_0x368f02){_0x44f12f['push'](_0x44f12f['shift']());}};_0x34d474(++_0x3f3957);}(_0x3fa1,0x157));var _0x13fa=function(_0x12cb90,_0xdab1f9){_0x12cb90=_0x12cb90-0x0;var _0x952309=_0x3fa1[_0x12cb90];return _0x952309;};'use strict';var _=require(_0x13fa('0x0'));var util=require(_0x13fa('0x1'));var logger=require(_0x13fa('0x2'))(_0x13fa('0x3'));var moment=require(_0x13fa('0x4'));var BPromise=require('bluebird');var rp=require(_0x13fa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x13fa('0x6'));var config=require(_0x13fa('0x7'));var attributes=require(_0x13fa('0x8'));module[_0x13fa('0x9')]=function(_0x3fb8e7,_0x53ba1b){return _0x3fb8e7[_0x13fa('0xa')](_0x13fa('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56d61e,_0x388311,_0x1d1fa4){if(_0x56d61e[_0x13fa('0xc')]('closed')){_0x56d61e['closedAt']=moment()[_0x13fa('0xd')](_0x13fa('0xe'));}_0x1d1fa4(null,_0x56d61e);}},'charset':_0x13fa('0xf'),'collate':_0x13fa('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 4653779..476915d 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 _0x1142=['request','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','body','options','raw','where','attributes','limit','then','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x2d8403,_0x1dd8f7){var _0x425012=function(_0x1e0b2a){while(--_0x1e0b2a){_0x2d8403['push'](_0x2d8403['shift']());}};_0x425012(++_0x1dd8f7);}(_0x1142,0x70));var _0x2114=function(_0x307327,_0x1f169f){_0x307327=_0x307327-0x0;var _0x38ec83=_0x1142[_0x307327];return _0x38ec83;};'use strict';var _=require(_0x2114('0x0'));var util=require('util');var moment=require(_0x2114('0x1'));var BPromise=require(_0x2114('0x2'));var rs=require(_0x2114('0x3'));var fs=require('fs');var Redis=require(_0x2114('0x4'));var db=require(_0x2114('0x5'))['db'];var utils=require(_0x2114('0x6'));var logger=require(_0x2114('0x7'))(_0x2114('0x8'));var config=require(_0x2114('0x9'));var jayson=require(_0x2114('0xa'));var client=jayson['client'][_0x2114('0xb')]({'port':0x232a});config['redis']=_[_0x2114('0xc')](config[_0x2114('0xd')],{'host':_0x2114('0xe'),'port':0x18eb});var socket=require(_0x2114('0xf'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x2114('0x10')](socket);function respondWithRpcPromise(_0x5289c5,_0x391a13,_0x9d8796){return new BPromise(function(_0xbf65e0,_0x7a4c18){return client[_0x2114('0x11')](_0x5289c5,_0x9d8796)['then'](function(_0x776ba2){logger[_0x2114('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x391a13,_0x2114('0x13'));logger[_0x2114('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x391a13,'request\x20sent',JSON[_0x2114('0x15')](_0x776ba2));if(_0x776ba2[_0x2114('0x16')]){if(_0x776ba2[_0x2114('0x16')][_0x2114('0x17')]===0x1f4){logger[_0x2114('0x16')](_0x2114('0x18'),_0x391a13,_0x776ba2[_0x2114('0x16')]['message']);return _0x7a4c18(_0x776ba2['error'][_0x2114('0x19')]);}logger[_0x2114('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x391a13,_0x776ba2['error']['message']);return _0xbf65e0(_0x776ba2[_0x2114('0x16')][_0x2114('0x19')]);}else{logger[_0x2114('0x12')](_0x2114('0x18'),_0x391a13,_0x2114('0x13'));_0xbf65e0(_0x776ba2[_0x2114('0x1a')]['message']);}})[_0x2114('0x1b')](function(_0x5b478e){logger[_0x2114('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x391a13,_0x5b478e);_0x7a4c18(_0x5b478e);});});}exports['UpdateChatInteraction']=function(_0x23f48b){var _0xf31a5b=this;return new Promise(function(_0x497cdd,_0x4a5df2){return db[_0x2114('0x1c')]['update'](_0x23f48b[_0x2114('0x1d')],{'raw':_0x23f48b[_0x2114('0x1e')]?_0x23f48b['options'][_0x2114('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23f48b['options']?_0x23f48b[_0x2114('0x1e')][_0x2114('0x20')]||null:null,'attributes':_0x23f48b[_0x2114('0x1e')]?_0x23f48b[_0x2114('0x1e')][_0x2114('0x21')]||null:null,'limit':_0x23f48b[_0x2114('0x1e')]?_0x23f48b[_0x2114('0x1e')][_0x2114('0x22')]||null:null})[_0x2114('0x23')](function(_0x2290eb){logger['info'](_0x2114('0x24'),_0x23f48b);logger[_0x2114('0x14')](_0x2114('0x24'),_0x23f48b,JSON[_0x2114('0x15')](_0x2290eb));_0x497cdd(_0x2290eb);})['catch'](function(_0x2f0978){logger[_0x2114('0x16')](_0x2114('0x24'),_0x2f0978['message'],_0x23f48b);_0x4a5df2(_0xf31a5b[_0x2114('0x16')](0x1f4,_0x2f0978[_0x2114('0x19')]));});});};exports[_0x2114('0x25')]=function(_0x105365){return new Promise(function(_0x1d4997,_0x99ec3){return db['ChatInteraction'][_0x2114('0x26')]({'where':_0x105365[_0x2114('0x1e')]?_0x105365[_0x2114('0x1e')][_0x2114('0x20')]||null:null})[_0x2114('0x23')](function(_0x2308ea){if(_0x2308ea){return _0x2308ea[_0x2114('0x27')](_0x105365[_0x2114('0x1d')][_0x2114('0x28')],_['omit'](_0x105365[_0x2114('0x1d')],['ids','id'])||{});}})[_0x2114('0x29')](function(_0x19ae58){logger[_0x2114('0x12')](_0x2114('0x2a'),_0x105365);logger[_0x2114('0x14')]('AddTags',_0x105365,JSON['stringify'](_0x19ae58));_0x1d4997(_0x19ae58);})[_0x2114('0x1b')](function(_0x556728){logger[_0x2114('0x16')](_0x2114('0x2a'),_0x556728['message'],_0x105365);_0x99ec3(_this['error'](0x1f4,_0x556728[_0x2114('0x19')]));});});};
\ No newline at end of file
+var _0xfba1=['info','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','then','stringify','ChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfba1,0xa2));var _0x1fba=function(_0x2063de,_0x286428){_0x2063de=_0x2063de-0x0;var _0x43343c=_0xfba1[_0x2063de];return _0x43343c;};'use strict';var _=require(_0x1fba('0x0'));var util=require('util');var moment=require(_0x1fba('0x1'));var BPromise=require('bluebird');var rs=require(_0x1fba('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fba('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1fba('0x4'));var config=require(_0x1fba('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x1fba('0x6')]['http']({'port':0x232a});config[_0x1fba('0x7')]=_[_0x1fba('0x8')](config[_0x1fba('0x7')],{'host':_0x1fba('0x9'),'port':0x18eb});var socket=require(_0x1fba('0xa'))(new Redis(config[_0x1fba('0x7')]));require('./chatInteraction.socket')[_0x1fba('0xb')](socket);function respondWithRpcPromise(_0x8e64ef,_0x3a3a63,_0xd6987b){return new BPromise(function(_0xabba60,_0x4f36bc){return client['request'](_0x8e64ef,_0xd6987b)['then'](function(_0x1e9b5b){logger['info'](_0x1fba('0xc'),_0x3a3a63,_0x1fba('0xd'));logger[_0x1fba('0xe')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3a3a63,_0x1fba('0xd'),JSON['stringify'](_0x1e9b5b));if(_0x1e9b5b[_0x1fba('0xf')]){if(_0x1e9b5b['error'][_0x1fba('0x10')]===0x1f4){logger['error'](_0x1fba('0xc'),_0x3a3a63,_0x1e9b5b[_0x1fba('0xf')]['message']);return _0x4f36bc(_0x1e9b5b['error']['message']);}logger[_0x1fba('0xf')](_0x1fba('0xc'),_0x3a3a63,_0x1e9b5b[_0x1fba('0xf')][_0x1fba('0x11')]);return _0xabba60(_0x1e9b5b[_0x1fba('0xf')][_0x1fba('0x11')]);}else{logger[_0x1fba('0x12')](_0x1fba('0xc'),_0x3a3a63,_0x1fba('0xd'));_0xabba60(_0x1e9b5b['result'][_0x1fba('0x11')]);}})[_0x1fba('0x13')](function(_0x31b2fb){logger[_0x1fba('0xf')](_0x1fba('0xc'),_0x3a3a63,_0x31b2fb);_0x4f36bc(_0x31b2fb);});});}exports[_0x1fba('0x14')]=function(_0x30aaa8){var _0x366159=this;return new Promise(function(_0x43fa42,_0x19a412){return db['ChatInteraction'][_0x1fba('0x15')](_0x30aaa8['body'],{'raw':_0x30aaa8[_0x1fba('0x16')]?_0x30aaa8['options'][_0x1fba('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30aaa8[_0x1fba('0x16')]?_0x30aaa8['options'][_0x1fba('0x18')]||null:null,'attributes':_0x30aaa8[_0x1fba('0x16')]?_0x30aaa8['options'][_0x1fba('0x19')]||null:null,'limit':_0x30aaa8[_0x1fba('0x16')]?_0x30aaa8[_0x1fba('0x16')][_0x1fba('0x1a')]||null:null})[_0x1fba('0x1b')](function(_0x6bad22){logger[_0x1fba('0x12')]('UpdateChatInteraction',_0x30aaa8);logger['debug'](_0x1fba('0x14'),_0x30aaa8,JSON[_0x1fba('0x1c')](_0x6bad22));_0x43fa42(_0x6bad22);})[_0x1fba('0x13')](function(_0x47ab48){logger[_0x1fba('0xf')](_0x1fba('0x14'),_0x47ab48[_0x1fba('0x11')],_0x30aaa8);_0x19a412(_0x366159[_0x1fba('0xf')](0x1f4,_0x47ab48[_0x1fba('0x11')]));});});};exports['AddTagsToChatInteraction']=function(_0x392460){return new Promise(function(_0x16f9ec,_0x5008de){return db[_0x1fba('0x1d')][_0x1fba('0x1e')]({'where':_0x392460[_0x1fba('0x16')]?_0x392460[_0x1fba('0x16')][_0x1fba('0x18')]||null:null})[_0x1fba('0x1b')](function(_0x3db7a9){if(_0x3db7a9){return _0x3db7a9[_0x1fba('0x1f')](_0x392460['body'][_0x1fba('0x20')],_[_0x1fba('0x21')](_0x392460['body'],[_0x1fba('0x20'),'id'])||{});}})[_0x1fba('0x22')](function(_0x3ddc72){logger[_0x1fba('0x12')]('AddTags',_0x392460);logger[_0x1fba('0xe')]('AddTags',_0x392460,JSON['stringify'](_0x3ddc72));_0x16f9ec(_0x3ddc72);})[_0x1fba('0x13')](function(_0x2211dd){logger[_0x1fba('0xf')](_0x1fba('0x23'),_0x2211dd['message'],_0x392460);_0x5008de(_this[_0x1fba('0xf')](0x1f4,_0x2211dd[_0x1fba('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index af2dc74..51acad3 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 _0x5f58=['register','chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener'];(function(_0x442db4,_0x4c17f9){var _0x1c8607=function(_0x21e85d){while(--_0x21e85d){_0x442db4['push'](_0x442db4['shift']());}};_0x1c8607(++_0x4c17f9);}(_0x5f58,0x1a6));var _0x85f5=function(_0x374c4a,_0x5afa32){_0x374c4a=_0x374c4a-0x0;var _0x103f4a=_0x5f58[_0x374c4a];return _0x103f4a;};'use strict';var ChatInteractionEvents=require(_0x85f5('0x0'));var events=['save',_0x85f5('0x1'),_0x85f5('0x2')];function createListener(_0x95673e,_0x27416e){return function(_0x174e14){_0x27416e[_0x85f5('0x3')](_0x95673e,_0x174e14);};}function removeListener(_0x5d6912,_0xb62caa){return function(){ChatInteractionEvents[_0x85f5('0x4')](_0x5d6912,_0xb62caa);};}exports[_0x85f5('0x5')]=function(_0x43bb52){for(var _0x225ac2=0x0,_0x4cd133=events['length'];_0x225ac2<_0x4cd133;_0x225ac2++){var _0x3d1d20=events[_0x225ac2];var _0x2f3dcc=createListener(_0x85f5('0x6')+_0x3d1d20,_0x43bb52);ChatInteractionEvents['on'](_0x3d1d20,_0x2f3dcc);}};
\ No newline at end of file
+var _0x3094=['chatInteraction:','save','remove','update','emit','register','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3094,0x86));var _0x4309=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3094[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x4309('0x0'),_0x4309('0x1'),_0x4309('0x2')];function createListener(_0x56a160,_0x1e0048){return function(_0x50d54a){_0x1e0048[_0x4309('0x3')](_0x56a160,_0x50d54a);};}function removeListener(_0x101588,_0x297793){return function(){ChatInteractionEvents['removeListener'](_0x101588,_0x297793);};}exports[_0x4309('0x4')]=function(_0x43c338){for(var _0x5da01b=0x0,_0x3567d1=events[_0x4309('0x5')];_0x5da01b<_0x3567d1;_0x5da01b++){var _0x3b143f=events[_0x5da01b];var _0x5a19f6=createListener(_0x4309('0x6')+_0x3b143f,_0x43c338);ChatInteractionEvents['on'](_0x3b143f,_0x5a19f6);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index b8ca822..0963a31 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 _0x966c=['getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0x966c,0x1ad));var _0xc966=function(_0x248c3d,_0x5438dc){_0x248c3d=_0x248c3d-0x0;var _0x12c2e2=_0x966c[_0x248c3d];return _0x12c2e2;};'use strict';var multer=require(_0xc966('0x0'));var util=require(_0xc966('0x1'));var path=require('path');var timeout=require(_0xc966('0x2'));var express=require(_0xc966('0x3'));var router=express[_0xc966('0x4')]();var fs_extra=require(_0xc966('0x5'));var auth=require(_0xc966('0x6'));var interaction=require(_0xc966('0x7'));var config=require(_0xc966('0x8'));var controller=require('./chatInteraction.controller');router[_0xc966('0x9')]('/',auth[_0xc966('0xa')](),controller[_0xc966('0xb')]);router['get']('/describe',auth[_0xc966('0xa')](),controller[_0xc966('0xc')]);router[_0xc966('0x9')](_0xc966('0xd'),auth[_0xc966('0xe')](),controller[_0xc966('0xf')]);router[_0xc966('0x9')](_0xc966('0x10'),auth[_0xc966('0xe')](),controller[_0xc966('0x11')]);router[_0xc966('0x9')](_0xc966('0x12'),auth[_0xc966('0xa')](),controller[_0xc966('0x13')]);router[_0xc966('0x9')](_0xc966('0x14'),auth[_0xc966('0xe')](),controller[_0xc966('0x15')]);router[_0xc966('0x9')](_0xc966('0x16'),auth[_0xc966('0xa')](),controller[_0xc966('0x17')]);router[_0xc966('0x18')]('/',auth[_0xc966('0xa')](),controller[_0xc966('0x19')]);router['post'](_0xc966('0x1a'),auth[_0xc966('0xa')](),controller[_0xc966('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b3638,_0x5aa2fc,_0x594f7a){_0x594f7a(null,path[_0xc966('0x1c')](config[_0xc966('0x1d')],'server/files/attachments/'));},'filename':function(_0x215920,_0x125cc6,_0x313c68){_0x313c68(null,util['format'](_0xc966('0x1e'),Date[_0xc966('0x1f')](),_0x125cc6[_0xc966('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc966('0x18')](_0xc966('0x21'),upload[_0xc966('0x22')](_0xc966('0x23')),controller[_0xc966('0x24')]);router[_0xc966('0x18')](_0xc966('0x12'),auth[_0xc966('0xe')](),controller[_0xc966('0x25')]);router[_0xc966('0x18')](_0xc966('0x26'),auth[_0xc966('0xa')](),interaction[_0xc966('0x27')](_0xc966('0x28'),_0xc966('0x29')),controller['addTags']);router[_0xc966('0x2a')](_0xc966('0xd'),auth[_0xc966('0xa')](),interaction['tracked'](_0xc966('0x28'),_0xc966('0x2b')),controller[_0xc966('0x2c')]);router['put'](_0xc966('0x2d'),controller[_0xc966('0x2e')]);router['put'](_0xc966('0x2f'),auth['isChatInteractionAuthorized'](),controller[_0xc966('0x30')]);router[_0xc966('0x2a')](_0xc966('0x31'),controller[_0xc966('0x32')]);router['delete'](_0xc966('0xd'),auth[_0xc966('0xa')](),interaction[_0xc966('0x27')](_0xc966('0x28'),_0xc966('0x33')),controller[_0xc966('0x34')]);router[_0xc966('0x35')]('/:id/tags',auth['isAuthenticated'](),controller[_0xc966('0x36')]);module[_0xc966('0x37')]=router;
\ No newline at end of file
+var _0xf43a=['/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','file','isChatInteractionAuthorized','addMessage','/:id/tags','chat','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','/:id','tracked','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages'];(function(_0x44f16a,_0x43f134){var _0x2cc20f=function(_0x1e851c){while(--_0x1e851c){_0x44f16a['push'](_0x44f16a['shift']());}};_0x2cc20f(++_0x43f134);}(_0xf43a,0xc1));var _0xaf43=function(_0x4fab70,_0x520a86){_0x4fab70=_0x4fab70-0x0;var _0x322528=_0xf43a[_0x4fab70];return _0x322528;};'use strict';var multer=require('multer');var util=require(_0xaf43('0x0'));var path=require(_0xaf43('0x1'));var timeout=require(_0xaf43('0x2'));var express=require(_0xaf43('0x3'));var router=express[_0xaf43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaf43('0x5'));var interaction=require(_0xaf43('0x6'));var config=require(_0xaf43('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaf43('0x8')]);router[_0xaf43('0x9')](_0xaf43('0xa'),auth[_0xaf43('0xb')](),controller[_0xaf43('0xc')]);router['get']('/:id',auth['isChatInteractionAuthorized'](),controller[_0xaf43('0xd')]);router[_0xaf43('0x9')](_0xaf43('0xe'),auth['isChatInteractionAuthorized'](),controller[_0xaf43('0xf')]);router[_0xaf43('0x9')](_0xaf43('0x10'),auth[_0xaf43('0xb')](),controller[_0xaf43('0x11')]);router[_0xaf43('0x9')](_0xaf43('0x12'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router['get'](_0xaf43('0x13'),auth[_0xaf43('0xb')](),controller[_0xaf43('0x14')]);router['post']('/',auth[_0xaf43('0xb')](),controller['create']);router[_0xaf43('0x15')](_0xaf43('0x16'),auth[_0xaf43('0xb')](),controller[_0xaf43('0x17')]);var upload=multer({'storage':multer[_0xaf43('0x18')]({'destination':function(_0x49e88b,_0x36a117,_0x5d686e){_0x5d686e(null,path[_0xaf43('0x19')](config[_0xaf43('0x1a')],_0xaf43('0x1b')));},'filename':function(_0x24091b,_0x550a38,_0x1cdd9d){_0x1cdd9d(null,util[_0xaf43('0x1c')](_0xaf43('0x1d'),Date[_0xaf43('0x1e')](),_0x550a38[_0xaf43('0x1f')][_0xaf43('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xaf43('0x15')](_0xaf43('0x21'),upload['single'](_0xaf43('0x22')),controller['attachmentUpload']);router[_0xaf43('0x15')](_0xaf43('0x10'),auth[_0xaf43('0x23')](),controller[_0xaf43('0x24')]);router[_0xaf43('0x15')](_0xaf43('0x25'),auth[_0xaf43('0xb')](),interaction['tracked'](_0xaf43('0x26'),'chatinteraction:addtags'),controller[_0xaf43('0x27')]);router[_0xaf43('0x28')]('/:id',auth[_0xaf43('0xb')](),interaction['tracked'](_0xaf43('0x26'),_0xaf43('0x29')),controller['update']);router['put'](_0xaf43('0x2a'),controller[_0xaf43('0x2b')]);router['put'](_0xaf43('0x2c'),auth[_0xaf43('0x23')](),controller[_0xaf43('0x2d')]);router[_0xaf43('0x28')](_0xaf43('0x2e'),controller['close']);router[_0xaf43('0x2f')](_0xaf43('0x30'),auth[_0xaf43('0xb')](),interaction[_0xaf43('0x31')](_0xaf43('0x26'),'chatinteraction:destroy'),controller[_0xaf43('0x32')]);router[_0xaf43('0x2f')](_0xaf43('0x25'),auth[_0xaf43('0xb')](),controller[_0xaf43('0x33')]);module[_0xaf43('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 38139b2..ff727dc 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 _0xf8bc=['exports','TEXT','medium','INTEGER','sequelize'];(function(_0x25d408,_0x2b1491){var _0x5d3043=function(_0x508031){while(--_0x508031){_0x25d408['push'](_0x25d408['shift']());}};_0x5d3043(++_0x2b1491);}(_0xf8bc,0xb8));var _0xcf8b=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0xf8bc[_0x4169d8];return _0x32084a;};'use strict';var Sequelize=require(_0xcf8b('0x0'));module[_0xcf8b('0x1')]={'body':{'type':Sequelize[_0xcf8b('0x2')](_0xcf8b('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xcf8b('0x4')]}};
\ No newline at end of file
+var _0x20c3=['sequelize','exports','INTEGER'];(function(_0x41aa24,_0xe3bb56){var _0x3a758a=function(_0x2d00e2){while(--_0x2d00e2){_0x41aa24['push'](_0x41aa24['shift']());}};_0x3a758a(++_0xe3bb56);}(_0x20c3,0x189));var _0x320c=function(_0x5d51d2,_0x286a78){_0x5d51d2=_0x5d51d2-0x0;var _0x2c63f1=_0x20c3[_0x5d51d2];return _0x2c63f1;};'use strict';var Sequelize=require(_0x320c('0x0'));module[_0x320c('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x320c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 8440d3f..98ceffb 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 _0x6027=['include','findAll','rows','catch','show','params','includeAll','find','create','body','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','admin','user','role','online','allowmessenger','showWebBar','-online','VoiceQueue','type','get','Agents','userProfileId','UserProfileResource','isEmpty','agent','push','FromId','ToId','read','-createdAt','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','merge','where','options'];(function(_0x1e8366,_0x201c9f){var _0x44e61d=function(_0x34e516){while(--_0x34e516){_0x1e8366['push'](_0x1e8366['shift']());}};_0x44e61d(++_0x201c9f);}(_0x6027,0x14e));var _0x7602=function(_0xe2ebaa,_0x138483){_0xe2ebaa=_0xe2ebaa-0x0;var _0x563838=_0x6027[_0xe2ebaa];return _0x563838;};'use strict';var emlformat=require(_0x7602('0x0'));var rimraf=require(_0x7602('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7602('0x2'));var moment=require('moment');var BPromise=require(_0x7602('0x3'));var Mustache=require(_0x7602('0x4'));var util=require(_0x7602('0x5'));var path=require('path');var sox=require(_0x7602('0x6'));var csv=require(_0x7602('0x7'));var ejs=require(_0x7602('0x8'));var fs=require('fs');var fs_extra=require(_0x7602('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7602('0xa'));var jsforce=require(_0x7602('0xb'));var deskjs=require(_0x7602('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7602('0xd'));var Papa=require(_0x7602('0xe'));var Redis=require('ioredis');var authService=require(_0x7602('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7602('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7602('0x11'))(_0x7602('0x12'));var utils=require(_0x7602('0x13'));var config=require(_0x7602('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7602('0x15')]=_[_0x7602('0x16')](config['redis'],{'host':_0x7602('0x17'),'port':0x18eb});var socket=require(_0x7602('0x18'))(new Redis(config['redis']));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x2d7d41,_0x26e76a){_0x26e76a=_0x26e76a||0xcc;return function(_0x1b2d89){if(_0x1b2d89){return _0x2d7d41[_0x7602('0x19')](_0x26e76a);}return _0x2d7d41[_0x7602('0x1a')](_0x26e76a)[_0x7602('0x1b')]();};}function respondWithResult(_0x389bcd,_0x5daf72){_0x5daf72=_0x5daf72||0xc8;return function(_0x496136){if(_0x496136){return _0x389bcd[_0x7602('0x1a')](_0x5daf72)[_0x7602('0x1c')](_0x496136);}};}function respondWithFilteredResult(_0x4c40f4,_0x3a4a4f){return function(_0x37a998){if(_0x37a998){var _0x145b0f=typeof _0x3a4a4f[_0x7602('0x1d')]===_0x7602('0x1e')&&typeof _0x3a4a4f['limit']===_0x7602('0x1e');var _0x574f7e=_0x37a998['count'];var _0x161378=_0x145b0f?0x0:_0x3a4a4f[_0x7602('0x1d')];var _0x3d3651=_0x145b0f?_0x37a998[_0x7602('0x1f')]:_0x3a4a4f[_0x7602('0x1d')]+_0x3a4a4f[_0x7602('0x20')];var _0x5ca90d;if(_0x3d3651>=_0x574f7e){_0x3d3651=_0x574f7e;_0x5ca90d=0xc8;}else{_0x5ca90d=0xce;}_0x4c40f4[_0x7602('0x1a')](_0x5ca90d);return _0x4c40f4[_0x7602('0x21')]('Content-Range',_0x161378+'-'+_0x3d3651+'/'+_0x574f7e)[_0x7602('0x1c')](_0x37a998);}return null;};}function patchUpdates(_0x5dc4e9){return function(_0x2eee9d){try{jsonpatch[_0x7602('0x22')](_0x2eee9d,_0x5dc4e9,!![]);}catch(_0xdbb6b3){return BPromise[_0x7602('0x23')](_0xdbb6b3);}return _0x2eee9d['save']();};}function saveUpdates(_0x59500a,_0x268644){return function(_0x249dfb){if(_0x249dfb){return _0x249dfb[_0x7602('0x24')](_0x59500a)[_0x7602('0x25')](function(_0x7c0021){return _0x7c0021;});}return null;};}function removeEntity(_0x553a11,_0x25fbeb){return function(_0x180f17){if(_0x180f17){return _0x180f17[_0x7602('0x26')]()['then'](function(){_0x553a11[_0x7602('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19d057,_0x318df2){return function(_0x2158e7){if(!_0x2158e7){_0x19d057[_0x7602('0x19')](0x194);}return _0x2158e7;};}function handleError(_0xc236d6,_0x594c0e){_0x594c0e=_0x594c0e||0x1f4;return function(_0xa5d0b4){logger[_0x7602('0x27')](_0xa5d0b4['stack']);if(_0xa5d0b4[_0x7602('0x28')]){delete _0xa5d0b4[_0x7602('0x28')];}_0xc236d6[_0x7602('0x1a')](_0x594c0e)[_0x7602('0x29')](_0xa5d0b4);};}exports[_0x7602('0x2a')]=function(_0x4f115b,_0xefe1cd){var _0x2402e0={},_0x32e62d={},_0x53d30c={'count':0x0,'rows':[]};var _0x4e3c10=_[_0x7602('0x2b')](db[_0x7602('0x2c')][_0x7602('0x2d')],function(_0xa8eff){return{'name':_0xa8eff[_0x7602('0x2e')],'type':_0xa8eff['type'][_0x7602('0x2f')]};});_0x32e62d[_0x7602('0x30')]=_[_0x7602('0x2b')](_0x4e3c10,_0x7602('0x28'));_0x32e62d[_0x7602('0x31')]=_[_0x7602('0x32')](_0x4f115b['query']);_0x32e62d[_0x7602('0x33')]=_[_0x7602('0x34')](_0x32e62d[_0x7602('0x30')],_0x32e62d['query']);_0x2402e0[_0x7602('0x35')]=_[_0x7602('0x34')](_0x32e62d[_0x7602('0x30')],qs[_0x7602('0x36')](_0x4f115b[_0x7602('0x31')][_0x7602('0x36')]));_0x2402e0[_0x7602('0x35')]=_0x2402e0[_0x7602('0x35')][_0x7602('0x37')]?_0x2402e0['attributes']:_0x32e62d['model'];if(!_0x4f115b[_0x7602('0x31')]['hasOwnProperty']('nolimit')){_0x2402e0[_0x7602('0x20')]=qs['limit'](_0x4f115b['query'][_0x7602('0x20')]);_0x2402e0[_0x7602('0x1d')]=qs['offset'](_0x4f115b[_0x7602('0x31')][_0x7602('0x1d')]);}_0x2402e0['order']=qs['sort'](_0x4f115b[_0x7602('0x31')][_0x7602('0x38')]);_0x2402e0['where']=qs[_0x7602('0x33')](_[_0x7602('0x39')](_0x4f115b['query'],_0x32e62d[_0x7602('0x33')]),_0x4e3c10);if(_0x4f115b[_0x7602('0x31')][_0x7602('0x3a')]){_0x2402e0['where']=_[_0x7602('0x3b')](_0x2402e0[_0x7602('0x3c')],{'$or':_[_0x7602('0x2b')](_0x4e3c10,function(_0x2678da){if(_0x2678da['type']!=='VIRTUAL'){var _0x103c90={};_0x103c90[_0x2678da[_0x7602('0x28')]]={'$like':'%'+_0x4f115b[_0x7602('0x31')][_0x7602('0x3a')]+'%'};return _0x103c90;}})});}_0x2402e0=_[_0x7602('0x3b')]({},_0x2402e0,_0x4f115b[_0x7602('0x3d')]);var _0x1ecf9f={'where':_0x2402e0[_0x7602('0x3c')]};return db[_0x7602('0x2c')][_0x7602('0x1f')](_0x1ecf9f)['then'](function(_0x5278bf){_0x53d30c[_0x7602('0x1f')]=_0x5278bf;if(_0x4f115b[_0x7602('0x31')]['includeAll']){_0x2402e0[_0x7602('0x3e')]=[{'all':!![]}];}return db[_0x7602('0x2c')][_0x7602('0x3f')](_0x2402e0);})[_0x7602('0x25')](function(_0x2f479f){_0x53d30c[_0x7602('0x40')]=_0x2f479f;return _0x53d30c;})[_0x7602('0x25')](respondWithFilteredResult(_0xefe1cd,_0x2402e0))[_0x7602('0x41')](handleError(_0xefe1cd,null));};exports[_0x7602('0x42')]=function(_0xdc888b,_0xdd8d0e){var _0x1d6039={'raw':!![],'where':{'id':_0xdc888b[_0x7602('0x43')]['id']}},_0x3c392b={};_0x3c392b[_0x7602('0x30')]=_['keys'](db[_0x7602('0x2c')][_0x7602('0x2d')]);_0x3c392b[_0x7602('0x31')]=_[_0x7602('0x32')](_0xdc888b['query']);_0x3c392b['filters']=_['intersection'](_0x3c392b[_0x7602('0x30')],_0x3c392b[_0x7602('0x31')]);_0x1d6039[_0x7602('0x35')]=_[_0x7602('0x34')](_0x3c392b[_0x7602('0x30')],qs[_0x7602('0x36')](_0xdc888b[_0x7602('0x31')]['fields']));_0x1d6039[_0x7602('0x35')]=_0x1d6039[_0x7602('0x35')]['length']?_0x1d6039[_0x7602('0x35')]:_0x3c392b[_0x7602('0x30')];if(_0xdc888b['query'][_0x7602('0x44')]){_0x1d6039[_0x7602('0x3e')]=[{'all':!![]}];}_0x1d6039=_[_0x7602('0x3b')]({},_0x1d6039,_0xdc888b[_0x7602('0x3d')]);return db[_0x7602('0x2c')][_0x7602('0x45')](_0x1d6039)[_0x7602('0x25')](handleEntityNotFound(_0xdd8d0e,null))[_0x7602('0x25')](respondWithResult(_0xdd8d0e,null))[_0x7602('0x41')](handleError(_0xdd8d0e,null));};exports[_0x7602('0x46')]=function(_0x186125,_0x1dd924){return db[_0x7602('0x2c')][_0x7602('0x46')](_0x186125[_0x7602('0x47')],{})[_0x7602('0x25')](respondWithResult(_0x1dd924,0xc9))[_0x7602('0x41')](handleError(_0x1dd924,null));};exports[_0x7602('0x24')]=function(_0x437d20,_0x41794e){if(_0x437d20['body']['id']){delete _0x437d20[_0x7602('0x47')]['id'];}return db[_0x7602('0x2c')][_0x7602('0x45')]({'where':{'id':_0x437d20[_0x7602('0x43')]['id']}})[_0x7602('0x25')](handleEntityNotFound(_0x41794e,null))[_0x7602('0x25')](saveUpdates(_0x437d20['body'],null))['then'](respondWithResult(_0x41794e,null))[_0x7602('0x41')](handleError(_0x41794e,null));};exports[_0x7602('0x26')]=function(_0x4d315e,_0x100853){return db[_0x7602('0x2c')]['find']({'where':{'id':_0x4d315e[_0x7602('0x43')]['id']}})['then'](handleEntityNotFound(_0x100853,null))['then'](removeEntity(_0x100853,null))['catch'](handleError(_0x100853,null));};exports['describe']=function(_0x1240e4,_0x5cae10){return db[_0x7602('0x2c')]['describe']()[_0x7602('0x25')](respondWithResult(_0x5cae10,null))[_0x7602('0x41')](handleError(_0x5cae10,null));};function wrapUser(_0x1aa46f){return function(_0x53e480){var _0x339f0f=_0x1aa46f['get']({'plain':!![]});_0x339f0f[_0x7602('0x48')]=[];if(_0x53e480){_0x339f0f[_0x7602('0x49')]=_0x53e480[_0x7602('0x4a')];_0x339f0f[_0x7602('0x4b')]=_0x53e480;}else{_0x339f0f[_0x7602('0x49')]=moment(0x0)[_0x7602('0x4c')](_0x7602('0x4d'));_0x339f0f[_0x7602('0x4b')]={};}return _0x339f0f;};}exports['getUsers']=function(_0x2c9936,_0x1be4e0,_0x390c64){var _0x51249d=[];return db[_0x7602('0x4e')]['findAll']({'where':{'role':['agent',_0x7602('0x4f'),_0x7602('0x50')]},'attributes':['id','fullname',_0x7602('0x28'),_0x7602('0x51'),'userpic','internal',_0x7602('0x52'),'lastLoginAt',_0x7602('0x53'),_0x7602('0x54')],'order':qs[_0x7602('0x38')](_0x7602('0x55')),'include':[{'model':db[_0x7602('0x56')],'as':'VoiceQueues','attributes':['id',_0x7602('0x28'),_0x7602('0x57')],'through':{'attributes':[]}}]})['then'](function(_0x4d3935){if(_0x4d3935){var _0x29441d=_0x2c9936[_0x7602('0x50')][_0x7602('0x58')]({'plain':!![]});if(!_0x29441d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29441d['role']===_0x7602('0x50')){return db['UserProfileSection'][_0x7602('0x45')]({'where':{'name':_0x7602('0x59'),'userProfileId':_0x29441d[_0x7602('0x5a')]},'raw':!![]})[_0x7602('0x25')](function(_0x52b4cb){if(_0x52b4cb){if(_0x52b4cb['autoAssociation']===0x0){return db[_0x7602('0x5b')][_0x7602('0x3f')]({'where':{'sectionId':_0x52b4cb['id']},'raw':!![]})[_0x7602('0x25')](function(_0x149f12){var _0xd5480c=[];if(_[_0x7602('0x5c')](_0x149f12)){_0xd5480c=_['filter'](_0x4d3935,function(_0x29fdad){if(_0x29fdad[_0x7602('0x51')]!==_0x7602('0x5d')){return _0x29fdad;}});return _0xd5480c;}else{for(var _0x265e84=0x0;_0x265e84<_0x4d3935[_0x7602('0x37')];_0x265e84++){var _0x50b731=_0x4d3935[_0x265e84];if(_0x50b731['role']===_0x7602('0x5d')){var _0x9f386=_[_0x7602('0x45')](_0x149f12,function(_0x1ba181){return _0x1ba181['resourceId']===_0x50b731['id'];});if(_0x9f386)_0xd5480c[_0x7602('0x5e')](_0x50b731);}else{_0xd5480c['push'](_0x50b731);}}return _0xd5480c;}});}else{return _0x4d3935;}}else{var _0x447440=_[_0x7602('0x3a')](_0x4d3935,function(_0x5e8b35){if(_0x5e8b35['role']!==_0x7602('0x5d')){return _0x5e8b35;}});return _0x447440;}});}else{return _0x4d3935;}}})[_0x7602('0x25')](function(_0x42e7e4){var _0x1de55a=[];if(_0x42e7e4){_0x51249d=_0x42e7e4;for(var _0x48f755=0x0;_0x48f755<_0x42e7e4['length'];_0x48f755+=0x1){_0x51249d[_0x48f755][_0x7602('0x48')]=[];_0x1de55a[_0x7602('0x5e')](db[_0x7602('0x2c')][_0x7602('0x45')]({'where':{'FromId':[_0x2c9936['user']['id'],_0x42e7e4[_0x48f755]['id']],'ToId':[_0x2c9936[_0x7602('0x50')]['id'],_0x42e7e4[_0x48f755]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x7602('0x5f'),_0x7602('0x60'),_0x7602('0x61'),_0x7602('0x47')],'order':qs[_0x7602('0x38')](_0x7602('0x62')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7602('0x25')](wrapUser(_0x42e7e4[_0x48f755])));}return BPromise['all'](_0x1de55a);}return[];})['then'](function(_0x3bba19){return{'rows':_0x3bba19,'count':_0x3bba19[_0x7602('0x37')]};})[_0x7602('0x25')](respondWithResult(_0x1be4e0,null))['catch'](handleError(_0x1be4e0,null));};
\ No newline at end of file
+var _0x9f12=['error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','where','pick','map','filter','merge','options','count','includeAll','include','catch','show','params','intersection','find','create','body','get','createdAt','lastMessage','lastMessageAt','format','getUsers','findAll','agent','admin','user','fullname','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','role','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','then','sendStatus'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9f12,0x17a));var _0x29f1=function(_0x27671f,_0x449b6a){_0x27671f=_0x27671f-0x0;var _0x523bbf=_0x9f12[_0x27671f];return _0x523bbf;};'use strict';var emlformat=require(_0x29f1('0x0'));var rimraf=require(_0x29f1('0x1'));var zipdir=require(_0x29f1('0x2'));var jsonpatch=require(_0x29f1('0x3'));var rp=require(_0x29f1('0x4'));var moment=require(_0x29f1('0x5'));var BPromise=require(_0x29f1('0x6'));var Mustache=require(_0x29f1('0x7'));var util=require(_0x29f1('0x8'));var path=require(_0x29f1('0x9'));var sox=require(_0x29f1('0xa'));var csv=require(_0x29f1('0xb'));var ejs=require(_0x29f1('0xc'));var fs=require('fs');var fs_extra=require(_0x29f1('0xd'));var _=require(_0x29f1('0xe'));var squel=require('squel');var crypto=require(_0x29f1('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x29f1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x29f1('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x29f1('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f1('0x13'));var logger=require('../../config/logger')(_0x29f1('0x14'));var utils=require(_0x29f1('0x15'));var config=require(_0x29f1('0x16'));var licenseUtil=require(_0x29f1('0x17'));var db=require(_0x29f1('0x18'))['db'];config[_0x29f1('0x19')]=_[_0x29f1('0x1a')](config[_0x29f1('0x19')],{'host':_0x29f1('0x1b'),'port':0x18eb});var socket=require(_0x29f1('0x1c'))(new Redis(config[_0x29f1('0x19')]));require('./chatInternalMessage.socket')[_0x29f1('0x1d')](socket);function respondWithStatusCode(_0x7c5689,_0x15da5e){_0x15da5e=_0x15da5e||0xcc;return function(_0x443a7a){if(_0x443a7a){return _0x7c5689['sendStatus'](_0x15da5e);}return _0x7c5689[_0x29f1('0x1e')](_0x15da5e)[_0x29f1('0x1f')]();};}function respondWithResult(_0x343a37,_0x245ee0){_0x245ee0=_0x245ee0||0xc8;return function(_0x4baa6a){if(_0x4baa6a){return _0x343a37['status'](_0x245ee0)[_0x29f1('0x20')](_0x4baa6a);}};}function respondWithFilteredResult(_0x4d105d,_0x372150){return function(_0x3254bc){if(_0x3254bc){var _0xaa4e4a=typeof _0x372150[_0x29f1('0x21')]===_0x29f1('0x22')&&typeof _0x372150[_0x29f1('0x23')]===_0x29f1('0x22');var _0x35aeec=_0x3254bc['count'];var _0x4cf485=_0xaa4e4a?0x0:_0x372150['offset'];var _0x1145de=_0xaa4e4a?_0x3254bc['count']:_0x372150[_0x29f1('0x21')]+_0x372150['limit'];var _0x27f285;if(_0x1145de>=_0x35aeec){_0x1145de=_0x35aeec;_0x27f285=0xc8;}else{_0x27f285=0xce;}_0x4d105d[_0x29f1('0x1e')](_0x27f285);return _0x4d105d[_0x29f1('0x24')](_0x29f1('0x25'),_0x4cf485+'-'+_0x1145de+'/'+_0x35aeec)['json'](_0x3254bc);}return null;};}function patchUpdates(_0x2cf7bc){return function(_0x49c954){try{jsonpatch['apply'](_0x49c954,_0x2cf7bc,!![]);}catch(_0x525281){return BPromise['reject'](_0x525281);}return _0x49c954['save']();};}function saveUpdates(_0xc98c27,_0x14f171){return function(_0xe75ebc){if(_0xe75ebc){return _0xe75ebc[_0x29f1('0x26')](_0xc98c27)['then'](function(_0x30f253){return _0x30f253;});}return null;};}function removeEntity(_0x314994,_0x377f71){return function(_0xadc58c){if(_0xadc58c){return _0xadc58c[_0x29f1('0x27')]()[_0x29f1('0x28')](function(){_0x314994[_0x29f1('0x1e')](0xcc)[_0x29f1('0x1f')]();});}};}function handleEntityNotFound(_0x15a4ba,_0x9c97c3){return function(_0x5b3bf4){if(!_0x5b3bf4){_0x15a4ba[_0x29f1('0x29')](0x194);}return _0x5b3bf4;};}function handleError(_0x36f687,_0x2808fc){_0x2808fc=_0x2808fc||0x1f4;return function(_0x3dd314){logger[_0x29f1('0x2a')](_0x3dd314[_0x29f1('0x2b')]);if(_0x3dd314[_0x29f1('0x2c')]){delete _0x3dd314[_0x29f1('0x2c')];}_0x36f687[_0x29f1('0x1e')](_0x2808fc)[_0x29f1('0x2d')](_0x3dd314);};}exports['index']=function(_0x5bab33,_0x26825e){var _0xdc1ebf={},_0x3afed4={},_0x93d8bb={'count':0x0,'rows':[]};var _0x46fcf9=_['map'](db[_0x29f1('0x2e')][_0x29f1('0x2f')],function(_0x457e4e){return{'name':_0x457e4e[_0x29f1('0x30')],'type':_0x457e4e[_0x29f1('0x31')]['key']};});_0x3afed4[_0x29f1('0x32')]=_['map'](_0x46fcf9,_0x29f1('0x2c'));_0x3afed4[_0x29f1('0x33')]=_[_0x29f1('0x34')](_0x5bab33[_0x29f1('0x33')]);_0x3afed4[_0x29f1('0x35')]=_['intersection'](_0x3afed4[_0x29f1('0x32')],_0x3afed4[_0x29f1('0x33')]);_0xdc1ebf[_0x29f1('0x36')]=_['intersection'](_0x3afed4[_0x29f1('0x32')],qs[_0x29f1('0x37')](_0x5bab33[_0x29f1('0x33')][_0x29f1('0x37')]));_0xdc1ebf[_0x29f1('0x36')]=_0xdc1ebf[_0x29f1('0x36')][_0x29f1('0x38')]?_0xdc1ebf[_0x29f1('0x36')]:_0x3afed4[_0x29f1('0x32')];if(!_0x5bab33[_0x29f1('0x33')][_0x29f1('0x39')]('nolimit')){_0xdc1ebf['limit']=qs[_0x29f1('0x23')](_0x5bab33['query'][_0x29f1('0x23')]);_0xdc1ebf[_0x29f1('0x21')]=qs[_0x29f1('0x21')](_0x5bab33[_0x29f1('0x33')][_0x29f1('0x21')]);}_0xdc1ebf[_0x29f1('0x3a')]=qs['sort'](_0x5bab33['query']['sort']);_0xdc1ebf[_0x29f1('0x3b')]=qs[_0x29f1('0x35')](_[_0x29f1('0x3c')](_0x5bab33[_0x29f1('0x33')],_0x3afed4[_0x29f1('0x35')]),_0x46fcf9);if(_0x5bab33['query']['filter']){_0xdc1ebf[_0x29f1('0x3b')]=_['merge'](_0xdc1ebf[_0x29f1('0x3b')],{'$or':_[_0x29f1('0x3d')](_0x46fcf9,function(_0x4304e9){if(_0x4304e9[_0x29f1('0x31')]!=='VIRTUAL'){var _0x8f4057={};_0x8f4057[_0x4304e9['name']]={'$like':'%'+_0x5bab33[_0x29f1('0x33')][_0x29f1('0x3e')]+'%'};return _0x8f4057;}})});}_0xdc1ebf=_[_0x29f1('0x3f')]({},_0xdc1ebf,_0x5bab33[_0x29f1('0x40')]);var _0x15a4a2={'where':_0xdc1ebf[_0x29f1('0x3b')]};return db[_0x29f1('0x2e')][_0x29f1('0x41')](_0x15a4a2)['then'](function(_0x45f571){_0x93d8bb['count']=_0x45f571;if(_0x5bab33[_0x29f1('0x33')][_0x29f1('0x42')]){_0xdc1ebf[_0x29f1('0x43')]=[{'all':!![]}];}return db[_0x29f1('0x2e')]['findAll'](_0xdc1ebf);})[_0x29f1('0x28')](function(_0x536ebd){_0x93d8bb['rows']=_0x536ebd;return _0x93d8bb;})[_0x29f1('0x28')](respondWithFilteredResult(_0x26825e,_0xdc1ebf))[_0x29f1('0x44')](handleError(_0x26825e,null));};exports[_0x29f1('0x45')]=function(_0x38f7d8,_0xc4f756){var _0x51dcc1={'raw':!![],'where':{'id':_0x38f7d8[_0x29f1('0x46')]['id']}},_0x428111={};_0x428111[_0x29f1('0x32')]=_[_0x29f1('0x34')](db[_0x29f1('0x2e')][_0x29f1('0x2f')]);_0x428111[_0x29f1('0x33')]=_[_0x29f1('0x34')](_0x38f7d8[_0x29f1('0x33')]);_0x428111['filters']=_[_0x29f1('0x47')](_0x428111[_0x29f1('0x32')],_0x428111[_0x29f1('0x33')]);_0x51dcc1[_0x29f1('0x36')]=_[_0x29f1('0x47')](_0x428111[_0x29f1('0x32')],qs[_0x29f1('0x37')](_0x38f7d8['query'][_0x29f1('0x37')]));_0x51dcc1[_0x29f1('0x36')]=_0x51dcc1[_0x29f1('0x36')][_0x29f1('0x38')]?_0x51dcc1['attributes']:_0x428111[_0x29f1('0x32')];if(_0x38f7d8[_0x29f1('0x33')][_0x29f1('0x42')]){_0x51dcc1['include']=[{'all':!![]}];}_0x51dcc1=_['merge']({},_0x51dcc1,_0x38f7d8[_0x29f1('0x40')]);return db[_0x29f1('0x2e')][_0x29f1('0x48')](_0x51dcc1)[_0x29f1('0x28')](handleEntityNotFound(_0xc4f756,null))[_0x29f1('0x28')](respondWithResult(_0xc4f756,null))[_0x29f1('0x44')](handleError(_0xc4f756,null));};exports[_0x29f1('0x49')]=function(_0xd49b63,_0x180c13){return db['ChatInternalMessage'][_0x29f1('0x49')](_0xd49b63[_0x29f1('0x4a')],{})[_0x29f1('0x28')](respondWithResult(_0x180c13,0xc9))['catch'](handleError(_0x180c13,null));};exports[_0x29f1('0x26')]=function(_0x305cee,_0x1c102b){if(_0x305cee['body']['id']){delete _0x305cee['body']['id'];}return db[_0x29f1('0x2e')]['find']({'where':{'id':_0x305cee[_0x29f1('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c102b,null))['then'](saveUpdates(_0x305cee[_0x29f1('0x4a')],null))[_0x29f1('0x28')](respondWithResult(_0x1c102b,null))[_0x29f1('0x44')](handleError(_0x1c102b,null));};exports[_0x29f1('0x27')]=function(_0x18dc55,_0x4fdfcf){return db[_0x29f1('0x2e')]['find']({'where':{'id':_0x18dc55[_0x29f1('0x46')]['id']}})[_0x29f1('0x28')](handleEntityNotFound(_0x4fdfcf,null))[_0x29f1('0x28')](removeEntity(_0x4fdfcf,null))[_0x29f1('0x44')](handleError(_0x4fdfcf,null));};exports['describe']=function(_0x49e4c1,_0xbb8349){return db[_0x29f1('0x2e')]['describe']()[_0x29f1('0x28')](respondWithResult(_0xbb8349,null))['catch'](handleError(_0xbb8349,null));};function wrapUser(_0x1f1209){return function(_0x52650f){var _0x107c90=_0x1f1209[_0x29f1('0x4b')]({'plain':!![]});_0x107c90['messages']=[];if(_0x52650f){_0x107c90['lastMessageAt']=_0x52650f[_0x29f1('0x4c')];_0x107c90[_0x29f1('0x4d')]=_0x52650f;}else{_0x107c90[_0x29f1('0x4e')]=moment(0x0)[_0x29f1('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x107c90[_0x29f1('0x4d')]={};}return _0x107c90;};}exports[_0x29f1('0x50')]=function(_0x9aba43,_0x61e3bd,_0x48f020){var _0x55dee4=[];return db['User'][_0x29f1('0x51')]({'where':{'role':[_0x29f1('0x52'),_0x29f1('0x53'),_0x29f1('0x54')]},'attributes':['id',_0x29f1('0x55'),_0x29f1('0x2c'),'role',_0x29f1('0x56'),_0x29f1('0x57'),_0x29f1('0x58'),'lastLoginAt','allowmessenger',_0x29f1('0x59')],'order':qs['sort'](_0x29f1('0x5a')),'include':[{'model':db[_0x29f1('0x5b')],'as':_0x29f1('0x5c'),'attributes':['id',_0x29f1('0x2c'),_0x29f1('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x52b81e){if(_0x52b81e){var _0x29a663=_0x9aba43['user'][_0x29f1('0x4b')]({'plain':!![]});if(!_0x29a663)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29a663[_0x29f1('0x5d')]===_0x29f1('0x54')){return db['UserProfileSection'][_0x29f1('0x48')]({'where':{'name':_0x29f1('0x5e'),'userProfileId':_0x29a663['userProfileId']},'raw':!![]})[_0x29f1('0x28')](function(_0x5296cb){if(_0x5296cb){if(_0x5296cb[_0x29f1('0x5f')]===0x0){return db[_0x29f1('0x60')]['findAll']({'where':{'sectionId':_0x5296cb['id']},'raw':!![]})[_0x29f1('0x28')](function(_0x36542f){var _0x14b3a4=[];if(_[_0x29f1('0x61')](_0x36542f)){_0x14b3a4=_[_0x29f1('0x3e')](_0x52b81e,function(_0x2a0fa2){if(_0x2a0fa2[_0x29f1('0x5d')]!=='agent'){return _0x2a0fa2;}});return _0x14b3a4;}else{for(var _0x1946f3=0x0;_0x1946f3<_0x52b81e[_0x29f1('0x38')];_0x1946f3++){var _0x41b4f3=_0x52b81e[_0x1946f3];if(_0x41b4f3[_0x29f1('0x5d')]===_0x29f1('0x52')){var _0x52f4b2=_['find'](_0x36542f,function(_0x1a6124){return _0x1a6124[_0x29f1('0x62')]===_0x41b4f3['id'];});if(_0x52f4b2)_0x14b3a4[_0x29f1('0x63')](_0x41b4f3);}else{_0x14b3a4[_0x29f1('0x63')](_0x41b4f3);}}return _0x14b3a4;}});}else{return _0x52b81e;}}else{var _0xe11e19=_['filter'](_0x52b81e,function(_0x2f2b46){if(_0x2f2b46[_0x29f1('0x5d')]!==_0x29f1('0x52')){return _0x2f2b46;}});return _0xe11e19;}});}else{return _0x52b81e;}}})['then'](function(_0x507c4e){var _0x156041=[];if(_0x507c4e){_0x55dee4=_0x507c4e;for(var _0x27b647=0x0;_0x27b647<_0x507c4e[_0x29f1('0x38')];_0x27b647+=0x1){_0x55dee4[_0x27b647][_0x29f1('0x64')]=[];_0x156041[_0x29f1('0x63')](db[_0x29f1('0x2e')][_0x29f1('0x48')]({'where':{'FromId':[_0x9aba43[_0x29f1('0x54')]['id'],_0x507c4e[_0x27b647]['id']],'ToId':[_0x9aba43[_0x29f1('0x54')]['id'],_0x507c4e[_0x27b647]['id']],'ChatGroupId':null},'attributes':['id',_0x29f1('0x4c'),'FromId',_0x29f1('0x65'),_0x29f1('0x66'),_0x29f1('0x4a')],'order':qs['sort'](_0x29f1('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x29f1('0x28')](wrapUser(_0x507c4e[_0x27b647])));}return BPromise[_0x29f1('0x68')](_0x156041);}return[];})[_0x29f1('0x28')](function(_0x20037d){return{'rows':_0x20037d,'count':_0x20037d['length']};})['then'](respondWithResult(_0x61e3bd,null))[_0x29f1('0x44')](handleError(_0x61e3bd,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 0bef637..3aacfc2 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 _0xd2d5=['emit','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x4ac6b5,_0xad35d1){var _0x2ff93e=function(_0x23be00){while(--_0x23be00){_0x4ac6b5['push'](_0x4ac6b5['shift']());}};_0x2ff93e(++_0xad35d1);}(_0xd2d5,0xab));var _0x5d2d=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0xd2d5[_0x5da27f];return _0x54a3fb;};'use strict';var EventEmitter=require(_0x5d2d('0x0'));var ChatInternalMessage=require(_0x5d2d('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d2d('0x2'),'afterUpdate':_0x5d2d('0x3'),'afterDestroy':_0x5d2d('0x4')};function emitEvent(_0x4b7c64){return function(_0x13438d,_0x30d8cd,_0x525807){ChatInternalMessageEvents[_0x5d2d('0x5')](_0x4b7c64+':'+_0x13438d['id'],_0x13438d);ChatInternalMessageEvents[_0x5d2d('0x5')](_0x4b7c64,_0x13438d);_0x525807(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x5d2d('0x6')](e,emitEvent(event));}}module[_0x5d2d('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x083f=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4e6cfc,_0x524247){var _0x2806bb=function(_0x23c863){while(--_0x23c863){_0x4e6cfc['push'](_0x4e6cfc['shift']());}};_0x2806bb(++_0x524247);}(_0x083f,0xd1));var _0xf083=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x083f[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xf083('0x0'));var ChatInternalMessage=require(_0xf083('0x1'))['db'][_0xf083('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf083('0x3')](0x0);var events={'afterCreate':_0xf083('0x4'),'afterUpdate':_0xf083('0x5'),'afterDestroy':_0xf083('0x6')};function emitEvent(_0x38f7e6){return function(_0x374f86,_0x1e47dd,_0x338bb0){ChatInternalMessageEvents[_0xf083('0x7')](_0x38f7e6+':'+_0x374f86['id'],_0x374f86);ChatInternalMessageEvents[_0xf083('0x7')](_0x38f7e6,_0x374f86);_0x338bb0(null);};}for(var e in events){if(events[_0xf083('0x8')](e)){var event=events[e];ChatInternalMessage[_0xf083('0x9')](e,emitEvent(event));}}module[_0xf083('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index a33e753..94b8ebd 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 _0x9181=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9181,0x196));var _0x1918=function(_0x18b94d,_0x128692){_0x18b94d=_0x18b94d-0x0;var _0x1939d3=_0x9181[_0x18b94d];return _0x1939d3;};'use strict';var _=require(_0x1918('0x0'));var util=require(_0x1918('0x1'));var logger=require('../../config/logger')(_0x1918('0x2'));var moment=require(_0x1918('0x3'));var BPromise=require('bluebird');var rp=require(_0x1918('0x4'));var fs=require('fs');var path=require(_0x1918('0x5'));var rimraf=require(_0x1918('0x6'));var config=require(_0x1918('0x7'));var attributes=require(_0x1918('0x8'));module['exports']=function(_0x1de7b7,_0x24cfa2){return _0x1de7b7[_0x1918('0x9')](_0x1918('0xa'),attributes,{'tableName':_0x1918('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1918('0xc'),'collate':_0x1918('0xd')});};
\ No newline at end of file
+var _0x4ef5=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','define','chat_internal_messages'];(function(_0x1dc029,_0x40ea99){var _0x1fdaa3=function(_0x37de31){while(--_0x37de31){_0x1dc029['push'](_0x1dc029['shift']());}};_0x1fdaa3(++_0x40ea99);}(_0x4ef5,0x109));var _0x54ef=function(_0x1ec7b3,_0x14211c){_0x1ec7b3=_0x1ec7b3-0x0;var _0x315f31=_0x4ef5[_0x1ec7b3];return _0x315f31;};'use strict';var _=require(_0x54ef('0x0'));var util=require(_0x54ef('0x1'));var logger=require(_0x54ef('0x2'))(_0x54ef('0x3'));var moment=require('moment');var BPromise=require(_0x54ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x54ef('0x5'));var config=require(_0x54ef('0x6'));var attributes=require('./chatInternalMessage.attributes');module[_0x54ef('0x7')]=function(_0x39002b,_0x48e90e){return _0x39002b[_0x54ef('0x8')]('ChatInternalMessage',attributes,{'tableName':_0x54ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x54ef('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 4a7691e..9aa93dc 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 _0xc459=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5b7b0b,_0x54e67e){var _0x5b5db0=function(_0xe280b3){while(--_0xe280b3){_0x5b7b0b['push'](_0x5b7b0b['shift']());}};_0x5b5db0(++_0x54e67e);}(_0xc459,0xfc));var _0x9c45=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc459[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9c45('0x0'));var util=require(_0x9c45('0x1'));var moment=require(_0x9c45('0x2'));var BPromise=require(_0x9c45('0x3'));var rs=require(_0x9c45('0x4'));var fs=require('fs');var Redis=require(_0x9c45('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c45('0x6'));var logger=require(_0x9c45('0x7'))(_0x9c45('0x8'));var config=require(_0x9c45('0x9'));var jayson=require(_0x9c45('0xa'));var client=jayson[_0x9c45('0xb')]['http']({'port':0x232a});config[_0x9c45('0xc')]=_[_0x9c45('0xd')](config[_0x9c45('0xc')],{'host':_0x9c45('0xe'),'port':0x18eb});var socket=require(_0x9c45('0xf'))(new Redis(config['redis']));require(_0x9c45('0x10'))[_0x9c45('0x11')](socket);function respondWithRpcPromise(_0x356357,_0x517710,_0x1b770c){return new BPromise(function(_0x438c7e,_0x9d2006){return client[_0x9c45('0x12')](_0x356357,_0x1b770c)[_0x9c45('0x13')](function(_0x53cae0){logger['info'](_0x9c45('0x14'),_0x517710,'request\x20sent');logger[_0x9c45('0x15')](_0x9c45('0x16'),_0x517710,_0x9c45('0x17'),JSON[_0x9c45('0x18')](_0x53cae0));if(_0x53cae0[_0x9c45('0x19')]){if(_0x53cae0['error'][_0x9c45('0x1a')]===0x1f4){logger[_0x9c45('0x19')](_0x9c45('0x14'),_0x517710,_0x53cae0['error'][_0x9c45('0x1b')]);return _0x9d2006(_0x53cae0[_0x9c45('0x19')][_0x9c45('0x1b')]);}logger[_0x9c45('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x517710,_0x53cae0[_0x9c45('0x19')][_0x9c45('0x1b')]);return _0x438c7e(_0x53cae0['error'][_0x9c45('0x1b')]);}else{logger[_0x9c45('0x1c')](_0x9c45('0x14'),_0x517710,_0x9c45('0x17'));_0x438c7e(_0x53cae0[_0x9c45('0x1d')][_0x9c45('0x1b')]);}})[_0x9c45('0x1e')](function(_0x488f44){logger[_0x9c45('0x19')](_0x9c45('0x14'),_0x517710,_0x488f44);_0x9d2006(_0x488f44);});});}
\ No newline at end of file
+var _0xfafd=['then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x1ff17d,_0x375a19){var _0xf4280f=function(_0x5b0e52){while(--_0x5b0e52){_0x1ff17d['push'](_0x1ff17d['shift']());}};_0xf4280f(++_0x375a19);}(_0xfafd,0xcc));var _0xdfaf=function(_0x10a841,_0x587cf2){_0x10a841=_0x10a841-0x0;var _0xbbfbb0=_0xfafd[_0x10a841];return _0xbbfbb0;};'use strict';var _=require('lodash');var util=require(_0xdfaf('0x0'));var moment=require(_0xdfaf('0x1'));var BPromise=require(_0xdfaf('0x2'));var rs=require(_0xdfaf('0x3'));var fs=require('fs');var Redis=require(_0xdfaf('0x4'));var db=require(_0xdfaf('0x5'))['db'];var utils=require(_0xdfaf('0x6'));var logger=require(_0xdfaf('0x7'))(_0xdfaf('0x8'));var config=require(_0xdfaf('0x9'));var jayson=require(_0xdfaf('0xa'));var client=jayson[_0xdfaf('0xb')][_0xdfaf('0xc')]({'port':0x232a});config[_0xdfaf('0xd')]=_[_0xdfaf('0xe')](config['redis'],{'host':_0xdfaf('0xf'),'port':0x18eb});var socket=require(_0xdfaf('0x10'))(new Redis(config[_0xdfaf('0xd')]));require(_0xdfaf('0x11'))[_0xdfaf('0x12')](socket);function respondWithRpcPromise(_0x23712a,_0x466923,_0x26fd47){return new BPromise(function(_0x5092d6,_0x3747ce){return client[_0xdfaf('0x13')](_0x23712a,_0x26fd47)[_0xdfaf('0x14')](function(_0x42ea9f){logger[_0xdfaf('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x466923,_0xdfaf('0x16'));logger[_0xdfaf('0x17')](_0xdfaf('0x18'),_0x466923,_0xdfaf('0x16'),JSON[_0xdfaf('0x19')](_0x42ea9f));if(_0x42ea9f[_0xdfaf('0x1a')]){if(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1b')]===0x1f4){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x42ea9f['error'][_0xdfaf('0x1d')]);return _0x3747ce(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);}logger['error'](_0xdfaf('0x1c'),_0x466923,_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);return _0x5092d6(_0x42ea9f['error']['message']);}else{logger[_0xdfaf('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x466923,'request\x20sent');_0x5092d6(_0x42ea9f[_0xdfaf('0x1e')][_0xdfaf('0x1d')]);}})[_0xdfaf('0x1f')](function(_0x120e5d){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x120e5d);_0x3747ce(_0x120e5d);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 8947b50..7e95ad5 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 _0x33ec=['emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x33ec,0x1d2));var _0xc33e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x33ec[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xc33e('0x0'));var events=[_0xc33e('0x1'),'remove',_0xc33e('0x2')];function createListener(_0x2dd651,_0x58377e){return function(_0x1fcaad){_0x58377e[_0xc33e('0x3')](_0x2dd651,_0x1fcaad);};}function removeListener(_0x5b8023,_0x6ddf1d){return function(){ChatInternalMessageEvents[_0xc33e('0x4')](_0x5b8023,_0x6ddf1d);};}exports['register']=function(_0x237510){for(var _0xcbc8ec=0x0,_0x1c88ec=events[_0xc33e('0x5')];_0xcbc8ec<_0x1c88ec;_0xcbc8ec++){var _0x21ee2d=events[_0xcbc8ec];var _0x3d7b78=createListener(_0xc33e('0x6')+_0x21ee2d,_0x237510);ChatInternalMessageEvents['on'](_0x21ee2d,_0x3d7b78);}};
\ No newline at end of file
+var _0xbf03=['emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x293274,_0x1f9041){var _0x21730e=function(_0x56fc27){while(--_0x56fc27){_0x293274['push'](_0x293274['shift']());}};_0x21730e(++_0x1f9041);}(_0xbf03,0x66));var _0x3bf0=function(_0x196822,_0x3658d1){_0x196822=_0x196822-0x0;var _0x14338a=_0xbf03[_0x196822];return _0x14338a;};'use strict';var ChatInternalMessageEvents=require(_0x3bf0('0x0'));var events=[_0x3bf0('0x1'),_0x3bf0('0x2'),'update'];function createListener(_0x3b9e90,_0x3a7d5b){return function(_0x4b47f6){_0x3a7d5b[_0x3bf0('0x3')](_0x3b9e90,_0x4b47f6);};}function removeListener(_0x43da41,_0x95db4){return function(){ChatInternalMessageEvents[_0x3bf0('0x4')](_0x43da41,_0x95db4);};}exports['register']=function(_0x5e1e24){for(var _0x23329e=0x0,_0x3fbd24=events[_0x3bf0('0x5')];_0x23329e<_0x3fbd24;_0x23329e++){var _0x1cd001=events[_0x23329e];var _0x4457b2=createListener(_0x3bf0('0x6')+_0x1cd001,_0x5e1e24);ChatInternalMessageEvents['on'](_0x1cd001,_0x4457b2);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 8c9522c..1a31e5d 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 _0x3fcd=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0x3f8a3f,_0x37a68b){var _0x2cf290=function(_0x1fddc1){while(--_0x1fddc1){_0x3f8a3f['push'](_0x3f8a3f['shift']());}};_0x2cf290(++_0x37a68b);}(_0x3fcd,0x1c7));var _0xd3fc=function(_0x4bf3fb,_0x4bb220){_0x4bf3fb=_0x4bf3fb-0x0;var _0x37f0d6=_0x3fcd[_0x4bf3fb];return _0x37f0d6;};'use strict';var multer=require(_0xd3fc('0x0'));var util=require(_0xd3fc('0x1'));var path=require('path');var timeout=require(_0xd3fc('0x2'));var express=require('express');var router=express[_0xd3fc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd3fc('0x4'));var interaction=require(_0xd3fc('0x5'));var config=require(_0xd3fc('0x6'));var controller=require(_0xd3fc('0x7'));router[_0xd3fc('0x8')]('/',auth[_0xd3fc('0x9')](),controller['index']);router[_0xd3fc('0x8')](_0xd3fc('0xa'),auth[_0xd3fc('0x9')](),controller['describe']);router['get']('/users',auth['isAuthenticated'](),controller['getUsers']);router[_0xd3fc('0x8')](_0xd3fc('0xb'),auth['isAuthenticated'](),controller[_0xd3fc('0xc')]);router[_0xd3fc('0xd')]('/',auth[_0xd3fc('0x9')](),controller[_0xd3fc('0xe')]);router[_0xd3fc('0xf')](_0xd3fc('0xb'),controller[_0xd3fc('0x10')]);router[_0xd3fc('0x11')](_0xd3fc('0xb'),auth['isAuthenticated'](),controller[_0xd3fc('0x12')]);module[_0xd3fc('0x13')]=router;
\ No newline at end of file
+var _0xf061=['get','isAuthenticated','index','/describe','describe','/:id','post','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xf061,0x1a7));var _0x1f06=function(_0x1949eb,_0x4a899d){_0x1949eb=_0x1949eb-0x0;var _0x496bdd=_0xf061[_0x1949eb];return _0x496bdd;};'use strict';var multer=require(_0x1f06('0x0'));var util=require(_0x1f06('0x1'));var path=require(_0x1f06('0x2'));var timeout=require('connect-timeout');var express=require(_0x1f06('0x3'));var router=express[_0x1f06('0x4')]();var fs_extra=require(_0x1f06('0x5'));var auth=require(_0x1f06('0x6'));var interaction=require(_0x1f06('0x7'));var config=require(_0x1f06('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x1f06('0x9')]('/',auth[_0x1f06('0xa')](),controller[_0x1f06('0xb')]);router[_0x1f06('0x9')](_0x1f06('0xc'),auth['isAuthenticated'](),controller[_0x1f06('0xd')]);router[_0x1f06('0x9')]('/users',auth[_0x1f06('0xa')](),controller['getUsers']);router[_0x1f06('0x9')](_0x1f06('0xe'),auth[_0x1f06('0xa')](),controller['show']);router[_0x1f06('0xf')]('/',auth[_0x1f06('0xa')](),controller['create']);router['put']('/:id',controller['update']);router[_0x1f06('0x10')](_0x1f06('0xe'),auth[_0x1f06('0xa')](),controller[_0x1f06('0x11')]);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 6ae239f..09e4e54 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 _0xb7e2=['sequelize','TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0xcdd3dd,_0x39f009){var _0x5d9394=function(_0x1fea22){while(--_0x1fea22){_0xcdd3dd['push'](_0xcdd3dd['shift']());}};_0x5d9394(++_0x39f009);}(_0xb7e2,0x103));var _0x2b7e=function(_0x1a2f16,_0x1dd3a4){_0x1a2f16=_0x1a2f16-0x0;var _0x23b0e7=_0xb7e2[_0x1a2f16];return _0x23b0e7;};'use strict';var Sequelize=require(_0x2b7e('0x0'));module['exports']={'body':{'type':Sequelize[_0x2b7e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2b7e('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x2b7e('0x3')]('in','out'),'defaultValue':_0x2b7e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2b7e('0x5')]},'providerName':{'type':Sequelize[_0x2b7e('0x6')]},'providerResponse':{'type':Sequelize[_0x2b7e('0x1')]}};
\ No newline at end of file
+var _0x73a1=['medium','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x73a1,0x161));var _0x173a=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x73a1[_0x40dd56];return _0x4f850f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x173a('0x0')](_0x173a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x173a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x173a('0x3')]('in',_0x173a('0x4')),'defaultValue':_0x173a('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x173a('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x173a('0x0')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 8fb78af..fd88129 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 _0x9ead=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','destroy','stack','name','send','index','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','ChatMessage','rawAttributes','fields','find','body','params','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','../../config/logger','chat-interactions','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x40d9c8,_0x42ddab){var _0x4b11fe=function(_0xc279ad){while(--_0xc279ad){_0x40d9c8['push'](_0x40d9c8['shift']());}};_0x4b11fe(++_0x42ddab);}(_0x9ead,0x70));var _0xd9ea=function(_0x4f6259,_0x35094b){_0x4f6259=_0x4f6259-0x0;var _0x35f1bb=_0x9ead[_0x4f6259];return _0x35f1bb;};'use strict';var emlformat=require(_0xd9ea('0x0'));var rimraf=require(_0xd9ea('0x1'));var zipdir=require(_0xd9ea('0x2'));var jsonpatch=require(_0xd9ea('0x3'));var rp=require('request-promise');var moment=require(_0xd9ea('0x4'));var BPromise=require(_0xd9ea('0x5'));var Mustache=require(_0xd9ea('0x6'));var util=require('util');var path=require(_0xd9ea('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd9ea('0x8'));var fs=require('fs');var fs_extra=require(_0xd9ea('0x9'));var _=require(_0xd9ea('0xa'));var squel=require(_0xd9ea('0xb'));var crypto=require('crypto');var jsforce=require(_0xd9ea('0xc'));var deskjs=require(_0xd9ea('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd9ea('0xe'));var qs=require(_0xd9ea('0xf'));var as=require(_0xd9ea('0x10'));var hardwareService=require(_0xd9ea('0x11'));var logger=require('../../config/logger')(_0xd9ea('0x12'));var utils=require(_0xd9ea('0x13'));var config=require(_0xd9ea('0x14'));var licenseUtil=require(_0xd9ea('0x15'));var db=require('../../mysqldb')['db'];config[_0xd9ea('0x16')]=_[_0xd9ea('0x17')](config['redis'],{'host':_0xd9ea('0x18'),'port':0x18eb});var socket=require(_0xd9ea('0x19'))(new Redis(config[_0xd9ea('0x16')]));require(_0xd9ea('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xd9ea('0x1b')][_0xd9ea('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xd9ea('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x46c906,_0x57b79b,_0x1c4c70,_0x53e5ab){return new BPromise(function(_0x1d417b,_0x556f6a){var _0x4ded73=_0x53e5ab||client;return _0x4ded73['request'](_0x46c906,_0x1c4c70)[_0xd9ea('0x1d')](function(_0x3daa5a){logger['info'](_0xd9ea('0x1e'),_0x57b79b,_0xd9ea('0x1f'));logger[_0xd9ea('0x20')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57b79b,'request\x20sent',JSON['stringify'](_0x3daa5a));if(_0x3daa5a[_0xd9ea('0x21')]){if(_0x3daa5a['error'][_0xd9ea('0x22')]===0x1f4){logger['error'](_0xd9ea('0x1e'),_0x57b79b,_0x3daa5a[_0xd9ea('0x21')][_0xd9ea('0x23')]);return _0x556f6a(_0x3daa5a['error'][_0xd9ea('0x23')]);}logger['error'](_0xd9ea('0x1e'),_0x57b79b,_0x3daa5a[_0xd9ea('0x21')][_0xd9ea('0x23')]);return _0x1d417b(_0x3daa5a[_0xd9ea('0x21')][_0xd9ea('0x23')]);}else{logger[_0xd9ea('0x24')]('ChatMessage,\x20%s,\x20%s',_0x57b79b,_0xd9ea('0x1f'));_0x1d417b(_0x3daa5a[_0xd9ea('0x25')][_0xd9ea('0x23')]);}})[_0xd9ea('0x26')](function(_0x4a1e56){logger[_0xd9ea('0x21')](_0xd9ea('0x1e'),_0x57b79b,_0x4a1e56);_0x556f6a(_0x4a1e56);});});}function respondWithStatusCode(_0x5c9ab5,_0x2f6de0){_0x2f6de0=_0x2f6de0||0xcc;return function(_0x54ff36){if(_0x54ff36){return _0x5c9ab5[_0xd9ea('0x27')](_0x2f6de0);}return _0x5c9ab5['status'](_0x2f6de0)[_0xd9ea('0x28')]();};}function respondWithResult(_0x4d286f,_0x32c167){_0x32c167=_0x32c167||0xc8;return function(_0x2f43c2){if(_0x2f43c2){return _0x4d286f['status'](_0x32c167)['json'](_0x2f43c2);}};}function respondWithFilteredResult(_0x353103,_0x2e389f){return function(_0x54b2ec){if(_0x54b2ec){var _0x59659b=typeof _0x2e389f[_0xd9ea('0x29')]===_0xd9ea('0x2a')&&typeof _0x2e389f[_0xd9ea('0x2b')]===_0xd9ea('0x2a');var _0x2d8709=_0x54b2ec[_0xd9ea('0x2c')];var _0x1871e0=_0x59659b?0x0:_0x2e389f[_0xd9ea('0x29')];var _0x183df1=_0x59659b?_0x54b2ec['count']:_0x2e389f[_0xd9ea('0x29')]+_0x2e389f[_0xd9ea('0x2b')];var _0x517105;if(_0x183df1>=_0x2d8709){_0x183df1=_0x2d8709;_0x517105=0xc8;}else{_0x517105=0xce;}_0x353103[_0xd9ea('0x2d')](_0x517105);return _0x353103[_0xd9ea('0x2e')](_0xd9ea('0x2f'),_0x1871e0+'-'+_0x183df1+'/'+_0x2d8709)[_0xd9ea('0x30')](_0x54b2ec);}return null;};}function patchUpdates(_0x4ccb81){return function(_0x26bb7a){try{jsonpatch[_0xd9ea('0x31')](_0x26bb7a,_0x4ccb81,!![]);}catch(_0x2ddc8d){return BPromise['reject'](_0x2ddc8d);}return _0x26bb7a[_0xd9ea('0x32')]();};}function saveUpdates(_0x4a2a56,_0x7575ae){return function(_0x70075e){if(_0x70075e){return _0x70075e[_0xd9ea('0x33')](_0x4a2a56)['then'](function(_0x36b53a){return _0x36b53a;});}return null;};}function removeEntity(_0x229167,_0x2afa12){return function(_0x35299a){if(_0x35299a){return _0x35299a[_0xd9ea('0x34')]()[_0xd9ea('0x1d')](function(){_0x229167[_0xd9ea('0x2d')](0xcc)[_0xd9ea('0x28')]();});}};}function handleEntityNotFound(_0x4f4f68,_0x483423){return function(_0x167928){if(!_0x167928){_0x4f4f68[_0xd9ea('0x27')](0x194);}return _0x167928;};}function handleError(_0x17f508,_0x551caa){_0x551caa=_0x551caa||0x1f4;return function(_0x341783){logger['error'](_0x341783[_0xd9ea('0x35')]);if(_0x341783[_0xd9ea('0x36')]){delete _0x341783[_0xd9ea('0x36')];}_0x17f508[_0xd9ea('0x2d')](_0x551caa)[_0xd9ea('0x37')](_0x341783);};}exports[_0xd9ea('0x38')]=function(_0x54b7ab,_0x2e33e4){var _0x506169={},_0x396e79={},_0x441be1={'count':0x0,'rows':[]};var _0x4bfe0a=_['map'](db['ChatMessage']['rawAttributes'],function(_0x5eda0e){return{'name':_0x5eda0e[_0xd9ea('0x39')],'type':_0x5eda0e[_0xd9ea('0x3a')][_0xd9ea('0x3b')]};});_0x396e79[_0xd9ea('0x3c')]=_['map'](_0x4bfe0a,_0xd9ea('0x36'));_0x396e79[_0xd9ea('0x3d')]=_[_0xd9ea('0x3e')](_0x54b7ab[_0xd9ea('0x3d')]);_0x396e79[_0xd9ea('0x3f')]=_[_0xd9ea('0x40')](_0x396e79[_0xd9ea('0x3c')],_0x396e79[_0xd9ea('0x3d')]);_0x506169[_0xd9ea('0x41')]=_['intersection'](_0x396e79[_0xd9ea('0x3c')],qs['fields'](_0x54b7ab[_0xd9ea('0x3d')]['fields']));_0x506169[_0xd9ea('0x41')]=_0x506169[_0xd9ea('0x41')]['length']?_0x506169['attributes']:_0x396e79['model'];if(!_0x54b7ab[_0xd9ea('0x3d')][_0xd9ea('0x42')](_0xd9ea('0x43'))){_0x506169[_0xd9ea('0x2b')]=qs[_0xd9ea('0x2b')](_0x54b7ab['query'][_0xd9ea('0x2b')]);_0x506169[_0xd9ea('0x29')]=qs['offset'](_0x54b7ab['query'][_0xd9ea('0x29')]);}_0x506169[_0xd9ea('0x44')]=qs[_0xd9ea('0x45')](_0x54b7ab[_0xd9ea('0x3d')][_0xd9ea('0x45')]);_0x506169['where']=qs[_0xd9ea('0x3f')](_['pick'](_0x54b7ab[_0xd9ea('0x3d')],_0x396e79[_0xd9ea('0x3f')]),_0x4bfe0a);if(_0x54b7ab[_0xd9ea('0x3d')][_0xd9ea('0x46')]){_0x506169[_0xd9ea('0x47')]=_[_0xd9ea('0x48')](_0x506169[_0xd9ea('0x47')],{'$or':_[_0xd9ea('0x49')](_0x4bfe0a,function(_0x5c4a33){if(_0x5c4a33['type']!==_0xd9ea('0x4a')){var _0x11cb7a={};_0x11cb7a[_0x5c4a33['name']]={'$like':'%'+_0x54b7ab['query'][_0xd9ea('0x46')]+'%'};return _0x11cb7a;}})});}_0x506169=_[_0xd9ea('0x48')]({},_0x506169,_0x54b7ab[_0xd9ea('0x4b')]);var _0x3ea891={'where':_0x506169[_0xd9ea('0x47')]};return db['ChatMessage'][_0xd9ea('0x2c')](_0x3ea891)[_0xd9ea('0x1d')](function(_0x3e022e){_0x441be1[_0xd9ea('0x2c')]=_0x3e022e;if(_0x54b7ab[_0xd9ea('0x3d')][_0xd9ea('0x4c')]){_0x506169[_0xd9ea('0x4d')]=[{'all':!![]}];}return db['ChatMessage'][_0xd9ea('0x4e')](_0x506169);})['then'](function(_0x2faf85){_0x441be1[_0xd9ea('0x4f')]=_0x2faf85;return _0x441be1;})[_0xd9ea('0x1d')](respondWithFilteredResult(_0x2e33e4,_0x506169))['catch'](handleError(_0x2e33e4,null));};exports[_0xd9ea('0x50')]=function(_0x2eb3b7,_0x5dd1ff){var _0x2178cc={'raw':!![],'where':{'id':_0x2eb3b7['params']['id']}},_0x36a974={};_0x36a974[_0xd9ea('0x3c')]=_[_0xd9ea('0x3e')](db[_0xd9ea('0x51')][_0xd9ea('0x52')]);_0x36a974[_0xd9ea('0x3d')]=_['keys'](_0x2eb3b7[_0xd9ea('0x3d')]);_0x36a974[_0xd9ea('0x3f')]=_[_0xd9ea('0x40')](_0x36a974[_0xd9ea('0x3c')],_0x36a974[_0xd9ea('0x3d')]);_0x2178cc['attributes']=_[_0xd9ea('0x40')](_0x36a974['model'],qs[_0xd9ea('0x53')](_0x2eb3b7[_0xd9ea('0x3d')][_0xd9ea('0x53')]));_0x2178cc[_0xd9ea('0x41')]=_0x2178cc[_0xd9ea('0x41')]['length']?_0x2178cc[_0xd9ea('0x41')]:_0x36a974['model'];if(_0x2eb3b7['query'][_0xd9ea('0x4c')]){_0x2178cc[_0xd9ea('0x4d')]=[{'all':!![]}];}_0x2178cc=_[_0xd9ea('0x48')]({},_0x2178cc,_0x2eb3b7[_0xd9ea('0x4b')]);return db['ChatMessage'][_0xd9ea('0x54')](_0x2178cc)['then'](handleEntityNotFound(_0x5dd1ff,null))[_0xd9ea('0x1d')](respondWithResult(_0x5dd1ff,null))[_0xd9ea('0x26')](handleError(_0x5dd1ff,null));};exports['create']=function(_0x2aa502,_0x10117e){return db['ChatMessage']['create'](_0x2aa502['body'],{})['then'](respondWithResult(_0x10117e,0xc9))['catch'](handleError(_0x10117e,null));};exports[_0xd9ea('0x33')]=function(_0x4e0576,_0x9dbb16){if(_0x4e0576[_0xd9ea('0x55')]['id']){delete _0x4e0576[_0xd9ea('0x55')]['id'];}return db[_0xd9ea('0x51')]['find']({'where':{'id':_0x4e0576['params']['id']}})[_0xd9ea('0x1d')](handleEntityNotFound(_0x9dbb16,null))[_0xd9ea('0x1d')](saveUpdates(_0x4e0576[_0xd9ea('0x55')],null))[_0xd9ea('0x1d')](respondWithResult(_0x9dbb16,null))[_0xd9ea('0x26')](handleError(_0x9dbb16,null));};exports['destroy']=function(_0x722575,_0x175330){return db[_0xd9ea('0x51')][_0xd9ea('0x54')]({'where':{'id':_0x722575[_0xd9ea('0x56')]['id']}})['then'](handleEntityNotFound(_0x175330,null))[_0xd9ea('0x1d')](removeEntity(_0x175330,null))[_0xd9ea('0x26')](handleError(_0x175330,null));};exports[_0xd9ea('0x57')]=function(_0x38f5b7,_0x340daf){return db[_0xd9ea('0x51')][_0xd9ea('0x57')]()[_0xd9ea('0x1d')](respondWithResult(_0x340daf,null))['catch'](handleError(_0x340daf,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xd9ea('0x58')]=function(_0x2ff213,_0x4c8677,_0x5d0c07){var _0x3be13={'agent':{},'channel':_0xd9ea('0x59')};if(_0x2ff213[_0xd9ea('0x55')]['id']){delete _0x2ff213[_0xd9ea('0x55')]['id'];}_0x2ff213[_0xd9ea('0x55')][_0xd9ea('0x5a')]=!![];_0x2ff213[_0xd9ea('0x55')][_0xd9ea('0x5b')]=moment()[_0xd9ea('0x5c')](_0xd9ea('0x5d'));_0x2ff213['body'][_0xd9ea('0x5e')]=_0x2ff213['body'][_0xd9ea('0x5e')]||_0x2ff213[_0xd9ea('0x5f')]['id'];_0x3be13[_0xd9ea('0x60')]['id']=_0x2ff213[_0xd9ea('0x55')][_0xd9ea('0x5e')];return db[_0xd9ea('0x51')][_0xd9ea('0x54')]({'where':{'id':_0x2ff213['params']['id'],'UserId':null}})[_0xd9ea('0x1d')](handleEntityNotFound(_0x4c8677,null))['then'](saveUpdates(_0x2ff213['body'],null))[_0xd9ea('0x1d')](function(_0x4c65e9){if(_0x4c65e9){_0x3be13[_0xd9ea('0x23')]=_0x4c65e9[_0xd9ea('0x61')]({'plain':!![]});return db[_0xd9ea('0x62')][_0xd9ea('0x54')]({'where':{'id':_0x4c65e9[_0xd9ea('0x63')]}});}return null;})[_0xd9ea('0x1d')](handleEntityNotFound(_0x4c8677,null))[_0xd9ea('0x1d')](function(_0x6833ec){if(_0x6833ec){return _0x6833ec['update']({'UserId':_0x2ff213['body'][_0xd9ea('0x5e')],'read1stAt':_['isNil'](_0x6833ec[_0xd9ea('0x64')])?moment()[_0xd9ea('0x5c')](_0xd9ea('0x5d')):undefined});}return null;})[_0xd9ea('0x1d')](function(_0x1b7c34){if(_0x1b7c34){_0x3be13[_0xd9ea('0x65')]=_0x1b7c34[_0xd9ea('0x61')]({'plain':!![]});interaction_log[_0xd9ea('0x24')](_0xd9ea('0x66'),_0x2ff213[_0xd9ea('0x5f')]['id'],_0x2ff213['user']['name'],_0x2ff213['user'][_0xd9ea('0x67')],_0x3be13[_0xd9ea('0x65')]['id'],_0x2ff213[_0xd9ea('0x55')]?JSON[_0xd9ea('0x68')](_0x2ff213['body']):_0xd9ea('0x69'));return respondWithRpcPromise(_0xd9ea('0x6a'),_0xd9ea('0x6b'),_0x3be13);}return null;})[_0xd9ea('0x1d')](function(_0xae6049){var _0x156af5=_0xd9ea('0x6c')+_0xae6049[_0xd9ea('0x23')][_0xd9ea('0x6d')];return db[_0xd9ea('0x6e')][_0xd9ea('0x3d')](_0x156af5,{'type':db[_0xd9ea('0x6f')][_0xd9ea('0x70')][_0xd9ea('0x71')],'raw':!![]})[_0xd9ea('0x1d')](function(_0xbf9f28){return _0xbf9f28;});})['then'](function(_0x2afc74){if(_0x2afc74){_0x3be13[_0xd9ea('0x23')]['contact']=_0x2afc74[0x0];if(!_0x2ff213['body'][_0xd9ea('0x5e')])return;return db[_0xd9ea('0x72')][_0xd9ea('0x54')]({'where':{'id':_0x2ff213[_0xd9ea('0x55')][_0xd9ea('0x5e')],'role':_0xd9ea('0x60')},'attributes':['id',_0xd9ea('0x36'),_0xd9ea('0x73'),_0xd9ea('0x74'),_0xd9ea('0x75')],'raw':!![]});}return null;})[_0xd9ea('0x1d')](function(_0x316ff){if(!_0x316ff)return null;_0x3be13[_0xd9ea('0x23')][_0xd9ea('0x60')]=_0x316ff;return _0x3be13;})[_0xd9ea('0x1d')](function(_0x2f51f5){if(_0x2f51f5){if(_0x2ff213[_0xd9ea('0x55')][_0xd9ea('0x76')]){_0x3be13[_0xd9ea('0x23')][_0xd9ea('0x77')]=util[_0xd9ea('0x5c')](_0xd9ea('0x78'),_0x2ff213[_0xd9ea('0x5f')][_0xd9ea('0x36')]);_0x3be13['message'][_0xd9ea('0x79')]=_0x3be13[_0xd9ea('0x79')];_0x3be13['message']['motionChannel']=_0x3be13['channel'];_0x3be13['message'][_0xd9ea('0x7a')]='accept';return respondWithRpcPromise(_0xd9ea('0x7b'),'EventManager',{'event':_0xd9ea('0x7c'),'message':_[_0xd9ea('0x48')](_0x3be13['message'],JSON[_0xd9ea('0x7d')](_0x3be13[_0xd9ea('0x65')][_0xd9ea('0x7e')]))},client9002)[_0xd9ea('0x1d')](function(){return _0x3be13;});}return _0x3be13;}return null;})[_0xd9ea('0x1d')](respondWithResult(_0x4c8677,null))[_0xd9ea('0x26')](handleError(_0x4c8677,null));};var interaction_log=require(_0xd9ea('0x7f'))(_0xd9ea('0x80'));exports[_0xd9ea('0x81')]=function(_0x191545,_0x49b8dd,_0x4cae52){var _0x1c70fc={'agent':{},'channel':_0xd9ea('0x59')};if(_0x191545[_0xd9ea('0x55')]['id']){delete _0x191545[_0xd9ea('0x55')]['id'];}_0x191545[_0xd9ea('0x55')][_0xd9ea('0x5e')]=_0x191545['body']['UserId']||_0x191545[_0xd9ea('0x5f')]['id'];_0x1c70fc[_0xd9ea('0x60')]['id']=_0x191545['body'][_0xd9ea('0x5e')];return db['ChatMessage'][_0xd9ea('0x54')]({'where':{'id':_0x191545[_0xd9ea('0x56')]['id'],'UserId':null}})[_0xd9ea('0x1d')](handleEntityNotFound(_0x49b8dd,null))[_0xd9ea('0x1d')](function(_0x17971e){if(_0x17971e){_0x1c70fc[_0xd9ea('0x23')]=_0x17971e[_0xd9ea('0x61')]({'plain':!![]});return db['ChatInteraction'][_0xd9ea('0x54')]({'where':{'id':_0x17971e['ChatInteractionId']}});}return null;})[_0xd9ea('0x1d')](handleEntityNotFound(_0x49b8dd,null))[_0xd9ea('0x1d')](function(_0x4c4ccf){if(_0x4c4ccf){_0x1c70fc['interaction']=_0x4c4ccf['get']({'plain':!![]});interaction_log[_0xd9ea('0x24')](_0xd9ea('0x82'),_0x191545[_0xd9ea('0x5f')]['id'],_0x191545[_0xd9ea('0x5f')][_0xd9ea('0x36')],_0x191545['user'][_0xd9ea('0x67')],_0x1c70fc[_0xd9ea('0x65')]['id'],_0x191545[_0xd9ea('0x55')]?JSON[_0xd9ea('0x68')](_0x191545[_0xd9ea('0x55')]):_0xd9ea('0x69'));return respondWithRpcPromise(_0xd9ea('0x83'),'rejectMessage',_0x1c70fc);}return null;})[_0xd9ea('0x1d')](function(_0x535d7a){var _0x4208fb=_0xd9ea('0x6c')+_0x535d7a[_0xd9ea('0x23')][_0xd9ea('0x6d')];return db[_0xd9ea('0x6e')][_0xd9ea('0x3d')](_0x4208fb,{'type':db[_0xd9ea('0x6f')][_0xd9ea('0x70')][_0xd9ea('0x71')],'raw':!![]})[_0xd9ea('0x1d')](function(_0x2e28c8){return _0x2e28c8;});})[_0xd9ea('0x1d')](function(_0x53362c){if(_0x53362c){_0x1c70fc[_0xd9ea('0x23')]['contact']=_0x53362c[0x0];if(!_0x191545[_0xd9ea('0x55')]['UserId'])return;return db[_0xd9ea('0x72')][_0xd9ea('0x54')]({'where':{'id':_0x191545[_0xd9ea('0x55')]['UserId'],'role':_0xd9ea('0x60')},'attributes':['id',_0xd9ea('0x36'),_0xd9ea('0x73'),_0xd9ea('0x74'),_0xd9ea('0x75')],'raw':!![]});}return null;})[_0xd9ea('0x1d')](function(_0x4dd4f6){if(!_0x4dd4f6)return null;_0x1c70fc['message'][_0xd9ea('0x60')]=_0x4dd4f6;return _0x1c70fc;})[_0xd9ea('0x1d')](function(_0xa9fdbf){if(_0xa9fdbf){_0xa9fdbf[_0xd9ea('0x23')][_0xd9ea('0x77')]=util[_0xd9ea('0x5c')](_0xd9ea('0x78'),_0x191545['user'][_0xd9ea('0x36')]);_0xa9fdbf['message'][_0xd9ea('0x79')]=_0x1c70fc[_0xd9ea('0x79')];_0xa9fdbf[_0xd9ea('0x23')][_0xd9ea('0x84')]=_0x1c70fc['channel'];_0xa9fdbf[_0xd9ea('0x23')][_0xd9ea('0x7a')]=_0xd9ea('0x81');respondWithRpcPromise('EventManager',_0xd9ea('0x7b'),{'event':_0xd9ea('0x85'),'message':_['merge'](_0x1c70fc[_0xd9ea('0x23')],JSON[_0xd9ea('0x7d')](_0x1c70fc['interaction'][_0xd9ea('0x7e')]))},client9002);return _0x1c70fc;}return null;})[_0xd9ea('0x1d')](respondWithResult(_0x49b8dd,null))[_0xd9ea('0x26')](handleError(_0x49b8dd,null));};
\ No newline at end of file
+var _0x8972=['reject','then','destroy','end','sendStatus','stack','name','index','map','ChatMessage','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','create','update','body','describe','chat-interactions','accept','chat','read','format','user','agent','UserId','get','ChatInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','internal','channel','motionChannel','event','EventManager','parse','formData','ChatInteractionId','RejectMessage','rejectMessage','Sequelize','contact','fullname','email','interface','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x52a80a,_0x1442d1){var _0x500083=function(_0xf0454a){while(--_0xf0454a){_0x52a80a['push'](_0x52a80a['shift']());}};_0x500083(++_0x1442d1);}(_0x8972,0xd8));var _0x2897=function(_0x2039ef,_0x51e049){_0x2039ef=_0x2039ef-0x0;var _0x1012c7=_0x8972[_0x2039ef];return _0x1012c7;};'use strict';var emlformat=require(_0x2897('0x0'));var rimraf=require(_0x2897('0x1'));var zipdir=require(_0x2897('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2897('0x3'));var moment=require(_0x2897('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2897('0x5'));var util=require(_0x2897('0x6'));var path=require(_0x2897('0x7'));var sox=require(_0x2897('0x8'));var csv=require(_0x2897('0x9'));var ejs=require(_0x2897('0xa'));var fs=require('fs');var fs_extra=require(_0x2897('0xb'));var _=require(_0x2897('0xc'));var squel=require(_0x2897('0xd'));var crypto=require(_0x2897('0xe'));var jsforce=require(_0x2897('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2897('0x10'));var Papa=require('papaparse');var Redis=require(_0x2897('0x11'));var authService=require(_0x2897('0x12'));var qs=require(_0x2897('0x13'));var as=require(_0x2897('0x14'));var hardwareService=require(_0x2897('0x15'));var logger=require(_0x2897('0x16'))(_0x2897('0x17'));var utils=require('../../config/utils');var config=require(_0x2897('0x18'));var licenseUtil=require(_0x2897('0x19'));var db=require(_0x2897('0x1a'))['db'];config[_0x2897('0x1b')]=_[_0x2897('0x1c')](config['redis'],{'host':_0x2897('0x1d'),'port':0x18eb});var socket=require(_0x2897('0x1e'))(new Redis(config[_0x2897('0x1b')]));require(_0x2897('0x1f'))[_0x2897('0x20')](socket);var jayson=require(_0x2897('0x21'));var client=jayson['client'][_0x2897('0x22')]({'port':0x232c});var client9002=jayson[_0x2897('0x23')][_0x2897('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x22e07c,_0x3eedaf,_0x3cb4e9,_0x48aeed){return new BPromise(function(_0x33d48d,_0x1437cf){var _0x30215c=_0x48aeed||client;return _0x30215c['request'](_0x22e07c,_0x3cb4e9)['then'](function(_0x1c93a8){logger[_0x2897('0x24')](_0x2897('0x25'),_0x3eedaf,_0x2897('0x26'));logger[_0x2897('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3eedaf,'request\x20sent',JSON[_0x2897('0x28')](_0x1c93a8));if(_0x1c93a8[_0x2897('0x29')]){if(_0x1c93a8['error'][_0x2897('0x2a')]===0x1f4){logger[_0x2897('0x29')]('ChatMessage,\x20%s,\x20%s',_0x3eedaf,_0x1c93a8[_0x2897('0x29')]['message']);return _0x1437cf(_0x1c93a8[_0x2897('0x29')][_0x2897('0x2b')]);}logger[_0x2897('0x29')](_0x2897('0x25'),_0x3eedaf,_0x1c93a8['error'][_0x2897('0x2b')]);return _0x33d48d(_0x1c93a8['error'][_0x2897('0x2b')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3eedaf,_0x2897('0x26'));_0x33d48d(_0x1c93a8[_0x2897('0x2c')][_0x2897('0x2b')]);}})[_0x2897('0x2d')](function(_0x4857ff){logger[_0x2897('0x29')]('ChatMessage,\x20%s,\x20%s',_0x3eedaf,_0x4857ff);_0x1437cf(_0x4857ff);});});}function respondWithStatusCode(_0x5e25e9,_0x4e62ac){_0x4e62ac=_0x4e62ac||0xcc;return function(_0x37a20e){if(_0x37a20e){return _0x5e25e9['sendStatus'](_0x4e62ac);}return _0x5e25e9[_0x2897('0x2e')](_0x4e62ac)['end']();};}function respondWithResult(_0x5ed7b5,_0x50d045){_0x50d045=_0x50d045||0xc8;return function(_0x4f8c12){if(_0x4f8c12){return _0x5ed7b5[_0x2897('0x2e')](_0x50d045)[_0x2897('0x2f')](_0x4f8c12);}};}function respondWithFilteredResult(_0x942599,_0x84bc74){return function(_0x3bb17d){if(_0x3bb17d){var _0x8c4c32=typeof _0x84bc74[_0x2897('0x30')]===_0x2897('0x31')&&typeof _0x84bc74[_0x2897('0x32')]===_0x2897('0x31');var _0x1680be=_0x3bb17d[_0x2897('0x33')];var _0x41c6b9=_0x8c4c32?0x0:_0x84bc74[_0x2897('0x30')];var _0x4b9e54=_0x8c4c32?_0x3bb17d['count']:_0x84bc74[_0x2897('0x30')]+_0x84bc74[_0x2897('0x32')];var _0x13d7ec;if(_0x4b9e54>=_0x1680be){_0x4b9e54=_0x1680be;_0x13d7ec=0xc8;}else{_0x13d7ec=0xce;}_0x942599[_0x2897('0x2e')](_0x13d7ec);return _0x942599[_0x2897('0x34')](_0x2897('0x35'),_0x41c6b9+'-'+_0x4b9e54+'/'+_0x1680be)[_0x2897('0x2f')](_0x3bb17d);}return null;};}function patchUpdates(_0x5d1623){return function(_0x3a0049){try{jsonpatch['apply'](_0x3a0049,_0x5d1623,!![]);}catch(_0x27f033){return BPromise[_0x2897('0x36')](_0x27f033);}return _0x3a0049['save']();};}function saveUpdates(_0x4aba66,_0x134177){return function(_0x329dd2){if(_0x329dd2){return _0x329dd2['update'](_0x4aba66)[_0x2897('0x37')](function(_0x12f023){return _0x12f023;});}return null;};}function removeEntity(_0x407523,_0x4ec2a6){return function(_0x4a7a4e){if(_0x4a7a4e){return _0x4a7a4e[_0x2897('0x38')]()[_0x2897('0x37')](function(){_0x407523['status'](0xcc)[_0x2897('0x39')]();});}};}function handleEntityNotFound(_0x42f789,_0x4408d6){return function(_0x26bff9){if(!_0x26bff9){_0x42f789[_0x2897('0x3a')](0x194);}return _0x26bff9;};}function handleError(_0x1eb0e6,_0x3d8632){_0x3d8632=_0x3d8632||0x1f4;return function(_0x13ec7c){logger[_0x2897('0x29')](_0x13ec7c[_0x2897('0x3b')]);if(_0x13ec7c[_0x2897('0x3c')]){delete _0x13ec7c[_0x2897('0x3c')];}_0x1eb0e6['status'](_0x3d8632)['send'](_0x13ec7c);};}exports[_0x2897('0x3d')]=function(_0x1957e3,_0x457009){var _0x3d1ecb={},_0x30b6ec={},_0x3eea82={'count':0x0,'rows':[]};var _0x11c9a7=_[_0x2897('0x3e')](db[_0x2897('0x3f')]['rawAttributes'],function(_0x5ded23){return{'name':_0x5ded23['fieldName'],'type':_0x5ded23[_0x2897('0x40')][_0x2897('0x41')]};});_0x30b6ec[_0x2897('0x42')]=_[_0x2897('0x3e')](_0x11c9a7,_0x2897('0x3c'));_0x30b6ec['query']=_[_0x2897('0x43')](_0x1957e3[_0x2897('0x44')]);_0x30b6ec[_0x2897('0x45')]=_[_0x2897('0x46')](_0x30b6ec[_0x2897('0x42')],_0x30b6ec[_0x2897('0x44')]);_0x3d1ecb[_0x2897('0x47')]=_['intersection'](_0x30b6ec[_0x2897('0x42')],qs[_0x2897('0x48')](_0x1957e3[_0x2897('0x44')]['fields']));_0x3d1ecb[_0x2897('0x47')]=_0x3d1ecb['attributes']['length']?_0x3d1ecb[_0x2897('0x47')]:_0x30b6ec['model'];if(!_0x1957e3[_0x2897('0x44')][_0x2897('0x49')](_0x2897('0x4a'))){_0x3d1ecb[_0x2897('0x32')]=qs['limit'](_0x1957e3[_0x2897('0x44')][_0x2897('0x32')]);_0x3d1ecb[_0x2897('0x30')]=qs[_0x2897('0x30')](_0x1957e3['query'][_0x2897('0x30')]);}_0x3d1ecb[_0x2897('0x4b')]=qs[_0x2897('0x4c')](_0x1957e3[_0x2897('0x44')][_0x2897('0x4c')]);_0x3d1ecb[_0x2897('0x4d')]=qs[_0x2897('0x45')](_[_0x2897('0x4e')](_0x1957e3[_0x2897('0x44')],_0x30b6ec[_0x2897('0x45')]),_0x11c9a7);if(_0x1957e3[_0x2897('0x44')][_0x2897('0x4f')]){_0x3d1ecb['where']=_[_0x2897('0x50')](_0x3d1ecb[_0x2897('0x4d')],{'$or':_['map'](_0x11c9a7,function(_0x241830){if(_0x241830[_0x2897('0x40')]!==_0x2897('0x51')){var _0x1d4e4f={};_0x1d4e4f[_0x241830['name']]={'$like':'%'+_0x1957e3['query'][_0x2897('0x4f')]+'%'};return _0x1d4e4f;}})});}_0x3d1ecb=_[_0x2897('0x50')]({},_0x3d1ecb,_0x1957e3['options']);var _0x51e972={'where':_0x3d1ecb[_0x2897('0x4d')]};return db[_0x2897('0x3f')]['count'](_0x51e972)[_0x2897('0x37')](function(_0x18397a){_0x3eea82['count']=_0x18397a;if(_0x1957e3[_0x2897('0x44')][_0x2897('0x52')]){_0x3d1ecb[_0x2897('0x53')]=[{'all':!![]}];}return db['ChatMessage'][_0x2897('0x54')](_0x3d1ecb);})[_0x2897('0x37')](function(_0x4ae4aa){_0x3eea82[_0x2897('0x55')]=_0x4ae4aa;return _0x3eea82;})['then'](respondWithFilteredResult(_0x457009,_0x3d1ecb))[_0x2897('0x2d')](handleError(_0x457009,null));};exports[_0x2897('0x56')]=function(_0x4dc412,_0x1820ed){var _0x4582e3={'raw':!![],'where':{'id':_0x4dc412[_0x2897('0x57')]['id']}},_0x1d6610={};_0x1d6610[_0x2897('0x42')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x1d6610[_0x2897('0x44')]=_[_0x2897('0x43')](_0x4dc412['query']);_0x1d6610[_0x2897('0x45')]=_[_0x2897('0x46')](_0x1d6610['model'],_0x1d6610[_0x2897('0x44')]);_0x4582e3[_0x2897('0x47')]=_[_0x2897('0x46')](_0x1d6610['model'],qs[_0x2897('0x48')](_0x4dc412['query'][_0x2897('0x48')]));_0x4582e3[_0x2897('0x47')]=_0x4582e3['attributes'][_0x2897('0x58')]?_0x4582e3[_0x2897('0x47')]:_0x1d6610[_0x2897('0x42')];if(_0x4dc412[_0x2897('0x44')][_0x2897('0x52')]){_0x4582e3[_0x2897('0x53')]=[{'all':!![]}];}_0x4582e3=_[_0x2897('0x50')]({},_0x4582e3,_0x4dc412[_0x2897('0x59')]);return db['ChatMessage'][_0x2897('0x5a')](_0x4582e3)[_0x2897('0x37')](handleEntityNotFound(_0x1820ed,null))[_0x2897('0x37')](respondWithResult(_0x1820ed,null))[_0x2897('0x2d')](handleError(_0x1820ed,null));};exports[_0x2897('0x5b')]=function(_0x48b038,_0x24dc97){return db[_0x2897('0x3f')]['create'](_0x48b038['body'],{})[_0x2897('0x37')](respondWithResult(_0x24dc97,0xc9))['catch'](handleError(_0x24dc97,null));};exports[_0x2897('0x5c')]=function(_0x4d8af6,_0xc43214){if(_0x4d8af6[_0x2897('0x5d')]['id']){delete _0x4d8af6['body']['id'];}return db['ChatMessage'][_0x2897('0x5a')]({'where':{'id':_0x4d8af6[_0x2897('0x57')]['id']}})[_0x2897('0x37')](handleEntityNotFound(_0xc43214,null))['then'](saveUpdates(_0x4d8af6[_0x2897('0x5d')],null))['then'](respondWithResult(_0xc43214,null))[_0x2897('0x2d')](handleError(_0xc43214,null));};exports[_0x2897('0x38')]=function(_0x3eb982,_0x1ef863){return db['ChatMessage'][_0x2897('0x5a')]({'where':{'id':_0x3eb982['params']['id']}})[_0x2897('0x37')](handleEntityNotFound(_0x1ef863,null))[_0x2897('0x37')](removeEntity(_0x1ef863,null))[_0x2897('0x2d')](handleError(_0x1ef863,null));};exports[_0x2897('0x5e')]=function(_0x5cf38d,_0x32b310){return db[_0x2897('0x3f')][_0x2897('0x5e')]()[_0x2897('0x37')](respondWithResult(_0x32b310,null))[_0x2897('0x2d')](handleError(_0x32b310,null));};var interaction_log=require('../../config/logger')(_0x2897('0x5f'));exports[_0x2897('0x60')]=function(_0x310468,_0x557062,_0x323c91){var _0x2bbd48={'agent':{},'channel':_0x2897('0x61')};if(_0x310468[_0x2897('0x5d')]['id']){delete _0x310468['body']['id'];}_0x310468['body'][_0x2897('0x62')]=!![];_0x310468[_0x2897('0x5d')]['readAt']=moment()[_0x2897('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x310468['body']['UserId']=_0x310468['body']['UserId']||_0x310468[_0x2897('0x64')]['id'];_0x2bbd48[_0x2897('0x65')]['id']=_0x310468[_0x2897('0x5d')][_0x2897('0x66')];return db[_0x2897('0x3f')][_0x2897('0x5a')]({'where':{'id':_0x310468[_0x2897('0x57')]['id'],'UserId':null}})[_0x2897('0x37')](handleEntityNotFound(_0x557062,null))['then'](saveUpdates(_0x310468['body'],null))['then'](function(_0xe4545e){if(_0xe4545e){_0x2bbd48[_0x2897('0x2b')]=_0xe4545e[_0x2897('0x67')]({'plain':!![]});return db[_0x2897('0x68')][_0x2897('0x5a')]({'where':{'id':_0xe4545e['ChatInteractionId']}});}return null;})[_0x2897('0x37')](handleEntityNotFound(_0x557062,null))[_0x2897('0x37')](function(_0x35611c){if(_0x35611c){return _0x35611c[_0x2897('0x5c')]({'UserId':_0x310468[_0x2897('0x5d')][_0x2897('0x66')],'read1stAt':_['isNil'](_0x35611c[_0x2897('0x69')])?moment()[_0x2897('0x63')](_0x2897('0x6a')):undefined});}return null;})[_0x2897('0x37')](function(_0xd3c701){if(_0xd3c701){_0x2bbd48[_0x2897('0x6b')]=_0xd3c701[_0x2897('0x67')]({'plain':!![]});interaction_log['info'](_0x2897('0x6c'),_0x310468[_0x2897('0x64')]['id'],_0x310468[_0x2897('0x64')][_0x2897('0x3c')],_0x310468['user'][_0x2897('0x6d')],_0x2bbd48[_0x2897('0x6b')]['id'],_0x310468[_0x2897('0x5d')]?JSON[_0x2897('0x28')](_0x310468[_0x2897('0x5d')]):_0x2897('0x6e'));return respondWithRpcPromise(_0x2897('0x6f'),'acceptMessage',_0x2bbd48);}return null;})[_0x2897('0x37')](function(_0x576e13){var _0x448277=_0x2897('0x70')+_0x576e13['message'][_0x2897('0x71')];return db[_0x2897('0x72')][_0x2897('0x44')](_0x448277,{'type':db['Sequelize'][_0x2897('0x73')][_0x2897('0x74')],'raw':!![]})['then'](function(_0x9ab4c6){return _0x9ab4c6;});})[_0x2897('0x37')](function(_0x31323b){if(_0x31323b){_0x2bbd48[_0x2897('0x2b')]['contact']=_0x31323b[0x0];if(!_0x310468['body'][_0x2897('0x66')])return;return db[_0x2897('0x75')]['find']({'where':{'id':_0x310468[_0x2897('0x5d')][_0x2897('0x66')],'role':_0x2897('0x65')},'attributes':['id',_0x2897('0x3c'),'fullname','email',_0x2897('0x76')],'raw':!![]});}return null;})['then'](function(_0xc8d8b8){if(!_0xc8d8b8)return null;_0x2bbd48[_0x2897('0x2b')][_0x2897('0x65')]=_0xc8d8b8;return _0x2bbd48;})['then'](function(_0x74a973){if(_0x74a973){if(_0x310468['body']['manual']){_0x2bbd48[_0x2897('0x2b')]['interface']=util['format']('SIP/%s',_0x310468[_0x2897('0x64')][_0x2897('0x3c')]);_0x2bbd48[_0x2897('0x2b')][_0x2897('0x77')]=_0x2bbd48[_0x2897('0x77')];_0x2bbd48['message'][_0x2897('0x78')]=_0x2bbd48[_0x2897('0x77')];_0x2bbd48[_0x2897('0x2b')][_0x2897('0x79')]=_0x2897('0x60');return respondWithRpcPromise(_0x2897('0x7a'),_0x2897('0x7a'),{'event':'acceptmessage','message':_[_0x2897('0x50')](_0x2bbd48['message'],JSON[_0x2897('0x7b')](_0x2bbd48[_0x2897('0x6b')][_0x2897('0x7c')]))},client9002)[_0x2897('0x37')](function(){return _0x2bbd48;});}return _0x2bbd48;}return null;})[_0x2897('0x37')](respondWithResult(_0x557062,null))[_0x2897('0x2d')](handleError(_0x557062,null));};var interaction_log=require('../../config/logger')(_0x2897('0x5f'));exports['reject']=function(_0x3c2746,_0x8e76a1,_0x192faa){var _0x4d8670={'agent':{},'channel':_0x2897('0x61')};if(_0x3c2746[_0x2897('0x5d')]['id']){delete _0x3c2746[_0x2897('0x5d')]['id'];}_0x3c2746[_0x2897('0x5d')][_0x2897('0x66')]=_0x3c2746[_0x2897('0x5d')]['UserId']||_0x3c2746['user']['id'];_0x4d8670[_0x2897('0x65')]['id']=_0x3c2746[_0x2897('0x5d')][_0x2897('0x66')];return db['ChatMessage'][_0x2897('0x5a')]({'where':{'id':_0x3c2746[_0x2897('0x57')]['id'],'UserId':null}})[_0x2897('0x37')](handleEntityNotFound(_0x8e76a1,null))[_0x2897('0x37')](function(_0x2dc7d5){if(_0x2dc7d5){_0x4d8670[_0x2897('0x2b')]=_0x2dc7d5[_0x2897('0x67')]({'plain':!![]});return db[_0x2897('0x68')][_0x2897('0x5a')]({'where':{'id':_0x2dc7d5[_0x2897('0x7d')]}});}return null;})[_0x2897('0x37')](handleEntityNotFound(_0x8e76a1,null))['then'](function(_0x5bdb7c){if(_0x5bdb7c){_0x4d8670[_0x2897('0x6b')]=_0x5bdb7c[_0x2897('0x67')]({'plain':!![]});interaction_log[_0x2897('0x24')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3c2746[_0x2897('0x64')]['id'],_0x3c2746[_0x2897('0x64')][_0x2897('0x3c')],_0x3c2746[_0x2897('0x64')]['role'],_0x4d8670[_0x2897('0x6b')]['id'],_0x3c2746[_0x2897('0x5d')]?JSON[_0x2897('0x28')](_0x3c2746['body']):_0x2897('0x6e'));return respondWithRpcPromise(_0x2897('0x7e'),_0x2897('0x7f'),_0x4d8670);}return null;})['then'](function(_0x2fdcc6){var _0x343092=_0x2897('0x70')+_0x2fdcc6[_0x2897('0x2b')]['ContactId'];return db[_0x2897('0x72')]['query'](_0x343092,{'type':db[_0x2897('0x80')]['QueryTypes']['SELECT'],'raw':!![]})[_0x2897('0x37')](function(_0x3dde02){return _0x3dde02;});})[_0x2897('0x37')](function(_0x39a2dd){if(_0x39a2dd){_0x4d8670[_0x2897('0x2b')][_0x2897('0x81')]=_0x39a2dd[0x0];if(!_0x3c2746['body']['UserId'])return;return db[_0x2897('0x75')][_0x2897('0x5a')]({'where':{'id':_0x3c2746['body']['UserId'],'role':_0x2897('0x65')},'attributes':['id',_0x2897('0x3c'),_0x2897('0x82'),_0x2897('0x83'),_0x2897('0x76')],'raw':!![]});}return null;})[_0x2897('0x37')](function(_0x2eb32b){if(!_0x2eb32b)return null;_0x4d8670[_0x2897('0x2b')]['agent']=_0x2eb32b;return _0x4d8670;})['then'](function(_0x325356){if(_0x325356){_0x325356['message'][_0x2897('0x84')]=util[_0x2897('0x63')](_0x2897('0x85'),_0x3c2746[_0x2897('0x64')][_0x2897('0x3c')]);_0x325356[_0x2897('0x2b')][_0x2897('0x77')]=_0x4d8670[_0x2897('0x77')];_0x325356[_0x2897('0x2b')]['motionChannel']=_0x4d8670[_0x2897('0x77')];_0x325356[_0x2897('0x2b')]['event']=_0x2897('0x36');respondWithRpcPromise(_0x2897('0x7a'),_0x2897('0x7a'),{'event':_0x2897('0x86'),'message':_[_0x2897('0x50')](_0x4d8670[_0x2897('0x2b')],JSON[_0x2897('0x7b')](_0x4d8670[_0x2897('0x6b')][_0x2897('0x7c')]))},client9002);return _0x4d8670;}return null;})['then'](respondWithResult(_0x8e76a1,null))[_0x2897('0x2d')](handleError(_0x8e76a1,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 6b1a099..82fc616 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 _0x322d=['setMaxListeners','remove','hasOwnProperty','hook','exports','events','ChatMessage'];(function(_0x537d13,_0x423bc0){var _0x4e6e66=function(_0xac0734){while(--_0xac0734){_0x537d13['push'](_0x537d13['shift']());}};_0x4e6e66(++_0x423bc0);}(_0x322d,0x15c));var _0xd322=function(_0xe31502,_0x24688d){_0xe31502=_0xe31502-0x0;var _0x171c63=_0x322d[_0xe31502];return _0x171c63;};'use strict';var EventEmitter=require(_0xd322('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xd322('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd322('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xd322('0x3')};function emitEvent(_0x1e11c3){return function(_0x1ba876,_0x29c1f0,_0x4a7eb5){ChatMessageEvents['emit'](_0x1e11c3+':'+_0x1ba876['id'],_0x1ba876);ChatMessageEvents['emit'](_0x1e11c3,_0x1ba876);_0x4a7eb5(null);};}for(var e in events){if(events[_0xd322('0x4')](e)){var event=events[e];ChatMessage[_0xd322('0x5')](e,emitEvent(event));}}module[_0xd322('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0xbf87=['save','update','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xa71904,_0x21363f){var _0x507060=function(_0x4ac794){while(--_0x4ac794){_0xa71904['push'](_0xa71904['shift']());}};_0x507060(++_0x21363f);}(_0xbf87,0x11d));var _0x7bf8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbf87[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x7bf8('0x0'));var ChatMessage=require(_0x7bf8('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7bf8('0x2')](0x0);var events={'afterCreate':_0x7bf8('0x3'),'afterUpdate':_0x7bf8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52b631){return function(_0x534fe5,_0x4ce692,_0x54ce0f){ChatMessageEvents['emit'](_0x52b631+':'+_0x534fe5['id'],_0x534fe5);ChatMessageEvents[_0x7bf8('0x5')](_0x52b631,_0x534fe5);_0x54ce0f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7bf8('0x6')](e,emitEvent(event));}}module[_0x7bf8('0x7')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index d48563c..9dcb873 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 _0x92e1=['isNil','UserId','ChatInteraction','findOne','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','toLowerCase','direction'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x92e1,0x10d));var _0x192e=function(_0x45f111,_0x3a1a4a){_0x45f111=_0x45f111-0x0;var _0x483508=_0x92e1[_0x45f111];return _0x483508;};'use strict';var _=require(_0x192e('0x0'));var util=require(_0x192e('0x1'));var logger=require(_0x192e('0x2'))(_0x192e('0x3'));var moment=require('moment');var BPromise=require(_0x192e('0x4'));var rp=require(_0x192e('0x5'));var fs=require('fs');var path=require(_0x192e('0x6'));var rimraf=require(_0x192e('0x7'));var config=require(_0x192e('0x8'));var attributes=require(_0x192e('0x9'));module[_0x192e('0xa')]=function(_0x3bb4e7,_0x1cdd3e){return _0x3bb4e7[_0x192e('0xb')](_0x192e('0xc'),attributes,{'tableName':_0x192e('0xd'),'paranoid':![],'indexes':[{'name':_0x192e('0xe'),'fields':[_0x192e('0xf')],'type':_0x192e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x142d4f,_0x38f469,_0x4f216f){var _0x4b01c9=_0x3bb4e7[_0x192e('0x11')];var _0x736f15=_0x142d4f[_0x192e('0x12')]({'plain':!![]});if(_0x736f15['direction'][_0x192e('0x13')]()==='in'||_0x736f15[_0x192e('0x14')][_0x192e('0x13')]()==='out'&&!_0x736f15['secret']&&!_[_0x192e('0x15')](_0x736f15[_0x192e('0x16')])){_0x4b01c9[_0x192e('0x17')][_0x192e('0x18')]({'where':{'id':_0x736f15['ChatInteractionId']}})['then'](function(_0x34a606){if(_0x34a606){_0x34a606['update']({'lastMsgAt':_0x736f15[_0x192e('0x19')],'lastMsgDirection':_0x736f15[_0x192e('0x14')]['toLowerCase']()});}})[_0x192e('0x1a')](function(_0x448aa7){console[_0x192e('0x1b')](_0x448aa7);});}_0x4f216f();}},'charset':_0x192e('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xef45=['catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update'];(function(_0x4c9e04,_0x1f12e1){var _0x391e86=function(_0x57f7ae){while(--_0x57f7ae){_0x4c9e04['push'](_0x4c9e04['shift']());}};_0x391e86(++_0x1f12e1);}(_0xef45,0xe3));var _0x5ef4=function(_0x3ee0e1,_0x3193b1){_0x3ee0e1=_0x3ee0e1-0x0;var _0x42be7b=_0xef45[_0x3ee0e1];return _0x42be7b;};'use strict';var _=require(_0x5ef4('0x0'));var util=require(_0x5ef4('0x1'));var logger=require(_0x5ef4('0x2'))(_0x5ef4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ef4('0x4'));var rimraf=require(_0x5ef4('0x5'));var config=require(_0x5ef4('0x6'));var attributes=require('./chatMessage.attributes');module[_0x5ef4('0x7')]=function(_0x3bd46c,_0x95d6d9){return _0x3bd46c[_0x5ef4('0x8')]('ChatMessage',attributes,{'tableName':_0x5ef4('0x9'),'paranoid':![],'indexes':[{'name':_0x5ef4('0xa'),'fields':[_0x5ef4('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14ee1f,_0x45ada7,_0x3142d1){var _0x407eff=_0x3bd46c[_0x5ef4('0xc')];var _0x4b17f1=_0x14ee1f[_0x5ef4('0xd')]({'plain':!![]});if(_0x4b17f1[_0x5ef4('0xe')][_0x5ef4('0xf')]()==='in'||_0x4b17f1[_0x5ef4('0xe')]['toLowerCase']()===_0x5ef4('0x10')&&!_0x4b17f1[_0x5ef4('0x11')]&&!_[_0x5ef4('0x12')](_0x4b17f1[_0x5ef4('0x13')])){_0x407eff[_0x5ef4('0x14')][_0x5ef4('0x15')]({'where':{'id':_0x4b17f1[_0x5ef4('0x16')]}})[_0x5ef4('0x17')](function(_0x107dd6){if(_0x107dd6){_0x107dd6[_0x5ef4('0x18')]({'lastMsgAt':_0x4b17f1['createdAt'],'lastMsgDirection':_0x4b17f1[_0x5ef4('0xe')]['toLowerCase']()});}})[_0x5ef4('0x19')](function(_0x4b87f7){console[_0x5ef4('0x1a')](_0x4b87f7);});}_0x3142d1();}},'charset':'utf8mb4','collate':_0x5ef4('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 9dc3256..bc3c617 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 _0xa135=['stringify','error','code','ChatMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','ChatMessage','create','body','options','then','CreateChatMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./chatMessage.socket','register','info','debug','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x562cc9,_0x1cb01e){var _0x5ddbf8=function(_0x48cb40){while(--_0x48cb40){_0x562cc9['push'](_0x562cc9['shift']());}};_0x5ddbf8(++_0x1cb01e);}(_0xa135,0x12e));var _0x5a13=function(_0x196752,_0x4f1429){_0x196752=_0x196752-0x0;var _0x77fda3=_0xa135[_0x196752];return _0x77fda3;};'use strict';var _=require('lodash');var util=require(_0x5a13('0x0'));var moment=require(_0x5a13('0x1'));var BPromise=require(_0x5a13('0x2'));var rs=require(_0x5a13('0x3'));var fs=require('fs');var Redis=require(_0x5a13('0x4'));var db=require(_0x5a13('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a13('0x6'));var config=require(_0x5a13('0x7'));var jayson=require(_0x5a13('0x8'));var client=jayson[_0x5a13('0x9')]['http']({'port':0x232a});config['redis']=_[_0x5a13('0xa')](config[_0x5a13('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a13('0xc'))(new Redis(config[_0x5a13('0xb')]));require(_0x5a13('0xd'))[_0x5a13('0xe')](socket);function respondWithRpcPromise(_0x1cc3f9,_0x50189c,_0x596e07){return new BPromise(function(_0x2add0c,_0x378c56){return client['request'](_0x1cc3f9,_0x596e07)['then'](function(_0x37d09b){logger[_0x5a13('0xf')]('ChatMessage,\x20%s,\x20%s',_0x50189c,'request\x20sent');logger[_0x5a13('0x10')](_0x5a13('0x11'),_0x50189c,'request\x20sent',JSON[_0x5a13('0x12')](_0x37d09b));if(_0x37d09b[_0x5a13('0x13')]){if(_0x37d09b[_0x5a13('0x13')][_0x5a13('0x14')]===0x1f4){logger[_0x5a13('0x13')](_0x5a13('0x15'),_0x50189c,_0x37d09b[_0x5a13('0x13')][_0x5a13('0x16')]);return _0x378c56(_0x37d09b[_0x5a13('0x13')][_0x5a13('0x16')]);}logger[_0x5a13('0x13')](_0x5a13('0x15'),_0x50189c,_0x37d09b[_0x5a13('0x13')]['message']);return _0x2add0c(_0x37d09b[_0x5a13('0x13')][_0x5a13('0x16')]);}else{logger[_0x5a13('0xf')]('ChatMessage,\x20%s,\x20%s',_0x50189c,_0x5a13('0x17'));_0x2add0c(_0x37d09b[_0x5a13('0x18')][_0x5a13('0x16')]);}})[_0x5a13('0x19')](function(_0x598303){logger[_0x5a13('0x13')](_0x5a13('0x15'),_0x50189c,_0x598303);_0x378c56(_0x598303);});});}exports['CreateChatMessage']=function(_0x27667e){var _0x975b08=this;return new Promise(function(_0x1cc4ab,_0x7dc6b6){return db[_0x5a13('0x1a')][_0x5a13('0x1b')](_0x27667e[_0x5a13('0x1c')],{'raw':_0x27667e[_0x5a13('0x1d')]?_0x27667e['options']['raw']===undefined?!![]:![]:!![]})[_0x5a13('0x1e')](function(_0x4da9b3){logger[_0x5a13('0xf')](_0x5a13('0x1f'),_0x27667e);logger[_0x5a13('0x10')]('CreateChatMessage',_0x27667e,JSON['stringify'](_0x4da9b3));_0x1cc4ab(_0x4da9b3);})[_0x5a13('0x19')](function(_0x127d32){logger[_0x5a13('0x13')]('CreateChatMessage',_0x127d32[_0x5a13('0x16')],_0x27667e);_0x7dc6b6(_0x975b08[_0x5a13('0x13')](0x1f4,_0x127d32[_0x5a13('0x16')]));});});};
\ No newline at end of file
+var _0x69d1=['request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','stringify','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x2649aa,_0x34c0c3){var _0x3cde1c=function(_0x5059d3){while(--_0x5059d3){_0x2649aa['push'](_0x2649aa['shift']());}};_0x3cde1c(++_0x34c0c3);}(_0x69d1,0xdd));var _0x169d=function(_0x13485b,_0x29fb3e){_0x13485b=_0x13485b-0x0;var _0x4ae5e8=_0x69d1[_0x13485b];return _0x4ae5e8;};'use strict';var _=require('lodash');var util=require(_0x169d('0x0'));var moment=require(_0x169d('0x1'));var BPromise=require(_0x169d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x169d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x169d('0x4'));var logger=require(_0x169d('0x5'))(_0x169d('0x6'));var config=require(_0x169d('0x7'));var jayson=require(_0x169d('0x8'));var client=jayson[_0x169d('0x9')][_0x169d('0xa')]({'port':0x232a});config['redis']=_[_0x169d('0xb')](config[_0x169d('0xc')],{'host':_0x169d('0xd'),'port':0x18eb});var socket=require(_0x169d('0xe'))(new Redis(config[_0x169d('0xc')]));require(_0x169d('0xf'))[_0x169d('0x10')](socket);function respondWithRpcPromise(_0x617d66,_0x2dc570,_0x247e69){return new BPromise(function(_0x38010a,_0x41f85d){return client[_0x169d('0x11')](_0x617d66,_0x247e69)[_0x169d('0x12')](function(_0x13676d){logger[_0x169d('0x13')](_0x169d('0x14'),_0x2dc570,_0x169d('0x15'));logger[_0x169d('0x16')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2dc570,'request\x20sent',JSON['stringify'](_0x13676d));if(_0x13676d[_0x169d('0x17')]){if(_0x13676d[_0x169d('0x17')][_0x169d('0x18')]===0x1f4){logger[_0x169d('0x17')](_0x169d('0x14'),_0x2dc570,_0x13676d[_0x169d('0x17')][_0x169d('0x19')]);return _0x41f85d(_0x13676d[_0x169d('0x17')][_0x169d('0x19')]);}logger[_0x169d('0x17')](_0x169d('0x14'),_0x2dc570,_0x13676d[_0x169d('0x17')][_0x169d('0x19')]);return _0x38010a(_0x13676d[_0x169d('0x17')][_0x169d('0x19')]);}else{logger['info'](_0x169d('0x14'),_0x2dc570,'request\x20sent');_0x38010a(_0x13676d[_0x169d('0x1a')][_0x169d('0x19')]);}})[_0x169d('0x1b')](function(_0x957cfc){logger[_0x169d('0x17')](_0x169d('0x14'),_0x2dc570,_0x957cfc);_0x41f85d(_0x957cfc);});});}exports[_0x169d('0x1c')]=function(_0x47bf84){var _0x5626fe=this;return new Promise(function(_0x43f537,_0x484889){return db[_0x169d('0x1d')][_0x169d('0x1e')](_0x47bf84['body'],{'raw':_0x47bf84['options']?_0x47bf84[_0x169d('0x1f')][_0x169d('0x20')]===undefined?!![]:![]:!![]})[_0x169d('0x12')](function(_0x118d17){logger[_0x169d('0x13')](_0x169d('0x1c'),_0x47bf84);logger[_0x169d('0x16')](_0x169d('0x1c'),_0x47bf84,JSON[_0x169d('0x21')](_0x118d17));_0x43f537(_0x118d17);})[_0x169d('0x1b')](function(_0x491565){logger[_0x169d('0x17')](_0x169d('0x1c'),_0x491565[_0x169d('0x19')],_0x47bf84);_0x484889(_0x5626fe[_0x169d('0x17')](0x1f4,_0x491565[_0x169d('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 745f56d..fc1562e 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 _0x3248=['remove','update','removeListener','length','chatMessage:','./chatMessage.events','save'];(function(_0x2338ae,_0x1896f8){var _0x4adad9=function(_0x1f6ed1){while(--_0x1f6ed1){_0x2338ae['push'](_0x2338ae['shift']());}};_0x4adad9(++_0x1896f8);}(_0x3248,0x1b0));var _0x8324=function(_0x3ec65,_0x396ba5){_0x3ec65=_0x3ec65-0x0;var _0x4bf59e=_0x3248[_0x3ec65];return _0x4bf59e;};'use strict';var ChatMessageEvents=require(_0x8324('0x0'));var events=[_0x8324('0x1'),_0x8324('0x2'),_0x8324('0x3')];function createListener(_0x9b580,_0x23b671){return function(_0x3ab598){_0x23b671['emit'](_0x9b580,_0x3ab598);};}function removeListener(_0x4c565b,_0x2e46f3){return function(){ChatMessageEvents[_0x8324('0x4')](_0x4c565b,_0x2e46f3);};}exports['register']=function(_0x18edd2){for(var _0x283f5f=0x0,_0x446423=events[_0x8324('0x5')];_0x283f5f<_0x446423;_0x283f5f++){var _0x215c15=events[_0x283f5f];var _0x5d5f01=createListener(_0x8324('0x6')+_0x215c15,_0x18edd2);ChatMessageEvents['on'](_0x215c15,_0x5d5f01);}};
\ No newline at end of file
+var _0x56e7=['emit','removeListener','length','save','remove'];(function(_0x35d4e4,_0x19ea70){var _0x520d8a=function(_0x5455ed){while(--_0x5455ed){_0x35d4e4['push'](_0x35d4e4['shift']());}};_0x520d8a(++_0x19ea70);}(_0x56e7,0x7b));var _0x756e=function(_0x28efa0,_0x481587){_0x28efa0=_0x28efa0-0x0;var _0x110f72=_0x56e7[_0x28efa0];return _0x110f72;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x756e('0x0'),_0x756e('0x1'),'update'];function createListener(_0x2eadee,_0x3efe5c){return function(_0x46a672){_0x3efe5c[_0x756e('0x2')](_0x2eadee,_0x46a672);};}function removeListener(_0x11ce5f,_0x38546a){return function(){ChatMessageEvents[_0x756e('0x3')](_0x11ce5f,_0x38546a);};}exports['register']=function(_0x3b3b8f){for(var _0x404189=0x0,_0x26519d=events[_0x756e('0x4')];_0x404189<_0x26519d;_0x404189++){var _0x5c8589=events[_0x404189];var _0x1c6a22=createListener('chatMessage:'+_0x5c8589,_0x3b3b8f);ChatMessageEvents['on'](_0x5c8589,_0x1c6a22);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index fc7b69f..4537fb9 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 _0x54fe=['/:id','show','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','/describe','isAuthenticated','get'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x54fe,0x1d8));var _0xe54f=function(_0x5b43af,_0x24a223){_0x5b43af=_0x5b43af-0x0;var _0x23f724=_0x54fe[_0x5b43af];return _0x23f724;};'use strict';var multer=require(_0xe54f('0x0'));var util=require(_0xe54f('0x1'));var path=require('path');var timeout=require(_0xe54f('0x2'));var express=require(_0xe54f('0x3'));var router=express[_0xe54f('0x4')]();var fs_extra=require(_0xe54f('0x5'));var auth=require(_0xe54f('0x6'));var interaction=require(_0xe54f('0x7'));var config=require(_0xe54f('0x8'));var controller=require(_0xe54f('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe54f('0xa')]);router['get'](_0xe54f('0xb'),auth[_0xe54f('0xc')](),controller['describe']);router[_0xe54f('0xd')](_0xe54f('0xe'),auth[_0xe54f('0xc')](),controller[_0xe54f('0xf')]);router['post']('/',auth[_0xe54f('0xc')](),interaction[_0xe54f('0x10')](_0xe54f('0x11'),_0xe54f('0x12')),controller[_0xe54f('0x13')]);router[_0xe54f('0x14')]('/:id',controller[_0xe54f('0x15')]);router[_0xe54f('0x14')](_0xe54f('0x16'),auth['isAuthenticated'](),controller[_0xe54f('0x17')]);router[_0xe54f('0x14')](_0xe54f('0x18'),auth['isAuthenticated'](),controller[_0xe54f('0x19')]);router[_0xe54f('0x1a')](_0xe54f('0xe'),auth[_0xe54f('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x74e7=['post','create','put','update','/:id/accept','accept','/:id/reject','reject','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x5b5868,_0x5215e2){var _0x2decaa=function(_0x1ffbcc){while(--_0x1ffbcc){_0x5b5868['push'](_0x5b5868['shift']());}};_0x2decaa(++_0x5215e2);}(_0x74e7,0x1d6));var _0x774e=function(_0x54bb8c,_0x1b3e97){_0x54bb8c=_0x54bb8c-0x0;var _0x18ccc0=_0x74e7[_0x54bb8c];return _0x18ccc0;};'use strict';var multer=require(_0x774e('0x0'));var util=require(_0x774e('0x1'));var path=require(_0x774e('0x2'));var timeout=require('connect-timeout');var express=require(_0x774e('0x3'));var router=express['Router']();var fs_extra=require(_0x774e('0x4'));var auth=require(_0x774e('0x5'));var interaction=require(_0x774e('0x6'));var config=require('../../config/environment');var controller=require(_0x774e('0x7'));router[_0x774e('0x8')]('/',auth[_0x774e('0x9')](),controller[_0x774e('0xa')]);router[_0x774e('0x8')](_0x774e('0xb'),auth[_0x774e('0x9')](),controller['describe']);router[_0x774e('0x8')](_0x774e('0xc'),auth[_0x774e('0x9')](),controller[_0x774e('0xd')]);router[_0x774e('0xe')]('/',auth['isAuthenticated'](),interaction['tracked']('chat','chatmessage:create'),controller[_0x774e('0xf')]);router[_0x774e('0x10')]('/:id',controller[_0x774e('0x11')]);router[_0x774e('0x10')](_0x774e('0x12'),auth[_0x774e('0x9')](),controller[_0x774e('0x13')]);router[_0x774e('0x10')](_0x774e('0x14'),auth[_0x774e('0x9')](),controller[_0x774e('0x15')]);router['delete'](_0x774e('0xc'),auth[_0x774e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index ca0eca4..351f5a5 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['medium','sequelize','TEXT'];(function(_0xb0cc8c,_0x13dabd){var _0x29204c=function(_0x57b531){while(--_0x57b531){_0xb0cc8c['push'](_0xb0cc8c['shift']());}};_0x29204c(++_0x13dabd);}(_0xb10b,0x12a));var _0xbb10=function(_0x511a19,_0x417e36){_0x511a19=_0x511a19-0x0;var _0x499aa6=_0xb10b[_0x511a19];return _0x499aa6;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x28b29a,_0x2db6d4){var _0x306ac1=function(_0x4e005d){while(--_0x4e005d){_0x28b29a['push'](_0x28b29a['shift']());}};_0x306ac1(++_0x2db6d4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21a2e1,_0x548682){_0x21a2e1=_0x21a2e1-0x0;var _0x4f15e1=_0x5f2f[_0x21a2e1];return _0x4f15e1;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index e178b12..15c380c 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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0x7a54,0x106));var _0x47a5=function(_0x213598,_0x17a114){_0x213598=_0x213598-0x0;var _0x554ac7=_0x7a54[_0x213598];return _0x554ac7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+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(_0x3a4de8,_0x823276){var _0x4ca5a8=function(_0x883b7e){while(--_0x883b7e){_0x3a4de8['push'](_0x3a4de8['shift']());}};_0x4ca5a8(++_0x823276);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 62f9798..16da497 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 _0xe899=['hasOwnProperty','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe899,0x1cc));var _0x9e89=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0xe899[_0x296754];return _0x1d9f1d;};'use strict';var EventEmitter=require(_0x9e89('0x0'));var ChatOfflineMessage=require(_0x9e89('0x1'))['db'][_0x9e89('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9e89('0x3')](0x0);var events={'afterCreate':_0x9e89('0x4'),'afterUpdate':_0x9e89('0x5'),'afterDestroy':_0x9e89('0x6')};function emitEvent(_0xc2aa22){return function(_0x5d129f,_0x277f6a,_0x1815f3){ChatOfflineMessageEvents['emit'](_0xc2aa22+':'+_0x5d129f['id'],_0x5d129f);ChatOfflineMessageEvents[_0x9e89('0x7')](_0xc2aa22,_0x5d129f);_0x1815f3(null);};}for(var e in events){if(events[_0x9e89('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x00f0=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x48e49c,_0x18f577){var _0x4e0448=function(_0x5661e4){while(--_0x5661e4){_0x48e49c['push'](_0x48e49c['shift']());}};_0x4e0448(++_0x18f577);}(_0x00f0,0xec));var _0x000f=function(_0x4ae70d,_0x2f2082){_0x4ae70d=_0x4ae70d-0x0;var _0x446f8b=_0x00f0[_0x4ae70d];return _0x446f8b;};'use strict';var EventEmitter=require(_0x000f('0x0'));var ChatOfflineMessage=require(_0x000f('0x1'))['db'][_0x000f('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x000f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x000f('0x4')};function emitEvent(_0x4c8ce1){return function(_0x3cd8ed,_0x53989d,_0x3a0613){ChatOfflineMessageEvents[_0x000f('0x5')](_0x4c8ce1+':'+_0x3cd8ed['id'],_0x3cd8ed);ChatOfflineMessageEvents['emit'](_0x4c8ce1,_0x3cd8ed);_0x3a0613(null);};}for(var e in events){if(events[_0x000f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x000f('0x7')](e,emitEvent(event));}}module[_0x000f('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 374c76a..6905caa 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 _0x0c6e=['chat_offline_messages','./chatOfflineMessage.attributes','exports','define'];(function(_0x4f962,_0x455cef){var _0x185244=function(_0x209950){while(--_0x209950){_0x4f962['push'](_0x4f962['shift']());}};_0x185244(++_0x455cef);}(_0x0c6e,0xb9));var _0xe0c6=function(_0x149ab0,_0x220d22){_0x149ab0=_0x149ab0-0x0;var _0xea2a6c=_0x0c6e[_0x149ab0];return _0xea2a6c;};'use strict';var attributes=require(_0xe0c6('0x0'));module[_0xe0c6('0x1')]=function(_0x3c3ef9){return _0x3c3ef9[_0xe0c6('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xe0c6('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xda44=['chat_offline_messages','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x2e9f28,_0x18a89e){var _0x248a5d=function(_0x188ba1){while(--_0x188ba1){_0x2e9f28['push'](_0x2e9f28['shift']());}};_0x248a5d(++_0x18a89e);}(_0xda44,0x13c));var _0x4da4=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xda44[_0x2ec461];return _0x28603d;};'use strict';var attributes=require(_0x4da4('0x0'));module[_0x4da4('0x1')]=function(_0x2e07ba){return _0x2e07ba[_0x4da4('0x2')](_0x4da4('0x3'),attributes,{'tableName':_0x4da4('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 0585cb1..472974e 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 _0xc80f=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x47b7a0,_0x304798){var _0x32f37d=function(_0x16ad8f){while(--_0x16ad8f){_0x47b7a0['push'](_0x47b7a0['shift']());}};_0x32f37d(++_0x304798);}(_0xc80f,0x7e));var _0xfc80=function(_0x2d47b5,_0x1cedfa){_0x2d47b5=_0x2d47b5-0x0;var _0x45f873=_0xc80f[_0x2d47b5];return _0x45f873;};'use strict';var _=require(_0xfc80('0x0'));var util=require(_0xfc80('0x1'));var moment=require(_0xfc80('0x2'));var BPromise=require(_0xfc80('0x3'));var rs=require(_0xfc80('0x4'));var fs=require('fs');var Redis=require(_0xfc80('0x5'));var db=require(_0xfc80('0x6'))['db'];var utils=require(_0xfc80('0x7'));var logger=require(_0xfc80('0x8'))(_0xfc80('0x9'));var config=require(_0xfc80('0xa'));var jayson=require(_0xfc80('0xb'));var client=jayson['client'][_0xfc80('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58022e,_0x385ebb,_0x394e73){return new BPromise(function(_0x78a674,_0x1e1197){return client[_0xfc80('0xd')](_0x58022e,_0x394e73)['then'](function(_0x598584){logger[_0xfc80('0xe')](_0xfc80('0xf'),_0x385ebb,'request\x20sent');logger[_0xfc80('0x10')](_0xfc80('0x11'),_0x385ebb,_0xfc80('0x12'),JSON[_0xfc80('0x13')](_0x598584));if(_0x598584[_0xfc80('0x14')]){if(_0x598584[_0xfc80('0x14')][_0xfc80('0x15')]===0x1f4){logger[_0xfc80('0x14')](_0xfc80('0xf'),_0x385ebb,_0x598584[_0xfc80('0x14')][_0xfc80('0x16')]);return _0x1e1197(_0x598584[_0xfc80('0x14')][_0xfc80('0x16')]);}logger[_0xfc80('0x14')](_0xfc80('0xf'),_0x385ebb,_0x598584[_0xfc80('0x14')][_0xfc80('0x16')]);return _0x78a674(_0x598584[_0xfc80('0x14')][_0xfc80('0x16')]);}else{logger[_0xfc80('0xe')](_0xfc80('0xf'),_0x385ebb,_0xfc80('0x12'));_0x78a674(_0x598584[_0xfc80('0x17')][_0xfc80('0x16')]);}})[_0xfc80('0x18')](function(_0x2d84a6){logger[_0xfc80('0x14')](_0xfc80('0xf'),_0x385ebb,_0x2d84a6);_0x1e1197(_0x2d84a6);});});}
\ No newline at end of file
+var _0xb9d5=['../../config/environment','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x51fb2f,_0x37f004){var _0x40be65=function(_0x296aaa){while(--_0x296aaa){_0x51fb2f['push'](_0x51fb2f['shift']());}};_0x40be65(++_0x37f004);}(_0xb9d5,0xb6));var _0x5b9d=function(_0x4fd3d3,_0x3f34ff){_0x4fd3d3=_0x4fd3d3-0x0;var _0x36e697=_0xb9d5[_0x4fd3d3];return _0x36e697;};'use strict';var _=require('lodash');var util=require(_0x5b9d('0x0'));var moment=require(_0x5b9d('0x1'));var BPromise=require(_0x5b9d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b9d('0x3'))['db'];var utils=require(_0x5b9d('0x4'));var logger=require(_0x5b9d('0x5'))(_0x5b9d('0x6'));var config=require(_0x5b9d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5b9d('0x8')][_0x5b9d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9c89ce,_0x35bde3,_0x300797){return new BPromise(function(_0x546207,_0x2fb79c){return client['request'](_0x9c89ce,_0x300797)[_0x5b9d('0xa')](function(_0x35c60b){logger[_0x5b9d('0xb')](_0x5b9d('0xc'),_0x35bde3,_0x5b9d('0xd'));logger['debug'](_0x5b9d('0xe'),_0x35bde3,_0x5b9d('0xd'),JSON[_0x5b9d('0xf')](_0x35c60b));if(_0x35c60b['error']){if(_0x35c60b['error'][_0x5b9d('0x10')]===0x1f4){logger[_0x5b9d('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x35bde3,_0x35c60b[_0x5b9d('0x11')][_0x5b9d('0x12')]);return _0x2fb79c(_0x35c60b[_0x5b9d('0x11')][_0x5b9d('0x12')]);}logger[_0x5b9d('0x11')](_0x5b9d('0xc'),_0x35bde3,_0x35c60b[_0x5b9d('0x11')]['message']);return _0x546207(_0x35c60b[_0x5b9d('0x11')][_0x5b9d('0x12')]);}else{logger[_0x5b9d('0xb')](_0x5b9d('0xc'),_0x35bde3,_0x5b9d('0xd'));_0x546207(_0x35c60b[_0x5b9d('0x13')][_0x5b9d('0x12')]);}})[_0x5b9d('0x14')](function(_0xea2730){logger['error'](_0x5b9d('0xc'),_0x35bde3,_0xea2730);_0x2fb79c(_0xea2730);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 43653d5..99c2f4a 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 _0xb2e3=['./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','show','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x9ff5a,_0x5f4f61){var _0x205979=function(_0x650a85){while(--_0x650a85){_0x9ff5a['push'](_0x9ff5a['shift']());}};_0x205979(++_0x5f4f61);}(_0xb2e3,0x157));var _0x3b2e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2e3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3b2e('0x0'));var util=require(_0x3b2e('0x1'));var path=require(_0x3b2e('0x2'));var timeout=require(_0x3b2e('0x3'));var express=require(_0x3b2e('0x4'));var router=express[_0x3b2e('0x5')]();var fs_extra=require(_0x3b2e('0x6'));var auth=require(_0x3b2e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3b2e('0x8'));var controller=require(_0x3b2e('0x9'));router[_0x3b2e('0xa')]('/',auth[_0x3b2e('0xb')](),controller['index']);router[_0x3b2e('0xa')](_0x3b2e('0xc'),auth[_0x3b2e('0xb')](),controller[_0x3b2e('0xd')]);router[_0x3b2e('0xa')]('/:id',auth[_0x3b2e('0xb')](),controller[_0x3b2e('0xe')]);router['post']('/',auth[_0x3b2e('0xb')](),controller[_0x3b2e('0xf')]);router[_0x3b2e('0x10')]('/:id',auth[_0x3b2e('0xb')](),controller[_0x3b2e('0x11')]);router[_0x3b2e('0x12')](_0x3b2e('0x13'),auth[_0x3b2e('0xb')](),controller[_0x3b2e('0x14')]);module[_0x3b2e('0x15')]=router;
\ No newline at end of file
+var _0xd5a4=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x10e8ed,_0x384a0d){var _0x4aea4a=function(_0x486ad1){while(--_0x486ad1){_0x10e8ed['push'](_0x10e8ed['shift']());}};_0x4aea4a(++_0x384a0d);}(_0xd5a4,0xb8));var _0x4d5a=function(_0x468c2a,_0x4a1ca7){_0x468c2a=_0x468c2a-0x0;var _0x2c7fee=_0xd5a4[_0x468c2a];return _0x2c7fee;};'use strict';var multer=require(_0x4d5a('0x0'));var util=require(_0x4d5a('0x1'));var path=require('path');var timeout=require(_0x4d5a('0x2'));var express=require(_0x4d5a('0x3'));var router=express[_0x4d5a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4d5a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4d5a('0x6'));var controller=require(_0x4d5a('0x7'));router[_0x4d5a('0x8')]('/',auth[_0x4d5a('0x9')](),controller[_0x4d5a('0xa')]);router['get']('/describe',auth[_0x4d5a('0x9')](),controller[_0x4d5a('0xb')]);router[_0x4d5a('0x8')](_0x4d5a('0xc'),auth['isAuthenticated'](),controller[_0x4d5a('0xd')]);router[_0x4d5a('0xe')]('/',auth[_0x4d5a('0x9')](),controller['create']);router[_0x4d5a('0xf')](_0x4d5a('0xc'),auth[_0x4d5a('0x9')](),controller[_0x4d5a('0x10')]);router['delete'](_0x4d5a('0xc'),auth[_0x4d5a('0x9')](),controller[_0x4d5a('0x11')]);module[_0x4d5a('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 8e245cf..ceec771 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 _0x7941=['sequelize','exports','STRING','ENUM','timeout','mouseOver','INTEGER'];(function(_0x10826e,_0x228c11){var _0x2d534e=function(_0xff3ebd){while(--_0xff3ebd){_0x10826e['push'](_0x10826e['shift']());}};_0x2d534e(++_0x228c11);}(_0x7941,0xcb));var _0x1794=function(_0x4ab815,_0x434bdc){_0x4ab815=_0x4ab815-0x0;var _0x50f01c=_0x7941[_0x4ab815];return _0x50f01c;};'use strict';var Sequelize=require(_0x1794('0x0'));module[_0x1794('0x1')]={'name':{'type':Sequelize[_0x1794('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1794('0x3')]('mouseOver',_0x1794('0x4')),'defaultValue':_0x1794('0x5')},'selector':{'type':Sequelize[_0x1794('0x2')]},'timeout':{'type':Sequelize[_0x1794('0x6')]}};
\ No newline at end of file
+var _0xe0ed=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x49d30a,_0xa737c2){var _0x6a6025=function(_0x38ee16){while(--_0x38ee16){_0x49d30a['push'](_0x49d30a['shift']());}};_0x6a6025(++_0xa737c2);}(_0xe0ed,0x1ab));var _0xde0e=function(_0x1258f9,_0x5dc8f3){_0x1258f9=_0x1258f9-0x0;var _0x1f8a78=_0xe0ed[_0x1258f9];return _0x1f8a78;};'use strict';var Sequelize=require(_0xde0e('0x0'));module[_0xde0e('0x1')]={'name':{'type':Sequelize[_0xde0e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xde0e('0x3')](_0xde0e('0x4'),_0xde0e('0x5')),'defaultValue':_0xde0e('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xde0e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 1abeef1..fcd9b0a 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 _0x8098=['end','error','stack','name','send','params','keys','rawAttributes','query','intersection','model','attributes','fields','length','merge','ChatProactiveAction','catch','create','body','update','find','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','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','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8098,0x1ba));var _0x8809=function(_0x288528,_0x3e9b45){_0x288528=_0x288528-0x0;var _0x5cdb7d=_0x8098[_0x288528];return _0x5cdb7d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8809('0x0'));var jsonpatch=require(_0x8809('0x1'));var rp=require(_0x8809('0x2'));var moment=require(_0x8809('0x3'));var BPromise=require(_0x8809('0x4'));var Mustache=require('mustache');var util=require(_0x8809('0x5'));var path=require(_0x8809('0x6'));var sox=require(_0x8809('0x7'));var csv=require(_0x8809('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8809('0x9'));var _=require(_0x8809('0xa'));var squel=require('squel');var crypto=require(_0x8809('0xb'));var jsforce=require(_0x8809('0xc'));var deskjs=require(_0x8809('0xd'));var toCsv=require(_0x8809('0x8'));var querystring=require(_0x8809('0xe'));var Papa=require(_0x8809('0xf'));var Redis=require(_0x8809('0x10'));var authService=require(_0x8809('0x11'));var qs=require(_0x8809('0x12'));var as=require(_0x8809('0x13'));var hardwareService=require(_0x8809('0x14'));var logger=require(_0x8809('0x15'))(_0x8809('0x16'));var utils=require(_0x8809('0x17'));var config=require(_0x8809('0x18'));var licenseUtil=require(_0x8809('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x388b99,_0x455989){_0x455989=_0x455989||0xcc;return function(_0x4d3b4c){if(_0x4d3b4c){return _0x388b99[_0x8809('0x1a')](_0x455989);}return _0x388b99[_0x8809('0x1b')](_0x455989)['end']();};}function respondWithResult(_0x5d87df,_0x316f2c){_0x316f2c=_0x316f2c||0xc8;return function(_0x2e4279){if(_0x2e4279){return _0x5d87df[_0x8809('0x1b')](_0x316f2c)[_0x8809('0x1c')](_0x2e4279);}};}function respondWithFilteredResult(_0x131716,_0x3d4d7e){return function(_0x105bec){if(_0x105bec){var _0x5624b5=typeof _0x3d4d7e[_0x8809('0x1d')]===_0x8809('0x1e')&&typeof _0x3d4d7e['limit']===_0x8809('0x1e');var _0x369d58=_0x105bec['count'];var _0x3b0562=_0x5624b5?0x0:_0x3d4d7e[_0x8809('0x1d')];var _0x7ec1a6=_0x5624b5?_0x105bec[_0x8809('0x1f')]:_0x3d4d7e[_0x8809('0x1d')]+_0x3d4d7e['limit'];var _0x4826e2;if(_0x7ec1a6>=_0x369d58){_0x7ec1a6=_0x369d58;_0x4826e2=0xc8;}else{_0x4826e2=0xce;}_0x131716[_0x8809('0x1b')](_0x4826e2);return _0x131716[_0x8809('0x20')](_0x8809('0x21'),_0x3b0562+'-'+_0x7ec1a6+'/'+_0x369d58)[_0x8809('0x1c')](_0x105bec);}return null;};}function patchUpdates(_0x2ff4a1){return function(_0x91de1e){try{jsonpatch[_0x8809('0x22')](_0x91de1e,_0x2ff4a1,!![]);}catch(_0x404be9){return BPromise[_0x8809('0x23')](_0x404be9);}return _0x91de1e[_0x8809('0x24')]();};}function saveUpdates(_0x16893a,_0x1440aa){return function(_0x26b43e){if(_0x26b43e){return _0x26b43e['update'](_0x16893a)['then'](function(_0x34d2df){return _0x34d2df;});}return null;};}function removeEntity(_0x5984c6,_0x521840){return function(_0x54ddd8){if(_0x54ddd8){return _0x54ddd8['destroy']()[_0x8809('0x25')](function(){_0x5984c6[_0x8809('0x1b')](0xcc)[_0x8809('0x26')]();});}};}function handleEntityNotFound(_0x2bbf26,_0x2947f7){return function(_0x3d21fd){if(!_0x3d21fd){_0x2bbf26[_0x8809('0x1a')](0x194);}return _0x3d21fd;};}function handleError(_0x14f545,_0x125776){_0x125776=_0x125776||0x1f4;return function(_0x6e5dc8){logger[_0x8809('0x27')](_0x6e5dc8[_0x8809('0x28')]);if(_0x6e5dc8['name']){delete _0x6e5dc8[_0x8809('0x29')];}_0x14f545[_0x8809('0x1b')](_0x125776)[_0x8809('0x2a')](_0x6e5dc8);};}exports['show']=function(_0x13d74b,_0x443741){var _0xbba52b={'raw':!![],'where':{'id':_0x13d74b[_0x8809('0x2b')]['id']}},_0x296187={};_0x296187['model']=_[_0x8809('0x2c')](db['ChatProactiveAction'][_0x8809('0x2d')]);_0x296187[_0x8809('0x2e')]=_['keys'](_0x13d74b[_0x8809('0x2e')]);_0x296187['filters']=_[_0x8809('0x2f')](_0x296187[_0x8809('0x30')],_0x296187[_0x8809('0x2e')]);_0xbba52b[_0x8809('0x31')]=_[_0x8809('0x2f')](_0x296187[_0x8809('0x30')],qs['fields'](_0x13d74b['query'][_0x8809('0x32')]));_0xbba52b[_0x8809('0x31')]=_0xbba52b[_0x8809('0x31')][_0x8809('0x33')]?_0xbba52b[_0x8809('0x31')]:_0x296187['model'];if(_0x13d74b[_0x8809('0x2e')]['includeAll']){_0xbba52b['include']=[{'all':!![]}];}_0xbba52b=_[_0x8809('0x34')]({},_0xbba52b,_0x13d74b['options']);return db[_0x8809('0x35')]['find'](_0xbba52b)[_0x8809('0x25')](handleEntityNotFound(_0x443741,null))[_0x8809('0x25')](respondWithResult(_0x443741,null))[_0x8809('0x36')](handleError(_0x443741,null));};exports[_0x8809('0x37')]=function(_0x27565c,_0x29c522){return db['ChatProactiveAction'][_0x8809('0x37')](_0x27565c[_0x8809('0x38')],{})['then'](respondWithResult(_0x29c522,0xc9))[_0x8809('0x36')](handleError(_0x29c522,null));};exports[_0x8809('0x39')]=function(_0x4a09a,_0x2f584f){if(_0x4a09a[_0x8809('0x38')]['id']){delete _0x4a09a[_0x8809('0x38')]['id'];}return db['ChatProactiveAction'][_0x8809('0x3a')]({'where':{'id':_0x4a09a[_0x8809('0x2b')]['id']}})[_0x8809('0x25')](handleEntityNotFound(_0x2f584f,null))[_0x8809('0x25')](saveUpdates(_0x4a09a[_0x8809('0x38')],null))[_0x8809('0x25')](respondWithResult(_0x2f584f,null))[_0x8809('0x36')](handleError(_0x2f584f,null));};exports[_0x8809('0x3b')]=function(_0x4e73ff,_0x13b530){return db[_0x8809('0x35')][_0x8809('0x3a')]({'where':{'id':_0x4e73ff[_0x8809('0x2b')]['id']}})['then'](handleEntityNotFound(_0x13b530,null))[_0x8809('0x25')](removeEntity(_0x13b530,null))[_0x8809('0x36')](handleError(_0x13b530,null));};
\ No newline at end of file
+var _0x777f=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','model','ChatProactiveAction','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x1aa66f,_0x275c62){var _0xda3e71=function(_0x2b09d3){while(--_0x2b09d3){_0x1aa66f['push'](_0x1aa66f['shift']());}};_0xda3e71(++_0x275c62);}(_0x777f,0x9f));var _0xf777=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x777f[_0x326e79];return _0x37eb89;};'use strict';var emlformat=require(_0xf777('0x0'));var rimraf=require(_0xf777('0x1'));var zipdir=require(_0xf777('0x2'));var jsonpatch=require(_0xf777('0x3'));var rp=require(_0xf777('0x4'));var moment=require(_0xf777('0x5'));var BPromise=require(_0xf777('0x6'));var Mustache=require(_0xf777('0x7'));var util=require('util');var path=require(_0xf777('0x8'));var sox=require(_0xf777('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf777('0xa'));var squel=require(_0xf777('0xb'));var crypto=require(_0xf777('0xc'));var jsforce=require(_0xf777('0xd'));var deskjs=require(_0xf777('0xe'));var toCsv=require(_0xf777('0xf'));var querystring=require(_0xf777('0x10'));var Papa=require(_0xf777('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf777('0x12'));var hardwareService=require(_0xf777('0x13'));var logger=require('../../config/logger')(_0xf777('0x14'));var utils=require(_0xf777('0x15'));var config=require(_0xf777('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf777('0x17'))['db'];function respondWithStatusCode(_0x43c032,_0x5d7c2b){_0x5d7c2b=_0x5d7c2b||0xcc;return function(_0x1c8c65){if(_0x1c8c65){return _0x43c032[_0xf777('0x18')](_0x5d7c2b);}return _0x43c032[_0xf777('0x19')](_0x5d7c2b)[_0xf777('0x1a')]();};}function respondWithResult(_0x4d2173,_0x52e5a1){_0x52e5a1=_0x52e5a1||0xc8;return function(_0x8a1436){if(_0x8a1436){return _0x4d2173['status'](_0x52e5a1)[_0xf777('0x1b')](_0x8a1436);}};}function respondWithFilteredResult(_0x18aa74,_0x182c00){return function(_0x5780f5){if(_0x5780f5){var _0x3ecaa5=typeof _0x182c00[_0xf777('0x1c')]===_0xf777('0x1d')&&typeof _0x182c00[_0xf777('0x1e')]===_0xf777('0x1d');var _0xb3908a=_0x5780f5[_0xf777('0x1f')];var _0x3e0ba3=_0x3ecaa5?0x0:_0x182c00[_0xf777('0x1c')];var _0x126f72=_0x3ecaa5?_0x5780f5[_0xf777('0x1f')]:_0x182c00['offset']+_0x182c00[_0xf777('0x1e')];var _0x4e0edb;if(_0x126f72>=_0xb3908a){_0x126f72=_0xb3908a;_0x4e0edb=0xc8;}else{_0x4e0edb=0xce;}_0x18aa74[_0xf777('0x19')](_0x4e0edb);return _0x18aa74['set'](_0xf777('0x20'),_0x3e0ba3+'-'+_0x126f72+'/'+_0xb3908a)['json'](_0x5780f5);}return null;};}function patchUpdates(_0x4c6d39){return function(_0x3b4b0e){try{jsonpatch[_0xf777('0x21')](_0x3b4b0e,_0x4c6d39,!![]);}catch(_0x4e370b){return BPromise[_0xf777('0x22')](_0x4e370b);}return _0x3b4b0e[_0xf777('0x23')]();};}function saveUpdates(_0x50bddb,_0x55c56a){return function(_0x54bdf8){if(_0x54bdf8){return _0x54bdf8[_0xf777('0x24')](_0x50bddb)[_0xf777('0x25')](function(_0x527305){return _0x527305;});}return null;};}function removeEntity(_0x57d2b4,_0x43384d){return function(_0x5a0a3f){if(_0x5a0a3f){return _0x5a0a3f[_0xf777('0x26')]()['then'](function(){_0x57d2b4[_0xf777('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fd176,_0x2a1c7f){return function(_0x4d4296){if(!_0x4d4296){_0x4fd176[_0xf777('0x18')](0x194);}return _0x4d4296;};}function handleError(_0x48a961,_0x130461){_0x130461=_0x130461||0x1f4;return function(_0x1a1d74){logger[_0xf777('0x27')](_0x1a1d74[_0xf777('0x28')]);if(_0x1a1d74[_0xf777('0x29')]){delete _0x1a1d74[_0xf777('0x29')];}_0x48a961['status'](_0x130461)[_0xf777('0x2a')](_0x1a1d74);};}exports[_0xf777('0x2b')]=function(_0x13b2a8,_0x4f38f2){var _0x4f6933={'raw':!![],'where':{'id':_0x13b2a8['params']['id']}},_0x451e21={};_0x451e21[_0xf777('0x2c')]=_['keys'](db[_0xf777('0x2d')]['rawAttributes']);_0x451e21[_0xf777('0x2e')]=_[_0xf777('0x2f')](_0x13b2a8[_0xf777('0x2e')]);_0x451e21[_0xf777('0x30')]=_[_0xf777('0x31')](_0x451e21[_0xf777('0x2c')],_0x451e21['query']);_0x4f6933[_0xf777('0x32')]=_[_0xf777('0x31')](_0x451e21[_0xf777('0x2c')],qs[_0xf777('0x33')](_0x13b2a8[_0xf777('0x2e')][_0xf777('0x33')]));_0x4f6933[_0xf777('0x32')]=_0x4f6933['attributes'][_0xf777('0x34')]?_0x4f6933[_0xf777('0x32')]:_0x451e21[_0xf777('0x2c')];if(_0x13b2a8[_0xf777('0x2e')][_0xf777('0x35')]){_0x4f6933[_0xf777('0x36')]=[{'all':!![]}];}_0x4f6933=_['merge']({},_0x4f6933,_0x13b2a8[_0xf777('0x37')]);return db[_0xf777('0x2d')][_0xf777('0x38')](_0x4f6933)[_0xf777('0x25')](handleEntityNotFound(_0x4f38f2,null))[_0xf777('0x25')](respondWithResult(_0x4f38f2,null))[_0xf777('0x39')](handleError(_0x4f38f2,null));};exports[_0xf777('0x3a')]=function(_0x88cbc8,_0x49c864){return db[_0xf777('0x2d')][_0xf777('0x3a')](_0x88cbc8[_0xf777('0x3b')],{})[_0xf777('0x25')](respondWithResult(_0x49c864,0xc9))['catch'](handleError(_0x49c864,null));};exports[_0xf777('0x24')]=function(_0x5c5a43,_0x377c85){if(_0x5c5a43[_0xf777('0x3b')]['id']){delete _0x5c5a43[_0xf777('0x3b')]['id'];}return db[_0xf777('0x2d')]['find']({'where':{'id':_0x5c5a43['params']['id']}})[_0xf777('0x25')](handleEntityNotFound(_0x377c85,null))[_0xf777('0x25')](saveUpdates(_0x5c5a43[_0xf777('0x3b')],null))[_0xf777('0x25')](respondWithResult(_0x377c85,null))['catch'](handleError(_0x377c85,null));};exports[_0xf777('0x26')]=function(_0x47e847,_0x5f4757){return db[_0xf777('0x2d')][_0xf777('0x38')]({'where':{'id':_0x47e847['params']['id']}})[_0xf777('0x25')](handleEntityNotFound(_0x5f4757,null))[_0xf777('0x25')](removeEntity(_0x5f4757,null))['catch'](handleError(_0x5f4757,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 0784310..16f788b 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 _0xaf64=['util','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xaf64,0x178));var _0x4af6=function(_0x49c653,_0x390195){_0x49c653=_0x49c653-0x0;var _0x31e169=_0xaf64[_0x49c653];return _0x31e169;};'use strict';var _=require('lodash');var util=require(_0x4af6('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4af6('0x1'));var fs=require('fs');var path=require(_0x4af6('0x2'));var rimraf=require('rimraf');var config=require(_0x4af6('0x3'));var attributes=require(_0x4af6('0x4'));module[_0x4af6('0x5')]=function(_0x5b5d34,_0x4b1f90){return _0x5b5d34[_0x4af6('0x6')](_0x4af6('0x7'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd6ac=['moment','bluebird','request-promise','rimraf','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x4a0801,_0x55b298){var _0x47306d=function(_0x415a91){while(--_0x415a91){_0x4a0801['push'](_0x4a0801['shift']());}};_0x47306d(++_0x55b298);}(_0xd6ac,0x16f));var _0xcd6a=function(_0x555d51,_0x534544){_0x555d51=_0x555d51-0x0;var _0x2552f8=_0xd6ac[_0x555d51];return _0x2552f8;};'use strict';var _=require(_0xcd6a('0x0'));var util=require(_0xcd6a('0x1'));var logger=require(_0xcd6a('0x2'))('api');var moment=require(_0xcd6a('0x3'));var BPromise=require(_0xcd6a('0x4'));var rp=require(_0xcd6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd6a('0x6'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x55f2db,_0x294007){return _0x55f2db[_0xcd6a('0x7')](_0xcd6a('0x8'),attributes,{'tableName':_0xcd6a('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 df1ae6c..45f0a7f 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 _0x2a59=['stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s'];(function(_0x3bd52b,_0xbbc735){var _0x1e5b89=function(_0x29ccc3){while(--_0x29ccc3){_0x3bd52b['push'](_0x3bd52b['shift']());}};_0x1e5b89(++_0xbbc735);}(_0x2a59,0x13a));var _0x92a5=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x2a59[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x92a5('0x0'));var util=require(_0x92a5('0x1'));var moment=require(_0x92a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x92a5('0x3'));var fs=require('fs');var Redis=require(_0x92a5('0x4'));var db=require(_0x92a5('0x5'))['db'];var utils=require(_0x92a5('0x6'));var logger=require(_0x92a5('0x7'))('rpc');var config=require(_0x92a5('0x8'));var jayson=require(_0x92a5('0x9'));var client=jayson['client'][_0x92a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bc5e5,_0x12bdb5,_0x4da633){return new BPromise(function(_0x268b88,_0x34667e){return client['request'](_0x5bc5e5,_0x4da633)['then'](function(_0x3d0b30){logger[_0x92a5('0xb')](_0x92a5('0xc'),_0x12bdb5,_0x92a5('0xd'));logger[_0x92a5('0xe')](_0x92a5('0xf'),_0x12bdb5,'request\x20sent',JSON[_0x92a5('0x10')](_0x3d0b30));if(_0x3d0b30[_0x92a5('0x11')]){if(_0x3d0b30[_0x92a5('0x11')][_0x92a5('0x12')]===0x1f4){logger['error'](_0x92a5('0xc'),_0x12bdb5,_0x3d0b30['error'][_0x92a5('0x13')]);return _0x34667e(_0x3d0b30[_0x92a5('0x11')][_0x92a5('0x13')]);}logger[_0x92a5('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x12bdb5,_0x3d0b30[_0x92a5('0x11')][_0x92a5('0x13')]);return _0x268b88(_0x3d0b30[_0x92a5('0x11')][_0x92a5('0x13')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x12bdb5,_0x92a5('0xd'));_0x268b88(_0x3d0b30[_0x92a5('0x14')][_0x92a5('0x13')]);}})[_0x92a5('0x15')](function(_0x36c8a5){logger[_0x92a5('0x11')](_0x92a5('0xc'),_0x12bdb5,_0x36c8a5);_0x34667e(_0x36c8a5);});});}
\ No newline at end of file
+var _0xf05e=['rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x1da6a8,_0x2d5fcf){var _0x388f23=function(_0x1eca61){while(--_0x1eca61){_0x1da6a8['push'](_0x1da6a8['shift']());}};_0x388f23(++_0x2d5fcf);}(_0xf05e,0x179));var _0xef05=function(_0x59bd3b,_0x53eff9){_0x59bd3b=_0x59bd3b-0x0;var _0x586c53=_0xf05e[_0x59bd3b];return _0x586c53;};'use strict';var _=require(_0xef05('0x0'));var util=require(_0xef05('0x1'));var moment=require(_0xef05('0x2'));var BPromise=require(_0xef05('0x3'));var rs=require(_0xef05('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xef05('0x5'))['db'];var utils=require(_0xef05('0x6'));var logger=require('../../config/logger')(_0xef05('0x7'));var config=require(_0xef05('0x8'));var jayson=require(_0xef05('0x9'));var client=jayson['client'][_0xef05('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x530739,_0x48420f,_0x2a4c96){return new BPromise(function(_0x10a0c9,_0x275493){return client[_0xef05('0xb')](_0x530739,_0x2a4c96)[_0xef05('0xc')](function(_0x62743a){logger[_0xef05('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x48420f,'request\x20sent');logger[_0xef05('0xe')](_0xef05('0xf'),_0x48420f,'request\x20sent',JSON[_0xef05('0x10')](_0x62743a));if(_0x62743a[_0xef05('0x11')]){if(_0x62743a[_0xef05('0x11')][_0xef05('0x12')]===0x1f4){logger[_0xef05('0x11')](_0xef05('0x13'),_0x48420f,_0x62743a[_0xef05('0x11')][_0xef05('0x14')]);return _0x275493(_0x62743a[_0xef05('0x11')][_0xef05('0x14')]);}logger[_0xef05('0x11')](_0xef05('0x13'),_0x48420f,_0x62743a[_0xef05('0x11')]['message']);return _0x10a0c9(_0x62743a[_0xef05('0x11')][_0xef05('0x14')]);}else{logger[_0xef05('0xd')](_0xef05('0x13'),_0x48420f,_0xef05('0x15'));_0x10a0c9(_0x62743a[_0xef05('0x16')][_0xef05('0x14')]);}})[_0xef05('0x17')](function(_0x44e9b6){logger[_0xef05('0x11')](_0xef05('0x13'),_0x48420f,_0x44e9b6);_0x275493(_0x44e9b6);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 858acee..17e15fd 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 _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x2c32fb,_0x45b9a8){var _0x1f2836=function(_0x277504){while(--_0x277504){_0x2c32fb['push'](_0x2c32fb['shift']());}};_0x1f2836(++_0x45b9a8);}(_0x7da7,0x10d));var _0x77da=function(_0x3cd91d,_0x163516){_0x3cd91d=_0x3cd91d-0x0;var _0x3b4fab=_0x7da7[_0x3cd91d];return _0x3b4fab;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
+var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x18a085,_0x2b4a77){var _0x59b09e=function(_0x4dda9d){while(--_0x4dda9d){_0x18a085['push'](_0x18a085['shift']());}};_0x59b09e(++_0x2b4a77);}(_0x326f,0xd1));var _0xf326=function(_0x198171,_0x56c7ce){_0x198171=_0x198171-0x0;var _0x5c8c45=_0x326f[_0x198171];return _0x5c8c45;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 6fa998d..f7b80e6 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 _0x3642=['ENUM','roundrobin','exports','name','STRING','INTEGER'];(function(_0x459847,_0x3d79f4){var _0x3720fe=function(_0x213c83){while(--_0x213c83){_0x459847['push'](_0x459847['shift']());}};_0x3720fe(++_0x3d79f4);}(_0x3642,0x8c));var _0x2364=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x3642[_0x3cb6dc];return _0x47ec89;};'use strict';var Sequelize=require('sequelize');module[_0x2364('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x2364('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2364('0x2')]},'timeout':{'type':Sequelize[_0x2364('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2364('0x4')]('rrmemory','beepall',_0x2364('0x5'))}};
\ No newline at end of file
+var _0x59b5=['rrmemory','beepall','roundrobin','exports','name','STRING','INTEGER','ENUM'];(function(_0x2f0a2c,_0x56b573){var _0x146f78=function(_0x10fcc4){while(--_0x10fcc4){_0x2f0a2c['push'](_0x2f0a2c['shift']());}};_0x146f78(++_0x56b573);}(_0x59b5,0xd3));var _0x559b=function(_0x33d93d,_0xe170b3){_0x33d93d=_0x33d93d-0x0;var _0x2e4150=_0x59b5[_0x33d93d];return _0x2e4150;};'use strict';var Sequelize=require('sequelize');module[_0x559b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x559b('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x559b('0x2')]},'timeout':{'type':Sequelize[_0x559b('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x559b('0x4')](_0x559b('0x5'),_0x559b('0x6'),_0x559b('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index db70847..3e716ae 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 _0x2651=['../../mysqldb','redis','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','ChatQueue','rows','show','length','include','create','body','user','role','UserProfileSection','find','userProfileId','params','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','UserId','chatPause','updatedAt','format','createdAt','getTeams','Team','hasOwnProperty','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','emit','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xbb6fd8,_0x271a1a){var _0x2f22d3=function(_0x3dba77){while(--_0x3dba77){_0xbb6fd8['push'](_0xbb6fd8['shift']());}};_0x2f22d3(++_0x271a1a);}(_0x2651,0x7e));var _0x1265=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x2651[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1265('0x0'));var zipdir=require(_0x1265('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1265('0x2'));var moment=require(_0x1265('0x3'));var BPromise=require(_0x1265('0x4'));var Mustache=require(_0x1265('0x5'));var util=require(_0x1265('0x6'));var path=require(_0x1265('0x7'));var sox=require(_0x1265('0x8'));var csv=require('to-csv');var ejs=require(_0x1265('0x9'));var fs=require('fs');var fs_extra=require(_0x1265('0xa'));var _=require('lodash');var squel=require(_0x1265('0xb'));var crypto=require('crypto');var jsforce=require(_0x1265('0xc'));var deskjs=require(_0x1265('0xd'));var toCsv=require(_0x1265('0xe'));var querystring=require('querystring');var Papa=require(_0x1265('0xf'));var Redis=require(_0x1265('0x10'));var authService=require(_0x1265('0x11'));var qs=require(_0x1265('0x12'));var as=require(_0x1265('0x13'));var hardwareService=require(_0x1265('0x14'));var logger=require(_0x1265('0x15'))(_0x1265('0x16'));var utils=require(_0x1265('0x17'));var config=require(_0x1265('0x18'));var licenseUtil=require(_0x1265('0x19'));var db=require(_0x1265('0x1a'))['db'];config[_0x1265('0x1b')]=_['defaults'](config[_0x1265('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1265('0x1c'))(new Redis(config[_0x1265('0x1b')]));require(_0x1265('0x1d'))[_0x1265('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1265('0x1f')][_0x1265('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x41dad5,_0x1b7e85,_0x3f11cb,_0x336f10){return new BPromise(function(_0x5267ca,_0x21484d){var _0x250616=_0x336f10||client;return _0x250616[_0x1265('0x21')](_0x41dad5,_0x3f11cb)[_0x1265('0x22')](function(_0xcb8aa7){logger[_0x1265('0x23')](_0x1265('0x24'),_0x1b7e85,'request\x20sent');logger[_0x1265('0x25')](_0x1265('0x26'),_0x1b7e85,_0x1265('0x27'),JSON['stringify'](_0xcb8aa7));if(_0xcb8aa7[_0x1265('0x28')]){if(_0xcb8aa7[_0x1265('0x28')][_0x1265('0x29')]===0x1f4){logger[_0x1265('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1b7e85,_0xcb8aa7['error']['message']);return _0x21484d(_0xcb8aa7[_0x1265('0x28')]['message']);}logger[_0x1265('0x28')](_0x1265('0x24'),_0x1b7e85,_0xcb8aa7['error'][_0x1265('0x2a')]);return _0x5267ca(_0xcb8aa7['error'][_0x1265('0x2a')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x1b7e85,_0x1265('0x27'));_0x5267ca(_0xcb8aa7[_0x1265('0x2b')][_0x1265('0x2a')]);}})[_0x1265('0x2c')](function(_0x2293ee){logger[_0x1265('0x28')](_0x1265('0x24'),_0x1b7e85,_0x2293ee);_0x21484d(_0x2293ee);});});}function respondWithStatusCode(_0x156775,_0xd8c638){_0xd8c638=_0xd8c638||0xcc;return function(_0x48af72){if(_0x48af72){return _0x156775[_0x1265('0x2d')](_0xd8c638);}return _0x156775[_0x1265('0x2e')](_0xd8c638)['end']();};}function respondWithResult(_0x236abf,_0x126ad5){_0x126ad5=_0x126ad5||0xc8;return function(_0x3dc6e5){if(_0x3dc6e5){return _0x236abf['status'](_0x126ad5)[_0x1265('0x2f')](_0x3dc6e5);}};}function respondWithFilteredResult(_0x1e7cd4,_0x580f45){return function(_0x59c230){if(_0x59c230){var _0x4e2359=typeof _0x580f45[_0x1265('0x30')]==='undefined'&&typeof _0x580f45[_0x1265('0x31')]===_0x1265('0x32');var _0x448f60=_0x59c230[_0x1265('0x33')];var _0x1b9a79=_0x4e2359?0x0:_0x580f45[_0x1265('0x30')];var _0x299fcd=_0x4e2359?_0x59c230[_0x1265('0x33')]:_0x580f45[_0x1265('0x30')]+_0x580f45[_0x1265('0x31')];var _0xe13bc1;if(_0x299fcd>=_0x448f60){_0x299fcd=_0x448f60;_0xe13bc1=0xc8;}else{_0xe13bc1=0xce;}_0x1e7cd4[_0x1265('0x2e')](_0xe13bc1);return _0x1e7cd4['set'](_0x1265('0x34'),_0x1b9a79+'-'+_0x299fcd+'/'+_0x448f60)['json'](_0x59c230);}return null;};}function patchUpdates(_0x2a7b2a){return function(_0xddb167){try{jsonpatch[_0x1265('0x35')](_0xddb167,_0x2a7b2a,!![]);}catch(_0x4b1c33){return BPromise[_0x1265('0x36')](_0x4b1c33);}return _0xddb167['save']();};}function saveUpdates(_0x4bb5e1,_0x492b12){return function(_0x13eb99){if(_0x13eb99){return _0x13eb99[_0x1265('0x37')](_0x4bb5e1)[_0x1265('0x22')](function(_0x15ad9f){return _0x15ad9f;});}return null;};}function removeEntity(_0x487d69,_0x1abd6d){return function(_0x7c89be){if(_0x7c89be){return _0x7c89be[_0x1265('0x38')]()[_0x1265('0x22')](function(){var _0x1c27fd=_0x7c89be[_0x1265('0x39')]({'plain':!![]});var _0x2b52e4=_0x1265('0x3a');return db[_0x1265('0x3b')][_0x1265('0x38')]({'where':{'type':_0x2b52e4,'resourceId':_0x1c27fd['id']}})[_0x1265('0x22')](function(){return _0x7c89be;});})[_0x1265('0x22')](function(){_0x487d69[_0x1265('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf63498,_0x4b220b){return function(_0x59ba70){if(!_0x59ba70){_0xf63498[_0x1265('0x2d')](0x194);}return _0x59ba70;};}function handleError(_0x4d9b49,_0x1f1c9b){_0x1f1c9b=_0x1f1c9b||0x1f4;return function(_0x4d4df0){logger[_0x1265('0x28')](_0x4d4df0[_0x1265('0x3c')]);if(_0x4d4df0[_0x1265('0x3d')]){delete _0x4d4df0['name'];}_0x4d9b49[_0x1265('0x2e')](_0x1f1c9b)[_0x1265('0x3e')](_0x4d4df0);};}exports[_0x1265('0x3f')]=function(_0x1a87ce,_0x3272c0){var _0x55167d={},_0x39ddcc={},_0x316c07={'count':0x0,'rows':[]};var _0x433604=_[_0x1265('0x40')](db['ChatQueue'][_0x1265('0x41')],function(_0x18f6ff){return{'name':_0x18f6ff['fieldName'],'type':_0x18f6ff[_0x1265('0x42')][_0x1265('0x43')]};});_0x39ddcc[_0x1265('0x44')]=_[_0x1265('0x40')](_0x433604,_0x1265('0x3d'));_0x39ddcc[_0x1265('0x45')]=_[_0x1265('0x46')](_0x1a87ce['query']);_0x39ddcc[_0x1265('0x47')]=_[_0x1265('0x48')](_0x39ddcc['model'],_0x39ddcc[_0x1265('0x45')]);_0x55167d[_0x1265('0x49')]=_[_0x1265('0x48')](_0x39ddcc[_0x1265('0x44')],qs['fields'](_0x1a87ce[_0x1265('0x45')][_0x1265('0x4a')]));_0x55167d[_0x1265('0x49')]=_0x55167d[_0x1265('0x49')]['length']?_0x55167d['attributes']:_0x39ddcc[_0x1265('0x44')];if(!_0x1a87ce['query']['hasOwnProperty'](_0x1265('0x4b'))){_0x55167d[_0x1265('0x31')]=qs[_0x1265('0x31')](_0x1a87ce[_0x1265('0x45')]['limit']);_0x55167d[_0x1265('0x30')]=qs[_0x1265('0x30')](_0x1a87ce[_0x1265('0x45')]['offset']);}_0x55167d[_0x1265('0x4c')]=qs[_0x1265('0x4d')](_0x1a87ce[_0x1265('0x45')][_0x1265('0x4d')]);_0x55167d[_0x1265('0x4e')]=qs[_0x1265('0x47')](_[_0x1265('0x4f')](_0x1a87ce[_0x1265('0x45')],_0x39ddcc[_0x1265('0x47')]),_0x433604);if(_0x1a87ce[_0x1265('0x45')][_0x1265('0x50')]){_0x55167d[_0x1265('0x4e')]=_[_0x1265('0x51')](_0x55167d[_0x1265('0x4e')],{'$or':_['map'](_0x433604,function(_0x12aec0){if(_0x12aec0[_0x1265('0x42')]!==_0x1265('0x52')){var _0x204074={};_0x204074[_0x12aec0['name']]={'$like':'%'+_0x1a87ce[_0x1265('0x45')][_0x1265('0x50')]+'%'};return _0x204074;}})});}_0x55167d=_['merge']({},_0x55167d,_0x1a87ce[_0x1265('0x53')]);var _0x534f47={'where':_0x55167d[_0x1265('0x4e')]};return db['ChatQueue'][_0x1265('0x33')](_0x534f47)['then'](function(_0x11dbc7){_0x316c07['count']=_0x11dbc7;if(_0x1a87ce['query'][_0x1265('0x54')]){_0x55167d['include']=[{'all':!![]}];}return db[_0x1265('0x55')]['findAll'](_0x55167d);})[_0x1265('0x22')](function(_0x41f13b){_0x316c07[_0x1265('0x56')]=_0x41f13b;return _0x316c07;})[_0x1265('0x22')](respondWithFilteredResult(_0x3272c0,_0x55167d))[_0x1265('0x2c')](handleError(_0x3272c0,null));};exports[_0x1265('0x57')]=function(_0x492510,_0x159ef7){var _0x218840={'raw':!![],'where':{'id':_0x492510['params']['id']}},_0x1c65f6={};_0x1c65f6[_0x1265('0x44')]=_['keys'](db[_0x1265('0x55')]['rawAttributes']);_0x1c65f6['query']=_['keys'](_0x492510[_0x1265('0x45')]);_0x1c65f6['filters']=_[_0x1265('0x48')](_0x1c65f6[_0x1265('0x44')],_0x1c65f6[_0x1265('0x45')]);_0x218840['attributes']=_[_0x1265('0x48')](_0x1c65f6[_0x1265('0x44')],qs[_0x1265('0x4a')](_0x492510['query']['fields']));_0x218840['attributes']=_0x218840[_0x1265('0x49')][_0x1265('0x58')]?_0x218840[_0x1265('0x49')]:_0x1c65f6[_0x1265('0x44')];if(_0x492510['query'][_0x1265('0x54')]){_0x218840[_0x1265('0x59')]=[{'all':!![]}];}_0x218840=_[_0x1265('0x51')]({},_0x218840,_0x492510['options']);return db[_0x1265('0x55')]['find'](_0x218840)[_0x1265('0x22')](handleEntityNotFound(_0x159ef7,null))['then'](respondWithResult(_0x159ef7,null))[_0x1265('0x2c')](handleError(_0x159ef7,null));};exports[_0x1265('0x5a')]=function(_0x167f70,_0x4607b1){return db[_0x1265('0x55')][_0x1265('0x5a')](_0x167f70[_0x1265('0x5b')],{})[_0x1265('0x22')](function(_0x526b3b){var _0x61bb10=_0x167f70[_0x1265('0x5c')]['get']({'plain':!![]});if(!_0x61bb10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x61bb10[_0x1265('0x5d')]===_0x1265('0x5c')){var _0x40b8e8=_0x526b3b[_0x1265('0x39')]({'plain':!![]});var _0x12522d=_0x1265('0x3a');return db[_0x1265('0x5e')][_0x1265('0x5f')]({'where':{'name':_0x12522d,'userProfileId':_0x61bb10[_0x1265('0x60')]},'raw':!![]})[_0x1265('0x22')](function(_0x5aff17){if(_0x5aff17&&_0x5aff17['autoAssociation']===0x0){return db[_0x1265('0x3b')][_0x1265('0x5a')]({'name':_0x40b8e8['name'],'resourceId':_0x40b8e8['id'],'type':_0x5aff17[_0x1265('0x3d')],'sectionId':_0x5aff17['id']},{})[_0x1265('0x22')](function(){return _0x526b3b;});}else{return _0x526b3b;}})[_0x1265('0x2c')](function(_0x23d518){logger[_0x1265('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23d518);throw _0x23d518;});}return _0x526b3b;})[_0x1265('0x22')](respondWithResult(_0x4607b1,0xc9))['catch'](handleError(_0x4607b1,null));};exports[_0x1265('0x37')]=function(_0x15ee54,_0x9bfdb0){if(_0x15ee54[_0x1265('0x5b')]['id']){delete _0x15ee54[_0x1265('0x5b')]['id'];}return db[_0x1265('0x55')]['find']({'where':{'id':_0x15ee54[_0x1265('0x61')]['id']}})['then'](handleEntityNotFound(_0x9bfdb0,null))[_0x1265('0x22')](saveUpdates(_0x15ee54[_0x1265('0x5b')],null))[_0x1265('0x22')](respondWithResult(_0x9bfdb0,null))[_0x1265('0x2c')](handleError(_0x9bfdb0,null));};exports[_0x1265('0x38')]=function(_0x203388,_0x1016f2){return db[_0x1265('0x55')][_0x1265('0x5f')]({'where':{'id':_0x203388[_0x1265('0x61')]['id']}})['then'](handleEntityNotFound(_0x1016f2,null))[_0x1265('0x22')](removeEntity(_0x1016f2,null))[_0x1265('0x2c')](handleError(_0x1016f2,null));};exports[_0x1265('0x62')]=function(_0x4a6ea6,_0x526b97){return db[_0x1265('0x55')]['describe']()['then'](respondWithResult(_0x526b97,null))[_0x1265('0x2c')](handleError(_0x526b97,null));};exports[_0x1265('0x63')]=function(_0x1c4325,_0x44c3ea,_0x560e1c){var _0x16752f={'raw':!![],'where':{}},_0x1504f1={},_0x1e6e89;return db[_0x1265('0x55')][_0x1265('0x64')]({'where':{'id':_0x1c4325[_0x1265('0x61')]['id']}})['then'](handleEntityNotFound(_0x44c3ea,null))[_0x1265('0x22')](function(_0x16c9e3){if(_0x16c9e3){_0x1e6e89=_0x16c9e3[_0x1265('0x39')]({'plain':!![]});_0x1504f1[_0x1265('0x44')]=_[_0x1265('0x46')](db[_0x1265('0x65')]['rawAttributes']);_0x1504f1[_0x1265('0x45')]=_['keys'](_0x1c4325[_0x1265('0x45')]);_0x1504f1[_0x1265('0x47')]=_['intersection'](_0x1504f1[_0x1265('0x44')],_0x1504f1['query']);_0x16752f['attributes']=_[_0x1265('0x48')](_0x1504f1['model'],qs[_0x1265('0x4a')](_0x1c4325['query'][_0x1265('0x4a')]));_0x16752f[_0x1265('0x49')]=_0x16752f[_0x1265('0x49')][_0x1265('0x58')]?_0x16752f[_0x1265('0x49')]:_0x1504f1[_0x1265('0x44')];if(!_0x1c4325[_0x1265('0x45')]['hasOwnProperty'](_0x1265('0x4b'))){_0x16752f[_0x1265('0x31')]=qs[_0x1265('0x31')](_0x1c4325['query'][_0x1265('0x31')]);_0x16752f[_0x1265('0x30')]=qs['offset'](_0x1c4325[_0x1265('0x45')]['offset']);}_0x16752f[_0x1265('0x4c')]=qs['sort'](_0x1c4325[_0x1265('0x45')][_0x1265('0x4d')]);_0x16752f[_0x1265('0x4e')]=qs['filters'](_['pick'](_0x1c4325[_0x1265('0x45')],_0x1504f1[_0x1265('0x47')]));_0x16752f[_0x1265('0x4e')][_0x1265('0x66')]=_0x16c9e3['id'];if(_0x1c4325['query'][_0x1265('0x50')]){_0x16752f[_0x1265('0x4e')]=_[_0x1265('0x51')](_0x16752f[_0x1265('0x4e')],{'$or':_['map'](_0x16752f['attributes'],function(_0x3b85d9){var _0x25bf6c={};_0x25bf6c[_0x3b85d9]={'$like':'%'+_0x1c4325[_0x1265('0x45')][_0x1265('0x50')]+'%'};return _0x25bf6c;})});}_0x16752f=_[_0x1265('0x51')]({},_0x16752f,_0x1c4325[_0x1265('0x53')]);return db[_0x1265('0x65')][_0x1265('0x67')](_0x16752f);}})['then'](function(_0x32a1ee){if(_0x32a1ee){return db[_0x1265('0x68')][_0x1265('0x69')]({'where':{'id':_['map'](_0x32a1ee,_0x1265('0x6a')),'role':'agent'},'attributes':['id',_0x1265('0x3d'),_0x1265('0x6b'),_0x1265('0x6c'),'createdAt']});}})[_0x1265('0x22')](function(_0x2ac6fe){if(_0x2ac6fe){return{'count':_0x2ac6fe[_0x1265('0x33')],'rows':_[_0x1265('0x40')](_0x2ac6fe['rows'],function(_0x477a96){return{'membername':_0x477a96[_0x1265('0x3d')],'UserId':_0x477a96['id'],'queue_name':_0x1e6e89['name'],'ChatQueueId':_0x1e6e89['id'],'interface':util[_0x1265('0x6d')]('%s/%s','SIP',_0x477a96[_0x1265('0x3d')]),'penalty':0x0,'paused':_0x477a96['chatPause'],'createdAt':_0x477a96[_0x1265('0x6e')],'updatedAt':_0x477a96[_0x1265('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1265('0x22')](respondWithFilteredResult(_0x44c3ea,_0x16752f))[_0x1265('0x2c')](handleError(_0x44c3ea,null));};exports[_0x1265('0x6f')]=function(_0xe643b4,_0x4e29b5,_0x329186){var _0x1a7885={};var _0x20e3bd={};var _0x259b6b;var _0x2984a8;return db[_0x1265('0x55')][_0x1265('0x64')]({'where':{'id':_0xe643b4[_0x1265('0x61')]['id']}})[_0x1265('0x22')](handleEntityNotFound(_0x4e29b5,null))[_0x1265('0x22')](function(_0x131851){if(_0x131851){_0x259b6b=_0x131851;_0x20e3bd[_0x1265('0x44')]=_[_0x1265('0x46')](db[_0x1265('0x70')][_0x1265('0x41')]);_0x20e3bd[_0x1265('0x45')]=_[_0x1265('0x46')](_0xe643b4['query']);_0x20e3bd[_0x1265('0x47')]=_[_0x1265('0x48')](_0x20e3bd[_0x1265('0x44')],_0x20e3bd['query']);_0x1a7885['attributes']=_[_0x1265('0x48')](_0x20e3bd[_0x1265('0x44')],qs['fields'](_0xe643b4[_0x1265('0x45')][_0x1265('0x4a')]));_0x1a7885[_0x1265('0x49')]=_0x1a7885['attributes'][_0x1265('0x58')]?_0x1a7885[_0x1265('0x49')]:_0x20e3bd[_0x1265('0x44')];_0x1a7885[_0x1265('0x4c')]=qs[_0x1265('0x4d')](_0xe643b4[_0x1265('0x45')][_0x1265('0x4d')]);_0x1a7885[_0x1265('0x4e')]=qs[_0x1265('0x47')](_[_0x1265('0x4f')](_0xe643b4[_0x1265('0x45')],_0x20e3bd[_0x1265('0x47')]));if(_0xe643b4[_0x1265('0x45')][_0x1265('0x50')]){_0x1a7885['where']=_[_0x1265('0x51')](_0x1a7885[_0x1265('0x4e')],{'$or':_['map'](_0x1a7885[_0x1265('0x49')],function(_0x5e3683){var _0x17e882={};_0x17e882[_0x5e3683]={'$like':'%'+_0xe643b4['query'][_0x1265('0x50')]+'%'};return _0x17e882;})});}_0x1a7885=_[_0x1265('0x51')]({},_0x1a7885,_0xe643b4['options']);return _0x259b6b[_0x1265('0x6f')](_0x1a7885);}})[_0x1265('0x22')](function(_0x22a38f){if(_0x22a38f){_0x2984a8=_0x22a38f['length'];if(!_0xe643b4[_0x1265('0x45')][_0x1265('0x71')](_0x1265('0x4b'))){_0x1a7885[_0x1265('0x31')]=qs['limit'](_0xe643b4['query']['limit']);_0x1a7885[_0x1265('0x30')]=qs[_0x1265('0x30')](_0xe643b4[_0x1265('0x45')][_0x1265('0x30')]);}return _0x259b6b[_0x1265('0x6f')](_0x1a7885);}})[_0x1265('0x22')](function(_0x3677b1){if(_0x3677b1){return _0x3677b1?{'count':_0x2984a8,'rows':_0x3677b1}:null;}})[_0x1265('0x22')](respondWithResult(_0x4e29b5,null))[_0x1265('0x2c')](handleError(_0x4e29b5,null));};exports['addTeams']=function(_0xfb4391,_0x273b9d,_0x3acc18){var _0xc1b60d=_0xfb4391[_0x1265('0x5b')]['ids'];return db[_0x1265('0x70')][_0x1265('0x67')]({'where':{'id':_0xc1b60d},'attributes':['id'],'include':[{'model':db[_0x1265('0x68')],'as':_0x1265('0x72'),'attributes':['id',_0x1265('0x3d'),_0x1265('0x73'),_0x1265('0x74'),_0x1265('0x75')],'raw':!![]}]})[_0x1265('0x22')](function(_0x424ace){if(_0x424ace){var _0x10e5c1=_[_0x1265('0x76')](_0x424ace,function(_0x36e145){var _0x24c857=_0x36e145[_0x1265('0x39')]({'plain':!![]});return _0x24c857[_0x1265('0x72')];});return db[_0x1265('0x55')][_0x1265('0x5f')]({'where':{'id':_0xfb4391[_0x1265('0x61')]['id']}})[_0x1265('0x22')](function(_0x26a9d7){return db[_0x1265('0x77')][_0x1265('0x78')](function(_0x35c49e){return _0x26a9d7[_0x1265('0x79')](_0xc1b60d,{'transaction':_0x35c49e})[_0x1265('0x22')](function(){return BPromise[_0x1265('0x7a')](_0x10e5c1,function(_0xe993a2){return db[_0x1265('0x65')]['findOrCreate']({'where':{'UserId':_0xe993a2['id'],'ChatQueueId':_0xfb4391['params']['id']},'transaction':_0x35c49e});});})[_0x1265('0x22')](function(){_0x10e5c1[_0x1265('0x7b')](function(_0x100b74){socket['emit'](_0x1265('0x7c'),{'UserId':_0x100b74['id'],'ChatQueueId':_0x26a9d7['id']});});});});});}})[_0x1265('0x22')](respondWithStatusCode(_0x273b9d,null))['catch'](handleError(_0x273b9d,null));};exports[_0x1265('0x7d')]=function(_0x4c9ca6,_0x31af64,_0x54fd72){return db[_0x1265('0x70')]['findAll']({'where':{'id':_0x4c9ca6['query'][_0x1265('0x7e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1265('0x72'),'attributes':['id'],'raw':!![]}]})[_0x1265('0x22')](handleEntityNotFound(_0x31af64,null))[_0x1265('0x22')](function(_0x5c833d){var _0x4bd123=_['map'](_0x5c833d,'id');var _0xed7150=[];var _0x6b2c8=[];var _0x3206c0=squel[_0x1265('0x7f')]();_0x3206c0[_0x1265('0x80')](_0x1265('0x81'))[_0x1265('0x82')]('team_has_chat_queues','tq')[_0x1265('0x83')](_0x1265('0x84'),'ut',_0x1265('0x85'))[_0x1265('0x4e')](_0x1265('0x86'),_0x4c9ca6[_0x1265('0x61')]['id']);for(var _0x197f72=0x0;_0x197f72<_0x5c833d[_0x1265('0x58')];_0x197f72+=0x1){let _0x2b494c=_0x5c833d[_0x197f72];for(var _0x3e75bf=0x0;_0x3e75bf<_0x2b494c[_0x1265('0x72')][_0x1265('0x58')];_0x3e75bf+=0x1){let _0x4f18f0=_0x2b494c['Agents'][_0x3e75bf];var _0x4c699f=_0x3206c0[_0x1265('0x87')]();_0x4c699f[_0x1265('0x4e')](_0x1265('0x88'),_0x4f18f0['id']);_0x6b2c8[_0x1265('0x89')](db[_0x1265('0x77')][_0x1265('0x45')](_0x4c699f['toString'](),{'type':db[_0x1265('0x77')]['QueryTypes'][_0x1265('0x8a')]})[_0x1265('0x22')](function(_0x48a36a){if(_0x48a36a[_0x1265('0x58')]===0x1){return _0x4f18f0['id'];}else{var _0x78e01a=_[_0x1265('0x8b')](_[_0x1265('0x40')](_0x48a36a,_0x1265('0x8c')),function(_0x3f3c7f){return _[_0x1265('0x8d')](_0x4bd123,_0x3f3c7f);});if(_0x78e01a){return _0x4f18f0['id'];}}}));}}return BPromise['all'](_0x6b2c8)[_0x1265('0x22')](function(_0x163c00){_0xed7150=_(_0xed7150)[_0x1265('0x8e')](_0x163c00)[_0x1265('0x8f')]()['value']();return db[_0x1265('0x55')][_0x1265('0x5f')]({'where':{'id':_0x4c9ca6['params']['id']}})[_0x1265('0x22')](function(_0xc985e1){return db['sequelize'][_0x1265('0x78')](function(_0x56a7a3){return _0xc985e1['removeTeams'](_0x4c9ca6[_0x1265('0x45')][_0x1265('0x7e')],{'transaction':_0x56a7a3})['then'](function(){if(!_[_0x1265('0x90')](_0xed7150)){return _0xc985e1[_0x1265('0x91')](_0xed7150,{'transaction':_0x56a7a3});}})[_0x1265('0x22')](function(){_0xed7150[_0x1265('0x7b')](function(_0x16879b){socket['emit'](_0x1265('0x92'),{'UserId':_0x16879b,'ChatQueueId':_0xc985e1['id']});});});});});});})[_0x1265('0x22')](respondWithStatusCode(_0x31af64,null))[_0x1265('0x2c')](handleError(_0x31af64,null));};exports[_0x1265('0x93')]=function(_0x5d695c,_0x9a3bce,_0x36d91a){return db[_0x1265('0x55')][_0x1265('0x5f')]({'where':{'id':_0x5d695c[_0x1265('0x61')]['id']}})[_0x1265('0x22')](handleEntityNotFound(_0x9a3bce,null))['then'](function(_0x3da090){if(_0x3da090){return _0x3da090[_0x1265('0x93')](_0x5d695c[_0x1265('0x5b')][_0x1265('0x7e')],_['omit'](_0x5d695c[_0x1265('0x5b')],[_0x1265('0x7e'),'id'])||{})[_0x1265('0x94')](function(_0x309e7f){for(var _0x4823eb=0x0;_0x4823eb<_0x5d695c['body'][_0x1265('0x7e')][_0x1265('0x58')];_0x4823eb+=0x1){socket['emit'](_0x1265('0x7c'),{'UserId':Number(_0x5d695c[_0x1265('0x5b')][_0x1265('0x7e')][_0x4823eb]),'ChatQueueId':Number(_0x5d695c[_0x1265('0x61')]['id'])});}return _0x309e7f;});}})[_0x1265('0x22')](respondWithResult(_0x9a3bce,null))[_0x1265('0x2c')](handleError(_0x9a3bce,null));};exports['removeAgents']=function(_0x2cb1ad,_0x323a13,_0x26f5f5){return db[_0x1265('0x55')][_0x1265('0x5f')]({'where':{'id':_0x2cb1ad['params']['id']}})[_0x1265('0x22')](handleEntityNotFound(_0x323a13,null))['then'](function(_0x1ee133){if(_0x1ee133){return _0x1ee133[_0x1265('0x91')](_0x2cb1ad[_0x1265('0x45')][_0x1265('0x7e')])[_0x1265('0x22')](function(){if(_[_0x1265('0x95')](_0x2cb1ad['query'][_0x1265('0x7e')])){for(var _0x53417c=0x0;_0x53417c<_0x2cb1ad['query'][_0x1265('0x7e')][_0x1265('0x58')];_0x53417c+=0x1){socket[_0x1265('0x96')]('userChatQueue:remove',{'UserId':Number(_0x2cb1ad[_0x1265('0x45')][_0x1265('0x7e')][_0x53417c]),'ChatQueueId':Number(_0x2cb1ad[_0x1265('0x61')]['id'])});}}else{socket[_0x1265('0x96')](_0x1265('0x92'),{'UserId':Number(_0x2cb1ad['query'][_0x1265('0x7e')]),'ChatQueueId':Number(_0x2cb1ad[_0x1265('0x61')]['id'])});}});}})[_0x1265('0x22')](respondWithStatusCode(_0x323a13,null))[_0x1265('0x2c')](handleError(_0x323a13,null));};exports[_0x1265('0x97')]=function(_0x27d336,_0x2aa44e,_0x136c5f){var _0x2c14e6={};var _0x5c9b91={};var _0x5e46a0;var _0x582a3a;return db[_0x1265('0x55')][_0x1265('0x64')]({'where':{'id':_0x27d336[_0x1265('0x61')]['id']}})[_0x1265('0x22')](handleEntityNotFound(_0x2aa44e,null))[_0x1265('0x22')](function(_0x5eefdc){if(_0x5eefdc){_0x5e46a0=_0x5eefdc;_0x5c9b91['model']=_[_0x1265('0x46')](db[_0x1265('0x68')][_0x1265('0x41')]);_0x5c9b91[_0x1265('0x45')]=_['keys'](_0x27d336[_0x1265('0x45')]);_0x5c9b91[_0x1265('0x47')]=_[_0x1265('0x48')](_0x5c9b91['model'],_0x5c9b91[_0x1265('0x45')]);_0x2c14e6[_0x1265('0x49')]=_[_0x1265('0x48')](_0x5c9b91[_0x1265('0x44')],qs[_0x1265('0x4a')](_0x27d336[_0x1265('0x45')][_0x1265('0x4a')]));_0x2c14e6['attributes']=_0x2c14e6[_0x1265('0x49')][_0x1265('0x58')]?_0x2c14e6[_0x1265('0x49')]:_0x5c9b91[_0x1265('0x44')];_0x2c14e6[_0x1265('0x4c')]=qs[_0x1265('0x4d')](_0x27d336['query'][_0x1265('0x4d')]);_0x2c14e6[_0x1265('0x4e')]=qs[_0x1265('0x47')](_[_0x1265('0x4f')](_0x27d336[_0x1265('0x45')],_0x5c9b91[_0x1265('0x47')]));if(_0x27d336['query'][_0x1265('0x50')]){_0x2c14e6['where']=_[_0x1265('0x51')](_0x2c14e6[_0x1265('0x4e')],{'$or':_[_0x1265('0x40')](_0x2c14e6[_0x1265('0x49')],function(_0x4eda48){var _0x4dce6e={};_0x4dce6e[_0x4eda48]={'$like':'%'+_0x27d336[_0x1265('0x45')][_0x1265('0x50')]+'%'};return _0x4dce6e;})});}_0x2c14e6=_['merge']({},_0x2c14e6,_0x27d336[_0x1265('0x53')]);return _0x5e46a0[_0x1265('0x97')](_0x2c14e6);}})[_0x1265('0x22')](function(_0x1141d2){if(_0x1141d2){_0x582a3a=_0x1141d2[_0x1265('0x58')];if(!_0x27d336[_0x1265('0x45')]['hasOwnProperty'](_0x1265('0x4b'))){_0x2c14e6[_0x1265('0x31')]=qs[_0x1265('0x31')](_0x27d336[_0x1265('0x45')][_0x1265('0x31')]);_0x2c14e6['offset']=qs[_0x1265('0x30')](_0x27d336[_0x1265('0x45')]['offset']);}return _0x5e46a0['getAgents'](_0x2c14e6);}})[_0x1265('0x22')](function(_0x453477){if(_0x453477){return _0x453477?{'count':_0x582a3a,'rows':_0x453477}:null;}})[_0x1265('0x22')](respondWithResult(_0x2aa44e,null))[_0x1265('0x2c')](handleError(_0x2aa44e,null));};
\ No newline at end of file
+var _0x33f8=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','nolimit','options','findAll','User','findAndCountAll','UserId','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','flatMap','sequelize','transaction','each','forEach','userChatQueue:save','removeTeams','select','from','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','omit','spread','isArray','getAgents','findOne','rimraf','zip-dir','request-promise','bluebird'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x33f8,0x128));var _0x833f=function(_0x3895ac,_0x4c29ed){_0x3895ac=_0x3895ac-0x0;var _0x45d22b=_0x33f8[_0x3895ac];return _0x45d22b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x833f('0x0'));var zipdir=require(_0x833f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x833f('0x2'));var moment=require('moment');var BPromise=require(_0x833f('0x3'));var Mustache=require(_0x833f('0x4'));var util=require(_0x833f('0x5'));var path=require(_0x833f('0x6'));var sox=require(_0x833f('0x7'));var csv=require(_0x833f('0x8'));var ejs=require(_0x833f('0x9'));var fs=require('fs');var fs_extra=require(_0x833f('0xa'));var _=require(_0x833f('0xb'));var squel=require('squel');var crypto=require(_0x833f('0xc'));var jsforce=require(_0x833f('0xd'));var deskjs=require(_0x833f('0xe'));var toCsv=require(_0x833f('0x8'));var querystring=require(_0x833f('0xf'));var Papa=require(_0x833f('0x10'));var Redis=require(_0x833f('0x11'));var authService=require(_0x833f('0x12'));var qs=require(_0x833f('0x13'));var as=require(_0x833f('0x14'));var hardwareService=require(_0x833f('0x15'));var logger=require(_0x833f('0x16'))(_0x833f('0x17'));var utils=require('../../config/utils');var config=require(_0x833f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x833f('0x19'))['db'];config['redis']=_[_0x833f('0x1a')](config[_0x833f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x833f('0x1c'))[_0x833f('0x1d')](socket);var jayson=require(_0x833f('0x1e'));var client=jayson[_0x833f('0x1f')][_0x833f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x369e30,_0x378873,_0x4cdb51,_0x29c337){return new BPromise(function(_0x42656b,_0x160427){var _0x11ae67=_0x29c337||client;return _0x11ae67[_0x833f('0x21')](_0x369e30,_0x4cdb51)[_0x833f('0x22')](function(_0xdded16){logger[_0x833f('0x23')](_0x833f('0x24'),_0x378873,_0x833f('0x25'));logger[_0x833f('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x378873,'request\x20sent',JSON['stringify'](_0xdded16));if(_0xdded16[_0x833f('0x27')]){if(_0xdded16[_0x833f('0x27')][_0x833f('0x28')]===0x1f4){logger[_0x833f('0x27')](_0x833f('0x24'),_0x378873,_0xdded16[_0x833f('0x27')]['message']);return _0x160427(_0xdded16[_0x833f('0x27')][_0x833f('0x29')]);}logger['error'](_0x833f('0x24'),_0x378873,_0xdded16['error']['message']);return _0x42656b(_0xdded16[_0x833f('0x27')][_0x833f('0x29')]);}else{logger[_0x833f('0x23')](_0x833f('0x24'),_0x378873,'request\x20sent');_0x42656b(_0xdded16[_0x833f('0x2a')][_0x833f('0x29')]);}})[_0x833f('0x2b')](function(_0x358fc5){logger[_0x833f('0x27')]('ChatQueue,\x20%s,\x20%s',_0x378873,_0x358fc5);_0x160427(_0x358fc5);});});}function respondWithStatusCode(_0x1ee33e,_0xb2de93){_0xb2de93=_0xb2de93||0xcc;return function(_0x5c3d3f){if(_0x5c3d3f){return _0x1ee33e[_0x833f('0x2c')](_0xb2de93);}return _0x1ee33e[_0x833f('0x2d')](_0xb2de93)[_0x833f('0x2e')]();};}function respondWithResult(_0x929af3,_0x457f4a){_0x457f4a=_0x457f4a||0xc8;return function(_0x3e784f){if(_0x3e784f){return _0x929af3[_0x833f('0x2d')](_0x457f4a)[_0x833f('0x2f')](_0x3e784f);}};}function respondWithFilteredResult(_0x46dec0,_0x371bc9){return function(_0x3ca96e){if(_0x3ca96e){var _0x16e017=typeof _0x371bc9[_0x833f('0x30')]==='undefined'&&typeof _0x371bc9[_0x833f('0x31')]===_0x833f('0x32');var _0x4eeef1=_0x3ca96e[_0x833f('0x33')];var _0x4fcb30=_0x16e017?0x0:_0x371bc9[_0x833f('0x30')];var _0x1a5d54=_0x16e017?_0x3ca96e['count']:_0x371bc9[_0x833f('0x30')]+_0x371bc9['limit'];var _0x496f96;if(_0x1a5d54>=_0x4eeef1){_0x1a5d54=_0x4eeef1;_0x496f96=0xc8;}else{_0x496f96=0xce;}_0x46dec0[_0x833f('0x2d')](_0x496f96);return _0x46dec0[_0x833f('0x34')](_0x833f('0x35'),_0x4fcb30+'-'+_0x1a5d54+'/'+_0x4eeef1)[_0x833f('0x2f')](_0x3ca96e);}return null;};}function patchUpdates(_0x4b1edd){return function(_0x14a080){try{jsonpatch['apply'](_0x14a080,_0x4b1edd,!![]);}catch(_0x5a60bc){return BPromise[_0x833f('0x36')](_0x5a60bc);}return _0x14a080[_0x833f('0x37')]();};}function saveUpdates(_0x328e8,_0x141afd){return function(_0x743331){if(_0x743331){return _0x743331[_0x833f('0x38')](_0x328e8)['then'](function(_0x2bf7e5){return _0x2bf7e5;});}return null;};}function removeEntity(_0x4f9613,_0xde4caf){return function(_0x3fe938){if(_0x3fe938){return _0x3fe938[_0x833f('0x39')]()['then'](function(){var _0x173147=_0x3fe938[_0x833f('0x3a')]({'plain':!![]});var _0x48b8d3=_0x833f('0x3b');return db[_0x833f('0x3c')]['destroy']({'where':{'type':_0x48b8d3,'resourceId':_0x173147['id']}})[_0x833f('0x22')](function(){return _0x3fe938;});})[_0x833f('0x22')](function(){_0x4f9613[_0x833f('0x2d')](0xcc)[_0x833f('0x2e')]();});}};}function handleEntityNotFound(_0x55d407,_0x2466e2){return function(_0xe72fed){if(!_0xe72fed){_0x55d407[_0x833f('0x2c')](0x194);}return _0xe72fed;};}function handleError(_0x163113,_0x3eca5a){_0x3eca5a=_0x3eca5a||0x1f4;return function(_0xa86577){logger[_0x833f('0x27')](_0xa86577[_0x833f('0x3d')]);if(_0xa86577[_0x833f('0x3e')]){delete _0xa86577['name'];}_0x163113[_0x833f('0x2d')](_0x3eca5a)[_0x833f('0x3f')](_0xa86577);};}exports[_0x833f('0x40')]=function(_0x1999b7,_0x1ab48){var _0x3ff367={},_0x5d720f={},_0x35c78d={'count':0x0,'rows':[]};var _0x21e10b=_[_0x833f('0x41')](db[_0x833f('0x42')]['rawAttributes'],function(_0x6c9b2){return{'name':_0x6c9b2['fieldName'],'type':_0x6c9b2[_0x833f('0x43')][_0x833f('0x44')]};});_0x5d720f[_0x833f('0x45')]=_['map'](_0x21e10b,_0x833f('0x3e'));_0x5d720f['query']=_[_0x833f('0x46')](_0x1999b7['query']);_0x5d720f[_0x833f('0x47')]=_[_0x833f('0x48')](_0x5d720f[_0x833f('0x45')],_0x5d720f[_0x833f('0x49')]);_0x3ff367['attributes']=_[_0x833f('0x48')](_0x5d720f[_0x833f('0x45')],qs['fields'](_0x1999b7[_0x833f('0x49')]['fields']));_0x3ff367[_0x833f('0x4a')]=_0x3ff367[_0x833f('0x4a')][_0x833f('0x4b')]?_0x3ff367[_0x833f('0x4a')]:_0x5d720f[_0x833f('0x45')];if(!_0x1999b7[_0x833f('0x49')][_0x833f('0x4c')]('nolimit')){_0x3ff367[_0x833f('0x31')]=qs[_0x833f('0x31')](_0x1999b7[_0x833f('0x49')][_0x833f('0x31')]);_0x3ff367[_0x833f('0x30')]=qs['offset'](_0x1999b7[_0x833f('0x49')][_0x833f('0x30')]);}_0x3ff367[_0x833f('0x4d')]=qs[_0x833f('0x4e')](_0x1999b7[_0x833f('0x49')][_0x833f('0x4e')]);_0x3ff367['where']=qs[_0x833f('0x47')](_[_0x833f('0x4f')](_0x1999b7['query'],_0x5d720f['filters']),_0x21e10b);if(_0x1999b7[_0x833f('0x49')][_0x833f('0x50')]){_0x3ff367[_0x833f('0x51')]=_[_0x833f('0x52')](_0x3ff367[_0x833f('0x51')],{'$or':_[_0x833f('0x41')](_0x21e10b,function(_0x302a9f){if(_0x302a9f[_0x833f('0x43')]!==_0x833f('0x53')){var _0x5a5fb1={};_0x5a5fb1[_0x302a9f[_0x833f('0x3e')]]={'$like':'%'+_0x1999b7[_0x833f('0x49')][_0x833f('0x50')]+'%'};return _0x5a5fb1;}})});}_0x3ff367=_['merge']({},_0x3ff367,_0x1999b7['options']);var _0x36c2e3={'where':_0x3ff367[_0x833f('0x51')]};return db['ChatQueue'][_0x833f('0x33')](_0x36c2e3)['then'](function(_0xa2e161){_0x35c78d[_0x833f('0x33')]=_0xa2e161;if(_0x1999b7[_0x833f('0x49')][_0x833f('0x54')]){_0x3ff367[_0x833f('0x55')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x3ff367);})['then'](function(_0x4a1a90){_0x35c78d[_0x833f('0x56')]=_0x4a1a90;return _0x35c78d;})['then'](respondWithFilteredResult(_0x1ab48,_0x3ff367))[_0x833f('0x2b')](handleError(_0x1ab48,null));};exports[_0x833f('0x57')]=function(_0x1332eb,_0x2962a7){var _0x479a31={'raw':!![],'where':{'id':_0x1332eb[_0x833f('0x58')]['id']}},_0x2830fc={};_0x2830fc[_0x833f('0x45')]=_[_0x833f('0x46')](db['ChatQueue'][_0x833f('0x59')]);_0x2830fc[_0x833f('0x49')]=_[_0x833f('0x46')](_0x1332eb[_0x833f('0x49')]);_0x2830fc['filters']=_[_0x833f('0x48')](_0x2830fc['model'],_0x2830fc['query']);_0x479a31[_0x833f('0x4a')]=_['intersection'](_0x2830fc[_0x833f('0x45')],qs[_0x833f('0x5a')](_0x1332eb[_0x833f('0x49')][_0x833f('0x5a')]));_0x479a31[_0x833f('0x4a')]=_0x479a31[_0x833f('0x4a')][_0x833f('0x4b')]?_0x479a31[_0x833f('0x4a')]:_0x2830fc['model'];if(_0x1332eb[_0x833f('0x49')][_0x833f('0x54')]){_0x479a31['include']=[{'all':!![]}];}_0x479a31=_[_0x833f('0x52')]({},_0x479a31,_0x1332eb['options']);return db[_0x833f('0x42')][_0x833f('0x5b')](_0x479a31)[_0x833f('0x22')](handleEntityNotFound(_0x2962a7,null))['then'](respondWithResult(_0x2962a7,null))['catch'](handleError(_0x2962a7,null));};exports[_0x833f('0x5c')]=function(_0xc7245f,_0x2d425f){return db['ChatQueue']['create'](_0xc7245f[_0x833f('0x5d')],{})[_0x833f('0x22')](function(_0x31a713){var _0x60fc28=_0xc7245f['user'][_0x833f('0x3a')]({'plain':!![]});if(!_0x60fc28)throw new Error(_0x833f('0x5e'));if(_0x60fc28[_0x833f('0x5f')]===_0x833f('0x60')){var _0x4afaf2=_0x31a713[_0x833f('0x3a')]({'plain':!![]});var _0x27ef77=_0x833f('0x3b');return db['UserProfileSection'][_0x833f('0x5b')]({'where':{'name':_0x27ef77,'userProfileId':_0x60fc28['userProfileId']},'raw':!![]})[_0x833f('0x22')](function(_0x2d57b1){if(_0x2d57b1&&_0x2d57b1[_0x833f('0x61')]===0x0){return db[_0x833f('0x3c')][_0x833f('0x5c')]({'name':_0x4afaf2[_0x833f('0x3e')],'resourceId':_0x4afaf2['id'],'type':_0x2d57b1['name'],'sectionId':_0x2d57b1['id']},{})['then'](function(){return _0x31a713;});}else{return _0x31a713;}})['catch'](function(_0x1ca025){logger[_0x833f('0x27')](_0x833f('0x62'),_0x1ca025);throw _0x1ca025;});}return _0x31a713;})[_0x833f('0x22')](respondWithResult(_0x2d425f,0xc9))[_0x833f('0x2b')](handleError(_0x2d425f,null));};exports['update']=function(_0x3fad18,_0x3e6b6f){if(_0x3fad18[_0x833f('0x5d')]['id']){delete _0x3fad18[_0x833f('0x5d')]['id'];}return db[_0x833f('0x42')]['find']({'where':{'id':_0x3fad18['params']['id']}})[_0x833f('0x22')](handleEntityNotFound(_0x3e6b6f,null))[_0x833f('0x22')](saveUpdates(_0x3fad18['body'],null))[_0x833f('0x22')](respondWithResult(_0x3e6b6f,null))[_0x833f('0x2b')](handleError(_0x3e6b6f,null));};exports[_0x833f('0x39')]=function(_0x4cea1e,_0x5301b8){return db[_0x833f('0x42')][_0x833f('0x5b')]({'where':{'id':_0x4cea1e[_0x833f('0x58')]['id']}})[_0x833f('0x22')](handleEntityNotFound(_0x5301b8,null))[_0x833f('0x22')](removeEntity(_0x5301b8,null))['catch'](handleError(_0x5301b8,null));};exports[_0x833f('0x63')]=function(_0x56e9b9,_0xfe8750){return db['ChatQueue'][_0x833f('0x63')]()[_0x833f('0x22')](respondWithResult(_0xfe8750,null))[_0x833f('0x2b')](handleError(_0xfe8750,null));};exports[_0x833f('0x64')]=function(_0x5b9df8,_0x575177,_0x1e45b7){var _0x1a3482={'raw':!![],'where':{}},_0xa513b9={},_0x2da040;return db[_0x833f('0x42')]['findOne']({'where':{'id':_0x5b9df8['params']['id']}})[_0x833f('0x22')](handleEntityNotFound(_0x575177,null))['then'](function(_0x30f939){if(_0x30f939){_0x2da040=_0x30f939['get']({'plain':!![]});_0xa513b9[_0x833f('0x45')]=_[_0x833f('0x46')](db[_0x833f('0x65')]['rawAttributes']);_0xa513b9[_0x833f('0x49')]=_['keys'](_0x5b9df8[_0x833f('0x49')]);_0xa513b9[_0x833f('0x47')]=_[_0x833f('0x48')](_0xa513b9[_0x833f('0x45')],_0xa513b9[_0x833f('0x49')]);_0x1a3482[_0x833f('0x4a')]=_[_0x833f('0x48')](_0xa513b9['model'],qs['fields'](_0x5b9df8[_0x833f('0x49')][_0x833f('0x5a')]));_0x1a3482[_0x833f('0x4a')]=_0x1a3482[_0x833f('0x4a')]['length']?_0x1a3482['attributes']:_0xa513b9['model'];if(!_0x5b9df8[_0x833f('0x49')]['hasOwnProperty'](_0x833f('0x66'))){_0x1a3482[_0x833f('0x31')]=qs[_0x833f('0x31')](_0x5b9df8[_0x833f('0x49')][_0x833f('0x31')]);_0x1a3482[_0x833f('0x30')]=qs['offset'](_0x5b9df8[_0x833f('0x49')][_0x833f('0x30')]);}_0x1a3482[_0x833f('0x4d')]=qs['sort'](_0x5b9df8[_0x833f('0x49')]['sort']);_0x1a3482[_0x833f('0x51')]=qs[_0x833f('0x47')](_[_0x833f('0x4f')](_0x5b9df8['query'],_0xa513b9[_0x833f('0x47')]));_0x1a3482[_0x833f('0x51')]['ChatQueueId']=_0x30f939['id'];if(_0x5b9df8['query']['filter']){_0x1a3482[_0x833f('0x51')]=_[_0x833f('0x52')](_0x1a3482[_0x833f('0x51')],{'$or':_[_0x833f('0x41')](_0x1a3482[_0x833f('0x4a')],function(_0x7e1551){var _0x3f9e9e={};_0x3f9e9e[_0x7e1551]={'$like':'%'+_0x5b9df8[_0x833f('0x49')][_0x833f('0x50')]+'%'};return _0x3f9e9e;})});}_0x1a3482=_[_0x833f('0x52')]({},_0x1a3482,_0x5b9df8[_0x833f('0x67')]);return db[_0x833f('0x65')][_0x833f('0x68')](_0x1a3482);}})['then'](function(_0x9df97a){if(_0x9df97a){return db[_0x833f('0x69')][_0x833f('0x6a')]({'where':{'id':_[_0x833f('0x41')](_0x9df97a,_0x833f('0x6b')),'role':_0x833f('0x6c')},'attributes':['id',_0x833f('0x3e'),_0x833f('0x6d'),'updatedAt',_0x833f('0x6e')]});}})[_0x833f('0x22')](function(_0x5b55b0){if(_0x5b55b0){return{'count':_0x5b55b0['count'],'rows':_[_0x833f('0x41')](_0x5b55b0[_0x833f('0x56')],function(_0x312294){return{'membername':_0x312294[_0x833f('0x3e')],'UserId':_0x312294['id'],'queue_name':_0x2da040[_0x833f('0x3e')],'ChatQueueId':_0x2da040['id'],'interface':util['format'](_0x833f('0x6f'),_0x833f('0x70'),_0x312294[_0x833f('0x3e')]),'penalty':0x0,'paused':_0x312294[_0x833f('0x6d')],'createdAt':_0x312294[_0x833f('0x6e')],'updatedAt':_0x312294[_0x833f('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x833f('0x22')](respondWithFilteredResult(_0x575177,_0x1a3482))[_0x833f('0x2b')](handleError(_0x575177,null));};exports['getTeams']=function(_0x2ba614,_0x3b915b,_0x4fa39f){var _0x55facb={};var _0x39a375={};var _0x2f3f9b;var _0xdc9983;return db['ChatQueue']['findOne']({'where':{'id':_0x2ba614[_0x833f('0x58')]['id']}})['then'](handleEntityNotFound(_0x3b915b,null))[_0x833f('0x22')](function(_0x4c3931){if(_0x4c3931){_0x2f3f9b=_0x4c3931;_0x39a375['model']=_[_0x833f('0x46')](db['Team'][_0x833f('0x59')]);_0x39a375[_0x833f('0x49')]=_[_0x833f('0x46')](_0x2ba614[_0x833f('0x49')]);_0x39a375['filters']=_[_0x833f('0x48')](_0x39a375[_0x833f('0x45')],_0x39a375['query']);_0x55facb[_0x833f('0x4a')]=_[_0x833f('0x48')](_0x39a375['model'],qs[_0x833f('0x5a')](_0x2ba614['query'][_0x833f('0x5a')]));_0x55facb[_0x833f('0x4a')]=_0x55facb[_0x833f('0x4a')][_0x833f('0x4b')]?_0x55facb[_0x833f('0x4a')]:_0x39a375[_0x833f('0x45')];_0x55facb[_0x833f('0x4d')]=qs[_0x833f('0x4e')](_0x2ba614[_0x833f('0x49')]['sort']);_0x55facb[_0x833f('0x51')]=qs[_0x833f('0x47')](_['pick'](_0x2ba614[_0x833f('0x49')],_0x39a375[_0x833f('0x47')]));if(_0x2ba614[_0x833f('0x49')][_0x833f('0x50')]){_0x55facb['where']=_['merge'](_0x55facb[_0x833f('0x51')],{'$or':_[_0x833f('0x41')](_0x55facb[_0x833f('0x4a')],function(_0x417d6c){var _0x2670d4={};_0x2670d4[_0x417d6c]={'$like':'%'+_0x2ba614['query'][_0x833f('0x50')]+'%'};return _0x2670d4;})});}_0x55facb=_[_0x833f('0x52')]({},_0x55facb,_0x2ba614[_0x833f('0x67')]);return _0x2f3f9b[_0x833f('0x72')](_0x55facb);}})[_0x833f('0x22')](function(_0x2730e1){if(_0x2730e1){_0xdc9983=_0x2730e1[_0x833f('0x4b')];if(!_0x2ba614['query']['hasOwnProperty'](_0x833f('0x66'))){_0x55facb[_0x833f('0x31')]=qs[_0x833f('0x31')](_0x2ba614['query'][_0x833f('0x31')]);_0x55facb[_0x833f('0x30')]=qs[_0x833f('0x30')](_0x2ba614['query'][_0x833f('0x30')]);}return _0x2f3f9b['getTeams'](_0x55facb);}})[_0x833f('0x22')](function(_0x1f1ba4){if(_0x1f1ba4){return _0x1f1ba4?{'count':_0xdc9983,'rows':_0x1f1ba4}:null;}})[_0x833f('0x22')](respondWithResult(_0x3b915b,null))['catch'](handleError(_0x3b915b,null));};exports[_0x833f('0x73')]=function(_0x38fb8d,_0x18cafc,_0x16b3b6){var _0x32fa2a=_0x38fb8d[_0x833f('0x5d')][_0x833f('0x74')];return db[_0x833f('0x75')][_0x833f('0x68')]({'where':{'id':_0x32fa2a},'attributes':['id'],'include':[{'model':db[_0x833f('0x69')],'as':_0x833f('0x76'),'attributes':['id',_0x833f('0x3e'),'online','voicePause','interface'],'raw':!![]}]})[_0x833f('0x22')](function(_0x3bb754){if(_0x3bb754){var _0x4fb225=_[_0x833f('0x77')](_0x3bb754,function(_0x3701a0){var _0x36b025=_0x3701a0[_0x833f('0x3a')]({'plain':!![]});return _0x36b025[_0x833f('0x76')];});return db['ChatQueue'][_0x833f('0x5b')]({'where':{'id':_0x38fb8d[_0x833f('0x58')]['id']}})[_0x833f('0x22')](function(_0x3ce590){return db[_0x833f('0x78')][_0x833f('0x79')](function(_0x4820ec){return _0x3ce590[_0x833f('0x73')](_0x32fa2a,{'transaction':_0x4820ec})['then'](function(){return BPromise[_0x833f('0x7a')](_0x4fb225,function(_0x12a21d){return db[_0x833f('0x65')]['findOrCreate']({'where':{'UserId':_0x12a21d['id'],'ChatQueueId':_0x38fb8d[_0x833f('0x58')]['id']},'transaction':_0x4820ec});});})['then'](function(){_0x4fb225[_0x833f('0x7b')](function(_0x2684bc){socket['emit'](_0x833f('0x7c'),{'UserId':_0x2684bc['id'],'ChatQueueId':_0x3ce590['id']});});});});});}})[_0x833f('0x22')](respondWithStatusCode(_0x18cafc,null))[_0x833f('0x2b')](handleError(_0x18cafc,null));};exports[_0x833f('0x7d')]=function(_0x516804,_0x35baf4,_0x5ee896){return db[_0x833f('0x75')][_0x833f('0x68')]({'where':{'id':_0x516804[_0x833f('0x49')]['ids']},'attributes':['id'],'include':[{'model':db[_0x833f('0x69')],'as':_0x833f('0x76'),'attributes':['id'],'raw':!![]}]})[_0x833f('0x22')](handleEntityNotFound(_0x35baf4,null))[_0x833f('0x22')](function(_0x73a1ef){var _0x1c9019=_[_0x833f('0x41')](_0x73a1ef,'id');var _0xaf45ae=[];var _0x860f8a=[];var _0x5d9124=squel[_0x833f('0x7e')]();_0x5d9124['field']('tq.TeamId')[_0x833f('0x7f')]('team_has_chat_queues','tq')[_0x833f('0x80')](_0x833f('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x833f('0x82'),_0x516804['params']['id']);for(var _0x27bc3e=0x0;_0x27bc3e<_0x73a1ef[_0x833f('0x4b')];_0x27bc3e+=0x1){let _0x271b07=_0x73a1ef[_0x27bc3e];for(var _0x33240d=0x0;_0x33240d<_0x271b07[_0x833f('0x76')]['length'];_0x33240d+=0x1){let _0x6c4f16=_0x271b07[_0x833f('0x76')][_0x33240d];var _0x39051a=_0x5d9124[_0x833f('0x83')]();_0x39051a['where'](_0x833f('0x84'),_0x6c4f16['id']);_0x860f8a['push'](db[_0x833f('0x78')][_0x833f('0x49')](_0x39051a[_0x833f('0x85')](),{'type':db[_0x833f('0x78')][_0x833f('0x86')][_0x833f('0x87')]})[_0x833f('0x22')](function(_0x776e80){if(_0x776e80['length']===0x1){return _0x6c4f16['id'];}else{var _0x1a7358=_[_0x833f('0x88')](_['map'](_0x776e80,'TeamId'),function(_0x568308){return _[_0x833f('0x89')](_0x1c9019,_0x568308);});if(_0x1a7358){return _0x6c4f16['id'];}}}));}}return BPromise[_0x833f('0x8a')](_0x860f8a)['then'](function(_0x69fff9){_0xaf45ae=_(_0xaf45ae)['union'](_0x69fff9)[_0x833f('0x8b')]()[_0x833f('0x8c')]();return db[_0x833f('0x42')][_0x833f('0x5b')]({'where':{'id':_0x516804['params']['id']}})['then'](function(_0x289d97){return db['sequelize'][_0x833f('0x79')](function(_0x5636c9){return _0x289d97[_0x833f('0x7d')](_0x516804['query'][_0x833f('0x74')],{'transaction':_0x5636c9})[_0x833f('0x22')](function(){if(!_[_0x833f('0x8d')](_0xaf45ae)){return _0x289d97[_0x833f('0x8e')](_0xaf45ae,{'transaction':_0x5636c9});}})[_0x833f('0x22')](function(){_0xaf45ae[_0x833f('0x7b')](function(_0x412836){socket[_0x833f('0x8f')](_0x833f('0x90'),{'UserId':_0x412836,'ChatQueueId':_0x289d97['id']});});});});});});})['then'](respondWithStatusCode(_0x35baf4,null))[_0x833f('0x2b')](handleError(_0x35baf4,null));};exports['addAgents']=function(_0x213226,_0x4ae801,_0x24d02f){return db['ChatQueue'][_0x833f('0x5b')]({'where':{'id':_0x213226[_0x833f('0x58')]['id']}})['then'](handleEntityNotFound(_0x4ae801,null))[_0x833f('0x22')](function(_0x27a069){if(_0x27a069){return _0x27a069['addAgents'](_0x213226['body'][_0x833f('0x74')],_[_0x833f('0x91')](_0x213226[_0x833f('0x5d')],[_0x833f('0x74'),'id'])||{})[_0x833f('0x92')](function(_0x586292){for(var _0x4f863c=0x0;_0x4f863c<_0x213226[_0x833f('0x5d')][_0x833f('0x74')][_0x833f('0x4b')];_0x4f863c+=0x1){socket[_0x833f('0x8f')](_0x833f('0x7c'),{'UserId':Number(_0x213226[_0x833f('0x5d')][_0x833f('0x74')][_0x4f863c]),'ChatQueueId':Number(_0x213226[_0x833f('0x58')]['id'])});}return _0x586292;});}})[_0x833f('0x22')](respondWithResult(_0x4ae801,null))[_0x833f('0x2b')](handleError(_0x4ae801,null));};exports[_0x833f('0x8e')]=function(_0x63d2ef,_0x1e5d35,_0x1aab87){return db['ChatQueue']['find']({'where':{'id':_0x63d2ef[_0x833f('0x58')]['id']}})[_0x833f('0x22')](handleEntityNotFound(_0x1e5d35,null))[_0x833f('0x22')](function(_0x5548ad){if(_0x5548ad){return _0x5548ad[_0x833f('0x8e')](_0x63d2ef[_0x833f('0x49')][_0x833f('0x74')])[_0x833f('0x22')](function(){if(_[_0x833f('0x93')](_0x63d2ef[_0x833f('0x49')][_0x833f('0x74')])){for(var _0x59f60b=0x0;_0x59f60b<_0x63d2ef[_0x833f('0x49')][_0x833f('0x74')]['length'];_0x59f60b+=0x1){socket[_0x833f('0x8f')](_0x833f('0x90'),{'UserId':Number(_0x63d2ef['query']['ids'][_0x59f60b]),'ChatQueueId':Number(_0x63d2ef['params']['id'])});}}else{socket[_0x833f('0x8f')](_0x833f('0x90'),{'UserId':Number(_0x63d2ef[_0x833f('0x49')]['ids']),'ChatQueueId':Number(_0x63d2ef[_0x833f('0x58')]['id'])});}});}})[_0x833f('0x22')](respondWithStatusCode(_0x1e5d35,null))[_0x833f('0x2b')](handleError(_0x1e5d35,null));};exports[_0x833f('0x94')]=function(_0x39573a,_0x1ec9a0,_0x196608){var _0x527fe1={};var _0x32dd4f={};var _0x2906a4;var _0x4358fa;return db[_0x833f('0x42')][_0x833f('0x95')]({'where':{'id':_0x39573a[_0x833f('0x58')]['id']}})['then'](handleEntityNotFound(_0x1ec9a0,null))[_0x833f('0x22')](function(_0x55f696){if(_0x55f696){_0x2906a4=_0x55f696;_0x32dd4f[_0x833f('0x45')]=_['keys'](db['User'][_0x833f('0x59')]);_0x32dd4f[_0x833f('0x49')]=_[_0x833f('0x46')](_0x39573a[_0x833f('0x49')]);_0x32dd4f[_0x833f('0x47')]=_[_0x833f('0x48')](_0x32dd4f[_0x833f('0x45')],_0x32dd4f[_0x833f('0x49')]);_0x527fe1[_0x833f('0x4a')]=_[_0x833f('0x48')](_0x32dd4f[_0x833f('0x45')],qs[_0x833f('0x5a')](_0x39573a[_0x833f('0x49')][_0x833f('0x5a')]));_0x527fe1[_0x833f('0x4a')]=_0x527fe1[_0x833f('0x4a')][_0x833f('0x4b')]?_0x527fe1[_0x833f('0x4a')]:_0x32dd4f['model'];_0x527fe1[_0x833f('0x4d')]=qs[_0x833f('0x4e')](_0x39573a[_0x833f('0x49')][_0x833f('0x4e')]);_0x527fe1[_0x833f('0x51')]=qs[_0x833f('0x47')](_['pick'](_0x39573a['query'],_0x32dd4f[_0x833f('0x47')]));if(_0x39573a[_0x833f('0x49')][_0x833f('0x50')]){_0x527fe1[_0x833f('0x51')]=_['merge'](_0x527fe1[_0x833f('0x51')],{'$or':_[_0x833f('0x41')](_0x527fe1[_0x833f('0x4a')],function(_0x5d1860){var _0x2285e5={};_0x2285e5[_0x5d1860]={'$like':'%'+_0x39573a['query'][_0x833f('0x50')]+'%'};return _0x2285e5;})});}_0x527fe1=_[_0x833f('0x52')]({},_0x527fe1,_0x39573a['options']);return _0x2906a4[_0x833f('0x94')](_0x527fe1);}})[_0x833f('0x22')](function(_0x3a56ff){if(_0x3a56ff){_0x4358fa=_0x3a56ff[_0x833f('0x4b')];if(!_0x39573a['query'][_0x833f('0x4c')](_0x833f('0x66'))){_0x527fe1[_0x833f('0x31')]=qs[_0x833f('0x31')](_0x39573a[_0x833f('0x49')]['limit']);_0x527fe1[_0x833f('0x30')]=qs[_0x833f('0x30')](_0x39573a[_0x833f('0x49')][_0x833f('0x30')]);}return _0x2906a4['getAgents'](_0x527fe1);}})[_0x833f('0x22')](function(_0x616653){if(_0x616653){return _0x616653?{'count':_0x4358fa,'rows':_0x616653}:null;}})[_0x833f('0x22')](respondWithResult(_0x1ec9a0,null))['catch'](handleError(_0x1ec9a0,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index ece6cbe..8033992 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 _0x8fe0=['emit','hasOwnProperty','hook','exports','ChatQueue','update','remove'];(function(_0x442469,_0x5d2194){var _0x2109b4=function(_0x3fdf86){while(--_0x3fdf86){_0x442469['push'](_0x442469['shift']());}};_0x2109b4(++_0x5d2194);}(_0x8fe0,0xdd));var _0x08fe=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fe0[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x08fe('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x08fe('0x1'),'afterDestroy':_0x08fe('0x2')};function emitEvent(_0x46aa95){return function(_0x5cd8ec,_0x2fb7ea,_0x1f04bc){ChatQueueEvents[_0x08fe('0x3')](_0x46aa95+':'+_0x5cd8ec['id'],_0x5cd8ec);ChatQueueEvents[_0x08fe('0x3')](_0x46aa95,_0x5cd8ec);_0x1f04bc(null);};}for(var e in events){if(events[_0x08fe('0x4')](e)){var event=events[e];ChatQueue[_0x08fe('0x5')](e,emitEvent(event));}}module[_0x08fe('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x74a3=['hasOwnProperty','exports','events','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0x2ce44f,_0x446221){var _0x1c1495=function(_0x53857b){while(--_0x53857b){_0x2ce44f['push'](_0x2ce44f['shift']());}};_0x1c1495(++_0x446221);}(_0x74a3,0x1b2));var _0x374a=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x74a3[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require(_0x374a('0x0'));var ChatQueue=require(_0x374a('0x1'))['db'][_0x374a('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x374a('0x3'),'afterUpdate':_0x374a('0x4'),'afterDestroy':_0x374a('0x5')};function emitEvent(_0x33a53f){return function(_0x48d0c6,_0x5138f7,_0x1fd0c5){ChatQueueEvents[_0x374a('0x6')](_0x33a53f+':'+_0x48d0c6['id'],_0x48d0c6);ChatQueueEvents[_0x374a('0x6')](_0x33a53f,_0x48d0c6);_0x1fd0c5(null);};}for(var e in events){if(events[_0x374a('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x374a('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 922db01..f2e083d 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 _0x9202=['request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','../../config/logger','api','moment'];(function(_0x4fd0b2,_0x1cb32e){var _0x1a1fd2=function(_0x3cb3ee){while(--_0x3cb3ee){_0x4fd0b2['push'](_0x4fd0b2['shift']());}};_0x1a1fd2(++_0x1cb32e);}(_0x9202,0x1f1));var _0x2920=function(_0x4d9943,_0x34d95e){_0x4d9943=_0x4d9943-0x0;var _0x484515=_0x9202[_0x4d9943];return _0x484515;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2920('0x0'))(_0x2920('0x1'));var moment=require(_0x2920('0x2'));var BPromise=require('bluebird');var rp=require(_0x2920('0x3'));var fs=require('fs');var path=require(_0x2920('0x4'));var rimraf=require('rimraf');var config=require(_0x2920('0x5'));var attributes=require(_0x2920('0x6'));module[_0x2920('0x7')]=function(_0x24c23c,_0x37e1b1){return _0x24c23c[_0x2920('0x8')](_0x2920('0x9'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb801=['request-promise','path','exports','chat_queues','lodash','../../config/logger','api','moment'];(function(_0x49f79b,_0x17fdcb){var _0x2d7f34=function(_0x5062d8){while(--_0x5062d8){_0x49f79b['push'](_0x49f79b['shift']());}};_0x2d7f34(++_0x17fdcb);}(_0xb801,0x11c));var _0x1b80=function(_0x1f28a6,_0x11d1a4){_0x1f28a6=_0x1f28a6-0x0;var _0x444b21=_0xb801[_0x1f28a6];return _0x444b21;};'use strict';var _=require(_0x1b80('0x0'));var util=require('util');var logger=require(_0x1b80('0x1'))(_0x1b80('0x2'));var moment=require(_0x1b80('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b80('0x4'));var fs=require('fs');var path=require(_0x1b80('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x1b80('0x6')]=function(_0x47e1be,_0x270505){return _0x47e1be['define']('ChatQueue',attributes,{'tableName':_0x1b80('0x7'),'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 bcfa1d9..6234d43 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 _0x53aa=['where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x17ff84,_0x513e44){var _0x4d6138=function(_0x291862){while(--_0x291862){_0x17ff84['push'](_0x17ff84['shift']());}};_0x4d6138(++_0x513e44);}(_0x53aa,0x167));var _0xa53a=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x53aa[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xa53a('0x0'));var util=require(_0xa53a('0x1'));var moment=require(_0xa53a('0x2'));var BPromise=require(_0xa53a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa53a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa53a('0x5'))(_0xa53a('0x6'));var config=require(_0xa53a('0x7'));var jayson=require(_0xa53a('0x8'));var client=jayson[_0xa53a('0x9')]['http']({'port':0x232a});config[_0xa53a('0xa')]=_[_0xa53a('0xb')](config['redis'],{'host':_0xa53a('0xc'),'port':0x18eb});var socket=require(_0xa53a('0xd'))(new Redis(config[_0xa53a('0xa')]));require('./chatQueue.socket')[_0xa53a('0xe')](socket);function respondWithRpcPromise(_0x5785a9,_0x422fb3,_0x1a79a1){return new BPromise(function(_0x40bd10,_0x5d1e46){return client[_0xa53a('0xf')](_0x5785a9,_0x1a79a1)[_0xa53a('0x10')](function(_0x18eba9){logger[_0xa53a('0x11')](_0xa53a('0x12'),_0x422fb3,'request\x20sent');logger[_0xa53a('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x422fb3,_0xa53a('0x14'),JSON[_0xa53a('0x15')](_0x18eba9));if(_0x18eba9[_0xa53a('0x16')]){if(_0x18eba9[_0xa53a('0x16')][_0xa53a('0x17')]===0x1f4){logger[_0xa53a('0x16')](_0xa53a('0x12'),_0x422fb3,_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);return _0x5d1e46(_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);}logger[_0xa53a('0x16')]('ChatQueue,\x20%s,\x20%s',_0x422fb3,_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);return _0x40bd10(_0x18eba9['error'][_0xa53a('0x18')]);}else{logger[_0xa53a('0x11')](_0xa53a('0x12'),_0x422fb3,_0xa53a('0x14'));_0x40bd10(_0x18eba9[_0xa53a('0x19')][_0xa53a('0x18')]);}})[_0xa53a('0x1a')](function(_0x344350){logger[_0xa53a('0x16')](_0xa53a('0x12'),_0x422fb3,_0x344350);_0x5d1e46(_0x344350);});});}exports[_0xa53a('0x1b')]=function(_0x1a50bd){var _0x2311ba=this;return new Promise(function(_0xaecd04,_0x584c4e){return db[_0xa53a('0x1c')][_0xa53a('0x1d')]({'raw':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1a50bd[_0xa53a('0x1e')]?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x1f')]||null:null,'attributes':_0x1a50bd[_0xa53a('0x1e')]?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x20')]||null:null,'limit':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x21')]||null:null,'include':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x22')],function(_0x401aae){return{'model':db[_0x401aae[_0xa53a('0x24')]],'as':_0x401aae['as'],'attributes':_0x401aae['attributes'],'include':_0x401aae['include']?_[_0xa53a('0x23')](_0x401aae[_0xa53a('0x22')],function(_0x512d96){return{'model':db[_0x512d96[_0xa53a('0x24')]],'as':_0x512d96['as'],'attributes':_0x512d96[_0xa53a('0x20')],'include':_0x512d96[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x512d96[_0xa53a('0x22')],function(_0x1e796b){return{'model':db[_0x1e796b['model']],'as':_0x1e796b['as'],'attributes':_0x1e796b[_0xa53a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa53a('0x10')](function(_0xde3502){logger['info']('GetChatQueue',_0x1a50bd);logger[_0xa53a('0x13')](_0xa53a('0x1b'),_0x1a50bd,JSON[_0xa53a('0x15')](_0xde3502));_0xaecd04(_0xde3502);})['catch'](function(_0x2d78eb){logger[_0xa53a('0x16')](_0xa53a('0x1b'),_0x2d78eb[_0xa53a('0x18')],_0x1a50bd);_0x584c4e(_0x2311ba['error'](0x1f4,_0x2d78eb['message']));});});};exports[_0xa53a('0x25')]=function(_0x25d4f3){var _0x22d998=this;return new Promise(function(_0x315dc6,_0x3461ae){return db[_0xa53a('0x1c')][_0xa53a('0x26')]({'raw':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3['options'][_0xa53a('0x1f')]||null:null,'attributes':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')][_0xa53a('0x20')]||null:null,'include':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')][_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x25d4f3[_0xa53a('0x1e')]['include'],function(_0x351860){return{'model':db[_0x351860['model']],'as':_0x351860['as'],'attributes':_0x351860['attributes'],'include':_0x351860[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x351860[_0xa53a('0x22')],function(_0x4993df){return{'model':db[_0x4993df[_0xa53a('0x24')]],'as':_0x4993df['as'],'attributes':_0x4993df['attributes'],'include':_0x4993df[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x4993df['include'],function(_0x295898){return{'model':db[_0x295898[_0xa53a('0x24')]],'as':_0x295898['as'],'attributes':_0x295898[_0xa53a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x109276){logger[_0xa53a('0x11')]('ShowChatQueue',_0x25d4f3);logger[_0xa53a('0x13')](_0xa53a('0x25'),_0x25d4f3,JSON[_0xa53a('0x15')](_0x109276));_0x315dc6(_0x109276);})[_0xa53a('0x1a')](function(_0x13dc01){logger['error'](_0xa53a('0x25'),_0x13dc01[_0xa53a('0x18')],_0x25d4f3);_0x3461ae(_0x22d998['error'](0x1f4,_0x13dc01[_0xa53a('0x18')]));});});};
\ No newline at end of file
+var _0x6f2f=['model','attributes','then','ShowChatQueue','find','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','options','raw','where','include','map'];(function(_0x1fe978,_0x5e1d74){var _0x13b233=function(_0x2dc5d8){while(--_0x2dc5d8){_0x1fe978['push'](_0x1fe978['shift']());}};_0x13b233(++_0x5e1d74);}(_0x6f2f,0xbe));var _0xf6f2=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x6f2f[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0xf6f2('0x0'));var util=require(_0xf6f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf6f2('0x3'))(_0xf6f2('0x4'));var config=require(_0xf6f2('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf6f2('0x6')]({'port':0x232a});config[_0xf6f2('0x7')]=_[_0xf6f2('0x8')](config[_0xf6f2('0x7')],{'host':_0xf6f2('0x9'),'port':0x18eb});var socket=require(_0xf6f2('0xa'))(new Redis(config[_0xf6f2('0x7')]));require(_0xf6f2('0xb'))[_0xf6f2('0xc')](socket);function respondWithRpcPromise(_0x17ffd2,_0x55a260,_0x109271){return new BPromise(function(_0x266c6e,_0x2a4325){return client[_0xf6f2('0xd')](_0x17ffd2,_0x109271)['then'](function(_0x4ca76a){logger['info'](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));logger[_0xf6f2('0x10')](_0xf6f2('0x11'),_0x55a260,_0xf6f2('0xf'),JSON[_0xf6f2('0x12')](_0x4ca76a));if(_0x4ca76a['error']){if(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x14')]===0x1f4){logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')]['message']);return _0x2a4325(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}logger[_0xf6f2('0x13')](_0xf6f2('0xe'),_0x55a260,_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);return _0x266c6e(_0x4ca76a[_0xf6f2('0x13')][_0xf6f2('0x15')]);}else{logger[_0xf6f2('0x16')](_0xf6f2('0xe'),_0x55a260,_0xf6f2('0xf'));_0x266c6e(_0x4ca76a[_0xf6f2('0x17')][_0xf6f2('0x15')]);}})[_0xf6f2('0x18')](function(_0xb05611){logger['error']('ChatQueue,\x20%s,\x20%s',_0x55a260,_0xb05611);_0x2a4325(_0xb05611);});});}exports[_0xf6f2('0x19')]=function(_0x544f71){var _0x145a7e=this;return new Promise(function(_0xe01b4d,_0x312429){return db[_0xf6f2('0x1a')]['findAll']({'raw':_0x544f71[_0xf6f2('0x1b')]?_0x544f71[_0xf6f2('0x1b')][_0xf6f2('0x1c')]===undefined?!![]:![]:!![],'where':_0x544f71[_0xf6f2('0x1b')]?_0x544f71['options'][_0xf6f2('0x1d')]||null:null,'attributes':_0x544f71['options']?_0x544f71[_0xf6f2('0x1b')]['attributes']||null:null,'limit':_0x544f71[_0xf6f2('0x1b')]?_0x544f71[_0xf6f2('0x1b')]['limit']||null:null,'include':_0x544f71[_0xf6f2('0x1b')]?_0x544f71[_0xf6f2('0x1b')][_0xf6f2('0x1e')]?_[_0xf6f2('0x1f')](_0x544f71[_0xf6f2('0x1b')][_0xf6f2('0x1e')],function(_0x3304ec){return{'model':db[_0x3304ec[_0xf6f2('0x20')]],'as':_0x3304ec['as'],'attributes':_0x3304ec['attributes'],'include':_0x3304ec[_0xf6f2('0x1e')]?_[_0xf6f2('0x1f')](_0x3304ec[_0xf6f2('0x1e')],function(_0xf0f188){return{'model':db[_0xf0f188[_0xf6f2('0x20')]],'as':_0xf0f188['as'],'attributes':_0xf0f188[_0xf6f2('0x21')],'include':_0xf0f188[_0xf6f2('0x1e')]?_[_0xf6f2('0x1f')](_0xf0f188[_0xf6f2('0x1e')],function(_0x40243e){return{'model':db[_0x40243e[_0xf6f2('0x20')]],'as':_0x40243e['as'],'attributes':_0x40243e['attributes']};}):[]};}):[]};}):[]:[]})[_0xf6f2('0x22')](function(_0x26c4dc){logger[_0xf6f2('0x16')](_0xf6f2('0x19'),_0x544f71);logger[_0xf6f2('0x10')](_0xf6f2('0x19'),_0x544f71,JSON[_0xf6f2('0x12')](_0x26c4dc));_0xe01b4d(_0x26c4dc);})[_0xf6f2('0x18')](function(_0x6a077c){logger[_0xf6f2('0x13')](_0xf6f2('0x19'),_0x6a077c[_0xf6f2('0x15')],_0x544f71);_0x312429(_0x145a7e['error'](0x1f4,_0x6a077c[_0xf6f2('0x15')]));});});};exports[_0xf6f2('0x23')]=function(_0x2fc531){var _0x1863d9=this;return new Promise(function(_0x3aec2c,_0x3a421f){return db[_0xf6f2('0x1a')][_0xf6f2('0x24')]({'raw':_0x2fc531[_0xf6f2('0x1b')]?_0x2fc531[_0xf6f2('0x1b')][_0xf6f2('0x1c')]===undefined?!![]:![]:!![],'where':_0x2fc531[_0xf6f2('0x1b')]?_0x2fc531[_0xf6f2('0x1b')]['where']||null:null,'attributes':_0x2fc531['options']?_0x2fc531['options'][_0xf6f2('0x21')]||null:null,'include':_0x2fc531[_0xf6f2('0x1b')]?_0x2fc531['options']['include']?_[_0xf6f2('0x1f')](_0x2fc531[_0xf6f2('0x1b')][_0xf6f2('0x1e')],function(_0x9bf3e0){return{'model':db[_0x9bf3e0[_0xf6f2('0x20')]],'as':_0x9bf3e0['as'],'attributes':_0x9bf3e0[_0xf6f2('0x21')],'include':_0x9bf3e0['include']?_[_0xf6f2('0x1f')](_0x9bf3e0['include'],function(_0x33139f){return{'model':db[_0x33139f[_0xf6f2('0x20')]],'as':_0x33139f['as'],'attributes':_0x33139f[_0xf6f2('0x21')],'include':_0x33139f[_0xf6f2('0x1e')]?_['map'](_0x33139f[_0xf6f2('0x1e')],function(_0x311a37){return{'model':db[_0x311a37[_0xf6f2('0x20')]],'as':_0x311a37['as'],'attributes':_0x311a37['attributes']};}):[]};}):[]};}):[]:[]})[_0xf6f2('0x22')](function(_0x213923){logger[_0xf6f2('0x16')]('ShowChatQueue',_0x2fc531);logger[_0xf6f2('0x10')]('ShowChatQueue',_0x2fc531,JSON[_0xf6f2('0x12')](_0x213923));_0x3aec2c(_0x213923);})[_0xf6f2('0x18')](function(_0x2ed69c){logger['error'](_0xf6f2('0x23'),_0x2ed69c[_0xf6f2('0x15')],_0x2fc531);_0x3a421f(_0x1863d9[_0xf6f2('0x13')](0x1f4,_0x2ed69c[_0xf6f2('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 7bc0e92..8046db2 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 _0x826a=['update','emit','removeListener','register','length','chatQueue:','save'];(function(_0xb951b2,_0x242620){var _0x5102f0=function(_0x44504f){while(--_0x44504f){_0xb951b2['push'](_0xb951b2['shift']());}};_0x5102f0(++_0x242620);}(_0x826a,0x1aa));var _0xa826=function(_0x1b0888,_0x20ba39){_0x1b0888=_0x1b0888-0x0;var _0x24c3e2=_0x826a[_0x1b0888];return _0x24c3e2;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatQueueEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatQueueEvents['on'](_0x4339f9,_0x14c2ba);}};
\ No newline at end of file
+var _0x5178=['remove','update','register','length','save'];(function(_0x542549,_0x466258){var _0x39693b=function(_0x430e25){while(--_0x430e25){_0x542549['push'](_0x542549['shift']());}};_0x39693b(++_0x466258);}(_0x5178,0x171));var _0x8517=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5178[_0x6131cd];return _0x47e916;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8517('0x0'),_0x8517('0x1'),_0x8517('0x2')];function createListener(_0x2dc28f,_0x38d5b3){return function(_0x5e0a44){_0x38d5b3['emit'](_0x2dc28f,_0x5e0a44);};}function removeListener(_0x3ed6a5,_0x221184){return function(){ChatQueueEvents['removeListener'](_0x3ed6a5,_0x221184);};}exports[_0x8517('0x3')]=function(_0x58ed7e){for(var _0x13ba05=0x0,_0x45498e=events[_0x8517('0x4')];_0x13ba05<_0x45498e;_0x13ba05++){var _0x10f918=events[_0x13ba05];var _0x25146d=createListener('chatQueue:'+_0x10f918,_0x58ed7e);ChatQueueEvents['on'](_0x10f918,_0x25146d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index c756a69..7719bbb 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x4f8893,_0x20800b){var _0xa460e0=function(_0x4b7a18){while(--_0x4b7a18){_0x4f8893['push'](_0x4f8893['shift']());}};_0xa460e0(++_0x20800b);}(_0x814b,0x1a2));var _0xb814=function(_0x300b26,_0x3a9b67){_0x300b26=_0x300b26-0x0;var _0x5cb1ae=_0x814b[_0x300b26];return _0x5cb1ae;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x37d00f,_0x554792){var _0xfece47=function(_0x231088){while(--_0x231088){_0x37d00f['push'](_0x37d00f['shift']());}};_0xfece47(++_0x554792);}(_0xe14b,0x93));var _0xbe14=function(_0x142ed6,_0x3f2137){_0x142ed6=_0x142ed6-0x0;var _0x38f5f6=_0xe14b[_0x142ed6];return _0x38f5f6;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 360694c..47617ef 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 _0x219a=['exports','STRING','DATE','sequelize'];(function(_0x4079fd,_0x1598a3){var _0x872e1b=function(_0x1b6343){while(--_0x1b6343){_0x4079fd['push'](_0x4079fd['shift']());}};_0x872e1b(++_0x1598a3);}(_0x219a,0x1c7));var _0xa219=function(_0x32a028,_0x16c217){_0x32a028=_0x32a028-0x0;var _0x529aca=_0x219a[_0x32a028];return _0x529aca;};'use strict';var moment=require('moment');var Sequelize=require(_0xa219('0x0'));module[_0xa219('0x1')]={'uniqueid':{'type':Sequelize[_0xa219('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa219('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa219('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x50a9=['moment','sequelize','exports','STRING','DATE'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x50a9,0x11d));var _0x950a=function(_0x411f8f,_0x11a2a2){_0x411f8f=_0x411f8f-0x0;var _0x5954f8=_0x50a9[_0x411f8f];return _0x5954f8;};'use strict';var moment=require(_0x950a('0x0'));var Sequelize=require(_0x950a('0x1'));module[_0x950a('0x2')]={'uniqueid':{'type':Sequelize[_0x950a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x950a('0x3')]},'joinAt':{'type':Sequelize[_0x950a('0x4')]},'leaveAt':{'type':Sequelize[_0x950a('0x4')]},'acceptAt':{'type':Sequelize[_0x950a('0x4')]},'exitAt':{'type':Sequelize[_0x950a('0x4')]},'reason':{'type':Sequelize[_0x950a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 43fef0f..6c7ae46 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 _0x326f=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment'];(function(_0x90be5,_0x5a9d98){var _0x377d8b=function(_0x5d6352){while(--_0x5d6352){_0x90be5['push'](_0x90be5['shift']());}};_0x377d8b(++_0x5a9d98);}(_0x326f,0xd1));var _0xf326=function(_0x3361cb,_0x44fbdd){_0x3361cb=_0x3361cb-0x0;var _0x1c121b=_0x326f[_0x3361cb];return _0x1c121b;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['ChatQueueReport'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')](_0x12792c[_0xf326('0x45')],{})[_0xf326('0x24')](respondWithResult(_0x3b90dc,0xc9))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0xeac1a1,_0x59f9a7){if(_0xeac1a1[_0xf326('0x45')]['id']){delete _0xeac1a1[_0xf326('0x45')]['id'];}return db[_0xf326('0x3c')][_0xf326('0x43')]({'where':{'id':_0xeac1a1['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x59f9a7,null))[_0xf326('0x24')](saveUpdates(_0xeac1a1[_0xf326('0x45')],null))[_0xf326('0x24')](respondWithResult(_0x59f9a7,null))['catch'](handleError(_0x59f9a7,null));};exports[_0xf326('0x23')]=function(_0x1967ab,_0x145a77){return db[_0xf326('0x3c')][_0xf326('0x43')]({'where':{'id':_0x1967ab['params']['id']}})['then'](handleEntityNotFound(_0x145a77,null))[_0xf326('0x24')](removeEntity(_0x145a77,null))[_0xf326('0x40')](handleError(_0x145a77,null));};exports[_0xf326('0x46')]=function(_0x4cb25b,_0x102fba){return db[_0xf326('0x3c')][_0xf326('0x46')]()['then'](respondWithResult(_0x102fba,null))['catch'](handleError(_0x102fba,null));};
\ No newline at end of file
+var _0x4351=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','params','fields','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis'];(function(_0x190f52,_0x2927eb){var _0x4dc4c7=function(_0xaa6bf){while(--_0xaa6bf){_0x190f52['push'](_0x190f52['shift']());}};_0x4dc4c7(++_0x2927eb);}(_0x4351,0x1b5));var _0x1435=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x4351[_0x4fc9e6];return _0x551d28;};'use strict';var emlformat=require(_0x1435('0x0'));var rimraf=require(_0x1435('0x1'));var zipdir=require(_0x1435('0x2'));var jsonpatch=require(_0x1435('0x3'));var rp=require(_0x1435('0x4'));var moment=require(_0x1435('0x5'));var BPromise=require(_0x1435('0x6'));var Mustache=require(_0x1435('0x7'));var util=require(_0x1435('0x8'));var path=require(_0x1435('0x9'));var sox=require(_0x1435('0xa'));var csv=require(_0x1435('0xb'));var ejs=require(_0x1435('0xc'));var fs=require('fs');var fs_extra=require(_0x1435('0xd'));var _=require(_0x1435('0xe'));var squel=require('squel');var crypto=require(_0x1435('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1435('0xb'));var querystring=require(_0x1435('0x10'));var Papa=require(_0x1435('0x11'));var Redis=require(_0x1435('0x12'));var authService=require(_0x1435('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1435('0x14'));var hardwareService=require(_0x1435('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x1435('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1435('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1632ac,_0x5137c0){_0x5137c0=_0x5137c0||0xcc;return function(_0x47daf0){if(_0x47daf0){return _0x1632ac['sendStatus'](_0x5137c0);}return _0x1632ac[_0x1435('0x18')](_0x5137c0)[_0x1435('0x19')]();};}function respondWithResult(_0x243669,_0x4a80bc){_0x4a80bc=_0x4a80bc||0xc8;return function(_0x4a52ba){if(_0x4a52ba){return _0x243669[_0x1435('0x18')](_0x4a80bc)['json'](_0x4a52ba);}};}function respondWithFilteredResult(_0x39405c,_0x3f0b08){return function(_0x1f5fc3){if(_0x1f5fc3){var _0x202744=typeof _0x3f0b08[_0x1435('0x1a')]===_0x1435('0x1b')&&typeof _0x3f0b08[_0x1435('0x1c')]===_0x1435('0x1b');var _0x2c1a6b=_0x1f5fc3[_0x1435('0x1d')];var _0x430367=_0x202744?0x0:_0x3f0b08[_0x1435('0x1a')];var _0x68f503=_0x202744?_0x1f5fc3[_0x1435('0x1d')]:_0x3f0b08[_0x1435('0x1a')]+_0x3f0b08['limit'];var _0x26da28;if(_0x68f503>=_0x2c1a6b){_0x68f503=_0x2c1a6b;_0x26da28=0xc8;}else{_0x26da28=0xce;}_0x39405c[_0x1435('0x18')](_0x26da28);return _0x39405c['set'](_0x1435('0x1e'),_0x430367+'-'+_0x68f503+'/'+_0x2c1a6b)['json'](_0x1f5fc3);}return null;};}function patchUpdates(_0x15d7c0){return function(_0x2a72aa){try{jsonpatch[_0x1435('0x1f')](_0x2a72aa,_0x15d7c0,!![]);}catch(_0x28bc0a){return BPromise[_0x1435('0x20')](_0x28bc0a);}return _0x2a72aa[_0x1435('0x21')]();};}function saveUpdates(_0x543209,_0x17ed76){return function(_0x437f61){if(_0x437f61){return _0x437f61[_0x1435('0x22')](_0x543209)[_0x1435('0x23')](function(_0x57a94f){return _0x57a94f;});}return null;};}function removeEntity(_0x1b6259,_0x302831){return function(_0xab77fa){if(_0xab77fa){return _0xab77fa[_0x1435('0x24')]()[_0x1435('0x23')](function(){_0x1b6259[_0x1435('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523792,_0x22241f){return function(_0x2b4828){if(!_0x2b4828){_0x523792[_0x1435('0x25')](0x194);}return _0x2b4828;};}function handleError(_0x4f86f0,_0x42599d){_0x42599d=_0x42599d||0x1f4;return function(_0x25cf29){logger[_0x1435('0x26')](_0x25cf29[_0x1435('0x27')]);if(_0x25cf29[_0x1435('0x28')]){delete _0x25cf29['name'];}_0x4f86f0[_0x1435('0x18')](_0x42599d)[_0x1435('0x29')](_0x25cf29);};}exports[_0x1435('0x2a')]=function(_0x453d68,_0x1c3b7e){var _0x108c25={},_0x2e0e72={},_0x57a02f={'count':0x0,'rows':[]};var _0x31ab10=_[_0x1435('0x2b')](db[_0x1435('0x2c')][_0x1435('0x2d')],function(_0x297edf){return{'name':_0x297edf['fieldName'],'type':_0x297edf[_0x1435('0x2e')][_0x1435('0x2f')]};});_0x2e0e72[_0x1435('0x30')]=_[_0x1435('0x2b')](_0x31ab10,'name');_0x2e0e72[_0x1435('0x31')]=_[_0x1435('0x32')](_0x453d68['query']);_0x2e0e72[_0x1435('0x33')]=_['intersection'](_0x2e0e72[_0x1435('0x30')],_0x2e0e72[_0x1435('0x31')]);_0x108c25['attributes']=_[_0x1435('0x34')](_0x2e0e72[_0x1435('0x30')],qs['fields'](_0x453d68['query']['fields']));_0x108c25[_0x1435('0x35')]=_0x108c25['attributes'][_0x1435('0x36')]?_0x108c25['attributes']:_0x2e0e72[_0x1435('0x30')];if(!_0x453d68['query'][_0x1435('0x37')](_0x1435('0x38'))){_0x108c25[_0x1435('0x1c')]=qs[_0x1435('0x1c')](_0x453d68[_0x1435('0x31')][_0x1435('0x1c')]);_0x108c25['offset']=qs[_0x1435('0x1a')](_0x453d68[_0x1435('0x31')][_0x1435('0x1a')]);}_0x108c25[_0x1435('0x39')]=qs[_0x1435('0x3a')](_0x453d68['query'][_0x1435('0x3a')]);_0x108c25['where']=qs[_0x1435('0x33')](_[_0x1435('0x3b')](_0x453d68['query'],_0x2e0e72[_0x1435('0x33')]),_0x31ab10);if(_0x453d68[_0x1435('0x31')][_0x1435('0x3c')]){_0x108c25[_0x1435('0x3d')]=_[_0x1435('0x3e')](_0x108c25[_0x1435('0x3d')],{'$or':_[_0x1435('0x2b')](_0x31ab10,function(_0x176dbd){if(_0x176dbd[_0x1435('0x2e')]!==_0x1435('0x3f')){var _0x3ecac4={};_0x3ecac4[_0x176dbd[_0x1435('0x28')]]={'$like':'%'+_0x453d68['query'][_0x1435('0x3c')]+'%'};return _0x3ecac4;}})});}_0x108c25=_['merge']({},_0x108c25,_0x453d68[_0x1435('0x40')]);var _0x5b24ab={'where':_0x108c25[_0x1435('0x3d')]};return db['ChatQueueReport'][_0x1435('0x1d')](_0x5b24ab)['then'](function(_0x36bc74){_0x57a02f[_0x1435('0x1d')]=_0x36bc74;if(_0x453d68[_0x1435('0x31')]['includeAll']){_0x108c25[_0x1435('0x41')]=[{'all':!![]}];}return db[_0x1435('0x2c')][_0x1435('0x42')](_0x108c25);})['then'](function(_0x1d6417){_0x57a02f[_0x1435('0x43')]=_0x1d6417;return _0x57a02f;})['then'](respondWithFilteredResult(_0x1c3b7e,_0x108c25))['catch'](handleError(_0x1c3b7e,null));};exports[_0x1435('0x44')]=function(_0x40e9eb,_0x2dd1f5){var _0x5986f8={'raw':!![],'where':{'id':_0x40e9eb[_0x1435('0x45')]['id']}},_0x4e5d0a={};_0x4e5d0a['model']=_[_0x1435('0x32')](db['ChatQueueReport'][_0x1435('0x2d')]);_0x4e5d0a['query']=_[_0x1435('0x32')](_0x40e9eb['query']);_0x4e5d0a[_0x1435('0x33')]=_['intersection'](_0x4e5d0a[_0x1435('0x30')],_0x4e5d0a[_0x1435('0x31')]);_0x5986f8['attributes']=_[_0x1435('0x34')](_0x4e5d0a['model'],qs[_0x1435('0x46')](_0x40e9eb[_0x1435('0x31')][_0x1435('0x46')]));_0x5986f8['attributes']=_0x5986f8[_0x1435('0x35')][_0x1435('0x36')]?_0x5986f8['attributes']:_0x4e5d0a[_0x1435('0x30')];if(_0x40e9eb[_0x1435('0x31')]['includeAll']){_0x5986f8[_0x1435('0x41')]=[{'all':!![]}];}_0x5986f8=_[_0x1435('0x3e')]({},_0x5986f8,_0x40e9eb['options']);return db[_0x1435('0x2c')][_0x1435('0x47')](_0x5986f8)['then'](handleEntityNotFound(_0x2dd1f5,null))[_0x1435('0x23')](respondWithResult(_0x2dd1f5,null))[_0x1435('0x48')](handleError(_0x2dd1f5,null));};exports[_0x1435('0x49')]=function(_0x4b254e,_0x57b5d4){return db[_0x1435('0x2c')]['create'](_0x4b254e[_0x1435('0x4a')],{})['then'](respondWithResult(_0x57b5d4,0xc9))[_0x1435('0x48')](handleError(_0x57b5d4,null));};exports[_0x1435('0x22')]=function(_0x1f8899,_0x148862){if(_0x1f8899[_0x1435('0x4a')]['id']){delete _0x1f8899[_0x1435('0x4a')]['id'];}return db[_0x1435('0x2c')]['find']({'where':{'id':_0x1f8899[_0x1435('0x45')]['id']}})[_0x1435('0x23')](handleEntityNotFound(_0x148862,null))[_0x1435('0x23')](saveUpdates(_0x1f8899['body'],null))[_0x1435('0x23')](respondWithResult(_0x148862,null))[_0x1435('0x48')](handleError(_0x148862,null));};exports[_0x1435('0x24')]=function(_0x24c5d0,_0x118c06){return db[_0x1435('0x2c')][_0x1435('0x47')]({'where':{'id':_0x24c5d0[_0x1435('0x45')]['id']}})['then'](handleEntityNotFound(_0x118c06,null))[_0x1435('0x23')](removeEntity(_0x118c06,null))[_0x1435('0x48')](handleError(_0x118c06,null));};exports[_0x1435('0x4b')]=function(_0x4244e1,_0x5953ce){return db['ChatQueueReport'][_0x1435('0x4b')]()[_0x1435('0x23')](respondWithResult(_0x5953ce,null))[_0x1435('0x48')](handleError(_0x5953ce,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index a95536f..efea479 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x3a7e42,_0x58e47d){var _0x7122b7=function(_0x42acab){while(--_0x42acab){_0x3a7e42['push'](_0x3a7e42['shift']());}};_0x7122b7(++_0x58e47d);}(_0xe706,0xa3));var _0x6e70=function(_0x28ee74,_0x289441){_0x28ee74=_0x28ee74-0x0;var _0x6cc80c=_0xe706[_0x28ee74];return _0x6cc80c;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x5dc123,_0x1a7217){var _0xd98e38=function(_0x1332aa){while(--_0x1332aa){_0x5dc123['push'](_0x5dc123['shift']());}};_0xd98e38(++_0x1a7217);}(_0xe706,0xa3));var _0x6e70=function(_0x6d394d,_0x185b80){_0x6d394d=_0x6d394d-0x0;var _0x1f0621=_0xe706[_0x6d394d];return _0x1f0621;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 3bf76f3..23f4b5d 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 _0xa5db=['http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','create','options','raw','then','UpdateChatQueueReport','ChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0xa5db,0x7e));var _0xba5d=function(_0x2a51c9,_0x407762){_0x2a51c9=_0x2a51c9-0x0;var _0x569011=_0xa5db[_0x2a51c9];return _0x569011;};'use strict';var _=require(_0xba5d('0x0'));var util=require(_0xba5d('0x1'));var moment=require(_0xba5d('0x2'));var BPromise=require('bluebird');var rs=require(_0xba5d('0x3'));var fs=require('fs');var Redis=require(_0xba5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba5d('0x5'))(_0xba5d('0x6'));var config=require(_0xba5d('0x7'));var jayson=require(_0xba5d('0x8'));var client=jayson[_0xba5d('0x9')][_0xba5d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1046df,_0x5b650c,_0x4a7d12){return new BPromise(function(_0x19bca3,_0x1d27bc){return client[_0xba5d('0xb')](_0x1046df,_0x4a7d12)['then'](function(_0x4a8036){logger[_0xba5d('0xc')](_0xba5d('0xd'),_0x5b650c,_0xba5d('0xe'));logger[_0xba5d('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5b650c,_0xba5d('0xe'),JSON[_0xba5d('0x10')](_0x4a8036));if(_0x4a8036[_0xba5d('0x11')]){if(_0x4a8036[_0xba5d('0x11')][_0xba5d('0x12')]===0x1f4){logger[_0xba5d('0x11')](_0xba5d('0xd'),_0x5b650c,_0x4a8036[_0xba5d('0x11')][_0xba5d('0x13')]);return _0x1d27bc(_0x4a8036[_0xba5d('0x11')][_0xba5d('0x13')]);}logger[_0xba5d('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x5b650c,_0x4a8036[_0xba5d('0x11')]['message']);return _0x19bca3(_0x4a8036[_0xba5d('0x11')][_0xba5d('0x13')]);}else{logger[_0xba5d('0xc')](_0xba5d('0xd'),_0x5b650c,_0xba5d('0xe'));_0x19bca3(_0x4a8036[_0xba5d('0x14')][_0xba5d('0x13')]);}})[_0xba5d('0x15')](function(_0x265934){logger[_0xba5d('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x5b650c,_0x265934);_0x1d27bc(_0x265934);});});}exports[_0xba5d('0x16')]=function(_0xe3cff2){var _0x1ebcc6=this;return new Promise(function(_0x5b62f2,_0xdda906){return db['ChatQueueReport'][_0xba5d('0x17')](_0xe3cff2['body'],{'raw':_0xe3cff2[_0xba5d('0x18')]?_0xe3cff2[_0xba5d('0x18')][_0xba5d('0x19')]===undefined?!![]:![]:!![]})[_0xba5d('0x1a')](function(_0x13fc98){logger['info'](_0xba5d('0x16'),_0xe3cff2);logger['debug'](_0xba5d('0x16'),_0xe3cff2,JSON[_0xba5d('0x10')](_0x13fc98));_0x5b62f2(_0x13fc98);})['catch'](function(_0x5a879c){logger[_0xba5d('0x11')]('CreateChatQueueReport',_0x5a879c[_0xba5d('0x13')],_0xe3cff2);_0xdda906(_0x1ebcc6['error'](0x1f4,_0x5a879c[_0xba5d('0x13')]));});});};exports[_0xba5d('0x1b')]=function(_0x416aee){var _0x550dea=this;return new Promise(function(_0x8f06f1,_0x2ed45f){return db[_0xba5d('0x1c')][_0xba5d('0x1d')](_0x416aee[_0xba5d('0x1e')],{'raw':_0x416aee[_0xba5d('0x18')]?_0x416aee['options'][_0xba5d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x416aee[_0xba5d('0x18')]?_0x416aee[_0xba5d('0x18')][_0xba5d('0x1f')]||null:null,'attributes':_0x416aee[_0xba5d('0x18')]?_0x416aee[_0xba5d('0x18')][_0xba5d('0x20')]||null:null,'limit':_0x416aee[_0xba5d('0x18')]?_0x416aee[_0xba5d('0x18')][_0xba5d('0x21')]||null:null})[_0xba5d('0x1a')](function(_0x43e203){logger[_0xba5d('0xc')](_0xba5d('0x1b'),_0x416aee);logger['debug']('UpdateChatQueueReport',_0x416aee,JSON[_0xba5d('0x10')](_0x43e203));_0x8f06f1(_0x43e203);})['catch'](function(_0x4b682f){logger[_0xba5d('0x11')](_0xba5d('0x1b'),_0x4b682f[_0xba5d('0x13')],_0x416aee);_0x2ed45f(_0x550dea[_0xba5d('0x11')](0x1f4,_0x4b682f['message']));});});};
\ No newline at end of file
+var _0xf097=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','then','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment'];(function(_0x54c10d,_0x2f2251){var _0x1fa703=function(_0x508eb4){while(--_0x508eb4){_0x54c10d['push'](_0x54c10d['shift']());}};_0x1fa703(++_0x2f2251);}(_0xf097,0x66));var _0x7f09=function(_0x541e51,_0x3b4a2c){_0x541e51=_0x541e51-0x0;var _0x4cc19e=_0xf097[_0x541e51];return _0x4cc19e;};'use strict';var _=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var moment=require(_0x7f09('0x2'));var BPromise=require(_0x7f09('0x3'));var rs=require(_0x7f09('0x4'));var fs=require('fs');var Redis=require(_0x7f09('0x5'));var db=require(_0x7f09('0x6'))['db'];var utils=require(_0x7f09('0x7'));var logger=require(_0x7f09('0x8'))(_0x7f09('0x9'));var config=require('../../config/environment');var jayson=require(_0x7f09('0xa'));var client=jayson[_0x7f09('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364e42,_0x6d7627,_0x1a60cf){return new BPromise(function(_0xebfeae,_0x3336ba){return client[_0x7f09('0xc')](_0x364e42,_0x1a60cf)['then'](function(_0x4f845f){logger[_0x7f09('0xd')](_0x7f09('0xe'),_0x6d7627,'request\x20sent');logger[_0x7f09('0xf')](_0x7f09('0x10'),_0x6d7627,_0x7f09('0x11'),JSON[_0x7f09('0x12')](_0x4f845f));if(_0x4f845f[_0x7f09('0x13')]){if(_0x4f845f[_0x7f09('0x13')]['code']===0x1f4){logger[_0x7f09('0x13')](_0x7f09('0xe'),_0x6d7627,_0x4f845f[_0x7f09('0x13')][_0x7f09('0x14')]);return _0x3336ba(_0x4f845f['error']['message']);}logger[_0x7f09('0x13')](_0x7f09('0xe'),_0x6d7627,_0x4f845f['error']['message']);return _0xebfeae(_0x4f845f[_0x7f09('0x13')][_0x7f09('0x14')]);}else{logger[_0x7f09('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x6d7627,_0x7f09('0x11'));_0xebfeae(_0x4f845f[_0x7f09('0x15')][_0x7f09('0x14')]);}})[_0x7f09('0x16')](function(_0x32b561){logger[_0x7f09('0x13')](_0x7f09('0xe'),_0x6d7627,_0x32b561);_0x3336ba(_0x32b561);});});}exports[_0x7f09('0x17')]=function(_0x25ba41){var _0x420401=this;return new Promise(function(_0x4a4bcb,_0x1b5427){return db[_0x7f09('0x18')][_0x7f09('0x19')](_0x25ba41['body'],{'raw':_0x25ba41[_0x7f09('0x1a')]?_0x25ba41[_0x7f09('0x1a')][_0x7f09('0x1b')]===undefined?!![]:![]:!![]})[_0x7f09('0x1c')](function(_0x5e59e5){logger[_0x7f09('0xd')]('CreateChatQueueReport',_0x25ba41);logger['debug'](_0x7f09('0x17'),_0x25ba41,JSON[_0x7f09('0x12')](_0x5e59e5));_0x4a4bcb(_0x5e59e5);})[_0x7f09('0x16')](function(_0x916963){logger[_0x7f09('0x13')](_0x7f09('0x17'),_0x916963[_0x7f09('0x14')],_0x25ba41);_0x1b5427(_0x420401[_0x7f09('0x13')](0x1f4,_0x916963[_0x7f09('0x14')]));});});};exports[_0x7f09('0x1d')]=function(_0x225299){var _0x101640=this;return new Promise(function(_0x5bfd73,_0x2c40cf){return db[_0x7f09('0x18')][_0x7f09('0x1e')](_0x225299[_0x7f09('0x1f')],{'raw':_0x225299[_0x7f09('0x1a')]?_0x225299['options'][_0x7f09('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225299[_0x7f09('0x1a')]?_0x225299[_0x7f09('0x1a')][_0x7f09('0x20')]||null:null,'attributes':_0x225299['options']?_0x225299[_0x7f09('0x1a')][_0x7f09('0x21')]||null:null,'limit':_0x225299[_0x7f09('0x1a')]?_0x225299['options'][_0x7f09('0x22')]||null:null})[_0x7f09('0x1c')](function(_0x4d2d93){logger[_0x7f09('0xd')](_0x7f09('0x1d'),_0x225299);logger[_0x7f09('0xf')](_0x7f09('0x1d'),_0x225299,JSON[_0x7f09('0x12')](_0x4d2d93));_0x5bfd73(_0x4d2d93);})[_0x7f09('0x16')](function(_0x2af662){logger[_0x7f09('0x13')](_0x7f09('0x1d'),_0x2af662[_0x7f09('0x14')],_0x225299);_0x2c40cf(_0x101640['error'](0x1f4,_0x2af662[_0x7f09('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a823cfb..7d19663 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 _0x1499=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x5d5a51,_0x54d479){var _0x1deb2b=function(_0x1276da){while(--_0x1276da){_0x5d5a51['push'](_0x5d5a51['shift']());}};_0x1deb2b(++_0x54d479);}(_0x1499,0x8f));var _0x9149=function(_0x1d5252,_0x4d485b){_0x1d5252=_0x1d5252-0x0;var _0xf3a49e=_0x1499[_0x1d5252];return _0xf3a49e;};'use strict';var multer=require(_0x9149('0x0'));var util=require(_0x9149('0x1'));var path=require('path');var timeout=require(_0x9149('0x2'));var express=require('express');var router=express[_0x9149('0x3')]();var fs_extra=require(_0x9149('0x4'));var auth=require(_0x9149('0x5'));var interaction=require(_0x9149('0x6'));var config=require(_0x9149('0x7'));var controller=require('./chatQueueReport.controller');router[_0x9149('0x8')]('/',auth[_0x9149('0x9')](),controller[_0x9149('0xa')]);router[_0x9149('0x8')](_0x9149('0xb'),auth['isAuthenticated'](),controller[_0x9149('0xc')]);router[_0x9149('0x8')](_0x9149('0xd'),auth[_0x9149('0x9')](),controller[_0x9149('0xe')]);router[_0x9149('0xf')]('/',auth[_0x9149('0x9')](),controller['create']);router[_0x9149('0x10')]('/:id',auth[_0x9149('0x9')](),controller[_0x9149('0x11')]);router[_0x9149('0x12')](_0x9149('0xd'),auth[_0x9149('0x9')](),controller[_0x9149('0x13')]);module[_0x9149('0x14')]=router;
\ No newline at end of file
+var _0x7571=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatQueueReport.controller','isAuthenticated','get','/describe','show','post'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x7571,0x1a8));var _0x1757=function(_0x267c41,_0x244bd2){_0x267c41=_0x267c41-0x0;var _0x160aaf=_0x7571[_0x267c41];return _0x160aaf;};'use strict';var multer=require(_0x1757('0x0'));var util=require(_0x1757('0x1'));var path=require(_0x1757('0x2'));var timeout=require(_0x1757('0x3'));var express=require(_0x1757('0x4'));var router=express['Router']();var fs_extra=require(_0x1757('0x5'));var auth=require(_0x1757('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1757('0x7'));router['get']('/',auth[_0x1757('0x8')](),controller['index']);router[_0x1757('0x9')](_0x1757('0xa'),auth[_0x1757('0x8')](),controller['describe']);router[_0x1757('0x9')]('/:id',auth[_0x1757('0x8')](),controller[_0x1757('0xb')]);router[_0x1757('0xc')]('/',auth['isAuthenticated'](),controller[_0x1757('0xd')]);router[_0x1757('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1757('0xf')]);router[_0x1757('0x10')]('/:id',auth[_0x1757('0x8')](),controller[_0x1757('0x11')]);module[_0x1757('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index c0e9a28..0356e48 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x31a415,_0x342648){var _0x159ccb=function(_0x2fb50b){while(--_0x2fb50b){_0x31a415['push'](_0x31a415['shift']());}};_0x159ccb(++_0x342648);}(_0x008c,0x188));var _0xc008=function(_0x5005ba,_0x423ed1){_0x5005ba=_0x5005ba-0x0;var _0x21278c=_0x008c[_0x5005ba];return _0x21278c;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1004fa,_0x21747f){var _0x4b53f2=function(_0x5120cb){while(--_0x5120cb){_0x1004fa['push'](_0x1004fa['shift']());}};_0x4b53f2(++_0x21747f);}(_0x70e0,0x17b));var _0x070e=function(_0x309995,_0xa5e701){_0x309995=_0x309995-0x0;var _0x1453f7=_0x70e0[_0x309995];return _0x1453f7;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 526d1fa..b207343 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 _0xc5c9=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','ChatTransferReport','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4b19a5,_0x1d6119){var _0x2e663d=function(_0x5e665d){while(--_0x5e665d){_0x4b19a5['push'](_0x4b19a5['shift']());}};_0x2e663d(++_0x1d6119);}(_0xc5c9,0x11d));var _0x9c5c=function(_0x38e570,_0xf78d4f){_0x38e570=_0x38e570-0x0;var _0x58e83f=_0xc5c9[_0x38e570];return _0x58e83f;};'use strict';var emlformat=require(_0x9c5c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c5c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9c5c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x9c5c('0x3'));var util=require(_0x9c5c('0x4'));var path=require(_0x9c5c('0x5'));var sox=require(_0x9c5c('0x6'));var csv=require(_0x9c5c('0x7'));var ejs=require(_0x9c5c('0x8'));var fs=require('fs');var fs_extra=require(_0x9c5c('0x9'));var _=require(_0x9c5c('0xa'));var squel=require(_0x9c5c('0xb'));var crypto=require(_0x9c5c('0xc'));var jsforce=require(_0x9c5c('0xd'));var deskjs=require(_0x9c5c('0xe'));var toCsv=require(_0x9c5c('0x7'));var querystring=require(_0x9c5c('0xf'));var Papa=require('papaparse');var Redis=require(_0x9c5c('0x10'));var authService=require(_0x9c5c('0x11'));var qs=require(_0x9c5c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c5c('0x13'));var logger=require(_0x9c5c('0x14'))('api');var utils=require(_0x9c5c('0x15'));var config=require(_0x9c5c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28c860,_0x169806){_0x169806=_0x169806||0xcc;return function(_0xcfbd7d){if(_0xcfbd7d){return _0x28c860[_0x9c5c('0x17')](_0x169806);}return _0x28c860['status'](_0x169806)[_0x9c5c('0x18')]();};}function respondWithResult(_0x3537a5,_0x511f86){_0x511f86=_0x511f86||0xc8;return function(_0x157d2d){if(_0x157d2d){return _0x3537a5[_0x9c5c('0x19')](_0x511f86)[_0x9c5c('0x1a')](_0x157d2d);}};}function respondWithFilteredResult(_0x1f917d,_0x5590e0){return function(_0x2887bf){if(_0x2887bf){var _0x5aefe8=typeof _0x5590e0['offset']===_0x9c5c('0x1b')&&typeof _0x5590e0['limit']===_0x9c5c('0x1b');var _0x28abd6=_0x2887bf[_0x9c5c('0x1c')];var _0x13e021=_0x5aefe8?0x0:_0x5590e0[_0x9c5c('0x1d')];var _0x4b600c=_0x5aefe8?_0x2887bf[_0x9c5c('0x1c')]:_0x5590e0['offset']+_0x5590e0['limit'];var _0x5c4140;if(_0x4b600c>=_0x28abd6){_0x4b600c=_0x28abd6;_0x5c4140=0xc8;}else{_0x5c4140=0xce;}_0x1f917d['status'](_0x5c4140);return _0x1f917d[_0x9c5c('0x1e')](_0x9c5c('0x1f'),_0x13e021+'-'+_0x4b600c+'/'+_0x28abd6)[_0x9c5c('0x1a')](_0x2887bf);}return null;};}function patchUpdates(_0x4704bf){return function(_0x5f3bce){try{jsonpatch[_0x9c5c('0x20')](_0x5f3bce,_0x4704bf,!![]);}catch(_0x2e94eb){return BPromise[_0x9c5c('0x21')](_0x2e94eb);}return _0x5f3bce[_0x9c5c('0x22')]();};}function saveUpdates(_0xca2059,_0x4b0b68){return function(_0x5690d5){if(_0x5690d5){return _0x5690d5[_0x9c5c('0x23')](_0xca2059)[_0x9c5c('0x24')](function(_0x2fca61){return _0x2fca61;});}return null;};}function removeEntity(_0x134e65,_0x143020){return function(_0x26c76e){if(_0x26c76e){return _0x26c76e[_0x9c5c('0x25')]()['then'](function(){_0x134e65[_0x9c5c('0x19')](0xcc)[_0x9c5c('0x18')]();});}};}function handleEntityNotFound(_0x5922d6,_0x5768e9){return function(_0x1eca95){if(!_0x1eca95){_0x5922d6[_0x9c5c('0x17')](0x194);}return _0x1eca95;};}function handleError(_0x5439c1,_0x2417ae){_0x2417ae=_0x2417ae||0x1f4;return function(_0x34352c){logger[_0x9c5c('0x26')](_0x34352c[_0x9c5c('0x27')]);if(_0x34352c['name']){delete _0x34352c['name'];}_0x5439c1[_0x9c5c('0x19')](_0x2417ae)[_0x9c5c('0x28')](_0x34352c);};}exports['index']=function(_0x30c360,_0x17d44f){var _0x2cae75={},_0x12dfb1={},_0x1e7e25={'count':0x0,'rows':[]};var _0x4cd6c1=_[_0x9c5c('0x29')](db[_0x9c5c('0x2a')][_0x9c5c('0x2b')],function(_0x39f8ef){return{'name':_0x39f8ef['fieldName'],'type':_0x39f8ef['type'][_0x9c5c('0x2c')]};});_0x12dfb1[_0x9c5c('0x2d')]=_[_0x9c5c('0x29')](_0x4cd6c1,_0x9c5c('0x2e'));_0x12dfb1[_0x9c5c('0x2f')]=_[_0x9c5c('0x30')](_0x30c360['query']);_0x12dfb1[_0x9c5c('0x31')]=_[_0x9c5c('0x32')](_0x12dfb1[_0x9c5c('0x2d')],_0x12dfb1['query']);_0x2cae75[_0x9c5c('0x33')]=_[_0x9c5c('0x32')](_0x12dfb1[_0x9c5c('0x2d')],qs['fields'](_0x30c360['query'][_0x9c5c('0x34')]));_0x2cae75[_0x9c5c('0x33')]=_0x2cae75[_0x9c5c('0x33')][_0x9c5c('0x35')]?_0x2cae75[_0x9c5c('0x33')]:_0x12dfb1[_0x9c5c('0x2d')];if(!_0x30c360[_0x9c5c('0x2f')][_0x9c5c('0x36')](_0x9c5c('0x37'))){_0x2cae75[_0x9c5c('0x38')]=qs['limit'](_0x30c360[_0x9c5c('0x2f')][_0x9c5c('0x38')]);_0x2cae75[_0x9c5c('0x1d')]=qs[_0x9c5c('0x1d')](_0x30c360['query'][_0x9c5c('0x1d')]);}_0x2cae75[_0x9c5c('0x39')]=qs['sort'](_0x30c360[_0x9c5c('0x2f')][_0x9c5c('0x3a')]);_0x2cae75[_0x9c5c('0x3b')]=qs[_0x9c5c('0x31')](_[_0x9c5c('0x3c')](_0x30c360[_0x9c5c('0x2f')],_0x12dfb1[_0x9c5c('0x31')]),_0x4cd6c1);if(_0x30c360[_0x9c5c('0x2f')][_0x9c5c('0x3d')]){_0x2cae75[_0x9c5c('0x3b')]=_[_0x9c5c('0x3e')](_0x2cae75[_0x9c5c('0x3b')],{'$or':_[_0x9c5c('0x29')](_0x4cd6c1,function(_0x4d2aee){if(_0x4d2aee['type']!==_0x9c5c('0x3f')){var _0x40b833={};_0x40b833[_0x4d2aee['name']]={'$like':'%'+_0x30c360['query'][_0x9c5c('0x3d')]+'%'};return _0x40b833;}})});}_0x2cae75=_[_0x9c5c('0x3e')]({},_0x2cae75,_0x30c360[_0x9c5c('0x40')]);var _0x384cb0={'where':_0x2cae75[_0x9c5c('0x3b')]};return db[_0x9c5c('0x2a')][_0x9c5c('0x1c')](_0x384cb0)['then'](function(_0x5d781c){_0x1e7e25['count']=_0x5d781c;if(_0x30c360[_0x9c5c('0x2f')][_0x9c5c('0x41')]){_0x2cae75[_0x9c5c('0x42')]=[{'all':!![]}];}return db[_0x9c5c('0x2a')][_0x9c5c('0x43')](_0x2cae75);})[_0x9c5c('0x24')](function(_0x264300){_0x1e7e25['rows']=_0x264300;return _0x1e7e25;})[_0x9c5c('0x24')](respondWithFilteredResult(_0x17d44f,_0x2cae75))[_0x9c5c('0x44')](handleError(_0x17d44f,null));};exports[_0x9c5c('0x45')]=function(_0x1283b5,_0x187504){var _0xe90970={'raw':!![],'where':{'id':_0x1283b5[_0x9c5c('0x46')]['id']}},_0xfd5ffc={};_0xfd5ffc[_0x9c5c('0x2d')]=_[_0x9c5c('0x30')](db[_0x9c5c('0x2a')][_0x9c5c('0x2b')]);_0xfd5ffc['query']=_[_0x9c5c('0x30')](_0x1283b5['query']);_0xfd5ffc[_0x9c5c('0x31')]=_[_0x9c5c('0x32')](_0xfd5ffc[_0x9c5c('0x2d')],_0xfd5ffc[_0x9c5c('0x2f')]);_0xe90970['attributes']=_[_0x9c5c('0x32')](_0xfd5ffc[_0x9c5c('0x2d')],qs[_0x9c5c('0x34')](_0x1283b5['query'][_0x9c5c('0x34')]));_0xe90970[_0x9c5c('0x33')]=_0xe90970[_0x9c5c('0x33')][_0x9c5c('0x35')]?_0xe90970['attributes']:_0xfd5ffc[_0x9c5c('0x2d')];if(_0x1283b5[_0x9c5c('0x2f')]['includeAll']){_0xe90970[_0x9c5c('0x42')]=[{'all':!![]}];}_0xe90970=_[_0x9c5c('0x3e')]({},_0xe90970,_0x1283b5['options']);return db[_0x9c5c('0x2a')]['find'](_0xe90970)[_0x9c5c('0x24')](handleEntityNotFound(_0x187504,null))['then'](respondWithResult(_0x187504,null))['catch'](handleError(_0x187504,null));};exports[_0x9c5c('0x47')]=function(_0x2ddd51,_0x113e59){return db[_0x9c5c('0x2a')]['create'](_0x2ddd51['body'],{})[_0x9c5c('0x24')](respondWithResult(_0x113e59,0xc9))[_0x9c5c('0x44')](handleError(_0x113e59,null));};exports[_0x9c5c('0x23')]=function(_0x5805a2,_0x2fd35f){if(_0x5805a2[_0x9c5c('0x48')]['id']){delete _0x5805a2[_0x9c5c('0x48')]['id'];}return db[_0x9c5c('0x2a')][_0x9c5c('0x49')]({'where':{'id':_0x5805a2[_0x9c5c('0x46')]['id']}})[_0x9c5c('0x24')](handleEntityNotFound(_0x2fd35f,null))[_0x9c5c('0x24')](saveUpdates(_0x5805a2[_0x9c5c('0x48')],null))[_0x9c5c('0x24')](respondWithResult(_0x2fd35f,null))[_0x9c5c('0x44')](handleError(_0x2fd35f,null));};exports['destroy']=function(_0x4c12ea,_0x3a0b18){return db[_0x9c5c('0x2a')][_0x9c5c('0x49')]({'where':{'id':_0x4c12ea[_0x9c5c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a0b18,null))[_0x9c5c('0x24')](removeEntity(_0x3a0b18,null))[_0x9c5c('0x44')](handleError(_0x3a0b18,null));};exports[_0x9c5c('0x4a')]=function(_0x522fdc,_0x22c25a){return db[_0x9c5c('0x2a')][_0x9c5c('0x4a')]()[_0x9c5c('0x24')](respondWithResult(_0x22c25a,null))[_0x9c5c('0x44')](handleError(_0x22c25a,null));};
\ No newline at end of file
+var _0x4ea8=['count','offset','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','show','keys','merge','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit'];(function(_0x2648d5,_0x59d362){var _0x47abda=function(_0x4ed58a){while(--_0x4ed58a){_0x2648d5['push'](_0x2648d5['shift']());}};_0x47abda(++_0x59d362);}(_0x4ea8,0xc0));var _0x84ea=function(_0x536442,_0x18e920){_0x536442=_0x536442-0x0;var _0x82516e=_0x4ea8[_0x536442];return _0x82516e;};'use strict';var emlformat=require(_0x84ea('0x0'));var rimraf=require(_0x84ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x84ea('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x84ea('0x3'));var util=require(_0x84ea('0x4'));var path=require('path');var sox=require(_0x84ea('0x5'));var csv=require(_0x84ea('0x6'));var ejs=require(_0x84ea('0x7'));var fs=require('fs');var fs_extra=require(_0x84ea('0x8'));var _=require('lodash');var squel=require(_0x84ea('0x9'));var crypto=require(_0x84ea('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x84ea('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x84ea('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84ea('0xd'));var logger=require(_0x84ea('0xe'))(_0x84ea('0xf'));var utils=require(_0x84ea('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x84ea('0x11'));var db=require(_0x84ea('0x12'))['db'];function respondWithStatusCode(_0x2fdf8b,_0x3b0887){_0x3b0887=_0x3b0887||0xcc;return function(_0x5b6140){if(_0x5b6140){return _0x2fdf8b['sendStatus'](_0x3b0887);}return _0x2fdf8b[_0x84ea('0x13')](_0x3b0887)[_0x84ea('0x14')]();};}function respondWithResult(_0x2950a8,_0x81ff83){_0x81ff83=_0x81ff83||0xc8;return function(_0x25d628){if(_0x25d628){return _0x2950a8[_0x84ea('0x13')](_0x81ff83)[_0x84ea('0x15')](_0x25d628);}};}function respondWithFilteredResult(_0x5b957e,_0x429762){return function(_0xcfc6e9){if(_0xcfc6e9){var _0x16bef9=typeof _0x429762['offset']===_0x84ea('0x16')&&typeof _0x429762[_0x84ea('0x17')]===_0x84ea('0x16');var _0x21fe37=_0xcfc6e9['count'];var _0x57ec5b=_0x16bef9?0x0:_0x429762['offset'];var _0x2cbef5=_0x16bef9?_0xcfc6e9[_0x84ea('0x18')]:_0x429762[_0x84ea('0x19')]+_0x429762[_0x84ea('0x17')];var _0x133d78;if(_0x2cbef5>=_0x21fe37){_0x2cbef5=_0x21fe37;_0x133d78=0xc8;}else{_0x133d78=0xce;}_0x5b957e['status'](_0x133d78);return _0x5b957e['set'](_0x84ea('0x1a'),_0x57ec5b+'-'+_0x2cbef5+'/'+_0x21fe37)[_0x84ea('0x15')](_0xcfc6e9);}return null;};}function patchUpdates(_0x5824d7){return function(_0x25794f){try{jsonpatch[_0x84ea('0x1b')](_0x25794f,_0x5824d7,!![]);}catch(_0x1fc551){return BPromise[_0x84ea('0x1c')](_0x1fc551);}return _0x25794f['save']();};}function saveUpdates(_0x2d9a40,_0x5466e7){return function(_0x5b0a99){if(_0x5b0a99){return _0x5b0a99[_0x84ea('0x1d')](_0x2d9a40)[_0x84ea('0x1e')](function(_0x52f558){return _0x52f558;});}return null;};}function removeEntity(_0x18d567,_0x8adc39){return function(_0x456f0f){if(_0x456f0f){return _0x456f0f[_0x84ea('0x1f')]()[_0x84ea('0x1e')](function(){_0x18d567[_0x84ea('0x13')](0xcc)[_0x84ea('0x14')]();});}};}function handleEntityNotFound(_0x22dd92,_0x14a25c){return function(_0x1c3064){if(!_0x1c3064){_0x22dd92[_0x84ea('0x20')](0x194);}return _0x1c3064;};}function handleError(_0x222f0c,_0x1cb911){_0x1cb911=_0x1cb911||0x1f4;return function(_0x253c51){logger[_0x84ea('0x21')](_0x253c51[_0x84ea('0x22')]);if(_0x253c51['name']){delete _0x253c51['name'];}_0x222f0c[_0x84ea('0x13')](_0x1cb911)[_0x84ea('0x23')](_0x253c51);};}exports[_0x84ea('0x24')]=function(_0x26ed33,_0x173fd9){var _0x342fed={},_0x5aba3f={},_0x30e78c={'count':0x0,'rows':[]};var _0x28774d=_[_0x84ea('0x25')](db['ChatTransferReport'][_0x84ea('0x26')],function(_0x11ebd0){return{'name':_0x11ebd0[_0x84ea('0x27')],'type':_0x11ebd0['type'][_0x84ea('0x28')]};});_0x5aba3f[_0x84ea('0x29')]=_[_0x84ea('0x25')](_0x28774d,_0x84ea('0x2a'));_0x5aba3f[_0x84ea('0x2b')]=_['keys'](_0x26ed33[_0x84ea('0x2b')]);_0x5aba3f[_0x84ea('0x2c')]=_[_0x84ea('0x2d')](_0x5aba3f[_0x84ea('0x29')],_0x5aba3f['query']);_0x342fed[_0x84ea('0x2e')]=_[_0x84ea('0x2d')](_0x5aba3f[_0x84ea('0x29')],qs[_0x84ea('0x2f')](_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x2f')]));_0x342fed[_0x84ea('0x2e')]=_0x342fed[_0x84ea('0x2e')]['length']?_0x342fed['attributes']:_0x5aba3f[_0x84ea('0x29')];if(!_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x30')](_0x84ea('0x31'))){_0x342fed[_0x84ea('0x17')]=qs[_0x84ea('0x17')](_0x26ed33[_0x84ea('0x2b')]['limit']);_0x342fed[_0x84ea('0x19')]=qs[_0x84ea('0x19')](_0x26ed33['query'][_0x84ea('0x19')]);}_0x342fed[_0x84ea('0x32')]=qs[_0x84ea('0x33')](_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x33')]);_0x342fed[_0x84ea('0x34')]=qs['filters'](_[_0x84ea('0x35')](_0x26ed33['query'],_0x5aba3f['filters']),_0x28774d);if(_0x26ed33['query'][_0x84ea('0x36')]){_0x342fed['where']=_['merge'](_0x342fed[_0x84ea('0x34')],{'$or':_[_0x84ea('0x25')](_0x28774d,function(_0xd1fdd7){if(_0xd1fdd7[_0x84ea('0x37')]!==_0x84ea('0x38')){var _0x5cbebc={};_0x5cbebc[_0xd1fdd7[_0x84ea('0x2a')]]={'$like':'%'+_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x36')]+'%'};return _0x5cbebc;}})});}_0x342fed=_['merge']({},_0x342fed,_0x26ed33[_0x84ea('0x39')]);var _0x5c3f07={'where':_0x342fed['where']};return db[_0x84ea('0x3a')][_0x84ea('0x18')](_0x5c3f07)['then'](function(_0x56f213){_0x30e78c[_0x84ea('0x18')]=_0x56f213;if(_0x26ed33[_0x84ea('0x2b')][_0x84ea('0x3b')]){_0x342fed[_0x84ea('0x3c')]=[{'all':!![]}];}return db[_0x84ea('0x3a')][_0x84ea('0x3d')](_0x342fed);})[_0x84ea('0x1e')](function(_0x49a19c){_0x30e78c[_0x84ea('0x3e')]=_0x49a19c;return _0x30e78c;})[_0x84ea('0x1e')](respondWithFilteredResult(_0x173fd9,_0x342fed))[_0x84ea('0x3f')](handleError(_0x173fd9,null));};exports[_0x84ea('0x40')]=function(_0x5c9ff9,_0x1b5e4e){var _0x4f5542={'raw':!![],'where':{'id':_0x5c9ff9['params']['id']}},_0x4863a3={};_0x4863a3[_0x84ea('0x29')]=_['keys'](db[_0x84ea('0x3a')][_0x84ea('0x26')]);_0x4863a3[_0x84ea('0x2b')]=_[_0x84ea('0x41')](_0x5c9ff9[_0x84ea('0x2b')]);_0x4863a3[_0x84ea('0x2c')]=_[_0x84ea('0x2d')](_0x4863a3['model'],_0x4863a3['query']);_0x4f5542[_0x84ea('0x2e')]=_[_0x84ea('0x2d')](_0x4863a3[_0x84ea('0x29')],qs['fields'](_0x5c9ff9['query']['fields']));_0x4f5542['attributes']=_0x4f5542[_0x84ea('0x2e')]['length']?_0x4f5542[_0x84ea('0x2e')]:_0x4863a3[_0x84ea('0x29')];if(_0x5c9ff9['query'][_0x84ea('0x3b')]){_0x4f5542[_0x84ea('0x3c')]=[{'all':!![]}];}_0x4f5542=_[_0x84ea('0x42')]({},_0x4f5542,_0x5c9ff9[_0x84ea('0x39')]);return db[_0x84ea('0x3a')][_0x84ea('0x43')](_0x4f5542)[_0x84ea('0x1e')](handleEntityNotFound(_0x1b5e4e,null))['then'](respondWithResult(_0x1b5e4e,null))[_0x84ea('0x3f')](handleError(_0x1b5e4e,null));};exports[_0x84ea('0x44')]=function(_0x455a97,_0x291320){return db[_0x84ea('0x3a')][_0x84ea('0x44')](_0x455a97[_0x84ea('0x45')],{})[_0x84ea('0x1e')](respondWithResult(_0x291320,0xc9))[_0x84ea('0x3f')](handleError(_0x291320,null));};exports[_0x84ea('0x1d')]=function(_0x49df49,_0xe237c7){if(_0x49df49['body']['id']){delete _0x49df49[_0x84ea('0x45')]['id'];}return db[_0x84ea('0x3a')][_0x84ea('0x43')]({'where':{'id':_0x49df49['params']['id']}})[_0x84ea('0x1e')](handleEntityNotFound(_0xe237c7,null))[_0x84ea('0x1e')](saveUpdates(_0x49df49[_0x84ea('0x45')],null))[_0x84ea('0x1e')](respondWithResult(_0xe237c7,null))[_0x84ea('0x3f')](handleError(_0xe237c7,null));};exports[_0x84ea('0x1f')]=function(_0x272d84,_0x2f1ac4){return db[_0x84ea('0x3a')]['find']({'where':{'id':_0x272d84[_0x84ea('0x46')]['id']}})[_0x84ea('0x1e')](handleEntityNotFound(_0x2f1ac4,null))[_0x84ea('0x1e')](removeEntity(_0x2f1ac4,null))['catch'](handleError(_0x2f1ac4,null));};exports[_0x84ea('0x47')]=function(_0x3e25ed,_0x1a68b0){return db['ChatTransferReport']['describe']()['then'](respondWithResult(_0x1a68b0,null))[_0x84ea('0x3f')](handleError(_0x1a68b0,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 3e09f38..f86abab 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 _0x3083=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','exports','define'];(function(_0x5419da,_0x429446){var _0x3a4c50=function(_0x274f75){while(--_0x274f75){_0x5419da['push'](_0x5419da['shift']());}};_0x3a4c50(++_0x429446);}(_0x3083,0xff));var _0x3308=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x3083[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x3308('0x0'));var util=require(_0x3308('0x1'));var logger=require(_0x3308('0x2'))(_0x3308('0x3'));var moment=require(_0x3308('0x4'));var BPromise=require(_0x3308('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3308('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x3308('0x7')]=function(_0x5b6d2b,_0x183214){return _0x5b6d2b[_0x3308('0x8')]('ChatTransferReport',attributes,{'tableName':_0x3308('0x9'),'paranoid':![],'indexes':[{'name':_0x3308('0xa'),'fields':[_0x3308('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1be=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0xa1be,0x128));var _0xea1b=function(_0x3c6aa0,_0x280f28){_0x3c6aa0=_0x3c6aa0-0x0;var _0x4b58c6=_0xa1be[_0x3c6aa0];return _0x4b58c6;};'use strict';var _=require(_0xea1b('0x0'));var util=require('util');var logger=require(_0xea1b('0x1'))('api');var moment=require(_0xea1b('0x2'));var BPromise=require(_0xea1b('0x3'));var rp=require(_0xea1b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea1b('0x5'));var attributes=require(_0xea1b('0x6'));module[_0xea1b('0x7')]=function(_0x5f0423,_0x364c82){return _0x5f0423[_0xea1b('0x8')](_0xea1b('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xea1b('0xa'),'fields':[_0xea1b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 268d744..2dc1624 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 _0x1498=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird'];(function(_0x284ba4,_0x5f5db1){var _0x1ba706=function(_0x514d03){while(--_0x514d03){_0x284ba4['push'](_0x284ba4['shift']());}};_0x1ba706(++_0x5f5db1);}(_0x1498,0xa5));var _0x8149=function(_0x12ef51,_0x2d5ea7){_0x12ef51=_0x12ef51-0x0;var _0x39af05=_0x1498[_0x12ef51];return _0x39af05;};'use strict';var _=require(_0x8149('0x0'));var util=require(_0x8149('0x1'));var moment=require('moment');var BPromise=require(_0x8149('0x2'));var rs=require(_0x8149('0x3'));var fs=require('fs');var Redis=require(_0x8149('0x4'));var db=require(_0x8149('0x5'))['db'];var utils=require(_0x8149('0x6'));var logger=require(_0x8149('0x7'))('rpc');var config=require(_0x8149('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8149('0x9')][_0x8149('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x468d19,_0x153b97,_0x325c6a){return new BPromise(function(_0x45df89,_0x3f3392){return client[_0x8149('0xb')](_0x468d19,_0x325c6a)[_0x8149('0xc')](function(_0x39414f){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x153b97,_0x8149('0xd'));logger[_0x8149('0xe')](_0x8149('0xf'),_0x153b97,'request\x20sent',JSON[_0x8149('0x10')](_0x39414f));if(_0x39414f[_0x8149('0x11')]){if(_0x39414f[_0x8149('0x11')][_0x8149('0x12')]===0x1f4){logger[_0x8149('0x11')](_0x8149('0x13'),_0x153b97,_0x39414f[_0x8149('0x11')]['message']);return _0x3f3392(_0x39414f[_0x8149('0x11')][_0x8149('0x14')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x153b97,_0x39414f[_0x8149('0x11')][_0x8149('0x14')]);return _0x45df89(_0x39414f['error'][_0x8149('0x14')]);}else{logger[_0x8149('0x15')](_0x8149('0x13'),_0x153b97,'request\x20sent');_0x45df89(_0x39414f[_0x8149('0x16')]['message']);}})[_0x8149('0x17')](function(_0x5f56f8){logger[_0x8149('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x153b97,_0x5f56f8);_0x3f3392(_0x5f56f8);});});}
\ No newline at end of file
+var _0xa4e3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa4e3,0x103));var _0x3a4e=function(_0x2ea92f,_0x1b4f22){_0x2ea92f=_0x2ea92f-0x0;var _0x5529ee=_0xa4e3[_0x2ea92f];return _0x5529ee;};'use strict';var _=require(_0x3a4e('0x0'));var util=require(_0x3a4e('0x1'));var moment=require('moment');var BPromise=require(_0x3a4e('0x2'));var rs=require(_0x3a4e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a4e('0x4'))['db'];var utils=require(_0x3a4e('0x5'));var logger=require(_0x3a4e('0x6'))('rpc');var config=require(_0x3a4e('0x7'));var jayson=require(_0x3a4e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ea0e0,_0x39af53,_0x27e9e5){return new BPromise(function(_0x127cf0,_0x194d21){return client[_0x3a4e('0x9')](_0x4ea0e0,_0x27e9e5)[_0x3a4e('0xa')](function(_0x32200c){logger[_0x3a4e('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x39af53,_0x3a4e('0xc'));logger[_0x3a4e('0xd')](_0x3a4e('0xe'),_0x39af53,_0x3a4e('0xc'),JSON[_0x3a4e('0xf')](_0x32200c));if(_0x32200c[_0x3a4e('0x10')]){if(_0x32200c['error'][_0x3a4e('0x11')]===0x1f4){logger[_0x3a4e('0x10')](_0x3a4e('0x12'),_0x39af53,_0x32200c[_0x3a4e('0x10')][_0x3a4e('0x13')]);return _0x194d21(_0x32200c['error']['message']);}logger[_0x3a4e('0x10')](_0x3a4e('0x12'),_0x39af53,_0x32200c[_0x3a4e('0x10')][_0x3a4e('0x13')]);return _0x127cf0(_0x32200c[_0x3a4e('0x10')][_0x3a4e('0x13')]);}else{logger['info'](_0x3a4e('0x12'),_0x39af53,'request\x20sent');_0x127cf0(_0x32200c[_0x3a4e('0x14')][_0x3a4e('0x13')]);}})[_0x3a4e('0x15')](function(_0x5c8ceb){logger[_0x3a4e('0x10')](_0x3a4e('0x12'),_0x39af53,_0x5c8ceb);_0x194d21(_0x5c8ceb);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 24486da..be68b54 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 _0x6174=['Router','fs-extra','isAuthenticated','index','get','show','create','put','/:id','update','delete','util','path','express'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x6174,0x1af));var _0x4617=function(_0x877dbb,_0x4d00d5){_0x877dbb=_0x877dbb-0x0;var _0xc224a9=_0x6174[_0x877dbb];return _0xc224a9;};'use strict';var multer=require('multer');var util=require(_0x4617('0x0'));var path=require(_0x4617('0x1'));var timeout=require('connect-timeout');var express=require(_0x4617('0x2'));var router=express[_0x4617('0x3')]();var fs_extra=require(_0x4617('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x4617('0x5')](),controller[_0x4617('0x6')]);router['get']('/describe',auth[_0x4617('0x5')](),controller['describe']);router[_0x4617('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4617('0x8')]);router['post']('/',auth[_0x4617('0x5')](),controller[_0x4617('0x9')]);router[_0x4617('0xa')](_0x4617('0xb'),auth[_0x4617('0x5')](),controller[_0x4617('0xc')]);router[_0x4617('0xd')]('/:id',auth[_0x4617('0x5')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7bc8=['destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete'];(function(_0x1dce89,_0x5cae59){var _0x5415b4=function(_0x3441b1){while(--_0x3441b1){_0x1dce89['push'](_0x1dce89['shift']());}};_0x5415b4(++_0x5cae59);}(_0x7bc8,0x92));var _0x87bc=function(_0x3bc0da,_0x81d03d){_0x3bc0da=_0x3bc0da-0x0;var _0x5a2547=_0x7bc8[_0x3bc0da];return _0x5a2547;};'use strict';var multer=require(_0x87bc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x87bc('0x1'));var express=require('express');var router=express[_0x87bc('0x2')]();var fs_extra=require(_0x87bc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x87bc('0x4'));var config=require(_0x87bc('0x5'));var controller=require(_0x87bc('0x6'));router[_0x87bc('0x7')]('/',auth[_0x87bc('0x8')](),controller[_0x87bc('0x9')]);router[_0x87bc('0x7')](_0x87bc('0xa'),auth[_0x87bc('0x8')](),controller[_0x87bc('0xb')]);router[_0x87bc('0x7')](_0x87bc('0xc'),auth[_0x87bc('0x8')](),controller['show']);router['post']('/',auth[_0x87bc('0x8')](),controller['create']);router[_0x87bc('0xd')](_0x87bc('0xc'),auth[_0x87bc('0x8')](),controller[_0x87bc('0xe')]);router[_0x87bc('0xf')](_0x87bc('0xc'),auth['isAuthenticated'](),controller[_0x87bc('0x10')]);module[_0x87bc('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 5cb19ed..8a7e7e4 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 _0xa74f=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','address','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Feedback','star','TEXT','stringify','input','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0xa74f,0x9a));var _0xfa74=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0xa74f[_0x4d7116];return _0x4593dc;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xfa74('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfa74('0x1')},'description':{'type':Sequelize[_0xfa74('0x2')]},'mapKey':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x4')},'customerAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xfa74('0x9')]('rounded',_0xfa74('0xa')),'defaultValue':_0xfa74('0xb')},'header_online':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0xd')},'offline_chat_button':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'header_offline':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x12')},'noteTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0xe')},'skipMessageButton':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x14')},'ratingType':{'type':Sequelize[_0xfa74('0x9')]('star','thumb'),'defaultValue':_0xfa74('0x15')},'ratingStarsNumber':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':_0xfa74('0x18'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xfa74('0x19'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfa74('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xfa74('0x1a')](_0xfa74('0x1b'))?JSON['parse'](this['getDataValue'](_0xfa74('0x1b'))):{};},'set':function(_0xeb6c11){return this['setDataValue'](_0xfa74('0x1b'),JSON['stringify'](_0xeb6c11));}},'offlineForm':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return JSON[_0xfa74('0x17')]({'items':[{'type':'input','props':{'title':_0xfa74('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xfa74('0x3'),'type':_0xfa74('0x3')},'variable':null},{'type':_0xfa74('0x1c'),'config':{'placeholder':'Comments'},'props':{'title':_0xfa74('0x1d'),'helpText':_0xfa74('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xfa74('0x1a')]('offlineForm')?JSON['parse'](this[_0xfa74('0x1a')](_0xfa74('0x1f'))):{};},'set':function(_0x5df5cd){return this['setDataValue'](_0xfa74('0x1f'),JSON['stringify'](_0x5df5cd));}},'token':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfa74('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfa74('0x2')]},'waitingTitle':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x20')},'waitingMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x22')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfa74('0x23')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x24')},'skipUnmanaged':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x25')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfa74('0x16')]},'showAgentAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xfa74('0x16')],'defaultValue':function(){return _0xfa74('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x27')},'verticalAlignment':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x28')},'messagesAlignment':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x29')},'defaultTitle':{'type':Sequelize[_0xfa74('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfa74('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa74('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':_0xfa74('0x2b')},'systemAvatar':{'type':Sequelize[_0xfa74('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xfa74('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'comment':_0xfa74('0x2d'),'set':function(_0x35f252){if(!_0x35f252)this['setDataValue'](_0xfa74('0x2e'),null);this[_0xfa74('0x2f')](_0xfa74('0x30'),_0x35f252);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xfa74('0x2')],'allowNull':![],'defaultValue':_0xfa74('0x31')},'vidaooNote':{'type':Sequelize[_0xfa74('0x2')],'defaultValue':function(){return _0xfa74('0x32');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfa74('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xfa74('0x16')]}};
\ No newline at end of file
+var _0x702d=['ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','name','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#ffffff','INTEGER','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x702d,0x147));var _0xd702=function(_0x4be77c,_0x465d29){_0x4be77c=_0x4be77c-0x0;var _0x1ddbe0=_0x702d[_0x4be77c];return _0x1ddbe0;};'use strict';var Sequelize=require(_0xd702('0x0'));var rs=require(_0xd702('0x1'));module[_0xd702('0x2')]={'name':{'type':Sequelize[_0xd702('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xd702('0x3')]},'mapKey':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x4')},'mapKeyOffline':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0xd702('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x5')},'customerAlias':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':_0xd702('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':_0xd702('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd702('0x3')]},'animation':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd702('0x9')](_0xd702('0xa'),_0xd702('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xc')},'start_chat_button':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xe')},'header_offline':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xf')},'download_transcript':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd702('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x13')},'placeholderMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0xe')},'skipMessageButton':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x15')},'conditionAgreement':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0xd702('0x16'),_0xd702('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xd702('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0xd702('0x19'),'helpText':''}},{'type':_0xd702('0x1a'),'props':{'title':_0xd702('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xd702('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd702('0x1b')](_0xd702('0x1c'))?JSON[_0xd702('0x1d')](this[_0xd702('0x1b')](_0xd702('0x1c'))):{};},'set':function(_0x94c58d){return this[_0xd702('0x1e')](_0xd702('0x1c'),JSON['stringify'](_0x94c58d));}},'offlineForm':{'type':Sequelize[_0xd702('0x10')],'defaultValue':function(){return JSON[_0xd702('0x18')]({'items':[{'type':_0xd702('0x1a'),'props':{'title':_0xd702('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xd702('0x4'),'type':_0xd702('0x4')},'variable':null},{'type':_0xd702('0x1f'),'config':{'placeholder':_0xd702('0x20')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xd702('0x1b')](_0xd702('0x21'))?JSON['parse'](this[_0xd702('0x1b')](_0xd702('0x21'))):{};},'set':function(_0xffdb54){return this[_0xd702('0x1e')]('offlineForm',JSON[_0xd702('0x18')](_0xffdb54));}},'token':{'type':Sequelize[_0xd702('0x3')],'defaultValue':function(){return rs[_0xd702('0x22')]();}},'autoclose':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd702('0x3')]},'forwardOffline':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd702('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x24')},'offlineMessageBody':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x15')},'sendUnmanaged':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd702('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd702('0x3')]},'notificationTemplate':{'type':Sequelize[_0xd702('0x10')],'defaultValue':function(){return _0xd702('0x25');}},'notificationSound':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd702('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x27')},'verticalAlignment':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd702('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xd702('0x28')},'defaultTitle':{'type':Sequelize[_0xd702('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xd702('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd702('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd702('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd702('0x3')],'defaultValue':_0xd702('0x29')},'systemAvatar':{'type':Sequelize[_0xd702('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xd702('0x2a')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xd702('0x2b'),'set':function(_0x239bec){if(!_0x239bec)this[_0xd702('0x1e')](_0xd702('0x2c'),null);this[_0xd702('0x1e')](_0xd702('0x2d'),_0x239bec);}},'vidaooEscalation':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd702('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd702('0x2e')},'vidaooNote':{'type':Sequelize[_0xd702('0x3')],'defaultValue':function(){return _0xd702('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xd702('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd702('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 89efa47..e0c0224 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 _0x8b0a=['remote','x-real-ip','connection','remoteAddress','referer','replace','alignment','verticalAlignment','textColor','textButtonColor','color_button','backgroundColor','IntervalId','Transaction','READ_COMMITTED','finally','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','url','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','Pause','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','order','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','showCustomerAvatar','download','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','headers','user-agent','getResult','chat','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','ChatApplication','Applications','account','applications','list','orderBy','priority','Contacts','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','x-real-port','browser','%s\x20%s','version','format','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','originalname','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Contact','Owner','fullname','color','tag','Command','interval','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','all','some','readFileSync','server/files/chat/iframe.ejs','origin'];(function(_0x5d11ca,_0x4dbe9e){var _0x347e91=function(_0x12ae92){while(--_0x12ae92){_0x5d11ca['push'](_0x5d11ca['shift']());}};_0x347e91(++_0x4dbe9e);}(_0x8b0a,0x14b));var _0xa8b0=function(_0x3311ae,_0x362cee){_0x3311ae=_0x3311ae-0x0;var _0x107949=_0x8b0a[_0x3311ae];return _0x107949;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xa8b0('0x0'));var util=require(_0xa8b0('0x1'));var path=require('path');var ejs=require(_0xa8b0('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa8b0('0x3'));var querystring=require(_0xa8b0('0x4'));var Redis=require('ioredis');var qs=require(_0xa8b0('0x5'));var logger=require(_0xa8b0('0x6'))(_0xa8b0('0x7'));var config=require(_0xa8b0('0x8'));var url=require(_0xa8b0('0x9'));var db=require(_0xa8b0('0xa'))['db'];config['redis']=_['defaults'](config[_0xa8b0('0xb')],{'host':_0xa8b0('0xc'),'port':0x18eb});var socket=require(_0xa8b0('0xd'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xa8b0('0xe')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xa8b0('0xf'));var client=jayson[_0xa8b0('0x10')][_0xa8b0('0x11')]({'port':0x232c});var client9002=jayson[_0xa8b0('0x10')][_0xa8b0('0x11')]({'port':0x232a});var client9003=jayson[_0xa8b0('0x10')][_0xa8b0('0x11')]({'port':0x232b});var client9001=jayson['client'][_0xa8b0('0x11')]({'port':0x2329});function respondWithRpcPromise(_0xe137a3,_0x51ca45,_0x49c230,_0x1123b3){return new BPromise(function(_0x196e64,_0x10ad2b){var _0x1c157e=_0x1123b3||client;return _0x1c157e[_0xa8b0('0x12')](_0xe137a3,_0x49c230)['then'](function(_0x1ebb9d){logger[_0xa8b0('0x13')](_0xa8b0('0x14'),_0x51ca45,_0xa8b0('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x51ca45,_0xa8b0('0x15'),JSON[_0xa8b0('0x16')](_0x1ebb9d));if(_0x1ebb9d[_0xa8b0('0x17')]){if(_0x1ebb9d[_0xa8b0('0x17')]['code']===0x1f4){logger[_0xa8b0('0x17')](_0xa8b0('0x14'),_0x51ca45,_0x1ebb9d[_0xa8b0('0x17')][_0xa8b0('0x18')]);return _0x10ad2b(_0x1ebb9d['error']['message']);}logger[_0xa8b0('0x17')](_0xa8b0('0x14'),_0x51ca45,_0x1ebb9d[_0xa8b0('0x17')][_0xa8b0('0x18')]);return _0x196e64(_0x1ebb9d[_0xa8b0('0x17')][_0xa8b0('0x18')]);}else{logger[_0xa8b0('0x13')](_0xa8b0('0x14'),_0x51ca45,_0xa8b0('0x15'));_0x196e64(_0x1ebb9d[_0xa8b0('0x19')][_0xa8b0('0x18')]);}})['catch'](function(_0x4f5882){logger[_0xa8b0('0x17')](_0xa8b0('0x14'),_0x51ca45,_0x4f5882);_0x10ad2b(_0x4f5882);});});}function respondWithStatusCode(_0x3cd207,_0x174ff3){_0x174ff3=_0x174ff3||0xcc;return function(_0x417e32){if(_0x417e32){return _0x3cd207[_0xa8b0('0x1a')](_0x174ff3);}return _0x3cd207[_0xa8b0('0x1b')](_0x174ff3)[_0xa8b0('0x1c')]();};}function respondWithResult(_0x19cf8d,_0x2f3e66){_0x2f3e66=_0x2f3e66||0xc8;return function(_0x50234e){if(_0x50234e){return _0x19cf8d[_0xa8b0('0x1b')](_0x2f3e66)[_0xa8b0('0x1d')](_0x50234e);}};}function respondWithFilteredResult(_0x162065,_0x3e7508){return function(_0x72c8b7){if(_0x72c8b7){var _0x5b8659=typeof _0x3e7508[_0xa8b0('0x1e')]===_0xa8b0('0x1f')&&typeof _0x3e7508['limit']==='undefined';var _0xa82156=_0x72c8b7[_0xa8b0('0x20')];var _0x67a2c1=_0x5b8659?0x0:_0x3e7508[_0xa8b0('0x1e')];var _0x202b7f=_0x5b8659?_0x72c8b7[_0xa8b0('0x20')]:_0x3e7508['offset']+_0x3e7508['limit'];var _0x4d9baf;if(_0x202b7f>=_0xa82156){_0x202b7f=_0xa82156;_0x4d9baf=0xc8;}else{_0x4d9baf=0xce;}_0x162065[_0xa8b0('0x1b')](_0x4d9baf);return _0x162065['set']('Content-Range',_0x67a2c1+'-'+_0x202b7f+'/'+_0xa82156)[_0xa8b0('0x1d')](_0x72c8b7);}return null;};}function saveUpdates(_0x322c49){return function(_0x579d13){if(_0x579d13){return _0x579d13[_0xa8b0('0x21')](_0x322c49)[_0xa8b0('0x22')](function(_0x1d5580){return _0x1d5580;});}return null;};}function removeEntity(_0x534792){return function(_0x582697){if(_0x582697){return _0x582697[_0xa8b0('0x23')]()[_0xa8b0('0x22')](function(){var _0x271bab=_0x582697[_0xa8b0('0x24')]({'plain':!![]});var _0x3a856c=_0xa8b0('0x25');return db[_0xa8b0('0x26')][_0xa8b0('0x23')]({'where':{'type':_0x3a856c,'resourceId':_0x271bab['id']}})['then'](function(){return _0x582697;});})['then'](function(){_0x534792[_0xa8b0('0x1b')](0xcc)[_0xa8b0('0x1c')]();});}};}function handleEntityNotFound(_0x5697cc){return function(_0x387893){if(!_0x387893){_0x5697cc['sendStatus'](0x194);}return _0x387893;};}function handleError(_0x235f29,_0x134641){_0x134641=_0x134641||0x1f4;return function(_0x379529){logger[_0xa8b0('0x17')](_0x379529[_0xa8b0('0x27')]);if(_0x379529['name']){delete _0x379529[_0xa8b0('0x28')];}_0x235f29[_0xa8b0('0x1b')](_0x134641)[_0xa8b0('0x29')](_0x379529);};}exports[_0xa8b0('0x2a')]=function(_0x48410e,_0x472fa6){var _0xae1ce0={'include':[{'model':db['Pause'],'as':_0xa8b0('0x2b')}]},_0x4f17b8={},_0x5b61c2={'count':0x0,'rows':[]};var _0x2dd750=_['map'](db[_0xa8b0('0x2c')][_0xa8b0('0x2d')],function(_0x5bf373){return{'name':_0x5bf373[_0xa8b0('0x2e')],'type':_0x5bf373[_0xa8b0('0x2f')][_0xa8b0('0x30')]};});_0x4f17b8['model']=_[_0xa8b0('0x31')](_0x2dd750,_0xa8b0('0x28'));_0x4f17b8[_0xa8b0('0x32')]=_[_0xa8b0('0x33')](_0x48410e[_0xa8b0('0x32')]);_0x4f17b8[_0xa8b0('0x34')]=_[_0xa8b0('0x35')](_0x4f17b8[_0xa8b0('0x36')],_0x4f17b8[_0xa8b0('0x32')]);_0xae1ce0[_0xa8b0('0x37')]=_[_0xa8b0('0x35')](_0x4f17b8['model'],qs[_0xa8b0('0x38')](_0x48410e[_0xa8b0('0x32')][_0xa8b0('0x38')]));_0xae1ce0[_0xa8b0('0x37')]=_0xae1ce0[_0xa8b0('0x37')][_0xa8b0('0x39')]?_0xae1ce0[_0xa8b0('0x37')]:_0x4f17b8['model'];if(!_0x48410e[_0xa8b0('0x32')]['hasOwnProperty'](_0xa8b0('0x3a'))){_0xae1ce0[_0xa8b0('0x3b')]=qs[_0xa8b0('0x3b')](_0x48410e[_0xa8b0('0x32')]['limit']);_0xae1ce0[_0xa8b0('0x1e')]=qs[_0xa8b0('0x1e')](_0x48410e['query'][_0xa8b0('0x1e')]);}_0xae1ce0['order']=qs[_0xa8b0('0x3c')](_0x48410e[_0xa8b0('0x32')]['sort']);_0xae1ce0['where']=qs[_0xa8b0('0x34')](_[_0xa8b0('0x3d')](_0x48410e[_0xa8b0('0x32')],_0x4f17b8[_0xa8b0('0x34')]),_0x2dd750);if(_0x48410e[_0xa8b0('0x32')][_0xa8b0('0x3e')]){_0xae1ce0['where']=_['merge'](_0xae1ce0[_0xa8b0('0x3f')],{'$or':_[_0xa8b0('0x31')](_0x2dd750,function(_0x212f6b){if(_0x212f6b['type']!==_0xa8b0('0x40')){var _0x7e34dd={};_0x7e34dd[_0x212f6b[_0xa8b0('0x28')]]={'$like':'%'+_0x48410e[_0xa8b0('0x32')][_0xa8b0('0x3e')]+'%'};return _0x7e34dd;}})});}_0xae1ce0=_[_0xa8b0('0x41')]({},_0xae1ce0,_0x48410e[_0xa8b0('0x42')]);var _0x38dde2={'where':_0xae1ce0[_0xa8b0('0x3f')]};return db[_0xa8b0('0x2c')][_0xa8b0('0x20')](_0x38dde2)[_0xa8b0('0x22')](function(_0x38c44d){_0x5b61c2[_0xa8b0('0x20')]=_0x38c44d;if(_0x48410e[_0xa8b0('0x32')][_0xa8b0('0x43')]){_0xae1ce0[_0xa8b0('0x44')]=[{'all':!![]}];}return db[_0xa8b0('0x2c')][_0xa8b0('0x45')](_0xae1ce0);})['then'](function(_0x5eb34d){_0x5b61c2[_0xa8b0('0x46')]=_0x5eb34d;return _0x5b61c2;})['then'](respondWithFilteredResult(_0x472fa6,_0xae1ce0))['catch'](handleError(_0x472fa6,null));};exports['show']=function(_0xd9225c,_0x148891){var _0x39a427={'raw':![],'where':{'id':_0xd9225c['params']['id']},'include':[{'model':db[_0xa8b0('0x47')],'as':_0xa8b0('0x2b')}]},_0x197be7={};_0x197be7[_0xa8b0('0x36')]=_[_0xa8b0('0x33')](db['ChatWebsite'][_0xa8b0('0x2d')]);_0x197be7[_0xa8b0('0x32')]=_[_0xa8b0('0x33')](_0xd9225c['query']);_0x197be7[_0xa8b0('0x34')]=_[_0xa8b0('0x35')](_0x197be7['model'],_0x197be7[_0xa8b0('0x32')]);_0x39a427[_0xa8b0('0x37')]=_[_0xa8b0('0x35')](_0x197be7[_0xa8b0('0x36')],qs[_0xa8b0('0x38')](_0xd9225c[_0xa8b0('0x32')][_0xa8b0('0x38')]));_0x39a427[_0xa8b0('0x37')]=_0x39a427[_0xa8b0('0x37')][_0xa8b0('0x39')]?_0x39a427[_0xa8b0('0x37')]:_0x197be7[_0xa8b0('0x36')];if(_0xd9225c[_0xa8b0('0x32')][_0xa8b0('0x43')]){_0x39a427['include']=[{'all':!![]}];}_0x39a427=_[_0xa8b0('0x41')]({},_0x39a427,_0xd9225c[_0xa8b0('0x42')]);return db[_0xa8b0('0x2c')]['find'](_0x39a427)[_0xa8b0('0x22')](handleEntityNotFound(_0x148891,null))['then'](respondWithResult(_0x148891,null))['catch'](handleError(_0x148891,null));};exports[_0xa8b0('0x48')]=function(_0x5e2517,_0x46728a){return db[_0xa8b0('0x2c')]['create'](_0x5e2517[_0xa8b0('0x49')],{})[_0xa8b0('0x22')](function(_0x1cc99f){var _0x276162=_0x5e2517[_0xa8b0('0x4a')][_0xa8b0('0x24')]({'plain':!![]});if(!_0x276162)throw new Error(_0xa8b0('0x4b'));if(_0x276162[_0xa8b0('0x4c')]===_0xa8b0('0x4a')){var _0x2a6d26=_0x1cc99f['get']({'plain':!![]});var _0x1be10a=_0xa8b0('0x25');return db[_0xa8b0('0x4d')][_0xa8b0('0x4e')]({'where':{'name':_0x1be10a,'userProfileId':_0x276162[_0xa8b0('0x4f')]},'raw':!![]})[_0xa8b0('0x22')](function(_0x2c8c46){if(_0x2c8c46&&_0x2c8c46['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2a6d26[_0xa8b0('0x28')],'resourceId':_0x2a6d26['id'],'type':_0x2c8c46[_0xa8b0('0x28')],'sectionId':_0x2c8c46['id']},{})[_0xa8b0('0x22')](function(){return _0x1cc99f;});}else{return _0x1cc99f;}})[_0xa8b0('0x50')](function(_0x219a39){logger['error'](_0xa8b0('0x51'),_0x219a39);throw _0x219a39;});}return _0x1cc99f;})[_0xa8b0('0x22')](respondWithResult(_0x46728a,0xc9))['catch'](handleError(_0x46728a,null));};exports[_0xa8b0('0x21')]=function(_0x3291e1,_0x5642f7){if(_0x3291e1[_0xa8b0('0x49')]['id']){delete _0x3291e1[_0xa8b0('0x49')]['id'];}return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x3291e1['params']['id']},'include':[{'model':db[_0xa8b0('0x47')],'as':_0xa8b0('0x2b')}]})[_0xa8b0('0x22')](handleEntityNotFound(_0x5642f7,null))[_0xa8b0('0x22')](saveUpdates(_0x3291e1[_0xa8b0('0x49')],null))['then'](respondWithResult(_0x5642f7,null))[_0xa8b0('0x50')](handleError(_0x5642f7,null));};exports[_0xa8b0('0x23')]=function(_0x35455a,_0x354b7d){return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x35455a[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x354b7d,null))[_0xa8b0('0x22')](removeEntity(_0x354b7d,null))[_0xa8b0('0x50')](handleError(_0x354b7d,null));};exports['describe']=function(_0x3f2e2f,_0x130b64){return db['ChatWebsite'][_0xa8b0('0x53')]()['then'](respondWithResult(_0x130b64,null))[_0xa8b0('0x50')](handleError(_0x130b64,null));};exports[_0xa8b0('0x54')]=function(_0x5e9be9,_0x3ebb41){if(_0x5e9be9[_0xa8b0('0x49')]['id']){delete _0x5e9be9[_0xa8b0('0x49')]['id'];}return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x5e9be9[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x3ebb41,null))['then'](function(_0x45c22a){if(_0x45c22a){_0x5e9be9[_0xa8b0('0x49')][_0xa8b0('0x55')]=_0x45c22a['id'];return db[_0xa8b0('0x56')][_0xa8b0('0x48')](_0x5e9be9[_0xa8b0('0x49')]);}})['then'](respondWithResult(_0x3ebb41,null))[_0xa8b0('0x50')](handleError(_0x3ebb41,null));};exports['getDispositions']=function(_0x53a5de,_0x9ecdbe){var _0x19dba7={'raw':![],'where':{}};var _0xa466d3={};var _0x5e697c={'count':0x0,'rows':[]};return db[_0xa8b0('0x2c')][_0xa8b0('0x57')]({'where':{'id':_0x53a5de[_0xa8b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x9ecdbe,null))[_0xa8b0('0x22')](function(_0x108a63){if(_0x108a63){_0xa466d3['model']=_[_0xa8b0('0x33')](db[_0xa8b0('0x56')][_0xa8b0('0x2d')]);_0xa466d3[_0xa8b0('0x32')]=_[_0xa8b0('0x33')](_0x53a5de[_0xa8b0('0x32')]);_0xa466d3[_0xa8b0('0x34')]=_[_0xa8b0('0x35')](_0xa466d3[_0xa8b0('0x36')],_0xa466d3['query']);_0x19dba7[_0xa8b0('0x37')]=_['intersection'](_0xa466d3[_0xa8b0('0x36')],qs[_0xa8b0('0x38')](_0x53a5de[_0xa8b0('0x32')][_0xa8b0('0x38')]));_0x19dba7[_0xa8b0('0x37')]=_0x19dba7[_0xa8b0('0x37')][_0xa8b0('0x39')]?_0x19dba7[_0xa8b0('0x37')]:_0xa466d3['model'];if(!_0x53a5de['query'][_0xa8b0('0x58')](_0xa8b0('0x3a'))){_0x19dba7['limit']=qs[_0xa8b0('0x3b')](_0x53a5de[_0xa8b0('0x32')][_0xa8b0('0x3b')]);_0x19dba7['offset']=qs[_0xa8b0('0x1e')](_0x53a5de[_0xa8b0('0x32')]['offset']);}_0x19dba7[_0xa8b0('0x59')]=qs[_0xa8b0('0x3c')](_0x53a5de['query'][_0xa8b0('0x3c')]);_0x19dba7['where']=qs[_0xa8b0('0x34')](_[_0xa8b0('0x3d')](_0x53a5de[_0xa8b0('0x32')],_0xa466d3[_0xa8b0('0x34')]));_0x19dba7[_0xa8b0('0x3f')][_0xa8b0('0x55')]=_0x108a63['id'];if(_0x53a5de['query'][_0xa8b0('0x3e')]){_0x19dba7[_0xa8b0('0x3f')]=_[_0xa8b0('0x41')](_0x19dba7[_0xa8b0('0x3f')],{'$or':_[_0xa8b0('0x31')](_0x19dba7[_0xa8b0('0x37')],function(_0x1b4ba0){var _0x599fb4={};_0x599fb4[_0x1b4ba0]={'$like':'%'+_0x53a5de[_0xa8b0('0x32')]['filter']+'%'};return _0x599fb4;})});}_0x19dba7=_['merge']({},_0x19dba7,_0x53a5de[_0xa8b0('0x42')]);return db['Disposition'][_0xa8b0('0x20')]({'where':_0x19dba7[_0xa8b0('0x3f')]})[_0xa8b0('0x22')](function(_0x30da27){_0x5e697c[_0xa8b0('0x20')]=_0x30da27;if(_0x53a5de[_0xa8b0('0x32')][_0xa8b0('0x43')]){_0x19dba7[_0xa8b0('0x44')]=[{'all':!![]}];}return db[_0xa8b0('0x56')][_0xa8b0('0x45')](_0x19dba7);})[_0xa8b0('0x22')](function(_0x640ef6){_0x5e697c['rows']=_0x640ef6;return _0x5e697c;});}})[_0xa8b0('0x22')](respondWithFilteredResult(_0x9ecdbe,_0x19dba7))[_0xa8b0('0x50')](handleError(_0x9ecdbe,null));};exports[_0xa8b0('0x5a')]=function(_0x4c2f40,_0x3b9f0d){return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x4c2f40[_0xa8b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x3b9f0d,null))[_0xa8b0('0x22')](function(_0x289d52){if(_0x289d52){return _0x289d52[_0xa8b0('0x5a')](_0x4c2f40[_0xa8b0('0x32')]['ids']);}})[_0xa8b0('0x22')](respondWithStatusCode(_0x3b9f0d,null))[_0xa8b0('0x50')](handleError(_0x3b9f0d,null));};exports[_0xa8b0('0x5b')]=function(_0x137377,_0x3dee5f){if(_0x137377[_0xa8b0('0x49')]['id']){delete _0x137377['body']['id'];}return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x137377[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x3dee5f,null))[_0xa8b0('0x22')](function(_0x4a3737){if(_0x4a3737){_0x137377[_0xa8b0('0x49')][_0xa8b0('0x55')]=_0x4a3737['id'];return db[_0xa8b0('0x5c')][_0xa8b0('0x48')](_0x137377[_0xa8b0('0x49')]);}})[_0xa8b0('0x22')](respondWithResult(_0x3dee5f,null))['catch'](handleError(_0x3dee5f,null));};exports['getAnswers']=function(_0x2ede8f,_0x403491){var _0x43e68e={'raw':![],'where':{}};var _0x1bcac2={};var _0x457619={'count':0x0,'rows':[]};return db[_0xa8b0('0x2c')][_0xa8b0('0x57')]({'where':{'id':_0x2ede8f['params']['id']}})['then'](handleEntityNotFound(_0x403491,null))['then'](function(_0x1ce373){if(_0x1ce373){_0x1bcac2[_0xa8b0('0x36')]=_['keys'](db[_0xa8b0('0x5c')][_0xa8b0('0x2d')]);_0x1bcac2[_0xa8b0('0x32')]=_[_0xa8b0('0x33')](_0x2ede8f[_0xa8b0('0x32')]);_0x1bcac2['filters']=_[_0xa8b0('0x35')](_0x1bcac2[_0xa8b0('0x36')],_0x1bcac2[_0xa8b0('0x32')]);_0x43e68e[_0xa8b0('0x37')]=_[_0xa8b0('0x35')](_0x1bcac2[_0xa8b0('0x36')],qs['fields'](_0x2ede8f[_0xa8b0('0x32')][_0xa8b0('0x38')]));_0x43e68e[_0xa8b0('0x37')]=_0x43e68e['attributes'][_0xa8b0('0x39')]?_0x43e68e[_0xa8b0('0x37')]:_0x1bcac2[_0xa8b0('0x36')];if(!_0x2ede8f[_0xa8b0('0x32')][_0xa8b0('0x58')](_0xa8b0('0x3a'))){_0x43e68e[_0xa8b0('0x3b')]=qs[_0xa8b0('0x3b')](_0x2ede8f[_0xa8b0('0x32')]['limit']);_0x43e68e[_0xa8b0('0x1e')]=qs['offset'](_0x2ede8f[_0xa8b0('0x32')][_0xa8b0('0x1e')]);}_0x43e68e[_0xa8b0('0x59')]=qs[_0xa8b0('0x3c')](_0x2ede8f[_0xa8b0('0x32')][_0xa8b0('0x3c')]);_0x43e68e['where']=qs[_0xa8b0('0x34')](_['pick'](_0x2ede8f[_0xa8b0('0x32')],_0x1bcac2[_0xa8b0('0x34')]));_0x43e68e['where'][_0xa8b0('0x55')]=_0x1ce373['id'];if(_0x2ede8f[_0xa8b0('0x32')][_0xa8b0('0x3e')]){_0x43e68e[_0xa8b0('0x3f')]=_[_0xa8b0('0x41')](_0x43e68e[_0xa8b0('0x3f')],{'$or':_[_0xa8b0('0x31')](_0x43e68e[_0xa8b0('0x37')],function(_0xcaf1e7){var _0xe3dcb2={};_0xe3dcb2[_0xcaf1e7]={'$like':'%'+_0x2ede8f['query']['filter']+'%'};return _0xe3dcb2;})});}_0x43e68e=_[_0xa8b0('0x41')]({},_0x43e68e,_0x2ede8f[_0xa8b0('0x42')]);return db['CannedAnswer'][_0xa8b0('0x20')]({'where':_0x43e68e[_0xa8b0('0x3f')]})[_0xa8b0('0x22')](function(_0x4c34f4){_0x457619[_0xa8b0('0x20')]=_0x4c34f4;if(_0x2ede8f[_0xa8b0('0x32')]['includeAll']){_0x43e68e[_0xa8b0('0x44')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x43e68e);})[_0xa8b0('0x22')](function(_0x413668){_0x457619[_0xa8b0('0x46')]=_0x413668;return _0x457619;});}})['then'](respondWithFilteredResult(_0x403491,_0x43e68e))[_0xa8b0('0x50')](handleError(_0x403491,null));};exports[_0xa8b0('0x5d')]=function(_0xd01ce4,_0x15de89){return db['ChatWebsite'][_0xa8b0('0x4e')]({'where':{'id':_0xd01ce4[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x15de89,null))[_0xa8b0('0x22')](function(_0x179a41){if(_0x179a41){return _0x179a41[_0xa8b0('0x5d')](_0xd01ce4[_0xa8b0('0x32')][_0xa8b0('0x5e')]);}})[_0xa8b0('0x22')](respondWithStatusCode(_0x15de89,null))[_0xa8b0('0x50')](handleError(_0x15de89,null));};exports[_0xa8b0('0x5f')]=function(_0x174857,_0x3eb3c6){_0x174857[_0xa8b0('0x49')]['sitepic']=_0x174857[_0xa8b0('0x60')][_0xa8b0('0x61')];return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x174857[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x3eb3c6,null))[_0xa8b0('0x22')](saveUpdates(_0x174857['body'],null))[_0xa8b0('0x22')](respondWithResult(_0x3eb3c6,null))['catch'](handleError(_0x3eb3c6,null));};exports[_0xa8b0('0x62')]=function(_0x115646,_0x176ced){_0x115646['body'][_0xa8b0('0x63')]=_0x115646[_0xa8b0('0x60')]['filename'];return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x115646[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x176ced,null))[_0xa8b0('0x22')](saveUpdates(_0x115646[_0xa8b0('0x49')],null))[_0xa8b0('0x22')](respondWithResult(_0x176ced,null))['catch'](handleError(_0x176ced,null));};exports[_0xa8b0('0x64')]=function(_0x32238a,_0x2e588c){_0x32238a[_0xa8b0('0x49')][_0xa8b0('0x65')]=_0x32238a[_0xa8b0('0x60')]['filename'];return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x32238a[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x2e588c,null))[_0xa8b0('0x22')](saveUpdates(_0x32238a[_0xa8b0('0x49')],null))[_0xa8b0('0x22')](respondWithResult(_0x2e588c,null))[_0xa8b0('0x50')](handleError(_0x2e588c,null));};exports['addSystemAvatar']=function(_0x3a505e,_0x36a7dc){_0x3a505e[_0xa8b0('0x49')][_0xa8b0('0x66')]=_0x3a505e[_0xa8b0('0x60')][_0xa8b0('0x61')];return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x3a505e[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x36a7dc,null))[_0xa8b0('0x22')](saveUpdates(_0x3a505e['body'],null))['then'](respondWithResult(_0x36a7dc,null))[_0xa8b0('0x50')](handleError(_0x36a7dc,null));};exports[_0xa8b0('0x67')]=function(_0x221e32,_0x46c6da){var _0x538a02=path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0x6a'));var _0x41ccd6={'where':{'id':_0x221e32['params']['id']},'attributes':['id',_0xa8b0('0x6b')],'raw':!![]};var _0x44b475=![];return require(_0xa8b0('0x6c'))['getLicense']()[_0xa8b0('0x22')](function(_0xa309d){if(_0xa309d){_0x44b475=_0xa309d[_0xa8b0('0x6d')];}})[_0xa8b0('0x22')](function(){return db['ChatWebsite'][_0xa8b0('0x4e')](_0x41ccd6);})[_0xa8b0('0x22')](handleEntityNotFound(_0x46c6da,null))[_0xa8b0('0x22')](function(_0x20128e){if(_0x20128e){if(!_['isNil'](_0x20128e[_0xa8b0('0x6b')])){if(fs[_0xa8b0('0x6e')](path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0x6f'),_0x20128e['sitepic']))&&_0x44b475){_0x538a02=path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],'server/files/images/logos/',_0x20128e[_0xa8b0('0x6b')]);}}return _0x46c6da['download'](_0x538a02);}})[_0xa8b0('0x50')](handleError(_0x46c6da,null));};exports[_0xa8b0('0x70')]=function(_0x405c96,_0x457a97){var _0x505c4d=path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0x71'));var _0x332531={'where':{'id':_0x405c96[_0xa8b0('0x52')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')](_0x332531)[_0xa8b0('0x22')](handleEntityNotFound(_0x457a97,null))['then'](function(_0x3a7760){if(_0x3a7760){if(!_[_0xa8b0('0x72')](_0x3a7760[_0xa8b0('0x63')])){if(fs[_0xa8b0('0x6e')](path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0x73'),_0x3a7760[_0xa8b0('0x63')]))){_0x505c4d=path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0x73'),_0x3a7760[_0xa8b0('0x63')]);}}return _0x457a97['download'](_0x505c4d);}})[_0xa8b0('0x50')](handleError(_0x457a97,null));};exports['getCustomerAvatar']=function(_0x30950c,_0xbbeaae){var _0x237a67=path['join'](config[_0xa8b0('0x69')],'server/files/images/avatars/customer_avatar.png');var _0x48aa5b={'where':{'id':_0x30950c[_0xa8b0('0x52')]['id']},'attributes':['id',_0xa8b0('0x65'),_0xa8b0('0x74')],'raw':!![]};return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')](_0x48aa5b)['then'](handleEntityNotFound(_0xbbeaae,null))[_0xa8b0('0x22')](function(_0x8aa43a){if(_0x8aa43a){if(!_[_0xa8b0('0x72')](_0x8aa43a['customerAvatar'])){if(fs[_0xa8b0('0x6e')](path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0x73'),_0x8aa43a[_0xa8b0('0x65')]))&&_0x8aa43a[_0xa8b0('0x74')]){_0x237a67=path['join'](config[_0xa8b0('0x69')],_0xa8b0('0x73'),_0x8aa43a[_0xa8b0('0x65')]);}}return _0xbbeaae[_0xa8b0('0x75')](_0x237a67);}})['catch'](handleError(_0xbbeaae,null));};exports[_0xa8b0('0x76')]=function(_0x2c574c,_0x4fb081){var _0x47051d=path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0x77'));var _0x34c8fe={'where':{'id':_0x2c574c['params']['id']},'attributes':['id',_0xa8b0('0x66')],'raw':!![]};return db['ChatWebsite'][_0xa8b0('0x4e')](_0x34c8fe)['then'](handleEntityNotFound(_0x4fb081,null))[_0xa8b0('0x22')](function(_0x28ffa8){if(_0x28ffa8){if(!_[_0xa8b0('0x72')](_0x28ffa8[_0xa8b0('0x66')])){if(fs['existsSync'](path[_0xa8b0('0x68')](config['root'],_0xa8b0('0x73'),_0x28ffa8['systemAvatar']))){_0x47051d=path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0x73'),_0x28ffa8[_0xa8b0('0x66')]);}}return _0x4fb081[_0xa8b0('0x75')](_0x47051d);}})[_0xa8b0('0x50')](handleError(_0x4fb081,null));};exports['notify']=function(_0x3f9edf,_0x33d92f){var _0x290a6a=require(_0xa8b0('0x78'));var _0x24244e=new _0x290a6a();var _0x4be2d0=_0x24244e['setUA'](_0x3f9edf[_0xa8b0('0x79')][_0xa8b0('0x7a')])[_0xa8b0('0x7b')]();var _0x3ace2d={'body':_0x3f9edf[_0xa8b0('0x49')],'channel':_0xa8b0('0x7c')};var _0x5aa8c7=[];var _0x5d3ae4=[];var _0x48d36d={};var _0xc4926d=![];return db['CmContact'][_0xa8b0('0x53')]()[_0xa8b0('0x22')](function(_0x5c655a){if(!_0x5c655a){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x5aa8c7=_[_0xa8b0('0x7d')](_[_0xa8b0('0x33')](_0x5c655a),[_0xa8b0('0x7e'),_0xa8b0('0x7f')]);_0x5d3ae4=_[_0xa8b0('0x7d')](_['keys'](_0x5c655a),[_0xa8b0('0x7e'),'updatedAt',_0xa8b0('0x80'),_0xa8b0('0x81')]);if(_0x3f9edf[_0xa8b0('0x49')]['id']){delete _0x3f9edf[_0xa8b0('0x49')]['id'];}if(_['isNil'](_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x82')])){throw new db[(_0xa8b0('0x83'))][(_0xa8b0('0x84'))](_0xa8b0('0x85'));}if(_[_0xa8b0('0x72')](_0x3f9edf['body'][_0xa8b0('0x49')])||_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x49')]===''){throw new db[(_0xa8b0('0x83'))][(_0xa8b0('0x84'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x86')])){throw new db[(_0xa8b0('0x83'))]['ValidationError'](_0xa8b0('0x87')+_0x5d3ae4);}if(!_[_0xa8b0('0x88')](_0x5d3ae4,_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x86')])){throw new db[(_0xa8b0('0x83'))][(_0xa8b0('0x84'))](_0xa8b0('0x89')+_0x5d3ae4);}_0x48d36d[_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x86')]]=_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x82')];})[_0xa8b0('0x22')](function(){return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x3f9edf['params']['id']},'include':[{'model':db[_0xa8b0('0x8a')],'as':_0xa8b0('0x8b'),'include':[{'model':db[_0xa8b0('0x8c')],'as':'Contacts','where':_0x48d36d,'limit':0x1,'order':[[_0xa8b0('0x7f'),'DESC']]}]},{'model':db[_0xa8b0('0x8d')],'as':_0xa8b0('0x8e')}]});})[_0xa8b0('0x22')](handleEntityNotFound(_0x33d92f,null))[_0xa8b0('0x22')](function(_0xb87e6c){if(_0xb87e6c&&_0xb87e6c[_0xa8b0('0x8b')]){_0x3ace2d[_0xa8b0('0x8f')]=_0xb87e6c;_0x3ace2d[_0xa8b0('0x90')]=_0xb87e6c['Applications'];_0x3ace2d[_0xa8b0('0x91')]=_0xb87e6c['List'];_0x3ace2d[_0xa8b0('0x90')]=_[_0xa8b0('0x92')](_0x3ace2d[_0xa8b0('0x90')],[_0xa8b0('0x93')],['asc']);if(_0x3ace2d[_0xa8b0('0x8f')]['Applications']){delete _0x3ace2d['account'][_0xa8b0('0x8e')];}if(_0x3ace2d[_0xa8b0('0x8f')][_0xa8b0('0x8b')]&&_0x3ace2d['account'][_0xa8b0('0x8b')][_0xa8b0('0x94')][_0xa8b0('0x39')]){return _0x3ace2d[_0xa8b0('0x8f')][_0xa8b0('0x8b')][_0xa8b0('0x94')][0x0];}var _0x2ba24e=_[_0xa8b0('0x95')](_0x3f9edf[_0xa8b0('0x49')],{'firstName':_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x82')],'ListId':_0xb87e6c[_0xa8b0('0x81')]});_0x2ba24e[_0x3f9edf['body'][_0xa8b0('0x86')]]=_0x3f9edf['body'][_0xa8b0('0x82')];return db[_0xa8b0('0x8c')][_0xa8b0('0x48')](_0x2ba24e,{'fields':_0x5aa8c7,'raw':!![]});}})[_0xa8b0('0x22')](handleEntityNotFound(_0x33d92f,null))['then'](function(_0x40444a){_0x3ace2d[_0xa8b0('0x96')]=_0x40444a;var _0x59fe47=_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x97')];if(_0x3f9edf['headers'][_0xa8b0('0x98')]){_0x59fe47=_0x3f9edf[_0xa8b0('0x79')][_0xa8b0('0x98')];}else if(_0x3f9edf[_0xa8b0('0x79')][_0xa8b0('0x99')]){_0x59fe47=_[_0xa8b0('0x9a')](_0x3f9edf[_0xa8b0('0x79')]['x-forwarded-for']['split'](','));}if(_0x40444a){var _0x524c0b={'ContactId':_0x40444a['id'],'ChatWebsiteId':_0x3f9edf[_0xa8b0('0x52')]['id'],'from':(_0x40444a[_0xa8b0('0x9b')]||'')+'\x20'+(_0x40444a['lastName']||''),'customerIp':_0x59fe47,'customerPort':_0x3f9edf[_0xa8b0('0x79')][_0xa8b0('0x9c')]?_0x3f9edf[_0xa8b0('0x79')][_0xa8b0('0x9c')]:null,'referer':_0x3f9edf[_0xa8b0('0x49')]['referer'],'browserName':_0x4be2d0['browser'][_0xa8b0('0x28')]&&_0x4be2d0[_0xa8b0('0x9d')]['version']?util['format'](_0xa8b0('0x9e'),_0x4be2d0[_0xa8b0('0x9d')][_0xa8b0('0x28')],_0x4be2d0[_0xa8b0('0x9d')][_0xa8b0('0x9f')]):'unknown','browserVersion':_0x4be2d0[_0xa8b0('0x9d')][_0xa8b0('0x9f')]||'unknown','osName':util[_0xa8b0('0xa0')](_0xa8b0('0x9e'),_0x4be2d0['os'][_0xa8b0('0x28')],_0x4be2d0['os'][_0xa8b0('0x9f')]),'osVersion':_0x4be2d0['os'][_0xa8b0('0x9f')],'deviceModel':_0x4be2d0[_0xa8b0('0xa1')]['model']&&_0x4be2d0[_0xa8b0('0xa1')][_0xa8b0('0xa2')]?util['format']('%s\x20%s\x20%s',_0x4be2d0[_0xa8b0('0xa1')][_0xa8b0('0x36')],_0x4be2d0[_0xa8b0('0xa1')][_0xa8b0('0xa2')],_0x4be2d0['device']['type']):null,'deviceVendor':_0x4be2d0[_0xa8b0('0xa1')][_0xa8b0('0xa2')],'deviceType':_0x4be2d0[_0xa8b0('0xa1')]['type'],'formData':JSON[_0xa8b0('0x16')](_0x3f9edf[_0xa8b0('0x49')])};var _0x449a05={'ChatWebsiteId':_0x3f9edf[_0xa8b0('0x52')]['id'],'closed':![]};if(_0x3f9edf[_0xa8b0('0x49')]['threadId']){_0x449a05['threadId']=_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xa3')];return db[_0xa8b0('0xa4')][_0xa8b0('0x4e')]({'where':_0x449a05})[_0xa8b0('0x22')](function(_0x257c4a){if(_0x257c4a){return[_0x257c4a,![]];}_0x524c0b[_0xa8b0('0xa3')]=_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xa3')];_0x524c0b[_0xa8b0('0xa5')]=_0x3f9edf['body'][_0xa8b0('0xa5')];return db[_0xa8b0('0xa4')][_0xa8b0('0x48')](_0x524c0b)[_0xa8b0('0x22')](function(_0xcc76b1){return[_0xcc76b1,!![]];});});}_0x449a05[_0xa8b0('0xa6')]=_0x40444a['id'];if(_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xa7')]&&_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xa7')]['id']){_0x449a05['id']=_0x3f9edf['body'][_0xa8b0('0xa7')]['id'];return db[_0xa8b0('0xa4')]['find']({'where':_0x449a05})[_0xa8b0('0x22')](function(_0x329f43){if(_0x329f43){return[_0x329f43,![]];}return db['ChatInteraction']['create'](_0x524c0b)[_0xa8b0('0x22')](function(_0x5de305){return[_0x5de305,!![]];});});}return db[_0xa8b0('0xa4')][_0xa8b0('0x48')](_0x524c0b)[_0xa8b0('0x22')](function(_0x44a123){return[_0x44a123,!![]];});}})[_0xa8b0('0xa8')](function(_0x434732,_0x3e9cd6){if(_0x434732){_0xc4926d=_0x3e9cd6;if(!_0x3e9cd6){var _0x47d3da={'from':(_0x3ace2d['contact']['firstName']||'')+'\x20'+(_0x3ace2d['contact'][_0xa8b0('0xa9')]||'')};if(_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xa3')]&&_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xaa')]&&_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xa3')]!=_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xaa')]){_0x47d3da[_0xa8b0('0xa3')]=_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xaa')];}return _0x434732[_0xa8b0('0x21')](_0x47d3da);}else{return _0x434732;}}})[_0xa8b0('0x22')](function(_0x23f2b2){_0x3ace2d[_0xa8b0('0xa7')]=_0x23f2b2[_0xa8b0('0x24')]({'plain':!![]});_0x3ace2d[_0xa8b0('0xa7')][_0xa8b0('0xab')]=_0xc4926d;if(_0x3ace2d['interaction'][_0xa8b0('0xab')]){if(_0x3ace2d[_0xa8b0('0x8f')]['autoclose']){_0x3ace2d['applications'][_0xa8b0('0xac')]({'id':0x0,'priority':_0x3ace2d[_0xa8b0('0x90')]['length']+0x1,'app':_0xa8b0('0xad'),'appdata':_0xa8b0('0xae'),'interval':_0xa8b0('0xaf')});}}return db[_0xa8b0('0xb0')]['create']({'body':_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0x49')],'ChatWebsiteId':_0x3f9edf[_0xa8b0('0x52')]['id'],'ChatInteractionId':_0x23f2b2['id'],'direction':'in','ContactId':_0x3ace2d[_0xa8b0('0x96')]['id'],'AttachmentId':_0x3f9edf[_0xa8b0('0x49')][_0xa8b0('0xb1')]});})[_0xa8b0('0x22')](function(_0x1a6804){_0x3ace2d[_0xa8b0('0x18')]=_0x1a6804;if(_0x3ace2d[_0xa8b0('0xa7')][_0xa8b0('0xb2')]){return db[_0xa8b0('0xb3')][_0xa8b0('0x4e')]({'attributes':['id','name'],'where':{'id':_0x3ace2d[_0xa8b0('0xa7')][_0xa8b0('0xb2')]}})['then'](function(_0x310da3){if(_0x310da3){_0x3ace2d[_0xa8b0('0x90')][_0xa8b0('0xb4')]({'id':0x0,'priority':0x0,'app':_0xa8b0('0xb5'),'appdata':_0x310da3[_0xa8b0('0x28')]+','+(_0x3ace2d['account'][_0xa8b0('0xb6')]||0xa),'interval':_0xa8b0('0xaf')});_0x3ace2d[_0xa8b0('0xb7')]=!![];}return respondWithRpcPromise(_0xa8b0('0xb8'),_0xa8b0('0xb9'),_0x3ace2d);});}return respondWithRpcPromise(_0xa8b0('0xb8'),_0xa8b0('0xb9'),_0x3ace2d);})[_0xa8b0('0x22')](function(_0x37a253){respondWithRpcPromise(_0xa8b0('0xba'),_0xa8b0('0xba'),{'event':_0xa8b0('0xbb'),'message':_0x37a253},client9002);return _0x37a253;})[_0xa8b0('0x22')](respondWithResult(_0x33d92f,null))[_0xa8b0('0x50')](handleError(_0x33d92f,null));};exports[_0xa8b0('0xbc')]=function(_0x2bb615,_0x2cebe2){var _0x1a1e75,_0x127831,_0x58d13d;var _0x4cfc78=[];var _0x4c0cec={};var _0x54e882=_0x2bb615['files']||[];var _0x443550=[];var _0x3bd722;return db['CmContact'][_0xa8b0('0x53')]()['then'](function(_0x2374b9){if(!_0x2374b9){throw new db['Sequelize'][(_0xa8b0('0x84'))](_0xa8b0('0xbd'));}_0x4cfc78=_[_0xa8b0('0x7d')](_['keys'](_0x2374b9),[_0xa8b0('0x7e'),_0xa8b0('0x7f'),'CompanyId','ListId']);if(_0x2bb615[_0xa8b0('0x49')]['id']){delete _0x2bb615[_0xa8b0('0x49')]['id'];}if(_[_0xa8b0('0x72')](_0x2bb615['body']['from'])){throw _0x2cebe2[_0xa8b0('0x1b')](0x1f4)[_0xa8b0('0x29')](new db[(_0xa8b0('0x83'))][(_0xa8b0('0x84'))]('from\x20is\x20mandatory'));}if(_[_0xa8b0('0x72')](_0x2bb615[_0xa8b0('0x49')]['body'])||_0x2bb615['body'][_0xa8b0('0x49')]===''){throw _0x2cebe2['status'](0x1f4)[_0xa8b0('0x29')](new db['Sequelize'][(_0xa8b0('0x84'))](_0xa8b0('0xbe')));}if(_[_0xa8b0('0x72')](_0x2bb615['body'][_0xa8b0('0xbf')])){throw _0x2cebe2['status'](0x1f4)[_0xa8b0('0x29')](new db[(_0xa8b0('0x83'))][(_0xa8b0('0x84'))](_0xa8b0('0xc0')+_0x4cfc78));}if(!_[_0xa8b0('0x88')](_0x4cfc78,_0x2bb615[_0xa8b0('0x49')][_0xa8b0('0xbf')])){throw _0x2cebe2[_0xa8b0('0x1b')](0x1f4)['send'](new db[(_0xa8b0('0x83'))][(_0xa8b0('0x84'))](_0xa8b0('0xc1')+_0x4cfc78));}_0x4c0cec[_0x2bb615[_0xa8b0('0x49')][_0xa8b0('0xbf')]]=_0x2bb615[_0xa8b0('0x49')]['from'];})[_0xa8b0('0x22')](function(){return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x2bb615[_0xa8b0('0x52')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xa8b0('0xc2')],'as':_0xa8b0('0xc2')}]});})[_0xa8b0('0x22')](handleEntityNotFound(_0x2cebe2,null))[_0xa8b0('0x22')](function(_0xd717ef){if(_0xd717ef&&_0xd717ef['List']){_0x127831=_0xd717ef;var _0xdb94df=_[_0xa8b0('0x95')](_0x2bb615[_0xa8b0('0x49')],{'firstName':_0x2bb615[_0xa8b0('0x49')][_0xa8b0('0x82')],'phone':_0x2bb615[_0xa8b0('0x49')][_0xa8b0('0x82')],'ListId':_0xd717ef[_0xa8b0('0x81')]});_0xdb94df[_0x2bb615[_0xa8b0('0x49')][_0xa8b0('0xbf')]]=_0x2bb615[_0xa8b0('0x49')][_0xa8b0('0x82')];return db[_0xa8b0('0x8c')][_0xa8b0('0xc3')]({'where':_0x4c0cec,'defaults':_0xdb94df});}})[_0xa8b0('0xa8')](function(_0x205d68){if(_0x205d68){_0x58d13d=_0x205d68;var _0xb23dbe=fs['readFileSync'](path[_0xa8b0('0x68')](config['root'],_0xa8b0('0xc4')),_0xa8b0('0xc5'));var _0x2888fe=ejs[_0xa8b0('0xc6')](_0xb23dbe,{'body':_[_0xa8b0('0xc7')](_0x2bb615[_0xa8b0('0x49')]['body']),'bodyTitle':_0x127831['offlineMessageBody']});return db[_0xa8b0('0xc8')][_0xa8b0('0x48')]({'body':_0x2888fe,'plainBody':htmlToText[_0xa8b0('0xc9')](_0x2888fe),'ContactId':_0x205d68['id'],'ChatWebsiteId':_0x127831['id']});}})[_0xa8b0('0x22')](function(_0x4f1c5d){_0x3bd722=_0x4f1c5d;if(_0x54e882[_0xa8b0('0x39')]){var _0x202e08=_0x54e882[_0xa8b0('0x31')](function(_0x30315c){return{'name':_0x30315c['originalname'],'basename':_0x30315c['filename'],'type':_0x30315c[_0xa8b0('0xca')],'ChatOfflineMessageId':_0x4f1c5d['id']};});_0x443550=_0x202e08['map'](_0x50f01d=>{var _0x2d5e91={'filename':_0x50f01d[_0xa8b0('0x28')],'path':path['join'](config[_0xa8b0('0x69')],_0xa8b0('0xcb'),_0xa8b0('0xcc'),_0xa8b0('0xcd'),_0xa8b0('0xce'),_0x50f01d[_0xa8b0('0xcf')])};return _0x2d5e91;});if(!_0x127831[_0xa8b0('0xd0')]){return db[_0xa8b0('0xd1')]['transaction'](function(_0x5d2ff9){return db[_0xa8b0('0xd2')][_0xa8b0('0xd3')](_0x202e08,{'transaction':_0x5d2ff9});});}}})['then'](function(){if(_0x3bd722){_0x1a1e75=_0x3bd722;return db['MailAccount'][_0xa8b0('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0xa8b0('0xd4')],'as':_0xa8b0('0xd5'),'raw':!![],'include':[{'model':db[_0xa8b0('0xd6')],'as':_0xa8b0('0xd6'),'raw':!![]}]}]});}})[_0xa8b0('0x22')](function(_0x127e72){if(_0x127e72&&_0x127e72[_0xa8b0('0xd5')]&&_0x127831[_0xa8b0('0xd7')]&&_0x127831[_0xa8b0('0xd8')]){var _0x521502=_0x127e72['getSmtpOptions']();return respondWithRpcPromise(_0xa8b0('0xd9'),_0xa8b0('0xda'),{'account':_0x521502,'message':{'from':util[_0xa8b0('0xa0')](_0xa8b0('0xdb'),_0x127e72[_0xa8b0('0x28')],_0x127e72[_0xa8b0('0xdc')]||_0x127e72[_0xa8b0('0xd5')][_0xa8b0('0x4a')]),'to':_0x127831[_0xa8b0('0xd8')],'subject':_0x127831[_0xa8b0('0xdd')],'html':_0x1a1e75[_0xa8b0('0x49')],'attachments':_0x443550}},client9003)['then'](function(){return _0x1a1e75;})['catch'](function(_0x223a38){logger[_0xa8b0('0x17')](_0x223a38);});}})[_0xa8b0('0x22')](function(){if(_0x127831&&_0x127831[_0xa8b0('0xd0')]&&_0x127831[_0xa8b0('0xde')]){var _0x4eed3b=[];if(_0x54e882[_0xa8b0('0x39')]){_0x4eed3b=_0x54e882[_0xa8b0('0x31')](function(_0x4c6f05){return{'name':_0x4c6f05[_0xa8b0('0xdf')],'basename':_0x4c6f05[_0xa8b0('0x61')],'type':_0x4c6f05[_0xa8b0('0xca')],'ChatOfflineMessageId':_0x3bd722['id']};});}var _0x2723cb;if(!_[_0xa8b0('0x72')](_0x127831['subjectOffline'])){var _0x5a48bd=_[_0xa8b0('0x31')](_0x2bb615['body'],function(_0x14dd18){return _0x14dd18;});var _0x502305=_[_0xa8b0('0xe0')](_0x5a48bd)[0x0];var _0x54ccdf=_[_0xa8b0('0xe1')](_0x502305,function(_0x5e97a8){return _0x5e97a8;});_0x2723cb=_0x54ccdf[0x1][_0x127831[_0xa8b0('0xe2')]];}var _0x2b8a66={'from':_0x58d13d[_0xa8b0('0xdc')],'firstName':_0x58d13d['firstName'],'lastName':_0x58d13d['lastName'],'mapKey':_0xa8b0('0xdc'),'message':{'from':_0x58d13d[_0xa8b0('0xdc')],'to':_0x127831[_0xa8b0('0xc2')][_0xa8b0('0xdc')],'cc':'','subject':_[_0xa8b0('0x72')](_0x2723cb)?_0x127831[_0xa8b0('0xdd')]:_0x2723cb,'messageId':'','sentAt':new Date(),'attach':_0x4eed3b[_0xa8b0('0x39')],'attachments':_0x4eed3b,'originChannel':_0xa8b0('0xe3'),'ChatWebsiteId':_0x127831['id'],'ChatOfflineMessageId':_0x1a1e75['id'],'originTo':_0x127831[_0xa8b0('0xc2')][_0xa8b0('0xdc')]},'body':_0x1a1e75[_0xa8b0('0x49')]};var _0x39ff88={'account':{'id':_0x127831['MailAccountId']},'body':_0x2b8a66,'log':_0xa8b0('0xe4')};return respondWithRpcPromise(_0xa8b0('0xe4'),'notifyMail',_0x39ff88,client9001)[_0xa8b0('0x22')](function(){return _0x1a1e75;})[_0xa8b0('0x50')](function(_0x2abc28){logger[_0xa8b0('0x17')](_0x2abc28);});}return;})[_0xa8b0('0x22')](function(){if(_0x1a1e75){return _0x1a1e75;}})['then'](respondWithResult(_0x2cebe2,null))[_0xa8b0('0x50')](function(_0x5922ba){logger[_0xa8b0('0x17')](_0xa8b0('0x50'),_0x5922ba);for(var _0x5ad0ce of _0x54e882){var _0x56f00c=path[_0xa8b0('0x68')](config[_0xa8b0('0x69')],_0xa8b0('0xcb'),_0xa8b0('0xcc'),'attachments','offline-chat',_0x5ad0ce['filename']);fs_extra[_0xa8b0('0xe5')](_0x56f00c)['catch'](function(_0x19c94c){logger['error'](_0xa8b0('0xe6'),_0x56f00c,_0x19c94c);});}});};exports['addInteraction']=function(_0x4d9a18,_0x41d749){return db['ChatInteraction']['find']({'where':{'id':_0x4d9a18[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x41d749,null))[_0xa8b0('0x22')](function(_0x59fa41){if(_0x59fa41){return _0x59fa41[_0xa8b0('0xe7')](_0x4d9a18[_0xa8b0('0x49')]['ids'],_['omit'](_0x4d9a18['body'],[_0xa8b0('0x5e'),'id'])||{});}})['then'](respondWithResult(_0x41d749,null))[_0xa8b0('0x50')](handleError(_0x41d749,null));};exports['getInteractions']=function(_0xbcb126,_0x48a465){var _0x335af4={'raw':![],'where':{}};var _0x519b8e={};var _0x1d7e4f={'count':0x0,'rows':[]};return db[_0xa8b0('0x2c')][_0xa8b0('0x57')]({'where':{'id':_0xbcb126[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x48a465,null))['then'](function(_0x78956e){if(_0x78956e){_0x519b8e[_0xa8b0('0x36')]=_[_0xa8b0('0x33')](db[_0xa8b0('0xa4')][_0xa8b0('0x2d')]);_0x519b8e['query']=_[_0xa8b0('0x33')](_0xbcb126[_0xa8b0('0x32')]);_0x519b8e[_0xa8b0('0x34')]=_['intersection'](_0x519b8e[_0xa8b0('0x36')],_0x519b8e[_0xa8b0('0x32')]);_0x335af4[_0xa8b0('0x37')]=_['intersection'](_0x519b8e[_0xa8b0('0x36')],qs[_0xa8b0('0x38')](_0xbcb126[_0xa8b0('0x32')]['fields']));_0x335af4[_0xa8b0('0x37')]=_0x335af4[_0xa8b0('0x37')]['length']?_0x335af4[_0xa8b0('0x37')]:_0x519b8e['model'];if(!_0xbcb126[_0xa8b0('0x32')][_0xa8b0('0x58')](_0xa8b0('0x3a'))){_0x335af4[_0xa8b0('0x3b')]=qs[_0xa8b0('0x3b')](_0xbcb126[_0xa8b0('0x32')][_0xa8b0('0x3b')]);_0x335af4[_0xa8b0('0x1e')]=qs[_0xa8b0('0x1e')](_0xbcb126[_0xa8b0('0x32')][_0xa8b0('0x1e')]);}_0x335af4[_0xa8b0('0x59')]=qs[_0xa8b0('0x3c')](_0xbcb126[_0xa8b0('0x32')]['sort']);_0x335af4['where']=qs[_0xa8b0('0x34')](_[_0xa8b0('0x3d')](_0xbcb126[_0xa8b0('0x32')],_0x519b8e[_0xa8b0('0x34')]));_0x335af4[_0xa8b0('0x3f')][_0xa8b0('0x55')]=_0x78956e['id'];if(_0xbcb126[_0xa8b0('0x32')][_0xa8b0('0x3e')]){_0x335af4[_0xa8b0('0x3f')]=_[_0xa8b0('0x41')](_0x335af4['where'],{'$or':_[_0xa8b0('0x31')](_0x335af4[_0xa8b0('0x37')],function(_0x2d3173){var _0x1bd2dd={};_0x1bd2dd[_0x2d3173]={'$like':'%'+_0xbcb126['query'][_0xa8b0('0x3e')]+'%'};return _0x1bd2dd;})});}_0x335af4=_[_0xa8b0('0x41')]({},_0x335af4,_0xbcb126['options']);return db[_0xa8b0('0xa4')][_0xa8b0('0x20')]({'where':_0x335af4[_0xa8b0('0x3f')]})[_0xa8b0('0x22')](function(_0x2b3b02){_0x1d7e4f[_0xa8b0('0x20')]=_0x2b3b02;if(_0xbcb126[_0xa8b0('0x32')][_0xa8b0('0x43')]){_0x335af4[_0xa8b0('0x44')]=[{'model':db[_0xa8b0('0x8c')],'as':_0xa8b0('0xe8'),'required':![]},{'model':db[_0xa8b0('0xb3')],'as':_0xa8b0('0xe9'),'attributes':['name',_0xa8b0('0xea'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xa8b0('0x28'),_0xa8b0('0xeb')],'where':_0xbcb126[_0xa8b0('0x32')]['tag']?{'id':_0xbcb126['query'][_0xa8b0('0xec')]}:undefined,'required':_0xbcb126[_0xa8b0('0x32')][_0xa8b0('0xec')]?!![]:![]}];}return db['ChatInteraction'][_0xa8b0('0x45')](_0x335af4);})['then'](function(_0x57a49f){_0x1d7e4f[_0xa8b0('0x46')]=_0x57a49f;return _0x1d7e4f;});}})[_0xa8b0('0x22')](respondWithFilteredResult(_0x48a465,_0x335af4))[_0xa8b0('0x50')](handleError(_0x48a465,null));};function iftimePromise(_0x402b58,_0x4f3de7){return respondWithRpcPromise(_0xa8b0('0xed'),'getSnippet',{'command':_0x4f3de7['timezone']?util[_0xa8b0('0xa0')]('iftime\x20%s,%s',_0x402b58[_0xa8b0('0xee')],_0x4f3de7[_0xa8b0('0xef')]):util[_0xa8b0('0xa0')](_0xa8b0('0xf0'),_0x402b58[_0xa8b0('0xee')])},client9002)['then'](function(_0x2b0018){var _0x3a4c3c=_0x2b0018&&_0x2b0018['indexOf']('true')>=0x0?!![]:![];logger[_0xa8b0('0x13')](_0xa8b0('0xf1'),_0x4f3de7['id'],_0x402b58['id'],_0x402b58[_0xa8b0('0xee')],_0x3a4c3c?_0xa8b0('0xf2'):_0xa8b0('0xf3'),_0x4f3de7['timezone']?_0x4f3de7[_0xa8b0('0xef')]:_0xa8b0('0xf4'));return _0x3a4c3c;})[_0xa8b0('0x50')](function(_0x52d601){logger[_0xa8b0('0x17')](_0xa8b0('0xf1'),_0x4f3de7['id'],_0x402b58['id'],_0x402b58['interval'],util[_0xa8b0('0xf5')](_0x52d601,{'showHidden':![],'depth':null}),_0x4f3de7[_0xa8b0('0xef')]?_0x4f3de7['timezone']:'No\x20timezone');return![];});}exports[_0xa8b0('0xf6')]=function(_0x574671,_0x499a2c){var _0x1d2af0=0x0;var _0xf95c65=0x0;var _0x8e9cdf=![];var _0xd4a62c;var _0x11fe97;return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'where':{'id':_0x574671['params']['id']},'include':[{'model':db[_0xa8b0('0xf7')],'as':'Interval','include':[{'model':db[_0xa8b0('0xf7')],'as':_0xa8b0('0xf8'),'attributes':['id',_0xa8b0('0xee')],'raw':!![]}]}]})[_0xa8b0('0x22')](handleEntityNotFound(_0x499a2c,null))['then'](function(_0x243efb){if(_0x243efb){_0xd4a62c=_0x243efb;return _0x243efb[_0xa8b0('0xf9')]({'raw':!![]});}})[_0xa8b0('0x22')](function(_0x1b1e57){if(_0xd4a62c){if(_0x1b1e57){_0x11fe97=_0x1b1e57;}}return require(_0xa8b0('0x6c'))[_0xa8b0('0xfa')]();})['then'](function(_0x5106fb){if(_0x5106fb){_0xf95c65=_0x5106fb[_0xa8b0('0xfb')];_0x8e9cdf=_0x5106fb['custom'];}})[_0xa8b0('0x22')](function(){return db[_0xa8b0('0xa4')][_0xa8b0('0x20')]({'where':{'closed':![]}});})[_0xa8b0('0x22')](function(_0x21b33e){_0x1d2af0=_0x21b33e;if(_0xf95c65&&_0x21b33e>_0xf95c65){return db[_0xa8b0('0xfc')][_0xa8b0('0x57')]({'where':{'id':0x1}})[_0xa8b0('0x22')](function(_0x32a4e0){if(_0x32a4e0){_0x32a4e0[_0xa8b0('0xfd')]('chatLicenseExceeded');}});}})[_0xa8b0('0x22')](function(){if(_0xd4a62c[_0xa8b0('0xf7')]&&_0xd4a62c[_0xa8b0('0xf7')][_0xa8b0('0xf8')]){var _0x278acc=[];for(var _0x5e301d=0x0;_0x5e301d<_0xd4a62c['Interval'][_0xa8b0('0xf8')][_0xa8b0('0x39')];_0x5e301d++){var _0x40d5f8=_0xd4a62c['Interval']['Intervals'][_0x5e301d][_0xa8b0('0x24')]({'plain':!![]});_0x278acc[_0xa8b0('0xac')](iftimePromise(_0x40d5f8,_0xd4a62c));}return BPromise[_0xa8b0('0xfe')](_0x278acc)[_0xa8b0('0x22')](function(_0x278483){return _[_0xa8b0('0xff')](_0x278483);});}else{return!![];}})[_0xa8b0('0x22')](function(_0x5303e2){var _0x3e91fd=fs[_0xa8b0('0x100')](path['join'](config[_0xa8b0('0x69')],_0xa8b0('0x101')),'utf8');var _0x300319=new url['URL'](_0xd4a62c['address'])[_0xa8b0('0x102')];var _0x5874be='3.1.0';var _0x104c9f=![];var _0x3a84a0={'chatVersion':_0x5874be,'chatWebsiteAddressOrigin':_0x300319,'remote':_0xd4a62c[_0xa8b0('0x103')],'query':querystring['stringify'](_['merge'](_0xd4a62c[_0xa8b0('0x24')]({'plain':!![]}),{'customerIp':_0x574671[_0xa8b0('0x79')][_0xa8b0('0x99')]||_0x574671[_0xa8b0('0x79')][_0xa8b0('0x104')]||_0x574671[_0xa8b0('0x105')][_0xa8b0('0x106')]||_0x574671['ip'],'referer':_0x574671[_0xa8b0('0x79')][_0xa8b0('0x107')],'openedInteractions':_0x1d2af0,'maxInteractions':_0xf95c65,'virtual':_0x8e9cdf['virtual'],'online':_0x5303e2,'custom':_0x8e9cdf}))[_0xa8b0('0x108')](/'/g,'\x5c\x27')};_0x499a2c[_0xa8b0('0x29')](ejs[_0xa8b0('0xc6')](Mustache[_0xa8b0('0xc6')](_0x3e91fd,_0x3a84a0),{'proactiveActions':_0x11fe97,'alignment':_0xd4a62c[_0xa8b0('0x109')],'verticalAlignment':_0xd4a62c[_0xa8b0('0x10a')],'div_color':_0xd4a62c[_0xa8b0('0xeb')],'labelText':_0xd4a62c['labelText'],'text_color':_0xd4a62c[_0xa8b0('0x10b')],'text_button_color':_0xd4a62c[_0xa8b0('0x10c')],'button_color':_0xd4a62c[_0xa8b0('0x10d')],'background_color':_0xd4a62c[_0xa8b0('0x10e')],'hideWhenOffline':_0xd4a62c['hideWhenOffline'],'intervalId':_0xd4a62c[_0xa8b0('0x10f')],'isDevelopment':_0x104c9f,'chatVersion':_0x5874be}));})[_0xa8b0('0x50')](handleError(_0x499a2c,null));};exports['addApplications']=function(_0xfea279,_0x2c8aa2){var _0x408e3e=_0xfea279['params']['id'];var _0x192e8d=_0xfea279[_0xa8b0('0x49')];var _0x3c9122=0xc8;var _0x3c5540=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xa8b0('0xd1')][_0xa8b0('0x110')]['ISOLATION_LEVELS'][_0xa8b0('0x111')]},function(_0xe7fbd8){return db['ChatWebsite']['findOne']({'where':{'id':_0x408e3e},'transaction':_0xe7fbd8})[_0xa8b0('0x22')](function(_0x548a31){if(_0x548a31){return db[_0xa8b0('0x8d')][_0xa8b0('0x23')]({'where':{'ChatWebsiteId':_0x408e3e},'transaction':_0xe7fbd8})['then'](function(){var _0x149af2=_[_0xa8b0('0x31')](_0x192e8d,function(_0x537013){_0x537013[_0xa8b0('0x55')]=_0x408e3e;return _0x537013;});return db[_0xa8b0('0x8d')][_0xa8b0('0xd3')](_0x149af2,{'transaction':_0xe7fbd8});});}else{_0x3c9122=0x194;_0x3c5540=[];}});})[_0xa8b0('0x22')](function(){if(_0x3c9122!==0x194){return db[_0xa8b0('0x8d')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x408e3e},'order':_0xa8b0('0x93')})['then'](function(_0x5d0875){_0x3c5540=_0x5d0875;});}})[_0xa8b0('0x50')](function(_0x5b4739){_0x3c9122=0x1f4;logger['error'](_0x5b4739[_0xa8b0('0x27')]);if(_0x5b4739[_0xa8b0('0x28')]){delete _0x5b4739[_0xa8b0('0x28')];}_0x3c5540=_0x5b4739;})[_0xa8b0('0x112')](function(){if(_0x3c5540===null){_0x2c8aa2[_0xa8b0('0x1a')](_0x3c9122);}else{if(_0x3c9122===0x1f4){_0x2c8aa2[_0xa8b0('0x1b')](_0x3c9122)[_0xa8b0('0x29')](_0x3c5540);}else{_0x2c8aa2[_0xa8b0('0x1b')](_0x3c9122)['json'](_0x3c5540);}}});};exports[_0xa8b0('0x113')]=function(_0x34bd37,_0x20b74c){var _0x1596c5={};var _0x37cd05={};var _0x3e8b2f;var _0x592dd7;return db[_0xa8b0('0x2c')][_0xa8b0('0x57')]({'where':{'id':_0x34bd37['params']['id']}})['then'](handleEntityNotFound(_0x20b74c,null))[_0xa8b0('0x22')](function(_0x536e8f){if(_0x536e8f){_0x3e8b2f=_0x536e8f;_0x37cd05[_0xa8b0('0x36')]=_[_0xa8b0('0x33')](db[_0xa8b0('0x8d')][_0xa8b0('0x2d')]);_0x37cd05[_0xa8b0('0x32')]=_['keys'](_0x34bd37[_0xa8b0('0x32')]);_0x37cd05[_0xa8b0('0x34')]=_['intersection'](_0x37cd05[_0xa8b0('0x36')],_0x37cd05[_0xa8b0('0x32')]);_0x1596c5[_0xa8b0('0x37')]=_[_0xa8b0('0x35')](_0x37cd05['model'],qs[_0xa8b0('0x38')](_0x34bd37[_0xa8b0('0x32')]['fields']));_0x1596c5['attributes']=_0x1596c5[_0xa8b0('0x37')][_0xa8b0('0x39')]?_0x1596c5['attributes']:_0x37cd05['model'];_0x1596c5[_0xa8b0('0x59')]=qs[_0xa8b0('0x3c')](_0x34bd37['query'][_0xa8b0('0x3c')]);_0x1596c5[_0xa8b0('0x3f')]=qs[_0xa8b0('0x34')](_[_0xa8b0('0x3d')](_0x34bd37['query'],_0x37cd05[_0xa8b0('0x34')]));if(_0x34bd37[_0xa8b0('0x32')][_0xa8b0('0x3e')]){_0x1596c5[_0xa8b0('0x3f')]=_[_0xa8b0('0x41')](_0x1596c5[_0xa8b0('0x3f')],{'$or':_[_0xa8b0('0x31')](_0x1596c5[_0xa8b0('0x37')],function(_0xe82eca){var _0x4f80ba={};_0x4f80ba[_0xe82eca]={'$like':'%'+_0x34bd37[_0xa8b0('0x32')]['filter']+'%'};return _0x4f80ba;})});}_0x1596c5=_[_0xa8b0('0x41')]({},_0x1596c5,_0x34bd37[_0xa8b0('0x42')]);return _0x3e8b2f[_0xa8b0('0x113')](_0x1596c5);}})['then'](function(_0x3cdf44){if(_0x3cdf44){_0x592dd7=_0x3cdf44[_0xa8b0('0x39')];if(!_0x34bd37[_0xa8b0('0x32')]['hasOwnProperty'](_0xa8b0('0x3a'))){_0x1596c5[_0xa8b0('0x3b')]=qs[_0xa8b0('0x3b')](_0x34bd37[_0xa8b0('0x32')]['limit']);_0x1596c5[_0xa8b0('0x1e')]=qs[_0xa8b0('0x1e')](_0x34bd37[_0xa8b0('0x32')]['offset']);}return _0x3e8b2f[_0xa8b0('0x113')](_0x1596c5);}})[_0xa8b0('0x22')](function(_0x3c3da5){if(_0x3c3da5){return _0x3c3da5?{'count':_0x592dd7,'rows':_0x3c3da5}:null;}})[_0xa8b0('0x22')](respondWithResult(_0x20b74c,null))[_0xa8b0('0x50')](handleError(_0x20b74c,null));};exports['addProactiveActions']=function(_0xf1f412,_0x8dcccf){return db[_0xa8b0('0x114')]['find']({'where':{'id':_0xf1f412[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x8dcccf,null))[_0xa8b0('0x22')](function(_0x2163fd){if(_0x2163fd){return _0x2163fd[_0xa8b0('0x115')](_0xf1f412[_0xa8b0('0x49')][_0xa8b0('0x5e')],_[_0xa8b0('0x116')](_0xf1f412[_0xa8b0('0x49')],[_0xa8b0('0x5e'),'id'])||{});}})[_0xa8b0('0x22')](respondWithResult(_0x8dcccf,null))[_0xa8b0('0x50')](handleError(_0x8dcccf,null));};exports['getProactiveActions']=function(_0x51cd6c,_0x3bc9c2){var _0x3f4865={};var _0x3a610e={};var _0x10d654;var _0x3a9167;return db[_0xa8b0('0x2c')][_0xa8b0('0x57')]({'where':{'id':_0x51cd6c['params']['id']}})['then'](handleEntityNotFound(_0x3bc9c2,null))['then'](function(_0xb0a477){if(_0xb0a477){_0x10d654=_0xb0a477;_0x3a610e[_0xa8b0('0x36')]=_[_0xa8b0('0x33')](db[_0xa8b0('0x117')][_0xa8b0('0x2d')]);_0x3a610e[_0xa8b0('0x32')]=_['keys'](_0x51cd6c[_0xa8b0('0x32')]);_0x3a610e[_0xa8b0('0x34')]=_[_0xa8b0('0x35')](_0x3a610e[_0xa8b0('0x36')],_0x3a610e[_0xa8b0('0x32')]);_0x3f4865['attributes']=_[_0xa8b0('0x35')](_0x3a610e[_0xa8b0('0x36')],qs[_0xa8b0('0x38')](_0x51cd6c[_0xa8b0('0x32')]['fields']));_0x3f4865[_0xa8b0('0x37')]=_0x3f4865[_0xa8b0('0x37')]['length']?_0x3f4865[_0xa8b0('0x37')]:_0x3a610e[_0xa8b0('0x36')];_0x3f4865[_0xa8b0('0x59')]=qs[_0xa8b0('0x3c')](_0x51cd6c[_0xa8b0('0x32')]['sort']);_0x3f4865[_0xa8b0('0x3f')]=qs['filters'](_[_0xa8b0('0x3d')](_0x51cd6c['query'],_0x3a610e[_0xa8b0('0x34')]));if(_0x51cd6c['query'][_0xa8b0('0x3e')]){_0x3f4865['where']=_[_0xa8b0('0x41')](_0x3f4865[_0xa8b0('0x3f')],{'$or':_[_0xa8b0('0x31')](_0x3f4865[_0xa8b0('0x37')],function(_0x58adfb){var _0x2abd0a={};_0x2abd0a[_0x58adfb]={'$like':'%'+_0x51cd6c[_0xa8b0('0x32')][_0xa8b0('0x3e')]+'%'};return _0x2abd0a;})});}_0x3f4865=_[_0xa8b0('0x41')]({},_0x3f4865,_0x51cd6c[_0xa8b0('0x42')]);return _0x10d654[_0xa8b0('0xf9')](_0x3f4865);}})[_0xa8b0('0x22')](function(_0x470d82){if(_0x470d82){_0x3a9167=_0x470d82[_0xa8b0('0x39')];if(!_0x51cd6c[_0xa8b0('0x32')]['hasOwnProperty'](_0xa8b0('0x3a'))){_0x3f4865[_0xa8b0('0x3b')]=qs[_0xa8b0('0x3b')](_0x51cd6c['query']['limit']);_0x3f4865[_0xa8b0('0x1e')]=qs[_0xa8b0('0x1e')](_0x51cd6c[_0xa8b0('0x32')][_0xa8b0('0x1e')]);}return _0x10d654[_0xa8b0('0xf9')](_0x3f4865);}})[_0xa8b0('0x22')](function(_0x31d332){if(_0x31d332){return _0x31d332?{'count':_0x3a9167,'rows':_0x31d332}:null;}})[_0xa8b0('0x22')](respondWithResult(_0x3bc9c2,null))[_0xa8b0('0x50')](handleError(_0x3bc9c2,null));};exports[_0xa8b0('0x118')]=function(_0x481bd1,_0x57edee){var _0x25cca5=_0x481bd1[_0xa8b0('0x32')][_0xa8b0('0x119')]===_0xa8b0('0x11a')?_0xa8b0('0x11b'):'onlineForm';return db[_0xa8b0('0x2c')][_0xa8b0('0x4e')]({'attributes':['id',_0x25cca5],'where':{'id':_0x481bd1[_0xa8b0('0x52')]['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x57edee,null))['then'](function(_0x6af93c){if(_0x6af93c){var _0x169cfb=_0x6af93c[_0x25cca5];var _0x2b2ddb=_0x169cfb&&_0x169cfb[_0xa8b0('0x11c')]?_0x169cfb[_0xa8b0('0x11c')]:[];_0x57edee[_0xa8b0('0x29')]({'fromKey':_[_0xa8b0('0x72')](_0x169cfb[_0xa8b0('0x11d')])?undefined:_0x169cfb[_0xa8b0('0x11d')],'count':_0x2b2ddb[_0xa8b0('0x39')],'rows':_0x2b2ddb});}})[_0xa8b0('0x50')](handleError(_0x57edee,null));};exports[_0xa8b0('0x11e')]=function(_0x6306a6,_0x2b3096){var _0x4d9228={'raw':![],'where':{}};var _0x599f8d={};var _0x5335bb={'count':0x0,'rows':[]};return db[_0xa8b0('0x2c')]['findOne']({'where':{'id':_0x6306a6['params']['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x2b3096,null))['then'](function(_0x12a159){if(_0x12a159){_0x599f8d[_0xa8b0('0x36')]=_[_0xa8b0('0x33')](db[_0xa8b0('0xc8')]['rawAttributes']);_0x599f8d[_0xa8b0('0x32')]=_[_0xa8b0('0x33')](_0x6306a6[_0xa8b0('0x32')]);_0x599f8d['filters']=_['intersection'](_0x599f8d[_0xa8b0('0x36')],_0x599f8d['query']);_0x4d9228['attributes']=_['intersection'](_0x599f8d['model'],qs[_0xa8b0('0x38')](_0x6306a6[_0xa8b0('0x32')][_0xa8b0('0x38')]));_0x4d9228[_0xa8b0('0x37')]=_0x4d9228[_0xa8b0('0x37')][_0xa8b0('0x39')]?_0x4d9228['attributes']:_0x599f8d[_0xa8b0('0x36')];if(!_0x6306a6['query']['hasOwnProperty'](_0xa8b0('0x3a'))){_0x4d9228['limit']=qs['limit'](_0x6306a6[_0xa8b0('0x32')][_0xa8b0('0x3b')]);_0x4d9228['offset']=qs[_0xa8b0('0x1e')](_0x6306a6[_0xa8b0('0x32')][_0xa8b0('0x1e')]);}_0x4d9228[_0xa8b0('0x59')]=qs[_0xa8b0('0x3c')](_0x6306a6[_0xa8b0('0x32')][_0xa8b0('0x3c')]);_0x4d9228[_0xa8b0('0x3f')]=qs['filters'](_[_0xa8b0('0x3d')](_0x6306a6[_0xa8b0('0x32')],_0x599f8d[_0xa8b0('0x34')]));_0x4d9228['where'][_0xa8b0('0x55')]=_0x12a159['id'];if(_0x6306a6[_0xa8b0('0x32')][_0xa8b0('0x3e')]){_0x4d9228[_0xa8b0('0x3f')]=_[_0xa8b0('0x41')](_0x4d9228[_0xa8b0('0x3f')],{'$or':_[_0xa8b0('0x31')](_0x4d9228[_0xa8b0('0x37')],function(_0x17a587){var _0x59a09c={};_0x59a09c[_0x17a587]={'$like':'%'+_0x6306a6[_0xa8b0('0x32')][_0xa8b0('0x3e')]+'%'};return _0x59a09c;})});}_0x4d9228=_[_0xa8b0('0x41')]({},_0x4d9228,_0x6306a6[_0xa8b0('0x42')]);return db[_0xa8b0('0xc8')][_0xa8b0('0x20')]({'where':_0x4d9228[_0xa8b0('0x3f')]})[_0xa8b0('0x22')](function(_0x29a9f7){_0x5335bb[_0xa8b0('0x20')]=_0x29a9f7;if(_0x6306a6['query'][_0xa8b0('0x43')]){_0x4d9228[_0xa8b0('0x44')]=[{'all':!![]}];}else{_0x4d9228['include']=[{'model':db['CmContact'],'as':_0xa8b0('0xe8'),'required':![]},{'model':db[_0xa8b0('0xd2')],'as':_0xa8b0('0x11f'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x4d9228);})['then'](function(_0x1df89d){_0x5335bb['rows']=_0x1df89d;return _0x5335bb;});}})[_0xa8b0('0x22')](respondWithFilteredResult(_0x2b3096,_0x4d9228))[_0xa8b0('0x50')](handleError(_0x2b3096,null));};exports[_0xa8b0('0x120')]=function(_0x131379,_0x9e5c8f){return db[_0xa8b0('0x2c')]['find']({'where':{'id':_0x131379[_0xa8b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x9e5c8f,null))['then'](function(_0x3b43fc){if(_0x3b43fc){return _0x3b43fc['addAgents'](_0x131379['body']['ids'],_[_0xa8b0('0x116')](_0x131379[_0xa8b0('0x49')],['ids','id'])||{})[_0xa8b0('0xa8')](function(_0x498fa1){for(var _0x727ee7=0x0;_0x727ee7<_0x131379['body'][_0xa8b0('0x5e')]['length'];_0x727ee7+=0x1){socket[_0xa8b0('0x121')](_0xa8b0('0x122'),{'UserId':Number(_0x131379[_0xa8b0('0x49')][_0xa8b0('0x5e')][_0x727ee7]),'ChatWebsiteId':Number(_0x131379[_0xa8b0('0x52')]['id'])});}return _0x498fa1;});}})[_0xa8b0('0x22')](respondWithResult(_0x9e5c8f,null))[_0xa8b0('0x50')](handleError(_0x9e5c8f,null));};exports[_0xa8b0('0x123')]=function(_0x190ca6,_0x5da136){return db[_0xa8b0('0x2c')]['find']({'where':{'id':_0x190ca6['params']['id']}})[_0xa8b0('0x22')](handleEntityNotFound(_0x5da136,null))[_0xa8b0('0x22')](function(_0x1b4f7a){if(_0x1b4f7a){return _0x1b4f7a[_0xa8b0('0x123')](_0x190ca6[_0xa8b0('0x32')][_0xa8b0('0x5e')])['then'](function(){if(_[_0xa8b0('0x124')](_0x190ca6['query'][_0xa8b0('0x5e')])){for(var _0x446183=0x0;_0x446183<_0x190ca6[_0xa8b0('0x32')]['ids'][_0xa8b0('0x39')];_0x446183+=0x1){socket[_0xa8b0('0x121')](_0xa8b0('0x125'),{'UserId':Number(_0x190ca6[_0xa8b0('0x32')][_0xa8b0('0x5e')][_0x446183]),'ChatWebsiteId':Number(_0x190ca6[_0xa8b0('0x52')]['id'])});}}else{socket[_0xa8b0('0x121')]('userChatWebsite:remove',{'UserId':Number(_0x190ca6['query'][_0xa8b0('0x5e')]),'ChatWebsiteId':Number(_0x190ca6[_0xa8b0('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x5da136,null))[_0xa8b0('0x50')](handleError(_0x5da136,null));};exports[_0xa8b0('0x126')]=function(_0x5e76b5,_0x549d97){var _0x541c7f={};var _0x718332={};var _0x64e82b;var _0x7f5526;return db[_0xa8b0('0x2c')][_0xa8b0('0x57')]({'where':{'id':_0x5e76b5[_0xa8b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x549d97,null))[_0xa8b0('0x22')](function(_0x4d5d18){if(_0x4d5d18){_0x64e82b=_0x4d5d18;_0x718332[_0xa8b0('0x36')]=_[_0xa8b0('0x33')](db['User'][_0xa8b0('0x2d')]);_0x718332[_0xa8b0('0x32')]=_['keys'](_0x5e76b5[_0xa8b0('0x32')]);_0x718332['filters']=_['intersection'](_0x718332[_0xa8b0('0x36')],_0x718332[_0xa8b0('0x32')]);_0x541c7f[_0xa8b0('0x37')]=_['intersection'](_0x718332[_0xa8b0('0x36')],qs[_0xa8b0('0x38')](_0x5e76b5[_0xa8b0('0x32')][_0xa8b0('0x38')]));_0x541c7f[_0xa8b0('0x37')]=_0x541c7f[_0xa8b0('0x37')][_0xa8b0('0x39')]?_0x541c7f[_0xa8b0('0x37')]:_0x718332[_0xa8b0('0x36')];_0x541c7f[_0xa8b0('0x59')]=qs[_0xa8b0('0x3c')](_0x5e76b5[_0xa8b0('0x32')][_0xa8b0('0x3c')]);_0x541c7f[_0xa8b0('0x3f')]=qs[_0xa8b0('0x34')](_['pick'](_0x5e76b5['query'],_0x718332[_0xa8b0('0x34')]));if(_0x5e76b5[_0xa8b0('0x32')]['filter']){_0x541c7f[_0xa8b0('0x3f')]=_[_0xa8b0('0x41')](_0x541c7f[_0xa8b0('0x3f')],{'$or':_['map'](_0x541c7f[_0xa8b0('0x37')],function(_0x1e2f69){var _0x544848={};_0x544848[_0x1e2f69]={'$like':'%'+_0x5e76b5['query'][_0xa8b0('0x3e')]+'%'};return _0x544848;})});}_0x541c7f=_[_0xa8b0('0x41')]({},_0x541c7f,_0x5e76b5[_0xa8b0('0x42')]);return _0x64e82b[_0xa8b0('0x126')](_0x541c7f);}})[_0xa8b0('0x22')](function(_0x221c1f){if(_0x221c1f){_0x7f5526=_0x221c1f[_0xa8b0('0x39')];if(!_0x5e76b5[_0xa8b0('0x32')]['hasOwnProperty'](_0xa8b0('0x3a'))){_0x541c7f['limit']=qs[_0xa8b0('0x3b')](_0x5e76b5[_0xa8b0('0x32')][_0xa8b0('0x3b')]);_0x541c7f[_0xa8b0('0x1e')]=qs[_0xa8b0('0x1e')](_0x5e76b5['query']['offset']);}return _0x64e82b[_0xa8b0('0x126')](_0x541c7f);}})['then'](function(_0x5c26a7){if(_0x5c26a7){return _0x5c26a7?{'count':_0x7f5526,'rows':_0x5c26a7}:null;}})['then'](respondWithResult(_0x549d97,null))[_0xa8b0('0x50')](handleError(_0x549d97,null));};
\ No newline at end of file
+var _0xa70f=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Applications','account','applications','list','orderBy','asc','Contacts','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','externalUrl','interaction','ChatInteraction','spread','messageId','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','waitForTheAssignedAgent','Start','startRouting','EventManager','notify','offline','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','offlineMessageSubject','toPairsIn','mapValues','subjectOffline','email','Chat','MailAccountId','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','URL','address','origin','3.1.0','remote','stringify','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','color_button','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','path','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url','../../mysqldb','defaults','redis','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','update','then','destroy','get','sendStatus','name','send','index','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','rows','show','Pause','mandatoryDispositionPause','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','findAll','removeDispositions','ids','getAnswers','findOne','CannedAnswer','nolimit','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','file','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from'];(function(_0x4b2d64,_0x202ded){var _0x16b037=function(_0x111fa2){while(--_0x111fa2){_0x4b2d64['push'](_0x4b2d64['shift']());}};_0x16b037(++_0x202ded);}(_0xa70f,0xa6));var _0xfa70=function(_0x1cddf6,_0x27b840){_0x1cddf6=_0x1cddf6-0x0;var _0x54ee23=_0xa70f[_0x1cddf6];return _0x54ee23;};'use strict';var BPromise=require(_0xfa70('0x0'));var Mustache=require(_0xfa70('0x1'));var util=require('util');var path=require(_0xfa70('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa70('0x3'));var _=require(_0xfa70('0x4'));var querystring=require('querystring');var Redis=require(_0xfa70('0x5'));var qs=require(_0xfa70('0x6'));var logger=require(_0xfa70('0x7'))('api');var config=require(_0xfa70('0x8'));var url=require(_0xfa70('0x9'));var db=require(_0xfa70('0xa'))['db'];config['redis']=_[_0xfa70('0xb')](config[_0xfa70('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfa70('0xc')]));require(_0xfa70('0xd'))[_0xfa70('0xe')](socket);var htmlToText=require(_0xfa70('0xf'));var jayson=require(_0xfa70('0x10'));var client=jayson[_0xfa70('0x11')][_0xfa70('0x12')]({'port':0x232c});var client9002=jayson[_0xfa70('0x11')][_0xfa70('0x12')]({'port':0x232a});var client9003=jayson['client'][_0xfa70('0x12')]({'port':0x232b});var client9001=jayson[_0xfa70('0x11')][_0xfa70('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x4bf1c8,_0x929163,_0x3f8f61,_0x430401){return new BPromise(function(_0x185029,_0x50bcb2){var _0x57a8dc=_0x430401||client;return _0x57a8dc['request'](_0x4bf1c8,_0x3f8f61)['then'](function(_0x58da67){logger[_0xfa70('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x929163,_0xfa70('0x14'));logger[_0xfa70('0x15')](_0xfa70('0x16'),_0x929163,_0xfa70('0x14'),JSON['stringify'](_0x58da67));if(_0x58da67[_0xfa70('0x17')]){if(_0x58da67['error'][_0xfa70('0x18')]===0x1f4){logger[_0xfa70('0x17')](_0xfa70('0x19'),_0x929163,_0x58da67['error'][_0xfa70('0x1a')]);return _0x50bcb2(_0x58da67[_0xfa70('0x17')]['message']);}logger[_0xfa70('0x17')](_0xfa70('0x19'),_0x929163,_0x58da67[_0xfa70('0x17')][_0xfa70('0x1a')]);return _0x185029(_0x58da67[_0xfa70('0x17')][_0xfa70('0x1a')]);}else{logger['info'](_0xfa70('0x19'),_0x929163,_0xfa70('0x14'));_0x185029(_0x58da67[_0xfa70('0x1b')][_0xfa70('0x1a')]);}})[_0xfa70('0x1c')](function(_0x3544ac){logger[_0xfa70('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x929163,_0x3544ac);_0x50bcb2(_0x3544ac);});});}function respondWithStatusCode(_0x2998ed,_0x3b4196){_0x3b4196=_0x3b4196||0xcc;return function(_0x58d56d){if(_0x58d56d){return _0x2998ed['sendStatus'](_0x3b4196);}return _0x2998ed[_0xfa70('0x1d')](_0x3b4196)[_0xfa70('0x1e')]();};}function respondWithResult(_0x2b56bc,_0x78c835){_0x78c835=_0x78c835||0xc8;return function(_0x46f8c1){if(_0x46f8c1){return _0x2b56bc[_0xfa70('0x1d')](_0x78c835)[_0xfa70('0x1f')](_0x46f8c1);}};}function respondWithFilteredResult(_0x19d1f5,_0x25307f){return function(_0x11ccac){if(_0x11ccac){var _0x46a54b=typeof _0x25307f[_0xfa70('0x20')]===_0xfa70('0x21')&&typeof _0x25307f[_0xfa70('0x22')]===_0xfa70('0x21');var _0x113ece=_0x11ccac[_0xfa70('0x23')];var _0x414f9a=_0x46a54b?0x0:_0x25307f[_0xfa70('0x20')];var _0x48b443=_0x46a54b?_0x11ccac[_0xfa70('0x23')]:_0x25307f[_0xfa70('0x20')]+_0x25307f[_0xfa70('0x22')];var _0x103fd2;if(_0x48b443>=_0x113ece){_0x48b443=_0x113ece;_0x103fd2=0xc8;}else{_0x103fd2=0xce;}_0x19d1f5['status'](_0x103fd2);return _0x19d1f5[_0xfa70('0x24')]('Content-Range',_0x414f9a+'-'+_0x48b443+'/'+_0x113ece)[_0xfa70('0x1f')](_0x11ccac);}return null;};}function saveUpdates(_0x13f95c){return function(_0x3c7eef){if(_0x3c7eef){return _0x3c7eef[_0xfa70('0x25')](_0x13f95c)[_0xfa70('0x26')](function(_0x37550e){return _0x37550e;});}return null;};}function removeEntity(_0x48cc89){return function(_0x59eeb6){if(_0x59eeb6){return _0x59eeb6[_0xfa70('0x27')]()[_0xfa70('0x26')](function(){var _0x202443=_0x59eeb6[_0xfa70('0x28')]({'plain':!![]});var _0x5beb2b='ChatWebsites';return db['UserProfileResource']['destroy']({'where':{'type':_0x5beb2b,'resourceId':_0x202443['id']}})[_0xfa70('0x26')](function(){return _0x59eeb6;});})[_0xfa70('0x26')](function(){_0x48cc89[_0xfa70('0x1d')](0xcc)[_0xfa70('0x1e')]();});}};}function handleEntityNotFound(_0x5d9a72){return function(_0x3286d3){if(!_0x3286d3){_0x5d9a72[_0xfa70('0x29')](0x194);}return _0x3286d3;};}function handleError(_0x288ebc,_0x4b03f3){_0x4b03f3=_0x4b03f3||0x1f4;return function(_0x950669){logger[_0xfa70('0x17')](_0x950669['stack']);if(_0x950669[_0xfa70('0x2a')]){delete _0x950669[_0xfa70('0x2a')];}_0x288ebc[_0xfa70('0x1d')](_0x4b03f3)[_0xfa70('0x2b')](_0x950669);};}exports[_0xfa70('0x2c')]=function(_0x2fb66f,_0x536d5f){var _0x50d89e={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5387f3={},_0x112306={'count':0x0,'rows':[]};var _0x19d3d7=_[_0xfa70('0x2d')](db[_0xfa70('0x2e')][_0xfa70('0x2f')],function(_0x964668){return{'name':_0x964668[_0xfa70('0x30')],'type':_0x964668['type'][_0xfa70('0x31')]};});_0x5387f3[_0xfa70('0x32')]=_[_0xfa70('0x2d')](_0x19d3d7,_0xfa70('0x2a'));_0x5387f3[_0xfa70('0x33')]=_[_0xfa70('0x34')](_0x2fb66f[_0xfa70('0x33')]);_0x5387f3['filters']=_[_0xfa70('0x35')](_0x5387f3[_0xfa70('0x32')],_0x5387f3[_0xfa70('0x33')]);_0x50d89e['attributes']=_[_0xfa70('0x35')](_0x5387f3[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x36')]));_0x50d89e[_0xfa70('0x37')]=_0x50d89e[_0xfa70('0x37')][_0xfa70('0x38')]?_0x50d89e[_0xfa70('0x37')]:_0x5387f3[_0xfa70('0x32')];if(!_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x39')]('nolimit')){_0x50d89e[_0xfa70('0x22')]=qs['limit'](_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x22')]);_0x50d89e[_0xfa70('0x20')]=qs['offset'](_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x20')]);}_0x50d89e[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x2fb66f[_0xfa70('0x33')]['sort']);_0x50d89e[_0xfa70('0x3c')]=qs['filters'](_[_0xfa70('0x3d')](_0x2fb66f[_0xfa70('0x33')],_0x5387f3[_0xfa70('0x3e')]),_0x19d3d7);if(_0x2fb66f[_0xfa70('0x33')][_0xfa70('0x3f')]){_0x50d89e[_0xfa70('0x3c')]=_[_0xfa70('0x40')](_0x50d89e[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x19d3d7,function(_0x481293){if(_0x481293['type']!==_0xfa70('0x41')){var _0x5dea56={};_0x5dea56[_0x481293['name']]={'$like':'%'+_0x2fb66f['query'][_0xfa70('0x3f')]+'%'};return _0x5dea56;}})});}_0x50d89e=_['merge']({},_0x50d89e,_0x2fb66f[_0xfa70('0x42')]);var _0x88ae20={'where':_0x50d89e[_0xfa70('0x3c')]};return db[_0xfa70('0x2e')][_0xfa70('0x23')](_0x88ae20)[_0xfa70('0x26')](function(_0x4de4fa){_0x112306[_0xfa70('0x23')]=_0x4de4fa;if(_0x2fb66f[_0xfa70('0x33')]['includeAll']){_0x50d89e[_0xfa70('0x43')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x50d89e);})[_0xfa70('0x26')](function(_0x14392a){_0x112306[_0xfa70('0x44')]=_0x14392a;return _0x112306;})[_0xfa70('0x26')](respondWithFilteredResult(_0x536d5f,_0x50d89e))[_0xfa70('0x1c')](handleError(_0x536d5f,null));};exports[_0xfa70('0x45')]=function(_0xd533a9,_0x27ff75){var _0x2a88d0={'raw':![],'where':{'id':_0xd533a9['params']['id']},'include':[{'model':db[_0xfa70('0x46')],'as':_0xfa70('0x47')}]},_0x325e1b={};_0x325e1b[_0xfa70('0x32')]=_[_0xfa70('0x34')](db['ChatWebsite'][_0xfa70('0x2f')]);_0x325e1b['query']=_[_0xfa70('0x34')](_0xd533a9['query']);_0x325e1b[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x325e1b[_0xfa70('0x32')],_0x325e1b[_0xfa70('0x33')]);_0x2a88d0[_0xfa70('0x37')]=_['intersection'](_0x325e1b['model'],qs[_0xfa70('0x36')](_0xd533a9['query'][_0xfa70('0x36')]));_0x2a88d0[_0xfa70('0x37')]=_0x2a88d0['attributes'][_0xfa70('0x38')]?_0x2a88d0[_0xfa70('0x37')]:_0x325e1b[_0xfa70('0x32')];if(_0xd533a9[_0xfa70('0x33')][_0xfa70('0x48')]){_0x2a88d0[_0xfa70('0x43')]=[{'all':!![]}];}_0x2a88d0=_[_0xfa70('0x40')]({},_0x2a88d0,_0xd533a9[_0xfa70('0x42')]);return db[_0xfa70('0x2e')][_0xfa70('0x49')](_0x2a88d0)[_0xfa70('0x26')](handleEntityNotFound(_0x27ff75,null))[_0xfa70('0x26')](respondWithResult(_0x27ff75,null))[_0xfa70('0x1c')](handleError(_0x27ff75,null));};exports['create']=function(_0x3ec32b,_0x58ca02){return db[_0xfa70('0x2e')][_0xfa70('0x4a')](_0x3ec32b[_0xfa70('0x4b')],{})['then'](function(_0x215627){var _0x1ce21e=_0x3ec32b[_0xfa70('0x4c')]['get']({'plain':!![]});if(!_0x1ce21e)throw new Error(_0xfa70('0x4d'));if(_0x1ce21e[_0xfa70('0x4e')]===_0xfa70('0x4c')){var _0x15765f=_0x215627[_0xfa70('0x28')]({'plain':!![]});var _0x18a8e1=_0xfa70('0x4f');return db[_0xfa70('0x50')][_0xfa70('0x49')]({'where':{'name':_0x18a8e1,'userProfileId':_0x1ce21e[_0xfa70('0x51')]},'raw':!![]})[_0xfa70('0x26')](function(_0x4b9a84){if(_0x4b9a84&&_0x4b9a84['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x15765f[_0xfa70('0x2a')],'resourceId':_0x15765f['id'],'type':_0x4b9a84['name'],'sectionId':_0x4b9a84['id']},{})['then'](function(){return _0x215627;});}else{return _0x215627;}})[_0xfa70('0x1c')](function(_0x117e19){logger[_0xfa70('0x17')](_0xfa70('0x52'),_0x117e19);throw _0x117e19;});}return _0x215627;})[_0xfa70('0x26')](respondWithResult(_0x58ca02,0xc9))[_0xfa70('0x1c')](handleError(_0x58ca02,null));};exports[_0xfa70('0x25')]=function(_0xc0ccee,_0x969ed1){if(_0xc0ccee['body']['id']){delete _0xc0ccee[_0xfa70('0x4b')]['id'];}return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0xc0ccee['params']['id']},'include':[{'model':db[_0xfa70('0x46')],'as':'mandatoryDispositionPause'}]})[_0xfa70('0x26')](handleEntityNotFound(_0x969ed1,null))['then'](saveUpdates(_0xc0ccee[_0xfa70('0x4b')],null))['then'](respondWithResult(_0x969ed1,null))['catch'](handleError(_0x969ed1,null));};exports[_0xfa70('0x27')]=function(_0x3dfc85,_0x1848d8){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x3dfc85[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x1848d8,null))[_0xfa70('0x26')](removeEntity(_0x1848d8,null))[_0xfa70('0x1c')](handleError(_0x1848d8,null));};exports[_0xfa70('0x54')]=function(_0x182f58,_0x796bf9){return db[_0xfa70('0x2e')]['describe']()[_0xfa70('0x26')](respondWithResult(_0x796bf9,null))[_0xfa70('0x1c')](handleError(_0x796bf9,null));};exports[_0xfa70('0x55')]=function(_0x44308e,_0xa8a502){if(_0x44308e[_0xfa70('0x4b')]['id']){delete _0x44308e['body']['id'];}return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x44308e['params']['id']}})['then'](handleEntityNotFound(_0xa8a502,null))[_0xfa70('0x26')](function(_0x5f35e7){if(_0x5f35e7){_0x44308e['body'][_0xfa70('0x56')]=_0x5f35e7['id'];return db['Disposition'][_0xfa70('0x4a')](_0x44308e[_0xfa70('0x4b')]);}})[_0xfa70('0x26')](respondWithResult(_0xa8a502,null))['catch'](handleError(_0xa8a502,null));};exports[_0xfa70('0x57')]=function(_0x2854c0,_0x5ba27e){var _0x315713={'raw':![],'where':{}};var _0x256f1d={};var _0x51dc0e={'count':0x0,'rows':[]};return db[_0xfa70('0x2e')]['findOne']({'where':{'id':_0x2854c0[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5ba27e,null))[_0xfa70('0x26')](function(_0x2c9a66){if(_0x2c9a66){_0x256f1d[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0x58')][_0xfa70('0x2f')]);_0x256f1d[_0xfa70('0x33')]=_[_0xfa70('0x34')](_0x2854c0['query']);_0x256f1d[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x256f1d[_0xfa70('0x32')],_0x256f1d[_0xfa70('0x33')]);_0x315713[_0xfa70('0x37')]=_['intersection'](_0x256f1d[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x2854c0[_0xfa70('0x33')][_0xfa70('0x36')]));_0x315713[_0xfa70('0x37')]=_0x315713['attributes'][_0xfa70('0x38')]?_0x315713[_0xfa70('0x37')]:_0x256f1d[_0xfa70('0x32')];if(!_0x2854c0['query'][_0xfa70('0x39')]('nolimit')){_0x315713['limit']=qs[_0xfa70('0x22')](_0x2854c0[_0xfa70('0x33')][_0xfa70('0x22')]);_0x315713['offset']=qs[_0xfa70('0x20')](_0x2854c0[_0xfa70('0x33')]['offset']);}_0x315713[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x2854c0[_0xfa70('0x33')]['sort']);_0x315713[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_['pick'](_0x2854c0['query'],_0x256f1d['filters']));_0x315713['where']['ChatWebsiteId']=_0x2c9a66['id'];if(_0x2854c0[_0xfa70('0x33')]['filter']){_0x315713[_0xfa70('0x3c')]=_['merge'](_0x315713[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x315713[_0xfa70('0x37')],function(_0x51711e){var _0x1e2164={};_0x1e2164[_0x51711e]={'$like':'%'+_0x2854c0[_0xfa70('0x33')]['filter']+'%'};return _0x1e2164;})});}_0x315713=_[_0xfa70('0x40')]({},_0x315713,_0x2854c0[_0xfa70('0x42')]);return db['Disposition'][_0xfa70('0x23')]({'where':_0x315713['where']})[_0xfa70('0x26')](function(_0x2042e4){_0x51dc0e[_0xfa70('0x23')]=_0x2042e4;if(_0x2854c0[_0xfa70('0x33')][_0xfa70('0x48')]){_0x315713['include']=[{'all':!![]}];}return db[_0xfa70('0x58')][_0xfa70('0x59')](_0x315713);})[_0xfa70('0x26')](function(_0x2cdfb5){_0x51dc0e[_0xfa70('0x44')]=_0x2cdfb5;return _0x51dc0e;});}})[_0xfa70('0x26')](respondWithFilteredResult(_0x5ba27e,_0x315713))['catch'](handleError(_0x5ba27e,null));};exports['removeDispositions']=function(_0x5d7620,_0x4f78b6){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x5d7620[_0xfa70('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f78b6,null))[_0xfa70('0x26')](function(_0x125082){if(_0x125082){return _0x125082[_0xfa70('0x5a')](_0x5d7620[_0xfa70('0x33')][_0xfa70('0x5b')]);}})[_0xfa70('0x26')](respondWithStatusCode(_0x4f78b6,null))[_0xfa70('0x1c')](handleError(_0x4f78b6,null));};exports['addAnswer']=function(_0x4f98b7,_0x40b4b6){if(_0x4f98b7['body']['id']){delete _0x4f98b7[_0xfa70('0x4b')]['id'];}return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x4f98b7[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x40b4b6,null))[_0xfa70('0x26')](function(_0x596d1b){if(_0x596d1b){_0x4f98b7[_0xfa70('0x4b')][_0xfa70('0x56')]=_0x596d1b['id'];return db['CannedAnswer'][_0xfa70('0x4a')](_0x4f98b7['body']);}})[_0xfa70('0x26')](respondWithResult(_0x40b4b6,null))[_0xfa70('0x1c')](handleError(_0x40b4b6,null));};exports[_0xfa70('0x5c')]=function(_0x49dca1,_0x3619c5){var _0x483e67={'raw':![],'where':{}};var _0x4bb3f1={};var _0x3732d5={'count':0x0,'rows':[]};return db[_0xfa70('0x2e')][_0xfa70('0x5d')]({'where':{'id':_0x49dca1[_0xfa70('0x53')]['id']}})['then'](handleEntityNotFound(_0x3619c5,null))[_0xfa70('0x26')](function(_0x45bd75){if(_0x45bd75){_0x4bb3f1[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0x5e')]['rawAttributes']);_0x4bb3f1[_0xfa70('0x33')]=_['keys'](_0x49dca1[_0xfa70('0x33')]);_0x4bb3f1[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x4bb3f1[_0xfa70('0x32')],_0x4bb3f1[_0xfa70('0x33')]);_0x483e67['attributes']=_[_0xfa70('0x35')](_0x4bb3f1['model'],qs[_0xfa70('0x36')](_0x49dca1[_0xfa70('0x33')][_0xfa70('0x36')]));_0x483e67[_0xfa70('0x37')]=_0x483e67[_0xfa70('0x37')][_0xfa70('0x38')]?_0x483e67[_0xfa70('0x37')]:_0x4bb3f1[_0xfa70('0x32')];if(!_0x49dca1['query']['hasOwnProperty'](_0xfa70('0x5f'))){_0x483e67[_0xfa70('0x22')]=qs[_0xfa70('0x22')](_0x49dca1[_0xfa70('0x33')][_0xfa70('0x22')]);_0x483e67['offset']=qs[_0xfa70('0x20')](_0x49dca1['query'][_0xfa70('0x20')]);}_0x483e67[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x49dca1[_0xfa70('0x33')]['sort']);_0x483e67['where']=qs[_0xfa70('0x3e')](_[_0xfa70('0x3d')](_0x49dca1[_0xfa70('0x33')],_0x4bb3f1['filters']));_0x483e67[_0xfa70('0x3c')][_0xfa70('0x56')]=_0x45bd75['id'];if(_0x49dca1[_0xfa70('0x33')][_0xfa70('0x3f')]){_0x483e67[_0xfa70('0x3c')]=_[_0xfa70('0x40')](_0x483e67[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x483e67[_0xfa70('0x37')],function(_0x47f56d){var _0x5d3361={};_0x5d3361[_0x47f56d]={'$like':'%'+_0x49dca1[_0xfa70('0x33')]['filter']+'%'};return _0x5d3361;})});}_0x483e67=_[_0xfa70('0x40')]({},_0x483e67,_0x49dca1[_0xfa70('0x42')]);return db['CannedAnswer']['count']({'where':_0x483e67['where']})[_0xfa70('0x26')](function(_0x2e9e47){_0x3732d5[_0xfa70('0x23')]=_0x2e9e47;if(_0x49dca1[_0xfa70('0x33')][_0xfa70('0x48')]){_0x483e67[_0xfa70('0x43')]=[{'all':!![]}];}return db[_0xfa70('0x5e')][_0xfa70('0x59')](_0x483e67);})[_0xfa70('0x26')](function(_0x207b27){_0x3732d5[_0xfa70('0x44')]=_0x207b27;return _0x3732d5;});}})[_0xfa70('0x26')](respondWithFilteredResult(_0x3619c5,_0x483e67))[_0xfa70('0x1c')](handleError(_0x3619c5,null));};exports[_0xfa70('0x60')]=function(_0x5524e2,_0x46a48c){return db[_0xfa70('0x2e')]['find']({'where':{'id':_0x5524e2['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x46a48c,null))[_0xfa70('0x26')](function(_0x3b6b9a){if(_0x3b6b9a){return _0x3b6b9a[_0xfa70('0x60')](_0x5524e2[_0xfa70('0x33')][_0xfa70('0x5b')]);}})[_0xfa70('0x26')](respondWithStatusCode(_0x46a48c,null))[_0xfa70('0x1c')](handleError(_0x46a48c,null));};exports[_0xfa70('0x61')]=function(_0x4aa72b,_0x37b35f){_0x4aa72b[_0xfa70('0x4b')][_0xfa70('0x62')]=_0x4aa72b['file'][_0xfa70('0x63')];return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x4aa72b['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x37b35f,null))['then'](saveUpdates(_0x4aa72b[_0xfa70('0x4b')],null))[_0xfa70('0x26')](respondWithResult(_0x37b35f,null))[_0xfa70('0x1c')](handleError(_0x37b35f,null));};exports[_0xfa70('0x64')]=function(_0x16136d,_0x3625b9){_0x16136d[_0xfa70('0x4b')][_0xfa70('0x65')]=_0x16136d['file'][_0xfa70('0x63')];return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x16136d[_0xfa70('0x53')]['id']}})['then'](handleEntityNotFound(_0x3625b9,null))['then'](saveUpdates(_0x16136d['body'],null))[_0xfa70('0x26')](respondWithResult(_0x3625b9,null))[_0xfa70('0x1c')](handleError(_0x3625b9,null));};exports[_0xfa70('0x66')]=function(_0x4cadf0,_0x93a349){_0x4cadf0[_0xfa70('0x4b')][_0xfa70('0x67')]=_0x4cadf0[_0xfa70('0x68')][_0xfa70('0x63')];return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x4cadf0[_0xfa70('0x53')]['id']}})['then'](handleEntityNotFound(_0x93a349,null))['then'](saveUpdates(_0x4cadf0[_0xfa70('0x4b')],null))[_0xfa70('0x26')](respondWithResult(_0x93a349,null))['catch'](handleError(_0x93a349,null));};exports[_0xfa70('0x69')]=function(_0x2ff938,_0x2d3ef3){_0x2ff938['body']['systemAvatar']=_0x2ff938[_0xfa70('0x68')][_0xfa70('0x63')];return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x2ff938[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x2d3ef3,null))[_0xfa70('0x26')](saveUpdates(_0x2ff938[_0xfa70('0x4b')],null))[_0xfa70('0x26')](respondWithResult(_0x2d3ef3,null))['catch'](handleError(_0x2d3ef3,null));};exports['getLogo']=function(_0x237ce4,_0x497945){var _0x178143=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x6c'));var _0xdc557f={'where':{'id':_0x237ce4['params']['id']},'attributes':['id',_0xfa70('0x62')],'raw':!![]};var _0x468041=![];return require(_0xfa70('0x6d'))['getLicense']()[_0xfa70('0x26')](function(_0xb3567d){if(_0xb3567d){_0x468041=_0xb3567d[_0xfa70('0x6e')];}})[_0xfa70('0x26')](function(){return db[_0xfa70('0x2e')]['find'](_0xdc557f);})['then'](handleEntityNotFound(_0x497945,null))[_0xfa70('0x26')](function(_0x101d61){if(_0x101d61){if(!_['isNil'](_0x101d61['sitepic'])){if(fs[_0xfa70('0x6f')](path[_0xfa70('0x6a')](config['root'],_0xfa70('0x70'),_0x101d61[_0xfa70('0x62')]))&&_0x468041){_0x178143=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x70'),_0x101d61[_0xfa70('0x62')]);}}return _0x497945[_0xfa70('0x71')](_0x178143);}})[_0xfa70('0x1c')](handleError(_0x497945,null));};exports[_0xfa70('0x72')]=function(_0x394f15,_0x2c0c7c){var _0x2da734=path[_0xfa70('0x6a')](config['root'],_0xfa70('0x73'));var _0x4e146b={'where':{'id':_0x394f15[_0xfa70('0x53')]['id']},'attributes':['id',_0xfa70('0x65')],'raw':!![]};return db[_0xfa70('0x2e')][_0xfa70('0x49')](_0x4e146b)[_0xfa70('0x26')](handleEntityNotFound(_0x2c0c7c,null))[_0xfa70('0x26')](function(_0x701ef9){if(_0x701ef9){if(!_[_0xfa70('0x74')](_0x701ef9[_0xfa70('0x65')])){if(fs[_0xfa70('0x6f')](path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x75'),_0x701ef9['agentAvatar']))){_0x2da734=path[_0xfa70('0x6a')](config['root'],'server/files/images/avatars/',_0x701ef9[_0xfa70('0x65')]);}}return _0x2c0c7c['download'](_0x2da734);}})[_0xfa70('0x1c')](handleError(_0x2c0c7c,null));};exports[_0xfa70('0x76')]=function(_0x356342,_0x5ea107){var _0x59fcc4=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x77'));var _0x3123d7={'where':{'id':_0x356342[_0xfa70('0x53')]['id']},'attributes':['id',_0xfa70('0x67'),_0xfa70('0x78')],'raw':!![]};return db[_0xfa70('0x2e')][_0xfa70('0x49')](_0x3123d7)[_0xfa70('0x26')](handleEntityNotFound(_0x5ea107,null))[_0xfa70('0x26')](function(_0x3fc015){if(_0x3fc015){if(!_[_0xfa70('0x74')](_0x3fc015[_0xfa70('0x67')])){if(fs[_0xfa70('0x6f')](path['join'](config[_0xfa70('0x6b')],_0xfa70('0x75'),_0x3fc015[_0xfa70('0x67')]))&&_0x3fc015[_0xfa70('0x78')]){_0x59fcc4=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],'server/files/images/avatars/',_0x3fc015[_0xfa70('0x67')]);}}return _0x5ea107['download'](_0x59fcc4);}})['catch'](handleError(_0x5ea107,null));};exports[_0xfa70('0x79')]=function(_0x3a8477,_0x5f4f89){var _0x568a4b=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x7a'));var _0x580d3b={'where':{'id':_0x3a8477[_0xfa70('0x53')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xfa70('0x2e')][_0xfa70('0x49')](_0x580d3b)[_0xfa70('0x26')](handleEntityNotFound(_0x5f4f89,null))[_0xfa70('0x26')](function(_0x5403cd){if(_0x5403cd){if(!_[_0xfa70('0x74')](_0x5403cd[_0xfa70('0x7b')])){if(fs['existsSync'](path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0x75'),_0x5403cd[_0xfa70('0x7b')]))){_0x568a4b=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],'server/files/images/avatars/',_0x5403cd[_0xfa70('0x7b')]);}}return _0x5f4f89[_0xfa70('0x71')](_0x568a4b);}})[_0xfa70('0x1c')](handleError(_0x5f4f89,null));};exports['notify']=function(_0x4d1789,_0x475e49){var _0xb589=require(_0xfa70('0x7c'));var _0x58bd7b=new _0xb589();var _0x2faa7d=_0x58bd7b[_0xfa70('0x7d')](_0x4d1789[_0xfa70('0x7e')][_0xfa70('0x7f')])[_0xfa70('0x80')]();var _0x3f6c27={'body':_0x4d1789[_0xfa70('0x4b')],'channel':_0xfa70('0x81')};var _0x2872a4=[];var _0x75b8db=[];var _0x28c0fb={};var _0x510350=![];return db[_0xfa70('0x82')][_0xfa70('0x54')]()[_0xfa70('0x26')](function(_0x421a7a){if(!_0x421a7a){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0x85'));}_0x2872a4=_['difference'](_[_0xfa70('0x34')](_0x421a7a),[_0xfa70('0x86'),_0xfa70('0x87')]);_0x75b8db=_[_0xfa70('0x88')](_[_0xfa70('0x34')](_0x421a7a),[_0xfa70('0x86'),'updatedAt',_0xfa70('0x89'),_0xfa70('0x8a')]);if(_0x4d1789[_0xfa70('0x4b')]['id']){delete _0x4d1789['body']['id'];}if(_['isNil'](_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8b')])){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))]('from\x20is\x20mandatory');}if(_[_0xfa70('0x74')](_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x4b')])||_0x4d1789['body'][_0xfa70('0x4b')]===''){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0x8c'));}if(_[_0xfa70('0x74')](_0x4d1789['body'][_0xfa70('0x8d')])){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x75b8db);}if(!_[_0xfa70('0x8e')](_0x75b8db,_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8d')])){throw new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0x8f')+_0x75b8db);}_0x28c0fb[_0x4d1789[_0xfa70('0x4b')]['mapKey']]=_0x4d1789[_0xfa70('0x4b')]['from'];})[_0xfa70('0x26')](function(){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x4d1789['params']['id']},'include':[{'model':db[_0xfa70('0x90')],'as':_0xfa70('0x91'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x28c0fb,'limit':0x1,'order':[[_0xfa70('0x87'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xfa70('0x92')}]});})['then'](handleEntityNotFound(_0x475e49,null))[_0xfa70('0x26')](function(_0x326883){if(_0x326883&&_0x326883[_0xfa70('0x91')]){_0x3f6c27[_0xfa70('0x93')]=_0x326883;_0x3f6c27[_0xfa70('0x94')]=_0x326883['Applications'];_0x3f6c27[_0xfa70('0x95')]=_0x326883[_0xfa70('0x91')];_0x3f6c27[_0xfa70('0x94')]=_[_0xfa70('0x96')](_0x3f6c27[_0xfa70('0x94')],['priority'],[_0xfa70('0x97')]);if(_0x3f6c27['account'][_0xfa70('0x92')]){delete _0x3f6c27['account'][_0xfa70('0x92')];}if(_0x3f6c27[_0xfa70('0x93')]['List']&&_0x3f6c27[_0xfa70('0x93')][_0xfa70('0x91')][_0xfa70('0x98')][_0xfa70('0x38')]){return _0x3f6c27[_0xfa70('0x93')]['List'][_0xfa70('0x98')][0x0];}var _0x29e438=_[_0xfa70('0xb')](_0x4d1789[_0xfa70('0x4b')],{'firstName':_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8b')],'ListId':_0x326883['ListId']});_0x29e438[_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8d')]]=_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x8b')];return db[_0xfa70('0x82')][_0xfa70('0x4a')](_0x29e438,{'fields':_0x2872a4,'raw':!![]});}})[_0xfa70('0x26')](handleEntityNotFound(_0x475e49,null))[_0xfa70('0x26')](function(_0x590cd0){_0x3f6c27[_0xfa70('0x99')]=_0x590cd0;var _0x43c826=_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x9a')];if(_0x4d1789[_0xfa70('0x7e')][_0xfa70('0x9b')]){_0x43c826=_0x4d1789[_0xfa70('0x7e')][_0xfa70('0x9b')];}else if(_0x4d1789['headers']['x-forwarded-for']){_0x43c826=_[_0xfa70('0x9c')](_0x4d1789[_0xfa70('0x7e')][_0xfa70('0x9d')][_0xfa70('0x9e')](','));}if(_0x590cd0){var _0x27fcc6={'ContactId':_0x590cd0['id'],'ChatWebsiteId':_0x4d1789['params']['id'],'from':(_0x590cd0[_0xfa70('0x9f')]||'')+'\x20'+(_0x590cd0[_0xfa70('0xa0')]||''),'customerIp':_0x43c826,'customerPort':_0x4d1789[_0xfa70('0x7e')][_0xfa70('0xa1')]?_0x4d1789['headers'][_0xfa70('0xa1')]:null,'referer':_0x4d1789['body'][_0xfa70('0xa2')],'browserName':_0x2faa7d['browser']['name']&&_0x2faa7d[_0xfa70('0xa3')][_0xfa70('0xa4')]?util[_0xfa70('0xa5')](_0xfa70('0xa6'),_0x2faa7d[_0xfa70('0xa3')][_0xfa70('0x2a')],_0x2faa7d[_0xfa70('0xa3')][_0xfa70('0xa4')]):_0xfa70('0xa7'),'browserVersion':_0x2faa7d[_0xfa70('0xa3')][_0xfa70('0xa4')]||_0xfa70('0xa7'),'osName':util['format'](_0xfa70('0xa6'),_0x2faa7d['os'][_0xfa70('0x2a')],_0x2faa7d['os'][_0xfa70('0xa4')]),'osVersion':_0x2faa7d['os'][_0xfa70('0xa4')],'deviceModel':_0x2faa7d[_0xfa70('0xa8')]['model']&&_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xa9')]?util[_0xfa70('0xa5')](_0xfa70('0xaa'),_0x2faa7d['device']['model'],_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xa9')],_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xab')]):null,'deviceVendor':_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xa9')],'deviceType':_0x2faa7d[_0xfa70('0xa8')][_0xfa70('0xab')],'formData':JSON['stringify'](_0x4d1789[_0xfa70('0x4b')])};var _0x2ef4b1={'ChatWebsiteId':_0x4d1789[_0xfa70('0x53')]['id'],'closed':![]};if(_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xac')]){_0x2ef4b1[_0xfa70('0xac')]=_0x4d1789['body']['threadId'];return db['ChatInteraction'][_0xfa70('0x49')]({'where':_0x2ef4b1})[_0xfa70('0x26')](function(_0x5e33f2){if(_0x5e33f2){return[_0x5e33f2,![]];}_0x27fcc6[_0xfa70('0xac')]=_0x4d1789['body']['threadId'];_0x27fcc6[_0xfa70('0xad')]=_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xad')];return db['ChatInteraction'][_0xfa70('0x4a')](_0x27fcc6)[_0xfa70('0x26')](function(_0xc3c3b8){return[_0xc3c3b8,!![]];});});}_0x2ef4b1['ContactId']=_0x590cd0['id'];if(_0x4d1789['body'][_0xfa70('0xae')]&&_0x4d1789['body']['interaction']['id']){_0x2ef4b1['id']=_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xae')]['id'];return db[_0xfa70('0xaf')][_0xfa70('0x49')]({'where':_0x2ef4b1})[_0xfa70('0x26')](function(_0x9373f2){if(_0x9373f2){return[_0x9373f2,![]];}return db['ChatInteraction']['create'](_0x27fcc6)['then'](function(_0x2ad53a){return[_0x2ad53a,!![]];});});}return db[_0xfa70('0xaf')]['create'](_0x27fcc6)[_0xfa70('0x26')](function(_0xa94a88){return[_0xa94a88,!![]];});}})[_0xfa70('0xb0')](function(_0x4d15a0,_0x56c9cc){if(_0x4d15a0){_0x510350=_0x56c9cc;if(!_0x56c9cc){var _0x5bf7fd={'from':(_0x3f6c27[_0xfa70('0x99')]['firstName']||'')+'\x20'+(_0x3f6c27[_0xfa70('0x99')][_0xfa70('0xa0')]||'')};if(_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xac')]&&_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xb1')]&&_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xac')]!=_0x4d1789['body'][_0xfa70('0xb1')]){_0x5bf7fd[_0xfa70('0xac')]=_0x4d1789[_0xfa70('0x4b')]['messageId'];}return _0x4d15a0[_0xfa70('0x25')](_0x5bf7fd);}else{return _0x4d15a0;}}})[_0xfa70('0x26')](function(_0x3b80d6){_0x3f6c27[_0xfa70('0xae')]=_0x3b80d6[_0xfa70('0x28')]({'plain':!![]});_0x3f6c27[_0xfa70('0xae')][_0xfa70('0xb2')]=_0x510350;if(_0x3f6c27[_0xfa70('0xae')][_0xfa70('0xb2')]){if(_0x3f6c27[_0xfa70('0x93')]['autoclose']){_0x3f6c27[_0xfa70('0x94')][_0xfa70('0xb3')]({'id':0x0,'priority':_0x3f6c27['applications']['length']+0x1,'app':'close','appdata':_0xfa70('0xb4'),'interval':_0xfa70('0xb5')});}}return db[_0xfa70('0xb6')]['create']({'body':_0x4d1789[_0xfa70('0x4b')][_0xfa70('0x4b')],'ChatWebsiteId':_0x4d1789['params']['id'],'ChatInteractionId':_0x3b80d6['id'],'direction':'in','ContactId':_0x3f6c27['contact']['id'],'AttachmentId':_0x4d1789[_0xfa70('0x4b')][_0xfa70('0xb7')]});})[_0xfa70('0x26')](function(_0x470608){_0x3f6c27[_0xfa70('0x1a')]=_0x470608;if(_0x3f6c27[_0xfa70('0xae')][_0xfa70('0xb8')]){return db[_0xfa70('0xb9')][_0xfa70('0x49')]({'attributes':['id',_0xfa70('0x2a')],'where':{'id':_0x3f6c27[_0xfa70('0xae')]['UserId']}})[_0xfa70('0x26')](function(_0x455f7f){if(_0x455f7f){_0x3f6c27['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x455f7f[_0xfa70('0x2a')]+','+(_0x3f6c27[_0xfa70('0x93')][_0xfa70('0xba')]||0xa),'interval':_0xfa70('0xb5')});_0x3f6c27['forcedOwnership']=!![];}return respondWithRpcPromise(_0xfa70('0xbb'),_0xfa70('0xbc'),_0x3f6c27);});}return respondWithRpcPromise('Start',_0xfa70('0xbc'),_0x3f6c27);})['then'](function(_0x517a2a){respondWithRpcPromise(_0xfa70('0xbd'),_0xfa70('0xbd'),{'event':_0xfa70('0xbe'),'message':_0x517a2a},client9002);return _0x517a2a;})[_0xfa70('0x26')](respondWithResult(_0x475e49,null))[_0xfa70('0x1c')](handleError(_0x475e49,null));};exports[_0xfa70('0xbf')]=function(_0x3cb410,_0x4d85ae){var _0x1efda4,_0x124083,_0x1bf8f6;var _0x3333b2=[];var _0x1bef11={};var _0x3cfc60=_0x3cb410['files']||[];var _0x1e49d5=[];var _0x4bd01f;return db[_0xfa70('0x82')][_0xfa70('0x54')]()['then'](function(_0x267248){if(!_0x267248){throw new db['Sequelize'][(_0xfa70('0x84'))](_0xfa70('0x85'));}_0x3333b2=_[_0xfa70('0x88')](_[_0xfa70('0x34')](_0x267248),[_0xfa70('0x86'),_0xfa70('0x87'),'CompanyId','ListId']);if(_0x3cb410[_0xfa70('0x4b')]['id']){delete _0x3cb410['body']['id'];}if(_[_0xfa70('0x74')](_0x3cb410[_0xfa70('0x4b')]['from'])){throw _0x4d85ae[_0xfa70('0x1d')](0x1f4)[_0xfa70('0x2b')](new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0xc0')));}if(_[_0xfa70('0x74')](_0x3cb410[_0xfa70('0x4b')][_0xfa70('0x4b')])||_0x3cb410['body'][_0xfa70('0x4b')]===''){throw _0x4d85ae[_0xfa70('0x1d')](0x1f4)[_0xfa70('0x2b')](new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0x8c')));}if(_['isNil'](_0x3cb410[_0xfa70('0x4b')][_0xfa70('0xc1')])){throw _0x4d85ae[_0xfa70('0x1d')](0x1f4)['send'](new db['Sequelize'][(_0xfa70('0x84'))](_0xfa70('0xc2')+_0x3333b2));}if(!_[_0xfa70('0x8e')](_0x3333b2,_0x3cb410[_0xfa70('0x4b')][_0xfa70('0xc1')])){throw _0x4d85ae['status'](0x1f4)[_0xfa70('0x2b')](new db[(_0xfa70('0x83'))][(_0xfa70('0x84'))](_0xfa70('0xc3')+_0x3333b2));}_0x1bef11[_0x3cb410[_0xfa70('0x4b')][_0xfa70('0xc1')]]=_0x3cb410[_0xfa70('0x4b')][_0xfa70('0x8b')];})[_0xfa70('0x26')](function(){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0x3cb410[_0xfa70('0x53')]['id']},'include':[{'model':db[_0xfa70('0x90')],'as':_0xfa70('0x91')},{'model':db[_0xfa70('0xc4')],'as':_0xfa70('0xc4')}]});})['then'](handleEntityNotFound(_0x4d85ae,null))[_0xfa70('0x26')](function(_0x1def23){if(_0x1def23&&_0x1def23['List']){_0x124083=_0x1def23;var _0x3bb6c8=_[_0xfa70('0xb')](_0x3cb410[_0xfa70('0x4b')],{'firstName':_0x3cb410[_0xfa70('0x4b')][_0xfa70('0x8b')],'phone':_0x3cb410[_0xfa70('0x4b')]['from'],'ListId':_0x1def23[_0xfa70('0x8a')]});_0x3bb6c8[_0x3cb410[_0xfa70('0x4b')][_0xfa70('0xc1')]]=_0x3cb410[_0xfa70('0x4b')][_0xfa70('0x8b')];return db['CmContact'][_0xfa70('0xc5')]({'where':_0x1bef11,'defaults':_0x3bb6c8});}})[_0xfa70('0xb0')](function(_0x571e68){if(_0x571e68){_0x1bf8f6=_0x571e68;var _0x1d044c=fs[_0xfa70('0xc6')](path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0xc7')),_0xfa70('0xc8'));var _0x3028e8=ejs[_0xfa70('0xc9')](_0x1d044c,{'body':_[_0xfa70('0xca')](_0x3cb410['body']['body']),'bodyTitle':_0x124083[_0xfa70('0xcb')]});return db[_0xfa70('0xcc')][_0xfa70('0x4a')]({'body':_0x3028e8,'plainBody':htmlToText[_0xfa70('0xcd')](_0x3028e8),'ContactId':_0x571e68['id'],'ChatWebsiteId':_0x124083['id']});}})[_0xfa70('0x26')](function(_0x4dc5a5){_0x4bd01f=_0x4dc5a5;if(_0x3cfc60['length']){var _0x32bc77=_0x3cfc60['map'](function(_0x35354c){return{'name':_0x35354c[_0xfa70('0xce')],'basename':_0x35354c[_0xfa70('0x63')],'type':_0x35354c[_0xfa70('0xcf')],'ChatOfflineMessageId':_0x4dc5a5['id']};});_0x1e49d5=_0x32bc77[_0xfa70('0x2d')](_0x1703bc=>{var _0x2bc913={'filename':_0x1703bc[_0xfa70('0x2a')],'path':path[_0xfa70('0x6a')](config['root'],_0xfa70('0xd0'),_0xfa70('0xd1'),'attachments','offline-chat',_0x1703bc[_0xfa70('0xd2')])};return _0x2bc913;});if(!_0x124083[_0xfa70('0xd3')]){return db[_0xfa70('0xd4')][_0xfa70('0xd5')](function(_0x17aedd){return db['Attachment'][_0xfa70('0xd6')](_0x32bc77,{'transaction':_0x17aedd});});}}})[_0xfa70('0x26')](function(){if(_0x4bd01f){_0x1efda4=_0x4bd01f;return db[_0xfa70('0xc4')][_0xfa70('0x5d')]({'where':{'service':!![]},'include':[{'model':db[_0xfa70('0xd7')],'as':_0xfa70('0xd8'),'raw':!![],'include':[{'model':db[_0xfa70('0xd9')],'as':_0xfa70('0xd9'),'raw':!![]}]}]});}})[_0xfa70('0x26')](function(_0x165db6){if(_0x165db6&&_0x165db6[_0xfa70('0xd8')]&&_0x124083['forwardOffline']&&_0x124083['forwardOfflineAddress']){var _0x4bb0df=_0x165db6['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xfa70('0xda'),{'account':_0x4bb0df,'message':{'from':util[_0xfa70('0xa5')](_0xfa70('0xdb'),_0x165db6[_0xfa70('0x2a')],_0x165db6['email']||_0x165db6[_0xfa70('0xd8')][_0xfa70('0x4c')]),'to':_0x124083[_0xfa70('0xdc')],'subject':_0x124083[_0xfa70('0xdd')],'html':_0x1efda4[_0xfa70('0x4b')],'attachments':_0x1e49d5}},client9003)[_0xfa70('0x26')](function(){return _0x1efda4;})[_0xfa70('0x1c')](function(_0x1a62e6){logger['error'](_0x1a62e6);});}})[_0xfa70('0x26')](function(){if(_0x124083&&_0x124083['openNewInteraction']&&_0x124083['MailAccountId']){var _0x13cbdb=[];if(_0x3cfc60[_0xfa70('0x38')]){_0x13cbdb=_0x3cfc60['map'](function(_0x286ccf){return{'name':_0x286ccf[_0xfa70('0xce')],'basename':_0x286ccf[_0xfa70('0x63')],'type':_0x286ccf[_0xfa70('0xcf')],'ChatOfflineMessageId':_0x4bd01f['id']};});}var _0x290641;if(!_['isNil'](_0x124083['subjectOffline'])){var _0x36a04=_[_0xfa70('0x2d')](_0x3cb410['body'],function(_0x3fa3c1){return _0x3fa3c1;});var _0x24cad0=_[_0xfa70('0xde')](_0x36a04)[0x0];var _0x2f7306=_[_0xfa70('0xdf')](_0x24cad0,function(_0x26ff6f){return _0x26ff6f;});_0x290641=_0x2f7306[0x1][_0x124083[_0xfa70('0xe0')]];}var _0x11a8e9={'from':_0x1bf8f6[_0xfa70('0xe1')],'firstName':_0x1bf8f6[_0xfa70('0x9f')],'lastName':_0x1bf8f6[_0xfa70('0xa0')],'mapKey':_0xfa70('0xe1'),'message':{'from':_0x1bf8f6[_0xfa70('0xe1')],'to':_0x124083['MailAccount'][_0xfa70('0xe1')],'cc':'','subject':_[_0xfa70('0x74')](_0x290641)?_0x124083[_0xfa70('0xdd')]:_0x290641,'messageId':'','sentAt':new Date(),'attach':_0x13cbdb[_0xfa70('0x38')],'attachments':_0x13cbdb,'originChannel':_0xfa70('0xe2'),'ChatWebsiteId':_0x124083['id'],'ChatOfflineMessageId':_0x1efda4['id'],'originTo':_0x124083['MailAccount'][_0xfa70('0xe1')]},'body':_0x1efda4['body']};var _0x53e87d={'account':{'id':_0x124083[_0xfa70('0xe3')]},'body':_0x11a8e9,'log':_0xfa70('0xe4')};return respondWithRpcPromise(_0xfa70('0xe4'),_0xfa70('0xe5'),_0x53e87d,client9001)['then'](function(){return _0x1efda4;})[_0xfa70('0x1c')](function(_0x47078b){logger[_0xfa70('0x17')](_0x47078b);});}return;})[_0xfa70('0x26')](function(){if(_0x1efda4){return _0x1efda4;}})['then'](respondWithResult(_0x4d85ae,null))[_0xfa70('0x1c')](function(_0x314826){logger[_0xfa70('0x17')](_0xfa70('0x1c'),_0x314826);for(var _0x3558b1 of _0x3cfc60){var _0x3fd132=path[_0xfa70('0x6a')](config[_0xfa70('0x6b')],_0xfa70('0xd0'),_0xfa70('0xd1'),'attachments',_0xfa70('0xe6'),_0x3558b1[_0xfa70('0x63')]);fs_extra[_0xfa70('0xe7')](_0x3fd132)[_0xfa70('0x1c')](function(_0x19f0a5){logger[_0xfa70('0x17')](_0xfa70('0xe8'),_0x3fd132,_0x19f0a5);});}});};exports[_0xfa70('0xe9')]=function(_0x3ad0c5,_0x5a32f8){return db[_0xfa70('0xaf')]['find']({'where':{'id':_0x3ad0c5[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5a32f8,null))['then'](function(_0x479453){if(_0x479453){return _0x479453['addInteraction'](_0x3ad0c5[_0xfa70('0x4b')][_0xfa70('0x5b')],_[_0xfa70('0xea')](_0x3ad0c5[_0xfa70('0x4b')],[_0xfa70('0x5b'),'id'])||{});}})[_0xfa70('0x26')](respondWithResult(_0x5a32f8,null))[_0xfa70('0x1c')](handleError(_0x5a32f8,null));};exports[_0xfa70('0xeb')]=function(_0x507bc1,_0x5479a4){var _0x17b586={'raw':![],'where':{}};var _0x2f697c={};var _0x559225={'count':0x0,'rows':[]};return db[_0xfa70('0x2e')][_0xfa70('0x5d')]({'where':{'id':_0x507bc1[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5479a4,null))['then'](function(_0x1354a1){if(_0x1354a1){_0x2f697c[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0xaf')][_0xfa70('0x2f')]);_0x2f697c['query']=_[_0xfa70('0x34')](_0x507bc1[_0xfa70('0x33')]);_0x2f697c[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x2f697c[_0xfa70('0x32')],_0x2f697c[_0xfa70('0x33')]);_0x17b586[_0xfa70('0x37')]=_[_0xfa70('0x35')](_0x2f697c[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x507bc1[_0xfa70('0x33')]['fields']));_0x17b586[_0xfa70('0x37')]=_0x17b586[_0xfa70('0x37')][_0xfa70('0x38')]?_0x17b586['attributes']:_0x2f697c[_0xfa70('0x32')];if(!_0x507bc1[_0xfa70('0x33')][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x17b586['limit']=qs[_0xfa70('0x22')](_0x507bc1[_0xfa70('0x33')]['limit']);_0x17b586['offset']=qs['offset'](_0x507bc1['query'][_0xfa70('0x20')]);}_0x17b586[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x507bc1[_0xfa70('0x33')][_0xfa70('0x3b')]);_0x17b586[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_[_0xfa70('0x3d')](_0x507bc1[_0xfa70('0x33')],_0x2f697c[_0xfa70('0x3e')]));_0x17b586['where'][_0xfa70('0x56')]=_0x1354a1['id'];if(_0x507bc1[_0xfa70('0x33')][_0xfa70('0x3f')]){_0x17b586['where']=_['merge'](_0x17b586[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x17b586['attributes'],function(_0x594226){var _0x398cee={};_0x398cee[_0x594226]={'$like':'%'+_0x507bc1[_0xfa70('0x33')][_0xfa70('0x3f')]+'%'};return _0x398cee;})});}_0x17b586=_[_0xfa70('0x40')]({},_0x17b586,_0x507bc1[_0xfa70('0x42')]);return db[_0xfa70('0xaf')][_0xfa70('0x23')]({'where':_0x17b586[_0xfa70('0x3c')]})[_0xfa70('0x26')](function(_0x3ef1f1){_0x559225[_0xfa70('0x23')]=_0x3ef1f1;if(_0x507bc1['query'][_0xfa70('0x48')]){_0x17b586['include']=[{'model':db[_0xfa70('0x82')],'as':_0xfa70('0xec'),'required':![]},{'model':db[_0xfa70('0xb9')],'as':_0xfa70('0xed'),'attributes':['name',_0xfa70('0xee'),'internal'],'required':![]},{'model':db[_0xfa70('0xef')],'as':_0xfa70('0xf0'),'attributes':['id',_0xfa70('0x2a'),_0xfa70('0xf1')],'where':_0x507bc1[_0xfa70('0x33')][_0xfa70('0xf2')]?{'id':_0x507bc1['query'][_0xfa70('0xf2')]}:undefined,'required':_0x507bc1['query']['tag']?!![]:![]}];}return db[_0xfa70('0xaf')][_0xfa70('0x59')](_0x17b586);})[_0xfa70('0x26')](function(_0x303beb){_0x559225['rows']=_0x303beb;return _0x559225;});}})[_0xfa70('0x26')](respondWithFilteredResult(_0x5479a4,_0x17b586))[_0xfa70('0x1c')](handleError(_0x5479a4,null));};function iftimePromise(_0x9e9f99,_0x1d0e9d){return respondWithRpcPromise(_0xfa70('0xf3'),_0xfa70('0xf4'),{'command':_0x1d0e9d[_0xfa70('0xf5')]?util[_0xfa70('0xa5')](_0xfa70('0xf6'),_0x9e9f99[_0xfa70('0xf7')],_0x1d0e9d[_0xfa70('0xf5')]):util[_0xfa70('0xa5')]('iftime\x20%s',_0x9e9f99[_0xfa70('0xf7')])},client9002)[_0xfa70('0x26')](function(_0x2be633){var _0x4fbad2=_0x2be633&&_0x2be633[_0xfa70('0xf8')](_0xfa70('0xf9'))>=0x0?!![]:![];logger[_0xfa70('0x13')](_0xfa70('0xfa'),_0x1d0e9d['id'],_0x9e9f99['id'],_0x9e9f99[_0xfa70('0xf7')],_0x4fbad2?_0xfa70('0xfb'):_0xfa70('0xfc'),_0x1d0e9d[_0xfa70('0xf5')]?_0x1d0e9d[_0xfa70('0xf5')]:_0xfa70('0xfd'));return _0x4fbad2;})[_0xfa70('0x1c')](function(_0x546bc9){logger[_0xfa70('0x17')](_0xfa70('0xfa'),_0x1d0e9d['id'],_0x9e9f99['id'],_0x9e9f99['interval'],util['inspect'](_0x546bc9,{'showHidden':![],'depth':null}),_0x1d0e9d[_0xfa70('0xf5')]?_0x1d0e9d[_0xfa70('0xf5')]:_0xfa70('0xfd'));return![];});}exports[_0xfa70('0xf4')]=function(_0x5d040a,_0x8a6a34){var _0x527efc=0x0;var _0x358579=0x0;var _0xd1827f=![];var _0x15f198;var _0x368ba8;return db['ChatWebsite'][_0xfa70('0x49')]({'where':{'id':_0x5d040a['params']['id']},'include':[{'model':db[_0xfa70('0xfe')],'as':_0xfa70('0xfe'),'include':[{'model':db[_0xfa70('0xfe')],'as':_0xfa70('0xff'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xfa70('0x26')](handleEntityNotFound(_0x8a6a34,null))[_0xfa70('0x26')](function(_0x2ff5ba){if(_0x2ff5ba){_0x15f198=_0x2ff5ba;return _0x2ff5ba[_0xfa70('0x100')]({'raw':!![]});}})['then'](function(_0x47d246){if(_0x15f198){if(_0x47d246){_0x368ba8=_0x47d246;}}return require(_0xfa70('0x6d'))[_0xfa70('0x101')]();})[_0xfa70('0x26')](function(_0x317dca){if(_0x317dca){_0x358579=_0x317dca[_0xfa70('0x102')];_0xd1827f=_0x317dca[_0xfa70('0x6e')];}})[_0xfa70('0x26')](function(){return db[_0xfa70('0xaf')]['count']({'where':{'closed':![]}});})['then'](function(_0x23cae4){_0x527efc=_0x23cae4;if(_0x358579&&_0x23cae4>_0x358579){return db['License'][_0xfa70('0x5d')]({'where':{'id':0x1}})[_0xfa70('0x26')](function(_0x5afae7){if(_0x5afae7){_0x5afae7[_0xfa70('0x103')](_0xfa70('0x104'));}});}})['then'](function(){if(_0x15f198[_0xfa70('0xfe')]&&_0x15f198[_0xfa70('0xfe')]['Intervals']){var _0x31ff0f=[];for(var _0x37d4d2=0x0;_0x37d4d2<_0x15f198[_0xfa70('0xfe')]['Intervals'][_0xfa70('0x38')];_0x37d4d2++){var _0x1531f4=_0x15f198[_0xfa70('0xfe')][_0xfa70('0xff')][_0x37d4d2][_0xfa70('0x28')]({'plain':!![]});_0x31ff0f[_0xfa70('0xb3')](iftimePromise(_0x1531f4,_0x15f198));}return BPromise[_0xfa70('0x105')](_0x31ff0f)['then'](function(_0x2d97d9){return _[_0xfa70('0x106')](_0x2d97d9);});}else{return!![];}})['then'](function(_0x41cd40){var _0x2e436b=fs['readFileSync'](path[_0xfa70('0x6a')](config['root'],_0xfa70('0x107')),_0xfa70('0xc8'));var _0x92670e=new url[(_0xfa70('0x108'))](_0x15f198[_0xfa70('0x109')])[_0xfa70('0x10a')];var _0x16743c=_0xfa70('0x10b');var _0x6c439e=![];var _0x45cfc3={'chatVersion':_0x16743c,'chatWebsiteAddressOrigin':_0x92670e,'remote':_0x15f198[_0xfa70('0x10c')],'query':querystring[_0xfa70('0x10d')](_[_0xfa70('0x40')](_0x15f198[_0xfa70('0x28')]({'plain':!![]}),{'customerIp':_0x5d040a['headers'][_0xfa70('0x9d')]||_0x5d040a[_0xfa70('0x7e')][_0xfa70('0x10e')]||_0x5d040a[_0xfa70('0x10f')][_0xfa70('0x110')]||_0x5d040a['ip'],'referer':_0x5d040a[_0xfa70('0x7e')][_0xfa70('0xa2')],'openedInteractions':_0x527efc,'maxInteractions':_0x358579,'virtual':_0xd1827f[_0xfa70('0x102')],'online':_0x41cd40,'custom':_0xd1827f}))['replace'](/'/g,'\x5c\x27')};_0x8a6a34[_0xfa70('0x2b')](ejs[_0xfa70('0xc9')](Mustache[_0xfa70('0xc9')](_0x2e436b,_0x45cfc3),{'proactiveActions':_0x368ba8,'alignment':_0x15f198[_0xfa70('0x111')],'verticalAlignment':_0x15f198[_0xfa70('0x112')],'div_color':_0x15f198[_0xfa70('0xf1')],'labelText':_0x15f198[_0xfa70('0x113')],'text_color':_0x15f198[_0xfa70('0x114')],'text_button_color':_0x15f198['textButtonColor'],'button_color':_0x15f198[_0xfa70('0x115')],'background_color':_0x15f198['backgroundColor'],'hideWhenOffline':_0x15f198['hideWhenOffline'],'intervalId':_0x15f198[_0xfa70('0x116')],'isDevelopment':_0x6c439e,'chatVersion':_0x16743c}));})['catch'](handleError(_0x8a6a34,null));};exports[_0xfa70('0x117')]=function(_0x10b327,_0xf03ac0){var _0x1e64cd=_0x10b327[_0xfa70('0x53')]['id'];var _0x13abfb=_0x10b327[_0xfa70('0x4b')];var _0x44bf2e=0xc8;var _0x1a599d=null;return db[_0xfa70('0xd4')][_0xfa70('0xd5')]({'isolationLevel':db[_0xfa70('0xd4')][_0xfa70('0x118')][_0xfa70('0x119')][_0xfa70('0x11a')]},function(_0x1097cc){return db[_0xfa70('0x2e')]['findOne']({'where':{'id':_0x1e64cd},'transaction':_0x1097cc})[_0xfa70('0x26')](function(_0x33f475){if(_0x33f475){return db['ChatApplication'][_0xfa70('0x27')]({'where':{'ChatWebsiteId':_0x1e64cd},'transaction':_0x1097cc})[_0xfa70('0x26')](function(){var _0x3164d2=_[_0xfa70('0x2d')](_0x13abfb,function(_0x40a8b6){_0x40a8b6[_0xfa70('0x56')]=_0x1e64cd;return _0x40a8b6;});return db[_0xfa70('0x11b')][_0xfa70('0xd6')](_0x3164d2,{'transaction':_0x1097cc});});}else{_0x44bf2e=0x194;_0x1a599d=[];}});})[_0xfa70('0x26')](function(){if(_0x44bf2e!==0x194){return db[_0xfa70('0x11b')][_0xfa70('0x11c')]({'where':{'ChatWebsiteId':_0x1e64cd},'order':_0xfa70('0x11d')})[_0xfa70('0x26')](function(_0x1d5405){_0x1a599d=_0x1d5405;});}})[_0xfa70('0x1c')](function(_0x4f48c5){_0x44bf2e=0x1f4;logger[_0xfa70('0x17')](_0x4f48c5['stack']);if(_0x4f48c5[_0xfa70('0x2a')]){delete _0x4f48c5[_0xfa70('0x2a')];}_0x1a599d=_0x4f48c5;})[_0xfa70('0x11e')](function(){if(_0x1a599d===null){_0xf03ac0[_0xfa70('0x29')](_0x44bf2e);}else{if(_0x44bf2e===0x1f4){_0xf03ac0[_0xfa70('0x1d')](_0x44bf2e)[_0xfa70('0x2b')](_0x1a599d);}else{_0xf03ac0['status'](_0x44bf2e)[_0xfa70('0x1f')](_0x1a599d);}}});};exports[_0xfa70('0x11f')]=function(_0x3516ca,_0x2be032){var _0x374801={};var _0x5a39c9={};var _0x24b58c;var _0x23dce1;return db[_0xfa70('0x2e')]['findOne']({'where':{'id':_0x3516ca[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x2be032,null))[_0xfa70('0x26')](function(_0x266c0b){if(_0x266c0b){_0x24b58c=_0x266c0b;_0x5a39c9[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0x11b')][_0xfa70('0x2f')]);_0x5a39c9[_0xfa70('0x33')]=_['keys'](_0x3516ca['query']);_0x5a39c9[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x5a39c9['model'],_0x5a39c9[_0xfa70('0x33')]);_0x374801[_0xfa70('0x37')]=_[_0xfa70('0x35')](_0x5a39c9[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x3516ca['query'][_0xfa70('0x36')]));_0x374801[_0xfa70('0x37')]=_0x374801[_0xfa70('0x37')]['length']?_0x374801['attributes']:_0x5a39c9['model'];_0x374801[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x3516ca[_0xfa70('0x33')]['sort']);_0x374801[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_[_0xfa70('0x3d')](_0x3516ca[_0xfa70('0x33')],_0x5a39c9[_0xfa70('0x3e')]));if(_0x3516ca[_0xfa70('0x33')][_0xfa70('0x3f')]){_0x374801[_0xfa70('0x3c')]=_[_0xfa70('0x40')](_0x374801[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x374801[_0xfa70('0x37')],function(_0x37a8ee){var _0x231dd4={};_0x231dd4[_0x37a8ee]={'$like':'%'+_0x3516ca['query'][_0xfa70('0x3f')]+'%'};return _0x231dd4;})});}_0x374801=_[_0xfa70('0x40')]({},_0x374801,_0x3516ca['options']);return _0x24b58c[_0xfa70('0x11f')](_0x374801);}})[_0xfa70('0x26')](function(_0x4b651c){if(_0x4b651c){_0x23dce1=_0x4b651c[_0xfa70('0x38')];if(!_0x3516ca[_0xfa70('0x33')][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x374801[_0xfa70('0x22')]=qs['limit'](_0x3516ca[_0xfa70('0x33')][_0xfa70('0x22')]);_0x374801[_0xfa70('0x20')]=qs['offset'](_0x3516ca[_0xfa70('0x33')]['offset']);}return _0x24b58c['getApplications'](_0x374801);}})[_0xfa70('0x26')](function(_0x246d20){if(_0x246d20){return _0x246d20?{'count':_0x23dce1,'rows':_0x246d20}:null;}})['then'](respondWithResult(_0x2be032,null))[_0xfa70('0x1c')](handleError(_0x2be032,null));};exports[_0xfa70('0x120')]=function(_0x444e2a,_0x5ec26b){return db[_0xfa70('0x121')][_0xfa70('0x49')]({'where':{'id':_0x444e2a['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5ec26b,null))[_0xfa70('0x26')](function(_0x10d4d7){if(_0x10d4d7){return _0x10d4d7[_0xfa70('0x120')](_0x444e2a['body']['ids'],_['omit'](_0x444e2a[_0xfa70('0x4b')],['ids','id'])||{});}})[_0xfa70('0x26')](respondWithResult(_0x5ec26b,null))[_0xfa70('0x1c')](handleError(_0x5ec26b,null));};exports[_0xfa70('0x100')]=function(_0x1cf8d2,_0x38378b){var _0x2f1159={};var _0x12f808={};var _0x483a4d;var _0x1851c4;return db['ChatWebsite'][_0xfa70('0x5d')]({'where':{'id':_0x1cf8d2['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x38378b,null))['then'](function(_0x70f27a){if(_0x70f27a){_0x483a4d=_0x70f27a;_0x12f808[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0x122')][_0xfa70('0x2f')]);_0x12f808[_0xfa70('0x33')]=_[_0xfa70('0x34')](_0x1cf8d2[_0xfa70('0x33')]);_0x12f808[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x12f808[_0xfa70('0x32')],_0x12f808['query']);_0x2f1159['attributes']=_[_0xfa70('0x35')](_0x12f808[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x1cf8d2[_0xfa70('0x33')][_0xfa70('0x36')]));_0x2f1159['attributes']=_0x2f1159[_0xfa70('0x37')][_0xfa70('0x38')]?_0x2f1159['attributes']:_0x12f808[_0xfa70('0x32')];_0x2f1159[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x1cf8d2[_0xfa70('0x33')][_0xfa70('0x3b')]);_0x2f1159[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_['pick'](_0x1cf8d2[_0xfa70('0x33')],_0x12f808[_0xfa70('0x3e')]));if(_0x1cf8d2[_0xfa70('0x33')]['filter']){_0x2f1159['where']=_['merge'](_0x2f1159[_0xfa70('0x3c')],{'$or':_['map'](_0x2f1159['attributes'],function(_0x39c25f){var _0x414e08={};_0x414e08[_0x39c25f]={'$like':'%'+_0x1cf8d2[_0xfa70('0x33')]['filter']+'%'};return _0x414e08;})});}_0x2f1159=_[_0xfa70('0x40')]({},_0x2f1159,_0x1cf8d2[_0xfa70('0x42')]);return _0x483a4d['getProactiveActions'](_0x2f1159);}})[_0xfa70('0x26')](function(_0x257978){if(_0x257978){_0x1851c4=_0x257978['length'];if(!_0x1cf8d2['query'][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x2f1159[_0xfa70('0x22')]=qs[_0xfa70('0x22')](_0x1cf8d2['query'][_0xfa70('0x22')]);_0x2f1159[_0xfa70('0x20')]=qs[_0xfa70('0x20')](_0x1cf8d2[_0xfa70('0x33')][_0xfa70('0x20')]);}return _0x483a4d[_0xfa70('0x100')](_0x2f1159);}})[_0xfa70('0x26')](function(_0x33c404){if(_0x33c404){return _0x33c404?{'count':_0x1851c4,'rows':_0x33c404}:null;}})[_0xfa70('0x26')](respondWithResult(_0x38378b,null))['catch'](handleError(_0x38378b,null));};exports[_0xfa70('0x123')]=function(_0x427ef8,_0x4c0a75){var _0x25bae3=_0x427ef8['query'][_0xfa70('0x124')]==='false'?_0xfa70('0x125'):_0xfa70('0x126');return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'attributes':['id',_0x25bae3],'where':{'id':_0x427ef8[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x4c0a75,null))[_0xfa70('0x26')](function(_0x59c5b8){if(_0x59c5b8){var _0x18985b=_0x59c5b8[_0x25bae3];var _0x1c184a=_0x18985b&&_0x18985b[_0xfa70('0x127')]?_0x18985b[_0xfa70('0x127')]:[];_0x4c0a75[_0xfa70('0x2b')]({'fromKey':_[_0xfa70('0x74')](_0x18985b[_0xfa70('0x128')])?undefined:_0x18985b[_0xfa70('0x128')],'count':_0x1c184a[_0xfa70('0x38')],'rows':_0x1c184a});}})['catch'](handleError(_0x4c0a75,null));};exports[_0xfa70('0x129')]=function(_0x1a90d1,_0x214792){var _0x529929={'raw':![],'where':{}};var _0x607581={};var _0x5f3d69={'count':0x0,'rows':[]};return db[_0xfa70('0x2e')][_0xfa70('0x5d')]({'where':{'id':_0x1a90d1['params']['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x214792,null))['then'](function(_0x223185){if(_0x223185){_0x607581['model']=_[_0xfa70('0x34')](db[_0xfa70('0xcc')][_0xfa70('0x2f')]);_0x607581[_0xfa70('0x33')]=_['keys'](_0x1a90d1[_0xfa70('0x33')]);_0x607581['filters']=_['intersection'](_0x607581[_0xfa70('0x32')],_0x607581[_0xfa70('0x33')]);_0x529929[_0xfa70('0x37')]=_['intersection'](_0x607581['model'],qs[_0xfa70('0x36')](_0x1a90d1['query'][_0xfa70('0x36')]));_0x529929[_0xfa70('0x37')]=_0x529929[_0xfa70('0x37')][_0xfa70('0x38')]?_0x529929[_0xfa70('0x37')]:_0x607581[_0xfa70('0x32')];if(!_0x1a90d1[_0xfa70('0x33')][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x529929[_0xfa70('0x22')]=qs[_0xfa70('0x22')](_0x1a90d1['query'][_0xfa70('0x22')]);_0x529929[_0xfa70('0x20')]=qs[_0xfa70('0x20')](_0x1a90d1['query'][_0xfa70('0x20')]);}_0x529929[_0xfa70('0x3a')]=qs[_0xfa70('0x3b')](_0x1a90d1['query'][_0xfa70('0x3b')]);_0x529929[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_['pick'](_0x1a90d1[_0xfa70('0x33')],_0x607581[_0xfa70('0x3e')]));_0x529929[_0xfa70('0x3c')][_0xfa70('0x56')]=_0x223185['id'];if(_0x1a90d1['query'][_0xfa70('0x3f')]){_0x529929[_0xfa70('0x3c')]=_[_0xfa70('0x40')](_0x529929[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x529929['attributes'],function(_0x55b6ab){var _0x5e4e2b={};_0x5e4e2b[_0x55b6ab]={'$like':'%'+_0x1a90d1[_0xfa70('0x33')]['filter']+'%'};return _0x5e4e2b;})});}_0x529929=_[_0xfa70('0x40')]({},_0x529929,_0x1a90d1[_0xfa70('0x42')]);return db[_0xfa70('0xcc')][_0xfa70('0x23')]({'where':_0x529929[_0xfa70('0x3c')]})['then'](function(_0x5d455d){_0x5f3d69[_0xfa70('0x23')]=_0x5d455d;if(_0x1a90d1[_0xfa70('0x33')]['includeAll']){_0x529929[_0xfa70('0x43')]=[{'all':!![]}];}else{_0x529929[_0xfa70('0x43')]=[{'model':db[_0xfa70('0x82')],'as':'Contact','required':![]},{'model':db[_0xfa70('0x12a')],'as':'Attachments','required':![]}];}return db[_0xfa70('0xcc')]['findAll'](_0x529929);})[_0xfa70('0x26')](function(_0x36c336){_0x5f3d69[_0xfa70('0x44')]=_0x36c336;return _0x5f3d69;});}})[_0xfa70('0x26')](respondWithFilteredResult(_0x214792,_0x529929))['catch'](handleError(_0x214792,null));};exports[_0xfa70('0x12b')]=function(_0xcce62c,_0x42e3ad){return db[_0xfa70('0x2e')][_0xfa70('0x49')]({'where':{'id':_0xcce62c[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x42e3ad,null))[_0xfa70('0x26')](function(_0x126c06){if(_0x126c06){return _0x126c06[_0xfa70('0x12b')](_0xcce62c['body'][_0xfa70('0x5b')],_[_0xfa70('0xea')](_0xcce62c[_0xfa70('0x4b')],['ids','id'])||{})[_0xfa70('0xb0')](function(_0x365984){for(var _0x35ee1c=0x0;_0x35ee1c<_0xcce62c['body'][_0xfa70('0x5b')][_0xfa70('0x38')];_0x35ee1c+=0x1){socket[_0xfa70('0x12c')](_0xfa70('0x12d'),{'UserId':Number(_0xcce62c['body'][_0xfa70('0x5b')][_0x35ee1c]),'ChatWebsiteId':Number(_0xcce62c[_0xfa70('0x53')]['id'])});}return _0x365984;});}})['then'](respondWithResult(_0x42e3ad,null))[_0xfa70('0x1c')](handleError(_0x42e3ad,null));};exports[_0xfa70('0x12e')]=function(_0x640da1,_0x5defd9){return db[_0xfa70('0x2e')]['find']({'where':{'id':_0x640da1[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x5defd9,null))[_0xfa70('0x26')](function(_0x3b4663){if(_0x3b4663){return _0x3b4663['removeAgents'](_0x640da1[_0xfa70('0x33')][_0xfa70('0x5b')])[_0xfa70('0x26')](function(){if(_[_0xfa70('0x12f')](_0x640da1['query'][_0xfa70('0x5b')])){for(var _0x14be27=0x0;_0x14be27<_0x640da1[_0xfa70('0x33')][_0xfa70('0x5b')][_0xfa70('0x38')];_0x14be27+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x640da1['query']['ids'][_0x14be27]),'ChatWebsiteId':Number(_0x640da1[_0xfa70('0x53')]['id'])});}}else{socket[_0xfa70('0x12c')](_0xfa70('0x130'),{'UserId':Number(_0x640da1[_0xfa70('0x33')][_0xfa70('0x5b')]),'ChatWebsiteId':Number(_0x640da1[_0xfa70('0x53')]['id'])});}});}})[_0xfa70('0x26')](respondWithStatusCode(_0x5defd9,null))['catch'](handleError(_0x5defd9,null));};exports[_0xfa70('0x131')]=function(_0x44975d,_0x20c7aa){var _0x1d23bd={};var _0x467df8={};var _0x3869b3;var _0x3107a4;return db[_0xfa70('0x2e')][_0xfa70('0x5d')]({'where':{'id':_0x44975d[_0xfa70('0x53')]['id']}})[_0xfa70('0x26')](handleEntityNotFound(_0x20c7aa,null))[_0xfa70('0x26')](function(_0x38c149){if(_0x38c149){_0x3869b3=_0x38c149;_0x467df8[_0xfa70('0x32')]=_[_0xfa70('0x34')](db[_0xfa70('0xb9')]['rawAttributes']);_0x467df8[_0xfa70('0x33')]=_[_0xfa70('0x34')](_0x44975d['query']);_0x467df8[_0xfa70('0x3e')]=_[_0xfa70('0x35')](_0x467df8[_0xfa70('0x32')],_0x467df8[_0xfa70('0x33')]);_0x1d23bd['attributes']=_['intersection'](_0x467df8[_0xfa70('0x32')],qs[_0xfa70('0x36')](_0x44975d[_0xfa70('0x33')][_0xfa70('0x36')]));_0x1d23bd[_0xfa70('0x37')]=_0x1d23bd[_0xfa70('0x37')][_0xfa70('0x38')]?_0x1d23bd[_0xfa70('0x37')]:_0x467df8[_0xfa70('0x32')];_0x1d23bd['order']=qs[_0xfa70('0x3b')](_0x44975d[_0xfa70('0x33')][_0xfa70('0x3b')]);_0x1d23bd[_0xfa70('0x3c')]=qs[_0xfa70('0x3e')](_[_0xfa70('0x3d')](_0x44975d[_0xfa70('0x33')],_0x467df8[_0xfa70('0x3e')]));if(_0x44975d['query'][_0xfa70('0x3f')]){_0x1d23bd[_0xfa70('0x3c')]=_['merge'](_0x1d23bd[_0xfa70('0x3c')],{'$or':_[_0xfa70('0x2d')](_0x1d23bd['attributes'],function(_0x105cf8){var _0x27469c={};_0x27469c[_0x105cf8]={'$like':'%'+_0x44975d[_0xfa70('0x33')]['filter']+'%'};return _0x27469c;})});}_0x1d23bd=_[_0xfa70('0x40')]({},_0x1d23bd,_0x44975d[_0xfa70('0x42')]);return _0x3869b3['getAgents'](_0x1d23bd);}})['then'](function(_0x38973c){if(_0x38973c){_0x3107a4=_0x38973c[_0xfa70('0x38')];if(!_0x44975d['query'][_0xfa70('0x39')](_0xfa70('0x5f'))){_0x1d23bd['limit']=qs[_0xfa70('0x22')](_0x44975d[_0xfa70('0x33')][_0xfa70('0x22')]);_0x1d23bd[_0xfa70('0x20')]=qs['offset'](_0x44975d[_0xfa70('0x33')][_0xfa70('0x20')]);}return _0x3869b3[_0xfa70('0x131')](_0x1d23bd);}})[_0xfa70('0x26')](function(_0xc2610e){if(_0xc2610e){return _0xc2610e?{'count':_0x3107a4,'rows':_0xc2610e}:null;}})['then'](respondWithResult(_0x20c7aa,null))[_0xfa70('0x1c')](handleError(_0x20c7aa,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 07847de..d7d42c5 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 _0xbe48=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x2b8907,_0x2e15a4){var _0x1a4f5a=function(_0x4ab1e2){while(--_0x4ab1e2){_0x2b8907['push'](_0x2b8907['shift']());}};_0x1a4f5a(++_0x2e15a4);}(_0xbe48,0x121));var _0x8be4=function(_0x1d591d,_0x3b0814){_0x1d591d=_0x1d591d-0x0;var _0x147f9f=_0xbe48[_0x1d591d];return _0x147f9f;};'use strict';var EventEmitter=require(_0x8be4('0x0'));var ChatWebsite=require(_0x8be4('0x1'))['db'][_0x8be4('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8be4('0x3')](0x0);var events={'afterCreate':_0x8be4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3404c7){return function(_0x95e50e,_0x53fdb0,_0x191a88){ChatWebsiteEvents[_0x8be4('0x5')](_0x3404c7+':'+_0x95e50e['id'],_0x95e50e);ChatWebsiteEvents[_0x8be4('0x5')](_0x3404c7,_0x95e50e);_0x191a88(null);};}for(var e in events){if(events[_0x8be4('0x6')](e)){var event=events[e];ChatWebsite[_0x8be4('0x7')](e,emitEvent(event));}}module[_0x8be4('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xcf1c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1f993a,_0x2391e8){var _0x49d756=function(_0xf15d56){while(--_0xf15d56){_0x1f993a['push'](_0x1f993a['shift']());}};_0x49d756(++_0x2391e8);}(_0xcf1c,0x18d));var _0xccf1=function(_0x458f09,_0xf2ee90){_0x458f09=_0x458f09-0x0;var _0x1ca565=_0xcf1c[_0x458f09];return _0x1ca565;};'use strict';var EventEmitter=require(_0xccf1('0x0'));var ChatWebsite=require(_0xccf1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xccf1('0x2')](0x0);var events={'afterCreate':_0xccf1('0x3'),'afterUpdate':_0xccf1('0x4'),'afterDestroy':_0xccf1('0x5')};function emitEvent(_0x5670d0){return function(_0x5d3e85,_0x509c8d,_0x301b38){ChatWebsiteEvents['emit'](_0x5670d0+':'+_0x5d3e85['id'],_0x5d3e85);ChatWebsiteEvents[_0xccf1('0x6')](_0x5670d0,_0x5d3e85);_0x301b38(null);};}for(var e in events){if(events[_0xccf1('0x7')](e)){var event=events[e];ChatWebsite[_0xccf1('0x8')](e,emitEvent(event));}}module[_0xccf1('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 6eb2284..c4e018d 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 _0x9701=['moment','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','util','api'];(function(_0x2cb7a1,_0x49f4ee){var _0x3ff7ff=function(_0x3b6ed9){while(--_0x3b6ed9){_0x2cb7a1['push'](_0x2cb7a1['shift']());}};_0x3ff7ff(++_0x49f4ee);}(_0x9701,0x198));var _0x1970=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9701[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x1970('0x0'));var logger=require('../../config/logger')(_0x1970('0x1'));var moment=require(_0x1970('0x2'));var BPromise=require(_0x1970('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1970('0x4'));var rimraf=require(_0x1970('0x5'));var config=require(_0x1970('0x6'));var attributes=require(_0x1970('0x7'));module[_0x1970('0x8')]=function(_0x5bc374,_0x80d2d2){return _0x5bc374[_0x1970('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5061=['lodash','util','../../config/logger','api','moment','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x1b4a2c,_0x3fc60b){var _0x40a60e=function(_0xf9feb){while(--_0xf9feb){_0x1b4a2c['push'](_0x1b4a2c['shift']());}};_0x40a60e(++_0x3fc60b);}(_0x5061,0x176));var _0x1506=function(_0x4d9bb2,_0x3db50d){_0x4d9bb2=_0x4d9bb2-0x0;var _0x3179fe=_0x5061[_0x4d9bb2];return _0x3179fe;};'use strict';var _=require(_0x1506('0x0'));var util=require(_0x1506('0x1'));var logger=require(_0x1506('0x2'))(_0x1506('0x3'));var moment=require(_0x1506('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1506('0x5'));var rimraf=require(_0x1506('0x6'));var config=require('../../config/environment');var attributes=require(_0x1506('0x7'));module['exports']=function(_0x371fb7,_0x6836cd){return _0x371fb7[_0x1506('0x8')](_0x1506('0x9'),attributes,{'tableName':_0x1506('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 896acc7..77d4696 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 _0xcc56=['./chatWebsite.socket','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x2f9ecc,_0x417125){var _0x121b0a=function(_0xaf4c53){while(--_0xaf4c53){_0x2f9ecc['push'](_0x2f9ecc['shift']());}};_0x121b0a(++_0x417125);}(_0xcc56,0x14d));var _0x6cc5=function(_0x58fa29,_0x1135f2){_0x58fa29=_0x58fa29-0x0;var _0x59044e=_0xcc56[_0x58fa29];return _0x59044e;};'use strict';var _=require(_0x6cc5('0x0'));var util=require(_0x6cc5('0x1'));var moment=require(_0x6cc5('0x2'));var BPromise=require(_0x6cc5('0x3'));var rs=require(_0x6cc5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6cc5('0x5'))['db'];var utils=require(_0x6cc5('0x6'));var logger=require(_0x6cc5('0x7'))(_0x6cc5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6cc5('0x9')][_0x6cc5('0xa')]({'port':0x232a});config[_0x6cc5('0xb')]=_[_0x6cc5('0xc')](config[_0x6cc5('0xb')],{'host':_0x6cc5('0xd'),'port':0x18eb});var socket=require(_0x6cc5('0xe'))(new Redis(config[_0x6cc5('0xb')]));require(_0x6cc5('0xf'))['register'](socket);function respondWithRpcPromise(_0x206311,_0x4563ab,_0x58e582){return new BPromise(function(_0x4f0be3,_0x5e630f){return client[_0x6cc5('0x10')](_0x206311,_0x58e582)[_0x6cc5('0x11')](function(_0x39af30){logger[_0x6cc5('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x4563ab,_0x6cc5('0x13'));logger[_0x6cc5('0x14')](_0x6cc5('0x15'),_0x4563ab,'request\x20sent',JSON[_0x6cc5('0x16')](_0x39af30));if(_0x39af30['error']){if(_0x39af30['error'][_0x6cc5('0x17')]===0x1f4){logger[_0x6cc5('0x18')](_0x6cc5('0x19'),_0x4563ab,_0x39af30[_0x6cc5('0x18')]['message']);return _0x5e630f(_0x39af30['error']['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4563ab,_0x39af30['error']['message']);return _0x4f0be3(_0x39af30[_0x6cc5('0x18')][_0x6cc5('0x1a')]);}else{logger[_0x6cc5('0x12')](_0x6cc5('0x19'),_0x4563ab,_0x6cc5('0x13'));_0x4f0be3(_0x39af30[_0x6cc5('0x1b')][_0x6cc5('0x1a')]);}})[_0x6cc5('0x1c')](function(_0x53170a){logger[_0x6cc5('0x18')](_0x6cc5('0x19'),_0x4563ab,_0x53170a);_0x5e630f(_0x53170a);});});}
\ No newline at end of file
+var _0xe168=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2387c5,_0xfcc74c){var _0x2c414c=function(_0x3d1881){while(--_0x3d1881){_0x2387c5['push'](_0x2387c5['shift']());}};_0x2c414c(++_0xfcc74c);}(_0xe168,0xce));var _0x8e16=function(_0x35f511,_0x4b60ff){_0x35f511=_0x35f511-0x0;var _0x33d91b=_0xe168[_0x35f511];return _0x33d91b;};'use strict';var _=require(_0x8e16('0x0'));var util=require(_0x8e16('0x1'));var moment=require(_0x8e16('0x2'));var BPromise=require(_0x8e16('0x3'));var rs=require(_0x8e16('0x4'));var fs=require('fs');var Redis=require(_0x8e16('0x5'));var db=require(_0x8e16('0x6'))['db'];var utils=require(_0x8e16('0x7'));var logger=require(_0x8e16('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8e16('0x9'));var client=jayson[_0x8e16('0xa')][_0x8e16('0xb')]({'port':0x232a});config[_0x8e16('0xc')]=_[_0x8e16('0xd')](config[_0x8e16('0xc')],{'host':_0x8e16('0xe'),'port':0x18eb});var socket=require(_0x8e16('0xf'))(new Redis(config[_0x8e16('0xc')]));require(_0x8e16('0x10'))[_0x8e16('0x11')](socket);function respondWithRpcPromise(_0x339bc2,_0x5b1e8e,_0x2c5a1e){return new BPromise(function(_0x7ede4b,_0x20d19b){return client[_0x8e16('0x12')](_0x339bc2,_0x2c5a1e)[_0x8e16('0x13')](function(_0x122024){logger[_0x8e16('0x14')](_0x8e16('0x15'),_0x5b1e8e,_0x8e16('0x16'));logger['debug'](_0x8e16('0x17'),_0x5b1e8e,_0x8e16('0x16'),JSON[_0x8e16('0x18')](_0x122024));if(_0x122024[_0x8e16('0x19')]){if(_0x122024['error'][_0x8e16('0x1a')]===0x1f4){logger[_0x8e16('0x19')](_0x8e16('0x15'),_0x5b1e8e,_0x122024['error'][_0x8e16('0x1b')]);return _0x20d19b(_0x122024[_0x8e16('0x19')][_0x8e16('0x1b')]);}logger[_0x8e16('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x5b1e8e,_0x122024[_0x8e16('0x19')][_0x8e16('0x1b')]);return _0x7ede4b(_0x122024[_0x8e16('0x19')]['message']);}else{logger[_0x8e16('0x14')](_0x8e16('0x15'),_0x5b1e8e,'request\x20sent');_0x7ede4b(_0x122024['result']['message']);}})[_0x8e16('0x1c')](function(_0x4a02f5){logger[_0x8e16('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x5b1e8e,_0x4a02f5);_0x20d19b(_0x4a02f5);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 5d7d3b3..4211eaa 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 _0x78c6=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x1f2e95,_0x5aafca){var _0x3a9a07=function(_0x1e83b8){while(--_0x1e83b8){_0x1f2e95['push'](_0x1f2e95['shift']());}};_0x3a9a07(++_0x5aafca);}(_0x78c6,0x17f));var _0x678c=function(_0x249db0,_0x45947d){_0x249db0=_0x249db0-0x0;var _0xda8563=_0x78c6[_0x249db0];return _0xda8563;};'use strict';var ChatWebsiteEvents=require(_0x678c('0x0'));var events=[_0x678c('0x1'),_0x678c('0x2'),_0x678c('0x3')];function createListener(_0x2202b6,_0x21c60b){return function(_0x3beec1){_0x21c60b[_0x678c('0x4')](_0x2202b6,_0x3beec1);};}function removeListener(_0x2d2de0,_0x262ee7){return function(){ChatWebsiteEvents[_0x678c('0x5')](_0x2d2de0,_0x262ee7);};}exports[_0x678c('0x6')]=function(_0x5fe6d5){for(var _0x8b5d27=0x0,_0x2ad240=events[_0x678c('0x7')];_0x8b5d27<_0x2ad240;_0x8b5d27++){var _0x7a70d1=events[_0x8b5d27];var _0x295434=createListener(_0x678c('0x8')+_0x7a70d1,_0x5fe6d5);ChatWebsiteEvents['on'](_0x7a70d1,_0x295434);}};
\ No newline at end of file
+var _0xf698=['length','chatWebsite:','./chatWebsite.events','update','removeListener','register'];(function(_0x3c3eb7,_0x55343d){var _0x108733=function(_0x5bd6f6){while(--_0x5bd6f6){_0x3c3eb7['push'](_0x3c3eb7['shift']());}};_0x108733(++_0x55343d);}(_0xf698,0x14c));var _0x8f69=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0xf698[_0x296897];return _0x2b44ab;};'use strict';var ChatWebsiteEvents=require(_0x8f69('0x0'));var events=['save','remove',_0x8f69('0x1')];function createListener(_0x354452,_0x12fc41){return function(_0x21c3c7){_0x12fc41['emit'](_0x354452,_0x21c3c7);};}function removeListener(_0x305bf1,_0x53824c){return function(){ChatWebsiteEvents[_0x8f69('0x2')](_0x305bf1,_0x53824c);};}exports[_0x8f69('0x3')]=function(_0x3f3f2b){for(var _0x86e8bf=0x0,_0x3f2c1e=events[_0x8f69('0x4')];_0x86e8bf<_0x3f2c1e;_0x86e8bf++){var _0x99e4c4=events[_0x86e8bf];var _0x93054e=createListener(_0x8f69('0x5')+_0x99e4c4,_0x3f3f2b);ChatWebsiteEvents['on'](_0x99e4c4,_0x93054e);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 58b23ab..38b1dad 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 _0xd37b=['getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getOfflineMessages','/:id/users','getAgents','post','/:id/dispositions','join','root','server/files/images/logos/','now','single','file','addLogo','diskStorage','server/files/images/avatars/','format','addAvatar','%s-%s','originalname','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd37b,0x1dd));var _0xbd37=function(_0x59f454,_0x1f688c){_0x59f454=_0x59f454-0x0;var _0x273b91=_0xd37b[_0x59f454];return _0x273b91;};'use strict';var multer=require(_0xbd37('0x0'));var util=require(_0xbd37('0x1'));var path=require(_0xbd37('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbd37('0x3')]();var fs_extra=require(_0xbd37('0x4'));var auth=require(_0xbd37('0x5'));var interaction=require(_0xbd37('0x6'));var config=require(_0xbd37('0x7'));var controller=require(_0xbd37('0x8'));router[_0xbd37('0x9')]('/',auth[_0xbd37('0xa')](),controller[_0xbd37('0xb')]);router[_0xbd37('0x9')](_0xbd37('0xc'),auth['isAuthenticated'](),controller[_0xbd37('0xd')]);router['get'](_0xbd37('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xbd37('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xbd37('0xf')]);router[_0xbd37('0x9')](_0xbd37('0x10'),auth[_0xbd37('0xa')](),controller[_0xbd37('0x11')]);router[_0xbd37('0x9')](_0xbd37('0x12'),controller[_0xbd37('0x13')]);router['get'](_0xbd37('0x14'),controller[_0xbd37('0x15')]);router['get']('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xbd37('0x9')](_0xbd37('0x16'),controller[_0xbd37('0x17')]);router[_0xbd37('0x9')](_0xbd37('0x18'),auth[_0xbd37('0xa')](),controller[_0xbd37('0x19')]);router['get'](_0xbd37('0x1a'),controller[_0xbd37('0x1b')]);router[_0xbd37('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0xbd37('0x1c')]);router[_0xbd37('0x9')](_0xbd37('0x1d'),auth[_0xbd37('0xa')](),controller[_0xbd37('0x1e')]);router[_0xbd37('0x9')](_0xbd37('0x1f'),controller['getFields']);router['get']('/:id/offline_messages',auth[_0xbd37('0xa')](),controller[_0xbd37('0x20')]);router[_0xbd37('0x9')](_0xbd37('0x21'),auth[_0xbd37('0xa')](),controller[_0xbd37('0x22')]);router[_0xbd37('0x23')]('/',auth[_0xbd37('0xa')](),controller['create']);router['post'](_0xbd37('0x24'),auth[_0xbd37('0xa')](),controller['addDisposition']);router[_0xbd37('0x23')](_0xbd37('0x10'),auth[_0xbd37('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3ad983,_0x3d9082,_0x14e1e5){_0x14e1e5(null,path[_0xbd37('0x25')](config[_0xbd37('0x26')],_0xbd37('0x27')));},'filename':function(_0x1f1b3e,_0xac6241,_0x42dd9e){_0x42dd9e(null,util['format']('%s-%s',Date[_0xbd37('0x28')](),_0xac6241['originalname']));}})});router['post'](_0xbd37('0x12'),upload[_0xbd37('0x29')](_0xbd37('0x2a')),controller[_0xbd37('0x2b')]);var upload=multer({'storage':multer[_0xbd37('0x2c')]({'destination':function(_0x5ed083,_0x514bba,_0xb53213){_0xb53213(null,path[_0xbd37('0x25')](config['root'],_0xbd37('0x2d')));},'filename':function(_0x1c2304,_0x3470c6,_0x2fb98b){_0x2fb98b(null,util[_0xbd37('0x2e')]('%s-%s',Date[_0xbd37('0x28')](),_0x3470c6['originalname']));}})});router[_0xbd37('0x23')](_0xbd37('0x14'),upload[_0xbd37('0x29')](_0xbd37('0x2a')),controller[_0xbd37('0x2f')]);var upload=multer({'storage':multer[_0xbd37('0x2c')]({'destination':function(_0x1667ea,_0x55a97c,_0x59af57){_0x59af57(null,path[_0xbd37('0x25')](config[_0xbd37('0x26')],_0xbd37('0x2d')));},'filename':function(_0x13ee31,_0x2d9a4e,_0xce6a7c){_0xce6a7c(null,util[_0xbd37('0x2e')](_0xbd37('0x30'),Date['now'](),_0x2d9a4e[_0xbd37('0x31')]));}})});router[_0xbd37('0x23')](_0xbd37('0x32'),upload[_0xbd37('0x29')](_0xbd37('0x2a')),controller[_0xbd37('0x33')]);var upload=multer({'storage':multer[_0xbd37('0x2c')]({'destination':function(_0x9820fa,_0x5631e5,_0x3a0c94){_0x3a0c94(null,path[_0xbd37('0x25')](config[_0xbd37('0x26')],_0xbd37('0x2d')));},'filename':function(_0x43daac,_0x5e4215,_0x2bd87b){_0x2bd87b(null,util['format']('%s-%s',Date[_0xbd37('0x28')](),_0x5e4215[_0xbd37('0x31')]));}})});router[_0xbd37('0x23')](_0xbd37('0x16'),upload[_0xbd37('0x29')]('file'),controller['addSystemAvatar']);router['post'](_0xbd37('0x34'),controller[_0xbd37('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xbd37('0x2c')]({'destination':function(_0x5cba08,_0x56b16c,_0x2d6227){const _0x4037e1=path[_0xbd37('0x25')](config[_0xbd37('0x26')],_0xbd37('0x36'),_0xbd37('0x37'),_0xbd37('0x38'));fs_extra[_0xbd37('0x39')](_0x4037e1,function(){_0x2d6227(null,_0x4037e1);});},'filename':function(_0x2d3e0f,_0x36cf0b,_0x550ab9){const _0x248cf9=_0x36cf0b[_0xbd37('0x31')][_0xbd37('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5a6d30=path['extname'](_0x248cf9);const _0x52352d=Date[_0xbd37('0x28')]()+'-'+_0x248cf9['replace'](_0x5a6d30,'')+_0x5a6d30;_0x550ab9(null,_0x52352d);}})});router[_0xbd37('0x23')](_0xbd37('0x3b'),offlineUploadMulter['any'](),controller[_0xbd37('0x3c')]);router[_0xbd37('0x23')](_0xbd37('0x18'),auth[_0xbd37('0xa')](),controller[_0xbd37('0x3d')]);router[_0xbd37('0x23')](_0xbd37('0x3e'),auth[_0xbd37('0xa')](),controller[_0xbd37('0x3f')]);router[_0xbd37('0x23')](_0xbd37('0x1d'),auth['isAuthenticated'](),controller[_0xbd37('0x40')]);router[_0xbd37('0x23')]('/:id/users',auth[_0xbd37('0xa')](),controller[_0xbd37('0x41')]);router[_0xbd37('0x42')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbd37('0x43')](_0xbd37('0xe'),auth[_0xbd37('0xa')](),controller[_0xbd37('0x44')]);router['delete'](_0xbd37('0x24'),auth[_0xbd37('0xa')](),controller['removeDispositions']);router[_0xbd37('0x43')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xbd37('0x45')]);router[_0xbd37('0x43')](_0xbd37('0x21'),auth['isAuthenticated'](),controller[_0xbd37('0x46')]);module[_0xbd37('0x47')]=router;
\ No newline at end of file
+var _0xbc45=['removeAnswers','removeAgents','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','post','create','addAnswer','diskStorage','root','format','%s-%s','now','/:id/logo','single','addLogo','join','server/files/images/avatars/','originalname','file','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','offline-chat','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','destroy','removeDispositions','delete'];(function(_0x2e8f90,_0x830dd9){var _0x584090=function(_0x53bd1c){while(--_0x53bd1c){_0x2e8f90['push'](_0x2e8f90['shift']());}};_0x584090(++_0x830dd9);}(_0xbc45,0x160));var _0x5bc4=function(_0x45bd77,_0x594e75){_0x45bd77=_0x45bd77-0x0;var _0x5c26ed=_0xbc45[_0x45bd77];return _0x5c26ed;};'use strict';var multer=require(_0x5bc4('0x0'));var util=require(_0x5bc4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5bc4('0x2'));var router=express['Router']();var fs_extra=require(_0x5bc4('0x3'));var auth=require(_0x5bc4('0x4'));var interaction=require(_0x5bc4('0x5'));var config=require(_0x5bc4('0x6'));var controller=require(_0x5bc4('0x7'));router[_0x5bc4('0x8')]('/',auth[_0x5bc4('0x9')](),controller['index']);router[_0x5bc4('0x8')](_0x5bc4('0xa'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0xb')]);router['get'](_0x5bc4('0xc'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0xd')]);router['get'](_0x5bc4('0xe'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0xf')]);router[_0x5bc4('0x8')](_0x5bc4('0x10'),auth[_0x5bc4('0x9')](),controller['getAnswers']);router[_0x5bc4('0x8')]('/:id/logo',controller[_0x5bc4('0x11')]);router[_0x5bc4('0x8')](_0x5bc4('0x12'),controller['getAvatar']);router['get'](_0x5bc4('0x13'),controller[_0x5bc4('0x14')]);router[_0x5bc4('0x8')]('/:id/system_avatar',controller[_0x5bc4('0x15')]);router[_0x5bc4('0x8')](_0x5bc4('0x16'),auth[_0x5bc4('0x9')](),controller['getInteractions']);router[_0x5bc4('0x8')](_0x5bc4('0x17'),controller[_0x5bc4('0x18')]);router['get'](_0x5bc4('0x19'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x1a')]);router[_0x5bc4('0x8')](_0x5bc4('0x1b'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x1c')]);router[_0x5bc4('0x8')](_0x5bc4('0x1d'),controller['getFields']);router[_0x5bc4('0x8')](_0x5bc4('0x1e'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x1f')]);router['get']('/:id/users',auth[_0x5bc4('0x9')](),controller['getAgents']);router[_0x5bc4('0x20')]('/',auth['isAuthenticated'](),controller[_0x5bc4('0x21')]);router['post'](_0x5bc4('0xe'),auth[_0x5bc4('0x9')](),controller['addDisposition']);router[_0x5bc4('0x20')]('/:id/canned_answers',auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x22')]);var upload=multer({'storage':multer[_0x5bc4('0x23')]({'destination':function(_0xc11f64,_0x351926,_0x1d54fe){_0x1d54fe(null,path['join'](config[_0x5bc4('0x24')],'server/files/images/logos/'));},'filename':function(_0x4834b3,_0x58e61b,_0x4ac44f){_0x4ac44f(null,util[_0x5bc4('0x25')](_0x5bc4('0x26'),Date[_0x5bc4('0x27')](),_0x58e61b['originalname']));}})});router[_0x5bc4('0x20')](_0x5bc4('0x28'),upload[_0x5bc4('0x29')]('file'),controller[_0x5bc4('0x2a')]);var upload=multer({'storage':multer[_0x5bc4('0x23')]({'destination':function(_0x19ef05,_0x5674dd,_0x4b7c72){_0x4b7c72(null,path[_0x5bc4('0x2b')](config['root'],_0x5bc4('0x2c')));},'filename':function(_0x1f47e4,_0x406aa2,_0xe0d6c2){_0xe0d6c2(null,util['format'](_0x5bc4('0x26'),Date[_0x5bc4('0x27')](),_0x406aa2[_0x5bc4('0x2d')]));}})});router[_0x5bc4('0x20')](_0x5bc4('0x12'),upload[_0x5bc4('0x29')](_0x5bc4('0x2e')),controller[_0x5bc4('0x2f')]);var upload=multer({'storage':multer[_0x5bc4('0x23')]({'destination':function(_0x294823,_0x391eba,_0x36b5f9){_0x36b5f9(null,path['join'](config[_0x5bc4('0x24')],_0x5bc4('0x2c')));},'filename':function(_0x22b021,_0x4290db,_0xaaf582){_0xaaf582(null,util['format'](_0x5bc4('0x26'),Date[_0x5bc4('0x27')](),_0x4290db['originalname']));}})});router['post'](_0x5bc4('0x13'),upload[_0x5bc4('0x29')](_0x5bc4('0x2e')),controller[_0x5bc4('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e3d96,_0x23ee16,_0x27d8bb){_0x27d8bb(null,path[_0x5bc4('0x2b')](config[_0x5bc4('0x24')],_0x5bc4('0x2c')));},'filename':function(_0x3126df,_0x30e5c7,_0x13c02f){_0x13c02f(null,util[_0x5bc4('0x25')](_0x5bc4('0x26'),Date[_0x5bc4('0x27')](),_0x30e5c7[_0x5bc4('0x2d')]));}})});router[_0x5bc4('0x20')](_0x5bc4('0x31'),upload[_0x5bc4('0x29')](_0x5bc4('0x2e')),controller[_0x5bc4('0x32')]);router['post'](_0x5bc4('0x33'),controller[_0x5bc4('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x5bc4('0x23')]({'destination':function(_0x7e9fe5,_0x384541,_0x31d1a0){const _0x2b0118=path['join'](config[_0x5bc4('0x24')],_0x5bc4('0x35'),'attachments',_0x5bc4('0x36'));fs_extra['ensureDir'](_0x2b0118,function(){_0x31d1a0(null,_0x2b0118);});},'filename':function(_0x4e0ce4,_0xa95f03,_0x5c5e55){const _0x14fe0c=_0xa95f03[_0x5bc4('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x34d871=path[_0x5bc4('0x37')](_0x14fe0c);const _0x1a0a2f=Date[_0x5bc4('0x27')]()+'-'+_0x14fe0c['replace'](_0x34d871,'')+_0x34d871;_0x5c5e55(null,_0x1a0a2f);}})});router['post'](_0x5bc4('0x38'),offlineUploadMulter[_0x5bc4('0x39')](),controller[_0x5bc4('0x3a')]);router[_0x5bc4('0x20')](_0x5bc4('0x16'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x3b')]);router[_0x5bc4('0x20')](_0x5bc4('0x19'),auth[_0x5bc4('0x9')](),controller['addApplications']);router['post'](_0x5bc4('0x1b'),auth['isAuthenticated'](),controller[_0x5bc4('0x3c')]);router[_0x5bc4('0x20')](_0x5bc4('0x3d'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x3e')]);router[_0x5bc4('0x3f')]('/:id',auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x40')]);router['delete'](_0x5bc4('0xc'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x41')]);router['delete'](_0x5bc4('0xe'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x42')]);router[_0x5bc4('0x43')](_0x5bc4('0x10'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x44')]);router[_0x5bc4('0x43')](_0x5bc4('0x3d'),auth[_0x5bc4('0x9')](),controller[_0x5bc4('0x45')]);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 d252546..d91ac46 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 _0xe5a5=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','use','isAuthenticated','exports','Router','production','get','client-side-logger'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe5a5,0xcb));var _0x5e5a=function(_0x583c72,_0x3aac93){_0x583c72=_0x583c72-0x0;var _0x1fdd0f=_0xe5a5[_0x583c72];return _0x1fdd0f;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x5e5a('0x0')]();var isProduction=config['env']===_0x5e5a('0x1')||![];function clientSideLogs(_0x350ea4,_0x29f7e7,_0x168e29){var _0x5b0b9c=_0x350ea4['app'][_0x5e5a('0x2')](_0x5e5a('0x3'));if(!_0x5b0b9c){throw new Error(_0x5e5a('0x4'));}return beaverLogger[_0x5e5a('0x5')]({'uri':'/client-logs','logger':_0x5b0b9c,'enableCors':!isProduction})(_0x350ea4,_0x29f7e7,_0x168e29);}router[_0x5e5a('0x6')](auth[_0x5e5a('0x7')](),clientSideLogs);module[_0x5e5a('0x8')]=router;
\ No newline at end of file
+var _0xab90=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','isAuthenticated','exports','express','../components/auth/service','env','production','app'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xab90,0x175));var _0x0ab9=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xab90[_0x8c43de];return _0xa6591b;};var beaverLogger=require('beaver-logger/server');var express=require(_0x0ab9('0x0'));var auth=require(_0x0ab9('0x1'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x0ab9('0x2')]===_0x0ab9('0x3')||![];function clientSideLogs(_0x1593ed,_0x4f5c57,_0x3adf12){var _0x36b1aa=_0x1593ed[_0x0ab9('0x4')]['get']('client-side-logger');if(!_0x36b1aa){throw new Error(_0x0ab9('0x5'));}return beaverLogger[_0x0ab9('0x6')]({'uri':'/client-logs','logger':_0x36b1aa,'enableCors':!isProduction})(_0x1593ed,_0x4f5c57,_0x3adf12);}router['use'](auth[_0x0ab9('0x7')](),clientSideLogs);module[_0x0ab9('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 26f904d..09a4ccb 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 _0x58ff=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant'];(function(_0x5cf713,_0x364aa9){var _0x4630dd=function(_0x59a253){while(--_0x59a253){_0x5cf713['push'](_0x5cf713['shift']());}};_0x4630dd(++_0x364aa9);}(_0x58ff,0xd7));var _0xf58f=function(_0x54bc01,_0x3c2d5a){_0x54bc01=_0x54bc01-0x0;var _0x14a34f=_0x58ff[_0x54bc01];return _0x14a34f;};'use strict';var Sequelize=require(_0xf58f('0x0'));module[_0xf58f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf58f('0x2')](_0xf58f('0x3'),'Google',_0xf58f('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf58f('0x5'),_0xf58f('0x6'))},'data1':{'type':Sequelize[_0xf58f('0x7')],'comment':_0xf58f('0x8')},'data2':{'type':Sequelize[_0xf58f('0x7')],'comment':_0xf58f('0x9')},'data3':{'type':Sequelize[_0xf58f('0x7')],'comment':_0xf58f('0xa')},'data4':{'type':Sequelize[_0xf58f('0x7')],'comment':_0xf58f('0xb')},'data5':{'type':Sequelize[_0xf58f('0xc')],'comment':_0xf58f('0xd')},'data6':{'type':Sequelize[_0xf58f('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf58f('0xc')],'comment':_0xf58f('0xe')}};
\ No newline at end of file
+var _0x062b=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','Google','MicrosoftAzure'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x062b,0xe2));var _0xb062=function(_0x51713e,_0x1343f3){_0x51713e=_0x51713e-0x0;var _0x3e3743=_0x062b[_0x51713e];return _0x3e3743;};'use strict';var Sequelize=require(_0xb062('0x0'));module['exports']={'name':{'type':Sequelize[_0xb062('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb062('0x2')]('AmazonAWS',_0xb062('0x3'),_0xb062('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xb062('0x2')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0xb062('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xb062('0x1')],'comment':_0xb062('0x5')},'data3':{'type':Sequelize[_0xb062('0x1')],'comment':_0xb062('0x6')},'data4':{'type':Sequelize[_0xb062('0x1')],'comment':_0xb062('0x7')},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0xb062('0x8')],'comment':_0xb062('0x9')},'data7':{'type':Sequelize['TEXT'],'comment':_0xb062('0xa')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e70adba..1eaad2e 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 _0x55fa=['encryptString','oauth2MicrosoftAuthorize','findOne','user','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token','data6','startRefreshInterval','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','json','offset','undefined','count','limit','set','destroy','then','end','error','name','send','padEnd','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','rows','MicrosoftAzure','data3','catch','show','params','length','find','service','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x55fa,0x12e));var _0xa55f=function(_0x332282,_0x3514e1){_0x332282=_0x332282-0x0;var _0x30600b=_0x55fa[_0x332282];return _0x30600b;};'use strict';var _=require('lodash');var Redis=require(_0xa55f('0x0'));var qs=require(_0xa55f('0x1'));var encryptor=require(_0xa55f('0x2'));var config=require(_0xa55f('0x3'));var logger=require('../../config/logger')('api');var db=require(_0xa55f('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xa55f('0x5')]=_[_0xa55f('0x6')](config[_0xa55f('0x5')],{'host':_0xa55f('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55f('0x5')]));var redis=new Redis(config[_0xa55f('0x5')]);function respondWithStatusCode(_0x53f0d6,_0x249a1b){_0x249a1b=_0x249a1b||0xcc;return function(_0x4cd03e){if(_0x4cd03e){return _0x53f0d6[_0xa55f('0x8')](_0x249a1b);}return _0x53f0d6[_0xa55f('0x9')](_0x249a1b)['end']();};}function respondWithResult(_0x31f9bb,_0x2a716a){_0x2a716a=_0x2a716a||0xc8;return function(_0xce9fbc){if(_0xce9fbc){return _0x31f9bb[_0xa55f('0x9')](_0x2a716a)[_0xa55f('0xa')](_0xce9fbc);}};}function respondWithFilteredResult(_0x283d6a,_0x21f84c){return function(_0x17e71a){if(_0x17e71a){var _0x4dc9fc=typeof _0x21f84c[_0xa55f('0xb')]===_0xa55f('0xc')&&typeof _0x21f84c['limit']===_0xa55f('0xc');var _0x236f6e=_0x17e71a[_0xa55f('0xd')];var _0x2ef55a=_0x4dc9fc?0x0:_0x21f84c[_0xa55f('0xb')];var _0x314594=_0x4dc9fc?_0x17e71a[_0xa55f('0xd')]:_0x21f84c['offset']+_0x21f84c[_0xa55f('0xe')];var _0x2e2d4a;if(_0x314594>=_0x236f6e){_0x314594=_0x236f6e;_0x2e2d4a=0xc8;}else{_0x2e2d4a=0xce;}_0x283d6a[_0xa55f('0x9')](_0x2e2d4a);return _0x283d6a[_0xa55f('0xf')]('Content-Range',_0x2ef55a+'-'+_0x314594+'/'+_0x236f6e)[_0xa55f('0xa')](_0x17e71a);}return null;};}function saveUpdates(_0x1b2ec4){return function(_0x57f11b){if(_0x57f11b){return _0x57f11b['update'](_0x1b2ec4)['then'](function(_0x3b227c){return _0x3b227c;});}return null;};}function removeEntity(_0xd5257c){return function(_0x333612){if(_0x333612){return _0x333612[_0xa55f('0x10')]()[_0xa55f('0x11')](function(){_0xd5257c[_0xa55f('0x9')](0xcc)[_0xa55f('0x12')]();});}};}function handleEntityNotFound(_0x247d7f){return function(_0x285be0){if(!_0x285be0){_0x247d7f['sendStatus'](0x194);}return _0x285be0;};}function handleError(_0x4b3286,_0x414dc5){_0x414dc5=_0x414dc5||0x1f4;return function(_0x529d21){logger[_0xa55f('0x13')](_0x529d21['stack']);if(_0x529d21[_0xa55f('0x14')]){delete _0x529d21[_0xa55f('0x14')];}_0x4b3286[_0xa55f('0x9')](_0x414dc5)[_0xa55f('0x15')](_0x529d21);};}function maskClientSecret(_0xc571a8){return _[_0xa55f('0x16')](_0xc571a8['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x25197c,_0x5dc2a2){var _0x2ae783={},_0x276814={},_0x70b1c7={'count':0x0,'rows':[]};var _0x29ddc8=_['map'](db[_0xa55f('0x17')][_0xa55f('0x18')],function(_0x4e3ad3){return{'name':_0x4e3ad3[_0xa55f('0x19')],'type':_0x4e3ad3[_0xa55f('0x1a')][_0xa55f('0x1b')]};});_0x276814[_0xa55f('0x1c')]=_['map'](_0x29ddc8,'name');_0x276814[_0xa55f('0x1d')]=_[_0xa55f('0x1e')](_0x25197c['query']);_0x276814['filters']=_[_0xa55f('0x1f')](_0x276814['model'],_0x276814[_0xa55f('0x1d')]);_0x2ae783[_0xa55f('0x20')]=_[_0xa55f('0x1f')](_0x276814['model'],qs[_0xa55f('0x21')](_0x25197c[_0xa55f('0x1d')]['fields']));_0x2ae783[_0xa55f('0x20')]=_0x2ae783[_0xa55f('0x20')]['length']?_0x2ae783[_0xa55f('0x20')]:_0x276814[_0xa55f('0x1c')];if(!_0x25197c[_0xa55f('0x1d')][_0xa55f('0x22')](_0xa55f('0x23'))){_0x2ae783[_0xa55f('0xe')]=qs[_0xa55f('0xe')](_0x25197c[_0xa55f('0x1d')][_0xa55f('0xe')]);_0x2ae783['offset']=qs[_0xa55f('0xb')](_0x25197c[_0xa55f('0x1d')][_0xa55f('0xb')]);}_0x2ae783['order']=qs[_0xa55f('0x24')](_0x25197c[_0xa55f('0x1d')][_0xa55f('0x24')]);_0x2ae783[_0xa55f('0x25')]=qs[_0xa55f('0x26')](_[_0xa55f('0x27')](_0x25197c[_0xa55f('0x1d')],_0x276814['filters']),_0x29ddc8);if(_0x25197c[_0xa55f('0x1d')][_0xa55f('0x28')]){_0x2ae783[_0xa55f('0x25')]=_[_0xa55f('0x29')](_0x2ae783[_0xa55f('0x25')],{'$or':_[_0xa55f('0x2a')](_0x29ddc8,function(_0x590b3b){if(_0x590b3b[_0xa55f('0x1a')]!=='VIRTUAL'){var _0x51c8d5={};_0x51c8d5[_0x590b3b[_0xa55f('0x14')]]={'$like':'%'+_0x25197c[_0xa55f('0x1d')][_0xa55f('0x28')]+'%'};return _0x51c8d5;}})});}_0x2ae783=_[_0xa55f('0x29')]({},_0x2ae783,_0x25197c[_0xa55f('0x2b')]);var _0x41c8d1={'where':_0x2ae783[_0xa55f('0x25')]};return db[_0xa55f('0x17')][_0xa55f('0xd')](_0x41c8d1)[_0xa55f('0x11')](function(_0x5ea543){_0x70b1c7[_0xa55f('0xd')]=_0x5ea543;if(_0x25197c[_0xa55f('0x1d')][_0xa55f('0x2c')]){_0x2ae783[_0xa55f('0x2d')]=[{'all':!![]}];}return db[_0xa55f('0x17')][_0xa55f('0x2e')](_0x2ae783);})['then'](function(_0x1b4fc9){_0x70b1c7[_0xa55f('0x2f')]=_[_0xa55f('0x2a')](_0x1b4fc9,function(_0x2d4c91){if(_0x2d4c91['service']===_0xa55f('0x30')){var _0x3fbbb3=encryptor['decryptString'](_0x2d4c91[_0xa55f('0x31')]);_0x2d4c91['data3']=maskClientSecret(_0x3fbbb3);}return _0x2d4c91;});return _0x70b1c7;})[_0xa55f('0x11')](respondWithFilteredResult(_0x5dc2a2,_0x2ae783))[_0xa55f('0x32')](handleError(_0x5dc2a2,null));};exports[_0xa55f('0x33')]=function(_0x85eb7b,_0x3f9649){var _0x142e09={'raw':!![],'where':{'id':_0x85eb7b[_0xa55f('0x34')]['id']}},_0x3a26f6={};_0x3a26f6['model']=_[_0xa55f('0x1e')](db[_0xa55f('0x17')][_0xa55f('0x18')]);_0x3a26f6[_0xa55f('0x1d')]=_[_0xa55f('0x1e')](_0x85eb7b[_0xa55f('0x1d')]);_0x3a26f6[_0xa55f('0x26')]=_[_0xa55f('0x1f')](_0x3a26f6['model'],_0x3a26f6[_0xa55f('0x1d')]);_0x142e09[_0xa55f('0x20')]=_[_0xa55f('0x1f')](_0x3a26f6[_0xa55f('0x1c')],qs[_0xa55f('0x21')](_0x85eb7b[_0xa55f('0x1d')][_0xa55f('0x21')]));_0x142e09['attributes']=_0x142e09[_0xa55f('0x20')][_0xa55f('0x35')]?_0x142e09[_0xa55f('0x20')]:_0x3a26f6['model'];if(_0x85eb7b[_0xa55f('0x1d')][_0xa55f('0x2c')]){_0x142e09[_0xa55f('0x2d')]=[{'all':!![]}];}_0x142e09=_['merge']({},_0x142e09,_0x85eb7b[_0xa55f('0x2b')]);return db[_0xa55f('0x17')][_0xa55f('0x36')](_0x142e09)[_0xa55f('0x11')](handleEntityNotFound(_0x3f9649,null))[_0xa55f('0x11')](function(_0x5e2eba){if(_0x5e2eba[_0xa55f('0x37')]===_0xa55f('0x30')){var _0x5e1b4b=encryptor[_0xa55f('0x38')](_0x5e2eba[_0xa55f('0x31')]);_0x5e2eba['data3']=maskClientSecret(_0x5e1b4b);}return _0x5e2eba;})[_0xa55f('0x11')](respondWithResult(_0x3f9649,null))[_0xa55f('0x32')](handleError(_0x3f9649,null));};exports[_0xa55f('0x39')]=function(_0x13ed0f,_0xe0a73f){if(!_0x13ed0f[_0xa55f('0x3a')]['name'])throw new Error(_0xa55f('0x3b'));if(!_0x13ed0f[_0xa55f('0x3a')][_0xa55f('0x37')])throw new Error(_0xa55f('0x3c'));var _0x959a7b=db[_0xa55f('0x17')]['rawAttributes'][_0xa55f('0x37')][_0xa55f('0x3d')];if(!_0x959a7b[_0xa55f('0x3e')](_0x13ed0f[_0xa55f('0x3a')][_0xa55f('0x37')]))throw new Error(_0xa55f('0x3f')+_0x959a7b[_0xa55f('0x40')](',\x20'));if(_0x13ed0f[_0xa55f('0x3a')][_0xa55f('0x37')]===_0xa55f('0x30')&&_0x13ed0f['body']['data3']){_0x13ed0f[_0xa55f('0x3a')][_0xa55f('0x31')]=encryptor['encryptString'](_0x13ed0f[_0xa55f('0x3a')]['data3']);}return db[_0xa55f('0x17')][_0xa55f('0x39')](_0x13ed0f[_0xa55f('0x3a')],{})[_0xa55f('0x11')](respondWithResult(_0xe0a73f,0xc9))[_0xa55f('0x32')](handleError(_0xe0a73f,null));};exports[_0xa55f('0x41')]=function(_0x474e00,_0x37dd9c){if(_0x474e00[_0xa55f('0x3a')]['id']){delete _0x474e00[_0xa55f('0x3a')]['id'];}return db[_0xa55f('0x17')][_0xa55f('0x36')]({'where':{'id':_0x474e00['params']['id']}})[_0xa55f('0x11')](handleEntityNotFound(_0x37dd9c,null))[_0xa55f('0x11')](function(_0x1d9421){if(_0x1d9421[_0xa55f('0x37')]==='MicrosoftAzure'&&_0x474e00[_0xa55f('0x3a')][_0xa55f('0x31')]){_0x474e00['body'][_0xa55f('0x31')]=encryptor[_0xa55f('0x42')](_0x474e00['body'][_0xa55f('0x31')]);}return _0x1d9421;})[_0xa55f('0x11')](saveUpdates(_0x474e00['body'],null))[_0xa55f('0x11')](respondWithResult(_0x37dd9c,null))[_0xa55f('0x32')](handleError(_0x37dd9c,null));};exports[_0xa55f('0x10')]=function(_0x4096ee,_0x26ec87){return db[_0xa55f('0x17')][_0xa55f('0x36')]({'where':{'id':_0x4096ee['params']['id']}})['then'](handleEntityNotFound(_0x26ec87,null))[_0xa55f('0x11')](removeEntity(_0x26ec87,null))[_0xa55f('0x32')](handleError(_0x26ec87,null));};exports[_0xa55f('0x43')]=function(_0x460b82,_0x219276){return db[_0xa55f('0x17')][_0xa55f('0x44')]({'where':{'id':_0x460b82[_0xa55f('0x34')]['id']},'raw':!![]})[_0xa55f('0x11')](function(_0x31fa0a){if(!_0x31fa0a)return _0x219276[_0xa55f('0x8')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x31fa0a,_0x460b82[_0xa55f('0x45')]['id'])};})['then'](respondWithResult(_0x219276,null))[_0xa55f('0x32')](handleError(_0x219276,null));};exports['oauth2MicrosoftCallback']=function(_0x2370e3,_0x510e1e){var _0x1a7d12=_0x2370e3[_0xa55f('0x3a')];var _0x4f23ff;var _0x18c4a2;if(_0x1a7d12[_0xa55f('0x13')])throw _0x1a7d12;redis[_0xa55f('0x46')](_0x1a7d12[_0xa55f('0x47')])[_0xa55f('0x11')](function(_0x2e5003){if(!_0x2e5003)throw new Error(_0xa55f('0x48'));_0x4f23ff=JSON[_0xa55f('0x49')](_0x2e5003);var _0x113f66=Buffer['from'](_0x1a7d12[_0xa55f('0x47')],_0xa55f('0x4a'))[_0xa55f('0x4b')](_0xa55f('0x4c'));_0x18c4a2=JSON[_0xa55f('0x49')](_0x113f66);if(!oauth[_0xa55f('0x4d')](_0x1a7d12['id_token'],_0x4f23ff[_0xa55f('0x4e')]))throw new Error(_0xa55f('0x4f'));redis[_0xa55f('0x50')](_0x1a7d12[_0xa55f('0x47')]);return oauth[_0xa55f('0x51')](_0x1a7d12[_0xa55f('0x52')],_0x4f23ff);})[_0xa55f('0x11')](function(_0x16dc4c){_0x4f23ff[_0xa55f('0x53')]=_0x16dc4c['access_token'];_0x4f23ff['data6']=_0x16dc4c[_0xa55f('0x54')];return db['CloudProvider'][_0xa55f('0x41')]({'data5':_0x4f23ff[_0xa55f('0x53')],'data6':_0x4f23ff[_0xa55f('0x55')]},{'where':{'id':_0x4f23ff['id']}});})[_0xa55f('0x11')](function(){oauth[_0xa55f('0x56')](_0x4f23ff);socket['emit']('microsoftAuthorization:success',{'id':_0x18c4a2['id']});return;})[_0xa55f('0x11')](respondWithStatusCode(_0x510e1e,null))['catch'](function(_0x597d58){if(_0x18c4a2){socket['emit'](_0xa55f('0x57'),{'id':_0x18c4a2['id']});}if(!_0x4f23ff){logger[_0xa55f('0x13')](_0xa55f('0x58'),_0x597d58);return _0x510e1e[_0xa55f('0x9')](0x1f4)[_0xa55f('0x15')](_0x597d58[_0xa55f('0x59')]);}logger[_0xa55f('0x13')](_0xa55f('0x5a'),_0x4f23ff['id'],JSON[_0xa55f('0x5b')](_0x597d58));});};
\ No newline at end of file
+var _0xaa51=['findAll','rows','service','MicrosoftAzure','data3','catch','show','params','rawAttributes','merge','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','stack','name','padEnd','index','map','CloudProvider','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','type','VIRTUAL','filter','options','includeAll','include'];(function(_0x892f29,_0x3d4087){var _0x233136=function(_0x4f9e85){while(--_0x4f9e85){_0x892f29['push'](_0x892f29['shift']());}};_0x233136(++_0x3d4087);}(_0xaa51,0x92));var _0x1aa5=function(_0x56798d,_0x4b5937){_0x56798d=_0x56798d-0x0;var _0x2667f7=_0xaa51[_0x56798d];return _0x2667f7;};'use strict';var _=require(_0x1aa5('0x0'));var Redis=require(_0x1aa5('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x1aa5('0x2'));var config=require(_0x1aa5('0x3'));var logger=require(_0x1aa5('0x4'))(_0x1aa5('0x5'));var db=require(_0x1aa5('0x6'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x1aa5('0x7')]=_[_0x1aa5('0x8')](config[_0x1aa5('0x7')],{'host':_0x1aa5('0x9'),'port':0x18eb});var socket=require(_0x1aa5('0xa'))(new Redis(config[_0x1aa5('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x13eeb1,_0x2680b4){_0x2680b4=_0x2680b4||0xcc;return function(_0x3f849b){if(_0x3f849b){return _0x13eeb1[_0x1aa5('0xb')](_0x2680b4);}return _0x13eeb1[_0x1aa5('0xc')](_0x2680b4)[_0x1aa5('0xd')]();};}function respondWithResult(_0x49692e,_0xdb91e5){_0xdb91e5=_0xdb91e5||0xc8;return function(_0x3096aa){if(_0x3096aa){return _0x49692e[_0x1aa5('0xc')](_0xdb91e5)[_0x1aa5('0xe')](_0x3096aa);}};}function respondWithFilteredResult(_0x2bd5df,_0x1b3c99){return function(_0x4e97b){if(_0x4e97b){var _0x5a822b=typeof _0x1b3c99[_0x1aa5('0xf')]==='undefined'&&typeof _0x1b3c99['limit']===_0x1aa5('0x10');var _0x261b12=_0x4e97b[_0x1aa5('0x11')];var _0x472995=_0x5a822b?0x0:_0x1b3c99[_0x1aa5('0xf')];var _0x51f77c=_0x5a822b?_0x4e97b[_0x1aa5('0x11')]:_0x1b3c99[_0x1aa5('0xf')]+_0x1b3c99[_0x1aa5('0x12')];var _0x83833a;if(_0x51f77c>=_0x261b12){_0x51f77c=_0x261b12;_0x83833a=0xc8;}else{_0x83833a=0xce;}_0x2bd5df[_0x1aa5('0xc')](_0x83833a);return _0x2bd5df[_0x1aa5('0x13')](_0x1aa5('0x14'),_0x472995+'-'+_0x51f77c+'/'+_0x261b12)[_0x1aa5('0xe')](_0x4e97b);}return null;};}function saveUpdates(_0x5a9e26){return function(_0x232ef4){if(_0x232ef4){return _0x232ef4['update'](_0x5a9e26)[_0x1aa5('0x15')](function(_0x2530fd){return _0x2530fd;});}return null;};}function removeEntity(_0x5bdd48){return function(_0xb7757){if(_0xb7757){return _0xb7757[_0x1aa5('0x16')]()['then'](function(){_0x5bdd48['status'](0xcc)[_0x1aa5('0xd')]();});}};}function handleEntityNotFound(_0x309e5a){return function(_0x3b4177){if(!_0x3b4177){_0x309e5a['sendStatus'](0x194);}return _0x3b4177;};}function handleError(_0x478e4d,_0x1b8149){_0x1b8149=_0x1b8149||0x1f4;return function(_0x332066){logger[_0x1aa5('0x17')](_0x332066[_0x1aa5('0x18')]);if(_0x332066[_0x1aa5('0x19')]){delete _0x332066[_0x1aa5('0x19')];}_0x478e4d['status'](_0x1b8149)['send'](_0x332066);};}function maskClientSecret(_0x4b5e6d){return _[_0x1aa5('0x1a')](_0x4b5e6d['slice'](0x0,0x3),0x14,'*');}exports[_0x1aa5('0x1b')]=function(_0x47f587,_0x27672b){var _0x38f618={},_0x229123={},_0x6df553={'count':0x0,'rows':[]};var _0x1292d2=_[_0x1aa5('0x1c')](db[_0x1aa5('0x1d')]['rawAttributes'],function(_0x4f0635){return{'name':_0x4f0635['fieldName'],'type':_0x4f0635['type'][_0x1aa5('0x1e')]};});_0x229123[_0x1aa5('0x1f')]=_[_0x1aa5('0x1c')](_0x1292d2,'name');_0x229123[_0x1aa5('0x20')]=_[_0x1aa5('0x21')](_0x47f587[_0x1aa5('0x20')]);_0x229123['filters']=_[_0x1aa5('0x22')](_0x229123[_0x1aa5('0x1f')],_0x229123['query']);_0x38f618[_0x1aa5('0x23')]=_[_0x1aa5('0x22')](_0x229123[_0x1aa5('0x1f')],qs['fields'](_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x24')]));_0x38f618[_0x1aa5('0x23')]=_0x38f618[_0x1aa5('0x23')][_0x1aa5('0x25')]?_0x38f618[_0x1aa5('0x23')]:_0x229123[_0x1aa5('0x1f')];if(!_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x26')]('nolimit')){_0x38f618[_0x1aa5('0x12')]=qs[_0x1aa5('0x12')](_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x12')]);_0x38f618[_0x1aa5('0xf')]=qs[_0x1aa5('0xf')](_0x47f587[_0x1aa5('0x20')][_0x1aa5('0xf')]);}_0x38f618['order']=qs[_0x1aa5('0x27')](_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x27')]);_0x38f618[_0x1aa5('0x28')]=qs[_0x1aa5('0x29')](_['pick'](_0x47f587[_0x1aa5('0x20')],_0x229123[_0x1aa5('0x29')]),_0x1292d2);if(_0x47f587[_0x1aa5('0x20')]['filter']){_0x38f618[_0x1aa5('0x28')]=_['merge'](_0x38f618[_0x1aa5('0x28')],{'$or':_['map'](_0x1292d2,function(_0x53fc6b){if(_0x53fc6b[_0x1aa5('0x2a')]!==_0x1aa5('0x2b')){var _0x54e884={};_0x54e884[_0x53fc6b[_0x1aa5('0x19')]]={'$like':'%'+_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x2c')]+'%'};return _0x54e884;}})});}_0x38f618=_['merge']({},_0x38f618,_0x47f587[_0x1aa5('0x2d')]);var _0x4c12b2={'where':_0x38f618[_0x1aa5('0x28')]};return db[_0x1aa5('0x1d')]['count'](_0x4c12b2)['then'](function(_0x12aafa){_0x6df553[_0x1aa5('0x11')]=_0x12aafa;if(_0x47f587[_0x1aa5('0x20')][_0x1aa5('0x2e')]){_0x38f618[_0x1aa5('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0x1aa5('0x30')](_0x38f618);})[_0x1aa5('0x15')](function(_0x3339e1){_0x6df553[_0x1aa5('0x31')]=_[_0x1aa5('0x1c')](_0x3339e1,function(_0x2db581){if(_0x2db581[_0x1aa5('0x32')]===_0x1aa5('0x33')){var _0x2e543b=encryptor['decryptString'](_0x2db581['data3']);_0x2db581[_0x1aa5('0x34')]=maskClientSecret(_0x2e543b);}return _0x2db581;});return _0x6df553;})[_0x1aa5('0x15')](respondWithFilteredResult(_0x27672b,_0x38f618))[_0x1aa5('0x35')](handleError(_0x27672b,null));};exports[_0x1aa5('0x36')]=function(_0x50f4b2,_0x58cb0f){var _0x15f487={'raw':!![],'where':{'id':_0x50f4b2[_0x1aa5('0x37')]['id']}},_0x552389={};_0x552389[_0x1aa5('0x1f')]=_[_0x1aa5('0x21')](db['CloudProvider'][_0x1aa5('0x38')]);_0x552389[_0x1aa5('0x20')]=_['keys'](_0x50f4b2[_0x1aa5('0x20')]);_0x552389[_0x1aa5('0x29')]=_[_0x1aa5('0x22')](_0x552389['model'],_0x552389[_0x1aa5('0x20')]);_0x15f487['attributes']=_[_0x1aa5('0x22')](_0x552389[_0x1aa5('0x1f')],qs['fields'](_0x50f4b2[_0x1aa5('0x20')]['fields']));_0x15f487['attributes']=_0x15f487[_0x1aa5('0x23')]['length']?_0x15f487['attributes']:_0x552389['model'];if(_0x50f4b2['query']['includeAll']){_0x15f487['include']=[{'all':!![]}];}_0x15f487=_[_0x1aa5('0x39')]({},_0x15f487,_0x50f4b2['options']);return db[_0x1aa5('0x1d')][_0x1aa5('0x3a')](_0x15f487)[_0x1aa5('0x15')](handleEntityNotFound(_0x58cb0f,null))[_0x1aa5('0x15')](function(_0x35af36){if(_0x35af36[_0x1aa5('0x32')]===_0x1aa5('0x33')){var _0x7af12c=encryptor[_0x1aa5('0x3b')](_0x35af36[_0x1aa5('0x34')]);_0x35af36[_0x1aa5('0x34')]=maskClientSecret(_0x7af12c);}return _0x35af36;})[_0x1aa5('0x15')](respondWithResult(_0x58cb0f,null))[_0x1aa5('0x35')](handleError(_0x58cb0f,null));};exports[_0x1aa5('0x3c')]=function(_0xe18710,_0xa0176c){if(!_0xe18710[_0x1aa5('0x3d')][_0x1aa5('0x19')])throw new Error(_0x1aa5('0x3e'));if(!_0xe18710[_0x1aa5('0x3d')][_0x1aa5('0x32')])throw new Error(_0x1aa5('0x3f'));var _0x3877a7=db['CloudProvider'][_0x1aa5('0x38')][_0x1aa5('0x32')][_0x1aa5('0x40')];if(!_0x3877a7[_0x1aa5('0x41')](_0xe18710[_0x1aa5('0x3d')][_0x1aa5('0x32')]))throw new Error(_0x1aa5('0x42')+_0x3877a7['join'](',\x20'));if(_0xe18710[_0x1aa5('0x3d')]['service']===_0x1aa5('0x33')&&_0xe18710['body'][_0x1aa5('0x34')]){_0xe18710[_0x1aa5('0x3d')][_0x1aa5('0x34')]=encryptor[_0x1aa5('0x43')](_0xe18710['body'][_0x1aa5('0x34')]);}return db[_0x1aa5('0x1d')][_0x1aa5('0x3c')](_0xe18710[_0x1aa5('0x3d')],{})[_0x1aa5('0x15')](respondWithResult(_0xa0176c,0xc9))[_0x1aa5('0x35')](handleError(_0xa0176c,null));};exports[_0x1aa5('0x44')]=function(_0x3fc218,_0x33fada){if(_0x3fc218[_0x1aa5('0x3d')]['id']){delete _0x3fc218[_0x1aa5('0x3d')]['id'];}return db[_0x1aa5('0x1d')][_0x1aa5('0x3a')]({'where':{'id':_0x3fc218[_0x1aa5('0x37')]['id']}})[_0x1aa5('0x15')](handleEntityNotFound(_0x33fada,null))[_0x1aa5('0x15')](function(_0xb8caa9){if(_0xb8caa9[_0x1aa5('0x32')]===_0x1aa5('0x33')&&_0x3fc218[_0x1aa5('0x3d')][_0x1aa5('0x34')]){_0x3fc218['body']['data3']=encryptor['encryptString'](_0x3fc218[_0x1aa5('0x3d')][_0x1aa5('0x34')]);}return _0xb8caa9;})['then'](saveUpdates(_0x3fc218[_0x1aa5('0x3d')],null))[_0x1aa5('0x15')](respondWithResult(_0x33fada,null))[_0x1aa5('0x35')](handleError(_0x33fada,null));};exports['destroy']=function(_0x3cf84b,_0x2d0cce){return db[_0x1aa5('0x1d')][_0x1aa5('0x3a')]({'where':{'id':_0x3cf84b[_0x1aa5('0x37')]['id']}})[_0x1aa5('0x15')](handleEntityNotFound(_0x2d0cce,null))[_0x1aa5('0x15')](removeEntity(_0x2d0cce,null))[_0x1aa5('0x35')](handleError(_0x2d0cce,null));};exports[_0x1aa5('0x45')]=function(_0x274ed0,_0x3baf54){return db['CloudProvider'][_0x1aa5('0x46')]({'where':{'id':_0x274ed0['params']['id']},'raw':!![]})['then'](function(_0xec58e7){if(!_0xec58e7)return _0x3baf54[_0x1aa5('0xb')](0x194);return{'url':oauth[_0x1aa5('0x47')](_0xec58e7,_0x274ed0[_0x1aa5('0x48')]['id'])};})[_0x1aa5('0x15')](respondWithResult(_0x3baf54,null))['catch'](handleError(_0x3baf54,null));};exports[_0x1aa5('0x49')]=function(_0x35649a,_0x201ec9){var _0x44088d=_0x35649a['body'];var _0x2ad6a5;var _0x46497e;if(_0x44088d[_0x1aa5('0x17')])throw _0x44088d;redis[_0x1aa5('0x4a')](_0x44088d[_0x1aa5('0x4b')])[_0x1aa5('0x15')](function(_0x1b2a38){if(!_0x1b2a38)throw new Error(_0x1aa5('0x4c'));_0x2ad6a5=JSON[_0x1aa5('0x4d')](_0x1b2a38);var _0x3999d9=Buffer[_0x1aa5('0x4e')](_0x44088d[_0x1aa5('0x4b')],_0x1aa5('0x4f'))[_0x1aa5('0x50')]('ascii');_0x46497e=JSON[_0x1aa5('0x4d')](_0x3999d9);if(!oauth[_0x1aa5('0x51')](_0x44088d[_0x1aa5('0x52')],_0x2ad6a5[_0x1aa5('0x53')]))throw new Error(_0x1aa5('0x54'));redis[_0x1aa5('0x55')](_0x44088d[_0x1aa5('0x4b')]);return oauth[_0x1aa5('0x56')](_0x44088d[_0x1aa5('0x57')],_0x2ad6a5);})[_0x1aa5('0x15')](function(_0x409801){_0x2ad6a5['data5']=_0x409801[_0x1aa5('0x58')];_0x2ad6a5[_0x1aa5('0x59')]=_0x409801[_0x1aa5('0x5a')];return db['CloudProvider'][_0x1aa5('0x44')]({'data5':_0x2ad6a5['data5'],'data6':_0x2ad6a5['data6']},{'where':{'id':_0x2ad6a5['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x2ad6a5);socket['emit']('microsoftAuthorization:success',{'id':_0x46497e['id']});return;})[_0x1aa5('0x15')](respondWithStatusCode(_0x201ec9,null))[_0x1aa5('0x35')](function(_0x1deb53){if(_0x46497e){socket[_0x1aa5('0x5b')](_0x1aa5('0x5c'),{'id':_0x46497e['id']});}if(!_0x2ad6a5){logger[_0x1aa5('0x17')](_0x1aa5('0x5d'),_0x1deb53);return _0x201ec9[_0x1aa5('0xc')](0x1f4)[_0x1aa5('0x5e')](_0x1deb53['message']);}logger[_0x1aa5('0x17')](_0x1aa5('0x5f'),_0x2ad6a5['id'],JSON[_0x1aa5('0x60')](_0x1deb53));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index fce2e7b..5e06edb 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 _0xbc2f=['rimraf','./cloudProvider.attributes','exports','define','CloudProvider','../../config/logger','api','moment','request-promise'];(function(_0x32b0fc,_0x482f22){var _0x2274e1=function(_0x2a4599){while(--_0x2a4599){_0x32b0fc['push'](_0x32b0fc['shift']());}};_0x2274e1(++_0x482f22);}(_0xbc2f,0x16d));var _0xfbc2=function(_0x2af219,_0x280514){_0x2af219=_0x2af219-0x0;var _0xad6991=_0xbc2f[_0x2af219];return _0xad6991;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfbc2('0x0'))(_0xfbc2('0x1'));var moment=require(_0xfbc2('0x2'));var BPromise=require('bluebird');var rp=require(_0xfbc2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbc2('0x4'));var config=require('../../config/environment');var attributes=require(_0xfbc2('0x5'));module[_0xfbc2('0x6')]=function(_0x5e24fb,_0x7a4203){return _0x5e24fb[_0xfbc2('0x7')](_0xfbc2('0x8'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f53=['bluebird','path','rimraf','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x53cd94,_0xdb71b0){var _0x1d3b02=function(_0x789d69){while(--_0x789d69){_0x53cd94['push'](_0x53cd94['shift']());}};_0x1d3b02(++_0xdb71b0);}(_0x6f53,0x19f));var _0x36f5=function(_0x31c81b,_0x20f535){_0x31c81b=_0x31c81b-0x0;var _0x371034=_0x6f53[_0x31c81b];return _0x371034;};'use strict';var _=require(_0x36f5('0x0'));var util=require(_0x36f5('0x1'));var logger=require(_0x36f5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x36f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36f5('0x4'));var rimraf=require(_0x36f5('0x5'));var config=require('../../config/environment');var attributes=require(_0x36f5('0x6'));module[_0x36f5('0x7')]=function(_0x536c03,_0x3d9bf3){return _0x536c03[_0x36f5('0x8')](_0x36f5('0x9'),attributes,{'tableName':_0x36f5('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 5e0aae7..5741dae 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 _0x4e56=['https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','base64','toString','hex','client_id','data1','response_type','redirect_uri','data4','form_post','scope','prompt','value','oauth2Claims','oauth2/','set','stringify','payload','iss','issuer','aud','nonce','unix','exp','resolve','data3','findOne','refresh_token','data6','decryptString','POST','data5','access_token','CloudProvider','update','then','error','authorization_code','intervals','bind','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All'];(function(_0x15cd00,_0x2565de){var _0x67350f=function(_0x6829be){while(--_0x6829be){_0x15cd00['push'](_0x15cd00['shift']());}};_0x67350f(++_0x2565de);}(_0x4e56,0x89));var _0x64e5=function(_0x3f2546,_0x2ff601){_0x3f2546=_0x3f2546-0x0;var _0x47dc25=_0x4e56[_0x3f2546];return _0x47dc25;};'use strict';var _=require(_0x64e5('0x0'));var crypto=require(_0x64e5('0x1'));var jwt=require(_0x64e5('0x2'));var moment=require('moment');var Redis=require(_0x64e5('0x3'));var rp=require(_0x64e5('0x4'));var util=require(_0x64e5('0x5'));var encryptor=require(_0x64e5('0x6'));var config=require(_0x64e5('0x7'));var logger=require('../../config/logger')(_0x64e5('0x8'));var schedule=require(_0x64e5('0x9'));var db=require(_0x64e5('0xa'))['db'];config[_0x64e5('0xb')]=_['defaults'](config[_0x64e5('0xb')],{'host':_0x64e5('0xc'),'port':0x18eb});var redis=new Redis(config[_0x64e5('0xb')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x64e5('0xd'),'profile',_0x64e5('0xe'),_0x64e5('0xf'),_0x64e5('0x10'),_0x64e5('0x11'),_0x64e5('0x12')],'Dynamics365':[_0x64e5('0xd'),_0x64e5('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x64e5('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x64e5('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x247bc0){var _0x442c4b=_['map'](AZURE_AUTH_SCOPES[_0x247bc0[_0x64e5('0x15')]]);if(_0x247bc0[_0x64e5('0x15')]===_0x64e5('0x16'))_0x442c4b[_0x64e5('0x17')](_0x247bc0[_0x64e5('0x18')]+_0x64e5('0x19'));return _0x442c4b[_0x64e5('0x1a')]('\x20');}function getAccessTokenScope(_0x10c75b){if(_0x10c75b[_0x64e5('0x15')]===_0x64e5('0x1b'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x10c75b[_0x64e5('0x15')]===_0x64e5('0x16'))return _0x10c75b[_0x64e5('0x18')]+_0x64e5('0x19');}function generateMicrosoftAuthorizationUrl(_0x353e4b,_0x1eb0b6){var _0x4efda3=MICROSOFT_AUTH_URL[_0x64e5('0x1c')](_0x64e5('0x1d'),_0x353e4b[_0x64e5('0x1e')]);var _0xe750dc=[_0x64e5('0x1f'),_0x64e5('0x20')];var _0x2f9e2f=Buffer[_0x64e5('0x21')](JSON['stringify']({'id':_0x1eb0b6}))['toString'](_0x64e5('0x22'));var _0x53099f=crypto['randomBytes'](0x10)[_0x64e5('0x23')](_0x64e5('0x24'));var _0x39ebd8=getAuthorizationScopes(_0x353e4b);var _0x58c973=[{'key':_0x64e5('0x25'),'value':_0x353e4b[_0x64e5('0x26')]},{'key':_0x64e5('0x27'),'value':encodeURIComponent(_0xe750dc[_0x64e5('0x1a')]('\x20'))},{'key':_0x64e5('0x28'),'value':_0x353e4b[_0x64e5('0x29')]},{'key':'response_mode','value':_0x64e5('0x2a')},{'key':_0x64e5('0x2b'),'value':encodeURIComponent(_0x39ebd8)},{'key':'state','value':_0x2f9e2f},{'key':'nonce','value':_0x53099f},{'key':_0x64e5('0x2c'),'value':'login'}];var _0xee9a9e=_0x4efda3+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x58c973,function(_0x195dd1){return _0x195dd1['key']+'='+_0x195dd1[_0x64e5('0x2d')];})['join']('&');_0x353e4b[_0x64e5('0x2e')]={'issuer':_0x4efda3[_0x64e5('0x1c')](_0x64e5('0x2f'),''),'audience':_0x353e4b[_0x64e5('0x26')],'state':_0x2f9e2f,'nonce':_0x53099f};redis[_0x64e5('0x30')](_0x2f9e2f,JSON[_0x64e5('0x31')](_0x353e4b));return _0xee9a9e;}function isValidIdToken(_0x3548b1,_0x31e9dd){try{var _0x3b7008=jwt['decode'](_0x3548b1,{'complete':!![]});var _0x3b62af=_0x3b7008[_0x64e5('0x32')];if(_0x3b62af[_0x64e5('0x33')]!==_0x31e9dd[_0x64e5('0x34')])return![];if(_0x3b62af[_0x64e5('0x35')]!==_0x31e9dd['audience'])return![];if(_0x3b62af[_0x64e5('0x36')]!==_0x31e9dd[_0x64e5('0x36')])return![];if(moment()['isAfter'](moment[_0x64e5('0x37')](_0x3b62af[_0x64e5('0x38')])))return![];return!![];}catch(_0x311dd8){throw _0x311dd8;}}function refreshOauth2MicrosoftAccessToken(_0x131b67){return Promise[_0x64e5('0x39')]()['then'](function(){if(_0x131b67[_0x64e5('0x3a')])return _0x131b67;return db['CloudProvider'][_0x64e5('0x3b')]({'where':{'id':_0x131b67['id']},'raw':!![]});})['then'](function(_0x49e612){var _0x5b95a2={'grant_type':_0x64e5('0x3c'),'refresh_token':_0x49e612[_0x64e5('0x3d')],'scope':getAccessTokenScope(_0x49e612),'redirect_uri':_0x49e612['data4'],'client_id':_0x49e612[_0x64e5('0x26')],'client_secret':encryptor[_0x64e5('0x3e')](_0x49e612['data3'])};var _0x58a708={'method':_0x64e5('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0x64e5('0x1d'),_0x49e612['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5b95a2,'json':!![]};return rp(_0x58a708);})['then'](function(_0x92ef9a){_0x131b67[_0x64e5('0x40')]=_0x92ef9a[_0x64e5('0x41')];_0x131b67['data6']=_0x92ef9a[_0x64e5('0x3c')];return db[_0x64e5('0x42')][_0x64e5('0x43')]({'data5':_0x131b67[_0x64e5('0x40')],'data6':_0x131b67[_0x64e5('0x3d')]},{'where':{'id':_0x131b67['id']}});})[_0x64e5('0x44')](function(){return _0x131b67;})['catch'](function(_0x54602a){logger[_0x64e5('0x45')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x131b67['id'],_0x54602a);});}function getOauth2MicrosoftAccessToken(_0x3d390e,_0x3b1b90){var _0x4bf945={'grant_type':_0x64e5('0x46'),'code':_0x3d390e,'scope':getAccessTokenScope(_0x3b1b90),'redirect_uri':_0x3b1b90[_0x64e5('0x29')],'client_id':_0x3b1b90[_0x64e5('0x26')],'client_secret':encryptor['decryptString'](_0x3b1b90[_0x64e5('0x3a')])};var _0x4ce37a={'method':_0x64e5('0x3f'),'uri':MICROSOFT_AUTH_URL[_0x64e5('0x1c')](_0x64e5('0x1d'),_0x3b1b90[_0x64e5('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4bf945,'json':!![]};return rp(_0x4ce37a);}function startRefreshInterval(_0x3183b4){var _0xf92f16=schedule[_0x64e5('0x47')];if(_0xf92f16[_0x3183b4['id']])clearInterval(_0xf92f16[_0x3183b4['id']]);_0xf92f16[_0x3183b4['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x64e5('0x48')](this,{'id':_0x3183b4['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0xf92f16;}function startAllRefreshIntervals(){return db[_0x64e5('0x42')][_0x64e5('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x49acf4){var _0x588e76=_0x49acf4['map'](function(_0x3fae41){return refreshOauth2MicrosoftAccessToken(_0x3fae41)['then'](function(_0x3374aa){startRefreshInterval(_0x3374aa);});});return Promise['all'](_0x588e76);})['catch'](function(_0x57cc30){var _0x4ebc34=_0x57cc30?util[_0x64e5('0x4a')](_0x57cc30,{'showHidden':![],'depth':null}):'';logger['error'](_0x64e5('0x4b'),_0x4ebc34);});}module[_0x64e5('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x8559=['../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','map','type','Dynamics365','/.default','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','data1','response_type','join','redirect_uri','data4','form_post','scope','state','nonce','login','key','value','oauth2Claims','replace','oauth2/','decode','payload','iss','issuer','aud','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data5','access_token','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor'];(function(_0x218554,_0x2896f4){var _0x3a2bbf=function(_0x106868){while(--_0x106868){_0x218554['push'](_0x218554['shift']());}};_0x3a2bbf(++_0x2896f4);}(_0x8559,0x175));var _0x9855=function(_0xcd47a,_0x100962){_0xcd47a=_0xcd47a-0x0;var _0x4b58dd=_0x8559[_0xcd47a];return _0x4b58dd;};'use strict';var _=require('lodash');var crypto=require(_0x9855('0x0'));var jwt=require(_0x9855('0x1'));var moment=require(_0x9855('0x2'));var Redis=require(_0x9855('0x3'));var rp=require(_0x9855('0x4'));var util=require(_0x9855('0x5'));var encryptor=require(_0x9855('0x6'));var config=require(_0x9855('0x7'));var logger=require(_0x9855('0x8'))(_0x9855('0x9'));var schedule=require(_0x9855('0xa'));var db=require(_0x9855('0xb'))['db'];config[_0x9855('0xc')]=_[_0x9855('0xd')](config[_0x9855('0xc')],{'host':_0x9855('0xe'),'port':0x18eb});var redis=new Redis(config[_0x9855('0xc')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x9855('0xf'),_0x9855('0x10'),'offline_access',_0x9855('0x11'),_0x9855('0x12'),_0x9855('0x13')],'Dynamics365':[_0x9855('0x14'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x9855('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4727da){var _0x2d6e66=_[_0x9855('0x16')](AZURE_AUTH_SCOPES[_0x4727da[_0x9855('0x17')]]);if(_0x4727da[_0x9855('0x17')]===_0x9855('0x18'))_0x2d6e66['push'](_0x4727da['data7']+_0x9855('0x19'));return _0x2d6e66['join']('\x20');}function getAccessTokenScope(_0x718a08){if(_0x718a08[_0x9855('0x17')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x718a08[_0x9855('0x17')]===_0x9855('0x18'))return _0x718a08['data7']+_0x9855('0x19');}function generateMicrosoftAuthorizationUrl(_0x28cd68,_0x27afd4){var _0x5b1953=MICROSOFT_AUTH_URL['replace'](_0x9855('0x1a'),_0x28cd68[_0x9855('0x1b')]);var _0xaec9f2=[_0x9855('0x1c'),_0x9855('0x1d')];var _0x17bcfe=Buffer[_0x9855('0x1e')](JSON[_0x9855('0x1f')]({'id':_0x27afd4}))[_0x9855('0x20')](_0x9855('0x21'));var _0x72bc7a=crypto[_0x9855('0x22')](0x10)[_0x9855('0x20')]('hex');var _0x126b20=getAuthorizationScopes(_0x28cd68);var _0x562828=[{'key':'client_id','value':_0x28cd68[_0x9855('0x23')]},{'key':_0x9855('0x24'),'value':encodeURIComponent(_0xaec9f2[_0x9855('0x25')]('\x20'))},{'key':_0x9855('0x26'),'value':_0x28cd68[_0x9855('0x27')]},{'key':'response_mode','value':_0x9855('0x28')},{'key':_0x9855('0x29'),'value':encodeURIComponent(_0x126b20)},{'key':_0x9855('0x2a'),'value':_0x17bcfe},{'key':_0x9855('0x2b'),'value':_0x72bc7a},{'key':'prompt','value':_0x9855('0x2c')}];var _0x577d6a=_0x5b1953+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x9855('0x16')](_0x562828,function(_0x1db66c){return _0x1db66c[_0x9855('0x2d')]+'='+_0x1db66c[_0x9855('0x2e')];})[_0x9855('0x25')]('&');_0x28cd68[_0x9855('0x2f')]={'issuer':_0x5b1953[_0x9855('0x30')](_0x9855('0x31'),''),'audience':_0x28cd68[_0x9855('0x23')],'state':_0x17bcfe,'nonce':_0x72bc7a};redis['set'](_0x17bcfe,JSON[_0x9855('0x1f')](_0x28cd68));return _0x577d6a;}function isValidIdToken(_0x805928,_0x310a39){try{var _0x1705e1=jwt[_0x9855('0x32')](_0x805928,{'complete':!![]});var _0x41e902=_0x1705e1[_0x9855('0x33')];if(_0x41e902[_0x9855('0x34')]!==_0x310a39[_0x9855('0x35')])return![];if(_0x41e902[_0x9855('0x36')]!==_0x310a39['audience'])return![];if(_0x41e902[_0x9855('0x2b')]!==_0x310a39[_0x9855('0x2b')])return![];if(moment()['isAfter'](moment[_0x9855('0x37')](_0x41e902[_0x9855('0x38')])))return![];return!![];}catch(_0x40bdd8){throw _0x40bdd8;}}function refreshOauth2MicrosoftAccessToken(_0x3b9936){return Promise[_0x9855('0x39')]()[_0x9855('0x3a')](function(){if(_0x3b9936[_0x9855('0x3b')])return _0x3b9936;return db[_0x9855('0x3c')][_0x9855('0x3d')]({'where':{'id':_0x3b9936['id']},'raw':!![]});})[_0x9855('0x3a')](function(_0x5ef6d3){var _0x11714a={'grant_type':_0x9855('0x3e'),'refresh_token':_0x5ef6d3[_0x9855('0x3f')],'scope':getAccessTokenScope(_0x5ef6d3),'redirect_uri':_0x5ef6d3[_0x9855('0x27')],'client_id':_0x5ef6d3['data1'],'client_secret':encryptor[_0x9855('0x40')](_0x5ef6d3[_0x9855('0x3b')])};var _0xc37255={'method':_0x9855('0x41'),'uri':MICROSOFT_AUTH_URL[_0x9855('0x30')](_0x9855('0x1a'),_0x5ef6d3[_0x9855('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x11714a,'json':!![]};return rp(_0xc37255);})[_0x9855('0x3a')](function(_0x526b5e){_0x3b9936[_0x9855('0x42')]=_0x526b5e[_0x9855('0x43')];_0x3b9936[_0x9855('0x3f')]=_0x526b5e[_0x9855('0x3e')];return db[_0x9855('0x3c')]['update']({'data5':_0x3b9936[_0x9855('0x42')],'data6':_0x3b9936[_0x9855('0x3f')]},{'where':{'id':_0x3b9936['id']}});})[_0x9855('0x3a')](function(){return _0x3b9936;})[_0x9855('0x44')](function(_0x3d871e){logger[_0x9855('0x45')](_0x9855('0x46'),_0x3b9936['id'],_0x3d871e);});}function getOauth2MicrosoftAccessToken(_0x15d482,_0x4f5132){var _0x1e4add={'grant_type':'authorization_code','code':_0x15d482,'scope':getAccessTokenScope(_0x4f5132),'redirect_uri':_0x4f5132['data4'],'client_id':_0x4f5132[_0x9855('0x23')],'client_secret':encryptor[_0x9855('0x40')](_0x4f5132[_0x9855('0x3b')])};var _0x284dd2={'method':_0x9855('0x41'),'uri':MICROSOFT_AUTH_URL[_0x9855('0x30')](_0x9855('0x1a'),_0x4f5132[_0x9855('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1e4add,'json':!![]};return rp(_0x284dd2);}function startRefreshInterval(_0x1d2187){var _0x3cae93=schedule[_0x9855('0x47')];if(_0x3cae93[_0x1d2187['id']])clearInterval(_0x3cae93[_0x1d2187['id']]);_0x3cae93[_0x1d2187['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x1d2187['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x9855('0x47')]=_0x3cae93;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x9855('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x9855('0x3a')](function(_0x4cb1c4){var _0x30a2f1=_0x4cb1c4[_0x9855('0x16')](function(_0x496b56){return refreshOauth2MicrosoftAccessToken(_0x496b56)[_0x9855('0x3a')](function(_0x4f1ec9){startRefreshInterval(_0x4f1ec9);});});return Promise[_0x9855('0x49')](_0x30a2f1);})[_0x9855('0x44')](function(_0x3f6f80){var _0x53316f=_0x3f6f80?util[_0x9855('0x4a')](_0x3f6f80,{'showHidden':![],'depth':null}):'';logger[_0x9855('0x45')](_0x9855('0x4b'),_0x53316f);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 17bcb2f..7ec8c3e 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 _0xbbbc=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x6da129,_0x40948d){var _0x1349d6=function(_0x3b1bc){while(--_0x3b1bc){_0x6da129['push'](_0x6da129['shift']());}};_0x1349d6(++_0x40948d);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x4c27c2,_0x3572f4){_0x4c27c2=_0x4c27c2-0x0;var _0x5e2605=_0xbbbc[_0x4c27c2];return _0x5e2605;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var moment=require(_0xcbbb('0x2'));var BPromise=require(_0xcbbb('0x3'));var rs=require(_0xcbbb('0x4'));var fs=require('fs');var Redis=require(_0xcbbb('0x5'));var db=require(_0xcbbb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbbb('0x7'))(_0xcbbb('0x8'));var config=require(_0xcbbb('0x9'));var jayson=require(_0xcbbb('0xa'));var client=jayson[_0xcbbb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x388197,_0x1796b4,_0x32ec9c){return new BPromise(function(_0x6f4fd8,_0x356249){return client[_0xcbbb('0xc')](_0x388197,_0x32ec9c)[_0xcbbb('0xd')](function(_0x4ec90a){logger[_0xcbbb('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1796b4,'request\x20sent');logger[_0xcbbb('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'),JSON['stringify'](_0x4ec90a));if(_0x4ec90a[_0xcbbb('0x11')]){if(_0x4ec90a[_0xcbbb('0x11')]['code']===0x1f4){logger[_0xcbbb('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')]['message']);return _0x356249(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}logger[_0xcbbb('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1796b4,_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);return _0x6f4fd8(_0x4ec90a[_0xcbbb('0x11')][_0xcbbb('0x12')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x1796b4,_0xcbbb('0x10'));_0x6f4fd8(_0x4ec90a[_0xcbbb('0x13')][_0xcbbb('0x12')]);}})[_0xcbbb('0x14')](function(_0x5e25ca){logger[_0xcbbb('0x11')]('CloudProvider,\x20%s,\x20%s',_0x1796b4,_0x5e25ca);_0x356249(_0x5e25ca);});});}
\ No newline at end of file
+var _0xccde=['stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x36147b,_0x57f40b){var _0x141351=function(_0x219aa1){while(--_0x219aa1){_0x36147b['push'](_0x36147b['shift']());}};_0x141351(++_0x57f40b);}(_0xccde,0x1e1));var _0xeccd=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xccde[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0xeccd('0x0'));var util=require('util');var moment=require(_0xeccd('0x1'));var BPromise=require('bluebird');var rs=require(_0xeccd('0x2'));var fs=require('fs');var Redis=require(_0xeccd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xeccd('0x4'))(_0xeccd('0x5'));var config=require(_0xeccd('0x6'));var jayson=require(_0xeccd('0x7'));var client=jayson[_0xeccd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x338742,_0x130f1c,_0x1b622f){return new BPromise(function(_0x1eebfb,_0x4b068e){return client[_0xeccd('0x9')](_0x338742,_0x1b622f)[_0xeccd('0xa')](function(_0x9dccd){logger[_0xeccd('0xb')]('CloudProvider,\x20%s,\x20%s',_0x130f1c,'request\x20sent');logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x130f1c,_0xeccd('0xc'),JSON[_0xeccd('0xd')](_0x9dccd));if(_0x9dccd[_0xeccd('0xe')]){if(_0x9dccd[_0xeccd('0xe')][_0xeccd('0xf')]===0x1f4){logger['error'](_0xeccd('0x10'),_0x130f1c,_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);return _0x4b068e(_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);}logger[_0xeccd('0xe')]('CloudProvider,\x20%s,\x20%s',_0x130f1c,_0x9dccd['error'][_0xeccd('0x11')]);return _0x1eebfb(_0x9dccd[_0xeccd('0xe')][_0xeccd('0x11')]);}else{logger[_0xeccd('0xb')]('CloudProvider,\x20%s,\x20%s',_0x130f1c,_0xeccd('0xc'));_0x1eebfb(_0x9dccd[_0xeccd('0x12')]['message']);}})['catch'](function(_0x42e47e){logger[_0xeccd('0xe')](_0xeccd('0x10'),_0x130f1c,_0x42e47e);_0x4b068e(_0x42e47e);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6b3c4f3..6d23763 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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x3c139e,_0x177cfa){var _0x378be6=function(_0x45bdc3){while(--_0x45bdc3){_0x3c139e['push'](_0x3c139e['shift']());}};_0x378be6(++_0x177cfa);}(_0xdb28,0x106));var _0x8db2=function(_0x2d203b,_0x21eece){_0x2d203b=_0x2d203b-0x0;var _0x56e30e=_0xdb28[_0x2d203b];return _0x56e30e;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x7a54,0x106));var _0x47a5=function(_0x2f09a3,_0x3d2777){_0x2f09a3=_0x2f09a3-0x0;var _0xa63c1c=_0x7a54[_0x2f09a3];return _0xa63c1c;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index a2df17b..bcea597 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 _0x2094=['STRING','name','sequelize'];(function(_0x4b23bc,_0x3bf394){var _0xb63d3=function(_0x1b73cb){while(--_0x1b73cb){_0x4b23bc['push'](_0x4b23bc['shift']());}};_0xb63d3(++_0x3bf394);}(_0x2094,0x10d));var _0x4209=function(_0x510ef9,_0x230714){_0x510ef9=_0x510ef9-0x0;var _0x50efd3=_0x2094[_0x510ef9];return _0x50efd3;};'use strict';var Sequelize=require(_0x4209('0x0'));module['exports']={'name':{'type':Sequelize[_0x4209('0x1')],'unique':_0x4209('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4209('0x1')]},'companyId':{'type':Sequelize[_0x4209('0x1')]},'website':{'type':Sequelize[_0x4209('0x1')]},'phone':{'type':Sequelize[_0x4209('0x1')]},'fax':{'type':Sequelize[_0x4209('0x1')]},'type':{'type':Sequelize[_0x4209('0x1')]},'street':{'type':Sequelize[_0x4209('0x1')]},'postalCode':{'type':Sequelize[_0x4209('0x1')]},'city':{'type':Sequelize[_0x4209('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4209('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4209('0x1')]},'sStreet':{'type':Sequelize[_0x4209('0x1')]},'sPostalCode':{'type':Sequelize[_0x4209('0x1')]},'sCity':{'type':Sequelize[_0x4209('0x1')]},'sCountry':{'type':Sequelize[_0x4209('0x1')]},'description':{'type':Sequelize[_0x4209('0x1')]}};
\ No newline at end of file
+var _0xfca5=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfca5,0x1cf));var _0x5fca=function(_0x576266,_0x4002b0){_0x576266=_0x576266-0x0;var _0x18234f=_0xfca5[_0x576266];return _0x18234f;};'use strict';var Sequelize=require(_0x5fca('0x0'));module[_0x5fca('0x1')]={'name':{'type':Sequelize[_0x5fca('0x2')],'unique':_0x5fca('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5fca('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x5fca('0x2')]},'phone':{'type':Sequelize[_0x5fca('0x2')]},'fax':{'type':Sequelize[_0x5fca('0x2')]},'type':{'type':Sequelize[_0x5fca('0x2')]},'street':{'type':Sequelize[_0x5fca('0x2')]},'postalCode':{'type':Sequelize[_0x5fca('0x2')]},'city':{'type':Sequelize[_0x5fca('0x2')]},'country':{'type':Sequelize[_0x5fca('0x2')]},'email':{'type':Sequelize[_0x5fca('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5fca('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x5fca('0x2')]},'sCity':{'type':Sequelize[_0x5fca('0x2')]},'sCountry':{'type':Sequelize[_0x5fca('0x2')]},'description':{'type':Sequelize[_0x5fca('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 3d5cab8..5a81938 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 _0xeaa2=['merge','map','options','where','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','omit','getContacts','findOne','CmContact','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','Companies','UserProfileResource','sendStatus','error','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter'];(function(_0x22e050,_0x1bedbc){var _0x5743f6=function(_0x5cdbd7){while(--_0x5cdbd7){_0x22e050['push'](_0x22e050['shift']());}};_0x5743f6(++_0x1bedbc);}(_0xeaa2,0x18c));var _0x2eaa=function(_0x174202,_0x5c5292){_0x174202=_0x174202-0x0;var _0x4daa4a=_0xeaa2[_0x174202];return _0x4daa4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2eaa('0x0'));var zipdir=require(_0x2eaa('0x1'));var jsonpatch=require(_0x2eaa('0x2'));var rp=require(_0x2eaa('0x3'));var moment=require(_0x2eaa('0x4'));var BPromise=require(_0x2eaa('0x5'));var Mustache=require(_0x2eaa('0x6'));var util=require(_0x2eaa('0x7'));var path=require(_0x2eaa('0x8'));var sox=require(_0x2eaa('0x9'));var csv=require(_0x2eaa('0xa'));var ejs=require(_0x2eaa('0xb'));var fs=require('fs');var fs_extra=require(_0x2eaa('0xc'));var _=require(_0x2eaa('0xd'));var squel=require('squel');var crypto=require(_0x2eaa('0xe'));var jsforce=require(_0x2eaa('0xf'));var deskjs=require(_0x2eaa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2eaa('0x11'));var Papa=require(_0x2eaa('0x12'));var Redis=require(_0x2eaa('0x13'));var authService=require(_0x2eaa('0x14'));var qs=require(_0x2eaa('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2eaa('0x16'));var logger=require(_0x2eaa('0x17'))(_0x2eaa('0x18'));var utils=require(_0x2eaa('0x19'));var config=require(_0x2eaa('0x1a'));var licenseUtil=require(_0x2eaa('0x1b'));var db=require(_0x2eaa('0x1c'))['db'];function respondWithStatusCode(_0x29a8da,_0x33693){_0x33693=_0x33693||0xcc;return function(_0x41d8e2){if(_0x41d8e2){return _0x29a8da['sendStatus'](_0x33693);}return _0x29a8da[_0x2eaa('0x1d')](_0x33693)[_0x2eaa('0x1e')]();};}function respondWithResult(_0x5e3ca0,_0xdcbcfb){_0xdcbcfb=_0xdcbcfb||0xc8;return function(_0xebd1b){if(_0xebd1b){return _0x5e3ca0[_0x2eaa('0x1d')](_0xdcbcfb)[_0x2eaa('0x1f')](_0xebd1b);}};}function respondWithFilteredResult(_0x3b8337,_0x36d25c){return function(_0x3d1605){if(_0x3d1605){var _0x4d1e89=typeof _0x36d25c[_0x2eaa('0x20')]==='undefined'&&typeof _0x36d25c[_0x2eaa('0x21')]===_0x2eaa('0x22');var _0x4e685a=_0x3d1605[_0x2eaa('0x23')];var _0x523303=_0x4d1e89?0x0:_0x36d25c['offset'];var _0x47dac4=_0x4d1e89?_0x3d1605[_0x2eaa('0x23')]:_0x36d25c[_0x2eaa('0x20')]+_0x36d25c[_0x2eaa('0x21')];var _0x461906;if(_0x47dac4>=_0x4e685a){_0x47dac4=_0x4e685a;_0x461906=0xc8;}else{_0x461906=0xce;}_0x3b8337[_0x2eaa('0x1d')](_0x461906);return _0x3b8337[_0x2eaa('0x24')](_0x2eaa('0x25'),_0x523303+'-'+_0x47dac4+'/'+_0x4e685a)['json'](_0x3d1605);}return null;};}function patchUpdates(_0x42590f){return function(_0xb5db73){try{jsonpatch['apply'](_0xb5db73,_0x42590f,!![]);}catch(_0x39f4d8){return BPromise[_0x2eaa('0x26')](_0x39f4d8);}return _0xb5db73[_0x2eaa('0x27')]();};}function saveUpdates(_0x3bc0a5,_0x236493){return function(_0x47b081){if(_0x47b081){return _0x47b081['update'](_0x3bc0a5)[_0x2eaa('0x28')](function(_0x293e27){return _0x293e27;});}return null;};}function removeEntity(_0x6ac0c7,_0x1bf3d4){return function(_0xb3c1aa){if(_0xb3c1aa){return _0xb3c1aa[_0x2eaa('0x29')]()['then'](function(){var _0x5953dc=_0xb3c1aa[_0x2eaa('0x2a')]({'plain':!![]});var _0x5cc0ab=_0x2eaa('0x2b');return db[_0x2eaa('0x2c')][_0x2eaa('0x29')]({'where':{'type':_0x5cc0ab,'resourceId':_0x5953dc['id']}})[_0x2eaa('0x28')](function(){return _0xb3c1aa;});})[_0x2eaa('0x28')](function(){_0x6ac0c7[_0x2eaa('0x1d')](0xcc)[_0x2eaa('0x1e')]();});}};}function handleEntityNotFound(_0x221b6b,_0x3b9833){return function(_0x522465){if(!_0x522465){_0x221b6b[_0x2eaa('0x2d')](0x194);}return _0x522465;};}function handleError(_0x4a644a,_0x112c4a){_0x112c4a=_0x112c4a||0x1f4;return function(_0x30157a){logger[_0x2eaa('0x2e')](_0x30157a['stack']);if(_0x30157a[_0x2eaa('0x2f')]){delete _0x30157a['name'];}_0x4a644a['status'](_0x112c4a)[_0x2eaa('0x30')](_0x30157a);};}exports[_0x2eaa('0x31')]=function(_0x5cadd9,_0x30b03f){var _0x5c75d7={},_0x2b135b={},_0x10216d={'count':0x0,'rows':[]};return db[_0x2eaa('0x32')][_0x2eaa('0x33')]()[_0x2eaa('0x28')](function(_0x688ff6){_0x2b135b[_0x2eaa('0x34')]=_[_0x2eaa('0x35')](_0x688ff6);_0x2b135b[_0x2eaa('0x36')]=_[_0x2eaa('0x35')](_0x5cadd9[_0x2eaa('0x36')]);_0x2b135b[_0x2eaa('0x37')]=_[_0x2eaa('0x38')](_0x2b135b[_0x2eaa('0x34')],_0x2b135b[_0x2eaa('0x36')]);_0x5c75d7[_0x2eaa('0x39')]=_['intersection'](_0x2b135b[_0x2eaa('0x34')],qs[_0x2eaa('0x3a')](_0x5cadd9[_0x2eaa('0x36')]['fields']));_0x5c75d7[_0x2eaa('0x39')]=_0x5c75d7[_0x2eaa('0x39')][_0x2eaa('0x3b')]?_0x5c75d7[_0x2eaa('0x39')]:_0x2b135b[_0x2eaa('0x34')];if(!_0x5cadd9[_0x2eaa('0x36')][_0x2eaa('0x3c')](_0x2eaa('0x3d'))){_0x5c75d7[_0x2eaa('0x21')]=qs['limit'](_0x5cadd9[_0x2eaa('0x36')][_0x2eaa('0x21')]);_0x5c75d7[_0x2eaa('0x20')]=qs[_0x2eaa('0x20')](_0x5cadd9['query']['offset']);}_0x5c75d7['order']=qs[_0x2eaa('0x3e')](_0x5cadd9[_0x2eaa('0x36')][_0x2eaa('0x3e')]);_0x5c75d7['where']=qs['filters'](_['pick'](_0x5cadd9['query'],_0x2b135b[_0x2eaa('0x37')]),_0x688ff6);if(_0x5cadd9[_0x2eaa('0x36')][_0x2eaa('0x3f')]){_0x5c75d7['where']=_[_0x2eaa('0x40')](_0x5c75d7['where'],{'$or':_[_0x2eaa('0x41')](_0x5c75d7['attributes'],function(_0x2648d2){var _0x5a91ed={};_0x5a91ed[_0x2648d2]={'$like':'%'+_0x5cadd9[_0x2eaa('0x36')][_0x2eaa('0x3f')]+'%'};return _0x5a91ed;})});}_0x5c75d7=_[_0x2eaa('0x40')]({},_0x5c75d7,_0x5cadd9[_0x2eaa('0x42')]);var _0x552dcc={'where':_0x5c75d7[_0x2eaa('0x43')]};return db['CmCompany'][_0x2eaa('0x23')](_0x552dcc)[_0x2eaa('0x28')](function(_0x10b274){_0x10216d[_0x2eaa('0x23')]=_0x10b274;if(_0x5cadd9[_0x2eaa('0x36')][_0x2eaa('0x44')]){_0x5c75d7[_0x2eaa('0x45')]=[{'all':!![]}];}return db[_0x2eaa('0x32')][_0x2eaa('0x46')](_0x5c75d7);})[_0x2eaa('0x28')](function(_0x3f2831){_0x10216d[_0x2eaa('0x47')]=_0x3f2831;return _0x10216d;})['then'](respondWithFilteredResult(_0x30b03f,_0x5c75d7))['catch'](handleError(_0x30b03f,null));})[_0x2eaa('0x48')](handleError(_0x30b03f,null));};exports[_0x2eaa('0x49')]=function(_0x11dff3,_0x133fbc){var _0x2fd3d7={'raw':![],'where':{'id':_0x11dff3[_0x2eaa('0x4a')]['id']}},_0x3413ef={};_0x3413ef[_0x2eaa('0x34')]=_[_0x2eaa('0x35')](db['CmCompany'][_0x2eaa('0x4b')]);_0x3413ef[_0x2eaa('0x36')]=_['keys'](_0x11dff3[_0x2eaa('0x36')]);_0x3413ef[_0x2eaa('0x37')]=_[_0x2eaa('0x38')](_0x3413ef[_0x2eaa('0x34')],_0x3413ef[_0x2eaa('0x36')]);_0x2fd3d7[_0x2eaa('0x39')]=_[_0x2eaa('0x38')](_0x3413ef[_0x2eaa('0x34')],qs['fields'](_0x11dff3[_0x2eaa('0x36')][_0x2eaa('0x3a')]));_0x2fd3d7[_0x2eaa('0x39')]=_0x2fd3d7[_0x2eaa('0x39')][_0x2eaa('0x3b')]?_0x2fd3d7['attributes']:_0x3413ef[_0x2eaa('0x34')];if(_0x11dff3['query'][_0x2eaa('0x44')]){_0x2fd3d7['include']=[{'all':!![]}];}_0x2fd3d7=_[_0x2eaa('0x40')]({},_0x2fd3d7,_0x11dff3['options']);return db[_0x2eaa('0x32')][_0x2eaa('0x4c')](_0x2fd3d7)[_0x2eaa('0x28')](handleEntityNotFound(_0x133fbc,null))[_0x2eaa('0x28')](respondWithResult(_0x133fbc,null))[_0x2eaa('0x48')](handleError(_0x133fbc,null));};exports[_0x2eaa('0x4d')]=function(_0x267658,_0x66447){return db['CmCompany']['create'](_0x267658[_0x2eaa('0x4e')],{})[_0x2eaa('0x28')](function(_0x4ee771){var _0x5ba4aa=_0x267658[_0x2eaa('0x4f')][_0x2eaa('0x2a')]({'plain':!![]});if(!_0x5ba4aa)throw new Error(_0x2eaa('0x50'));if(_0x5ba4aa[_0x2eaa('0x51')]===_0x2eaa('0x4f')){var _0x32f82b=_0x4ee771[_0x2eaa('0x2a')]({'plain':!![]});var _0x2e1a53=_0x2eaa('0x2b');return db[_0x2eaa('0x52')][_0x2eaa('0x4c')]({'where':{'name':_0x2e1a53,'userProfileId':_0x5ba4aa['userProfileId']},'raw':!![]})[_0x2eaa('0x28')](function(_0x102a26){if(_0x102a26&&_0x102a26[_0x2eaa('0x53')]===0x0){return db[_0x2eaa('0x2c')][_0x2eaa('0x4d')]({'name':_0x32f82b[_0x2eaa('0x2f')],'resourceId':_0x32f82b['id'],'type':_0x102a26[_0x2eaa('0x2f')],'sectionId':_0x102a26['id']},{})[_0x2eaa('0x28')](function(){return _0x4ee771;});}else{return _0x4ee771;}})[_0x2eaa('0x48')](function(_0x4564f8){logger['error'](_0x2eaa('0x54'),_0x4564f8);throw _0x4564f8;});}return _0x4ee771;})[_0x2eaa('0x28')](respondWithResult(_0x66447,0xc9))[_0x2eaa('0x48')](handleError(_0x66447,null));};exports[_0x2eaa('0x55')]=function(_0x2a1769,_0x44bd71){if(_0x2a1769[_0x2eaa('0x4e')]['id']){delete _0x2a1769[_0x2eaa('0x4e')]['id'];}return db[_0x2eaa('0x32')][_0x2eaa('0x4c')]({'where':{'id':_0x2a1769[_0x2eaa('0x4a')]['id']}})[_0x2eaa('0x28')](handleEntityNotFound(_0x44bd71,null))[_0x2eaa('0x28')](saveUpdates(_0x2a1769[_0x2eaa('0x4e')],null))[_0x2eaa('0x28')](respondWithResult(_0x44bd71,null))[_0x2eaa('0x48')](handleError(_0x44bd71,null));};exports['destroy']=function(_0x21b2c5,_0x657ed1){return db[_0x2eaa('0x32')][_0x2eaa('0x4c')]({'where':{'id':_0x21b2c5[_0x2eaa('0x4a')]['id']}})[_0x2eaa('0x28')](handleEntityNotFound(_0x657ed1,null))[_0x2eaa('0x28')](removeEntity(_0x657ed1,null))[_0x2eaa('0x48')](handleError(_0x657ed1,null));};exports['describe']=function(_0x2766fd,_0x56aa2f){return db[_0x2eaa('0x32')][_0x2eaa('0x33')]()['then'](respondWithResult(_0x56aa2f,null))[_0x2eaa('0x48')](handleError(_0x56aa2f,null));};exports[_0x2eaa('0x56')]=function(_0xb45b8a,_0x3755fd,_0x24f93b){return db['CmContact']['find']({'where':{'id':_0xb45b8a['params']['id']}})[_0x2eaa('0x28')](handleEntityNotFound(_0x3755fd,null))[_0x2eaa('0x28')](function(_0x10a861){if(_0x10a861){return _0x10a861[_0x2eaa('0x56')](_0xb45b8a['body']['ids'],_[_0x2eaa('0x57')](_0xb45b8a[_0x2eaa('0x4e')],['ids','id'])||{});}})[_0x2eaa('0x28')](respondWithResult(_0x3755fd,null))[_0x2eaa('0x48')](handleError(_0x3755fd,null));};exports[_0x2eaa('0x58')]=function(_0x1e5126,_0x3bd7ed,_0x1fb62d){var _0x466125={};var _0xefddfc={};var _0xd34d35;var _0x430bea;return db[_0x2eaa('0x32')][_0x2eaa('0x59')]({'where':{'id':_0x1e5126[_0x2eaa('0x4a')]['id']}})[_0x2eaa('0x28')](handleEntityNotFound(_0x3bd7ed,null))[_0x2eaa('0x28')](function(_0x2380e8){if(_0x2380e8){_0xd34d35=_0x2380e8;_0xefddfc[_0x2eaa('0x34')]=_[_0x2eaa('0x35')](db[_0x2eaa('0x5a')][_0x2eaa('0x4b')]);_0xefddfc[_0x2eaa('0x36')]=_[_0x2eaa('0x35')](_0x1e5126['query']);_0xefddfc[_0x2eaa('0x37')]=_['intersection'](_0xefddfc[_0x2eaa('0x34')],_0xefddfc[_0x2eaa('0x36')]);_0x466125[_0x2eaa('0x39')]=_['intersection'](_0xefddfc[_0x2eaa('0x34')],qs[_0x2eaa('0x3a')](_0x1e5126[_0x2eaa('0x36')][_0x2eaa('0x3a')]));_0x466125[_0x2eaa('0x39')]=_0x466125['attributes'][_0x2eaa('0x3b')]?_0x466125[_0x2eaa('0x39')]:_0xefddfc[_0x2eaa('0x34')];_0x466125[_0x2eaa('0x5b')]=qs[_0x2eaa('0x3e')](_0x1e5126[_0x2eaa('0x36')]['sort']);_0x466125[_0x2eaa('0x43')]=qs[_0x2eaa('0x37')](_['pick'](_0x1e5126['query'],_0xefddfc['filters']));if(_0x1e5126[_0x2eaa('0x36')]['filter']){_0x466125[_0x2eaa('0x43')]=_['merge'](_0x466125[_0x2eaa('0x43')],{'$or':_[_0x2eaa('0x41')](_0x466125[_0x2eaa('0x39')],function(_0x348540){var _0x48c0d4={};_0x48c0d4[_0x348540]={'$like':'%'+_0x1e5126[_0x2eaa('0x36')][_0x2eaa('0x3f')]+'%'};return _0x48c0d4;})});}_0x466125=_[_0x2eaa('0x40')]({},_0x466125,_0x1e5126['options']);return _0xd34d35[_0x2eaa('0x58')](_0x466125);}})[_0x2eaa('0x28')](function(_0x4ddf14){if(_0x4ddf14){_0x430bea=_0x4ddf14[_0x2eaa('0x3b')];if(!_0x1e5126[_0x2eaa('0x36')][_0x2eaa('0x3c')](_0x2eaa('0x3d'))){_0x466125[_0x2eaa('0x21')]=qs[_0x2eaa('0x21')](_0x1e5126[_0x2eaa('0x36')][_0x2eaa('0x21')]);_0x466125[_0x2eaa('0x20')]=qs['offset'](_0x1e5126[_0x2eaa('0x36')][_0x2eaa('0x20')]);}return _0xd34d35[_0x2eaa('0x58')](_0x466125);}})[_0x2eaa('0x28')](function(_0x6190f9){if(_0x6190f9){return _0x6190f9?{'count':_0x430bea,'rows':_0x6190f9}:null;}})[_0x2eaa('0x28')](respondWithResult(_0x3bd7ed,null))[_0x2eaa('0x48')](handleError(_0x3bd7ed,null));};
\ No newline at end of file
+var _0x150c=['status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','filters','intersection','model','query','fields','attributes','length','limit','order','sort','where','pick','merge','filter','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','omit','ids','getContacts','findOne','rawAttributes','map','hasOwnProperty','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x150c,0x9a));var _0xc150=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x150c[_0x342700];return _0x53406f;};'use strict';var emlformat=require(_0xc150('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc150('0x1'));var rp=require(_0xc150('0x2'));var moment=require(_0xc150('0x3'));var BPromise=require(_0xc150('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc150('0x5'));var sox=require(_0xc150('0x6'));var csv=require(_0xc150('0x7'));var ejs=require(_0xc150('0x8'));var fs=require('fs');var fs_extra=require(_0xc150('0x9'));var _=require(_0xc150('0xa'));var squel=require(_0xc150('0xb'));var crypto=require(_0xc150('0xc'));var jsforce=require(_0xc150('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc150('0x7'));var querystring=require(_0xc150('0xe'));var Papa=require(_0xc150('0xf'));var Redis=require('ioredis');var authService=require(_0xc150('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc150('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc150('0x12'))(_0xc150('0x13'));var utils=require(_0xc150('0x14'));var config=require(_0xc150('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc150('0x16'))['db'];function respondWithStatusCode(_0x4268f3,_0x3b91a4){_0x3b91a4=_0x3b91a4||0xcc;return function(_0x2bcda4){if(_0x2bcda4){return _0x4268f3[_0xc150('0x17')](_0x3b91a4);}return _0x4268f3[_0xc150('0x18')](_0x3b91a4)[_0xc150('0x19')]();};}function respondWithResult(_0x19e986,_0x4a32d4){_0x4a32d4=_0x4a32d4||0xc8;return function(_0x4a120a){if(_0x4a120a){return _0x19e986[_0xc150('0x18')](_0x4a32d4)[_0xc150('0x1a')](_0x4a120a);}};}function respondWithFilteredResult(_0x440422,_0x5a094a){return function(_0x3d730b){if(_0x3d730b){var _0x3ccefc=typeof _0x5a094a[_0xc150('0x1b')]==='undefined'&&typeof _0x5a094a['limit']===_0xc150('0x1c');var _0x364e0a=_0x3d730b[_0xc150('0x1d')];var _0x1120c9=_0x3ccefc?0x0:_0x5a094a[_0xc150('0x1b')];var _0x302a01=_0x3ccefc?_0x3d730b[_0xc150('0x1d')]:_0x5a094a['offset']+_0x5a094a['limit'];var _0x2f89b2;if(_0x302a01>=_0x364e0a){_0x302a01=_0x364e0a;_0x2f89b2=0xc8;}else{_0x2f89b2=0xce;}_0x440422[_0xc150('0x18')](_0x2f89b2);return _0x440422[_0xc150('0x1e')](_0xc150('0x1f'),_0x1120c9+'-'+_0x302a01+'/'+_0x364e0a)[_0xc150('0x1a')](_0x3d730b);}return null;};}function patchUpdates(_0x2ba0ab){return function(_0xb70a76){try{jsonpatch[_0xc150('0x20')](_0xb70a76,_0x2ba0ab,!![]);}catch(_0x2c43f2){return BPromise[_0xc150('0x21')](_0x2c43f2);}return _0xb70a76['save']();};}function saveUpdates(_0x58162d,_0xeee1d4){return function(_0x55d1e3){if(_0x55d1e3){return _0x55d1e3[_0xc150('0x22')](_0x58162d)[_0xc150('0x23')](function(_0x527b8a){return _0x527b8a;});}return null;};}function removeEntity(_0x210fd5,_0x59059d){return function(_0x289090){if(_0x289090){return _0x289090[_0xc150('0x24')]()[_0xc150('0x23')](function(){var _0x5f4992=_0x289090[_0xc150('0x25')]({'plain':!![]});var _0x453f41='Companies';return db[_0xc150('0x26')][_0xc150('0x24')]({'where':{'type':_0x453f41,'resourceId':_0x5f4992['id']}})[_0xc150('0x23')](function(){return _0x289090;});})[_0xc150('0x23')](function(){_0x210fd5[_0xc150('0x18')](0xcc)[_0xc150('0x19')]();});}};}function handleEntityNotFound(_0x33cd44,_0x5a5a31){return function(_0x489294){if(!_0x489294){_0x33cd44['sendStatus'](0x194);}return _0x489294;};}function handleError(_0x129941,_0x79a54e){_0x79a54e=_0x79a54e||0x1f4;return function(_0x2c198f){logger[_0xc150('0x27')](_0x2c198f[_0xc150('0x28')]);if(_0x2c198f['name']){delete _0x2c198f[_0xc150('0x29')];}_0x129941[_0xc150('0x18')](_0x79a54e)[_0xc150('0x2a')](_0x2c198f);};}exports[_0xc150('0x2b')]=function(_0x1d145b,_0x49fb47){var _0x174ec7={},_0x24760c={},_0x41347a={'count':0x0,'rows':[]};return db[_0xc150('0x2c')][_0xc150('0x2d')]()['then'](function(_0x3efd2c){_0x24760c['model']=_['keys'](_0x3efd2c);_0x24760c['query']=_[_0xc150('0x2e')](_0x1d145b['query']);_0x24760c[_0xc150('0x2f')]=_[_0xc150('0x30')](_0x24760c[_0xc150('0x31')],_0x24760c[_0xc150('0x32')]);_0x174ec7['attributes']=_[_0xc150('0x30')](_0x24760c[_0xc150('0x31')],qs[_0xc150('0x33')](_0x1d145b[_0xc150('0x32')][_0xc150('0x33')]));_0x174ec7[_0xc150('0x34')]=_0x174ec7[_0xc150('0x34')][_0xc150('0x35')]?_0x174ec7[_0xc150('0x34')]:_0x24760c[_0xc150('0x31')];if(!_0x1d145b[_0xc150('0x32')]['hasOwnProperty']('nolimit')){_0x174ec7[_0xc150('0x36')]=qs[_0xc150('0x36')](_0x1d145b[_0xc150('0x32')]['limit']);_0x174ec7[_0xc150('0x1b')]=qs[_0xc150('0x1b')](_0x1d145b[_0xc150('0x32')][_0xc150('0x1b')]);}_0x174ec7[_0xc150('0x37')]=qs[_0xc150('0x38')](_0x1d145b[_0xc150('0x32')][_0xc150('0x38')]);_0x174ec7[_0xc150('0x39')]=qs[_0xc150('0x2f')](_[_0xc150('0x3a')](_0x1d145b['query'],_0x24760c['filters']),_0x3efd2c);if(_0x1d145b[_0xc150('0x32')]['filter']){_0x174ec7[_0xc150('0x39')]=_[_0xc150('0x3b')](_0x174ec7['where'],{'$or':_['map'](_0x174ec7[_0xc150('0x34')],function(_0x514c25){var _0x4c5797={};_0x4c5797[_0x514c25]={'$like':'%'+_0x1d145b[_0xc150('0x32')][_0xc150('0x3c')]+'%'};return _0x4c5797;})});}_0x174ec7=_['merge']({},_0x174ec7,_0x1d145b['options']);var _0xaa3a77={'where':_0x174ec7[_0xc150('0x39')]};return db[_0xc150('0x2c')][_0xc150('0x1d')](_0xaa3a77)[_0xc150('0x23')](function(_0x3ae607){_0x41347a[_0xc150('0x1d')]=_0x3ae607;if(_0x1d145b[_0xc150('0x32')][_0xc150('0x3d')]){_0x174ec7['include']=[{'all':!![]}];}return db[_0xc150('0x2c')][_0xc150('0x3e')](_0x174ec7);})[_0xc150('0x23')](function(_0x4b55fa){_0x41347a[_0xc150('0x3f')]=_0x4b55fa;return _0x41347a;})[_0xc150('0x23')](respondWithFilteredResult(_0x49fb47,_0x174ec7))['catch'](handleError(_0x49fb47,null));})[_0xc150('0x40')](handleError(_0x49fb47,null));};exports[_0xc150('0x41')]=function(_0xfc9d19,_0x4de175){var _0x89406f={'raw':![],'where':{'id':_0xfc9d19[_0xc150('0x42')]['id']}},_0x5c999d={};_0x5c999d[_0xc150('0x31')]=_[_0xc150('0x2e')](db['CmCompany']['rawAttributes']);_0x5c999d['query']=_[_0xc150('0x2e')](_0xfc9d19[_0xc150('0x32')]);_0x5c999d[_0xc150('0x2f')]=_[_0xc150('0x30')](_0x5c999d[_0xc150('0x31')],_0x5c999d[_0xc150('0x32')]);_0x89406f['attributes']=_[_0xc150('0x30')](_0x5c999d[_0xc150('0x31')],qs[_0xc150('0x33')](_0xfc9d19['query'][_0xc150('0x33')]));_0x89406f[_0xc150('0x34')]=_0x89406f[_0xc150('0x34')][_0xc150('0x35')]?_0x89406f[_0xc150('0x34')]:_0x5c999d[_0xc150('0x31')];if(_0xfc9d19['query'][_0xc150('0x3d')]){_0x89406f[_0xc150('0x43')]=[{'all':!![]}];}_0x89406f=_['merge']({},_0x89406f,_0xfc9d19[_0xc150('0x44')]);return db[_0xc150('0x2c')][_0xc150('0x45')](_0x89406f)[_0xc150('0x23')](handleEntityNotFound(_0x4de175,null))[_0xc150('0x23')](respondWithResult(_0x4de175,null))['catch'](handleError(_0x4de175,null));};exports['create']=function(_0x6aa338,_0x2cc21f){return db[_0xc150('0x2c')][_0xc150('0x46')](_0x6aa338[_0xc150('0x47')],{})[_0xc150('0x23')](function(_0x158e9a){var _0x237481=_0x6aa338[_0xc150('0x48')]['get']({'plain':!![]});if(!_0x237481)throw new Error(_0xc150('0x49'));if(_0x237481[_0xc150('0x4a')]===_0xc150('0x48')){var _0x1c94c8=_0x158e9a[_0xc150('0x25')]({'plain':!![]});var _0x570914='Companies';return db[_0xc150('0x4b')][_0xc150('0x45')]({'where':{'name':_0x570914,'userProfileId':_0x237481[_0xc150('0x4c')]},'raw':!![]})[_0xc150('0x23')](function(_0x31aab6){if(_0x31aab6&&_0x31aab6[_0xc150('0x4d')]===0x0){return db[_0xc150('0x26')][_0xc150('0x46')]({'name':_0x1c94c8['name'],'resourceId':_0x1c94c8['id'],'type':_0x31aab6['name'],'sectionId':_0x31aab6['id']},{})[_0xc150('0x23')](function(){return _0x158e9a;});}else{return _0x158e9a;}})[_0xc150('0x40')](function(_0x5d0fc6){logger[_0xc150('0x27')](_0xc150('0x4e'),_0x5d0fc6);throw _0x5d0fc6;});}return _0x158e9a;})[_0xc150('0x23')](respondWithResult(_0x2cc21f,0xc9))['catch'](handleError(_0x2cc21f,null));};exports[_0xc150('0x22')]=function(_0x438bc2,_0x8d33c7){if(_0x438bc2[_0xc150('0x47')]['id']){delete _0x438bc2[_0xc150('0x47')]['id'];}return db['CmCompany'][_0xc150('0x45')]({'where':{'id':_0x438bc2[_0xc150('0x42')]['id']}})[_0xc150('0x23')](handleEntityNotFound(_0x8d33c7,null))[_0xc150('0x23')](saveUpdates(_0x438bc2[_0xc150('0x47')],null))['then'](respondWithResult(_0x8d33c7,null))[_0xc150('0x40')](handleError(_0x8d33c7,null));};exports[_0xc150('0x24')]=function(_0x4c3a0a,_0xfae184){return db[_0xc150('0x2c')][_0xc150('0x45')]({'where':{'id':_0x4c3a0a['params']['id']}})[_0xc150('0x23')](handleEntityNotFound(_0xfae184,null))[_0xc150('0x23')](removeEntity(_0xfae184,null))[_0xc150('0x40')](handleError(_0xfae184,null));};exports[_0xc150('0x2d')]=function(_0x384cb2,_0xc4989e){return db[_0xc150('0x2c')][_0xc150('0x2d')]()[_0xc150('0x23')](respondWithResult(_0xc4989e,null))[_0xc150('0x40')](handleError(_0xc4989e,null));};exports[_0xc150('0x4f')]=function(_0x386a7b,_0x289df6,_0x1e2800){return db[_0xc150('0x50')][_0xc150('0x45')]({'where':{'id':_0x386a7b[_0xc150('0x42')]['id']}})[_0xc150('0x23')](handleEntityNotFound(_0x289df6,null))['then'](function(_0x131839){if(_0x131839){return _0x131839[_0xc150('0x4f')](_0x386a7b[_0xc150('0x47')]['ids'],_[_0xc150('0x51')](_0x386a7b[_0xc150('0x47')],[_0xc150('0x52'),'id'])||{});}})[_0xc150('0x23')](respondWithResult(_0x289df6,null))[_0xc150('0x40')](handleError(_0x289df6,null));};exports[_0xc150('0x53')]=function(_0x26ea57,_0x24cc8d,_0x1a584a){var _0x3a9d41={};var _0x2c8c81={};var _0x503d87;var _0x32bc0b;return db[_0xc150('0x2c')][_0xc150('0x54')]({'where':{'id':_0x26ea57[_0xc150('0x42')]['id']}})[_0xc150('0x23')](handleEntityNotFound(_0x24cc8d,null))[_0xc150('0x23')](function(_0x34cb41){if(_0x34cb41){_0x503d87=_0x34cb41;_0x2c8c81[_0xc150('0x31')]=_[_0xc150('0x2e')](db[_0xc150('0x50')][_0xc150('0x55')]);_0x2c8c81[_0xc150('0x32')]=_[_0xc150('0x2e')](_0x26ea57[_0xc150('0x32')]);_0x2c8c81[_0xc150('0x2f')]=_[_0xc150('0x30')](_0x2c8c81[_0xc150('0x31')],_0x2c8c81['query']);_0x3a9d41[_0xc150('0x34')]=_[_0xc150('0x30')](_0x2c8c81['model'],qs[_0xc150('0x33')](_0x26ea57[_0xc150('0x32')][_0xc150('0x33')]));_0x3a9d41[_0xc150('0x34')]=_0x3a9d41[_0xc150('0x34')][_0xc150('0x35')]?_0x3a9d41[_0xc150('0x34')]:_0x2c8c81[_0xc150('0x31')];_0x3a9d41['order']=qs[_0xc150('0x38')](_0x26ea57['query'][_0xc150('0x38')]);_0x3a9d41[_0xc150('0x39')]=qs[_0xc150('0x2f')](_[_0xc150('0x3a')](_0x26ea57[_0xc150('0x32')],_0x2c8c81['filters']));if(_0x26ea57[_0xc150('0x32')][_0xc150('0x3c')]){_0x3a9d41[_0xc150('0x39')]=_[_0xc150('0x3b')](_0x3a9d41[_0xc150('0x39')],{'$or':_[_0xc150('0x56')](_0x3a9d41[_0xc150('0x34')],function(_0x389b61){var _0x588269={};_0x588269[_0x389b61]={'$like':'%'+_0x26ea57[_0xc150('0x32')][_0xc150('0x3c')]+'%'};return _0x588269;})});}_0x3a9d41=_[_0xc150('0x3b')]({},_0x3a9d41,_0x26ea57[_0xc150('0x44')]);return _0x503d87[_0xc150('0x53')](_0x3a9d41);}})['then'](function(_0x274c22){if(_0x274c22){_0x32bc0b=_0x274c22[_0xc150('0x35')];if(!_0x26ea57['query'][_0xc150('0x57')](_0xc150('0x58'))){_0x3a9d41['limit']=qs[_0xc150('0x36')](_0x26ea57['query'][_0xc150('0x36')]);_0x3a9d41[_0xc150('0x1b')]=qs[_0xc150('0x1b')](_0x26ea57[_0xc150('0x32')][_0xc150('0x1b')]);}return _0x503d87['getContacts'](_0x3a9d41);}})[_0xc150('0x23')](function(_0x5c756a){if(_0x5c756a){return _0x5c756a?{'count':_0x32bc0b,'rows':_0x5c756a}:null;}})[_0xc150('0x23')](respondWithResult(_0x24cc8d,null))[_0xc150('0x40')](handleError(_0x24cc8d,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index da79641..4172182 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 _0x54a4=['api','moment','bluebird','path','rimraf','../../config/environment','define','CmCompany','lodash','util','../../config/logger'];(function(_0x41f56a,_0x49a25b){var _0x25d410=function(_0x2aae95){while(--_0x2aae95){_0x41f56a['push'](_0x41f56a['shift']());}};_0x25d410(++_0x49a25b);}(_0x54a4,0x17e));var _0x454a=function(_0x2bc288,_0x2d7f08){_0x2bc288=_0x2bc288-0x0;var _0x38d080=_0x54a4[_0x2bc288];return _0x38d080;};'use strict';var _=require(_0x454a('0x0'));var util=require(_0x454a('0x1'));var logger=require(_0x454a('0x2'))(_0x454a('0x3'));var moment=require(_0x454a('0x4'));var BPromise=require(_0x454a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x454a('0x6'));var rimraf=require(_0x454a('0x7'));var config=require(_0x454a('0x8'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x5b1a55,_0x36e093){return _0x5b1a55[_0x454a('0x9')](_0x454a('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x257d=['exports','define','cm_companies','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cmCompany.attributes'];(function(_0x47878f,_0x48d3bf){var _0x4b05b8=function(_0x3d6597){while(--_0x3d6597){_0x47878f['push'](_0x47878f['shift']());}};_0x4b05b8(++_0x48d3bf);}(_0x257d,0x1b3));var _0xd257=function(_0x498e3f,_0x15bb7d){_0x498e3f=_0x498e3f-0x0;var _0x537c0f=_0x257d[_0x498e3f];return _0x537c0f;};'use strict';var _=require(_0xd257('0x0'));var util=require(_0xd257('0x1'));var logger=require(_0xd257('0x2'))(_0xd257('0x3'));var moment=require(_0xd257('0x4'));var BPromise=require('bluebird');var rp=require(_0xd257('0x5'));var fs=require('fs');var path=require(_0xd257('0x6'));var rimraf=require(_0xd257('0x7'));var config=require('../../config/environment');var attributes=require(_0xd257('0x8'));module[_0xd257('0x9')]=function(_0x420e20,_0x4711fc){return _0x420e20[_0xd257('0xa')]('CmCompany',attributes,{'tableName':_0xd257('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 90e3090..6a86591 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 _0x9ccc=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x9c964b,_0x5a2929){var _0x5f3df7=function(_0x1f7a7e){while(--_0x1f7a7e){_0x9c964b['push'](_0x9c964b['shift']());}};_0x5f3df7(++_0x5a2929);}(_0x9ccc,0x161));var _0xc9cc=function(_0x21cf56,_0x25733c){_0x21cf56=_0x21cf56-0x0;var _0x31f4e0=_0x9ccc[_0x21cf56];return _0x31f4e0;};'use strict';var _=require(_0xc9cc('0x0'));var util=require(_0xc9cc('0x1'));var moment=require(_0xc9cc('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9cc('0x3'));var fs=require('fs');var Redis=require(_0xc9cc('0x4'));var db=require(_0xc9cc('0x5'))['db'];var utils=require(_0xc9cc('0x6'));var logger=require(_0xc9cc('0x7'))('rpc');var config=require(_0xc9cc('0x8'));var jayson=require(_0xc9cc('0x9'));var client=jayson['client'][_0xc9cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6b87,_0x41fad2,_0x4b806e){return new BPromise(function(_0x4117fc,_0x26d398){return client[_0xc9cc('0xb')](_0x3f6b87,_0x4b806e)[_0xc9cc('0xc')](function(_0x307cbe){logger[_0xc9cc('0xd')](_0xc9cc('0xe'),_0x41fad2,'request\x20sent');logger[_0xc9cc('0xf')](_0xc9cc('0x10'),_0x41fad2,_0xc9cc('0x11'),JSON['stringify'](_0x307cbe));if(_0x307cbe[_0xc9cc('0x12')]){if(_0x307cbe[_0xc9cc('0x12')][_0xc9cc('0x13')]===0x1f4){logger['error'](_0xc9cc('0xe'),_0x41fad2,_0x307cbe[_0xc9cc('0x12')][_0xc9cc('0x14')]);return _0x26d398(_0x307cbe['error'][_0xc9cc('0x14')]);}logger[_0xc9cc('0x12')](_0xc9cc('0xe'),_0x41fad2,_0x307cbe[_0xc9cc('0x12')][_0xc9cc('0x14')]);return _0x4117fc(_0x307cbe['error'][_0xc9cc('0x14')]);}else{logger[_0xc9cc('0xd')](_0xc9cc('0xe'),_0x41fad2,_0xc9cc('0x11'));_0x4117fc(_0x307cbe[_0xc9cc('0x15')][_0xc9cc('0x14')]);}})['catch'](function(_0x30ea0e){logger['error'](_0xc9cc('0xe'),_0x41fad2,_0x30ea0e);_0x26d398(_0x30ea0e);});});}
\ No newline at end of file
+var _0x21c7=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2d0472,_0x2b3088){var _0x46a846=function(_0x209b5b){while(--_0x209b5b){_0x2d0472['push'](_0x2d0472['shift']());}};_0x46a846(++_0x2b3088);}(_0x21c7,0x1a8));var _0x721c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x721c('0x0'));var util=require(_0x721c('0x1'));var moment=require(_0x721c('0x2'));var BPromise=require(_0x721c('0x3'));var rs=require(_0x721c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x721c('0x5'));var logger=require(_0x721c('0x6'))(_0x721c('0x7'));var config=require(_0x721c('0x8'));var jayson=require(_0x721c('0x9'));var client=jayson[_0x721c('0xa')][_0x721c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53a7a6,_0x169b50,_0x33f7a2){return new BPromise(function(_0x5df156,_0x4996bd){return client[_0x721c('0xc')](_0x53a7a6,_0x33f7a2)[_0x721c('0xd')](function(_0x275b0e){logger['info']('CmCompany,\x20%s,\x20%s',_0x169b50,_0x721c('0xe'));logger[_0x721c('0xf')](_0x721c('0x10'),_0x169b50,_0x721c('0xe'),JSON[_0x721c('0x11')](_0x275b0e));if(_0x275b0e[_0x721c('0x12')]){if(_0x275b0e[_0x721c('0x12')][_0x721c('0x13')]===0x1f4){logger[_0x721c('0x12')](_0x721c('0x14'),_0x169b50,_0x275b0e[_0x721c('0x12')][_0x721c('0x15')]);return _0x4996bd(_0x275b0e['error'][_0x721c('0x15')]);}logger[_0x721c('0x12')](_0x721c('0x14'),_0x169b50,_0x275b0e[_0x721c('0x12')][_0x721c('0x15')]);return _0x5df156(_0x275b0e[_0x721c('0x12')]['message']);}else{logger[_0x721c('0x16')]('CmCompany,\x20%s,\x20%s',_0x169b50,_0x721c('0xe'));_0x5df156(_0x275b0e[_0x721c('0x17')][_0x721c('0x15')]);}})['catch'](function(_0x2f6c42){logger[_0x721c('0x12')](_0x721c('0x14'),_0x169b50,_0x2f6c42);_0x4996bd(_0x2f6c42);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 287cc6f..ff0bdb2 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 _0xd578=['index','get','isAuthenticated','describe','show','/:id/contacts','getContacts','create','post','addContacts','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xd578,0x1dd));var _0x8d57=function(_0x205570,_0x42fc4e){_0x205570=_0x205570-0x0;var _0x3f1c80=_0xd578[_0x205570];return _0x3f1c80;};'use strict';var multer=require(_0x8d57('0x0'));var util=require(_0x8d57('0x1'));var path=require(_0x8d57('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d57('0x3'));var router=express[_0x8d57('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8d57('0x5'));var config=require(_0x8d57('0x6'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8d57('0x7')]);router[_0x8d57('0x8')]('/describe',auth[_0x8d57('0x9')](),controller[_0x8d57('0xa')]);router[_0x8d57('0x8')]('/:id',auth[_0x8d57('0x9')](),controller[_0x8d57('0xb')]);router[_0x8d57('0x8')](_0x8d57('0xc'),auth[_0x8d57('0x9')](),controller[_0x8d57('0xd')]);router['post']('/',auth[_0x8d57('0x9')](),controller[_0x8d57('0xe')]);router[_0x8d57('0xf')](_0x8d57('0xc'),auth['isAuthenticated'](),controller[_0x8d57('0x10')]);router[_0x8d57('0x11')](_0x8d57('0x12'),auth[_0x8d57('0x9')](),controller[_0x8d57('0x13')]);router[_0x8d57('0x14')](_0x8d57('0x12'),auth[_0x8d57('0x9')](),controller[_0x8d57('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x26a2=['../../config/environment','./cmCompany.controller','isAuthenticated','/describe','describe','get','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x26a2,0x125));var _0x226a=function(_0x3b004f,_0x16392b){_0x3b004f=_0x3b004f-0x0;var _0x167b2f=_0x26a2[_0x3b004f];return _0x167b2f;};'use strict';var multer=require(_0x226a('0x0'));var util=require('util');var path=require(_0x226a('0x1'));var timeout=require(_0x226a('0x2'));var express=require('express');var router=express[_0x226a('0x3')]();var fs_extra=require(_0x226a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x226a('0x5'));var config=require(_0x226a('0x6'));var controller=require(_0x226a('0x7'));router['get']('/',auth[_0x226a('0x8')](),controller['index']);router['get'](_0x226a('0x9'),auth[_0x226a('0x8')](),controller[_0x226a('0xa')]);router[_0x226a('0xb')](_0x226a('0xc'),auth[_0x226a('0x8')](),controller['show']);router[_0x226a('0xb')](_0x226a('0xd'),auth[_0x226a('0x8')](),controller[_0x226a('0xe')]);router[_0x226a('0xf')]('/',auth[_0x226a('0x8')](),controller[_0x226a('0x10')]);router[_0x226a('0xf')](_0x226a('0xd'),auth[_0x226a('0x8')](),controller[_0x226a('0x11')]);router[_0x226a('0x12')](_0x226a('0xc'),auth['isAuthenticated'](),controller[_0x226a('0x13')]);router[_0x226a('0x14')](_0x226a('0xc'),auth['isAuthenticated'](),controller[_0x226a('0x15')]);module[_0x226a('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3434f5f..0c4b2e0 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 _0xda2e=['NOW','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x32d09e,_0x5e05bf){var _0x4c6451=function(_0x36fc57){while(--_0x36fc57){_0x32d09e['push'](_0x32d09e['shift']());}};_0x4c6451(++_0x5e05bf);}(_0xda2e,0xd9));var _0xeda2=function(_0x19fb2b,_0x212bd8){_0x19fb2b=_0x19fb2b-0x0;var _0x3be612=_0xda2e[_0x19fb2b];return _0x3be612;};'use strict';var _=require(_0xeda2('0x0'));var Sequelize=require(_0xeda2('0x1'));module[_0xeda2('0x2')]={'firstName':{'type':Sequelize[_0xeda2('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xeda2('0x3')]},'street':{'type':Sequelize[_0xeda2('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xeda2('0x3')]},'country':{'type':Sequelize[_0xeda2('0x3')]},'dateOfBirth':{'type':Sequelize[_0xeda2('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xeda2('0x3')]},'mobile':{'type':Sequelize[_0xeda2('0x3')]},'fax':{'type':Sequelize[_0xeda2('0x3')]},'email':{'type':Sequelize[_0xeda2('0x3')]},'url':{'type':Sequelize[_0xeda2('0x3')]},'facebook':{'type':Sequelize[_0xeda2('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xeda2('0x3')]},'skype':{'type':Sequelize[_0xeda2('0x3')]},'teams':{'type':Sequelize[_0xeda2('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xeda2('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xeda2('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xeda2('0x3')]},'priority':{'type':Sequelize[_0xeda2('0x4')](0x2)[_0xeda2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xeda2('0x6')],'defaultValue':Sequelize[_0xeda2('0x7')]},'dialTimezone':{'type':Sequelize[_0xeda2('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x49c8=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x49c8,0x7f));var _0x849c=function(_0x1f7fd5,_0x16dbb3){_0x1f7fd5=_0x1f7fd5-0x0;var _0x429402=_0x49c8[_0x1f7fd5];return _0x429402;};'use strict';var _=require(_0x849c('0x0'));var Sequelize=require(_0x849c('0x1'));module[_0x849c('0x2')]={'firstName':{'type':Sequelize[_0x849c('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x849c('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x849c('0x3')]},'city':{'type':Sequelize[_0x849c('0x3')]},'country':{'type':Sequelize[_0x849c('0x3')]},'dateOfBirth':{'type':Sequelize[_0x849c('0x3')]},'description':{'type':Sequelize[_0x849c('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x849c('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x849c('0x3')]},'url':{'type':Sequelize[_0x849c('0x3')]},'facebook':{'type':Sequelize[_0x849c('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x849c('0x3')]},'skype':{'type':Sequelize[_0x849c('0x3')]},'teams':{'type':Sequelize[_0x849c('0x3')]},'viber':{'type':Sequelize[_0x849c('0x3')]},'line':{'type':Sequelize[_0x849c('0x3')]},'wechat':{'type':Sequelize[_0x849c('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x849c('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x849c('0x3')]},'priority':{'type':Sequelize[_0x849c('0x5')](0x2)[_0x849c('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x849c('0x7')],'defaultValue':Sequelize[_0x849c('0x8')]},'dialTimezone':{'type':Sequelize[_0x849c('0x3')]},'utcOffset':{'type':Sequelize[_0x849c('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 5b8c15f..887f4cb 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','node-tnef'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x335e,0x87));var _0xe335=function(_0x218df0,_0x257ad5){_0x218df0=_0x218df0-0x0;var _0x17b682=_0x335e[_0x218df0];return _0x17b682;};'use strict';var _=require(_0xe335('0x0'));var moment=require(_0xe335('0x1'));var random=require(_0xe335('0x2'));var fs=require('fs');var path=require(_0xe335('0x3'));var util=require('util');var tnef=require(_0xe335('0x4'));var logger=require(_0xe335('0x5'))(_0xe335('0x6'));var config=require(_0xe335('0x7'));function getAddress(_0x4f2e51){var _0x5d8d61=_['head'](_0x4f2e51[_0xe335('0x8')]);return _0x5d8d61&&_0x5d8d61[_0xe335('0x9')]?_0x5d8d61['address']:'anonymous'+random[_0xe335('0xa')](0x6)+_0xe335('0xb');}function getFirstName(_0x426272){var _0x3fec75=_[_0xe335('0xc')](_0x426272[_0xe335('0x8')]);if(_0x3fec75&&_0x3fec75[_0xe335('0xd')]){if(_0x3fec75['name']==_0x3fec75[_0xe335('0x9')]){return _0x3fec75[_0xe335('0xd')]['substring'](0x0,_0x3fec75['name'][_0xe335('0xe')]('@'));}var _0x24da7f=_0x3fec75[_0xe335('0xd')]['split'](/\s+/);return _0x24da7f[_0xe335('0xf')]>0x1?_0x24da7f[_0xe335('0x10')](0x0,-0x1)[_0xe335('0x11')]('\x20'):_0x3fec75['name'];}return'Anonymous';}function getLastName(_0xfe3142){var _0x17e364=_[_0xe335('0xc')](_0xfe3142['value']);if(_0x17e364&&_0x17e364[_0xe335('0xd')]){var _0x4f7b16=_0x17e364[_0xe335('0xd')][_0xe335('0x12')](/\s+/);return _0x4f7b16[_0xe335('0xf')]>0x1?_0x4f7b16['pop']():'';}return'';}function getMails(_0x4c212a,_0x4c94d4){var _0x239e61='';for(var _0x226995=0x0;_0x226995<_0x4c94d4[_0xe335('0x8')]['length'];_0x226995+=0x1){if(_0x4c94d4[_0xe335('0x8')][_0x226995]['address']!==_0x4c212a){if(!_[_0xe335('0x13')](_0x239e61)){_0x239e61+=',';}_0x239e61+=_0x4c94d4[_0xe335('0x8')][_0x226995][_0xe335('0xd')]||_0x4c94d4[_0xe335('0x8')][_0x226995][_0xe335('0x9')]||'';_0x239e61+='\x20<';_0x239e61+=_0x4c94d4[_0xe335('0x8')][_0x226995]['address']?_0x4c94d4[_0xe335('0x8')][_0x226995][_0xe335('0x9')]:_0xe335('0x14')+random['generate'](0x6)+_0xe335('0xb');_0x239e61+='>';}}return _0x239e61;}function parseEmail(_0x5136d9,_0x4acf5d,_0x347d7f){if(_0x4acf5d['html']){var _0xb5afb5=/