From 0d03a34a13f6be28bbe0fa462ef85188f70f51b6 Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Mon, 6 Sep 2021 14:52:24 +0200
Subject: [PATCH] Built motion from commit 1644b69e.|2.5.345
---
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 +-
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/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 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.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/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/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 +-
1151 files changed, 1151 insertions(+), 1151 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 69e77db..229cad8 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-06T12:29:21.798Z",
+ "time": "2021-09-06T12:41:38.576Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 2cb94a6..149402f 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-06T12:29:21.798Z",
+ "time": "2021-09-06T12:41:38.576Z",
"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 7b0035a..0a2630b 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 _0x6657=['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]','TEXT','sequelize','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','jscripty','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]'];(function(_0x4e0de1,_0x251835){var _0x507b73=function(_0x4353b7){while(--_0x4353b7){_0x4e0de1['push'](_0x4e0de1['shift']());}};_0x507b73(++_0x251835);}(_0x6657,0x17f));var _0x7665=function(_0x53691d,_0x5d11a2){_0x53691d=_0x53691d-0x0;var _0x4849b0=_0x6657[_0x53691d];return _0x4849b0;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'name':{'type':Sequelize[_0x7665('0x1')],'get':function(_0x43c954){return this[_0x7665('0x2')](_0x7665('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x7665('0x4'),_0x7665('0x5'),_0x7665('0x6'),_0x7665('0x7'),_0x7665('0x8'),_0x7665('0x9'),_0x7665('0xa'),_0x7665('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x7665('0xc')},'data1':{'type':Sequelize[_0x7665('0xd')](0x1000),'comment':_0x7665('0xe')},'data2':{'type':Sequelize[_0x7665('0xd')](0x1000),'comment':_0x7665('0xf')},'data3':{'type':Sequelize[_0x7665('0xd')](0x1000),'comment':_0x7665('0x10')},'data4':{'type':Sequelize[_0x7665('0xd')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x7665('0xd')](0x1000),'comments':_0x7665('0x11')},'data6':{'type':Sequelize[_0x7665('0xd')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x7665('0x12')],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x0618=['motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','getDataValue','contactManager','integration'];(function(_0x6e9a2c,_0x500106){var _0x4e331b=function(_0x4e8711){while(--_0x4e8711){_0x6e9a2c['push'](_0x6e9a2c['shift']());}};_0x4e331b(++_0x500106);}(_0x0618,0x1c6));var _0x8061=function(_0x32e68f,_0x57a2df){_0x32e68f=_0x32e68f-0x0;var _0x31ce49=_0x0618[_0x32e68f];return _0x31ce49;};'use strict';var Sequelize=require(_0x8061('0x0'));module[_0x8061('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x973865){return this[_0x8061('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8061('0x3'),_0x8061('0x4'),_0x8061('0x5'),_0x8061('0x6'),_0x8061('0x7'),_0x8061('0x8'),_0x8061('0x9'),_0x8061('0xa')]],'msg':_0x8061('0xb')}},'comment':_0x8061('0xb')},'data1':{'type':Sequelize[_0x8061('0xc')](0x1000),'comment':'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)]'},'data2':{'type':Sequelize[_0x8061('0xc')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x8061('0xc')](0x1000),'comment':_0x8061('0xd')},'data4':{'type':Sequelize[_0x8061('0xc')](0x1000),'comments':_0x8061('0xe')},'data5':{'type':Sequelize[_0x8061('0xc')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize['STRING'],'comments':_0x8061('0xf')},'data7':{'type':Sequelize[_0x8061('0x10')],'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 5fc9323..d0a7ca1 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 _0x9f6f=['offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','body','Action','find','params','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x2550ce,_0x45209b){var _0x25748d=function(_0x806ad5){while(--_0x806ad5){_0x2550ce['push'](_0x2550ce['shift']());}};_0x25748d(++_0x45209b);}(_0x9f6f,0x1b1));var _0xf9f6=function(_0xdc545c,_0x1b010f){_0xdc545c=_0xdc545c-0x0;var _0x249c58=_0x9f6f[_0xdc545c];return _0x249c58;};'use strict';var emlformat=require(_0xf9f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf9f6('0x1'));var rp=require(_0xf9f6('0x2'));var moment=require('moment');var BPromise=require(_0xf9f6('0x3'));var Mustache=require(_0xf9f6('0x4'));var util=require(_0xf9f6('0x5'));var path=require(_0xf9f6('0x6'));var sox=require(_0xf9f6('0x7'));var csv=require(_0xf9f6('0x8'));var ejs=require(_0xf9f6('0x9'));var fs=require('fs');var fs_extra=require(_0xf9f6('0xa'));var _=require('lodash');var squel=require(_0xf9f6('0xb'));var crypto=require(_0xf9f6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf9f6('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf9f6('0xe'));var Papa=require(_0xf9f6('0xf'));var Redis=require(_0xf9f6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf9f6('0x11'));var as=require(_0xf9f6('0x12'));var hardwareService=require(_0xf9f6('0x13'));var logger=require(_0xf9f6('0x14'))('api');var utils=require(_0xf9f6('0x15'));var config=require(_0xf9f6('0x16'));var licenseUtil=require(_0xf9f6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x175627,_0x17cc69){_0x17cc69=_0x17cc69||0xcc;return function(_0x3b1fc3){if(_0x3b1fc3){return _0x175627[_0xf9f6('0x18')](_0x17cc69);}return _0x175627[_0xf9f6('0x19')](_0x17cc69)['end']();};}function respondWithResult(_0x4ad7b6,_0x3b6cee){_0x3b6cee=_0x3b6cee||0xc8;return function(_0x38946f){if(_0x38946f){return _0x4ad7b6[_0xf9f6('0x19')](_0x3b6cee)[_0xf9f6('0x1a')](_0x38946f);}};}function respondWithFilteredResult(_0x3b5d5f,_0x4460dc){return function(_0x5a8235){if(_0x5a8235){var _0x16577a=typeof _0x4460dc[_0xf9f6('0x1b')]===_0xf9f6('0x1c')&&typeof _0x4460dc['limit']===_0xf9f6('0x1c');var _0x7b6e1a=_0x5a8235['count'];var _0x3fa0a3=_0x16577a?0x0:_0x4460dc[_0xf9f6('0x1b')];var _0x2e3c9f=_0x16577a?_0x5a8235[_0xf9f6('0x1d')]:_0x4460dc[_0xf9f6('0x1b')]+_0x4460dc[_0xf9f6('0x1e')];var _0x6a1b06;if(_0x2e3c9f>=_0x7b6e1a){_0x2e3c9f=_0x7b6e1a;_0x6a1b06=0xc8;}else{_0x6a1b06=0xce;}_0x3b5d5f[_0xf9f6('0x19')](_0x6a1b06);return _0x3b5d5f['set'](_0xf9f6('0x1f'),_0x3fa0a3+'-'+_0x2e3c9f+'/'+_0x7b6e1a)[_0xf9f6('0x1a')](_0x5a8235);}return null;};}function patchUpdates(_0x1cfa2d){return function(_0x379339){try{jsonpatch[_0xf9f6('0x20')](_0x379339,_0x1cfa2d,!![]);}catch(_0x4b2512){return BPromise[_0xf9f6('0x21')](_0x4b2512);}return _0x379339['save']();};}function saveUpdates(_0x13df70,_0x541e73){return function(_0x55baa9){if(_0x55baa9){return _0x55baa9[_0xf9f6('0x22')](_0x13df70)[_0xf9f6('0x23')](function(_0x5450e6){return _0x5450e6;});}return null;};}function removeEntity(_0x4d54d2,_0x417556){return function(_0x142670){if(_0x142670){return _0x142670[_0xf9f6('0x24')]()[_0xf9f6('0x23')](function(){_0x4d54d2['status'](0xcc)[_0xf9f6('0x25')]();});}};}function handleEntityNotFound(_0x309cff,_0x149264){return function(_0x1bc51e){if(!_0x1bc51e){_0x309cff['sendStatus'](0x194);}return _0x1bc51e;};}function handleError(_0x24d97e,_0x3d5457){_0x3d5457=_0x3d5457||0x1f4;return function(_0x4d6b8e){logger[_0xf9f6('0x26')](_0x4d6b8e[_0xf9f6('0x27')]);if(_0x4d6b8e[_0xf9f6('0x28')]){delete _0x4d6b8e[_0xf9f6('0x28')];}_0x24d97e['status'](_0x3d5457)[_0xf9f6('0x29')](_0x4d6b8e);};}exports[_0xf9f6('0x22')]=function(_0x511cb2,_0x1110fa){if(_0x511cb2[_0xf9f6('0x2a')]['id']){delete _0x511cb2[_0xf9f6('0x2a')]['id'];}return db[_0xf9f6('0x2b')][_0xf9f6('0x2c')]({'where':{'id':_0x511cb2[_0xf9f6('0x2d')]['id']}})[_0xf9f6('0x23')](handleEntityNotFound(_0x1110fa,null))[_0xf9f6('0x23')](saveUpdates(_0x511cb2[_0xf9f6('0x2a')],null))[_0xf9f6('0x23')](respondWithResult(_0x1110fa,null))['catch'](handleError(_0x1110fa,null));};exports[_0xf9f6('0x24')]=function(_0x3968c3,_0x257745){return db[_0xf9f6('0x2b')]['find']({'where':{'id':_0x3968c3[_0xf9f6('0x2d')]['id']}})[_0xf9f6('0x23')](handleEntityNotFound(_0x257745,null))['then'](removeEntity(_0x257745,null))['catch'](handleError(_0x257745,null));};
\ No newline at end of file
+var _0xf051=['destroy','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','stack','name','send','body','Action','find','params','catch'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0xf051,0x17b));var _0x1f05=function(_0x488262,_0x407387){_0x488262=_0x488262-0x0;var _0x3a4c00=_0xf051[_0x488262];return _0x3a4c00;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1f05('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f05('0x1'));var rp=require(_0x1f05('0x2'));var moment=require('moment');var BPromise=require(_0x1f05('0x3'));var Mustache=require(_0x1f05('0x4'));var util=require(_0x1f05('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x1f05('0x6'));var ejs=require(_0x1f05('0x7'));var fs=require('fs');var fs_extra=require(_0x1f05('0x8'));var _=require('lodash');var squel=require(_0x1f05('0x9'));var crypto=require('crypto');var jsforce=require(_0x1f05('0xa'));var deskjs=require(_0x1f05('0xb'));var toCsv=require(_0x1f05('0x6'));var querystring=require('querystring');var Papa=require(_0x1f05('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1f05('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f05('0xe'))(_0x1f05('0xf'));var utils=require(_0x1f05('0x10'));var config=require(_0x1f05('0x11'));var licenseUtil=require(_0x1f05('0x12'));var db=require(_0x1f05('0x13'))['db'];function respondWithStatusCode(_0x3556ce,_0x1a78ab){_0x1a78ab=_0x1a78ab||0xcc;return function(_0x5374af){if(_0x5374af){return _0x3556ce[_0x1f05('0x14')](_0x1a78ab);}return _0x3556ce[_0x1f05('0x15')](_0x1a78ab)[_0x1f05('0x16')]();};}function respondWithResult(_0x4e7e9a,_0x3cbcb7){_0x3cbcb7=_0x3cbcb7||0xc8;return function(_0x17b642){if(_0x17b642){return _0x4e7e9a[_0x1f05('0x15')](_0x3cbcb7)['json'](_0x17b642);}};}function respondWithFilteredResult(_0x2c1cfa,_0x5bf92b){return function(_0x3fa9b2){if(_0x3fa9b2){var _0x85a501=typeof _0x5bf92b[_0x1f05('0x17')]===_0x1f05('0x18')&&typeof _0x5bf92b['limit']===_0x1f05('0x18');var _0x29472b=_0x3fa9b2[_0x1f05('0x19')];var _0x5f0398=_0x85a501?0x0:_0x5bf92b[_0x1f05('0x17')];var _0x2335f1=_0x85a501?_0x3fa9b2[_0x1f05('0x19')]:_0x5bf92b[_0x1f05('0x17')]+_0x5bf92b['limit'];var _0x45ec3c;if(_0x2335f1>=_0x29472b){_0x2335f1=_0x29472b;_0x45ec3c=0xc8;}else{_0x45ec3c=0xce;}_0x2c1cfa[_0x1f05('0x15')](_0x45ec3c);return _0x2c1cfa[_0x1f05('0x1a')](_0x1f05('0x1b'),_0x5f0398+'-'+_0x2335f1+'/'+_0x29472b)[_0x1f05('0x1c')](_0x3fa9b2);}return null;};}function patchUpdates(_0x3543eb){return function(_0xf43147){try{jsonpatch['apply'](_0xf43147,_0x3543eb,!![]);}catch(_0x59e377){return BPromise[_0x1f05('0x1d')](_0x59e377);}return _0xf43147[_0x1f05('0x1e')]();};}function saveUpdates(_0x3f08c5,_0x574dbd){return function(_0x400fc6){if(_0x400fc6){return _0x400fc6[_0x1f05('0x1f')](_0x3f08c5)[_0x1f05('0x20')](function(_0x23dcc6){return _0x23dcc6;});}return null;};}function removeEntity(_0x58b505,_0x59456c){return function(_0x214422){if(_0x214422){return _0x214422['destroy']()[_0x1f05('0x20')](function(){_0x58b505[_0x1f05('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x122465,_0x24308f){return function(_0x4c1dae){if(!_0x4c1dae){_0x122465[_0x1f05('0x14')](0x194);}return _0x4c1dae;};}function handleError(_0x316fbc,_0xa6c692){_0xa6c692=_0xa6c692||0x1f4;return function(_0x44c8c7){logger['error'](_0x44c8c7[_0x1f05('0x21')]);if(_0x44c8c7['name']){delete _0x44c8c7[_0x1f05('0x22')];}_0x316fbc['status'](_0xa6c692)[_0x1f05('0x23')](_0x44c8c7);};}exports[_0x1f05('0x1f')]=function(_0x1c80cc,_0x24eca6){if(_0x1c80cc[_0x1f05('0x24')]['id']){delete _0x1c80cc[_0x1f05('0x24')]['id'];}return db[_0x1f05('0x25')][_0x1f05('0x26')]({'where':{'id':_0x1c80cc[_0x1f05('0x27')]['id']}})[_0x1f05('0x20')](handleEntityNotFound(_0x24eca6,null))[_0x1f05('0x20')](saveUpdates(_0x1c80cc['body'],null))[_0x1f05('0x20')](respondWithResult(_0x24eca6,null))[_0x1f05('0x28')](handleError(_0x24eca6,null));};exports[_0x1f05('0x29')]=function(_0x48c9d6,_0x4847f7){return db[_0x1f05('0x25')]['find']({'where':{'id':_0x48c9d6[_0x1f05('0x27')]['id']}})[_0x1f05('0x20')](handleEntityNotFound(_0x4847f7,null))[_0x1f05('0x20')](removeEntity(_0x4847f7,null))['catch'](handleError(_0x4847f7,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 86f4906..c015250 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 _0x36b1=['exports','define','Action','lodash','util','../../config/logger','path','../../config/environment','./action.attributes'];(function(_0x1bcaa5,_0x4d8f4e){var _0x5093b6=function(_0x30a5ae){while(--_0x30a5ae){_0x1bcaa5['push'](_0x1bcaa5['shift']());}};_0x5093b6(++_0x4d8f4e);}(_0x36b1,0x1aa));var _0x136b=function(_0x10219c,_0x20196e){_0x10219c=_0x10219c-0x0;var _0x5139b9=_0x36b1[_0x10219c];return _0x5139b9;};'use strict';var _=require(_0x136b('0x0'));var util=require(_0x136b('0x1'));var logger=require(_0x136b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x136b('0x3'));var rimraf=require('rimraf');var config=require(_0x136b('0x4'));var attributes=require(_0x136b('0x5'));module[_0x136b('0x6')]=function(_0x2240a6,_0x5a8f24){return _0x2240a6[_0x136b('0x7')](_0x136b('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf30d=['moment','bluebird','path','rimraf','./action.attributes','exports','lodash','util'];(function(_0x3fd3a3,_0x36c863){var _0xa3e4d5=function(_0x1fd03b){while(--_0x1fd03b){_0x3fd3a3['push'](_0x3fd3a3['shift']());}};_0xa3e4d5(++_0x36c863);}(_0xf30d,0xd6));var _0xdf30=function(_0x5093c0,_0x4884c5){_0x5093c0=_0x5093c0-0x0;var _0x1acd10=_0xf30d[_0x5093c0];return _0x1acd10;};'use strict';var _=require(_0xdf30('0x0'));var util=require(_0xdf30('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdf30('0x2'));var BPromise=require(_0xdf30('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf30('0x4'));var rimraf=require(_0xdf30('0x5'));var config=require('../../config/environment');var attributes=require(_0xdf30('0x6'));module[_0xdf30('0x7')]=function(_0x332210,_0x566088){return _0x332210['define']('Action',attributes,{'tableName':'tools_actions','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 f548fde..3887209 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 _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x37b27b,_0x45571c){_0x37b27b=_0x37b27b-0x0;var _0x5deff7=_0x1cb9[_0x37b27b];return _0x5deff7;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x994286,_0x5cdc6e){var _0x149aed=function(_0xb7bd84){while(--_0xb7bd84){_0x994286['push'](_0x994286['shift']());}};_0x149aed(++_0x5cdc6e);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x45ea78,_0x31678e){_0x45ea78=_0x45ea78-0x0;var _0xd722b7=_0x7fbe[_0x45ea78];return _0xd722b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 2d5d7d4..586bbc4 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 _0xe978=['connect-timeout','express','Router','fs-extra','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','path'];(function(_0x5c1353,_0x328298){var _0x31e2e6=function(_0x5d37e4){while(--_0x5d37e4){_0x5c1353['push'](_0x5c1353['shift']());}};_0x31e2e6(++_0x328298);}(_0xe978,0x173));var _0x8e97=function(_0x2a44b9,_0x51ac94){_0x2a44b9=_0x2a44b9-0x0;var _0x1e2fa5=_0xe978[_0x2a44b9];return _0x1e2fa5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8e97('0x0'));var timeout=require(_0x8e97('0x1'));var express=require(_0x8e97('0x2'));var router=express[_0x8e97('0x3')]();var fs_extra=require(_0x8e97('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8e97('0x5'));var controller=require(_0x8e97('0x6'));router[_0x8e97('0x7')](_0x8e97('0x8'),auth[_0x8e97('0x9')](),controller[_0x8e97('0xa')]);router[_0x8e97('0xb')](_0x8e97('0x8'),auth[_0x8e97('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xcd08=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','isAuthenticated','update','delete','/:id','exports','multer','util','path','connect-timeout'];(function(_0x59001b,_0x550269){var _0x4d9707=function(_0x538c09){while(--_0x538c09){_0x59001b['push'](_0x59001b['shift']());}};_0x4d9707(++_0x550269);}(_0xcd08,0x10a));var _0x8cd0=function(_0x486ea1,_0x2e4bef){_0x486ea1=_0x486ea1-0x0;var _0x1849e5=_0xcd08[_0x486ea1];return _0x1849e5;};'use strict';var multer=require(_0x8cd0('0x0'));var util=require(_0x8cd0('0x1'));var path=require(_0x8cd0('0x2'));var timeout=require(_0x8cd0('0x3'));var express=require(_0x8cd0('0x4'));var router=express['Router']();var fs_extra=require(_0x8cd0('0x5'));var auth=require(_0x8cd0('0x6'));var interaction=require(_0x8cd0('0x7'));var config=require('../../config/environment');var controller=require(_0x8cd0('0x8'));router[_0x8cd0('0x9')]('/:id',auth[_0x8cd0('0xa')](),controller[_0x8cd0('0xb')]);router[_0x8cd0('0xc')](_0x8cd0('0xd'),auth[_0x8cd0('0xa')](),controller['destroy']);module[_0x8cd0('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 0623c67..39ed9d0 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 _0xf494=['STRING','TEXT','sequelize','exports'];(function(_0x5815af,_0x361f0b){var _0x3f14cb=function(_0x422c47){while(--_0x422c47){_0x5815af['push'](_0x5815af['shift']());}};_0x3f14cb(++_0x361f0b);}(_0xf494,0x1c6));var _0x4f49=function(_0x3a6ff9,_0x4ae96f){_0x3a6ff9=_0x3a6ff9-0x0;var _0x48467e=_0xf494[_0x3a6ff9];return _0x48467e;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x4f49('0x2')]},'table':{'type':Sequelize[_0x4f49('0x2')]},'conditions':{'type':Sequelize[_0x4f49('0x3')]},'joins':{'type':Sequelize[_0x4f49('0x3')]}};
\ No newline at end of file
+var _0xc4aa=['STRING','sequelize','exports'];(function(_0x2e1489,_0x18033f){var _0x1d41c1=function(_0x699b47){while(--_0x699b47){_0x2e1489['push'](_0x2e1489['shift']());}};_0x1d41c1(++_0x18033f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 5b9947f..f4b1189 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 _0xa33d=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','update','then','UserProfileResource','destroy','error','name','send','map','AnalyticCustomReport','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','keys','filters','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','findAll','keyBy','select','from','table','MetricId','function','replace','format','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20EMPTY','Sequelize','AnalyticMetric','metric','groupBy','alias','output','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','run','runReport','IS\x20NOT\x20NULL','%s.%s\x20=\x20%s.%s','debug','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','fs-extra','lodash','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa33d,0x8f));var _0xda33=function(_0x214f4d,_0x3153ad){_0x214f4d=_0x214f4d-0x0;var _0x5218e6=_0xa33d[_0x214f4d];return _0x5218e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xda33('0x0'));var zipdir=require(_0xda33('0x1'));var jsonpatch=require(_0xda33('0x2'));var rp=require(_0xda33('0x3'));var moment=require(_0xda33('0x4'));var BPromise=require(_0xda33('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xda33('0x6'));var sox=require(_0xda33('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda33('0x8'));var _=require(_0xda33('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xda33('0xa'));var toCsv=require(_0xda33('0xb'));var querystring=require(_0xda33('0xc'));var Papa=require('papaparse');var Redis=require(_0xda33('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda33('0xe'));var hardwareService=require(_0xda33('0xf'));var logger=require(_0xda33('0x10'))('api');var utils=require(_0xda33('0x11'));var config=require(_0xda33('0x12'));var licenseUtil=require(_0xda33('0x13'));var db=require(_0xda33('0x14'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x42fdb3,_0x2ab371){_0x2ab371=_0x2ab371||0xcc;return function(_0x1e4f57){if(_0x1e4f57){return _0x42fdb3[_0xda33('0x15')](_0x2ab371);}return _0x42fdb3['status'](_0x2ab371)['end']();};}function respondWithResult(_0x56d423,_0x5f4722){_0x5f4722=_0x5f4722||0xc8;return function(_0x2bf0c4){if(_0x2bf0c4){return _0x56d423[_0xda33('0x16')](_0x5f4722)[_0xda33('0x17')](_0x2bf0c4);}};}function respondWithFilteredResult(_0xc98127,_0x342def){return function(_0x300e3f){if(_0x300e3f){var _0x4aa762=typeof _0x342def[_0xda33('0x18')]==='undefined'&&typeof _0x342def[_0xda33('0x19')]===_0xda33('0x1a');var _0x22928d=_0x300e3f[_0xda33('0x1b')];var _0x2cbb63=_0x4aa762?0x0:_0x342def[_0xda33('0x18')];var _0x3a6b0b=_0x4aa762?_0x300e3f[_0xda33('0x1b')]:_0x342def[_0xda33('0x18')]+_0x342def[_0xda33('0x19')];var _0x340401;if(_0x3a6b0b>=_0x22928d){_0x3a6b0b=_0x22928d;_0x340401=0xc8;}else{_0x340401=0xce;}_0xc98127[_0xda33('0x16')](_0x340401);return _0xc98127['set'](_0xda33('0x1c'),_0x2cbb63+'-'+_0x3a6b0b+'/'+_0x22928d)[_0xda33('0x17')](_0x300e3f);}return null;};}function patchUpdates(_0x4fcaa4){return function(_0x586f2f){try{jsonpatch['apply'](_0x586f2f,_0x4fcaa4,!![]);}catch(_0x46e601){return BPromise[_0xda33('0x1d')](_0x46e601);}return _0x586f2f['save']();};}function saveUpdates(_0x4f6a0e,_0x2e319c){return function(_0xcdebf3){if(_0xcdebf3){return _0xcdebf3[_0xda33('0x1e')](_0x4f6a0e)[_0xda33('0x1f')](function(_0x12c538){return _0x12c538;});}return null;};}function removeEntity(_0x261642,_0x2955f1){return function(_0x48aed8){if(_0x48aed8){return _0x48aed8['destroy']()['then'](function(){var _0x5a7ba1=_0x48aed8['get']({'plain':!![]});var _0x1ccb6a='CustomReports';return db[_0xda33('0x20')][_0xda33('0x21')]({'where':{'type':_0x1ccb6a,'resourceId':_0x5a7ba1['id']}})[_0xda33('0x1f')](function(){return _0x48aed8;});})['then'](function(){_0x261642[_0xda33('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b9021,_0x4e1eca){return function(_0x3b5e16){if(!_0x3b5e16){_0x5b9021[_0xda33('0x15')](0x194);}return _0x3b5e16;};}function handleError(_0x2be28e,_0x45810c){_0x45810c=_0x45810c||0x1f4;return function(_0x142486){logger[_0xda33('0x22')](_0x142486['stack']);if(_0x142486[_0xda33('0x23')]){delete _0x142486['name'];}_0x2be28e[_0xda33('0x16')](_0x45810c)[_0xda33('0x24')](_0x142486);};}exports['index']=function(_0x168ac4,_0xe7714c){var _0x1acc7e={},_0x47620f={},_0xddbff9={'count':0x0,'rows':[]};var _0x4d4b4e=_[_0xda33('0x25')](db[_0xda33('0x26')]['rawAttributes'],function(_0x4ffc2b){return{'name':_0x4ffc2b[_0xda33('0x27')],'type':_0x4ffc2b[_0xda33('0x28')]['key']};});_0x47620f[_0xda33('0x29')]=_[_0xda33('0x25')](_0x4d4b4e,_0xda33('0x23'));_0x47620f['query']=_['keys'](_0x168ac4[_0xda33('0x2a')]);_0x47620f['filters']=_[_0xda33('0x2b')](_0x47620f[_0xda33('0x29')],_0x47620f[_0xda33('0x2a')]);_0x1acc7e['attributes']=_[_0xda33('0x2b')](_0x47620f['model'],qs[_0xda33('0x2c')](_0x168ac4['query'][_0xda33('0x2c')]));_0x1acc7e[_0xda33('0x2d')]=_0x1acc7e[_0xda33('0x2d')]['length']?_0x1acc7e[_0xda33('0x2d')]:_0x47620f['model'];if(!_0x168ac4[_0xda33('0x2a')][_0xda33('0x2e')](_0xda33('0x2f'))){_0x1acc7e['limit']=qs[_0xda33('0x19')](_0x168ac4['query'][_0xda33('0x19')]);_0x1acc7e[_0xda33('0x18')]=qs['offset'](_0x168ac4[_0xda33('0x2a')]['offset']);}_0x1acc7e[_0xda33('0x30')]=qs[_0xda33('0x31')](_0x168ac4['query'][_0xda33('0x31')]);_0x1acc7e[_0xda33('0x32')]=qs['filters'](_[_0xda33('0x33')](_0x168ac4[_0xda33('0x2a')],_0x47620f['filters']),_0x4d4b4e);if(_0x168ac4['query'][_0xda33('0x34')]){_0x1acc7e['where']=_[_0xda33('0x35')](_0x1acc7e[_0xda33('0x32')],{'$or':_[_0xda33('0x25')](_0x4d4b4e,function(_0x6409d9){if(_0x6409d9[_0xda33('0x28')]!==_0xda33('0x36')){var _0x58ddde={};_0x58ddde[_0x6409d9['name']]={'$like':'%'+_0x168ac4[_0xda33('0x2a')]['filter']+'%'};return _0x58ddde;}})});}_0x1acc7e=_[_0xda33('0x35')]({},_0x1acc7e,_0x168ac4[_0xda33('0x37')]);var _0xf324e0={'where':_0x1acc7e[_0xda33('0x32')]};return db[_0xda33('0x26')][_0xda33('0x1b')](_0xf324e0)[_0xda33('0x1f')](function(_0x4c3ae6){_0xddbff9[_0xda33('0x1b')]=_0x4c3ae6;if(_0x168ac4[_0xda33('0x2a')][_0xda33('0x38')]){_0x1acc7e[_0xda33('0x39')]=[{'all':!![]}];}return db[_0xda33('0x26')]['findAll'](_0x1acc7e);})[_0xda33('0x1f')](function(_0x5cabd9){_0xddbff9['rows']=_0x5cabd9;return _0xddbff9;})[_0xda33('0x1f')](respondWithFilteredResult(_0xe7714c,_0x1acc7e))[_0xda33('0x3a')](handleError(_0xe7714c,null));};exports['show']=function(_0x37beb4,_0x27311b){var _0x3726dd={'raw':![],'where':{'id':_0x37beb4[_0xda33('0x3b')]['id']}},_0x3ecb91={};_0x3ecb91[_0xda33('0x29')]=_['keys'](db[_0xda33('0x26')][_0xda33('0x3c')]);_0x3ecb91[_0xda33('0x2a')]=_[_0xda33('0x3d')](_0x37beb4['query']);_0x3ecb91[_0xda33('0x3e')]=_['intersection'](_0x3ecb91[_0xda33('0x29')],_0x3ecb91[_0xda33('0x2a')]);_0x3726dd[_0xda33('0x2d')]=_[_0xda33('0x2b')](_0x3ecb91[_0xda33('0x29')],qs[_0xda33('0x2c')](_0x37beb4[_0xda33('0x2a')][_0xda33('0x2c')]));_0x3726dd['attributes']=_0x3726dd[_0xda33('0x2d')][_0xda33('0x3f')]?_0x3726dd[_0xda33('0x2d')]:_0x3ecb91['model'];if(_0x37beb4[_0xda33('0x2a')][_0xda33('0x38')]){_0x3726dd[_0xda33('0x39')]=[{'all':!![]}];}_0x3726dd=_[_0xda33('0x35')]({},_0x3726dd,_0x37beb4['options']);return db[_0xda33('0x26')][_0xda33('0x40')](_0x3726dd)[_0xda33('0x1f')](handleEntityNotFound(_0x27311b,null))['then'](respondWithResult(_0x27311b,null))['catch'](handleError(_0x27311b,null));};exports[_0xda33('0x41')]=function(_0x1dcc64,_0x584ea9){return db[_0xda33('0x26')][_0xda33('0x41')](_0x1dcc64[_0xda33('0x42')],{})[_0xda33('0x1f')](function(_0x43ab8d){var _0x4e81f9=_0x1dcc64[_0xda33('0x43')][_0xda33('0x44')]({'plain':!![]});if(!_0x4e81f9)throw new Error(_0xda33('0x45'));if(_0x4e81f9['role']===_0xda33('0x43')){var _0x566bdc=_0x43ab8d[_0xda33('0x44')]({'plain':!![]});var _0x575c2=_0xda33('0x46');return db[_0xda33('0x47')]['find']({'where':{'name':_0x575c2,'userProfileId':_0x4e81f9[_0xda33('0x48')]},'raw':!![]})['then'](function(_0x1bbb1c){if(_0x1bbb1c&&_0x1bbb1c[_0xda33('0x49')]===0x0){return db[_0xda33('0x20')]['create']({'name':_0x566bdc[_0xda33('0x23')],'resourceId':_0x566bdc['id'],'type':_0xda33('0x4a'),'sectionId':_0x1bbb1c['id']},{})[_0xda33('0x1f')](function(){return _0x43ab8d;});}else{return _0x43ab8d;}})[_0xda33('0x3a')](function(_0x700803){logger['error'](_0xda33('0x4b'),_0x700803);throw _0x700803;});}return _0x43ab8d;})[_0xda33('0x1f')](respondWithResult(_0x584ea9,0xc9))['catch'](handleError(_0x584ea9,null));};exports['update']=function(_0x3be859,_0x451bb2){if(_0x3be859[_0xda33('0x42')]['id']){delete _0x3be859[_0xda33('0x42')]['id'];}return db['AnalyticCustomReport'][_0xda33('0x40')]({'where':{'id':_0x3be859[_0xda33('0x3b')]['id']}})[_0xda33('0x1f')](handleEntityNotFound(_0x451bb2,null))[_0xda33('0x1f')](saveUpdates(_0x3be859[_0xda33('0x42')],null))[_0xda33('0x1f')](respondWithResult(_0x451bb2,null))['catch'](handleError(_0x451bb2,null));};exports[_0xda33('0x21')]=function(_0x2df531,_0x3b73da){return db['AnalyticCustomReport']['find']({'where':{'id':_0x2df531[_0xda33('0x3b')]['id']}})[_0xda33('0x1f')](handleEntityNotFound(_0x3b73da,null))[_0xda33('0x1f')](removeEntity(_0x3b73da,null))[_0xda33('0x3a')](handleError(_0x3b73da,null));};exports[_0xda33('0x4c')]=function(_0xb2c643,_0x59fd3b){var _0x56f479=0xa;var _0x236101=[_0xda33('0x4d'),_0xda33('0x4e'),_0xda33('0x4f'),_0xda33('0x50')];var _0x5370fc={'SUM':_0xda33('0x51'),'COUNT':_0xda33('0x52'),'COUNT DISTINCT':_0xda33('0x53'),'MAX':_0xda33('0x54'),'MIN':_0xda33('0x55'),'AVG':_0xda33('0x56'),'GROUP_CONCAT':_0xda33('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xda33('0x58')};var _0x528cd4={'SEC_TO_TIME':_0xda33('0x59'),'DATE':_0xda33('0x5a'),'HOUR':_0xda33('0x5b'),'ROUND':_0xda33('0x5c'),'UNIX_TIMESTAMP':_0xda33('0x5d')};var _0x547aa5=function(_0x106d87){return!_[_0xda33('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xda33('0x5f')],_0x106d87);};var _0x13baeb=function(_0x16f9bd){if(!_0x16f9bd||!_0x16f9bd[_0xda33('0x60')]['length']){return'';}for(var _0x1a5c34='(',_0x49349b=0x0;_0x49349b<_0x16f9bd['rules'][_0xda33('0x3f')];_0x49349b+=0x1){_0x49349b>0x0&&(_0x1a5c34+='\x20'+_0x16f9bd[_0xda33('0x61')]+'\x20');_0x1a5c34+=_0x16f9bd[_0xda33('0x60')][_0x49349b][_0xda33('0x62')]?_0x13baeb(_0x16f9bd['rules'][_0x49349b][_0xda33('0x62')]):_0x16f9bd[_0xda33('0x60')][_0x49349b][_0xda33('0x63')]+'\x20'+_0x16f9bd['rules'][_0x49349b][_0xda33('0x64')]+(_0x547aa5(_0x16f9bd[_0xda33('0x60')][_0x49349b][_0xda33('0x64')])?'\x20'+_0x16f9bd[_0xda33('0x60')][_0x49349b][_0xda33('0x65')]:'');}return _0x1a5c34+')';};var _0x3284b9={'where':{'id':_0xb2c643[_0xda33('0x3b')]['id']}},_0x25888b,_0x31ea41,_0x3d6cf6,_0x26fd1e,_0x3d83c7;_0x3284b9=_[_0xda33('0x35')]({},_0x3284b9,_0xb2c643[_0xda33('0x37')]);return db[_0xda33('0x26')][_0xda33('0x40')](_0x3284b9)[_0xda33('0x1f')](function(_0x4765c9){if(_0x4765c9){_0x25888b=_0x4765c9;return _0x4765c9[_0xda33('0x66')]();}return null;})[_0xda33('0x1f')](function(_0x3eb953){if(_0x3eb953){if(!_0x3eb953['length']){throw new db['Sequelize'][(_0xda33('0x67'))](_0xda33('0x68'),0x193);}_0x31ea41=_0x3eb953;return db['AnalyticMetric'][_0xda33('0x69')]({'raw':!![]});}return null;})[_0xda33('0x1f')](function(_0x2bf423){if(_0x2bf423){_0x3d6cf6=_[_0xda33('0x6a')](_0x2bf423,'id');var _0x482af1;var _0x12be75=squel[_0xda33('0x6b')]();_0x12be75[_0xda33('0x6c')](_0x25888b[_0xda33('0x6d')]);for(var _0x3108f3=0x0;_0x3108f3<_0x31ea41[_0xda33('0x3f')];_0x3108f3+=0x1){_0x482af1=_0x31ea41[_0x3108f3][_0xda33('0x6e')]?_0x3d6cf6[_0x31ea41[_0x3108f3][_0xda33('0x6e')]]['metric']:_0x31ea41[_0x3108f3][_0xda33('0x63')];_0x482af1=_0x31ea41[_0x3108f3][_0xda33('0x6f')]?_['replace'](_0x5370fc[_0x31ea41[_0x3108f3][_0xda33('0x6f')]],'%s',_0x482af1):_0x482af1;_0x482af1=_0x31ea41[_0x3108f3]['format']?_[_0xda33('0x70')](_0x528cd4[_0x31ea41[_0x3108f3][_0xda33('0x71')]],'%s',_0x482af1):_0x482af1;if(_0x31ea41[_0x3108f3]['groupBy']){_0x12be75[_0xda33('0x62')](_0x482af1);}_0x31ea41[_0x3108f3]['orderBy']&&_0x12be75[_0xda33('0x30')](_0x482af1,_0x31ea41[_0x3108f3][_0xda33('0x72')]===_0xda33('0x73')?![]:!![]);_0x12be75[_0xda33('0x63')](_0x482af1,_0x31ea41[_0x3108f3]['alias']||_0x482af1);}if(_0x25888b[_0xda33('0x74')]){_0x25888b[_0xda33('0x74')]=JSON[_0xda33('0x75')](_0x25888b[_0xda33('0x74')]);for(var _0x3241d0=0x0;_0x3241d0<_0x25888b['joins'][_0xda33('0x3f')];_0x3241d0+=0x1){if(_0x25888b['joins'][_0x3241d0][_0xda33('0x28')]&&_[_0xda33('0x5e')](_0x236101,_0x25888b[_0xda33('0x74')][_0x3241d0][_0xda33('0x28')])&&_0x25888b['joins'][_0x3241d0][_0xda33('0x76')]&&_0x25888b[_0xda33('0x74')][_0x3241d0][_0xda33('0x77')]&&_0x25888b['joins'][_0x3241d0][_0xda33('0x78')]){_0x12be75[_0x25888b[_0xda33('0x74')][_0x3241d0][_0xda33('0x28')]](_0x25888b[_0xda33('0x74')][_0x3241d0][_0xda33('0x77')],null,util[_0xda33('0x71')]('%s.%s\x20=\x20%s.%s',_0x25888b[_0xda33('0x6d')],_0x25888b[_0xda33('0x74')][_0x3241d0][_0xda33('0x76')],_0x25888b[_0xda33('0x74')][_0x3241d0][_0xda33('0x77')],_0x25888b['joins'][_0x3241d0][_0xda33('0x78')]));}}}if(_0x25888b[_0xda33('0x79')]){_0x25888b['conditions']=JSON[_0xda33('0x75')](_0x25888b['conditions']);_0x12be75['where'](_0x13baeb(_0x25888b['conditions'][_0xda33('0x62')]));}_0x3d83c7=_0x12be75[_0xda33('0x7a')]();_0x12be75[_0xda33('0x19')](_0x56f479);_0x12be75[_0xda33('0x18')](0x0);logger['debug'](_0xda33('0x7b'),_0x12be75[_0xda33('0x7c')]());return dbH[_0xda33('0x7d')][_0xda33('0x2a')](_0x12be75[_0xda33('0x7c')](),{'type':dbH[_0xda33('0x7d')]['QueryTypes'][_0xda33('0x7e')]});}})[_0xda33('0x1f')](respondWithResult(_0x59fd3b,null))[_0xda33('0x3a')](handleError(_0x59fd3b,null));};function runReport(_0xa9641a,_0x57c5f9,_0x45e814){var _0xae6491=_0x57c5f9[_0xda33('0x23')];var _0x11c9c6=0xa;var _0xa0c674=[_0xda33('0x4d'),_0xda33('0x4e'),_0xda33('0x4f'),_0xda33('0x50')];var _0x176a63={'SUM':_0xda33('0x51'),'COUNT':_0xda33('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xda33('0x55'),'AVG':_0xda33('0x56'),'GROUP_CONCAT':_0xda33('0x57'),'GROUP_CONCAT ASC':_0xda33('0x7f'),'GROUP_CONCAT DESC':_0xda33('0x58')};var _0x3b34ab={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xda33('0x5a'),'HOUR':_0xda33('0x5b'),'ROUND':_0xda33('0x5c'),'UNIX_TIMESTAMP':_0xda33('0x5d')};var _0x2877a9=function(_0x588447){return!_[_0xda33('0x5e')]([_0xda33('0x80'),'IS\x20NOT\x20NULL',_0xda33('0x81'),_0xda33('0x5f')],_0x588447);};var _0x310b8b=function(_0x498b1f){if(!_0x498b1f||!_0x498b1f['rules']['length']){return'';}for(var _0x9ca72b='(',_0x3b423a=0x0;_0x3b423a<_0x498b1f[_0xda33('0x60')][_0xda33('0x3f')];_0x3b423a+=0x1){_0x3b423a>0x0&&(_0x9ca72b+='\x20'+_0x498b1f[_0xda33('0x61')]+'\x20');_0x9ca72b+=_0x498b1f[_0xda33('0x60')][_0x3b423a][_0xda33('0x62')]?_0x310b8b(_0x498b1f[_0xda33('0x60')][_0x3b423a][_0xda33('0x62')]):_0x498b1f['rules'][_0x3b423a][_0xda33('0x63')]+'\x20'+_0x498b1f[_0xda33('0x60')][_0x3b423a]['condition']+(_0x2877a9(_0x498b1f[_0xda33('0x60')][_0x3b423a][_0xda33('0x64')])?'\x20'+_0x498b1f[_0xda33('0x60')][_0x3b423a][_0xda33('0x65')]:'');}return _0x9ca72b+')';};var _0x9bf68f={'where':{'id':_0xa9641a['id']}},_0x5f36fc,_0x30240f,_0x10f4e7,_0x43cc99,_0x5dd34a;_0x9bf68f=_[_0xda33('0x35')]({},_0x9bf68f,_0x45e814);return db[_0xda33('0x26')]['find'](_0x9bf68f)[_0xda33('0x1f')](function(_0x451497){if(_0x451497){_0x5f36fc=_0x451497;return _0x451497[_0xda33('0x66')]();}return null;})[_0xda33('0x1f')](function(_0x70a6cc){if(_0x70a6cc){if(!_0x70a6cc[_0xda33('0x3f')]){throw new db[(_0xda33('0x82'))][(_0xda33('0x67'))](_0xda33('0x68'),0x193);}_0x30240f=_0x70a6cc;return db[_0xda33('0x83')]['findAll']({'raw':!![]});}return null;})[_0xda33('0x1f')](function(_0x3f58b7){if(_0x3f58b7){_0x10f4e7=_[_0xda33('0x6a')](_0x3f58b7,'id');var _0x31f557;var _0x29520c=squel['select']();_0x29520c[_0xda33('0x6c')](_0x5f36fc[_0xda33('0x6d')]);for(var _0x1db94e=0x0;_0x1db94e<_0x30240f['length'];_0x1db94e+=0x1){_0x31f557=_0x30240f[_0x1db94e]['MetricId']?_0x10f4e7[_0x30240f[_0x1db94e][_0xda33('0x6e')]][_0xda33('0x84')]:_0x30240f[_0x1db94e][_0xda33('0x63')];_0x31f557=_0x30240f[_0x1db94e][_0xda33('0x6f')]?_['replace'](_0x176a63[_0x30240f[_0x1db94e][_0xda33('0x6f')]],'%s',_0x31f557):_0x31f557;_0x31f557=_0x30240f[_0x1db94e]['format']?_[_0xda33('0x70')](_0x3b34ab[_0x30240f[_0x1db94e][_0xda33('0x71')]],'%s',_0x31f557):_0x31f557;if(_0x30240f[_0x1db94e][_0xda33('0x85')]){_0x29520c[_0xda33('0x62')](_0x31f557);}_0x30240f[_0x1db94e][_0xda33('0x72')]&&_0x29520c['order'](_0x31f557,_0x30240f[_0x1db94e][_0xda33('0x72')]==='DESC'?![]:!![]);_0x29520c[_0xda33('0x63')](_0x31f557,_0x30240f[_0x1db94e][_0xda33('0x86')]||_0x31f557);}if(_0x5f36fc[_0xda33('0x74')]){_0x5f36fc[_0xda33('0x74')]=JSON[_0xda33('0x75')](_0x5f36fc[_0xda33('0x74')]);for(var _0x2e7ba5=0x0;_0x2e7ba5<_0x5f36fc[_0xda33('0x74')][_0xda33('0x3f')];_0x2e7ba5+=0x1){if(_0x5f36fc[_0xda33('0x74')][_0x2e7ba5][_0xda33('0x28')]&&_[_0xda33('0x5e')](_0xa0c674,_0x5f36fc[_0xda33('0x74')][_0x2e7ba5][_0xda33('0x28')])&&_0x5f36fc[_0xda33('0x74')][_0x2e7ba5][_0xda33('0x76')]&&_0x5f36fc['joins'][_0x2e7ba5][_0xda33('0x77')]&&_0x5f36fc['joins'][_0x2e7ba5][_0xda33('0x78')]){_0x29520c[_0x5f36fc[_0xda33('0x74')][_0x2e7ba5][_0xda33('0x28')]](_0x5f36fc[_0xda33('0x74')][_0x2e7ba5][_0xda33('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5f36fc['table'],_0x5f36fc[_0xda33('0x74')][_0x2e7ba5][_0xda33('0x76')],_0x5f36fc[_0xda33('0x74')][_0x2e7ba5][_0xda33('0x77')],_0x5f36fc[_0xda33('0x74')][_0x2e7ba5][_0xda33('0x78')]));}}}if(_0x5f36fc[_0xda33('0x79')]){_0x5f36fc[_0xda33('0x79')]=JSON[_0xda33('0x75')](_0x5f36fc['conditions']);_0x29520c[_0xda33('0x32')](_0x310b8b(_0x5f36fc[_0xda33('0x79')][_0xda33('0x62')]));}_0x5dd34a=_0x29520c[_0xda33('0x7a')]();_0x29520c[_0xda33('0x19')](_0x11c9c6);_0x29520c['offset'](0x0);return;}})['then'](function(){if(_0x57c5f9[_0xda33('0x87')]==='web'){return null;}var _0x19cb9a=_[_0xda33('0x35')](_0x57c5f9,{'name':_0x57c5f9[_0xda33('0x88')]||_0x57c5f9[_0xda33('0x23')]||_0x5f36fc[_0xda33('0x23')],'basename':_0xae6491,'savename':util['format'](_0xda33('0x89'),_0x57c5f9[_0xda33('0x23')]||_0x5f36fc[_0xda33('0x23')],require('randomstring')[_0xda33('0x8a')](0x4),_0x57c5f9[_0xda33('0x87')]||_0xda33('0x8b')),'reportId':_0x5f36fc['id'],'reportType':_0xda33('0x8c')});return db[_0xda33('0x8d')][_0xda33('0x41')](_0x19cb9a,{'raw':!![]});})['then'](function(_0x44abf5){if(_0x5f36fc[_0xda33('0x6d')]==='cdr'){_0x5dd34a['where'](_0x5f36fc[_0xda33('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x57c5f9[_0xda33('0x8e')],_0x57c5f9[_0xda33('0x8f')]);}else{_0x5dd34a[_0xda33('0x32')](_0x5f36fc[_0xda33('0x6d')]+_0xda33('0x90'),_0x57c5f9['startDate'],_0x57c5f9['endDate']);}if(_0x44abf5){logger[_0xda33('0x91')](_0xda33('0x92'),_0x5dd34a[_0xda33('0x7c')]());require(_0xda33('0x93'))[_0xda33('0x94')](path[_0xda33('0x4d')](__dirname,_0xda33('0x95'),_0x44abf5['output']),[_0x44abf5['id'],_0x5dd34a[_0xda33('0x7c')](),path['join'](__dirname,_0xda33('0x96'),_0x44abf5[_0xda33('0x97')]),_0xae6491]);return _0x44abf5;}else{var _0x50ee7b=squel[_0xda33('0x6b')]();_0x50ee7b[_0xda33('0x6c')]('('+_0x5dd34a[_0xda33('0x7c')]()+')',_0xda33('0x98'));_0x50ee7b[_0xda33('0x63')](_0xda33('0x99'),_0xda33('0x1b'));_0x5dd34a['limit'](_0x57c5f9[_0xda33('0x19')]||_0x11c9c6);_0x5dd34a[_0xda33('0x18')](_0x57c5f9[_0xda33('0x18')]||0x0);return dbH['sequelize'][_0xda33('0x2a')](_0x50ee7b[_0xda33('0x7c')](),{'type':dbH['sequelize'][_0xda33('0x9a')]['SELECT']})['then'](function(_0x45147a){if(!_0x45147a[_0xda33('0x3f')]){_0x43cc99=0x0;}else{_0x43cc99=_0x45147a[0x0][_0xda33('0x1b')]||0x0;}return dbH[_0xda33('0x7d')][_0xda33('0x2a')](_0x5dd34a['toString'](),{'type':dbH[_0xda33('0x7d')][_0xda33('0x9a')][_0xda33('0x7e')]});})['then'](function(_0x1e4676){return{'rows':_0x1e4676||[],'count':_0x43cc99};});}});}exports[_0xda33('0x9b')]=function(_0xf60957,_0x2dbdb8){return runReport(_0xf60957[_0xda33('0x3b')],_0xf60957[_0xda33('0x2a')],_0xf60957[_0xda33('0x37')])[_0xda33('0x1f')](respondWithResult(_0x2dbdb8,null))[_0xda33('0x3a')](handleError(_0x2dbdb8,null));};exports[_0xda33('0x9c')]=runReport;exports[_0xda33('0x2a')]=function(_0x24bd2f,_0x322aa4){var _0x599732=0xa;var _0x16fa77=[_0xda33('0x4d'),_0xda33('0x4e'),'right_join',_0xda33('0x50')];var _0x343b5d={'SUM':_0xda33('0x51'),'COUNT':_0xda33('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xda33('0x55'),'AVG':_0xda33('0x56'),'GROUP_CONCAT':_0xda33('0x57'),'GROUP_CONCAT ASC':_0xda33('0x7f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x305df1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xda33('0x5a'),'HOUR':_0xda33('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xda33('0x5d')};var _0x4f25e9=function(_0x16ae2a){return!_[_0xda33('0x5e')]([_0xda33('0x80'),_0xda33('0x9d'),_0xda33('0x81'),_0xda33('0x5f')],_0x16ae2a);};var _0x2dd0f2=function(_0x480113){if(!_0x480113||!_0x480113[_0xda33('0x60')][_0xda33('0x3f')]){return'';}for(var _0x5e1c01='(',_0x357491=0x0;_0x357491<_0x480113['rules']['length'];_0x357491+=0x1){_0x357491>0x0&&(_0x5e1c01+='\x20'+_0x480113[_0xda33('0x61')]+'\x20');_0x5e1c01+=_0x480113['rules'][_0x357491][_0xda33('0x62')]?_0x2dd0f2(_0x480113[_0xda33('0x60')][_0x357491]['group']):_0x480113[_0xda33('0x60')][_0x357491][_0xda33('0x63')]+'\x20'+_0x480113[_0xda33('0x60')][_0x357491][_0xda33('0x64')]+(_0x4f25e9(_0x480113[_0xda33('0x60')][_0x357491]['condition'])?'\x20'+_0x480113[_0xda33('0x60')][_0x357491][_0xda33('0x65')]:'');}return _0x5e1c01+')';};var _0x3d50ba={'where':{'id':_0x24bd2f[_0xda33('0x3b')]['id']}},_0x1fd895,_0x3de1b8,_0x1b5454,_0x1d357f,_0x2a5375;_0x3d50ba=_[_0xda33('0x35')]({},_0x3d50ba,_0x24bd2f[_0xda33('0x37')]);return db[_0xda33('0x26')][_0xda33('0x40')](_0x3d50ba)[_0xda33('0x1f')](function(_0x55a982){if(_0x55a982){_0x1fd895=_0x55a982;return _0x55a982[_0xda33('0x66')]();}return null;})[_0xda33('0x1f')](function(_0x1d517a){if(_0x1d517a){if(!_0x1d517a['length']){throw new db[(_0xda33('0x82'))][(_0xda33('0x67'))](_0xda33('0x68'),0x193);}_0x3de1b8=_0x1d517a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xda33('0x1f')](function(_0x21c35e){if(_0x21c35e){_0x1b5454=_[_0xda33('0x6a')](_0x21c35e,'id');var _0x3081e2;var _0x2cf42e=squel[_0xda33('0x6b')]();_0x2cf42e['from'](_0x1fd895[_0xda33('0x6d')]);for(var _0x1ae7a1=0x0;_0x1ae7a1<_0x3de1b8['length'];_0x1ae7a1+=0x1){_0x3081e2=_0x3de1b8[_0x1ae7a1][_0xda33('0x6e')]?_0x1b5454[_0x3de1b8[_0x1ae7a1]['MetricId']][_0xda33('0x84')]:_0x3de1b8[_0x1ae7a1]['field'];_0x3081e2=_0x3de1b8[_0x1ae7a1]['function']?_['replace'](_0x343b5d[_0x3de1b8[_0x1ae7a1]['function']],'%s',_0x3081e2):_0x3081e2;_0x3081e2=_0x3de1b8[_0x1ae7a1][_0xda33('0x71')]?_[_0xda33('0x70')](_0x305df1[_0x3de1b8[_0x1ae7a1]['format']],'%s',_0x3081e2):_0x3081e2;if(_0x3de1b8[_0x1ae7a1][_0xda33('0x85')]){_0x2cf42e[_0xda33('0x62')](_0x3081e2);}_0x3de1b8[_0x1ae7a1][_0xda33('0x72')]&&_0x2cf42e[_0xda33('0x30')](_0x3081e2,_0x3de1b8[_0x1ae7a1][_0xda33('0x72')]===_0xda33('0x73')?![]:!![]);_0x2cf42e['field'](_0x3081e2,_0x3de1b8[_0x1ae7a1][_0xda33('0x86')]||_0x3081e2);}if(_0x1fd895[_0xda33('0x74')]){_0x1fd895[_0xda33('0x74')]=JSON[_0xda33('0x75')](_0x1fd895[_0xda33('0x74')]);for(var _0x236961=0x0;_0x236961<_0x1fd895[_0xda33('0x74')][_0xda33('0x3f')];_0x236961+=0x1){if(_0x1fd895['joins'][_0x236961]['type']&&_[_0xda33('0x5e')](_0x16fa77,_0x1fd895[_0xda33('0x74')][_0x236961][_0xda33('0x28')])&&_0x1fd895[_0xda33('0x74')][_0x236961][_0xda33('0x76')]&&_0x1fd895['joins'][_0x236961][_0xda33('0x77')]&&_0x1fd895[_0xda33('0x74')][_0x236961][_0xda33('0x78')]){_0x2cf42e[_0x1fd895['joins'][_0x236961]['type']](_0x1fd895[_0xda33('0x74')][_0x236961][_0xda33('0x77')],null,util[_0xda33('0x71')](_0xda33('0x9e'),_0x1fd895[_0xda33('0x6d')],_0x1fd895[_0xda33('0x74')][_0x236961][_0xda33('0x76')],_0x1fd895['joins'][_0x236961][_0xda33('0x77')],_0x1fd895[_0xda33('0x74')][_0x236961]['foreignKey']));}}}if(_0x1fd895[_0xda33('0x79')]){_0x1fd895[_0xda33('0x79')]=JSON[_0xda33('0x75')](_0x1fd895[_0xda33('0x79')]);_0x2cf42e['where'](_0x2dd0f2(_0x1fd895[_0xda33('0x79')][_0xda33('0x62')]));}_0x2a5375=_0x2cf42e[_0xda33('0x7a')]();_0x2cf42e[_0xda33('0x19')](_0x599732);_0x2cf42e[_0xda33('0x18')](0x0);logger[_0xda33('0x9f')](_0xda33('0x7b'),_0x2cf42e['toString']());return dbH['sequelize'][_0xda33('0x2a')](_0x2cf42e[_0xda33('0x7c')](),{'type':dbH['sequelize'][_0xda33('0x9a')]['SELECT']});}})[_0xda33('0x1f')](function(){return{'sql':_0x2a5375[_0xda33('0x7c')]()};})[_0xda33('0x1f')](respondWithResult(_0x322aa4,null))[_0xda33('0x3a')](handleError(_0x322aa4,null));};
\ No newline at end of file
+var _0xd5ee=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','limit','undefined','count','apply','update','destroy','then','get','CustomReports','error','stack','name','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','AnalyticCustomReport','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','group','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','SUM(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','groupBy','output','web','randomstring','generate','csv','AnalyticExtractedReport','cdr','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','run','runReport','DESC','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4c9f5d,_0x232322){var _0xc5ddc2=function(_0x4168b5){while(--_0x4168b5){_0x4c9f5d['push'](_0x4c9f5d['shift']());}};_0xc5ddc2(++_0x232322);}(_0xd5ee,0x93));var _0xed5e=function(_0x2a6571,_0xf1567c){_0x2a6571=_0x2a6571-0x0;var _0xdf7731=_0xd5ee[_0x2a6571];return _0xdf7731;};'use strict';var emlformat=require(_0xed5e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed5e('0x1'));var jsonpatch=require(_0xed5e('0x2'));var rp=require(_0xed5e('0x3'));var moment=require('moment');var BPromise=require(_0xed5e('0x4'));var Mustache=require('mustache');var util=require(_0xed5e('0x5'));var path=require(_0xed5e('0x6'));var sox=require(_0xed5e('0x7'));var csv=require(_0xed5e('0x8'));var ejs=require(_0xed5e('0x9'));var fs=require('fs');var fs_extra=require(_0xed5e('0xa'));var _=require(_0xed5e('0xb'));var squel=require(_0xed5e('0xc'));var crypto=require(_0xed5e('0xd'));var jsforce=require(_0xed5e('0xe'));var deskjs=require(_0xed5e('0xf'));var toCsv=require('to-csv');var querystring=require(_0xed5e('0x10'));var Papa=require(_0xed5e('0x11'));var Redis=require(_0xed5e('0x12'));var authService=require(_0xed5e('0x13'));var qs=require(_0xed5e('0x14'));var as=require(_0xed5e('0x15'));var hardwareService=require(_0xed5e('0x16'));var logger=require(_0xed5e('0x17'))(_0xed5e('0x18'));var utils=require(_0xed5e('0x19'));var config=require(_0xed5e('0x1a'));var licenseUtil=require(_0xed5e('0x1b'));var db=require('../../mysqldb')['db'];var dbH=require(_0xed5e('0x1c'))[_0xed5e('0x1d')];function respondWithStatusCode(_0x26d25c,_0x27373b){_0x27373b=_0x27373b||0xcc;return function(_0x490085){if(_0x490085){return _0x26d25c['sendStatus'](_0x27373b);}return _0x26d25c[_0xed5e('0x1e')](_0x27373b)[_0xed5e('0x1f')]();};}function respondWithResult(_0x1fc3a7,_0x4f7552){_0x4f7552=_0x4f7552||0xc8;return function(_0x18b4ab){if(_0x18b4ab){return _0x1fc3a7[_0xed5e('0x1e')](_0x4f7552)[_0xed5e('0x20')](_0x18b4ab);}};}function respondWithFilteredResult(_0x10893d,_0x54fe57){return function(_0xa986ef){if(_0xa986ef){var _0x2f794f=typeof _0x54fe57[_0xed5e('0x21')]==='undefined'&&typeof _0x54fe57[_0xed5e('0x22')]===_0xed5e('0x23');var _0x2a166a=_0xa986ef['count'];var _0x102485=_0x2f794f?0x0:_0x54fe57['offset'];var _0x4b4f30=_0x2f794f?_0xa986ef[_0xed5e('0x24')]:_0x54fe57['offset']+_0x54fe57[_0xed5e('0x22')];var _0x34e26c;if(_0x4b4f30>=_0x2a166a){_0x4b4f30=_0x2a166a;_0x34e26c=0xc8;}else{_0x34e26c=0xce;}_0x10893d['status'](_0x34e26c);return _0x10893d['set']('Content-Range',_0x102485+'-'+_0x4b4f30+'/'+_0x2a166a)[_0xed5e('0x20')](_0xa986ef);}return null;};}function patchUpdates(_0x4c7fa6){return function(_0x1bbf80){try{jsonpatch[_0xed5e('0x25')](_0x1bbf80,_0x4c7fa6,!![]);}catch(_0x10013f){return BPromise['reject'](_0x10013f);}return _0x1bbf80['save']();};}function saveUpdates(_0x1462da,_0x3acd50){return function(_0x51d0f7){if(_0x51d0f7){return _0x51d0f7[_0xed5e('0x26')](_0x1462da)['then'](function(_0x34bf33){return _0x34bf33;});}return null;};}function removeEntity(_0x13433d,_0x2e087a){return function(_0x176490){if(_0x176490){return _0x176490[_0xed5e('0x27')]()[_0xed5e('0x28')](function(){var _0x35b67e=_0x176490[_0xed5e('0x29')]({'plain':!![]});var _0xf7c420=_0xed5e('0x2a');return db['UserProfileResource'][_0xed5e('0x27')]({'where':{'type':_0xf7c420,'resourceId':_0x35b67e['id']}})[_0xed5e('0x28')](function(){return _0x176490;});})[_0xed5e('0x28')](function(){_0x13433d[_0xed5e('0x1e')](0xcc)[_0xed5e('0x1f')]();});}};}function handleEntityNotFound(_0x44b3f,_0x246f27){return function(_0x5de547){if(!_0x5de547){_0x44b3f['sendStatus'](0x194);}return _0x5de547;};}function handleError(_0x2667ad,_0x23e048){_0x23e048=_0x23e048||0x1f4;return function(_0x69a1d4){logger[_0xed5e('0x2b')](_0x69a1d4[_0xed5e('0x2c')]);if(_0x69a1d4[_0xed5e('0x2d')]){delete _0x69a1d4[_0xed5e('0x2d')];}_0x2667ad[_0xed5e('0x1e')](_0x23e048)['send'](_0x69a1d4);};}exports['index']=function(_0xda4d6a,_0x180cef){var _0x4247e4={},_0x3e2c7e={},_0x141d71={'count':0x0,'rows':[]};var _0x215bcb=_[_0xed5e('0x2e')](db['AnalyticCustomReport']['rawAttributes'],function(_0x2857dd){return{'name':_0x2857dd[_0xed5e('0x2f')],'type':_0x2857dd[_0xed5e('0x30')]['key']};});_0x3e2c7e[_0xed5e('0x31')]=_[_0xed5e('0x2e')](_0x215bcb,_0xed5e('0x2d'));_0x3e2c7e[_0xed5e('0x32')]=_[_0xed5e('0x33')](_0xda4d6a[_0xed5e('0x32')]);_0x3e2c7e[_0xed5e('0x34')]=_[_0xed5e('0x35')](_0x3e2c7e['model'],_0x3e2c7e['query']);_0x4247e4[_0xed5e('0x36')]=_['intersection'](_0x3e2c7e[_0xed5e('0x31')],qs[_0xed5e('0x37')](_0xda4d6a[_0xed5e('0x32')][_0xed5e('0x37')]));_0x4247e4['attributes']=_0x4247e4[_0xed5e('0x36')][_0xed5e('0x38')]?_0x4247e4[_0xed5e('0x36')]:_0x3e2c7e['model'];if(!_0xda4d6a[_0xed5e('0x32')][_0xed5e('0x39')](_0xed5e('0x3a'))){_0x4247e4['limit']=qs[_0xed5e('0x22')](_0xda4d6a[_0xed5e('0x32')][_0xed5e('0x22')]);_0x4247e4[_0xed5e('0x21')]=qs[_0xed5e('0x21')](_0xda4d6a[_0xed5e('0x32')][_0xed5e('0x21')]);}_0x4247e4[_0xed5e('0x3b')]=qs[_0xed5e('0x3c')](_0xda4d6a[_0xed5e('0x32')][_0xed5e('0x3c')]);_0x4247e4[_0xed5e('0x3d')]=qs[_0xed5e('0x34')](_['pick'](_0xda4d6a[_0xed5e('0x32')],_0x3e2c7e[_0xed5e('0x34')]),_0x215bcb);if(_0xda4d6a[_0xed5e('0x32')][_0xed5e('0x3e')]){_0x4247e4[_0xed5e('0x3d')]=_[_0xed5e('0x3f')](_0x4247e4[_0xed5e('0x3d')],{'$or':_[_0xed5e('0x2e')](_0x215bcb,function(_0x59e458){if(_0x59e458[_0xed5e('0x30')]!=='VIRTUAL'){var _0x2b5f31={};_0x2b5f31[_0x59e458[_0xed5e('0x2d')]]={'$like':'%'+_0xda4d6a[_0xed5e('0x32')][_0xed5e('0x3e')]+'%'};return _0x2b5f31;}})});}_0x4247e4=_['merge']({},_0x4247e4,_0xda4d6a[_0xed5e('0x40')]);var _0xd21cb8={'where':_0x4247e4[_0xed5e('0x3d')]};return db[_0xed5e('0x41')]['count'](_0xd21cb8)['then'](function(_0x39f402){_0x141d71['count']=_0x39f402;if(_0xda4d6a[_0xed5e('0x32')]['includeAll']){_0x4247e4[_0xed5e('0x42')]=[{'all':!![]}];}return db[_0xed5e('0x41')][_0xed5e('0x43')](_0x4247e4);})['then'](function(_0x28fb6f){_0x141d71[_0xed5e('0x44')]=_0x28fb6f;return _0x141d71;})[_0xed5e('0x28')](respondWithFilteredResult(_0x180cef,_0x4247e4))[_0xed5e('0x45')](handleError(_0x180cef,null));};exports[_0xed5e('0x46')]=function(_0x3d0e98,_0x19c289){var _0x5b96fa={'raw':![],'where':{'id':_0x3d0e98[_0xed5e('0x47')]['id']}},_0x392a75={};_0x392a75[_0xed5e('0x31')]=_['keys'](db[_0xed5e('0x41')]['rawAttributes']);_0x392a75[_0xed5e('0x32')]=_[_0xed5e('0x33')](_0x3d0e98[_0xed5e('0x32')]);_0x392a75[_0xed5e('0x34')]=_['intersection'](_0x392a75['model'],_0x392a75[_0xed5e('0x32')]);_0x5b96fa[_0xed5e('0x36')]=_[_0xed5e('0x35')](_0x392a75[_0xed5e('0x31')],qs['fields'](_0x3d0e98['query'][_0xed5e('0x37')]));_0x5b96fa[_0xed5e('0x36')]=_0x5b96fa['attributes'][_0xed5e('0x38')]?_0x5b96fa[_0xed5e('0x36')]:_0x392a75['model'];if(_0x3d0e98['query']['includeAll']){_0x5b96fa[_0xed5e('0x42')]=[{'all':!![]}];}_0x5b96fa=_[_0xed5e('0x3f')]({},_0x5b96fa,_0x3d0e98['options']);return db['AnalyticCustomReport'][_0xed5e('0x48')](_0x5b96fa)['then'](handleEntityNotFound(_0x19c289,null))[_0xed5e('0x28')](respondWithResult(_0x19c289,null))[_0xed5e('0x45')](handleError(_0x19c289,null));};exports[_0xed5e('0x49')]=function(_0x5ca488,_0x1fd7b8){return db[_0xed5e('0x41')][_0xed5e('0x49')](_0x5ca488[_0xed5e('0x4a')],{})[_0xed5e('0x28')](function(_0x5695a0){var _0x5b6640=_0x5ca488['user']['get']({'plain':!![]});if(!_0x5b6640)throw new Error(_0xed5e('0x4b'));if(_0x5b6640['role']===_0xed5e('0x4c')){var _0x43d708=_0x5695a0[_0xed5e('0x29')]({'plain':!![]});var _0x106194=_0xed5e('0x4d');return db[_0xed5e('0x4e')][_0xed5e('0x48')]({'where':{'name':_0x106194,'userProfileId':_0x5b6640['userProfileId']},'raw':!![]})[_0xed5e('0x28')](function(_0xed2350){if(_0xed2350&&_0xed2350[_0xed5e('0x4f')]===0x0){return db[_0xed5e('0x50')][_0xed5e('0x49')]({'name':_0x43d708[_0xed5e('0x2d')],'resourceId':_0x43d708['id'],'type':_0xed5e('0x2a'),'sectionId':_0xed2350['id']},{})['then'](function(){return _0x5695a0;});}else{return _0x5695a0;}})[_0xed5e('0x45')](function(_0x51dc52){logger[_0xed5e('0x2b')](_0xed5e('0x51'),_0x51dc52);throw _0x51dc52;});}return _0x5695a0;})[_0xed5e('0x28')](respondWithResult(_0x1fd7b8,0xc9))[_0xed5e('0x45')](handleError(_0x1fd7b8,null));};exports[_0xed5e('0x26')]=function(_0x3db7f3,_0x4e86df){if(_0x3db7f3[_0xed5e('0x4a')]['id']){delete _0x3db7f3[_0xed5e('0x4a')]['id'];}return db['AnalyticCustomReport'][_0xed5e('0x48')]({'where':{'id':_0x3db7f3[_0xed5e('0x47')]['id']}})[_0xed5e('0x28')](handleEntityNotFound(_0x4e86df,null))[_0xed5e('0x28')](saveUpdates(_0x3db7f3[_0xed5e('0x4a')],null))[_0xed5e('0x28')](respondWithResult(_0x4e86df,null))[_0xed5e('0x45')](handleError(_0x4e86df,null));};exports[_0xed5e('0x27')]=function(_0x45d536,_0x97d857){return db[_0xed5e('0x41')][_0xed5e('0x48')]({'where':{'id':_0x45d536[_0xed5e('0x47')]['id']}})['then'](handleEntityNotFound(_0x97d857,null))[_0xed5e('0x28')](removeEntity(_0x97d857,null))[_0xed5e('0x45')](handleError(_0x97d857,null));};exports['preview']=function(_0x705dcc,_0x2d6909){var _0x30723c=0xa;var _0x58a0f2=['join',_0xed5e('0x52'),_0xed5e('0x53'),_0xed5e('0x54')];var _0x49ce27={'SUM':'SUM(%s)','COUNT':_0xed5e('0x55'),'COUNT DISTINCT':_0xed5e('0x56'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xed5e('0x57'),'GROUP_CONCAT':_0xed5e('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xed5e('0x59')};var _0x274e93={'SEC_TO_TIME':_0xed5e('0x5a'),'DATE':_0xed5e('0x5b'),'HOUR':_0xed5e('0x5c'),'ROUND':_0xed5e('0x5d'),'UNIX_TIMESTAMP':_0xed5e('0x5e')};var _0x1af289=function(_0x4e5ad3){return!_[_0xed5e('0x5f')]([_0xed5e('0x60'),'IS\x20NOT\x20NULL',_0xed5e('0x61'),_0xed5e('0x62')],_0x4e5ad3);};var _0x1ce896=function(_0x33baff){if(!_0x33baff||!_0x33baff[_0xed5e('0x63')][_0xed5e('0x38')]){return'';}for(var _0x4a30ec='(',_0x381f45=0x0;_0x381f45<_0x33baff[_0xed5e('0x63')][_0xed5e('0x38')];_0x381f45+=0x1){_0x381f45>0x0&&(_0x4a30ec+='\x20'+_0x33baff[_0xed5e('0x64')]+'\x20');_0x4a30ec+=_0x33baff[_0xed5e('0x63')][_0x381f45]['group']?_0x1ce896(_0x33baff['rules'][_0x381f45]['group']):_0x33baff[_0xed5e('0x63')][_0x381f45][_0xed5e('0x65')]+'\x20'+_0x33baff[_0xed5e('0x63')][_0x381f45][_0xed5e('0x66')]+(_0x1af289(_0x33baff[_0xed5e('0x63')][_0x381f45][_0xed5e('0x66')])?'\x20'+_0x33baff[_0xed5e('0x63')][_0x381f45][_0xed5e('0x67')]:'');}return _0x4a30ec+')';};var _0x27e987={'where':{'id':_0x705dcc[_0xed5e('0x47')]['id']}},_0xcc2619,_0x41a0d4,_0x265977,_0x30fef7,_0x308fb8;_0x27e987=_[_0xed5e('0x3f')]({},_0x27e987,_0x705dcc[_0xed5e('0x40')]);return db[_0xed5e('0x41')][_0xed5e('0x48')](_0x27e987)[_0xed5e('0x28')](function(_0x472aef){if(_0x472aef){_0xcc2619=_0x472aef;return _0x472aef[_0xed5e('0x68')]();}return null;})['then'](function(_0x54f01c){if(_0x54f01c){if(!_0x54f01c[_0xed5e('0x38')]){throw new db['Sequelize'][(_0xed5e('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x41a0d4=_0x54f01c;return db[_0xed5e('0x6a')][_0xed5e('0x43')]({'raw':!![]});}return null;})['then'](function(_0x18602a){if(_0x18602a){_0x265977=_['keyBy'](_0x18602a,'id');var _0x34b026;var _0x5de972=squel[_0xed5e('0x6b')]();_0x5de972[_0xed5e('0x6c')](_0xcc2619['table']);for(var _0x57e7e3=0x0;_0x57e7e3<_0x41a0d4['length'];_0x57e7e3+=0x1){_0x34b026=_0x41a0d4[_0x57e7e3][_0xed5e('0x6d')]?_0x265977[_0x41a0d4[_0x57e7e3][_0xed5e('0x6d')]][_0xed5e('0x6e')]:_0x41a0d4[_0x57e7e3][_0xed5e('0x65')];_0x34b026=_0x41a0d4[_0x57e7e3][_0xed5e('0x6f')]?_[_0xed5e('0x70')](_0x49ce27[_0x41a0d4[_0x57e7e3][_0xed5e('0x6f')]],'%s',_0x34b026):_0x34b026;_0x34b026=_0x41a0d4[_0x57e7e3][_0xed5e('0x71')]?_[_0xed5e('0x70')](_0x274e93[_0x41a0d4[_0x57e7e3]['format']],'%s',_0x34b026):_0x34b026;if(_0x41a0d4[_0x57e7e3]['groupBy']){_0x5de972['group'](_0x34b026);}_0x41a0d4[_0x57e7e3][_0xed5e('0x72')]&&_0x5de972[_0xed5e('0x3b')](_0x34b026,_0x41a0d4[_0x57e7e3][_0xed5e('0x72')]==='DESC'?![]:!![]);_0x5de972[_0xed5e('0x65')](_0x34b026,_0x41a0d4[_0x57e7e3][_0xed5e('0x73')]||_0x34b026);}if(_0xcc2619[_0xed5e('0x74')]){_0xcc2619[_0xed5e('0x74')]=JSON[_0xed5e('0x75')](_0xcc2619['joins']);for(var _0x4c901c=0x0;_0x4c901c<_0xcc2619[_0xed5e('0x74')]['length'];_0x4c901c+=0x1){if(_0xcc2619[_0xed5e('0x74')][_0x4c901c][_0xed5e('0x30')]&&_['includes'](_0x58a0f2,_0xcc2619[_0xed5e('0x74')][_0x4c901c]['type'])&&_0xcc2619[_0xed5e('0x74')][_0x4c901c][_0xed5e('0x76')]&&_0xcc2619[_0xed5e('0x74')][_0x4c901c][_0xed5e('0x77')]&&_0xcc2619[_0xed5e('0x74')][_0x4c901c]['foreignKey']){_0x5de972[_0xcc2619[_0xed5e('0x74')][_0x4c901c][_0xed5e('0x30')]](_0xcc2619[_0xed5e('0x74')][_0x4c901c]['foreignTable'],null,util['format'](_0xed5e('0x78'),_0xcc2619[_0xed5e('0x79')],_0xcc2619[_0xed5e('0x74')][_0x4c901c][_0xed5e('0x76')],_0xcc2619[_0xed5e('0x74')][_0x4c901c][_0xed5e('0x77')],_0xcc2619[_0xed5e('0x74')][_0x4c901c][_0xed5e('0x7a')]));}}}if(_0xcc2619[_0xed5e('0x7b')]){_0xcc2619[_0xed5e('0x7b')]=JSON[_0xed5e('0x75')](_0xcc2619['conditions']);_0x5de972[_0xed5e('0x3d')](_0x1ce896(_0xcc2619[_0xed5e('0x7b')][_0xed5e('0x7c')]));}_0x308fb8=_0x5de972[_0xed5e('0x7d')]();_0x5de972[_0xed5e('0x22')](_0x30723c);_0x5de972['offset'](0x0);logger[_0xed5e('0x7e')](_0xed5e('0x7f'),_0x5de972[_0xed5e('0x80')]());return dbH['sequelize'][_0xed5e('0x32')](_0x5de972[_0xed5e('0x80')](),{'type':dbH[_0xed5e('0x81')][_0xed5e('0x82')][_0xed5e('0x83')]});}})[_0xed5e('0x28')](respondWithResult(_0x2d6909,null))[_0xed5e('0x45')](handleError(_0x2d6909,null));};function runReport(_0x4b1889,_0x1c8e3b,_0x199464){var _0x55dfce=_0x1c8e3b[_0xed5e('0x2d')];var _0x19cf2f=0xa;var _0x307c8a=[_0xed5e('0x84'),'left_join',_0xed5e('0x53'),_0xed5e('0x54')];var _0xaf7a91={'SUM':_0xed5e('0x85'),'COUNT':_0xed5e('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xed5e('0x86'),'MIN':_0xed5e('0x87'),'AVG':_0xed5e('0x57'),'GROUP_CONCAT':_0xed5e('0x58'),'GROUP_CONCAT ASC':_0xed5e('0x88'),'GROUP_CONCAT DESC':_0xed5e('0x59')};var _0xc5225a={'SEC_TO_TIME':_0xed5e('0x5a'),'DATE':'DATE(%s)','HOUR':_0xed5e('0x5c'),'ROUND':_0xed5e('0x5d'),'UNIX_TIMESTAMP':_0xed5e('0x5e')};var _0x94325=function(_0x115ca7){return!_[_0xed5e('0x5f')]([_0xed5e('0x60'),_0xed5e('0x89'),'IS\x20EMPTY',_0xed5e('0x62')],_0x115ca7);};var _0x20d310=function(_0x431e48){if(!_0x431e48||!_0x431e48[_0xed5e('0x63')][_0xed5e('0x38')]){return'';}for(var _0x4bb511='(',_0xd9f10b=0x0;_0xd9f10b<_0x431e48[_0xed5e('0x63')][_0xed5e('0x38')];_0xd9f10b+=0x1){_0xd9f10b>0x0&&(_0x4bb511+='\x20'+_0x431e48['operator']+'\x20');_0x4bb511+=_0x431e48[_0xed5e('0x63')][_0xd9f10b]['group']?_0x20d310(_0x431e48['rules'][_0xd9f10b][_0xed5e('0x7c')]):_0x431e48[_0xed5e('0x63')][_0xd9f10b][_0xed5e('0x65')]+'\x20'+_0x431e48['rules'][_0xd9f10b][_0xed5e('0x66')]+(_0x94325(_0x431e48[_0xed5e('0x63')][_0xd9f10b]['condition'])?'\x20'+_0x431e48[_0xed5e('0x63')][_0xd9f10b][_0xed5e('0x67')]:'');}return _0x4bb511+')';};var _0x388720={'where':{'id':_0x4b1889['id']}},_0xaef2e3,_0x5e9a78,_0x165a3d,_0x18d9a8,_0xd25b74;_0x388720=_[_0xed5e('0x3f')]({},_0x388720,_0x199464);return db[_0xed5e('0x41')]['find'](_0x388720)['then'](function(_0x6c940d){if(_0x6c940d){_0xaef2e3=_0x6c940d;return _0x6c940d[_0xed5e('0x68')]();}return null;})[_0xed5e('0x28')](function(_0x25b18c){if(_0x25b18c){if(!_0x25b18c[_0xed5e('0x38')]){throw new db[(_0xed5e('0x8a'))][(_0xed5e('0x69'))](_0xed5e('0x8b'),0x193);}_0x5e9a78=_0x25b18c;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xed5e('0x28')](function(_0x90097){if(_0x90097){_0x165a3d=_[_0xed5e('0x8c')](_0x90097,'id');var _0x503c3f;var _0x369c55=squel[_0xed5e('0x6b')]();_0x369c55[_0xed5e('0x6c')](_0xaef2e3[_0xed5e('0x79')]);for(var _0x2bc077=0x0;_0x2bc077<_0x5e9a78['length'];_0x2bc077+=0x1){_0x503c3f=_0x5e9a78[_0x2bc077]['MetricId']?_0x165a3d[_0x5e9a78[_0x2bc077][_0xed5e('0x6d')]][_0xed5e('0x6e')]:_0x5e9a78[_0x2bc077]['field'];_0x503c3f=_0x5e9a78[_0x2bc077][_0xed5e('0x6f')]?_[_0xed5e('0x70')](_0xaf7a91[_0x5e9a78[_0x2bc077][_0xed5e('0x6f')]],'%s',_0x503c3f):_0x503c3f;_0x503c3f=_0x5e9a78[_0x2bc077][_0xed5e('0x71')]?_[_0xed5e('0x70')](_0xc5225a[_0x5e9a78[_0x2bc077][_0xed5e('0x71')]],'%s',_0x503c3f):_0x503c3f;if(_0x5e9a78[_0x2bc077][_0xed5e('0x8d')]){_0x369c55[_0xed5e('0x7c')](_0x503c3f);}_0x5e9a78[_0x2bc077][_0xed5e('0x72')]&&_0x369c55[_0xed5e('0x3b')](_0x503c3f,_0x5e9a78[_0x2bc077][_0xed5e('0x72')]==='DESC'?![]:!![]);_0x369c55[_0xed5e('0x65')](_0x503c3f,_0x5e9a78[_0x2bc077][_0xed5e('0x73')]||_0x503c3f);}if(_0xaef2e3[_0xed5e('0x74')]){_0xaef2e3[_0xed5e('0x74')]=JSON[_0xed5e('0x75')](_0xaef2e3[_0xed5e('0x74')]);for(var _0x5d8f30=0x0;_0x5d8f30<_0xaef2e3[_0xed5e('0x74')][_0xed5e('0x38')];_0x5d8f30+=0x1){if(_0xaef2e3[_0xed5e('0x74')][_0x5d8f30][_0xed5e('0x30')]&&_['includes'](_0x307c8a,_0xaef2e3[_0xed5e('0x74')][_0x5d8f30][_0xed5e('0x30')])&&_0xaef2e3['joins'][_0x5d8f30][_0xed5e('0x76')]&&_0xaef2e3[_0xed5e('0x74')][_0x5d8f30]['foreignTable']&&_0xaef2e3[_0xed5e('0x74')][_0x5d8f30][_0xed5e('0x7a')]){_0x369c55[_0xaef2e3['joins'][_0x5d8f30][_0xed5e('0x30')]](_0xaef2e3[_0xed5e('0x74')][_0x5d8f30][_0xed5e('0x77')],null,util[_0xed5e('0x71')](_0xed5e('0x78'),_0xaef2e3[_0xed5e('0x79')],_0xaef2e3[_0xed5e('0x74')][_0x5d8f30][_0xed5e('0x76')],_0xaef2e3[_0xed5e('0x74')][_0x5d8f30]['foreignTable'],_0xaef2e3['joins'][_0x5d8f30][_0xed5e('0x7a')]));}}}if(_0xaef2e3[_0xed5e('0x7b')]){_0xaef2e3['conditions']=JSON[_0xed5e('0x75')](_0xaef2e3['conditions']);_0x369c55['where'](_0x20d310(_0xaef2e3[_0xed5e('0x7b')][_0xed5e('0x7c')]));}_0xd25b74=_0x369c55['clone']();_0x369c55[_0xed5e('0x22')](_0x19cf2f);_0x369c55[_0xed5e('0x21')](0x0);return;}})[_0xed5e('0x28')](function(){if(_0x1c8e3b[_0xed5e('0x8e')]===_0xed5e('0x8f')){return null;}var _0x4a241c=_[_0xed5e('0x3f')](_0x1c8e3b,{'name':_0x1c8e3b['fullPath']||_0x1c8e3b[_0xed5e('0x2d')]||_0xaef2e3[_0xed5e('0x2d')],'basename':_0x55dfce,'savename':util[_0xed5e('0x71')]('%s-%s.%s',_0x1c8e3b['name']||_0xaef2e3[_0xed5e('0x2d')],require(_0xed5e('0x90'))[_0xed5e('0x91')](0x4),_0x1c8e3b[_0xed5e('0x8e')]||_0xed5e('0x92')),'reportId':_0xaef2e3['id'],'reportType':'custom'});return db[_0xed5e('0x93')][_0xed5e('0x49')](_0x4a241c,{'raw':!![]});})['then'](function(_0x20657e){if(_0xaef2e3[_0xed5e('0x79')]===_0xed5e('0x94')){_0xd25b74[_0xed5e('0x3d')](_0xaef2e3['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1c8e3b['startDate'],_0x1c8e3b['endDate']);}else{_0xd25b74['where'](_0xaef2e3[_0xed5e('0x79')]+_0xed5e('0x95'),_0x1c8e3b['startDate'],_0x1c8e3b[_0xed5e('0x96')]);}if(_0x20657e){logger[_0xed5e('0x97')](_0xed5e('0x98'),_0xd25b74[_0xed5e('0x80')]());require(_0xed5e('0x99'))[_0xed5e('0x9a')](path['join'](__dirname,_0xed5e('0x9b'),_0x20657e[_0xed5e('0x8e')]),[_0x20657e['id'],_0xd25b74[_0xed5e('0x80')](),path['join'](__dirname,_0xed5e('0x9c'),_0x20657e['savename']),_0x55dfce]);return _0x20657e;}else{var _0x1a2cdd=squel[_0xed5e('0x6b')]();_0x1a2cdd[_0xed5e('0x6c')]('('+_0xd25b74[_0xed5e('0x80')]()+')','countTable');_0x1a2cdd[_0xed5e('0x65')](_0xed5e('0x9d'),'count');_0xd25b74[_0xed5e('0x22')](_0x1c8e3b[_0xed5e('0x22')]||_0x19cf2f);_0xd25b74[_0xed5e('0x21')](_0x1c8e3b[_0xed5e('0x21')]||0x0);return dbH['sequelize'][_0xed5e('0x32')](_0x1a2cdd[_0xed5e('0x80')](),{'type':dbH[_0xed5e('0x81')][_0xed5e('0x82')]['SELECT']})[_0xed5e('0x28')](function(_0x13ad10){if(!_0x13ad10[_0xed5e('0x38')]){_0x18d9a8=0x0;}else{_0x18d9a8=_0x13ad10[0x0][_0xed5e('0x24')]||0x0;}return dbH['sequelize'][_0xed5e('0x32')](_0xd25b74[_0xed5e('0x80')](),{'type':dbH['sequelize'][_0xed5e('0x82')]['SELECT']});})['then'](function(_0x2d4247){return{'rows':_0x2d4247||[],'count':_0x18d9a8};});}});}exports[_0xed5e('0x9e')]=function(_0x3aa649,_0x24cf6f){return runReport(_0x3aa649[_0xed5e('0x47')],_0x3aa649[_0xed5e('0x32')],_0x3aa649[_0xed5e('0x40')])['then'](respondWithResult(_0x24cf6f,null))['catch'](handleError(_0x24cf6f,null));};exports[_0xed5e('0x9f')]=runReport;exports[_0xed5e('0x32')]=function(_0x456e8d,_0x299761){var _0x294126=0xa;var _0x159d9e=[_0xed5e('0x84'),_0xed5e('0x52'),'right_join',_0xed5e('0x54')];var _0x509444={'SUM':_0xed5e('0x85'),'COUNT':_0xed5e('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xed5e('0x86'),'MIN':'MIN(%s)','AVG':_0xed5e('0x57'),'GROUP_CONCAT':_0xed5e('0x58'),'GROUP_CONCAT ASC':_0xed5e('0x88'),'GROUP_CONCAT DESC':_0xed5e('0x59')};var _0x5d2bdb={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xed5e('0x5b'),'HOUR':_0xed5e('0x5c'),'ROUND':_0xed5e('0x5d'),'UNIX_TIMESTAMP':_0xed5e('0x5e')};var _0x286970=function(_0x5c5b0f){return!_[_0xed5e('0x5f')]([_0xed5e('0x60'),_0xed5e('0x89'),_0xed5e('0x61'),'IS\x20NOT\x20EMPTY'],_0x5c5b0f);};var _0x2b57f1=function(_0x55914f){if(!_0x55914f||!_0x55914f['rules'][_0xed5e('0x38')]){return'';}for(var _0x1516f5='(',_0x5a37ce=0x0;_0x5a37ce<_0x55914f[_0xed5e('0x63')]['length'];_0x5a37ce+=0x1){_0x5a37ce>0x0&&(_0x1516f5+='\x20'+_0x55914f[_0xed5e('0x64')]+'\x20');_0x1516f5+=_0x55914f[_0xed5e('0x63')][_0x5a37ce][_0xed5e('0x7c')]?_0x2b57f1(_0x55914f[_0xed5e('0x63')][_0x5a37ce][_0xed5e('0x7c')]):_0x55914f['rules'][_0x5a37ce][_0xed5e('0x65')]+'\x20'+_0x55914f['rules'][_0x5a37ce][_0xed5e('0x66')]+(_0x286970(_0x55914f[_0xed5e('0x63')][_0x5a37ce]['condition'])?'\x20'+_0x55914f[_0xed5e('0x63')][_0x5a37ce][_0xed5e('0x67')]:'');}return _0x1516f5+')';};var _0x30eba9={'where':{'id':_0x456e8d[_0xed5e('0x47')]['id']}},_0x37ce06,_0x18bb26,_0x2e46f6,_0x21d3d4,_0x2be86d;_0x30eba9=_['merge']({},_0x30eba9,_0x456e8d[_0xed5e('0x40')]);return db[_0xed5e('0x41')][_0xed5e('0x48')](_0x30eba9)['then'](function(_0x51454d){if(_0x51454d){_0x37ce06=_0x51454d;return _0x51454d[_0xed5e('0x68')]();}return null;})[_0xed5e('0x28')](function(_0xbf0c0){if(_0xbf0c0){if(!_0xbf0c0['length']){throw new db[(_0xed5e('0x8a'))][(_0xed5e('0x69'))](_0xed5e('0x8b'),0x193);}_0x18bb26=_0xbf0c0;return db[_0xed5e('0x6a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4692b5){if(_0x4692b5){_0x2e46f6=_[_0xed5e('0x8c')](_0x4692b5,'id');var _0x23dc2d;var _0x4f3bb6=squel[_0xed5e('0x6b')]();_0x4f3bb6[_0xed5e('0x6c')](_0x37ce06[_0xed5e('0x79')]);for(var _0xd05d86=0x0;_0xd05d86<_0x18bb26[_0xed5e('0x38')];_0xd05d86+=0x1){_0x23dc2d=_0x18bb26[_0xd05d86][_0xed5e('0x6d')]?_0x2e46f6[_0x18bb26[_0xd05d86][_0xed5e('0x6d')]]['metric']:_0x18bb26[_0xd05d86]['field'];_0x23dc2d=_0x18bb26[_0xd05d86][_0xed5e('0x6f')]?_[_0xed5e('0x70')](_0x509444[_0x18bb26[_0xd05d86][_0xed5e('0x6f')]],'%s',_0x23dc2d):_0x23dc2d;_0x23dc2d=_0x18bb26[_0xd05d86][_0xed5e('0x71')]?_[_0xed5e('0x70')](_0x5d2bdb[_0x18bb26[_0xd05d86][_0xed5e('0x71')]],'%s',_0x23dc2d):_0x23dc2d;if(_0x18bb26[_0xd05d86][_0xed5e('0x8d')]){_0x4f3bb6['group'](_0x23dc2d);}_0x18bb26[_0xd05d86]['orderBy']&&_0x4f3bb6['order'](_0x23dc2d,_0x18bb26[_0xd05d86][_0xed5e('0x72')]===_0xed5e('0xa0')?![]:!![]);_0x4f3bb6[_0xed5e('0x65')](_0x23dc2d,_0x18bb26[_0xd05d86][_0xed5e('0x73')]||_0x23dc2d);}if(_0x37ce06[_0xed5e('0x74')]){_0x37ce06[_0xed5e('0x74')]=JSON[_0xed5e('0x75')](_0x37ce06[_0xed5e('0x74')]);for(var _0x4e4c2b=0x0;_0x4e4c2b<_0x37ce06[_0xed5e('0x74')][_0xed5e('0x38')];_0x4e4c2b+=0x1){if(_0x37ce06[_0xed5e('0x74')][_0x4e4c2b][_0xed5e('0x30')]&&_[_0xed5e('0x5f')](_0x159d9e,_0x37ce06['joins'][_0x4e4c2b][_0xed5e('0x30')])&&_0x37ce06['joins'][_0x4e4c2b][_0xed5e('0x76')]&&_0x37ce06[_0xed5e('0x74')][_0x4e4c2b]['foreignTable']&&_0x37ce06[_0xed5e('0x74')][_0x4e4c2b][_0xed5e('0x7a')]){_0x4f3bb6[_0x37ce06[_0xed5e('0x74')][_0x4e4c2b][_0xed5e('0x30')]](_0x37ce06['joins'][_0x4e4c2b]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x37ce06['table'],_0x37ce06['joins'][_0x4e4c2b][_0xed5e('0x76')],_0x37ce06['joins'][_0x4e4c2b][_0xed5e('0x77')],_0x37ce06[_0xed5e('0x74')][_0x4e4c2b][_0xed5e('0x7a')]));}}}if(_0x37ce06[_0xed5e('0x7b')]){_0x37ce06[_0xed5e('0x7b')]=JSON[_0xed5e('0x75')](_0x37ce06[_0xed5e('0x7b')]);_0x4f3bb6[_0xed5e('0x3d')](_0x2b57f1(_0x37ce06[_0xed5e('0x7b')]['group']));}_0x2be86d=_0x4f3bb6[_0xed5e('0x7d')]();_0x4f3bb6[_0xed5e('0x22')](_0x294126);_0x4f3bb6[_0xed5e('0x21')](0x0);logger[_0xed5e('0x7e')](_0xed5e('0x7f'),_0x4f3bb6[_0xed5e('0x80')]());return dbH[_0xed5e('0x81')][_0xed5e('0x32')](_0x4f3bb6[_0xed5e('0x80')](),{'type':dbH['sequelize']['QueryTypes'][_0xed5e('0x83')]});}})[_0xed5e('0x28')](function(){return{'sql':_0x2be86d[_0xed5e('0x80')]()};})['then'](respondWithResult(_0x299761,null))[_0xed5e('0x45')](handleError(_0x299761,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 3b8d801..2de7e10 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 _0xd0a3=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x1acb5a,_0x112268){var _0x92d8c5=function(_0x3038a2){while(--_0x3038a2){_0x1acb5a['push'](_0x1acb5a['shift']());}};_0x92d8c5(++_0x112268);}(_0xd0a3,0x1a3));var _0x3d0a=function(_0x221a3f,_0x2c632a){_0x221a3f=_0x221a3f-0x0;var _0x756b2b=_0xd0a3[_0x221a3f];return _0x756b2b;};'use strict';var _=require(_0x3d0a('0x0'));var util=require('util');var logger=require(_0x3d0a('0x1'))(_0x3d0a('0x2'));var moment=require(_0x3d0a('0x3'));var BPromise=require('bluebird');var rp=require(_0x3d0a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d0a('0x5'));var config=require(_0x3d0a('0x6'));var attributes=require(_0x3d0a('0x7'));module['exports']=function(_0x1d278f,_0x2b6f9a){return _0x1d278f['define'](_0x3d0a('0x8'),attributes,{'tableName':_0x3d0a('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3204=['define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3204,0x12e));var _0x4320=function(_0x5655fc,_0x11036b){_0x5655fc=_0x5655fc-0x0;var _0x17d348=_0x3204[_0x5655fc];return _0x17d348;};'use strict';var _=require(_0x4320('0x0'));var util=require(_0x4320('0x1'));var logger=require(_0x4320('0x2'))(_0x4320('0x3'));var moment=require(_0x4320('0x4'));var BPromise=require(_0x4320('0x5'));var rp=require(_0x4320('0x6'));var fs=require('fs');var path=require(_0x4320('0x7'));var rimraf=require(_0x4320('0x8'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x4320('0x9')]=function(_0x7ce01d,_0xbda169){return _0x7ce01d[_0x4320('0xa')](_0x4320('0xb'),attributes,{'tableName':_0x4320('0xc'),'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 eb7da2e..6584a8d 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 _0xa9c3=['../../config/environment','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x30e289,_0x1ed090){var _0x37d9a2=function(_0x306be5){while(--_0x306be5){_0x30e289['push'](_0x30e289['shift']());}};_0x37d9a2(++_0x1ed090);}(_0xa9c3,0x18e));var _0x3a9c=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xa9c3[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x3a9c('0x0'));var util=require(_0x3a9c('0x1'));var moment=require(_0x3a9c('0x2'));var BPromise=require(_0x3a9c('0x3'));var rs=require(_0x3a9c('0x4'));var fs=require('fs');var Redis=require(_0x3a9c('0x5'));var db=require(_0x3a9c('0x6'))['db'];var utils=require(_0x3a9c('0x7'));var logger=require(_0x3a9c('0x8'))(_0x3a9c('0x9'));var config=require(_0x3a9c('0xa'));var jayson=require(_0x3a9c('0xb'));var client=jayson[_0x3a9c('0xc')][_0x3a9c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xfe17c6,_0x1cd332,_0x4e9edd){return new BPromise(function(_0xdd95f5,_0x11667f){return client['request'](_0xfe17c6,_0x4e9edd)['then'](function(_0x4ffd29){logger[_0x3a9c('0xe')](_0x3a9c('0xf'),_0x1cd332,'request\x20sent');logger[_0x3a9c('0x10')](_0x3a9c('0x11'),_0x1cd332,'request\x20sent',JSON[_0x3a9c('0x12')](_0x4ffd29));if(_0x4ffd29[_0x3a9c('0x13')]){if(_0x4ffd29['error']['code']===0x1f4){logger['error'](_0x3a9c('0xf'),_0x1cd332,_0x4ffd29[_0x3a9c('0x13')][_0x3a9c('0x14')]);return _0x11667f(_0x4ffd29[_0x3a9c('0x13')]['message']);}logger[_0x3a9c('0x13')](_0x3a9c('0xf'),_0x1cd332,_0x4ffd29[_0x3a9c('0x13')][_0x3a9c('0x14')]);return _0xdd95f5(_0x4ffd29[_0x3a9c('0x13')][_0x3a9c('0x14')]);}else{logger[_0x3a9c('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1cd332,_0x3a9c('0x15'));_0xdd95f5(_0x4ffd29[_0x3a9c('0x16')][_0x3a9c('0x14')]);}})[_0x3a9c('0x17')](function(_0x5f546d){logger[_0x3a9c('0x13')](_0x3a9c('0xf'),_0x1cd332,_0x5f546d);_0x11667f(_0x5f546d);});});}
\ No newline at end of file
+var _0xb416=['AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c2407,_0x3c9a47){var _0x5d2eac=function(_0xb33bf8){while(--_0xb33bf8){_0x3c2407['push'](_0x3c2407['shift']());}};_0x5d2eac(++_0x3c9a47);}(_0xb416,0xe9));var _0x6b41=function(_0xa3fdc,_0x5aab57){_0xa3fdc=_0xa3fdc-0x0;var _0x50b95f=_0xb416[_0xa3fdc];return _0x50b95f;};'use strict';var _=require(_0x6b41('0x0'));var util=require(_0x6b41('0x1'));var moment=require('moment');var BPromise=require(_0x6b41('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b41('0x3'));var db=require(_0x6b41('0x4'))['db'];var utils=require(_0x6b41('0x5'));var logger=require('../../config/logger')(_0x6b41('0x6'));var config=require(_0x6b41('0x7'));var jayson=require(_0x6b41('0x8'));var client=jayson[_0x6b41('0x9')][_0x6b41('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cbf10,_0x5d1452,_0x384c9b){return new BPromise(function(_0x23a7fd,_0xe5e5fa){return client[_0x6b41('0xb')](_0x2cbf10,_0x384c9b)[_0x6b41('0xc')](function(_0x244b2){logger[_0x6b41('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d1452,_0x6b41('0xe'));logger[_0x6b41('0xf')](_0x6b41('0x10'),_0x5d1452,_0x6b41('0xe'),JSON[_0x6b41('0x11')](_0x244b2));if(_0x244b2[_0x6b41('0x12')]){if(_0x244b2[_0x6b41('0x12')][_0x6b41('0x13')]===0x1f4){logger[_0x6b41('0x12')](_0x6b41('0x14'),_0x5d1452,_0x244b2[_0x6b41('0x12')][_0x6b41('0x15')]);return _0xe5e5fa(_0x244b2[_0x6b41('0x12')][_0x6b41('0x15')]);}logger['error'](_0x6b41('0x14'),_0x5d1452,_0x244b2[_0x6b41('0x12')][_0x6b41('0x15')]);return _0x23a7fd(_0x244b2[_0x6b41('0x12')][_0x6b41('0x15')]);}else{logger[_0x6b41('0xd')](_0x6b41('0x14'),_0x5d1452,_0x6b41('0xe'));_0x23a7fd(_0x244b2['result'][_0x6b41('0x15')]);}})[_0x6b41('0x16')](function(_0x3538d2){logger[_0x6b41('0x12')](_0x6b41('0x14'),_0x5d1452,_0x3538d2);_0xe5e5fa(_0x3538d2);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 839c1d3..67c79a8 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 _0xf83f=['show','/:id/preview','preview','/:id/run','run','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./analyticCustomReport.controller','isAuthenticated','get','/:id'];(function(_0x23a298,_0x21adb7){var _0x31a410=function(_0x3350b9){while(--_0x3350b9){_0x23a298['push'](_0x23a298['shift']());}};_0x31a410(++_0x21adb7);}(_0xf83f,0x185));var _0xff83=function(_0x2b553d,_0x5bc904){_0x2b553d=_0x2b553d-0x0;var _0xe9b379=_0xf83f[_0x2b553d];return _0xe9b379;};'use strict';var multer=require(_0xff83('0x0'));var util=require(_0xff83('0x1'));var path=require(_0xff83('0x2'));var timeout=require('connect-timeout');var express=require(_0xff83('0x3'));var router=express[_0xff83('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff83('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xff83('0x6'));router['get']('/',auth[_0xff83('0x7')](),controller['index']);router[_0xff83('0x8')](_0xff83('0x9'),auth[_0xff83('0x7')](),controller[_0xff83('0xa')]);router[_0xff83('0x8')](_0xff83('0xb'),auth[_0xff83('0x7')](),controller[_0xff83('0xc')]);router[_0xff83('0x8')](_0xff83('0xd'),auth[_0xff83('0x7')](),controller[_0xff83('0xe')]);router[_0xff83('0x8')]('/:id/query',auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xff83('0x7')](),controller['create']);router['put'](_0xff83('0x9'),auth[_0xff83('0x7')](),controller[_0xff83('0xf')]);router[_0xff83('0x10')](_0xff83('0x9'),auth[_0xff83('0x7')](),controller[_0xff83('0x11')]);module[_0xff83('0x12')]=router;
\ No newline at end of file
+var _0xb995=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','query','post','create','put','delete','exports'];(function(_0xa643d4,_0x550359){var _0x290eae=function(_0x312219){while(--_0x312219){_0xa643d4['push'](_0xa643d4['shift']());}};_0x290eae(++_0x550359);}(_0xb995,0xb0));var _0x5b99=function(_0x557448,_0xd6a91){_0x557448=_0x557448-0x0;var _0x307ded=_0xb995[_0x557448];return _0x307ded;};'use strict';var multer=require(_0x5b99('0x0'));var util=require('util');var path=require(_0x5b99('0x1'));var timeout=require(_0x5b99('0x2'));var express=require(_0x5b99('0x3'));var router=express[_0x5b99('0x4')]();var fs_extra=require(_0x5b99('0x5'));var auth=require(_0x5b99('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5b99('0x7'));var controller=require(_0x5b99('0x8'));router[_0x5b99('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b99('0x9')](_0x5b99('0xa'),auth[_0x5b99('0xb')](),controller[_0x5b99('0xc')]);router[_0x5b99('0x9')](_0x5b99('0xd'),auth['isAuthenticated'](),controller['preview']);router['get'](_0x5b99('0xe'),auth[_0x5b99('0xb')](),controller[_0x5b99('0xf')]);router[_0x5b99('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0x5b99('0x10')]);router[_0x5b99('0x11')]('/',auth[_0x5b99('0xb')](),controller[_0x5b99('0x12')]);router[_0x5b99('0x13')](_0x5b99('0xa'),auth[_0x5b99('0xb')](),controller['update']);router[_0x5b99('0x14')](_0x5b99('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5b99('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 8f66acb..05a985b 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x474ba7,_0x1d74c6){var _0x422657=function(_0x570f82){while(--_0x570f82){_0x474ba7['push'](_0x474ba7['shift']());}};_0x422657(++_0x1d74c6);}(_0xac9d,0x14d));var _0xdac9=function(_0x3d7a9f,_0x24e0f1){_0x3d7a9f=_0x3d7a9f-0x0;var _0x13f5f1=_0xac9d[_0x3d7a9f];return _0x13f5f1;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}};
\ No newline at end of file
+var _0x425d=['sequelize','STRING','TEXT'];(function(_0x18db4d,_0x1379ad){var _0xa96e87=function(_0x5661c8){while(--_0x5661c8){_0x18db4d['push'](_0x18db4d['shift']());}};_0xa96e87(++_0x1379ad);}(_0x425d,0x1e0));var _0xd425=function(_0x129bed,_0x529bf2){_0x129bed=_0x129bed-0x0;var _0x286f63=_0x425d[_0x129bed];return _0x286f63;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 6e360c4..5aa1d13 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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x2ef9e2,_0x376185){var _0x2d4632=function(_0x4abaf4){while(--_0x4abaf4){_0x2ef9e2['push'](_0x2ef9e2['shift']());}};_0x2d4632(++_0x376185);}(_0x2675,0x75));var _0x5267=function(_0x1ca795,_0x3f3b29){_0x1ca795=_0x1ca795-0x0;var _0x499bb5=_0x2675[_0x1ca795];return _0x499bb5;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));};
\ No newline at end of file
+var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x5db576,_0xd3f8c1){var _0x19ef5b=function(_0x1f7a28){while(--_0x1f7a28){_0x5db576['push'](_0x5db576['shift']());}};_0x19ef5b(++_0xd3f8c1);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2f5aa0,_0x2de038){_0x2f5aa0=_0x2f5aa0-0x0;var _0x498021=_0x1cb9[_0x2f5aa0];return _0x498021;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 0345b11..96cddb8 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 _0x3533=['analytics_default_reports','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport'];(function(_0x4b9aea,_0x85deeb){var _0x34fd47=function(_0x282b51){while(--_0x282b51){_0x4b9aea['push'](_0x4b9aea['shift']());}};_0x34fd47(++_0x85deeb);}(_0x3533,0xb5));var _0x3353=function(_0x82eef6,_0x52a17d){_0x82eef6=_0x82eef6-0x0;var _0x8809c3=_0x3533[_0x82eef6];return _0x8809c3;};'use strict';var _=require('lodash');var util=require(_0x3353('0x0'));var logger=require(_0x3353('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3353('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3353('0x3'));var rimraf=require(_0x3353('0x4'));var config=require(_0x3353('0x5'));var attributes=require(_0x3353('0x6'));module[_0x3353('0x7')]=function(_0x4f0988,_0xb85da7){return _0x4f0988['define'](_0x3353('0x8'),attributes,{'tableName':_0x3353('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb53f=['request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment','bluebird'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xb53f,0x10c));var _0xfb53=function(_0x2af106,_0x5adc54){_0x2af106=_0x2af106-0x0;var _0x286124=_0xb53f[_0x2af106];return _0x286124;};'use strict';var _=require(_0xfb53('0x0'));var util=require(_0xfb53('0x1'));var logger=require('../../config/logger')(_0xfb53('0x2'));var moment=require(_0xfb53('0x3'));var BPromise=require(_0xfb53('0x4'));var rp=require(_0xfb53('0x5'));var fs=require('fs');var path=require(_0xfb53('0x6'));var rimraf=require(_0xfb53('0x7'));var config=require(_0xfb53('0x8'));var attributes=require(_0xfb53('0x9'));module['exports']=function(_0x342968,_0x17eb5b){return _0x342968[_0xfb53('0xa')](_0xfb53('0xb'),attributes,{'tableName':_0xfb53('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index ae86345..f428f64 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 _0x4f88=['../../config/environment','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x50f288,_0xfecd76){var _0x2a0755=function(_0x48f555){while(--_0x48f555){_0x50f288['push'](_0x50f288['shift']());}};_0x2a0755(++_0xfecd76);}(_0x4f88,0x1da));var _0x84f8=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0x4f88[_0x467cb0];return _0x2153f7;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var moment=require(_0x84f8('0x2'));var BPromise=require(_0x84f8('0x3'));var rs=require(_0x84f8('0x4'));var fs=require('fs');var Redis=require(_0x84f8('0x5'));var db=require(_0x84f8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x84f8('0x7'))(_0x84f8('0x8'));var config=require(_0x84f8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x84f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fea09,_0x54441e,_0x5e8807){return new BPromise(function(_0x5f2841,_0x4613c0){return client[_0x84f8('0xb')](_0x3fea09,_0x5e8807)['then'](function(_0x32fc2c){logger['info'](_0x84f8('0xc'),_0x54441e,_0x84f8('0xd'));logger[_0x84f8('0xe')](_0x84f8('0xf'),_0x54441e,_0x84f8('0xd'),JSON[_0x84f8('0x10')](_0x32fc2c));if(_0x32fc2c[_0x84f8('0x11')]){if(_0x32fc2c[_0x84f8('0x11')][_0x84f8('0x12')]===0x1f4){logger[_0x84f8('0x11')](_0x84f8('0xc'),_0x54441e,_0x32fc2c[_0x84f8('0x11')]['message']);return _0x4613c0(_0x32fc2c[_0x84f8('0x11')]['message']);}logger[_0x84f8('0x11')](_0x84f8('0xc'),_0x54441e,_0x32fc2c[_0x84f8('0x11')][_0x84f8('0x13')]);return _0x5f2841(_0x32fc2c['error'][_0x84f8('0x13')]);}else{logger[_0x84f8('0x14')](_0x84f8('0xc'),_0x54441e,_0x84f8('0xd'));_0x5f2841(_0x32fc2c[_0x84f8('0x15')]['message']);}})[_0x84f8('0x16')](function(_0x163332){logger['error'](_0x84f8('0xc'),_0x54441e,_0x163332);_0x4613c0(_0x163332);});});}
\ No newline at end of file
+var _0x9c21=['AnalyticDefaultReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x32abdd,_0xde81ef){var _0x1c9b16=function(_0x5a1632){while(--_0x5a1632){_0x32abdd['push'](_0x32abdd['shift']());}};_0x1c9b16(++_0xde81ef);}(_0x9c21,0x77));var _0x19c2=function(_0x8b1b15,_0x30a726){_0x8b1b15=_0x8b1b15-0x0;var _0x2448b3=_0x9c21[_0x8b1b15];return _0x2448b3;};'use strict';var _=require(_0x19c2('0x0'));var util=require(_0x19c2('0x1'));var moment=require(_0x19c2('0x2'));var BPromise=require(_0x19c2('0x3'));var rs=require(_0x19c2('0x4'));var fs=require('fs');var Redis=require(_0x19c2('0x5'));var db=require(_0x19c2('0x6'))['db'];var utils=require(_0x19c2('0x7'));var logger=require(_0x19c2('0x8'))(_0x19c2('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x19c2('0xa')][_0x19c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cf43a,_0x48ea5b,_0x81c062){return new BPromise(function(_0x33fcd9,_0x537c08){return client[_0x19c2('0xc')](_0x5cf43a,_0x81c062)[_0x19c2('0xd')](function(_0x642a16){logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x48ea5b,'request\x20sent');logger[_0x19c2('0xe')](_0x19c2('0xf'),_0x48ea5b,'request\x20sent',JSON[_0x19c2('0x10')](_0x642a16));if(_0x642a16[_0x19c2('0x11')]){if(_0x642a16[_0x19c2('0x11')][_0x19c2('0x12')]===0x1f4){logger[_0x19c2('0x11')](_0x19c2('0x13'),_0x48ea5b,_0x642a16[_0x19c2('0x11')]['message']);return _0x537c08(_0x642a16[_0x19c2('0x11')]['message']);}logger[_0x19c2('0x11')](_0x19c2('0x13'),_0x48ea5b,_0x642a16['error'][_0x19c2('0x14')]);return _0x33fcd9(_0x642a16['error'][_0x19c2('0x14')]);}else{logger[_0x19c2('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x48ea5b,'request\x20sent');_0x33fcd9(_0x642a16[_0x19c2('0x16')][_0x19c2('0x14')]);}})['catch'](function(_0x10eb3a){logger['error'](_0x19c2('0x13'),_0x48ea5b,_0x10eb3a);_0x537c08(_0x10eb3a);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 64b6e93..81eca3d 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 _0x74a7=['index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x12e073,_0x2a6387){var _0x17e67b=function(_0x61b780){while(--_0x61b780){_0x12e073['push'](_0x12e073['shift']());}};_0x17e67b(++_0x2a6387);}(_0x74a7,0x91));var _0x774a=function(_0x3c8291,_0x104ac7){_0x3c8291=_0x3c8291-0x0;var _0x3eea23=_0x74a7[_0x3c8291];return _0x3eea23;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x774a('0x0'));var timeout=require(_0x774a('0x1'));var express=require('express');var router=express[_0x774a('0x2')]();var fs_extra=require(_0x774a('0x3'));var auth=require(_0x774a('0x4'));var interaction=require(_0x774a('0x5'));var config=require('../../config/environment');var controller=require(_0x774a('0x6'));router[_0x774a('0x7')]('/',auth[_0x774a('0x8')](),controller[_0x774a('0x9')]);router[_0x774a('0x7')](_0x774a('0xa'),auth['isAuthenticated'](),controller[_0x774a('0xb')]);router[_0x774a('0x7')](_0x774a('0xc'),auth[_0x774a('0x8')](),controller[_0x774a('0xd')]);router[_0x774a('0x7')](_0x774a('0xe'),auth[_0x774a('0x8')](),controller['run']);router[_0x774a('0x7')](_0x774a('0xf'),auth['isAuthenticated'](),controller[_0x774a('0x10')]);router[_0x774a('0x11')]('/',auth['isAuthenticated'](),controller[_0x774a('0x12')]);router[_0x774a('0x13')](_0x774a('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x774a('0x14')](_0x774a('0xa'),auth[_0x774a('0x8')](),controller['destroy']);module[_0x774a('0x15')]=router;
\ No newline at end of file
+var _0xd227=['/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','get','/:id/preview','preview','/:id/run','/:id/query','post','create'];(function(_0x46dce0,_0x2e12a8){var _0x254615=function(_0x172af0){while(--_0x172af0){_0x46dce0['push'](_0x46dce0['shift']());}};_0x254615(++_0x2e12a8);}(_0xd227,0xab));var _0x7d22=function(_0x22f75e,_0x4a9e06){_0x22f75e=_0x22f75e-0x0;var _0x1f6ab3=_0xd227[_0x22f75e];return _0x1f6ab3;};'use strict';var multer=require(_0x7d22('0x0'));var util=require(_0x7d22('0x1'));var path=require(_0x7d22('0x2'));var timeout=require(_0x7d22('0x3'));var express=require(_0x7d22('0x4'));var router=express[_0x7d22('0x5')]();var fs_extra=require(_0x7d22('0x6'));var auth=require(_0x7d22('0x7'));var interaction=require(_0x7d22('0x8'));var config=require('../../config/environment');var controller=require(_0x7d22('0x9'));router['get']('/',auth[_0x7d22('0xa')](),controller['index']);router[_0x7d22('0xb')]('/:id',auth[_0x7d22('0xa')](),controller['show']);router[_0x7d22('0xb')](_0x7d22('0xc'),auth['isAuthenticated'](),controller[_0x7d22('0xd')]);router[_0x7d22('0xb')](_0x7d22('0xe'),auth[_0x7d22('0xa')](),controller['run']);router['get'](_0x7d22('0xf'),auth[_0x7d22('0xa')](),controller['query']);router[_0x7d22('0x10')]('/',auth['isAuthenticated'](),controller[_0x7d22('0x11')]);router['put'](_0x7d22('0x12'),auth[_0x7d22('0xa')](),controller['update']);router[_0x7d22('0x13')]('/:id',auth[_0x7d22('0xa')](),controller[_0x7d22('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index f4f518e..833ad9c 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 _0x4401=['ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','sequelize','moment','exports','STRING'];(function(_0x4848cd,_0x3d9895){var _0x261a1d=function(_0xc825c0){while(--_0xc825c0){_0x4848cd['push'](_0x4848cd['shift']());}};_0x261a1d(++_0x3d9895);}(_0x4401,0xcc));var _0x1440=function(_0x29d1ac,_0x502f20){_0x29d1ac=_0x29d1ac-0x0;var _0x5db05c=_0x4401[_0x29d1ac];return _0x5db05c;};'use strict';var Sequelize=require(_0x1440('0x0'));var moment=require(_0x1440('0x1'));module[_0x1440('0x2')]={'name':{'type':Sequelize[_0x1440('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x1440('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x1440('0x4')](_0x1440('0x5'),_0x1440('0x6'),_0x1440('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x1440('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x1440('0x8')]},'endDate':{'type':Sequelize[_0x1440('0x8')]},'status':{'type':Sequelize[_0x1440('0x3')],'defaultValue':_0x1440('0x9')},'type':{'type':Sequelize[_0x1440('0x4')]('manual',_0x1440('0xa')),'allowNull':![],'defaultValue':_0x1440('0xb')},'reportId':{'type':Sequelize[_0x1440('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x1440('0x3')]}};
\ No newline at end of file
+var _0xcd3c=['STRING','DATE','manual','INTEGER','sequelize','moment','exports','ENUM','csv','xlsx'];(function(_0x2d6c20,_0x4ce15c){var _0x2d18ef=function(_0x285aac){while(--_0x285aac){_0x2d6c20['push'](_0x2d6c20['shift']());}};_0x2d18ef(++_0x4ce15c);}(_0xcd3c,0x1a8));var _0xccd3=function(_0x49d08a,_0x53a512){_0x49d08a=_0x49d08a-0x0;var _0x19a236=_0xcd3c[_0x49d08a];return _0x19a236;};'use strict';var Sequelize=require(_0xccd3('0x0'));var moment=require(_0xccd3('0x1'));module[_0xccd3('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xccd3('0x3')](_0xccd3('0x4'),'pdf',_0xccd3('0x5')),'allowNull':![],'defaultValue':_0xccd3('0x4')},'savename':{'type':Sequelize[_0xccd3('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0xccd3('0x7')]},'endDate':{'type':Sequelize[_0xccd3('0x7')]},'status':{'type':Sequelize[_0xccd3('0x6')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xccd3('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0xccd3('0x8')},'reportId':{'type':Sequelize[_0xccd3('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index f515c67..5bdbe8e 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 _0x9519=['pick','merge','options','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','find','create','body','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','ExtractedReports','UserProfileResource','error','stack','name','status','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters'];(function(_0x5679ac,_0x413bd9){var _0xe5073b=function(_0x5b6903){while(--_0x5b6903){_0x5679ac['push'](_0x5679ac['shift']());}};_0xe5073b(++_0x413bd9);}(_0x9519,0x1a0));var _0x9951=function(_0x4452db,_0x4b907c){_0x4452db=_0x4452db-0x0;var _0x192d46=_0x9519[_0x4452db];return _0x192d46;};'use strict';var emlformat=require(_0x9951('0x0'));var rimraf=require(_0x9951('0x1'));var zipdir=require(_0x9951('0x2'));var jsonpatch=require(_0x9951('0x3'));var rp=require(_0x9951('0x4'));var moment=require(_0x9951('0x5'));var BPromise=require(_0x9951('0x6'));var Mustache=require(_0x9951('0x7'));var util=require(_0x9951('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9951('0x9'));var _=require(_0x9951('0xa'));var squel=require(_0x9951('0xb'));var crypto=require('crypto');var jsforce=require(_0x9951('0xc'));var deskjs=require(_0x9951('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9951('0xe'));var authService=require(_0x9951('0xf'));var qs=require(_0x9951('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9951('0x11'));var logger=require(_0x9951('0x12'))(_0x9951('0x13'));var utils=require(_0x9951('0x14'));var config=require(_0x9951('0x15'));var licenseUtil=require(_0x9951('0x16'));var db=require(_0x9951('0x17'))['db'];function respondWithStatusCode(_0x3b70e8,_0x56cca0){_0x56cca0=_0x56cca0||0xcc;return function(_0x518020){if(_0x518020){return _0x3b70e8[_0x9951('0x18')](_0x56cca0);}return _0x3b70e8['status'](_0x56cca0)[_0x9951('0x19')]();};}function respondWithResult(_0x2fd6e7,_0x45dbcc){_0x45dbcc=_0x45dbcc||0xc8;return function(_0x45f874){if(_0x45f874){return _0x2fd6e7['status'](_0x45dbcc)['json'](_0x45f874);}};}function respondWithFilteredResult(_0x266983,_0xcdfa8e){return function(_0x3cb7f4){if(_0x3cb7f4){var _0x5231fa=typeof _0xcdfa8e['offset']===_0x9951('0x1a')&&typeof _0xcdfa8e[_0x9951('0x1b')]==='undefined';var _0x230130=_0x3cb7f4[_0x9951('0x1c')];var _0x32c4df=_0x5231fa?0x0:_0xcdfa8e[_0x9951('0x1d')];var _0x517a25=_0x5231fa?_0x3cb7f4[_0x9951('0x1c')]:_0xcdfa8e[_0x9951('0x1d')]+_0xcdfa8e[_0x9951('0x1b')];var _0x5ecb52;if(_0x517a25>=_0x230130){_0x517a25=_0x230130;_0x5ecb52=0xc8;}else{_0x5ecb52=0xce;}_0x266983['status'](_0x5ecb52);return _0x266983[_0x9951('0x1e')](_0x9951('0x1f'),_0x32c4df+'-'+_0x517a25+'/'+_0x230130)['json'](_0x3cb7f4);}return null;};}function patchUpdates(_0x5dfb47){return function(_0x7b60de){try{jsonpatch[_0x9951('0x20')](_0x7b60de,_0x5dfb47,!![]);}catch(_0x2180e3){return BPromise[_0x9951('0x21')](_0x2180e3);}return _0x7b60de['save']();};}function saveUpdates(_0x4d32b0,_0x4003e5){return function(_0x4fabcd){if(_0x4fabcd){return _0x4fabcd['update'](_0x4d32b0)['then'](function(_0x1f44ae){return _0x1f44ae;});}return null;};}function removeEntity(_0x3bdd95,_0xc4392a){return function(_0x462788){if(_0x462788){return _0x462788[_0x9951('0x22')]()[_0x9951('0x23')](function(){var _0x53289b=_0x462788['get']({'plain':!![]});var _0x18ab60=_0x9951('0x24');return db[_0x9951('0x25')][_0x9951('0x22')]({'where':{'type':_0x18ab60,'resourceId':_0x53289b['id']}})[_0x9951('0x23')](function(){return _0x462788;});})[_0x9951('0x23')](function(){_0x3bdd95['status'](0xcc)[_0x9951('0x19')]();});}};}function handleEntityNotFound(_0x2243a3,_0x400377){return function(_0x30755b){if(!_0x30755b){_0x2243a3[_0x9951('0x18')](0x194);}return _0x30755b;};}function handleError(_0x1c88bd,_0x433f59){_0x433f59=_0x433f59||0x1f4;return function(_0x5b2aff){logger[_0x9951('0x26')](_0x5b2aff[_0x9951('0x27')]);if(_0x5b2aff[_0x9951('0x28')]){delete _0x5b2aff['name'];}_0x1c88bd[_0x9951('0x29')](_0x433f59)[_0x9951('0x2a')](_0x5b2aff);};}exports[_0x9951('0x2b')]=function(_0x5054ac,_0x102e89){var _0x4c5a39={},_0x335d4a={},_0x3a6f14={'count':0x0,'rows':[]};var _0x5d9b77=_[_0x9951('0x2c')](db[_0x9951('0x2d')]['rawAttributes'],function(_0x13fee1){return{'name':_0x13fee1[_0x9951('0x2e')],'type':_0x13fee1[_0x9951('0x2f')][_0x9951('0x30')]};});_0x335d4a[_0x9951('0x31')]=_['map'](_0x5d9b77,_0x9951('0x28'));_0x335d4a['query']=_['keys'](_0x5054ac[_0x9951('0x32')]);_0x335d4a['filters']=_[_0x9951('0x33')](_0x335d4a[_0x9951('0x31')],_0x335d4a['query']);_0x4c5a39[_0x9951('0x34')]=_[_0x9951('0x33')](_0x335d4a['model'],qs[_0x9951('0x35')](_0x5054ac[_0x9951('0x32')][_0x9951('0x35')]));_0x4c5a39['attributes']=_0x4c5a39[_0x9951('0x34')]['length']?_0x4c5a39[_0x9951('0x34')]:_0x335d4a[_0x9951('0x31')];if(!_0x5054ac[_0x9951('0x32')][_0x9951('0x36')](_0x9951('0x37'))){_0x4c5a39[_0x9951('0x1b')]=qs['limit'](_0x5054ac[_0x9951('0x32')]['limit']);_0x4c5a39[_0x9951('0x1d')]=qs[_0x9951('0x1d')](_0x5054ac[_0x9951('0x32')][_0x9951('0x1d')]);}_0x4c5a39['order']=qs['sort'](_0x5054ac['query'][_0x9951('0x38')]);_0x4c5a39[_0x9951('0x39')]=qs[_0x9951('0x3a')](_[_0x9951('0x3b')](_0x5054ac[_0x9951('0x32')],_0x335d4a[_0x9951('0x3a')]),_0x5d9b77);if(_0x5054ac[_0x9951('0x32')]['filter']){_0x4c5a39[_0x9951('0x39')]=_[_0x9951('0x3c')](_0x4c5a39[_0x9951('0x39')],{'$or':_[_0x9951('0x2c')](_0x5d9b77,function(_0x456727){if(_0x456727['type']!=='VIRTUAL'){var _0x424caa={};_0x424caa[_0x456727[_0x9951('0x28')]]={'$like':'%'+_0x5054ac['query']['filter']+'%'};return _0x424caa;}})});}_0x4c5a39=_[_0x9951('0x3c')]({},_0x4c5a39,_0x5054ac[_0x9951('0x3d')]);var _0xd48001={'where':_0x4c5a39[_0x9951('0x39')]};return db[_0x9951('0x2d')]['count'](_0xd48001)[_0x9951('0x23')](function(_0x235642){_0x3a6f14['count']=_0x235642;if(_0x5054ac[_0x9951('0x32')]['includeAll']){_0x4c5a39['include']=[{'all':!![]}];}return db[_0x9951('0x2d')][_0x9951('0x3e')](_0x4c5a39);})[_0x9951('0x23')](function(_0x51e2fa){_0x3a6f14[_0x9951('0x3f')]=_0x51e2fa;return _0x3a6f14;})['then'](respondWithFilteredResult(_0x102e89,_0x4c5a39))[_0x9951('0x40')](handleError(_0x102e89,null));};exports[_0x9951('0x41')]=function(_0x18b661,_0x3527c0){var _0x4b780e={'raw':!![],'where':{'id':_0x18b661[_0x9951('0x42')]['id']}},_0x4c1a84={};_0x4c1a84[_0x9951('0x31')]=_[_0x9951('0x43')](db[_0x9951('0x2d')][_0x9951('0x44')]);_0x4c1a84['query']=_[_0x9951('0x43')](_0x18b661[_0x9951('0x32')]);_0x4c1a84['filters']=_[_0x9951('0x33')](_0x4c1a84[_0x9951('0x31')],_0x4c1a84[_0x9951('0x32')]);_0x4b780e['attributes']=_['intersection'](_0x4c1a84[_0x9951('0x31')],qs[_0x9951('0x35')](_0x18b661['query']['fields']));_0x4b780e['attributes']=_0x4b780e[_0x9951('0x34')][_0x9951('0x45')]?_0x4b780e[_0x9951('0x34')]:_0x4c1a84[_0x9951('0x31')];if(_0x18b661[_0x9951('0x32')][_0x9951('0x46')]){_0x4b780e['include']=[{'all':!![]}];}_0x4b780e=_['merge']({},_0x4b780e,_0x18b661[_0x9951('0x3d')]);return db[_0x9951('0x2d')][_0x9951('0x47')](_0x4b780e)['then'](handleEntityNotFound(_0x3527c0,null))[_0x9951('0x23')](respondWithResult(_0x3527c0,null))['catch'](handleError(_0x3527c0,null));};exports['create']=function(_0x1eb99b,_0x138d98){return db[_0x9951('0x2d')][_0x9951('0x48')](_0x1eb99b[_0x9951('0x49')],{})[_0x9951('0x23')](function(_0x3e57a9){var _0x473bc5=_0x1eb99b['user'][_0x9951('0x4a')]({'plain':!![]});if(!_0x473bc5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x473bc5[_0x9951('0x4b')]==='user'){var _0x35f856=_0x3e57a9['get']({'plain':!![]});var _0x413042=_0x9951('0x24');return db[_0x9951('0x4c')][_0x9951('0x47')]({'where':{'name':_0x413042,'userProfileId':_0x473bc5[_0x9951('0x4d')]},'raw':!![]})[_0x9951('0x23')](function(_0x2e8d20){if(_0x2e8d20&&_0x2e8d20[_0x9951('0x4e')]===0x0){return db['UserProfileResource'][_0x9951('0x48')]({'name':_0x35f856['name'],'resourceId':_0x35f856['id'],'type':_0x2e8d20[_0x9951('0x28')],'sectionId':_0x2e8d20['id']},{})[_0x9951('0x23')](function(){return _0x3e57a9;});}else{return _0x3e57a9;}})[_0x9951('0x40')](function(_0x29ed5d){logger['error'](_0x9951('0x4f'),_0x29ed5d);throw _0x29ed5d;});}return _0x3e57a9;})[_0x9951('0x23')](respondWithResult(_0x138d98,0xc9))[_0x9951('0x40')](handleError(_0x138d98,null));};exports[_0x9951('0x50')]=function(_0xf9c26d,_0x471d7d){if(_0xf9c26d[_0x9951('0x49')]['id']){delete _0xf9c26d[_0x9951('0x49')]['id'];}return db[_0x9951('0x2d')][_0x9951('0x47')]({'where':{'id':_0xf9c26d[_0x9951('0x42')]['id']}})[_0x9951('0x23')](handleEntityNotFound(_0x471d7d,null))[_0x9951('0x23')](saveUpdates(_0xf9c26d['body'],null))[_0x9951('0x23')](respondWithResult(_0x471d7d,null))[_0x9951('0x40')](handleError(_0x471d7d,null));};exports[_0x9951('0x22')]=function(_0x205de1,_0x2a00d6){return db[_0x9951('0x2d')][_0x9951('0x47')]({'where':{'id':_0x205de1[_0x9951('0x42')]['id']}})[_0x9951('0x23')](handleEntityNotFound(_0x2a00d6,null))[_0x9951('0x23')](removeEntity(_0x2a00d6,null))['catch'](handleError(_0x2a00d6,null));};exports[_0x9951('0x51')]=function(_0x3556ab,_0x26c7af,_0x418a7e){return db[_0x9951('0x2d')]['find']({'where':{'id':_0x3556ab[_0x9951('0x42')]['id']},'attributes':[_0x9951('0x28'),_0x9951('0x52'),_0x9951('0x53'),'output'],'raw':!![]})[_0x9951('0x23')](handleEntityNotFound(_0x26c7af,null))[_0x9951('0x23')](function(_0x5877af){if(_0x5877af){if(!fs[_0x9951('0x54')](path[_0x9951('0x55')](config[_0x9951('0x56')],'server/files/reports',_0x5877af['savename']))){throw new db[(_0x9951('0x57'))][(_0x9951('0x58'))](_0x9951('0x59'));}if(_0x3556ab[_0x9951('0x32')][_0x9951('0x5a')]){return _0x26c7af[_0x9951('0x18')](0xc8);}return _0x26c7af['download'](path['join'](config[_0x9951('0x56')],_0x9951('0x5b'),_0x5877af[_0x9951('0x53')]),util[_0x9951('0x5c')](_0x9951('0x5d'),_0x5877af[_0x9951('0x52')]||_0x5877af[_0x9951('0x28')],_0x5877af['output'][_0x9951('0x5e')]()));}})[_0x9951('0x40')](handleError(_0x26c7af,null));};
\ No newline at end of file
+var _0x1e2d=['limit','count','status','set','Content-Range','save','update','destroy','then','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','rows','show','params','keys','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined'];(function(_0x43cce0,_0x5b432b){var _0x663f7e=function(_0x59c38c){while(--_0x59c38c){_0x43cce0['push'](_0x43cce0['shift']());}};_0x663f7e(++_0x5b432b);}(_0x1e2d,0xa5));var _0xd1e2=function(_0x4e5117,_0x1c90cd){_0x4e5117=_0x4e5117-0x0;var _0x1b0eea=_0x1e2d[_0x4e5117];return _0x1b0eea;};'use strict';var emlformat=require(_0xd1e2('0x0'));var rimraf=require(_0xd1e2('0x1'));var zipdir=require(_0xd1e2('0x2'));var jsonpatch=require(_0xd1e2('0x3'));var rp=require(_0xd1e2('0x4'));var moment=require('moment');var BPromise=require(_0xd1e2('0x5'));var Mustache=require(_0xd1e2('0x6'));var util=require(_0xd1e2('0x7'));var path=require(_0xd1e2('0x8'));var sox=require(_0xd1e2('0x9'));var csv=require(_0xd1e2('0xa'));var ejs=require(_0xd1e2('0xb'));var fs=require('fs');var fs_extra=require(_0xd1e2('0xc'));var _=require('lodash');var squel=require(_0xd1e2('0xd'));var crypto=require(_0xd1e2('0xe'));var jsforce=require(_0xd1e2('0xf'));var deskjs=require(_0xd1e2('0x10'));var toCsv=require(_0xd1e2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd1e2('0x11'));var authService=require(_0xd1e2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd1e2('0x13'));var hardwareService=require(_0xd1e2('0x14'));var logger=require(_0xd1e2('0x15'))(_0xd1e2('0x16'));var utils=require(_0xd1e2('0x17'));var config=require(_0xd1e2('0x18'));var licenseUtil=require(_0xd1e2('0x19'));var db=require(_0xd1e2('0x1a'))['db'];function respondWithStatusCode(_0x358b55,_0x48e4fa){_0x48e4fa=_0x48e4fa||0xcc;return function(_0x27fa4a){if(_0x27fa4a){return _0x358b55['sendStatus'](_0x48e4fa);}return _0x358b55['status'](_0x48e4fa)[_0xd1e2('0x1b')]();};}function respondWithResult(_0x4678c6,_0x1aa58b){_0x1aa58b=_0x1aa58b||0xc8;return function(_0x1bcf1f){if(_0x1bcf1f){return _0x4678c6['status'](_0x1aa58b)[_0xd1e2('0x1c')](_0x1bcf1f);}};}function respondWithFilteredResult(_0x5499f0,_0x24098e){return function(_0x465783){if(_0x465783){var _0x185b0d=typeof _0x24098e[_0xd1e2('0x1d')]===_0xd1e2('0x1e')&&typeof _0x24098e[_0xd1e2('0x1f')]==='undefined';var _0x5beaf4=_0x465783[_0xd1e2('0x20')];var _0x3b12f2=_0x185b0d?0x0:_0x24098e[_0xd1e2('0x1d')];var _0x4ae0d2=_0x185b0d?_0x465783[_0xd1e2('0x20')]:_0x24098e[_0xd1e2('0x1d')]+_0x24098e[_0xd1e2('0x1f')];var _0xfb3b0c;if(_0x4ae0d2>=_0x5beaf4){_0x4ae0d2=_0x5beaf4;_0xfb3b0c=0xc8;}else{_0xfb3b0c=0xce;}_0x5499f0[_0xd1e2('0x21')](_0xfb3b0c);return _0x5499f0[_0xd1e2('0x22')](_0xd1e2('0x23'),_0x3b12f2+'-'+_0x4ae0d2+'/'+_0x5beaf4)['json'](_0x465783);}return null;};}function patchUpdates(_0x4d58ea){return function(_0x169d92){try{jsonpatch['apply'](_0x169d92,_0x4d58ea,!![]);}catch(_0x1b1ee0){return BPromise['reject'](_0x1b1ee0);}return _0x169d92[_0xd1e2('0x24')]();};}function saveUpdates(_0x5c74bf,_0x5a114a){return function(_0xdc067e){if(_0xdc067e){return _0xdc067e[_0xd1e2('0x25')](_0x5c74bf)['then'](function(_0x1ba2bb){return _0x1ba2bb;});}return null;};}function removeEntity(_0x42d115,_0x39cc28){return function(_0x1da081){if(_0x1da081){return _0x1da081[_0xd1e2('0x26')]()[_0xd1e2('0x27')](function(){var _0x17d0a8=_0x1da081[_0xd1e2('0x28')]({'plain':!![]});var _0x5b964d=_0xd1e2('0x29');return db[_0xd1e2('0x2a')]['destroy']({'where':{'type':_0x5b964d,'resourceId':_0x17d0a8['id']}})[_0xd1e2('0x27')](function(){return _0x1da081;});})['then'](function(){_0x42d115[_0xd1e2('0x21')](0xcc)[_0xd1e2('0x1b')]();});}};}function handleEntityNotFound(_0x16f825,_0x5a91da){return function(_0x45efbd){if(!_0x45efbd){_0x16f825[_0xd1e2('0x2b')](0x194);}return _0x45efbd;};}function handleError(_0x416c56,_0xba1c3c){_0xba1c3c=_0xba1c3c||0x1f4;return function(_0x41a369){logger[_0xd1e2('0x2c')](_0x41a369[_0xd1e2('0x2d')]);if(_0x41a369[_0xd1e2('0x2e')]){delete _0x41a369[_0xd1e2('0x2e')];}_0x416c56[_0xd1e2('0x21')](_0xba1c3c)[_0xd1e2('0x2f')](_0x41a369);};}exports[_0xd1e2('0x30')]=function(_0x366180,_0x419053){var _0x592695={},_0x5d4742={},_0x46cadd={'count':0x0,'rows':[]};var _0x3c679c=_[_0xd1e2('0x31')](db[_0xd1e2('0x32')][_0xd1e2('0x33')],function(_0x22bd6b){return{'name':_0x22bd6b['fieldName'],'type':_0x22bd6b[_0xd1e2('0x34')][_0xd1e2('0x35')]};});_0x5d4742[_0xd1e2('0x36')]=_[_0xd1e2('0x31')](_0x3c679c,_0xd1e2('0x2e'));_0x5d4742[_0xd1e2('0x37')]=_['keys'](_0x366180[_0xd1e2('0x37')]);_0x5d4742['filters']=_[_0xd1e2('0x38')](_0x5d4742[_0xd1e2('0x36')],_0x5d4742[_0xd1e2('0x37')]);_0x592695[_0xd1e2('0x39')]=_[_0xd1e2('0x38')](_0x5d4742['model'],qs[_0xd1e2('0x3a')](_0x366180['query'][_0xd1e2('0x3a')]));_0x592695[_0xd1e2('0x39')]=_0x592695[_0xd1e2('0x39')][_0xd1e2('0x3b')]?_0x592695[_0xd1e2('0x39')]:_0x5d4742[_0xd1e2('0x36')];if(!_0x366180['query'][_0xd1e2('0x3c')](_0xd1e2('0x3d'))){_0x592695[_0xd1e2('0x1f')]=qs['limit'](_0x366180[_0xd1e2('0x37')][_0xd1e2('0x1f')]);_0x592695[_0xd1e2('0x1d')]=qs[_0xd1e2('0x1d')](_0x366180[_0xd1e2('0x37')][_0xd1e2('0x1d')]);}_0x592695['order']=qs['sort'](_0x366180[_0xd1e2('0x37')][_0xd1e2('0x3e')]);_0x592695['where']=qs[_0xd1e2('0x3f')](_[_0xd1e2('0x40')](_0x366180[_0xd1e2('0x37')],_0x5d4742[_0xd1e2('0x3f')]),_0x3c679c);if(_0x366180[_0xd1e2('0x37')][_0xd1e2('0x41')]){_0x592695[_0xd1e2('0x42')]=_[_0xd1e2('0x43')](_0x592695['where'],{'$or':_[_0xd1e2('0x31')](_0x3c679c,function(_0xbfd28f){if(_0xbfd28f[_0xd1e2('0x34')]!==_0xd1e2('0x44')){var _0x576a34={};_0x576a34[_0xbfd28f[_0xd1e2('0x2e')]]={'$like':'%'+_0x366180['query'][_0xd1e2('0x41')]+'%'};return _0x576a34;}})});}_0x592695=_[_0xd1e2('0x43')]({},_0x592695,_0x366180['options']);var _0x5d6a8e={'where':_0x592695[_0xd1e2('0x42')]};return db[_0xd1e2('0x32')][_0xd1e2('0x20')](_0x5d6a8e)[_0xd1e2('0x27')](function(_0x1e9988){_0x46cadd[_0xd1e2('0x20')]=_0x1e9988;if(_0x366180[_0xd1e2('0x37')][_0xd1e2('0x45')]){_0x592695[_0xd1e2('0x46')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x592695);})[_0xd1e2('0x27')](function(_0xb18bd3){_0x46cadd[_0xd1e2('0x47')]=_0xb18bd3;return _0x46cadd;})[_0xd1e2('0x27')](respondWithFilteredResult(_0x419053,_0x592695))['catch'](handleError(_0x419053,null));};exports[_0xd1e2('0x48')]=function(_0x19e67a,_0x38e22d){var _0x4641b8={'raw':!![],'where':{'id':_0x19e67a[_0xd1e2('0x49')]['id']}},_0x5331de={};_0x5331de[_0xd1e2('0x36')]=_['keys'](db['AnalyticExtractedReport'][_0xd1e2('0x33')]);_0x5331de[_0xd1e2('0x37')]=_[_0xd1e2('0x4a')](_0x19e67a['query']);_0x5331de[_0xd1e2('0x3f')]=_[_0xd1e2('0x38')](_0x5331de[_0xd1e2('0x36')],_0x5331de[_0xd1e2('0x37')]);_0x4641b8[_0xd1e2('0x39')]=_[_0xd1e2('0x38')](_0x5331de[_0xd1e2('0x36')],qs[_0xd1e2('0x3a')](_0x19e67a[_0xd1e2('0x37')]['fields']));_0x4641b8[_0xd1e2('0x39')]=_0x4641b8[_0xd1e2('0x39')][_0xd1e2('0x3b')]?_0x4641b8['attributes']:_0x5331de[_0xd1e2('0x36')];if(_0x19e67a[_0xd1e2('0x37')][_0xd1e2('0x45')]){_0x4641b8[_0xd1e2('0x46')]=[{'all':!![]}];}_0x4641b8=_['merge']({},_0x4641b8,_0x19e67a[_0xd1e2('0x4b')]);return db[_0xd1e2('0x32')][_0xd1e2('0x4c')](_0x4641b8)[_0xd1e2('0x27')](handleEntityNotFound(_0x38e22d,null))['then'](respondWithResult(_0x38e22d,null))[_0xd1e2('0x4d')](handleError(_0x38e22d,null));};exports[_0xd1e2('0x4e')]=function(_0x4b7e3f,_0x1156b4){return db[_0xd1e2('0x32')][_0xd1e2('0x4e')](_0x4b7e3f['body'],{})[_0xd1e2('0x27')](function(_0x4f20b9){var _0x457ad0=_0x4b7e3f[_0xd1e2('0x4f')][_0xd1e2('0x28')]({'plain':!![]});if(!_0x457ad0)throw new Error(_0xd1e2('0x50'));if(_0x457ad0[_0xd1e2('0x51')]==='user'){var _0x5caf17=_0x4f20b9['get']({'plain':!![]});var _0x592e7e=_0xd1e2('0x29');return db[_0xd1e2('0x52')][_0xd1e2('0x4c')]({'where':{'name':_0x592e7e,'userProfileId':_0x457ad0[_0xd1e2('0x53')]},'raw':!![]})[_0xd1e2('0x27')](function(_0x39484a){if(_0x39484a&&_0x39484a[_0xd1e2('0x54')]===0x0){return db[_0xd1e2('0x2a')][_0xd1e2('0x4e')]({'name':_0x5caf17[_0xd1e2('0x2e')],'resourceId':_0x5caf17['id'],'type':_0x39484a[_0xd1e2('0x2e')],'sectionId':_0x39484a['id']},{})[_0xd1e2('0x27')](function(){return _0x4f20b9;});}else{return _0x4f20b9;}})[_0xd1e2('0x4d')](function(_0x398b5b){logger['error'](_0xd1e2('0x55'),_0x398b5b);throw _0x398b5b;});}return _0x4f20b9;})['then'](respondWithResult(_0x1156b4,0xc9))[_0xd1e2('0x4d')](handleError(_0x1156b4,null));};exports['update']=function(_0x5d9a4b,_0x1b886d){if(_0x5d9a4b['body']['id']){delete _0x5d9a4b[_0xd1e2('0x56')]['id'];}return db[_0xd1e2('0x32')][_0xd1e2('0x4c')]({'where':{'id':_0x5d9a4b['params']['id']}})['then'](handleEntityNotFound(_0x1b886d,null))[_0xd1e2('0x27')](saveUpdates(_0x5d9a4b['body'],null))[_0xd1e2('0x27')](respondWithResult(_0x1b886d,null))[_0xd1e2('0x4d')](handleError(_0x1b886d,null));};exports[_0xd1e2('0x26')]=function(_0x5cdaf5,_0x5687d9){return db[_0xd1e2('0x32')][_0xd1e2('0x4c')]({'where':{'id':_0x5cdaf5[_0xd1e2('0x49')]['id']}})[_0xd1e2('0x27')](handleEntityNotFound(_0x5687d9,null))['then'](removeEntity(_0x5687d9,null))[_0xd1e2('0x4d')](handleError(_0x5687d9,null));};exports[_0xd1e2('0x57')]=function(_0x1488a3,_0x66b9b2,_0x2b334e){return db[_0xd1e2('0x32')][_0xd1e2('0x4c')]({'where':{'id':_0x1488a3['params']['id']},'attributes':['name',_0xd1e2('0x58'),_0xd1e2('0x59'),_0xd1e2('0x5a')],'raw':!![]})['then'](handleEntityNotFound(_0x66b9b2,null))[_0xd1e2('0x27')](function(_0x5f594b){if(_0x5f594b){if(!fs[_0xd1e2('0x5b')](path[_0xd1e2('0x5c')](config[_0xd1e2('0x5d')],_0xd1e2('0x5e'),_0x5f594b['savename']))){throw new db[(_0xd1e2('0x5f'))]['ValidationError'](_0xd1e2('0x60'));}if(_0x1488a3['query']['exists']){return _0x66b9b2[_0xd1e2('0x2b')](0xc8);}return _0x66b9b2[_0xd1e2('0x57')](path[_0xd1e2('0x5c')](config[_0xd1e2('0x5d')],_0xd1e2('0x5e'),_0x5f594b[_0xd1e2('0x59')]),util['format'](_0xd1e2('0x61'),_0x5f594b[_0xd1e2('0x58')]||_0x5f594b[_0xd1e2('0x2e')],_0x5f594b['output']['toLowerCase']()));}})['catch'](handleError(_0x66b9b2,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index d81ed2c..6b234c9 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 _0xdb2f=['./analyticExtractedReport.attributes','define','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x51d6e4,_0x5b48ff){var _0xb104f1=function(_0x4d1bc3){while(--_0x4d1bc3){_0x51d6e4['push'](_0x51d6e4['shift']());}};_0xb104f1(++_0x5b48ff);}(_0xdb2f,0x12f));var _0xfdb2=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xdb2f[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xfdb2('0x0'));var util=require(_0xfdb2('0x1'));var logger=require(_0xfdb2('0x2'))(_0xfdb2('0x3'));var moment=require(_0xfdb2('0x4'));var BPromise=require(_0xfdb2('0x5'));var rp=require(_0xfdb2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfdb2('0x7'));var config=require(_0xfdb2('0x8'));var attributes=require(_0xfdb2('0x9'));module['exports']=function(_0x351713,_0x590a39){return _0x351713[_0xfdb2('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0xfdb2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2ec=['analytics_extracted_reports','lodash','util','../../config/logger','moment','request-promise','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x493983,_0x45ea0e){var _0x52031b=function(_0xe84b82){while(--_0xe84b82){_0x493983['push'](_0x493983['shift']());}};_0x52031b(++_0x45ea0e);}(_0xe2ec,0x173));var _0xce2e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xe2ec[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xce2e('0x0'));var util=require(_0xce2e('0x1'));var logger=require(_0xce2e('0x2'))('api');var moment=require(_0xce2e('0x3'));var BPromise=require('bluebird');var rp=require(_0xce2e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xce2e('0x5'));module[_0xce2e('0x6')]=function(_0x3be0c4,_0x5142fe){return _0x3be0c4[_0xce2e('0x7')](_0xce2e('0x8'),attributes,{'tableName':_0xce2e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index f04976f..e28afee 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 _0x96bb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x58b6e9,_0x2857c0){var _0x261a4c=function(_0x1ac398){while(--_0x1ac398){_0x58b6e9['push'](_0x58b6e9['shift']());}};_0x261a4c(++_0x2857c0);}(_0x96bb,0x9c));var _0xb96b=function(_0x16c0bd,_0x9676d2){_0x16c0bd=_0x16c0bd-0x0;var _0x48fd60=_0x96bb[_0x16c0bd];return _0x48fd60;};'use strict';var _=require('lodash');var util=require(_0xb96b('0x0'));var moment=require(_0xb96b('0x1'));var BPromise=require(_0xb96b('0x2'));var rs=require(_0xb96b('0x3'));var fs=require('fs');var Redis=require(_0xb96b('0x4'));var db=require(_0xb96b('0x5'))['db'];var utils=require(_0xb96b('0x6'));var logger=require(_0xb96b('0x7'))(_0xb96b('0x8'));var config=require(_0xb96b('0x9'));var jayson=require(_0xb96b('0xa'));var client=jayson[_0xb96b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da463,_0x293eb3,_0x543c74){return new BPromise(function(_0x4b142c,_0x154222){return client[_0xb96b('0xc')](_0x5da463,_0x543c74)[_0xb96b('0xd')](function(_0x35c1c2){logger[_0xb96b('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x293eb3,_0xb96b('0xf'));logger[_0xb96b('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x293eb3,'request\x20sent',JSON[_0xb96b('0x11')](_0x35c1c2));if(_0x35c1c2[_0xb96b('0x12')]){if(_0x35c1c2['error'][_0xb96b('0x13')]===0x1f4){logger['error'](_0xb96b('0x14'),_0x293eb3,_0x35c1c2['error']['message']);return _0x154222(_0x35c1c2[_0xb96b('0x12')]['message']);}logger[_0xb96b('0x12')](_0xb96b('0x14'),_0x293eb3,_0x35c1c2['error'][_0xb96b('0x15')]);return _0x4b142c(_0x35c1c2[_0xb96b('0x12')][_0xb96b('0x15')]);}else{logger['info'](_0xb96b('0x14'),_0x293eb3,_0xb96b('0xf'));_0x4b142c(_0x35c1c2[_0xb96b('0x16')][_0xb96b('0x15')]);}})['catch'](function(_0x47b842){logger[_0xb96b('0x12')](_0xb96b('0x14'),_0x293eb3,_0x47b842);_0x154222(_0x47b842);});});}
\ No newline at end of file
+var _0xdcc1=['request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xdcc1,0x170));var _0x1dcc=function(_0x2127ad,_0x1e858d){_0x2127ad=_0x2127ad-0x0;var _0x30e2ab=_0xdcc1[_0x2127ad];return _0x30e2ab;};'use strict';var _=require(_0x1dcc('0x0'));var util=require(_0x1dcc('0x1'));var moment=require(_0x1dcc('0x2'));var BPromise=require(_0x1dcc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dcc('0x4'));var db=require(_0x1dcc('0x5'))['db'];var utils=require(_0x1dcc('0x6'));var logger=require(_0x1dcc('0x7'))('rpc');var config=require(_0x1dcc('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1dcc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ce3a6,_0x481d7c,_0x40acb8){return new BPromise(function(_0x2b29ce,_0x13b150){return client[_0x1dcc('0xa')](_0x1ce3a6,_0x40acb8)['then'](function(_0x4d4edd){logger['info'](_0x1dcc('0xb'),_0x481d7c,_0x1dcc('0xc'));logger[_0x1dcc('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x481d7c,'request\x20sent',JSON[_0x1dcc('0xe')](_0x4d4edd));if(_0x4d4edd[_0x1dcc('0xf')]){if(_0x4d4edd[_0x1dcc('0xf')][_0x1dcc('0x10')]===0x1f4){logger[_0x1dcc('0xf')](_0x1dcc('0xb'),_0x481d7c,_0x4d4edd[_0x1dcc('0xf')][_0x1dcc('0x11')]);return _0x13b150(_0x4d4edd[_0x1dcc('0xf')][_0x1dcc('0x11')]);}logger[_0x1dcc('0xf')](_0x1dcc('0xb'),_0x481d7c,_0x4d4edd['error'][_0x1dcc('0x11')]);return _0x2b29ce(_0x4d4edd['error'][_0x1dcc('0x11')]);}else{logger[_0x1dcc('0x12')](_0x1dcc('0xb'),_0x481d7c,'request\x20sent');_0x2b29ce(_0x4d4edd[_0x1dcc('0x13')][_0x1dcc('0x11')]);}})[_0x1dcc('0x14')](function(_0x25eb59){logger[_0x1dcc('0xf')](_0x1dcc('0xb'),_0x481d7c,_0x25eb59);_0x13b150(_0x25eb59);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 8c24e1d..2e5e4ed 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 _0xdd79=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','/:id/download','isAuthenticated','put','update'];(function(_0x6c0ac,_0x26ec95){var _0x57f34c=function(_0x4d0ac6){while(--_0x4d0ac6){_0x6c0ac['push'](_0x6c0ac['shift']());}};_0x57f34c(++_0x26ec95);}(_0xdd79,0x16b));var _0x9dd7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdd79[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x9dd7('0x0'));var path=require(_0x9dd7('0x1'));var timeout=require(_0x9dd7('0x2'));var express=require(_0x9dd7('0x3'));var router=express[_0x9dd7('0x4')]();var fs_extra=require(_0x9dd7('0x5'));var auth=require(_0x9dd7('0x6'));var interaction=require(_0x9dd7('0x7'));var config=require('../../config/environment');var controller=require('./analyticExtractedReport.controller');router[_0x9dd7('0x8')]('/',auth['isAuthenticated'](),controller[_0x9dd7('0x9')]);router[_0x9dd7('0x8')](_0x9dd7('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9dd7('0x8')](_0x9dd7('0xb'),auth[_0x9dd7('0xc')](),controller['download']);router['post']('/',auth[_0x9dd7('0xc')](),controller['create']);router[_0x9dd7('0xd')](_0x9dd7('0xa'),auth['isAuthenticated'](),controller[_0x9dd7('0xe')]);router[_0x9dd7('0xf')](_0x9dd7('0xa'),auth['isAuthenticated'](),controller[_0x9dd7('0x10')]);module[_0x9dd7('0x11')]=router;
\ No newline at end of file
+var _0xd20d=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put'];(function(_0x38d897,_0x4683df){var _0x439ce8=function(_0x47f268){while(--_0x47f268){_0x38d897['push'](_0x38d897['shift']());}};_0x439ce8(++_0x4683df);}(_0xd20d,0x168));var _0xdd20=function(_0x877c80,_0x38f939){_0x877c80=_0x877c80-0x0;var _0x377bdb=_0xd20d[_0x877c80];return _0x377bdb;};'use strict';var multer=require(_0xdd20('0x0'));var util=require(_0xdd20('0x1'));var path=require(_0xdd20('0x2'));var timeout=require(_0xdd20('0x3'));var express=require(_0xdd20('0x4'));var router=express[_0xdd20('0x5')]();var fs_extra=require(_0xdd20('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdd20('0x7'));var controller=require('./analyticExtractedReport.controller');router[_0xdd20('0x8')]('/',auth['isAuthenticated'](),controller[_0xdd20('0x9')]);router[_0xdd20('0x8')](_0xdd20('0xa'),auth[_0xdd20('0xb')](),controller[_0xdd20('0xc')]);router[_0xdd20('0x8')](_0xdd20('0xd'),auth['isAuthenticated'](),controller[_0xdd20('0xe')]);router[_0xdd20('0xf')]('/',auth[_0xdd20('0xb')](),controller[_0xdd20('0x10')]);router[_0xdd20('0x11')](_0xdd20('0xa'),auth[_0xdd20('0xb')](),controller[_0xdd20('0x12')]);router[_0xdd20('0x13')]('/:id',auth[_0xdd20('0xb')](),controller['destroy']);module[_0xdd20('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 47c897d..51379a6 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 _0x8f1b=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x577a87,_0x30efe2){var _0x3e2384=function(_0x2f9915){while(--_0x2f9915){_0x577a87['push'](_0x577a87['shift']());}};_0x3e2384(++_0x30efe2);}(_0x8f1b,0x16a));var _0xb8f1=function(_0x87f99b,_0x4c3d05){_0x87f99b=_0x87f99b-0x0;var _0x233df9=_0x8f1b[_0x87f99b];return _0x233df9;};'use strict';var Sequelize=require(_0xb8f1('0x0'));module[_0xb8f1('0x1')]={'field':{'type':Sequelize[_0xb8f1('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xb8f1('0x3')]},'format':{'type':Sequelize[_0xb8f1('0x3')]},'groupBy':{'type':Sequelize[_0xb8f1('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb8f1('0x3')]},'custom':{'type':Sequelize[_0xb8f1('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1fc1=['BOOLEAN','exports','TEXT','STRING'];(function(_0x3ab6cb,_0x5e47e7){var _0x1592d9=function(_0x28f34f){while(--_0x28f34f){_0x3ab6cb['push'](_0x3ab6cb['shift']());}};_0x1592d9(++_0x5e47e7);}(_0x1fc1,0x185));var _0x11fc=function(_0x23dad9,_0x5dc8f2){_0x23dad9=_0x23dad9-0x0;var _0x527967=_0x1fc1[_0x23dad9];return _0x527967;};'use strict';var Sequelize=require('sequelize');module[_0x11fc('0x0')]={'field':{'type':Sequelize[_0x11fc('0x1')]},'alias':{'type':Sequelize[_0x11fc('0x2')]},'function':{'type':Sequelize[_0x11fc('0x2')]},'format':{'type':Sequelize[_0x11fc('0x2')]},'groupBy':{'type':Sequelize[_0x11fc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index e12c789..c5ac353 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 _0x535e=['AnalyticFieldReport','rawAttributes','fieldName','type','map','query','keys','intersection','attributes','model','length','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','then','findAll','catch','params','fields','includeAll','find','create','bulkCreate','body','update','bulkDestroy','ids','addFields','findOne','sequelize','transaction','rimraf','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','destroy','sendStatus','stack','name','send','index'];(function(_0x27162c,_0x21cb5d){var _0x39f7fc=function(_0x2ba9e0){while(--_0x2ba9e0){_0x27162c['push'](_0x27162c['shift']());}};_0x39f7fc(++_0x21cb5d);}(_0x535e,0x189));var _0xe535=function(_0x2cdcf9,_0x8a09d1){_0x2cdcf9=_0x2cdcf9-0x0;var _0x39412d=_0x535e[_0x2cdcf9];return _0x39412d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe535('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe535('0x1'));var moment=require('moment');var BPromise=require(_0xe535('0x2'));var Mustache=require(_0xe535('0x3'));var util=require('util');var path=require('path');var sox=require(_0xe535('0x4'));var csv=require(_0xe535('0x5'));var ejs=require(_0xe535('0x6'));var fs=require('fs');var fs_extra=require(_0xe535('0x7'));var _=require('lodash');var squel=require(_0xe535('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe535('0x9'));var toCsv=require(_0xe535('0x5'));var querystring=require(_0xe535('0xa'));var Papa=require('papaparse');var Redis=require(_0xe535('0xb'));var authService=require(_0xe535('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xe535('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe535('0xe'))(_0xe535('0xf'));var utils=require(_0xe535('0x10'));var config=require(_0xe535('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xe535('0x12'))['db'];function respondWithStatusCode(_0x20cc8e,_0x2579c7){_0x2579c7=_0x2579c7||0xcc;return function(_0x573db0){if(_0x573db0){return _0x20cc8e['sendStatus'](_0x2579c7);}return _0x20cc8e[_0xe535('0x13')](_0x2579c7)[_0xe535('0x14')]();};}function respondWithResult(_0x50047b,_0x4bd6a5){_0x4bd6a5=_0x4bd6a5||0xc8;return function(_0x36c3b8){if(_0x36c3b8){return _0x50047b[_0xe535('0x13')](_0x4bd6a5)[_0xe535('0x15')](_0x36c3b8);}};}function respondWithFilteredResult(_0x2ea235,_0x5a0bca){return function(_0x29453d){if(_0x29453d){var _0x3dc832=typeof _0x5a0bca[_0xe535('0x16')]===_0xe535('0x17')&&typeof _0x5a0bca[_0xe535('0x18')]===_0xe535('0x17');var _0x2723f6=_0x29453d[_0xe535('0x19')];var _0x1886cb=_0x3dc832?0x0:_0x5a0bca['offset'];var _0x54bfd8=_0x3dc832?_0x29453d[_0xe535('0x19')]:_0x5a0bca[_0xe535('0x16')]+_0x5a0bca[_0xe535('0x18')];var _0x23d7d2;if(_0x54bfd8>=_0x2723f6){_0x54bfd8=_0x2723f6;_0x23d7d2=0xc8;}else{_0x23d7d2=0xce;}_0x2ea235[_0xe535('0x13')](_0x23d7d2);return _0x2ea235['set']('Content-Range',_0x1886cb+'-'+_0x54bfd8+'/'+_0x2723f6)[_0xe535('0x15')](_0x29453d);}return null;};}function patchUpdates(_0x3866d0){return function(_0x1bf92b){try{jsonpatch['apply'](_0x1bf92b,_0x3866d0,!![]);}catch(_0x297475){return BPromise[_0xe535('0x1a')](_0x297475);}return _0x1bf92b['save']();};}function saveUpdates(_0x6b6a79,_0x31bbcb){return function(_0x4946d5){if(_0x4946d5){return _0x4946d5['update'](_0x6b6a79)['then'](function(_0xcbffa2){return _0xcbffa2;});}return null;};}function removeEntity(_0x2936b5,_0x53b591){return function(_0x23a351){if(_0x23a351){return _0x23a351[_0xe535('0x1b')]()['then'](function(){_0x2936b5['status'](0xcc)[_0xe535('0x14')]();});}};}function handleEntityNotFound(_0x458876,_0x13fcb4){return function(_0x337565){if(!_0x337565){_0x458876[_0xe535('0x1c')](0x194);}return _0x337565;};}function handleError(_0x2ccc74,_0x206e65){_0x206e65=_0x206e65||0x1f4;return function(_0x232d30){logger['error'](_0x232d30[_0xe535('0x1d')]);if(_0x232d30[_0xe535('0x1e')]){delete _0x232d30[_0xe535('0x1e')];}_0x2ccc74[_0xe535('0x13')](_0x206e65)[_0xe535('0x1f')](_0x232d30);};}exports[_0xe535('0x20')]=function(_0x5b7ec5,_0xf96443){var _0x2415cd={},_0x3d7c86={},_0x7f46dd={'count':0x0,'rows':[]};var _0x34b778=_['map'](db[_0xe535('0x21')][_0xe535('0x22')],function(_0x3a6701){return{'name':_0x3a6701[_0xe535('0x23')],'type':_0x3a6701[_0xe535('0x24')]['key']};});_0x3d7c86['model']=_[_0xe535('0x25')](_0x34b778,'name');_0x3d7c86[_0xe535('0x26')]=_[_0xe535('0x27')](_0x5b7ec5[_0xe535('0x26')]);_0x3d7c86['filters']=_[_0xe535('0x28')](_0x3d7c86['model'],_0x3d7c86['query']);_0x2415cd[_0xe535('0x29')]=_['intersection'](_0x3d7c86[_0xe535('0x2a')],qs['fields'](_0x5b7ec5[_0xe535('0x26')]['fields']));_0x2415cd[_0xe535('0x29')]=_0x2415cd['attributes'][_0xe535('0x2b')]?_0x2415cd[_0xe535('0x29')]:_0x3d7c86[_0xe535('0x2a')];if(!_0x5b7ec5[_0xe535('0x26')]['hasOwnProperty'](_0xe535('0x2c'))){_0x2415cd['limit']=qs[_0xe535('0x18')](_0x5b7ec5[_0xe535('0x26')][_0xe535('0x18')]);_0x2415cd['offset']=qs[_0xe535('0x16')](_0x5b7ec5[_0xe535('0x26')][_0xe535('0x16')]);}_0x2415cd[_0xe535('0x2d')]=qs[_0xe535('0x2e')](_0x5b7ec5['query']['sort']);_0x2415cd['where']=qs['filters'](_[_0xe535('0x2f')](_0x5b7ec5[_0xe535('0x26')],_0x3d7c86[_0xe535('0x30')]),_0x34b778);if(_0x5b7ec5[_0xe535('0x26')]['filter']){_0x2415cd[_0xe535('0x31')]=_[_0xe535('0x32')](_0x2415cd['where'],{'$or':_[_0xe535('0x25')](_0x34b778,function(_0xa6bbe1){if(_0xa6bbe1['type']!==_0xe535('0x33')){var _0x1a0d08={};_0x1a0d08[_0xa6bbe1[_0xe535('0x1e')]]={'$like':'%'+_0x5b7ec5[_0xe535('0x26')][_0xe535('0x34')]+'%'};return _0x1a0d08;}})});}_0x2415cd=_[_0xe535('0x32')]({},_0x2415cd,_0x5b7ec5[_0xe535('0x35')]);var _0x46d861={'where':_0x2415cd['where']};return db[_0xe535('0x21')][_0xe535('0x19')](_0x46d861)[_0xe535('0x36')](function(_0x265b79){_0x7f46dd[_0xe535('0x19')]=_0x265b79;if(_0x5b7ec5[_0xe535('0x26')]['includeAll']){_0x2415cd['include']=[{'all':!![]}];}return db[_0xe535('0x21')][_0xe535('0x37')](_0x2415cd);})[_0xe535('0x36')](function(_0x4bb06e){_0x7f46dd['rows']=_0x4bb06e;return _0x7f46dd;})[_0xe535('0x36')](respondWithFilteredResult(_0xf96443,_0x2415cd))[_0xe535('0x38')](handleError(_0xf96443,null));};exports['show']=function(_0x30e83c,_0x3ee7a8){var _0x3b5aba={'raw':![],'where':{'id':_0x30e83c[_0xe535('0x39')]['id']}},_0x499071={};_0x499071[_0xe535('0x2a')]=_['keys'](db[_0xe535('0x21')][_0xe535('0x22')]);_0x499071[_0xe535('0x26')]=_[_0xe535('0x27')](_0x30e83c['query']);_0x499071['filters']=_[_0xe535('0x28')](_0x499071[_0xe535('0x2a')],_0x499071[_0xe535('0x26')]);_0x3b5aba[_0xe535('0x29')]=_[_0xe535('0x28')](_0x499071[_0xe535('0x2a')],qs[_0xe535('0x3a')](_0x30e83c[_0xe535('0x26')][_0xe535('0x3a')]));_0x3b5aba[_0xe535('0x29')]=_0x3b5aba[_0xe535('0x29')][_0xe535('0x2b')]?_0x3b5aba['attributes']:_0x499071[_0xe535('0x2a')];if(_0x30e83c[_0xe535('0x26')][_0xe535('0x3b')]){_0x3b5aba['include']=[{'all':!![]}];}_0x3b5aba=_[_0xe535('0x32')]({},_0x3b5aba,_0x30e83c[_0xe535('0x35')]);return db['AnalyticFieldReport'][_0xe535('0x3c')](_0x3b5aba)['then'](handleEntityNotFound(_0x3ee7a8,null))[_0xe535('0x36')](respondWithResult(_0x3ee7a8,null))[_0xe535('0x38')](handleError(_0x3ee7a8,null));};exports[_0xe535('0x3d')]=function(_0x4f1e95,_0x234267){return db[_0xe535('0x21')][_0xe535('0x3d')](_0x4f1e95['body'],{})[_0xe535('0x36')](respondWithResult(_0x234267,0xc9))[_0xe535('0x38')](handleError(_0x234267,null));};exports[_0xe535('0x3e')]=function(_0x398522,_0x416560){return db[_0xe535('0x21')][_0xe535('0x3e')](_0x398522[_0xe535('0x3f')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x416560,0xc9))[_0xe535('0x38')](handleError(_0x416560,null));};exports[_0xe535('0x40')]=function(_0xa02751,_0x237ee5){if(_0xa02751[_0xe535('0x3f')]['id']){delete _0xa02751[_0xe535('0x3f')]['id'];}return db[_0xe535('0x21')][_0xe535('0x3c')]({'where':{'id':_0xa02751['params']['id']}})['then'](handleEntityNotFound(_0x237ee5,null))[_0xe535('0x36')](saveUpdates(_0xa02751[_0xe535('0x3f')],null))[_0xe535('0x36')](respondWithResult(_0x237ee5,null))[_0xe535('0x38')](handleError(_0x237ee5,null));};exports[_0xe535('0x1b')]=function(_0x66e843,_0xdc8cc2){return db['AnalyticFieldReport'][_0xe535('0x3c')]({'where':{'id':_0x66e843[_0xe535('0x39')]['id']}})[_0xe535('0x36')](handleEntityNotFound(_0xdc8cc2,null))['then'](removeEntity(_0xdc8cc2,null))[_0xe535('0x38')](handleError(_0xdc8cc2,null));};exports[_0xe535('0x41')]=function(_0x16c597,_0x1c835b){return db[_0xe535('0x21')][_0xe535('0x1b')]({'where':{'id':_0x16c597[_0xe535('0x26')][_0xe535('0x42')]||[]},'raw':![],'individualHooks':!![]})[_0xe535('0x36')](respondWithResult(_0x1c835b,0xcc))[_0xe535('0x38')](handleError(_0x1c835b,null));};exports[_0xe535('0x43')]=function(_0x16fb66,_0x5d8566,_0xd6d10){return db['AnalyticCustomReport'][_0xe535('0x44')]({'where':{'id':_0x16fb66[_0xe535('0x39')]['id']}})[_0xe535('0x36')](handleEntityNotFound(_0x5d8566,null))['then'](function(_0x39e580){if(_0x39e580){return db[_0xe535('0x45')][_0xe535('0x46')](function(_0x278766){return db['AnalyticFieldReport'][_0xe535('0x1b')]({'where':{'CustomReportId':_0x16fb66[_0xe535('0x39')]['id']},'transaction':_0x278766})[_0xe535('0x36')](function(_0xdd7a7){var _0x41b37a=_['map'](_0x16fb66['body'],function(_0x48adb1){delete _0x48adb1['id'];_0x48adb1['CustomReportId']=_0x16fb66['params']['id'];return _0x48adb1;});return db[_0xe535('0x21')][_0xe535('0x3e')](_0x41b37a,{'transaction':_0x278766});});})[_0xe535('0x36')](function(){return db['AnalyticFieldReport'][_0xe535('0x37')]({'where':{'CustomReportId':_0x16fb66[_0xe535('0x39')]['id']}});});}})[_0xe535('0x36')](respondWithResult(_0x5d8566,null))[_0xe535('0x38')](handleError(_0x5d8566,null));};
\ No newline at end of file
+var _0x50ca=['../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','bulkCreate','bulkDestroy','destroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x125207,_0x4b176b){var _0x3e8804=function(_0x4ac9ae){while(--_0x4ac9ae){_0x125207['push'](_0x125207['shift']());}};_0x3e8804(++_0x4b176b);}(_0x50ca,0xe3));var _0xa50c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x50ca[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa50c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa50c('0x1'));var rp=require(_0xa50c('0x2'));var moment=require(_0xa50c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa50c('0x4'));var path=require(_0xa50c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa50c('0x6'));var fs=require('fs');var fs_extra=require(_0xa50c('0x7'));var _=require(_0xa50c('0x8'));var squel=require(_0xa50c('0x9'));var crypto=require(_0xa50c('0xa'));var jsforce=require(_0xa50c('0xb'));var deskjs=require(_0xa50c('0xc'));var toCsv=require(_0xa50c('0xd'));var querystring=require(_0xa50c('0xe'));var Papa=require(_0xa50c('0xf'));var Redis=require(_0xa50c('0x10'));var authService=require(_0xa50c('0x11'));var qs=require(_0xa50c('0x12'));var as=require(_0xa50c('0x13'));var hardwareService=require(_0xa50c('0x14'));var logger=require(_0xa50c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xa50c('0x16'));var licenseUtil=require(_0xa50c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b0818,_0x2902d2){_0x2902d2=_0x2902d2||0xcc;return function(_0x33d7a0){if(_0x33d7a0){return _0x1b0818[_0xa50c('0x18')](_0x2902d2);}return _0x1b0818[_0xa50c('0x19')](_0x2902d2)['end']();};}function respondWithResult(_0x1ffa05,_0x4438c0){_0x4438c0=_0x4438c0||0xc8;return function(_0x2009ce){if(_0x2009ce){return _0x1ffa05['status'](_0x4438c0)[_0xa50c('0x1a')](_0x2009ce);}};}function respondWithFilteredResult(_0x3cda12,_0x4c1453){return function(_0x174f51){if(_0x174f51){var _0x50a389=typeof _0x4c1453[_0xa50c('0x1b')]===_0xa50c('0x1c')&&typeof _0x4c1453[_0xa50c('0x1d')]===_0xa50c('0x1c');var _0x553bb8=_0x174f51['count'];var _0x5adf1e=_0x50a389?0x0:_0x4c1453[_0xa50c('0x1b')];var _0x2a8561=_0x50a389?_0x174f51[_0xa50c('0x1e')]:_0x4c1453[_0xa50c('0x1b')]+_0x4c1453['limit'];var _0xc3f35f;if(_0x2a8561>=_0x553bb8){_0x2a8561=_0x553bb8;_0xc3f35f=0xc8;}else{_0xc3f35f=0xce;}_0x3cda12[_0xa50c('0x19')](_0xc3f35f);return _0x3cda12[_0xa50c('0x1f')]('Content-Range',_0x5adf1e+'-'+_0x2a8561+'/'+_0x553bb8)[_0xa50c('0x1a')](_0x174f51);}return null;};}function patchUpdates(_0xf980cd){return function(_0xeeda7d){try{jsonpatch[_0xa50c('0x20')](_0xeeda7d,_0xf980cd,!![]);}catch(_0xbe35a4){return BPromise[_0xa50c('0x21')](_0xbe35a4);}return _0xeeda7d['save']();};}function saveUpdates(_0x1bfaa6,_0x57aa25){return function(_0x5132d8){if(_0x5132d8){return _0x5132d8[_0xa50c('0x22')](_0x1bfaa6)[_0xa50c('0x23')](function(_0x185695){return _0x185695;});}return null;};}function removeEntity(_0x566b57,_0x58da52){return function(_0x79229f){if(_0x79229f){return _0x79229f['destroy']()[_0xa50c('0x23')](function(){_0x566b57[_0xa50c('0x19')](0xcc)[_0xa50c('0x24')]();});}};}function handleEntityNotFound(_0x570b78,_0x3e85ae){return function(_0x5b8cf5){if(!_0x5b8cf5){_0x570b78[_0xa50c('0x18')](0x194);}return _0x5b8cf5;};}function handleError(_0x54611a,_0x1d307e){_0x1d307e=_0x1d307e||0x1f4;return function(_0x45b52c){logger[_0xa50c('0x25')](_0x45b52c[_0xa50c('0x26')]);if(_0x45b52c[_0xa50c('0x27')]){delete _0x45b52c[_0xa50c('0x27')];}_0x54611a[_0xa50c('0x19')](_0x1d307e)[_0xa50c('0x28')](_0x45b52c);};}exports[_0xa50c('0x29')]=function(_0x4efb98,_0x4c5543){var _0x1a2962={},_0xe159ef={},_0x4da853={'count':0x0,'rows':[]};var _0x2a7e0d=_[_0xa50c('0x2a')](db[_0xa50c('0x2b')][_0xa50c('0x2c')],function(_0x48cd0d){return{'name':_0x48cd0d[_0xa50c('0x2d')],'type':_0x48cd0d[_0xa50c('0x2e')][_0xa50c('0x2f')]};});_0xe159ef[_0xa50c('0x30')]=_[_0xa50c('0x2a')](_0x2a7e0d,_0xa50c('0x27'));_0xe159ef['query']=_[_0xa50c('0x31')](_0x4efb98[_0xa50c('0x32')]);_0xe159ef[_0xa50c('0x33')]=_[_0xa50c('0x34')](_0xe159ef[_0xa50c('0x30')],_0xe159ef[_0xa50c('0x32')]);_0x1a2962['attributes']=_['intersection'](_0xe159ef['model'],qs[_0xa50c('0x35')](_0x4efb98[_0xa50c('0x32')][_0xa50c('0x35')]));_0x1a2962[_0xa50c('0x36')]=_0x1a2962[_0xa50c('0x36')][_0xa50c('0x37')]?_0x1a2962[_0xa50c('0x36')]:_0xe159ef[_0xa50c('0x30')];if(!_0x4efb98[_0xa50c('0x32')]['hasOwnProperty'](_0xa50c('0x38'))){_0x1a2962['limit']=qs[_0xa50c('0x1d')](_0x4efb98['query'][_0xa50c('0x1d')]);_0x1a2962[_0xa50c('0x1b')]=qs[_0xa50c('0x1b')](_0x4efb98['query'][_0xa50c('0x1b')]);}_0x1a2962[_0xa50c('0x39')]=qs['sort'](_0x4efb98[_0xa50c('0x32')][_0xa50c('0x3a')]);_0x1a2962[_0xa50c('0x3b')]=qs[_0xa50c('0x33')](_[_0xa50c('0x3c')](_0x4efb98[_0xa50c('0x32')],_0xe159ef[_0xa50c('0x33')]),_0x2a7e0d);if(_0x4efb98[_0xa50c('0x32')]['filter']){_0x1a2962[_0xa50c('0x3b')]=_[_0xa50c('0x3d')](_0x1a2962['where'],{'$or':_['map'](_0x2a7e0d,function(_0x2a9fd7){if(_0x2a9fd7[_0xa50c('0x2e')]!==_0xa50c('0x3e')){var _0x248c85={};_0x248c85[_0x2a9fd7['name']]={'$like':'%'+_0x4efb98['query'][_0xa50c('0x3f')]+'%'};return _0x248c85;}})});}_0x1a2962=_['merge']({},_0x1a2962,_0x4efb98[_0xa50c('0x40')]);var _0x2bc3df={'where':_0x1a2962[_0xa50c('0x3b')]};return db['AnalyticFieldReport'][_0xa50c('0x1e')](_0x2bc3df)[_0xa50c('0x23')](function(_0x5371cd){_0x4da853[_0xa50c('0x1e')]=_0x5371cd;if(_0x4efb98[_0xa50c('0x32')][_0xa50c('0x41')]){_0x1a2962[_0xa50c('0x42')]=[{'all':!![]}];}return db[_0xa50c('0x2b')][_0xa50c('0x43')](_0x1a2962);})[_0xa50c('0x23')](function(_0x55977c){_0x4da853[_0xa50c('0x44')]=_0x55977c;return _0x4da853;})[_0xa50c('0x23')](respondWithFilteredResult(_0x4c5543,_0x1a2962))[_0xa50c('0x45')](handleError(_0x4c5543,null));};exports['show']=function(_0x2f7995,_0x2e2a3e){var _0x300ff4={'raw':![],'where':{'id':_0x2f7995[_0xa50c('0x46')]['id']}},_0x1852f0={};_0x1852f0[_0xa50c('0x30')]=_[_0xa50c('0x31')](db[_0xa50c('0x2b')][_0xa50c('0x2c')]);_0x1852f0[_0xa50c('0x32')]=_[_0xa50c('0x31')](_0x2f7995['query']);_0x1852f0[_0xa50c('0x33')]=_[_0xa50c('0x34')](_0x1852f0['model'],_0x1852f0['query']);_0x300ff4[_0xa50c('0x36')]=_[_0xa50c('0x34')](_0x1852f0['model'],qs[_0xa50c('0x35')](_0x2f7995[_0xa50c('0x32')][_0xa50c('0x35')]));_0x300ff4[_0xa50c('0x36')]=_0x300ff4[_0xa50c('0x36')][_0xa50c('0x37')]?_0x300ff4[_0xa50c('0x36')]:_0x1852f0['model'];if(_0x2f7995[_0xa50c('0x32')]['includeAll']){_0x300ff4[_0xa50c('0x42')]=[{'all':!![]}];}_0x300ff4=_[_0xa50c('0x3d')]({},_0x300ff4,_0x2f7995[_0xa50c('0x40')]);return db[_0xa50c('0x2b')][_0xa50c('0x47')](_0x300ff4)[_0xa50c('0x23')](handleEntityNotFound(_0x2e2a3e,null))[_0xa50c('0x23')](respondWithResult(_0x2e2a3e,null))[_0xa50c('0x45')](handleError(_0x2e2a3e,null));};exports[_0xa50c('0x48')]=function(_0x2af5f0,_0xf86b56){return db[_0xa50c('0x2b')][_0xa50c('0x48')](_0x2af5f0[_0xa50c('0x49')],{})['then'](respondWithResult(_0xf86b56,0xc9))[_0xa50c('0x45')](handleError(_0xf86b56,null));};exports[_0xa50c('0x4a')]=function(_0x1689ae,_0x3f7b79){return db['AnalyticFieldReport'][_0xa50c('0x4a')](_0x1689ae[_0xa50c('0x49')],{'raw':![],'individualHooks':!![]})[_0xa50c('0x23')](respondWithResult(_0x3f7b79,0xc9))[_0xa50c('0x45')](handleError(_0x3f7b79,null));};exports[_0xa50c('0x22')]=function(_0x25d770,_0x506a4a){if(_0x25d770['body']['id']){delete _0x25d770[_0xa50c('0x49')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x25d770[_0xa50c('0x46')]['id']}})[_0xa50c('0x23')](handleEntityNotFound(_0x506a4a,null))['then'](saveUpdates(_0x25d770[_0xa50c('0x49')],null))[_0xa50c('0x23')](respondWithResult(_0x506a4a,null))['catch'](handleError(_0x506a4a,null));};exports['destroy']=function(_0x1769e4,_0x4904bb){return db[_0xa50c('0x2b')][_0xa50c('0x47')]({'where':{'id':_0x1769e4[_0xa50c('0x46')]['id']}})[_0xa50c('0x23')](handleEntityNotFound(_0x4904bb,null))[_0xa50c('0x23')](removeEntity(_0x4904bb,null))['catch'](handleError(_0x4904bb,null));};exports[_0xa50c('0x4b')]=function(_0x45dffe,_0x38d2ed){return db['AnalyticFieldReport'][_0xa50c('0x4c')]({'where':{'id':_0x45dffe[_0xa50c('0x32')][_0xa50c('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0xa50c('0x23')](respondWithResult(_0x38d2ed,0xcc))[_0xa50c('0x45')](handleError(_0x38d2ed,null));};exports['addFields']=function(_0x1a1b28,_0x6a0670,_0x1ec333){return db[_0xa50c('0x4e')][_0xa50c('0x4f')]({'where':{'id':_0x1a1b28[_0xa50c('0x46')]['id']}})[_0xa50c('0x23')](handleEntityNotFound(_0x6a0670,null))['then'](function(_0x40141c){if(_0x40141c){return db[_0xa50c('0x50')][_0xa50c('0x51')](function(_0xa6243b){return db[_0xa50c('0x2b')][_0xa50c('0x4c')]({'where':{'CustomReportId':_0x1a1b28[_0xa50c('0x46')]['id']},'transaction':_0xa6243b})['then'](function(_0x3b6a5e){var _0x2bcf5b=_['map'](_0x1a1b28[_0xa50c('0x49')],function(_0x182bc0){delete _0x182bc0['id'];_0x182bc0[_0xa50c('0x52')]=_0x1a1b28['params']['id'];return _0x182bc0;});return db[_0xa50c('0x2b')][_0xa50c('0x4a')](_0x2bcf5b,{'transaction':_0xa6243b});});})['then'](function(){return db[_0xa50c('0x2b')][_0xa50c('0x43')]({'where':{'CustomReportId':_0x1a1b28[_0xa50c('0x46')]['id']}});});}})[_0xa50c('0x23')](respondWithResult(_0x6a0670,null))[_0xa50c('0x45')](handleError(_0x6a0670,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 206e1c7..cac02ea 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 _0xc247=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4408b8,_0x41014b){var _0x4671df=function(_0x420a4f){while(--_0x420a4f){_0x4408b8['push'](_0x4408b8['shift']());}};_0x4671df(++_0x41014b);}(_0xc247,0x1ac));var _0x7c24=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0xc247[_0x44216d];return _0xeca523;};'use strict';var _=require('lodash');var util=require(_0x7c24('0x0'));var logger=require(_0x7c24('0x1'))(_0x7c24('0x2'));var moment=require(_0x7c24('0x3'));var BPromise=require(_0x7c24('0x4'));var rp=require(_0x7c24('0x5'));var fs=require('fs');var path=require(_0x7c24('0x6'));var rimraf=require(_0x7c24('0x7'));var config=require(_0x7c24('0x8'));var attributes=require(_0x7c24('0x9'));module[_0x7c24('0xa')]=function(_0xbb4844,_0x7954c8){return _0xbb4844[_0x7c24('0xb')](_0x7c24('0xc'),attributes,{'tableName':_0x7c24('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ec2=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x545a02,_0x2efaab){var _0x70e3e=function(_0x3132a0){while(--_0x3132a0){_0x545a02['push'](_0x545a02['shift']());}};_0x70e3e(++_0x2efaab);}(_0x4ec2,0xd0));var _0x24ec=function(_0x1840ae,_0x3481a0){_0x1840ae=_0x1840ae-0x0;var _0x3478e4=_0x4ec2[_0x1840ae];return _0x3478e4;};'use strict';var _=require(_0x24ec('0x0'));var util=require(_0x24ec('0x1'));var logger=require(_0x24ec('0x2'))(_0x24ec('0x3'));var moment=require('moment');var BPromise=require(_0x24ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24ec('0x5'));var rimraf=require(_0x24ec('0x6'));var config=require(_0x24ec('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x24ec('0x8')]=function(_0x5798da,_0x50fb40){return _0x5798da[_0x24ec('0x9')](_0x24ec('0xa'),attributes,{'tableName':_0x24ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 629aaef..9eae410 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 _0xa0e0=['../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x434a78,_0x4b1332){var _0x431d6e=function(_0xa80eac){while(--_0xa80eac){_0x434a78['push'](_0x434a78['shift']());}};_0x431d6e(++_0x4b1332);}(_0xa0e0,0x1af));var _0x0a0e=function(_0x47e4ba,_0x1e7596){_0x47e4ba=_0x47e4ba-0x0;var _0x51b33a=_0xa0e0[_0x47e4ba];return _0x51b33a;};'use strict';var _=require(_0x0a0e('0x0'));var util=require(_0x0a0e('0x1'));var moment=require(_0x0a0e('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a0e('0x3'));var fs=require('fs');var Redis=require(_0x0a0e('0x4'));var db=require(_0x0a0e('0x5'))['db'];var utils=require(_0x0a0e('0x6'));var logger=require(_0x0a0e('0x7'))(_0x0a0e('0x8'));var config=require(_0x0a0e('0x9'));var jayson=require(_0x0a0e('0xa'));var client=jayson[_0x0a0e('0xb')][_0x0a0e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x8ef100,_0x3f6e6c,_0x217936){return new BPromise(function(_0x5f4d0e,_0x5f531c){return client['request'](_0x8ef100,_0x217936)[_0x0a0e('0xd')](function(_0x485b4c){logger[_0x0a0e('0xe')](_0x0a0e('0xf'),_0x3f6e6c,_0x0a0e('0x10'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3f6e6c,'request\x20sent',JSON[_0x0a0e('0x11')](_0x485b4c));if(_0x485b4c[_0x0a0e('0x12')]){if(_0x485b4c[_0x0a0e('0x12')]['code']===0x1f4){logger[_0x0a0e('0x12')](_0x0a0e('0xf'),_0x3f6e6c,_0x485b4c[_0x0a0e('0x12')][_0x0a0e('0x13')]);return _0x5f531c(_0x485b4c[_0x0a0e('0x12')][_0x0a0e('0x13')]);}logger['error'](_0x0a0e('0xf'),_0x3f6e6c,_0x485b4c[_0x0a0e('0x12')][_0x0a0e('0x13')]);return _0x5f4d0e(_0x485b4c[_0x0a0e('0x12')][_0x0a0e('0x13')]);}else{logger[_0x0a0e('0xe')](_0x0a0e('0xf'),_0x3f6e6c,_0x0a0e('0x10'));_0x5f4d0e(_0x485b4c[_0x0a0e('0x14')][_0x0a0e('0x13')]);}})[_0x0a0e('0x15')](function(_0x331ff7){logger[_0x0a0e('0x12')](_0x0a0e('0xf'),_0x3f6e6c,_0x331ff7);_0x5f531c(_0x331ff7);});});}
\ No newline at end of file
+var _0x5fc4=['error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','request\x20sent','stringify'];(function(_0x3401b2,_0x15187a){var _0x37ced6=function(_0x596f93){while(--_0x596f93){_0x3401b2['push'](_0x3401b2['shift']());}};_0x37ced6(++_0x15187a);}(_0x5fc4,0x8b));var _0x45fc=function(_0xdada58,_0x324249){_0xdada58=_0xdada58-0x0;var _0xa6b75a=_0x5fc4[_0xdada58];return _0xa6b75a;};'use strict';var _=require(_0x45fc('0x0'));var util=require(_0x45fc('0x1'));var moment=require(_0x45fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x45fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45fc('0x4'))['db'];var utils=require(_0x45fc('0x5'));var logger=require(_0x45fc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x45fc('0x7'));var client=jayson['client'][_0x45fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cf74d,_0x14a6aa,_0x553268){return new BPromise(function(_0x26c0a8,_0x3de375){return client[_0x45fc('0x9')](_0x2cf74d,_0x553268)[_0x45fc('0xa')](function(_0x1bf644){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x14a6aa,_0x45fc('0xb'));logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x14a6aa,_0x45fc('0xb'),JSON[_0x45fc('0xc')](_0x1bf644));if(_0x1bf644['error']){if(_0x1bf644[_0x45fc('0xd')][_0x45fc('0xe')]===0x1f4){logger[_0x45fc('0xd')](_0x45fc('0xf'),_0x14a6aa,_0x1bf644[_0x45fc('0xd')]['message']);return _0x3de375(_0x1bf644['error']['message']);}logger['error'](_0x45fc('0xf'),_0x14a6aa,_0x1bf644['error'][_0x45fc('0x10')]);return _0x26c0a8(_0x1bf644['error'][_0x45fc('0x10')]);}else{logger[_0x45fc('0x11')](_0x45fc('0xf'),_0x14a6aa,_0x45fc('0xb'));_0x26c0a8(_0x1bf644['result'][_0x45fc('0x10')]);}})[_0x45fc('0x12')](function(_0xceebc7){logger[_0x45fc('0xd')](_0x45fc('0xf'),_0x14a6aa,_0xceebc7);_0x3de375(_0xceebc7);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 74c7d58..8589d88 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(_0x3f4bef,_0x359a87){var _0x1989b7=function(_0xe0ffca){while(--_0xe0ffca){_0x3f4bef['push'](_0x3f4bef['shift']());}};_0x1989b7(++_0x359a87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x53b625,_0x1cef46){var _0x201d33=function(_0x52c775){while(--_0x52c775){_0x53b625['push'](_0x53b625['shift']());}};_0x201d33(++_0x1cef46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 ca251f5..f3892d6 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 _0xd110=['sequelize','exports','STRING','TEXT'];(function(_0x307547,_0x1a12bb){var _0x35bee3=function(_0x4d0499){while(--_0x4d0499){_0x307547['push'](_0x307547['shift']());}};_0x35bee3(++_0x1a12bb);}(_0xd110,0x1e8));var _0x0d11=function(_0x11163c,_0xa1514e){_0x11163c=_0x11163c-0x0;var _0x26b991=_0xd110[_0x11163c];return _0x26b991;};'use strict';var Sequelize=require(_0x0d11('0x0'));module[_0x0d11('0x1')]={'name':{'type':Sequelize[_0x0d11('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x0d11('0x2')]},'metric':{'type':Sequelize[_0x0d11('0x3')]},'description':{'type':Sequelize[_0x0d11('0x2')]}};
\ No newline at end of file
+var _0x96cc=['TEXT','sequelize','STRING'];(function(_0x5ace25,_0x536239){var _0x4ba17a=function(_0x1ee54e){while(--_0x1ee54e){_0x5ace25['push'](_0x5ace25['shift']());}};_0x4ba17a(++_0x536239);}(_0x96cc,0x16c));var _0xc96c=function(_0x44d4e9,_0x52d710){_0x44d4e9=_0x44d4e9-0x0;var _0x4c9bd2=_0x96cc[_0x44d4e9];return _0x4c9bd2;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'name':{'type':Sequelize[_0xc96c('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xc96c('0x1')]},'metric':{'type':Sequelize[_0xc96c('0x2')]},'description':{'type':Sequelize[_0xc96c('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 877cea9..9cb5bad 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 _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(_0x59517f,_0x5a7789){var _0x10f732=function(_0x125cb6){while(--_0x125cb6){_0x59517f['push'](_0x59517f['shift']());}};_0x10f732(++_0x5a7789);}(_0xe5b3,0x133));var _0x3e5b=function(_0x4af356,_0x298d74){_0x4af356=_0x4af356-0x0;var _0x40566=_0xe5b3[_0x4af356];return _0x40566;};'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
+var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x347ff5,_0x3f21c9){var _0x59756d=function(_0x1a8e6e){while(--_0x1a8e6e){_0x347ff5['push'](_0x347ff5['shift']());}};_0x59756d(++_0x3f21c9);}(_0xabce,0x103));var _0xeabc=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xabce[_0x53cf8e];return _0x459197;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 8118890..b4e9e26 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 _0x280b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util'];(function(_0x27236c,_0x4e81b6){var _0x325d41=function(_0x355313){while(--_0x355313){_0x27236c['push'](_0x27236c['shift']());}};_0x325d41(++_0x4e81b6);}(_0x280b,0xce));var _0xb280=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x280b[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var logger=require('../../config/logger')(_0xb280('0x2'));var moment=require(_0xb280('0x3'));var BPromise=require(_0xb280('0x4'));var rp=require(_0xb280('0x5'));var fs=require('fs');var path=require(_0xb280('0x6'));var rimraf=require(_0xb280('0x7'));var config=require(_0xb280('0x8'));var attributes=require(_0xb280('0x9'));module[_0xb280('0xa')]=function(_0x5d1991,_0x4d1b2e){return _0x5d1991[_0xb280('0xb')](_0xb280('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x06f4=['lodash','util','api','moment','path','../../config/environment','./analyticMetric.attributes','exports','define','analytics_metrics'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x06f4,0x136));var _0x406f=function(_0x555e42,_0x89260a){_0x555e42=_0x555e42-0x0;var _0x1ec74e=_0x06f4[_0x555e42];return _0x1ec74e;};'use strict';var _=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var logger=require('../../config/logger')(_0x406f('0x2'));var moment=require(_0x406f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x406f('0x4'));var rimraf=require('rimraf');var config=require(_0x406f('0x5'));var attributes=require(_0x406f('0x6'));module[_0x406f('0x7')]=function(_0x32b2bd,_0x59821c){return _0x32b2bd[_0x406f('0x8')]('AnalyticMetric',attributes,{'tableName':_0x406f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 81e6198..18248a2 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 _0xaed1=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0xaed1,0x135));var _0x1aed=function(_0x384b64,_0x4f0784){_0x384b64=_0x384b64-0x0;var _0x3a8f2c=_0xaed1[_0x384b64];return _0x3a8f2c;};'use strict';var _=require('lodash');var util=require(_0x1aed('0x0'));var moment=require(_0x1aed('0x1'));var BPromise=require(_0x1aed('0x2'));var rs=require(_0x1aed('0x3'));var fs=require('fs');var Redis=require(_0x1aed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1aed('0x5'));var logger=require(_0x1aed('0x6'))(_0x1aed('0x7'));var config=require(_0x1aed('0x8'));var jayson=require(_0x1aed('0x9'));var client=jayson[_0x1aed('0xa')][_0x1aed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cf800,_0x23db52,_0x43af06){return new BPromise(function(_0x181b62,_0x26bfdb){return client[_0x1aed('0xc')](_0x4cf800,_0x43af06)[_0x1aed('0xd')](function(_0x2d7e41){logger[_0x1aed('0xe')](_0x1aed('0xf'),_0x23db52,_0x1aed('0x10'));logger[_0x1aed('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x23db52,_0x1aed('0x10'),JSON[_0x1aed('0x12')](_0x2d7e41));if(_0x2d7e41['error']){if(_0x2d7e41[_0x1aed('0x13')][_0x1aed('0x14')]===0x1f4){logger[_0x1aed('0x13')](_0x1aed('0xf'),_0x23db52,_0x2d7e41[_0x1aed('0x13')]['message']);return _0x26bfdb(_0x2d7e41['error']['message']);}logger[_0x1aed('0x13')](_0x1aed('0xf'),_0x23db52,_0x2d7e41['error']['message']);return _0x181b62(_0x2d7e41[_0x1aed('0x13')][_0x1aed('0x15')]);}else{logger[_0x1aed('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x23db52,_0x1aed('0x10'));_0x181b62(_0x2d7e41[_0x1aed('0x16')][_0x1aed('0x15')]);}})['catch'](function(_0x51d0b9){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x23db52,_0x51d0b9);_0x26bfdb(_0x51d0b9);});});}
\ No newline at end of file
+var _0x4953=['lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4953,0x104));var _0x3495=function(_0x4eb48b,_0x4f3eb1){_0x4eb48b=_0x4eb48b-0x0;var _0x4f5180=_0x4953[_0x4eb48b];return _0x4f5180;};'use strict';var _=require(_0x3495('0x0'));var util=require(_0x3495('0x1'));var moment=require(_0x3495('0x2'));var BPromise=require('bluebird');var rs=require(_0x3495('0x3'));var fs=require('fs');var Redis=require(_0x3495('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3495('0x5'));var config=require(_0x3495('0x6'));var jayson=require(_0x3495('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x473205,_0x54c927,_0x4953ff){return new BPromise(function(_0x5e60af,_0x1baa0a){return client['request'](_0x473205,_0x4953ff)[_0x3495('0x8')](function(_0x327a22){logger[_0x3495('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x54c927,_0x3495('0xa'));logger[_0x3495('0xb')](_0x3495('0xc'),_0x54c927,_0x3495('0xa'),JSON[_0x3495('0xd')](_0x327a22));if(_0x327a22[_0x3495('0xe')]){if(_0x327a22[_0x3495('0xe')][_0x3495('0xf')]===0x1f4){logger[_0x3495('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x54c927,_0x327a22['error'][_0x3495('0x10')]);return _0x1baa0a(_0x327a22[_0x3495('0xe')][_0x3495('0x10')]);}logger[_0x3495('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x54c927,_0x327a22[_0x3495('0xe')]['message']);return _0x5e60af(_0x327a22[_0x3495('0xe')]['message']);}else{logger['info'](_0x3495('0x11'),_0x54c927,_0x3495('0xa'));_0x5e60af(_0x327a22[_0x3495('0x12')][_0x3495('0x10')]);}})[_0x3495('0x13')](function(_0x254cb2){logger[_0x3495('0xe')](_0x3495('0x11'),_0x54c927,_0x254cb2);_0x1baa0a(_0x254cb2);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 53f3592..e0a5db8 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 _0x0958=['create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x4e468f,_0x1489a2){var _0x32edaf=function(_0x2e8cf3){while(--_0x2e8cf3){_0x4e468f['push'](_0x4e468f['shift']());}};_0x32edaf(++_0x1489a2);}(_0x0958,0x7c));var _0x8095=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0958[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8095('0x0'));var util=require(_0x8095('0x1'));var path=require(_0x8095('0x2'));var timeout=require('connect-timeout');var express=require(_0x8095('0x3'));var router=express[_0x8095('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8095('0x5'));var config=require(_0x8095('0x6'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x8095('0x7')](),controller[_0x8095('0x8')]);router[_0x8095('0x9')](_0x8095('0xa'),auth[_0x8095('0x7')](),controller['show']);router['post']('/',auth[_0x8095('0x7')](),controller[_0x8095('0xb')]);router['put']('/:id',auth[_0x8095('0x7')](),controller['update']);router[_0x8095('0xc')](_0x8095('0xa'),auth[_0x8095('0x7')](),controller[_0x8095('0xd')]);module[_0x8095('0xe')]=router;
\ No newline at end of file
+var _0xee14=['get','/:id','show','post','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xee14,0x13a));var _0x4ee1=function(_0x32b25e,_0x5cb3f9){_0x32b25e=_0x32b25e-0x0;var _0x2acbc7=_0xee14[_0x32b25e];return _0x2acbc7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get']('/',auth[_0x4ee1('0x9')](),controller['index']);router[_0x4ee1('0xa')](_0x4ee1('0xb'),auth[_0x4ee1('0x9')](),controller[_0x4ee1('0xc')]);router[_0x4ee1('0xd')]('/',auth[_0x4ee1('0x9')](),controller['create']);router[_0x4ee1('0xe')](_0x4ee1('0xb'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')](_0x4ee1('0xb'),auth[_0x4ee1('0x9')](),controller['destroy']);module[_0x4ee1('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 f04335d..abc92ca 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 _0x8002=['TEXT','sequelize','exports'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x8002,0xa0));var _0x2800=function(_0x4f6f0b,_0xc26047){_0x4f6f0b=_0x4f6f0b-0x0;var _0x518ed2=_0x8002[_0x4f6f0b];return _0x518ed2;};'use strict';var Sequelize=require(_0x2800('0x0'));module[_0x2800('0x1')]={'tree':{'type':Sequelize[_0x2800('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xb30b=['exports','TEXT'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb30b,0xf4));var _0xbb30=function(_0x2e0938,_0x2e20f0){_0x2e0938=_0x2e0938-0x0;var _0x1691d3=_0xb30b[_0x2e0938];return _0x1691d3;};'use strict';var Sequelize=require('sequelize');module[_0xbb30('0x0')]={'tree':{'type':Sequelize[_0xbb30('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index fa8622f..ed8e07f 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 _0x4a00=['update','then','destroy','error','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','include','findAll','rows','params','includeAll','merge','options','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x53d5c6,_0x4cbc4d){var _0xd6e91a=function(_0x517a2f){while(--_0x517a2f){_0x53d5c6['push'](_0x53d5c6['shift']());}};_0xd6e91a(++_0x4cbc4d);}(_0x4a00,0x192));var _0x04a0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4a00[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04a0('0x0'));var zipdir=require(_0x04a0('0x1'));var jsonpatch=require(_0x04a0('0x2'));var rp=require(_0x04a0('0x3'));var moment=require('moment');var BPromise=require(_0x04a0('0x4'));var Mustache=require(_0x04a0('0x5'));var util=require(_0x04a0('0x6'));var path=require(_0x04a0('0x7'));var sox=require(_0x04a0('0x8'));var csv=require(_0x04a0('0x9'));var ejs=require(_0x04a0('0xa'));var fs=require('fs');var fs_extra=require(_0x04a0('0xb'));var _=require(_0x04a0('0xc'));var squel=require(_0x04a0('0xd'));var crypto=require(_0x04a0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x04a0('0xf'));var toCsv=require(_0x04a0('0x9'));var querystring=require(_0x04a0('0x10'));var Papa=require(_0x04a0('0x11'));var Redis=require(_0x04a0('0x12'));var authService=require(_0x04a0('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x04a0('0x14'));var config=require(_0x04a0('0x15'));var licenseUtil=require(_0x04a0('0x16'));var db=require(_0x04a0('0x17'))['db'];function respondWithStatusCode(_0x54d360,_0x4280c8){_0x4280c8=_0x4280c8||0xcc;return function(_0xd3bc9b){if(_0xd3bc9b){return _0x54d360[_0x04a0('0x18')](_0x4280c8);}return _0x54d360[_0x04a0('0x19')](_0x4280c8)['end']();};}function respondWithResult(_0x20d3ab,_0x286aa4){_0x286aa4=_0x286aa4||0xc8;return function(_0x2454cb){if(_0x2454cb){return _0x20d3ab[_0x04a0('0x19')](_0x286aa4)[_0x04a0('0x1a')](_0x2454cb);}};}function respondWithFilteredResult(_0x3d4036,_0x1d9261){return function(_0x540702){if(_0x540702){var _0x83546=typeof _0x1d9261[_0x04a0('0x1b')]===_0x04a0('0x1c')&&typeof _0x1d9261[_0x04a0('0x1d')]===_0x04a0('0x1c');var _0x367915=_0x540702[_0x04a0('0x1e')];var _0x318b8a=_0x83546?0x0:_0x1d9261[_0x04a0('0x1b')];var _0x3883a5=_0x83546?_0x540702['count']:_0x1d9261[_0x04a0('0x1b')]+_0x1d9261['limit'];var _0x4515fd;if(_0x3883a5>=_0x367915){_0x3883a5=_0x367915;_0x4515fd=0xc8;}else{_0x4515fd=0xce;}_0x3d4036[_0x04a0('0x19')](_0x4515fd);return _0x3d4036[_0x04a0('0x1f')](_0x04a0('0x20'),_0x318b8a+'-'+_0x3883a5+'/'+_0x367915)[_0x04a0('0x1a')](_0x540702);}return null;};}function patchUpdates(_0x50847e){return function(_0x5d8dda){try{jsonpatch[_0x04a0('0x21')](_0x5d8dda,_0x50847e,!![]);}catch(_0x18693a){return BPromise[_0x04a0('0x22')](_0x18693a);}return _0x5d8dda[_0x04a0('0x23')]();};}function saveUpdates(_0x33163a,_0x54bae0){return function(_0x213295){if(_0x213295){return _0x213295[_0x04a0('0x24')](_0x33163a)[_0x04a0('0x25')](function(_0x4a5e83){return _0x4a5e83;});}return null;};}function removeEntity(_0x454b15,_0x406aae){return function(_0x4a9f67){if(_0x4a9f67){return _0x4a9f67[_0x04a0('0x26')]()[_0x04a0('0x25')](function(){_0x454b15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45eb59,_0x5be87d){return function(_0x2bd02a){if(!_0x2bd02a){_0x45eb59[_0x04a0('0x18')](0x194);}return _0x2bd02a;};}function handleError(_0x5a15ba,_0x164636){_0x164636=_0x164636||0x1f4;return function(_0x45c350){logger[_0x04a0('0x27')](_0x45c350['stack']);if(_0x45c350[_0x04a0('0x28')]){delete _0x45c350['name'];}_0x5a15ba[_0x04a0('0x19')](_0x164636)[_0x04a0('0x29')](_0x45c350);};}exports['index']=function(_0x269752,_0x209ba3){var _0x2bd19f={},_0xf8ba1d={},_0x4160fa={'count':0x0,'rows':[]};var _0x15d509=_[_0x04a0('0x2a')](db[_0x04a0('0x2b')][_0x04a0('0x2c')],function(_0x5b9d15){return{'name':_0x5b9d15[_0x04a0('0x2d')],'type':_0x5b9d15[_0x04a0('0x2e')][_0x04a0('0x2f')]};});_0xf8ba1d[_0x04a0('0x30')]=_[_0x04a0('0x2a')](_0x15d509,_0x04a0('0x28'));_0xf8ba1d['query']=_[_0x04a0('0x31')](_0x269752[_0x04a0('0x32')]);_0xf8ba1d[_0x04a0('0x33')]=_['intersection'](_0xf8ba1d['model'],_0xf8ba1d[_0x04a0('0x32')]);_0x2bd19f[_0x04a0('0x34')]=_[_0x04a0('0x35')](_0xf8ba1d[_0x04a0('0x30')],qs[_0x04a0('0x36')](_0x269752[_0x04a0('0x32')]['fields']));_0x2bd19f['attributes']=_0x2bd19f[_0x04a0('0x34')][_0x04a0('0x37')]?_0x2bd19f[_0x04a0('0x34')]:_0xf8ba1d[_0x04a0('0x30')];if(!_0x269752['query'][_0x04a0('0x38')](_0x04a0('0x39'))){_0x2bd19f[_0x04a0('0x1d')]=qs[_0x04a0('0x1d')](_0x269752[_0x04a0('0x32')][_0x04a0('0x1d')]);_0x2bd19f[_0x04a0('0x1b')]=qs[_0x04a0('0x1b')](_0x269752[_0x04a0('0x32')][_0x04a0('0x1b')]);}_0x2bd19f[_0x04a0('0x3a')]=qs[_0x04a0('0x3b')](_0x269752['query']['sort']);_0x2bd19f[_0x04a0('0x3c')]=qs[_0x04a0('0x33')](_[_0x04a0('0x3d')](_0x269752[_0x04a0('0x32')],_0xf8ba1d['filters']),_0x15d509);if(_0x269752['query'][_0x04a0('0x3e')]){_0x2bd19f['where']=_['merge'](_0x2bd19f['where'],{'$or':_['map'](_0x15d509,function(_0x1707fb){if(_0x1707fb[_0x04a0('0x2e')]!=='VIRTUAL'){var _0x5207a9={};_0x5207a9[_0x1707fb[_0x04a0('0x28')]]={'$like':'%'+_0x269752[_0x04a0('0x32')][_0x04a0('0x3e')]+'%'};return _0x5207a9;}})});}_0x2bd19f=_['merge']({},_0x2bd19f,_0x269752['options']);var _0x2262d4={'where':_0x2bd19f[_0x04a0('0x3c')]};return db[_0x04a0('0x2b')][_0x04a0('0x1e')](_0x2262d4)[_0x04a0('0x25')](function(_0x1dcd2){_0x4160fa[_0x04a0('0x1e')]=_0x1dcd2;if(_0x269752[_0x04a0('0x32')]['includeAll']){_0x2bd19f[_0x04a0('0x3f')]=[{'all':!![]}];}return db[_0x04a0('0x2b')][_0x04a0('0x40')](_0x2bd19f);})['then'](function(_0x43a21a){_0x4160fa[_0x04a0('0x41')]=_0x43a21a;return _0x4160fa;})['then'](respondWithFilteredResult(_0x209ba3,_0x2bd19f))['catch'](handleError(_0x209ba3,null));};exports['show']=function(_0x2015eb,_0x4f54fe){var _0x197802={'raw':!![],'where':{'id':_0x2015eb[_0x04a0('0x42')]['id']}},_0x11e212={};_0x11e212['model']=_[_0x04a0('0x31')](db['AnalyticTreeReport'][_0x04a0('0x2c')]);_0x11e212['query']=_[_0x04a0('0x31')](_0x2015eb['query']);_0x11e212[_0x04a0('0x33')]=_[_0x04a0('0x35')](_0x11e212[_0x04a0('0x30')],_0x11e212[_0x04a0('0x32')]);_0x197802[_0x04a0('0x34')]=_[_0x04a0('0x35')](_0x11e212['model'],qs[_0x04a0('0x36')](_0x2015eb[_0x04a0('0x32')][_0x04a0('0x36')]));_0x197802['attributes']=_0x197802['attributes'][_0x04a0('0x37')]?_0x197802[_0x04a0('0x34')]:_0x11e212[_0x04a0('0x30')];if(_0x2015eb[_0x04a0('0x32')][_0x04a0('0x43')]){_0x197802['include']=[{'all':!![]}];}_0x197802=_[_0x04a0('0x44')]({},_0x197802,_0x2015eb[_0x04a0('0x45')]);return db[_0x04a0('0x2b')]['find'](_0x197802)[_0x04a0('0x25')](handleEntityNotFound(_0x4f54fe,null))[_0x04a0('0x25')](respondWithResult(_0x4f54fe,null))['catch'](handleError(_0x4f54fe,null));};exports['create']=function(_0x42c273,_0x3b5125){return db['AnalyticTreeReport'][_0x04a0('0x46')](_0x42c273[_0x04a0('0x47')],{})['then'](respondWithResult(_0x3b5125,0xc9))[_0x04a0('0x48')](handleError(_0x3b5125,null));};exports[_0x04a0('0x24')]=function(_0x44c38c,_0x17f739){if(_0x44c38c[_0x04a0('0x47')]['id']){delete _0x44c38c[_0x04a0('0x47')]['id'];}return db[_0x04a0('0x2b')]['find']({'where':{'id':_0x44c38c[_0x04a0('0x42')]['id']}})[_0x04a0('0x25')](handleEntityNotFound(_0x17f739,null))[_0x04a0('0x25')](saveUpdates(_0x44c38c[_0x04a0('0x47')],null))[_0x04a0('0x25')](respondWithResult(_0x17f739,null))[_0x04a0('0x48')](handleError(_0x17f739,null));};exports[_0x04a0('0x26')]=function(_0x3cba97,_0x93bc1d){return db[_0x04a0('0x2b')]['find']({'where':{'id':_0x3cba97[_0x04a0('0x42')]['id']}})[_0x04a0('0x25')](handleEntityNotFound(_0x93bc1d,null))[_0x04a0('0x25')](removeEntity(_0x93bc1d,null))[_0x04a0('0x48')](handleError(_0x93bc1d,null));};
\ No newline at end of file
+var _0x5a19=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','findAll','rows','catch','params','include','find','create','body','update','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','model','query','keys'];(function(_0x3ad102,_0x59058a){var _0x279219=function(_0x450267){while(--_0x450267){_0x3ad102['push'](_0x3ad102['shift']());}};_0x279219(++_0x59058a);}(_0x5a19,0xf1));var _0x95a1=function(_0x4d5d0a,_0x4148dd){_0x4d5d0a=_0x4d5d0a-0x0;var _0x502c59=_0x5a19[_0x4d5d0a];return _0x502c59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x95a1('0x0'));var rp=require(_0x95a1('0x1'));var moment=require(_0x95a1('0x2'));var BPromise=require(_0x95a1('0x3'));var Mustache=require(_0x95a1('0x4'));var util=require('util');var path=require(_0x95a1('0x5'));var sox=require(_0x95a1('0x6'));var csv=require(_0x95a1('0x7'));var ejs=require(_0x95a1('0x8'));var fs=require('fs');var fs_extra=require(_0x95a1('0x9'));var _=require(_0x95a1('0xa'));var squel=require(_0x95a1('0xb'));var crypto=require(_0x95a1('0xc'));var jsforce=require(_0x95a1('0xd'));var deskjs=require(_0x95a1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x95a1('0xf'));var Papa=require('papaparse');var Redis=require(_0x95a1('0x10'));var authService=require(_0x95a1('0x11'));var qs=require(_0x95a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95a1('0x13'));var logger=require('../../config/logger')(_0x95a1('0x14'));var utils=require(_0x95a1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x95a1('0x16'));var db=require(_0x95a1('0x17'))['db'];function respondWithStatusCode(_0x59c259,_0x5c2146){_0x5c2146=_0x5c2146||0xcc;return function(_0x31abe8){if(_0x31abe8){return _0x59c259[_0x95a1('0x18')](_0x5c2146);}return _0x59c259[_0x95a1('0x19')](_0x5c2146)[_0x95a1('0x1a')]();};}function respondWithResult(_0x4a92af,_0x39d196){_0x39d196=_0x39d196||0xc8;return function(_0x44bbb3){if(_0x44bbb3){return _0x4a92af[_0x95a1('0x19')](_0x39d196)['json'](_0x44bbb3);}};}function respondWithFilteredResult(_0x3fd668,_0x1591c3){return function(_0x188bb0){if(_0x188bb0){var _0x360f77=typeof _0x1591c3[_0x95a1('0x1b')]===_0x95a1('0x1c')&&typeof _0x1591c3[_0x95a1('0x1d')]==='undefined';var _0x1efa32=_0x188bb0[_0x95a1('0x1e')];var _0x461f0a=_0x360f77?0x0:_0x1591c3[_0x95a1('0x1b')];var _0x698f0e=_0x360f77?_0x188bb0['count']:_0x1591c3[_0x95a1('0x1b')]+_0x1591c3[_0x95a1('0x1d')];var _0x431c71;if(_0x698f0e>=_0x1efa32){_0x698f0e=_0x1efa32;_0x431c71=0xc8;}else{_0x431c71=0xce;}_0x3fd668['status'](_0x431c71);return _0x3fd668[_0x95a1('0x1f')](_0x95a1('0x20'),_0x461f0a+'-'+_0x698f0e+'/'+_0x1efa32)['json'](_0x188bb0);}return null;};}function patchUpdates(_0x558c16){return function(_0x43b964){try{jsonpatch[_0x95a1('0x21')](_0x43b964,_0x558c16,!![]);}catch(_0xaed437){return BPromise['reject'](_0xaed437);}return _0x43b964[_0x95a1('0x22')]();};}function saveUpdates(_0x34d696,_0x3ba06f){return function(_0x2c2723){if(_0x2c2723){return _0x2c2723['update'](_0x34d696)[_0x95a1('0x23')](function(_0x5a03df){return _0x5a03df;});}return null;};}function removeEntity(_0x5a75d5,_0x19cbf7){return function(_0x29a970){if(_0x29a970){return _0x29a970[_0x95a1('0x24')]()[_0x95a1('0x23')](function(){_0x5a75d5['status'](0xcc)[_0x95a1('0x1a')]();});}};}function handleEntityNotFound(_0x18a825,_0x45d8b1){return function(_0x300095){if(!_0x300095){_0x18a825[_0x95a1('0x18')](0x194);}return _0x300095;};}function handleError(_0x1cc292,_0x79e128){_0x79e128=_0x79e128||0x1f4;return function(_0x4a6d5e){logger[_0x95a1('0x25')](_0x4a6d5e[_0x95a1('0x26')]);if(_0x4a6d5e[_0x95a1('0x27')]){delete _0x4a6d5e[_0x95a1('0x27')];}_0x1cc292['status'](_0x79e128)[_0x95a1('0x28')](_0x4a6d5e);};}exports[_0x95a1('0x29')]=function(_0x2bf9dc,_0x21bef0){var _0x13ec8c={},_0x4d8e7b={},_0x4e1a76={'count':0x0,'rows':[]};var _0x4bbc11=_['map'](db[_0x95a1('0x2a')][_0x95a1('0x2b')],function(_0x16d447){return{'name':_0x16d447['fieldName'],'type':_0x16d447['type']['key']};});_0x4d8e7b[_0x95a1('0x2c')]=_['map'](_0x4bbc11,_0x95a1('0x27'));_0x4d8e7b[_0x95a1('0x2d')]=_[_0x95a1('0x2e')](_0x2bf9dc[_0x95a1('0x2d')]);_0x4d8e7b[_0x95a1('0x2f')]=_[_0x95a1('0x30')](_0x4d8e7b[_0x95a1('0x2c')],_0x4d8e7b[_0x95a1('0x2d')]);_0x13ec8c['attributes']=_[_0x95a1('0x30')](_0x4d8e7b[_0x95a1('0x2c')],qs[_0x95a1('0x31')](_0x2bf9dc[_0x95a1('0x2d')][_0x95a1('0x31')]));_0x13ec8c[_0x95a1('0x32')]=_0x13ec8c[_0x95a1('0x32')][_0x95a1('0x33')]?_0x13ec8c[_0x95a1('0x32')]:_0x4d8e7b[_0x95a1('0x2c')];if(!_0x2bf9dc[_0x95a1('0x2d')][_0x95a1('0x34')](_0x95a1('0x35'))){_0x13ec8c['limit']=qs['limit'](_0x2bf9dc[_0x95a1('0x2d')][_0x95a1('0x1d')]);_0x13ec8c[_0x95a1('0x1b')]=qs[_0x95a1('0x1b')](_0x2bf9dc[_0x95a1('0x2d')][_0x95a1('0x1b')]);}_0x13ec8c[_0x95a1('0x36')]=qs[_0x95a1('0x37')](_0x2bf9dc[_0x95a1('0x2d')]['sort']);_0x13ec8c['where']=qs['filters'](_[_0x95a1('0x38')](_0x2bf9dc[_0x95a1('0x2d')],_0x4d8e7b['filters']),_0x4bbc11);if(_0x2bf9dc[_0x95a1('0x2d')][_0x95a1('0x39')]){_0x13ec8c[_0x95a1('0x3a')]=_[_0x95a1('0x3b')](_0x13ec8c[_0x95a1('0x3a')],{'$or':_['map'](_0x4bbc11,function(_0x2772b5){if(_0x2772b5[_0x95a1('0x3c')]!=='VIRTUAL'){var _0x32eac0={};_0x32eac0[_0x2772b5[_0x95a1('0x27')]]={'$like':'%'+_0x2bf9dc[_0x95a1('0x2d')][_0x95a1('0x39')]+'%'};return _0x32eac0;}})});}_0x13ec8c=_[_0x95a1('0x3b')]({},_0x13ec8c,_0x2bf9dc[_0x95a1('0x3d')]);var _0xe24899={'where':_0x13ec8c[_0x95a1('0x3a')]};return db[_0x95a1('0x2a')][_0x95a1('0x1e')](_0xe24899)['then'](function(_0x2e58ce){_0x4e1a76[_0x95a1('0x1e')]=_0x2e58ce;if(_0x2bf9dc[_0x95a1('0x2d')][_0x95a1('0x3e')]){_0x13ec8c['include']=[{'all':!![]}];}return db[_0x95a1('0x2a')][_0x95a1('0x3f')](_0x13ec8c);})[_0x95a1('0x23')](function(_0x524901){_0x4e1a76[_0x95a1('0x40')]=_0x524901;return _0x4e1a76;})[_0x95a1('0x23')](respondWithFilteredResult(_0x21bef0,_0x13ec8c))[_0x95a1('0x41')](handleError(_0x21bef0,null));};exports['show']=function(_0x111861,_0x216a33){var _0x1ea231={'raw':!![],'where':{'id':_0x111861[_0x95a1('0x42')]['id']}},_0x2b3d52={};_0x2b3d52[_0x95a1('0x2c')]=_[_0x95a1('0x2e')](db['AnalyticTreeReport']['rawAttributes']);_0x2b3d52[_0x95a1('0x2d')]=_[_0x95a1('0x2e')](_0x111861[_0x95a1('0x2d')]);_0x2b3d52['filters']=_['intersection'](_0x2b3d52[_0x95a1('0x2c')],_0x2b3d52[_0x95a1('0x2d')]);_0x1ea231[_0x95a1('0x32')]=_[_0x95a1('0x30')](_0x2b3d52[_0x95a1('0x2c')],qs[_0x95a1('0x31')](_0x111861['query'][_0x95a1('0x31')]));_0x1ea231[_0x95a1('0x32')]=_0x1ea231[_0x95a1('0x32')]['length']?_0x1ea231['attributes']:_0x2b3d52[_0x95a1('0x2c')];if(_0x111861[_0x95a1('0x2d')][_0x95a1('0x3e')]){_0x1ea231[_0x95a1('0x43')]=[{'all':!![]}];}_0x1ea231=_[_0x95a1('0x3b')]({},_0x1ea231,_0x111861[_0x95a1('0x3d')]);return db[_0x95a1('0x2a')][_0x95a1('0x44')](_0x1ea231)[_0x95a1('0x23')](handleEntityNotFound(_0x216a33,null))[_0x95a1('0x23')](respondWithResult(_0x216a33,null))[_0x95a1('0x41')](handleError(_0x216a33,null));};exports['create']=function(_0x4a999e,_0x514f65){return db[_0x95a1('0x2a')][_0x95a1('0x45')](_0x4a999e[_0x95a1('0x46')],{})['then'](respondWithResult(_0x514f65,0xc9))['catch'](handleError(_0x514f65,null));};exports[_0x95a1('0x47')]=function(_0x4b717a,_0xd8b05){if(_0x4b717a['body']['id']){delete _0x4b717a[_0x95a1('0x46')]['id'];}return db[_0x95a1('0x2a')][_0x95a1('0x44')]({'where':{'id':_0x4b717a[_0x95a1('0x42')]['id']}})[_0x95a1('0x23')](handleEntityNotFound(_0xd8b05,null))['then'](saveUpdates(_0x4b717a[_0x95a1('0x46')],null))[_0x95a1('0x23')](respondWithResult(_0xd8b05,null))['catch'](handleError(_0xd8b05,null));};exports[_0x95a1('0x24')]=function(_0x3c4262,_0x2ed86e){return db[_0x95a1('0x2a')]['find']({'where':{'id':_0x3c4262[_0x95a1('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ed86e,null))[_0x95a1('0x23')](removeEntity(_0x2ed86e,null))[_0x95a1('0x41')](handleError(_0x2ed86e,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 9bdf34f..6ef3071 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 _0xecc5=['lodash','api','moment','bluebird','path','../../config/environment','define','AnalyticTreeReport'];(function(_0x18528a,_0x4de7d1){var _0x2c3214=function(_0x1b9ff8){while(--_0x1b9ff8){_0x18528a['push'](_0x18528a['shift']());}};_0x2c3214(++_0x4de7d1);}(_0xecc5,0xf8));var _0x5ecc=function(_0x379271,_0x272069){_0x379271=_0x379271-0x0;var _0x597bf4=_0xecc5[_0x379271];return _0x597bf4;};'use strict';var _=require(_0x5ecc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5ecc('0x1'));var moment=require(_0x5ecc('0x2'));var BPromise=require(_0x5ecc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ecc('0x4'));var rimraf=require('rimraf');var config=require(_0x5ecc('0x5'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x1901fe,_0x4e134e){return _0x1901fe[_0x5ecc('0x6')](_0x5ecc('0x7'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x30fb=['analytics_report_trees','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticTreeReport'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x30fb,0x1ef));var _0xb30f=function(_0x4b16cf,_0x2dc12b){_0x4b16cf=_0x4b16cf-0x0;var _0x1e8620=_0x30fb[_0x4b16cf];return _0x1e8620;};'use strict';var _=require(_0xb30f('0x0'));var util=require(_0xb30f('0x1'));var logger=require(_0xb30f('0x2'))('api');var moment=require(_0xb30f('0x3'));var BPromise=require(_0xb30f('0x4'));var rp=require(_0xb30f('0x5'));var fs=require('fs');var path=require(_0xb30f('0x6'));var rimraf=require(_0xb30f('0x7'));var config=require(_0xb30f('0x8'));var attributes=require('./analyticTreeReport.attributes');module[_0xb30f('0x9')]=function(_0x2fbc92,_0x5495e1){return _0x2fbc92[_0xb30f('0xa')](_0xb30f('0xb'),attributes,{'tableName':_0xb30f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index f2e6ec7..4e825f4 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x33f9d0,_0x60b5b2){var _0x452c7e=function(_0x362179){while(--_0x362179){_0x33f9d0['push'](_0x33f9d0['shift']());}};_0x452c7e(++_0x60b5b2);}(_0x1261,0x144));var _0x1126=function(_0x16e9b5,_0x192142){_0x16e9b5=_0x16e9b5-0x0;var _0x206df0=_0x1261[_0x16e9b5];return _0x206df0;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x69d888,_0x1f5645){_0x69d888=_0x69d888-0x0;var _0x360531=_0x7a54[_0x69d888];return _0x360531;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e237869..64ad9c9 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 _0x7b5a=['show','post','create','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id'];(function(_0x5676df,_0x14d122){var _0x1fb878=function(_0x84c80a){while(--_0x84c80a){_0x5676df['push'](_0x5676df['shift']());}};_0x1fb878(++_0x14d122);}(_0x7b5a,0x1d0));var _0xa7b5=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0x7b5a[_0x386525];return _0x14d015;};'use strict';var multer=require(_0xa7b5('0x0'));var util=require('util');var path=require(_0xa7b5('0x1'));var timeout=require(_0xa7b5('0x2'));var express=require(_0xa7b5('0x3'));var router=express[_0xa7b5('0x4')]();var fs_extra=require(_0xa7b5('0x5'));var auth=require(_0xa7b5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa7b5('0x7'));var controller=require(_0xa7b5('0x8'));router[_0xa7b5('0x9')]('/',auth[_0xa7b5('0xa')](),controller['index']);router[_0xa7b5('0x9')](_0xa7b5('0xb'),auth[_0xa7b5('0xa')](),controller[_0xa7b5('0xc')]);router[_0xa7b5('0xd')]('/',auth['isAuthenticated'](),controller[_0xa7b5('0xe')]);router['put']('/:id',auth[_0xa7b5('0xa')](),controller['update']);router[_0xa7b5('0xf')]('/:id',auth[_0xa7b5('0xa')](),controller[_0xa7b5('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xbe4c=['Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','multer','path','connect-timeout','express'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xbe4c,0xd9));var _0xcbe4=function(_0x1623b9,_0x3079e4){_0x1623b9=_0x1623b9-0x0;var _0x35f978=_0xbe4c[_0x1623b9];return _0x35f978;};'use strict';var multer=require(_0xcbe4('0x0'));var util=require('util');var path=require(_0xcbe4('0x1'));var timeout=require(_0xcbe4('0x2'));var express=require(_0xcbe4('0x3'));var router=express[_0xcbe4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcbe4('0x5'));var interaction=require(_0xcbe4('0x6'));var config=require('../../config/environment');var controller=require(_0xcbe4('0x7'));router[_0xcbe4('0x8')]('/',auth['isAuthenticated'](),controller[_0xcbe4('0x9')]);router[_0xcbe4('0x8')](_0xcbe4('0xa'),auth[_0xcbe4('0xb')](),controller[_0xcbe4('0xc')]);router[_0xcbe4('0xd')]('/',auth['isAuthenticated'](),controller[_0xcbe4('0xe')]);router[_0xcbe4('0xf')](_0xcbe4('0xa'),auth[_0xcbe4('0xb')](),controller[_0xcbe4('0x10')]);router['delete'](_0xcbe4('0xa'),auth[_0xcbe4('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index dc4c16a..2e731d6 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 _0x89c3=['sequelize','exports','STRING'];(function(_0x200d3d,_0xa6ad41){var _0x6d0dca=function(_0x37127b){while(--_0x37127b){_0x200d3d['push'](_0x200d3d['shift']());}};_0x6d0dca(++_0xa6ad41);}(_0x89c3,0xff));var _0x389c=function(_0x552b33,_0x1ce5ec){_0x552b33=_0x552b33-0x0;var _0x2b8810=_0x89c3[_0x552b33];return _0x2b8810;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'name':{'type':Sequelize[_0x389c('0x2')]},'basename':{'type':Sequelize[_0x389c('0x2')]},'type':{'type':Sequelize[_0x389c('0x2')]}};
\ No newline at end of file
+var _0x255f=['STRING','sequelize'];(function(_0x52121e,_0x4e7ac8){var _0x2d7778=function(_0x41775c){while(--_0x41775c){_0x52121e['push'](_0x52121e['shift']());}};_0x2d7778(++_0x4e7ac8);}(_0x255f,0x185));var _0xf255=function(_0x268db5,_0x3408a0){_0x268db5=_0x268db5-0x0;var _0x5c0a20=_0x255f[_0x268db5];return _0x5c0a20;};'use strict';var Sequelize=require(_0xf255('0x0'));module['exports']={'name':{'type':Sequelize[_0xf255('0x1')]},'basename':{'type':Sequelize[_0xf255('0x1')]},'type':{'type':Sequelize[_0xf255('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 62485fc..2e9840a 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 _0xcb53=['then','error','stack','name','send','index','Attachment','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','length','options','find','omit','createdAt','body','create','params','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x1a0667,_0x31adbd){var _0x39475a=function(_0x561478){while(--_0x561478){_0x1a0667['push'](_0x1a0667['shift']());}};_0x39475a(++_0x31adbd);}(_0xcb53,0xe6));var _0x3cb5=function(_0xc98184,_0x5adfa4){_0xc98184=_0xc98184-0x0;var _0x1d7c75=_0xcb53[_0xc98184];return _0x1d7c75;};'use strict';var emlformat=require(_0x3cb5('0x0'));var rimraf=require(_0x3cb5('0x1'));var zipdir=require(_0x3cb5('0x2'));var jsonpatch=require(_0x3cb5('0x3'));var rp=require(_0x3cb5('0x4'));var moment=require(_0x3cb5('0x5'));var BPromise=require(_0x3cb5('0x6'));var Mustache=require(_0x3cb5('0x7'));var util=require('util');var path=require(_0x3cb5('0x8'));var sox=require(_0x3cb5('0x9'));var csv=require(_0x3cb5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3cb5('0xb'));var _=require('lodash');var squel=require(_0x3cb5('0xc'));var crypto=require(_0x3cb5('0xd'));var jsforce=require(_0x3cb5('0xe'));var deskjs=require(_0x3cb5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3cb5('0x10'));var Redis=require(_0x3cb5('0x11'));var authService=require(_0x3cb5('0x12'));var qs=require(_0x3cb5('0x13'));var as=require(_0x3cb5('0x14'));var hardwareService=require(_0x3cb5('0x15'));var logger=require('../../config/logger')(_0x3cb5('0x16'));var utils=require(_0x3cb5('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3cb5('0x18'))['db'];function respondWithStatusCode(_0x3846c6,_0x3515bd){_0x3515bd=_0x3515bd||0xcc;return function(_0x34be3c){if(_0x34be3c){return _0x3846c6[_0x3cb5('0x19')](_0x3515bd);}return _0x3846c6[_0x3cb5('0x1a')](_0x3515bd)['end']();};}function respondWithResult(_0x5cc097,_0x3bbdc4){_0x3bbdc4=_0x3bbdc4||0xc8;return function(_0x3f0603){if(_0x3f0603){return _0x5cc097[_0x3cb5('0x1a')](_0x3bbdc4)[_0x3cb5('0x1b')](_0x3f0603);}};}function respondWithFilteredResult(_0x101c2a,_0x523582){return function(_0x2e62b4){if(_0x2e62b4){var _0x4d407b=typeof _0x523582[_0x3cb5('0x1c')]===_0x3cb5('0x1d')&&typeof _0x523582[_0x3cb5('0x1e')]==='undefined';var _0x3a6de5=_0x2e62b4[_0x3cb5('0x1f')];var _0x222638=_0x4d407b?0x0:_0x523582[_0x3cb5('0x1c')];var _0x5ab7d=_0x4d407b?_0x2e62b4[_0x3cb5('0x1f')]:_0x523582[_0x3cb5('0x1c')]+_0x523582[_0x3cb5('0x1e')];var _0x46cae1;if(_0x5ab7d>=_0x3a6de5){_0x5ab7d=_0x3a6de5;_0x46cae1=0xc8;}else{_0x46cae1=0xce;}_0x101c2a['status'](_0x46cae1);return _0x101c2a[_0x3cb5('0x20')](_0x3cb5('0x21'),_0x222638+'-'+_0x5ab7d+'/'+_0x3a6de5)[_0x3cb5('0x1b')](_0x2e62b4);}return null;};}function patchUpdates(_0x53d40d){return function(_0x160ce8){try{jsonpatch['apply'](_0x160ce8,_0x53d40d,!![]);}catch(_0x273985){return BPromise[_0x3cb5('0x22')](_0x273985);}return _0x160ce8[_0x3cb5('0x23')]();};}function saveUpdates(_0x5859a0,_0x5750b2){return function(_0x412306){if(_0x412306){return _0x412306[_0x3cb5('0x24')](_0x5859a0)['then'](function(_0x36c044){return _0x36c044;});}return null;};}function removeEntity(_0x306842,_0x3ddb6c){return function(_0x67fcf3){if(_0x67fcf3){return _0x67fcf3['destroy']()[_0x3cb5('0x25')](function(){_0x306842[_0x3cb5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a7a74,_0x43775d){return function(_0x4c1dda){if(!_0x4c1dda){_0x1a7a74['sendStatus'](0x194);}return _0x4c1dda;};}function handleError(_0x1ea89f,_0x458a8a){_0x458a8a=_0x458a8a||0x1f4;return function(_0x5b41eb){logger[_0x3cb5('0x26')](_0x5b41eb[_0x3cb5('0x27')]);if(_0x5b41eb[_0x3cb5('0x28')]){delete _0x5b41eb[_0x3cb5('0x28')];}_0x1ea89f[_0x3cb5('0x1a')](_0x458a8a)[_0x3cb5('0x29')](_0x5b41eb);};}exports[_0x3cb5('0x2a')]=function(_0x5eb8ad,_0x44c863){var _0x18aad2={},_0x1187a0={},_0x135cd0={'count':0x0,'rows':[]};var _0x265634=_['map'](db[_0x3cb5('0x2b')][_0x3cb5('0x2c')],function(_0x5dcdb8){return{'name':_0x5dcdb8[_0x3cb5('0x2d')],'type':_0x5dcdb8['type'][_0x3cb5('0x2e')]};});_0x1187a0[_0x3cb5('0x2f')]=_[_0x3cb5('0x30')](_0x265634,_0x3cb5('0x28'));_0x1187a0[_0x3cb5('0x31')]=_['keys'](_0x5eb8ad[_0x3cb5('0x31')]);_0x1187a0[_0x3cb5('0x32')]=_['intersection'](_0x1187a0['model'],_0x1187a0[_0x3cb5('0x31')]);_0x18aad2[_0x3cb5('0x33')]=_[_0x3cb5('0x34')](_0x1187a0[_0x3cb5('0x2f')],qs[_0x3cb5('0x35')](_0x5eb8ad[_0x3cb5('0x31')][_0x3cb5('0x35')]));_0x18aad2['attributes']=_0x18aad2[_0x3cb5('0x33')]['length']?_0x18aad2[_0x3cb5('0x33')]:_0x1187a0[_0x3cb5('0x2f')];if(!_0x5eb8ad[_0x3cb5('0x31')][_0x3cb5('0x36')](_0x3cb5('0x37'))){_0x18aad2[_0x3cb5('0x1e')]=qs[_0x3cb5('0x1e')](_0x5eb8ad[_0x3cb5('0x31')][_0x3cb5('0x1e')]);_0x18aad2[_0x3cb5('0x1c')]=qs[_0x3cb5('0x1c')](_0x5eb8ad[_0x3cb5('0x31')][_0x3cb5('0x1c')]);}_0x18aad2['order']=qs[_0x3cb5('0x38')](_0x5eb8ad['query'][_0x3cb5('0x38')]);_0x18aad2[_0x3cb5('0x39')]=qs[_0x3cb5('0x32')](_[_0x3cb5('0x3a')](_0x5eb8ad[_0x3cb5('0x31')],_0x1187a0[_0x3cb5('0x32')]),_0x265634);if(_0x5eb8ad[_0x3cb5('0x31')]['filter']){_0x18aad2[_0x3cb5('0x39')]=_[_0x3cb5('0x3b')](_0x18aad2['where'],{'$or':_[_0x3cb5('0x30')](_0x265634,function(_0x2ac2f7){if(_0x2ac2f7[_0x3cb5('0x3c')]!==_0x3cb5('0x3d')){var _0x1f40ec={};_0x1f40ec[_0x2ac2f7[_0x3cb5('0x28')]]={'$like':'%'+_0x5eb8ad[_0x3cb5('0x31')][_0x3cb5('0x3e')]+'%'};return _0x1f40ec;}})});}_0x18aad2=_['merge']({},_0x18aad2,_0x5eb8ad['options']);var _0x47527d={'where':_0x18aad2[_0x3cb5('0x39')]};return db[_0x3cb5('0x2b')][_0x3cb5('0x1f')](_0x47527d)[_0x3cb5('0x25')](function(_0x53c7ee){_0x135cd0['count']=_0x53c7ee;if(_0x5eb8ad[_0x3cb5('0x31')][_0x3cb5('0x3f')]){_0x18aad2[_0x3cb5('0x40')]=[{'all':!![]}];}return db[_0x3cb5('0x2b')][_0x3cb5('0x41')](_0x18aad2);})['then'](function(_0x21116f){_0x135cd0[_0x3cb5('0x42')]=_0x21116f;return _0x135cd0;})[_0x3cb5('0x25')](respondWithFilteredResult(_0x44c863,_0x18aad2))[_0x3cb5('0x43')](handleError(_0x44c863,null));};exports[_0x3cb5('0x44')]=function(_0x122427,_0x52695b){var _0x2277db={'raw':!![],'where':{'id':_0x122427['params']['id']}},_0x57ddd0={};_0x57ddd0[_0x3cb5('0x2f')]=_[_0x3cb5('0x45')](db[_0x3cb5('0x2b')][_0x3cb5('0x2c')]);_0x57ddd0[_0x3cb5('0x31')]=_[_0x3cb5('0x45')](_0x122427[_0x3cb5('0x31')]);_0x57ddd0['filters']=_['intersection'](_0x57ddd0[_0x3cb5('0x2f')],_0x57ddd0[_0x3cb5('0x31')]);_0x2277db[_0x3cb5('0x33')]=_[_0x3cb5('0x34')](_0x57ddd0[_0x3cb5('0x2f')],qs['fields'](_0x122427['query'][_0x3cb5('0x35')]));_0x2277db[_0x3cb5('0x33')]=_0x2277db[_0x3cb5('0x33')][_0x3cb5('0x46')]?_0x2277db[_0x3cb5('0x33')]:_0x57ddd0[_0x3cb5('0x2f')];if(_0x122427['query']['includeAll']){_0x2277db['include']=[{'all':!![]}];}_0x2277db=_[_0x3cb5('0x3b')]({},_0x2277db,_0x122427[_0x3cb5('0x47')]);return db[_0x3cb5('0x2b')][_0x3cb5('0x48')](_0x2277db)['then'](handleEntityNotFound(_0x52695b,null))[_0x3cb5('0x25')](respondWithResult(_0x52695b,null))[_0x3cb5('0x43')](handleError(_0x52695b,null));};exports['clone']=function(_0x449248,_0x48823e){var _0x2807fb={'where':{'id':_0x449248['params']['id']}},_0x95c08e={};_0x95c08e[_0x3cb5('0x2f')]=_['keys'](db[_0x3cb5('0x2b')]['rawAttributes']);_0x2807fb['attributes']=_['intersection'](_0x95c08e[_0x3cb5('0x2f')],qs[_0x3cb5('0x35')](_0x449248[_0x3cb5('0x31')][_0x3cb5('0x35')]));_0x2807fb['attributes']=_0x2807fb[_0x3cb5('0x33')][_0x3cb5('0x46')]?_0x2807fb[_0x3cb5('0x33')]:_0x95c08e[_0x3cb5('0x2f')];if(_0x449248[_0x3cb5('0x31')][_0x3cb5('0x3f')]){_0x2807fb[_0x3cb5('0x40')]=[{'all':!![]}];}_0x2807fb=_[_0x3cb5('0x3b')]({},_0x2807fb,_0x449248['options']);return db[_0x3cb5('0x2b')][_0x3cb5('0x48')](_0x2807fb)['then'](handleEntityNotFound(_0x48823e,null))[_0x3cb5('0x25')](function(_0x1a1a12){if(_0x1a1a12){var _0x1460c0=_0x1a1a12['get']({'plain':!![]});_0x1460c0=qs[_0x3cb5('0x49')](_0x1460c0,['id',_0x3cb5('0x4a'),'updatedAt']);_0x449248[_0x3cb5('0x4b')]=_['omit'](_0x449248['body'],['id',_0x3cb5('0x4a'),'updatedAt']);return db[_0x3cb5('0x2b')][_0x3cb5('0x4c')](_[_0x3cb5('0x3b')](_0x1460c0,_0x449248[_0x3cb5('0x4b')]),{'include':_0x449248[_0x3cb5('0x31')][_0x3cb5('0x3f')]?[{'all':!![]}]:undefined});}})[_0x3cb5('0x25')](respondWithResult(_0x48823e,0xc9))[_0x3cb5('0x43')](handleError(_0x48823e,null));};exports[_0x3cb5('0x24')]=function(_0x1607af,_0x17922e){if(_0x1607af[_0x3cb5('0x4b')]['id']){delete _0x1607af['body']['id'];}return db['Attachment'][_0x3cb5('0x48')]({'where':{'id':_0x1607af[_0x3cb5('0x4d')]['id']}})[_0x3cb5('0x25')](handleEntityNotFound(_0x17922e,null))[_0x3cb5('0x25')](saveUpdates(_0x1607af[_0x3cb5('0x4b')],null))[_0x3cb5('0x25')](respondWithResult(_0x17922e,null))[_0x3cb5('0x43')](handleError(_0x17922e,null));};exports['destroy']=function(_0x13ca01,_0x1be727){return db['Attachment'][_0x3cb5('0x48')]({'where':{'id':_0x13ca01['params']['id']}})[_0x3cb5('0x25')](handleEntityNotFound(_0x1be727,null))[_0x3cb5('0x25')](removeEntity(_0x1be727,null))[_0x3cb5('0x43')](handleError(_0x1be727,null));};exports[_0x3cb5('0x4c')]=function(_0x69cbe3,_0x2f0cac,_0x626b2c){_0x69cbe3['body']['name']=_0x69cbe3[_0x3cb5('0x4e')][_0x3cb5('0x4f')];_0x69cbe3[_0x3cb5('0x4b')][_0x3cb5('0x50')]=_0x69cbe3[_0x3cb5('0x4e')][_0x3cb5('0x51')];_0x69cbe3[_0x3cb5('0x4b')][_0x3cb5('0x3c')]=_0x69cbe3[_0x3cb5('0x4e')][_0x3cb5('0x52')];return db['Attachment'][_0x3cb5('0x4c')](_0x69cbe3[_0x3cb5('0x4b')])[_0x3cb5('0x25')](respondWithResult(_0x2f0cac,0xc9))[_0x3cb5('0x43')](handleError(_0x2f0cac,null));};exports[_0x3cb5('0x53')]=function(_0x4f4ec2,_0x194191,_0x505332){return db['Attachment'][_0x3cb5('0x54')]({'where':{'id':_0x4f4ec2[_0x3cb5('0x4d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x194191,null))['then'](function(_0x275f32){if(_0x275f32){var _0x2b31d5=_0x275f32[_0x3cb5('0x55')]!==null;var _0x31e82c=path[_0x3cb5('0x56')](config[_0x3cb5('0x57')],'server/files/attachments/');if(_0x2b31d5){_0x31e82c=path['join'](_0x31e82c,_0x3cb5('0x58'));}var _0x5bc453=path[_0x3cb5('0x56')](_0x31e82c,_0x275f32['basename']);return _0x194191[_0x3cb5('0x53')](_0x5bc453);}})[_0x3cb5('0x43')](handleError(_0x194191,null));};
\ No newline at end of file
+var _0xa0f5=['options','Attachment','includeAll','include','findAll','rows','catch','params','keys','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','stack','name','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x350517,_0x1afeb6){var _0x335a10=function(_0x54b44c){while(--_0x54b44c){_0x350517['push'](_0x350517['shift']());}};_0x335a10(++_0x1afeb6);}(_0xa0f5,0x177));var _0x5a0f=function(_0x5d30c2,_0x20b931){_0x5d30c2=_0x5d30c2-0x0;var _0x322ce6=_0xa0f5[_0x5d30c2];return _0x322ce6;};'use strict';var emlformat=require(_0x5a0f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a0f('0x1'));var jsonpatch=require(_0x5a0f('0x2'));var rp=require(_0x5a0f('0x3'));var moment=require('moment');var BPromise=require(_0x5a0f('0x4'));var Mustache=require(_0x5a0f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5a0f('0x6'));var csv=require(_0x5a0f('0x7'));var ejs=require(_0x5a0f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5a0f('0x9'));var crypto=require(_0x5a0f('0xa'));var jsforce=require(_0x5a0f('0xb'));var deskjs=require(_0x5a0f('0xc'));var toCsv=require(_0x5a0f('0x7'));var querystring=require(_0x5a0f('0xd'));var Papa=require(_0x5a0f('0xe'));var Redis=require(_0x5a0f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5a0f('0x10'));var as=require(_0x5a0f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5a0f('0x12'))(_0x5a0f('0x13'));var utils=require(_0x5a0f('0x14'));var config=require(_0x5a0f('0x15'));var licenseUtil=require(_0x5a0f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564854,_0x423c91){_0x423c91=_0x423c91||0xcc;return function(_0x49c80b){if(_0x49c80b){return _0x564854[_0x5a0f('0x17')](_0x423c91);}return _0x564854[_0x5a0f('0x18')](_0x423c91)[_0x5a0f('0x19')]();};}function respondWithResult(_0x3d345f,_0x21e287){_0x21e287=_0x21e287||0xc8;return function(_0x4291d6){if(_0x4291d6){return _0x3d345f['status'](_0x21e287)['json'](_0x4291d6);}};}function respondWithFilteredResult(_0x354bf4,_0x4fbf75){return function(_0x56f2f0){if(_0x56f2f0){var _0x1623bc=typeof _0x4fbf75['offset']===_0x5a0f('0x1a')&&typeof _0x4fbf75[_0x5a0f('0x1b')]===_0x5a0f('0x1a');var _0x30a18f=_0x56f2f0[_0x5a0f('0x1c')];var _0x3a138b=_0x1623bc?0x0:_0x4fbf75[_0x5a0f('0x1d')];var _0xfaa649=_0x1623bc?_0x56f2f0[_0x5a0f('0x1c')]:_0x4fbf75[_0x5a0f('0x1d')]+_0x4fbf75[_0x5a0f('0x1b')];var _0x3bd6b8;if(_0xfaa649>=_0x30a18f){_0xfaa649=_0x30a18f;_0x3bd6b8=0xc8;}else{_0x3bd6b8=0xce;}_0x354bf4['status'](_0x3bd6b8);return _0x354bf4[_0x5a0f('0x1e')](_0x5a0f('0x1f'),_0x3a138b+'-'+_0xfaa649+'/'+_0x30a18f)[_0x5a0f('0x20')](_0x56f2f0);}return null;};}function patchUpdates(_0x2c1589){return function(_0x4c1c1d){try{jsonpatch[_0x5a0f('0x21')](_0x4c1c1d,_0x2c1589,!![]);}catch(_0x45394a){return BPromise[_0x5a0f('0x22')](_0x45394a);}return _0x4c1c1d[_0x5a0f('0x23')]();};}function saveUpdates(_0x58ff0a,_0x4b6b4c){return function(_0x5d08e1){if(_0x5d08e1){return _0x5d08e1[_0x5a0f('0x24')](_0x58ff0a)[_0x5a0f('0x25')](function(_0x45e9a8){return _0x45e9a8;});}return null;};}function removeEntity(_0x166447,_0x487dc1){return function(_0x5d4272){if(_0x5d4272){return _0x5d4272['destroy']()[_0x5a0f('0x25')](function(){_0x166447[_0x5a0f('0x18')](0xcc)[_0x5a0f('0x19')]();});}};}function handleEntityNotFound(_0x432f22,_0x14a0a9){return function(_0xb20af7){if(!_0xb20af7){_0x432f22[_0x5a0f('0x17')](0x194);}return _0xb20af7;};}function handleError(_0x22c859,_0x2e7b79){_0x2e7b79=_0x2e7b79||0x1f4;return function(_0x22d4a2){logger['error'](_0x22d4a2[_0x5a0f('0x26')]);if(_0x22d4a2['name']){delete _0x22d4a2[_0x5a0f('0x27')];}_0x22c859['status'](_0x2e7b79)['send'](_0x22d4a2);};}exports[_0x5a0f('0x28')]=function(_0xfedbe0,_0x7fa78f){var _0x584b21={},_0x422e41={},_0xdd598a={'count':0x0,'rows':[]};var _0x162226=_['map'](db['Attachment'][_0x5a0f('0x29')],function(_0x537dc3){return{'name':_0x537dc3['fieldName'],'type':_0x537dc3[_0x5a0f('0x2a')][_0x5a0f('0x2b')]};});_0x422e41[_0x5a0f('0x2c')]=_[_0x5a0f('0x2d')](_0x162226,'name');_0x422e41['query']=_['keys'](_0xfedbe0[_0x5a0f('0x2e')]);_0x422e41[_0x5a0f('0x2f')]=_[_0x5a0f('0x30')](_0x422e41[_0x5a0f('0x2c')],_0x422e41[_0x5a0f('0x2e')]);_0x584b21[_0x5a0f('0x31')]=_[_0x5a0f('0x30')](_0x422e41['model'],qs[_0x5a0f('0x32')](_0xfedbe0[_0x5a0f('0x2e')][_0x5a0f('0x32')]));_0x584b21[_0x5a0f('0x31')]=_0x584b21[_0x5a0f('0x31')][_0x5a0f('0x33')]?_0x584b21[_0x5a0f('0x31')]:_0x422e41[_0x5a0f('0x2c')];if(!_0xfedbe0[_0x5a0f('0x2e')][_0x5a0f('0x34')]('nolimit')){_0x584b21[_0x5a0f('0x1b')]=qs[_0x5a0f('0x1b')](_0xfedbe0[_0x5a0f('0x2e')][_0x5a0f('0x1b')]);_0x584b21[_0x5a0f('0x1d')]=qs[_0x5a0f('0x1d')](_0xfedbe0[_0x5a0f('0x2e')][_0x5a0f('0x1d')]);}_0x584b21[_0x5a0f('0x35')]=qs[_0x5a0f('0x36')](_0xfedbe0[_0x5a0f('0x2e')]['sort']);_0x584b21[_0x5a0f('0x37')]=qs[_0x5a0f('0x2f')](_[_0x5a0f('0x38')](_0xfedbe0[_0x5a0f('0x2e')],_0x422e41[_0x5a0f('0x2f')]),_0x162226);if(_0xfedbe0[_0x5a0f('0x2e')][_0x5a0f('0x39')]){_0x584b21[_0x5a0f('0x37')]=_['merge'](_0x584b21[_0x5a0f('0x37')],{'$or':_[_0x5a0f('0x2d')](_0x162226,function(_0x5aaa5a){if(_0x5aaa5a[_0x5a0f('0x2a')]!==_0x5a0f('0x3a')){var _0x5de01b={};_0x5de01b[_0x5aaa5a[_0x5a0f('0x27')]]={'$like':'%'+_0xfedbe0[_0x5a0f('0x2e')][_0x5a0f('0x39')]+'%'};return _0x5de01b;}})});}_0x584b21=_[_0x5a0f('0x3b')]({},_0x584b21,_0xfedbe0[_0x5a0f('0x3c')]);var _0xb8868b={'where':_0x584b21[_0x5a0f('0x37')]};return db[_0x5a0f('0x3d')][_0x5a0f('0x1c')](_0xb8868b)[_0x5a0f('0x25')](function(_0x3a9255){_0xdd598a[_0x5a0f('0x1c')]=_0x3a9255;if(_0xfedbe0[_0x5a0f('0x2e')][_0x5a0f('0x3e')]){_0x584b21[_0x5a0f('0x3f')]=[{'all':!![]}];}return db[_0x5a0f('0x3d')][_0x5a0f('0x40')](_0x584b21);})['then'](function(_0x858b0c){_0xdd598a[_0x5a0f('0x41')]=_0x858b0c;return _0xdd598a;})['then'](respondWithFilteredResult(_0x7fa78f,_0x584b21))[_0x5a0f('0x42')](handleError(_0x7fa78f,null));};exports['show']=function(_0x573b7d,_0x1bed51){var _0x159e58={'raw':!![],'where':{'id':_0x573b7d[_0x5a0f('0x43')]['id']}},_0x90bba8={};_0x90bba8['model']=_[_0x5a0f('0x44')](db['Attachment']['rawAttributes']);_0x90bba8[_0x5a0f('0x2e')]=_[_0x5a0f('0x44')](_0x573b7d[_0x5a0f('0x2e')]);_0x90bba8[_0x5a0f('0x2f')]=_[_0x5a0f('0x30')](_0x90bba8[_0x5a0f('0x2c')],_0x90bba8[_0x5a0f('0x2e')]);_0x159e58['attributes']=_['intersection'](_0x90bba8[_0x5a0f('0x2c')],qs[_0x5a0f('0x32')](_0x573b7d[_0x5a0f('0x2e')][_0x5a0f('0x32')]));_0x159e58[_0x5a0f('0x31')]=_0x159e58[_0x5a0f('0x31')][_0x5a0f('0x33')]?_0x159e58[_0x5a0f('0x31')]:_0x90bba8['model'];if(_0x573b7d['query'][_0x5a0f('0x3e')]){_0x159e58['include']=[{'all':!![]}];}_0x159e58=_[_0x5a0f('0x3b')]({},_0x159e58,_0x573b7d[_0x5a0f('0x3c')]);return db[_0x5a0f('0x3d')][_0x5a0f('0x45')](_0x159e58)[_0x5a0f('0x25')](handleEntityNotFound(_0x1bed51,null))[_0x5a0f('0x25')](respondWithResult(_0x1bed51,null))[_0x5a0f('0x42')](handleError(_0x1bed51,null));};exports[_0x5a0f('0x46')]=function(_0x2ea411,_0x29156e){var _0x593e06={'where':{'id':_0x2ea411['params']['id']}},_0x46653f={};_0x46653f[_0x5a0f('0x2c')]=_['keys'](db['Attachment'][_0x5a0f('0x29')]);_0x593e06[_0x5a0f('0x31')]=_[_0x5a0f('0x30')](_0x46653f[_0x5a0f('0x2c')],qs[_0x5a0f('0x32')](_0x2ea411[_0x5a0f('0x2e')][_0x5a0f('0x32')]));_0x593e06[_0x5a0f('0x31')]=_0x593e06['attributes'][_0x5a0f('0x33')]?_0x593e06[_0x5a0f('0x31')]:_0x46653f[_0x5a0f('0x2c')];if(_0x2ea411['query'][_0x5a0f('0x3e')]){_0x593e06['include']=[{'all':!![]}];}_0x593e06=_[_0x5a0f('0x3b')]({},_0x593e06,_0x2ea411['options']);return db[_0x5a0f('0x3d')][_0x5a0f('0x45')](_0x593e06)[_0x5a0f('0x25')](handleEntityNotFound(_0x29156e,null))[_0x5a0f('0x25')](function(_0x107372){if(_0x107372){var _0x5b2337=_0x107372[_0x5a0f('0x47')]({'plain':!![]});_0x5b2337=qs[_0x5a0f('0x48')](_0x5b2337,['id',_0x5a0f('0x49'),_0x5a0f('0x4a')]);_0x2ea411['body']=_[_0x5a0f('0x48')](_0x2ea411[_0x5a0f('0x4b')],['id',_0x5a0f('0x49'),_0x5a0f('0x4a')]);return db[_0x5a0f('0x3d')][_0x5a0f('0x4c')](_['merge'](_0x5b2337,_0x2ea411['body']),{'include':_0x2ea411[_0x5a0f('0x2e')][_0x5a0f('0x3e')]?[{'all':!![]}]:undefined});}})[_0x5a0f('0x25')](respondWithResult(_0x29156e,0xc9))['catch'](handleError(_0x29156e,null));};exports[_0x5a0f('0x24')]=function(_0x45e0af,_0x37bfdf){if(_0x45e0af[_0x5a0f('0x4b')]['id']){delete _0x45e0af[_0x5a0f('0x4b')]['id'];}return db['Attachment'][_0x5a0f('0x45')]({'where':{'id':_0x45e0af[_0x5a0f('0x43')]['id']}})[_0x5a0f('0x25')](handleEntityNotFound(_0x37bfdf,null))[_0x5a0f('0x25')](saveUpdates(_0x45e0af[_0x5a0f('0x4b')],null))[_0x5a0f('0x25')](respondWithResult(_0x37bfdf,null))[_0x5a0f('0x42')](handleError(_0x37bfdf,null));};exports['destroy']=function(_0x4f39cb,_0x5c61fb){return db[_0x5a0f('0x3d')][_0x5a0f('0x45')]({'where':{'id':_0x4f39cb[_0x5a0f('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c61fb,null))[_0x5a0f('0x25')](removeEntity(_0x5c61fb,null))['catch'](handleError(_0x5c61fb,null));};exports[_0x5a0f('0x4c')]=function(_0x3f0929,_0x5191ea,_0x453bd3){_0x3f0929[_0x5a0f('0x4b')][_0x5a0f('0x27')]=_0x3f0929[_0x5a0f('0x4d')][_0x5a0f('0x4e')];_0x3f0929[_0x5a0f('0x4b')][_0x5a0f('0x4f')]=_0x3f0929[_0x5a0f('0x4d')][_0x5a0f('0x50')];_0x3f0929[_0x5a0f('0x4b')][_0x5a0f('0x2a')]=_0x3f0929['file']['mimetype'];return db[_0x5a0f('0x3d')]['create'](_0x3f0929['body'])[_0x5a0f('0x25')](respondWithResult(_0x5191ea,0xc9))[_0x5a0f('0x42')](handleError(_0x5191ea,null));};exports[_0x5a0f('0x51')]=function(_0x4e3a7e,_0x45a4d7,_0x2a19b7){return db[_0x5a0f('0x3d')][_0x5a0f('0x52')]({'where':{'id':_0x4e3a7e[_0x5a0f('0x43')]['id']},'raw':!![]})[_0x5a0f('0x25')](handleEntityNotFound(_0x45a4d7,null))[_0x5a0f('0x25')](function(_0x3e3068){if(_0x3e3068){var _0x5cc212=_0x3e3068[_0x5a0f('0x53')]!==null;var _0x328c95=path[_0x5a0f('0x54')](config[_0x5a0f('0x55')],'server/files/attachments/');if(_0x5cc212){_0x328c95=path['join'](_0x328c95,_0x5a0f('0x56'));}var _0xd98cbc=path['join'](_0x328c95,_0x3e3068[_0x5a0f('0x4f')]);return _0x45a4d7['download'](_0xd98cbc);}})[_0x5a0f('0x42')](handleError(_0x45a4d7,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 7789b90..897c7f4 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 _0x0725=['exports','define','attachments','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x223a26,_0xfa7d3f){var _0x46f8d2=function(_0x3ddc3f){while(--_0x3ddc3f){_0x223a26['push'](_0x223a26['shift']());}};_0x46f8d2(++_0xfa7d3f);}(_0x0725,0x1aa));var _0x5072=function(_0x212d49,_0x1121d6){_0x212d49=_0x212d49-0x0;var _0x272fce=_0x0725[_0x212d49];return _0x272fce;};'use strict';var _=require('lodash');var util=require(_0x5072('0x0'));var logger=require('../../config/logger')(_0x5072('0x1'));var moment=require('moment');var BPromise=require(_0x5072('0x2'));var rp=require(_0x5072('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5072('0x4'));var config=require(_0x5072('0x5'));var attributes=require('./attachment.attributes');module[_0x5072('0x6')]=function(_0x2b39f1,_0x13904a){return _0x2b39f1[_0x5072('0x7')]('Attachment',attributes,{'tableName':_0x5072('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6acf=['Attachment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x6acf,0x121));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ac('0x0'));var util=require(_0xf6ac('0x1'));var logger=require(_0xf6ac('0x2'))(_0xf6ac('0x3'));var moment=require(_0xf6ac('0x4'));var BPromise=require(_0xf6ac('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6ac('0x6'));var rimraf=require(_0xf6ac('0x7'));var config=require(_0xf6ac('0x8'));var attributes=require(_0xf6ac('0x9'));module[_0xf6ac('0xa')]=function(_0x5d01c7,_0xc4bcde){return _0x5d01c7['define'](_0xf6ac('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 2e19925..64ae6d3 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 _0x222f=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','body','options','raw','debug'];(function(_0x484508,_0x217c0e){var _0x141ef5=function(_0x26fdef){while(--_0x26fdef){_0x484508['push'](_0x484508['shift']());}};_0x141ef5(++_0x217c0e);}(_0x222f,0x1a4));var _0xf222=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x222f[_0x33c9f8];return _0x2d7004;};'use strict';var _=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var moment=require(_0xf222('0x2'));var BPromise=require(_0xf222('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf222('0x4'))['db'];var utils=require(_0xf222('0x5'));var logger=require(_0xf222('0x6'))(_0xf222('0x7'));var config=require('../../config/environment');var jayson=require(_0xf222('0x8'));var client=jayson['client'][_0xf222('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f129,_0x518ebb,_0xf5a105){return new BPromise(function(_0x302d7a,_0x4aceb4){return client[_0xf222('0xa')](_0x26f129,_0xf5a105)[_0xf222('0xb')](function(_0x878804){logger[_0xf222('0xc')](_0xf222('0xd'),_0x518ebb,_0xf222('0xe'));logger['debug'](_0xf222('0xf'),_0x518ebb,_0xf222('0xe'),JSON[_0xf222('0x10')](_0x878804));if(_0x878804[_0xf222('0x11')]){if(_0x878804['error'][_0xf222('0x12')]===0x1f4){logger[_0xf222('0x11')](_0xf222('0xd'),_0x518ebb,_0x878804[_0xf222('0x11')][_0xf222('0x13')]);return _0x4aceb4(_0x878804[_0xf222('0x11')][_0xf222('0x13')]);}logger[_0xf222('0x11')]('Attachment,\x20%s,\x20%s',_0x518ebb,_0x878804['error'][_0xf222('0x13')]);return _0x302d7a(_0x878804[_0xf222('0x11')]['message']);}else{logger[_0xf222('0xc')](_0xf222('0xd'),_0x518ebb,_0xf222('0xe'));_0x302d7a(_0x878804[_0xf222('0x14')][_0xf222('0x13')]);}})[_0xf222('0x15')](function(_0x30b646){logger['error'](_0xf222('0xd'),_0x518ebb,_0x30b646);_0x4aceb4(_0x30b646);});});}exports[_0xf222('0x16')]=function(_0x8783ab){var _0xfb4ddf=this;return new Promise(function(_0x12a2e4,_0x1e57ee){return db[_0xf222('0x17')]['create'](_0x8783ab[_0xf222('0x18')],{'raw':_0x8783ab[_0xf222('0x19')]?_0x8783ab[_0xf222('0x19')][_0xf222('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5cd899){logger[_0xf222('0xc')](_0xf222('0x16'),_0x8783ab);logger[_0xf222('0x1b')](_0xf222('0x16'),_0x8783ab,JSON[_0xf222('0x10')](_0x5cd899));_0x12a2e4(_0x5cd899);})[_0xf222('0x15')](function(_0x51b872){logger[_0xf222('0x11')](_0xf222('0x16'),_0x51b872[_0xf222('0x13')],_0x8783ab);_0x1e57ee(_0xfb4ddf[_0xf222('0x11')](0x1f4,_0x51b872[_0xf222('0x13')]));});});};
\ No newline at end of file
+var _0x1ddc=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','body','options','raw','CreateAttachment','util','moment'];(function(_0x574115,_0x1334fb){var _0x45f3fe=function(_0x351e5b){while(--_0x351e5b){_0x574115['push'](_0x574115['shift']());}};_0x45f3fe(++_0x1334fb);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x14f37f,_0x247bce){_0x14f37f=_0x14f37f-0x0;var _0xa85176=_0x1ddc[_0x14f37f];return _0xa85176;};'use strict';var _=require('lodash');var util=require(_0xc1dd('0x0'));var moment=require(_0xc1dd('0x1'));var BPromise=require(_0xc1dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1dd('0x3'));var db=require(_0xc1dd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc1dd('0x5'))(_0xc1dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xc1dd('0x7'));var client=jayson[_0xc1dd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3938ff,_0x25c543,_0x593de5){return new BPromise(function(_0x54819b,_0x411452){return client[_0xc1dd('0x9')](_0x3938ff,_0x593de5)[_0xc1dd('0xa')](function(_0x217d07){logger['info'](_0xc1dd('0xb'),_0x25c543,_0xc1dd('0xc'));logger[_0xc1dd('0xd')](_0xc1dd('0xe'),_0x25c543,'request\x20sent',JSON[_0xc1dd('0xf')](_0x217d07));if(_0x217d07[_0xc1dd('0x10')]){if(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x11')]===0x1f4){logger[_0xc1dd('0x10')](_0xc1dd('0xb'),_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x411452(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}logger[_0xc1dd('0x10')]('Attachment,\x20%s,\x20%s',_0x25c543,_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);return _0x54819b(_0x217d07[_0xc1dd('0x10')][_0xc1dd('0x12')]);}else{logger[_0xc1dd('0x13')]('Attachment,\x20%s,\x20%s',_0x25c543,_0xc1dd('0xc'));_0x54819b(_0x217d07[_0xc1dd('0x14')][_0xc1dd('0x12')]);}})[_0xc1dd('0x15')](function(_0x5815d3){logger['error'](_0xc1dd('0xb'),_0x25c543,_0x5815d3);_0x411452(_0x5815d3);});});}exports['CreateAttachment']=function(_0x35139a){var _0x4c3114=this;return new Promise(function(_0x6198a7,_0x24446f){return db[_0xc1dd('0x16')][_0xc1dd('0x17')](_0x35139a[_0xc1dd('0x18')],{'raw':_0x35139a[_0xc1dd('0x19')]?_0x35139a['options'][_0xc1dd('0x1a')]===undefined?!![]:![]:!![]})[_0xc1dd('0xa')](function(_0x5e99a6){logger[_0xc1dd('0x13')](_0xc1dd('0x1b'),_0x35139a);logger[_0xc1dd('0xd')](_0xc1dd('0x1b'),_0x35139a,JSON[_0xc1dd('0xf')](_0x5e99a6));_0x6198a7(_0x5e99a6);})[_0xc1dd('0x15')](function(_0x228626){logger[_0xc1dd('0x10')]('CreateAttachment',_0x228626[_0xc1dd('0x12')],_0x35139a);_0x24446f(_0x4c3114[_0xc1dd('0x10')](0x1f4,_0x228626[_0xc1dd('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 27771ff..07d100b 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x3c7371,_0x4508f6){var _0x220298=function(_0x3d1d70){while(--_0x3d1d70){_0x3c7371['push'](_0x3c7371['shift']());}};_0x220298(++_0x4508f6);}(_0xadb5,0xad));var _0x5adb=function(_0xfa8d75,_0xfc2844){_0xfa8d75=_0xfa8d75-0x0;var _0xe03c2d=_0xadb5[_0xfa8d75];return _0xe03c2d;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x0b0e,0x187));var _0xe0b0=function(_0x51639a,_0x35f006){_0x51639a=_0x51639a-0x0;var _0x3abae4=_0x0b0e[_0x51639a];return _0x3abae4;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 96d93a4..32bd85b 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 _0xdc7a=['lodash','passport','passport-google-oauth20','../../mysqldb','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','profile','email','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','find','map','emails','value','admin','user','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','getLicense'];(function(_0x4d4576,_0x373606){var _0x437769=function(_0x4fee50){while(--_0x4fee50){_0x4d4576['push'](_0x4d4576['shift']());}};_0x437769(++_0x373606);}(_0xdc7a,0x8c));var _0xadc7=function(_0x174728,_0x205bb4){_0x174728=_0x174728-0x0;var _0x53e467=_0xdc7a[_0x174728];return _0x53e467;};'use strict';var _=require(_0xadc7('0x0'));var passport=require(_0xadc7('0x1'));var GoogleStrategy=require(_0xadc7('0x2'))['Strategy'];var moment=require('moment');var db=require(_0xadc7('0x3'))['db'];var config=require('../../config/environment');var signToken=require(_0xadc7('0x4'))[_0xadc7('0x5')];var utils=require(_0xadc7('0x6'));exports[_0xadc7('0x7')]=passport[_0xadc7('0x8')](_0xadc7('0x9'),{'failureRedirect':_0xadc7('0xa'),'scope':[_0xadc7('0xb'),_0xadc7('0xc')],'session':![]});exports['callback']=passport[_0xadc7('0x8')]('google',{'failureRedirect':_0xadc7('0xa'),'session':![]});passport[_0xadc7('0xd')](new GoogleStrategy({'clientID':config[_0xadc7('0x9')]?config['google'][_0xadc7('0xe')]:'id','clientSecret':config[_0xadc7('0x9')]?config[_0xadc7('0x9')][_0xadc7('0xf')]:_0xadc7('0x10'),'callbackURL':config[_0xadc7('0x9')]?config[_0xadc7('0x9')][_0xadc7('0x11')]:''},function(_0x342eb6,_0x3d8e59,_0x5b0a99,_0x5e7506){var _0x135394,_0x42c91c;return db[_0xadc7('0x12')][_0xadc7('0x13')]({'where':{'id':0x1},'attributes':[_0xadc7('0x14'),_0xadc7('0x15')],'raw':!![]})['then'](function(_0x416f64){_0x135394=_0x416f64;return db['User'][_0xadc7('0x16')]({'where':{'email':_[_0xadc7('0x17')](_0x5b0a99[_0xadc7('0x18')],_0xadc7('0x19')),'role':{'$or':[_0xadc7('0x1a'),_0xadc7('0x1b'),_0xadc7('0x1c')]}}});})[_0xadc7('0x1d')](function(_0x1fca4e){_0x42c91c=_0x1fca4e;if(_0x42c91c){if(_0x42c91c[_0xadc7('0x1e')]){return _0x5e7506(_0xadc7('0x1f'));}else if(_0x135394[_0xadc7('0x15')]>0x0){if(_0x42c91c['blocked']){if(moment(_0x42c91c['blockedAt'])[_0xadc7('0x20')](_0x135394[_0xadc7('0x15')],_0xadc7('0x21'))>moment()){return _0x5e7506(_0xadc7('0x1f'));}else{return utils['clearBlockUser'](_0x42c91c,0x0,![],null)['then'](function(){return utils[_0xadc7('0x22')](_0x42c91c);})[_0xadc7('0x1d')](function(){return _0x5e7506(null,_0x42c91c);});}}else{return utils['getLicense'](_0x42c91c)[_0xadc7('0x1d')](function(){return _0x5e7506(null,_0x42c91c);});}}else{return utils[_0xadc7('0x22')](_0x42c91c)['then'](function(){return _0x5e7506(null,_0x42c91c);});}}return _0x5e7506('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x42294a){_0x5e7506(_0x42294a);});}));
\ No newline at end of file
+var _0x0bf3=['../../config/utils','authenticate','google','/login','email','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','find','emails','admin','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../mysqldb','../../components/auth/service','signToken'];(function(_0x2a3caa,_0x5239dc){var _0x44479a=function(_0x253c47){while(--_0x253c47){_0x2a3caa['push'](_0x2a3caa['shift']());}};_0x44479a(++_0x5239dc);}(_0x0bf3,0x1da));var _0x30bf=function(_0x2279ca,_0x59c102){_0x2279ca=_0x2279ca-0x0;var _0x41c616=_0x0bf3[_0x2279ca];return _0x41c616;};'use strict';var _=require('lodash');var passport=require(_0x30bf('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x30bf('0x1')];var moment=require(_0x30bf('0x2'));var db=require(_0x30bf('0x3'))['db'];var config=require('../../config/environment');var signToken=require(_0x30bf('0x4'))[_0x30bf('0x5')];var utils=require(_0x30bf('0x6'));exports['login']=passport[_0x30bf('0x7')](_0x30bf('0x8'),{'failureRedirect':_0x30bf('0x9'),'scope':['profile',_0x30bf('0xa')],'session':![]});exports['callback']=passport['authenticate'](_0x30bf('0x8'),{'failureRedirect':_0x30bf('0x9'),'session':![]});passport[_0x30bf('0xb')](new GoogleStrategy({'clientID':config[_0x30bf('0x8')]?config[_0x30bf('0x8')][_0x30bf('0xc')]:'id','clientSecret':config['google']?config[_0x30bf('0x8')][_0x30bf('0xd')]:'secret','callbackURL':config[_0x30bf('0x8')]?config[_0x30bf('0x8')][_0x30bf('0xe')]:''},function(_0xf8f8c,_0x1bb702,_0x14586d,_0x5d93f3){var _0xb36731,_0x1ed0c8;return db[_0x30bf('0xf')][_0x30bf('0x10')]({'where':{'id':0x1},'attributes':[_0x30bf('0x11'),_0x30bf('0x12')],'raw':!![]})['then'](function(_0x1f1b70){_0xb36731=_0x1f1b70;return db['User'][_0x30bf('0x13')]({'where':{'email':_['map'](_0x14586d[_0x30bf('0x14')],'value'),'role':{'$or':[_0x30bf('0x15'),'user',_0x30bf('0x16')]}}});})[_0x30bf('0x17')](function(_0x10d7cd){_0x1ed0c8=_0x10d7cd;if(_0x1ed0c8){if(_0x1ed0c8[_0x30bf('0x18')]){return _0x5d93f3(_0x30bf('0x19'));}else if(_0xb36731['blockDuration']>0x0){if(_0x1ed0c8[_0x30bf('0x1a')]){if(moment(_0x1ed0c8[_0x30bf('0x1b')])[_0x30bf('0x1c')](_0xb36731[_0x30bf('0x12')],'minutes')>moment()){return _0x5d93f3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x30bf('0x1d')](_0x1ed0c8,0x0,![],null)['then'](function(){return utils[_0x30bf('0x1e')](_0x1ed0c8);})[_0x30bf('0x17')](function(){return _0x5d93f3(null,_0x1ed0c8);});}}else{return utils[_0x30bf('0x1e')](_0x1ed0c8)['then'](function(){return _0x5d93f3(null,_0x1ed0c8);});}}else{return utils[_0x30bf('0x1e')](_0x1ed0c8)[_0x30bf('0x17')](function(){return _0x5d93f3(null,_0x1ed0c8);});}}return _0x5d93f3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x30bf('0x1f')](function(_0x329def){_0x5d93f3(_0x329def);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 07970ab..b8bdf6b 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 _0xacde=['isMiddleware','login','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','get','callback'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xacde,0x1cf));var _0xeacd=function(_0x5d160,_0xa4838e){_0x5d160=_0x5d160-0x0;var _0x1d180d=_0xacde[_0x5d160];return _0x1d180d;};'use strict';var express=require(_0xeacd('0x0'));var passport=require(_0xeacd('0x1'));var router=express[_0xeacd('0x2')]();var controller=require(_0xeacd('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0xeacd('0x4'));router[_0xeacd('0x5')]('/',controller['login']);router['get']('/callback',controller[_0xeacd('0x6')],authService[_0xeacd('0x7')],userController[_0xeacd('0x8')],authService['setTokenCookie']);module[_0xeacd('0x9')]=router;
\ No newline at end of file
+var _0x046f=['login','/callback','callback','isMiddleware','express','passport','../user/user.controller.js','../../components/auth/service','get'];(function(_0x17fb84,_0x23d913){var _0x2d16eb=function(_0x357c39){while(--_0x357c39){_0x17fb84['push'](_0x17fb84['shift']());}};_0x2d16eb(++_0x23d913);}(_0x046f,0x1a2));var _0xf046=function(_0x1a60f8,_0x881a4e){_0x1a60f8=_0x1a60f8-0x0;var _0x1e5a4d=_0x046f[_0x1a60f8];return _0x1e5a4d;};'use strict';var express=require(_0xf046('0x0'));var passport=require(_0xf046('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xf046('0x2'));var authService=require(_0xf046('0x3'));router[_0xf046('0x4')]('/',controller[_0xf046('0x5')]);router[_0xf046('0x4')](_0xf046('0x6'),controller[_0xf046('0x7')],authService[_0xf046('0x8')],userController[_0xf046('0x5')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 31a90e8..c486a19 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 _0xc820=['moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','then','authenticate','minutes','clearBlockUser','add','getLicense','catch','MailAccount','find','email','service','Smtp','host','port','secure','auth','pass','merge','\x22%s\x22\x20<%s>','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','send','reset','User','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash'];(function(_0x1e741c,_0x20e62d){var _0x2652b0=function(_0x220af5){while(--_0x220af5){_0x1e741c['push'](_0x1e741c['shift']());}};_0x2652b0(++_0x20e62d);}(_0xc820,0x13f));var _0x0c82=function(_0x3ad0d7,_0x22e61c){_0x3ad0d7=_0x3ad0d7-0x0;var _0x51cd6b=_0xc820[_0x3ad0d7];return _0x51cd6b;};'use strict';var util=require('util');var passport=require(_0x0c82('0x0'));var LocalStrategy=require(_0x0c82('0x1'))[_0x0c82('0x2')];var jayson=require(_0x0c82('0x3'));var _=require(_0x0c82('0x4'));var rs=require('randomstring');var moment=require(_0x0c82('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x0c82('0x6'));var utils=require(_0x0c82('0x7'));var client=jayson[_0x0c82('0x8')][_0x0c82('0x9')]({'port':0x232b});function localAuthenticate(_0x28db5e,_0x23f783,_0x2d2567,_0x32e9ee){var _0x4689b7,_0x29fc55;return db[_0x0c82('0xa')][_0x0c82('0xb')]({'where':{'id':0x1},'attributes':[_0x0c82('0xc'),_0x0c82('0xd')],'raw':!![]})['then'](function(_0x8c568){_0x4689b7=_0x8c568;return _0x28db5e[_0x0c82('0xb')]({'attributes':['id',_0x0c82('0xe'),_0x0c82('0xf'),_0x0c82('0x10'),_0x0c82('0x11'),_0x0c82('0x12'),_0x0c82('0x13'),_0x0c82('0x14'),_0x0c82('0x15')],'where':{'name':_0x23f783,'role':{'$or':['admin',_0x0c82('0x16'),'agent']}}});})['then'](function(_0x2098ae){if(!_0x2098ae||_0x2098ae&&_0x2098ae[_0x0c82('0xe')]!==_0x23f783){throw new Error(_0x0c82('0x17'));}else{_0x29fc55=_0x2098ae;return _0x29fc55;}})[_0x0c82('0x18')](function(){_0x29fc55[_0x0c82('0x19')](_0x2d2567,function(_0x5bdcf6,_0x4610e5){var _0x17376c=_0x29fc55[_0x0c82('0x15')]+0x1;if(_0x5bdcf6){return _0x32e9ee(_0x5bdcf6);}else if(!_0x4610e5){if(_0x29fc55['disabled']){return _0x32e9ee(null,![],{'message':_0x0c82('0x17')});}else if(_0x4689b7['allowedLoginAttempts']>0x0){if(_0x29fc55[_0x0c82('0x13')]){if(_0x4689b7[_0x0c82('0xd')]>0x0){if(moment(_0x29fc55[_0x0c82('0x14')])['add'](_0x4689b7['blockDuration'],_0x0c82('0x1a'))>moment()){return _0x32e9ee(null,![],{'message':_0x0c82('0x17')});}else{return utils['clearBlockUser'](_0x29fc55,_0x17376c,![],null)[_0x0c82('0x18')](function(){return _0x32e9ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x32e9ee(null,![],{'message':_0x0c82('0x17')});}}else{if(_0x17376c>=_0x4689b7[_0x0c82('0xc')]){return utils['clearBlockUser'](_0x29fc55,0x0,!![],moment())[_0x0c82('0x18')](function(){return _0x32e9ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0c82('0x1b')](_0x29fc55,_0x17376c,![],null)['then'](function(){return _0x32e9ee(null,![],{'message':_0x0c82('0x17')});});}}}else{return _0x32e9ee(null,![],{'message':_0x0c82('0x17')});}}else{if(_0x29fc55['disabled']){return _0x32e9ee(null,![],{'message':_0x0c82('0x17')});}else if(_0x4689b7[_0x0c82('0xc')]>0x0){if(_0x29fc55[_0x0c82('0x13')]){if(_0x4689b7['blockDuration']>0x0){if(moment(_0x29fc55[_0x0c82('0x14')])[_0x0c82('0x1c')](_0x4689b7[_0x0c82('0xd')],_0x0c82('0x1a'))>moment()){return _0x32e9ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0c82('0x1b')](_0x29fc55,0x0,![],null)[_0x0c82('0x18')](function(){return utils[_0x0c82('0x1d')](_0x29fc55);})[_0x0c82('0x18')](function(){return _0x32e9ee(null,_0x29fc55);});}}else{return _0x32e9ee(null,![],{'message':_0x0c82('0x17')});}}else{return utils[_0x0c82('0x1b')](_0x29fc55,0x0,![],null)[_0x0c82('0x18')](function(){return utils['getLicense'](_0x29fc55);})[_0x0c82('0x18')](function(){return _0x32e9ee(null,_0x29fc55);})[_0x0c82('0x1e')](function(_0x4e7f33){return _0x32e9ee(null,![],_0x4e7f33);});}}else{if(_0x29fc55[_0x0c82('0x13')]){return _0x32e9ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x29fc55)[_0x0c82('0x18')](function(){return _0x32e9ee(null,_0x29fc55);});}}}});})[_0x0c82('0x1e')](function(_0x224b66){return _0x32e9ee(null,![],_0x224b66);});}function sendServiceMail(_0x46490d){return db[_0x0c82('0x1f')][_0x0c82('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x0c82('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x0c82('0x18')](function(_0x596232){if(!_0x596232){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1ca7ee={'tls':{'rejectUnauthorized':![]}};if(_0x596232['Smtp']['service']){_0x1ca7ee[_0x0c82('0x22')]=_0x596232[_0x0c82('0x23')][_0x0c82('0x22')];}else{_0x1ca7ee[_0x0c82('0x24')]=_0x596232[_0x0c82('0x23')][_0x0c82('0x24')];_0x1ca7ee[_0x0c82('0x25')]=_0x596232[_0x0c82('0x23')][_0x0c82('0x25')];_0x1ca7ee[_0x0c82('0x26')]=_0x596232[_0x0c82('0x23')][_0x0c82('0x26')];}if(_0x596232['Smtp']['authentication']){_0x1ca7ee[_0x0c82('0x27')]={'user':_0x596232[_0x0c82('0x23')][_0x0c82('0x16')],'pass':_0x596232[_0x0c82('0x23')][_0x0c82('0x28')]};}var _0x175708={'account':_0x1ca7ee,'message':_[_0x0c82('0x29')]({'from':util['format'](_0x0c82('0x2a'),_0x596232[_0x0c82('0xe')],_0x596232['email']||_0x596232[_0x0c82('0x23')]['user'])},_0x46490d)};return client['request'](_0x0c82('0x2b'),_0x175708);})['then'](function(_0x4d86c2){if(_0x4d86c2[_0x0c82('0x2c')]){throw new Error(util[_0x0c82('0x2d')](_0x0c82('0x2e'),_0x4d86c2[_0x0c82('0x2c')][_0x0c82('0x2f')]||JSON[_0x0c82('0x30')](_0x4d86c2['error'])));}return!![];});}function handleError(_0x5a9cd1,_0x6ae129,_0x32597d){return _0x5a9cd1[_0x0c82('0x31')](_0x6ae129||0x1f4)['send']({'message':_0x32597d?_0x32597d[_0x0c82('0x2f')]||_0x32597d:''});}exports[_0x0c82('0x32')]=function(_0x572c14,_0x1c4bd7,_0x46d3d8){passport['authenticate'](_0x0c82('0x33'),function(_0x2da3dc,_0x41a569,_0x94f60e){var _0x5dcb49=_0x2da3dc||_0x94f60e;if(_0x5dcb49){return handleError(_0x1c4bd7,0x191,_0x5dcb49);}if(!_0x41a569){return handleError(_0x1c4bd7,0x194,{'message':_0x0c82('0x34')});}else{var _0x1b3048={'payload':{'id':_0x41a569['id'],'role':_0x41a569[_0x0c82('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x0c82('0x35')](_0x1b3048)[_0x0c82('0x18')](function(_0x2fa180){_0x1c4bd7[_0x0c82('0x36')]({'id':_0x41a569['id'],'token':_0x2fa180,'statusCall':'','isAlreadyLogged':_0x41a569['online']});});}})(_0x572c14,_0x1c4bd7,_0x46d3d8);};exports[_0x0c82('0x37')]=function(_0x18e98d,_0x534ec5,_0x1ad7f5){if(!_0x18e98d[_0x0c82('0x38')][_0x0c82('0x21')]){return handleError(_0x534ec5,0x1f4,{'message':_0x0c82('0x39')});}var _0x57ff5e=rs['generate']();_0x18e98d[_0x0c82('0x38')]['email']=_0x18e98d[_0x0c82('0x38')][_0x0c82('0x21')][_0x0c82('0x3a')]()['toLowerCase']();var _0x4b3257;return db[_0x0c82('0xa')][_0x0c82('0xb')]({'where':{'id':0x1},'attributes':[_0x0c82('0xc'),_0x0c82('0xd')],'raw':!![]})[_0x0c82('0x18')](function(_0x4b80f4){_0x4b3257=_0x4b80f4;return db['User'][_0x0c82('0x20')]({'where':{'email':_0x18e98d['body']['email']}});})['then'](function(_0xcdb966){if(!_0xcdb966){throw new Error(_0x0c82('0x3b'));}if(_0xcdb966['disabled']){throw new Error(_0x0c82('0x3c'));}if(_0xcdb966[_0x0c82('0x13')]){if(moment(_0xcdb966[_0x0c82('0x14')])['add'](_0x4b3257['blockDuration'],_0x0c82('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0xcdb966[_0x0c82('0x13')]=![];_0xcdb966[_0x0c82('0x14')]=null;}}_0xcdb966[_0x0c82('0x3d')]=_0x57ff5e;_0xcdb966[_0x0c82('0x3e')]=Date[_0x0c82('0x3f')]()+0x36ee80;return _0xcdb966[_0x0c82('0x40')]();})[_0x0c82('0x18')](function(){return sendServiceMail({'to':_0x18e98d[_0x0c82('0x38')][_0x0c82('0x21')],'subject':_0x0c82('0x41'),'text':_0x0c82('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x18e98d[_0x0c82('0x43')][_0x0c82('0x24')]+_0x0c82('0x44')+_0x57ff5e+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0c82('0x18')](function(){_0x534ec5[_0x0c82('0x31')](0xc8)[_0x0c82('0x45')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x16d118){return handleError(_0x534ec5,0x1f4,_0x16d118);});};exports[_0x0c82('0x46')]=function(_0x4e789d,_0x221efc,_0x5ccd68){return db[_0x0c82('0x47')][_0x0c82('0x20')]({'where':{'resetPasswordToken':_0x4e789d['params'][_0x0c82('0x48')],'resetPasswordExpires':{'$gt':Date[_0x0c82('0x3f')]()}}})[_0x0c82('0x18')](function(_0x401654){if(!_0x401654){throw new Error(_0x0c82('0x49'));}return db[_0x0c82('0xa')]['findOne']({'attributes':['id','securePassword',_0x0c82('0x4a'),_0x0c82('0x4b')]})[_0x0c82('0x18')](function(_0x1993b1){if(_0x1993b1[_0x0c82('0x4c')])authService[_0x0c82('0x4d')](_0x4e789d[_0x0c82('0x38')]['password']);if(!_0x1993b1['enforcePasswordHistory']||!_0x401654[_0x0c82('0x4e')])return _0x401654;authService['validatePasswordHistory'](_0x4e789d[_0x0c82('0x38')][_0x0c82('0xf')],_0x401654['previousPasswords'],_0x1993b1[_0x0c82('0x4b')]);return _0x401654;})[_0x0c82('0x18')](function(){_0x401654[_0x0c82('0xf')]=_0x4e789d[_0x0c82('0x38')]['password'];_0x401654[_0x0c82('0x3d')]=null;_0x401654[_0x0c82('0x3e')]=null;return _0x401654[_0x0c82('0x40')]();});})[_0x0c82('0x18')](function(){_0x221efc[_0x0c82('0x31')](0xc8)['send']({'message':_0x0c82('0x4f')});})[_0x0c82('0x1e')](function(_0x525673){return handleError(_0x221efc,0x1f4,_0x525673);});};passport[_0x0c82('0x50')](new LocalStrategy({'usernameField':_0x0c82('0xe'),'passwordField':_0x0c82('0xf')},function(_0x97889,_0x2b737a,_0x500e80){return localAuthenticate(db[_0x0c82('0x47')],_0x97889,_0x2b737a,_0x500e80);}));
\ No newline at end of file
+var _0xf6c6=['validatePasswordPattern','previousPasswords','validatePasswordHistory','use','passport','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','disabled','blocked','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local','role','signToken','json','online','forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','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://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf6c6,0x154));var _0x6f6c=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xf6c6[_0x7e2eb0];return _0xd92de4;};'use strict';var util=require('util');var passport=require(_0x6f6c('0x0'));var LocalStrategy=require('passport-local')[_0x6f6c('0x1')];var jayson=require(_0x6f6c('0x2'));var _=require(_0x6f6c('0x3'));var rs=require('randomstring');var moment=require(_0x6f6c('0x4'));var db=require(_0x6f6c('0x5'))['db'];var authService=require(_0x6f6c('0x6'));var utils=require('../../config/utils');var client=jayson[_0x6f6c('0x7')][_0x6f6c('0x8')]({'port':0x232b});function localAuthenticate(_0x2b259e,_0x40a1c0,_0x3feb60,_0x1999c6){var _0x3cb15a,_0x2ef627;return db[_0x6f6c('0x9')][_0x6f6c('0xa')]({'where':{'id':0x1},'attributes':[_0x6f6c('0xb'),_0x6f6c('0xc')],'raw':!![]})[_0x6f6c('0xd')](function(_0x1acddc){_0x3cb15a=_0x1acddc;return _0x2b259e[_0x6f6c('0xa')]({'attributes':['id',_0x6f6c('0xe'),_0x6f6c('0xf'),_0x6f6c('0x10'),'role',_0x6f6c('0x11'),_0x6f6c('0x12'),'blockedAt',_0x6f6c('0x13')],'where':{'name':_0x40a1c0,'role':{'$or':[_0x6f6c('0x14'),'user','agent']}}});})[_0x6f6c('0xd')](function(_0x46b78e){if(!_0x46b78e||_0x46b78e&&_0x46b78e[_0x6f6c('0xe')]!==_0x40a1c0){throw new Error(_0x6f6c('0x15'));}else{_0x2ef627=_0x46b78e;return _0x2ef627;}})['then'](function(){_0x2ef627['authenticate'](_0x3feb60,function(_0x16f49e,_0x357dbd){var _0x1c9b6c=_0x2ef627[_0x6f6c('0x13')]+0x1;if(_0x16f49e){return _0x1999c6(_0x16f49e);}else if(!_0x357dbd){if(_0x2ef627[_0x6f6c('0x11')]){return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});}else if(_0x3cb15a[_0x6f6c('0xb')]>0x0){if(_0x2ef627[_0x6f6c('0x12')]){if(_0x3cb15a[_0x6f6c('0xc')]>0x0){if(moment(_0x2ef627[_0x6f6c('0x16')])[_0x6f6c('0x17')](_0x3cb15a['blockDuration'],_0x6f6c('0x18'))>moment()){return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});}else{return utils['clearBlockUser'](_0x2ef627,_0x1c9b6c,![],null)[_0x6f6c('0xd')](function(){return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});});}}else{return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});}}else{if(_0x1c9b6c>=_0x3cb15a[_0x6f6c('0xb')]){return utils[_0x6f6c('0x19')](_0x2ef627,0x0,!![],moment())[_0x6f6c('0xd')](function(){return _0x1999c6(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x2ef627,_0x1c9b6c,![],null)[_0x6f6c('0xd')](function(){return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});});}}}else{return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});}}else{if(_0x2ef627[_0x6f6c('0x11')]){return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});}else if(_0x3cb15a[_0x6f6c('0xb')]>0x0){if(_0x2ef627[_0x6f6c('0x12')]){if(_0x3cb15a['blockDuration']>0x0){if(moment(_0x2ef627[_0x6f6c('0x16')])[_0x6f6c('0x17')](_0x3cb15a[_0x6f6c('0xc')],_0x6f6c('0x18'))>moment()){return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});}else{return utils['clearBlockUser'](_0x2ef627,0x0,![],null)['then'](function(){return utils[_0x6f6c('0x1a')](_0x2ef627);})[_0x6f6c('0xd')](function(){return _0x1999c6(null,_0x2ef627);});}}else{return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});}}else{return utils[_0x6f6c('0x19')](_0x2ef627,0x0,![],null)[_0x6f6c('0xd')](function(){return utils['getLicense'](_0x2ef627);})['then'](function(){return _0x1999c6(null,_0x2ef627);})[_0x6f6c('0x1b')](function(_0x183e49){return _0x1999c6(null,![],_0x183e49);});}}else{if(_0x2ef627[_0x6f6c('0x12')]){return _0x1999c6(null,![],{'message':_0x6f6c('0x15')});}else{return utils[_0x6f6c('0x1a')](_0x2ef627)[_0x6f6c('0xd')](function(){return _0x1999c6(null,_0x2ef627);});}}}});})[_0x6f6c('0x1b')](function(_0x22ef30){return _0x1999c6(null,![],_0x22ef30);});}function sendServiceMail(_0x546dd8){return db[_0x6f6c('0x1c')][_0x6f6c('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x6f6c('0xe'),_0x6f6c('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x6f6c('0x1f')}]})[_0x6f6c('0xd')](function(_0x398470){if(!_0x398470){throw new Error(_0x6f6c('0x20'));}var _0x1b34e8={'tls':{'rejectUnauthorized':![]}};if(_0x398470[_0x6f6c('0x1f')][_0x6f6c('0x21')]){_0x1b34e8['service']=_0x398470['Smtp'][_0x6f6c('0x21')];}else{_0x1b34e8['host']=_0x398470[_0x6f6c('0x1f')][_0x6f6c('0x22')];_0x1b34e8['port']=_0x398470[_0x6f6c('0x1f')][_0x6f6c('0x23')];_0x1b34e8[_0x6f6c('0x24')]=_0x398470['Smtp']['secure'];}if(_0x398470[_0x6f6c('0x1f')][_0x6f6c('0x25')]){_0x1b34e8[_0x6f6c('0x26')]={'user':_0x398470[_0x6f6c('0x1f')]['user'],'pass':_0x398470[_0x6f6c('0x1f')][_0x6f6c('0x27')]};}var _0x3e032b={'account':_0x1b34e8,'message':_[_0x6f6c('0x28')]({'from':util[_0x6f6c('0x29')](_0x6f6c('0x2a'),_0x398470[_0x6f6c('0xe')],_0x398470[_0x6f6c('0x1e')]||_0x398470[_0x6f6c('0x1f')]['user'])},_0x546dd8)};return client[_0x6f6c('0x2b')]('SendMail',_0x3e032b);})[_0x6f6c('0xd')](function(_0x461b18){if(_0x461b18[_0x6f6c('0x2c')]){throw new Error(util['format'](_0x6f6c('0x2d'),_0x461b18[_0x6f6c('0x2c')][_0x6f6c('0x2e')]||JSON[_0x6f6c('0x2f')](_0x461b18['error'])));}return!![];});}function handleError(_0x3ba588,_0x892313,_0x535a71){return _0x3ba588[_0x6f6c('0x30')](_0x892313||0x1f4)[_0x6f6c('0x31')]({'message':_0x535a71?_0x535a71[_0x6f6c('0x2e')]||_0x535a71:''});}exports['login']=function(_0x4bf0ba,_0x1f0ab7,_0xc90db3){passport['authenticate'](_0x6f6c('0x32'),function(_0x5bab5f,_0x1ba2fe,_0x3aa904){var _0xa35d26=_0x5bab5f||_0x3aa904;if(_0xa35d26){return handleError(_0x1f0ab7,0x191,_0xa35d26);}if(!_0x1ba2fe){return handleError(_0x1f0ab7,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x21020b={'payload':{'id':_0x1ba2fe['id'],'role':_0x1ba2fe[_0x6f6c('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0x6f6c('0x34')](_0x21020b)[_0x6f6c('0xd')](function(_0x224c70){_0x1f0ab7[_0x6f6c('0x35')]({'id':_0x1ba2fe['id'],'token':_0x224c70,'statusCall':'','isAlreadyLogged':_0x1ba2fe[_0x6f6c('0x36')]});});}})(_0x4bf0ba,_0x1f0ab7,_0xc90db3);};exports[_0x6f6c('0x37')]=function(_0x1e310f,_0x3cea7c,_0x55047f){if(!_0x1e310f[_0x6f6c('0x38')]['email']){return handleError(_0x3cea7c,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1b98f5=rs[_0x6f6c('0x39')]();_0x1e310f['body'][_0x6f6c('0x1e')]=_0x1e310f[_0x6f6c('0x38')][_0x6f6c('0x1e')][_0x6f6c('0x3a')]()['toLowerCase']();var _0x221343;return db['Setting'][_0x6f6c('0xa')]({'where':{'id':0x1},'attributes':[_0x6f6c('0xb'),'blockDuration'],'raw':!![]})[_0x6f6c('0xd')](function(_0x3bb475){_0x221343=_0x3bb475;return db[_0x6f6c('0x3b')]['find']({'where':{'email':_0x1e310f['body']['email']}});})[_0x6f6c('0xd')](function(_0x23daeb){if(!_0x23daeb){throw new Error(_0x6f6c('0x3c'));}if(_0x23daeb[_0x6f6c('0x11')]){throw new Error(_0x6f6c('0x3d'));}if(_0x23daeb[_0x6f6c('0x12')]){if(moment(_0x23daeb['blockedAt'])[_0x6f6c('0x17')](_0x221343['blockDuration'],'minutes')>moment()){throw new Error(_0x6f6c('0x3e'));}else{_0x23daeb[_0x6f6c('0x12')]=![];_0x23daeb['blockedAt']=null;}}_0x23daeb[_0x6f6c('0x3f')]=_0x1b98f5;_0x23daeb[_0x6f6c('0x40')]=Date['now']()+0x36ee80;return _0x23daeb[_0x6f6c('0x41')]();})[_0x6f6c('0xd')](function(){return sendServiceMail({'to':_0x1e310f[_0x6f6c('0x38')][_0x6f6c('0x1e')],'subject':_0x6f6c('0x42'),'text':_0x6f6c('0x43')+_0x6f6c('0x44')+_0x6f6c('0x45')+_0x1e310f[_0x6f6c('0x46')][_0x6f6c('0x22')]+_0x6f6c('0x47')+_0x1b98f5+'\x0a\x0a'+_0x6f6c('0x48')});})[_0x6f6c('0xd')](function(){_0x3cea7c[_0x6f6c('0x30')](0xc8)[_0x6f6c('0x31')]({'message':_0x6f6c('0x49')});})['catch'](function(_0x4c0ac6){return handleError(_0x3cea7c,0x1f4,_0x4c0ac6);});};exports[_0x6f6c('0x4a')]=function(_0x321576,_0x52b365,_0x41ca85){return db[_0x6f6c('0x3b')][_0x6f6c('0x1d')]({'where':{'resetPasswordToken':_0x321576['params'][_0x6f6c('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x6f6c('0x4c')]()}}})[_0x6f6c('0xd')](function(_0x183b44){if(!_0x183b44){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0x6f6c('0x4d'),_0x6f6c('0x4e'),_0x6f6c('0x4f')]})[_0x6f6c('0xd')](function(_0x3d0cc5){if(_0x3d0cc5[_0x6f6c('0x4d')])authService[_0x6f6c('0x50')](_0x321576[_0x6f6c('0x38')][_0x6f6c('0xf')]);if(!_0x3d0cc5[_0x6f6c('0x4e')]||!_0x183b44[_0x6f6c('0x51')])return _0x183b44;authService[_0x6f6c('0x52')](_0x321576[_0x6f6c('0x38')][_0x6f6c('0xf')],_0x183b44[_0x6f6c('0x51')],_0x3d0cc5['passwordHistoryLimit']);return _0x183b44;})[_0x6f6c('0xd')](function(){_0x183b44[_0x6f6c('0xf')]=_0x321576[_0x6f6c('0x38')][_0x6f6c('0xf')];_0x183b44[_0x6f6c('0x3f')]=null;_0x183b44[_0x6f6c('0x40')]=null;return _0x183b44['save']();});})[_0x6f6c('0xd')](function(){_0x52b365[_0x6f6c('0x30')](0xc8)[_0x6f6c('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x3e1766){return handleError(_0x52b365,0x1f4,_0x3e1766);});};passport[_0x6f6c('0x53')](new LocalStrategy({'usernameField':_0x6f6c('0xe'),'passwordField':'password'},function(_0x2ca429,_0x2e1232,_0x5d4193){return localAuthenticate(db[_0x6f6c('0x3b')],_0x2ca429,_0x2e1232,_0x5d4193);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index bb4d9cd..6536163 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 _0x2925=['exports','express','Router','./authLocal.controller','post','forgot','reset'];(function(_0x217931,_0x2c6669){var _0x20f8d0=function(_0x144281){while(--_0x144281){_0x217931['push'](_0x217931['shift']());}};_0x20f8d0(++_0x2c6669);}(_0x2925,0x71));var _0x5292=function(_0x1d094b,_0x251681){_0x1d094b=_0x1d094b-0x0;var _0x1bf90b=_0x2925[_0x1d094b];return _0x1bf90b;};'use strict';var express=require(_0x5292('0x0'));var router=express[_0x5292('0x1')]();var controller=require(_0x5292('0x2'));router['post']('/',controller['login']);router[_0x5292('0x3')]('/forgot',controller[_0x5292('0x4')]);router['post']('/reset/:token',controller[_0x5292('0x5')]);module[_0x5292('0x6')]=router;
\ No newline at end of file
+var _0xf4e1=['exports','express','./authLocal.controller','post','login','/forgot','/reset/:token'];(function(_0x5756f8,_0x22b6d5){var _0x3bb749=function(_0x332204){while(--_0x332204){_0x5756f8['push'](_0x5756f8['shift']());}};_0x3bb749(++_0x22b6d5);}(_0xf4e1,0x86));var _0x1f4e=function(_0x2fea36,_0x1b5629){_0x2fea36=_0x2fea36-0x0;var _0x250d6e=_0xf4e1[_0x2fea36];return _0x250d6e;};'use strict';var express=require(_0x1f4e('0x0'));var router=express['Router']();var controller=require(_0x1f4e('0x1'));router[_0x1f4e('0x2')]('/',controller[_0x1f4e('0x3')]);router[_0x1f4e('0x2')](_0x1f4e('0x4'),controller['forgot']);router[_0x1f4e('0x2')](_0x1f4e('0x5'),controller['reset']);module[_0x1f4e('0x6')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index b76e984..759ee46 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 _0xe10e=['BOOLEAN','sequelize','STRING'];(function(_0x3a6b68,_0x8d8c95){var _0x45e882=function(_0x10060d){while(--_0x10060d){_0x3a6b68['push'](_0x3a6b68['shift']());}};_0x45e882(++_0x8d8c95);}(_0xe10e,0xe2));var _0xee10=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xe10e[_0xd0a847];return _0x2536ec;};'use strict';var Sequelize=require(_0xee10('0x0'));module['exports']={'name':{'type':Sequelize[_0xee10('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xee10('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0x405c=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x49524b,_0x2f3ac0){var _0x5626b3=function(_0x4ed13d){while(--_0x4ed13d){_0x49524b['push'](_0x49524b['shift']());}};_0x5626b3(++_0x2f3ac0);}(_0x405c,0x11d));var _0xc405=function(_0x3146ea,_0x1c9e52){_0x3146ea=_0x3146ea-0x0;var _0x36acd6=_0x405c[_0x3146ea];return _0x36acd6;};'use strict';var Sequelize=require(_0xc405('0x0'));module[_0xc405('0x1')]={'name':{'type':Sequelize[_0xc405('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc405('0x2')]},'status':{'type':Sequelize[_0xc405('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc405('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index cc75003..272a870 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 _0xc418=['query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','rows','show','params','find','catch','create','body','addConditions','Condition','ids','omit','getConditions','addActions','Action','findOne','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','end','status','json','undefined','count','offset','limit','set','apply','reject','update','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','keys'];(function(_0x2f1677,_0x668f){var _0x359eff=function(_0x3fcc1e){while(--_0x3fcc1e){_0x2f1677['push'](_0x2f1677['shift']());}};_0x359eff(++_0x668f);}(_0xc418,0x17a));var _0x8c41=function(_0x13c782,_0x17bb19){_0x13c782=_0x13c782-0x0;var _0x539ad2=_0xc418[_0x13c782];return _0x539ad2;};'use strict';var emlformat=require(_0x8c41('0x0'));var rimraf=require(_0x8c41('0x1'));var zipdir=require(_0x8c41('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8c41('0x3'));var BPromise=require(_0x8c41('0x4'));var Mustache=require(_0x8c41('0x5'));var util=require(_0x8c41('0x6'));var path=require(_0x8c41('0x7'));var sox=require(_0x8c41('0x8'));var csv=require(_0x8c41('0x9'));var ejs=require(_0x8c41('0xa'));var fs=require('fs');var fs_extra=require(_0x8c41('0xb'));var _=require(_0x8c41('0xc'));var squel=require(_0x8c41('0xd'));var crypto=require(_0x8c41('0xe'));var jsforce=require(_0x8c41('0xf'));var deskjs=require(_0x8c41('0x10'));var toCsv=require(_0x8c41('0x9'));var querystring=require(_0x8c41('0x11'));var Papa=require(_0x8c41('0x12'));var Redis=require(_0x8c41('0x13'));var authService=require(_0x8c41('0x14'));var qs=require(_0x8c41('0x15'));var as=require(_0x8c41('0x16'));var hardwareService=require(_0x8c41('0x17'));var logger=require('../../config/logger')(_0x8c41('0x18'));var utils=require('../../config/utils');var config=require(_0x8c41('0x19'));var licenseUtil=require(_0x8c41('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x246c74,_0x412a05){_0x412a05=_0x412a05||0xcc;return function(_0x92c162){if(_0x92c162){return _0x246c74['sendStatus'](_0x412a05);}return _0x246c74['status'](_0x412a05)[_0x8c41('0x1b')]();};}function respondWithResult(_0x4c2a1f,_0x348559){_0x348559=_0x348559||0xc8;return function(_0x16bc3f){if(_0x16bc3f){return _0x4c2a1f[_0x8c41('0x1c')](_0x348559)[_0x8c41('0x1d')](_0x16bc3f);}};}function respondWithFilteredResult(_0x335eed,_0x1642f0){return function(_0xc29bbd){if(_0xc29bbd){var _0x47069a=typeof _0x1642f0['offset']===_0x8c41('0x1e')&&typeof _0x1642f0['limit']===_0x8c41('0x1e');var _0x4cafb3=_0xc29bbd[_0x8c41('0x1f')];var _0x51a344=_0x47069a?0x0:_0x1642f0[_0x8c41('0x20')];var _0x36d70f=_0x47069a?_0xc29bbd[_0x8c41('0x1f')]:_0x1642f0[_0x8c41('0x20')]+_0x1642f0[_0x8c41('0x21')];var _0x4ebee1;if(_0x36d70f>=_0x4cafb3){_0x36d70f=_0x4cafb3;_0x4ebee1=0xc8;}else{_0x4ebee1=0xce;}_0x335eed[_0x8c41('0x1c')](_0x4ebee1);return _0x335eed[_0x8c41('0x22')]('Content-Range',_0x51a344+'-'+_0x36d70f+'/'+_0x4cafb3)['json'](_0xc29bbd);}return null;};}function patchUpdates(_0x276f87){return function(_0x1c28d5){try{jsonpatch[_0x8c41('0x23')](_0x1c28d5,_0x276f87,!![]);}catch(_0x2eef71){return BPromise[_0x8c41('0x24')](_0x2eef71);}return _0x1c28d5['save']();};}function saveUpdates(_0x48d141,_0x14682c){return function(_0x3ef865){if(_0x3ef865){return _0x3ef865[_0x8c41('0x25')](_0x48d141)['then'](function(_0x2f0fc4){return _0x2f0fc4;});}return null;};}function removeEntity(_0x528ae6,_0x48b981){return function(_0x556a38){if(_0x556a38){return _0x556a38[_0x8c41('0x26')]()['then'](function(){_0x528ae6[_0x8c41('0x1c')](0xcc)[_0x8c41('0x1b')]();});}};}function handleEntityNotFound(_0x10bfd6,_0x51c543){return function(_0x3b9494){if(!_0x3b9494){_0x10bfd6['sendStatus'](0x194);}return _0x3b9494;};}function handleError(_0x462b5e,_0x2d4e7f){_0x2d4e7f=_0x2d4e7f||0x1f4;return function(_0x44b91e){logger[_0x8c41('0x27')](_0x44b91e[_0x8c41('0x28')]);if(_0x44b91e[_0x8c41('0x29')]){delete _0x44b91e['name'];}_0x462b5e[_0x8c41('0x1c')](_0x2d4e7f)[_0x8c41('0x2a')](_0x44b91e);};}exports[_0x8c41('0x2b')]=function(_0x52ef69,_0x51e2d1){var _0x3a7ef9={},_0x1f486b={},_0x542ec4={'count':0x0,'rows':[]};var _0x27664b=_[_0x8c41('0x2c')](db[_0x8c41('0x2d')][_0x8c41('0x2e')],function(_0x33a1df){return{'name':_0x33a1df[_0x8c41('0x2f')],'type':_0x33a1df[_0x8c41('0x30')][_0x8c41('0x31')]};});_0x1f486b[_0x8c41('0x32')]=_['map'](_0x27664b,_0x8c41('0x29'));_0x1f486b['query']=_[_0x8c41('0x33')](_0x52ef69[_0x8c41('0x34')]);_0x1f486b[_0x8c41('0x35')]=_[_0x8c41('0x36')](_0x1f486b[_0x8c41('0x32')],_0x1f486b['query']);_0x3a7ef9[_0x8c41('0x37')]=_[_0x8c41('0x36')](_0x1f486b[_0x8c41('0x32')],qs[_0x8c41('0x38')](_0x52ef69['query'][_0x8c41('0x38')]));_0x3a7ef9[_0x8c41('0x37')]=_0x3a7ef9['attributes'][_0x8c41('0x39')]?_0x3a7ef9[_0x8c41('0x37')]:_0x1f486b[_0x8c41('0x32')];if(!_0x52ef69[_0x8c41('0x34')]['hasOwnProperty'](_0x8c41('0x3a'))){_0x3a7ef9[_0x8c41('0x21')]=qs[_0x8c41('0x21')](_0x52ef69[_0x8c41('0x34')]['limit']);_0x3a7ef9['offset']=qs[_0x8c41('0x20')](_0x52ef69[_0x8c41('0x34')][_0x8c41('0x20')]);}_0x3a7ef9[_0x8c41('0x3b')]=qs[_0x8c41('0x3c')](_0x52ef69[_0x8c41('0x34')][_0x8c41('0x3c')]);_0x3a7ef9[_0x8c41('0x3d')]=qs[_0x8c41('0x35')](_[_0x8c41('0x3e')](_0x52ef69[_0x8c41('0x34')],_0x1f486b[_0x8c41('0x35')]),_0x27664b);if(_0x52ef69[_0x8c41('0x34')][_0x8c41('0x3f')]){_0x3a7ef9[_0x8c41('0x3d')]=_[_0x8c41('0x40')](_0x3a7ef9[_0x8c41('0x3d')],{'$or':_[_0x8c41('0x2c')](_0x27664b,function(_0x403e82){if(_0x403e82[_0x8c41('0x30')]!=='VIRTUAL'){var _0x4e59df={};_0x4e59df[_0x403e82[_0x8c41('0x29')]]={'$like':'%'+_0x52ef69['query'][_0x8c41('0x3f')]+'%'};return _0x4e59df;}})});}_0x3a7ef9=_[_0x8c41('0x40')]({},_0x3a7ef9,_0x52ef69[_0x8c41('0x41')]);var _0x1bc18d={'where':_0x3a7ef9[_0x8c41('0x3d')]};return db['Automation'][_0x8c41('0x1f')](_0x1bc18d)[_0x8c41('0x42')](function(_0x37c05c){_0x542ec4[_0x8c41('0x1f')]=_0x37c05c;if(_0x52ef69['query'][_0x8c41('0x43')]){_0x3a7ef9[_0x8c41('0x44')]=[{'all':!![]}];}return db[_0x8c41('0x2d')]['findAll'](_0x3a7ef9);})['then'](function(_0x3d2bbb){_0x542ec4[_0x8c41('0x45')]=_0x3d2bbb;return _0x542ec4;})[_0x8c41('0x42')](respondWithFilteredResult(_0x51e2d1,_0x3a7ef9))['catch'](handleError(_0x51e2d1,null));};exports[_0x8c41('0x46')]=function(_0x1b9197,_0x525c2d){var _0x58d211={'raw':![],'where':{'id':_0x1b9197[_0x8c41('0x47')]['id']}},_0x25a675={};_0x25a675[_0x8c41('0x32')]=_['keys'](db[_0x8c41('0x2d')][_0x8c41('0x2e')]);_0x25a675[_0x8c41('0x34')]=_[_0x8c41('0x33')](_0x1b9197[_0x8c41('0x34')]);_0x25a675[_0x8c41('0x35')]=_[_0x8c41('0x36')](_0x25a675[_0x8c41('0x32')],_0x25a675[_0x8c41('0x34')]);_0x58d211[_0x8c41('0x37')]=_['intersection'](_0x25a675[_0x8c41('0x32')],qs[_0x8c41('0x38')](_0x1b9197[_0x8c41('0x34')][_0x8c41('0x38')]));_0x58d211['attributes']=_0x58d211[_0x8c41('0x37')][_0x8c41('0x39')]?_0x58d211['attributes']:_0x25a675[_0x8c41('0x32')];if(_0x1b9197[_0x8c41('0x34')]['includeAll']){_0x58d211[_0x8c41('0x44')]=[{'all':!![]}];}_0x58d211=_[_0x8c41('0x40')]({},_0x58d211,_0x1b9197[_0x8c41('0x41')]);return db[_0x8c41('0x2d')][_0x8c41('0x48')](_0x58d211)[_0x8c41('0x42')](handleEntityNotFound(_0x525c2d,null))[_0x8c41('0x42')](respondWithResult(_0x525c2d,null))[_0x8c41('0x49')](handleError(_0x525c2d,null));};exports['create']=function(_0xa410c7,_0x302bea){return db['Automation'][_0x8c41('0x4a')](_0xa410c7[_0x8c41('0x4b')],{})[_0x8c41('0x42')](respondWithResult(_0x302bea,0xc9))[_0x8c41('0x49')](handleError(_0x302bea,null));};exports[_0x8c41('0x25')]=function(_0x526da9,_0x58febf){if(_0x526da9['body']['id']){delete _0x526da9['body']['id'];}return db[_0x8c41('0x2d')][_0x8c41('0x48')]({'where':{'id':_0x526da9[_0x8c41('0x47')]['id']}})['then'](handleEntityNotFound(_0x58febf,null))['then'](saveUpdates(_0x526da9[_0x8c41('0x4b')],null))[_0x8c41('0x42')](respondWithResult(_0x58febf,null))[_0x8c41('0x49')](handleError(_0x58febf,null));};exports[_0x8c41('0x26')]=function(_0xaa7815,_0x4de7c9){return db[_0x8c41('0x2d')]['find']({'where':{'id':_0xaa7815[_0x8c41('0x47')]['id']}})['then'](handleEntityNotFound(_0x4de7c9,null))[_0x8c41('0x42')](removeEntity(_0x4de7c9,null))['catch'](handleError(_0x4de7c9,null));};exports[_0x8c41('0x4c')]=function(_0x5f3565,_0x52722a,_0x3874c9){return db[_0x8c41('0x4d')][_0x8c41('0x48')]({'where':{'id':_0x5f3565[_0x8c41('0x47')]['id']}})[_0x8c41('0x42')](handleEntityNotFound(_0x52722a,null))[_0x8c41('0x42')](function(_0x573ae2){if(_0x573ae2){return _0x573ae2[_0x8c41('0x4c')](_0x5f3565['body'][_0x8c41('0x4e')],_[_0x8c41('0x4f')](_0x5f3565['body'],['ids','id'])||{});}})[_0x8c41('0x42')](respondWithResult(_0x52722a,null))[_0x8c41('0x49')](handleError(_0x52722a,null));};exports[_0x8c41('0x50')]=function(_0x3565e7,_0x5ecb6,_0x136444){var _0x38721e={};var _0x5e0f1d={};var _0x270b1b;var _0x3f2eb6;return db['Automation']['findOne']({'where':{'id':_0x3565e7[_0x8c41('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ecb6,null))['then'](function(_0x3201ea){if(_0x3201ea){_0x270b1b=_0x3201ea;_0x5e0f1d[_0x8c41('0x32')]=_['keys'](db[_0x8c41('0x4d')][_0x8c41('0x2e')]);_0x5e0f1d[_0x8c41('0x34')]=_['keys'](_0x3565e7['query']);_0x5e0f1d[_0x8c41('0x35')]=_[_0x8c41('0x36')](_0x5e0f1d[_0x8c41('0x32')],_0x5e0f1d[_0x8c41('0x34')]);_0x38721e['attributes']=_['intersection'](_0x5e0f1d[_0x8c41('0x32')],qs['fields'](_0x3565e7[_0x8c41('0x34')][_0x8c41('0x38')]));_0x38721e[_0x8c41('0x37')]=_0x38721e[_0x8c41('0x37')][_0x8c41('0x39')]?_0x38721e[_0x8c41('0x37')]:_0x5e0f1d['model'];_0x38721e['order']=qs['sort'](_0x3565e7[_0x8c41('0x34')][_0x8c41('0x3c')]);_0x38721e[_0x8c41('0x3d')]=qs[_0x8c41('0x35')](_[_0x8c41('0x3e')](_0x3565e7['query'],_0x5e0f1d[_0x8c41('0x35')]));if(_0x3565e7[_0x8c41('0x34')][_0x8c41('0x3f')]){_0x38721e[_0x8c41('0x3d')]=_[_0x8c41('0x40')](_0x38721e[_0x8c41('0x3d')],{'$or':_[_0x8c41('0x2c')](_0x38721e[_0x8c41('0x37')],function(_0x15d619){var _0x2b86d3={};_0x2b86d3[_0x15d619]={'$like':'%'+_0x3565e7[_0x8c41('0x34')][_0x8c41('0x3f')]+'%'};return _0x2b86d3;})});}_0x38721e=_[_0x8c41('0x40')]({},_0x38721e,_0x3565e7[_0x8c41('0x41')]);return _0x270b1b[_0x8c41('0x50')](_0x38721e);}})[_0x8c41('0x42')](function(_0x32aa91){if(_0x32aa91){_0x3f2eb6=_0x32aa91[_0x8c41('0x39')];if(!_0x3565e7['query']['hasOwnProperty'](_0x8c41('0x3a'))){_0x38721e['limit']=qs[_0x8c41('0x21')](_0x3565e7['query'][_0x8c41('0x21')]);_0x38721e['offset']=qs[_0x8c41('0x20')](_0x3565e7[_0x8c41('0x34')][_0x8c41('0x20')]);}return _0x270b1b[_0x8c41('0x50')](_0x38721e);}})[_0x8c41('0x42')](function(_0x371582){if(_0x371582){return _0x371582?{'count':_0x3f2eb6,'rows':_0x371582}:null;}})['then'](respondWithResult(_0x5ecb6,null))['catch'](handleError(_0x5ecb6,null));};exports[_0x8c41('0x51')]=function(_0x158307,_0x5d1768,_0x291546){return db[_0x8c41('0x52')][_0x8c41('0x48')]({'where':{'id':_0x158307['params']['id']}})[_0x8c41('0x42')](handleEntityNotFound(_0x5d1768,null))[_0x8c41('0x42')](function(_0x82f8b7){if(_0x82f8b7){return _0x82f8b7[_0x8c41('0x51')](_0x158307[_0x8c41('0x4b')]['ids'],_[_0x8c41('0x4f')](_0x158307[_0x8c41('0x4b')],[_0x8c41('0x4e'),'id'])||{});}})[_0x8c41('0x42')](respondWithResult(_0x5d1768,null))[_0x8c41('0x49')](handleError(_0x5d1768,null));};exports['getActions']=function(_0x545c66,_0xa85e76,_0x5130d1){var _0x36518a={};var _0x2ff1c0={};var _0x23f15c;var _0x42a22f;return db[_0x8c41('0x2d')][_0x8c41('0x53')]({'where':{'id':_0x545c66['params']['id']}})[_0x8c41('0x42')](handleEntityNotFound(_0xa85e76,null))[_0x8c41('0x42')](function(_0x2e52c4){if(_0x2e52c4){_0x23f15c=_0x2e52c4;_0x2ff1c0[_0x8c41('0x32')]=_[_0x8c41('0x33')](db['Action'][_0x8c41('0x2e')]);_0x2ff1c0[_0x8c41('0x34')]=_[_0x8c41('0x33')](_0x545c66[_0x8c41('0x34')]);_0x2ff1c0[_0x8c41('0x35')]=_[_0x8c41('0x36')](_0x2ff1c0[_0x8c41('0x32')],_0x2ff1c0[_0x8c41('0x34')]);_0x36518a[_0x8c41('0x37')]=_[_0x8c41('0x36')](_0x2ff1c0[_0x8c41('0x32')],qs[_0x8c41('0x38')](_0x545c66[_0x8c41('0x34')]['fields']));_0x36518a['attributes']=_0x36518a[_0x8c41('0x37')][_0x8c41('0x39')]?_0x36518a[_0x8c41('0x37')]:_0x2ff1c0[_0x8c41('0x32')];_0x36518a[_0x8c41('0x3b')]=qs[_0x8c41('0x3c')](_0x545c66[_0x8c41('0x34')][_0x8c41('0x3c')]);_0x36518a['where']=qs[_0x8c41('0x35')](_[_0x8c41('0x3e')](_0x545c66[_0x8c41('0x34')],_0x2ff1c0['filters']));if(_0x545c66[_0x8c41('0x34')][_0x8c41('0x3f')]){_0x36518a['where']=_[_0x8c41('0x40')](_0x36518a[_0x8c41('0x3d')],{'$or':_['map'](_0x36518a['attributes'],function(_0x3e87d5){var _0x354df2={};_0x354df2[_0x3e87d5]={'$like':'%'+_0x545c66[_0x8c41('0x34')][_0x8c41('0x3f')]+'%'};return _0x354df2;})});}_0x36518a=_[_0x8c41('0x40')]({},_0x36518a,_0x545c66[_0x8c41('0x41')]);return _0x23f15c[_0x8c41('0x54')](_0x36518a);}})[_0x8c41('0x42')](function(_0x58f93e){if(_0x58f93e){_0x42a22f=_0x58f93e[_0x8c41('0x39')];if(!_0x545c66[_0x8c41('0x34')][_0x8c41('0x55')](_0x8c41('0x3a'))){_0x36518a['limit']=qs['limit'](_0x545c66[_0x8c41('0x34')][_0x8c41('0x21')]);_0x36518a[_0x8c41('0x20')]=qs[_0x8c41('0x20')](_0x545c66['query']['offset']);}return _0x23f15c[_0x8c41('0x54')](_0x36518a);}})['then'](function(_0x31ffa7){if(_0x31ffa7){return _0x31ffa7?{'count':_0x42a22f,'rows':_0x31ffa7}:null;}})[_0x8c41('0x42')](respondWithResult(_0xa85e76,null))[_0x8c41('0x49')](handleError(_0xa85e76,null));};
\ No newline at end of file
+var _0x8397=['Action','getActions','eml-format','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','update','destroy','name','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','then','includeAll','include','findAll','rows','show','params','intersection','find','create','body','catch','addConditions','ids','omit','getConditions','findOne','Condition','addActions'];(function(_0x3d6bf6,_0x1ecad1){var _0x2c7929=function(_0x2ea51d){while(--_0x2ea51d){_0x3d6bf6['push'](_0x3d6bf6['shift']());}};_0x2c7929(++_0x1ecad1);}(_0x8397,0x12e));var _0x7839=function(_0x1e1818,_0x5bb131){_0x1e1818=_0x1e1818-0x0;var _0x5c7561=_0x8397[_0x1e1818];return _0x5c7561;};'use strict';var emlformat=require(_0x7839('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7839('0x1'));var moment=require('moment');var BPromise=require(_0x7839('0x2'));var Mustache=require(_0x7839('0x3'));var util=require('util');var path=require(_0x7839('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7839('0x5'));var fs=require('fs');var fs_extra=require(_0x7839('0x6'));var _=require(_0x7839('0x7'));var squel=require(_0x7839('0x8'));var crypto=require(_0x7839('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7839('0xa'));var toCsv=require(_0x7839('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7839('0xc'));var authService=require(_0x7839('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x7839('0xe'));var hardwareService=require(_0x7839('0xf'));var logger=require(_0x7839('0x10'))(_0x7839('0x11'));var utils=require(_0x7839('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7839('0x13'))['db'];function respondWithStatusCode(_0x4abdac,_0x3e3c84){_0x3e3c84=_0x3e3c84||0xcc;return function(_0x4be564){if(_0x4be564){return _0x4abdac[_0x7839('0x14')](_0x3e3c84);}return _0x4abdac[_0x7839('0x15')](_0x3e3c84)[_0x7839('0x16')]();};}function respondWithResult(_0x5ccf86,_0xfd43fa){_0xfd43fa=_0xfd43fa||0xc8;return function(_0x7c063a){if(_0x7c063a){return _0x5ccf86['status'](_0xfd43fa)[_0x7839('0x17')](_0x7c063a);}};}function respondWithFilteredResult(_0x300883,_0x1a3850){return function(_0x43e9b7){if(_0x43e9b7){var _0x5693b9=typeof _0x1a3850['offset']==='undefined'&&typeof _0x1a3850[_0x7839('0x18')]==='undefined';var _0xae4f9b=_0x43e9b7[_0x7839('0x19')];var _0xc624a8=_0x5693b9?0x0:_0x1a3850[_0x7839('0x1a')];var _0x562a54=_0x5693b9?_0x43e9b7[_0x7839('0x19')]:_0x1a3850[_0x7839('0x1a')]+_0x1a3850[_0x7839('0x18')];var _0x316a75;if(_0x562a54>=_0xae4f9b){_0x562a54=_0xae4f9b;_0x316a75=0xc8;}else{_0x316a75=0xce;}_0x300883[_0x7839('0x15')](_0x316a75);return _0x300883[_0x7839('0x1b')]('Content-Range',_0xc624a8+'-'+_0x562a54+'/'+_0xae4f9b)['json'](_0x43e9b7);}return null;};}function patchUpdates(_0x25ec1d){return function(_0x3da022){try{jsonpatch['apply'](_0x3da022,_0x25ec1d,!![]);}catch(_0x2206fa){return BPromise['reject'](_0x2206fa);}return _0x3da022['save']();};}function saveUpdates(_0x25726d,_0xc8ceb5){return function(_0x3fccc7){if(_0x3fccc7){return _0x3fccc7[_0x7839('0x1c')](_0x25726d)['then'](function(_0x1af3ee){return _0x1af3ee;});}return null;};}function removeEntity(_0x426b48,_0x49ba43){return function(_0x2545f0){if(_0x2545f0){return _0x2545f0[_0x7839('0x1d')]()['then'](function(){_0x426b48[_0x7839('0x15')](0xcc)[_0x7839('0x16')]();});}};}function handleEntityNotFound(_0xa4bb3,_0x5b1bd5){return function(_0x20b957){if(!_0x20b957){_0xa4bb3['sendStatus'](0x194);}return _0x20b957;};}function handleError(_0x16566c,_0x42a915){_0x42a915=_0x42a915||0x1f4;return function(_0x1840c7){logger['error'](_0x1840c7['stack']);if(_0x1840c7[_0x7839('0x1e')]){delete _0x1840c7[_0x7839('0x1e')];}_0x16566c[_0x7839('0x15')](_0x42a915)['send'](_0x1840c7);};}exports[_0x7839('0x1f')]=function(_0x5118bd,_0x514020){var _0x2adbe3={},_0x1d78a0={},_0x4c5946={'count':0x0,'rows':[]};var _0x5c3267=_[_0x7839('0x20')](db[_0x7839('0x21')][_0x7839('0x22')],function(_0x37642d){return{'name':_0x37642d[_0x7839('0x23')],'type':_0x37642d[_0x7839('0x24')][_0x7839('0x25')]};});_0x1d78a0[_0x7839('0x26')]=_[_0x7839('0x20')](_0x5c3267,'name');_0x1d78a0[_0x7839('0x27')]=_[_0x7839('0x28')](_0x5118bd[_0x7839('0x27')]);_0x1d78a0[_0x7839('0x29')]=_['intersection'](_0x1d78a0[_0x7839('0x26')],_0x1d78a0[_0x7839('0x27')]);_0x2adbe3[_0x7839('0x2a')]=_['intersection'](_0x1d78a0[_0x7839('0x26')],qs['fields'](_0x5118bd[_0x7839('0x27')][_0x7839('0x2b')]));_0x2adbe3[_0x7839('0x2a')]=_0x2adbe3[_0x7839('0x2a')][_0x7839('0x2c')]?_0x2adbe3[_0x7839('0x2a')]:_0x1d78a0[_0x7839('0x26')];if(!_0x5118bd[_0x7839('0x27')][_0x7839('0x2d')](_0x7839('0x2e'))){_0x2adbe3[_0x7839('0x18')]=qs[_0x7839('0x18')](_0x5118bd['query'][_0x7839('0x18')]);_0x2adbe3[_0x7839('0x1a')]=qs[_0x7839('0x1a')](_0x5118bd[_0x7839('0x27')][_0x7839('0x1a')]);}_0x2adbe3[_0x7839('0x2f')]=qs[_0x7839('0x30')](_0x5118bd[_0x7839('0x27')][_0x7839('0x30')]);_0x2adbe3[_0x7839('0x31')]=qs[_0x7839('0x29')](_[_0x7839('0x32')](_0x5118bd[_0x7839('0x27')],_0x1d78a0[_0x7839('0x29')]),_0x5c3267);if(_0x5118bd[_0x7839('0x27')]['filter']){_0x2adbe3[_0x7839('0x31')]=_[_0x7839('0x33')](_0x2adbe3[_0x7839('0x31')],{'$or':_['map'](_0x5c3267,function(_0x569824){if(_0x569824[_0x7839('0x24')]!=='VIRTUAL'){var _0x2fee25={};_0x2fee25[_0x569824[_0x7839('0x1e')]]={'$like':'%'+_0x5118bd[_0x7839('0x27')][_0x7839('0x34')]+'%'};return _0x2fee25;}})});}_0x2adbe3=_['merge']({},_0x2adbe3,_0x5118bd[_0x7839('0x35')]);var _0x5e413f={'where':_0x2adbe3[_0x7839('0x31')]};return db['Automation'][_0x7839('0x19')](_0x5e413f)[_0x7839('0x36')](function(_0x42e72a){_0x4c5946['count']=_0x42e72a;if(_0x5118bd[_0x7839('0x27')][_0x7839('0x37')]){_0x2adbe3[_0x7839('0x38')]=[{'all':!![]}];}return db[_0x7839('0x21')][_0x7839('0x39')](_0x2adbe3);})[_0x7839('0x36')](function(_0x53b71f){_0x4c5946[_0x7839('0x3a')]=_0x53b71f;return _0x4c5946;})[_0x7839('0x36')](respondWithFilteredResult(_0x514020,_0x2adbe3))['catch'](handleError(_0x514020,null));};exports[_0x7839('0x3b')]=function(_0x14171e,_0x46e086){var _0x274ecd={'raw':![],'where':{'id':_0x14171e[_0x7839('0x3c')]['id']}},_0x272792={};_0x272792[_0x7839('0x26')]=_['keys'](db[_0x7839('0x21')][_0x7839('0x22')]);_0x272792[_0x7839('0x27')]=_[_0x7839('0x28')](_0x14171e[_0x7839('0x27')]);_0x272792[_0x7839('0x29')]=_[_0x7839('0x3d')](_0x272792[_0x7839('0x26')],_0x272792['query']);_0x274ecd[_0x7839('0x2a')]=_[_0x7839('0x3d')](_0x272792[_0x7839('0x26')],qs[_0x7839('0x2b')](_0x14171e[_0x7839('0x27')][_0x7839('0x2b')]));_0x274ecd['attributes']=_0x274ecd[_0x7839('0x2a')][_0x7839('0x2c')]?_0x274ecd[_0x7839('0x2a')]:_0x272792[_0x7839('0x26')];if(_0x14171e[_0x7839('0x27')][_0x7839('0x37')]){_0x274ecd['include']=[{'all':!![]}];}_0x274ecd=_[_0x7839('0x33')]({},_0x274ecd,_0x14171e[_0x7839('0x35')]);return db['Automation'][_0x7839('0x3e')](_0x274ecd)[_0x7839('0x36')](handleEntityNotFound(_0x46e086,null))[_0x7839('0x36')](respondWithResult(_0x46e086,null))['catch'](handleError(_0x46e086,null));};exports[_0x7839('0x3f')]=function(_0x235bb9,_0x4d8ff2){return db[_0x7839('0x21')][_0x7839('0x3f')](_0x235bb9[_0x7839('0x40')],{})[_0x7839('0x36')](respondWithResult(_0x4d8ff2,0xc9))['catch'](handleError(_0x4d8ff2,null));};exports[_0x7839('0x1c')]=function(_0x307dbf,_0x5569af){if(_0x307dbf[_0x7839('0x40')]['id']){delete _0x307dbf[_0x7839('0x40')]['id'];}return db[_0x7839('0x21')][_0x7839('0x3e')]({'where':{'id':_0x307dbf['params']['id']}})[_0x7839('0x36')](handleEntityNotFound(_0x5569af,null))[_0x7839('0x36')](saveUpdates(_0x307dbf['body'],null))['then'](respondWithResult(_0x5569af,null))[_0x7839('0x41')](handleError(_0x5569af,null));};exports[_0x7839('0x1d')]=function(_0x51320c,_0x1b2c95){return db[_0x7839('0x21')][_0x7839('0x3e')]({'where':{'id':_0x51320c[_0x7839('0x3c')]['id']}})[_0x7839('0x36')](handleEntityNotFound(_0x1b2c95,null))['then'](removeEntity(_0x1b2c95,null))['catch'](handleError(_0x1b2c95,null));};exports[_0x7839('0x42')]=function(_0x5e6bca,_0x5732bb,_0x3f5512){return db['Condition'][_0x7839('0x3e')]({'where':{'id':_0x5e6bca['params']['id']}})[_0x7839('0x36')](handleEntityNotFound(_0x5732bb,null))[_0x7839('0x36')](function(_0x307f67){if(_0x307f67){return _0x307f67[_0x7839('0x42')](_0x5e6bca[_0x7839('0x40')][_0x7839('0x43')],_[_0x7839('0x44')](_0x5e6bca[_0x7839('0x40')],['ids','id'])||{});}})['then'](respondWithResult(_0x5732bb,null))['catch'](handleError(_0x5732bb,null));};exports[_0x7839('0x45')]=function(_0x1b508c,_0x3b70b1,_0x11c41f){var _0x2a9a8a={};var _0x1b1482={};var _0xb9c0c9;var _0x5e9cae;return db['Automation'][_0x7839('0x46')]({'where':{'id':_0x1b508c[_0x7839('0x3c')]['id']}})[_0x7839('0x36')](handleEntityNotFound(_0x3b70b1,null))['then'](function(_0x1812fe){if(_0x1812fe){_0xb9c0c9=_0x1812fe;_0x1b1482['model']=_['keys'](db[_0x7839('0x47')][_0x7839('0x22')]);_0x1b1482[_0x7839('0x27')]=_['keys'](_0x1b508c[_0x7839('0x27')]);_0x1b1482[_0x7839('0x29')]=_['intersection'](_0x1b1482[_0x7839('0x26')],_0x1b1482[_0x7839('0x27')]);_0x2a9a8a['attributes']=_[_0x7839('0x3d')](_0x1b1482[_0x7839('0x26')],qs[_0x7839('0x2b')](_0x1b508c['query'][_0x7839('0x2b')]));_0x2a9a8a[_0x7839('0x2a')]=_0x2a9a8a[_0x7839('0x2a')][_0x7839('0x2c')]?_0x2a9a8a[_0x7839('0x2a')]:_0x1b1482[_0x7839('0x26')];_0x2a9a8a[_0x7839('0x2f')]=qs[_0x7839('0x30')](_0x1b508c[_0x7839('0x27')]['sort']);_0x2a9a8a[_0x7839('0x31')]=qs[_0x7839('0x29')](_[_0x7839('0x32')](_0x1b508c[_0x7839('0x27')],_0x1b1482[_0x7839('0x29')]));if(_0x1b508c['query'][_0x7839('0x34')]){_0x2a9a8a[_0x7839('0x31')]=_[_0x7839('0x33')](_0x2a9a8a[_0x7839('0x31')],{'$or':_['map'](_0x2a9a8a[_0x7839('0x2a')],function(_0x476af5){var _0x38833d={};_0x38833d[_0x476af5]={'$like':'%'+_0x1b508c[_0x7839('0x27')]['filter']+'%'};return _0x38833d;})});}_0x2a9a8a=_[_0x7839('0x33')]({},_0x2a9a8a,_0x1b508c[_0x7839('0x35')]);return _0xb9c0c9[_0x7839('0x45')](_0x2a9a8a);}})[_0x7839('0x36')](function(_0x55110c){if(_0x55110c){_0x5e9cae=_0x55110c[_0x7839('0x2c')];if(!_0x1b508c[_0x7839('0x27')][_0x7839('0x2d')](_0x7839('0x2e'))){_0x2a9a8a[_0x7839('0x18')]=qs[_0x7839('0x18')](_0x1b508c[_0x7839('0x27')][_0x7839('0x18')]);_0x2a9a8a[_0x7839('0x1a')]=qs[_0x7839('0x1a')](_0x1b508c[_0x7839('0x27')]['offset']);}return _0xb9c0c9[_0x7839('0x45')](_0x2a9a8a);}})[_0x7839('0x36')](function(_0x2b5a1b){if(_0x2b5a1b){return _0x2b5a1b?{'count':_0x5e9cae,'rows':_0x2b5a1b}:null;}})[_0x7839('0x36')](respondWithResult(_0x3b70b1,null))[_0x7839('0x41')](handleError(_0x3b70b1,null));};exports[_0x7839('0x48')]=function(_0x3175ee,_0x2177b4,_0x154130){return db[_0x7839('0x49')][_0x7839('0x3e')]({'where':{'id':_0x3175ee[_0x7839('0x3c')]['id']}})[_0x7839('0x36')](handleEntityNotFound(_0x2177b4,null))[_0x7839('0x36')](function(_0x2caa55){if(_0x2caa55){return _0x2caa55['addActions'](_0x3175ee[_0x7839('0x40')]['ids'],_['omit'](_0x3175ee[_0x7839('0x40')],[_0x7839('0x43'),'id'])||{});}})[_0x7839('0x36')](respondWithResult(_0x2177b4,null))['catch'](handleError(_0x2177b4,null));};exports[_0x7839('0x4a')]=function(_0x220d9e,_0x16c80d,_0x3661c4){var _0x35acc8={};var _0x1953a6={};var _0x4be8b4;var _0x686efc;return db[_0x7839('0x21')]['findOne']({'where':{'id':_0x220d9e[_0x7839('0x3c')]['id']}})[_0x7839('0x36')](handleEntityNotFound(_0x16c80d,null))[_0x7839('0x36')](function(_0x134f84){if(_0x134f84){_0x4be8b4=_0x134f84;_0x1953a6[_0x7839('0x26')]=_[_0x7839('0x28')](db[_0x7839('0x49')]['rawAttributes']);_0x1953a6[_0x7839('0x27')]=_[_0x7839('0x28')](_0x220d9e['query']);_0x1953a6[_0x7839('0x29')]=_[_0x7839('0x3d')](_0x1953a6[_0x7839('0x26')],_0x1953a6[_0x7839('0x27')]);_0x35acc8[_0x7839('0x2a')]=_[_0x7839('0x3d')](_0x1953a6[_0x7839('0x26')],qs[_0x7839('0x2b')](_0x220d9e[_0x7839('0x27')][_0x7839('0x2b')]));_0x35acc8[_0x7839('0x2a')]=_0x35acc8[_0x7839('0x2a')][_0x7839('0x2c')]?_0x35acc8[_0x7839('0x2a')]:_0x1953a6[_0x7839('0x26')];_0x35acc8[_0x7839('0x2f')]=qs['sort'](_0x220d9e[_0x7839('0x27')][_0x7839('0x30')]);_0x35acc8['where']=qs[_0x7839('0x29')](_['pick'](_0x220d9e[_0x7839('0x27')],_0x1953a6['filters']));if(_0x220d9e[_0x7839('0x27')]['filter']){_0x35acc8[_0x7839('0x31')]=_[_0x7839('0x33')](_0x35acc8[_0x7839('0x31')],{'$or':_[_0x7839('0x20')](_0x35acc8['attributes'],function(_0x518a4f){var _0x43353c={};_0x43353c[_0x518a4f]={'$like':'%'+_0x220d9e[_0x7839('0x27')]['filter']+'%'};return _0x43353c;})});}_0x35acc8=_[_0x7839('0x33')]({},_0x35acc8,_0x220d9e['options']);return _0x4be8b4[_0x7839('0x4a')](_0x35acc8);}})[_0x7839('0x36')](function(_0xa52c92){if(_0xa52c92){_0x686efc=_0xa52c92['length'];if(!_0x220d9e[_0x7839('0x27')][_0x7839('0x2d')](_0x7839('0x2e'))){_0x35acc8[_0x7839('0x18')]=qs[_0x7839('0x18')](_0x220d9e[_0x7839('0x27')][_0x7839('0x18')]);_0x35acc8['offset']=qs[_0x7839('0x1a')](_0x220d9e[_0x7839('0x27')][_0x7839('0x1a')]);}return _0x4be8b4['getActions'](_0x35acc8);}})[_0x7839('0x36')](function(_0x271207){if(_0x271207){return _0x271207?{'count':_0x686efc,'rows':_0x271207}:null;}})['then'](respondWithResult(_0x16c80d,null))[_0x7839('0x41')](handleError(_0x16c80d,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 2a0260a..8f06362 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 _0x925d=['lodash','util','api','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5d3397,_0x23a4bc){var _0x16a3c7=function(_0x54750e){while(--_0x54750e){_0x5d3397['push'](_0x5d3397['shift']());}};_0x16a3c7(++_0x23a4bc);}(_0x925d,0x140));var _0xd925=function(_0x547a0d,_0x442e7a){_0x547a0d=_0x547a0d-0x0;var _0x55f12c=_0x925d[_0x547a0d];return _0x55f12c;};'use strict';var _=require(_0xd925('0x0'));var util=require(_0xd925('0x1'));var logger=require('../../config/logger')(_0xd925('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd925('0x3'));var fs=require('fs');var path=require(_0xd925('0x4'));var rimraf=require(_0xd925('0x5'));var config=require(_0xd925('0x6'));var attributes=require('./automation.attributes');module[_0xd925('0x7')]=function(_0x4d0a93,_0x5de7ae){return _0x4d0a93['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x86e3=['../../config/environment','exports','define','Automation','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4948e0,_0x3701d3){var _0x594498=function(_0x4fba8c){while(--_0x4fba8c){_0x4948e0['push'](_0x4948e0['shift']());}};_0x594498(++_0x3701d3);}(_0x86e3,0xa0));var _0x386e=function(_0x35561d,_0x59a5cf){_0x35561d=_0x35561d-0x0;var _0x2ccc5b=_0x86e3[_0x35561d];return _0x2ccc5b;};'use strict';var _=require(_0x386e('0x0'));var util=require('util');var logger=require(_0x386e('0x1'))(_0x386e('0x2'));var moment=require(_0x386e('0x3'));var BPromise=require(_0x386e('0x4'));var rp=require(_0x386e('0x5'));var fs=require('fs');var path=require(_0x386e('0x6'));var rimraf=require(_0x386e('0x7'));var config=require(_0x386e('0x8'));var attributes=require('./automation.attributes');module[_0x386e('0x9')]=function(_0x411681,_0x522c69){return _0x411681[_0x386e('0xa')](_0x386e('0xb'),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 3a9711e..c875009 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 _0x6efe=['error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x32146e,_0x2be230){var _0x375cc7=function(_0xdf3711){while(--_0xdf3711){_0x32146e['push'](_0x32146e['shift']());}};_0x375cc7(++_0x2be230);}(_0x6efe,0xc6));var _0xe6ef=function(_0x1c60a1,_0x11b0e1){_0x1c60a1=_0x1c60a1-0x0;var _0x45a858=_0x6efe[_0x1c60a1];return _0x45a858;};'use strict';var _=require(_0xe6ef('0x0'));var util=require(_0xe6ef('0x1'));var moment=require(_0xe6ef('0x2'));var BPromise=require(_0xe6ef('0x3'));var rs=require(_0xe6ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe6ef('0x5'));var logger=require(_0xe6ef('0x6'))(_0xe6ef('0x7'));var config=require(_0xe6ef('0x8'));var jayson=require(_0xe6ef('0x9'));var client=jayson['client'][_0xe6ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x422e13,_0x599b6c,_0x4a4bb9){return new BPromise(function(_0x51a9eb,_0x3256ff){return client[_0xe6ef('0xb')](_0x422e13,_0x4a4bb9)[_0xe6ef('0xc')](function(_0x4fca2f){logger[_0xe6ef('0xd')]('Automation,\x20%s,\x20%s',_0x599b6c,_0xe6ef('0xe'));logger[_0xe6ef('0xf')](_0xe6ef('0x10'),_0x599b6c,_0xe6ef('0xe'),JSON[_0xe6ef('0x11')](_0x4fca2f));if(_0x4fca2f[_0xe6ef('0x12')]){if(_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x13')]===0x1f4){logger['error'](_0xe6ef('0x14'),_0x599b6c,_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);return _0x3256ff(_0x4fca2f[_0xe6ef('0x12')]['message']);}logger[_0xe6ef('0x12')]('Automation,\x20%s,\x20%s',_0x599b6c,_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);return _0x51a9eb(_0x4fca2f[_0xe6ef('0x12')][_0xe6ef('0x15')]);}else{logger[_0xe6ef('0xd')](_0xe6ef('0x14'),_0x599b6c,_0xe6ef('0xe'));_0x51a9eb(_0x4fca2f[_0xe6ef('0x16')][_0xe6ef('0x15')]);}})[_0xe6ef('0x17')](function(_0x5c32cc){logger[_0xe6ef('0x12')](_0xe6ef('0x14'),_0x599b6c,_0x5c32cc);_0x3256ff(_0x5c32cc);});});}
\ No newline at end of file
+var _0x753c=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2e2eab,_0x2e609a){var _0x2357bc=function(_0x2235ad){while(--_0x2235ad){_0x2e2eab['push'](_0x2e2eab['shift']());}};_0x2357bc(++_0x2e609a);}(_0x753c,0x96));var _0xc753=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x753c[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0xc753('0x0'));var moment=require('moment');var BPromise=require(_0xc753('0x1'));var rs=require(_0xc753('0x2'));var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require(_0xc753('0x6'))(_0xc753('0x7'));var config=require(_0xc753('0x8'));var jayson=require(_0xc753('0x9'));var client=jayson[_0xc753('0xa')][_0xc753('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf96e73,_0xd7ee43,_0x44e544){return new BPromise(function(_0xb80bea,_0x3866e8){return client[_0xc753('0xc')](_0xf96e73,_0x44e544)[_0xc753('0xd')](function(_0x128610){logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,_0xc753('0x10'));logger[_0xc753('0x11')](_0xc753('0x12'),_0xd7ee43,'request\x20sent',JSON[_0xc753('0x13')](_0x128610));if(_0x128610[_0xc753('0x14')]){if(_0x128610['error'][_0xc753('0x15')]===0x1f4){logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610[_0xc753('0x14')][_0xc753('0x16')]);return _0x3866e8(_0x128610['error'][_0xc753('0x16')]);}logger['error'](_0xc753('0xf'),_0xd7ee43,_0x128610['error'][_0xc753('0x16')]);return _0xb80bea(_0x128610[_0xc753('0x14')][_0xc753('0x16')]);}else{logger[_0xc753('0xe')](_0xc753('0xf'),_0xd7ee43,'request\x20sent');_0xb80bea(_0x128610[_0xc753('0x17')][_0xc753('0x16')]);}})[_0xc753('0x18')](function(_0x2e056c){logger[_0xc753('0x14')](_0xc753('0xf'),_0xd7ee43,_0x2e056c);_0x3866e8(_0x2e056c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index f6be194..ab1df2b 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 _0xf4e5=['express','Router','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get','/:id','show','/:id/conditions','/:id/actions','getActions','create','post','addConditions','addActions','put','update','destroy','multer','util','path','connect-timeout'];(function(_0xfd495c,_0x4a3c1a){var _0x561dd8=function(_0x83e915){while(--_0x83e915){_0xfd495c['push'](_0xfd495c['shift']());}};_0x561dd8(++_0x4a3c1a);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x5785fe,_0x359895){_0x5785fe=_0x5785fe-0x0;var _0x57a0e1=_0xf4e5[_0x5785fe];return _0x57a0e1;};'use strict';var multer=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var path=require(_0x5f4e('0x2'));var timeout=require(_0x5f4e('0x3'));var express=require(_0x5f4e('0x4'));var router=express[_0x5f4e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5f4e('0x6'));var config=require(_0x5f4e('0x7'));var controller=require(_0x5f4e('0x8'));router['get']('/',auth[_0x5f4e('0x9')](),controller[_0x5f4e('0xa')]);router[_0x5f4e('0xb')](_0x5f4e('0xc'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0xd')]);router[_0x5f4e('0xb')](_0x5f4e('0xe'),auth[_0x5f4e('0x9')](),controller['getConditions']);router['get'](_0x5f4e('0xf'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x10')]);router['post']('/',auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x11')]);router[_0x5f4e('0x12')](_0x5f4e('0xe'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x13')]);router[_0x5f4e('0x12')](_0x5f4e('0xf'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x14')]);router[_0x5f4e('0x15')]('/:id',auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x16')]);router['delete'](_0x5f4e('0xc'),auth[_0x5f4e('0x9')](),controller[_0x5f4e('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xd882=['destroy','exports','multer','path','connect-timeout','express','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete'];(function(_0x627730,_0x43a922){var _0x3d4df3=function(_0x2bc64c){while(--_0x2bc64c){_0x627730['push'](_0x627730['shift']());}};_0x3d4df3(++_0x43a922);}(_0xd882,0xd1));var _0x2d88=function(_0x21d982,_0x1c6cf5){_0x21d982=_0x21d982-0x0;var _0x1b045d=_0xd882[_0x21d982];return _0x1b045d;};'use strict';var multer=require(_0x2d88('0x0'));var util=require('util');var path=require(_0x2d88('0x1'));var timeout=require(_0x2d88('0x2'));var express=require(_0x2d88('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2d88('0x4'));var controller=require(_0x2d88('0x5'));router[_0x2d88('0x6')]('/',auth[_0x2d88('0x7')](),controller[_0x2d88('0x8')]);router[_0x2d88('0x6')](_0x2d88('0x9'),auth[_0x2d88('0x7')](),controller[_0x2d88('0xa')]);router[_0x2d88('0x6')](_0x2d88('0xb'),auth[_0x2d88('0x7')](),controller[_0x2d88('0xc')]);router[_0x2d88('0x6')](_0x2d88('0xd'),auth[_0x2d88('0x7')](),controller[_0x2d88('0xe')]);router[_0x2d88('0xf')]('/',auth[_0x2d88('0x7')](),controller['create']);router['post'](_0x2d88('0xb'),auth[_0x2d88('0x7')](),controller[_0x2d88('0x10')]);router[_0x2d88('0xf')](_0x2d88('0xd'),auth[_0x2d88('0x7')](),controller[_0x2d88('0x11')]);router[_0x2d88('0x12')](_0x2d88('0x9'),auth['isAuthenticated'](),controller[_0x2d88('0x13')]);router[_0x2d88('0x14')]('/:id',auth[_0x2d88('0x7')](),controller[_0x2d88('0x15')]);module[_0x2d88('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 7309277..b6e69bb 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 _0xdfc0=['UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdfc0,0x1aa));var _0x0dfc=function(_0x169f05,_0x451867){_0x169f05=_0x169f05-0x0;var _0x44c984=_0xdfc0[_0x169f05];return _0x44c984;};'use strict';var Sequelize=require(_0x0dfc('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dfc('0x1')],'unique':_0x0dfc('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0dfc('0x3')](_0x0dfc('0x4')),'allowNull':![],'defaultValue':_0x0dfc('0x4')},'description':{'type':Sequelize[_0x0dfc('0x1')]},'active':{'type':Sequelize[_0x0dfc('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x0dfc('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0dfc('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0dfc('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0dfc('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0dfc('0x6')](0x3)[_0x0dfc('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x0dfc('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0dfc('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0dfc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0dfc('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0dfc('0x6')](0x5)[_0x0dfc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0dfc('0x6')](0x3)[_0x0dfc('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0dfc('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0dfc('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0dfc('0x1')],'defaultValue':_0x0dfc('0xa')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x0dfc('0xb'),_0x0dfc('0xc')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0dfc('0x5')],'defaultValue':0x0,'comment':_0x0dfc('0xd')},'dialAMDInitialSilence':{'type':Sequelize[_0x0dfc('0x6')](0x9)[_0x0dfc('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0dfc('0x6')](0x9)[_0x0dfc('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0dfc('0xe')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0dfc('0x6')](0x9)[_0x0dfc('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0dfc('0x6')](0x9)[_0x0dfc('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0dfc('0xf')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0dfc('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0dfc('0x10')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0dfc('0x6')](0x9)[_0x0dfc('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0dfc('0x11')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0dfc('0x6')](0x9)[_0x0dfc('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0dfc('0x12')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0dfc('0x6')](0x5)[_0x0dfc('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0dfc('0x13')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0dfc('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0dfc('0x14')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x0dfc('0x15'),_0x0dfc('0x16')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0dfc('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0dfc('0x6')](0x3)[_0x0dfc('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0dfc('0x17')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0dfc('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0dfc('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0dfc('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0dfc('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0dfc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0dfc('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0x0dfc('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0dfc('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0x0dfc('0x6')](0x5)[_0x0dfc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0dfc('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0dfc('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0dfc('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0dfc('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0dfc('0x6')](0x5)[_0x0dfc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0dfc('0x6')](0x3)[_0x0dfc('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0dfc('0x6')](0x5)[_0x0dfc('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0dfc('0x1e')}};
\ No newline at end of file
+var _0xeb1c=['AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Max\x20200\x20calls.','INTEGER','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','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','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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)'];(function(_0x4c5c97,_0x4f85bf){var _0xd5d2cb=function(_0x1e6100){while(--_0x1e6100){_0x4c5c97['push'](_0x4c5c97['shift']());}};_0xd5d2cb(++_0x4f85bf);}(_0xeb1c,0x119));var _0xceb1=function(_0x360fc7,_0x5cd3e7){_0x360fc7=_0x360fc7-0x0;var _0x42f8ee=_0xeb1c[_0x360fc7];return _0x42f8ee;};'use strict';var Sequelize=require(_0xceb1('0x0'));module['exports']={'name':{'type':Sequelize[_0xceb1('0x1')],'unique':_0xceb1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xceb1('0x3')),'allowNull':![],'defaultValue':_0xceb1('0x3')},'description':{'type':Sequelize[_0xceb1('0x1')]},'active':{'type':Sequelize[_0xceb1('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xceb1('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0xceb1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xceb1('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xceb1('0x6')](0x3)[_0xceb1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xceb1('0x6')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0xceb1('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0xceb1('0x6')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xceb1('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xceb1('0x6')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xceb1('0x6')](0x3)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xceb1('0xe')},'dialTimezone':{'type':Sequelize[_0xceb1('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xceb1('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xceb1('0xf')](_0xceb1('0x10'),_0xceb1('0x11'),_0xceb1('0x12')),'defaultValue':_0xceb1('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xceb1('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xceb1('0x6')](0x9)[_0xceb1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xceb1('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xceb1('0x6')](0x9)[_0xceb1('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xceb1('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xceb1('0x6')](0x9)[_0xceb1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xceb1('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xceb1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceb1('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xceb1('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xceb1('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xceb1('0x6')](0x9)[_0xceb1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xceb1('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xceb1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xceb1('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xceb1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xceb1('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xceb1('0x6')](0x9)[_0xceb1('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xceb1('0x1c'),_0xceb1('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xceb1('0x6')](0x3)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xceb1('0x6')](0x3)[_0xceb1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceb1('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xceb1('0x6')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0xceb1('0x6')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xceb1('0x6')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xceb1('0x6')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xceb1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0xceb1('0x6')](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0xceb1('0x6')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceb1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceb1('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xceb1('0x6')](0x5)[_0xceb1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceb1('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 6a9bea5..da115ec 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 _0xb8ac=['to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','Campaign','includeAll','include','findAll','show','params','model','merge','catch','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','omit','createdAt','updatedAt','IvrCampaigns','update','body','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','deletedAt\x20IS\x20NULL','insert','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0xb8ac,0x10b));var _0xcb8a=function(_0xf2760,_0x2a3d49){_0xf2760=_0xf2760-0x0;var _0x17d9ac=_0xb8ac[_0xf2760];return _0x17d9ac;};'use strict';var emlformat=require(_0xcb8a('0x0'));var rimraf=require(_0xcb8a('0x1'));var zipdir=require(_0xcb8a('0x2'));var jsonpatch=require(_0xcb8a('0x3'));var rp=require(_0xcb8a('0x4'));var moment=require(_0xcb8a('0x5'));var BPromise=require(_0xcb8a('0x6'));var Mustache=require(_0xcb8a('0x7'));var util=require(_0xcb8a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcb8a('0x9'));var ejs=require(_0xcb8a('0xa'));var fs=require('fs');var fs_extra=require(_0xcb8a('0xb'));var _=require(_0xcb8a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcb8a('0xd'));var deskjs=require(_0xcb8a('0xe'));var toCsv=require(_0xcb8a('0x9'));var querystring=require(_0xcb8a('0xf'));var Papa=require(_0xcb8a('0x10'));var Redis=require(_0xcb8a('0x11'));var authService=require(_0xcb8a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcb8a('0x13'));var logger=require(_0xcb8a('0x14'))(_0xcb8a('0x15'));var utils=require('../../config/utils');var config=require(_0xcb8a('0x16'));var licenseUtil=require(_0xcb8a('0x17'));var db=require(_0xcb8a('0x18'))['db'];function respondWithStatusCode(_0x59932e,_0x5f0a5a){_0x5f0a5a=_0x5f0a5a||0xcc;return function(_0x519215){if(_0x519215){return _0x59932e['sendStatus'](_0x5f0a5a);}return _0x59932e['status'](_0x5f0a5a)[_0xcb8a('0x19')]();};}function respondWithResult(_0x49fc3b,_0x78f72f){_0x78f72f=_0x78f72f||0xc8;return function(_0x136c82){if(_0x136c82){return _0x49fc3b['status'](_0x78f72f)[_0xcb8a('0x1a')](_0x136c82);}};}function respondWithFilteredResult(_0x5a1481,_0x1eed8a){return function(_0x13a340){if(_0x13a340){var _0x529703=typeof _0x1eed8a[_0xcb8a('0x1b')]===_0xcb8a('0x1c')&&typeof _0x1eed8a['limit']==='undefined';var _0x475db6=_0x13a340[_0xcb8a('0x1d')];var _0x20d81c=_0x529703?0x0:_0x1eed8a[_0xcb8a('0x1b')];var _0x259cea=_0x529703?_0x13a340[_0xcb8a('0x1d')]:_0x1eed8a['offset']+_0x1eed8a[_0xcb8a('0x1e')];var _0x130af6;if(_0x259cea>=_0x475db6){_0x259cea=_0x475db6;_0x130af6=0xc8;}else{_0x130af6=0xce;}_0x5a1481[_0xcb8a('0x1f')](_0x130af6);return _0x5a1481[_0xcb8a('0x20')](_0xcb8a('0x21'),_0x20d81c+'-'+_0x259cea+'/'+_0x475db6)[_0xcb8a('0x1a')](_0x13a340);}return null;};}function patchUpdates(_0x2cdae7){return function(_0x378410){try{jsonpatch[_0xcb8a('0x22')](_0x378410,_0x2cdae7,!![]);}catch(_0x58772c){return BPromise[_0xcb8a('0x23')](_0x58772c);}return _0x378410[_0xcb8a('0x24')]();};}function saveUpdates(_0xe49140,_0x50e346){return function(_0x2ac6ea){if(_0x2ac6ea){return _0x2ac6ea['update'](_0xe49140)[_0xcb8a('0x25')](function(_0x23c05b){return _0x23c05b;});}return null;};}function removeEntity(_0x47d280,_0x1c042f){return function(_0x422f93){if(_0x422f93){return _0x422f93[_0xcb8a('0x26')]()[_0xcb8a('0x25')](function(){var _0x36fde6=_0x422f93[_0xcb8a('0x27')]({'plain':!![]});var _0x29825c='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x29825c,'resourceId':_0x36fde6['id']}})[_0xcb8a('0x25')](function(){return _0x422f93;});})[_0xcb8a('0x25')](function(){_0x47d280['status'](0xcc)[_0xcb8a('0x19')]();});}};}function handleEntityNotFound(_0x35d02f,_0x4b0ff5){return function(_0x62f277){if(!_0x62f277){_0x35d02f[_0xcb8a('0x28')](0x194);}return _0x62f277;};}function handleError(_0x4e6227,_0x3f71d6){_0x3f71d6=_0x3f71d6||0x1f4;return function(_0x534e75){logger[_0xcb8a('0x29')](_0x534e75['stack']);if(_0x534e75[_0xcb8a('0x2a')]){delete _0x534e75[_0xcb8a('0x2a')];}_0x4e6227[_0xcb8a('0x1f')](_0x3f71d6)[_0xcb8a('0x2b')](_0x534e75);};}exports[_0xcb8a('0x2c')]=function(_0x22be75,_0x1c9833){var _0x2fe306={},_0xaa3c55={},_0x4dd85f={'count':0x0,'rows':[]};var _0x348a8c=_[_0xcb8a('0x2d')](db['Campaign'][_0xcb8a('0x2e')],function(_0x3e874c){return{'name':_0x3e874c[_0xcb8a('0x2f')],'type':_0x3e874c[_0xcb8a('0x30')][_0xcb8a('0x31')]};});_0xaa3c55['model']=_[_0xcb8a('0x2d')](_0x348a8c,'name');_0xaa3c55[_0xcb8a('0x32')]=_[_0xcb8a('0x33')](_0x22be75[_0xcb8a('0x32')]);_0xaa3c55['filters']=_[_0xcb8a('0x34')](_0xaa3c55['model'],_0xaa3c55['query']);_0x2fe306[_0xcb8a('0x35')]=_[_0xcb8a('0x34')](_0xaa3c55['model'],qs[_0xcb8a('0x36')](_0x22be75[_0xcb8a('0x32')][_0xcb8a('0x36')]));_0x2fe306[_0xcb8a('0x35')]=_0x2fe306[_0xcb8a('0x35')][_0xcb8a('0x37')]?_0x2fe306[_0xcb8a('0x35')]:_0xaa3c55['model'];if(!_0x22be75[_0xcb8a('0x32')]['hasOwnProperty'](_0xcb8a('0x38'))){_0x2fe306[_0xcb8a('0x1e')]=qs[_0xcb8a('0x1e')](_0x22be75[_0xcb8a('0x32')][_0xcb8a('0x1e')]);_0x2fe306[_0xcb8a('0x1b')]=qs[_0xcb8a('0x1b')](_0x22be75[_0xcb8a('0x32')]['offset']);}_0x2fe306['order']=qs['sort'](_0x22be75['query'][_0xcb8a('0x39')]);_0x2fe306[_0xcb8a('0x3a')]=qs[_0xcb8a('0x3b')](_[_0xcb8a('0x3c')](_0x22be75[_0xcb8a('0x32')],_0xaa3c55['filters']),_0x348a8c);if(_0x22be75[_0xcb8a('0x32')][_0xcb8a('0x3d')]){_0x2fe306[_0xcb8a('0x3a')]=_['merge'](_0x2fe306['where'],{'$or':_['map'](_0x348a8c,function(_0x5ece2b){if(_0x5ece2b[_0xcb8a('0x30')]!==_0xcb8a('0x3e')){var _0x635cef={};_0x635cef[_0x5ece2b['name']]={'$like':'%'+_0x22be75[_0xcb8a('0x32')][_0xcb8a('0x3d')]+'%'};return _0x635cef;}})});}_0x2fe306=_['merge']({},_0x2fe306,_0x22be75[_0xcb8a('0x3f')]);var _0x532db2={'where':_0x2fe306['where']};return db[_0xcb8a('0x40')][_0xcb8a('0x1d')](_0x532db2)[_0xcb8a('0x25')](function(_0x3a6bff){_0x4dd85f[_0xcb8a('0x1d')]=_0x3a6bff;if(_0x22be75[_0xcb8a('0x32')][_0xcb8a('0x41')]){_0x2fe306[_0xcb8a('0x42')]=[{'all':!![]}];}return db['Campaign'][_0xcb8a('0x43')](_0x2fe306);})[_0xcb8a('0x25')](function(_0x29a86f){_0x4dd85f['rows']=_0x29a86f;return _0x4dd85f;})[_0xcb8a('0x25')](respondWithFilteredResult(_0x1c9833,_0x2fe306))['catch'](handleError(_0x1c9833,null));};exports[_0xcb8a('0x44')]=function(_0x5946c7,_0x34e3e3){var _0x4f53fd={'raw':![],'where':{'id':_0x5946c7[_0xcb8a('0x45')]['id']}},_0x3a1457={};_0x3a1457['model']=_[_0xcb8a('0x33')](db[_0xcb8a('0x40')][_0xcb8a('0x2e')]);_0x3a1457['query']=_['keys'](_0x5946c7[_0xcb8a('0x32')]);_0x3a1457[_0xcb8a('0x3b')]=_[_0xcb8a('0x34')](_0x3a1457[_0xcb8a('0x46')],_0x3a1457['query']);_0x4f53fd['attributes']=_[_0xcb8a('0x34')](_0x3a1457[_0xcb8a('0x46')],qs['fields'](_0x5946c7[_0xcb8a('0x32')][_0xcb8a('0x36')]));_0x4f53fd[_0xcb8a('0x35')]=_0x4f53fd[_0xcb8a('0x35')][_0xcb8a('0x37')]?_0x4f53fd[_0xcb8a('0x35')]:_0x3a1457[_0xcb8a('0x46')];if(_0x5946c7['query'][_0xcb8a('0x41')]){_0x4f53fd[_0xcb8a('0x42')]=[{'all':!![]}];}_0x4f53fd=_[_0xcb8a('0x47')]({},_0x4f53fd,_0x5946c7[_0xcb8a('0x3f')]);return db[_0xcb8a('0x40')]['find'](_0x4f53fd)[_0xcb8a('0x25')](handleEntityNotFound(_0x34e3e3,null))[_0xcb8a('0x25')](respondWithResult(_0x34e3e3,null))[_0xcb8a('0x48')](handleError(_0x34e3e3,null));};exports['create']=function(_0x19d5ec,_0x3e9330){return db[_0xcb8a('0x40')][_0xcb8a('0x49')](_0x19d5ec['body'],{})['then'](function(_0x58a8b1){var _0x3ed851=_0x19d5ec[_0xcb8a('0x4a')][_0xcb8a('0x27')]({'plain':!![]});if(!_0x3ed851)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ed851[_0xcb8a('0x4b')]==='user'){var _0x48fcd0=_0x58a8b1[_0xcb8a('0x27')]({'plain':!![]});var _0x5e0112='IvrCampaigns';return db[_0xcb8a('0x4c')][_0xcb8a('0x4d')]({'where':{'name':_0x5e0112,'userProfileId':_0x3ed851[_0xcb8a('0x4e')]},'raw':!![]})[_0xcb8a('0x25')](function(_0x3c6d12){if(_0x3c6d12&&_0x3c6d12[_0xcb8a('0x4f')]===0x0){return db[_0xcb8a('0x50')][_0xcb8a('0x49')]({'name':_0x48fcd0[_0xcb8a('0x2a')],'resourceId':_0x48fcd0['id'],'type':_0x3c6d12['name'],'sectionId':_0x3c6d12['id']},{})[_0xcb8a('0x25')](function(){return _0x58a8b1;});}else{return _0x58a8b1;}})[_0xcb8a('0x48')](function(_0x1ed7bd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1ed7bd);throw _0x1ed7bd;});}return _0x58a8b1;})[_0xcb8a('0x25')](respondWithResult(_0x3e9330,0xc9))['catch'](handleError(_0x3e9330,null));};exports['clone']=function(_0x495fb6,_0x55ffd5){var _0x1962fe={'where':{'id':_0x495fb6[_0xcb8a('0x45')]['id']}},_0x4cbef3={};_0x4cbef3[_0xcb8a('0x46')]=_[_0xcb8a('0x33')](db[_0xcb8a('0x40')][_0xcb8a('0x2e')]);_0x1962fe[_0xcb8a('0x35')]=_['intersection'](_0x4cbef3[_0xcb8a('0x46')],qs[_0xcb8a('0x36')](_0x495fb6[_0xcb8a('0x32')]['fields']));_0x1962fe[_0xcb8a('0x35')]=_0x1962fe[_0xcb8a('0x35')][_0xcb8a('0x37')]?_0x1962fe[_0xcb8a('0x35')]:_0x4cbef3[_0xcb8a('0x46')];if(_0x495fb6[_0xcb8a('0x32')][_0xcb8a('0x41')]){_0x1962fe[_0xcb8a('0x42')]=[{'all':!![]}];}_0x1962fe=_[_0xcb8a('0x47')]({},_0x1962fe,_0x495fb6[_0xcb8a('0x3f')]);return db[_0xcb8a('0x40')]['find'](_0x1962fe)[_0xcb8a('0x25')](handleEntityNotFound(_0x55ffd5,null))['then'](function(_0x58e580){if(_0x58e580){var _0x4cbb8e=_0x58e580['get']({'plain':!![]});_0x4cbb8e=qs[_0xcb8a('0x51')](_0x4cbb8e,['id',_0xcb8a('0x52'),'updatedAt']);_0x495fb6['body']=_['omit'](_0x495fb6['body'],['id',_0xcb8a('0x52'),_0xcb8a('0x53')]);return db[_0xcb8a('0x40')]['create'](_[_0xcb8a('0x47')](_0x4cbb8e,_0x495fb6['body']),{'include':_0x495fb6[_0xcb8a('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0xcb8a('0x25')](function(_0x3dc3dc){var _0x5239f6=_0x495fb6[_0xcb8a('0x4a')]['get']({'plain':!![]});if(!_0x5239f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5239f6[_0xcb8a('0x4b')]===_0xcb8a('0x4a')){var _0x53b3f3=_0x3dc3dc[_0xcb8a('0x27')]({'plain':!![]});var _0x162965=_0xcb8a('0x54');return db[_0xcb8a('0x4c')][_0xcb8a('0x4d')]({'where':{'name':_0x162965,'userProfileId':_0x5239f6['userProfileId']},'raw':!![]})[_0xcb8a('0x25')](function(_0x4941e6){if(_0x4941e6&&_0x4941e6[_0xcb8a('0x4f')]===0x0){return db[_0xcb8a('0x50')][_0xcb8a('0x49')]({'name':_0x53b3f3[_0xcb8a('0x2a')],'resourceId':_0x53b3f3['id'],'type':_0x4941e6[_0xcb8a('0x2a')],'sectionId':_0x4941e6['id']},{})[_0xcb8a('0x25')](function(){return _0x3dc3dc;});}else{return _0x3dc3dc;}})[_0xcb8a('0x48')](function(_0x3bcbdc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bcbdc);throw _0x3bcbdc;});}return _0x3dc3dc;});}})['then'](respondWithResult(_0x55ffd5,0xc9))[_0xcb8a('0x48')](handleError(_0x55ffd5,null));};exports[_0xcb8a('0x55')]=function(_0xd0c25e,_0x54aae7){if(_0xd0c25e[_0xcb8a('0x56')]['id']){delete _0xd0c25e['body']['id'];}return db[_0xcb8a('0x40')][_0xcb8a('0x4d')]({'where':{'id':_0xd0c25e[_0xcb8a('0x45')]['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0x54aae7,null))[_0xcb8a('0x25')](saveUpdates(_0xd0c25e[_0xcb8a('0x56')],null))[_0xcb8a('0x25')](respondWithResult(_0x54aae7,null))['catch'](handleError(_0x54aae7,null));};exports['destroy']=function(_0x38e72b,_0x50bcf8){return db[_0xcb8a('0x40')][_0xcb8a('0x4d')]({'where':{'id':_0x38e72b[_0xcb8a('0x45')]['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0x50bcf8,null))[_0xcb8a('0x25')](removeEntity(_0x50bcf8,null))[_0xcb8a('0x48')](handleError(_0x50bcf8,null));};exports[_0xcb8a('0x57')]=function(_0x4816d9,_0x35248d,_0x2806b9){var _0x25d24f={'raw':!![],'where':{}};var _0x43ec88={};var _0x1e536f={'count':0x0,'rows':[]};return db[_0xcb8a('0x40')][_0xcb8a('0x58')]({'where':{'id':_0x4816d9[_0xcb8a('0x45')]['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0x35248d,null))[_0xcb8a('0x25')](function(_0x1ed925){if(_0x1ed925){_0x43ec88['model']=_['keys'](db[_0xcb8a('0x59')][_0xcb8a('0x2e')]);_0x43ec88['query']=_[_0xcb8a('0x33')](_0x4816d9[_0xcb8a('0x32')]);_0x43ec88[_0xcb8a('0x3b')]=_[_0xcb8a('0x34')](_0x43ec88[_0xcb8a('0x46')],_0x43ec88[_0xcb8a('0x32')]);_0x25d24f[_0xcb8a('0x35')]=_[_0xcb8a('0x34')](_0x43ec88[_0xcb8a('0x46')],qs['fields'](_0x4816d9[_0xcb8a('0x32')][_0xcb8a('0x36')]));_0x25d24f[_0xcb8a('0x35')]=_0x25d24f['attributes'][_0xcb8a('0x37')]?_0x25d24f['attributes']:_0x43ec88[_0xcb8a('0x46')];if(!_0x4816d9[_0xcb8a('0x32')][_0xcb8a('0x5a')]('nolimit')){_0x25d24f[_0xcb8a('0x1e')]=qs['limit'](_0x4816d9['query'][_0xcb8a('0x1e')]);_0x25d24f['offset']=qs[_0xcb8a('0x1b')](_0x4816d9['query'][_0xcb8a('0x1b')]);}_0x25d24f[_0xcb8a('0x5b')]=qs['sort'](_0x4816d9['query'][_0xcb8a('0x39')]);_0x25d24f[_0xcb8a('0x3a')]=qs['filters'](_['pick'](_0x4816d9[_0xcb8a('0x32')],_0x43ec88[_0xcb8a('0x3b')]));_0x25d24f[_0xcb8a('0x3a')][_0xcb8a('0x5c')]=_0x1ed925['id'];if(_0x4816d9[_0xcb8a('0x32')][_0xcb8a('0x3d')]){_0x25d24f[_0xcb8a('0x3a')]=_['merge'](_0x25d24f[_0xcb8a('0x3a')],{'$or':_[_0xcb8a('0x2d')](_0x25d24f[_0xcb8a('0x35')],function(_0x707557){var _0x361b5e={};_0x361b5e[_0x707557]={'$like':'%'+_0x4816d9[_0xcb8a('0x32')]['filter']+'%'};return _0x361b5e;})});}_0x25d24f=_[_0xcb8a('0x47')]({},_0x25d24f,_0x4816d9[_0xcb8a('0x3f')]);return db[_0xcb8a('0x59')]['count']({'where':_0x25d24f['where']})[_0xcb8a('0x25')](function(_0x2bac27){_0x1e536f[_0xcb8a('0x1d')]=_0x2bac27;if(_0x4816d9[_0xcb8a('0x32')][_0xcb8a('0x41')]){_0x25d24f[_0xcb8a('0x42')]=[{'all':!![]}];}return db[_0xcb8a('0x59')]['findAll'](_0x25d24f);})['then'](function(_0x531f6f){_0x1e536f[_0xcb8a('0x5d')]=_0x531f6f;return _0x1e536f;});}})[_0xcb8a('0x25')](respondWithFilteredResult(_0x35248d,_0x25d24f))[_0xcb8a('0x48')](handleError(_0x35248d,null));};exports[_0xcb8a('0x5e')]=function(_0x150e00,_0xd23a30,_0x219726){var _0x28b7d7={'raw':!![],'where':{}};var _0x5b35db={};var _0x13dc2c={'count':0x0,'rows':[]};return db['Campaign'][_0xcb8a('0x58')]({'where':{'id':_0x150e00['params']['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0xd23a30,null))['then'](function(_0x5b9aea){if(_0x5b9aea){_0x5b35db[_0xcb8a('0x46')]=_[_0xcb8a('0x33')](db[_0xcb8a('0x5f')][_0xcb8a('0x2e')]);_0x5b35db[_0xcb8a('0x32')]=_[_0xcb8a('0x33')](_0x150e00['query']);_0x5b35db[_0xcb8a('0x3b')]=_[_0xcb8a('0x34')](_0x5b35db[_0xcb8a('0x46')],_0x5b35db[_0xcb8a('0x32')]);_0x28b7d7['attributes']=_[_0xcb8a('0x34')](_0x5b35db[_0xcb8a('0x46')],qs[_0xcb8a('0x36')](_0x150e00[_0xcb8a('0x32')][_0xcb8a('0x36')]));_0x28b7d7[_0xcb8a('0x35')]=_0x28b7d7[_0xcb8a('0x35')]['length']?_0x28b7d7[_0xcb8a('0x35')]:_0x5b35db[_0xcb8a('0x46')];if(!_0x150e00['query'][_0xcb8a('0x5a')](_0xcb8a('0x38'))){_0x28b7d7[_0xcb8a('0x1e')]=qs[_0xcb8a('0x1e')](_0x150e00[_0xcb8a('0x32')][_0xcb8a('0x1e')]);_0x28b7d7[_0xcb8a('0x1b')]=qs[_0xcb8a('0x1b')](_0x150e00[_0xcb8a('0x32')]['offset']);}_0x28b7d7[_0xcb8a('0x5b')]=qs[_0xcb8a('0x39')](_0x150e00['query'][_0xcb8a('0x39')]);_0x28b7d7[_0xcb8a('0x3a')]=qs[_0xcb8a('0x3b')](_[_0xcb8a('0x3c')](_0x150e00[_0xcb8a('0x32')],_0x5b35db[_0xcb8a('0x3b')]));_0x28b7d7[_0xcb8a('0x3a')][_0xcb8a('0x5c')]=_0x5b9aea['id'];if(_0x150e00['query'][_0xcb8a('0x3d')]){_0x28b7d7['where']=_[_0xcb8a('0x47')](_0x28b7d7[_0xcb8a('0x3a')],{'$or':_[_0xcb8a('0x2d')](_0x28b7d7['attributes'],function(_0x19b156){var _0x5052e2={};_0x5052e2[_0x19b156]={'$like':'%'+_0x150e00[_0xcb8a('0x32')][_0xcb8a('0x3d')]+'%'};return _0x5052e2;})});}_0x28b7d7=_[_0xcb8a('0x47')]({},_0x28b7d7,_0x150e00[_0xcb8a('0x3f')]);return db[_0xcb8a('0x5f')][_0xcb8a('0x1d')]({'where':_0x28b7d7[_0xcb8a('0x3a')]})[_0xcb8a('0x25')](function(_0x201731){_0x13dc2c[_0xcb8a('0x1d')]=_0x201731;if(_0x150e00[_0xcb8a('0x32')][_0xcb8a('0x41')]){_0x28b7d7[_0xcb8a('0x42')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x28b7d7);})[_0xcb8a('0x25')](function(_0x2b52ff){_0x13dc2c[_0xcb8a('0x5d')]=_0x2b52ff;return _0x13dc2c;});}})['then'](respondWithFilteredResult(_0xd23a30,_0x28b7d7))[_0xcb8a('0x48')](handleError(_0xd23a30,null));};exports[_0xcb8a('0x60')]=function(_0x185e73,_0x2232ae,_0x184325){var _0x2ad26e={'raw':!![],'where':{}};var _0x52ef1b={};var _0x13d4f1={'count':0x0,'rows':[]};return db[_0xcb8a('0x40')][_0xcb8a('0x58')]({'where':{'id':_0x185e73[_0xcb8a('0x45')]['id']}})['then'](handleEntityNotFound(_0x2232ae,null))[_0xcb8a('0x25')](function(_0x1b2d7d){if(_0x1b2d7d){_0x52ef1b[_0xcb8a('0x46')]=_[_0xcb8a('0x33')](db['CmHopperFinal'][_0xcb8a('0x2e')]);_0x52ef1b[_0xcb8a('0x32')]=_['keys'](_0x185e73[_0xcb8a('0x32')]);_0x52ef1b[_0xcb8a('0x3b')]=_['intersection'](_0x52ef1b[_0xcb8a('0x46')],_0x52ef1b['query']);_0x2ad26e[_0xcb8a('0x35')]=_[_0xcb8a('0x34')](_0x52ef1b['model'],qs[_0xcb8a('0x36')](_0x185e73[_0xcb8a('0x32')][_0xcb8a('0x36')]));_0x2ad26e[_0xcb8a('0x35')]=_0x2ad26e[_0xcb8a('0x35')][_0xcb8a('0x37')]?_0x2ad26e[_0xcb8a('0x35')]:_0x52ef1b['model'];if(!_0x185e73[_0xcb8a('0x32')][_0xcb8a('0x5a')](_0xcb8a('0x38'))){_0x2ad26e[_0xcb8a('0x1e')]=qs[_0xcb8a('0x1e')](_0x185e73[_0xcb8a('0x32')]['limit']);_0x2ad26e['offset']=qs[_0xcb8a('0x1b')](_0x185e73['query'][_0xcb8a('0x1b')]);}_0x2ad26e['order']=qs['sort'](_0x185e73[_0xcb8a('0x32')][_0xcb8a('0x39')]);_0x2ad26e[_0xcb8a('0x3a')]=qs['filters'](_[_0xcb8a('0x3c')](_0x185e73[_0xcb8a('0x32')],_0x52ef1b[_0xcb8a('0x3b')]));_0x2ad26e[_0xcb8a('0x3a')][_0xcb8a('0x5c')]=_0x1b2d7d['id'];if(_0x185e73[_0xcb8a('0x32')][_0xcb8a('0x3d')]){_0x2ad26e[_0xcb8a('0x3a')]=_[_0xcb8a('0x47')](_0x2ad26e['where'],{'$or':_[_0xcb8a('0x2d')](_0x2ad26e['attributes'],function(_0x208cbf){var _0x2b829c={};_0x2b829c[_0x208cbf]={'$like':'%'+_0x185e73['query']['filter']+'%'};return _0x2b829c;})});}_0x2ad26e=_['merge']({},_0x2ad26e,_0x185e73[_0xcb8a('0x3f')]);return db[_0xcb8a('0x61')][_0xcb8a('0x1d')]({'where':_0x2ad26e['where']})[_0xcb8a('0x25')](function(_0x187e5e){_0x13d4f1['count']=_0x187e5e;if(_0x185e73[_0xcb8a('0x32')][_0xcb8a('0x41')]){_0x2ad26e[_0xcb8a('0x42')]=[{'all':!![]}];}return db[_0xcb8a('0x61')][_0xcb8a('0x43')](_0x2ad26e);})[_0xcb8a('0x25')](function(_0x50dd87){_0x13d4f1[_0xcb8a('0x5d')]=_0x50dd87;return _0x13d4f1;});}})['then'](respondWithFilteredResult(_0x2232ae,_0x2ad26e))[_0xcb8a('0x48')](handleError(_0x2232ae,null));};exports[_0xcb8a('0x62')]=function(_0x421f40,_0x57b54e,_0x3c8ff7){var _0x45b141={'raw':!![],'where':{}};var _0x25fefb={};var _0x53fe4a={'count':0x0,'rows':[]};return db['Campaign'][_0xcb8a('0x58')]({'where':{'id':_0x421f40[_0xcb8a('0x45')]['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0x57b54e,null))[_0xcb8a('0x25')](function(_0x256d94){if(_0x256d94){_0x25fefb[_0xcb8a('0x46')]=_[_0xcb8a('0x33')](db[_0xcb8a('0x63')][_0xcb8a('0x2e')]);_0x25fefb['query']=_[_0xcb8a('0x33')](_0x421f40['query']);_0x25fefb['filters']=_[_0xcb8a('0x34')](_0x25fefb[_0xcb8a('0x46')],_0x25fefb[_0xcb8a('0x32')]);_0x45b141[_0xcb8a('0x35')]=_['intersection'](_0x25fefb[_0xcb8a('0x46')],qs[_0xcb8a('0x36')](_0x421f40['query'][_0xcb8a('0x36')]));_0x45b141[_0xcb8a('0x35')]=_0x45b141[_0xcb8a('0x35')]['length']?_0x45b141[_0xcb8a('0x35')]:_0x25fefb[_0xcb8a('0x46')];if(!_0x421f40[_0xcb8a('0x32')][_0xcb8a('0x5a')](_0xcb8a('0x38'))){_0x45b141[_0xcb8a('0x1e')]=qs[_0xcb8a('0x1e')](_0x421f40[_0xcb8a('0x32')][_0xcb8a('0x1e')]);_0x45b141[_0xcb8a('0x1b')]=qs[_0xcb8a('0x1b')](_0x421f40[_0xcb8a('0x32')][_0xcb8a('0x1b')]);}_0x45b141[_0xcb8a('0x5b')]=qs[_0xcb8a('0x39')](_0x421f40[_0xcb8a('0x32')]['sort']);_0x45b141[_0xcb8a('0x3a')]=qs[_0xcb8a('0x3b')](_['pick'](_0x421f40[_0xcb8a('0x32')],_0x25fefb['filters']));_0x45b141[_0xcb8a('0x3a')][_0xcb8a('0x5c')]=_0x256d94['id'];if(_0x421f40[_0xcb8a('0x32')]['filter']){_0x45b141['where']=_[_0xcb8a('0x47')](_0x45b141[_0xcb8a('0x3a')],{'$or':_[_0xcb8a('0x2d')](_0x45b141['attributes'],function(_0x510e06){var _0x34e2a3={};_0x34e2a3[_0x510e06]={'$like':'%'+_0x421f40['query'][_0xcb8a('0x3d')]+'%'};return _0x34e2a3;})});}_0x45b141=_[_0xcb8a('0x47')]({},_0x45b141,_0x421f40[_0xcb8a('0x3f')]);return db[_0xcb8a('0x63')][_0xcb8a('0x1d')]({'where':_0x45b141[_0xcb8a('0x3a')]})[_0xcb8a('0x25')](function(_0x4187f1){_0x53fe4a[_0xcb8a('0x1d')]=_0x4187f1;if(_0x421f40[_0xcb8a('0x32')][_0xcb8a('0x41')]){_0x45b141['include']=[{'all':!![]}];}return db[_0xcb8a('0x63')]['findAll'](_0x45b141);})[_0xcb8a('0x25')](function(_0x169376){_0x53fe4a[_0xcb8a('0x5d')]=_0x169376;return _0x53fe4a;});}})[_0xcb8a('0x25')](respondWithFilteredResult(_0x57b54e,_0x45b141))[_0xcb8a('0x48')](handleError(_0x57b54e,null));};exports[_0xcb8a('0x64')]=function(_0x456ed3,_0x4d59a5,_0x5c3bd4){var _0x57ef41={};var _0x311d18={};var _0x2a13f3;var _0x217173;return db[_0xcb8a('0x40')][_0xcb8a('0x58')]({'where':{'id':_0x456ed3['params']['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0x4d59a5,null))[_0xcb8a('0x25')](function(_0x2551be){if(_0x2551be){_0x2a13f3=_0x2551be;_0x311d18[_0xcb8a('0x46')]=_[_0xcb8a('0x33')](db[_0xcb8a('0x65')][_0xcb8a('0x2e')]);_0x311d18[_0xcb8a('0x32')]=_[_0xcb8a('0x33')](_0x456ed3[_0xcb8a('0x32')]);_0x311d18['filters']=_[_0xcb8a('0x34')](_0x311d18[_0xcb8a('0x46')],_0x311d18[_0xcb8a('0x32')]);_0x57ef41[_0xcb8a('0x35')]=_[_0xcb8a('0x34')](_0x311d18[_0xcb8a('0x46')],qs[_0xcb8a('0x36')](_0x456ed3[_0xcb8a('0x32')][_0xcb8a('0x36')]));_0x57ef41['attributes']=_0x57ef41['attributes']['length']?_0x57ef41[_0xcb8a('0x35')]:_0x311d18[_0xcb8a('0x46')];_0x57ef41['order']=qs['sort'](_0x456ed3[_0xcb8a('0x32')][_0xcb8a('0x39')]);_0x57ef41[_0xcb8a('0x3a')]=qs[_0xcb8a('0x3b')](_['pick'](_0x456ed3[_0xcb8a('0x32')],_0x311d18[_0xcb8a('0x3b')]));if(_0x456ed3['query'][_0xcb8a('0x3d')]){_0x57ef41[_0xcb8a('0x3a')]=_[_0xcb8a('0x47')](_0x57ef41[_0xcb8a('0x3a')],{'$or':_[_0xcb8a('0x2d')](_0x57ef41[_0xcb8a('0x35')],function(_0x224094){var _0x3a9af8={};_0x3a9af8[_0x224094]={'$like':'%'+_0x456ed3[_0xcb8a('0x32')][_0xcb8a('0x3d')]+'%'};return _0x3a9af8;})});}_0x57ef41=_['merge']({},_0x57ef41,_0x456ed3['options']);return _0x2a13f3[_0xcb8a('0x64')](_0x57ef41);}})['then'](function(_0x3c9734){if(_0x3c9734){_0x217173=_0x3c9734[_0xcb8a('0x37')];if(!_0x456ed3['query']['hasOwnProperty'](_0xcb8a('0x38'))){_0x57ef41[_0xcb8a('0x1e')]=qs[_0xcb8a('0x1e')](_0x456ed3[_0xcb8a('0x32')]['limit']);_0x57ef41[_0xcb8a('0x1b')]=qs[_0xcb8a('0x1b')](_0x456ed3[_0xcb8a('0x32')][_0xcb8a('0x1b')]);}return _0x2a13f3[_0xcb8a('0x64')](_0x57ef41);}})[_0xcb8a('0x25')](function(_0x53d2db){if(_0x53d2db){return _0x53d2db?{'count':_0x217173,'rows':_0x53d2db}:null;}})[_0xcb8a('0x25')](respondWithResult(_0x4d59a5,null))[_0xcb8a('0x48')](handleError(_0x4d59a5,null));};exports['addLists']=function(_0x1b6345,_0x344447,_0x367345){var _0x14d879,_0x4b3ff6;return db['Campaign'][_0xcb8a('0x4d')]({'where':{'id':_0x1b6345[_0xcb8a('0x45')]['id']}})['then'](handleEntityNotFound(_0x344447,null))[_0xcb8a('0x25')](function(_0x4fcfbe){if(_0x4fcfbe){_0x4b3ff6=_0x4fcfbe;return _0x4fcfbe[_0xcb8a('0x66')](_0x1b6345[_0xcb8a('0x56')][_0xcb8a('0x67')],_[_0xcb8a('0x51')](_0x1b6345[_0xcb8a('0x56')],[_0xcb8a('0x67'),'id'])||{});}return null;})[_0xcb8a('0x68')](function(_0x50c1de){var _0x1e043c;_0x14d879=_0x50c1de||[];var _0x179d47=[];if(_0x50c1de){for(var _0x4d5076=0x0;_0x4d5076<_0x50c1de['length'];_0x4d5076+=0x1){var _0x384519=_0x50c1de[_0x4d5076]['get']({'plain':!![]});_0x4b3ff6['dialCheckDuplicateType']=_0x1b6345['body']['dialCheckDuplicateType']?_0x1b6345[_0xcb8a('0x56')]['dialCheckDuplicateType']:_0x4b3ff6[_0xcb8a('0x69')];switch(_0x4b3ff6[_0xcb8a('0x69')]){case _0xcb8a('0x6a'):_0x1e043c=squel['insert']()[_0xcb8a('0x6b')](_0xcb8a('0x6c'))[_0xcb8a('0x6d')]([_0xcb8a('0x6e'),_0xcb8a('0x6f'),_0xcb8a('0x70'),_0xcb8a('0x71'),_0xcb8a('0x5c'),'createdAt',_0xcb8a('0x53')],squel[_0xcb8a('0x72')]()[_0xcb8a('0x73')](_0xcb8a('0x6e'),_0xcb8a('0x6e'))[_0xcb8a('0x73')](_0xcb8a('0x74'),_0xcb8a('0x6f'))['field']('id','ContactId')['field'](_0x384519[_0xcb8a('0x75')][_0xcb8a('0x76')](),_0xcb8a('0x71'))[_0xcb8a('0x73')](_0x1b6345[_0xcb8a('0x45')]['id'][_0xcb8a('0x76')](),'CampaignId')['field'](_0xcb8a('0x74'),_0xcb8a('0x52'))[_0xcb8a('0x73')]('NOW()',_0xcb8a('0x53'))[_0xcb8a('0x77')](_0xcb8a('0x78'))[_0xcb8a('0x3a')]('deletedAt\x20IS\x20NULL')[_0xcb8a('0x3a')](_0xcb8a('0x79'),_0x384519['CmListId'][_0xcb8a('0x76')]())[_0xcb8a('0x3a')](_0xcb8a('0x7a'))[_0xcb8a('0x3a')](_0xcb8a('0x7b'),squel['select']()[_0xcb8a('0x73')](_0xcb8a('0x7c'))['from'](_0xcb8a('0x7d'))[_0xcb8a('0x3a')](_0xcb8a('0x7e'),_0x1b6345[_0xcb8a('0x45')]['id']['toString']()))[_0xcb8a('0x3a')](_0xcb8a('0x7b'),squel[_0xcb8a('0x72')]()[_0xcb8a('0x73')](_0xcb8a('0x7f'))[_0xcb8a('0x77')]('cm_hopper')['where'](_0xcb8a('0x7e'),_0x1b6345[_0xcb8a('0x45')]['id'][_0xcb8a('0x76')]())))[_0xcb8a('0x76')]();break;case'onlyIfOpen':_0x1e043c=squel['insert']()[_0xcb8a('0x6b')](_0xcb8a('0x6c'))['fromQuery']([_0xcb8a('0x6e'),_0xcb8a('0x6f'),_0xcb8a('0x70'),_0xcb8a('0x71'),_0xcb8a('0x5c'),_0xcb8a('0x52'),_0xcb8a('0x53')],squel[_0xcb8a('0x72')]()[_0xcb8a('0x73')]('phone',_0xcb8a('0x6e'))['field'](_0xcb8a('0x74'),_0xcb8a('0x6f'))['field']('id',_0xcb8a('0x70'))[_0xcb8a('0x73')](_0x384519['CmListId'][_0xcb8a('0x76')](),_0xcb8a('0x71'))['field'](_0x1b6345[_0xcb8a('0x45')]['id'][_0xcb8a('0x76')](),_0xcb8a('0x5c'))[_0xcb8a('0x73')](_0xcb8a('0x74'),_0xcb8a('0x52'))['field']('NOW()',_0xcb8a('0x53'))['from'](_0xcb8a('0x78'))[_0xcb8a('0x3a')](_0xcb8a('0x80'))['where'](_0xcb8a('0x79'),_0x384519[_0xcb8a('0x75')][_0xcb8a('0x76')]())[_0xcb8a('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0xcb8a('0x3a')](_0xcb8a('0x7b'),squel[_0xcb8a('0x72')]()['field'](_0xcb8a('0x7f'))[_0xcb8a('0x77')](_0xcb8a('0x6c'))[_0xcb8a('0x3a')](_0xcb8a('0x7e'),_0x1b6345[_0xcb8a('0x45')]['id'][_0xcb8a('0x76')]())))[_0xcb8a('0x76')]();break;default:_0x1e043c=squel[_0xcb8a('0x81')]()['into'](_0xcb8a('0x6c'))['fromQuery']([_0xcb8a('0x6e'),_0xcb8a('0x6f'),'ContactId',_0xcb8a('0x71'),_0xcb8a('0x5c'),_0xcb8a('0x52'),_0xcb8a('0x53')],squel[_0xcb8a('0x72')]()['field'](_0xcb8a('0x6e'),'phone')[_0xcb8a('0x73')]('NOW()','scheduledAt')['field']('id',_0xcb8a('0x70'))[_0xcb8a('0x73')](_0x384519[_0xcb8a('0x75')][_0xcb8a('0x76')](),_0xcb8a('0x71'))[_0xcb8a('0x73')](_0x1b6345[_0xcb8a('0x45')]['id'][_0xcb8a('0x76')](),_0xcb8a('0x5c'))['field'](_0xcb8a('0x74'),'createdAt')[_0xcb8a('0x73')](_0xcb8a('0x74'),_0xcb8a('0x53'))['from']('cm_contacts')[_0xcb8a('0x3a')](_0xcb8a('0x80'))[_0xcb8a('0x3a')]('ListId\x20=\x20?',_0x384519[_0xcb8a('0x75')][_0xcb8a('0x76')]())[_0xcb8a('0x3a')](_0xcb8a('0x7a')))[_0xcb8a('0x76')]();}_0x179d47[_0xcb8a('0x82')](db[_0xcb8a('0x83')]['query'](_0x1e043c));}return BPromise[_0xcb8a('0x84')](_0x179d47);}})[_0xcb8a('0x25')](function(){return _0x14d879;})[_0xcb8a('0x25')](respondWithResult(_0x344447,null))['catch'](handleError(_0x344447,null));};exports[_0xcb8a('0x85')]=function(_0x5acfda,_0x5084d5,_0x593b3a){return db[_0xcb8a('0x40')][_0xcb8a('0x4d')]({'where':{'id':_0x5acfda['params']['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0x5084d5,null))[_0xcb8a('0x25')](function(_0x1b0d2d){if(_0x1b0d2d){return _0x1b0d2d['removeLists'](_0x5acfda['query'][_0xcb8a('0x67')]);}})['then'](function(_0x3d488f){if(_0x3d488f){return db[_0xcb8a('0x59')][_0xcb8a('0x26')]({'where':{'ListId':_0x5acfda['query'][_0xcb8a('0x67')],'CampaignId':_0x5acfda[_0xcb8a('0x45')]['id']}})['then'](function(){return _0x3d488f;});}})[_0xcb8a('0x25')](respondWithStatusCode(_0x5084d5,null))[_0xcb8a('0x48')](handleError(_0x5084d5,null));};exports[_0xcb8a('0x86')]=function(_0x29de60,_0x3d0639,_0x4d94c5){var _0xe3c16b={};var _0xeae62c={};var _0x4569f2;var _0x3e2234;return db[_0xcb8a('0x40')][_0xcb8a('0x58')]({'where':{'id':_0x29de60[_0xcb8a('0x45')]['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0x3d0639,null))[_0xcb8a('0x25')](function(_0x11e7f9){if(_0x11e7f9){_0x4569f2=_0x11e7f9;_0xeae62c[_0xcb8a('0x46')]=_[_0xcb8a('0x33')](db['CmList']['rawAttributes']);_0xeae62c[_0xcb8a('0x32')]=_[_0xcb8a('0x33')](_0x29de60[_0xcb8a('0x32')]);_0xeae62c[_0xcb8a('0x3b')]=_[_0xcb8a('0x34')](_0xeae62c[_0xcb8a('0x46')],_0xeae62c[_0xcb8a('0x32')]);_0xe3c16b[_0xcb8a('0x35')]=_['intersection'](_0xeae62c['model'],qs['fields'](_0x29de60['query'][_0xcb8a('0x36')]));_0xe3c16b['attributes']=_0xe3c16b[_0xcb8a('0x35')][_0xcb8a('0x37')]?_0xe3c16b['attributes']:_0xeae62c[_0xcb8a('0x46')];_0xe3c16b[_0xcb8a('0x5b')]=qs[_0xcb8a('0x39')](_0x29de60[_0xcb8a('0x32')][_0xcb8a('0x39')]);_0xe3c16b['where']=qs[_0xcb8a('0x3b')](_[_0xcb8a('0x3c')](_0x29de60[_0xcb8a('0x32')],_0xeae62c[_0xcb8a('0x3b')]));if(_0x29de60['query'][_0xcb8a('0x3d')]){_0xe3c16b[_0xcb8a('0x3a')]=_['merge'](_0xe3c16b[_0xcb8a('0x3a')],{'$or':_['map'](_0xe3c16b['attributes'],function(_0x5a13b3){var _0x175c8d={};_0x175c8d[_0x5a13b3]={'$like':'%'+_0x29de60[_0xcb8a('0x32')][_0xcb8a('0x3d')]+'%'};return _0x175c8d;})});}_0xe3c16b=_[_0xcb8a('0x47')]({},_0xe3c16b,_0x29de60[_0xcb8a('0x3f')]);return _0x4569f2[_0xcb8a('0x86')](_0xe3c16b);}})[_0xcb8a('0x25')](function(_0x16361f){if(_0x16361f){_0x3e2234=_0x16361f[_0xcb8a('0x37')];if(!_0x29de60[_0xcb8a('0x32')]['hasOwnProperty'](_0xcb8a('0x38'))){_0xe3c16b[_0xcb8a('0x1e')]=qs[_0xcb8a('0x1e')](_0x29de60[_0xcb8a('0x32')][_0xcb8a('0x1e')]);_0xe3c16b['offset']=qs[_0xcb8a('0x1b')](_0x29de60[_0xcb8a('0x32')]['offset']);}return _0x4569f2[_0xcb8a('0x86')](_0xe3c16b);}})[_0xcb8a('0x25')](function(_0x35d04b){if(_0x35d04b){return _0x35d04b?{'count':_0x3e2234,'rows':_0x35d04b}:null;}})[_0xcb8a('0x25')](respondWithResult(_0x3d0639,null))['catch'](handleError(_0x3d0639,null));};exports[_0xcb8a('0x87')]=function(_0x6999fd,_0x12db8b,_0x13aa7c){var _0x4ade74,_0x56966a;return db[_0xcb8a('0x40')]['find']({'where':{'id':_0x6999fd[_0xcb8a('0x45')]['id']}})[_0xcb8a('0x25')](handleEntityNotFound(_0x12db8b,null))[_0xcb8a('0x25')](function(_0x563ef0){if(_0x563ef0){_0x56966a=_0x563ef0;return _0x563ef0[_0xcb8a('0x87')](_0x6999fd[_0xcb8a('0x56')]['ids'],_[_0xcb8a('0x51')](_0x6999fd[_0xcb8a('0x56')],[_0xcb8a('0x67'),'id'])||{});}return null;})[_0xcb8a('0x68')](function(_0x3d3cbf){var _0x3fbff0;_0x4ade74=_0x3d3cbf||[];var _0x1b0a97=[];if(_0x3d3cbf){for(var _0x201e6a=0x0;_0x201e6a<_0x3d3cbf[_0xcb8a('0x37')];_0x201e6a+=0x1){var _0x17ba51=_0x3d3cbf[_0x201e6a]['get']({'plain':!![]});_0x3fbff0=squel[_0xcb8a('0x81')]()[_0xcb8a('0x6b')](_0xcb8a('0x88'))[_0xcb8a('0x6d')]([_0xcb8a('0x6e'),_0xcb8a('0x70'),_0xcb8a('0x71'),_0xcb8a('0x5c'),_0xcb8a('0x52'),_0xcb8a('0x53')],squel['select']()[_0xcb8a('0x73')]('phone','phone')[_0xcb8a('0x73')]('id','ContactId')['field'](_0x17ba51[_0xcb8a('0x75')]['toString'](),_0xcb8a('0x71'))['field'](_0x6999fd['params']['id'][_0xcb8a('0x76')](),'CampaignId')[_0xcb8a('0x73')](_0xcb8a('0x74'),_0xcb8a('0x52'))[_0xcb8a('0x73')](_0xcb8a('0x74'),'updatedAt')[_0xcb8a('0x77')](_0xcb8a('0x78'))[_0xcb8a('0x3a')](_0xcb8a('0x80'))[_0xcb8a('0x3a')](_0xcb8a('0x79'),_0x17ba51[_0xcb8a('0x75')][_0xcb8a('0x76')]())[_0xcb8a('0x3a')](_0xcb8a('0x7a')))['toString']();_0x1b0a97[_0xcb8a('0x82')](db[_0xcb8a('0x83')][_0xcb8a('0x32')](_0x3fbff0));}return BPromise[_0xcb8a('0x84')](_0x1b0a97);}})[_0xcb8a('0x25')](function(){return _0x4ade74;})[_0xcb8a('0x25')](respondWithResult(_0x12db8b,null))['catch'](handleError(_0x12db8b,null));};exports[_0xcb8a('0x89')]=function(_0x5a5539,_0x30d7d6,_0x4d8d26){return db[_0xcb8a('0x40')][_0xcb8a('0x4d')]({'where':{'id':_0x5a5539[_0xcb8a('0x45')]['id']}})['then'](handleEntityNotFound(_0x30d7d6,null))[_0xcb8a('0x25')](function(_0x53c4f3){if(_0x53c4f3){return _0x53c4f3['removeBlackLists'](_0x5a5539[_0xcb8a('0x32')][_0xcb8a('0x67')]);}})[_0xcb8a('0x25')](function(_0x1e5ef7){if(_0x1e5ef7){return db[_0xcb8a('0x63')][_0xcb8a('0x26')]({'where':{'ListId':_0x5a5539['query'][_0xcb8a('0x67')],'CampaignId':_0x5a5539['params']['id']}})[_0xcb8a('0x25')](function(){return _0x1e5ef7;});}})[_0xcb8a('0x25')](respondWithStatusCode(_0x30d7d6,null))[_0xcb8a('0x48')](handleError(_0x30d7d6,null));};
\ No newline at end of file
+var _0xc4bd=['omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','getHoppers','findOne','CmHopper','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','ids','dialCheckDuplicateType','always','into','fromQuery','scheduledAt','ContactId','ListId','field','phone','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','NOW()','sequelize','removeLists','getBlackLists','addBlackLists','push','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','IvrCampaigns','UserProfileResource','destroy','error','name','send','index','map','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Campaign','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','options','find','create','body','get','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone'];(function(_0x10511a,_0x156d15){var _0x2c3edc=function(_0x3ed68d){while(--_0x3ed68d){_0x10511a['push'](_0x10511a['shift']());}};_0x2c3edc(++_0x156d15);}(_0xc4bd,0x140));var _0xdc4b=function(_0x3f36fb,_0x2157a3){_0x3f36fb=_0x3f36fb-0x0;var _0xb394bc=_0xc4bd[_0x3f36fb];return _0xb394bc;};'use strict';var emlformat=require(_0xdc4b('0x0'));var rimraf=require(_0xdc4b('0x1'));var zipdir=require(_0xdc4b('0x2'));var jsonpatch=require(_0xdc4b('0x3'));var rp=require(_0xdc4b('0x4'));var moment=require('moment');var BPromise=require(_0xdc4b('0x5'));var Mustache=require(_0xdc4b('0x6'));var util=require('util');var path=require(_0xdc4b('0x7'));var sox=require(_0xdc4b('0x8'));var csv=require(_0xdc4b('0x9'));var ejs=require(_0xdc4b('0xa'));var fs=require('fs');var fs_extra=require(_0xdc4b('0xb'));var _=require(_0xdc4b('0xc'));var squel=require(_0xdc4b('0xd'));var crypto=require(_0xdc4b('0xe'));var jsforce=require(_0xdc4b('0xf'));var deskjs=require(_0xdc4b('0x10'));var toCsv=require(_0xdc4b('0x9'));var querystring=require(_0xdc4b('0x11'));var Papa=require(_0xdc4b('0x12'));var Redis=require(_0xdc4b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xdc4b('0x14'));var as=require(_0xdc4b('0x15'));var hardwareService=require(_0xdc4b('0x16'));var logger=require('../../config/logger')(_0xdc4b('0x17'));var utils=require('../../config/utils');var config=require(_0xdc4b('0x18'));var licenseUtil=require(_0xdc4b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a52ce,_0x327eeb){_0x327eeb=_0x327eeb||0xcc;return function(_0x4410da){if(_0x4410da){return _0x2a52ce[_0xdc4b('0x1a')](_0x327eeb);}return _0x2a52ce[_0xdc4b('0x1b')](_0x327eeb)[_0xdc4b('0x1c')]();};}function respondWithResult(_0x2a3acd,_0x9183c0){_0x9183c0=_0x9183c0||0xc8;return function(_0x3b7fc3){if(_0x3b7fc3){return _0x2a3acd[_0xdc4b('0x1b')](_0x9183c0)['json'](_0x3b7fc3);}};}function respondWithFilteredResult(_0xd7ee3a,_0x3c1d97){return function(_0x3e4974){if(_0x3e4974){var _0x2d0232=typeof _0x3c1d97[_0xdc4b('0x1d')]==='undefined'&&typeof _0x3c1d97[_0xdc4b('0x1e')]===_0xdc4b('0x1f');var _0x2178d5=_0x3e4974[_0xdc4b('0x20')];var _0x3ea75c=_0x2d0232?0x0:_0x3c1d97[_0xdc4b('0x1d')];var _0xced4d8=_0x2d0232?_0x3e4974[_0xdc4b('0x20')]:_0x3c1d97[_0xdc4b('0x1d')]+_0x3c1d97['limit'];var _0x5abdf2;if(_0xced4d8>=_0x2178d5){_0xced4d8=_0x2178d5;_0x5abdf2=0xc8;}else{_0x5abdf2=0xce;}_0xd7ee3a[_0xdc4b('0x1b')](_0x5abdf2);return _0xd7ee3a[_0xdc4b('0x21')](_0xdc4b('0x22'),_0x3ea75c+'-'+_0xced4d8+'/'+_0x2178d5)['json'](_0x3e4974);}return null;};}function patchUpdates(_0x5011bf){return function(_0x5588cc){try{jsonpatch[_0xdc4b('0x23')](_0x5588cc,_0x5011bf,!![]);}catch(_0x52f34c){return BPromise[_0xdc4b('0x24')](_0x52f34c);}return _0x5588cc[_0xdc4b('0x25')]();};}function saveUpdates(_0x11cf35,_0x18fd73){return function(_0x156f46){if(_0x156f46){return _0x156f46[_0xdc4b('0x26')](_0x11cf35)[_0xdc4b('0x27')](function(_0x268d4a){return _0x268d4a;});}return null;};}function removeEntity(_0x17123b,_0x1e3d9a){return function(_0x2edb6a){if(_0x2edb6a){return _0x2edb6a['destroy']()['then'](function(){var _0x1ee78a=_0x2edb6a['get']({'plain':!![]});var _0x4bc01d=_0xdc4b('0x28');return db[_0xdc4b('0x29')][_0xdc4b('0x2a')]({'where':{'type':_0x4bc01d,'resourceId':_0x1ee78a['id']}})[_0xdc4b('0x27')](function(){return _0x2edb6a;});})[_0xdc4b('0x27')](function(){_0x17123b[_0xdc4b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1360b7,_0x4a0b67){return function(_0xb55f24){if(!_0xb55f24){_0x1360b7[_0xdc4b('0x1a')](0x194);}return _0xb55f24;};}function handleError(_0x16917e,_0x25ff3a){_0x25ff3a=_0x25ff3a||0x1f4;return function(_0x164428){logger[_0xdc4b('0x2b')](_0x164428['stack']);if(_0x164428[_0xdc4b('0x2c')]){delete _0x164428[_0xdc4b('0x2c')];}_0x16917e[_0xdc4b('0x1b')](_0x25ff3a)[_0xdc4b('0x2d')](_0x164428);};}exports[_0xdc4b('0x2e')]=function(_0xf3f433,_0x16aba6){var _0x185733={},_0x5efc11={},_0x49ba7a={'count':0x0,'rows':[]};var _0x1dd700=_[_0xdc4b('0x2f')](db['Campaign']['rawAttributes'],function(_0x3f4ebc){return{'name':_0x3f4ebc['fieldName'],'type':_0x3f4ebc[_0xdc4b('0x30')][_0xdc4b('0x31')]};});_0x5efc11[_0xdc4b('0x32')]=_[_0xdc4b('0x2f')](_0x1dd700,_0xdc4b('0x2c'));_0x5efc11[_0xdc4b('0x33')]=_['keys'](_0xf3f433['query']);_0x5efc11[_0xdc4b('0x34')]=_[_0xdc4b('0x35')](_0x5efc11['model'],_0x5efc11[_0xdc4b('0x33')]);_0x185733['attributes']=_[_0xdc4b('0x35')](_0x5efc11[_0xdc4b('0x32')],qs[_0xdc4b('0x36')](_0xf3f433['query'][_0xdc4b('0x36')]));_0x185733['attributes']=_0x185733['attributes'][_0xdc4b('0x37')]?_0x185733[_0xdc4b('0x38')]:_0x5efc11[_0xdc4b('0x32')];if(!_0xf3f433[_0xdc4b('0x33')][_0xdc4b('0x39')](_0xdc4b('0x3a'))){_0x185733[_0xdc4b('0x1e')]=qs[_0xdc4b('0x1e')](_0xf3f433[_0xdc4b('0x33')][_0xdc4b('0x1e')]);_0x185733['offset']=qs[_0xdc4b('0x1d')](_0xf3f433[_0xdc4b('0x33')][_0xdc4b('0x1d')]);}_0x185733[_0xdc4b('0x3b')]=qs[_0xdc4b('0x3c')](_0xf3f433['query'][_0xdc4b('0x3c')]);_0x185733['where']=qs[_0xdc4b('0x34')](_[_0xdc4b('0x3d')](_0xf3f433[_0xdc4b('0x33')],_0x5efc11['filters']),_0x1dd700);if(_0xf3f433['query'][_0xdc4b('0x3e')]){_0x185733[_0xdc4b('0x3f')]=_[_0xdc4b('0x40')](_0x185733[_0xdc4b('0x3f')],{'$or':_[_0xdc4b('0x2f')](_0x1dd700,function(_0x96ee57){if(_0x96ee57[_0xdc4b('0x30')]!==_0xdc4b('0x41')){var _0x3d67d2={};_0x3d67d2[_0x96ee57['name']]={'$like':'%'+_0xf3f433['query'][_0xdc4b('0x3e')]+'%'};return _0x3d67d2;}})});}_0x185733=_[_0xdc4b('0x40')]({},_0x185733,_0xf3f433['options']);var _0x4a5194={'where':_0x185733[_0xdc4b('0x3f')]};return db[_0xdc4b('0x42')][_0xdc4b('0x20')](_0x4a5194)[_0xdc4b('0x27')](function(_0x4c440e){_0x49ba7a[_0xdc4b('0x20')]=_0x4c440e;if(_0xf3f433[_0xdc4b('0x33')][_0xdc4b('0x43')]){_0x185733[_0xdc4b('0x44')]=[{'all':!![]}];}return db[_0xdc4b('0x42')][_0xdc4b('0x45')](_0x185733);})['then'](function(_0x32289c){_0x49ba7a[_0xdc4b('0x46')]=_0x32289c;return _0x49ba7a;})[_0xdc4b('0x27')](respondWithFilteredResult(_0x16aba6,_0x185733))[_0xdc4b('0x47')](handleError(_0x16aba6,null));};exports['show']=function(_0x315105,_0x3b1e3c){var _0x1863c8={'raw':![],'where':{'id':_0x315105[_0xdc4b('0x48')]['id']}},_0x2e9599={};_0x2e9599[_0xdc4b('0x32')]=_['keys'](db[_0xdc4b('0x42')][_0xdc4b('0x49')]);_0x2e9599[_0xdc4b('0x33')]=_[_0xdc4b('0x4a')](_0x315105[_0xdc4b('0x33')]);_0x2e9599[_0xdc4b('0x34')]=_['intersection'](_0x2e9599[_0xdc4b('0x32')],_0x2e9599[_0xdc4b('0x33')]);_0x1863c8[_0xdc4b('0x38')]=_['intersection'](_0x2e9599[_0xdc4b('0x32')],qs['fields'](_0x315105['query']['fields']));_0x1863c8[_0xdc4b('0x38')]=_0x1863c8[_0xdc4b('0x38')][_0xdc4b('0x37')]?_0x1863c8[_0xdc4b('0x38')]:_0x2e9599[_0xdc4b('0x32')];if(_0x315105['query'][_0xdc4b('0x43')]){_0x1863c8[_0xdc4b('0x44')]=[{'all':!![]}];}_0x1863c8=_[_0xdc4b('0x40')]({},_0x1863c8,_0x315105[_0xdc4b('0x4b')]);return db[_0xdc4b('0x42')][_0xdc4b('0x4c')](_0x1863c8)['then'](handleEntityNotFound(_0x3b1e3c,null))[_0xdc4b('0x27')](respondWithResult(_0x3b1e3c,null))[_0xdc4b('0x47')](handleError(_0x3b1e3c,null));};exports[_0xdc4b('0x4d')]=function(_0x276668,_0x200dba){return db[_0xdc4b('0x42')][_0xdc4b('0x4d')](_0x276668[_0xdc4b('0x4e')],{})[_0xdc4b('0x27')](function(_0x1d655f){var _0x3d2af4=_0x276668['user'][_0xdc4b('0x4f')]({'plain':!![]});if(!_0x3d2af4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d2af4['role']===_0xdc4b('0x50')){var _0x5dffec=_0x1d655f[_0xdc4b('0x4f')]({'plain':!![]});var _0x32f778=_0xdc4b('0x28');return db['UserProfileSection'][_0xdc4b('0x4c')]({'where':{'name':_0x32f778,'userProfileId':_0x3d2af4[_0xdc4b('0x51')]},'raw':!![]})[_0xdc4b('0x27')](function(_0x476a18){if(_0x476a18&&_0x476a18[_0xdc4b('0x52')]===0x0){return db[_0xdc4b('0x29')][_0xdc4b('0x4d')]({'name':_0x5dffec[_0xdc4b('0x2c')],'resourceId':_0x5dffec['id'],'type':_0x476a18[_0xdc4b('0x2c')],'sectionId':_0x476a18['id']},{})['then'](function(){return _0x1d655f;});}else{return _0x1d655f;}})['catch'](function(_0x59f019){logger[_0xdc4b('0x2b')](_0xdc4b('0x53'),_0x59f019);throw _0x59f019;});}return _0x1d655f;})['then'](respondWithResult(_0x200dba,0xc9))[_0xdc4b('0x47')](handleError(_0x200dba,null));};exports[_0xdc4b('0x54')]=function(_0x4e62e2,_0x32bb82){var _0x25906c={'where':{'id':_0x4e62e2['params']['id']}},_0x57cbd6={};_0x57cbd6[_0xdc4b('0x32')]=_[_0xdc4b('0x4a')](db[_0xdc4b('0x42')][_0xdc4b('0x49')]);_0x25906c[_0xdc4b('0x38')]=_['intersection'](_0x57cbd6[_0xdc4b('0x32')],qs[_0xdc4b('0x36')](_0x4e62e2[_0xdc4b('0x33')][_0xdc4b('0x36')]));_0x25906c['attributes']=_0x25906c[_0xdc4b('0x38')][_0xdc4b('0x37')]?_0x25906c[_0xdc4b('0x38')]:_0x57cbd6[_0xdc4b('0x32')];if(_0x4e62e2['query']['includeAll']){_0x25906c['include']=[{'all':!![]}];}_0x25906c=_[_0xdc4b('0x40')]({},_0x25906c,_0x4e62e2[_0xdc4b('0x4b')]);return db[_0xdc4b('0x42')][_0xdc4b('0x4c')](_0x25906c)['then'](handleEntityNotFound(_0x32bb82,null))[_0xdc4b('0x27')](function(_0x3b2dc1){if(_0x3b2dc1){var _0x18b01d=_0x3b2dc1[_0xdc4b('0x4f')]({'plain':!![]});_0x18b01d=qs[_0xdc4b('0x55')](_0x18b01d,['id',_0xdc4b('0x56'),_0xdc4b('0x57')]);_0x4e62e2[_0xdc4b('0x4e')]=_[_0xdc4b('0x55')](_0x4e62e2[_0xdc4b('0x4e')],['id',_0xdc4b('0x56'),_0xdc4b('0x57')]);return db[_0xdc4b('0x42')][_0xdc4b('0x4d')](_[_0xdc4b('0x40')](_0x18b01d,_0x4e62e2['body']),{'include':_0x4e62e2[_0xdc4b('0x33')][_0xdc4b('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x163b1f){var _0x291b88=_0x4e62e2[_0xdc4b('0x50')][_0xdc4b('0x4f')]({'plain':!![]});if(!_0x291b88)throw new Error(_0xdc4b('0x58'));if(_0x291b88[_0xdc4b('0x59')]===_0xdc4b('0x50')){var _0x5cabc1=_0x163b1f[_0xdc4b('0x4f')]({'plain':!![]});var _0x841dd4=_0xdc4b('0x28');return db[_0xdc4b('0x5a')][_0xdc4b('0x4c')]({'where':{'name':_0x841dd4,'userProfileId':_0x291b88[_0xdc4b('0x51')]},'raw':!![]})[_0xdc4b('0x27')](function(_0x33cc2e){if(_0x33cc2e&&_0x33cc2e[_0xdc4b('0x52')]===0x0){return db[_0xdc4b('0x29')][_0xdc4b('0x4d')]({'name':_0x5cabc1[_0xdc4b('0x2c')],'resourceId':_0x5cabc1['id'],'type':_0x33cc2e[_0xdc4b('0x2c')],'sectionId':_0x33cc2e['id']},{})[_0xdc4b('0x27')](function(){return _0x163b1f;});}else{return _0x163b1f;}})[_0xdc4b('0x47')](function(_0x585942){logger[_0xdc4b('0x2b')](_0xdc4b('0x53'),_0x585942);throw _0x585942;});}return _0x163b1f;});}})[_0xdc4b('0x27')](respondWithResult(_0x32bb82,0xc9))['catch'](handleError(_0x32bb82,null));};exports[_0xdc4b('0x26')]=function(_0x2e4e65,_0x4b071b){if(_0x2e4e65['body']['id']){delete _0x2e4e65[_0xdc4b('0x4e')]['id'];}return db[_0xdc4b('0x42')][_0xdc4b('0x4c')]({'where':{'id':_0x2e4e65['params']['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x4b071b,null))[_0xdc4b('0x27')](saveUpdates(_0x2e4e65[_0xdc4b('0x4e')],null))[_0xdc4b('0x27')](respondWithResult(_0x4b071b,null))[_0xdc4b('0x47')](handleError(_0x4b071b,null));};exports['destroy']=function(_0x39c5c8,_0x5ce73e){return db[_0xdc4b('0x42')][_0xdc4b('0x4c')]({'where':{'id':_0x39c5c8[_0xdc4b('0x48')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x5ce73e,null))[_0xdc4b('0x27')](removeEntity(_0x5ce73e,null))[_0xdc4b('0x47')](handleError(_0x5ce73e,null));};exports[_0xdc4b('0x5b')]=function(_0x4d5d86,_0xefd2ea,_0x1647e0){var _0x1e5d1={'raw':!![],'where':{}};var _0x421e42={};var _0x268f85={'count':0x0,'rows':[]};return db[_0xdc4b('0x42')][_0xdc4b('0x5c')]({'where':{'id':_0x4d5d86[_0xdc4b('0x48')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0xefd2ea,null))['then'](function(_0x3838a6){if(_0x3838a6){_0x421e42[_0xdc4b('0x32')]=_[_0xdc4b('0x4a')](db[_0xdc4b('0x5d')][_0xdc4b('0x49')]);_0x421e42['query']=_[_0xdc4b('0x4a')](_0x4d5d86[_0xdc4b('0x33')]);_0x421e42[_0xdc4b('0x34')]=_['intersection'](_0x421e42[_0xdc4b('0x32')],_0x421e42[_0xdc4b('0x33')]);_0x1e5d1[_0xdc4b('0x38')]=_['intersection'](_0x421e42[_0xdc4b('0x32')],qs[_0xdc4b('0x36')](_0x4d5d86[_0xdc4b('0x33')][_0xdc4b('0x36')]));_0x1e5d1['attributes']=_0x1e5d1[_0xdc4b('0x38')]['length']?_0x1e5d1[_0xdc4b('0x38')]:_0x421e42[_0xdc4b('0x32')];if(!_0x4d5d86[_0xdc4b('0x33')][_0xdc4b('0x39')]('nolimit')){_0x1e5d1['limit']=qs[_0xdc4b('0x1e')](_0x4d5d86['query'][_0xdc4b('0x1e')]);_0x1e5d1[_0xdc4b('0x1d')]=qs[_0xdc4b('0x1d')](_0x4d5d86[_0xdc4b('0x33')][_0xdc4b('0x1d')]);}_0x1e5d1[_0xdc4b('0x3b')]=qs['sort'](_0x4d5d86[_0xdc4b('0x33')]['sort']);_0x1e5d1[_0xdc4b('0x3f')]=qs[_0xdc4b('0x34')](_[_0xdc4b('0x3d')](_0x4d5d86[_0xdc4b('0x33')],_0x421e42[_0xdc4b('0x34')]));_0x1e5d1[_0xdc4b('0x3f')]['CampaignId']=_0x3838a6['id'];if(_0x4d5d86[_0xdc4b('0x33')][_0xdc4b('0x3e')]){_0x1e5d1[_0xdc4b('0x3f')]=_[_0xdc4b('0x40')](_0x1e5d1[_0xdc4b('0x3f')],{'$or':_[_0xdc4b('0x2f')](_0x1e5d1['attributes'],function(_0x384182){var _0x370f25={};_0x370f25[_0x384182]={'$like':'%'+_0x4d5d86[_0xdc4b('0x33')][_0xdc4b('0x3e')]+'%'};return _0x370f25;})});}_0x1e5d1=_[_0xdc4b('0x40')]({},_0x1e5d1,_0x4d5d86['options']);return db['CmHopper'][_0xdc4b('0x20')]({'where':_0x1e5d1['where']})[_0xdc4b('0x27')](function(_0x42b32e){_0x268f85[_0xdc4b('0x20')]=_0x42b32e;if(_0x4d5d86['query']['includeAll']){_0x1e5d1[_0xdc4b('0x44')]=[{'all':!![]}];}return db[_0xdc4b('0x5d')]['findAll'](_0x1e5d1);})[_0xdc4b('0x27')](function(_0x28fe6a){_0x268f85[_0xdc4b('0x46')]=_0x28fe6a;return _0x268f85;});}})[_0xdc4b('0x27')](respondWithFilteredResult(_0xefd2ea,_0x1e5d1))['catch'](handleError(_0xefd2ea,null));};exports['getHopperHistories']=function(_0x449c9e,_0x73c702,_0x396116){var _0x58bd0f={'raw':!![],'where':{}};var _0x1394b0={};var _0x48055c={'count':0x0,'rows':[]};return db[_0xdc4b('0x42')]['findOne']({'where':{'id':_0x449c9e[_0xdc4b('0x48')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x73c702,null))[_0xdc4b('0x27')](function(_0x46d22a){if(_0x46d22a){_0x1394b0[_0xdc4b('0x32')]=_[_0xdc4b('0x4a')](db[_0xdc4b('0x5e')][_0xdc4b('0x49')]);_0x1394b0[_0xdc4b('0x33')]=_[_0xdc4b('0x4a')](_0x449c9e[_0xdc4b('0x33')]);_0x1394b0[_0xdc4b('0x34')]=_[_0xdc4b('0x35')](_0x1394b0[_0xdc4b('0x32')],_0x1394b0[_0xdc4b('0x33')]);_0x58bd0f[_0xdc4b('0x38')]=_['intersection'](_0x1394b0[_0xdc4b('0x32')],qs[_0xdc4b('0x36')](_0x449c9e[_0xdc4b('0x33')][_0xdc4b('0x36')]));_0x58bd0f[_0xdc4b('0x38')]=_0x58bd0f[_0xdc4b('0x38')][_0xdc4b('0x37')]?_0x58bd0f[_0xdc4b('0x38')]:_0x1394b0[_0xdc4b('0x32')];if(!_0x449c9e[_0xdc4b('0x33')]['hasOwnProperty'](_0xdc4b('0x3a'))){_0x58bd0f[_0xdc4b('0x1e')]=qs['limit'](_0x449c9e['query']['limit']);_0x58bd0f[_0xdc4b('0x1d')]=qs[_0xdc4b('0x1d')](_0x449c9e[_0xdc4b('0x33')][_0xdc4b('0x1d')]);}_0x58bd0f['order']=qs[_0xdc4b('0x3c')](_0x449c9e[_0xdc4b('0x33')][_0xdc4b('0x3c')]);_0x58bd0f[_0xdc4b('0x3f')]=qs[_0xdc4b('0x34')](_[_0xdc4b('0x3d')](_0x449c9e[_0xdc4b('0x33')],_0x1394b0[_0xdc4b('0x34')]));_0x58bd0f[_0xdc4b('0x3f')][_0xdc4b('0x5f')]=_0x46d22a['id'];if(_0x449c9e['query'][_0xdc4b('0x3e')]){_0x58bd0f['where']=_[_0xdc4b('0x40')](_0x58bd0f['where'],{'$or':_[_0xdc4b('0x2f')](_0x58bd0f[_0xdc4b('0x38')],function(_0x26a90e){var _0x229aa3={};_0x229aa3[_0x26a90e]={'$like':'%'+_0x449c9e[_0xdc4b('0x33')][_0xdc4b('0x3e')]+'%'};return _0x229aa3;})});}_0x58bd0f=_['merge']({},_0x58bd0f,_0x449c9e[_0xdc4b('0x4b')]);return db[_0xdc4b('0x5e')]['count']({'where':_0x58bd0f[_0xdc4b('0x3f')]})[_0xdc4b('0x27')](function(_0x3a0503){_0x48055c[_0xdc4b('0x20')]=_0x3a0503;if(_0x449c9e[_0xdc4b('0x33')][_0xdc4b('0x43')]){_0x58bd0f['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xdc4b('0x45')](_0x58bd0f);})[_0xdc4b('0x27')](function(_0x2e1dfd){_0x48055c[_0xdc4b('0x46')]=_0x2e1dfd;return _0x48055c;});}})['then'](respondWithFilteredResult(_0x73c702,_0x58bd0f))[_0xdc4b('0x47')](handleError(_0x73c702,null));};exports[_0xdc4b('0x60')]=function(_0x2c894f,_0x1106ad,_0x332e8d){var _0x569549={'raw':!![],'where':{}};var _0x41f8ef={};var _0x28a100={'count':0x0,'rows':[]};return db[_0xdc4b('0x42')][_0xdc4b('0x5c')]({'where':{'id':_0x2c894f[_0xdc4b('0x48')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x1106ad,null))[_0xdc4b('0x27')](function(_0x4a115e){if(_0x4a115e){_0x41f8ef[_0xdc4b('0x32')]=_[_0xdc4b('0x4a')](db[_0xdc4b('0x61')][_0xdc4b('0x49')]);_0x41f8ef[_0xdc4b('0x33')]=_['keys'](_0x2c894f['query']);_0x41f8ef[_0xdc4b('0x34')]=_[_0xdc4b('0x35')](_0x41f8ef['model'],_0x41f8ef['query']);_0x569549[_0xdc4b('0x38')]=_[_0xdc4b('0x35')](_0x41f8ef[_0xdc4b('0x32')],qs[_0xdc4b('0x36')](_0x2c894f[_0xdc4b('0x33')][_0xdc4b('0x36')]));_0x569549[_0xdc4b('0x38')]=_0x569549[_0xdc4b('0x38')][_0xdc4b('0x37')]?_0x569549[_0xdc4b('0x38')]:_0x41f8ef[_0xdc4b('0x32')];if(!_0x2c894f[_0xdc4b('0x33')][_0xdc4b('0x39')]('nolimit')){_0x569549[_0xdc4b('0x1e')]=qs['limit'](_0x2c894f['query']['limit']);_0x569549[_0xdc4b('0x1d')]=qs[_0xdc4b('0x1d')](_0x2c894f['query'][_0xdc4b('0x1d')]);}_0x569549[_0xdc4b('0x3b')]=qs['sort'](_0x2c894f[_0xdc4b('0x33')][_0xdc4b('0x3c')]);_0x569549['where']=qs['filters'](_['pick'](_0x2c894f[_0xdc4b('0x33')],_0x41f8ef[_0xdc4b('0x34')]));_0x569549[_0xdc4b('0x3f')]['CampaignId']=_0x4a115e['id'];if(_0x2c894f['query'][_0xdc4b('0x3e')]){_0x569549[_0xdc4b('0x3f')]=_['merge'](_0x569549[_0xdc4b('0x3f')],{'$or':_[_0xdc4b('0x2f')](_0x569549[_0xdc4b('0x38')],function(_0x55ed1){var _0x53fd5e={};_0x53fd5e[_0x55ed1]={'$like':'%'+_0x2c894f[_0xdc4b('0x33')]['filter']+'%'};return _0x53fd5e;})});}_0x569549=_[_0xdc4b('0x40')]({},_0x569549,_0x2c894f[_0xdc4b('0x4b')]);return db[_0xdc4b('0x61')][_0xdc4b('0x20')]({'where':_0x569549[_0xdc4b('0x3f')]})[_0xdc4b('0x27')](function(_0x2ef416){_0x28a100[_0xdc4b('0x20')]=_0x2ef416;if(_0x2c894f[_0xdc4b('0x33')][_0xdc4b('0x43')]){_0x569549[_0xdc4b('0x44')]=[{'all':!![]}];}return db[_0xdc4b('0x61')]['findAll'](_0x569549);})[_0xdc4b('0x27')](function(_0xdcbe76){_0x28a100[_0xdc4b('0x46')]=_0xdcbe76;return _0x28a100;});}})[_0xdc4b('0x27')](respondWithFilteredResult(_0x1106ad,_0x569549))[_0xdc4b('0x47')](handleError(_0x1106ad,null));};exports[_0xdc4b('0x62')]=function(_0x219056,_0x5881e2,_0x86611){var _0x2fe3bd={'raw':!![],'where':{}};var _0x4b47a1={};var _0x112b18={'count':0x0,'rows':[]};return db[_0xdc4b('0x42')]['findOne']({'where':{'id':_0x219056[_0xdc4b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5881e2,null))['then'](function(_0x385286){if(_0x385286){_0x4b47a1['model']=_[_0xdc4b('0x4a')](db[_0xdc4b('0x63')][_0xdc4b('0x49')]);_0x4b47a1[_0xdc4b('0x33')]=_[_0xdc4b('0x4a')](_0x219056[_0xdc4b('0x33')]);_0x4b47a1['filters']=_['intersection'](_0x4b47a1['model'],_0x4b47a1[_0xdc4b('0x33')]);_0x2fe3bd[_0xdc4b('0x38')]=_[_0xdc4b('0x35')](_0x4b47a1[_0xdc4b('0x32')],qs[_0xdc4b('0x36')](_0x219056[_0xdc4b('0x33')]['fields']));_0x2fe3bd[_0xdc4b('0x38')]=_0x2fe3bd[_0xdc4b('0x38')][_0xdc4b('0x37')]?_0x2fe3bd[_0xdc4b('0x38')]:_0x4b47a1[_0xdc4b('0x32')];if(!_0x219056[_0xdc4b('0x33')][_0xdc4b('0x39')](_0xdc4b('0x3a'))){_0x2fe3bd[_0xdc4b('0x1e')]=qs[_0xdc4b('0x1e')](_0x219056[_0xdc4b('0x33')][_0xdc4b('0x1e')]);_0x2fe3bd['offset']=qs[_0xdc4b('0x1d')](_0x219056[_0xdc4b('0x33')][_0xdc4b('0x1d')]);}_0x2fe3bd['order']=qs[_0xdc4b('0x3c')](_0x219056[_0xdc4b('0x33')][_0xdc4b('0x3c')]);_0x2fe3bd[_0xdc4b('0x3f')]=qs['filters'](_['pick'](_0x219056[_0xdc4b('0x33')],_0x4b47a1['filters']));_0x2fe3bd[_0xdc4b('0x3f')][_0xdc4b('0x5f')]=_0x385286['id'];if(_0x219056[_0xdc4b('0x33')][_0xdc4b('0x3e')]){_0x2fe3bd[_0xdc4b('0x3f')]=_[_0xdc4b('0x40')](_0x2fe3bd['where'],{'$or':_[_0xdc4b('0x2f')](_0x2fe3bd['attributes'],function(_0x43359d){var _0x1f8447={};_0x1f8447[_0x43359d]={'$like':'%'+_0x219056[_0xdc4b('0x33')][_0xdc4b('0x3e')]+'%'};return _0x1f8447;})});}_0x2fe3bd=_['merge']({},_0x2fe3bd,_0x219056[_0xdc4b('0x4b')]);return db['CmHopperBlack'][_0xdc4b('0x20')]({'where':_0x2fe3bd['where']})[_0xdc4b('0x27')](function(_0x59baf2){_0x112b18[_0xdc4b('0x20')]=_0x59baf2;if(_0x219056[_0xdc4b('0x33')][_0xdc4b('0x43')]){_0x2fe3bd[_0xdc4b('0x44')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x2fe3bd);})['then'](function(_0x58148c){_0x112b18[_0xdc4b('0x46')]=_0x58148c;return _0x112b18;});}})[_0xdc4b('0x27')](respondWithFilteredResult(_0x5881e2,_0x2fe3bd))[_0xdc4b('0x47')](handleError(_0x5881e2,null));};exports[_0xdc4b('0x64')]=function(_0x49265e,_0x41eff1,_0x52d722){var _0xdcff14={};var _0x499a6f={};var _0x4bb644;var _0x1ca30f;return db[_0xdc4b('0x42')][_0xdc4b('0x5c')]({'where':{'id':_0x49265e[_0xdc4b('0x48')]['id']}})['then'](handleEntityNotFound(_0x41eff1,null))[_0xdc4b('0x27')](function(_0x51871f){if(_0x51871f){_0x4bb644=_0x51871f;_0x499a6f['model']=_[_0xdc4b('0x4a')](db[_0xdc4b('0x65')][_0xdc4b('0x49')]);_0x499a6f[_0xdc4b('0x33')]=_['keys'](_0x49265e['query']);_0x499a6f[_0xdc4b('0x34')]=_['intersection'](_0x499a6f[_0xdc4b('0x32')],_0x499a6f[_0xdc4b('0x33')]);_0xdcff14[_0xdc4b('0x38')]=_[_0xdc4b('0x35')](_0x499a6f[_0xdc4b('0x32')],qs[_0xdc4b('0x36')](_0x49265e[_0xdc4b('0x33')]['fields']));_0xdcff14[_0xdc4b('0x38')]=_0xdcff14[_0xdc4b('0x38')]['length']?_0xdcff14[_0xdc4b('0x38')]:_0x499a6f[_0xdc4b('0x32')];_0xdcff14[_0xdc4b('0x3b')]=qs['sort'](_0x49265e[_0xdc4b('0x33')][_0xdc4b('0x3c')]);_0xdcff14[_0xdc4b('0x3f')]=qs[_0xdc4b('0x34')](_[_0xdc4b('0x3d')](_0x49265e[_0xdc4b('0x33')],_0x499a6f[_0xdc4b('0x34')]));if(_0x49265e[_0xdc4b('0x33')][_0xdc4b('0x3e')]){_0xdcff14[_0xdc4b('0x3f')]=_[_0xdc4b('0x40')](_0xdcff14[_0xdc4b('0x3f')],{'$or':_['map'](_0xdcff14['attributes'],function(_0x48947f){var _0x3eee13={};_0x3eee13[_0x48947f]={'$like':'%'+_0x49265e[_0xdc4b('0x33')][_0xdc4b('0x3e')]+'%'};return _0x3eee13;})});}_0xdcff14=_['merge']({},_0xdcff14,_0x49265e[_0xdc4b('0x4b')]);return _0x4bb644[_0xdc4b('0x64')](_0xdcff14);}})['then'](function(_0x2bc16d){if(_0x2bc16d){_0x1ca30f=_0x2bc16d[_0xdc4b('0x37')];if(!_0x49265e[_0xdc4b('0x33')][_0xdc4b('0x39')](_0xdc4b('0x3a'))){_0xdcff14['limit']=qs[_0xdc4b('0x1e')](_0x49265e[_0xdc4b('0x33')]['limit']);_0xdcff14['offset']=qs[_0xdc4b('0x1d')](_0x49265e['query'][_0xdc4b('0x1d')]);}return _0x4bb644['getLists'](_0xdcff14);}})[_0xdc4b('0x27')](function(_0x2b518b){if(_0x2b518b){return _0x2b518b?{'count':_0x1ca30f,'rows':_0x2b518b}:null;}})[_0xdc4b('0x27')](respondWithResult(_0x41eff1,null))[_0xdc4b('0x47')](handleError(_0x41eff1,null));};exports['addLists']=function(_0x1e73da,_0x141287,_0x3cd883){var _0x11a36c,_0x2c8740;return db[_0xdc4b('0x42')][_0xdc4b('0x4c')]({'where':{'id':_0x1e73da[_0xdc4b('0x48')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x141287,null))[_0xdc4b('0x27')](function(_0x2a74ec){if(_0x2a74ec){_0x2c8740=_0x2a74ec;return _0x2a74ec['addLists'](_0x1e73da[_0xdc4b('0x4e')][_0xdc4b('0x66')],_[_0xdc4b('0x55')](_0x1e73da['body'],[_0xdc4b('0x66'),'id'])||{});}return null;})['spread'](function(_0x1c2923){var _0x43a955;_0x11a36c=_0x1c2923||[];var _0x518790=[];if(_0x1c2923){for(var _0x4835ac=0x0;_0x4835ac<_0x1c2923[_0xdc4b('0x37')];_0x4835ac+=0x1){var _0x202206=_0x1c2923[_0x4835ac][_0xdc4b('0x4f')]({'plain':!![]});_0x2c8740[_0xdc4b('0x67')]=_0x1e73da[_0xdc4b('0x4e')][_0xdc4b('0x67')]?_0x1e73da[_0xdc4b('0x4e')][_0xdc4b('0x67')]:_0x2c8740['dialCheckDuplicateType'];switch(_0x2c8740[_0xdc4b('0x67')]){case _0xdc4b('0x68'):_0x43a955=squel['insert']()[_0xdc4b('0x69')]('cm_hopper')[_0xdc4b('0x6a')](['phone',_0xdc4b('0x6b'),_0xdc4b('0x6c'),_0xdc4b('0x6d'),_0xdc4b('0x5f'),_0xdc4b('0x56'),_0xdc4b('0x57')],squel['select']()[_0xdc4b('0x6e')]('phone',_0xdc4b('0x6f'))[_0xdc4b('0x6e')]('NOW()',_0xdc4b('0x6b'))[_0xdc4b('0x6e')]('id','ContactId')[_0xdc4b('0x6e')](_0x202206['CmListId']['toString'](),_0xdc4b('0x6d'))[_0xdc4b('0x6e')](_0x1e73da[_0xdc4b('0x48')]['id'][_0xdc4b('0x70')](),_0xdc4b('0x5f'))[_0xdc4b('0x6e')]('NOW()',_0xdc4b('0x56'))['field']('NOW()',_0xdc4b('0x57'))[_0xdc4b('0x71')](_0xdc4b('0x72'))[_0xdc4b('0x3f')](_0xdc4b('0x73'))['where'](_0xdc4b('0x74'),_0x202206[_0xdc4b('0x75')][_0xdc4b('0x70')]())[_0xdc4b('0x3f')](_0xdc4b('0x76'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xdc4b('0x77')]()[_0xdc4b('0x6e')](_0xdc4b('0x78'))[_0xdc4b('0x71')](_0xdc4b('0x79'))['where'](_0xdc4b('0x7a'),_0x1e73da[_0xdc4b('0x48')]['id'][_0xdc4b('0x70')]()))[_0xdc4b('0x3f')](_0xdc4b('0x7b'),squel[_0xdc4b('0x77')]()[_0xdc4b('0x6e')](_0xdc4b('0x7c'))['from'](_0xdc4b('0x7d'))[_0xdc4b('0x3f')]('CampaignId\x20=\x20?',_0x1e73da['params']['id']['toString']())))[_0xdc4b('0x70')]();break;case _0xdc4b('0x7e'):_0x43a955=squel[_0xdc4b('0x7f')]()[_0xdc4b('0x69')](_0xdc4b('0x7d'))[_0xdc4b('0x6a')](['phone',_0xdc4b('0x6b'),_0xdc4b('0x6c'),'ListId','CampaignId',_0xdc4b('0x56'),'updatedAt'],squel['select']()[_0xdc4b('0x6e')](_0xdc4b('0x6f'),_0xdc4b('0x6f'))[_0xdc4b('0x6e')]('NOW()',_0xdc4b('0x6b'))[_0xdc4b('0x6e')]('id',_0xdc4b('0x6c'))[_0xdc4b('0x6e')](_0x202206['CmListId']['toString'](),_0xdc4b('0x6d'))[_0xdc4b('0x6e')](_0x1e73da['params']['id'][_0xdc4b('0x70')](),'CampaignId')[_0xdc4b('0x6e')](_0xdc4b('0x80'),'createdAt')[_0xdc4b('0x6e')](_0xdc4b('0x80'),_0xdc4b('0x57'))['from'](_0xdc4b('0x72'))[_0xdc4b('0x3f')](_0xdc4b('0x73'))[_0xdc4b('0x3f')](_0xdc4b('0x74'),_0x202206[_0xdc4b('0x75')][_0xdc4b('0x70')]())[_0xdc4b('0x3f')](_0xdc4b('0x76'))[_0xdc4b('0x3f')](_0xdc4b('0x7b'),squel[_0xdc4b('0x77')]()[_0xdc4b('0x6e')](_0xdc4b('0x7c'))[_0xdc4b('0x71')](_0xdc4b('0x7d'))['where'](_0xdc4b('0x7a'),_0x1e73da[_0xdc4b('0x48')]['id'][_0xdc4b('0x70')]())))['toString']();break;default:_0x43a955=squel[_0xdc4b('0x7f')]()[_0xdc4b('0x69')](_0xdc4b('0x7d'))[_0xdc4b('0x6a')](['phone','scheduledAt',_0xdc4b('0x6c'),'ListId',_0xdc4b('0x5f'),'createdAt',_0xdc4b('0x57')],squel[_0xdc4b('0x77')]()[_0xdc4b('0x6e')](_0xdc4b('0x6f'),_0xdc4b('0x6f'))['field'](_0xdc4b('0x80'),_0xdc4b('0x6b'))['field']('id','ContactId')[_0xdc4b('0x6e')](_0x202206['CmListId']['toString'](),_0xdc4b('0x6d'))['field'](_0x1e73da['params']['id'][_0xdc4b('0x70')](),'CampaignId')['field'](_0xdc4b('0x80'),_0xdc4b('0x56'))[_0xdc4b('0x6e')](_0xdc4b('0x80'),'updatedAt')[_0xdc4b('0x71')](_0xdc4b('0x72'))[_0xdc4b('0x3f')]('deletedAt\x20IS\x20NULL')[_0xdc4b('0x3f')](_0xdc4b('0x74'),_0x202206[_0xdc4b('0x75')][_0xdc4b('0x70')]())[_0xdc4b('0x3f')](_0xdc4b('0x76')))[_0xdc4b('0x70')]();}_0x518790['push'](db[_0xdc4b('0x81')][_0xdc4b('0x33')](_0x43a955));}return BPromise['all'](_0x518790);}})[_0xdc4b('0x27')](function(){return _0x11a36c;})[_0xdc4b('0x27')](respondWithResult(_0x141287,null))[_0xdc4b('0x47')](handleError(_0x141287,null));};exports[_0xdc4b('0x82')]=function(_0x351a39,_0x5e003b,_0x2be6cb){return db[_0xdc4b('0x42')][_0xdc4b('0x4c')]({'where':{'id':_0x351a39[_0xdc4b('0x48')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x5e003b,null))[_0xdc4b('0x27')](function(_0xc5b0a3){if(_0xc5b0a3){return _0xc5b0a3['removeLists'](_0x351a39[_0xdc4b('0x33')]['ids']);}})['then'](function(_0x2d88cd){if(_0x2d88cd){return db[_0xdc4b('0x5d')]['destroy']({'where':{'ListId':_0x351a39[_0xdc4b('0x33')][_0xdc4b('0x66')],'CampaignId':_0x351a39[_0xdc4b('0x48')]['id']}})['then'](function(){return _0x2d88cd;});}})[_0xdc4b('0x27')](respondWithStatusCode(_0x5e003b,null))['catch'](handleError(_0x5e003b,null));};exports[_0xdc4b('0x83')]=function(_0x421862,_0x57e67a,_0x390b34){var _0x3d9b2d={};var _0x3879d2={};var _0x5a7a88;var _0x100dab;return db[_0xdc4b('0x42')]['findOne']({'where':{'id':_0x421862[_0xdc4b('0x48')]['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x57e67a,null))[_0xdc4b('0x27')](function(_0x4cb200){if(_0x4cb200){_0x5a7a88=_0x4cb200;_0x3879d2[_0xdc4b('0x32')]=_[_0xdc4b('0x4a')](db[_0xdc4b('0x65')]['rawAttributes']);_0x3879d2[_0xdc4b('0x33')]=_[_0xdc4b('0x4a')](_0x421862[_0xdc4b('0x33')]);_0x3879d2[_0xdc4b('0x34')]=_[_0xdc4b('0x35')](_0x3879d2[_0xdc4b('0x32')],_0x3879d2[_0xdc4b('0x33')]);_0x3d9b2d[_0xdc4b('0x38')]=_[_0xdc4b('0x35')](_0x3879d2[_0xdc4b('0x32')],qs[_0xdc4b('0x36')](_0x421862[_0xdc4b('0x33')][_0xdc4b('0x36')]));_0x3d9b2d['attributes']=_0x3d9b2d[_0xdc4b('0x38')][_0xdc4b('0x37')]?_0x3d9b2d[_0xdc4b('0x38')]:_0x3879d2[_0xdc4b('0x32')];_0x3d9b2d[_0xdc4b('0x3b')]=qs[_0xdc4b('0x3c')](_0x421862[_0xdc4b('0x33')][_0xdc4b('0x3c')]);_0x3d9b2d['where']=qs[_0xdc4b('0x34')](_[_0xdc4b('0x3d')](_0x421862['query'],_0x3879d2[_0xdc4b('0x34')]));if(_0x421862['query'][_0xdc4b('0x3e')]){_0x3d9b2d[_0xdc4b('0x3f')]=_['merge'](_0x3d9b2d[_0xdc4b('0x3f')],{'$or':_[_0xdc4b('0x2f')](_0x3d9b2d['attributes'],function(_0x258705){var _0x5c7a63={};_0x5c7a63[_0x258705]={'$like':'%'+_0x421862['query'][_0xdc4b('0x3e')]+'%'};return _0x5c7a63;})});}_0x3d9b2d=_[_0xdc4b('0x40')]({},_0x3d9b2d,_0x421862[_0xdc4b('0x4b')]);return _0x5a7a88[_0xdc4b('0x83')](_0x3d9b2d);}})[_0xdc4b('0x27')](function(_0x216b50){if(_0x216b50){_0x100dab=_0x216b50[_0xdc4b('0x37')];if(!_0x421862['query'][_0xdc4b('0x39')]('nolimit')){_0x3d9b2d[_0xdc4b('0x1e')]=qs[_0xdc4b('0x1e')](_0x421862[_0xdc4b('0x33')][_0xdc4b('0x1e')]);_0x3d9b2d[_0xdc4b('0x1d')]=qs['offset'](_0x421862['query'][_0xdc4b('0x1d')]);}return _0x5a7a88[_0xdc4b('0x83')](_0x3d9b2d);}})[_0xdc4b('0x27')](function(_0x27c607){if(_0x27c607){return _0x27c607?{'count':_0x100dab,'rows':_0x27c607}:null;}})[_0xdc4b('0x27')](respondWithResult(_0x57e67a,null))[_0xdc4b('0x47')](handleError(_0x57e67a,null));};exports[_0xdc4b('0x84')]=function(_0x7a7a1b,_0x11f54a,_0x21fd9c){var _0x2df040,_0x520c27;return db[_0xdc4b('0x42')]['find']({'where':{'id':_0x7a7a1b[_0xdc4b('0x48')]['id']}})['then'](handleEntityNotFound(_0x11f54a,null))[_0xdc4b('0x27')](function(_0x1c0843){if(_0x1c0843){_0x520c27=_0x1c0843;return _0x1c0843[_0xdc4b('0x84')](_0x7a7a1b[_0xdc4b('0x4e')]['ids'],_[_0xdc4b('0x55')](_0x7a7a1b[_0xdc4b('0x4e')],[_0xdc4b('0x66'),'id'])||{});}return null;})['spread'](function(_0x2d2172){var _0x4b387c;_0x2df040=_0x2d2172||[];var _0x18c44c=[];if(_0x2d2172){for(var _0x359749=0x0;_0x359749<_0x2d2172['length'];_0x359749+=0x1){var _0x3f0902=_0x2d2172[_0x359749][_0xdc4b('0x4f')]({'plain':!![]});_0x4b387c=squel[_0xdc4b('0x7f')]()[_0xdc4b('0x69')]('cm_hopper_black')[_0xdc4b('0x6a')]([_0xdc4b('0x6f'),'ContactId',_0xdc4b('0x6d'),_0xdc4b('0x5f'),_0xdc4b('0x56'),_0xdc4b('0x57')],squel[_0xdc4b('0x77')]()[_0xdc4b('0x6e')](_0xdc4b('0x6f'),_0xdc4b('0x6f'))['field']('id',_0xdc4b('0x6c'))['field'](_0x3f0902[_0xdc4b('0x75')]['toString'](),_0xdc4b('0x6d'))[_0xdc4b('0x6e')](_0x7a7a1b['params']['id'][_0xdc4b('0x70')](),_0xdc4b('0x5f'))['field'](_0xdc4b('0x80'),_0xdc4b('0x56'))[_0xdc4b('0x6e')](_0xdc4b('0x80'),_0xdc4b('0x57'))['from'](_0xdc4b('0x72'))[_0xdc4b('0x3f')](_0xdc4b('0x73'))['where']('ListId\x20=\x20?',_0x3f0902['CmListId'][_0xdc4b('0x70')]())[_0xdc4b('0x3f')]('phone\x20IS\x20NOT\x20NULL'))[_0xdc4b('0x70')]();_0x18c44c[_0xdc4b('0x85')](db[_0xdc4b('0x81')]['query'](_0x4b387c));}return BPromise['all'](_0x18c44c);}})[_0xdc4b('0x27')](function(){return _0x2df040;})[_0xdc4b('0x27')](respondWithResult(_0x11f54a,null))[_0xdc4b('0x47')](handleError(_0x11f54a,null));};exports[_0xdc4b('0x86')]=function(_0x514edf,_0x24de96,_0x447c79){return db[_0xdc4b('0x42')][_0xdc4b('0x4c')]({'where':{'id':_0x514edf['params']['id']}})[_0xdc4b('0x27')](handleEntityNotFound(_0x24de96,null))[_0xdc4b('0x27')](function(_0x1a9811){if(_0x1a9811){return _0x1a9811['removeBlackLists'](_0x514edf[_0xdc4b('0x33')][_0xdc4b('0x66')]);}})[_0xdc4b('0x27')](function(_0x5837a1){if(_0x5837a1){return db[_0xdc4b('0x63')]['destroy']({'where':{'ListId':_0x514edf[_0xdc4b('0x33')][_0xdc4b('0x66')],'CampaignId':_0x514edf[_0xdc4b('0x48')]['id']}})['then'](function(){return _0x5837a1;});}})[_0xdc4b('0x27')](respondWithStatusCode(_0x24de96,null))[_0xdc4b('0x47')](handleError(_0x24de96,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index b851e45..72e3d98 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2cee34,_0x7e21a9){var _0x5a369e=function(_0x5114d1){while(--_0x5114d1){_0x2cee34['push'](_0x2cee34['shift']());}};_0x5a369e(++_0x7e21a9);}(_0x7a54,0x106));var _0x47a5=function(_0x267210,_0x261b9f){_0x267210=_0x267210-0x0;var _0x485a55=_0x7a54[_0x267210];return _0x485a55;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x129954,_0x17b156){var _0x2b40f2=function(_0x5b3ce1){while(--_0x5b3ce1){_0x129954['push'](_0x129954['shift']());}};_0x2b40f2(++_0x17b156);}(_0x7a54,0x106));var _0x47a5=function(_0x4a1678,_0x35d7d5){_0x4a1678=_0x4a1678-0x0;var _0x4f7c32=_0x7a54[_0x4a1678];return _0x4f7c32;};'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 3f9297a..38ae9c3 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 _0x5bbd=['info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetCampaign','Campaign','options','raw','where','include','map','model','attributes','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise'];(function(_0x45ee03,_0x2f5319){var _0x13d535=function(_0x391904){while(--_0x391904){_0x45ee03['push'](_0x45ee03['shift']());}};_0x13d535(++_0x2f5319);}(_0x5bbd,0x12b));var _0xd5bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5bbd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5bb('0x0'));var util=require(_0xd5bb('0x1'));var moment=require(_0xd5bb('0x2'));var BPromise=require(_0xd5bb('0x3'));var rs=require(_0xd5bb('0x4'));var fs=require('fs');var Redis=require(_0xd5bb('0x5'));var db=require(_0xd5bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd5bb('0x7'));var jayson=require(_0xd5bb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x292873,_0x5093d3,_0x3878ba){return new BPromise(function(_0x17c08f,_0x1e7ad6){return client['request'](_0x292873,_0x3878ba)['then'](function(_0x44ffea){logger[_0xd5bb('0x9')](_0xd5bb('0xa'),_0x5093d3,'request\x20sent');logger[_0xd5bb('0xb')](_0xd5bb('0xc'),_0x5093d3,_0xd5bb('0xd'),JSON['stringify'](_0x44ffea));if(_0x44ffea['error']){if(_0x44ffea[_0xd5bb('0xe')][_0xd5bb('0xf')]===0x1f4){logger['error'](_0xd5bb('0xa'),_0x5093d3,_0x44ffea['error'][_0xd5bb('0x10')]);return _0x1e7ad6(_0x44ffea['error'][_0xd5bb('0x10')]);}logger[_0xd5bb('0xe')]('Campaign,\x20%s,\x20%s',_0x5093d3,_0x44ffea[_0xd5bb('0xe')][_0xd5bb('0x10')]);return _0x17c08f(_0x44ffea[_0xd5bb('0xe')]['message']);}else{logger['info'](_0xd5bb('0xa'),_0x5093d3,_0xd5bb('0xd'));_0x17c08f(_0x44ffea['result'][_0xd5bb('0x10')]);}})[_0xd5bb('0x11')](function(_0x3b7021){logger[_0xd5bb('0xe')]('Campaign,\x20%s,\x20%s',_0x5093d3,_0x3b7021);_0x1e7ad6(_0x3b7021);});});}exports[_0xd5bb('0x12')]=function(_0x41bc89){var _0x567d06=this;return new Promise(function(_0x3d312f,_0x222b0c){return db[_0xd5bb('0x13')]['findAll']({'raw':_0x41bc89[_0xd5bb('0x14')]?_0x41bc89[_0xd5bb('0x14')][_0xd5bb('0x15')]===undefined?!![]:![]:!![],'where':_0x41bc89[_0xd5bb('0x14')]?_0x41bc89[_0xd5bb('0x14')][_0xd5bb('0x16')]||null:null,'attributes':_0x41bc89[_0xd5bb('0x14')]?_0x41bc89[_0xd5bb('0x14')]['attributes']||null:null,'limit':_0x41bc89['options']?_0x41bc89[_0xd5bb('0x14')]['limit']||null:null,'include':_0x41bc89['options']?_0x41bc89[_0xd5bb('0x14')][_0xd5bb('0x17')]?_[_0xd5bb('0x18')](_0x41bc89[_0xd5bb('0x14')][_0xd5bb('0x17')],function(_0x52383c){return{'model':db[_0x52383c[_0xd5bb('0x19')]],'as':_0x52383c['as'],'attributes':_0x52383c[_0xd5bb('0x1a')],'include':_0x52383c[_0xd5bb('0x17')]?_[_0xd5bb('0x18')](_0x52383c[_0xd5bb('0x17')],function(_0x48f15d){return{'model':db[_0x48f15d['model']],'as':_0x48f15d['as'],'attributes':_0x48f15d[_0xd5bb('0x1a')],'include':_0x48f15d[_0xd5bb('0x17')]?_[_0xd5bb('0x18')](_0x48f15d[_0xd5bb('0x17')],function(_0x351c33){return{'model':db[_0x351c33['model']],'as':_0x351c33['as'],'attributes':_0x351c33[_0xd5bb('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30fa6d){logger[_0xd5bb('0x9')](_0xd5bb('0x12'),_0x41bc89);logger[_0xd5bb('0xb')](_0xd5bb('0x12'),_0x41bc89,JSON[_0xd5bb('0x1b')](_0x30fa6d));_0x3d312f(_0x30fa6d);})[_0xd5bb('0x11')](function(_0x228fc4){logger[_0xd5bb('0xe')](_0xd5bb('0x12'),_0x228fc4[_0xd5bb('0x10')],_0x41bc89);_0x222b0c(_0x567d06[_0xd5bb('0xe')](0x1f4,_0x228fc4[_0xd5bb('0x10')]));});});};
\ No newline at end of file
+var _0xe79a=['Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x27c4e4,_0x279846){var _0x526f00=function(_0x4c184d){while(--_0x4c184d){_0x27c4e4['push'](_0x27c4e4['shift']());}};_0x526f00(++_0x279846);}(_0xe79a,0x70));var _0xae79=function(_0x31c480,_0x13f64a){_0x31c480=_0x31c480-0x0;var _0x3687ce=_0xe79a[_0x31c480];return _0x3687ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae79('0x0'));var BPromise=require('bluebird');var rs=require(_0xae79('0x1'));var fs=require('fs');var Redis=require(_0xae79('0x2'));var db=require(_0xae79('0x3'))['db'];var utils=require(_0xae79('0x4'));var logger=require('../../config/logger')(_0xae79('0x5'));var config=require(_0xae79('0x6'));var jayson=require(_0xae79('0x7'));var client=jayson['client'][_0xae79('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a92bf,_0x51c226,_0x54e61d){return new BPromise(function(_0x459e6d,_0x417179){return client['request'](_0x3a92bf,_0x54e61d)[_0xae79('0x9')](function(_0x48092a){logger[_0xae79('0xa')]('Campaign,\x20%s,\x20%s',_0x51c226,'request\x20sent');logger[_0xae79('0xb')](_0xae79('0xc'),_0x51c226,_0xae79('0xd'),JSON['stringify'](_0x48092a));if(_0x48092a[_0xae79('0xe')]){if(_0x48092a[_0xae79('0xe')][_0xae79('0xf')]===0x1f4){logger[_0xae79('0xe')](_0xae79('0x10'),_0x51c226,_0x48092a[_0xae79('0xe')][_0xae79('0x11')]);return _0x417179(_0x48092a[_0xae79('0xe')][_0xae79('0x11')]);}logger[_0xae79('0xe')]('Campaign,\x20%s,\x20%s',_0x51c226,_0x48092a[_0xae79('0xe')][_0xae79('0x11')]);return _0x459e6d(_0x48092a[_0xae79('0xe')][_0xae79('0x11')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x51c226,_0xae79('0xd'));_0x459e6d(_0x48092a[_0xae79('0x12')]['message']);}})[_0xae79('0x13')](function(_0x5beb2d){logger[_0xae79('0xe')](_0xae79('0x10'),_0x51c226,_0x5beb2d);_0x417179(_0x5beb2d);});});}exports[_0xae79('0x14')]=function(_0x371944){var _0x3474a0=this;return new Promise(function(_0x5cb7d5,_0x432f0d){return db[_0xae79('0x15')][_0xae79('0x16')]({'raw':_0x371944[_0xae79('0x17')]?_0x371944[_0xae79('0x17')][_0xae79('0x18')]===undefined?!![]:![]:!![],'where':_0x371944['options']?_0x371944[_0xae79('0x17')][_0xae79('0x19')]||null:null,'attributes':_0x371944[_0xae79('0x17')]?_0x371944['options'][_0xae79('0x1a')]||null:null,'limit':_0x371944[_0xae79('0x17')]?_0x371944['options'][_0xae79('0x1b')]||null:null,'include':_0x371944[_0xae79('0x17')]?_0x371944[_0xae79('0x17')][_0xae79('0x1c')]?_['map'](_0x371944[_0xae79('0x17')][_0xae79('0x1c')],function(_0x49c55e){return{'model':db[_0x49c55e[_0xae79('0x1d')]],'as':_0x49c55e['as'],'attributes':_0x49c55e[_0xae79('0x1a')],'include':_0x49c55e[_0xae79('0x1c')]?_['map'](_0x49c55e[_0xae79('0x1c')],function(_0x6a289b){return{'model':db[_0x6a289b[_0xae79('0x1d')]],'as':_0x6a289b['as'],'attributes':_0x6a289b[_0xae79('0x1a')],'include':_0x6a289b['include']?_[_0xae79('0x1e')](_0x6a289b[_0xae79('0x1c')],function(_0x3ee7ea){return{'model':db[_0x3ee7ea['model']],'as':_0x3ee7ea['as'],'attributes':_0x3ee7ea['attributes']};}):[]};}):[]};}):[]:[]})[_0xae79('0x9')](function(_0x4efa59){logger[_0xae79('0xa')](_0xae79('0x14'),_0x371944);logger['debug']('GetCampaign',_0x371944,JSON[_0xae79('0x1f')](_0x4efa59));_0x5cb7d5(_0x4efa59);})[_0xae79('0x13')](function(_0x7281ce){logger[_0xae79('0xe')](_0xae79('0x14'),_0x7281ce[_0xae79('0x11')],_0x371944);_0x432f0d(_0x3474a0['error'](0x1f4,_0x7281ce['message']));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 1f37205..a201a8e 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 _0x27c9=['/:id/hopper_black','getHopperBlacks','/:id/lists','getBlackLists','post','clone','addLists','put','update','delete','removeLists','/:id/blacklists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals'];(function(_0x55a949,_0x43be62){var _0xbd0bff=function(_0x297308){while(--_0x297308){_0x55a949['push'](_0x55a949['shift']());}};_0xbd0bff(++_0x43be62);}(_0x27c9,0x12e));var _0x927c=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x27c9[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0x927c('0x0'));var util=require(_0x927c('0x1'));var path=require('path');var timeout=require(_0x927c('0x2'));var express=require(_0x927c('0x3'));var router=express[_0x927c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x927c('0x5'));var interaction=require(_0x927c('0x6'));var config=require(_0x927c('0x7'));var controller=require(_0x927c('0x8'));router[_0x927c('0x9')]('/',auth['isAuthenticated'](),controller[_0x927c('0xa')]);router[_0x927c('0x9')](_0x927c('0xb'),auth[_0x927c('0xc')](),controller[_0x927c('0xd')]);router[_0x927c('0x9')]('/:id/hoppers',auth[_0x927c('0xc')](),controller[_0x927c('0xe')]);router[_0x927c('0x9')](_0x927c('0xf'),auth[_0x927c('0xc')](),controller[_0x927c('0x10')]);router[_0x927c('0x9')]('/:id/hopper_finals',auth[_0x927c('0xc')](),controller[_0x927c('0x11')]);router[_0x927c('0x9')](_0x927c('0x12'),auth[_0x927c('0xc')](),controller[_0x927c('0x13')]);router[_0x927c('0x9')](_0x927c('0x14'),auth['isAuthenticated'](),controller['getLists']);router[_0x927c('0x9')]('/:id/blacklists',auth[_0x927c('0xc')](),controller[_0x927c('0x15')]);router[_0x927c('0x16')]('/',auth[_0x927c('0xc')](),controller['create']);router[_0x927c('0x16')]('/:id/clone',auth[_0x927c('0xc')](),controller[_0x927c('0x17')]);router[_0x927c('0x16')]('/:id/lists',auth[_0x927c('0xc')](),controller[_0x927c('0x18')]);router['post']('/:id/blacklists',auth[_0x927c('0xc')](),controller['addBlackLists']);router[_0x927c('0x19')](_0x927c('0xb'),auth[_0x927c('0xc')](),controller[_0x927c('0x1a')]);router[_0x927c('0x1b')]('/:id',auth[_0x927c('0xc')](),controller['destroy']);router['delete'](_0x927c('0x14'),auth[_0x927c('0xc')](),controller[_0x927c('0x1c')]);router[_0x927c('0x1b')](_0x927c('0x1d'),auth[_0x927c('0xc')](),controller[_0x927c('0x1e')]);module[_0x927c('0x1f')]=router;
\ No newline at end of file
+var _0x93da=['/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x51500e,_0x484ef0){var _0x3eec6e=function(_0x247c4d){while(--_0x247c4d){_0x51500e['push'](_0x51500e['shift']());}};_0x3eec6e(++_0x484ef0);}(_0x93da,0x92));var _0xa93d=function(_0x69dcb6,_0x282ffc){_0x69dcb6=_0x69dcb6-0x0;var _0x23a8cb=_0x93da[_0x69dcb6];return _0x23a8cb;};'use strict';var multer=require(_0xa93d('0x0'));var util=require('util');var path=require(_0xa93d('0x1'));var timeout=require(_0xa93d('0x2'));var express=require(_0xa93d('0x3'));var router=express[_0xa93d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa93d('0x5'));var controller=require(_0xa93d('0x6'));router[_0xa93d('0x7')]('/',auth[_0xa93d('0x8')](),controller[_0xa93d('0x9')]);router[_0xa93d('0x7')](_0xa93d('0xa'),auth[_0xa93d('0x8')](),controller[_0xa93d('0xb')]);router['get'](_0xa93d('0xc'),auth['isAuthenticated'](),controller[_0xa93d('0xd')]);router[_0xa93d('0x7')](_0xa93d('0xe'),auth['isAuthenticated'](),controller[_0xa93d('0xf')]);router[_0xa93d('0x7')](_0xa93d('0x10'),auth[_0xa93d('0x8')](),controller[_0xa93d('0x11')]);router['get']('/:id/hopper_black',auth[_0xa93d('0x8')](),controller['getHopperBlacks']);router[_0xa93d('0x7')](_0xa93d('0x12'),auth[_0xa93d('0x8')](),controller[_0xa93d('0x13')]);router[_0xa93d('0x7')](_0xa93d('0x14'),auth[_0xa93d('0x8')](),controller[_0xa93d('0x15')]);router[_0xa93d('0x16')]('/',auth[_0xa93d('0x8')](),controller[_0xa93d('0x17')]);router[_0xa93d('0x16')](_0xa93d('0x18'),auth[_0xa93d('0x8')](),controller[_0xa93d('0x19')]);router['post']('/:id/lists',auth[_0xa93d('0x8')](),controller[_0xa93d('0x1a')]);router[_0xa93d('0x16')](_0xa93d('0x14'),auth[_0xa93d('0x8')](),controller[_0xa93d('0x1b')]);router[_0xa93d('0x1c')](_0xa93d('0xa'),auth[_0xa93d('0x8')](),controller['update']);router[_0xa93d('0x1d')](_0xa93d('0xa'),auth['isAuthenticated'](),controller[_0xa93d('0x1e')]);router[_0xa93d('0x1d')](_0xa93d('0x12'),auth['isAuthenticated'](),controller[_0xa93d('0x1f')]);router[_0xa93d('0x1d')](_0xa93d('0x14'),auth[_0xa93d('0x8')](),controller[_0xa93d('0x20')]);module[_0xa93d('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 4f87492..8331af0 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 _0x0c42=['getDataValue','key','sequelize','STRING','VIRTUAL'];(function(_0x1f0559,_0x5257d5){var _0x1edf81=function(_0x1d076d){while(--_0x1d076d){_0x1f0559['push'](_0x1f0559['shift']());}};_0x1edf81(++_0x5257d5);}(_0x0c42,0x179));var _0x20c4=function(_0x5906f1,_0x32f216){_0x5906f1=_0x5906f1-0x0;var _0x3552a8=_0x0c42[_0x5906f1];return _0x3552a8;};'use strict';var Sequelize=require(_0x20c4('0x0'));module['exports']={'key':{'type':Sequelize[_0x20c4('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x20c4('0x1')]},'name':{'type':Sequelize[_0x20c4('0x2')],'get':function(){return this[_0x20c4('0x3')](_0x20c4('0x4'));}}};
\ No newline at end of file
+var _0xd247=['exports','STRING','VIRTUAL','key'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xd247,0xac));var _0x7d24=function(_0x380158,_0x599bd1){_0x380158=_0x380158-0x0;var _0x39ac68=_0xd247[_0x380158];return _0x39ac68;};'use strict';var Sequelize=require('sequelize');module[_0x7d24('0x0')]={'key':{'type':Sequelize[_0x7d24('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x7d24('0x1')]},'name':{'type':Sequelize[_0x7d24('0x2')],'get':function(){return this['getDataValue'](_0x7d24('0x3'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 393c727..c1bc407 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 _0x0ca3=['jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','UserProfileResource','error','stack','name','index','CannedAnswer','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel'];(function(_0x181e5b,_0x5e7d43){var _0x494c61=function(_0x4d0c0e){while(--_0x4d0c0e){_0x181e5b['push'](_0x181e5b['shift']());}};_0x494c61(++_0x5e7d43);}(_0x0ca3,0x1b5));var _0x30ca=function(_0x5d5bcb,_0x25e2ea){_0x5d5bcb=_0x5d5bcb-0x0;var _0x4ea5eb=_0x0ca3[_0x5d5bcb];return _0x4ea5eb;};'use strict';var emlformat=require(_0x30ca('0x0'));var rimraf=require(_0x30ca('0x1'));var zipdir=require(_0x30ca('0x2'));var jsonpatch=require(_0x30ca('0x3'));var rp=require(_0x30ca('0x4'));var moment=require(_0x30ca('0x5'));var BPromise=require(_0x30ca('0x6'));var Mustache=require(_0x30ca('0x7'));var util=require(_0x30ca('0x8'));var path=require(_0x30ca('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x30ca('0xa'));var fs=require('fs');var fs_extra=require(_0x30ca('0xb'));var _=require('lodash');var squel=require(_0x30ca('0xc'));var crypto=require('crypto');var jsforce=require(_0x30ca('0xd'));var deskjs=require(_0x30ca('0xe'));var toCsv=require(_0x30ca('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x30ca('0x10'));var authService=require(_0x30ca('0x11'));var qs=require(_0x30ca('0x12'));var as=require(_0x30ca('0x13'));var hardwareService=require(_0x30ca('0x14'));var logger=require(_0x30ca('0x15'))('api');var utils=require(_0x30ca('0x16'));var config=require(_0x30ca('0x17'));var licenseUtil=require(_0x30ca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45763b,_0x55afaf){_0x55afaf=_0x55afaf||0xcc;return function(_0x58dbd2){if(_0x58dbd2){return _0x45763b[_0x30ca('0x19')](_0x55afaf);}return _0x45763b['status'](_0x55afaf)[_0x30ca('0x1a')]();};}function respondWithResult(_0x429af7,_0x3b7737){_0x3b7737=_0x3b7737||0xc8;return function(_0x370815){if(_0x370815){return _0x429af7[_0x30ca('0x1b')](_0x3b7737)['json'](_0x370815);}};}function respondWithFilteredResult(_0x198664,_0x10f3b1){return function(_0x3a085b){if(_0x3a085b){var _0x155584=typeof _0x10f3b1[_0x30ca('0x1c')]===_0x30ca('0x1d')&&typeof _0x10f3b1[_0x30ca('0x1e')]===_0x30ca('0x1d');var _0x37f0e7=_0x3a085b['count'];var _0x6da53c=_0x155584?0x0:_0x10f3b1[_0x30ca('0x1c')];var _0x5258ce=_0x155584?_0x3a085b[_0x30ca('0x1f')]:_0x10f3b1[_0x30ca('0x1c')]+_0x10f3b1[_0x30ca('0x1e')];var _0x4fc776;if(_0x5258ce>=_0x37f0e7){_0x5258ce=_0x37f0e7;_0x4fc776=0xc8;}else{_0x4fc776=0xce;}_0x198664[_0x30ca('0x1b')](_0x4fc776);return _0x198664[_0x30ca('0x20')](_0x30ca('0x21'),_0x6da53c+'-'+_0x5258ce+'/'+_0x37f0e7)[_0x30ca('0x22')](_0x3a085b);}return null;};}function patchUpdates(_0x5583ee){return function(_0x536388){try{jsonpatch['apply'](_0x536388,_0x5583ee,!![]);}catch(_0x44358f){return BPromise[_0x30ca('0x23')](_0x44358f);}return _0x536388[_0x30ca('0x24')]();};}function saveUpdates(_0x51d3c0,_0x2bbfb2){return function(_0x3518f4){if(_0x3518f4){return _0x3518f4[_0x30ca('0x25')](_0x51d3c0)[_0x30ca('0x26')](function(_0x235ebb){return _0x235ebb;});}return null;};}function removeEntity(_0x6ef3d1,_0x30ca64){return function(_0x470523){if(_0x470523){return _0x470523['destroy']()['then'](function(){var _0x28a43e=_0x470523['get']({'plain':!![]});var _0x19199c='CannedAnswers';return db[_0x30ca('0x27')]['destroy']({'where':{'type':_0x19199c,'resourceId':_0x28a43e['id']}})[_0x30ca('0x26')](function(){return _0x470523;});})['then'](function(){_0x6ef3d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4550ca,_0x16e838){return function(_0xcfa08b){if(!_0xcfa08b){_0x4550ca['sendStatus'](0x194);}return _0xcfa08b;};}function handleError(_0x519a69,_0x44925d){_0x44925d=_0x44925d||0x1f4;return function(_0x4b6717){logger[_0x30ca('0x28')](_0x4b6717[_0x30ca('0x29')]);if(_0x4b6717[_0x30ca('0x2a')]){delete _0x4b6717[_0x30ca('0x2a')];}_0x519a69[_0x30ca('0x1b')](_0x44925d)['send'](_0x4b6717);};}exports[_0x30ca('0x2b')]=function(_0x95ac65,_0x48fdd8){var _0x5b54d7={},_0x378398={},_0x31b30d={'count':0x0,'rows':[]};var _0x5a5b34=_['map'](db[_0x30ca('0x2c')][_0x30ca('0x2d')],function(_0x24fb87){return{'name':_0x24fb87['fieldName'],'type':_0x24fb87[_0x30ca('0x2e')][_0x30ca('0x2f')]};});_0x378398[_0x30ca('0x30')]=_[_0x30ca('0x31')](_0x5a5b34,_0x30ca('0x2a'));_0x378398[_0x30ca('0x32')]=_['keys'](_0x95ac65['query']);_0x378398[_0x30ca('0x33')]=_[_0x30ca('0x34')](_0x378398['model'],_0x378398[_0x30ca('0x32')]);_0x5b54d7['attributes']=_[_0x30ca('0x34')](_0x378398[_0x30ca('0x30')],qs[_0x30ca('0x35')](_0x95ac65[_0x30ca('0x32')][_0x30ca('0x35')]));_0x5b54d7[_0x30ca('0x36')]=_0x5b54d7[_0x30ca('0x36')][_0x30ca('0x37')]?_0x5b54d7[_0x30ca('0x36')]:_0x378398['model'];if(!_0x95ac65[_0x30ca('0x32')][_0x30ca('0x38')](_0x30ca('0x39'))){_0x5b54d7[_0x30ca('0x1e')]=qs[_0x30ca('0x1e')](_0x95ac65[_0x30ca('0x32')][_0x30ca('0x1e')]);_0x5b54d7[_0x30ca('0x1c')]=qs[_0x30ca('0x1c')](_0x95ac65[_0x30ca('0x32')][_0x30ca('0x1c')]);}_0x5b54d7[_0x30ca('0x3a')]=qs[_0x30ca('0x3b')](_0x95ac65[_0x30ca('0x32')][_0x30ca('0x3b')]);_0x5b54d7[_0x30ca('0x3c')]=qs['filters'](_[_0x30ca('0x3d')](_0x95ac65[_0x30ca('0x32')],_0x378398[_0x30ca('0x33')]),_0x5a5b34);if(_0x95ac65['query'][_0x30ca('0x3e')]){_0x5b54d7[_0x30ca('0x3c')]=_[_0x30ca('0x3f')](_0x5b54d7[_0x30ca('0x3c')],{'$or':[{'key':{'$like':'%'+_0x95ac65[_0x30ca('0x32')][_0x30ca('0x3e')]+'%'}},{'value':{'$like':'%'+_0x95ac65[_0x30ca('0x32')]['filter']+'%'}}]});}_0x5b54d7=_[_0x30ca('0x3f')]({},_0x5b54d7,_0x95ac65[_0x30ca('0x40')]);var _0x1408cc={'where':_0x5b54d7[_0x30ca('0x3c')]};return db['CannedAnswer'][_0x30ca('0x1f')](_0x1408cc)[_0x30ca('0x26')](function(_0x1122d6){_0x31b30d[_0x30ca('0x1f')]=_0x1122d6;if(_0x95ac65[_0x30ca('0x32')][_0x30ca('0x41')]){_0x5b54d7[_0x30ca('0x42')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5b54d7);})['then'](function(_0x50943b){_0x31b30d[_0x30ca('0x43')]=_0x50943b;return _0x31b30d;})[_0x30ca('0x26')](respondWithFilteredResult(_0x48fdd8,_0x5b54d7))[_0x30ca('0x44')](handleError(_0x48fdd8,null));};exports[_0x30ca('0x45')]=function(_0x370385,_0x2724f5){var _0x29c72b={'raw':!![],'where':{'id':_0x370385[_0x30ca('0x46')]['id']}},_0x373fb3={};_0x373fb3[_0x30ca('0x30')]=_[_0x30ca('0x47')](db['CannedAnswer'][_0x30ca('0x2d')]);_0x373fb3[_0x30ca('0x32')]=_[_0x30ca('0x47')](_0x370385[_0x30ca('0x32')]);_0x373fb3[_0x30ca('0x33')]=_[_0x30ca('0x34')](_0x373fb3['model'],_0x373fb3[_0x30ca('0x32')]);_0x29c72b['attributes']=_[_0x30ca('0x34')](_0x373fb3['model'],qs[_0x30ca('0x35')](_0x370385[_0x30ca('0x32')][_0x30ca('0x35')]));_0x29c72b['attributes']=_0x29c72b[_0x30ca('0x36')][_0x30ca('0x37')]?_0x29c72b[_0x30ca('0x36')]:_0x373fb3[_0x30ca('0x30')];if(_0x370385[_0x30ca('0x32')][_0x30ca('0x41')]){_0x29c72b[_0x30ca('0x42')]=[{'all':!![]}];}_0x29c72b=_['merge']({},_0x29c72b,_0x370385[_0x30ca('0x40')]);return db[_0x30ca('0x2c')][_0x30ca('0x48')](_0x29c72b)[_0x30ca('0x26')](handleEntityNotFound(_0x2724f5,null))[_0x30ca('0x26')](respondWithResult(_0x2724f5,null))['catch'](handleError(_0x2724f5,null));};exports[_0x30ca('0x25')]=function(_0x233347,_0x4cedda){if(_0x233347[_0x30ca('0x49')]['id']){delete _0x233347[_0x30ca('0x49')]['id'];}return db[_0x30ca('0x2c')][_0x30ca('0x48')]({'where':{'id':_0x233347[_0x30ca('0x46')]['id']}})[_0x30ca('0x26')](handleEntityNotFound(_0x4cedda,null))['then'](saveUpdates(_0x233347[_0x30ca('0x49')],null))[_0x30ca('0x26')](respondWithResult(_0x4cedda,null))['catch'](handleError(_0x4cedda,null));};exports[_0x30ca('0x4a')]=function(_0xc34702,_0x562e5d){return db[_0x30ca('0x2c')]['find']({'where':{'id':_0xc34702[_0x30ca('0x46')]['id']}})[_0x30ca('0x26')](handleEntityNotFound(_0x562e5d,null))['then'](removeEntity(_0x562e5d,null))[_0x30ca('0x44')](handleError(_0x562e5d,null));};exports[_0x30ca('0x4b')]=function(_0xaabf5b,_0x1fa96f){var _0x21332d={'key':_0xaabf5b[_0x30ca('0x49')][_0x30ca('0x2f')]};if(_0xaabf5b['body'][_0x30ca('0x4c')]){_0x21332d[_0x30ca('0x4c')]=_0xaabf5b['body'][_0x30ca('0x4c')];}else if(_0xaabf5b[_0x30ca('0x49')][_0x30ca('0x4d')]){_0x21332d[_0x30ca('0x4d')]=_0xaabf5b[_0x30ca('0x49')][_0x30ca('0x4d')];}else if(_0xaabf5b[_0x30ca('0x49')][_0x30ca('0x4e')]){_0x21332d[_0x30ca('0x4e')]=_0xaabf5b[_0x30ca('0x49')][_0x30ca('0x4e')];}else if(_0xaabf5b[_0x30ca('0x49')][_0x30ca('0x4f')]){_0x21332d['ChatWebsiteId']=_0xaabf5b[_0x30ca('0x49')][_0x30ca('0x4f')];}return db[_0x30ca('0x2c')][_0x30ca('0x48')]({'where':_0x21332d})['then'](function(_0x5f14be){if(_0x5f14be){throw new db['Sequelize'][(_0x30ca('0x50'))](_0x30ca('0x51'));}return db[_0x30ca('0x2c')][_0x30ca('0x4b')](_0xaabf5b[_0x30ca('0x49')]);})[_0x30ca('0x26')](function(_0x244435){var _0x2eb3e8=_0xaabf5b[_0x30ca('0x52')][_0x30ca('0x53')]({'plain':!![]});if(!_0x2eb3e8)throw new Error(_0x30ca('0x54'));if(_0x2eb3e8['role']===_0x30ca('0x52')){var _0x18e889=_0x244435['get']({'plain':!![]});return db[_0x30ca('0x55')]['find']({'where':{'name':_0x30ca('0x56'),'userProfileId':_0x2eb3e8[_0x30ca('0x57')]},'raw':!![]})[_0x30ca('0x26')](function(_0x47a210){if(_0x47a210&&_0x47a210[_0x30ca('0x58')]===0x0){return db[_0x30ca('0x27')]['create']({'name':_0x18e889[_0x30ca('0x2a')],'resourceId':_0x18e889['id'],'type':_0x47a210[_0x30ca('0x2a')],'sectionId':_0x47a210['id']},{})[_0x30ca('0x26')](function(){return _0x244435;});}else{return _0x244435;}})[_0x30ca('0x44')](function(_0x50ea2c){logger['error'](_0x30ca('0x59'),_0x50ea2c);throw _0x50ea2c;});}return _0x244435;})['then'](respondWithResult(_0x1fa96f,0xc9))[_0x30ca('0x44')](handleError(_0x1fa96f,null));};
\ No newline at end of file
+var _0x3273=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','CannedAnswer','includeAll','include','findAll','catch','params','rawAttributes','find','body','create','MailAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','CannedAnswers','UserProfileResource','destroy','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x4f9f17,_0xcb1eeb){var _0x521fb5=function(_0x19980c){while(--_0x19980c){_0x4f9f17['push'](_0x4f9f17['shift']());}};_0x521fb5(++_0xcb1eeb);}(_0x3273,0x1da));var _0x3327=function(_0x46bf45,_0x201aaf){_0x46bf45=_0x46bf45-0x0;var _0x10cdc3=_0x3273[_0x46bf45];return _0x10cdc3;};'use strict';var emlformat=require(_0x3327('0x0'));var rimraf=require(_0x3327('0x1'));var zipdir=require(_0x3327('0x2'));var jsonpatch=require(_0x3327('0x3'));var rp=require(_0x3327('0x4'));var moment=require('moment');var BPromise=require(_0x3327('0x5'));var Mustache=require(_0x3327('0x6'));var util=require(_0x3327('0x7'));var path=require(_0x3327('0x8'));var sox=require(_0x3327('0x9'));var csv=require(_0x3327('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3327('0xb'));var squel=require(_0x3327('0xc'));var crypto=require(_0x3327('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3327('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3327('0xf'));var Papa=require(_0x3327('0x10'));var Redis=require(_0x3327('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3327('0x12'));var hardwareService=require(_0x3327('0x13'));var logger=require(_0x3327('0x14'))(_0x3327('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3327('0x16'));var db=require(_0x3327('0x17'))['db'];function respondWithStatusCode(_0x1f6b15,_0x38e719){_0x38e719=_0x38e719||0xcc;return function(_0x46a478){if(_0x46a478){return _0x1f6b15[_0x3327('0x18')](_0x38e719);}return _0x1f6b15['status'](_0x38e719)[_0x3327('0x19')]();};}function respondWithResult(_0x2eb48d,_0x48f1d6){_0x48f1d6=_0x48f1d6||0xc8;return function(_0x506ccd){if(_0x506ccd){return _0x2eb48d['status'](_0x48f1d6)['json'](_0x506ccd);}};}function respondWithFilteredResult(_0x5b5d9d,_0x36c067){return function(_0x10ef2b){if(_0x10ef2b){var _0x47aae9=typeof _0x36c067[_0x3327('0x1a')]===_0x3327('0x1b')&&typeof _0x36c067[_0x3327('0x1c')]===_0x3327('0x1b');var _0x23f807=_0x10ef2b[_0x3327('0x1d')];var _0x336037=_0x47aae9?0x0:_0x36c067['offset'];var _0x4e9d3b=_0x47aae9?_0x10ef2b['count']:_0x36c067[_0x3327('0x1a')]+_0x36c067['limit'];var _0x2ff214;if(_0x4e9d3b>=_0x23f807){_0x4e9d3b=_0x23f807;_0x2ff214=0xc8;}else{_0x2ff214=0xce;}_0x5b5d9d[_0x3327('0x1e')](_0x2ff214);return _0x5b5d9d['set'](_0x3327('0x1f'),_0x336037+'-'+_0x4e9d3b+'/'+_0x23f807)[_0x3327('0x20')](_0x10ef2b);}return null;};}function patchUpdates(_0x18f1ef){return function(_0x5e12d9){try{jsonpatch[_0x3327('0x21')](_0x5e12d9,_0x18f1ef,!![]);}catch(_0xaf46c5){return BPromise[_0x3327('0x22')](_0xaf46c5);}return _0x5e12d9[_0x3327('0x23')]();};}function saveUpdates(_0x1b7765,_0x5de47e){return function(_0x41b427){if(_0x41b427){return _0x41b427[_0x3327('0x24')](_0x1b7765)['then'](function(_0x361743){return _0x361743;});}return null;};}function removeEntity(_0x348c40,_0x4ae62a){return function(_0xa5d74a){if(_0xa5d74a){return _0xa5d74a['destroy']()['then'](function(){var _0x5986fc=_0xa5d74a['get']({'plain':!![]});var _0xbb0785=_0x3327('0x25');return db[_0x3327('0x26')][_0x3327('0x27')]({'where':{'type':_0xbb0785,'resourceId':_0x5986fc['id']}})[_0x3327('0x28')](function(){return _0xa5d74a;});})[_0x3327('0x28')](function(){_0x348c40[_0x3327('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e39a3,_0x567dea){return function(_0x2b474f){if(!_0x2b474f){_0x3e39a3[_0x3327('0x18')](0x194);}return _0x2b474f;};}function handleError(_0x46a0a3,_0x55fe30){_0x55fe30=_0x55fe30||0x1f4;return function(_0x541d52){logger['error'](_0x541d52[_0x3327('0x29')]);if(_0x541d52[_0x3327('0x2a')]){delete _0x541d52[_0x3327('0x2a')];}_0x46a0a3['status'](_0x55fe30)[_0x3327('0x2b')](_0x541d52);};}exports[_0x3327('0x2c')]=function(_0x4b052a,_0x1cea02){var _0x4260cc={},_0x22d7e1={},_0x16b762={'count':0x0,'rows':[]};var _0x297206=_[_0x3327('0x2d')](db['CannedAnswer']['rawAttributes'],function(_0x2f331e){return{'name':_0x2f331e[_0x3327('0x2e')],'type':_0x2f331e[_0x3327('0x2f')][_0x3327('0x30')]};});_0x22d7e1[_0x3327('0x31')]=_[_0x3327('0x2d')](_0x297206,_0x3327('0x2a'));_0x22d7e1[_0x3327('0x32')]=_[_0x3327('0x33')](_0x4b052a['query']);_0x22d7e1[_0x3327('0x34')]=_[_0x3327('0x35')](_0x22d7e1[_0x3327('0x31')],_0x22d7e1['query']);_0x4260cc[_0x3327('0x36')]=_[_0x3327('0x35')](_0x22d7e1['model'],qs[_0x3327('0x37')](_0x4b052a[_0x3327('0x32')][_0x3327('0x37')]));_0x4260cc[_0x3327('0x36')]=_0x4260cc[_0x3327('0x36')][_0x3327('0x38')]?_0x4260cc[_0x3327('0x36')]:_0x22d7e1['model'];if(!_0x4b052a['query'][_0x3327('0x39')](_0x3327('0x3a'))){_0x4260cc['limit']=qs[_0x3327('0x1c')](_0x4b052a[_0x3327('0x32')][_0x3327('0x1c')]);_0x4260cc[_0x3327('0x1a')]=qs['offset'](_0x4b052a[_0x3327('0x32')][_0x3327('0x1a')]);}_0x4260cc[_0x3327('0x3b')]=qs[_0x3327('0x3c')](_0x4b052a[_0x3327('0x32')][_0x3327('0x3c')]);_0x4260cc['where']=qs['filters'](_[_0x3327('0x3d')](_0x4b052a[_0x3327('0x32')],_0x22d7e1[_0x3327('0x34')]),_0x297206);if(_0x4b052a[_0x3327('0x32')][_0x3327('0x3e')]){_0x4260cc[_0x3327('0x3f')]=_['merge'](_0x4260cc['where'],{'$or':[{'key':{'$like':'%'+_0x4b052a[_0x3327('0x32')]['filter']+'%'}},{'value':{'$like':'%'+_0x4b052a['query'][_0x3327('0x3e')]+'%'}}]});}_0x4260cc=_[_0x3327('0x40')]({},_0x4260cc,_0x4b052a[_0x3327('0x41')]);var _0x2b6bf7={'where':_0x4260cc[_0x3327('0x3f')]};return db[_0x3327('0x42')][_0x3327('0x1d')](_0x2b6bf7)[_0x3327('0x28')](function(_0x2f4793){_0x16b762[_0x3327('0x1d')]=_0x2f4793;if(_0x4b052a[_0x3327('0x32')][_0x3327('0x43')]){_0x4260cc[_0x3327('0x44')]=[{'all':!![]}];}return db[_0x3327('0x42')][_0x3327('0x45')](_0x4260cc);})[_0x3327('0x28')](function(_0x17bf5c){_0x16b762['rows']=_0x17bf5c;return _0x16b762;})['then'](respondWithFilteredResult(_0x1cea02,_0x4260cc))[_0x3327('0x46')](handleError(_0x1cea02,null));};exports['show']=function(_0x1546b6,_0x28aeac){var _0x455558={'raw':!![],'where':{'id':_0x1546b6[_0x3327('0x47')]['id']}},_0x3926f7={};_0x3926f7[_0x3327('0x31')]=_[_0x3327('0x33')](db['CannedAnswer'][_0x3327('0x48')]);_0x3926f7[_0x3327('0x32')]=_[_0x3327('0x33')](_0x1546b6[_0x3327('0x32')]);_0x3926f7[_0x3327('0x34')]=_[_0x3327('0x35')](_0x3926f7[_0x3327('0x31')],_0x3926f7[_0x3327('0x32')]);_0x455558[_0x3327('0x36')]=_[_0x3327('0x35')](_0x3926f7[_0x3327('0x31')],qs[_0x3327('0x37')](_0x1546b6[_0x3327('0x32')][_0x3327('0x37')]));_0x455558['attributes']=_0x455558[_0x3327('0x36')][_0x3327('0x38')]?_0x455558[_0x3327('0x36')]:_0x3926f7[_0x3327('0x31')];if(_0x1546b6['query'][_0x3327('0x43')]){_0x455558['include']=[{'all':!![]}];}_0x455558=_['merge']({},_0x455558,_0x1546b6[_0x3327('0x41')]);return db[_0x3327('0x42')][_0x3327('0x49')](_0x455558)[_0x3327('0x28')](handleEntityNotFound(_0x28aeac,null))[_0x3327('0x28')](respondWithResult(_0x28aeac,null))[_0x3327('0x46')](handleError(_0x28aeac,null));};exports[_0x3327('0x24')]=function(_0x4f3ac7,_0x4c199b){if(_0x4f3ac7[_0x3327('0x4a')]['id']){delete _0x4f3ac7['body']['id'];}return db['CannedAnswer'][_0x3327('0x49')]({'where':{'id':_0x4f3ac7[_0x3327('0x47')]['id']}})[_0x3327('0x28')](handleEntityNotFound(_0x4c199b,null))['then'](saveUpdates(_0x4f3ac7['body'],null))['then'](respondWithResult(_0x4c199b,null))['catch'](handleError(_0x4c199b,null));};exports[_0x3327('0x27')]=function(_0x1698cd,_0x55122d){return db['CannedAnswer'][_0x3327('0x49')]({'where':{'id':_0x1698cd['params']['id']}})[_0x3327('0x28')](handleEntityNotFound(_0x55122d,null))[_0x3327('0x28')](removeEntity(_0x55122d,null))[_0x3327('0x46')](handleError(_0x55122d,null));};exports[_0x3327('0x4b')]=function(_0x260194,_0xdf94d6){var _0x2139f4={'key':_0x260194[_0x3327('0x4a')][_0x3327('0x30')]};if(_0x260194[_0x3327('0x4a')]['MailAccountId']){_0x2139f4['MailAccountId']=_0x260194[_0x3327('0x4a')][_0x3327('0x4c')];}else if(_0x260194[_0x3327('0x4a')]['SmsAccountId']){_0x2139f4['SmsAccountId']=_0x260194[_0x3327('0x4a')]['SmsAccountId'];}else if(_0x260194['body'][_0x3327('0x4d')]){_0x2139f4[_0x3327('0x4d')]=_0x260194[_0x3327('0x4a')][_0x3327('0x4d')];}else if(_0x260194[_0x3327('0x4a')][_0x3327('0x4e')]){_0x2139f4[_0x3327('0x4e')]=_0x260194[_0x3327('0x4a')][_0x3327('0x4e')];}return db[_0x3327('0x42')][_0x3327('0x49')]({'where':_0x2139f4})[_0x3327('0x28')](function(_0x1f61ac){if(_0x1f61ac){throw new db[(_0x3327('0x4f'))][(_0x3327('0x50'))](_0x3327('0x51'));}return db[_0x3327('0x42')]['create'](_0x260194[_0x3327('0x4a')]);})[_0x3327('0x28')](function(_0xa0b573){var _0x2b425a=_0x260194[_0x3327('0x52')][_0x3327('0x53')]({'plain':!![]});if(!_0x2b425a)throw new Error(_0x3327('0x54'));if(_0x2b425a[_0x3327('0x55')]===_0x3327('0x52')){var _0x5f3cb9=_0xa0b573[_0x3327('0x53')]({'plain':!![]});return db['UserProfileSection'][_0x3327('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x2b425a['userProfileId']},'raw':!![]})['then'](function(_0x245152){if(_0x245152&&_0x245152[_0x3327('0x56')]===0x0){return db[_0x3327('0x26')][_0x3327('0x4b')]({'name':_0x5f3cb9['name'],'resourceId':_0x5f3cb9['id'],'type':_0x245152[_0x3327('0x2a')],'sectionId':_0x245152['id']},{})['then'](function(){return _0xa0b573;});}else{return _0xa0b573;}})[_0x3327('0x46')](function(_0x1a4651){logger[_0x3327('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a4651);throw _0x1a4651;});}return _0xa0b573;})['then'](respondWithResult(_0xdf94d6,0xc9))[_0x3327('0x46')](handleError(_0xdf94d6,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index c90cb26..01aa7ae 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 _0x92db=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0x92db,0x111));var _0xb92d=function(_0x59f89a,_0x22bc8b){_0x59f89a=_0x59f89a-0x0;var _0x2783d2=_0x92db[_0x59f89a];return _0x2783d2;};'use strict';var _=require('lodash');var util=require(_0xb92d('0x0'));var logger=require(_0xb92d('0x1'))(_0xb92d('0x2'));var moment=require(_0xb92d('0x3'));var BPromise=require(_0xb92d('0x4'));var rp=require(_0xb92d('0x5'));var fs=require('fs');var path=require(_0xb92d('0x6'));var rimraf=require('rimraf');var config=require(_0xb92d('0x7'));var attributes=require(_0xb92d('0x8'));module[_0xb92d('0x9')]=function(_0x36c463,_0x534688){return _0x36c463[_0xb92d('0xa')](_0xb92d('0xb'),attributes,{'tableName':_0xb92d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb92d('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8155=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x12db6d,_0x3bb21d){var _0x4d7852=function(_0x3395d5){while(--_0x3395d5){_0x12db6d['push'](_0x12db6d['shift']());}};_0x4d7852(++_0x3bb21d);}(_0x8155,0x1f2));var _0x5815=function(_0x2ecbc7,_0x3b38ba){_0x2ecbc7=_0x2ecbc7-0x0;var _0xebb63b=_0x8155[_0x2ecbc7];return _0xebb63b;};'use strict';var _=require(_0x5815('0x0'));var util=require(_0x5815('0x1'));var logger=require(_0x5815('0x2'))(_0x5815('0x3'));var moment=require(_0x5815('0x4'));var BPromise=require(_0x5815('0x5'));var rp=require(_0x5815('0x6'));var fs=require('fs');var path=require(_0x5815('0x7'));var rimraf=require(_0x5815('0x8'));var config=require(_0x5815('0x9'));var attributes=require(_0x5815('0xa'));module[_0x5815('0xb')]=function(_0x49c3ed,_0x452712){return _0x49c3ed[_0x5815('0xc')](_0x5815('0xd'),attributes,{'tableName':_0x5815('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5815('0xf')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index daf79eb..07bda43 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(_0x557789,_0xce2491){var _0x164126=function(_0x2d8dfb){while(--_0x2d8dfb){_0x557789['push'](_0x557789['shift']());}};_0x164126(++_0xce2491);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0xaa88a1,_0x5615e){var _0x17b270=function(_0x2ea302){while(--_0x2ea302){_0xaa88a1['push'](_0xaa88a1['shift']());}};_0x17b270(++_0x5615e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 c9deef4..0d4d7a7 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 _0x0e57=['create','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x0e57,0x1eb));var _0x70e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e57[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x70e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x70e5('0x1'));var express=require(_0x70e5('0x2'));var router=express[_0x70e5('0x3')]();var fs_extra=require(_0x70e5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x70e5('0x5'));var controller=require(_0x70e5('0x6'));router[_0x70e5('0x7')]('/',auth[_0x70e5('0x8')](),controller[_0x70e5('0x9')]);router[_0x70e5('0x7')](_0x70e5('0xa'),auth['isAuthenticated'](),controller[_0x70e5('0xb')]);router[_0x70e5('0xc')]('/',auth['isAuthenticated'](),controller[_0x70e5('0xd')]);router['put'](_0x70e5('0xa'),auth[_0x70e5('0x8')](),controller[_0x70e5('0xe')]);router[_0x70e5('0xf')](_0x70e5('0xa'),auth[_0x70e5('0x8')](),controller[_0x70e5('0x10')]);module[_0x70e5('0x11')]=router;
\ No newline at end of file
+var _0x78c7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','post','create','put','/:id','delete'];(function(_0x3eb4f6,_0x342312){var _0x238e62=function(_0x588ced){while(--_0x588ced){_0x3eb4f6['push'](_0x3eb4f6['shift']());}};_0x238e62(++_0x342312);}(_0x78c7,0x1ba));var _0x778c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x78c7[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require(_0x778c('0x0'));var util=require(_0x778c('0x1'));var path=require(_0x778c('0x2'));var timeout=require(_0x778c('0x3'));var express=require(_0x778c('0x4'));var router=express[_0x778c('0x5')]();var fs_extra=require(_0x778c('0x6'));var auth=require(_0x778c('0x7'));var interaction=require(_0x778c('0x8'));var config=require('../../config/environment');var controller=require(_0x778c('0x9'));router[_0x778c('0xa')]('/',auth[_0x778c('0xb')](),controller[_0x778c('0xc')]);router[_0x778c('0xa')]('/:id',auth[_0x778c('0xb')](),controller['show']);router[_0x778c('0xd')]('/',auth[_0x778c('0xb')](),controller[_0x778c('0xe')]);router[_0x778c('0xf')](_0x778c('0x10'),auth[_0x778c('0xb')](),controller['update']);router[_0x778c('0x11')](_0x778c('0x10'),auth[_0x778c('0xb')](),controller[_0x778c('0x12')]);module[_0x778c('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4dcf6cd..a2ebbd2 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 _0x92d7=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x92d7,0x17b));var _0x792d=function(_0xc586d3,_0x516ed4){_0xc586d3=_0xc586d3-0x0;var _0xb12da7=_0x92d7[_0xc586d3];return _0xb12da7;};'use strict';var Sequelize=require(_0x792d('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x792d('0x1')],'allowNull':![],'defaultValue':_0x792d('0x2')},'clid':{'type':Sequelize[_0x792d('0x3')]},'src':{'type':Sequelize[_0x792d('0x3')]},'dst':{'type':Sequelize[_0x792d('0x3')]},'dcontext':{'type':Sequelize[_0x792d('0x3')]},'channel':{'type':Sequelize[_0x792d('0x3')]},'dstchannel':{'type':Sequelize[_0x792d('0x3')]},'lastapp':{'type':Sequelize[_0x792d('0x3')]},'lastdata':{'type':Sequelize[_0x792d('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x792d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x792d('0x3')]},'amaflags':{'type':Sequelize[_0x792d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x792d('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x792d('0x3')]},'linkedid':{'type':Sequelize[_0x792d('0x3')]},'sequence':{'type':Sequelize[_0x792d('0x3')]},'peeraccount':{'type':Sequelize[_0x792d('0x3')]},'type':{'type':Sequelize[_0x792d('0x3')]},'tag':{'type':Sequelize[_0x792d('0x3')]}};
\ No newline at end of file
+var _0x2821=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0x2821,0x87));var _0x1282=function(_0x5502f4,_0x171360){_0x5502f4=_0x5502f4-0x0;var _0x486eb7=_0x2821[_0x5502f4];return _0x486eb7;};'use strict';var Sequelize=require(_0x1282('0x0'));module[_0x1282('0x1')]={'calldate':{'type':Sequelize[_0x1282('0x2')],'allowNull':![],'defaultValue':_0x1282('0x3')},'clid':{'type':Sequelize[_0x1282('0x4')]},'src':{'type':Sequelize[_0x1282('0x4')]},'dst':{'type':Sequelize[_0x1282('0x4')]},'dcontext':{'type':Sequelize[_0x1282('0x4')]},'channel':{'type':Sequelize[_0x1282('0x4')]},'dstchannel':{'type':Sequelize[_0x1282('0x4')]},'lastapp':{'type':Sequelize[_0x1282('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x1282('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1282('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1282('0x4')]},'amaflags':{'type':Sequelize[_0x1282('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1282('0x4')]},'userfield':{'type':Sequelize[_0x1282('0x4')]},'uniqueid':{'type':Sequelize[_0x1282('0x4')]},'linkedid':{'type':Sequelize[_0x1282('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x1282('0x4')]},'type':{'type':Sequelize[_0x1282('0x4')]},'tag':{'type':Sequelize[_0x1282('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 7d21124..95dcba9 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 _0x1af3=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x1b68e5,_0x3d1a8d){var _0x2f80bb=function(_0x4fa58e){while(--_0x4fa58e){_0x1b68e5['push'](_0x1b68e5['shift']());}};_0x2f80bb(++_0x3d1a8d);}(_0x1af3,0x1ca));var _0x31af=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x1af3[_0x176317];return _0xef2759;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require(_0x31af('0x1'));var zipdir=require(_0x31af('0x2'));var jsonpatch=require(_0x31af('0x3'));var rp=require(_0x31af('0x4'));var moment=require(_0x31af('0x5'));var BPromise=require(_0x31af('0x6'));var Mustache=require(_0x31af('0x7'));var util=require(_0x31af('0x8'));var path=require(_0x31af('0x9'));var sox=require('sox');var csv=require(_0x31af('0xa'));var ejs=require(_0x31af('0xb'));var fs=require('fs');var fs_extra=require(_0x31af('0xc'));var _=require(_0x31af('0xd'));var squel=require('squel');var crypto=require(_0x31af('0xe'));var jsforce=require(_0x31af('0xf'));var deskjs=require(_0x31af('0x10'));var toCsv=require('to-csv');var querystring=require(_0x31af('0x11'));var Papa=require(_0x31af('0x12'));var Redis=require(_0x31af('0x13'));var authService=require(_0x31af('0x14'));var qs=require(_0x31af('0x15'));var as=require(_0x31af('0x16'));var hardwareService=require(_0x31af('0x17'));var logger=require(_0x31af('0x18'))('api');var utils=require(_0x31af('0x19'));var config=require(_0x31af('0x1a'));var licenseUtil=require(_0x31af('0x1b'));var db=require(_0x31af('0x1c'))['db'];function respondWithStatusCode(_0x144406,_0x481f20){_0x481f20=_0x481f20||0xcc;return function(_0x358fb4){if(_0x358fb4){return _0x144406[_0x31af('0x1d')](_0x481f20);}return _0x144406['status'](_0x481f20)['end']();};}function respondWithResult(_0x2a4727,_0x46a494){_0x46a494=_0x46a494||0xc8;return function(_0x14c57e){if(_0x14c57e){return _0x2a4727[_0x31af('0x1e')](_0x46a494)[_0x31af('0x1f')](_0x14c57e);}};}function respondWithFilteredResult(_0x1d35fa,_0x369934){return function(_0x37c275){if(_0x37c275){var _0xd431e4=typeof _0x369934[_0x31af('0x20')]===_0x31af('0x21')&&typeof _0x369934['limit']===_0x31af('0x21');var _0xd33b3f=_0x37c275[_0x31af('0x22')];var _0x477ada=_0xd431e4?0x0:_0x369934[_0x31af('0x20')];var _0x30a112=_0xd431e4?_0x37c275[_0x31af('0x22')]:_0x369934[_0x31af('0x20')]+_0x369934[_0x31af('0x23')];var _0x550870;if(_0x30a112>=_0xd33b3f){_0x30a112=_0xd33b3f;_0x550870=0xc8;}else{_0x550870=0xce;}_0x1d35fa[_0x31af('0x1e')](_0x550870);return _0x1d35fa[_0x31af('0x24')](_0x31af('0x25'),_0x477ada+'-'+_0x30a112+'/'+_0xd33b3f)[_0x31af('0x1f')](_0x37c275);}return null;};}function patchUpdates(_0x414ad8){return function(_0x5d96ca){try{jsonpatch[_0x31af('0x26')](_0x5d96ca,_0x414ad8,!![]);}catch(_0x46b03e){return BPromise[_0x31af('0x27')](_0x46b03e);}return _0x5d96ca[_0x31af('0x28')]();};}function saveUpdates(_0x394d13,_0x14c3f9){return function(_0x1ddfba){if(_0x1ddfba){return _0x1ddfba[_0x31af('0x29')](_0x394d13)[_0x31af('0x2a')](function(_0x6634e3){return _0x6634e3;});}return null;};}function removeEntity(_0x40aa32,_0x1a67e3){return function(_0x3a98d3){if(_0x3a98d3){return _0x3a98d3[_0x31af('0x2b')]()[_0x31af('0x2a')](function(){_0x40aa32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d3832,_0x20a50c){return function(_0x2b3bad){if(!_0x2b3bad){_0x5d3832['sendStatus'](0x194);}return _0x2b3bad;};}function handleError(_0x4c958,_0x8f9f60){_0x8f9f60=_0x8f9f60||0x1f4;return function(_0x49812a){logger[_0x31af('0x2c')](_0x49812a[_0x31af('0x2d')]);if(_0x49812a['name']){delete _0x49812a[_0x31af('0x2e')];}_0x4c958[_0x31af('0x1e')](_0x8f9f60)[_0x31af('0x2f')](_0x49812a);};}exports[_0x31af('0x30')]=function(_0x3326a7,_0x5a1f41){var _0xb1f5b1={},_0x3eb61f={},_0x1e6df8={'count':0x0,'rows':[]};var _0x1f4eae=_[_0x31af('0x31')](db[_0x31af('0x32')][_0x31af('0x33')],function(_0x231438){return{'name':_0x231438[_0x31af('0x34')],'type':_0x231438[_0x31af('0x35')][_0x31af('0x36')]};});_0x3eb61f[_0x31af('0x37')]=_['map'](_0x1f4eae,_0x31af('0x2e'));_0x3eb61f[_0x31af('0x38')]=_['keys'](_0x3326a7['query']);_0x3eb61f['filters']=_[_0x31af('0x39')](_0x3eb61f['model'],_0x3eb61f[_0x31af('0x38')]);_0xb1f5b1[_0x31af('0x3a')]=_[_0x31af('0x39')](_0x3eb61f[_0x31af('0x37')],qs[_0x31af('0x3b')](_0x3326a7[_0x31af('0x38')]['fields']));_0xb1f5b1[_0x31af('0x3a')]=_0xb1f5b1[_0x31af('0x3a')][_0x31af('0x3c')]?_0xb1f5b1[_0x31af('0x3a')]:_0x3eb61f[_0x31af('0x37')];if(!_0x3326a7[_0x31af('0x38')][_0x31af('0x3d')](_0x31af('0x3e'))){_0xb1f5b1['limit']=qs[_0x31af('0x23')](_0x3326a7['query'][_0x31af('0x23')]);_0xb1f5b1[_0x31af('0x20')]=qs[_0x31af('0x20')](_0x3326a7[_0x31af('0x38')][_0x31af('0x20')]);}_0xb1f5b1['order']=qs['sort'](_0x3326a7['query'][_0x31af('0x3f')]);_0xb1f5b1[_0x31af('0x40')]=qs[_0x31af('0x41')](_[_0x31af('0x42')](_0x3326a7[_0x31af('0x38')],_0x3eb61f[_0x31af('0x41')]),_0x1f4eae);if(_0x3326a7[_0x31af('0x38')][_0x31af('0x43')]){_0xb1f5b1['where']=_[_0x31af('0x44')](_0xb1f5b1[_0x31af('0x40')],{'$or':_[_0x31af('0x31')](_0x1f4eae,function(_0x2a5cde){if(_0x2a5cde[_0x31af('0x35')]!==_0x31af('0x45')){var _0x32d1b9={};_0x32d1b9[_0x2a5cde[_0x31af('0x2e')]]={'$like':'%'+_0x3326a7[_0x31af('0x38')]['filter']+'%'};return _0x32d1b9;}})});}_0xb1f5b1=_[_0x31af('0x44')]({},_0xb1f5b1,_0x3326a7['options']);var _0x447a01={'where':_0xb1f5b1['where']};return db['Cdr'][_0x31af('0x22')](_0x447a01)[_0x31af('0x2a')](function(_0x110f38){_0x1e6df8[_0x31af('0x22')]=_0x110f38;if(_0x3326a7[_0x31af('0x38')][_0x31af('0x46')]){_0xb1f5b1[_0x31af('0x47')]=[{'all':!![]}];}return db['Cdr'][_0x31af('0x48')](_0xb1f5b1);})[_0x31af('0x2a')](function(_0xb53565){_0x1e6df8['rows']=_0xb53565;return _0x1e6df8;})[_0x31af('0x2a')](respondWithFilteredResult(_0x5a1f41,_0xb1f5b1))[_0x31af('0x49')](handleError(_0x5a1f41,null));};exports[_0x31af('0x4a')]=function(_0x23942b,_0x34205a){var _0x57da2c={'raw':!![],'where':{'id':_0x23942b[_0x31af('0x4b')]['id']}},_0x12357c={};_0x12357c[_0x31af('0x37')]=_[_0x31af('0x4c')](db['Cdr'][_0x31af('0x33')]);_0x12357c[_0x31af('0x38')]=_['keys'](_0x23942b[_0x31af('0x38')]);_0x12357c[_0x31af('0x41')]=_[_0x31af('0x39')](_0x12357c[_0x31af('0x37')],_0x12357c[_0x31af('0x38')]);_0x57da2c[_0x31af('0x3a')]=_[_0x31af('0x39')](_0x12357c[_0x31af('0x37')],qs[_0x31af('0x3b')](_0x23942b[_0x31af('0x38')]['fields']));_0x57da2c['attributes']=_0x57da2c[_0x31af('0x3a')]['length']?_0x57da2c[_0x31af('0x3a')]:_0x12357c[_0x31af('0x37')];if(_0x23942b[_0x31af('0x38')]['includeAll']){_0x57da2c['include']=[{'all':!![]}];}_0x57da2c=_[_0x31af('0x44')]({},_0x57da2c,_0x23942b['options']);return db[_0x31af('0x32')][_0x31af('0x4d')](_0x57da2c)[_0x31af('0x2a')](handleEntityNotFound(_0x34205a,null))[_0x31af('0x2a')](respondWithResult(_0x34205a,null))['catch'](handleError(_0x34205a,null));};exports['create']=function(_0x407386,_0x3acff1){return db[_0x31af('0x32')][_0x31af('0x4e')](_0x407386['body'],{})[_0x31af('0x2a')](respondWithResult(_0x3acff1,0xc9))[_0x31af('0x49')](handleError(_0x3acff1,null));};exports[_0x31af('0x29')]=function(_0x4ad7a6,_0x5a1cbe){if(_0x4ad7a6[_0x31af('0x4f')]['id']){delete _0x4ad7a6[_0x31af('0x4f')]['id'];}return db[_0x31af('0x32')][_0x31af('0x4d')]({'where':{'id':_0x4ad7a6[_0x31af('0x4b')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x5a1cbe,null))[_0x31af('0x2a')](saveUpdates(_0x4ad7a6[_0x31af('0x4f')],null))[_0x31af('0x2a')](respondWithResult(_0x5a1cbe,null))[_0x31af('0x49')](handleError(_0x5a1cbe,null));};exports['destroy']=function(_0x441362,_0x29de7e){return db[_0x31af('0x32')][_0x31af('0x4d')]({'where':{'id':_0x441362[_0x31af('0x4b')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x29de7e,null))[_0x31af('0x2a')](removeEntity(_0x29de7e,null))[_0x31af('0x49')](handleError(_0x29de7e,null));};exports[_0x31af('0x50')]=function(_0x25369b,_0x3bfbae){return db[_0x31af('0x32')][_0x31af('0x50')]()[_0x31af('0x2a')](respondWithResult(_0x3bfbae,null))['catch'](handleError(_0x3bfbae,null));};
\ No newline at end of file
+var _0x826a=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','Cdr','fieldName','type'];(function(_0x222054,_0x45620f){var _0x5de492=function(_0x8ee7b4){while(--_0x8ee7b4){_0x222054['push'](_0x222054['shift']());}};_0x5de492(++_0x45620f);}(_0x826a,0x1aa));var _0xa826=function(_0x424759,_0x44b989){_0x424759=_0x424759-0x0;var _0x515ced=_0x826a[_0x424759];return _0x515ced;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa826('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa826('0x1'));var rp=require('request-promise');var moment=require(_0xa826('0x2'));var BPromise=require(_0xa826('0x3'));var Mustache=require(_0xa826('0x4'));var util=require(_0xa826('0x5'));var path=require('path');var sox=require(_0xa826('0x6'));var csv=require(_0xa826('0x7'));var ejs=require(_0xa826('0x8'));var fs=require('fs');var fs_extra=require(_0xa826('0x9'));var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x7'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var as=require(_0xa826('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa826('0x15'))('api');var utils=require(_0xa826('0x16'));var config=require(_0xa826('0x17'));var licenseUtil=require(_0xa826('0x18'));var db=require(_0xa826('0x19'))['db'];function respondWithStatusCode(_0x212fac,_0x40838f){_0x40838f=_0x40838f||0xcc;return function(_0x2f1d39){if(_0x2f1d39){return _0x212fac['sendStatus'](_0x40838f);}return _0x212fac[_0xa826('0x1a')](_0x40838f)['end']();};}function respondWithResult(_0x3e99b0,_0x41c0c2){_0x41c0c2=_0x41c0c2||0xc8;return function(_0x5dc0c7){if(_0x5dc0c7){return _0x3e99b0['status'](_0x41c0c2)['json'](_0x5dc0c7);}};}function respondWithFilteredResult(_0x1b6d16,_0x4f25bd){return function(_0x4c546b){if(_0x4c546b){var _0x9a3788=typeof _0x4f25bd[_0xa826('0x1b')]===_0xa826('0x1c')&&typeof _0x4f25bd['limit']===_0xa826('0x1c');var _0x312e14=_0x4c546b[_0xa826('0x1d')];var _0x453c5d=_0x9a3788?0x0:_0x4f25bd[_0xa826('0x1b')];var _0x48930f=_0x9a3788?_0x4c546b[_0xa826('0x1d')]:_0x4f25bd[_0xa826('0x1b')]+_0x4f25bd[_0xa826('0x1e')];var _0x57e96e;if(_0x48930f>=_0x312e14){_0x48930f=_0x312e14;_0x57e96e=0xc8;}else{_0x57e96e=0xce;}_0x1b6d16['status'](_0x57e96e);return _0x1b6d16[_0xa826('0x1f')](_0xa826('0x20'),_0x453c5d+'-'+_0x48930f+'/'+_0x312e14)[_0xa826('0x21')](_0x4c546b);}return null;};}function patchUpdates(_0x8d1650){return function(_0x124564){try{jsonpatch['apply'](_0x124564,_0x8d1650,!![]);}catch(_0x3171ff){return BPromise[_0xa826('0x22')](_0x3171ff);}return _0x124564[_0xa826('0x23')]();};}function saveUpdates(_0x5d410f,_0x5ddeef){return function(_0x361ca5){if(_0x361ca5){return _0x361ca5[_0xa826('0x24')](_0x5d410f)[_0xa826('0x25')](function(_0x4eb4f3){return _0x4eb4f3;});}return null;};}function removeEntity(_0x1d7adf,_0x26ef25){return function(_0x1d4ade){if(_0x1d4ade){return _0x1d4ade[_0xa826('0x26')]()[_0xa826('0x25')](function(){_0x1d7adf['status'](0xcc)[_0xa826('0x27')]();});}};}function handleEntityNotFound(_0x4fa5db,_0x17ef2d){return function(_0x174f16){if(!_0x174f16){_0x4fa5db['sendStatus'](0x194);}return _0x174f16;};}function handleError(_0xfc0448,_0xfa4d94){_0xfa4d94=_0xfa4d94||0x1f4;return function(_0x38c919){logger[_0xa826('0x28')](_0x38c919[_0xa826('0x29')]);if(_0x38c919[_0xa826('0x2a')]){delete _0x38c919[_0xa826('0x2a')];}_0xfc0448[_0xa826('0x1a')](_0xfa4d94)[_0xa826('0x2b')](_0x38c919);};}exports[_0xa826('0x2c')]=function(_0x1e35de,_0x473d8d){var _0x1f2749={},_0x2cb586={},_0x2253c7={'count':0x0,'rows':[]};var _0x27f8f9=_['map'](db[_0xa826('0x2d')]['rawAttributes'],function(_0x2dd810){return{'name':_0x2dd810[_0xa826('0x2e')],'type':_0x2dd810[_0xa826('0x2f')][_0xa826('0x30')]};});_0x2cb586[_0xa826('0x31')]=_['map'](_0x27f8f9,'name');_0x2cb586[_0xa826('0x32')]=_[_0xa826('0x33')](_0x1e35de[_0xa826('0x32')]);_0x2cb586[_0xa826('0x34')]=_['intersection'](_0x2cb586[_0xa826('0x31')],_0x2cb586[_0xa826('0x32')]);_0x1f2749['attributes']=_[_0xa826('0x35')](_0x2cb586['model'],qs[_0xa826('0x36')](_0x1e35de[_0xa826('0x32')][_0xa826('0x36')]));_0x1f2749[_0xa826('0x37')]=_0x1f2749[_0xa826('0x37')]['length']?_0x1f2749[_0xa826('0x37')]:_0x2cb586[_0xa826('0x31')];if(!_0x1e35de[_0xa826('0x32')][_0xa826('0x38')](_0xa826('0x39'))){_0x1f2749[_0xa826('0x1e')]=qs[_0xa826('0x1e')](_0x1e35de[_0xa826('0x32')][_0xa826('0x1e')]);_0x1f2749[_0xa826('0x1b')]=qs[_0xa826('0x1b')](_0x1e35de['query'][_0xa826('0x1b')]);}_0x1f2749['order']=qs[_0xa826('0x3a')](_0x1e35de['query'][_0xa826('0x3a')]);_0x1f2749[_0xa826('0x3b')]=qs[_0xa826('0x34')](_[_0xa826('0x3c')](_0x1e35de[_0xa826('0x32')],_0x2cb586[_0xa826('0x34')]),_0x27f8f9);if(_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]){_0x1f2749[_0xa826('0x3b')]=_[_0xa826('0x3e')](_0x1f2749[_0xa826('0x3b')],{'$or':_[_0xa826('0x3f')](_0x27f8f9,function(_0x5911d3){if(_0x5911d3[_0xa826('0x2f')]!==_0xa826('0x40')){var _0x251208={};_0x251208[_0x5911d3['name']]={'$like':'%'+_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]+'%'};return _0x251208;}})});}_0x1f2749=_['merge']({},_0x1f2749,_0x1e35de[_0xa826('0x41')]);var _0x47d9f1={'where':_0x1f2749['where']};return db[_0xa826('0x2d')][_0xa826('0x1d')](_0x47d9f1)[_0xa826('0x25')](function(_0x308d4){_0x2253c7[_0xa826('0x1d')]=_0x308d4;if(_0x1e35de[_0xa826('0x32')]['includeAll']){_0x1f2749[_0xa826('0x42')]=[{'all':!![]}];}return db[_0xa826('0x2d')][_0xa826('0x43')](_0x1f2749);})[_0xa826('0x25')](function(_0x244fd3){_0x2253c7[_0xa826('0x44')]=_0x244fd3;return _0x2253c7;})['then'](respondWithFilteredResult(_0x473d8d,_0x1f2749))[_0xa826('0x45')](handleError(_0x473d8d,null));};exports[_0xa826('0x46')]=function(_0x405ee1,_0x162be1){var _0x258e57={'raw':!![],'where':{'id':_0x405ee1[_0xa826('0x47')]['id']}},_0x53b70e={};_0x53b70e[_0xa826('0x31')]=_[_0xa826('0x33')](db[_0xa826('0x2d')][_0xa826('0x48')]);_0x53b70e[_0xa826('0x32')]=_[_0xa826('0x33')](_0x405ee1[_0xa826('0x32')]);_0x53b70e[_0xa826('0x34')]=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],_0x53b70e[_0xa826('0x32')]);_0x258e57['attributes']=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],qs[_0xa826('0x36')](_0x405ee1['query'][_0xa826('0x36')]));_0x258e57[_0xa826('0x37')]=_0x258e57[_0xa826('0x37')][_0xa826('0x49')]?_0x258e57[_0xa826('0x37')]:_0x53b70e['model'];if(_0x405ee1[_0xa826('0x32')][_0xa826('0x4a')]){_0x258e57[_0xa826('0x42')]=[{'all':!![]}];}_0x258e57=_[_0xa826('0x3e')]({},_0x258e57,_0x405ee1[_0xa826('0x41')]);return db[_0xa826('0x2d')][_0xa826('0x4b')](_0x258e57)['then'](handleEntityNotFound(_0x162be1,null))[_0xa826('0x25')](respondWithResult(_0x162be1,null))['catch'](handleError(_0x162be1,null));};exports['create']=function(_0x4b4352,_0x26a858){return db[_0xa826('0x2d')][_0xa826('0x4c')](_0x4b4352[_0xa826('0x4d')],{})['then'](respondWithResult(_0x26a858,0xc9))[_0xa826('0x45')](handleError(_0x26a858,null));};exports['update']=function(_0x5e0947,_0xedcbc2){if(_0x5e0947[_0xa826('0x4d')]['id']){delete _0x5e0947['body']['id'];}return db[_0xa826('0x2d')][_0xa826('0x4b')]({'where':{'id':_0x5e0947['params']['id']}})['then'](handleEntityNotFound(_0xedcbc2,null))['then'](saveUpdates(_0x5e0947['body'],null))['then'](respondWithResult(_0xedcbc2,null))['catch'](handleError(_0xedcbc2,null));};exports['destroy']=function(_0xb3fae0,_0x5d5269){return db[_0xa826('0x2d')]['find']({'where':{'id':_0xb3fae0[_0xa826('0x47')]['id']}})[_0xa826('0x25')](handleEntityNotFound(_0x5d5269,null))[_0xa826('0x25')](removeEntity(_0x5d5269,null))[_0xa826('0x45')](handleError(_0x5d5269,null));};exports[_0xa826('0x4e')]=function(_0x52cf5e,_0x209704){return db['Cdr']['describe']()[_0xa826('0x25')](respondWithResult(_0x209704,null))[_0xa826('0x45')](handleError(_0x209704,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index ea592c8..fb69880 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x15286e,_0x5c7c29){var _0x2fa3c8=function(_0x4e3a32){while(--_0x4e3a32){_0x15286e['push'](_0x15286e['shift']());}};_0x2fa3c8(++_0x5c7c29);}(_0x7a54,0x106));var _0x47a5=function(_0x34913b,_0x5070bf){_0x34913b=_0x34913b-0x0;var _0x4494f1=_0x7a54[_0x34913b];return _0x4494f1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5853d4,_0x7f879){var _0x1b55f4=function(_0x29b890){while(--_0x29b890){_0x5853d4['push'](_0x5853d4['shift']());}};_0x1b55f4(++_0x7f879);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 7be0bf1..75d30cc 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 _0xfc25=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x58194e,_0x541b3b){var _0x3e5a76=function(_0x5d375d){while(--_0x5d375d){_0x58194e['push'](_0x58194e['shift']());}};_0x3e5a76(++_0x541b3b);}(_0xfc25,0xde));var _0x5fc2=function(_0x161e48,_0xf0b7b4){_0x161e48=_0x161e48-0x0;var _0x5817f0=_0xfc25[_0x161e48];return _0x5817f0;};'use strict';var _=require(_0x5fc2('0x0'));var util=require(_0x5fc2('0x1'));var moment=require(_0x5fc2('0x2'));var BPromise=require(_0x5fc2('0x3'));var rs=require(_0x5fc2('0x4'));var fs=require('fs');var Redis=require(_0x5fc2('0x5'));var db=require(_0x5fc2('0x6'))['db'];var utils=require(_0x5fc2('0x7'));var logger=require(_0x5fc2('0x8'))('rpc');var config=require(_0x5fc2('0x9'));var jayson=require(_0x5fc2('0xa'));var client=jayson[_0x5fc2('0xb')][_0x5fc2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59dc6a,_0x55d7cb,_0x2ad7ed){return new BPromise(function(_0x148390,_0x41ad50){return client[_0x5fc2('0xd')](_0x59dc6a,_0x2ad7ed)[_0x5fc2('0xe')](function(_0x52ef09){logger[_0x5fc2('0xf')](_0x5fc2('0x10'),_0x55d7cb,_0x5fc2('0x11'));logger[_0x5fc2('0x12')](_0x5fc2('0x13'),_0x55d7cb,_0x5fc2('0x11'),JSON[_0x5fc2('0x14')](_0x52ef09));if(_0x52ef09[_0x5fc2('0x15')]){if(_0x52ef09[_0x5fc2('0x15')]['code']===0x1f4){logger[_0x5fc2('0x15')](_0x5fc2('0x10'),_0x55d7cb,_0x52ef09[_0x5fc2('0x15')][_0x5fc2('0x16')]);return _0x41ad50(_0x52ef09['error'][_0x5fc2('0x16')]);}logger[_0x5fc2('0x15')](_0x5fc2('0x10'),_0x55d7cb,_0x52ef09['error']['message']);return _0x148390(_0x52ef09[_0x5fc2('0x15')][_0x5fc2('0x16')]);}else{logger[_0x5fc2('0xf')](_0x5fc2('0x10'),_0x55d7cb,'request\x20sent');_0x148390(_0x52ef09[_0x5fc2('0x17')][_0x5fc2('0x16')]);}})[_0x5fc2('0x18')](function(_0x375c8f){logger[_0x5fc2('0x15')](_0x5fc2('0x10'),_0x55d7cb,_0x375c8f);_0x41ad50(_0x375c8f);});});}
\ No newline at end of file
+var _0x7948=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x7948,0xa3));var _0x8794=function(_0x112e2a,_0x364486){_0x112e2a=_0x112e2a-0x0;var _0x4f8af9=_0x7948[_0x112e2a];return _0x4f8af9;};'use strict';var _=require(_0x8794('0x0'));var util=require(_0x8794('0x1'));var moment=require(_0x8794('0x2'));var BPromise=require(_0x8794('0x3'));var rs=require(_0x8794('0x4'));var fs=require('fs');var Redis=require(_0x8794('0x5'));var db=require(_0x8794('0x6'))['db'];var utils=require(_0x8794('0x7'));var logger=require(_0x8794('0x8'))(_0x8794('0x9'));var config=require(_0x8794('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8794('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1649d7,_0x5b3adf,_0x33132d){return new BPromise(function(_0x222a7d,_0x508ca8){return client[_0x8794('0xc')](_0x1649d7,_0x33132d)['then'](function(_0x1fe8d1){logger[_0x8794('0xd')](_0x8794('0xe'),_0x5b3adf,_0x8794('0xf'));logger[_0x8794('0x10')](_0x8794('0x11'),_0x5b3adf,_0x8794('0xf'),JSON[_0x8794('0x12')](_0x1fe8d1));if(_0x1fe8d1[_0x8794('0x13')]){if(_0x1fe8d1['error']['code']===0x1f4){logger[_0x8794('0x13')](_0x8794('0xe'),_0x5b3adf,_0x1fe8d1['error'][_0x8794('0x14')]);return _0x508ca8(_0x1fe8d1[_0x8794('0x13')][_0x8794('0x14')]);}logger[_0x8794('0x13')](_0x8794('0xe'),_0x5b3adf,_0x1fe8d1[_0x8794('0x13')][_0x8794('0x14')]);return _0x222a7d(_0x1fe8d1['error'][_0x8794('0x14')]);}else{logger[_0x8794('0xd')]('Cdr,\x20%s,\x20%s',_0x5b3adf,_0x8794('0xf'));_0x222a7d(_0x1fe8d1[_0x8794('0x15')][_0x8794('0x14')]);}})[_0x8794('0x16')](function(_0x1eedfa){logger['error'](_0x8794('0xe'),_0x5b3adf,_0x1eedfa);_0x508ca8(_0x1eedfa);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 2fac372..8b2226b 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(_0x3dbccb,_0x126d36){var _0x3e90e7=function(_0x43298f){while(--_0x43298f){_0x3dbccb['push'](_0x3dbccb['shift']());}};_0x3e90e7(++_0x126d36);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+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(_0x1cb1a2,_0x3a0a27){var _0xa9aa05=function(_0x1cc324){while(--_0x1cc324){_0x1cb1a2['push'](_0x1cb1a2['shift']());}};_0xa9aa05(++_0x3a0a27);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 4744653..9f3fce6 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 _0xecd1=['TEXT','STRING','noop'];(function(_0x1d1fd9,_0x343c4f){var _0x48c07e=function(_0x2ccbef){while(--_0x2ccbef){_0x1d1fd9['push'](_0x1d1fd9['shift']());}};_0x48c07e(++_0x343c4f);}(_0xecd1,0x15d));var _0x1ecd=function(_0x10946a,_0x33d6b8){_0x10946a=_0x10946a-0x0;var _0x180fa3=_0xecd1[_0x10946a];return _0x180fa3;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1ecd('0x0')],'allowNull':![],'defaultValue':_0x1ecd('0x1')},'appdata':{'type':Sequelize[_0x1ecd('0x2')]()},'description':{'type':Sequelize[_0x1ecd('0x0')]},'interval':{'type':Sequelize[_0x1ecd('0x0')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x5be3=['*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x287f72,_0x4e37db){var _0x4ad9c9=function(_0x13e909){while(--_0x13e909){_0x287f72['push'](_0x287f72['shift']());}};_0x4ad9c9(++_0x4e37db);}(_0x5be3,0x19b));var _0x35be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5be3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x35be('0x0'));module[_0x35be('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x35be('0x2')],'allowNull':![],'defaultValue':_0x35be('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x35be('0x2')]},'interval':{'type':Sequelize[_0x35be('0x2')],'defaultValue':_0x35be('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index aacd46c..5653e6c 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 _0xb676=['ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys'];(function(_0x4a79c8,_0x49ec68){var _0x1b775d=function(_0x3bdb9b){while(--_0x3bdb9b){_0x4a79c8['push'](_0x4a79c8['shift']());}};_0x1b775d(++_0x49ec68);}(_0xb676,0xbc));var _0x6b67=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xb676[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0x6b67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b67('0x1'));var jsonpatch=require(_0x6b67('0x2'));var rp=require(_0x6b67('0x3'));var moment=require(_0x6b67('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b67('0x5'));var path=require(_0x6b67('0x6'));var sox=require('sox');var csv=require(_0x6b67('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b67('0x8'));var _=require(_0x6b67('0x9'));var squel=require(_0x6b67('0xa'));var crypto=require('crypto');var jsforce=require(_0x6b67('0xb'));var deskjs=require(_0x6b67('0xc'));var toCsv=require(_0x6b67('0x7'));var querystring=require('querystring');var Papa=require(_0x6b67('0xd'));var Redis=require(_0x6b67('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6b67('0xf'));var as=require(_0x6b67('0x10'));var hardwareService=require(_0x6b67('0x11'));var logger=require(_0x6b67('0x12'))('api');var utils=require(_0x6b67('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b67('0x14'));var db=require(_0x6b67('0x15'))['db'];function respondWithStatusCode(_0x1ebceb,_0x2ab6c5){_0x2ab6c5=_0x2ab6c5||0xcc;return function(_0x3e1bc6){if(_0x3e1bc6){return _0x1ebceb[_0x6b67('0x16')](_0x2ab6c5);}return _0x1ebceb[_0x6b67('0x17')](_0x2ab6c5)[_0x6b67('0x18')]();};}function respondWithResult(_0x2de534,_0x5fb6b3){_0x5fb6b3=_0x5fb6b3||0xc8;return function(_0x8a29a2){if(_0x8a29a2){return _0x2de534['status'](_0x5fb6b3)[_0x6b67('0x19')](_0x8a29a2);}};}function respondWithFilteredResult(_0x2213f4,_0x51e798){return function(_0x187fd4){if(_0x187fd4){var _0x1b6c60=typeof _0x51e798[_0x6b67('0x1a')]===_0x6b67('0x1b')&&typeof _0x51e798['limit']===_0x6b67('0x1b');var _0x46c44e=_0x187fd4[_0x6b67('0x1c')];var _0x46d828=_0x1b6c60?0x0:_0x51e798[_0x6b67('0x1a')];var _0x37d964=_0x1b6c60?_0x187fd4['count']:_0x51e798[_0x6b67('0x1a')]+_0x51e798['limit'];var _0x37cf6d;if(_0x37d964>=_0x46c44e){_0x37d964=_0x46c44e;_0x37cf6d=0xc8;}else{_0x37cf6d=0xce;}_0x2213f4[_0x6b67('0x17')](_0x37cf6d);return _0x2213f4[_0x6b67('0x1d')](_0x6b67('0x1e'),_0x46d828+'-'+_0x37d964+'/'+_0x46c44e)['json'](_0x187fd4);}return null;};}function patchUpdates(_0xd36be3){return function(_0x360208){try{jsonpatch[_0x6b67('0x1f')](_0x360208,_0xd36be3,!![]);}catch(_0x50fdfc){return BPromise[_0x6b67('0x20')](_0x50fdfc);}return _0x360208[_0x6b67('0x21')]();};}function saveUpdates(_0x1fedd5,_0x4d48e1){return function(_0xd4fda5){if(_0xd4fda5){return _0xd4fda5[_0x6b67('0x22')](_0x1fedd5)[_0x6b67('0x23')](function(_0x3a0a3f){return _0x3a0a3f;});}return null;};}function removeEntity(_0x393b3d,_0x17d27b){return function(_0x3c89d2){if(_0x3c89d2){return _0x3c89d2[_0x6b67('0x24')]()[_0x6b67('0x23')](function(){_0x393b3d[_0x6b67('0x17')](0xcc)[_0x6b67('0x18')]();});}};}function handleEntityNotFound(_0x47c927,_0x265245){return function(_0x3cffdf){if(!_0x3cffdf){_0x47c927[_0x6b67('0x16')](0x194);}return _0x3cffdf;};}function handleError(_0x5dca55,_0x2b67f6){_0x2b67f6=_0x2b67f6||0x1f4;return function(_0x1c73b0){logger['error'](_0x1c73b0[_0x6b67('0x25')]);if(_0x1c73b0[_0x6b67('0x26')]){delete _0x1c73b0[_0x6b67('0x26')];}_0x5dca55[_0x6b67('0x17')](_0x2b67f6)[_0x6b67('0x27')](_0x1c73b0);};}exports[_0x6b67('0x28')]=function(_0x3b65af,_0x5d9f6d){var _0x320a70={'raw':!![],'where':{'id':_0x3b65af[_0x6b67('0x29')]['id']}},_0x433881={};_0x433881[_0x6b67('0x2a')]=_[_0x6b67('0x2b')](db[_0x6b67('0x2c')][_0x6b67('0x2d')]);_0x433881[_0x6b67('0x2e')]=_['keys'](_0x3b65af[_0x6b67('0x2e')]);_0x433881[_0x6b67('0x2f')]=_[_0x6b67('0x30')](_0x433881[_0x6b67('0x2a')],_0x433881[_0x6b67('0x2e')]);_0x320a70[_0x6b67('0x31')]=_['intersection'](_0x433881['model'],qs[_0x6b67('0x32')](_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x32')]));_0x320a70[_0x6b67('0x31')]=_0x320a70['attributes'][_0x6b67('0x33')]?_0x320a70['attributes']:_0x433881[_0x6b67('0x2a')];if(_0x3b65af[_0x6b67('0x2e')][_0x6b67('0x34')]){_0x320a70['include']=[{'all':!![]}];}_0x320a70=_[_0x6b67('0x35')]({},_0x320a70,_0x3b65af[_0x6b67('0x36')]);return db[_0x6b67('0x2c')]['find'](_0x320a70)[_0x6b67('0x23')](handleEntityNotFound(_0x5d9f6d,null))[_0x6b67('0x23')](respondWithResult(_0x5d9f6d,null))[_0x6b67('0x37')](handleError(_0x5d9f6d,null));};exports[_0x6b67('0x22')]=function(_0x4c3a86,_0x2092f6){if(_0x4c3a86[_0x6b67('0x38')]['id']){delete _0x4c3a86[_0x6b67('0x38')]['id'];}return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4c3a86[_0x6b67('0x29')]['id']}})[_0x6b67('0x23')](handleEntityNotFound(_0x2092f6,null))[_0x6b67('0x23')](saveUpdates(_0x4c3a86['body'],null))[_0x6b67('0x23')](respondWithResult(_0x2092f6,null))[_0x6b67('0x37')](handleError(_0x2092f6,null));};exports[_0x6b67('0x24')]=function(_0x4d259f,_0x3889ef){return db[_0x6b67('0x2c')][_0x6b67('0x39')]({'where':{'id':_0x4d259f[_0x6b67('0x29')]['id']}})['then'](handleEntityNotFound(_0x3889ef,null))['then'](removeEntity(_0x3889ef,null))[_0x6b67('0x37')](handleError(_0x3889ef,null));};
\ No newline at end of file
+var _0xb945=['lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','update','then','destroy','error','stack','send','show','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','include','merge','options','find','body','params','catch','eml-format','zip-dir','request-promise','mustache','util','path','sox','to-csv'];(function(_0x4faedc,_0x3f5ecb){var _0x3132a5=function(_0x19ab6f){while(--_0x19ab6f){_0x4faedc['push'](_0x4faedc['shift']());}};_0x3132a5(++_0x3f5ecb);}(_0xb945,0x97));var _0x5b94=function(_0x3cb152,_0x57eb54){_0x3cb152=_0x3cb152-0x0;var _0x4f54c3=_0xb945[_0x3cb152];return _0x4f54c3;};'use strict';var emlformat=require(_0x5b94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b94('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b94('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b94('0x3'));var util=require(_0x5b94('0x4'));var path=require(_0x5b94('0x5'));var sox=require(_0x5b94('0x6'));var csv=require(_0x5b94('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b94('0x8'));var squel=require(_0x5b94('0x9'));var crypto=require(_0x5b94('0xa'));var jsforce=require(_0x5b94('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5b94('0x7'));var querystring=require('querystring');var Papa=require(_0x5b94('0xc'));var Redis=require(_0x5b94('0xd'));var authService=require(_0x5b94('0xe'));var qs=require(_0x5b94('0xf'));var as=require(_0x5b94('0x10'));var hardwareService=require(_0x5b94('0x11'));var logger=require(_0x5b94('0x12'))('api');var utils=require(_0x5b94('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5b94('0x14'));var db=require(_0x5b94('0x15'))['db'];function respondWithStatusCode(_0x11e65c,_0x23e1d8){_0x23e1d8=_0x23e1d8||0xcc;return function(_0x32948e){if(_0x32948e){return _0x11e65c['sendStatus'](_0x23e1d8);}return _0x11e65c[_0x5b94('0x16')](_0x23e1d8)[_0x5b94('0x17')]();};}function respondWithResult(_0x3d819d,_0x1114ab){_0x1114ab=_0x1114ab||0xc8;return function(_0x51f123){if(_0x51f123){return _0x3d819d[_0x5b94('0x16')](_0x1114ab)['json'](_0x51f123);}};}function respondWithFilteredResult(_0xa8cf03,_0x34aa94){return function(_0x48914f){if(_0x48914f){var _0x40fbc7=typeof _0x34aa94[_0x5b94('0x18')]===_0x5b94('0x19')&&typeof _0x34aa94['limit']===_0x5b94('0x19');var _0x371fce=_0x48914f['count'];var _0x2bb003=_0x40fbc7?0x0:_0x34aa94[_0x5b94('0x18')];var _0x1b5874=_0x40fbc7?_0x48914f['count']:_0x34aa94[_0x5b94('0x18')]+_0x34aa94[_0x5b94('0x1a')];var _0x5b13e0;if(_0x1b5874>=_0x371fce){_0x1b5874=_0x371fce;_0x5b13e0=0xc8;}else{_0x5b13e0=0xce;}_0xa8cf03[_0x5b94('0x16')](_0x5b13e0);return _0xa8cf03[_0x5b94('0x1b')](_0x5b94('0x1c'),_0x2bb003+'-'+_0x1b5874+'/'+_0x371fce)[_0x5b94('0x1d')](_0x48914f);}return null;};}function patchUpdates(_0x1f2293){return function(_0x5d1a5a){try{jsonpatch[_0x5b94('0x1e')](_0x5d1a5a,_0x1f2293,!![]);}catch(_0x44d510){return BPromise['reject'](_0x44d510);}return _0x5d1a5a['save']();};}function saveUpdates(_0x17789b,_0xb9e5db){return function(_0x12980d){if(_0x12980d){return _0x12980d[_0x5b94('0x1f')](_0x17789b)[_0x5b94('0x20')](function(_0x30fb7a){return _0x30fb7a;});}return null;};}function removeEntity(_0x1e8236,_0x31d950){return function(_0x219486){if(_0x219486){return _0x219486[_0x5b94('0x21')]()[_0x5b94('0x20')](function(){_0x1e8236[_0x5b94('0x16')](0xcc)[_0x5b94('0x17')]();});}};}function handleEntityNotFound(_0x1c8db6,_0x439df0){return function(_0x2efe25){if(!_0x2efe25){_0x1c8db6['sendStatus'](0x194);}return _0x2efe25;};}function handleError(_0x21f36e,_0x41a4e9){_0x41a4e9=_0x41a4e9||0x1f4;return function(_0x344373){logger[_0x5b94('0x22')](_0x344373[_0x5b94('0x23')]);if(_0x344373['name']){delete _0x344373['name'];}_0x21f36e[_0x5b94('0x16')](_0x41a4e9)[_0x5b94('0x24')](_0x344373);};}exports[_0x5b94('0x25')]=function(_0x5bace6,_0x6001fd){var _0x377ac5={'raw':!![],'where':{'id':_0x5bace6['params']['id']}},_0x594aca={};_0x594aca[_0x5b94('0x26')]=_[_0x5b94('0x27')](db[_0x5b94('0x28')][_0x5b94('0x29')]);_0x594aca[_0x5b94('0x2a')]=_[_0x5b94('0x27')](_0x5bace6[_0x5b94('0x2a')]);_0x594aca['filters']=_[_0x5b94('0x2b')](_0x594aca['model'],_0x594aca['query']);_0x377ac5['attributes']=_[_0x5b94('0x2b')](_0x594aca[_0x5b94('0x26')],qs['fields'](_0x5bace6[_0x5b94('0x2a')][_0x5b94('0x2c')]));_0x377ac5[_0x5b94('0x2d')]=_0x377ac5[_0x5b94('0x2d')]['length']?_0x377ac5['attributes']:_0x594aca[_0x5b94('0x26')];if(_0x5bace6[_0x5b94('0x2a')]['includeAll']){_0x377ac5[_0x5b94('0x2e')]=[{'all':!![]}];}_0x377ac5=_[_0x5b94('0x2f')]({},_0x377ac5,_0x5bace6[_0x5b94('0x30')]);return db[_0x5b94('0x28')][_0x5b94('0x31')](_0x377ac5)['then'](handleEntityNotFound(_0x6001fd,null))['then'](respondWithResult(_0x6001fd,null))['catch'](handleError(_0x6001fd,null));};exports[_0x5b94('0x1f')]=function(_0x1a9b30,_0x4a1f86){if(_0x1a9b30[_0x5b94('0x32')]['id']){delete _0x1a9b30['body']['id'];}return db['ChatApplication'][_0x5b94('0x31')]({'where':{'id':_0x1a9b30[_0x5b94('0x33')]['id']}})[_0x5b94('0x20')](handleEntityNotFound(_0x4a1f86,null))['then'](saveUpdates(_0x1a9b30['body'],null))[_0x5b94('0x20')](respondWithResult(_0x4a1f86,null))[_0x5b94('0x34')](handleError(_0x4a1f86,null));};exports['destroy']=function(_0x4cbd22,_0x461eef){return db[_0x5b94('0x28')][_0x5b94('0x31')]({'where':{'id':_0x4cbd22[_0x5b94('0x33')]['id']}})['then'](handleEntityNotFound(_0x461eef,null))['then'](removeEntity(_0x461eef,null))[_0x5b94('0x34')](handleError(_0x461eef,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 0ccadd9..173d37e 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 _0x7ca3=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x3da77c,_0x5251ff){var _0x35ff37=function(_0x6fc260){while(--_0x6fc260){_0x3da77c['push'](_0x3da77c['shift']());}};_0x35ff37(++_0x5251ff);}(_0x7ca3,0x9b));var _0x37ca=function(_0x1265fa,_0x1a1fed){_0x1265fa=_0x1265fa-0x0;var _0x1fe35e=_0x7ca3[_0x1265fa];return _0x1fe35e;};'use strict';var _=require('lodash');var util=require(_0x37ca('0x0'));var logger=require(_0x37ca('0x1'))(_0x37ca('0x2'));var moment=require(_0x37ca('0x3'));var BPromise=require(_0x37ca('0x4'));var rp=require(_0x37ca('0x5'));var fs=require('fs');var path=require(_0x37ca('0x6'));var rimraf=require('rimraf');var config=require(_0x37ca('0x7'));var attributes=require('./chatApplication.attributes');module[_0x37ca('0x8')]=function(_0x3f0a23,_0xbb16e3){return _0x3f0a23['define'](_0x37ca('0x9'),attributes,{'tableName':_0x37ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x37ca('0xb'),'collate':_0x37ca('0xc')});};
\ No newline at end of file
+var _0x737d=['exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x3fe30d,_0x469e48){var _0x37b3e1=function(_0x5f1a27){while(--_0x5f1a27){_0x3fe30d['push'](_0x3fe30d['shift']());}};_0x37b3e1(++_0x469e48);}(_0x737d,0x72));var _0xd737=function(_0x151efc,_0xacfaf2){_0x151efc=_0x151efc-0x0;var _0x1debeb=_0x737d[_0x151efc];return _0x1debeb;};'use strict';var _=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var logger=require(_0xd737('0x2'))(_0xd737('0x3'));var moment=require(_0xd737('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd737('0x5'));var rimraf=require(_0xd737('0x6'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0xd737('0x7')]=function(_0x565d4d,_0x4e5be1){return _0x565d4d[_0xd737('0x8')]('ChatApplication',attributes,{'tableName':_0xd737('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd737('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 198e432..95c1dae 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 _0x2c93=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2c93,0x106));var _0x32c9=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2c93[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x32c9('0x0'));var util=require(_0x32c9('0x1'));var moment=require(_0x32c9('0x2'));var BPromise=require(_0x32c9('0x3'));var rs=require(_0x32c9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x32c9('0x5'));var logger=require(_0x32c9('0x6'))(_0x32c9('0x7'));var config=require('../../config/environment');var jayson=require(_0x32c9('0x8'));var client=jayson[_0x32c9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x112024,_0x8c5c8e,_0x1b8ef9){return new BPromise(function(_0x1f6062,_0x30e03d){return client[_0x32c9('0xa')](_0x112024,_0x1b8ef9)[_0x32c9('0xb')](function(_0x43bb2c){logger[_0x32c9('0xc')](_0x32c9('0xd'),_0x8c5c8e,_0x32c9('0xe'));logger[_0x32c9('0xf')](_0x32c9('0x10'),_0x8c5c8e,_0x32c9('0xe'),JSON['stringify'](_0x43bb2c));if(_0x43bb2c[_0x32c9('0x11')]){if(_0x43bb2c[_0x32c9('0x11')][_0x32c9('0x12')]===0x1f4){logger[_0x32c9('0x11')](_0x32c9('0xd'),_0x8c5c8e,_0x43bb2c[_0x32c9('0x11')][_0x32c9('0x13')]);return _0x30e03d(_0x43bb2c[_0x32c9('0x11')][_0x32c9('0x13')]);}logger[_0x32c9('0x11')](_0x32c9('0xd'),_0x8c5c8e,_0x43bb2c['error'][_0x32c9('0x13')]);return _0x1f6062(_0x43bb2c['error'][_0x32c9('0x13')]);}else{logger[_0x32c9('0xc')](_0x32c9('0xd'),_0x8c5c8e,_0x32c9('0xe'));_0x1f6062(_0x43bb2c[_0x32c9('0x14')][_0x32c9('0x13')]);}})[_0x32c9('0x15')](function(_0x3a76ee){logger[_0x32c9('0x11')](_0x32c9('0xd'),_0x8c5c8e,_0x3a76ee);_0x30e03d(_0x3a76ee);});});}
\ No newline at end of file
+var _0x73f3=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatApplication,\x20%s,\x20%s','message','result'];(function(_0x3b9ebc,_0x3920da){var _0x1ca0ea=function(_0xa9695a){while(--_0xa9695a){_0x3b9ebc['push'](_0x3b9ebc['shift']());}};_0x1ca0ea(++_0x3920da);}(_0x73f3,0x1cc));var _0x373f=function(_0x422eb5,_0x2e9f9a){_0x422eb5=_0x422eb5-0x0;var _0x2a511b=_0x73f3[_0x422eb5];return _0x2a511b;};'use strict';var _=require(_0x373f('0x0'));var util=require(_0x373f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x373f('0x2'));var fs=require('fs');var Redis=require(_0x373f('0x3'));var db=require(_0x373f('0x4'))['db'];var utils=require(_0x373f('0x5'));var logger=require('../../config/logger')(_0x373f('0x6'));var config=require('../../config/environment');var jayson=require(_0x373f('0x7'));var client=jayson[_0x373f('0x8')][_0x373f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c7b77,_0x51bbac,_0x3815fb){return new BPromise(function(_0x5f3a68,_0x2ee770){return client[_0x373f('0xa')](_0x1c7b77,_0x3815fb)['then'](function(_0x3e2d35){logger[_0x373f('0xb')]('ChatApplication,\x20%s,\x20%s',_0x51bbac,'request\x20sent');logger[_0x373f('0xc')](_0x373f('0xd'),_0x51bbac,_0x373f('0xe'),JSON['stringify'](_0x3e2d35));if(_0x3e2d35[_0x373f('0xf')]){if(_0x3e2d35[_0x373f('0xf')][_0x373f('0x10')]===0x1f4){logger['error'](_0x373f('0x11'),_0x51bbac,_0x3e2d35['error'][_0x373f('0x12')]);return _0x2ee770(_0x3e2d35[_0x373f('0xf')][_0x373f('0x12')]);}logger[_0x373f('0xf')]('ChatApplication,\x20%s,\x20%s',_0x51bbac,_0x3e2d35[_0x373f('0xf')]['message']);return _0x5f3a68(_0x3e2d35[_0x373f('0xf')][_0x373f('0x12')]);}else{logger[_0x373f('0xb')]('ChatApplication,\x20%s,\x20%s',_0x51bbac,_0x373f('0xe'));_0x5f3a68(_0x3e2d35[_0x373f('0x13')][_0x373f('0x12')]);}})['catch'](function(_0x1a0a61){logger[_0x373f('0xf')](_0x373f('0x11'),_0x51bbac,_0x1a0a61);_0x2ee770(_0x1a0a61);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index b4e40ba..aed6b43 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 _0x3798=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3798,0xe9));var _0x8379=function(_0x1da90d,_0x349c14){_0x1da90d=_0x1da90d-0x0;var _0x34aae9=_0x3798[_0x1da90d];return _0x34aae9;};'use strict';var multer=require(_0x8379('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8379('0x1'));var router=express[_0x8379('0x2')]();var fs_extra=require(_0x8379('0x3'));var auth=require(_0x8379('0x4'));var interaction=require(_0x8379('0x5'));var config=require(_0x8379('0x6'));var controller=require('./chatApplication.controller');router[_0x8379('0x7')](_0x8379('0x8'),auth[_0x8379('0x9')](),controller['show']);router['put']('/:id',auth[_0x8379('0x9')](),controller[_0x8379('0xa')]);router[_0x8379('0xb')](_0x8379('0x8'),auth[_0x8379('0x9')](),controller[_0x8379('0xc')]);module[_0x8379('0xd')]=router;
\ No newline at end of file
+var _0x5673=['isAuthenticated','show','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get'];(function(_0x56281b,_0x581ef5){var _0x37e4e8=function(_0x5df89f){while(--_0x5df89f){_0x56281b['push'](_0x56281b['shift']());}};_0x37e4e8(++_0x581ef5);}(_0x5673,0x1b7));var _0x3567=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0x5673[_0x3124f8];return _0x5bab5f;};'use strict';var multer=require(_0x3567('0x0'));var util=require(_0x3567('0x1'));var path=require(_0x3567('0x2'));var timeout=require(_0x3567('0x3'));var express=require(_0x3567('0x4'));var router=express[_0x3567('0x5')]();var fs_extra=require(_0x3567('0x6'));var auth=require(_0x3567('0x7'));var interaction=require(_0x3567('0x8'));var config=require('../../config/environment');var controller=require(_0x3567('0x9'));router[_0x3567('0xa')]('/:id',auth[_0x3567('0xb')](),controller[_0x3567('0xc')]);router[_0x3567('0xd')](_0x3567('0xe'),auth[_0x3567('0xb')](),controller[_0x3567('0xf')]);router[_0x3567('0x10')](_0x3567('0xe'),auth[_0x3567('0xb')](),controller['destroy']);module[_0x3567('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 82b13d2..f9f379e 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 _0xaac4=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3663cb,_0x426160){var _0x2e5262=function(_0xf5ee41){while(--_0xf5ee41){_0x3663cb['push'](_0x3663cb['shift']());}};_0x2e5262(++_0x426160);}(_0xaac4,0x6c));var _0x4aac=function(_0x419c4a,_0x5d525d){_0x419c4a=_0x419c4a-0x0;var _0x4dae37=_0xaac4[_0x419c4a];return _0x4dae37;};'use strict';var Sequelize=require(_0x4aac('0x0'));module[_0x4aac('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4aac('0x2')]},'write':{'type':Sequelize[_0x4aac('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xd706=['BOOLEAN','sequelize','exports','STRING'];(function(_0xf0fd64,_0x5a71db){var _0x1d5666=function(_0x44aeb5){while(--_0x44aeb5){_0xf0fd64['push'](_0xf0fd64['shift']());}};_0x1d5666(++_0x5a71db);}(_0xd706,0x115));var _0x6d70=function(_0x24148a,_0x2c3b2a){_0x24148a=_0x24148a-0x0;var _0x45d54a=_0xd706[_0x24148a];return _0x45d54a;};'use strict';var Sequelize=require(_0x6d70('0x0'));module[_0x6d70('0x1')]={'name':{'type':Sequelize[_0x6d70('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x6d70('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index a00b7a3..72a453c 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 _0xa277=['getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','ChatGroup','findAll','rows','catch','find','create','body','update','params','describe','ChatInternalMessage','addMembers','omit','User','order','getMembers','removeMembers'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xa277,0x1f0));var _0x7a27=function(_0x180131,_0x28e667){_0x180131=_0x180131-0x0;var _0x13755b=_0xa277[_0x180131];return _0x13755b;};'use strict';var emlformat=require(_0x7a27('0x0'));var rimraf=require(_0x7a27('0x1'));var zipdir=require(_0x7a27('0x2'));var jsonpatch=require(_0x7a27('0x3'));var rp=require(_0x7a27('0x4'));var moment=require('moment');var BPromise=require(_0x7a27('0x5'));var Mustache=require(_0x7a27('0x6'));var util=require(_0x7a27('0x7'));var path=require('path');var sox=require(_0x7a27('0x8'));var csv=require(_0x7a27('0x9'));var ejs=require(_0x7a27('0xa'));var fs=require('fs');var fs_extra=require(_0x7a27('0xb'));var _=require(_0x7a27('0xc'));var squel=require('squel');var crypto=require(_0x7a27('0xd'));var jsforce=require(_0x7a27('0xe'));var deskjs=require(_0x7a27('0xf'));var toCsv=require(_0x7a27('0x9'));var querystring=require(_0x7a27('0x10'));var Papa=require(_0x7a27('0x11'));var Redis=require(_0x7a27('0x12'));var authService=require(_0x7a27('0x13'));var qs=require(_0x7a27('0x14'));var as=require(_0x7a27('0x15'));var hardwareService=require(_0x7a27('0x16'));var logger=require('../../config/logger')(_0x7a27('0x17'));var utils=require(_0x7a27('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7a27('0x19'));var db=require(_0x7a27('0x1a'))['db'];config['redis']=_[_0x7a27('0x1b')](config[_0x7a27('0x1c')],{'host':_0x7a27('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7a27('0x1e'))['register'](socket);function respondWithStatusCode(_0x3a9dd1,_0x3f4482){_0x3f4482=_0x3f4482||0xcc;return function(_0x5f0262){if(_0x5f0262){return _0x3a9dd1[_0x7a27('0x1f')](_0x3f4482);}return _0x3a9dd1[_0x7a27('0x20')](_0x3f4482)[_0x7a27('0x21')]();};}function respondWithResult(_0x4c4579,_0x28b608){_0x28b608=_0x28b608||0xc8;return function(_0x1433ae){if(_0x1433ae){return _0x4c4579[_0x7a27('0x20')](_0x28b608)[_0x7a27('0x22')](_0x1433ae);}};}function respondWithFilteredResult(_0x3bd962,_0x2ff936){return function(_0x290e25){if(_0x290e25){var _0x480deb=typeof _0x2ff936[_0x7a27('0x23')]===_0x7a27('0x24')&&typeof _0x2ff936[_0x7a27('0x25')]===_0x7a27('0x24');var _0x4befc8=_0x290e25['count'];var _0x2e13a7=_0x480deb?0x0:_0x2ff936[_0x7a27('0x23')];var _0x340925=_0x480deb?_0x290e25[_0x7a27('0x26')]:_0x2ff936[_0x7a27('0x23')]+_0x2ff936[_0x7a27('0x25')];var _0x2c0fcf;if(_0x340925>=_0x4befc8){_0x340925=_0x4befc8;_0x2c0fcf=0xc8;}else{_0x2c0fcf=0xce;}_0x3bd962[_0x7a27('0x20')](_0x2c0fcf);return _0x3bd962[_0x7a27('0x27')](_0x7a27('0x28'),_0x2e13a7+'-'+_0x340925+'/'+_0x4befc8)['json'](_0x290e25);}return null;};}function patchUpdates(_0x26e71e){return function(_0xf71b3c){try{jsonpatch[_0x7a27('0x29')](_0xf71b3c,_0x26e71e,!![]);}catch(_0x8c3777){return BPromise[_0x7a27('0x2a')](_0x8c3777);}return _0xf71b3c[_0x7a27('0x2b')]();};}function saveUpdates(_0x59bab5,_0x509e20){return function(_0xb85130){if(_0xb85130){return _0xb85130['update'](_0x59bab5)[_0x7a27('0x2c')](function(_0x6dc1a4){return _0x6dc1a4;});}return null;};}function removeEntity(_0x1f3810,_0x20dbc4){return function(_0x4f9732){if(_0x4f9732){return _0x4f9732[_0x7a27('0x2d')]()['then'](function(){_0x1f3810[_0x7a27('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1126c7,_0xb7dbde){return function(_0x3af1a3){if(!_0x3af1a3){_0x1126c7['sendStatus'](0x194);}return _0x3af1a3;};}function handleError(_0x3f46af,_0x1fbf01){_0x1fbf01=_0x1fbf01||0x1f4;return function(_0x4f51f1){logger[_0x7a27('0x2e')](_0x4f51f1[_0x7a27('0x2f')]);if(_0x4f51f1[_0x7a27('0x30')]){delete _0x4f51f1['name'];}_0x3f46af['status'](_0x1fbf01)[_0x7a27('0x31')](_0x4f51f1);};}exports[_0x7a27('0x32')]=function(_0x4da785,_0x1191ee){var _0x1eec5c={},_0x7befcc={},_0x48686a={'count':0x0,'rows':[]};var _0x11e570=_['map'](db['ChatGroup'][_0x7a27('0x33')],function(_0x1436f5){return{'name':_0x1436f5[_0x7a27('0x34')],'type':_0x1436f5[_0x7a27('0x35')][_0x7a27('0x36')]};});_0x7befcc[_0x7a27('0x37')]=_[_0x7a27('0x38')](_0x11e570,'name');_0x7befcc[_0x7a27('0x39')]=_[_0x7a27('0x3a')](_0x4da785[_0x7a27('0x39')]);_0x7befcc['filters']=_[_0x7a27('0x3b')](_0x7befcc[_0x7a27('0x37')],_0x7befcc[_0x7a27('0x39')]);_0x1eec5c[_0x7a27('0x3c')]=_[_0x7a27('0x3b')](_0x7befcc[_0x7a27('0x37')],qs['fields'](_0x4da785['query'][_0x7a27('0x3d')]));_0x1eec5c['attributes']=_0x1eec5c[_0x7a27('0x3c')][_0x7a27('0x3e')]?_0x1eec5c[_0x7a27('0x3c')]:_0x7befcc[_0x7a27('0x37')];if(!_0x4da785['query'][_0x7a27('0x3f')](_0x7a27('0x40'))){_0x1eec5c[_0x7a27('0x25')]=qs[_0x7a27('0x25')](_0x4da785[_0x7a27('0x39')][_0x7a27('0x25')]);_0x1eec5c[_0x7a27('0x23')]=qs[_0x7a27('0x23')](_0x4da785['query']['offset']);}_0x1eec5c['order']=qs['sort'](_0x4da785[_0x7a27('0x39')][_0x7a27('0x41')]);_0x1eec5c['where']=qs[_0x7a27('0x42')](_[_0x7a27('0x43')](_0x4da785[_0x7a27('0x39')],_0x7befcc[_0x7a27('0x42')]),_0x11e570);if(_0x4da785['query']['filter']){_0x1eec5c[_0x7a27('0x44')]=_[_0x7a27('0x45')](_0x1eec5c[_0x7a27('0x44')],{'$or':_[_0x7a27('0x38')](_0x11e570,function(_0x1fb3b5){if(_0x1fb3b5[_0x7a27('0x35')]!==_0x7a27('0x46')){var _0xa03ebd={};_0xa03ebd[_0x1fb3b5[_0x7a27('0x30')]]={'$like':'%'+_0x4da785[_0x7a27('0x39')][_0x7a27('0x47')]+'%'};return _0xa03ebd;}})});}_0x1eec5c=_[_0x7a27('0x45')]({},_0x1eec5c,_0x4da785[_0x7a27('0x48')]);var _0x594078={'where':_0x1eec5c[_0x7a27('0x44')]};return db['ChatGroup'][_0x7a27('0x26')](_0x594078)[_0x7a27('0x2c')](function(_0x24a3ae){_0x48686a[_0x7a27('0x26')]=_0x24a3ae;if(_0x4da785['query'][_0x7a27('0x49')]){_0x1eec5c[_0x7a27('0x4a')]=[{'all':!![]}];}return db[_0x7a27('0x4b')][_0x7a27('0x4c')](_0x1eec5c);})[_0x7a27('0x2c')](function(_0x2c7a6c){_0x48686a[_0x7a27('0x4d')]=_0x2c7a6c;return _0x48686a;})[_0x7a27('0x2c')](respondWithFilteredResult(_0x1191ee,_0x1eec5c))[_0x7a27('0x4e')](handleError(_0x1191ee,null));};exports['show']=function(_0x5f4f23,_0x41b00e){var _0x76f894={'raw':!![],'where':{'id':_0x5f4f23['params']['id']}},_0x1cdd7e={};_0x1cdd7e[_0x7a27('0x37')]=_[_0x7a27('0x3a')](db['ChatGroup']['rawAttributes']);_0x1cdd7e[_0x7a27('0x39')]=_[_0x7a27('0x3a')](_0x5f4f23[_0x7a27('0x39')]);_0x1cdd7e['filters']=_[_0x7a27('0x3b')](_0x1cdd7e['model'],_0x1cdd7e[_0x7a27('0x39')]);_0x76f894[_0x7a27('0x3c')]=_[_0x7a27('0x3b')](_0x1cdd7e[_0x7a27('0x37')],qs[_0x7a27('0x3d')](_0x5f4f23['query'][_0x7a27('0x3d')]));_0x76f894[_0x7a27('0x3c')]=_0x76f894[_0x7a27('0x3c')][_0x7a27('0x3e')]?_0x76f894[_0x7a27('0x3c')]:_0x1cdd7e[_0x7a27('0x37')];if(_0x5f4f23['query']['includeAll']){_0x76f894['include']=[{'all':!![]}];}_0x76f894=_[_0x7a27('0x45')]({},_0x76f894,_0x5f4f23[_0x7a27('0x48')]);return db[_0x7a27('0x4b')][_0x7a27('0x4f')](_0x76f894)[_0x7a27('0x2c')](handleEntityNotFound(_0x41b00e,null))[_0x7a27('0x2c')](respondWithResult(_0x41b00e,null))[_0x7a27('0x4e')](handleError(_0x41b00e,null));};exports[_0x7a27('0x50')]=function(_0x3072bc,_0x5840b0){return db[_0x7a27('0x4b')][_0x7a27('0x50')](_0x3072bc[_0x7a27('0x51')],{})[_0x7a27('0x2c')](respondWithResult(_0x5840b0,0xc9))[_0x7a27('0x4e')](handleError(_0x5840b0,null));};exports[_0x7a27('0x52')]=function(_0x2e16b2,_0x1b08dc){if(_0x2e16b2['body']['id']){delete _0x2e16b2[_0x7a27('0x51')]['id'];}return db[_0x7a27('0x4b')][_0x7a27('0x4f')]({'where':{'id':_0x2e16b2[_0x7a27('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b08dc,null))[_0x7a27('0x2c')](saveUpdates(_0x2e16b2[_0x7a27('0x51')],null))[_0x7a27('0x2c')](respondWithResult(_0x1b08dc,null))[_0x7a27('0x4e')](handleError(_0x1b08dc,null));};exports[_0x7a27('0x2d')]=function(_0x2ff167,_0x7879ad){return db[_0x7a27('0x4b')][_0x7a27('0x4f')]({'where':{'id':_0x2ff167['params']['id']}})[_0x7a27('0x2c')](handleEntityNotFound(_0x7879ad,null))[_0x7a27('0x2c')](removeEntity(_0x7879ad,null))[_0x7a27('0x4e')](handleError(_0x7879ad,null));};exports[_0x7a27('0x54')]=function(_0x3d8d92,_0xe2ce79){return db[_0x7a27('0x4b')]['describe']()[_0x7a27('0x2c')](respondWithResult(_0xe2ce79,null))[_0x7a27('0x4e')](handleError(_0xe2ce79,null));};exports['getUnread']=function(_0x30f38c,_0x26ae7c,_0x3ecba2){return db[_0x7a27('0x55')][_0x7a27('0x26')]({'where':{'ChatGroupId':_0x30f38c[_0x7a27('0x53')]['id'],'ToId':_0x30f38c['user']['id'],'read':![]}})[_0x7a27('0x2c')](function(_0x7f9ba){return{'id':_['toInteger'](_0x30f38c['params']['id']),'count':_0x7f9ba};})[_0x7a27('0x2c')](respondWithResult(_0x26ae7c,null))['catch'](handleError(_0x26ae7c,null));};exports[_0x7a27('0x56')]=function(_0x2a4142,_0x24d20e,_0x1b9e14){return db[_0x7a27('0x4b')][_0x7a27('0x4f')]({'where':{'id':_0x2a4142[_0x7a27('0x53')]['id']}})[_0x7a27('0x2c')](handleEntityNotFound(_0x24d20e,null))[_0x7a27('0x2c')](function(_0xe09070){if(_0xe09070){return _0xe09070[_0x7a27('0x56')](_0x2a4142['body']['ids'],_[_0x7a27('0x57')](_0x2a4142['body'],['ids','id'])||{});}})[_0x7a27('0x2c')](respondWithResult(_0x24d20e,null))[_0x7a27('0x4e')](handleError(_0x24d20e,null));};exports['getMembers']=function(_0x21c30b,_0x1f051e,_0x528b88){var _0x576537={};var _0x422135={};var _0x5628b7;var _0x5042d6;return db[_0x7a27('0x4b')]['findOne']({'where':{'id':_0x21c30b[_0x7a27('0x53')]['id']}})[_0x7a27('0x2c')](handleEntityNotFound(_0x1f051e,null))[_0x7a27('0x2c')](function(_0xd18baa){if(_0xd18baa){_0x5628b7=_0xd18baa;_0x422135[_0x7a27('0x37')]=_[_0x7a27('0x3a')](db[_0x7a27('0x58')][_0x7a27('0x33')]);_0x422135['query']=_[_0x7a27('0x3a')](_0x21c30b[_0x7a27('0x39')]);_0x422135['filters']=_[_0x7a27('0x3b')](_0x422135[_0x7a27('0x37')],_0x422135['query']);_0x576537['attributes']=_['intersection'](_0x422135['model'],qs[_0x7a27('0x3d')](_0x21c30b[_0x7a27('0x39')][_0x7a27('0x3d')]));_0x576537[_0x7a27('0x3c')]=_0x576537[_0x7a27('0x3c')][_0x7a27('0x3e')]?_0x576537[_0x7a27('0x3c')]:_0x422135[_0x7a27('0x37')];_0x576537[_0x7a27('0x59')]=qs[_0x7a27('0x41')](_0x21c30b['query'][_0x7a27('0x41')]);_0x576537['where']=qs[_0x7a27('0x42')](_['pick'](_0x21c30b[_0x7a27('0x39')],_0x422135[_0x7a27('0x42')]));if(_0x21c30b[_0x7a27('0x39')][_0x7a27('0x47')]){_0x576537[_0x7a27('0x44')]=_[_0x7a27('0x45')](_0x576537[_0x7a27('0x44')],{'$or':_[_0x7a27('0x38')](_0x576537['attributes'],function(_0x41629f){var _0x483711={};_0x483711[_0x41629f]={'$like':'%'+_0x21c30b[_0x7a27('0x39')][_0x7a27('0x47')]+'%'};return _0x483711;})});}_0x576537=_[_0x7a27('0x45')]({},_0x576537,_0x21c30b[_0x7a27('0x48')]);return _0x5628b7[_0x7a27('0x5a')](_0x576537);}})[_0x7a27('0x2c')](function(_0xb26db1){if(_0xb26db1){_0x5042d6=_0xb26db1[_0x7a27('0x3e')];if(!_0x21c30b[_0x7a27('0x39')][_0x7a27('0x3f')](_0x7a27('0x40'))){_0x576537[_0x7a27('0x25')]=qs[_0x7a27('0x25')](_0x21c30b[_0x7a27('0x39')][_0x7a27('0x25')]);_0x576537[_0x7a27('0x23')]=qs[_0x7a27('0x23')](_0x21c30b[_0x7a27('0x39')]['offset']);}return _0x5628b7['getMembers'](_0x576537);}})[_0x7a27('0x2c')](function(_0x51cfc9){if(_0x51cfc9){return _0x51cfc9?{'count':_0x5042d6,'rows':_0x51cfc9}:null;}})[_0x7a27('0x2c')](respondWithResult(_0x1f051e,null))[_0x7a27('0x4e')](handleError(_0x1f051e,null));};exports['removeMembers']=function(_0x5cb62b,_0x38c470,_0x31a133){return db[_0x7a27('0x4b')][_0x7a27('0x4f')]({'where':{'id':_0x5cb62b[_0x7a27('0x53')]['id']}})['then'](handleEntityNotFound(_0x38c470,null))[_0x7a27('0x2c')](function(_0x4b635f){if(_0x4b635f){return _0x4b635f[_0x7a27('0x5b')](_0x5cb62b[_0x7a27('0x39')]['ids']);}})['then'](respondWithStatusCode(_0x38c470,null))[_0x7a27('0x4e')](handleError(_0x38c470,null));};exports['addMessage']=function(_0x3b2b63,_0x3661e7,_0x5cd9e4){if(_0x3b2b63[_0x7a27('0x51')]['id']){delete _0x3b2b63[_0x7a27('0x51')]['id'];}return db[_0x7a27('0x4b')]['find']({'where':{'id':_0x3b2b63['params']['id']}})['then'](handleEntityNotFound(_0x3661e7,null))[_0x7a27('0x2c')](function(_0x2631ff){if(_0x2631ff){_0x3b2b63[_0x7a27('0x51')]['ChatGroupId']=_0x2631ff['id'];return db[_0x7a27('0x55')][_0x7a27('0x50')](_0x3b2b63[_0x7a27('0x51')]);}})['then'](respondWithResult(_0x3661e7,null))[_0x7a27('0x4e')](handleError(_0x3661e7,null));};exports[_0x7a27('0x5c')]=function(_0xd6544c,_0x2c17cf,_0x1bc540){var _0x5b385f={};var _0x4d05be={};var _0xb4a279;var _0x38e145;return db[_0x7a27('0x4b')][_0x7a27('0x5d')]({'where':{'id':_0xd6544c['params']['id']}})[_0x7a27('0x2c')](handleEntityNotFound(_0x2c17cf,null))[_0x7a27('0x2c')](function(_0x4701c4){if(_0x4701c4){_0xb4a279=_0x4701c4;_0x4d05be[_0x7a27('0x37')]=_[_0x7a27('0x3a')](db[_0x7a27('0x55')]['rawAttributes']);_0x4d05be['query']=_[_0x7a27('0x3a')](_0xd6544c[_0x7a27('0x39')]);_0x4d05be['filters']=_[_0x7a27('0x3b')](_0x4d05be['model'],_0x4d05be[_0x7a27('0x39')]);_0x5b385f['attributes']=_[_0x7a27('0x3b')](_0x4d05be[_0x7a27('0x37')],qs[_0x7a27('0x3d')](_0xd6544c[_0x7a27('0x39')][_0x7a27('0x3d')]));_0x5b385f['attributes']=_0x5b385f[_0x7a27('0x3c')][_0x7a27('0x3e')]?_0x5b385f[_0x7a27('0x3c')]:_0x4d05be[_0x7a27('0x37')];_0x5b385f['order']=qs[_0x7a27('0x41')](_0xd6544c[_0x7a27('0x39')][_0x7a27('0x41')]);_0x5b385f[_0x7a27('0x44')]=qs[_0x7a27('0x42')](_[_0x7a27('0x43')](_0xd6544c[_0x7a27('0x39')],_0x4d05be['filters']));if(_0xd6544c[_0x7a27('0x39')][_0x7a27('0x47')]){_0x5b385f[_0x7a27('0x44')]=_[_0x7a27('0x45')](_0x5b385f[_0x7a27('0x44')],{'$or':_[_0x7a27('0x38')](_0x5b385f[_0x7a27('0x3c')],function(_0x5b3b69){var _0x535d7f={};_0x535d7f[_0x5b3b69]={'$like':'%'+_0xd6544c['query'][_0x7a27('0x47')]+'%'};return _0x535d7f;})});}if(_0xd6544c[_0x7a27('0x39')][_0x7a27('0x5e')]){var _0xf76bd7=_0xd6544c[_0x7a27('0x39')][_0x7a27('0x5e')][_0x7a27('0x5f')](',');var _0x3e755d={};_0x3e755d[_0xf76bd7[0x0]]={'$gte':moment(_0xf76bd7[0x1])[_0x7a27('0x60')](_0x7a27('0x61'))};_0x5b385f[_0x7a27('0x44')]=_[_0x7a27('0x45')](_0x5b385f[_0x7a27('0x44')],_0x3e755d);}_0x5b385f=_[_0x7a27('0x45')]({},_0x5b385f,_0xd6544c[_0x7a27('0x48')]);return _0xb4a279[_0x7a27('0x5c')](_0x5b385f);}})[_0x7a27('0x2c')](function(_0xbeb2a3){if(_0xbeb2a3){_0x38e145=_0xbeb2a3[_0x7a27('0x3e')];if(!_0xd6544c[_0x7a27('0x39')][_0x7a27('0x3f')](_0x7a27('0x40'))){_0x5b385f[_0x7a27('0x25')]=qs[_0x7a27('0x25')](_0xd6544c[_0x7a27('0x39')][_0x7a27('0x25')]);_0x5b385f['offset']=qs[_0x7a27('0x23')](_0xd6544c[_0x7a27('0x39')]['offset']);}return _0xb4a279['getMessages'](_0x5b385f);}})[_0x7a27('0x2c')](function(_0x1ea6a4){if(_0x1ea6a4){return _0x1ea6a4?{'count':_0x38e145,'rows':_0x1ea6a4}:null;}})[_0x7a27('0x2c')](respondWithResult(_0x2c17cf,null))['catch'](handleError(_0x2c17cf,null));};
\ No newline at end of file
+var _0x24a8=['limit','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','User','removeMembers','addMessage','ChatGroupId','findOne','split','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined'];(function(_0x4cc5a4,_0x56635b){var _0x1abfe3=function(_0x188bfa){while(--_0x188bfa){_0x4cc5a4['push'](_0x4cc5a4['shift']());}};_0x1abfe3(++_0x56635b);}(_0x24a8,0x163));var _0x824a=function(_0x5511d4,_0x51aab8){_0x5511d4=_0x5511d4-0x0;var _0x133104=_0x24a8[_0x5511d4];return _0x133104;};'use strict';var emlformat=require(_0x824a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x824a('0x1'));var jsonpatch=require(_0x824a('0x2'));var rp=require(_0x824a('0x3'));var moment=require(_0x824a('0x4'));var BPromise=require(_0x824a('0x5'));var Mustache=require('mustache');var util=require(_0x824a('0x6'));var path=require(_0x824a('0x7'));var sox=require(_0x824a('0x8'));var csv=require('to-csv');var ejs=require(_0x824a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x824a('0xa'));var squel=require(_0x824a('0xb'));var crypto=require('crypto');var jsforce=require(_0x824a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x824a('0xd'));var querystring=require('querystring');var Papa=require(_0x824a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x824a('0xf'));var as=require(_0x824a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x824a('0x11'))(_0x824a('0x12'));var utils=require(_0x824a('0x13'));var config=require(_0x824a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x824a('0x15'))['db'];config[_0x824a('0x16')]=_[_0x824a('0x17')](config[_0x824a('0x16')],{'host':_0x824a('0x18'),'port':0x18eb});var socket=require(_0x824a('0x19'))(new Redis(config[_0x824a('0x16')]));require(_0x824a('0x1a'))[_0x824a('0x1b')](socket);function respondWithStatusCode(_0x148252,_0x4dde86){_0x4dde86=_0x4dde86||0xcc;return function(_0x4d396f){if(_0x4d396f){return _0x148252[_0x824a('0x1c')](_0x4dde86);}return _0x148252[_0x824a('0x1d')](_0x4dde86)['end']();};}function respondWithResult(_0x5358e4,_0x228be1){_0x228be1=_0x228be1||0xc8;return function(_0x52ac9f){if(_0x52ac9f){return _0x5358e4[_0x824a('0x1d')](_0x228be1)[_0x824a('0x1e')](_0x52ac9f);}};}function respondWithFilteredResult(_0xcfefa2,_0x1948aa){return function(_0x4cadbe){if(_0x4cadbe){var _0x588668=typeof _0x1948aa[_0x824a('0x1f')]===_0x824a('0x20')&&typeof _0x1948aa[_0x824a('0x21')]==='undefined';var _0x35b89f=_0x4cadbe[_0x824a('0x22')];var _0x3ee5e7=_0x588668?0x0:_0x1948aa['offset'];var _0x468053=_0x588668?_0x4cadbe[_0x824a('0x22')]:_0x1948aa['offset']+_0x1948aa['limit'];var _0xbb43f6;if(_0x468053>=_0x35b89f){_0x468053=_0x35b89f;_0xbb43f6=0xc8;}else{_0xbb43f6=0xce;}_0xcfefa2['status'](_0xbb43f6);return _0xcfefa2[_0x824a('0x23')](_0x824a('0x24'),_0x3ee5e7+'-'+_0x468053+'/'+_0x35b89f)[_0x824a('0x1e')](_0x4cadbe);}return null;};}function patchUpdates(_0x1864be){return function(_0x30da1f){try{jsonpatch[_0x824a('0x25')](_0x30da1f,_0x1864be,!![]);}catch(_0x73d4dc){return BPromise[_0x824a('0x26')](_0x73d4dc);}return _0x30da1f['save']();};}function saveUpdates(_0x556771,_0xf8dec7){return function(_0x30d8cc){if(_0x30d8cc){return _0x30d8cc[_0x824a('0x27')](_0x556771)[_0x824a('0x28')](function(_0x508cf1){return _0x508cf1;});}return null;};}function removeEntity(_0xcfb23b,_0x4fc538){return function(_0x1b1d5d){if(_0x1b1d5d){return _0x1b1d5d[_0x824a('0x29')]()[_0x824a('0x28')](function(){_0xcfb23b[_0x824a('0x1d')](0xcc)[_0x824a('0x2a')]();});}};}function handleEntityNotFound(_0x459065,_0x579c7c){return function(_0x4a6649){if(!_0x4a6649){_0x459065[_0x824a('0x1c')](0x194);}return _0x4a6649;};}function handleError(_0xcf611e,_0x209611){_0x209611=_0x209611||0x1f4;return function(_0x900b4e){logger[_0x824a('0x2b')](_0x900b4e[_0x824a('0x2c')]);if(_0x900b4e['name']){delete _0x900b4e[_0x824a('0x2d')];}_0xcf611e[_0x824a('0x1d')](_0x209611)[_0x824a('0x2e')](_0x900b4e);};}exports[_0x824a('0x2f')]=function(_0x22bc0a,_0x2d54b5){var _0x34395d={},_0x5759ad={},_0x23ed8d={'count':0x0,'rows':[]};var _0x7104d5=_[_0x824a('0x30')](db[_0x824a('0x31')][_0x824a('0x32')],function(_0x2d82b6){return{'name':_0x2d82b6[_0x824a('0x33')],'type':_0x2d82b6[_0x824a('0x34')][_0x824a('0x35')]};});_0x5759ad[_0x824a('0x36')]=_[_0x824a('0x30')](_0x7104d5,_0x824a('0x2d'));_0x5759ad[_0x824a('0x37')]=_[_0x824a('0x38')](_0x22bc0a['query']);_0x5759ad[_0x824a('0x39')]=_[_0x824a('0x3a')](_0x5759ad[_0x824a('0x36')],_0x5759ad[_0x824a('0x37')]);_0x34395d[_0x824a('0x3b')]=_['intersection'](_0x5759ad[_0x824a('0x36')],qs[_0x824a('0x3c')](_0x22bc0a[_0x824a('0x37')][_0x824a('0x3c')]));_0x34395d[_0x824a('0x3b')]=_0x34395d[_0x824a('0x3b')][_0x824a('0x3d')]?_0x34395d[_0x824a('0x3b')]:_0x5759ad['model'];if(!_0x22bc0a[_0x824a('0x37')][_0x824a('0x3e')](_0x824a('0x3f'))){_0x34395d[_0x824a('0x21')]=qs[_0x824a('0x21')](_0x22bc0a[_0x824a('0x37')][_0x824a('0x21')]);_0x34395d[_0x824a('0x1f')]=qs['offset'](_0x22bc0a[_0x824a('0x37')][_0x824a('0x1f')]);}_0x34395d[_0x824a('0x40')]=qs[_0x824a('0x41')](_0x22bc0a[_0x824a('0x37')]['sort']);_0x34395d[_0x824a('0x42')]=qs[_0x824a('0x39')](_[_0x824a('0x43')](_0x22bc0a[_0x824a('0x37')],_0x5759ad[_0x824a('0x39')]),_0x7104d5);if(_0x22bc0a[_0x824a('0x37')][_0x824a('0x44')]){_0x34395d[_0x824a('0x42')]=_[_0x824a('0x45')](_0x34395d[_0x824a('0x42')],{'$or':_[_0x824a('0x30')](_0x7104d5,function(_0x17b711){if(_0x17b711['type']!==_0x824a('0x46')){var _0x18505e={};_0x18505e[_0x17b711[_0x824a('0x2d')]]={'$like':'%'+_0x22bc0a[_0x824a('0x37')][_0x824a('0x44')]+'%'};return _0x18505e;}})});}_0x34395d=_[_0x824a('0x45')]({},_0x34395d,_0x22bc0a[_0x824a('0x47')]);var _0x4829a7={'where':_0x34395d[_0x824a('0x42')]};return db[_0x824a('0x31')][_0x824a('0x22')](_0x4829a7)[_0x824a('0x28')](function(_0x1f9b2f){_0x23ed8d[_0x824a('0x22')]=_0x1f9b2f;if(_0x22bc0a[_0x824a('0x37')][_0x824a('0x48')]){_0x34395d[_0x824a('0x49')]=[{'all':!![]}];}return db[_0x824a('0x31')][_0x824a('0x4a')](_0x34395d);})[_0x824a('0x28')](function(_0x4920f4){_0x23ed8d[_0x824a('0x4b')]=_0x4920f4;return _0x23ed8d;})[_0x824a('0x28')](respondWithFilteredResult(_0x2d54b5,_0x34395d))[_0x824a('0x4c')](handleError(_0x2d54b5,null));};exports[_0x824a('0x4d')]=function(_0x447778,_0x21e54b){var _0x268c87={'raw':!![],'where':{'id':_0x447778[_0x824a('0x4e')]['id']}},_0x526fe2={};_0x526fe2['model']=_[_0x824a('0x38')](db['ChatGroup'][_0x824a('0x32')]);_0x526fe2[_0x824a('0x37')]=_[_0x824a('0x38')](_0x447778[_0x824a('0x37')]);_0x526fe2[_0x824a('0x39')]=_['intersection'](_0x526fe2[_0x824a('0x36')],_0x526fe2[_0x824a('0x37')]);_0x268c87['attributes']=_[_0x824a('0x3a')](_0x526fe2[_0x824a('0x36')],qs['fields'](_0x447778[_0x824a('0x37')][_0x824a('0x3c')]));_0x268c87[_0x824a('0x3b')]=_0x268c87['attributes'][_0x824a('0x3d')]?_0x268c87[_0x824a('0x3b')]:_0x526fe2['model'];if(_0x447778[_0x824a('0x37')][_0x824a('0x48')]){_0x268c87['include']=[{'all':!![]}];}_0x268c87=_[_0x824a('0x45')]({},_0x268c87,_0x447778[_0x824a('0x47')]);return db[_0x824a('0x31')][_0x824a('0x4f')](_0x268c87)[_0x824a('0x28')](handleEntityNotFound(_0x21e54b,null))[_0x824a('0x28')](respondWithResult(_0x21e54b,null))[_0x824a('0x4c')](handleError(_0x21e54b,null));};exports[_0x824a('0x50')]=function(_0x2d76ac,_0x378ed5){return db['ChatGroup'][_0x824a('0x50')](_0x2d76ac[_0x824a('0x51')],{})['then'](respondWithResult(_0x378ed5,0xc9))[_0x824a('0x4c')](handleError(_0x378ed5,null));};exports[_0x824a('0x27')]=function(_0x453b11,_0x6e833d){if(_0x453b11[_0x824a('0x51')]['id']){delete _0x453b11['body']['id'];}return db[_0x824a('0x31')][_0x824a('0x4f')]({'where':{'id':_0x453b11[_0x824a('0x4e')]['id']}})[_0x824a('0x28')](handleEntityNotFound(_0x6e833d,null))[_0x824a('0x28')](saveUpdates(_0x453b11['body'],null))[_0x824a('0x28')](respondWithResult(_0x6e833d,null))['catch'](handleError(_0x6e833d,null));};exports['destroy']=function(_0x320fc1,_0x3c14fc){return db['ChatGroup']['find']({'where':{'id':_0x320fc1[_0x824a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3c14fc,null))[_0x824a('0x28')](removeEntity(_0x3c14fc,null))[_0x824a('0x4c')](handleError(_0x3c14fc,null));};exports[_0x824a('0x52')]=function(_0x2118ee,_0x5b61e7){return db[_0x824a('0x31')][_0x824a('0x52')]()[_0x824a('0x28')](respondWithResult(_0x5b61e7,null))[_0x824a('0x4c')](handleError(_0x5b61e7,null));};exports[_0x824a('0x53')]=function(_0x3c39d5,_0x5f444c,_0x3de7c7){return db[_0x824a('0x54')]['count']({'where':{'ChatGroupId':_0x3c39d5[_0x824a('0x4e')]['id'],'ToId':_0x3c39d5[_0x824a('0x55')]['id'],'read':![]}})[_0x824a('0x28')](function(_0x19e61e){return{'id':_['toInteger'](_0x3c39d5['params']['id']),'count':_0x19e61e};})['then'](respondWithResult(_0x5f444c,null))['catch'](handleError(_0x5f444c,null));};exports[_0x824a('0x56')]=function(_0x57cc8c,_0x5dda0a,_0x1de2d8){return db['ChatGroup'][_0x824a('0x4f')]({'where':{'id':_0x57cc8c[_0x824a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5dda0a,null))[_0x824a('0x28')](function(_0x25b7a4){if(_0x25b7a4){return _0x25b7a4['addMembers'](_0x57cc8c[_0x824a('0x51')][_0x824a('0x57')],_[_0x824a('0x58')](_0x57cc8c[_0x824a('0x51')],[_0x824a('0x57'),'id'])||{});}})[_0x824a('0x28')](respondWithResult(_0x5dda0a,null))[_0x824a('0x4c')](handleError(_0x5dda0a,null));};exports[_0x824a('0x59')]=function(_0x533774,_0x18e738,_0x3e8a3b){var _0x2317df={};var _0x133cc7={};var _0xa671e0;var _0x311a64;return db['ChatGroup']['findOne']({'where':{'id':_0x533774['params']['id']}})[_0x824a('0x28')](handleEntityNotFound(_0x18e738,null))[_0x824a('0x28')](function(_0x5d579f){if(_0x5d579f){_0xa671e0=_0x5d579f;_0x133cc7[_0x824a('0x36')]=_[_0x824a('0x38')](db[_0x824a('0x5a')]['rawAttributes']);_0x133cc7[_0x824a('0x37')]=_[_0x824a('0x38')](_0x533774[_0x824a('0x37')]);_0x133cc7['filters']=_[_0x824a('0x3a')](_0x133cc7['model'],_0x133cc7['query']);_0x2317df[_0x824a('0x3b')]=_[_0x824a('0x3a')](_0x133cc7['model'],qs[_0x824a('0x3c')](_0x533774[_0x824a('0x37')][_0x824a('0x3c')]));_0x2317df[_0x824a('0x3b')]=_0x2317df['attributes'][_0x824a('0x3d')]?_0x2317df[_0x824a('0x3b')]:_0x133cc7[_0x824a('0x36')];_0x2317df[_0x824a('0x40')]=qs[_0x824a('0x41')](_0x533774[_0x824a('0x37')][_0x824a('0x41')]);_0x2317df[_0x824a('0x42')]=qs[_0x824a('0x39')](_[_0x824a('0x43')](_0x533774[_0x824a('0x37')],_0x133cc7['filters']));if(_0x533774[_0x824a('0x37')][_0x824a('0x44')]){_0x2317df[_0x824a('0x42')]=_[_0x824a('0x45')](_0x2317df['where'],{'$or':_[_0x824a('0x30')](_0x2317df[_0x824a('0x3b')],function(_0x497a3c){var _0x575c00={};_0x575c00[_0x497a3c]={'$like':'%'+_0x533774[_0x824a('0x37')]['filter']+'%'};return _0x575c00;})});}_0x2317df=_[_0x824a('0x45')]({},_0x2317df,_0x533774[_0x824a('0x47')]);return _0xa671e0[_0x824a('0x59')](_0x2317df);}})[_0x824a('0x28')](function(_0x25d672){if(_0x25d672){_0x311a64=_0x25d672['length'];if(!_0x533774[_0x824a('0x37')][_0x824a('0x3e')](_0x824a('0x3f'))){_0x2317df['limit']=qs[_0x824a('0x21')](_0x533774[_0x824a('0x37')][_0x824a('0x21')]);_0x2317df[_0x824a('0x1f')]=qs[_0x824a('0x1f')](_0x533774[_0x824a('0x37')]['offset']);}return _0xa671e0[_0x824a('0x59')](_0x2317df);}})[_0x824a('0x28')](function(_0x54b702){if(_0x54b702){return _0x54b702?{'count':_0x311a64,'rows':_0x54b702}:null;}})[_0x824a('0x28')](respondWithResult(_0x18e738,null))[_0x824a('0x4c')](handleError(_0x18e738,null));};exports[_0x824a('0x5b')]=function(_0x23708e,_0x5d0be7,_0x35c4e1){return db[_0x824a('0x31')][_0x824a('0x4f')]({'where':{'id':_0x23708e['params']['id']}})[_0x824a('0x28')](handleEntityNotFound(_0x5d0be7,null))[_0x824a('0x28')](function(_0x3e93f7){if(_0x3e93f7){return _0x3e93f7[_0x824a('0x5b')](_0x23708e[_0x824a('0x37')]['ids']);}})[_0x824a('0x28')](respondWithStatusCode(_0x5d0be7,null))[_0x824a('0x4c')](handleError(_0x5d0be7,null));};exports[_0x824a('0x5c')]=function(_0x1dd3a7,_0x54ba2b,_0x565358){if(_0x1dd3a7[_0x824a('0x51')]['id']){delete _0x1dd3a7[_0x824a('0x51')]['id'];}return db['ChatGroup'][_0x824a('0x4f')]({'where':{'id':_0x1dd3a7[_0x824a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x54ba2b,null))[_0x824a('0x28')](function(_0x91174c){if(_0x91174c){_0x1dd3a7[_0x824a('0x51')][_0x824a('0x5d')]=_0x91174c['id'];return db[_0x824a('0x54')][_0x824a('0x50')](_0x1dd3a7[_0x824a('0x51')]);}})[_0x824a('0x28')](respondWithResult(_0x54ba2b,null))[_0x824a('0x4c')](handleError(_0x54ba2b,null));};exports['getMessages']=function(_0x3aab78,_0x244621,_0x66f1fe){var _0x48bf23={};var _0x526a5b={};var _0x86cd81;var _0x57257b;return db[_0x824a('0x31')][_0x824a('0x5e')]({'where':{'id':_0x3aab78[_0x824a('0x4e')]['id']}})[_0x824a('0x28')](handleEntityNotFound(_0x244621,null))[_0x824a('0x28')](function(_0x450f5f){if(_0x450f5f){_0x86cd81=_0x450f5f;_0x526a5b[_0x824a('0x36')]=_[_0x824a('0x38')](db[_0x824a('0x54')][_0x824a('0x32')]);_0x526a5b[_0x824a('0x37')]=_[_0x824a('0x38')](_0x3aab78[_0x824a('0x37')]);_0x526a5b['filters']=_[_0x824a('0x3a')](_0x526a5b['model'],_0x526a5b[_0x824a('0x37')]);_0x48bf23[_0x824a('0x3b')]=_['intersection'](_0x526a5b[_0x824a('0x36')],qs[_0x824a('0x3c')](_0x3aab78['query'][_0x824a('0x3c')]));_0x48bf23['attributes']=_0x48bf23['attributes'][_0x824a('0x3d')]?_0x48bf23[_0x824a('0x3b')]:_0x526a5b[_0x824a('0x36')];_0x48bf23[_0x824a('0x40')]=qs[_0x824a('0x41')](_0x3aab78[_0x824a('0x37')][_0x824a('0x41')]);_0x48bf23[_0x824a('0x42')]=qs[_0x824a('0x39')](_[_0x824a('0x43')](_0x3aab78['query'],_0x526a5b[_0x824a('0x39')]));if(_0x3aab78['query'][_0x824a('0x44')]){_0x48bf23[_0x824a('0x42')]=_[_0x824a('0x45')](_0x48bf23['where'],{'$or':_[_0x824a('0x30')](_0x48bf23[_0x824a('0x3b')],function(_0x435b18){var _0x56fc3e={};_0x56fc3e[_0x435b18]={'$like':'%'+_0x3aab78[_0x824a('0x37')]['filter']+'%'};return _0x56fc3e;})});}if(_0x3aab78[_0x824a('0x37')]['$gte']){var _0x2fba7e=_0x3aab78[_0x824a('0x37')]['$gte'][_0x824a('0x5f')](',');var _0x39eea3={};_0x39eea3[_0x2fba7e[0x0]]={'$gte':moment(_0x2fba7e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x48bf23[_0x824a('0x42')]=_[_0x824a('0x45')](_0x48bf23[_0x824a('0x42')],_0x39eea3);}_0x48bf23=_[_0x824a('0x45')]({},_0x48bf23,_0x3aab78[_0x824a('0x47')]);return _0x86cd81['getMessages'](_0x48bf23);}})[_0x824a('0x28')](function(_0x3dfbd5){if(_0x3dfbd5){_0x57257b=_0x3dfbd5['length'];if(!_0x3aab78[_0x824a('0x37')]['hasOwnProperty']('nolimit')){_0x48bf23[_0x824a('0x21')]=qs[_0x824a('0x21')](_0x3aab78[_0x824a('0x37')][_0x824a('0x21')]);_0x48bf23[_0x824a('0x1f')]=qs[_0x824a('0x1f')](_0x3aab78[_0x824a('0x37')][_0x824a('0x1f')]);}return _0x86cd81[_0x824a('0x60')](_0x48bf23);}})[_0x824a('0x28')](function(_0x59ac12){if(_0x59ac12){return _0x59ac12?{'count':_0x57257b,'rows':_0x59ac12}:null;}})[_0x824a('0x28')](respondWithResult(_0x244621,null))[_0x824a('0x4c')](handleError(_0x244621,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 31ace2f..c1c140d 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 _0x62a7=['save','update','remove','emit','hook','exports','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x92fc4e,_0x3e6d2b){var _0x1476c6=function(_0x32c8d0){while(--_0x32c8d0){_0x92fc4e['push'](_0x92fc4e['shift']());}};_0x1476c6(++_0x3e6d2b);}(_0x62a7,0x84));var _0x762a=function(_0x1f0c9b,_0x234e61){_0x1f0c9b=_0x1f0c9b-0x0;var _0x1283e6=_0x62a7[_0x1f0c9b];return _0x1283e6;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x762a('0x0'))['db'][_0x762a('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x762a('0x2')](0x0);var events={'afterCreate':_0x762a('0x3'),'afterUpdate':_0x762a('0x4'),'afterDestroy':_0x762a('0x5')};function emitEvent(_0x804ab8){return function(_0x2a0808,_0x5c5006,_0x58690b){ChatGroupEvents[_0x762a('0x6')](_0x804ab8+':'+_0x2a0808['id'],_0x2a0808);ChatGroupEvents[_0x762a('0x6')](_0x804ab8,_0x2a0808);_0x58690b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x762a('0x7')](e,emitEvent(event));}}module[_0x762a('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0x5522=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x535517,_0x1095be){var _0xc1f779=function(_0x1049a5){while(--_0x1049a5){_0x535517['push'](_0x535517['shift']());}};_0xc1f779(++_0x1095be);}(_0x5522,0x1bd));var _0x2552=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5522[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require(_0x2552('0x0'));var ChatGroup=require(_0x2552('0x1'))['db'][_0x2552('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2552('0x3')](0x0);var events={'afterCreate':_0x2552('0x4'),'afterUpdate':'update','afterDestroy':_0x2552('0x5')};function emitEvent(_0x2fda3a){return function(_0x133ba6,_0x5f3396,_0x322713){ChatGroupEvents[_0x2552('0x6')](_0x2fda3a+':'+_0x133ba6['id'],_0x133ba6);ChatGroupEvents['emit'](_0x2fda3a,_0x133ba6);_0x322713(null);};}for(var e in events){if(events[_0x2552('0x7')](e)){var event=events[e];ChatGroup[_0x2552('0x8')](e,emitEvent(event));}}module[_0x2552('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 a32ca60..8984320 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 _0x7d93=['lodash','util','../../config/logger','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x3a498d,_0x43a314){var _0xe247b9=function(_0x543e7c){while(--_0x543e7c){_0x3a498d['push'](_0x3a498d['shift']());}};_0xe247b9(++_0x43a314);}(_0x7d93,0x1c2));var _0x37d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x37d9('0x0'));var util=require(_0x37d9('0x1'));var logger=require(_0x37d9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x37d9('0x3'));var rimraf=require(_0x37d9('0x4'));var config=require(_0x37d9('0x5'));var attributes=require(_0x37d9('0x6'));module[_0x37d9('0x7')]=function(_0x32bd21,_0x278fdd){return _0x32bd21[_0x37d9('0x8')](_0x37d9('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f13=['./chatGroup.attributes','exports','ChatGroup','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xb4a90c,_0x11adba){var _0x5ca900=function(_0x37ac22){while(--_0x37ac22){_0xb4a90c['push'](_0xb4a90c['shift']());}};_0x5ca900(++_0x11adba);}(_0x1f13,0xeb));var _0x31f1=function(_0x2c1ed5,_0x56a549){_0x2c1ed5=_0x2c1ed5-0x0;var _0x3606a1=_0x1f13[_0x2c1ed5];return _0x3606a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x31f1('0x0'));var BPromise=require(_0x31f1('0x1'));var rp=require(_0x31f1('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x31f1('0x3'));var config=require(_0x31f1('0x4'));var attributes=require(_0x31f1('0x5'));module[_0x31f1('0x6')]=function(_0x1d6bca,_0x59c81f){return _0x1d6bca['define'](_0x31f1('0x7'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 124a8bb..fbd2cd4 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 _0x919e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatGroup.socket','register','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','ChatGroup,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring'];(function(_0x1c33b5,_0x3445d8){var _0x5bf626=function(_0x449a63){while(--_0x449a63){_0x1c33b5['push'](_0x1c33b5['shift']());}};_0x5bf626(++_0x3445d8);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe919('0x0'));var util=require(_0xe919('0x1'));var moment=require(_0xe919('0x2'));var BPromise=require('bluebird');var rs=require(_0xe919('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe919('0x4'));var logger=require(_0xe919('0x5'))(_0xe919('0x6'));var config=require(_0xe919('0x7'));var jayson=require(_0xe919('0x8'));var client=jayson[_0xe919('0x9')][_0xe919('0xa')]({'port':0x232a});config['redis']=_[_0xe919('0xb')](config[_0xe919('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe919('0xd'))(new Redis(config['redis']));require(_0xe919('0xe'))[_0xe919('0xf')](socket);function respondWithRpcPromise(_0x814c47,_0x58a7a7,_0x83759d){return new BPromise(function(_0x34e59e,_0x1da9c9){return client['request'](_0x814c47,_0x83759d)[_0xe919('0x10')](function(_0x50c6ff){logger['info']('ChatGroup,\x20%s,\x20%s',_0x58a7a7,_0xe919('0x11'));logger[_0xe919('0x12')](_0xe919('0x13'),_0x58a7a7,'request\x20sent',JSON['stringify'](_0x50c6ff));if(_0x50c6ff[_0xe919('0x14')]){if(_0x50c6ff[_0xe919('0x14')]['code']===0x1f4){logger[_0xe919('0x14')](_0xe919('0x15'),_0x58a7a7,_0x50c6ff[_0xe919('0x14')][_0xe919('0x16')]);return _0x1da9c9(_0x50c6ff[_0xe919('0x14')][_0xe919('0x16')]);}logger[_0xe919('0x14')]('ChatGroup,\x20%s,\x20%s',_0x58a7a7,_0x50c6ff[_0xe919('0x14')]['message']);return _0x34e59e(_0x50c6ff['error'][_0xe919('0x16')]);}else{logger[_0xe919('0x17')]('ChatGroup,\x20%s,\x20%s',_0x58a7a7,'request\x20sent');_0x34e59e(_0x50c6ff['result'][_0xe919('0x16')]);}})[_0xe919('0x18')](function(_0x2e0988){logger[_0xe919('0x14')]('ChatGroup,\x20%s,\x20%s',_0x58a7a7,_0x2e0988);_0x1da9c9(_0x2e0988);});});}
\ No newline at end of file
+var _0xa5c0=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','info'];(function(_0x508cbc,_0x2a29c8){var _0x3b98ee=function(_0x5cc156){while(--_0x5cc156){_0x508cbc['push'](_0x508cbc['shift']());}};_0x3b98ee(++_0x2a29c8);}(_0xa5c0,0xbf));var _0x0a5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5c0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a5c('0x0'));var util=require(_0x0a5c('0x1'));var moment=require(_0x0a5c('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a5c('0x3'));var fs=require('fs');var Redis=require(_0x0a5c('0x4'));var db=require(_0x0a5c('0x5'))['db'];var utils=require(_0x0a5c('0x6'));var logger=require(_0x0a5c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0a5c('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0a5c('0x9')],{'host':_0x0a5c('0xa'),'port':0x18eb});var socket=require(_0x0a5c('0xb'))(new Redis(config[_0x0a5c('0x9')]));require(_0x0a5c('0xc'))[_0x0a5c('0xd')](socket);function respondWithRpcPromise(_0x161ce9,_0x4e4a0a,_0x23a933){return new BPromise(function(_0x2c8dac,_0x576070){return client[_0x0a5c('0xe')](_0x161ce9,_0x23a933)[_0x0a5c('0xf')](function(_0x35442d){logger['info']('ChatGroup,\x20%s,\x20%s',_0x4e4a0a,_0x0a5c('0x10'));logger[_0x0a5c('0x11')](_0x0a5c('0x12'),_0x4e4a0a,_0x0a5c('0x10'),JSON[_0x0a5c('0x13')](_0x35442d));if(_0x35442d[_0x0a5c('0x14')]){if(_0x35442d[_0x0a5c('0x14')][_0x0a5c('0x15')]===0x1f4){logger[_0x0a5c('0x14')](_0x0a5c('0x16'),_0x4e4a0a,_0x35442d[_0x0a5c('0x14')][_0x0a5c('0x17')]);return _0x576070(_0x35442d[_0x0a5c('0x14')]['message']);}logger['error'](_0x0a5c('0x16'),_0x4e4a0a,_0x35442d[_0x0a5c('0x14')]['message']);return _0x2c8dac(_0x35442d['error']['message']);}else{logger[_0x0a5c('0x18')](_0x0a5c('0x16'),_0x4e4a0a,_0x0a5c('0x10'));_0x2c8dac(_0x35442d[_0x0a5c('0x19')][_0x0a5c('0x17')]);}})[_0x0a5c('0x1a')](function(_0x1a29d9){logger[_0x0a5c('0x14')](_0x0a5c('0x16'),_0x4e4a0a,_0x1a29d9);_0x576070(_0x1a29d9);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 07a6f5d..40115c8 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 _0xee06=['removeListener','length','./chatGroup.events','save','remove','update','emit'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xee06,0x19f));var _0x6ee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee06[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x6ee0('0x0'));var events=[_0x6ee0('0x1'),_0x6ee0('0x2'),_0x6ee0('0x3')];function createListener(_0x56ed68,_0x284013){return function(_0x16e380){_0x284013[_0x6ee0('0x4')](_0x56ed68,_0x16e380);};}function removeListener(_0x3f660c,_0x36ed40){return function(){ChatGroupEvents[_0x6ee0('0x5')](_0x3f660c,_0x36ed40);};}exports['register']=function(_0x5ec9b9){for(var _0x5b9136=0x0,_0x584d20=events[_0x6ee0('0x6')];_0x5b9136<_0x584d20;_0x5b9136++){var _0x3b4f69=events[_0x5b9136];var _0x157fd0=createListener('chatGroup:'+_0x3b4f69,_0x5ec9b9);ChatGroupEvents['on'](_0x3b4f69,_0x157fd0);}};
\ No newline at end of file
+var _0x338e=['chatGroup:','save','update','emit','removeListener','length'];(function(_0xab6362,_0x5f53cf){var _0x1d2862=function(_0x3f95a5){while(--_0x3f95a5){_0xab6362['push'](_0xab6362['shift']());}};_0x1d2862(++_0x5f53cf);}(_0x338e,0x169));var _0xe338=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x338e[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xe338('0x0'),'remove',_0xe338('0x1')];function createListener(_0x45c675,_0x35e3ba){return function(_0x42ff34){_0x35e3ba[_0xe338('0x2')](_0x45c675,_0x42ff34);};}function removeListener(_0x540b5c,_0x45dfd4){return function(){ChatGroupEvents[_0xe338('0x3')](_0x540b5c,_0x45dfd4);};}exports['register']=function(_0x490d28){for(var _0x223d7e=0x0,_0x286f06=events[_0xe338('0x4')];_0x223d7e<_0x286f06;_0x223d7e++){var _0x232205=events[_0x223d7e];var _0x51bf10=createListener(_0xe338('0x5')+_0x232205,_0x490d28);ChatGroupEvents['on'](_0x232205,_0x51bf10);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 9ac41a1..a813de7 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 _0x3687=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','getMembers','getMessages','create','post','addMembers','addMessage','update','delete','destroy','exports','multer','util'];(function(_0x5c1f3b,_0xb93a7e){var _0x3496e0=function(_0xac66aa){while(--_0xac66aa){_0x5c1f3b['push'](_0x5c1f3b['shift']());}};_0x3496e0(++_0xb93a7e);}(_0x3687,0x1e4));var _0x7368=function(_0x475198,_0x30c1fa){_0x475198=_0x475198-0x0;var _0x5b6ee7=_0x3687[_0x475198];return _0x5b6ee7;};'use strict';var multer=require(_0x7368('0x0'));var util=require(_0x7368('0x1'));var path=require(_0x7368('0x2'));var timeout=require(_0x7368('0x3'));var express=require(_0x7368('0x4'));var router=express[_0x7368('0x5')]();var fs_extra=require(_0x7368('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7368('0x7'));var config=require(_0x7368('0x8'));var controller=require('./chatGroup.controller');router[_0x7368('0x9')]('/',auth[_0x7368('0xa')](),controller[_0x7368('0xb')]);router[_0x7368('0x9')](_0x7368('0xc'),auth[_0x7368('0xa')](),controller[_0x7368('0xd')]);router[_0x7368('0x9')](_0x7368('0xe'),auth[_0x7368('0xa')](),controller[_0x7368('0xf')]);router[_0x7368('0x9')]('/:id/unread',auth[_0x7368('0xa')](),controller[_0x7368('0x10')]);router[_0x7368('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0x7368('0x11')]);router[_0x7368('0x9')]('/:id/messages',auth[_0x7368('0xa')](),controller[_0x7368('0x12')]);router['post']('/',auth[_0x7368('0xa')](),controller[_0x7368('0x13')]);router[_0x7368('0x14')]('/:id/members',auth['isAuthenticated'](),controller[_0x7368('0x15')]);router[_0x7368('0x14')]('/:id/messages',auth[_0x7368('0xa')](),controller[_0x7368('0x16')]);router['put'](_0x7368('0xe'),auth[_0x7368('0xa')](),controller[_0x7368('0x17')]);router[_0x7368('0x18')](_0x7368('0xe'),auth[_0x7368('0xa')](),controller[_0x7368('0x19')]);router[_0x7368('0x18')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module[_0x7368('0x1a')]=router;
\ No newline at end of file
+var _0x126f=['/:id/messages','getMessages','post','addMembers','addMessage','put','update','delete','removeMembers','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getUnread','/:id/members','getMembers'];(function(_0x2842b4,_0x2b1b7b){var _0x2b9521=function(_0x3613b8){while(--_0x3613b8){_0x2842b4['push'](_0x2842b4['shift']());}};_0x2b9521(++_0x2b1b7b);}(_0x126f,0x192));var _0xf126=function(_0x1eec3a,_0x168828){_0x1eec3a=_0x1eec3a-0x0;var _0x133cf7=_0x126f[_0x1eec3a];return _0x133cf7;};'use strict';var multer=require(_0xf126('0x0'));var util=require('util');var path=require(_0xf126('0x1'));var timeout=require(_0xf126('0x2'));var express=require(_0xf126('0x3'));var router=express['Router']();var fs_extra=require(_0xf126('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf126('0x5'));var config=require(_0xf126('0x6'));var controller=require(_0xf126('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf126('0x8')]);router[_0xf126('0x9')](_0xf126('0xa'),auth[_0xf126('0xb')](),controller[_0xf126('0xc')]);router[_0xf126('0x9')](_0xf126('0xd'),auth[_0xf126('0xb')](),controller[_0xf126('0xe')]);router[_0xf126('0x9')]('/:id/unread',auth['isAuthenticated'](),controller[_0xf126('0xf')]);router[_0xf126('0x9')](_0xf126('0x10'),auth[_0xf126('0xb')](),controller[_0xf126('0x11')]);router[_0xf126('0x9')](_0xf126('0x12'),auth[_0xf126('0xb')](),controller[_0xf126('0x13')]);router[_0xf126('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf126('0x14')](_0xf126('0x10'),auth['isAuthenticated'](),controller[_0xf126('0x15')]);router['post'](_0xf126('0x12'),auth[_0xf126('0xb')](),controller[_0xf126('0x16')]);router[_0xf126('0x17')](_0xf126('0xd'),auth[_0xf126('0xb')](),controller[_0xf126('0x18')]);router[_0xf126('0x19')](_0xf126('0xd'),auth[_0xf126('0xb')](),controller['destroy']);router[_0xf126('0x19')](_0xf126('0x10'),auth[_0xf126('0xb')](),controller[_0xf126('0x1a')]);module[_0xf126('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index e66b440..8f0d6f5 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 _0x6324=['long','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','star','TEXT','DATE','STRING'];(function(_0x177fb5,_0x3962f9){var _0x1b8128=function(_0x5514ff){while(--_0x5514ff){_0x177fb5['push'](_0x177fb5['shift']());}};_0x1b8128(++_0x3962f9);}(_0x6324,0x142));var _0x4632=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x6324[_0x255c48];return _0xaebda3;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'closed':{'type':Sequelize[_0x4632('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4632('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x4632('0x4'),'thumb'),'defaultValue':_0x4632('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x4632('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4632('0x6')]},'disposition':{'type':Sequelize[_0x4632('0x7')]},'secondDisposition':{'type':Sequelize[_0x4632('0x7')]},'thirdDisposition':{'type':Sequelize[_0x4632('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x4632('0x7')]},'browserVersion':{'type':Sequelize[_0x4632('0x7')]},'osName':{'type':Sequelize[_0x4632('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x4632('0x7')]},'deviceVendor':{'type':Sequelize[_0x4632('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x4632('0x7')]},'formData':{'type':Sequelize[_0x4632('0x5')](_0x4632('0x8'))},'read1stAt':{'type':Sequelize[_0x4632('0x6')]},'lastMsgAt':{'type':Sequelize[_0x4632('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x4632('0x9')]('in',_0x4632('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4632('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x4632('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x7fce=['sequelize','exports','BOOLEAN','ENUM','thumb','TEXT','STRING','long','DATE','out'];(function(_0x1e5011,_0x45db5b){var _0x25f503=function(_0x1b42cf){while(--_0x1b42cf){_0x1e5011['push'](_0x1e5011['shift']());}};_0x25f503(++_0x45db5b);}(_0x7fce,0xdc));var _0xe7fc=function(_0x4fdb7a,_0x602dc6){_0x4fdb7a=_0x4fdb7a-0x0;var _0x4d49f8=_0x7fce[_0x4fdb7a];return _0x4d49f8;};'use strict';var Sequelize=require(_0xe7fc('0x0'));module[_0xe7fc('0x1')]={'closed':{'type':Sequelize[_0xe7fc('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xe7fc('0x3')]('star',_0xe7fc('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xe7fc('0x5')]},'pathTranscript':{'type':Sequelize[_0xe7fc('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xe7fc('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe7fc('0x6')]},'note':{'type':Sequelize[_0xe7fc('0x6')]},'browserName':{'type':Sequelize[_0xe7fc('0x6')]},'browserVersion':{'type':Sequelize[_0xe7fc('0x6')]},'osName':{'type':Sequelize[_0xe7fc('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xe7fc('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xe7fc('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xe7fc('0x6')]},'formData':{'type':Sequelize[_0xe7fc('0x5')](_0xe7fc('0x7'))},'read1stAt':{'type':Sequelize[_0xe7fc('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xe7fc('0x3')]('in',_0xe7fc('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xe7fc('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 0cad000..eed2bf7 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 _0xea28=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','sendStatus','stack','name','merge','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','index','ChatInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','u.id','ui.ChatInteractionId','from','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','Contact','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','all','params','includeAll','options','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','%s%d','agentAlias','System','customer','format','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','fullname','[%s]\x20%s:\x20%s\x0a','direction','appendFileSync','MailServerOut','Smtp','service','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','include','findAll','rows','getMyMessages','secret','includeAgent','addTags','setTags','spread','emit','removeTags','files','attachments','transcript-%d-%s.zip','firstName','lastName','Messages','read','Account','Chat','Owner','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','log','unlinkSync','eml-format','rimraf','zip-dir'];(function(_0x57192c,_0x15496a){var _0x3d9932=function(_0x101291){while(--_0x101291){_0x57192c['push'](_0x57192c['shift']());}};_0x3d9932(++_0x15496a);}(_0xea28,0x13a));var _0x8ea2=function(_0x152f32,_0x2243d8){_0x152f32=_0x152f32-0x0;var _0x45d400=_0xea28[_0x152f32];return _0x45d400;};'use strict';var emlformat=require(_0x8ea2('0x0'));var rimraf=require(_0x8ea2('0x1'));var zipdir=require(_0x8ea2('0x2'));var jsonpatch=require(_0x8ea2('0x3'));var rp=require(_0x8ea2('0x4'));var moment=require(_0x8ea2('0x5'));var BPromise=require(_0x8ea2('0x6'));var Mustache=require(_0x8ea2('0x7'));var util=require('util');var path=require(_0x8ea2('0x8'));var sox=require(_0x8ea2('0x9'));var csv=require(_0x8ea2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8ea2('0xb'));var _=require(_0x8ea2('0xc'));var squel=require(_0x8ea2('0xd'));var crypto=require(_0x8ea2('0xe'));var jsforce=require(_0x8ea2('0xf'));var deskjs=require(_0x8ea2('0x10'));var toCsv=require(_0x8ea2('0xa'));var querystring=require(_0x8ea2('0x11'));var Papa=require(_0x8ea2('0x12'));var Redis=require(_0x8ea2('0x13'));var authService=require(_0x8ea2('0x14'));var qs=require(_0x8ea2('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8ea2('0x16'));var logger=require(_0x8ea2('0x17'))(_0x8ea2('0x18'));var utils=require('../../config/utils');var config=require(_0x8ea2('0x19'));var licenseUtil=require(_0x8ea2('0x1a'));var db=require(_0x8ea2('0x1b'))['db'];config[_0x8ea2('0x1c')]=_[_0x8ea2('0x1d')](config['redis'],{'host':_0x8ea2('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8ea2('0x1f'))[_0x8ea2('0x20')](socket);var jayson=require(_0x8ea2('0x21'));var client=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232b});var client9004=jayson[_0x8ea2('0x22')][_0x8ea2('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x11f5e8,_0x474873,_0x396aab,_0x2dfa7c){return new BPromise(function(_0x1c1715,_0x3bc774){var _0xaa8abf=_0x2dfa7c||client;return _0xaa8abf[_0x8ea2('0x24')](_0x11f5e8,_0x396aab)[_0x8ea2('0x25')](function(_0x467045){logger[_0x8ea2('0x26')](_0x8ea2('0x27'),_0x474873,_0x8ea2('0x28'));logger[_0x8ea2('0x29')](_0x8ea2('0x2a'),_0x474873,'request\x20sent',JSON['stringify'](_0x467045));if(_0x467045[_0x8ea2('0x2b')]){if(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2c')]===0x1f4){logger['error'](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')]['message']);return _0x3bc774(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}logger[_0x8ea2('0x2b')](_0x8ea2('0x27'),_0x474873,_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);return _0x1c1715(_0x467045[_0x8ea2('0x2b')][_0x8ea2('0x2d')]);}else{logger[_0x8ea2('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x8ea2('0x28'));_0x1c1715(_0x467045['result'][_0x8ea2('0x2d')]);}})[_0x8ea2('0x2e')](function(_0x29b38f){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x474873,_0x29b38f);_0x3bc774(_0x29b38f);});});}function respondWithStatusCode(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0xcc;return function(_0x200a49){if(_0x200a49){return _0x2e4da3['sendStatus'](_0x4dc7bf);}return _0x2e4da3[_0x8ea2('0x2f')](_0x4dc7bf)[_0x8ea2('0x30')]();};}function respondWithResult(_0x21c526,_0x266db8){_0x266db8=_0x266db8||0xc8;return function(_0x4e1b90){if(_0x4e1b90){return _0x21c526['status'](_0x266db8)[_0x8ea2('0x31')](_0x4e1b90);}};}function respondWithFilteredResult(_0x4da5b3,_0x4a9875){return function(_0x287078){if(_0x287078){var _0x24f187=typeof _0x4a9875[_0x8ea2('0x32')]===_0x8ea2('0x33')&&typeof _0x4a9875[_0x8ea2('0x34')]===_0x8ea2('0x33');var _0x316707=_0x287078[_0x8ea2('0x35')];var _0x9c5fac=_0x24f187?0x0:_0x4a9875['offset'];var _0x5b7ff9=_0x24f187?_0x287078[_0x8ea2('0x35')]:_0x4a9875[_0x8ea2('0x32')]+_0x4a9875['limit'];var _0x4a110f;if(_0x5b7ff9>=_0x316707){_0x5b7ff9=_0x316707;_0x4a110f=0xc8;}else{_0x4a110f=0xce;}_0x4da5b3[_0x8ea2('0x2f')](_0x4a110f);return _0x4da5b3['set'](_0x8ea2('0x36'),_0x9c5fac+'-'+_0x5b7ff9+'/'+_0x316707)[_0x8ea2('0x31')](_0x287078);}return null;};}function patchUpdates(_0x53fd06){return function(_0x17b21c){try{jsonpatch[_0x8ea2('0x37')](_0x17b21c,_0x53fd06,!![]);}catch(_0x33abc8){return BPromise['reject'](_0x33abc8);}return _0x17b21c['save']();};}function saveUpdates(_0x49a252,_0x3880c3){return function(_0x233e12){if(_0x233e12){return _0x233e12[_0x8ea2('0x38')](_0x49a252)['then'](function(_0x456487){return _0x456487;});}return null;};}function removeEntity(_0x391b08,_0x3d5bf0){return function(_0x278e5d){if(_0x278e5d){return _0x278e5d[_0x8ea2('0x39')]()[_0x8ea2('0x25')](function(){_0x391b08[_0x8ea2('0x2f')](0xcc)[_0x8ea2('0x30')]();});}};}function handleEntityNotFound(_0x5e9b1f,_0x955ef3){return function(_0x29e3f5){if(!_0x29e3f5){_0x5e9b1f[_0x8ea2('0x3a')](0x194);}return _0x29e3f5;};}function handleError(_0x467d97,_0x4eebc1){_0x4eebc1=_0x4eebc1||0x1f4;return function(_0x2a1f14){logger['error'](_0x2a1f14[_0x8ea2('0x3b')]);if(_0x2a1f14[_0x8ea2('0x3c')]){delete _0x2a1f14[_0x8ea2('0x3c')];}_0x467d97[_0x8ea2('0x2f')](_0x4eebc1)['send'](_0x2a1f14);};}function getMustacheRender(_0x2bed24,_0x531979){return Mustache['render'](_0x2bed24,_[_0x8ea2('0x3d')](_0x531979['body'],{'contact':_0x531979[_0x8ea2('0x3e')],'message':_0x531979[_0x8ea2('0x2d')],'agent':_0x531979[_0x8ea2('0x3f')],'interaction':_0x531979[_0x8ea2('0x40')],'account':_0x531979[_0x8ea2('0x41')]}))||'';}function getInteractionUsers(_0x4ae536,_0x84685d){return new BPromise(function(_0x5c5d2d,_0x12a6c2){try{if(_0x84685d[_0x4ae536['id']]){_0x4ae536[_0x8ea2('0x42')]=_[_0x8ea2('0x43')](_0x84685d[_0x4ae536['id']],function(_0x3995ff){return{'id':_0x3995ff['id'],'fullname':_0x3995ff['fullname']};});}}catch(_0x44e8bc){_0x12a6c2(_0x44e8bc);}_0x5c5d2d(_0x4ae536);});}function getInteractionTags(_0x57a6b8,_0x3f0c78){return new BPromise(function(_0x5ba351,_0x2ee78b){try{if(_0x57a6b8[_0x8ea2('0x44')]){_0x57a6b8[_0x8ea2('0x45')]=[];_0x57a6b8[_0x8ea2('0x44')][_0x8ea2('0x46')](',')[_0x8ea2('0x47')](function(_0x2f4fa8){_0x57a6b8['Tags']['push'](_0x3f0c78[_0x2f4fa8]);});}delete _0x57a6b8[_0x8ea2('0x44')];}catch(_0x53455a){_0x2ee78b(_0x53455a);}_0x5ba351(_0x57a6b8);});}function updateChatInteraction(_0x4b03fa,_0x59e2fa,_0x3cbc09){return new BPromise(function(_0x5d9ba0,_0x40a532){return getInteractionUsers(_0x4b03fa,_0x3cbc09)[_0x8ea2('0x25')](function(_0x39c944){return getInteractionTags(_0x39c944,_0x59e2fa);})[_0x8ea2('0x25')](function(_0x989d9b){_0x5d9ba0(_0x989d9b);})[_0x8ea2('0x2e')](function(_0x3b2219){_0x40a532(_0x3b2219);});});}exports[_0x8ea2('0x48')]=function(_0x5352b9,_0x3afb80){var _0x1ef615={},_0x1db25c={},_0x5cb6ad={'count':0x0,'rows':[]};var _0x2d6bbb=_[_0x8ea2('0x43')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')],function(_0x20992d){return{'name':_0x20992d['fieldName'],'type':_0x20992d[_0x8ea2('0x4b')][_0x8ea2('0x4c')]};});_0x1db25c[_0x8ea2('0x4d')]=_['map'](_0x2d6bbb,_0x8ea2('0x3c'));_0x1db25c[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x5352b9[_0x8ea2('0x4e')]);_0x1db25c[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],_0x1db25c[_0x8ea2('0x4e')]);_0x1ef615[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x1db25c[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x1ef615['attributes']=_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x1ef615[_0x8ea2('0x52')]:_0x1db25c[_0x8ea2('0x4d')];if(!_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x55')](_0x8ea2('0x56'))){_0x1ef615[_0x8ea2('0x34')]=qs['limit'](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x34')]);_0x1ef615[_0x8ea2('0x32')]=qs['offset'](_0x5352b9['query'][_0x8ea2('0x32')]);}_0x1ef615[_0x8ea2('0x57')]=qs[_0x8ea2('0x58')](_0x5352b9['query'][_0x8ea2('0x58')]);_0x1ef615[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x5352b9[_0x8ea2('0x4e')],_0x1db25c['filters']),_0x2d6bbb);var _0x4afd85=[];var _0x24a22a=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x5c')]('id')['field'](_0x8ea2('0x3c'))[_0x8ea2('0x5c')](_0x8ea2('0x5d'))['from']('tools_tags');var _0x48aebf=squel['select']()['field'](_0x8ea2('0x5e'))[_0x8ea2('0x5c')]('u.fullname')['field'](_0x8ea2('0x5f'))[_0x8ea2('0x60')](_0x8ea2('0x61'),'ui')['left_join'](_0x8ea2('0x62'),'u',_0x8ea2('0x63'));var _0x59e3df=squel[_0x8ea2('0x5b')]()[_0x8ea2('0x60')](_0x8ea2('0x64'),'i')[_0x8ea2('0x65')](_0x8ea2('0x66'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x8ea2('0x67'))[_0x8ea2('0x65')](_0x8ea2('0x68'),'a',_0x8ea2('0x69'))[_0x8ea2('0x65')](_0x8ea2('0x6a'),'me',_0x8ea2('0x6b'))['left_join']('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0x8ea2('0x65')](_0x8ea2('0x6c'),'t',_0x8ea2('0x6d'));var _0x2bbec0=squel['expr']();var _0x11824e=[];var _0x2b8662=squel['expr']();var _0x21485a;if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x6e')]){_0x21485a=as[_0x8ea2('0x6f')](_0x5352b9[_0x8ea2('0x4e')]['search']);var _0x479c05=_0x21485a['sqlOperator'];for(var _0x53a62c=0x0;_0x53a62c<_0x21485a[_0x8ea2('0x70')][_0x8ea2('0x54')];_0x53a62c++){var _0x2d8221=_0x21485a[_0x8ea2('0x70')][_0x53a62c];var _0x491d3d='i';var _0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x2d8221[_0x8ea2('0x5c')]]);if(!_0x461d32){switch(_0x2d8221['field']){case _0x8ea2('0x72'):if(_0x2d8221['value']==0x1){_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+_0x8ea2('0x74'));}else{_0x59e3df[_0x8ea2('0x73')]('`'+_0x2d8221['field']+'`\x20>\x200');}break;case _0x8ea2('0x75'):if(_0x2d8221['operator']===_0x8ea2('0x76')){if(_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')]('\x20')[_0x8ea2('0x54')]>0x1){_0x2bbec0[_0x479c05]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8ea2('0x78')](_0x2d8221[_0x8ea2('0x77')]),null);}else{var _0x39776d='%'+_0x2d8221[_0x8ea2('0x77')]+'%';_0x2bbec0[_0x479c05](_0x8ea2('0x79'),_0x39776d,_0x39776d,_0x39776d);}}else{_0x461d32=_[_0x8ea2('0x71')](_0x2d6bbb,[_0x8ea2('0x3c'),_0x8ea2('0x7a')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x7a');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db['text'],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);}break;case _0x8ea2('0x7d'):var _0x219f78=_0x2d8221[_0x8ea2('0x77')][_0x8ea2('0x46')](',')[_0x8ea2('0x43')](function(_0xefb7b){return Number(_0xefb7b);});_0x219f78[_0x8ea2('0x47')](function(_0x35cfc5){_0x2b8662['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35cfc5+',%');});_0x11824e=_[_0x8ea2('0x7e')](_0x11824e,_0x219f78);break;case _0x8ea2('0x7f'):if(_0x2d8221[_0x8ea2('0x80')]===_0x8ea2('0x76')){_0x2bbec0[_0x479c05](_0x8ea2('0x81'),'%'+_0x2d8221['value']+'%',null);}else{_0x461d32=_['find'](_0x2d6bbb,['name',_0x8ea2('0x82')]);_0x2d8221[_0x8ea2('0x5c')]=_0x8ea2('0x82');_0x3d55db=as[_0x8ea2('0x7b')](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db['value'][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')]['end']);}break;case'body':_0x3d55db=as[_0x8ea2('0x7b')]('me',null,_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x30')]);break;}}else{var _0x3d55db=as['buildExpression'](_0x491d3d,_0x461d32[_0x8ea2('0x4b')],_0x2d8221);_0x2bbec0[_0x479c05](_0x3d55db[_0x8ea2('0x83')],_0x3d55db[_0x8ea2('0x77')][_0x8ea2('0x7c')],_0x3d55db['value'][_0x8ea2('0x30')]);}}}else{var _0x356099=_(_0x5352b9[_0x8ea2('0x4e')])['keys']()[_0x8ea2('0x43')](function(_0x5c2d05){return _['some'](_0x2d6bbb,[_0x8ea2('0x3c'),_0x5c2d05])?_0x5c2d05:undefined;})[_0x8ea2('0x84')]()['value']();if(!_['isEmpty'](_0x356099)){_0x356099['forEach'](function(_0x167f15){if(_0x167f15==='ChatWebsiteId'){_0x59e3df['where'](_0x8ea2('0x85'),[][_0x8ea2('0x86')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15]));}else if(_0x167f15===_0x8ea2('0x87')){var _0x1681d8=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x89')];var _0x14a5de=JSON[_0x8ea2('0x88')](_0x5352b9[_0x8ea2('0x4e')][_0x167f15])[_0x8ea2('0x8a')];_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0x8b'),_0x1681d8,_0x14a5de);}else{if(_0x5352b9['query'][_0x167f15]===_0x8ea2('0x8c')){_0x59e3df[_0x8ea2('0x59')]('i.'+_0x167f15+_0x8ea2('0x8d'));}else{_0x59e3df['where']('i.'+_0x167f15+_0x8ea2('0x8e'),_0x5352b9['query'][_0x167f15]);}}});}if(_0x5352b9[_0x8ea2('0x4e')]['read']){if(_0x5352b9[_0x8ea2('0x4e')]['read']==0x1){_0x59e3df[_0x8ea2('0x73')](_0x8ea2('0x8f'));}else{_0x59e3df['having'](_0x8ea2('0x90'));}}if(_0x5352b9['query'][_0x8ea2('0x91')]){_0x11824e=_[_0x8ea2('0x92')](_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x91')])?_0x5352b9[_0x8ea2('0x4e')]['tag']:new Array(_0x5352b9['query'][_0x8ea2('0x91')]);_0x11824e['forEach'](function(_0x410f78){_0x2b8662['or'](_0x8ea2('0x93'),'%,'+_0x410f78+',%');});}if(_0x5352b9[_0x8ea2('0x4e')][_0x8ea2('0x94')]){var _0x262cef=_0x5352b9[_0x8ea2('0x4e')]['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x8ea2('0x95')](_0x262cef)){_0x2bbec0['or']('i.id\x20LIKE\x20?',_0x262cef+'%');}else{_0x2bbec0['or'](_0x8ea2('0x96'),qs[_0x8ea2('0x78')](_0x262cef))['or'](_0x8ea2('0x97'),_0x262cef+'%');}}}_0x59e3df[_0x8ea2('0x59')](_0x2bbec0);_0x59e3df[_0x8ea2('0x98')](_0x8ea2('0x99'));var _0x4b4d64={'type':db[_0x8ea2('0x9a')][_0x8ea2('0x9b')][_0x8ea2('0x9c')],'raw':!![]};var _0x335a96=_0x59e3df[_0x8ea2('0x9d')]();_0x335a96['field']('i.id');_0x335a96[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));if(_0x1ef615[_0x8ea2('0x57')]){_0x1ef615[_0x8ea2('0x57')][_0x8ea2('0x47')](function(_0x2e0bbe){var _0x9c4960=_0x2e0bbe[0x0]===_0x8ea2('0x9f')?_0x2e0bbe[0x0]:'i.'+_0x2e0bbe[0x0];_0x59e3df[_0x8ea2('0x57')](_0x9c4960,_0x2e0bbe[0x1]===_0x8ea2('0xa0')?![]:!![]);});}if(!_[_0x8ea2('0xa1')](_0x11824e)){_0x59e3df[_0x8ea2('0x73')](_0x2b8662);_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa2'),_0x11824e);}BPromise[_0x8ea2('0xa3')]()[_0x8ea2('0x25')](function(){if(!_0x21485a){if(_0x5352b9['query']['ChatWebsiteId'])return;_0x335a96[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa4'));return;}if(_0x5352b9['user'][_0x8ea2('0xa5')]!=='agent')return;return _0x5352b9[_0x8ea2('0xa6')][_0x8ea2('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x17dee8){if(_[_0x8ea2('0xa1')](_0x17dee8)){_0x335a96[_0x8ea2('0x59')](_0x8ea2('0xa8'));_0x59e3df[_0x8ea2('0x59')](_0x8ea2('0xa8'));}else{_0x335a96[_0x8ea2('0x59')](_0x8ea2('0x85'),_[_0x8ea2('0x43')](_0x17dee8,'id'));_0x59e3df[_0x8ea2('0x59')]('i.ChatWebsiteId\x20IN\x20?',_[_0x8ea2('0x43')](_0x17dee8,'id'));}});})[_0x8ea2('0x25')](function(){if(_0x5352b9['user'][_0x8ea2('0xa5')]==='agent'&&!_0x21485a&&!_0x5352b9['query']['ChatWebsiteId'])return[];return db[_0x8ea2('0xa9')]['query'](_0x335a96[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x12ed20){_0x5cb6ad[_0x8ea2('0x35')]=_0x12ed20[_0x8ea2('0x54')];if(_0x5cb6ad[_0x8ea2('0x35')]===0x0)return[];return db['sequelize'][_0x8ea2('0x4e')](_0x24a22a['toString'](),_0x4b4d64)[_0x8ea2('0x25')](function(_0x18aa81){_0x4afd85=_[_0x8ea2('0xab')](_0x18aa81,'id');_0x4b4d64=_[_0x8ea2('0x3d')](_0x4b4d64,{'model':db[_0x8ea2('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5352b9['query'][_0x8ea2('0x53')]){_0x1ef615[_0x8ea2('0x52')][_0x8ea2('0x47')](function(_0x2a82b2){_0x59e3df[_0x8ea2('0x5c')]('i.'+_0x2a82b2);});}else{_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0x9e'),_0x8ea2('0x72'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xac'),_0x8ea2('0xad'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xae'),_0x8ea2('0xaf'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb0'),_0x8ea2('0x9f'));_0x59e3df['field'](_0x8ea2('0xb1'));_0x59e3df['field']('c.firstName',_0x8ea2('0xb2'));_0x59e3df[_0x8ea2('0x5c')]('c.lastName',_0x8ea2('0xb3'));_0x59e3df[_0x8ea2('0x5c')]('c.email',_0x8ea2('0xb4'));_0x59e3df[_0x8ea2('0x5c')]('c.phone',_0x8ea2('0xb5'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb6'),_0x8ea2('0xb7'));_0x59e3df[_0x8ea2('0x5c')]('c.fax',_0x8ea2('0xb8'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xb9'),_0x8ea2('0xba'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbb'),_0x8ea2('0xbc'));_0x59e3df[_0x8ea2('0x5c')](_0x8ea2('0xbd'),'TagIds');}if(_0x1ef615[_0x8ea2('0x34')])_0x59e3df['limit'](_0x1ef615[_0x8ea2('0x34')]);if(_0x1ef615[_0x8ea2('0x32')])_0x59e3df[_0x8ea2('0x32')](_0x1ef615[_0x8ea2('0x32')]);return db[_0x8ea2('0xa9')]['query'](_0x59e3df[_0x8ea2('0xaa')](),_0x4b4d64);})[_0x8ea2('0x25')](function(_0x4fdd16){if(_0x4fdd16['length']>0x0)_0x48aebf[_0x8ea2('0x59')](_0x8ea2('0xbe'),_['map'](_0x4fdd16,'id'));return db['sequelize'][_0x8ea2('0x4e')](_0x48aebf[_0x8ea2('0xaa')](),_0x4b4d64)['then'](function(_0x2b7e80){var _0x2f6673=_[_0x8ea2('0xbf')](_0x2b7e80,_0x8ea2('0xc0'));var _0xdf4de9=[];_0x4fdd16['forEach'](function(_0x2e3a5d){_0xdf4de9[_0x8ea2('0xc1')](updateChatInteraction(_0x2e3a5d,_0x4afd85,_0x2f6673));});return BPromise[_0x8ea2('0xc2')](_0xdf4de9);});});})[_0x8ea2('0x25')](function(_0x412af1){_0x5cb6ad['rows']=_0x412af1;return _0x5cb6ad;})[_0x8ea2('0x25')](respondWithFilteredResult(_0x3afb80,_0x1ef615))['catch'](handleError(_0x3afb80,null));};exports['show']=function(_0x9468be,_0x17e9fc){var _0x5c95ec={'raw':![],'where':{'id':_0x9468be[_0x8ea2('0xc3')]['id']}},_0x239516={};_0x239516[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db[_0x8ea2('0x49')][_0x8ea2('0x4a')]);_0x239516['query']=_[_0x8ea2('0x4f')](_0x9468be[_0x8ea2('0x4e')]);_0x239516[_0x8ea2('0x50')]=_['intersection'](_0x239516[_0x8ea2('0x4d')],_0x239516[_0x8ea2('0x4e')]);_0x5c95ec[_0x8ea2('0x52')]=_[_0x8ea2('0x51')](_0x239516[_0x8ea2('0x4d')],qs['fields'](_0x9468be[_0x8ea2('0x4e')][_0x8ea2('0x53')]));_0x5c95ec[_0x8ea2('0x52')]=_0x5c95ec[_0x8ea2('0x52')]['length']?_0x5c95ec['attributes']:_0x239516[_0x8ea2('0x4d')];if(_0x9468be['query'][_0x8ea2('0xc4')]){_0x5c95ec['include']=[{'all':!![]}];}_0x5c95ec=_[_0x8ea2('0x3d')]({},_0x5c95ec,_0x9468be[_0x8ea2('0xc5')]);return db[_0x8ea2('0x49')][_0x8ea2('0x71')](_0x5c95ec)[_0x8ea2('0x25')](handleEntityNotFound(_0x17e9fc,null))[_0x8ea2('0x25')](respondWithResult(_0x17e9fc,null))[_0x8ea2('0x2e')](handleError(_0x17e9fc,null));};exports['create']=function(_0x2c5677,_0x224fca){return db[_0x8ea2('0x49')][_0x8ea2('0xc6')](_0x2c5677[_0x8ea2('0xc7')],{})[_0x8ea2('0x25')](respondWithResult(_0x224fca,0xc9))['catch'](handleError(_0x224fca,null));};exports[_0x8ea2('0x38')]=function(_0x463372,_0x76085){if(_0x463372[_0x8ea2('0xc7')]['id']){delete _0x463372['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x463372[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x76085,null))[_0x8ea2('0x25')](saveUpdates(_0x463372['body'],null))[_0x8ea2('0x25')](respondWithResult(_0x76085,null))[_0x8ea2('0x2e')](handleError(_0x76085,null));};exports[_0x8ea2('0x39')]=function(_0x500b47,_0x331019){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x500b47[_0x8ea2('0xc3')]['id']}})['then'](handleEntityNotFound(_0x331019,null))['then'](removeEntity(_0x331019,null))[_0x8ea2('0x2e')](handleError(_0x331019,null));};exports[_0x8ea2('0xc8')]=function(_0x405020,_0x5c9359){return db[_0x8ea2('0x49')][_0x8ea2('0xc8')]()[_0x8ea2('0x25')](respondWithResult(_0x5c9359,null))[_0x8ea2('0x2e')](handleError(_0x5c9359,null));};exports[_0x8ea2('0xc9')]=function(_0x11c59e,_0x11b02a){var _0x5ab2c4=_0x11c59e[_0x8ea2('0xc3')]['id'];var _0x111f97;var _0xf76d70;var _0x384500;return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x5ab2c4}})[_0x8ea2('0x25')](function(_0x568581){_0x111f97=_0x568581;return db[_0x8ea2('0xcb')][_0x8ea2('0xca')]({'where':{'id':_0x568581[_0x8ea2('0xcc')]},'attributes':['id',_0x8ea2('0xcd'),_0x8ea2('0xce'),'vidaooTopic',_0x8ea2('0xcf'),_0x8ea2('0xd0')],'raw':!![]});})[_0x8ea2('0x25')](function(_0x1c336e){if(_0x1c336e&&_0x1c336e[_0x8ea2('0xcd')]&&_0x1c336e[_0x8ea2('0xce')]){_0xf76d70=_0x1c336e;var _0x473ae2={'interaction':{'id':_0x5ab2c4},'agent':{'id':_0x11c59e[_0x8ea2('0xa6')]['id'],'name':_0x11c59e[_0x8ea2('0xa6')]['name'],'fullname':_0x11c59e['user']['fullname'],'email':_0x11c59e[_0x8ea2('0xa6')]['email']},'contact':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x3e')],'account':_0x11c59e[_0x8ea2('0xc7')][_0x8ea2('0x41')]};var _0x6c0ccc={'rejectUnauthorized':![],'method':_0x8ea2('0xd1'),'url':_0x8ea2('0xd2'),'headers':{'X-APIKEY':_0x1c336e[_0x8ea2('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x11c59e[_0x8ea2('0xa6')][_0x8ea2('0xd3')]],'buttons':null,'topic':_0xf76d70['vidaooTopic'],'note':_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xcf')])?null:getMustacheRender(_0xf76d70[_0x8ea2('0xcf')],_0x473ae2),'metadata':null},'redirect':_0x8ea2('0xd5'),'json':!![]};try{if(!_[_0x8ea2('0xd4')](_0xf76d70[_0x8ea2('0xd0')])){var _0xc6888c=getMustacheRender(_0xf76d70[_0x8ea2('0xd0')],_0x473ae2);var _0x152d46=JSON[_0x8ea2('0x88')](_0xc6888c);_0x6c0ccc[_0x8ea2('0xc7')][_0x8ea2('0xd6')]=_0x152d46;}}catch(_0x465e7f){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xd8'));}return rp(_0x6c0ccc);}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x4b2c0f){_0x384500=_0x4b2c0f;if(_0x384500['id']){var _0x2fcddc={'body':_0x384500[_0x8ea2('0xd9')],'ChatWebsiteId':_0xf76d70['id'],'ChatInteractionId':_0x111f97['id'],'direction':'out','UserId':_0x11c59e[_0x8ea2('0xa6')]['id']};return db[_0x8ea2('0xda')][_0x8ea2('0xc6')](_0x2fcddc,{});}else{throw new db[(_0x8ea2('0x9a'))]['ValidationError'](_0x8ea2('0xdb'));}})['then'](function(){return _0x111f97[_0x8ea2('0xdc')]({'vidaooSessionId':_0x384500['id']});})[_0x8ea2('0x25')](respondWithResult(_0x11b02a,null))[_0x8ea2('0x2e')](handleError(_0x11b02a,null));};exports[_0x8ea2('0xdd')]=function(_0x3b6b03,_0x3292bc){if(_0x3b6b03['body']['id']){delete _0x3b6b03['body']['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x3b6b03['params']['id']},'include':[{'model':db[_0x8ea2('0xde')],'as':'Contact'}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x3292bc,null))[_0x8ea2('0x25')](saveUpdates(_0x3b6b03[_0x8ea2('0xc7')],null))[_0x8ea2('0x25')](respondWithResult(_0x3292bc,null))[_0x8ea2('0x2e')](handleError(_0x3292bc,null));};exports[_0x8ea2('0xdf')]=function(_0x1383b4,_0x4c1b9d,_0x3f3822){if(_0x1383b4[_0x8ea2('0xc7')]['id']){delete _0x1383b4[_0x8ea2('0xc7')]['id'];}return db[_0x8ea2('0x49')][_0x8ea2('0x71')]({'where':{'id':_0x1383b4[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](function(_0x1c974d){if(!_0x1c974d){logger[_0x8ea2('0x2b')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x8ea2('0xdf'),0x194,_0x8ea2('0xe0'));_0x4c1b9d[_0x8ea2('0x3a')](0x194);}else{if(_0x1c974d['UserId']){throw new db[(_0x8ea2('0x9a'))][(_0x8ea2('0xd7'))](_0x8ea2('0xe1'));}}return _0x1c974d;})[_0x8ea2('0x25')](function(_0xe18090){if(_0xe18090){return _0xe18090[_0x8ea2('0x38')]({'closed':_0x1383b4['body']['closed'],'disposition':_0x1383b4[_0x8ea2('0xc7')][_0x8ea2('0xe2')]})[_0x8ea2('0x25')](function(_0x695f4a){return _0x695f4a;});}})[_0x8ea2('0x25')](function(_0x57ff72){return respondWithRpcPromise(_0x8ea2('0xe3'),'abandon',_0x1383b4[_0x8ea2('0xc7')],client9004);})[_0x8ea2('0x25')](respondWithResult(_0x4c1b9d,null))['catch'](handleError(_0x4c1b9d,null));};exports[_0x8ea2('0xe4')]=function(_0x254b51,_0x2c11d2,_0x2aaa88){_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x3c')]=_0x254b51[_0x8ea2('0xe5')][_0x8ea2('0xe6')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0xe7')]=_0x254b51['file'][_0x8ea2('0xe8')];_0x254b51[_0x8ea2('0xc7')][_0x8ea2('0x4b')]=_0x254b51['file'][_0x8ea2('0xe9')];return db['Attachment'][_0x8ea2('0xc6')](_0x254b51[_0x8ea2('0xc7')])[_0x8ea2('0x25')](respondWithResult(_0x2c11d2,0xc9))[_0x8ea2('0x2e')](handleError(_0x2c11d2,null));};exports[_0x8ea2('0xea')]=function(_0x1786ac,_0x7a45a8,_0x3a68e2){return db[_0x8ea2('0x49')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0xc3')]['id']},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null))[_0x8ea2('0x25')](function(_0x8d4abd){if(_0x8d4abd){if(_0x8d4abd[_0x8ea2('0xeb')]){return _0x7a45a8[_0x8ea2('0x2f')](0x193)[_0x8ea2('0x31')]({'status':0x193,'message':_0x8ea2('0xec')});}return db[_0x8ea2('0xed')]['findOne']({'where':{'id':_0x1786ac[_0x8ea2('0x4e')][_0x8ea2('0xee')]},'raw':!![]})[_0x8ea2('0x25')](handleEntityNotFound(_0x7a45a8,null));}})[_0x8ea2('0x25')](function(_0xcbb6b3){if(_0xcbb6b3){var _0x4bdbe0=_0xcbb6b3[_0x8ea2('0xef')]!==null;var _0x44791f=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf2'));if(_0x4bdbe0){_0x44791f=path['join'](_0x44791f,_0x8ea2('0xf3'));}var _0x4e7aff=path[_0x8ea2('0xf0')](_0x44791f,_0xcbb6b3[_0x8ea2('0xe7')]);return _0x7a45a8[_0x8ea2('0xf4')](_0x4e7aff);}})['catch'](handleError(_0x7a45a8,null));};exports[_0x8ea2('0xf5')]=function(_0x48a2e2,_0x4e804c){var _0x487bab=null;var _0x1a0966=null;var _0x50087b=null;var _0x196b89=null;if(_0x48a2e2[_0x8ea2('0xc7')]['id']){delete _0x48a2e2[_0x8ea2('0xc7')]['id'];}if(_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')]){_0x196b89=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],_0x8ea2('0xf7'),util['format']('transcript-%s.txt',Date[_0x8ea2('0xf8')]()));_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf9')]=_0x196b89;}return db['ChatInteraction']['find']({'where':{'id':_0x48a2e2['params']['id']},'include':[{'model':db[_0x8ea2('0xda')],'as':'Messages','include':[{'model':db['User'],'as':_0x8ea2('0x7f')}]}]})[_0x8ea2('0x25')](handleEntityNotFound(_0x4e804c,null))['then'](saveUpdates(_0x48a2e2['body'],null))[_0x8ea2('0x25')](function(_0x48eac8){if(_0x48eac8){_0x487bab=_0x48eac8;return db['ChatWebsite'][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0xcc')]}});}})[_0x8ea2('0x25')](function(_0x54da21){if(_0x54da21){_0x50087b=_0x54da21;return db[_0x8ea2('0xde')][_0x8ea2('0x71')]({'where':{'id':_0x487bab[_0x8ea2('0x7a')]}});}})[_0x8ea2('0x25')](function(_0x3a43d5){if(_0x3a43d5){_0x1a0966=_0x3a43d5;if(_0x196b89){var _0x535b01=null;for(var _0x22e4cd=0x1;_0x22e4cd<_0x487bab['Messages'][_0x8ea2('0x54')];++_0x22e4cd){_0x535b01=_0x487bab['Messages'][_0x22e4cd];var _0x230a70=_0x535b01['UserId']?util['format'](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');var _0x332670=_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xfd')]||util[_0x8ea2('0xfe')]('%s%d',_0x8ea2('0xff'),_0x535b01[_0x8ea2('0x7a')]);switch(_0x50087b[_0x8ea2('0x100')]){case _0x8ea2('0x101'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?util['format'](_0x8ea2('0xfa'),_0x50087b['agentAlias'],_0x535b01[_0x8ea2('0x82')]):'System';break;case _0x8ea2('0x102'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01[_0x8ea2('0x7f')][_0x8ea2('0x103')]||_0x535b01['User']['fullname']:'System';break;case _0x8ea2('0x104'):_0x230a70=_0x535b01[_0x8ea2('0x82')]?_0x535b01['User'][_0x8ea2('0x105')]:_0x8ea2('0xfc');break;default:_0x230a70=_0x535b01[_0x8ea2('0x82')]?util[_0x8ea2('0xfe')](_0x8ea2('0xfa'),_0x50087b[_0x8ea2('0xfb')],_0x535b01[_0x8ea2('0x82')]):_0x8ea2('0xfc');}var _0x422280=util[_0x8ea2('0xfe')](_0x8ea2('0x106'),moment(_0x535b01[_0x8ea2('0x87')])[_0x8ea2('0xfe')]('MM/DD/YYYY\x20HH:mm:ss'),_0x535b01[_0x8ea2('0x107')]==='in'?_0x332670:_0x230a70,_0x535b01['body']);if(!_0x535b01['secret']){fs[_0x8ea2('0x108')](_0x196b89,_0x422280);}}return db['MailAccount'][_0x8ea2('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0x8ea2('0x109')],'as':_0x8ea2('0x10a'),'raw':!![]}]});}}})[_0x8ea2('0x25')](function(_0xff0fae){if(_0xff0fae&&_0xff0fae['Smtp']&&_0x48a2e2[_0x8ea2('0xc7')]){var _0x3f5688={'tls':{'rejectUnauthorized':![]}};if(_0xff0fae[_0x8ea2('0x10a')]['service']){_0x3f5688['service']=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10b')];}else{_0x3f5688['host']=_0xff0fae[_0x8ea2('0x10a')]['host'];_0x3f5688[_0x8ea2('0x10c')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10c')];_0x3f5688[_0x8ea2('0x10d')]=_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10d')];}if(_0xff0fae[_0x8ea2('0x10a')][_0x8ea2('0x10e')]){_0x3f5688[_0x8ea2('0x10f')]={'user':_0xff0fae['Smtp']['user'],'pass':_0xff0fae[_0x8ea2('0x10a')]['pass']};}return respondWithRpcPromise(_0x8ea2('0x110'),_0x8ea2('0x111'),{'account':_0x3f5688,'message':{'from':util[_0x8ea2('0xfe')](_0x8ea2('0x112'),_0xff0fae['name'],_0xff0fae[_0x8ea2('0xd3')]||_0xff0fae[_0x8ea2('0x10a')]['user']),'to':_0x48a2e2[_0x8ea2('0xc7')][_0x8ea2('0xf6')],'subject':_0x8ea2('0x113'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x48a2e2['body'][_0x8ea2('0xf6')]),'attachments':[{'path':_0x196b89}]}})['then'](function(){return _0x487bab;})[_0x8ea2('0x2e')](function(_0x488acb){console[_0x8ea2('0x2b')](_0x488acb);});}else{return _0x487bab;}})[_0x8ea2('0x25')](respondWithStatusCode(_0x4e804c,0xc8))[_0x8ea2('0x2e')](handleError(_0x4e804c,null));};exports[_0x8ea2('0x114')]=function(_0x54925a,_0x295339,_0x55c23c){return db['ChatMessage']['find']({'where':{'id':_0x54925a[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x295339,null))[_0x8ea2('0x25')](function(_0x48b51d){if(_0x48b51d){return _0x48b51d[_0x8ea2('0x114')](_0x54925a[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x54925a[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{});}})[_0x8ea2('0x25')](respondWithResult(_0x295339,null))[_0x8ea2('0x2e')](handleError(_0x295339,null));};exports[_0x8ea2('0x117')]=function(_0x102d70,_0x2b014d,_0xc35654){var _0x355b91={'raw':![],'where':{}};var _0x1cf414={};var _0x48e543={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x8ea2('0xca')]({'where':{'id':_0x102d70['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x2b014d,null))[_0x8ea2('0x25')](function(_0x3ebbc8){if(_0x3ebbc8){_0x1cf414['model']=_[_0x8ea2('0x4f')](db['ChatMessage']['rawAttributes']);_0x1cf414[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x102d70[_0x8ea2('0x4e')]);_0x1cf414[_0x8ea2('0x50')]=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],_0x1cf414[_0x8ea2('0x4e')]);_0x355b91['attributes']=_[_0x8ea2('0x51')](_0x1cf414[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x102d70['query'][_0x8ea2('0x53')]));_0x355b91[_0x8ea2('0x52')]=_0x355b91[_0x8ea2('0x52')]['length']?_0x355b91[_0x8ea2('0x52')]:_0x1cf414[_0x8ea2('0x4d')];if(!_0x102d70[_0x8ea2('0x4e')]['hasOwnProperty']('nolimit')){_0x355b91[_0x8ea2('0x34')]=qs['limit'](_0x102d70[_0x8ea2('0x4e')]['limit']);_0x355b91[_0x8ea2('0x32')]=qs[_0x8ea2('0x32')](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x32')]);}_0x355b91[_0x8ea2('0x57')]=qs['sort'](_0x102d70[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x355b91[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_[_0x8ea2('0x5a')](_0x102d70[_0x8ea2('0x4e')],_0x1cf414['filters']));_0x355b91['where'][_0x8ea2('0xc0')]=_0x3ebbc8['id'];if(_0x102d70[_0x8ea2('0x4e')]['filter']){_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],{'$or':_[_0x8ea2('0x43')](_0x355b91['attributes'],function(_0x19ea2b){var _0x4450e8={};_0x4450e8[_0x19ea2b]={'$like':'%'+_0x102d70['query'][_0x8ea2('0x94')]+'%'};return _0x4450e8;})});}if(_0x102d70['query'][_0x8ea2('0x89')]){var _0x479b40=_0x102d70['query'][_0x8ea2('0x89')][_0x8ea2('0x46')](',');var _0xbb5964={};_0xbb5964[_0x479b40[0x0]]={'$gte':moment(_0x479b40[0x1])[_0x8ea2('0xfe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x355b91[_0x8ea2('0x59')]=_[_0x8ea2('0x3d')](_0x355b91[_0x8ea2('0x59')],_0xbb5964);}_0x355b91=_['merge']({},_0x355b91,_0x102d70[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x355b91[_0x8ea2('0x59')]})[_0x8ea2('0x25')](function(_0x46d38e){_0x48e543[_0x8ea2('0x35')]=_0x46d38e;if(_0x102d70['query'][_0x8ea2('0xc4')]){_0x355b91[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x355b91);})[_0x8ea2('0x25')](function(_0x23f247){_0x48e543[_0x8ea2('0x11a')]=_0x23f247;return _0x48e543;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x2b014d,_0x355b91))[_0x8ea2('0x2e')](handleError(_0x2b014d,null));};exports[_0x8ea2('0x11b')]=function(_0x3a37fb,_0x455009,_0x556919){var _0x58a0e5={'where':{}},_0x3be2ce={},_0x56a973={'count':0x0,'rows':[]};return db[_0x8ea2('0x49')][_0x8ea2('0xca')]({'where':{'id':_0x3a37fb[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x455009,null))[_0x8ea2('0x25')](function(_0x515381){if(_0x515381){_0x3be2ce[_0x8ea2('0x4d')]=_[_0x8ea2('0x4f')](db['ChatMessage'][_0x8ea2('0x4a')]);_0x3be2ce[_0x8ea2('0x4e')]=_[_0x8ea2('0x4f')](_0x3a37fb[_0x8ea2('0x4e')]);_0x3be2ce['filters']=_[_0x8ea2('0x51')](_0x3be2ce[_0x8ea2('0x4d')],_0x3be2ce[_0x8ea2('0x4e')]);_0x58a0e5[_0x8ea2('0x52')]=_['intersection'](_0x3be2ce[_0x8ea2('0x4d')],qs[_0x8ea2('0x53')](_0x3a37fb[_0x8ea2('0x4e')]['fields']));_0x58a0e5[_0x8ea2('0x52')]=_0x58a0e5[_0x8ea2('0x52')][_0x8ea2('0x54')]?_0x58a0e5['attributes']:_0x3be2ce['model'];if(!_0x3a37fb[_0x8ea2('0x4e')]['hasOwnProperty'](_0x8ea2('0x56'))){_0x58a0e5[_0x8ea2('0x34')]=qs[_0x8ea2('0x34')](_0x3a37fb[_0x8ea2('0x4e')]['limit']);_0x58a0e5[_0x8ea2('0x32')]=qs['offset'](_0x3a37fb['query']['offset']);}_0x58a0e5['order']=qs[_0x8ea2('0x58')](_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x58')]);_0x58a0e5[_0x8ea2('0x59')]=qs[_0x8ea2('0x50')](_['pick'](_0x3a37fb['query'],_0x3be2ce[_0x8ea2('0x50')]));_0x58a0e5['where']['ChatInteractionId']=_0x515381['id'];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]){_0x58a0e5[_0x8ea2('0x59')]=_['merge'](_0x58a0e5[_0x8ea2('0x59')],{'$or':_['map'](_0x58a0e5[_0x8ea2('0x52')],function(_0x4041ec){var _0x56178b={};_0x56178b[_0x4041ec]={'$like':'%'+_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x94')]+'%'};return _0x56178b;})});}_0x58a0e5['where'][_0x8ea2('0x11c')]=![];if(_0x3a37fb[_0x8ea2('0x4e')]['id']){_0x58a0e5[_0x8ea2('0x59')]['id']={'$gt':_0x3a37fb[_0x8ea2('0x4e')]['id']};}_0x58a0e5=_[_0x8ea2('0x3d')]({},_0x58a0e5,_0x3a37fb[_0x8ea2('0xc5')]);return db[_0x8ea2('0xda')][_0x8ea2('0x35')]({'where':_0x58a0e5[_0x8ea2('0x59')]})['then'](function(_0xcedece){_0x56a973['count']=_0xcedece;_0x58a0e5[_0x8ea2('0x118')]=[];if(_0x3a37fb[_0x8ea2('0x4e')][_0x8ea2('0x11d')]){_0x58a0e5[_0x8ea2('0x118')][_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':_0x8ea2('0x7f'),'attributes':['id',_0x8ea2('0x105'),'alias']});}if(_0x3a37fb['query'][_0x8ea2('0xc4')]){_0x58a0e5[_0x8ea2('0x118')]=[{'all':!![]}];}return db[_0x8ea2('0xda')][_0x8ea2('0x119')](_0x58a0e5);})[_0x8ea2('0x25')](function(_0x52bf7c){_0x56a973[_0x8ea2('0x11a')]=_0x52bf7c;return _0x56a973;});}})[_0x8ea2('0x25')](respondWithFilteredResult(_0x455009,_0x58a0e5))['catch'](handleError(_0x455009,null));};exports[_0x8ea2('0x11e')]=function(_0x3be5d0,_0x3ac848,_0x52ce76){return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x3be5d0['params']['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x3ac848,null))[_0x8ea2('0x25')](function(_0x1030c9){if(_0x1030c9){return _0x1030c9[_0x8ea2('0x11f')](_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')],_[_0x8ea2('0x116')](_0x3be5d0[_0x8ea2('0xc7')],[_0x8ea2('0x115'),'id'])||{})[_0x8ea2('0x120')](function(){return db[_0x8ea2('0x7d')][_0x8ea2('0x119')]({'attributes':['id',_0x8ea2('0x3c'),_0x8ea2('0x5d')],'where':{'id':_0x3be5d0[_0x8ea2('0xc7')][_0x8ea2('0x115')]}});})[_0x8ea2('0x25')](function(_0x452b94){socket[_0x8ea2('0x121')]('chatInteractionTags:save',{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]});return{'id':Number(_0x3be5d0['params']['id']),'tags':_0x452b94||[]};});}})[_0x8ea2('0x25')](respondWithResult(_0x3ac848,null))[_0x8ea2('0x2e')](handleError(_0x3ac848,null));};exports[_0x8ea2('0x122')]=function(_0x9410dd,_0x497671,_0x5e3e8d){return db[_0x8ea2('0x49')]['find']({'where':{'id':_0x9410dd[_0x8ea2('0xc3')]['id']}})[_0x8ea2('0x25')](handleEntityNotFound(_0x497671,null))[_0x8ea2('0x25')](function(_0x19b042){if(_0x19b042){return _0x19b042[_0x8ea2('0x122')](_0x9410dd[_0x8ea2('0x4e')][_0x8ea2('0x115')]);}})['then'](respondWithStatusCode(_0x497671,null))[_0x8ea2('0x2e')](handleError(_0x497671,null));};exports[_0x8ea2('0xf4')]=function(_0x2dc450,_0x34e1c5){var _0x5b929c=moment()['unix']()[_0x8ea2('0xaa')]();var _0x263123=path[_0x8ea2('0xf0')](config['root'],'server',_0x8ea2('0x123'),'tmp');var _0x40e8e6=path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x123'),_0x8ea2('0x124'));var _0x2dfabc=path[_0x8ea2('0xf0')](_0x263123,_0x5b929c);var _0x515049=util['format'](_0x8ea2('0x125'),_0x2dc450[_0x8ea2('0xc3')]['id'],_0x5b929c);var _0x39000d=path['join'](_0x263123,_0x515049);var _0x3a1752=[];_0x3a1752['push']({'model':db[_0x8ea2('0x7f')],'as':'User','attributes':['id',_0x8ea2('0x105')],'raw':!![]});_0x3a1752['push']({'model':db[_0x8ea2('0xde')],'as':_0x8ea2('0x75'),'attributes':['id',_0x8ea2('0x126'),_0x8ea2('0x127')],'raw':!![]});if(_0x2dc450['query'][_0x8ea2('0x124')]){_0x3a1752[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xed')],'as':_0x8ea2('0xed'),'raw':!![]});}var _0x5ba508=[{'model':db[_0x8ea2('0xda')],'as':_0x8ea2('0x128'),'attributes':['id',_0x8ea2('0xc7'),_0x8ea2('0x87'),_0x8ea2('0x107'),'secret',_0x8ea2('0x129')],'include':_0x3a1752}];_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0xcb')],'as':_0x8ea2('0x12a'),'attributes':['id','name']});_0x5ba508[_0x8ea2('0xc1')]({'model':db[_0x8ea2('0x7f')],'as':'Owner','attributes':['id','fullname']});return db['ChatInteraction'][_0x8ea2('0x71')]({'where':{'id':_0x2dc450[_0x8ea2('0xc3')]['id']},'include':_0x5ba508})[_0x8ea2('0x25')](handleEntityNotFound(_0x34e1c5,null))[_0x8ea2('0x25')](function(_0x3c9013){if(_0x3c9013){var _0x103c43=_0x3c9013['get']({'plain':!![]});fs['mkdirSync'](_0x2dfabc);var _0xc099b6={'channel':_0x8ea2('0x12b'),'account':_0x103c43[_0x8ea2('0x12a')]['name'],'agent':_0x103c43['Owner']?_0x103c43[_0x8ea2('0x12c')][_0x8ea2('0x105')]:'N.A.','createdAt':moment(_0x103c43[_0x8ea2('0x87')])['format'](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'closedAt':_0x103c43[_0x8ea2('0xeb')]?moment(_0x103c43['closedAt'])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))['toString']():'','disposition':_0x103c43[_0x8ea2('0xe2')],'chatInfo':{'browser':_0x103c43[_0x8ea2('0x12e')],'os':_0x103c43['osName'],'referer':_0x103c43['referer'],'customerIp':_0x103c43[_0x8ea2('0x12f')],'customerPort':_0x103c43[_0x8ea2('0x130')]?_0x103c43[_0x8ea2('0x130')]:'N.A.'},'messages':_(_0x103c43[_0x8ea2('0x128')])[_0x8ea2('0x131')]()[_0x8ea2('0x94')]({'secret':![]})[_0x8ea2('0x43')](function(_0x36799a){if(_0x36799a['Attachment']){var _0x1cc1d9=path['join'](_0x40e8e6,_0x36799a[_0x8ea2('0xed')]['basename']);if(fs[_0x8ea2('0x132')](_0x1cc1d9)){fs[_0x8ea2('0x133')](_0x1cc1d9)[_0x8ea2('0x134')](fs[_0x8ea2('0x135')](path['join'](_0x2dfabc,_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')])));}}return{'date':moment(_0x36799a[_0x8ea2('0x87')])[_0x8ea2('0xfe')](_0x8ea2('0x12d'))[_0x8ea2('0xaa')](),'sender':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?_0x36799a[_0x8ea2('0x7f')]?_0x36799a[_0x8ea2('0x7f')][_0x8ea2('0x105')]:'System':_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x126')]+(_0x36799a[_0x8ea2('0x75')]['lastName']?'\x20'+_0x36799a[_0x8ea2('0x75')][_0x8ea2('0x127')]:''),'body':_0x36799a[_0x8ea2('0xed')]?_0x36799a[_0x8ea2('0xed')][_0x8ea2('0xe7')]:_0x36799a[_0x8ea2('0xc7')],'direction':_0x36799a[_0x8ea2('0x107')]===_0x8ea2('0x136')?'A':'C','secret':_0x36799a[_0x8ea2('0x11c')],'read':_0x36799a[_0x8ea2('0x129')],'attachment':_0x36799a['Attachment']};})[_0x8ea2('0x77')]()};return ejs[_0x8ea2('0x137')](path[_0x8ea2('0xf0')](config[_0x8ea2('0xf1')],'server',_0x8ea2('0x138'),_0x8ea2('0x139')),{'interaction':_0xc099b6})[_0x8ea2('0x25')](function(_0x10d2b3){var _0x12a217=path[_0x8ea2('0xf0')](_0x2dfabc,_0x8ea2('0x13a')+_0x103c43['id']+'-'+_0x5b929c+'.pdf');var _0x44b0dc={'path':_0x12a217,'channel':_0x8ea2('0x12b'),'interactionId':_0x103c43['id']};return pdf['createPdfFromHTML'](_0x10d2b3,_0x44b0dc);})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x27f5e9,_0x19b678){zipdir(_0x2dfabc,{'saveTo':_0x39000d},function(_0x50ebcd,_0x5d6c63){if(_0x50ebcd)return _0x19b678(_0x50ebcd);return _0x27f5e9(_0x5d6c63);});})[_0x8ea2('0x25')](function(){return new BPromise(function(_0x55b3a1,_0x57e228){rimraf(_0x2dfabc,function(_0x3c669b){if(_0x3c669b)_0x57e228(_0x3c669b);return _0x55b3a1();});});})[_0x8ea2('0x25')](function(){return _0x34e1c5['download'](_0x39000d,_0x515049,function(_0x688d21){if(_0x688d21){console[_0x8ea2('0x13b')]('err',_0x688d21);}else{fs[_0x8ea2('0x13c')](_0x39000d);}});});});}else{return _0x34e1c5['sendStatus'](0xc8);}})[_0x8ea2('0x2e')](handleError(_0x34e1c5,null));};
\ No newline at end of file
+var _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5db9fd,_0x222244){var _0x1595c8=function(_0x54594f){while(--_0x54594f){_0x5db9fd['push'](_0x5db9fd['shift']());}};_0x1595c8(++_0x222244);}(_0x66fa,0x117));var _0xa66f=function(_0x3036e5,_0x485e29){_0x3036e5=_0x3036e5-0x0;var _0x349ff7=_0x66fa[_0x3036e5];return _0x349ff7;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 051b8cb..9798f2c 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 _0x3a90=['Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','setDataValue'];(function(_0x544a7b,_0x388672){var _0x1c8701=function(_0x448d61){while(--_0x448d61){_0x544a7b['push'](_0x544a7b['shift']());}};_0x1c8701(++_0x388672);}(_0x3a90,0x1ad));var _0x03a9=function(_0x5236e2,_0x18e12){_0x5236e2=_0x5236e2-0x0;var _0x22f044=_0x3a90[_0x5236e2];return _0x22f044;};'use strict';var EventEmitter=require(_0x03a9('0x0'));var ChatInteraction=require(_0x03a9('0x1'))['db'][_0x03a9('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x03a9('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x03a9('0x4'),'afterUpdate':_0x03a9('0x5'),'afterDestroy':'remove'};function emitEvent(_0x9646ca){return function(_0x31629f,_0xc70f63,_0x1837bc){_0x31629f[_0x03a9('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x12dfb0){_0x31629f[_0x03a9('0x7')](_0x03a9('0x8'),_0x12dfb0[_0x03a9('0x9')](function(_0x40994b){return{'id':_0x40994b['id']};}));return ChatMessage[_0x03a9('0xa')]({'where':{'ChatInteractionId':_0x31629f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x03a9('0xb')](function(_0x830798){_0x31629f[_0x03a9('0x7')](_0x03a9('0xc'),_0x830798[_0x03a9('0xd')]);ChatInteractionEvents[_0x03a9('0xe')](_0x9646ca+':'+_0x31629f['id'],_0x31629f);ChatInteractionEvents['emit'](_0x9646ca,_0x31629f);_0x1837bc(null);})[_0x03a9('0xf')](_0x1837bc(null));};}for(var e in events){if(events[_0x03a9('0x10')](e)){var event=events[e];ChatInteraction[_0x03a9('0x11')](e,emitEvent(event));}}module[_0x03a9('0x12')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x0041=['remove','getUsers','map','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','ChatInteraction','save','update'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x0041,0x1be));var _0x1004=function(_0x14b78b,_0x540ed0){_0x14b78b=_0x14b78b-0x0;var _0x590e43=_0x0041[_0x14b78b];return _0x590e43;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x1004('0x0'))['db'][_0x1004('0x1')];var ChatMessage=require(_0x1004('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1004('0x2'),'afterUpdate':_0x1004('0x3'),'afterDestroy':_0x1004('0x4')};function emitEvent(_0x3b70ab){return function(_0x82255,_0x8932bd,_0x1fde22){_0x82255[_0x1004('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3027f9){_0x82255['setDataValue']('Users',_0x3027f9[_0x1004('0x6')](function(_0x7b0229){return{'id':_0x7b0229['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x82255['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1004('0x7')](function(_0x2ca931){_0x82255[_0x1004('0x8')](_0x1004('0x9'),_0x2ca931[_0x1004('0xa')]);ChatInteractionEvents[_0x1004('0xb')](_0x3b70ab+':'+_0x82255['id'],_0x82255);ChatInteractionEvents['emit'](_0x3b70ab,_0x82255);_0x1fde22(null);})[_0x1004('0xc')](_0x1fde22(null));};}for(var e in events){if(events[_0x1004('0xd')](e)){var event=events[e];ChatInteraction[_0x1004('0xe')](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 18f3767..fb07e4e 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 _0x8313=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','../../config/logger','moment','path'];(function(_0x1d8ef2,_0x1b22f7){var _0x4a1c25=function(_0x49405f){while(--_0x49405f){_0x1d8ef2['push'](_0x1d8ef2['shift']());}};_0x4a1c25(++_0x1b22f7);}(_0x8313,0x14d));var _0x3831=function(_0x357a74,_0xe8550f){_0x357a74=_0x357a74-0x0;var _0x17dfe5=_0x8313[_0x357a74];return _0x17dfe5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3831('0x0'))('api');var moment=require(_0x3831('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3831('0x2'));var rimraf=require(_0x3831('0x3'));var config=require(_0x3831('0x4'));var attributes=require(_0x3831('0x5'));module[_0x3831('0x6')]=function(_0x57e186,_0x4d26cf){return _0x57e186[_0x3831('0x7')](_0x3831('0x8'),attributes,{'tableName':_0x3831('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x60479e,_0x1b12ae,_0x160376){if(_0x60479e[_0x3831('0xa')](_0x3831('0xb'))){_0x60479e[_0x3831('0xc')]=moment()[_0x3831('0xd')](_0x3831('0xe'));}_0x160376(null,_0x60479e);}},'charset':_0x3831('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc2ee=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util'];(function(_0x95419c,_0x2dc306){var _0x3cb730=function(_0x7cdced){while(--_0x7cdced){_0x95419c['push'](_0x95419c['shift']());}};_0x3cb730(++_0x2dc306);}(_0xc2ee,0x10e));var _0xec2e=function(_0x3f27e7,_0x3b85ba){_0x3f27e7=_0x3f27e7-0x0;var _0x5f1a51=_0xc2ee[_0x3f27e7];return _0x5f1a51;};'use strict';var _=require(_0xec2e('0x0'));var util=require(_0xec2e('0x1'));var logger=require(_0xec2e('0x2'))(_0xec2e('0x3'));var moment=require(_0xec2e('0x4'));var BPromise=require(_0xec2e('0x5'));var rp=require(_0xec2e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xec2e('0x7'));var attributes=require(_0xec2e('0x8'));module[_0xec2e('0x9')]=function(_0x5584a3,_0x27f7fc){return _0x5584a3[_0xec2e('0xa')]('ChatInteraction',attributes,{'tableName':_0xec2e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x427d63,_0x2038f7,_0x43b5f3){if(_0x427d63['changed'](_0xec2e('0xc'))){_0x427d63[_0xec2e('0xd')]=moment()[_0xec2e('0xe')](_0xec2e('0xf'));}_0x43b5f3(null,_0x427d63);}},'charset':'utf8mb4','collate':_0xec2e('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 60e7e65..1b9cf3e 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 _0x6026=['rpc','jayson/promise','client','redis','defaults','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','limit','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2958bf,_0x1d242c){var _0x454512=function(_0x4be22a){while(--_0x4be22a){_0x2958bf['push'](_0x2958bf['shift']());}};_0x454512(++_0x1d242c);}(_0x6026,0x76));var _0x6602=function(_0x2f2f8c,_0x12e3a5){_0x2f2f8c=_0x2f2f8c-0x0;var _0x26da09=_0x6026[_0x2f2f8c];return _0x26da09;};'use strict';var _=require(_0x6602('0x0'));var util=require(_0x6602('0x1'));var moment=require(_0x6602('0x2'));var BPromise=require(_0x6602('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6602('0x4'));var db=require(_0x6602('0x5'))['db'];var utils=require(_0x6602('0x6'));var logger=require(_0x6602('0x7'))(_0x6602('0x8'));var config=require('../../config/environment');var jayson=require(_0x6602('0x9'));var client=jayson[_0x6602('0xa')]['http']({'port':0x232a});config[_0x6602('0xb')]=_[_0x6602('0xc')](config['redis'],{'host':_0x6602('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6602('0xe'))[_0x6602('0xf')](socket);function respondWithRpcPromise(_0x5d3d6b,_0x4c6b42,_0x4d9b20){return new BPromise(function(_0x82c1fa,_0x563149){return client[_0x6602('0x10')](_0x5d3d6b,_0x4d9b20)[_0x6602('0x11')](function(_0x280316){logger[_0x6602('0x12')](_0x6602('0x13'),_0x4c6b42,'request\x20sent');logger[_0x6602('0x14')](_0x6602('0x15'),_0x4c6b42,'request\x20sent',JSON[_0x6602('0x16')](_0x280316));if(_0x280316[_0x6602('0x17')]){if(_0x280316[_0x6602('0x17')]['code']===0x1f4){logger[_0x6602('0x17')](_0x6602('0x13'),_0x4c6b42,_0x280316[_0x6602('0x17')][_0x6602('0x18')]);return _0x563149(_0x280316[_0x6602('0x17')][_0x6602('0x18')]);}logger[_0x6602('0x17')](_0x6602('0x13'),_0x4c6b42,_0x280316[_0x6602('0x17')][_0x6602('0x18')]);return _0x82c1fa(_0x280316['error']['message']);}else{logger[_0x6602('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x4c6b42,_0x6602('0x19'));_0x82c1fa(_0x280316[_0x6602('0x1a')][_0x6602('0x18')]);}})[_0x6602('0x1b')](function(_0x5967a5){logger[_0x6602('0x17')](_0x6602('0x13'),_0x4c6b42,_0x5967a5);_0x563149(_0x5967a5);});});}exports[_0x6602('0x1c')]=function(_0x355df3){var _0x29c5dc=this;return new Promise(function(_0x55ec0c,_0x381ed8){return db[_0x6602('0x1d')][_0x6602('0x1e')](_0x355df3[_0x6602('0x1f')],{'raw':_0x355df3['options']?_0x355df3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x355df3[_0x6602('0x20')]?_0x355df3[_0x6602('0x20')]['where']||null:null,'attributes':_0x355df3[_0x6602('0x20')]?_0x355df3[_0x6602('0x20')]['attributes']||null:null,'limit':_0x355df3[_0x6602('0x20')]?_0x355df3['options'][_0x6602('0x21')]||null:null})[_0x6602('0x11')](function(_0x235f52){logger[_0x6602('0x12')](_0x6602('0x1c'),_0x355df3);logger['debug'](_0x6602('0x1c'),_0x355df3,JSON[_0x6602('0x16')](_0x235f52));_0x55ec0c(_0x235f52);})['catch'](function(_0x987292){logger['error']('UpdateChatInteraction',_0x987292[_0x6602('0x18')],_0x355df3);_0x381ed8(_0x29c5dc[_0x6602('0x17')](0x1f4,_0x987292['message']));});});};exports[_0x6602('0x22')]=function(_0x596c71){return new Promise(function(_0x13b783,_0x25045f){return db['ChatInteraction'][_0x6602('0x23')]({'where':_0x596c71[_0x6602('0x20')]?_0x596c71[_0x6602('0x20')][_0x6602('0x24')]||null:null})['then'](function(_0xb9d616){if(_0xb9d616){return _0xb9d616[_0x6602('0x25')](_0x596c71[_0x6602('0x1f')][_0x6602('0x26')],_[_0x6602('0x27')](_0x596c71['body'],['ids','id'])||{});}})[_0x6602('0x28')](function(_0x31269e){logger[_0x6602('0x12')]('AddTags',_0x596c71);logger['debug'](_0x6602('0x29'),_0x596c71,JSON[_0x6602('0x16')](_0x31269e));_0x13b783(_0x31269e);})[_0x6602('0x1b')](function(_0x1ca417){logger[_0x6602('0x17')]('AddTags',_0x1ca417['message'],_0x596c71);_0x25045f(_this[_0x6602('0x17')](0x1f4,_0x1ca417[_0x6602('0x18')]));});});};
\ No newline at end of file
+var _0x94b6=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','request','then','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','update','options','raw','where','attributes','limit','info','UpdateChatInteraction','AddTagsToChatInteraction','ChatInteraction','addTags','body','ids','spread','AddTags'];(function(_0x412e45,_0x593523){var _0x317943=function(_0x5716d5){while(--_0x5716d5){_0x412e45['push'](_0x412e45['shift']());}};_0x317943(++_0x593523);}(_0x94b6,0x11f));var _0x694b=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0x94b6[_0x4b174a];return _0x3cd7bf;};'use strict';var _=require(_0x694b('0x0'));var util=require('util');var moment=require(_0x694b('0x1'));var BPromise=require(_0x694b('0x2'));var rs=require(_0x694b('0x3'));var fs=require('fs');var Redis=require(_0x694b('0x4'));var db=require(_0x694b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x694b('0x6'))(_0x694b('0x7'));var config=require(_0x694b('0x8'));var jayson=require(_0x694b('0x9'));var client=jayson[_0x694b('0xa')][_0x694b('0xb')]({'port':0x232a});config[_0x694b('0xc')]=_[_0x694b('0xd')](config[_0x694b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x694b('0xc')]));require(_0x694b('0xe'))[_0x694b('0xf')](socket);function respondWithRpcPromise(_0x287782,_0x332bb1,_0x3e01cb){return new BPromise(function(_0xfd2eab,_0x4e742d){return client[_0x694b('0x10')](_0x287782,_0x3e01cb)[_0x694b('0x11')](function(_0x142d15){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x332bb1,_0x694b('0x12'));logger[_0x694b('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x332bb1,_0x694b('0x12'),JSON[_0x694b('0x14')](_0x142d15));if(_0x142d15[_0x694b('0x15')]){if(_0x142d15[_0x694b('0x15')][_0x694b('0x16')]===0x1f4){logger[_0x694b('0x15')](_0x694b('0x17'),_0x332bb1,_0x142d15['error'][_0x694b('0x18')]);return _0x4e742d(_0x142d15[_0x694b('0x15')][_0x694b('0x18')]);}logger['error'](_0x694b('0x17'),_0x332bb1,_0x142d15[_0x694b('0x15')][_0x694b('0x18')]);return _0xfd2eab(_0x142d15[_0x694b('0x15')]['message']);}else{logger['info'](_0x694b('0x17'),_0x332bb1,_0x694b('0x12'));_0xfd2eab(_0x142d15['result'][_0x694b('0x18')]);}})[_0x694b('0x19')](function(_0x155e12){logger['error'](_0x694b('0x17'),_0x332bb1,_0x155e12);_0x4e742d(_0x155e12);});});}exports['UpdateChatInteraction']=function(_0x1fb474){var _0x3ffb32=this;return new Promise(function(_0xf9a698,_0x3d9802){return db['ChatInteraction'][_0x694b('0x1a')](_0x1fb474['body'],{'raw':_0x1fb474[_0x694b('0x1b')]?_0x1fb474[_0x694b('0x1b')][_0x694b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fb474['options']?_0x1fb474[_0x694b('0x1b')][_0x694b('0x1d')]||null:null,'attributes':_0x1fb474[_0x694b('0x1b')]?_0x1fb474[_0x694b('0x1b')][_0x694b('0x1e')]||null:null,'limit':_0x1fb474[_0x694b('0x1b')]?_0x1fb474['options'][_0x694b('0x1f')]||null:null})[_0x694b('0x11')](function(_0xe05741){logger[_0x694b('0x20')](_0x694b('0x21'),_0x1fb474);logger[_0x694b('0x13')](_0x694b('0x21'),_0x1fb474,JSON[_0x694b('0x14')](_0xe05741));_0xf9a698(_0xe05741);})[_0x694b('0x19')](function(_0x30086b){logger['error'](_0x694b('0x21'),_0x30086b[_0x694b('0x18')],_0x1fb474);_0x3d9802(_0x3ffb32[_0x694b('0x15')](0x1f4,_0x30086b[_0x694b('0x18')]));});});};exports[_0x694b('0x22')]=function(_0x4eba0d){return new Promise(function(_0xbdaf10,_0x4e65f0){return db[_0x694b('0x23')]['find']({'where':_0x4eba0d[_0x694b('0x1b')]?_0x4eba0d[_0x694b('0x1b')][_0x694b('0x1d')]||null:null})[_0x694b('0x11')](function(_0x2d34ef){if(_0x2d34ef){return _0x2d34ef[_0x694b('0x24')](_0x4eba0d[_0x694b('0x25')][_0x694b('0x26')],_['omit'](_0x4eba0d['body'],['ids','id'])||{});}})[_0x694b('0x27')](function(_0x46c141){logger[_0x694b('0x20')](_0x694b('0x28'),_0x4eba0d);logger[_0x694b('0x13')](_0x694b('0x28'),_0x4eba0d,JSON[_0x694b('0x14')](_0x46c141));_0xbdaf10(_0x46c141);})[_0x694b('0x19')](function(_0x113c1a){logger['error']('AddTags',_0x113c1a[_0x694b('0x18')],_0x4eba0d);_0x4e65f0(_this['error'](0x1f4,_0x113c1a['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 0ca4c17..d757b95 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 _0x9d2d=['update','emit','removeListener','register','chatInteraction:','save','remove'];(function(_0x4d22b8,_0x4f1c0b){var _0x233467=function(_0x50ac2c){while(--_0x50ac2c){_0x4d22b8['push'](_0x4d22b8['shift']());}};_0x233467(++_0x4f1c0b);}(_0x9d2d,0x124));var _0xd9d2=function(_0x31d279,_0x24f8d7){_0x31d279=_0x31d279-0x0;var _0x107618=_0x9d2d[_0x31d279];return _0x107618;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xd9d2('0x0'),_0xd9d2('0x1'),_0xd9d2('0x2')];function createListener(_0x1fe802,_0x348c9d){return function(_0x406dc9){_0x348c9d[_0xd9d2('0x3')](_0x1fe802,_0x406dc9);};}function removeListener(_0x10f4bf,_0x420ef6){return function(){ChatInteractionEvents[_0xd9d2('0x4')](_0x10f4bf,_0x420ef6);};}exports[_0xd9d2('0x5')]=function(_0x8f3c05){for(var _0x2288db=0x0,_0x559ae0=events['length'];_0x2288db<_0x559ae0;_0x2288db++){var _0x5d49df=events[_0x2288db];var _0x195f06=createListener(_0xd9d2('0x6')+_0x5d49df,_0x8f3c05);ChatInteractionEvents['on'](_0x5d49df,_0x195f06);}};
\ No newline at end of file
+var _0x27f3=['remove','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x27f3,0x1d8));var _0x327f=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x27f3[_0x3a2a3c];return _0x50ac9a;};'use strict';var ChatInteractionEvents=require(_0x327f('0x0'));var events=[_0x327f('0x1'),_0x327f('0x2'),'update'];function createListener(_0x527cb7,_0x403508){return function(_0x7545ce){_0x403508['emit'](_0x527cb7,_0x7545ce);};}function removeListener(_0x220b04,_0x917e13){return function(){ChatInteractionEvents['removeListener'](_0x220b04,_0x917e13);};}exports[_0x327f('0x3')]=function(_0x39f8eb){for(var _0x4cfd58=0x0,_0x54d325=events[_0x327f('0x4')];_0x4cfd58<_0x54d325;_0x4cfd58++){var _0x52a6ca=events[_0x4cfd58];var _0x21e12b=createListener(_0x327f('0x5')+_0x52a6ca,_0x39f8eb);ChatInteractionEvents['on'](_0x52a6ca,_0x21e12b);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index f7ec1fe..b34a350 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 _0x9fcd=['chatinteraction:destroy','destroy','delete','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','isAuthenticated','getMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','close'];(function(_0x2cf4b3,_0x3d8c66){var _0x4b72a8=function(_0x56c54d){while(--_0x56c54d){_0x2cf4b3['push'](_0x2cf4b3['shift']());}};_0x4b72a8(++_0x3d8c66);}(_0x9fcd,0x6a));var _0xd9fc=function(_0x4a36dd,_0x9d6dc4){_0x4a36dd=_0x4a36dd-0x0;var _0x59287a=_0x9fcd[_0x4a36dd];return _0x59287a;};'use strict';var multer=require(_0xd9fc('0x0'));var util=require(_0xd9fc('0x1'));var path=require(_0xd9fc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd9fc('0x3')]();var fs_extra=require(_0xd9fc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd9fc('0x5'));var config=require(_0xd9fc('0x6'));var controller=require('./chatInteraction.controller');router[_0xd9fc('0x7')]('/',auth['isAuthenticated'](),controller[_0xd9fc('0x8')]);router['get'](_0xd9fc('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xd9fc('0x7')](_0xd9fc('0xa'),auth['isChatInteractionAuthorized'](),controller[_0xd9fc('0xb')]);router[_0xd9fc('0x7')](_0xd9fc('0xc'),auth[_0xd9fc('0xd')](),controller[_0xd9fc('0xe')]);router[_0xd9fc('0x7')]('/:id/messages',auth[_0xd9fc('0xf')](),controller[_0xd9fc('0x10')]);router[_0xd9fc('0x7')]('/:id/my_messages',auth[_0xd9fc('0xd')](),controller['getMyMessages']);router[_0xd9fc('0x7')](_0xd9fc('0x11'),auth[_0xd9fc('0xf')](),controller[_0xd9fc('0x12')]);router[_0xd9fc('0x13')]('/',auth[_0xd9fc('0xf')](),controller[_0xd9fc('0x14')]);router[_0xd9fc('0x13')](_0xd9fc('0x15'),auth[_0xd9fc('0xf')](),controller[_0xd9fc('0x16')]);var upload=multer({'storage':multer[_0xd9fc('0x17')]({'destination':function(_0x439708,_0x47f89c,_0x503ffb){_0x503ffb(null,path[_0xd9fc('0x18')](config['root'],_0xd9fc('0x19')));},'filename':function(_0x407061,_0x3f4cea,_0x258264){_0x258264(null,util['format'](_0xd9fc('0x1a'),Date[_0xd9fc('0x1b')](),_0x3f4cea[_0xd9fc('0x1c')][_0xd9fc('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd9fc('0x13')](_0xd9fc('0x1e'),upload[_0xd9fc('0x1f')](_0xd9fc('0x20')),controller[_0xd9fc('0x21')]);router[_0xd9fc('0x13')](_0xd9fc('0x22'),auth[_0xd9fc('0xd')](),controller[_0xd9fc('0x23')]);router[_0xd9fc('0x13')](_0xd9fc('0x24'),auth['isAuthenticated'](),interaction['tracked'](_0xd9fc('0x25'),_0xd9fc('0x26')),controller[_0xd9fc('0x27')]);router[_0xd9fc('0x28')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xd9fc('0x25'),_0xd9fc('0x29')),controller['update']);router['put']('/:id/custom_update',controller[_0xd9fc('0x2a')]);router['put'](_0xd9fc('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xd9fc('0x2c')]);router[_0xd9fc('0x28')](_0xd9fc('0x2d'),controller[_0xd9fc('0x2e')]);router['delete']('/:id',auth[_0xd9fc('0xf')](),interaction['tracked'](_0xd9fc('0x25'),_0xd9fc('0x2f')),controller[_0xd9fc('0x30')]);router[_0xd9fc('0x31')]('/:id/tags',auth[_0xd9fc('0xf')](),controller['removeTags']);module[_0xd9fc('0x32')]=router;
\ No newline at end of file
+var _0xbadc=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','format','%s-%s','originalname','/:id/attachment_upload','single','file','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports'];(function(_0x374cce,_0x24c130){var _0x117084=function(_0x2192cf){while(--_0x2192cf){_0x374cce['push'](_0x374cce['shift']());}};_0x117084(++_0x24c130);}(_0xbadc,0x93));var _0xcbad=function(_0x125233,_0x522bf1){_0x125233=_0x125233-0x0;var _0x42d385=_0xbadc[_0x125233];return _0x42d385;};'use strict';var multer=require(_0xcbad('0x0'));var util=require(_0xcbad('0x1'));var path=require(_0xcbad('0x2'));var timeout=require(_0xcbad('0x3'));var express=require(_0xcbad('0x4'));var router=express[_0xcbad('0x5')]();var fs_extra=require(_0xcbad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcbad('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0xcbad('0x8')]('/',auth[_0xcbad('0x9')](),controller['index']);router[_0xcbad('0x8')](_0xcbad('0xa'),auth['isAuthenticated'](),controller[_0xcbad('0xb')]);router[_0xcbad('0x8')](_0xcbad('0xc'),auth[_0xcbad('0xd')](),controller[_0xcbad('0xe')]);router['get'](_0xcbad('0xf'),auth[_0xcbad('0xd')](),controller[_0xcbad('0x10')]);router['get'](_0xcbad('0x11'),auth[_0xcbad('0x9')](),controller[_0xcbad('0x12')]);router[_0xcbad('0x8')](_0xcbad('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xcbad('0x14')]);router[_0xcbad('0x8')]('/:id/download',auth[_0xcbad('0x9')](),controller['download']);router[_0xcbad('0x15')]('/',auth[_0xcbad('0x9')](),controller[_0xcbad('0x16')]);router[_0xcbad('0x15')](_0xcbad('0x17'),auth['isAuthenticated'](),controller[_0xcbad('0x18')]);var upload=multer({'storage':multer[_0xcbad('0x19')]({'destination':function(_0x43439c,_0x44c8fb,_0xc52857){_0xc52857(null,path['join'](config[_0xcbad('0x1a')],'server/files/attachments/'));},'filename':function(_0x235112,_0x2401ff,_0x516f42){_0x516f42(null,util[_0xcbad('0x1b')](_0xcbad('0x1c'),Date['now'](),_0x2401ff[_0xcbad('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xcbad('0x15')](_0xcbad('0x1e'),upload[_0xcbad('0x1f')](_0xcbad('0x20')),controller['attachmentUpload']);router[_0xcbad('0x15')](_0xcbad('0x11'),auth[_0xcbad('0xd')](),controller['addMessage']);router[_0xcbad('0x15')](_0xcbad('0x21'),auth[_0xcbad('0x9')](),interaction[_0xcbad('0x22')](_0xcbad('0x23'),_0xcbad('0x24')),controller[_0xcbad('0x25')]);router[_0xcbad('0x26')](_0xcbad('0xc'),auth[_0xcbad('0x9')](),interaction[_0xcbad('0x22')](_0xcbad('0x23'),_0xcbad('0x27')),controller['update']);router['put'](_0xcbad('0x28'),controller['customUpdate']);router['put'](_0xcbad('0x29'),auth[_0xcbad('0xd')](),controller[_0xcbad('0x2a')]);router[_0xcbad('0x26')](_0xcbad('0x2b'),controller[_0xcbad('0x2c')]);router[_0xcbad('0x2d')](_0xcbad('0xc'),auth[_0xcbad('0x9')](),interaction[_0xcbad('0x22')](_0xcbad('0x23'),'chatinteraction:destroy'),controller[_0xcbad('0x2e')]);router[_0xcbad('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller[_0xcbad('0x2f')]);module[_0xcbad('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 67adda1..c3c081e 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 _0xc9ef=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc9ef,0xe5));var _0xfc9e=function(_0x4c5cd4,_0x268643){_0x4c5cd4=_0x4c5cd4-0x0;var _0x210bcf=_0xc9ef[_0x4c5cd4];return _0x210bcf;};'use strict';var Sequelize=require(_0xfc9e('0x0'));module[_0xfc9e('0x1')]={'body':{'type':Sequelize[_0xfc9e('0x2')](_0xfc9e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfc9e('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xfc9e('0x5')]}};
\ No newline at end of file
+var _0x45b2=['exports','TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x5998d0,_0x24ad81){var _0x47149d=function(_0x5e4d63){while(--_0x5e4d63){_0x5998d0['push'](_0x5998d0['shift']());}};_0x47149d(++_0x24ad81);}(_0x45b2,0x107));var _0x245b=function(_0x4a165e,_0x1b5784){_0x4a165e=_0x4a165e-0x0;var _0x5c8fbc=_0x45b2[_0x4a165e];return _0x5c8fbc;};'use strict';var Sequelize=require(_0x245b('0x0'));module[_0x245b('0x1')]={'body':{'type':Sequelize[_0x245b('0x2')](_0x245b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x245b('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x245b('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index e972037..99c293b 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 _0x7410=['includeAll','include','findAll','catch','show','params','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7410,0x9b));var _0x0741=function(_0x3ac779,_0x2fb6ad){_0x3ac779=_0x3ac779-0x0;var _0x5de65d=_0x7410[_0x3ac779];return _0x5de65d;};'use strict';var emlformat=require(_0x0741('0x0'));var rimraf=require(_0x0741('0x1'));var zipdir=require(_0x0741('0x2'));var jsonpatch=require(_0x0741('0x3'));var rp=require('request-promise');var moment=require(_0x0741('0x4'));var BPromise=require(_0x0741('0x5'));var Mustache=require(_0x0741('0x6'));var util=require(_0x0741('0x7'));var path=require(_0x0741('0x8'));var sox=require(_0x0741('0x9'));var csv=require(_0x0741('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0741('0xb'));var _=require(_0x0741('0xc'));var squel=require(_0x0741('0xd'));var crypto=require(_0x0741('0xe'));var jsforce=require(_0x0741('0xf'));var deskjs=require(_0x0741('0x10'));var toCsv=require(_0x0741('0xa'));var querystring=require(_0x0741('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0741('0x12'));var qs=require(_0x0741('0x13'));var as=require(_0x0741('0x14'));var hardwareService=require(_0x0741('0x15'));var logger=require(_0x0741('0x16'))('api');var utils=require(_0x0741('0x17'));var config=require(_0x0741('0x18'));var licenseUtil=require(_0x0741('0x19'));var db=require(_0x0741('0x1a'))['db'];config[_0x0741('0x1b')]=_[_0x0741('0x1c')](config[_0x0741('0x1b')],{'host':_0x0741('0x1d'),'port':0x18eb});var socket=require(_0x0741('0x1e'))(new Redis(config[_0x0741('0x1b')]));require(_0x0741('0x1f'))['register'](socket);function respondWithStatusCode(_0x466dee,_0x57d275){_0x57d275=_0x57d275||0xcc;return function(_0x28c37b){if(_0x28c37b){return _0x466dee['sendStatus'](_0x57d275);}return _0x466dee[_0x0741('0x20')](_0x57d275)[_0x0741('0x21')]();};}function respondWithResult(_0x24e07e,_0x40599f){_0x40599f=_0x40599f||0xc8;return function(_0x18c531){if(_0x18c531){return _0x24e07e[_0x0741('0x20')](_0x40599f)[_0x0741('0x22')](_0x18c531);}};}function respondWithFilteredResult(_0x3f0082,_0x35504a){return function(_0x2e9495){if(_0x2e9495){var _0x95cf86=typeof _0x35504a[_0x0741('0x23')]===_0x0741('0x24')&&typeof _0x35504a[_0x0741('0x25')]===_0x0741('0x24');var _0x47038a=_0x2e9495[_0x0741('0x26')];var _0x318a3b=_0x95cf86?0x0:_0x35504a[_0x0741('0x23')];var _0x419867=_0x95cf86?_0x2e9495['count']:_0x35504a[_0x0741('0x23')]+_0x35504a[_0x0741('0x25')];var _0x3d86dc;if(_0x419867>=_0x47038a){_0x419867=_0x47038a;_0x3d86dc=0xc8;}else{_0x3d86dc=0xce;}_0x3f0082[_0x0741('0x20')](_0x3d86dc);return _0x3f0082[_0x0741('0x27')](_0x0741('0x28'),_0x318a3b+'-'+_0x419867+'/'+_0x47038a)[_0x0741('0x22')](_0x2e9495);}return null;};}function patchUpdates(_0x39b71d){return function(_0x580ebe){try{jsonpatch[_0x0741('0x29')](_0x580ebe,_0x39b71d,!![]);}catch(_0x33d5b6){return BPromise[_0x0741('0x2a')](_0x33d5b6);}return _0x580ebe[_0x0741('0x2b')]();};}function saveUpdates(_0x32c14e,_0x3cc9b1){return function(_0x5c0a56){if(_0x5c0a56){return _0x5c0a56[_0x0741('0x2c')](_0x32c14e)['then'](function(_0x54985a){return _0x54985a;});}return null;};}function removeEntity(_0x68e47b,_0x2bf6a1){return function(_0x1bbb88){if(_0x1bbb88){return _0x1bbb88[_0x0741('0x2d')]()[_0x0741('0x2e')](function(){_0x68e47b[_0x0741('0x20')](0xcc)[_0x0741('0x21')]();});}};}function handleEntityNotFound(_0x16e684,_0x2bebf0){return function(_0x14c035){if(!_0x14c035){_0x16e684[_0x0741('0x2f')](0x194);}return _0x14c035;};}function handleError(_0x13c07e,_0x3c02ca){_0x3c02ca=_0x3c02ca||0x1f4;return function(_0x55178f){logger['error'](_0x55178f[_0x0741('0x30')]);if(_0x55178f[_0x0741('0x31')]){delete _0x55178f['name'];}_0x13c07e['status'](_0x3c02ca)[_0x0741('0x32')](_0x55178f);};}exports[_0x0741('0x33')]=function(_0x26c7d7,_0x2f6e2e){var _0x423268={},_0x420396={},_0x3768e7={'count':0x0,'rows':[]};var _0x2e6f12=_[_0x0741('0x34')](db[_0x0741('0x35')][_0x0741('0x36')],function(_0x57ef52){return{'name':_0x57ef52[_0x0741('0x37')],'type':_0x57ef52[_0x0741('0x38')][_0x0741('0x39')]};});_0x420396['model']=_[_0x0741('0x34')](_0x2e6f12,_0x0741('0x31'));_0x420396[_0x0741('0x3a')]=_[_0x0741('0x3b')](_0x26c7d7[_0x0741('0x3a')]);_0x420396[_0x0741('0x3c')]=_['intersection'](_0x420396['model'],_0x420396['query']);_0x423268[_0x0741('0x3d')]=_[_0x0741('0x3e')](_0x420396[_0x0741('0x3f')],qs[_0x0741('0x40')](_0x26c7d7[_0x0741('0x3a')][_0x0741('0x40')]));_0x423268[_0x0741('0x3d')]=_0x423268[_0x0741('0x3d')][_0x0741('0x41')]?_0x423268[_0x0741('0x3d')]:_0x420396[_0x0741('0x3f')];if(!_0x26c7d7['query'][_0x0741('0x42')](_0x0741('0x43'))){_0x423268[_0x0741('0x25')]=qs[_0x0741('0x25')](_0x26c7d7['query']['limit']);_0x423268[_0x0741('0x23')]=qs[_0x0741('0x23')](_0x26c7d7['query'][_0x0741('0x23')]);}_0x423268[_0x0741('0x44')]=qs[_0x0741('0x45')](_0x26c7d7['query'][_0x0741('0x45')]);_0x423268[_0x0741('0x46')]=qs['filters'](_['pick'](_0x26c7d7[_0x0741('0x3a')],_0x420396[_0x0741('0x3c')]),_0x2e6f12);if(_0x26c7d7['query'][_0x0741('0x47')]){_0x423268[_0x0741('0x46')]=_['merge'](_0x423268[_0x0741('0x46')],{'$or':_[_0x0741('0x34')](_0x2e6f12,function(_0x58970c){if(_0x58970c[_0x0741('0x38')]!==_0x0741('0x48')){var _0x54062c={};_0x54062c[_0x58970c['name']]={'$like':'%'+_0x26c7d7[_0x0741('0x3a')][_0x0741('0x47')]+'%'};return _0x54062c;}})});}_0x423268=_[_0x0741('0x49')]({},_0x423268,_0x26c7d7[_0x0741('0x4a')]);var _0x517c09={'where':_0x423268[_0x0741('0x46')]};return db[_0x0741('0x35')]['count'](_0x517c09)[_0x0741('0x2e')](function(_0x4f06b6){_0x3768e7[_0x0741('0x26')]=_0x4f06b6;if(_0x26c7d7[_0x0741('0x3a')][_0x0741('0x4b')]){_0x423268[_0x0741('0x4c')]=[{'all':!![]}];}return db[_0x0741('0x35')][_0x0741('0x4d')](_0x423268);})[_0x0741('0x2e')](function(_0x511366){_0x3768e7['rows']=_0x511366;return _0x3768e7;})[_0x0741('0x2e')](respondWithFilteredResult(_0x2f6e2e,_0x423268))[_0x0741('0x4e')](handleError(_0x2f6e2e,null));};exports[_0x0741('0x4f')]=function(_0xdb27da,_0x847f2){var _0x24c463={'raw':!![],'where':{'id':_0xdb27da[_0x0741('0x50')]['id']}},_0x40c6dd={};_0x40c6dd[_0x0741('0x3f')]=_['keys'](db[_0x0741('0x35')][_0x0741('0x36')]);_0x40c6dd[_0x0741('0x3a')]=_['keys'](_0xdb27da[_0x0741('0x3a')]);_0x40c6dd[_0x0741('0x3c')]=_[_0x0741('0x3e')](_0x40c6dd['model'],_0x40c6dd[_0x0741('0x3a')]);_0x24c463['attributes']=_[_0x0741('0x3e')](_0x40c6dd[_0x0741('0x3f')],qs[_0x0741('0x40')](_0xdb27da[_0x0741('0x3a')][_0x0741('0x40')]));_0x24c463[_0x0741('0x3d')]=_0x24c463[_0x0741('0x3d')][_0x0741('0x41')]?_0x24c463[_0x0741('0x3d')]:_0x40c6dd[_0x0741('0x3f')];if(_0xdb27da[_0x0741('0x3a')][_0x0741('0x4b')]){_0x24c463[_0x0741('0x4c')]=[{'all':!![]}];}_0x24c463=_[_0x0741('0x49')]({},_0x24c463,_0xdb27da['options']);return db[_0x0741('0x35')][_0x0741('0x51')](_0x24c463)[_0x0741('0x2e')](handleEntityNotFound(_0x847f2,null))[_0x0741('0x2e')](respondWithResult(_0x847f2,null))[_0x0741('0x4e')](handleError(_0x847f2,null));};exports[_0x0741('0x52')]=function(_0x244158,_0x1980fb){return db[_0x0741('0x35')][_0x0741('0x52')](_0x244158[_0x0741('0x53')],{})[_0x0741('0x2e')](respondWithResult(_0x1980fb,0xc9))[_0x0741('0x4e')](handleError(_0x1980fb,null));};exports[_0x0741('0x2c')]=function(_0x5a13ab,_0x1b0c8d){if(_0x5a13ab[_0x0741('0x53')]['id']){delete _0x5a13ab[_0x0741('0x53')]['id'];}return db[_0x0741('0x35')]['find']({'where':{'id':_0x5a13ab[_0x0741('0x50')]['id']}})[_0x0741('0x2e')](handleEntityNotFound(_0x1b0c8d,null))[_0x0741('0x2e')](saveUpdates(_0x5a13ab[_0x0741('0x53')],null))[_0x0741('0x2e')](respondWithResult(_0x1b0c8d,null))['catch'](handleError(_0x1b0c8d,null));};exports[_0x0741('0x2d')]=function(_0x3d2bde,_0xa1c15e){return db[_0x0741('0x35')][_0x0741('0x51')]({'where':{'id':_0x3d2bde[_0x0741('0x50')]['id']}})[_0x0741('0x2e')](handleEntityNotFound(_0xa1c15e,null))[_0x0741('0x2e')](removeEntity(_0xa1c15e,null))['catch'](handleError(_0xa1c15e,null));};exports['describe']=function(_0x3abb5d,_0x394009){return db[_0x0741('0x35')][_0x0741('0x54')]()[_0x0741('0x2e')](respondWithResult(_0x394009,null))['catch'](handleError(_0x394009,null));};function wrapUser(_0x4a7959){return function(_0x456189){var _0x55d770=_0x4a7959[_0x0741('0x55')]({'plain':!![]});_0x55d770['messages']=[];if(_0x456189){_0x55d770[_0x0741('0x56')]=_0x456189[_0x0741('0x57')];_0x55d770[_0x0741('0x58')]=_0x456189;}else{_0x55d770[_0x0741('0x56')]=moment(0x0)['format'](_0x0741('0x59'));_0x55d770['lastMessage']={};}return _0x55d770;};}exports['getUsers']=function(_0x32ccbf,_0x56cefa,_0x28e78a){var _0x17979b=[];return db[_0x0741('0x5a')][_0x0741('0x4d')]({'where':{'role':[_0x0741('0x5b'),_0x0741('0x5c'),_0x0741('0x5d')]},'attributes':['id',_0x0741('0x5e'),_0x0741('0x31'),_0x0741('0x5f'),'userpic','internal',_0x0741('0x60'),_0x0741('0x61'),_0x0741('0x62'),_0x0741('0x63')],'order':qs[_0x0741('0x45')](_0x0741('0x64')),'include':[{'model':db[_0x0741('0x65')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x0741('0x2e')](function(_0x3cfca6){if(_0x3cfca6){var _0x31dad7=_0x32ccbf[_0x0741('0x5d')]['get']({'plain':!![]});if(!_0x31dad7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31dad7[_0x0741('0x5f')]===_0x0741('0x5d')){return db[_0x0741('0x66')][_0x0741('0x51')]({'where':{'name':_0x0741('0x67'),'userProfileId':_0x31dad7[_0x0741('0x68')]},'raw':!![]})[_0x0741('0x2e')](function(_0x2ca818){if(_0x2ca818){if(_0x2ca818[_0x0741('0x69')]===0x0){return db[_0x0741('0x6a')][_0x0741('0x4d')]({'where':{'sectionId':_0x2ca818['id']},'raw':!![]})[_0x0741('0x2e')](function(_0x58bd6e){var _0x55054f=[];if(_['isEmpty'](_0x58bd6e)){_0x55054f=_[_0x0741('0x47')](_0x3cfca6,function(_0x1e9a5e){if(_0x1e9a5e['role']!=='agent'){return _0x1e9a5e;}});return _0x55054f;}else{for(var _0x2920e8=0x0;_0x2920e8<_0x3cfca6['length'];_0x2920e8++){var _0x5030d4=_0x3cfca6[_0x2920e8];if(_0x5030d4['role']===_0x0741('0x5b')){var _0x181ea9=_[_0x0741('0x51')](_0x58bd6e,function(_0x53eeaf){return _0x53eeaf[_0x0741('0x6b')]===_0x5030d4['id'];});if(_0x181ea9)_0x55054f['push'](_0x5030d4);}else{_0x55054f[_0x0741('0x6c')](_0x5030d4);}}return _0x55054f;}});}else{return _0x3cfca6;}}else{var _0x43988b=_[_0x0741('0x47')](_0x3cfca6,function(_0x5c1a2f){if(_0x5c1a2f['role']!==_0x0741('0x5b')){return _0x5c1a2f;}});return _0x43988b;}});}else{return _0x3cfca6;}}})['then'](function(_0x382d85){var _0x3c5df3=[];if(_0x382d85){_0x17979b=_0x382d85;for(var _0x217702=0x0;_0x217702<_0x382d85[_0x0741('0x41')];_0x217702+=0x1){_0x17979b[_0x217702][_0x0741('0x6d')]=[];_0x3c5df3['push'](db[_0x0741('0x35')][_0x0741('0x51')]({'where':{'FromId':[_0x32ccbf[_0x0741('0x5d')]['id'],_0x382d85[_0x217702]['id']],'ToId':[_0x32ccbf[_0x0741('0x5d')]['id'],_0x382d85[_0x217702]['id']],'ChatGroupId':null},'attributes':['id',_0x0741('0x57'),_0x0741('0x6e'),_0x0741('0x6f'),_0x0741('0x70'),'body'],'order':qs[_0x0741('0x45')](_0x0741('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x382d85[_0x217702])));}return BPromise[_0x0741('0x72')](_0x3c5df3);}return[];})[_0x0741('0x2e')](function(_0x1cded5){return{'rows':_0x1cded5,'count':_0x1cded5[_0x0741('0x41')]};})[_0x0741('0x2e')](respondWithResult(_0x56cefa,null))[_0x0741('0x4e')](handleError(_0x56cefa,null));};
\ No newline at end of file
+var _0xf13c=['find','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','role','userpic','internal','online','showWebBar','-online','VoiceQueue','VoiceQueues','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','filter','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','options'];(function(_0x58578d,_0xd47212){var _0x37616b=function(_0x7bec18){while(--_0x7bec18){_0x58578d['push'](_0x58578d['shift']());}};_0x37616b(++_0xd47212);}(_0xf13c,0x1e1));var _0xcf13=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0xf13c[_0x3ec1da];return _0x472358;};'use strict';var emlformat=require(_0xcf13('0x0'));var rimraf=require(_0xcf13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf13('0x2'));var rp=require(_0xcf13('0x3'));var moment=require(_0xcf13('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcf13('0x5'));var util=require('util');var path=require(_0xcf13('0x6'));var sox=require(_0xcf13('0x7'));var csv=require(_0xcf13('0x8'));var ejs=require(_0xcf13('0x9'));var fs=require('fs');var fs_extra=require(_0xcf13('0xa'));var _=require('lodash');var squel=require(_0xcf13('0xb'));var crypto=require(_0xcf13('0xc'));var jsforce=require(_0xcf13('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcf13('0xe'));var Papa=require(_0xcf13('0xf'));var Redis=require(_0xcf13('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcf13('0x11'));var as=require(_0xcf13('0x12'));var hardwareService=require(_0xcf13('0x13'));var logger=require(_0xcf13('0x14'))('api');var utils=require(_0xcf13('0x15'));var config=require(_0xcf13('0x16'));var licenseUtil=require(_0xcf13('0x17'));var db=require(_0xcf13('0x18'))['db'];config[_0xcf13('0x19')]=_[_0xcf13('0x1a')](config[_0xcf13('0x19')],{'host':_0xcf13('0x1b'),'port':0x18eb});var socket=require(_0xcf13('0x1c'))(new Redis(config[_0xcf13('0x19')]));require(_0xcf13('0x1d'))[_0xcf13('0x1e')](socket);function respondWithStatusCode(_0x163304,_0x245153){_0x245153=_0x245153||0xcc;return function(_0x1a6f64){if(_0x1a6f64){return _0x163304[_0xcf13('0x1f')](_0x245153);}return _0x163304[_0xcf13('0x20')](_0x245153)[_0xcf13('0x21')]();};}function respondWithResult(_0x52e989,_0x5599c8){_0x5599c8=_0x5599c8||0xc8;return function(_0x2a9f86){if(_0x2a9f86){return _0x52e989['status'](_0x5599c8)['json'](_0x2a9f86);}};}function respondWithFilteredResult(_0x467abe,_0x53b217){return function(_0xf89c7a){if(_0xf89c7a){var _0x5e5942=typeof _0x53b217[_0xcf13('0x22')]===_0xcf13('0x23')&&typeof _0x53b217[_0xcf13('0x24')]===_0xcf13('0x23');var _0xb9899f=_0xf89c7a[_0xcf13('0x25')];var _0x10aa52=_0x5e5942?0x0:_0x53b217[_0xcf13('0x22')];var _0x42c89a=_0x5e5942?_0xf89c7a['count']:_0x53b217[_0xcf13('0x22')]+_0x53b217[_0xcf13('0x24')];var _0x520c2d;if(_0x42c89a>=_0xb9899f){_0x42c89a=_0xb9899f;_0x520c2d=0xc8;}else{_0x520c2d=0xce;}_0x467abe[_0xcf13('0x20')](_0x520c2d);return _0x467abe['set'](_0xcf13('0x26'),_0x10aa52+'-'+_0x42c89a+'/'+_0xb9899f)[_0xcf13('0x27')](_0xf89c7a);}return null;};}function patchUpdates(_0x472315){return function(_0x4735ba){try{jsonpatch[_0xcf13('0x28')](_0x4735ba,_0x472315,!![]);}catch(_0x3ea576){return BPromise[_0xcf13('0x29')](_0x3ea576);}return _0x4735ba[_0xcf13('0x2a')]();};}function saveUpdates(_0x103507,_0x4e32d6){return function(_0x41cdb5){if(_0x41cdb5){return _0x41cdb5[_0xcf13('0x2b')](_0x103507)[_0xcf13('0x2c')](function(_0x1f0b0b){return _0x1f0b0b;});}return null;};}function removeEntity(_0x6b4114,_0x4b8445){return function(_0x586d47){if(_0x586d47){return _0x586d47[_0xcf13('0x2d')]()['then'](function(){_0x6b4114[_0xcf13('0x20')](0xcc)[_0xcf13('0x21')]();});}};}function handleEntityNotFound(_0x2c8c63,_0x4fbbf3){return function(_0x3bee22){if(!_0x3bee22){_0x2c8c63[_0xcf13('0x1f')](0x194);}return _0x3bee22;};}function handleError(_0x142bd8,_0x7ca82d){_0x7ca82d=_0x7ca82d||0x1f4;return function(_0x154d54){logger[_0xcf13('0x2e')](_0x154d54[_0xcf13('0x2f')]);if(_0x154d54[_0xcf13('0x30')]){delete _0x154d54[_0xcf13('0x30')];}_0x142bd8['status'](_0x7ca82d)['send'](_0x154d54);};}exports[_0xcf13('0x31')]=function(_0x5b4382,_0x3f4d22){var _0x2f3ec2={},_0x31db5a={},_0x35b08c={'count':0x0,'rows':[]};var _0x1b9deb=_[_0xcf13('0x32')](db['ChatInternalMessage']['rawAttributes'],function(_0x3c303b){return{'name':_0x3c303b[_0xcf13('0x33')],'type':_0x3c303b['type'][_0xcf13('0x34')]};});_0x31db5a['model']=_[_0xcf13('0x32')](_0x1b9deb,_0xcf13('0x30'));_0x31db5a[_0xcf13('0x35')]=_[_0xcf13('0x36')](_0x5b4382['query']);_0x31db5a['filters']=_[_0xcf13('0x37')](_0x31db5a[_0xcf13('0x38')],_0x31db5a[_0xcf13('0x35')]);_0x2f3ec2[_0xcf13('0x39')]=_['intersection'](_0x31db5a['model'],qs[_0xcf13('0x3a')](_0x5b4382['query'][_0xcf13('0x3a')]));_0x2f3ec2[_0xcf13('0x39')]=_0x2f3ec2['attributes'][_0xcf13('0x3b')]?_0x2f3ec2['attributes']:_0x31db5a['model'];if(!_0x5b4382[_0xcf13('0x35')][_0xcf13('0x3c')](_0xcf13('0x3d'))){_0x2f3ec2[_0xcf13('0x24')]=qs[_0xcf13('0x24')](_0x5b4382[_0xcf13('0x35')][_0xcf13('0x24')]);_0x2f3ec2[_0xcf13('0x22')]=qs['offset'](_0x5b4382[_0xcf13('0x35')][_0xcf13('0x22')]);}_0x2f3ec2['order']=qs[_0xcf13('0x3e')](_0x5b4382[_0xcf13('0x35')][_0xcf13('0x3e')]);_0x2f3ec2[_0xcf13('0x3f')]=qs[_0xcf13('0x40')](_[_0xcf13('0x41')](_0x5b4382[_0xcf13('0x35')],_0x31db5a[_0xcf13('0x40')]),_0x1b9deb);if(_0x5b4382['query']['filter']){_0x2f3ec2['where']=_[_0xcf13('0x42')](_0x2f3ec2[_0xcf13('0x3f')],{'$or':_[_0xcf13('0x32')](_0x1b9deb,function(_0x2374d0){if(_0x2374d0[_0xcf13('0x43')]!==_0xcf13('0x44')){var _0xe64a48={};_0xe64a48[_0x2374d0['name']]={'$like':'%'+_0x5b4382[_0xcf13('0x35')][_0xcf13('0x45')]+'%'};return _0xe64a48;}})});}_0x2f3ec2=_[_0xcf13('0x42')]({},_0x2f3ec2,_0x5b4382['options']);var _0x23df79={'where':_0x2f3ec2['where']};return db[_0xcf13('0x46')]['count'](_0x23df79)[_0xcf13('0x2c')](function(_0x5cf848){_0x35b08c[_0xcf13('0x25')]=_0x5cf848;if(_0x5b4382[_0xcf13('0x35')][_0xcf13('0x47')]){_0x2f3ec2[_0xcf13('0x48')]=[{'all':!![]}];}return db[_0xcf13('0x46')][_0xcf13('0x49')](_0x2f3ec2);})['then'](function(_0x5305f7){_0x35b08c[_0xcf13('0x4a')]=_0x5305f7;return _0x35b08c;})[_0xcf13('0x2c')](respondWithFilteredResult(_0x3f4d22,_0x2f3ec2))[_0xcf13('0x4b')](handleError(_0x3f4d22,null));};exports[_0xcf13('0x4c')]=function(_0x31a6f1,_0xfe795c){var _0x5d05f0={'raw':!![],'where':{'id':_0x31a6f1[_0xcf13('0x4d')]['id']}},_0x438d38={};_0x438d38[_0xcf13('0x38')]=_[_0xcf13('0x36')](db['ChatInternalMessage']['rawAttributes']);_0x438d38[_0xcf13('0x35')]=_[_0xcf13('0x36')](_0x31a6f1['query']);_0x438d38[_0xcf13('0x40')]=_[_0xcf13('0x37')](_0x438d38[_0xcf13('0x38')],_0x438d38[_0xcf13('0x35')]);_0x5d05f0[_0xcf13('0x39')]=_[_0xcf13('0x37')](_0x438d38[_0xcf13('0x38')],qs[_0xcf13('0x3a')](_0x31a6f1[_0xcf13('0x35')][_0xcf13('0x3a')]));_0x5d05f0['attributes']=_0x5d05f0[_0xcf13('0x39')]['length']?_0x5d05f0[_0xcf13('0x39')]:_0x438d38[_0xcf13('0x38')];if(_0x31a6f1[_0xcf13('0x35')][_0xcf13('0x47')]){_0x5d05f0[_0xcf13('0x48')]=[{'all':!![]}];}_0x5d05f0=_[_0xcf13('0x42')]({},_0x5d05f0,_0x31a6f1[_0xcf13('0x4e')]);return db[_0xcf13('0x46')][_0xcf13('0x4f')](_0x5d05f0)[_0xcf13('0x2c')](handleEntityNotFound(_0xfe795c,null))[_0xcf13('0x2c')](respondWithResult(_0xfe795c,null))[_0xcf13('0x4b')](handleError(_0xfe795c,null));};exports[_0xcf13('0x50')]=function(_0x95a954,_0x12daec){return db[_0xcf13('0x46')][_0xcf13('0x50')](_0x95a954['body'],{})[_0xcf13('0x2c')](respondWithResult(_0x12daec,0xc9))[_0xcf13('0x4b')](handleError(_0x12daec,null));};exports[_0xcf13('0x2b')]=function(_0x57f81a,_0x58f4b6){if(_0x57f81a[_0xcf13('0x51')]['id']){delete _0x57f81a[_0xcf13('0x51')]['id'];}return db[_0xcf13('0x46')][_0xcf13('0x4f')]({'where':{'id':_0x57f81a[_0xcf13('0x4d')]['id']}})[_0xcf13('0x2c')](handleEntityNotFound(_0x58f4b6,null))[_0xcf13('0x2c')](saveUpdates(_0x57f81a[_0xcf13('0x51')],null))['then'](respondWithResult(_0x58f4b6,null))['catch'](handleError(_0x58f4b6,null));};exports[_0xcf13('0x2d')]=function(_0x27e21c,_0x22ce07){return db[_0xcf13('0x46')][_0xcf13('0x4f')]({'where':{'id':_0x27e21c['params']['id']}})[_0xcf13('0x2c')](handleEntityNotFound(_0x22ce07,null))['then'](removeEntity(_0x22ce07,null))[_0xcf13('0x4b')](handleError(_0x22ce07,null));};exports[_0xcf13('0x52')]=function(_0x50a89e,_0x1976f0){return db[_0xcf13('0x46')][_0xcf13('0x52')]()[_0xcf13('0x2c')](respondWithResult(_0x1976f0,null))[_0xcf13('0x4b')](handleError(_0x1976f0,null));};function wrapUser(_0x139624){return function(_0x41f0be){var _0x4d7290=_0x139624['get']({'plain':!![]});_0x4d7290[_0xcf13('0x53')]=[];if(_0x41f0be){_0x4d7290[_0xcf13('0x54')]=_0x41f0be[_0xcf13('0x55')];_0x4d7290[_0xcf13('0x56')]=_0x41f0be;}else{_0x4d7290[_0xcf13('0x54')]=moment(0x0)[_0xcf13('0x57')](_0xcf13('0x58'));_0x4d7290[_0xcf13('0x56')]={};}return _0x4d7290;};}exports[_0xcf13('0x59')]=function(_0xaadd3,_0x35f840,_0x4e0b03){var _0x56eeaf=[];return db[_0xcf13('0x5a')][_0xcf13('0x49')]({'where':{'role':[_0xcf13('0x5b'),'admin','user']},'attributes':['id','fullname',_0xcf13('0x30'),_0xcf13('0x5c'),_0xcf13('0x5d'),_0xcf13('0x5e'),_0xcf13('0x5f'),'lastLoginAt','allowmessenger',_0xcf13('0x60')],'order':qs[_0xcf13('0x3e')](_0xcf13('0x61')),'include':[{'model':db[_0xcf13('0x62')],'as':_0xcf13('0x63'),'attributes':['id','name',_0xcf13('0x43')],'through':{'attributes':[]}}]})[_0xcf13('0x2c')](function(_0x3f600){if(_0x3f600){var _0x1bbcde=_0xaadd3[_0xcf13('0x64')][_0xcf13('0x65')]({'plain':!![]});if(!_0x1bbcde)throw new Error(_0xcf13('0x66'));if(_0x1bbcde[_0xcf13('0x5c')]===_0xcf13('0x64')){return db[_0xcf13('0x67')]['find']({'where':{'name':_0xcf13('0x68'),'userProfileId':_0x1bbcde['userProfileId']},'raw':!![]})['then'](function(_0x480a05){if(_0x480a05){if(_0x480a05[_0xcf13('0x69')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x480a05['id']},'raw':!![]})[_0xcf13('0x2c')](function(_0x197ec7){var _0x449cbf=[];if(_['isEmpty'](_0x197ec7)){_0x449cbf=_[_0xcf13('0x45')](_0x3f600,function(_0x1f4727){if(_0x1f4727['role']!==_0xcf13('0x5b')){return _0x1f4727;}});return _0x449cbf;}else{for(var _0x3ea362=0x0;_0x3ea362<_0x3f600[_0xcf13('0x3b')];_0x3ea362++){var _0x54fccb=_0x3f600[_0x3ea362];if(_0x54fccb[_0xcf13('0x5c')]===_0xcf13('0x5b')){var _0x266b6e=_[_0xcf13('0x4f')](_0x197ec7,function(_0x55d5a2){return _0x55d5a2[_0xcf13('0x6a')]===_0x54fccb['id'];});if(_0x266b6e)_0x449cbf[_0xcf13('0x6b')](_0x54fccb);}else{_0x449cbf[_0xcf13('0x6b')](_0x54fccb);}}return _0x449cbf;}});}else{return _0x3f600;}}else{var _0x10e425=_[_0xcf13('0x45')](_0x3f600,function(_0x45c27d){if(_0x45c27d[_0xcf13('0x5c')]!==_0xcf13('0x5b')){return _0x45c27d;}});return _0x10e425;}});}else{return _0x3f600;}}})['then'](function(_0x29abec){var _0x22d5fe=[];if(_0x29abec){_0x56eeaf=_0x29abec;for(var _0x402ff3=0x0;_0x402ff3<_0x29abec[_0xcf13('0x3b')];_0x402ff3+=0x1){_0x56eeaf[_0x402ff3]['messages']=[];_0x22d5fe['push'](db[_0xcf13('0x46')][_0xcf13('0x4f')]({'where':{'FromId':[_0xaadd3[_0xcf13('0x64')]['id'],_0x29abec[_0x402ff3]['id']],'ToId':[_0xaadd3['user']['id'],_0x29abec[_0x402ff3]['id']],'ChatGroupId':null},'attributes':['id',_0xcf13('0x55'),'FromId',_0xcf13('0x6c'),_0xcf13('0x6d'),_0xcf13('0x51')],'order':qs[_0xcf13('0x3e')](_0xcf13('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x29abec[_0x402ff3])));}return BPromise[_0xcf13('0x6f')](_0x22d5fe);}return[];})[_0xcf13('0x2c')](function(_0x2b6264){return{'rows':_0x2b6264,'count':_0x2b6264[_0xcf13('0x3b')]};})[_0xcf13('0x2c')](respondWithResult(_0x35f840,null))['catch'](handleError(_0x35f840,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 545263a..8708c88 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 _0xcdd6=['setMaxListeners','save','remove','emit','hook','../../mysqldb','ChatInternalMessage'];(function(_0x4c3e69,_0x2be8c6){var _0x4aa69=function(_0x3b1238){while(--_0x3b1238){_0x4c3e69['push'](_0x4c3e69['shift']());}};_0x4aa69(++_0x2be8c6);}(_0xcdd6,0x1be));var _0x6cdd=function(_0x41f2fd,_0x427d9c){_0x41f2fd=_0x41f2fd-0x0;var _0x19ee5a=_0xcdd6[_0x41f2fd];return _0x19ee5a;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x6cdd('0x0'))['db'][_0x6cdd('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6cdd('0x2')](0x0);var events={'afterCreate':_0x6cdd('0x3'),'afterUpdate':'update','afterDestroy':_0x6cdd('0x4')};function emitEvent(_0x4d4591){return function(_0x105169,_0x2dd7da,_0x2cf235){ChatInternalMessageEvents[_0x6cdd('0x5')](_0x4d4591+':'+_0x105169['id'],_0x105169);ChatInternalMessageEvents[_0x6cdd('0x5')](_0x4d4591,_0x105169);_0x2cf235(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x6cdd('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x8044=['ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x446eff,_0x4e88e2){var _0x178fcf=function(_0x3c45ed){while(--_0x3c45ed){_0x446eff['push'](_0x446eff['shift']());}};_0x178fcf(++_0x4e88e2);}(_0x8044,0x170));var _0x4804=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0x8044[_0x2ca616];return _0x53155f;};'use strict';var EventEmitter=require(_0x4804('0x0'));var ChatInternalMessage=require(_0x4804('0x1'))['db'][_0x4804('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4804('0x3')](0x0);var events={'afterCreate':_0x4804('0x4'),'afterUpdate':_0x4804('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d6d6a){return function(_0x361aae,_0x1e482c,_0x3a3938){ChatInternalMessageEvents['emit'](_0x4d6d6a+':'+_0x361aae['id'],_0x361aae);ChatInternalMessageEvents[_0x4804('0x6')](_0x4d6d6a,_0x361aae);_0x3a3938(null);};}for(var e in events){if(events[_0x4804('0x7')](e)){var event=events[e];ChatInternalMessage[_0x4804('0x8')](e,emitEvent(event));}}module[_0x4804('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index f3c7d6c..0f1a36d 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 _0x947e=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','api','moment','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x947e,0x1a5));var _0xe947=function(_0x2e7153,_0x2b3dca){_0x2e7153=_0x2e7153-0x0;var _0xbd2fdd=_0x947e[_0x2e7153];return _0xbd2fdd;};'use strict';var _=require('lodash');var util=require(_0xe947('0x0'));var logger=require('../../config/logger')(_0xe947('0x1'));var moment=require(_0xe947('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe947('0x3'));var config=require(_0xe947('0x4'));var attributes=require(_0xe947('0x5'));module[_0xe947('0x6')]=function(_0x193497,_0x5919c7){return _0x193497[_0xe947('0x7')](_0xe947('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe947('0x9'),'collate':_0xe947('0xa')});};
\ No newline at end of file
+var _0x309b=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x1880f6,_0x3d14b5){var _0x13f186=function(_0x264e16){while(--_0x264e16){_0x1880f6['push'](_0x1880f6['shift']());}};_0x13f186(++_0x3d14b5);}(_0x309b,0x16e));var _0xb309=function(_0x2485b6,_0x1ac427){_0x2485b6=_0x2485b6-0x0;var _0x3f544f=_0x309b[_0x2485b6];return _0x3f544f;};'use strict';var _=require(_0xb309('0x0'));var util=require(_0xb309('0x1'));var logger=require(_0xb309('0x2'))(_0xb309('0x3'));var moment=require(_0xb309('0x4'));var BPromise=require('bluebird');var rp=require(_0xb309('0x5'));var fs=require('fs');var path=require(_0xb309('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xb309('0x7')]=function(_0x5622fd,_0x5a51a6){return _0x5622fd[_0xb309('0x8')](_0xb309('0x9'),attributes,{'tableName':_0xb309('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb309('0xb'),'collate':_0xb309('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 0723662..98332ee 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 _0x87cb=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x1b8880,_0x382d59){var _0x144525=function(_0x207621){while(--_0x207621){_0x1b8880['push'](_0x1b8880['shift']());}};_0x144525(++_0x382d59);}(_0x87cb,0xaa));var _0xb87c=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x87cb[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0xb87c('0x0'));var util=require(_0xb87c('0x1'));var moment=require(_0xb87c('0x2'));var BPromise=require(_0xb87c('0x3'));var rs=require(_0xb87c('0x4'));var fs=require('fs');var Redis=require(_0xb87c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb87c('0x6'))(_0xb87c('0x7'));var config=require(_0xb87c('0x8'));var jayson=require(_0xb87c('0x9'));var client=jayson[_0xb87c('0xa')][_0xb87c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb87c('0xc')],{'host':_0xb87c('0xd'),'port':0x18eb});var socket=require(_0xb87c('0xe'))(new Redis(config[_0xb87c('0xc')]));require(_0xb87c('0xf'))['register'](socket);function respondWithRpcPromise(_0x10517c,_0x484d49,_0x260a20){return new BPromise(function(_0x5229a4,_0x37b8e7){return client[_0xb87c('0x10')](_0x10517c,_0x260a20)[_0xb87c('0x11')](function(_0xa4095f){logger[_0xb87c('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x484d49,'request\x20sent');logger[_0xb87c('0x13')](_0xb87c('0x14'),_0x484d49,_0xb87c('0x15'),JSON['stringify'](_0xa4095f));if(_0xa4095f[_0xb87c('0x16')]){if(_0xa4095f[_0xb87c('0x16')][_0xb87c('0x17')]===0x1f4){logger[_0xb87c('0x16')](_0xb87c('0x18'),_0x484d49,_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);return _0x37b8e7(_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);}logger['error'](_0xb87c('0x18'),_0x484d49,_0xa4095f[_0xb87c('0x16')][_0xb87c('0x19')]);return _0x5229a4(_0xa4095f[_0xb87c('0x16')]['message']);}else{logger[_0xb87c('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x484d49,'request\x20sent');_0x5229a4(_0xa4095f[_0xb87c('0x1a')][_0xb87c('0x19')]);}})[_0xb87c('0x1b')](function(_0x581c9e){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x484d49,_0x581c9e);_0x37b8e7(_0x581c9e);});});}
\ No newline at end of file
+var _0x1052=['then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','register','request'];(function(_0x443808,_0x2561a8){var _0x1ac12a=function(_0x59d260){while(--_0x59d260){_0x443808['push'](_0x443808['shift']());}};_0x1ac12a(++_0x2561a8);}(_0x1052,0xf4));var _0x2105=function(_0xbb7389,_0x12b29d){_0xbb7389=_0xbb7389-0x0;var _0x12537b=_0x1052[_0xbb7389];return _0x12537b;};'use strict';var _=require(_0x2105('0x0'));var util=require(_0x2105('0x1'));var moment=require(_0x2105('0x2'));var BPromise=require(_0x2105('0x3'));var rs=require(_0x2105('0x4'));var fs=require('fs');var Redis=require(_0x2105('0x5'));var db=require(_0x2105('0x6'))['db'];var utils=require(_0x2105('0x7'));var logger=require(_0x2105('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2105('0x9'));var client=jayson['client'][_0x2105('0xa')]({'port':0x232a});config[_0x2105('0xb')]=_['defaults'](config[_0x2105('0xb')],{'host':_0x2105('0xc'),'port':0x18eb});var socket=require(_0x2105('0xd'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x2105('0xe')](socket);function respondWithRpcPromise(_0x1ee90d,_0x39171e,_0x573d65){return new BPromise(function(_0x20e028,_0x42fe65){return client[_0x2105('0xf')](_0x1ee90d,_0x573d65)[_0x2105('0x10')](function(_0x4c7128){logger['info'](_0x2105('0x11'),_0x39171e,_0x2105('0x12'));logger[_0x2105('0x13')](_0x2105('0x14'),_0x39171e,_0x2105('0x12'),JSON[_0x2105('0x15')](_0x4c7128));if(_0x4c7128[_0x2105('0x16')]){if(_0x4c7128[_0x2105('0x16')][_0x2105('0x17')]===0x1f4){logger[_0x2105('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x39171e,_0x4c7128[_0x2105('0x16')][_0x2105('0x18')]);return _0x42fe65(_0x4c7128[_0x2105('0x16')][_0x2105('0x18')]);}logger['error'](_0x2105('0x11'),_0x39171e,_0x4c7128[_0x2105('0x16')][_0x2105('0x18')]);return _0x20e028(_0x4c7128[_0x2105('0x16')][_0x2105('0x18')]);}else{logger['info'](_0x2105('0x11'),_0x39171e,_0x2105('0x12'));_0x20e028(_0x4c7128['result'][_0x2105('0x18')]);}})[_0x2105('0x19')](function(_0x10243a){logger[_0x2105('0x16')](_0x2105('0x11'),_0x39171e,_0x10243a);_0x42fe65(_0x10243a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 274c1a8..2ffbb1f 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 _0xd403=['update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x2224f0,_0x5a3253){var _0x4c2aac=function(_0xe32873){while(--_0xe32873){_0x2224f0['push'](_0x2224f0['shift']());}};_0x4c2aac(++_0x5a3253);}(_0xd403,0xbe));var _0x3d40=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xd403[_0x525c7b];return _0x27b33e;};'use strict';var ChatInternalMessageEvents=require(_0x3d40('0x0'));var events=[_0x3d40('0x1'),'remove',_0x3d40('0x2')];function createListener(_0xe152d6,_0x5dc3d1){return function(_0x362ea3){_0x5dc3d1[_0x3d40('0x3')](_0xe152d6,_0x362ea3);};}function removeListener(_0x2b3dc9,_0x1272ca){return function(){ChatInternalMessageEvents[_0x3d40('0x4')](_0x2b3dc9,_0x1272ca);};}exports[_0x3d40('0x5')]=function(_0x40fe68){for(var _0x29b4c8=0x0,_0x524034=events[_0x3d40('0x6')];_0x29b4c8<_0x524034;_0x29b4c8++){var _0x2f6f52=events[_0x29b4c8];var _0x3da2d3=createListener(_0x3d40('0x7')+_0x2f6f52,_0x40fe68);ChatInternalMessageEvents['on'](_0x2f6f52,_0x3da2d3);}};
\ No newline at end of file
+var _0xc0a8=['update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x23ca3a,_0xe44c43){var _0x5c1aab=function(_0x29bcdd){while(--_0x29bcdd){_0x23ca3a['push'](_0x23ca3a['shift']());}};_0x5c1aab(++_0xe44c43);}(_0xc0a8,0x10e));var _0x8c0a=function(_0x219e61,_0x23c6ed){_0x219e61=_0x219e61-0x0;var _0x38f7de=_0xc0a8[_0x219e61];return _0x38f7de;};'use strict';var ChatInternalMessageEvents=require(_0x8c0a('0x0'));var events=[_0x8c0a('0x1'),'remove',_0x8c0a('0x2')];function createListener(_0x4b1de9,_0x339173){return function(_0x52d998){_0x339173[_0x8c0a('0x3')](_0x4b1de9,_0x52d998);};}function removeListener(_0x2faa03,_0x291fff){return function(){ChatInternalMessageEvents[_0x8c0a('0x4')](_0x2faa03,_0x291fff);};}exports[_0x8c0a('0x5')]=function(_0x1bfdf8){for(var _0x342718=0x0,_0xf67d44=events[_0x8c0a('0x6')];_0x342718<_0xf67d44;_0x342718++){var _0x4cddae=events[_0x342718];var _0x142b47=createListener(_0x8c0a('0x7')+_0x4cddae,_0x1bfdf8);ChatInternalMessageEvents['on'](_0x4cddae,_0x142b47);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 953fc95..ce900be 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 _0x3af7=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','getUsers','/:id','show','post','create','put','delete','destroy','util'];(function(_0x3c3cf3,_0x3e1092){var _0xcd152b=function(_0x49600f){while(--_0x49600f){_0x3c3cf3['push'](_0x3c3cf3['shift']());}};_0xcd152b(++_0x3e1092);}(_0x3af7,0x1cd));var _0x73af=function(_0x147ece,_0x12c09c){_0x147ece=_0x147ece-0x0;var _0x2d0bcb=_0x3af7[_0x147ece];return _0x2d0bcb;};'use strict';var multer=require('multer');var util=require(_0x73af('0x0'));var path=require(_0x73af('0x1'));var timeout=require(_0x73af('0x2'));var express=require(_0x73af('0x3'));var router=express[_0x73af('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x73af('0x5'));var interaction=require(_0x73af('0x6'));var config=require(_0x73af('0x7'));var controller=require(_0x73af('0x8'));router[_0x73af('0x9')]('/',auth[_0x73af('0xa')](),controller[_0x73af('0xb')]);router[_0x73af('0x9')]('/describe',auth[_0x73af('0xa')](),controller[_0x73af('0xc')]);router[_0x73af('0x9')]('/users',auth['isAuthenticated'](),controller[_0x73af('0xd')]);router[_0x73af('0x9')](_0x73af('0xe'),auth['isAuthenticated'](),controller[_0x73af('0xf')]);router[_0x73af('0x10')]('/',auth[_0x73af('0xa')](),controller[_0x73af('0x11')]);router[_0x73af('0x12')](_0x73af('0xe'),controller['update']);router[_0x73af('0x13')](_0x73af('0xe'),auth[_0x73af('0xa')](),controller[_0x73af('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xd31d=['get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','post','create','put','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x15240b,_0x38dcd6){var _0x264cfe=function(_0x5ad394){while(--_0x5ad394){_0x15240b['push'](_0x15240b['shift']());}};_0x264cfe(++_0x38dcd6);}(_0xd31d,0x1da));var _0xdd31=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xd31d[_0x35d4e9];return _0x5c2770;};'use strict';var multer=require(_0xdd31('0x0'));var util=require(_0xdd31('0x1'));var path=require(_0xdd31('0x2'));var timeout=require(_0xdd31('0x3'));var express=require(_0xdd31('0x4'));var router=express['Router']();var fs_extra=require(_0xdd31('0x5'));var auth=require(_0xdd31('0x6'));var interaction=require(_0xdd31('0x7'));var config=require(_0xdd31('0x8'));var controller=require(_0xdd31('0x9'));router[_0xdd31('0xa')]('/',auth[_0xdd31('0xb')](),controller[_0xdd31('0xc')]);router[_0xdd31('0xa')](_0xdd31('0xd'),auth[_0xdd31('0xb')](),controller['describe']);router[_0xdd31('0xa')](_0xdd31('0xe'),auth[_0xdd31('0xb')](),controller[_0xdd31('0xf')]);router[_0xdd31('0xa')](_0xdd31('0x10'),auth[_0xdd31('0xb')](),controller[_0xdd31('0x11')]);router[_0xdd31('0x12')]('/',auth['isAuthenticated'](),controller[_0xdd31('0x13')]);router[_0xdd31('0x14')](_0xdd31('0x10'),controller['update']);router['delete']('/:id',auth[_0xdd31('0xb')](),controller['destroy']);module[_0xdd31('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 738c7a8..90390be 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 _0xc06d=['BOOLEAN','ENUM','DATE','sequelize','exports','TEXT','medium'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xc06d,0x15a));var _0xdc06=function(_0x175b18,_0x4cc1f3){_0x175b18=_0x175b18-0x0;var _0x1e0702=_0xc06d[_0x175b18];return _0x1e0702;};'use strict';var Sequelize=require(_0xdc06('0x0'));module[_0xdc06('0x1')]={'body':{'type':Sequelize[_0xdc06('0x2')](_0xdc06('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xdc06('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xdc06('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xdc06('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdc06('0x2')]}};
\ No newline at end of file
+var _0xb2af=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb2af,0xd2));var _0xfb2a=function(_0x45bcfb,_0x2f0780){_0x45bcfb=_0x45bcfb-0x0;var _0x271599=_0xb2af[_0x45bcfb];return _0x271599;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'body':{'type':Sequelize[_0xfb2a('0x2')](_0xfb2a('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xfb2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfb2a('0x5')]('in',_0xfb2a('0x6')),'defaultValue':_0xfb2a('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfb2a('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfb2a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 64cf235..4814a08 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 _0x465f=['includeAll','include','findAll','show','params','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','update','isNil','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','SELECT','fullname','motionChannel','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','stack','name','send','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','VIRTUAL','merge','where'];(function(_0x2123d2,_0x2b4976){var _0x3c549e=function(_0x2a539a){while(--_0x2a539a){_0x2123d2['push'](_0x2123d2['shift']());}};_0x3c549e(++_0x2b4976);}(_0x465f,0x13f));var _0xf465=function(_0x10c3fc,_0x342c3e){_0x10c3fc=_0x10c3fc-0x0;var _0x3515bb=_0x465f[_0x10c3fc];return _0x3515bb;};'use strict';var emlformat=require(_0xf465('0x0'));var rimraf=require(_0xf465('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf465('0x2'));var rp=require(_0xf465('0x3'));var moment=require('moment');var BPromise=require(_0xf465('0x4'));var Mustache=require('mustache');var util=require(_0xf465('0x5'));var path=require(_0xf465('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf465('0x7'));var fs=require('fs');var fs_extra=require(_0xf465('0x8'));var _=require(_0xf465('0x9'));var squel=require(_0xf465('0xa'));var crypto=require(_0xf465('0xb'));var jsforce=require(_0xf465('0xc'));var deskjs=require(_0xf465('0xd'));var toCsv=require(_0xf465('0xe'));var querystring=require(_0xf465('0xf'));var Papa=require(_0xf465('0x10'));var Redis=require(_0xf465('0x11'));var authService=require(_0xf465('0x12'));var qs=require(_0xf465('0x13'));var as=require(_0xf465('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf465('0x15'))(_0xf465('0x16'));var utils=require(_0xf465('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf465('0x18'));var db=require('../../mysqldb')['db'];config[_0xf465('0x19')]=_[_0xf465('0x1a')](config[_0xf465('0x19')],{'host':_0xf465('0x1b'),'port':0x18eb});var socket=require(_0xf465('0x1c'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xf465('0x1d'));var client=jayson[_0xf465('0x1e')][_0xf465('0x1f')]({'port':0x232c});var client9002=jayson[_0xf465('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e2707,_0xe47e8c,_0x5af046,_0x4e9c0d){return new BPromise(function(_0x230307,_0x227e9c){var _0x457caa=_0x4e9c0d||client;return _0x457caa['request'](_0x4e2707,_0x5af046)[_0xf465('0x20')](function(_0x45a23d){logger['info'](_0xf465('0x21'),_0xe47e8c,_0xf465('0x22'));logger[_0xf465('0x23')](_0xf465('0x24'),_0xe47e8c,'request\x20sent',JSON[_0xf465('0x25')](_0x45a23d));if(_0x45a23d[_0xf465('0x26')]){if(_0x45a23d[_0xf465('0x26')][_0xf465('0x27')]===0x1f4){logger[_0xf465('0x26')](_0xf465('0x21'),_0xe47e8c,_0x45a23d[_0xf465('0x26')]['message']);return _0x227e9c(_0x45a23d[_0xf465('0x26')][_0xf465('0x28')]);}logger[_0xf465('0x26')](_0xf465('0x21'),_0xe47e8c,_0x45a23d[_0xf465('0x26')]['message']);return _0x230307(_0x45a23d[_0xf465('0x26')][_0xf465('0x28')]);}else{logger[_0xf465('0x29')](_0xf465('0x21'),_0xe47e8c,_0xf465('0x22'));_0x230307(_0x45a23d[_0xf465('0x2a')]['message']);}})[_0xf465('0x2b')](function(_0x2405af){logger['error'](_0xf465('0x21'),_0xe47e8c,_0x2405af);_0x227e9c(_0x2405af);});});}function respondWithStatusCode(_0x5c6d17,_0x41a83f){_0x41a83f=_0x41a83f||0xcc;return function(_0x2167ca){if(_0x2167ca){return _0x5c6d17[_0xf465('0x2c')](_0x41a83f);}return _0x5c6d17[_0xf465('0x2d')](_0x41a83f)['end']();};}function respondWithResult(_0x4f72b9,_0x725457){_0x725457=_0x725457||0xc8;return function(_0xb75797){if(_0xb75797){return _0x4f72b9[_0xf465('0x2d')](_0x725457)[_0xf465('0x2e')](_0xb75797);}};}function respondWithFilteredResult(_0x5b0b17,_0x408c8d){return function(_0x14c4ad){if(_0x14c4ad){var _0x5b3eab=typeof _0x408c8d[_0xf465('0x2f')]==='undefined'&&typeof _0x408c8d['limit']===_0xf465('0x30');var _0x3abff3=_0x14c4ad[_0xf465('0x31')];var _0x35bb23=_0x5b3eab?0x0:_0x408c8d[_0xf465('0x2f')];var _0x4ef699=_0x5b3eab?_0x14c4ad[_0xf465('0x31')]:_0x408c8d[_0xf465('0x2f')]+_0x408c8d[_0xf465('0x32')];var _0x132005;if(_0x4ef699>=_0x3abff3){_0x4ef699=_0x3abff3;_0x132005=0xc8;}else{_0x132005=0xce;}_0x5b0b17['status'](_0x132005);return _0x5b0b17['set'](_0xf465('0x33'),_0x35bb23+'-'+_0x4ef699+'/'+_0x3abff3)[_0xf465('0x2e')](_0x14c4ad);}return null;};}function patchUpdates(_0x4d243b){return function(_0x3798f7){try{jsonpatch[_0xf465('0x34')](_0x3798f7,_0x4d243b,!![]);}catch(_0x4724c1){return BPromise[_0xf465('0x35')](_0x4724c1);}return _0x3798f7[_0xf465('0x36')]();};}function saveUpdates(_0x25cb23,_0x1aa85d){return function(_0x563df1){if(_0x563df1){return _0x563df1['update'](_0x25cb23)[_0xf465('0x20')](function(_0x598c9b){return _0x598c9b;});}return null;};}function removeEntity(_0x2f71c2,_0x2e4ad9){return function(_0x18bb78){if(_0x18bb78){return _0x18bb78['destroy']()[_0xf465('0x20')](function(){_0x2f71c2[_0xf465('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4246ba,_0x14bf97){return function(_0x314a02){if(!_0x314a02){_0x4246ba[_0xf465('0x2c')](0x194);}return _0x314a02;};}function handleError(_0x373f15,_0x475325){_0x475325=_0x475325||0x1f4;return function(_0x25edee){logger[_0xf465('0x26')](_0x25edee[_0xf465('0x37')]);if(_0x25edee[_0xf465('0x38')]){delete _0x25edee[_0xf465('0x38')];}_0x373f15['status'](_0x475325)[_0xf465('0x39')](_0x25edee);};}exports['index']=function(_0x38565c,_0x13d981){var _0x461a0e={},_0x2f8ce9={},_0x33ab69={'count':0x0,'rows':[]};var _0x93267b=_[_0xf465('0x3a')](db[_0xf465('0x3b')][_0xf465('0x3c')],function(_0xaf4005){return{'name':_0xaf4005['fieldName'],'type':_0xaf4005[_0xf465('0x3d')][_0xf465('0x3e')]};});_0x2f8ce9[_0xf465('0x3f')]=_['map'](_0x93267b,_0xf465('0x38'));_0x2f8ce9[_0xf465('0x40')]=_[_0xf465('0x41')](_0x38565c[_0xf465('0x40')]);_0x2f8ce9[_0xf465('0x42')]=_[_0xf465('0x43')](_0x2f8ce9[_0xf465('0x3f')],_0x2f8ce9[_0xf465('0x40')]);_0x461a0e[_0xf465('0x44')]=_['intersection'](_0x2f8ce9['model'],qs['fields'](_0x38565c[_0xf465('0x40')][_0xf465('0x45')]));_0x461a0e[_0xf465('0x44')]=_0x461a0e['attributes'][_0xf465('0x46')]?_0x461a0e[_0xf465('0x44')]:_0x2f8ce9[_0xf465('0x3f')];if(!_0x38565c[_0xf465('0x40')][_0xf465('0x47')](_0xf465('0x48'))){_0x461a0e[_0xf465('0x32')]=qs['limit'](_0x38565c[_0xf465('0x40')][_0xf465('0x32')]);_0x461a0e['offset']=qs['offset'](_0x38565c[_0xf465('0x40')][_0xf465('0x2f')]);}_0x461a0e[_0xf465('0x49')]=qs[_0xf465('0x4a')](_0x38565c[_0xf465('0x40')][_0xf465('0x4a')]);_0x461a0e['where']=qs[_0xf465('0x42')](_[_0xf465('0x4b')](_0x38565c['query'],_0x2f8ce9[_0xf465('0x42')]),_0x93267b);if(_0x38565c[_0xf465('0x40')][_0xf465('0x4c')]){_0x461a0e['where']=_['merge'](_0x461a0e['where'],{'$or':_['map'](_0x93267b,function(_0x290408){if(_0x290408[_0xf465('0x3d')]!==_0xf465('0x4d')){var _0x1465af={};_0x1465af[_0x290408['name']]={'$like':'%'+_0x38565c[_0xf465('0x40')][_0xf465('0x4c')]+'%'};return _0x1465af;}})});}_0x461a0e=_[_0xf465('0x4e')]({},_0x461a0e,_0x38565c['options']);var _0xf4666={'where':_0x461a0e[_0xf465('0x4f')]};return db[_0xf465('0x3b')][_0xf465('0x31')](_0xf4666)['then'](function(_0x1e46d){_0x33ab69['count']=_0x1e46d;if(_0x38565c[_0xf465('0x40')][_0xf465('0x50')]){_0x461a0e[_0xf465('0x51')]=[{'all':!![]}];}return db[_0xf465('0x3b')][_0xf465('0x52')](_0x461a0e);})['then'](function(_0x48d31d){_0x33ab69['rows']=_0x48d31d;return _0x33ab69;})[_0xf465('0x20')](respondWithFilteredResult(_0x13d981,_0x461a0e))[_0xf465('0x2b')](handleError(_0x13d981,null));};exports[_0xf465('0x53')]=function(_0x522e4d,_0x34c92e){var _0x315ec8={'raw':!![],'where':{'id':_0x522e4d[_0xf465('0x54')]['id']}},_0xe465c6={};_0xe465c6['model']=_[_0xf465('0x41')](db[_0xf465('0x3b')][_0xf465('0x3c')]);_0xe465c6[_0xf465('0x40')]=_['keys'](_0x522e4d[_0xf465('0x40')]);_0xe465c6[_0xf465('0x42')]=_[_0xf465('0x43')](_0xe465c6[_0xf465('0x3f')],_0xe465c6[_0xf465('0x40')]);_0x315ec8['attributes']=_['intersection'](_0xe465c6[_0xf465('0x3f')],qs['fields'](_0x522e4d['query']['fields']));_0x315ec8[_0xf465('0x44')]=_0x315ec8['attributes']['length']?_0x315ec8[_0xf465('0x44')]:_0xe465c6[_0xf465('0x3f')];if(_0x522e4d['query'][_0xf465('0x50')]){_0x315ec8[_0xf465('0x51')]=[{'all':!![]}];}_0x315ec8=_[_0xf465('0x4e')]({},_0x315ec8,_0x522e4d['options']);return db[_0xf465('0x3b')]['find'](_0x315ec8)[_0xf465('0x20')](handleEntityNotFound(_0x34c92e,null))[_0xf465('0x20')](respondWithResult(_0x34c92e,null))[_0xf465('0x2b')](handleError(_0x34c92e,null));};exports[_0xf465('0x55')]=function(_0x18c0be,_0x1efa96){return db[_0xf465('0x3b')][_0xf465('0x55')](_0x18c0be[_0xf465('0x56')],{})['then'](respondWithResult(_0x1efa96,0xc9))['catch'](handleError(_0x1efa96,null));};exports['update']=function(_0x185de9,_0x41fab2){if(_0x185de9[_0xf465('0x56')]['id']){delete _0x185de9['body']['id'];}return db[_0xf465('0x3b')][_0xf465('0x57')]({'where':{'id':_0x185de9[_0xf465('0x54')]['id']}})['then'](handleEntityNotFound(_0x41fab2,null))[_0xf465('0x20')](saveUpdates(_0x185de9[_0xf465('0x56')],null))['then'](respondWithResult(_0x41fab2,null))[_0xf465('0x2b')](handleError(_0x41fab2,null));};exports['destroy']=function(_0x365a3d,_0x2e070a){return db[_0xf465('0x3b')][_0xf465('0x57')]({'where':{'id':_0x365a3d[_0xf465('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e070a,null))['then'](removeEntity(_0x2e070a,null))[_0xf465('0x2b')](handleError(_0x2e070a,null));};exports[_0xf465('0x58')]=function(_0xddcbd1,_0xccb2c5){return db['ChatMessage'][_0xf465('0x58')]()[_0xf465('0x20')](respondWithResult(_0xccb2c5,null))[_0xf465('0x2b')](handleError(_0xccb2c5,null));};var interaction_log=require('../../config/logger')(_0xf465('0x59'));exports[_0xf465('0x5a')]=function(_0x341de5,_0x4c82d6,_0x43f0ed){var _0x2ebb70={'agent':{},'channel':_0xf465('0x5b')};if(_0x341de5[_0xf465('0x56')]['id']){delete _0x341de5[_0xf465('0x56')]['id'];}_0x341de5['body'][_0xf465('0x5c')]=!![];_0x341de5[_0xf465('0x56')][_0xf465('0x5d')]=moment()[_0xf465('0x5e')](_0xf465('0x5f'));_0x341de5['body']['UserId']=_0x341de5[_0xf465('0x56')][_0xf465('0x60')]||_0x341de5[_0xf465('0x61')]['id'];_0x2ebb70[_0xf465('0x62')]['id']=_0x341de5['body'][_0xf465('0x60')];return db['ChatMessage']['find']({'where':{'id':_0x341de5['params']['id'],'UserId':null}})[_0xf465('0x20')](handleEntityNotFound(_0x4c82d6,null))['then'](saveUpdates(_0x341de5['body'],null))[_0xf465('0x20')](function(_0x1e77dc){if(_0x1e77dc){_0x2ebb70[_0xf465('0x28')]=_0x1e77dc[_0xf465('0x63')]({'plain':!![]});return db['ChatInteraction'][_0xf465('0x57')]({'where':{'id':_0x1e77dc[_0xf465('0x64')]}});}return null;})[_0xf465('0x20')](handleEntityNotFound(_0x4c82d6,null))['then'](function(_0x31f526){if(_0x31f526){return _0x31f526[_0xf465('0x65')]({'UserId':_0x341de5[_0xf465('0x56')][_0xf465('0x60')],'read1stAt':_[_0xf465('0x66')](_0x31f526['read1stAt'])?moment()[_0xf465('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf465('0x20')](function(_0x47b6c5){if(_0x47b6c5){_0x2ebb70[_0xf465('0x67')]=_0x47b6c5[_0xf465('0x63')]({'plain':!![]});interaction_log[_0xf465('0x29')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x341de5[_0xf465('0x61')]['id'],_0x341de5['user'][_0xf465('0x38')],_0x341de5['user'][_0xf465('0x68')],_0x2ebb70[_0xf465('0x67')]['id'],_0x341de5['body']?JSON[_0xf465('0x25')](_0x341de5[_0xf465('0x56')]):_0xf465('0x69'));return respondWithRpcPromise(_0xf465('0x6a'),'acceptMessage',_0x2ebb70);}return null;})[_0xf465('0x20')](function(_0x4c9501){var _0x1aa3db=_0xf465('0x6b')+_0x4c9501[_0xf465('0x28')][_0xf465('0x6c')];return db['sequelize'][_0xf465('0x40')](_0x1aa3db,{'type':db[_0xf465('0x6d')][_0xf465('0x6e')]['SELECT'],'raw':!![]})[_0xf465('0x20')](function(_0x42363f){return _0x42363f;});})[_0xf465('0x20')](function(_0x15bcff){if(_0x15bcff){_0x2ebb70[_0xf465('0x28')][_0xf465('0x6f')]=_0x15bcff[0x0];if(!_0x341de5['body'][_0xf465('0x60')])return;return db[_0xf465('0x70')]['find']({'where':{'id':_0x341de5['body'][_0xf465('0x60')],'role':_0xf465('0x62')},'attributes':['id',_0xf465('0x38'),'fullname',_0xf465('0x71'),_0xf465('0x72')],'raw':!![]});}return null;})['then'](function(_0x4b09ea){if(!_0x4b09ea)return null;_0x2ebb70[_0xf465('0x28')][_0xf465('0x62')]=_0x4b09ea;return _0x2ebb70;})[_0xf465('0x20')](function(_0x1a1eab){if(_0x1a1eab){if(_0x341de5['body'][_0xf465('0x73')]){_0x2ebb70[_0xf465('0x28')][_0xf465('0x74')]=util[_0xf465('0x5e')](_0xf465('0x75'),_0x341de5[_0xf465('0x61')][_0xf465('0x38')]);_0x2ebb70[_0xf465('0x28')][_0xf465('0x76')]=_0x2ebb70['channel'];_0x2ebb70[_0xf465('0x28')]['motionChannel']=_0x2ebb70[_0xf465('0x76')];_0x2ebb70[_0xf465('0x28')][_0xf465('0x77')]=_0xf465('0x5a');return respondWithRpcPromise(_0xf465('0x78'),_0xf465('0x78'),{'event':_0xf465('0x79'),'message':_[_0xf465('0x4e')](_0x2ebb70[_0xf465('0x28')],JSON[_0xf465('0x7a')](_0x2ebb70['interaction'][_0xf465('0x7b')]))},client9002)['then'](function(){return _0x2ebb70;});}return _0x2ebb70;}return null;})['then'](respondWithResult(_0x4c82d6,null))[_0xf465('0x2b')](handleError(_0x4c82d6,null));};var interaction_log=require('../../config/logger')(_0xf465('0x59'));exports[_0xf465('0x35')]=function(_0x1aadca,_0x4bc62a,_0x5a891d){var _0x3b11d7={'agent':{},'channel':'chat'};if(_0x1aadca[_0xf465('0x56')]['id']){delete _0x1aadca['body']['id'];}_0x1aadca['body'][_0xf465('0x60')]=_0x1aadca[_0xf465('0x56')][_0xf465('0x60')]||_0x1aadca[_0xf465('0x61')]['id'];_0x3b11d7[_0xf465('0x62')]['id']=_0x1aadca[_0xf465('0x56')][_0xf465('0x60')];return db['ChatMessage'][_0xf465('0x57')]({'where':{'id':_0x1aadca[_0xf465('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4bc62a,null))[_0xf465('0x20')](function(_0x170d45){if(_0x170d45){_0x3b11d7['message']=_0x170d45[_0xf465('0x63')]({'plain':!![]});return db[_0xf465('0x7c')][_0xf465('0x57')]({'where':{'id':_0x170d45[_0xf465('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x4bc62a,null))[_0xf465('0x20')](function(_0x31e714){if(_0x31e714){_0x3b11d7[_0xf465('0x67')]=_0x31e714['get']({'plain':!![]});interaction_log['info'](_0xf465('0x7d'),_0x1aadca[_0xf465('0x61')]['id'],_0x1aadca[_0xf465('0x61')][_0xf465('0x38')],_0x1aadca[_0xf465('0x61')]['role'],_0x3b11d7['interaction']['id'],_0x1aadca[_0xf465('0x56')]?JSON[_0xf465('0x25')](_0x1aadca[_0xf465('0x56')]):'null');return respondWithRpcPromise(_0xf465('0x7e'),_0xf465('0x7f'),_0x3b11d7);}return null;})[_0xf465('0x20')](function(_0x5344fd){var _0x147d88=_0xf465('0x6b')+_0x5344fd[_0xf465('0x28')][_0xf465('0x6c')];return db[_0xf465('0x80')][_0xf465('0x40')](_0x147d88,{'type':db[_0xf465('0x6d')][_0xf465('0x6e')][_0xf465('0x81')],'raw':!![]})[_0xf465('0x20')](function(_0x4c8c8b){return _0x4c8c8b;});})['then'](function(_0x170b01){if(_0x170b01){_0x3b11d7[_0xf465('0x28')][_0xf465('0x6f')]=_0x170b01[0x0];if(!_0x1aadca[_0xf465('0x56')][_0xf465('0x60')])return;return db['User'][_0xf465('0x57')]({'where':{'id':_0x1aadca[_0xf465('0x56')]['UserId'],'role':_0xf465('0x62')},'attributes':['id',_0xf465('0x38'),_0xf465('0x82'),_0xf465('0x71'),'internal'],'raw':!![]});}return null;})[_0xf465('0x20')](function(_0x5c5c40){if(!_0x5c5c40)return null;_0x3b11d7[_0xf465('0x28')][_0xf465('0x62')]=_0x5c5c40;return _0x3b11d7;})[_0xf465('0x20')](function(_0x19b7eb){if(_0x19b7eb){_0x19b7eb[_0xf465('0x28')][_0xf465('0x74')]=util[_0xf465('0x5e')]('SIP/%s',_0x1aadca[_0xf465('0x61')]['name']);_0x19b7eb[_0xf465('0x28')][_0xf465('0x76')]=_0x3b11d7['channel'];_0x19b7eb['message'][_0xf465('0x83')]=_0x3b11d7[_0xf465('0x76')];_0x19b7eb[_0xf465('0x28')][_0xf465('0x77')]=_0xf465('0x35');respondWithRpcPromise(_0xf465('0x78'),_0xf465('0x78'),{'event':_0xf465('0x84'),'message':_[_0xf465('0x4e')](_0x3b11d7[_0xf465('0x28')],JSON['parse'](_0x3b11d7[_0xf465('0x67')][_0xf465('0x7b')]))},client9002);return _0x3b11d7;}return null;})[_0xf465('0x20')](respondWithResult(_0x4bc62a,null))[_0xf465('0x2b')](handleError(_0x4bc62a,null));};
\ No newline at end of file
+var _0xd91c=['pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','../../config/logger','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','chat','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','QueryTypes','interface','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0xd36736,_0x48433a){var _0x5889d4=function(_0x58b286){while(--_0x58b286){_0xd36736['push'](_0xd36736['shift']());}};_0x5889d4(++_0x48433a);}(_0xd91c,0x159));var _0xcd91=function(_0x200396,_0x1fa29e){_0x200396=_0x200396-0x0;var _0x1ef7ce=_0xd91c[_0x200396];return _0x1ef7ce;};'use strict';var emlformat=require(_0xcd91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd91('0x1'));var jsonpatch=require(_0xcd91('0x2'));var rp=require(_0xcd91('0x3'));var moment=require(_0xcd91('0x4'));var BPromise=require(_0xcd91('0x5'));var Mustache=require(_0xcd91('0x6'));var util=require('util');var path=require(_0xcd91('0x7'));var sox=require(_0xcd91('0x8'));var csv=require(_0xcd91('0x9'));var ejs=require(_0xcd91('0xa'));var fs=require('fs');var fs_extra=require(_0xcd91('0xb'));var _=require(_0xcd91('0xc'));var squel=require(_0xcd91('0xd'));var crypto=require(_0xcd91('0xe'));var jsforce=require(_0xcd91('0xf'));var deskjs=require(_0xcd91('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcd91('0x11'));var Papa=require(_0xcd91('0x12'));var Redis=require(_0xcd91('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcd91('0x14'));var as=require(_0xcd91('0x15'));var hardwareService=require(_0xcd91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xcd91('0x17'));var config=require(_0xcd91('0x18'));var licenseUtil=require(_0xcd91('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xcd91('0x1a')],{'host':_0xcd91('0x1b'),'port':0x18eb});var socket=require(_0xcd91('0x1c'))(new Redis(config['redis']));require(_0xcd91('0x1d'))[_0xcd91('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xcd91('0x1f')][_0xcd91('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x15cefd,_0x201f56,_0x51fefd,_0x27aacf){return new BPromise(function(_0x4b87c3,_0x115d97){var _0x10b6d8=_0x27aacf||client;return _0x10b6d8[_0xcd91('0x21')](_0x15cefd,_0x51fefd)[_0xcd91('0x22')](function(_0xca899a){logger[_0xcd91('0x23')](_0xcd91('0x24'),_0x201f56,'request\x20sent');logger[_0xcd91('0x25')](_0xcd91('0x26'),_0x201f56,_0xcd91('0x27'),JSON[_0xcd91('0x28')](_0xca899a));if(_0xca899a['error']){if(_0xca899a[_0xcd91('0x29')]['code']===0x1f4){logger['error'](_0xcd91('0x24'),_0x201f56,_0xca899a['error'][_0xcd91('0x2a')]);return _0x115d97(_0xca899a[_0xcd91('0x29')][_0xcd91('0x2a')]);}logger[_0xcd91('0x29')](_0xcd91('0x24'),_0x201f56,_0xca899a['error'][_0xcd91('0x2a')]);return _0x4b87c3(_0xca899a[_0xcd91('0x29')][_0xcd91('0x2a')]);}else{logger['info'](_0xcd91('0x24'),_0x201f56,'request\x20sent');_0x4b87c3(_0xca899a[_0xcd91('0x2b')][_0xcd91('0x2a')]);}})['catch'](function(_0x4b14d5){logger[_0xcd91('0x29')](_0xcd91('0x24'),_0x201f56,_0x4b14d5);_0x115d97(_0x4b14d5);});});}function respondWithStatusCode(_0xb31bd5,_0x21fa25){_0x21fa25=_0x21fa25||0xcc;return function(_0x145e25){if(_0x145e25){return _0xb31bd5[_0xcd91('0x2c')](_0x21fa25);}return _0xb31bd5[_0xcd91('0x2d')](_0x21fa25)[_0xcd91('0x2e')]();};}function respondWithResult(_0x5aa6b0,_0x14e16b){_0x14e16b=_0x14e16b||0xc8;return function(_0x4c3740){if(_0x4c3740){return _0x5aa6b0['status'](_0x14e16b)[_0xcd91('0x2f')](_0x4c3740);}};}function respondWithFilteredResult(_0x37965e,_0x57af76){return function(_0x55e08f){if(_0x55e08f){var _0x44898f=typeof _0x57af76[_0xcd91('0x30')]===_0xcd91('0x31')&&typeof _0x57af76[_0xcd91('0x32')]===_0xcd91('0x31');var _0x574160=_0x55e08f['count'];var _0x431d32=_0x44898f?0x0:_0x57af76[_0xcd91('0x30')];var _0x5df3d9=_0x44898f?_0x55e08f[_0xcd91('0x33')]:_0x57af76['offset']+_0x57af76[_0xcd91('0x32')];var _0xab0873;if(_0x5df3d9>=_0x574160){_0x5df3d9=_0x574160;_0xab0873=0xc8;}else{_0xab0873=0xce;}_0x37965e[_0xcd91('0x2d')](_0xab0873);return _0x37965e[_0xcd91('0x34')](_0xcd91('0x35'),_0x431d32+'-'+_0x5df3d9+'/'+_0x574160)[_0xcd91('0x2f')](_0x55e08f);}return null;};}function patchUpdates(_0x156934){return function(_0x51fd51){try{jsonpatch[_0xcd91('0x36')](_0x51fd51,_0x156934,!![]);}catch(_0x2f3152){return BPromise[_0xcd91('0x37')](_0x2f3152);}return _0x51fd51['save']();};}function saveUpdates(_0x107096,_0x563b02){return function(_0x3a0430){if(_0x3a0430){return _0x3a0430[_0xcd91('0x38')](_0x107096)[_0xcd91('0x22')](function(_0x405ccc){return _0x405ccc;});}return null;};}function removeEntity(_0x9c35d4,_0x54617e){return function(_0x55188c){if(_0x55188c){return _0x55188c[_0xcd91('0x39')]()[_0xcd91('0x22')](function(){_0x9c35d4[_0xcd91('0x2d')](0xcc)[_0xcd91('0x2e')]();});}};}function handleEntityNotFound(_0x2060f0,_0x51772c){return function(_0x4ee37b){if(!_0x4ee37b){_0x2060f0[_0xcd91('0x2c')](0x194);}return _0x4ee37b;};}function handleError(_0x5bf66c,_0x414371){_0x414371=_0x414371||0x1f4;return function(_0x3a2415){logger[_0xcd91('0x29')](_0x3a2415[_0xcd91('0x3a')]);if(_0x3a2415[_0xcd91('0x3b')]){delete _0x3a2415[_0xcd91('0x3b')];}_0x5bf66c[_0xcd91('0x2d')](_0x414371)[_0xcd91('0x3c')](_0x3a2415);};}exports[_0xcd91('0x3d')]=function(_0x8f3513,_0x4eb208){var _0x56e899={},_0x4e2d51={},_0x5d3647={'count':0x0,'rows':[]};var _0x4537fb=_['map'](db[_0xcd91('0x3e')][_0xcd91('0x3f')],function(_0x574d1c){return{'name':_0x574d1c[_0xcd91('0x40')],'type':_0x574d1c[_0xcd91('0x41')][_0xcd91('0x42')]};});_0x4e2d51[_0xcd91('0x43')]=_['map'](_0x4537fb,_0xcd91('0x3b'));_0x4e2d51[_0xcd91('0x44')]=_['keys'](_0x8f3513[_0xcd91('0x44')]);_0x4e2d51[_0xcd91('0x45')]=_[_0xcd91('0x46')](_0x4e2d51[_0xcd91('0x43')],_0x4e2d51[_0xcd91('0x44')]);_0x56e899[_0xcd91('0x47')]=_['intersection'](_0x4e2d51[_0xcd91('0x43')],qs[_0xcd91('0x48')](_0x8f3513['query']['fields']));_0x56e899[_0xcd91('0x47')]=_0x56e899[_0xcd91('0x47')][_0xcd91('0x49')]?_0x56e899[_0xcd91('0x47')]:_0x4e2d51[_0xcd91('0x43')];if(!_0x8f3513[_0xcd91('0x44')]['hasOwnProperty'](_0xcd91('0x4a'))){_0x56e899[_0xcd91('0x32')]=qs[_0xcd91('0x32')](_0x8f3513[_0xcd91('0x44')]['limit']);_0x56e899[_0xcd91('0x30')]=qs[_0xcd91('0x30')](_0x8f3513[_0xcd91('0x44')][_0xcd91('0x30')]);}_0x56e899[_0xcd91('0x4b')]=qs[_0xcd91('0x4c')](_0x8f3513[_0xcd91('0x44')]['sort']);_0x56e899[_0xcd91('0x4d')]=qs[_0xcd91('0x45')](_[_0xcd91('0x4e')](_0x8f3513[_0xcd91('0x44')],_0x4e2d51[_0xcd91('0x45')]),_0x4537fb);if(_0x8f3513['query'][_0xcd91('0x4f')]){_0x56e899['where']=_[_0xcd91('0x50')](_0x56e899['where'],{'$or':_[_0xcd91('0x51')](_0x4537fb,function(_0xe93b5a){if(_0xe93b5a[_0xcd91('0x41')]!==_0xcd91('0x52')){var _0x2e5887={};_0x2e5887[_0xe93b5a[_0xcd91('0x3b')]]={'$like':'%'+_0x8f3513[_0xcd91('0x44')][_0xcd91('0x4f')]+'%'};return _0x2e5887;}})});}_0x56e899=_['merge']({},_0x56e899,_0x8f3513['options']);var _0x48a343={'where':_0x56e899[_0xcd91('0x4d')]};return db['ChatMessage'][_0xcd91('0x33')](_0x48a343)['then'](function(_0x48d61e){_0x5d3647[_0xcd91('0x33')]=_0x48d61e;if(_0x8f3513[_0xcd91('0x44')][_0xcd91('0x53')]){_0x56e899[_0xcd91('0x54')]=[{'all':!![]}];}return db[_0xcd91('0x3e')][_0xcd91('0x55')](_0x56e899);})[_0xcd91('0x22')](function(_0x34b6ee){_0x5d3647[_0xcd91('0x56')]=_0x34b6ee;return _0x5d3647;})[_0xcd91('0x22')](respondWithFilteredResult(_0x4eb208,_0x56e899))[_0xcd91('0x57')](handleError(_0x4eb208,null));};exports[_0xcd91('0x58')]=function(_0x48801e,_0x384516){var _0x348a10={'raw':!![],'where':{'id':_0x48801e[_0xcd91('0x59')]['id']}},_0x139f2b={};_0x139f2b[_0xcd91('0x43')]=_[_0xcd91('0x5a')](db[_0xcd91('0x3e')][_0xcd91('0x3f')]);_0x139f2b[_0xcd91('0x44')]=_[_0xcd91('0x5a')](_0x48801e[_0xcd91('0x44')]);_0x139f2b[_0xcd91('0x45')]=_[_0xcd91('0x46')](_0x139f2b[_0xcd91('0x43')],_0x139f2b[_0xcd91('0x44')]);_0x348a10[_0xcd91('0x47')]=_[_0xcd91('0x46')](_0x139f2b[_0xcd91('0x43')],qs['fields'](_0x48801e[_0xcd91('0x44')]['fields']));_0x348a10[_0xcd91('0x47')]=_0x348a10[_0xcd91('0x47')][_0xcd91('0x49')]?_0x348a10['attributes']:_0x139f2b[_0xcd91('0x43')];if(_0x48801e[_0xcd91('0x44')]['includeAll']){_0x348a10[_0xcd91('0x54')]=[{'all':!![]}];}_0x348a10=_[_0xcd91('0x50')]({},_0x348a10,_0x48801e[_0xcd91('0x5b')]);return db['ChatMessage'][_0xcd91('0x5c')](_0x348a10)[_0xcd91('0x22')](handleEntityNotFound(_0x384516,null))[_0xcd91('0x22')](respondWithResult(_0x384516,null))[_0xcd91('0x57')](handleError(_0x384516,null));};exports[_0xcd91('0x5d')]=function(_0x23423e,_0xfc21a0){return db['ChatMessage'][_0xcd91('0x5d')](_0x23423e[_0xcd91('0x5e')],{})[_0xcd91('0x22')](respondWithResult(_0xfc21a0,0xc9))[_0xcd91('0x57')](handleError(_0xfc21a0,null));};exports[_0xcd91('0x38')]=function(_0x35abb5,_0x94b7cd){if(_0x35abb5[_0xcd91('0x5e')]['id']){delete _0x35abb5[_0xcd91('0x5e')]['id'];}return db['ChatMessage'][_0xcd91('0x5c')]({'where':{'id':_0x35abb5['params']['id']}})[_0xcd91('0x22')](handleEntityNotFound(_0x94b7cd,null))['then'](saveUpdates(_0x35abb5[_0xcd91('0x5e')],null))[_0xcd91('0x22')](respondWithResult(_0x94b7cd,null))[_0xcd91('0x57')](handleError(_0x94b7cd,null));};exports['destroy']=function(_0x1b2624,_0x3aaf2d){return db[_0xcd91('0x3e')][_0xcd91('0x5c')]({'where':{'id':_0x1b2624[_0xcd91('0x59')]['id']}})[_0xcd91('0x22')](handleEntityNotFound(_0x3aaf2d,null))[_0xcd91('0x22')](removeEntity(_0x3aaf2d,null))[_0xcd91('0x57')](handleError(_0x3aaf2d,null));};exports[_0xcd91('0x5f')]=function(_0x3890f0,_0x4355bd){return db[_0xcd91('0x3e')][_0xcd91('0x5f')]()[_0xcd91('0x22')](respondWithResult(_0x4355bd,null))[_0xcd91('0x57')](handleError(_0x4355bd,null));};var interaction_log=require(_0xcd91('0x60'))(_0xcd91('0x61'));exports['accept']=function(_0x384d24,_0x39030d,_0x70b5e6){var _0x4ff5e1={'agent':{},'channel':'chat'};if(_0x384d24[_0xcd91('0x5e')]['id']){delete _0x384d24[_0xcd91('0x5e')]['id'];}_0x384d24[_0xcd91('0x5e')][_0xcd91('0x62')]=!![];_0x384d24['body'][_0xcd91('0x63')]=moment()[_0xcd91('0x64')](_0xcd91('0x65'));_0x384d24[_0xcd91('0x5e')][_0xcd91('0x66')]=_0x384d24['body'][_0xcd91('0x66')]||_0x384d24[_0xcd91('0x67')]['id'];_0x4ff5e1[_0xcd91('0x68')]['id']=_0x384d24[_0xcd91('0x5e')][_0xcd91('0x66')];return db[_0xcd91('0x3e')]['find']({'where':{'id':_0x384d24['params']['id'],'UserId':null}})[_0xcd91('0x22')](handleEntityNotFound(_0x39030d,null))['then'](saveUpdates(_0x384d24[_0xcd91('0x5e')],null))[_0xcd91('0x22')](function(_0x574e42){if(_0x574e42){_0x4ff5e1[_0xcd91('0x2a')]=_0x574e42[_0xcd91('0x69')]({'plain':!![]});return db['ChatInteraction'][_0xcd91('0x5c')]({'where':{'id':_0x574e42[_0xcd91('0x6a')]}});}return null;})[_0xcd91('0x22')](handleEntityNotFound(_0x39030d,null))['then'](function(_0x4a651c){if(_0x4a651c){return _0x4a651c[_0xcd91('0x38')]({'UserId':_0x384d24[_0xcd91('0x5e')][_0xcd91('0x66')],'read1stAt':_[_0xcd91('0x6b')](_0x4a651c['read1stAt'])?moment()[_0xcd91('0x64')](_0xcd91('0x65')):undefined});}return null;})[_0xcd91('0x22')](function(_0x5940b0){if(_0x5940b0){_0x4ff5e1[_0xcd91('0x6c')]=_0x5940b0[_0xcd91('0x69')]({'plain':!![]});interaction_log[_0xcd91('0x23')](_0xcd91('0x6d'),_0x384d24[_0xcd91('0x67')]['id'],_0x384d24[_0xcd91('0x67')]['name'],_0x384d24['user'][_0xcd91('0x6e')],_0x4ff5e1[_0xcd91('0x6c')]['id'],_0x384d24[_0xcd91('0x5e')]?JSON[_0xcd91('0x28')](_0x384d24['body']):_0xcd91('0x6f'));return respondWithRpcPromise(_0xcd91('0x70'),_0xcd91('0x71'),_0x4ff5e1);}return null;})['then'](function(_0x5b61c1){var _0x4b1f2f=_0xcd91('0x72')+_0x5b61c1['message'][_0xcd91('0x73')];return db['sequelize'][_0xcd91('0x44')](_0x4b1f2f,{'type':db[_0xcd91('0x74')]['QueryTypes'][_0xcd91('0x75')],'raw':!![]})[_0xcd91('0x22')](function(_0x41034a){return _0x41034a;});})[_0xcd91('0x22')](function(_0x4ba26f){if(_0x4ba26f){_0x4ff5e1[_0xcd91('0x2a')][_0xcd91('0x76')]=_0x4ba26f[0x0];if(!_0x384d24[_0xcd91('0x5e')][_0xcd91('0x66')])return;return db[_0xcd91('0x77')]['find']({'where':{'id':_0x384d24['body'][_0xcd91('0x66')],'role':_0xcd91('0x68')},'attributes':['id',_0xcd91('0x3b'),_0xcd91('0x78'),_0xcd91('0x79'),_0xcd91('0x7a')],'raw':!![]});}return null;})[_0xcd91('0x22')](function(_0x4513a4){if(!_0x4513a4)return null;_0x4ff5e1[_0xcd91('0x2a')][_0xcd91('0x68')]=_0x4513a4;return _0x4ff5e1;})[_0xcd91('0x22')](function(_0x4d703c){if(_0x4d703c){if(_0x384d24[_0xcd91('0x5e')][_0xcd91('0x7b')]){_0x4ff5e1[_0xcd91('0x2a')]['interface']=util['format'](_0xcd91('0x7c'),_0x384d24[_0xcd91('0x67')][_0xcd91('0x3b')]);_0x4ff5e1[_0xcd91('0x2a')][_0xcd91('0x7d')]=_0x4ff5e1['channel'];_0x4ff5e1['message'][_0xcd91('0x7e')]=_0x4ff5e1[_0xcd91('0x7d')];_0x4ff5e1['message'][_0xcd91('0x7f')]=_0xcd91('0x80');return respondWithRpcPromise(_0xcd91('0x81'),_0xcd91('0x81'),{'event':_0xcd91('0x82'),'message':_[_0xcd91('0x50')](_0x4ff5e1[_0xcd91('0x2a')],JSON[_0xcd91('0x83')](_0x4ff5e1[_0xcd91('0x6c')][_0xcd91('0x84')]))},client9002)[_0xcd91('0x22')](function(){return _0x4ff5e1;});}return _0x4ff5e1;}return null;})['then'](respondWithResult(_0x39030d,null))['catch'](handleError(_0x39030d,null));};var interaction_log=require(_0xcd91('0x60'))(_0xcd91('0x61'));exports['reject']=function(_0x17788b,_0x290828,_0xcb0ede){var _0x33bdf7={'agent':{},'channel':_0xcd91('0x85')};if(_0x17788b['body']['id']){delete _0x17788b[_0xcd91('0x5e')]['id'];}_0x17788b[_0xcd91('0x5e')][_0xcd91('0x66')]=_0x17788b[_0xcd91('0x5e')][_0xcd91('0x66')]||_0x17788b[_0xcd91('0x67')]['id'];_0x33bdf7[_0xcd91('0x68')]['id']=_0x17788b[_0xcd91('0x5e')][_0xcd91('0x66')];return db[_0xcd91('0x3e')]['find']({'where':{'id':_0x17788b[_0xcd91('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x290828,null))['then'](function(_0x5b6d57){if(_0x5b6d57){_0x33bdf7[_0xcd91('0x2a')]=_0x5b6d57[_0xcd91('0x69')]({'plain':!![]});return db[_0xcd91('0x86')][_0xcd91('0x5c')]({'where':{'id':_0x5b6d57['ChatInteractionId']}});}return null;})[_0xcd91('0x22')](handleEntityNotFound(_0x290828,null))[_0xcd91('0x22')](function(_0x51aa16){if(_0x51aa16){_0x33bdf7[_0xcd91('0x6c')]=_0x51aa16[_0xcd91('0x69')]({'plain':!![]});interaction_log[_0xcd91('0x23')](_0xcd91('0x87'),_0x17788b[_0xcd91('0x67')]['id'],_0x17788b[_0xcd91('0x67')][_0xcd91('0x3b')],_0x17788b['user']['role'],_0x33bdf7[_0xcd91('0x6c')]['id'],_0x17788b[_0xcd91('0x5e')]?JSON[_0xcd91('0x28')](_0x17788b[_0xcd91('0x5e')]):_0xcd91('0x6f'));return respondWithRpcPromise('RejectMessage',_0xcd91('0x88'),_0x33bdf7);}return null;})[_0xcd91('0x22')](function(_0x3750c1){var _0x2a56c3=_0xcd91('0x72')+_0x3750c1['message']['ContactId'];return db[_0xcd91('0x89')]['query'](_0x2a56c3,{'type':db[_0xcd91('0x74')][_0xcd91('0x8a')][_0xcd91('0x75')],'raw':!![]})[_0xcd91('0x22')](function(_0x2ca9aa){return _0x2ca9aa;});})[_0xcd91('0x22')](function(_0x13c78a){if(_0x13c78a){_0x33bdf7[_0xcd91('0x2a')][_0xcd91('0x76')]=_0x13c78a[0x0];if(!_0x17788b[_0xcd91('0x5e')]['UserId'])return;return db[_0xcd91('0x77')]['find']({'where':{'id':_0x17788b['body'][_0xcd91('0x66')],'role':_0xcd91('0x68')},'attributes':['id',_0xcd91('0x3b'),_0xcd91('0x78'),_0xcd91('0x79'),_0xcd91('0x7a')],'raw':!![]});}return null;})[_0xcd91('0x22')](function(_0x5b64f2){if(!_0x5b64f2)return null;_0x33bdf7[_0xcd91('0x2a')][_0xcd91('0x68')]=_0x5b64f2;return _0x33bdf7;})[_0xcd91('0x22')](function(_0x37331c){if(_0x37331c){_0x37331c[_0xcd91('0x2a')][_0xcd91('0x8b')]=util[_0xcd91('0x64')]('SIP/%s',_0x17788b[_0xcd91('0x67')][_0xcd91('0x3b')]);_0x37331c[_0xcd91('0x2a')][_0xcd91('0x7d')]=_0x33bdf7[_0xcd91('0x7d')];_0x37331c[_0xcd91('0x2a')]['motionChannel']=_0x33bdf7[_0xcd91('0x7d')];_0x37331c[_0xcd91('0x2a')][_0xcd91('0x7f')]=_0xcd91('0x37');respondWithRpcPromise(_0xcd91('0x81'),_0xcd91('0x81'),{'event':_0xcd91('0x8c'),'message':_[_0xcd91('0x50')](_0x33bdf7[_0xcd91('0x2a')],JSON['parse'](_0x33bdf7[_0xcd91('0x6c')][_0xcd91('0x84')]))},client9002);return _0x33bdf7;}return null;})[_0xcd91('0x22')](respondWithResult(_0x290828,null))['catch'](handleError(_0x290828,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index cb79133..a9ec75f 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 _0xb04a=['emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xc941ea,_0x408c2e){var _0x3b0f27=function(_0x5a4233){while(--_0x5a4233){_0xc941ea['push'](_0xc941ea['shift']());}};_0x3b0f27(++_0x408c2e);}(_0xb04a,0x67));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xab04('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xab04('0x1')](0x0);var events={'afterCreate':_0xab04('0x2'),'afterUpdate':_0xab04('0x3'),'afterDestroy':_0xab04('0x4')};function emitEvent(_0x48112b){return function(_0x54a524,_0x24d857,_0x5d9fc2){ChatMessageEvents['emit'](_0x48112b+':'+_0x54a524['id'],_0x54a524);ChatMessageEvents[_0xab04('0x5')](_0x48112b,_0x54a524);_0x5d9fc2(null);};}for(var e in events){if(events[_0xab04('0x6')](e)){var event=events[e];ChatMessage[_0xab04('0x7')](e,emitEvent(event));}}module[_0xab04('0x8')]=ChatMessageEvents;
\ No newline at end of file
+var _0x721b=['emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x721b,0x150));var _0xb721=function(_0x5e1bc0,_0x1be942){_0x5e1bc0=_0x5e1bc0-0x0;var _0x24f992=_0x721b[_0x5e1bc0];return _0x24f992;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xb721('0x0'))['db'][_0xb721('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb721('0x2')](0x0);var events={'afterCreate':_0xb721('0x3'),'afterUpdate':_0xb721('0x4'),'afterDestroy':_0xb721('0x5')};function emitEvent(_0x2c1217){return function(_0x5e27ac,_0x25513e,_0x4b25e4){ChatMessageEvents[_0xb721('0x6')](_0x2c1217+':'+_0x5e27ac['id'],_0x5e27ac);ChatMessageEvents[_0xb721('0x6')](_0x2c1217,_0x5e27ac);_0x4b25e4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb721('0x7')](e,emitEvent(event));}}module[_0xb721('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index c5cb261..492cb5f 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 _0xe74d=['error','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','UserId','ChatInteraction','findOne','then','update','createdAt','catch'];(function(_0x2fb816,_0x1dadbb){var _0x557527=function(_0x461714){while(--_0x461714){_0x2fb816['push'](_0x2fb816['shift']());}};_0x557527(++_0x1dadbb);}(_0xe74d,0x16e));var _0xde74=function(_0x18d36f,_0x31b65f){_0x18d36f=_0x18d36f-0x0;var _0x10034d=_0xe74d[_0x18d36f];return _0x10034d;};'use strict';var _=require(_0xde74('0x0'));var util=require(_0xde74('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xde74('0x2'));var BPromise=require(_0xde74('0x3'));var rp=require(_0xde74('0x4'));var fs=require('fs');var path=require(_0xde74('0x5'));var rimraf=require('rimraf');var config=require(_0xde74('0x6'));var attributes=require(_0xde74('0x7'));module[_0xde74('0x8')]=function(_0x328c43,_0x4800a3){return _0x328c43[_0xde74('0x9')](_0xde74('0xa'),attributes,{'tableName':_0xde74('0xb'),'paranoid':![],'indexes':[{'name':_0xde74('0xc'),'fields':[_0xde74('0xd')],'type':_0xde74('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x27c148,_0x3e214e,_0x392082){var _0x146ecf=_0x328c43[_0xde74('0xf')];var _0x542f15=_0x27c148['get']({'plain':!![]});if(_0x542f15[_0xde74('0x10')][_0xde74('0x11')]()==='in'||_0x542f15[_0xde74('0x10')]['toLowerCase']()===_0xde74('0x12')&&!_0x542f15['secret']&&!_['isNil'](_0x542f15[_0xde74('0x13')])){_0x146ecf[_0xde74('0x14')][_0xde74('0x15')]({'where':{'id':_0x542f15['ChatInteractionId']}})[_0xde74('0x16')](function(_0x125c9b){if(_0x125c9b){_0x125c9b[_0xde74('0x17')]({'lastMsgAt':_0x542f15[_0xde74('0x18')],'lastMsgDirection':_0x542f15['direction']['toLowerCase']()});}})[_0xde74('0x19')](function(_0xa376){console[_0xde74('0x1a')](_0xa376);});}_0x392082();}},'charset':'utf8mb4','collate':_0xde74('0x1b')});};
\ No newline at end of file
+var _0xb439=['ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define'];(function(_0x2fa67e,_0x1fe7e0){var _0x56a2c9=function(_0x48fb59){while(--_0x48fb59){_0x2fa67e['push'](_0x2fa67e['shift']());}};_0x56a2c9(++_0x1fe7e0);}(_0xb439,0x87));var _0x9b43=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xb439[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x9b43('0x0'));var util=require(_0x9b43('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9b43('0x2'));var BPromise=require(_0x9b43('0x3'));var rp=require(_0x9b43('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b43('0x5'));var config=require(_0x9b43('0x6'));var attributes=require(_0x9b43('0x7'));module[_0x9b43('0x8')]=function(_0x3ab870,_0x3d2a05){return _0x3ab870[_0x9b43('0x9')](_0x9b43('0xa'),attributes,{'tableName':_0x9b43('0xb'),'paranoid':![],'indexes':[{'name':_0x9b43('0xc'),'fields':['body'],'type':_0x9b43('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x341492,_0x235503,_0x5d09d6){var _0x27b289=_0x3ab870[_0x9b43('0xe')];var _0x28c8be=_0x341492[_0x9b43('0xf')]({'plain':!![]});if(_0x28c8be[_0x9b43('0x10')][_0x9b43('0x11')]()==='in'||_0x28c8be[_0x9b43('0x10')][_0x9b43('0x11')]()==='out'&&!_0x28c8be[_0x9b43('0x12')]&&!_['isNil'](_0x28c8be[_0x9b43('0x13')])){_0x27b289[_0x9b43('0x14')][_0x9b43('0x15')]({'where':{'id':_0x28c8be['ChatInteractionId']}})[_0x9b43('0x16')](function(_0x470119){if(_0x470119){_0x470119[_0x9b43('0x17')]({'lastMsgAt':_0x28c8be[_0x9b43('0x18')],'lastMsgDirection':_0x28c8be[_0x9b43('0x10')][_0x9b43('0x11')]()});}})[_0x9b43('0x19')](function(_0x34678e){console[_0x9b43('0x1a')](_0x34678e);});}_0x5d09d6();}},'charset':_0x9b43('0x1b'),'collate':_0x9b43('0x1c')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index ab84721..ab00db7 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 _0x70d7=['then','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','CreateChatMessage','ChatMessage','options','raw','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x2a4246,_0xe98f2e){var _0x13d361=function(_0x4eacaa){while(--_0x4eacaa){_0x2a4246['push'](_0x2a4246['shift']());}};_0x13d361(++_0xe98f2e);}(_0x70d7,0x1ee));var _0x770d=function(_0x3978e9,_0x202fbf){_0x3978e9=_0x3978e9-0x0;var _0x4c6581=_0x70d7[_0x3978e9];return _0x4c6581;};'use strict';var _=require(_0x770d('0x0'));var util=require(_0x770d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x770d('0x2'));var fs=require('fs');var Redis=require(_0x770d('0x3'));var db=require(_0x770d('0x4'))['db'];var utils=require(_0x770d('0x5'));var logger=require(_0x770d('0x6'))(_0x770d('0x7'));var config=require('../../config/environment');var jayson=require(_0x770d('0x8'));var client=jayson[_0x770d('0x9')][_0x770d('0xa')]({'port':0x232a});config[_0x770d('0xb')]=_[_0x770d('0xc')](config[_0x770d('0xb')],{'host':_0x770d('0xd'),'port':0x18eb});var socket=require(_0x770d('0xe'))(new Redis(config[_0x770d('0xb')]));require('./chatMessage.socket')[_0x770d('0xf')](socket);function respondWithRpcPromise(_0x104b21,_0x1579ca,_0xa9aebe){return new BPromise(function(_0x2c1a71,_0x269a7c){return client['request'](_0x104b21,_0xa9aebe)[_0x770d('0x10')](function(_0x5e1ee1){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1579ca,_0x770d('0x11'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1579ca,_0x770d('0x11'),JSON[_0x770d('0x12')](_0x5e1ee1));if(_0x5e1ee1[_0x770d('0x13')]){if(_0x5e1ee1[_0x770d('0x13')][_0x770d('0x14')]===0x1f4){logger[_0x770d('0x13')](_0x770d('0x15'),_0x1579ca,_0x5e1ee1['error']['message']);return _0x269a7c(_0x5e1ee1[_0x770d('0x13')][_0x770d('0x16')]);}logger[_0x770d('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1579ca,_0x5e1ee1[_0x770d('0x13')][_0x770d('0x16')]);return _0x2c1a71(_0x5e1ee1['error']['message']);}else{logger[_0x770d('0x17')](_0x770d('0x15'),_0x1579ca,_0x770d('0x11'));_0x2c1a71(_0x5e1ee1[_0x770d('0x18')]['message']);}})['catch'](function(_0x3857c7){logger[_0x770d('0x13')]('ChatMessage,\x20%s,\x20%s',_0x1579ca,_0x3857c7);_0x269a7c(_0x3857c7);});});}exports[_0x770d('0x19')]=function(_0x5888e4){var _0xe31303=this;return new Promise(function(_0x49f8af,_0x5d7818){return db[_0x770d('0x1a')]['create'](_0x5888e4['body'],{'raw':_0x5888e4[_0x770d('0x1b')]?_0x5888e4[_0x770d('0x1b')][_0x770d('0x1c')]===undefined?!![]:![]:!![]})[_0x770d('0x10')](function(_0x75e812){logger[_0x770d('0x17')]('CreateChatMessage',_0x5888e4);logger[_0x770d('0x1d')](_0x770d('0x19'),_0x5888e4,JSON[_0x770d('0x12')](_0x75e812));_0x49f8af(_0x75e812);})['catch'](function(_0x253a66){logger[_0x770d('0x13')](_0x770d('0x19'),_0x253a66['message'],_0x5888e4);_0x5d7818(_0xe31303[_0x770d('0x13')](0x1f4,_0x253a66[_0x770d('0x16')]));});});};
\ No newline at end of file
+var _0x2fe5=['request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','info','CreateChatMessage','ChatMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register'];(function(_0x248ff5,_0x1dab91){var _0xc23327=function(_0x53912a){while(--_0x53912a){_0x248ff5['push'](_0x248ff5['shift']());}};_0xc23327(++_0x1dab91);}(_0x2fe5,0x1bd));var _0x52fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2fe5[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var moment=require(_0x52fe('0x2'));var BPromise=require(_0x52fe('0x3'));var rs=require(_0x52fe('0x4'));var fs=require('fs');var Redis=require(_0x52fe('0x5'));var db=require(_0x52fe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x52fe('0x7'))('rpc');var config=require(_0x52fe('0x8'));var jayson=require(_0x52fe('0x9'));var client=jayson[_0x52fe('0xa')][_0x52fe('0xb')]({'port':0x232a});config[_0x52fe('0xc')]=_[_0x52fe('0xd')](config[_0x52fe('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x52fe('0xe'))(new Redis(config['redis']));require(_0x52fe('0xf'))[_0x52fe('0x10')](socket);function respondWithRpcPromise(_0x533965,_0x57db28,_0x6785c2){return new BPromise(function(_0x50e7ec,_0x36e722){return client[_0x52fe('0x11')](_0x533965,_0x6785c2)[_0x52fe('0x12')](function(_0x1dd16d){logger['info'](_0x52fe('0x13'),_0x57db28,_0x52fe('0x14'));logger[_0x52fe('0x15')](_0x52fe('0x16'),_0x57db28,_0x52fe('0x14'),JSON['stringify'](_0x1dd16d));if(_0x1dd16d['error']){if(_0x1dd16d['error']['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x57db28,_0x1dd16d[_0x52fe('0x17')][_0x52fe('0x18')]);return _0x36e722(_0x1dd16d[_0x52fe('0x17')][_0x52fe('0x18')]);}logger[_0x52fe('0x17')](_0x52fe('0x13'),_0x57db28,_0x1dd16d['error'][_0x52fe('0x18')]);return _0x50e7ec(_0x1dd16d[_0x52fe('0x17')][_0x52fe('0x18')]);}else{logger[_0x52fe('0x19')]('ChatMessage,\x20%s,\x20%s',_0x57db28,_0x52fe('0x14'));_0x50e7ec(_0x1dd16d['result']['message']);}})['catch'](function(_0x4f451d){logger[_0x52fe('0x17')](_0x52fe('0x13'),_0x57db28,_0x4f451d);_0x36e722(_0x4f451d);});});}exports[_0x52fe('0x1a')]=function(_0x1ea552){var _0x5d2586=this;return new Promise(function(_0x50866b,_0xbaee0f){return db[_0x52fe('0x1b')][_0x52fe('0x1c')](_0x1ea552['body'],{'raw':_0x1ea552[_0x52fe('0x1d')]?_0x1ea552[_0x52fe('0x1d')][_0x52fe('0x1e')]===undefined?!![]:![]:!![]})[_0x52fe('0x12')](function(_0x4f4816){logger['info'](_0x52fe('0x1a'),_0x1ea552);logger[_0x52fe('0x15')]('CreateChatMessage',_0x1ea552,JSON[_0x52fe('0x1f')](_0x4f4816));_0x50866b(_0x4f4816);})[_0x52fe('0x20')](function(_0xc50460){logger[_0x52fe('0x17')]('CreateChatMessage',_0xc50460[_0x52fe('0x18')],_0x1ea552);_0xbaee0f(_0x5d2586[_0x52fe('0x17')](0x1f4,_0xc50460[_0x52fe('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 6f2d584..f3dce21 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 _0xf776=['length','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x1a450a,_0x4dcb72){var _0x4f8ef4=function(_0x44c6ba){while(--_0x44c6ba){_0x1a450a['push'](_0x1a450a['shift']());}};_0x4f8ef4(++_0x4dcb72);}(_0xf776,0x169));var _0x6f77=function(_0x399af4,_0x23cc92){_0x399af4=_0x399af4-0x0;var _0x265849=_0xf776[_0x399af4];return _0x265849;};'use strict';var ChatMessageEvents=require(_0x6f77('0x0'));var events=['save',_0x6f77('0x1'),_0x6f77('0x2')];function createListener(_0x4e3b77,_0x43f2fd){return function(_0x2458e0){_0x43f2fd[_0x6f77('0x3')](_0x4e3b77,_0x2458e0);};}function removeListener(_0x16874b,_0x53ec9b){return function(){ChatMessageEvents[_0x6f77('0x4')](_0x16874b,_0x53ec9b);};}exports['register']=function(_0xf62e3e){for(var _0x21909a=0x0,_0x36ffd2=events[_0x6f77('0x5')];_0x21909a<_0x36ffd2;_0x21909a++){var _0x545ba9=events[_0x21909a];var _0x1dd52f=createListener('chatMessage:'+_0x545ba9,_0xf62e3e);ChatMessageEvents['on'](_0x545ba9,_0x1dd52f);}};
\ No newline at end of file
+var _0x615a=['remove','emit','removeListener','length','chatMessage:','./chatMessage.events'];(function(_0x5cff66,_0xf7816a){var _0x3244c4=function(_0x4a4e77){while(--_0x4a4e77){_0x5cff66['push'](_0x5cff66['shift']());}};_0x3244c4(++_0xf7816a);}(_0x615a,0x119));var _0xa615=function(_0x46d613,_0xf6aa29){_0x46d613=_0x46d613-0x0;var _0x3494e1=_0x615a[_0x46d613];return _0x3494e1;};'use strict';var ChatMessageEvents=require(_0xa615('0x0'));var events=['save',_0xa615('0x1'),'update'];function createListener(_0x7e1c17,_0x33c100){return function(_0x30bb4f){_0x33c100[_0xa615('0x2')](_0x7e1c17,_0x30bb4f);};}function removeListener(_0x52ae35,_0x1d9a38){return function(){ChatMessageEvents[_0xa615('0x3')](_0x52ae35,_0x1d9a38);};}exports['register']=function(_0x320680){for(var _0x5d04bd=0x0,_0x44afda=events[_0xa615('0x4')];_0x5d04bd<_0x44afda;_0x5d04bd++){var _0x2db48d=events[_0x5d04bd];var _0x1e714d=createListener(_0xa615('0x5')+_0x2db48d,_0x320680);ChatMessageEvents['on'](_0x2db48d,_0x1e714d);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index ece76ff..5548298 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 _0x4680=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x162c52,_0x2d489b){var _0xcb6dda=function(_0x170496){while(--_0x170496){_0x162c52['push'](_0x162c52['shift']());}};_0xcb6dda(++_0x2d489b);}(_0x4680,0x1ce));var _0x0468=function(_0x2de62c,_0x2a32cd){_0x2de62c=_0x2de62c-0x0;var _0x1c024c=_0x4680[_0x2de62c];return _0x1c024c;};'use strict';var multer=require(_0x0468('0x0'));var util=require('util');var path=require(_0x0468('0x1'));var timeout=require(_0x0468('0x2'));var express=require(_0x0468('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0468('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0468('0x5'));var controller=require(_0x0468('0x6'));router[_0x0468('0x7')]('/',auth[_0x0468('0x8')](),controller[_0x0468('0x9')]);router[_0x0468('0x7')](_0x0468('0xa'),auth[_0x0468('0x8')](),controller[_0x0468('0xb')]);router[_0x0468('0x7')](_0x0468('0xc'),auth[_0x0468('0x8')](),controller[_0x0468('0xd')]);router[_0x0468('0xe')]('/',auth[_0x0468('0x8')](),interaction[_0x0468('0xf')](_0x0468('0x10'),'chatmessage:create'),controller[_0x0468('0x11')]);router[_0x0468('0x12')](_0x0468('0xc'),controller[_0x0468('0x13')]);router[_0x0468('0x12')](_0x0468('0x14'),auth[_0x0468('0x8')](),controller[_0x0468('0x15')]);router[_0x0468('0x12')](_0x0468('0x16'),auth[_0x0468('0x8')](),controller[_0x0468('0x17')]);router[_0x0468('0x18')](_0x0468('0xc'),auth[_0x0468('0x8')](),controller[_0x0468('0x19')]);module[_0x0468('0x1a')]=router;
\ No newline at end of file
+var _0xa733=['delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','/describe','show','isAuthenticated','tracked','chat','put','/:id','update','/:id/reject','reject'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa733,0x11a));var _0x3a73=function(_0x54ff2c,_0x203f4c){_0x54ff2c=_0x54ff2c-0x0;var _0xf3ed4e=_0xa733[_0x54ff2c];return _0xf3ed4e;};'use strict';var multer=require('multer');var util=require(_0x3a73('0x0'));var path=require(_0x3a73('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a73('0x2'));var router=express[_0x3a73('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3a73('0x4'));var interaction=require(_0x3a73('0x5'));var config=require('../../config/environment');var controller=require(_0x3a73('0x6'));router[_0x3a73('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3a73('0x7')](_0x3a73('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x3a73('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3a73('0x9')]);router['post']('/',auth[_0x3a73('0xa')](),interaction[_0x3a73('0xb')](_0x3a73('0xc'),'chatmessage:create'),controller['create']);router[_0x3a73('0xd')](_0x3a73('0xe'),controller[_0x3a73('0xf')]);router['put']('/:id/accept',auth[_0x3a73('0xa')](),controller['accept']);router['put'](_0x3a73('0x10'),auth[_0x3a73('0xa')](),controller[_0x3a73('0x11')]);router[_0x3a73('0x12')]('/:id',auth[_0x3a73('0xa')](),controller['destroy']);module[_0x3a73('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 553d46b..48171f3 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 _0xd38f=['exports','TEXT','medium','sequelize'];(function(_0x34f756,_0x1ea7ab){var _0x26e745=function(_0x165a65){while(--_0x165a65){_0x34f756['push'](_0x34f756['shift']());}};_0x26e745(++_0x1ea7ab);}(_0xd38f,0xbf));var _0xfd38=function(_0x406a87,_0x28891c){_0x406a87=_0x406a87-0x0;var _0x223876=_0xd38f[_0x406a87];return _0x223876;};'use strict';var Sequelize=require(_0xfd38('0x0'));module[_0xfd38('0x1')]={'body':{'type':Sequelize[_0xfd38('0x2')](_0xfd38('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x04c8=['TEXT','medium','sequelize','exports'];(function(_0x416e7a,_0x565426){var _0x3f624d=function(_0x5d4a0a){while(--_0x5d4a0a){_0x416e7a['push'](_0x416e7a['shift']());}};_0x3f624d(++_0x565426);}(_0x04c8,0x11e));var _0x804c=function(_0x2f785b,_0x2094c2){_0x2f785b=_0x2f785b-0x0;var _0x4c669a=_0x04c8[_0x2f785b];return _0x4c669a;};'use strict';var Sequelize=require(_0x804c('0x0'));module[_0x804c('0x1')]={'body':{'type':Sequelize[_0x804c('0x2')](_0x804c('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 150e32b..4fe72f1 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x13ca2c,_0x132564){var _0x37e9ac=function(_0x1c1d0f){while(--_0x1c1d0f){_0x13ca2c['push'](_0x13ca2c['shift']());}};_0x37e9ac(++_0x132564);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+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(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7a54,0x106));var _0x47a5=function(_0x28150a,_0x45f175){_0x28150a=_0x28150a-0x0;var _0x38986d=_0x7a54[_0x28150a];return _0x38986d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 06e8c54..6af8ff7 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 _0x45c2=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x45c2,0x164));var _0x245c=function(_0x3360f3,_0x344f01){_0x3360f3=_0x3360f3-0x0;var _0x45e856=_0x45c2[_0x3360f3];return _0x45e856;};'use strict';var _=require('lodash');var util=require(_0x245c('0x0'));var logger=require(_0x245c('0x1'))(_0x245c('0x2'));var moment=require('moment');var BPromise=require(_0x245c('0x3'));var rp=require(_0x245c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x245c('0x5'));var config=require(_0x245c('0x6'));var attributes=require(_0x245c('0x7'));module[_0x245c('0x8')]=function(_0x18d18c,_0x53d6bb){return _0x18d18c[_0x245c('0x9')](_0x245c('0xa'),attributes,{'tableName':_0x245c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x245c('0xc'),'collate':_0x245c('0xd')});};
\ No newline at end of file
+var _0x070f=['request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x070f,0x166));var _0xf070=function(_0x4836d5,_0x16bb76){_0x4836d5=_0x4836d5-0x0;var _0x480887=_0x070f[_0x4836d5];return _0x480887;};'use strict';var _=require(_0xf070('0x0'));var util=require(_0xf070('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf070('0x2'));var fs=require('fs');var path=require(_0xf070('0x3'));var rimraf=require('rimraf');var config=require(_0xf070('0x4'));var attributes=require(_0xf070('0x5'));module[_0xf070('0x6')]=function(_0x58e5ee,_0x45db56){return _0x58e5ee[_0xf070('0x7')](_0xf070('0x8'),attributes,{'tableName':_0xf070('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf070('0xa'),'collate':_0xf070('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 286ff86..94e384b 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 _0x4ccf=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug'];(function(_0x585cff,_0xedb8e0){var _0x1aaf4c=function(_0x2041aa){while(--_0x2041aa){_0x585cff['push'](_0x585cff['shift']());}};_0x1aaf4c(++_0xedb8e0);}(_0x4ccf,0x170));var _0xf4cc=function(_0x157492,_0x38af62){_0x157492=_0x157492-0x0;var _0x224180=_0x4ccf[_0x157492];return _0x224180;};'use strict';var _=require('lodash');var util=require(_0xf4cc('0x0'));var moment=require(_0xf4cc('0x1'));var BPromise=require(_0xf4cc('0x2'));var rs=require(_0xf4cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf4cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4cc('0x5'))(_0xf4cc('0x6'));var config=require(_0xf4cc('0x7'));var jayson=require(_0xf4cc('0x8'));var client=jayson[_0xf4cc('0x9')][_0xf4cc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x234ff6,_0x35625c,_0x4b0a29){return new BPromise(function(_0x392fda,_0x4092d1){return client[_0xf4cc('0xb')](_0x234ff6,_0x4b0a29)[_0xf4cc('0xc')](function(_0x561314){logger[_0xf4cc('0xd')](_0xf4cc('0xe'),_0x35625c,'request\x20sent');logger[_0xf4cc('0xf')](_0xf4cc('0x10'),_0x35625c,_0xf4cc('0x11'),JSON[_0xf4cc('0x12')](_0x561314));if(_0x561314['error']){if(_0x561314[_0xf4cc('0x13')][_0xf4cc('0x14')]===0x1f4){logger[_0xf4cc('0x13')](_0xf4cc('0xe'),_0x35625c,_0x561314['error'][_0xf4cc('0x15')]);return _0x4092d1(_0x561314[_0xf4cc('0x13')][_0xf4cc('0x15')]);}logger[_0xf4cc('0x13')](_0xf4cc('0xe'),_0x35625c,_0x561314['error']['message']);return _0x392fda(_0x561314['error'][_0xf4cc('0x15')]);}else{logger['info'](_0xf4cc('0xe'),_0x35625c,'request\x20sent');_0x392fda(_0x561314[_0xf4cc('0x16')]['message']);}})[_0xf4cc('0x17')](function(_0x119c5c){logger[_0xf4cc('0x13')](_0xf4cc('0xe'),_0x35625c,_0x119c5c);_0x4092d1(_0x119c5c);});});}
\ No newline at end of file
+var _0x1c9a=['code','ChatOfflineMessage,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x4ae767,_0x1e29cf){var _0x301df7=function(_0x2b5b60){while(--_0x2b5b60){_0x4ae767['push'](_0x4ae767['shift']());}};_0x301df7(++_0x1e29cf);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x2d49ee,_0x2b530a){_0x2d49ee=_0x2d49ee-0x0;var _0x4fe00f=_0x1c9a[_0x2d49ee];return _0x4fe00f;};'use strict';var _=require(_0xa1c9('0x0'));var util=require(_0xa1c9('0x1'));var moment=require('moment');var BPromise=require(_0xa1c9('0x2'));var rs=require(_0xa1c9('0x3'));var fs=require('fs');var Redis=require(_0xa1c9('0x4'));var db=require(_0xa1c9('0x5'))['db'];var utils=require(_0xa1c9('0x6'));var logger=require('../../config/logger')(_0xa1c9('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1c9('0x8'));var client=jayson[_0xa1c9('0x9')][_0xa1c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b0c89,_0x1a0364,_0x46b19a){return new BPromise(function(_0x3b1a2c,_0xc8bc5a){return client[_0xa1c9('0xb')](_0x2b0c89,_0x46b19a)[_0xa1c9('0xc')](function(_0x2fcbcd){logger[_0xa1c9('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1a0364,'request\x20sent');logger[_0xa1c9('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1a0364,_0xa1c9('0xf'),JSON[_0xa1c9('0x10')](_0x2fcbcd));if(_0x2fcbcd[_0xa1c9('0x11')]){if(_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x12')]===0x1f4){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x1a0364,_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x14')]);return _0xc8bc5a(_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x14')]);}logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x1a0364,_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x14')]);return _0x3b1a2c(_0x2fcbcd[_0xa1c9('0x11')][_0xa1c9('0x14')]);}else{logger[_0xa1c9('0xd')](_0xa1c9('0x13'),_0x1a0364,_0xa1c9('0xf'));_0x3b1a2c(_0x2fcbcd['result'][_0xa1c9('0x14')]);}})['catch'](function(_0x12d989){logger[_0xa1c9('0x11')](_0xa1c9('0x13'),_0x1a0364,_0x12d989);_0xc8bc5a(_0x12d989);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 90ad2e9..af26d52 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 _0x466f=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id'];(function(_0x46c8aa,_0x215266){var _0x5231eb=function(_0x500733){while(--_0x500733){_0x46c8aa['push'](_0x46c8aa['shift']());}};_0x5231eb(++_0x215266);}(_0x466f,0x114));var _0xf466=function(_0x514e2d,_0x5d7e17){_0x514e2d=_0x514e2d-0x0;var _0x3659f9=_0x466f[_0x514e2d];return _0x3659f9;};'use strict';var multer=require(_0xf466('0x0'));var util=require('util');var path=require(_0xf466('0x1'));var timeout=require(_0xf466('0x2'));var express=require(_0xf466('0x3'));var router=express[_0xf466('0x4')]();var fs_extra=require(_0xf466('0x5'));var auth=require(_0xf466('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf466('0x7'));router['get']('/',auth[_0xf466('0x8')](),controller[_0xf466('0x9')]);router[_0xf466('0xa')](_0xf466('0xb'),auth[_0xf466('0x8')](),controller[_0xf466('0xc')]);router[_0xf466('0xa')]('/:id',auth[_0xf466('0x8')](),controller[_0xf466('0xd')]);router[_0xf466('0xe')]('/',auth[_0xf466('0x8')](),controller[_0xf466('0xf')]);router[_0xf466('0x10')](_0xf466('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xf466('0x12')](_0xf466('0x11'),auth[_0xf466('0x8')](),controller[_0xf466('0x13')]);module[_0xf466('0x14')]=router;
\ No newline at end of file
+var _0x70fb=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x1384a9,_0x1fcfec){var _0x1b2fbf=function(_0x35eb62){while(--_0x35eb62){_0x1384a9['push'](_0x1384a9['shift']());}};_0x1b2fbf(++_0x1fcfec);}(_0x70fb,0x1a7));var _0xb70f=function(_0x54516e,_0x5df54c){_0x54516e=_0x54516e-0x0;var _0x4d1e6f=_0x70fb[_0x54516e];return _0x4d1e6f;};'use strict';var multer=require(_0xb70f('0x0'));var util=require(_0xb70f('0x1'));var path=require(_0xb70f('0x2'));var timeout=require(_0xb70f('0x3'));var express=require(_0xb70f('0x4'));var router=express[_0xb70f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb70f('0x6'));var controller=require(_0xb70f('0x7'));router[_0xb70f('0x8')]('/',auth[_0xb70f('0x9')](),controller[_0xb70f('0xa')]);router['get']('/describe',auth[_0xb70f('0x9')](),controller['describe']);router[_0xb70f('0x8')](_0xb70f('0xb'),auth[_0xb70f('0x9')](),controller[_0xb70f('0xc')]);router[_0xb70f('0xd')]('/',auth[_0xb70f('0x9')](),controller[_0xb70f('0xe')]);router[_0xb70f('0xf')]('/:id',auth[_0xb70f('0x9')](),controller[_0xb70f('0x10')]);router[_0xb70f('0x11')](_0xb70f('0xb'),auth[_0xb70f('0x9')](),controller[_0xb70f('0x12')]);module[_0xb70f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 9127ded..09c50bf 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 _0xb02d=['STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb02d,0xc8));var _0xdb02=function(_0x1f4427,_0x2c5101){_0x1f4427=_0x1f4427-0x0;var _0x56953d=_0xb02d[_0x1f4427];return _0x56953d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdb02('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xdb02('0x1')](_0xdb02('0x2'),_0xdb02('0x3')),'defaultValue':_0xdb02('0x2')},'selector':{'type':Sequelize[_0xdb02('0x0')]},'timeout':{'type':Sequelize[_0xdb02('0x4')]}};
\ No newline at end of file
+var _0x6de0=['mouseOver','timeout','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x6de0,0x114));var _0x06de=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x6de0[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x06de('0x0'));module[_0x06de('0x1')]={'name':{'type':Sequelize[_0x06de('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x06de('0x3')](_0x06de('0x4'),_0x06de('0x5')),'defaultValue':_0x06de('0x4')},'selector':{'type':Sequelize[_0x06de('0x2')]},'timeout':{'type':Sequelize[_0x06de('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 5b37605..ddb132f 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 _0x7217=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','show','params','keys','ChatProactiveAction','query','intersection','model','fields','attributes','length','includeAll','merge','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x50748b,_0x599d6d){var _0x5688d7=function(_0xfb5d55){while(--_0xfb5d55){_0x50748b['push'](_0x50748b['shift']());}};_0x5688d7(++_0x599d6d);}(_0x7217,0x19e));var _0x7721=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x7217[_0x2a6809];return _0x11c371;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={'raw':!![],'where':{'id':_0x158d98[_0x7721('0x2f')]['id']}},_0xd7d703={};_0xd7d703['model']=_[_0x7721('0x30')](db[_0x7721('0x31')]['rawAttributes']);_0xd7d703['query']=_[_0x7721('0x30')](_0x158d98[_0x7721('0x32')]);_0xd7d703['filters']=_[_0x7721('0x33')](_0xd7d703[_0x7721('0x34')],_0xd7d703[_0x7721('0x32')]);_0x37b9f0['attributes']=_[_0x7721('0x33')](_0xd7d703[_0x7721('0x34')],qs[_0x7721('0x35')](_0x158d98[_0x7721('0x32')][_0x7721('0x35')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x36')][_0x7721('0x37')]?_0x37b9f0[_0x7721('0x36')]:_0xd7d703['model'];if(_0x158d98[_0x7721('0x32')][_0x7721('0x38')]){_0x37b9f0['include']=[{'all':!![]}];}_0x37b9f0=_[_0x7721('0x39')]({},_0x37b9f0,_0x158d98['options']);return db[_0x7721('0x31')][_0x7721('0x3a')](_0x37b9f0)[_0x7721('0x29')](handleEntityNotFound(_0x1ea4d,null))[_0x7721('0x29')](respondWithResult(_0x1ea4d,null))[_0x7721('0x3b')](handleError(_0x1ea4d,null));};exports[_0x7721('0x3c')]=function(_0x2f1fe0,_0x15545a){return db[_0x7721('0x31')][_0x7721('0x3c')](_0x2f1fe0[_0x7721('0x3d')],{})['then'](respondWithResult(_0x15545a,0xc9))[_0x7721('0x3b')](handleError(_0x15545a,null));};exports['update']=function(_0x212384,_0x35614c){if(_0x212384[_0x7721('0x3d')]['id']){delete _0x212384[_0x7721('0x3d')]['id'];}return db[_0x7721('0x31')][_0x7721('0x3a')]({'where':{'id':_0x212384['params']['id']}})['then'](handleEntityNotFound(_0x35614c,null))['then'](saveUpdates(_0x212384['body'],null))[_0x7721('0x29')](respondWithResult(_0x35614c,null))[_0x7721('0x3b')](handleError(_0x35614c,null));};exports[_0x7721('0x2a')]=function(_0x22ef35,_0x4a90ce){return db[_0x7721('0x31')]['find']({'where':{'id':_0x22ef35[_0x7721('0x2f')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x4a90ce,null))['then'](removeEntity(_0x4a90ce,null))[_0x7721('0x3b')](handleError(_0x4a90ce,null));};
\ No newline at end of file
+var _0x3148=['crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options','ChatProactiveAction','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1e45c8,_0x196f96){var _0x2014db=function(_0x5bf6dc){while(--_0x5bf6dc){_0x1e45c8['push'](_0x1e45c8['shift']());}};_0x2014db(++_0x196f96);}(_0x3148,0x1d3));var _0x8314=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x3148[_0x20cf8a];return _0x54e165;};'use strict';var emlformat=require(_0x8314('0x0'));var rimraf=require(_0x8314('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8314('0x2'));var rp=require(_0x8314('0x3'));var moment=require(_0x8314('0x4'));var BPromise=require(_0x8314('0x5'));var Mustache=require('mustache');var util=require(_0x8314('0x6'));var path=require(_0x8314('0x7'));var sox=require(_0x8314('0x8'));var csv=require(_0x8314('0x9'));var ejs=require(_0x8314('0xa'));var fs=require('fs');var fs_extra=require(_0x8314('0xb'));var _=require(_0x8314('0xc'));var squel=require('squel');var crypto=require(_0x8314('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8314('0xe'));var toCsv=require(_0x8314('0x9'));var querystring=require(_0x8314('0xf'));var Papa=require(_0x8314('0x10'));var Redis=require(_0x8314('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8314('0x12'));var hardwareService=require(_0x8314('0x13'));var logger=require(_0x8314('0x14'))(_0x8314('0x15'));var utils=require('../../config/utils');var config=require(_0x8314('0x16'));var licenseUtil=require(_0x8314('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f8231,_0x55e770){_0x55e770=_0x55e770||0xcc;return function(_0x5f17d8){if(_0x5f17d8){return _0x2f8231[_0x8314('0x18')](_0x55e770);}return _0x2f8231[_0x8314('0x19')](_0x55e770)[_0x8314('0x1a')]();};}function respondWithResult(_0x24c55c,_0x49587c){_0x49587c=_0x49587c||0xc8;return function(_0x9e90a6){if(_0x9e90a6){return _0x24c55c[_0x8314('0x19')](_0x49587c)[_0x8314('0x1b')](_0x9e90a6);}};}function respondWithFilteredResult(_0x136e09,_0x2c459e){return function(_0x6a588a){if(_0x6a588a){var _0x579a15=typeof _0x2c459e['offset']===_0x8314('0x1c')&&typeof _0x2c459e[_0x8314('0x1d')]===_0x8314('0x1c');var _0x570db3=_0x6a588a[_0x8314('0x1e')];var _0x10e256=_0x579a15?0x0:_0x2c459e['offset'];var _0x1ade63=_0x579a15?_0x6a588a[_0x8314('0x1e')]:_0x2c459e['offset']+_0x2c459e[_0x8314('0x1d')];var _0x55053a;if(_0x1ade63>=_0x570db3){_0x1ade63=_0x570db3;_0x55053a=0xc8;}else{_0x55053a=0xce;}_0x136e09[_0x8314('0x19')](_0x55053a);return _0x136e09[_0x8314('0x1f')](_0x8314('0x20'),_0x10e256+'-'+_0x1ade63+'/'+_0x570db3)['json'](_0x6a588a);}return null;};}function patchUpdates(_0x4ead11){return function(_0x240f4b){try{jsonpatch[_0x8314('0x21')](_0x240f4b,_0x4ead11,!![]);}catch(_0xc37d84){return BPromise[_0x8314('0x22')](_0xc37d84);}return _0x240f4b[_0x8314('0x23')]();};}function saveUpdates(_0x1b1579,_0x2e9052){return function(_0x9e2c24){if(_0x9e2c24){return _0x9e2c24[_0x8314('0x24')](_0x1b1579)[_0x8314('0x25')](function(_0x5c6fd1){return _0x5c6fd1;});}return null;};}function removeEntity(_0xf72fc9,_0x29535a){return function(_0x2b6183){if(_0x2b6183){return _0x2b6183[_0x8314('0x26')]()[_0x8314('0x25')](function(){_0xf72fc9['status'](0xcc)[_0x8314('0x1a')]();});}};}function handleEntityNotFound(_0x2405af,_0x3f3736){return function(_0x4b37de){if(!_0x4b37de){_0x2405af[_0x8314('0x18')](0x194);}return _0x4b37de;};}function handleError(_0x56a047,_0x4c55b1){_0x4c55b1=_0x4c55b1||0x1f4;return function(_0x30d0b2){logger['error'](_0x30d0b2[_0x8314('0x27')]);if(_0x30d0b2['name']){delete _0x30d0b2[_0x8314('0x28')];}_0x56a047[_0x8314('0x19')](_0x4c55b1)[_0x8314('0x29')](_0x30d0b2);};}exports[_0x8314('0x2a')]=function(_0x40efa3,_0x7acf62){var _0x56f1c1={'raw':!![],'where':{'id':_0x40efa3[_0x8314('0x2b')]['id']}},_0x59fbfc={};_0x59fbfc[_0x8314('0x2c')]=_[_0x8314('0x2d')](db['ChatProactiveAction'][_0x8314('0x2e')]);_0x59fbfc[_0x8314('0x2f')]=_[_0x8314('0x2d')](_0x40efa3[_0x8314('0x2f')]);_0x59fbfc[_0x8314('0x30')]=_[_0x8314('0x31')](_0x59fbfc[_0x8314('0x2c')],_0x59fbfc[_0x8314('0x2f')]);_0x56f1c1[_0x8314('0x32')]=_[_0x8314('0x31')](_0x59fbfc[_0x8314('0x2c')],qs[_0x8314('0x33')](_0x40efa3[_0x8314('0x2f')][_0x8314('0x33')]));_0x56f1c1[_0x8314('0x32')]=_0x56f1c1[_0x8314('0x32')][_0x8314('0x34')]?_0x56f1c1['attributes']:_0x59fbfc['model'];if(_0x40efa3[_0x8314('0x2f')][_0x8314('0x35')]){_0x56f1c1['include']=[{'all':!![]}];}_0x56f1c1=_['merge']({},_0x56f1c1,_0x40efa3[_0x8314('0x36')]);return db[_0x8314('0x37')][_0x8314('0x38')](_0x56f1c1)[_0x8314('0x25')](handleEntityNotFound(_0x7acf62,null))['then'](respondWithResult(_0x7acf62,null))[_0x8314('0x39')](handleError(_0x7acf62,null));};exports[_0x8314('0x3a')]=function(_0x3be94c,_0x3637f5){return db['ChatProactiveAction'][_0x8314('0x3a')](_0x3be94c[_0x8314('0x3b')],{})[_0x8314('0x25')](respondWithResult(_0x3637f5,0xc9))['catch'](handleError(_0x3637f5,null));};exports[_0x8314('0x24')]=function(_0x480d81,_0x1194ff){if(_0x480d81[_0x8314('0x3b')]['id']){delete _0x480d81['body']['id'];}return db['ChatProactiveAction'][_0x8314('0x38')]({'where':{'id':_0x480d81['params']['id']}})[_0x8314('0x25')](handleEntityNotFound(_0x1194ff,null))['then'](saveUpdates(_0x480d81[_0x8314('0x3b')],null))[_0x8314('0x25')](respondWithResult(_0x1194ff,null))['catch'](handleError(_0x1194ff,null));};exports[_0x8314('0x26')]=function(_0x83e57a,_0x207afd){return db[_0x8314('0x37')][_0x8314('0x38')]({'where':{'id':_0x83e57a[_0x8314('0x2b')]['id']}})[_0x8314('0x25')](handleEntityNotFound(_0x207afd,null))[_0x8314('0x25')](removeEntity(_0x207afd,null))[_0x8314('0x39')](handleError(_0x207afd,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 2dfa5de..84e617d 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 _0xf5a8=['../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xf79bae,_0x263b2a){var _0x5d2cb7=function(_0x27c86b){while(--_0x27c86b){_0xf79bae['push'](_0xf79bae['shift']());}};_0x5d2cb7(++_0x263b2a);}(_0xf5a8,0x71));var _0x8f5a=function(_0x4d7a61,_0x3fb6e6){_0x4d7a61=_0x4d7a61-0x0;var _0x186f73=_0xf5a8[_0x4d7a61];return _0x186f73;};'use strict';var _=require('lodash');var util=require(_0x8f5a('0x0'));var logger=require(_0x8f5a('0x1'))(_0x8f5a('0x2'));var moment=require(_0x8f5a('0x3'));var BPromise=require(_0x8f5a('0x4'));var rp=require(_0x8f5a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f5a('0x6'));var config=require(_0x8f5a('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x8f5a('0x8')]=function(_0x364e1c,_0x58db24){return _0x364e1c[_0x8f5a('0x9')](_0x8f5a('0xa'),attributes,{'tableName':_0x8f5a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa610=['rimraf','../../config/environment','ChatProactiveAction','lodash','../../config/logger','moment','request-promise'];(function(_0x24ce1b,_0x885966){var _0x106cd6=function(_0x5a295a){while(--_0x5a295a){_0x24ce1b['push'](_0x24ce1b['shift']());}};_0x106cd6(++_0x885966);}(_0xa610,0x96));var _0x0a61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa610[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0a61('0x0'));var util=require('util');var logger=require(_0x0a61('0x1'))('api');var moment=require(_0x0a61('0x2'));var BPromise=require('bluebird');var rp=require(_0x0a61('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a61('0x4'));var config=require(_0x0a61('0x5'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x2f2064,_0x267640){return _0x2f2064['define'](_0x0a61('0x6'),attributes,{'tableName':'chat_proactive_actions','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 9f0a916..178cd97 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 _0xc36b=['util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x1306e9,_0x4fd1ce){var _0x15eafb=function(_0x16ebed){while(--_0x16ebed){_0x1306e9['push'](_0x1306e9['shift']());}};_0x15eafb(++_0x4fd1ce);}(_0xc36b,0x190));var _0xbc36=function(_0xfebe8f,_0x54af65){_0xfebe8f=_0xfebe8f-0x0;var _0x4c33a5=_0xc36b[_0xfebe8f];return _0x4c33a5;};'use strict';var _=require('lodash');var util=require(_0xbc36('0x0'));var moment=require(_0xbc36('0x1'));var BPromise=require(_0xbc36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbc36('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc36('0x4'));var logger=require('../../config/logger')(_0xbc36('0x5'));var config=require(_0xbc36('0x6'));var jayson=require(_0xbc36('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x227380,_0x4d3629,_0x3f5bd6){return new BPromise(function(_0xd35713,_0x34f560){return client['request'](_0x227380,_0x3f5bd6)[_0xbc36('0x8')](function(_0xada406){logger['info'](_0xbc36('0x9'),_0x4d3629,_0xbc36('0xa'));logger[_0xbc36('0xb')](_0xbc36('0xc'),_0x4d3629,_0xbc36('0xa'),JSON[_0xbc36('0xd')](_0xada406));if(_0xada406['error']){if(_0xada406[_0xbc36('0xe')][_0xbc36('0xf')]===0x1f4){logger[_0xbc36('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x4d3629,_0xada406['error']['message']);return _0x34f560(_0xada406[_0xbc36('0xe')]['message']);}logger[_0xbc36('0xe')](_0xbc36('0x9'),_0x4d3629,_0xada406[_0xbc36('0xe')][_0xbc36('0x10')]);return _0xd35713(_0xada406[_0xbc36('0xe')][_0xbc36('0x10')]);}else{logger[_0xbc36('0x11')](_0xbc36('0x9'),_0x4d3629,_0xbc36('0xa'));_0xd35713(_0xada406[_0xbc36('0x12')][_0xbc36('0x10')]);}})[_0xbc36('0x13')](function(_0x4f3dad){logger[_0xbc36('0xe')](_0xbc36('0x9'),_0x4d3629,_0x4f3dad);_0x34f560(_0x4f3dad);});});}
\ No newline at end of file
+var _0x3661=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x3600a9,_0x4a3cbb){var _0x4532fd=function(_0x1e66aa){while(--_0x1e66aa){_0x3600a9['push'](_0x3600a9['shift']());}};_0x4532fd(++_0x4a3cbb);}(_0x3661,0x138));var _0x1366=function(_0x358d7f,_0x1cfebb){_0x358d7f=_0x358d7f-0x0;var _0x552c95=_0x3661[_0x358d7f];return _0x552c95;};'use strict';var _=require(_0x1366('0x0'));var util=require(_0x1366('0x1'));var moment=require(_0x1366('0x2'));var BPromise=require(_0x1366('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1366('0x4'));var db=require(_0x1366('0x5'))['db'];var utils=require(_0x1366('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1366('0x7'));var jayson=require(_0x1366('0x8'));var client=jayson[_0x1366('0x9')][_0x1366('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x215f16,_0x12c4d7,_0x40f6d3){return new BPromise(function(_0x381742,_0x4f93f7){return client[_0x1366('0xb')](_0x215f16,_0x40f6d3)[_0x1366('0xc')](function(_0x353a04){logger['info'](_0x1366('0xd'),_0x12c4d7,'request\x20sent');logger[_0x1366('0xe')](_0x1366('0xf'),_0x12c4d7,_0x1366('0x10'),JSON[_0x1366('0x11')](_0x353a04));if(_0x353a04['error']){if(_0x353a04[_0x1366('0x12')][_0x1366('0x13')]===0x1f4){logger[_0x1366('0x12')](_0x1366('0xd'),_0x12c4d7,_0x353a04[_0x1366('0x12')][_0x1366('0x14')]);return _0x4f93f7(_0x353a04[_0x1366('0x12')][_0x1366('0x14')]);}logger[_0x1366('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x12c4d7,_0x353a04[_0x1366('0x12')][_0x1366('0x14')]);return _0x381742(_0x353a04[_0x1366('0x12')]['message']);}else{logger[_0x1366('0x15')](_0x1366('0xd'),_0x12c4d7,'request\x20sent');_0x381742(_0x353a04[_0x1366('0x16')][_0x1366('0x14')]);}})[_0x1366('0x17')](function(_0x7b4a06){logger['error'](_0x1366('0xd'),_0x12c4d7,_0x7b4a06);_0x4f93f7(_0x7b4a06);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index a8f121f..5e63afd 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 _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x25044f,_0x28a04a){var _0xaace9c=function(_0x209204){while(--_0x209204){_0x25044f['push'](_0x25044f['shift']());}};_0xaace9c(++_0x28a04a);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x340982,_0xa465f6){_0x340982=_0x340982-0x0;var _0x289d44=_0xdbf5[_0x340982];return _0x289d44;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xd8fb=['multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','isAuthenticated','post','create','put','update','delete','/:id','destroy','exports'];(function(_0x46b4d5,_0x4ac1e3){var _0x522d96=function(_0x4c2efc){while(--_0x4c2efc){_0x46b4d5['push'](_0x46b4d5['shift']());}};_0x522d96(++_0x4ac1e3);}(_0xd8fb,0x99));var _0xbd8f=function(_0x57b0fb,_0x56f17a){_0x57b0fb=_0x57b0fb-0x0;var _0x40c81a=_0xd8fb[_0x57b0fb];return _0x40c81a;};'use strict';var multer=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var path=require(_0xbd8f('0x2'));var timeout=require(_0xbd8f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd8f('0x4'));var interaction=require(_0xbd8f('0x5'));var config=require('../../config/environment');var controller=require(_0xbd8f('0x6'));router[_0xbd8f('0x7')]('/:id',auth[_0xbd8f('0x8')](),controller['show']);router[_0xbd8f('0x9')]('/',auth['isAuthenticated'](),controller[_0xbd8f('0xa')]);router[_0xbd8f('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbd8f('0xc')]);router[_0xbd8f('0xd')](_0xbd8f('0xe'),auth['isAuthenticated'](),controller[_0xbd8f('0xf')]);module[_0xbd8f('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 97db6b2..0cbd630 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 _0xde65=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x4fc5df,_0x3acaab){var _0x4a18f5=function(_0x241409){while(--_0x241409){_0x4fc5df['push'](_0x4fc5df['shift']());}};_0x4a18f5(++_0x3acaab);}(_0xde65,0x1b8));var _0x5de6=function(_0x2c9f4a,_0x4871e7){_0x2c9f4a=_0x2c9f4a-0x0;var _0xad8d0f=_0xde65[_0x2c9f4a];return _0xad8d0f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5de6('0x0')],'unique':_0x5de6('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5de6('0x0')]},'timeout':{'type':Sequelize[_0x5de6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5de6('0x3')](_0x5de6('0x4'),_0x5de6('0x5'),_0x5de6('0x6'))}};
\ No newline at end of file
+var _0x64c6=['name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x55d522,_0x58a4cd){var _0x5592a3=function(_0x9ff33f){while(--_0x9ff33f){_0x55d522['push'](_0x55d522['shift']());}};_0x5592a3(++_0x58a4cd);}(_0x64c6,0xae));var _0x664c=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0x64c6[_0x33c603];return _0xae96f4;};'use strict';var Sequelize=require(_0x664c('0x0'));module[_0x664c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x664c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x664c('0x3')]},'timeout':{'type':Sequelize[_0x664c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x664c('0x5'),_0x664c('0x6'),_0x664c('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index ab42629..ece4fe7 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 _0x7d10=['removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','clone','push','sequelize','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','ids','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','client','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','destroy','get','UserProfileResource','end','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','ChatQueue','findAll','show','params','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','findAndCountAll','agent','chatPause','updatedAt','rows','%s/%s','createdAt','getTeams','Team','addTeams','User','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','emit','userChatQueue:save'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x7d10,0xb3));var _0x07d1=function(_0x5c110e,_0x1c0f53){_0x5c110e=_0x5c110e-0x0;var _0x31b810=_0x7d10[_0x5c110e];return _0x31b810;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07d1('0x0'));var zipdir=require(_0x07d1('0x1'));var jsonpatch=require(_0x07d1('0x2'));var rp=require(_0x07d1('0x3'));var moment=require(_0x07d1('0x4'));var BPromise=require(_0x07d1('0x5'));var Mustache=require(_0x07d1('0x6'));var util=require(_0x07d1('0x7'));var path=require(_0x07d1('0x8'));var sox=require('sox');var csv=require(_0x07d1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07d1('0xa'));var _=require(_0x07d1('0xb'));var squel=require(_0x07d1('0xc'));var crypto=require(_0x07d1('0xd'));var jsforce=require(_0x07d1('0xe'));var deskjs=require(_0x07d1('0xf'));var toCsv=require(_0x07d1('0x9'));var querystring=require(_0x07d1('0x10'));var Papa=require(_0x07d1('0x11'));var Redis=require('ioredis');var authService=require(_0x07d1('0x12'));var qs=require(_0x07d1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x07d1('0x14'))(_0x07d1('0x15'));var utils=require(_0x07d1('0x16'));var config=require(_0x07d1('0x17'));var licenseUtil=require(_0x07d1('0x18'));var db=require(_0x07d1('0x19'))['db'];config[_0x07d1('0x1a')]=_['defaults'](config[_0x07d1('0x1a')],{'host':_0x07d1('0x1b'),'port':0x18eb});var socket=require(_0x07d1('0x1c'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x07d1('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31f30b,_0x4f63da,_0x289d4b,_0x867c65){return new BPromise(function(_0x49b7b9,_0x5bf102){var _0x50a44b=_0x867c65||client;return _0x50a44b[_0x07d1('0x1e')](_0x31f30b,_0x289d4b)[_0x07d1('0x1f')](function(_0x3816fb){logger['info'](_0x07d1('0x20'),_0x4f63da,_0x07d1('0x21'));logger[_0x07d1('0x22')](_0x07d1('0x23'),_0x4f63da,'request\x20sent',JSON[_0x07d1('0x24')](_0x3816fb));if(_0x3816fb['error']){if(_0x3816fb[_0x07d1('0x25')][_0x07d1('0x26')]===0x1f4){logger[_0x07d1('0x25')](_0x07d1('0x20'),_0x4f63da,_0x3816fb[_0x07d1('0x25')][_0x07d1('0x27')]);return _0x5bf102(_0x3816fb['error'][_0x07d1('0x27')]);}logger[_0x07d1('0x25')]('ChatQueue,\x20%s,\x20%s',_0x4f63da,_0x3816fb[_0x07d1('0x25')][_0x07d1('0x27')]);return _0x49b7b9(_0x3816fb[_0x07d1('0x25')][_0x07d1('0x27')]);}else{logger[_0x07d1('0x28')]('ChatQueue,\x20%s,\x20%s',_0x4f63da,_0x07d1('0x21'));_0x49b7b9(_0x3816fb[_0x07d1('0x29')]['message']);}})[_0x07d1('0x2a')](function(_0x31559d){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4f63da,_0x31559d);_0x5bf102(_0x31559d);});});}function respondWithStatusCode(_0x1bd403,_0x493923){_0x493923=_0x493923||0xcc;return function(_0x2b4911){if(_0x2b4911){return _0x1bd403[_0x07d1('0x2b')](_0x493923);}return _0x1bd403[_0x07d1('0x2c')](_0x493923)['end']();};}function respondWithResult(_0xc92a99,_0x4e3d6d){_0x4e3d6d=_0x4e3d6d||0xc8;return function(_0x39034e){if(_0x39034e){return _0xc92a99['status'](_0x4e3d6d)[_0x07d1('0x2d')](_0x39034e);}};}function respondWithFilteredResult(_0x58bdf4,_0x3f8de2){return function(_0x16a7b6){if(_0x16a7b6){var _0x4a585a=typeof _0x3f8de2[_0x07d1('0x2e')]===_0x07d1('0x2f')&&typeof _0x3f8de2[_0x07d1('0x30')]===_0x07d1('0x2f');var _0x150311=_0x16a7b6['count'];var _0xd6ee18=_0x4a585a?0x0:_0x3f8de2['offset'];var _0x24ef12=_0x4a585a?_0x16a7b6[_0x07d1('0x31')]:_0x3f8de2['offset']+_0x3f8de2[_0x07d1('0x30')];var _0x1316b3;if(_0x24ef12>=_0x150311){_0x24ef12=_0x150311;_0x1316b3=0xc8;}else{_0x1316b3=0xce;}_0x58bdf4[_0x07d1('0x2c')](_0x1316b3);return _0x58bdf4[_0x07d1('0x32')]('Content-Range',_0xd6ee18+'-'+_0x24ef12+'/'+_0x150311)[_0x07d1('0x2d')](_0x16a7b6);}return null;};}function patchUpdates(_0x2b3e4c){return function(_0x967432){try{jsonpatch[_0x07d1('0x33')](_0x967432,_0x2b3e4c,!![]);}catch(_0x128c2a){return BPromise['reject'](_0x128c2a);}return _0x967432['save']();};}function saveUpdates(_0x2491d7,_0x33aed9){return function(_0x3d7481){if(_0x3d7481){return _0x3d7481['update'](_0x2491d7)[_0x07d1('0x1f')](function(_0x1fbb6a){return _0x1fbb6a;});}return null;};}function removeEntity(_0x89e7ad,_0x30b1a5){return function(_0x2e65ce){if(_0x2e65ce){return _0x2e65ce[_0x07d1('0x34')]()['then'](function(){var _0x4a9a9e=_0x2e65ce[_0x07d1('0x35')]({'plain':!![]});var _0x2c28ea='ChatQueues';return db[_0x07d1('0x36')]['destroy']({'where':{'type':_0x2c28ea,'resourceId':_0x4a9a9e['id']}})[_0x07d1('0x1f')](function(){return _0x2e65ce;});})[_0x07d1('0x1f')](function(){_0x89e7ad[_0x07d1('0x2c')](0xcc)[_0x07d1('0x37')]();});}};}function handleEntityNotFound(_0x10924b,_0x538355){return function(_0x16713d){if(!_0x16713d){_0x10924b[_0x07d1('0x2b')](0x194);}return _0x16713d;};}function handleError(_0x4e85b0,_0x2a026a){_0x2a026a=_0x2a026a||0x1f4;return function(_0x2952fe){logger['error'](_0x2952fe[_0x07d1('0x38')]);if(_0x2952fe[_0x07d1('0x39')]){delete _0x2952fe[_0x07d1('0x39')];}_0x4e85b0[_0x07d1('0x2c')](_0x2a026a)[_0x07d1('0x3a')](_0x2952fe);};}exports[_0x07d1('0x3b')]=function(_0x2e047f,_0x5ebc14){var _0xa8e6fa={},_0x39daff={},_0x38f3ae={'count':0x0,'rows':[]};var _0x2d9dd0=_[_0x07d1('0x3c')](db['ChatQueue'][_0x07d1('0x3d')],function(_0x3fb423){return{'name':_0x3fb423['fieldName'],'type':_0x3fb423[_0x07d1('0x3e')][_0x07d1('0x3f')]};});_0x39daff[_0x07d1('0x40')]=_[_0x07d1('0x3c')](_0x2d9dd0,_0x07d1('0x39'));_0x39daff[_0x07d1('0x41')]=_[_0x07d1('0x42')](_0x2e047f[_0x07d1('0x41')]);_0x39daff[_0x07d1('0x43')]=_[_0x07d1('0x44')](_0x39daff[_0x07d1('0x40')],_0x39daff[_0x07d1('0x41')]);_0xa8e6fa[_0x07d1('0x45')]=_[_0x07d1('0x44')](_0x39daff[_0x07d1('0x40')],qs[_0x07d1('0x46')](_0x2e047f[_0x07d1('0x41')][_0x07d1('0x46')]));_0xa8e6fa[_0x07d1('0x45')]=_0xa8e6fa['attributes'][_0x07d1('0x47')]?_0xa8e6fa['attributes']:_0x39daff[_0x07d1('0x40')];if(!_0x2e047f['query'][_0x07d1('0x48')](_0x07d1('0x49'))){_0xa8e6fa[_0x07d1('0x30')]=qs['limit'](_0x2e047f[_0x07d1('0x41')][_0x07d1('0x30')]);_0xa8e6fa['offset']=qs[_0x07d1('0x2e')](_0x2e047f[_0x07d1('0x41')]['offset']);}_0xa8e6fa[_0x07d1('0x4a')]=qs[_0x07d1('0x4b')](_0x2e047f[_0x07d1('0x41')][_0x07d1('0x4b')]);_0xa8e6fa['where']=qs['filters'](_[_0x07d1('0x4c')](_0x2e047f[_0x07d1('0x41')],_0x39daff['filters']),_0x2d9dd0);if(_0x2e047f[_0x07d1('0x41')][_0x07d1('0x4d')]){_0xa8e6fa['where']=_['merge'](_0xa8e6fa[_0x07d1('0x4e')],{'$or':_['map'](_0x2d9dd0,function(_0x31e7cf){if(_0x31e7cf['type']!==_0x07d1('0x4f')){var _0x597034={};_0x597034[_0x31e7cf[_0x07d1('0x39')]]={'$like':'%'+_0x2e047f[_0x07d1('0x41')]['filter']+'%'};return _0x597034;}})});}_0xa8e6fa=_[_0x07d1('0x50')]({},_0xa8e6fa,_0x2e047f['options']);var _0x1513b3={'where':_0xa8e6fa[_0x07d1('0x4e')]};return db[_0x07d1('0x51')][_0x07d1('0x31')](_0x1513b3)[_0x07d1('0x1f')](function(_0xf49e4a){_0x38f3ae[_0x07d1('0x31')]=_0xf49e4a;if(_0x2e047f[_0x07d1('0x41')]['includeAll']){_0xa8e6fa['include']=[{'all':!![]}];}return db[_0x07d1('0x51')][_0x07d1('0x52')](_0xa8e6fa);})[_0x07d1('0x1f')](function(_0x50ac7f){_0x38f3ae['rows']=_0x50ac7f;return _0x38f3ae;})[_0x07d1('0x1f')](respondWithFilteredResult(_0x5ebc14,_0xa8e6fa))[_0x07d1('0x2a')](handleError(_0x5ebc14,null));};exports[_0x07d1('0x53')]=function(_0x2f30bf,_0x17c5f1){var _0x2c781b={'raw':!![],'where':{'id':_0x2f30bf[_0x07d1('0x54')]['id']}},_0x262c1d={};_0x262c1d[_0x07d1('0x40')]=_[_0x07d1('0x42')](db[_0x07d1('0x51')][_0x07d1('0x3d')]);_0x262c1d[_0x07d1('0x41')]=_['keys'](_0x2f30bf['query']);_0x262c1d['filters']=_[_0x07d1('0x44')](_0x262c1d[_0x07d1('0x40')],_0x262c1d[_0x07d1('0x41')]);_0x2c781b[_0x07d1('0x45')]=_[_0x07d1('0x44')](_0x262c1d[_0x07d1('0x40')],qs[_0x07d1('0x46')](_0x2f30bf[_0x07d1('0x41')]['fields']));_0x2c781b['attributes']=_0x2c781b[_0x07d1('0x45')][_0x07d1('0x47')]?_0x2c781b[_0x07d1('0x45')]:_0x262c1d[_0x07d1('0x40')];if(_0x2f30bf[_0x07d1('0x41')][_0x07d1('0x55')]){_0x2c781b['include']=[{'all':!![]}];}_0x2c781b=_[_0x07d1('0x50')]({},_0x2c781b,_0x2f30bf[_0x07d1('0x56')]);return db[_0x07d1('0x51')][_0x07d1('0x57')](_0x2c781b)[_0x07d1('0x1f')](handleEntityNotFound(_0x17c5f1,null))['then'](respondWithResult(_0x17c5f1,null))[_0x07d1('0x2a')](handleError(_0x17c5f1,null));};exports['create']=function(_0x203cce,_0x22399e){return db[_0x07d1('0x51')][_0x07d1('0x58')](_0x203cce['body'],{})['then'](function(_0x218ffa){var _0x2fa4d0=_0x203cce['user'][_0x07d1('0x35')]({'plain':!![]});if(!_0x2fa4d0)throw new Error(_0x07d1('0x59'));if(_0x2fa4d0[_0x07d1('0x5a')]===_0x07d1('0x5b')){var _0x3edf2a=_0x218ffa[_0x07d1('0x35')]({'plain':!![]});var _0x1ab738=_0x07d1('0x5c');return db[_0x07d1('0x5d')][_0x07d1('0x57')]({'where':{'name':_0x1ab738,'userProfileId':_0x2fa4d0[_0x07d1('0x5e')]},'raw':!![]})[_0x07d1('0x1f')](function(_0x4af579){if(_0x4af579&&_0x4af579[_0x07d1('0x5f')]===0x0){return db['UserProfileResource'][_0x07d1('0x58')]({'name':_0x3edf2a[_0x07d1('0x39')],'resourceId':_0x3edf2a['id'],'type':_0x4af579['name'],'sectionId':_0x4af579['id']},{})[_0x07d1('0x1f')](function(){return _0x218ffa;});}else{return _0x218ffa;}})['catch'](function(_0xff8087){logger[_0x07d1('0x25')](_0x07d1('0x60'),_0xff8087);throw _0xff8087;});}return _0x218ffa;})[_0x07d1('0x1f')](respondWithResult(_0x22399e,0xc9))['catch'](handleError(_0x22399e,null));};exports['update']=function(_0x5ac7f6,_0x1973b1){if(_0x5ac7f6[_0x07d1('0x61')]['id']){delete _0x5ac7f6[_0x07d1('0x61')]['id'];}return db[_0x07d1('0x51')][_0x07d1('0x57')]({'where':{'id':_0x5ac7f6[_0x07d1('0x54')]['id']}})[_0x07d1('0x1f')](handleEntityNotFound(_0x1973b1,null))['then'](saveUpdates(_0x5ac7f6[_0x07d1('0x61')],null))[_0x07d1('0x1f')](respondWithResult(_0x1973b1,null))[_0x07d1('0x2a')](handleError(_0x1973b1,null));};exports[_0x07d1('0x34')]=function(_0x6c7657,_0x2d4457){return db[_0x07d1('0x51')][_0x07d1('0x57')]({'where':{'id':_0x6c7657[_0x07d1('0x54')]['id']}})[_0x07d1('0x1f')](handleEntityNotFound(_0x2d4457,null))[_0x07d1('0x1f')](removeEntity(_0x2d4457,null))[_0x07d1('0x2a')](handleError(_0x2d4457,null));};exports[_0x07d1('0x62')]=function(_0xf8d927,_0x40e8e4){return db['ChatQueue'][_0x07d1('0x62')]()[_0x07d1('0x1f')](respondWithResult(_0x40e8e4,null))[_0x07d1('0x2a')](handleError(_0x40e8e4,null));};exports[_0x07d1('0x63')]=function(_0x5ceb1d,_0x7a06b7,_0x3d4009){var _0x5bdfa3={'raw':!![],'where':{}},_0x460854={},_0x53d5f9;return db[_0x07d1('0x51')][_0x07d1('0x64')]({'where':{'id':_0x5ceb1d[_0x07d1('0x54')]['id']}})[_0x07d1('0x1f')](handleEntityNotFound(_0x7a06b7,null))['then'](function(_0x4357ae){if(_0x4357ae){_0x53d5f9=_0x4357ae[_0x07d1('0x35')]({'plain':!![]});_0x460854[_0x07d1('0x40')]=_[_0x07d1('0x42')](db[_0x07d1('0x65')][_0x07d1('0x3d')]);_0x460854[_0x07d1('0x41')]=_[_0x07d1('0x42')](_0x5ceb1d['query']);_0x460854[_0x07d1('0x43')]=_[_0x07d1('0x44')](_0x460854[_0x07d1('0x40')],_0x460854[_0x07d1('0x41')]);_0x5bdfa3[_0x07d1('0x45')]=_['intersection'](_0x460854['model'],qs[_0x07d1('0x46')](_0x5ceb1d[_0x07d1('0x41')][_0x07d1('0x46')]));_0x5bdfa3[_0x07d1('0x45')]=_0x5bdfa3[_0x07d1('0x45')][_0x07d1('0x47')]?_0x5bdfa3[_0x07d1('0x45')]:_0x460854[_0x07d1('0x40')];if(!_0x5ceb1d[_0x07d1('0x41')][_0x07d1('0x48')](_0x07d1('0x49'))){_0x5bdfa3[_0x07d1('0x30')]=qs[_0x07d1('0x30')](_0x5ceb1d['query'][_0x07d1('0x30')]);_0x5bdfa3[_0x07d1('0x2e')]=qs[_0x07d1('0x2e')](_0x5ceb1d[_0x07d1('0x41')][_0x07d1('0x2e')]);}_0x5bdfa3[_0x07d1('0x4a')]=qs[_0x07d1('0x4b')](_0x5ceb1d[_0x07d1('0x41')][_0x07d1('0x4b')]);_0x5bdfa3[_0x07d1('0x4e')]=qs[_0x07d1('0x43')](_[_0x07d1('0x4c')](_0x5ceb1d[_0x07d1('0x41')],_0x460854[_0x07d1('0x43')]));_0x5bdfa3['where']['ChatQueueId']=_0x4357ae['id'];if(_0x5ceb1d[_0x07d1('0x41')][_0x07d1('0x4d')]){_0x5bdfa3[_0x07d1('0x4e')]=_[_0x07d1('0x50')](_0x5bdfa3[_0x07d1('0x4e')],{'$or':_[_0x07d1('0x3c')](_0x5bdfa3[_0x07d1('0x45')],function(_0x220e98){var _0x14bb26={};_0x14bb26[_0x220e98]={'$like':'%'+_0x5ceb1d[_0x07d1('0x41')][_0x07d1('0x4d')]+'%'};return _0x14bb26;})});}_0x5bdfa3=_[_0x07d1('0x50')]({},_0x5bdfa3,_0x5ceb1d[_0x07d1('0x56')]);return db[_0x07d1('0x65')][_0x07d1('0x52')](_0x5bdfa3);}})['then'](function(_0x2c7928){if(_0x2c7928){return db['User'][_0x07d1('0x66')]({'where':{'id':_[_0x07d1('0x3c')](_0x2c7928,'UserId'),'role':_0x07d1('0x67')},'attributes':['id',_0x07d1('0x39'),_0x07d1('0x68'),_0x07d1('0x69'),'createdAt']});}})[_0x07d1('0x1f')](function(_0x48404c){if(_0x48404c){return{'count':_0x48404c[_0x07d1('0x31')],'rows':_[_0x07d1('0x3c')](_0x48404c[_0x07d1('0x6a')],function(_0x19b4d8){return{'membername':_0x19b4d8[_0x07d1('0x39')],'UserId':_0x19b4d8['id'],'queue_name':_0x53d5f9[_0x07d1('0x39')],'ChatQueueId':_0x53d5f9['id'],'interface':util['format'](_0x07d1('0x6b'),'SIP',_0x19b4d8[_0x07d1('0x39')]),'penalty':0x0,'paused':_0x19b4d8[_0x07d1('0x68')],'createdAt':_0x19b4d8[_0x07d1('0x6c')],'updatedAt':_0x19b4d8[_0x07d1('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x07d1('0x1f')](respondWithFilteredResult(_0x7a06b7,_0x5bdfa3))[_0x07d1('0x2a')](handleError(_0x7a06b7,null));};exports[_0x07d1('0x6d')]=function(_0x415228,_0x387b5f,_0x47fc87){var _0x76f9a4={};var _0x2e3f7d={};var _0x2497d0;var _0x4c57b1;return db[_0x07d1('0x51')][_0x07d1('0x64')]({'where':{'id':_0x415228[_0x07d1('0x54')]['id']}})[_0x07d1('0x1f')](handleEntityNotFound(_0x387b5f,null))[_0x07d1('0x1f')](function(_0x48870b){if(_0x48870b){_0x2497d0=_0x48870b;_0x2e3f7d[_0x07d1('0x40')]=_['keys'](db[_0x07d1('0x6e')][_0x07d1('0x3d')]);_0x2e3f7d[_0x07d1('0x41')]=_[_0x07d1('0x42')](_0x415228[_0x07d1('0x41')]);_0x2e3f7d[_0x07d1('0x43')]=_['intersection'](_0x2e3f7d[_0x07d1('0x40')],_0x2e3f7d[_0x07d1('0x41')]);_0x76f9a4[_0x07d1('0x45')]=_[_0x07d1('0x44')](_0x2e3f7d[_0x07d1('0x40')],qs[_0x07d1('0x46')](_0x415228[_0x07d1('0x41')][_0x07d1('0x46')]));_0x76f9a4[_0x07d1('0x45')]=_0x76f9a4[_0x07d1('0x45')][_0x07d1('0x47')]?_0x76f9a4[_0x07d1('0x45')]:_0x2e3f7d['model'];_0x76f9a4['order']=qs[_0x07d1('0x4b')](_0x415228[_0x07d1('0x41')][_0x07d1('0x4b')]);_0x76f9a4[_0x07d1('0x4e')]=qs[_0x07d1('0x43')](_[_0x07d1('0x4c')](_0x415228['query'],_0x2e3f7d[_0x07d1('0x43')]));if(_0x415228[_0x07d1('0x41')][_0x07d1('0x4d')]){_0x76f9a4[_0x07d1('0x4e')]=_[_0x07d1('0x50')](_0x76f9a4[_0x07d1('0x4e')],{'$or':_[_0x07d1('0x3c')](_0x76f9a4[_0x07d1('0x45')],function(_0xefd951){var _0x307cc8={};_0x307cc8[_0xefd951]={'$like':'%'+_0x415228[_0x07d1('0x41')][_0x07d1('0x4d')]+'%'};return _0x307cc8;})});}_0x76f9a4=_['merge']({},_0x76f9a4,_0x415228[_0x07d1('0x56')]);return _0x2497d0[_0x07d1('0x6d')](_0x76f9a4);}})[_0x07d1('0x1f')](function(_0x2f3bd3){if(_0x2f3bd3){_0x4c57b1=_0x2f3bd3[_0x07d1('0x47')];if(!_0x415228['query'][_0x07d1('0x48')](_0x07d1('0x49'))){_0x76f9a4[_0x07d1('0x30')]=qs[_0x07d1('0x30')](_0x415228[_0x07d1('0x41')][_0x07d1('0x30')]);_0x76f9a4[_0x07d1('0x2e')]=qs['offset'](_0x415228[_0x07d1('0x41')]['offset']);}return _0x2497d0[_0x07d1('0x6d')](_0x76f9a4);}})[_0x07d1('0x1f')](function(_0x5d5285){if(_0x5d5285){return _0x5d5285?{'count':_0x4c57b1,'rows':_0x5d5285}:null;}})[_0x07d1('0x1f')](respondWithResult(_0x387b5f,null))[_0x07d1('0x2a')](handleError(_0x387b5f,null));};exports[_0x07d1('0x6f')]=function(_0x544e35,_0x277fab,_0xd1ead2){var _0x4be875=_0x544e35[_0x07d1('0x61')]['ids'];return db['Team'][_0x07d1('0x52')]({'where':{'id':_0x4be875},'attributes':['id'],'include':[{'model':db[_0x07d1('0x70')],'as':'Agents','attributes':['id',_0x07d1('0x39'),_0x07d1('0x71'),_0x07d1('0x72'),_0x07d1('0x73')],'raw':!![]}]})[_0x07d1('0x1f')](function(_0x2926e2){if(_0x2926e2){var _0x30cfb7=_[_0x07d1('0x74')](_0x2926e2,function(_0x5a60cb){var _0x21ca08=_0x5a60cb[_0x07d1('0x35')]({'plain':!![]});return _0x21ca08[_0x07d1('0x75')];});return db[_0x07d1('0x51')]['find']({'where':{'id':_0x544e35['params']['id']}})[_0x07d1('0x1f')](function(_0x4baf2d){return db['sequelize'][_0x07d1('0x76')](function(_0x3b0a8a){return _0x4baf2d['addTeams'](_0x4be875,{'transaction':_0x3b0a8a})[_0x07d1('0x1f')](function(){return BPromise[_0x07d1('0x77')](_0x30cfb7,function(_0x27a09f){return db['UserChatQueue'][_0x07d1('0x78')]({'where':{'UserId':_0x27a09f['id'],'ChatQueueId':_0x544e35['params']['id']},'transaction':_0x3b0a8a});});})[_0x07d1('0x1f')](function(){_0x30cfb7['forEach'](function(_0x1d2258){socket[_0x07d1('0x79')](_0x07d1('0x7a'),{'UserId':_0x1d2258['id'],'ChatQueueId':_0x4baf2d['id']});});});});});}})[_0x07d1('0x1f')](respondWithStatusCode(_0x277fab,null))[_0x07d1('0x2a')](handleError(_0x277fab,null));};exports[_0x07d1('0x7b')]=function(_0x2c6ecf,_0x27eeee,_0x145503){return db[_0x07d1('0x6e')][_0x07d1('0x52')]({'where':{'id':_0x2c6ecf[_0x07d1('0x41')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x07d1('0x1f')](handleEntityNotFound(_0x27eeee,null))['then'](function(_0xee4035){var _0x3e84d6=_['map'](_0xee4035,'id');var _0x4314e3=[];var _0x187c21=[];var _0x31c4f4=squel['select']();_0x31c4f4[_0x07d1('0x7c')](_0x07d1('0x7d'))[_0x07d1('0x7e')](_0x07d1('0x7f'),'tq')[_0x07d1('0x80')](_0x07d1('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x2c6ecf[_0x07d1('0x54')]['id']);for(var _0x3e2b36=0x0;_0x3e2b36<_0xee4035['length'];_0x3e2b36+=0x1){let _0x5613ce=_0xee4035[_0x3e2b36];for(var _0x2f2957=0x0;_0x2f2957<_0x5613ce[_0x07d1('0x75')][_0x07d1('0x47')];_0x2f2957+=0x1){let _0x272955=_0x5613ce['Agents'][_0x2f2957];var _0x451786=_0x31c4f4[_0x07d1('0x82')]();_0x451786['where']('ut.UserId\x20=\x20?',_0x272955['id']);_0x187c21[_0x07d1('0x83')](db[_0x07d1('0x84')][_0x07d1('0x41')](_0x451786[_0x07d1('0x85')](),{'type':db[_0x07d1('0x84')]['QueryTypes'][_0x07d1('0x86')]})[_0x07d1('0x1f')](function(_0x3ca01e){if(_0x3ca01e[_0x07d1('0x47')]===0x1){return _0x272955['id'];}else{var _0x5a6be2=_[_0x07d1('0x87')](_['map'](_0x3ca01e,_0x07d1('0x88')),function(_0x134d7e){return _[_0x07d1('0x89')](_0x3e84d6,_0x134d7e);});if(_0x5a6be2){return _0x272955['id'];}}}));}}return BPromise[_0x07d1('0x8a')](_0x187c21)[_0x07d1('0x1f')](function(_0x188751){_0x4314e3=_(_0x4314e3)[_0x07d1('0x8b')](_0x188751)[_0x07d1('0x8c')]()[_0x07d1('0x8d')]();return db[_0x07d1('0x51')]['find']({'where':{'id':_0x2c6ecf[_0x07d1('0x54')]['id']}})[_0x07d1('0x1f')](function(_0x485557){return db[_0x07d1('0x84')][_0x07d1('0x76')](function(_0x565dde){return _0x485557[_0x07d1('0x7b')](_0x2c6ecf['query']['ids'],{'transaction':_0x565dde})[_0x07d1('0x1f')](function(){if(!_[_0x07d1('0x8e')](_0x4314e3)){return _0x485557[_0x07d1('0x8f')](_0x4314e3,{'transaction':_0x565dde});}})[_0x07d1('0x1f')](function(){_0x4314e3[_0x07d1('0x90')](function(_0x46c80f){socket[_0x07d1('0x79')](_0x07d1('0x91'),{'UserId':_0x46c80f,'ChatQueueId':_0x485557['id']});});});});});});})[_0x07d1('0x1f')](respondWithStatusCode(_0x27eeee,null))[_0x07d1('0x2a')](handleError(_0x27eeee,null));};exports[_0x07d1('0x92')]=function(_0x161432,_0x3cfc2b,_0xcd863e){return db[_0x07d1('0x51')][_0x07d1('0x57')]({'where':{'id':_0x161432['params']['id']}})[_0x07d1('0x1f')](handleEntityNotFound(_0x3cfc2b,null))[_0x07d1('0x1f')](function(_0x5ddbf9){if(_0x5ddbf9){return _0x5ddbf9[_0x07d1('0x92')](_0x161432[_0x07d1('0x61')][_0x07d1('0x93')],_[_0x07d1('0x94')](_0x161432[_0x07d1('0x61')],[_0x07d1('0x93'),'id'])||{})[_0x07d1('0x95')](function(_0x3bea6b){for(var _0x41156b=0x0;_0x41156b<_0x161432[_0x07d1('0x61')]['ids']['length'];_0x41156b+=0x1){socket[_0x07d1('0x79')](_0x07d1('0x7a'),{'UserId':Number(_0x161432['body'][_0x07d1('0x93')][_0x41156b]),'ChatQueueId':Number(_0x161432['params']['id'])});}return _0x3bea6b;});}})['then'](respondWithResult(_0x3cfc2b,null))['catch'](handleError(_0x3cfc2b,null));};exports[_0x07d1('0x8f')]=function(_0x19a180,_0x11b774,_0x3ec169){return db[_0x07d1('0x51')]['find']({'where':{'id':_0x19a180[_0x07d1('0x54')]['id']}})[_0x07d1('0x1f')](handleEntityNotFound(_0x11b774,null))[_0x07d1('0x1f')](function(_0x121e11){if(_0x121e11){return _0x121e11[_0x07d1('0x8f')](_0x19a180[_0x07d1('0x41')][_0x07d1('0x93')])[_0x07d1('0x1f')](function(){if(_['isArray'](_0x19a180[_0x07d1('0x41')][_0x07d1('0x93')])){for(var _0x5e82aa=0x0;_0x5e82aa<_0x19a180[_0x07d1('0x41')]['ids']['length'];_0x5e82aa+=0x1){socket[_0x07d1('0x79')]('userChatQueue:remove',{'UserId':Number(_0x19a180['query'][_0x07d1('0x93')][_0x5e82aa]),'ChatQueueId':Number(_0x19a180[_0x07d1('0x54')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x19a180[_0x07d1('0x41')][_0x07d1('0x93')]),'ChatQueueId':Number(_0x19a180[_0x07d1('0x54')]['id'])});}});}})[_0x07d1('0x1f')](respondWithStatusCode(_0x11b774,null))[_0x07d1('0x2a')](handleError(_0x11b774,null));};exports[_0x07d1('0x96')]=function(_0x2f58ba,_0x495f4c,_0x33134b){var _0xa9d707={};var _0x58bff5={};var _0x2489fc;var _0x239e9b;return db[_0x07d1('0x51')]['findOne']({'where':{'id':_0x2f58ba[_0x07d1('0x54')]['id']}})[_0x07d1('0x1f')](handleEntityNotFound(_0x495f4c,null))[_0x07d1('0x1f')](function(_0x115a33){if(_0x115a33){_0x2489fc=_0x115a33;_0x58bff5['model']=_[_0x07d1('0x42')](db[_0x07d1('0x70')][_0x07d1('0x3d')]);_0x58bff5[_0x07d1('0x41')]=_[_0x07d1('0x42')](_0x2f58ba[_0x07d1('0x41')]);_0x58bff5['filters']=_[_0x07d1('0x44')](_0x58bff5[_0x07d1('0x40')],_0x58bff5[_0x07d1('0x41')]);_0xa9d707[_0x07d1('0x45')]=_[_0x07d1('0x44')](_0x58bff5[_0x07d1('0x40')],qs[_0x07d1('0x46')](_0x2f58ba['query']['fields']));_0xa9d707['attributes']=_0xa9d707['attributes']['length']?_0xa9d707[_0x07d1('0x45')]:_0x58bff5[_0x07d1('0x40')];_0xa9d707[_0x07d1('0x4a')]=qs['sort'](_0x2f58ba[_0x07d1('0x41')]['sort']);_0xa9d707[_0x07d1('0x4e')]=qs[_0x07d1('0x43')](_[_0x07d1('0x4c')](_0x2f58ba[_0x07d1('0x41')],_0x58bff5[_0x07d1('0x43')]));if(_0x2f58ba[_0x07d1('0x41')]['filter']){_0xa9d707[_0x07d1('0x4e')]=_[_0x07d1('0x50')](_0xa9d707[_0x07d1('0x4e')],{'$or':_[_0x07d1('0x3c')](_0xa9d707[_0x07d1('0x45')],function(_0x41e5e6){var _0x3743df={};_0x3743df[_0x41e5e6]={'$like':'%'+_0x2f58ba['query'][_0x07d1('0x4d')]+'%'};return _0x3743df;})});}_0xa9d707=_[_0x07d1('0x50')]({},_0xa9d707,_0x2f58ba[_0x07d1('0x56')]);return _0x2489fc[_0x07d1('0x96')](_0xa9d707);}})['then'](function(_0x2bfec0){if(_0x2bfec0){_0x239e9b=_0x2bfec0['length'];if(!_0x2f58ba[_0x07d1('0x41')][_0x07d1('0x48')](_0x07d1('0x49'))){_0xa9d707[_0x07d1('0x30')]=qs[_0x07d1('0x30')](_0x2f58ba[_0x07d1('0x41')][_0x07d1('0x30')]);_0xa9d707[_0x07d1('0x2e')]=qs[_0x07d1('0x2e')](_0x2f58ba[_0x07d1('0x41')][_0x07d1('0x2e')]);}return _0x2489fc[_0x07d1('0x96')](_0xa9d707);}})[_0x07d1('0x1f')](function(_0x2bebf1){if(_0x2bebf1){return _0x2bebf1?{'count':_0x239e9b,'rows':_0x2bebf1}:null;}})[_0x07d1('0x1f')](respondWithResult(_0x495f4c,null))[_0x07d1('0x2a')](handleError(_0x495f4c,null));};
\ No newline at end of file
+var _0x915d=['../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','count','format','%s/%s','SIP','Team','getTeams','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','includes','union','value','isEmpty','removeAgents','userChatQueue:remove','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x915d,0x83));var _0xd915=function(_0x45c84b,_0x4d3e9a){_0x45c84b=_0x45c84b-0x0;var _0x5cd3e1=_0x915d[_0x45c84b];return _0x5cd3e1;};'use strict';var emlformat=require(_0xd915('0x0'));var rimraf=require(_0xd915('0x1'));var zipdir=require(_0xd915('0x2'));var jsonpatch=require(_0xd915('0x3'));var rp=require('request-promise');var moment=require(_0xd915('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd915('0x5'));var util=require(_0xd915('0x6'));var path=require('path');var sox=require(_0xd915('0x7'));var csv=require(_0xd915('0x8'));var ejs=require(_0xd915('0x9'));var fs=require('fs');var fs_extra=require(_0xd915('0xa'));var _=require(_0xd915('0xb'));var squel=require(_0xd915('0xc'));var crypto=require('crypto');var jsforce=require(_0xd915('0xd'));var deskjs=require(_0xd915('0xe'));var toCsv=require(_0xd915('0x8'));var querystring=require(_0xd915('0xf'));var Papa=require('papaparse');var Redis=require(_0xd915('0x10'));var authService=require(_0xd915('0x11'));var qs=require(_0xd915('0x12'));var as=require(_0xd915('0x13'));var hardwareService=require(_0xd915('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd915('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd915('0x16'))['db'];config[_0xd915('0x17')]=_[_0xd915('0x18')](config[_0xd915('0x17')],{'host':_0xd915('0x19'),'port':0x18eb});var socket=require(_0xd915('0x1a'))(new Redis(config[_0xd915('0x17')]));require('./chatQueue.socket')[_0xd915('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd915('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x549537,_0xec6d17,_0xf4f37c,_0x442714){return new BPromise(function(_0xc76c85,_0x3e0048){var _0xce5aee=_0x442714||client;return _0xce5aee[_0xd915('0x1d')](_0x549537,_0xf4f37c)[_0xd915('0x1e')](function(_0x284b13){logger[_0xd915('0x1f')]('ChatQueue,\x20%s,\x20%s',_0xec6d17,_0xd915('0x20'));logger[_0xd915('0x21')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xec6d17,_0xd915('0x20'),JSON[_0xd915('0x22')](_0x284b13));if(_0x284b13[_0xd915('0x23')]){if(_0x284b13[_0xd915('0x23')][_0xd915('0x24')]===0x1f4){logger[_0xd915('0x23')](_0xd915('0x25'),_0xec6d17,_0x284b13[_0xd915('0x23')][_0xd915('0x26')]);return _0x3e0048(_0x284b13[_0xd915('0x23')][_0xd915('0x26')]);}logger['error'](_0xd915('0x25'),_0xec6d17,_0x284b13[_0xd915('0x23')][_0xd915('0x26')]);return _0xc76c85(_0x284b13[_0xd915('0x23')]['message']);}else{logger['info'](_0xd915('0x25'),_0xec6d17,_0xd915('0x20'));_0xc76c85(_0x284b13[_0xd915('0x27')][_0xd915('0x26')]);}})['catch'](function(_0x2e9f18){logger[_0xd915('0x23')](_0xd915('0x25'),_0xec6d17,_0x2e9f18);_0x3e0048(_0x2e9f18);});});}function respondWithStatusCode(_0x4a4f72,_0x19969f){_0x19969f=_0x19969f||0xcc;return function(_0x158bef){if(_0x158bef){return _0x4a4f72[_0xd915('0x28')](_0x19969f);}return _0x4a4f72['status'](_0x19969f)[_0xd915('0x29')]();};}function respondWithResult(_0x3f6ddf,_0x443dae){_0x443dae=_0x443dae||0xc8;return function(_0x3db6af){if(_0x3db6af){return _0x3f6ddf[_0xd915('0x2a')](_0x443dae)[_0xd915('0x2b')](_0x3db6af);}};}function respondWithFilteredResult(_0x1e8d42,_0x36b88c){return function(_0x2383a7){if(_0x2383a7){var _0x1d3070=typeof _0x36b88c[_0xd915('0x2c')]===_0xd915('0x2d')&&typeof _0x36b88c['limit']===_0xd915('0x2d');var _0x41d52f=_0x2383a7['count'];var _0x549d4c=_0x1d3070?0x0:_0x36b88c['offset'];var _0x1bef48=_0x1d3070?_0x2383a7['count']:_0x36b88c[_0xd915('0x2c')]+_0x36b88c['limit'];var _0x36930c;if(_0x1bef48>=_0x41d52f){_0x1bef48=_0x41d52f;_0x36930c=0xc8;}else{_0x36930c=0xce;}_0x1e8d42[_0xd915('0x2a')](_0x36930c);return _0x1e8d42['set'](_0xd915('0x2e'),_0x549d4c+'-'+_0x1bef48+'/'+_0x41d52f)[_0xd915('0x2b')](_0x2383a7);}return null;};}function patchUpdates(_0x4edb1d){return function(_0x3bc1b9){try{jsonpatch[_0xd915('0x2f')](_0x3bc1b9,_0x4edb1d,!![]);}catch(_0xd58e3e){return BPromise[_0xd915('0x30')](_0xd58e3e);}return _0x3bc1b9[_0xd915('0x31')]();};}function saveUpdates(_0x2bc5ea,_0x1aa36a){return function(_0x2220e3){if(_0x2220e3){return _0x2220e3[_0xd915('0x32')](_0x2bc5ea)[_0xd915('0x1e')](function(_0x2088e8){return _0x2088e8;});}return null;};}function removeEntity(_0x25122b,_0x25a7a2){return function(_0x1ae6a0){if(_0x1ae6a0){return _0x1ae6a0[_0xd915('0x33')]()['then'](function(){var _0x33924b=_0x1ae6a0[_0xd915('0x34')]({'plain':!![]});var _0x5015c8='ChatQueues';return db[_0xd915('0x35')][_0xd915('0x33')]({'where':{'type':_0x5015c8,'resourceId':_0x33924b['id']}})[_0xd915('0x1e')](function(){return _0x1ae6a0;});})[_0xd915('0x1e')](function(){_0x25122b[_0xd915('0x2a')](0xcc)[_0xd915('0x29')]();});}};}function handleEntityNotFound(_0x2ff8ad,_0x556c16){return function(_0x52f37f){if(!_0x52f37f){_0x2ff8ad[_0xd915('0x28')](0x194);}return _0x52f37f;};}function handleError(_0x26d6fc,_0x262af5){_0x262af5=_0x262af5||0x1f4;return function(_0x3e9b94){logger[_0xd915('0x23')](_0x3e9b94['stack']);if(_0x3e9b94[_0xd915('0x36')]){delete _0x3e9b94[_0xd915('0x36')];}_0x26d6fc['status'](_0x262af5)[_0xd915('0x37')](_0x3e9b94);};}exports[_0xd915('0x38')]=function(_0x479158,_0xd106c4){var _0x2b2f6f={},_0x16c154={},_0x447add={'count':0x0,'rows':[]};var _0xf8b32e=_[_0xd915('0x39')](db[_0xd915('0x3a')][_0xd915('0x3b')],function(_0x9ea996){return{'name':_0x9ea996[_0xd915('0x3c')],'type':_0x9ea996['type'][_0xd915('0x3d')]};});_0x16c154[_0xd915('0x3e')]=_['map'](_0xf8b32e,'name');_0x16c154[_0xd915('0x3f')]=_[_0xd915('0x40')](_0x479158[_0xd915('0x3f')]);_0x16c154[_0xd915('0x41')]=_[_0xd915('0x42')](_0x16c154[_0xd915('0x3e')],_0x16c154[_0xd915('0x3f')]);_0x2b2f6f[_0xd915('0x43')]=_[_0xd915('0x42')](_0x16c154[_0xd915('0x3e')],qs['fields'](_0x479158[_0xd915('0x3f')][_0xd915('0x44')]));_0x2b2f6f[_0xd915('0x43')]=_0x2b2f6f[_0xd915('0x43')][_0xd915('0x45')]?_0x2b2f6f[_0xd915('0x43')]:_0x16c154[_0xd915('0x3e')];if(!_0x479158[_0xd915('0x3f')][_0xd915('0x46')]('nolimit')){_0x2b2f6f[_0xd915('0x47')]=qs[_0xd915('0x47')](_0x479158['query'][_0xd915('0x47')]);_0x2b2f6f['offset']=qs[_0xd915('0x2c')](_0x479158[_0xd915('0x3f')][_0xd915('0x2c')]);}_0x2b2f6f[_0xd915('0x48')]=qs[_0xd915('0x49')](_0x479158[_0xd915('0x3f')][_0xd915('0x49')]);_0x2b2f6f['where']=qs['filters'](_[_0xd915('0x4a')](_0x479158[_0xd915('0x3f')],_0x16c154['filters']),_0xf8b32e);if(_0x479158[_0xd915('0x3f')][_0xd915('0x4b')]){_0x2b2f6f[_0xd915('0x4c')]=_[_0xd915('0x4d')](_0x2b2f6f[_0xd915('0x4c')],{'$or':_['map'](_0xf8b32e,function(_0x505d39){if(_0x505d39[_0xd915('0x4e')]!=='VIRTUAL'){var _0x46e1c2={};_0x46e1c2[_0x505d39[_0xd915('0x36')]]={'$like':'%'+_0x479158[_0xd915('0x3f')][_0xd915('0x4b')]+'%'};return _0x46e1c2;}})});}_0x2b2f6f=_[_0xd915('0x4d')]({},_0x2b2f6f,_0x479158[_0xd915('0x4f')]);var _0x59a494={'where':_0x2b2f6f[_0xd915('0x4c')]};return db[_0xd915('0x3a')]['count'](_0x59a494)['then'](function(_0xc61c20){_0x447add['count']=_0xc61c20;if(_0x479158['query'][_0xd915('0x50')]){_0x2b2f6f[_0xd915('0x51')]=[{'all':!![]}];}return db[_0xd915('0x3a')][_0xd915('0x52')](_0x2b2f6f);})['then'](function(_0x40868a){_0x447add[_0xd915('0x53')]=_0x40868a;return _0x447add;})[_0xd915('0x1e')](respondWithFilteredResult(_0xd106c4,_0x2b2f6f))[_0xd915('0x54')](handleError(_0xd106c4,null));};exports[_0xd915('0x55')]=function(_0x1e2f58,_0x23f675){var _0x362889={'raw':!![],'where':{'id':_0x1e2f58[_0xd915('0x56')]['id']}},_0x1a9355={};_0x1a9355[_0xd915('0x3e')]=_[_0xd915('0x40')](db['ChatQueue'][_0xd915('0x3b')]);_0x1a9355['query']=_[_0xd915('0x40')](_0x1e2f58[_0xd915('0x3f')]);_0x1a9355[_0xd915('0x41')]=_[_0xd915('0x42')](_0x1a9355['model'],_0x1a9355[_0xd915('0x3f')]);_0x362889['attributes']=_['intersection'](_0x1a9355[_0xd915('0x3e')],qs['fields'](_0x1e2f58[_0xd915('0x3f')][_0xd915('0x44')]));_0x362889['attributes']=_0x362889[_0xd915('0x43')]['length']?_0x362889[_0xd915('0x43')]:_0x1a9355[_0xd915('0x3e')];if(_0x1e2f58[_0xd915('0x3f')][_0xd915('0x50')]){_0x362889[_0xd915('0x51')]=[{'all':!![]}];}_0x362889=_[_0xd915('0x4d')]({},_0x362889,_0x1e2f58[_0xd915('0x4f')]);return db[_0xd915('0x3a')][_0xd915('0x57')](_0x362889)['then'](handleEntityNotFound(_0x23f675,null))[_0xd915('0x1e')](respondWithResult(_0x23f675,null))[_0xd915('0x54')](handleError(_0x23f675,null));};exports[_0xd915('0x58')]=function(_0x3435c0,_0x33ebb6){return db[_0xd915('0x3a')][_0xd915('0x58')](_0x3435c0['body'],{})[_0xd915('0x1e')](function(_0x241b37){var _0x200826=_0x3435c0[_0xd915('0x59')]['get']({'plain':!![]});if(!_0x200826)throw new Error(_0xd915('0x5a'));if(_0x200826[_0xd915('0x5b')]===_0xd915('0x59')){var _0x50e305=_0x241b37[_0xd915('0x34')]({'plain':!![]});var _0x5a61ef=_0xd915('0x5c');return db['UserProfileSection']['find']({'where':{'name':_0x5a61ef,'userProfileId':_0x200826[_0xd915('0x5d')]},'raw':!![]})[_0xd915('0x1e')](function(_0x6b6bfb){if(_0x6b6bfb&&_0x6b6bfb[_0xd915('0x5e')]===0x0){return db[_0xd915('0x35')][_0xd915('0x58')]({'name':_0x50e305['name'],'resourceId':_0x50e305['id'],'type':_0x6b6bfb[_0xd915('0x36')],'sectionId':_0x6b6bfb['id']},{})[_0xd915('0x1e')](function(){return _0x241b37;});}else{return _0x241b37;}})['catch'](function(_0x4c8c9a){logger[_0xd915('0x23')](_0xd915('0x5f'),_0x4c8c9a);throw _0x4c8c9a;});}return _0x241b37;})[_0xd915('0x1e')](respondWithResult(_0x33ebb6,0xc9))[_0xd915('0x54')](handleError(_0x33ebb6,null));};exports[_0xd915('0x32')]=function(_0x5aa697,_0x111329){if(_0x5aa697[_0xd915('0x60')]['id']){delete _0x5aa697[_0xd915('0x60')]['id'];}return db[_0xd915('0x3a')][_0xd915('0x57')]({'where':{'id':_0x5aa697['params']['id']}})[_0xd915('0x1e')](handleEntityNotFound(_0x111329,null))[_0xd915('0x1e')](saveUpdates(_0x5aa697['body'],null))[_0xd915('0x1e')](respondWithResult(_0x111329,null))[_0xd915('0x54')](handleError(_0x111329,null));};exports[_0xd915('0x33')]=function(_0x2ba29f,_0x2655eb){return db[_0xd915('0x3a')][_0xd915('0x57')]({'where':{'id':_0x2ba29f[_0xd915('0x56')]['id']}})['then'](handleEntityNotFound(_0x2655eb,null))[_0xd915('0x1e')](removeEntity(_0x2655eb,null))['catch'](handleError(_0x2655eb,null));};exports['describe']=function(_0x4cdb2e,_0x11e588){return db[_0xd915('0x3a')][_0xd915('0x61')]()[_0xd915('0x1e')](respondWithResult(_0x11e588,null))['catch'](handleError(_0x11e588,null));};exports['getMembers']=function(_0x5e5675,_0x4c5d6d,_0x354ba5){var _0x3b27d2={'raw':!![],'where':{}},_0x8caf6={},_0x4cdd04;return db[_0xd915('0x3a')][_0xd915('0x62')]({'where':{'id':_0x5e5675['params']['id']}})[_0xd915('0x1e')](handleEntityNotFound(_0x4c5d6d,null))[_0xd915('0x1e')](function(_0x2d821f){if(_0x2d821f){_0x4cdd04=_0x2d821f[_0xd915('0x34')]({'plain':!![]});_0x8caf6[_0xd915('0x3e')]=_[_0xd915('0x40')](db[_0xd915('0x63')][_0xd915('0x3b')]);_0x8caf6[_0xd915('0x3f')]=_[_0xd915('0x40')](_0x5e5675['query']);_0x8caf6[_0xd915('0x41')]=_[_0xd915('0x42')](_0x8caf6['model'],_0x8caf6['query']);_0x3b27d2['attributes']=_['intersection'](_0x8caf6['model'],qs['fields'](_0x5e5675[_0xd915('0x3f')]['fields']));_0x3b27d2[_0xd915('0x43')]=_0x3b27d2[_0xd915('0x43')][_0xd915('0x45')]?_0x3b27d2[_0xd915('0x43')]:_0x8caf6['model'];if(!_0x5e5675[_0xd915('0x3f')]['hasOwnProperty']('nolimit')){_0x3b27d2[_0xd915('0x47')]=qs[_0xd915('0x47')](_0x5e5675[_0xd915('0x3f')][_0xd915('0x47')]);_0x3b27d2[_0xd915('0x2c')]=qs[_0xd915('0x2c')](_0x5e5675['query']['offset']);}_0x3b27d2[_0xd915('0x48')]=qs['sort'](_0x5e5675[_0xd915('0x3f')][_0xd915('0x49')]);_0x3b27d2['where']=qs[_0xd915('0x41')](_['pick'](_0x5e5675['query'],_0x8caf6[_0xd915('0x41')]));_0x3b27d2[_0xd915('0x4c')][_0xd915('0x64')]=_0x2d821f['id'];if(_0x5e5675['query'][_0xd915('0x4b')]){_0x3b27d2['where']=_['merge'](_0x3b27d2['where'],{'$or':_[_0xd915('0x39')](_0x3b27d2[_0xd915('0x43')],function(_0x8dc15d){var _0x26ec39={};_0x26ec39[_0x8dc15d]={'$like':'%'+_0x5e5675[_0xd915('0x3f')][_0xd915('0x4b')]+'%'};return _0x26ec39;})});}_0x3b27d2=_[_0xd915('0x4d')]({},_0x3b27d2,_0x5e5675[_0xd915('0x4f')]);return db[_0xd915('0x63')][_0xd915('0x52')](_0x3b27d2);}})[_0xd915('0x1e')](function(_0x35b0a1){if(_0x35b0a1){return db[_0xd915('0x65')][_0xd915('0x66')]({'where':{'id':_[_0xd915('0x39')](_0x35b0a1,'UserId'),'role':_0xd915('0x67')},'attributes':['id','name',_0xd915('0x68'),_0xd915('0x69'),_0xd915('0x6a')]});}})['then'](function(_0x3ada25){if(_0x3ada25){return{'count':_0x3ada25[_0xd915('0x6b')],'rows':_[_0xd915('0x39')](_0x3ada25[_0xd915('0x53')],function(_0x31f634){return{'membername':_0x31f634[_0xd915('0x36')],'UserId':_0x31f634['id'],'queue_name':_0x4cdd04[_0xd915('0x36')],'ChatQueueId':_0x4cdd04['id'],'interface':util[_0xd915('0x6c')](_0xd915('0x6d'),_0xd915('0x6e'),_0x31f634[_0xd915('0x36')]),'penalty':0x0,'paused':_0x31f634[_0xd915('0x68')],'createdAt':_0x31f634[_0xd915('0x6a')],'updatedAt':_0x31f634['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xd915('0x1e')](respondWithFilteredResult(_0x4c5d6d,_0x3b27d2))[_0xd915('0x54')](handleError(_0x4c5d6d,null));};exports['getTeams']=function(_0x254494,_0x5ab50c,_0x53938f){var _0x47f2d7={};var _0x3a6939={};var _0x402a70;var _0x52144d;return db[_0xd915('0x3a')]['findOne']({'where':{'id':_0x254494[_0xd915('0x56')]['id']}})[_0xd915('0x1e')](handleEntityNotFound(_0x5ab50c,null))[_0xd915('0x1e')](function(_0x492152){if(_0x492152){_0x402a70=_0x492152;_0x3a6939[_0xd915('0x3e')]=_[_0xd915('0x40')](db[_0xd915('0x6f')][_0xd915('0x3b')]);_0x3a6939[_0xd915('0x3f')]=_[_0xd915('0x40')](_0x254494['query']);_0x3a6939[_0xd915('0x41')]=_[_0xd915('0x42')](_0x3a6939[_0xd915('0x3e')],_0x3a6939['query']);_0x47f2d7[_0xd915('0x43')]=_[_0xd915('0x42')](_0x3a6939[_0xd915('0x3e')],qs[_0xd915('0x44')](_0x254494[_0xd915('0x3f')][_0xd915('0x44')]));_0x47f2d7[_0xd915('0x43')]=_0x47f2d7['attributes'][_0xd915('0x45')]?_0x47f2d7[_0xd915('0x43')]:_0x3a6939[_0xd915('0x3e')];_0x47f2d7[_0xd915('0x48')]=qs[_0xd915('0x49')](_0x254494['query'][_0xd915('0x49')]);_0x47f2d7[_0xd915('0x4c')]=qs[_0xd915('0x41')](_['pick'](_0x254494[_0xd915('0x3f')],_0x3a6939[_0xd915('0x41')]));if(_0x254494[_0xd915('0x3f')][_0xd915('0x4b')]){_0x47f2d7['where']=_[_0xd915('0x4d')](_0x47f2d7[_0xd915('0x4c')],{'$or':_[_0xd915('0x39')](_0x47f2d7[_0xd915('0x43')],function(_0x4cc34a){var _0x34250d={};_0x34250d[_0x4cc34a]={'$like':'%'+_0x254494[_0xd915('0x3f')][_0xd915('0x4b')]+'%'};return _0x34250d;})});}_0x47f2d7=_[_0xd915('0x4d')]({},_0x47f2d7,_0x254494[_0xd915('0x4f')]);return _0x402a70[_0xd915('0x70')](_0x47f2d7);}})[_0xd915('0x1e')](function(_0x4fa451){if(_0x4fa451){_0x52144d=_0x4fa451[_0xd915('0x45')];if(!_0x254494['query'][_0xd915('0x46')](_0xd915('0x71'))){_0x47f2d7[_0xd915('0x47')]=qs['limit'](_0x254494['query']['limit']);_0x47f2d7[_0xd915('0x2c')]=qs[_0xd915('0x2c')](_0x254494[_0xd915('0x3f')][_0xd915('0x2c')]);}return _0x402a70['getTeams'](_0x47f2d7);}})[_0xd915('0x1e')](function(_0x284f0b){if(_0x284f0b){return _0x284f0b?{'count':_0x52144d,'rows':_0x284f0b}:null;}})[_0xd915('0x1e')](respondWithResult(_0x5ab50c,null))[_0xd915('0x54')](handleError(_0x5ab50c,null));};exports[_0xd915('0x72')]=function(_0x19bfc7,_0x2e143c,_0x1cda38){var _0x4f4da1=_0x19bfc7['body'][_0xd915('0x73')];return db['Team']['findAll']({'where':{'id':_0x4f4da1},'attributes':['id'],'include':[{'model':db[_0xd915('0x65')],'as':_0xd915('0x74'),'attributes':['id',_0xd915('0x36'),_0xd915('0x75'),_0xd915('0x76'),_0xd915('0x77')],'raw':!![]}]})[_0xd915('0x1e')](function(_0x156b50){if(_0x156b50){var _0x549ab2=_[_0xd915('0x78')](_0x156b50,function(_0x3f479d){var _0x389ddb=_0x3f479d[_0xd915('0x34')]({'plain':!![]});return _0x389ddb[_0xd915('0x74')];});return db[_0xd915('0x3a')][_0xd915('0x57')]({'where':{'id':_0x19bfc7[_0xd915('0x56')]['id']}})[_0xd915('0x1e')](function(_0x59a99a){return db['sequelize'][_0xd915('0x79')](function(_0x49ba52){return _0x59a99a[_0xd915('0x72')](_0x4f4da1,{'transaction':_0x49ba52})['then'](function(){return BPromise[_0xd915('0x7a')](_0x549ab2,function(_0x31dd0b){return db[_0xd915('0x63')][_0xd915('0x7b')]({'where':{'UserId':_0x31dd0b['id'],'ChatQueueId':_0x19bfc7[_0xd915('0x56')]['id']},'transaction':_0x49ba52});});})[_0xd915('0x1e')](function(){_0x549ab2[_0xd915('0x7c')](function(_0x3fc5d8){socket[_0xd915('0x7d')](_0xd915('0x7e'),{'UserId':_0x3fc5d8['id'],'ChatQueueId':_0x59a99a['id']});});});});});}})['then'](respondWithStatusCode(_0x2e143c,null))['catch'](handleError(_0x2e143c,null));};exports[_0xd915('0x7f')]=function(_0x11a2af,_0x4b2b96,_0x4ff2c1){return db[_0xd915('0x6f')][_0xd915('0x52')]({'where':{'id':_0x11a2af[_0xd915('0x3f')][_0xd915('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd915('0x74'),'attributes':['id'],'raw':!![]}]})[_0xd915('0x1e')](handleEntityNotFound(_0x4b2b96,null))[_0xd915('0x1e')](function(_0x36f84b){var _0x44eaa7=_[_0xd915('0x39')](_0x36f84b,'id');var _0x442f90=[];var _0x3fbc74=[];var _0x9e9161=squel[_0xd915('0x80')]();_0x9e9161[_0xd915('0x81')](_0xd915('0x82'))[_0xd915('0x83')](_0xd915('0x84'),'tq')['join'](_0xd915('0x85'),'ut',_0xd915('0x86'))[_0xd915('0x4c')](_0xd915('0x87'),_0x11a2af['params']['id']);for(var _0x59cff9=0x0;_0x59cff9<_0x36f84b[_0xd915('0x45')];_0x59cff9+=0x1){let _0x3012c4=_0x36f84b[_0x59cff9];for(var _0x1235ae=0x0;_0x1235ae<_0x3012c4[_0xd915('0x74')][_0xd915('0x45')];_0x1235ae+=0x1){let _0xe02c6e=_0x3012c4[_0xd915('0x74')][_0x1235ae];var _0x2e6517=_0x9e9161[_0xd915('0x88')]();_0x2e6517[_0xd915('0x4c')](_0xd915('0x89'),_0xe02c6e['id']);_0x3fbc74['push'](db[_0xd915('0x8a')]['query'](_0x2e6517[_0xd915('0x8b')](),{'type':db[_0xd915('0x8a')][_0xd915('0x8c')][_0xd915('0x8d')]})['then'](function(_0x4ce16d){if(_0x4ce16d[_0xd915('0x45')]===0x1){return _0xe02c6e['id'];}else{var _0x43a4b1=_[_0xd915('0x8e')](_['map'](_0x4ce16d,'TeamId'),function(_0x18c48b){return _[_0xd915('0x8f')](_0x44eaa7,_0x18c48b);});if(_0x43a4b1){return _0xe02c6e['id'];}}}));}}return BPromise['all'](_0x3fbc74)[_0xd915('0x1e')](function(_0xc4e086){_0x442f90=_(_0x442f90)[_0xd915('0x90')](_0xc4e086)['compact']()[_0xd915('0x91')]();return db[_0xd915('0x3a')]['find']({'where':{'id':_0x11a2af[_0xd915('0x56')]['id']}})['then'](function(_0x15c742){return db[_0xd915('0x8a')][_0xd915('0x79')](function(_0x27f0c6){return _0x15c742[_0xd915('0x7f')](_0x11a2af['query'][_0xd915('0x73')],{'transaction':_0x27f0c6})[_0xd915('0x1e')](function(){if(!_[_0xd915('0x92')](_0x442f90)){return _0x15c742[_0xd915('0x93')](_0x442f90,{'transaction':_0x27f0c6});}})[_0xd915('0x1e')](function(){_0x442f90[_0xd915('0x7c')](function(_0xc431ce){socket['emit'](_0xd915('0x94'),{'UserId':_0xc431ce,'ChatQueueId':_0x15c742['id']});});});});});});})[_0xd915('0x1e')](respondWithStatusCode(_0x4b2b96,null))[_0xd915('0x54')](handleError(_0x4b2b96,null));};exports['addAgents']=function(_0x18ad46,_0x1f29b4,_0x370977){return db['ChatQueue'][_0xd915('0x57')]({'where':{'id':_0x18ad46[_0xd915('0x56')]['id']}})['then'](handleEntityNotFound(_0x1f29b4,null))[_0xd915('0x1e')](function(_0x2edf3c){if(_0x2edf3c){return _0x2edf3c['addAgents'](_0x18ad46['body'][_0xd915('0x73')],_['omit'](_0x18ad46[_0xd915('0x60')],[_0xd915('0x73'),'id'])||{})[_0xd915('0x95')](function(_0x211749){for(var _0x4a6012=0x0;_0x4a6012<_0x18ad46[_0xd915('0x60')]['ids'][_0xd915('0x45')];_0x4a6012+=0x1){socket[_0xd915('0x7d')](_0xd915('0x7e'),{'UserId':Number(_0x18ad46[_0xd915('0x60')]['ids'][_0x4a6012]),'ChatQueueId':Number(_0x18ad46['params']['id'])});}return _0x211749;});}})[_0xd915('0x1e')](respondWithResult(_0x1f29b4,null))[_0xd915('0x54')](handleError(_0x1f29b4,null));};exports['removeAgents']=function(_0x49cfbc,_0x3ae93e,_0x88de91){return db[_0xd915('0x3a')][_0xd915('0x57')]({'where':{'id':_0x49cfbc[_0xd915('0x56')]['id']}})[_0xd915('0x1e')](handleEntityNotFound(_0x3ae93e,null))[_0xd915('0x1e')](function(_0x3f3095){if(_0x3f3095){return _0x3f3095[_0xd915('0x93')](_0x49cfbc[_0xd915('0x3f')][_0xd915('0x73')])[_0xd915('0x1e')](function(){if(_[_0xd915('0x96')](_0x49cfbc[_0xd915('0x3f')][_0xd915('0x73')])){for(var _0x4cab68=0x0;_0x4cab68<_0x49cfbc[_0xd915('0x3f')][_0xd915('0x73')][_0xd915('0x45')];_0x4cab68+=0x1){socket[_0xd915('0x7d')](_0xd915('0x94'),{'UserId':Number(_0x49cfbc[_0xd915('0x3f')][_0xd915('0x73')][_0x4cab68]),'ChatQueueId':Number(_0x49cfbc[_0xd915('0x56')]['id'])});}}else{socket[_0xd915('0x7d')](_0xd915('0x94'),{'UserId':Number(_0x49cfbc['query'][_0xd915('0x73')]),'ChatQueueId':Number(_0x49cfbc[_0xd915('0x56')]['id'])});}});}})[_0xd915('0x1e')](respondWithStatusCode(_0x3ae93e,null))[_0xd915('0x54')](handleError(_0x3ae93e,null));};exports[_0xd915('0x97')]=function(_0x28e301,_0x416005,_0xd55271){var _0x3a3670={};var _0x5357b0={};var _0x564f95;var _0x3f1fe4;return db[_0xd915('0x3a')][_0xd915('0x62')]({'where':{'id':_0x28e301[_0xd915('0x56')]['id']}})[_0xd915('0x1e')](handleEntityNotFound(_0x416005,null))[_0xd915('0x1e')](function(_0x4a5835){if(_0x4a5835){_0x564f95=_0x4a5835;_0x5357b0['model']=_[_0xd915('0x40')](db[_0xd915('0x65')]['rawAttributes']);_0x5357b0[_0xd915('0x3f')]=_[_0xd915('0x40')](_0x28e301['query']);_0x5357b0[_0xd915('0x41')]=_['intersection'](_0x5357b0['model'],_0x5357b0[_0xd915('0x3f')]);_0x3a3670['attributes']=_[_0xd915('0x42')](_0x5357b0[_0xd915('0x3e')],qs[_0xd915('0x44')](_0x28e301[_0xd915('0x3f')]['fields']));_0x3a3670[_0xd915('0x43')]=_0x3a3670[_0xd915('0x43')][_0xd915('0x45')]?_0x3a3670[_0xd915('0x43')]:_0x5357b0['model'];_0x3a3670[_0xd915('0x48')]=qs['sort'](_0x28e301['query'][_0xd915('0x49')]);_0x3a3670['where']=qs['filters'](_[_0xd915('0x4a')](_0x28e301['query'],_0x5357b0['filters']));if(_0x28e301[_0xd915('0x3f')]['filter']){_0x3a3670[_0xd915('0x4c')]=_[_0xd915('0x4d')](_0x3a3670[_0xd915('0x4c')],{'$or':_[_0xd915('0x39')](_0x3a3670[_0xd915('0x43')],function(_0x8265b1){var _0x10d0dc={};_0x10d0dc[_0x8265b1]={'$like':'%'+_0x28e301[_0xd915('0x3f')][_0xd915('0x4b')]+'%'};return _0x10d0dc;})});}_0x3a3670=_[_0xd915('0x4d')]({},_0x3a3670,_0x28e301[_0xd915('0x4f')]);return _0x564f95[_0xd915('0x97')](_0x3a3670);}})[_0xd915('0x1e')](function(_0x4a1f3b){if(_0x4a1f3b){_0x3f1fe4=_0x4a1f3b[_0xd915('0x45')];if(!_0x28e301[_0xd915('0x3f')][_0xd915('0x46')](_0xd915('0x71'))){_0x3a3670[_0xd915('0x47')]=qs[_0xd915('0x47')](_0x28e301[_0xd915('0x3f')][_0xd915('0x47')]);_0x3a3670[_0xd915('0x2c')]=qs[_0xd915('0x2c')](_0x28e301[_0xd915('0x3f')][_0xd915('0x2c')]);}return _0x564f95[_0xd915('0x97')](_0x3a3670);}})[_0xd915('0x1e')](function(_0x421e02){if(_0x421e02){return _0x421e02?{'count':_0x3f1fe4,'rows':_0x421e02}:null;}})['then'](respondWithResult(_0x416005,null))['catch'](handleError(_0x416005,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 51f0323..5f930c8 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 _0xa8fb=['exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4cae67,_0x573621){var _0x290961=function(_0x23e722){while(--_0x23e722){_0x4cae67['push'](_0x4cae67['shift']());}};_0x290961(++_0x573621);}(_0xa8fb,0x172));var _0xba8f=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0xa8fb[_0x47fd36];return _0x21a0fc;};'use strict';var EventEmitter=require(_0xba8f('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xba8f('0x1')](0x0);var events={'afterCreate':_0xba8f('0x2'),'afterUpdate':_0xba8f('0x3'),'afterDestroy':_0xba8f('0x4')};function emitEvent(_0x26eab1){return function(_0x21be59,_0x19567f,_0x2218f0){ChatQueueEvents[_0xba8f('0x5')](_0x26eab1+':'+_0x21be59['id'],_0x21be59);ChatQueueEvents[_0xba8f('0x5')](_0x26eab1,_0x21be59);_0x2218f0(null);};}for(var e in events){if(events[_0xba8f('0x6')](e)){var event=events[e];ChatQueue[_0xba8f('0x7')](e,emitEvent(event));}}module[_0xba8f('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xf3cd=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x5b1370,_0x5beac4){var _0xf5075d=function(_0x26aeab){while(--_0x26aeab){_0x5b1370['push'](_0x5b1370['shift']());}};_0xf5075d(++_0x5beac4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x203c8c,_0x2728e5){_0x203c8c=_0x203c8c-0x0;var _0x1e5322=_0xf3cd[_0x203c8c];return _0x1e5322;};'use strict';var EventEmitter=require(_0xdf3c('0x0'));var ChatQueue=require(_0xdf3c('0x1'))['db'][_0xdf3c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdf3c('0x3')](0x0);var events={'afterCreate':_0xdf3c('0x4'),'afterUpdate':_0xdf3c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x401518){return function(_0x71b446,_0x9f71cb,_0x573076){ChatQueueEvents[_0xdf3c('0x6')](_0x401518+':'+_0x71b446['id'],_0x71b446);ChatQueueEvents[_0xdf3c('0x6')](_0x401518,_0x71b446);_0x573076(null);};}for(var e in events){if(events[_0xdf3c('0x7')](e)){var event=events[e];ChatQueue[_0xdf3c('0x8')](e,emitEvent(event));}}module[_0xdf3c('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 27eddce..8911a61 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 _0x7abe=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util'];(function(_0x351134,_0x392b05){var _0x5a5278=function(_0x5a4a7f){while(--_0x5a4a7f){_0x351134['push'](_0x351134['shift']());}};_0x5a5278(++_0x392b05);}(_0x7abe,0x1ab));var _0xe7ab=function(_0x544e1a,_0xf7582c){_0x544e1a=_0x544e1a-0x0;var _0x142980=_0x7abe[_0x544e1a];return _0x142980;};'use strict';var _=require(_0xe7ab('0x0'));var util=require(_0xe7ab('0x1'));var logger=require(_0xe7ab('0x2'))(_0xe7ab('0x3'));var moment=require('moment');var BPromise=require(_0xe7ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7ab('0x5'));var rimraf=require(_0xe7ab('0x6'));var config=require(_0xe7ab('0x7'));var attributes=require(_0xe7ab('0x8'));module[_0xe7ab('0x9')]=function(_0x44c7de,_0x1a7494){return _0x44c7de[_0xe7ab('0xa')](_0xe7ab('0xb'),attributes,{'tableName':_0xe7ab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb412=['request-promise','rimraf','../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','lodash','util','moment','bluebird'];(function(_0x1ad53d,_0x3067eb){var _0x57df8d=function(_0x2e1ac3){while(--_0x2e1ac3){_0x1ad53d['push'](_0x1ad53d['shift']());}};_0x57df8d(++_0x3067eb);}(_0xb412,0x193));var _0x2b41=function(_0x5a9999,_0x557ff8){_0x5a9999=_0x5a9999-0x0;var _0x4597dc=_0xb412[_0x5a9999];return _0x4597dc;};'use strict';var _=require(_0x2b41('0x0'));var util=require(_0x2b41('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2b41('0x2'));var BPromise=require(_0x2b41('0x3'));var rp=require(_0x2b41('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b41('0x5'));var config=require(_0x2b41('0x6'));var attributes=require(_0x2b41('0x7'));module['exports']=function(_0x9b06a1,_0x39cfaa){return _0x9b06a1[_0x2b41('0x8')](_0x2b41('0x9'),attributes,{'tableName':_0x2b41('0xa'),'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 33f943c..a637b90 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 _0x8769=['map','model','attributes','catch','ShowChatQueue','stringify','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','where','include'];(function(_0x568f46,_0x507dcf){var _0xf158b1=function(_0x2d892f){while(--_0x2d892f){_0x568f46['push'](_0x568f46['shift']());}};_0xf158b1(++_0x507dcf);}(_0x8769,0x110));var _0x9876=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x8769[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0x9876('0x0'));var util=require(_0x9876('0x1'));var moment=require('moment');var BPromise=require(_0x9876('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9876('0x3'));var db=require(_0x9876('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9876('0x5'));var config=require(_0x9876('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9876('0x7')][_0x9876('0x8')]({'port':0x232a});config['redis']=_[_0x9876('0x9')](config[_0x9876('0xa')],{'host':_0x9876('0xb'),'port':0x18eb});var socket=require(_0x9876('0xc'))(new Redis(config[_0x9876('0xa')]));require(_0x9876('0xd'))[_0x9876('0xe')](socket);function respondWithRpcPromise(_0x2db388,_0x3c6568,_0x299087){return new BPromise(function(_0x1cac6c,_0x8946f8){return client[_0x9876('0xf')](_0x2db388,_0x299087)[_0x9876('0x10')](function(_0x2ef152){logger['info'](_0x9876('0x11'),_0x3c6568,'request\x20sent');logger[_0x9876('0x12')](_0x9876('0x13'),_0x3c6568,'request\x20sent',JSON['stringify'](_0x2ef152));if(_0x2ef152[_0x9876('0x14')]){if(_0x2ef152['error'][_0x9876('0x15')]===0x1f4){logger[_0x9876('0x14')](_0x9876('0x11'),_0x3c6568,_0x2ef152[_0x9876('0x14')]['message']);return _0x8946f8(_0x2ef152[_0x9876('0x14')][_0x9876('0x16')]);}logger[_0x9876('0x14')](_0x9876('0x11'),_0x3c6568,_0x2ef152[_0x9876('0x14')][_0x9876('0x16')]);return _0x1cac6c(_0x2ef152[_0x9876('0x14')][_0x9876('0x16')]);}else{logger[_0x9876('0x17')](_0x9876('0x11'),_0x3c6568,'request\x20sent');_0x1cac6c(_0x2ef152[_0x9876('0x18')][_0x9876('0x16')]);}})['catch'](function(_0x43cd0f){logger[_0x9876('0x14')](_0x9876('0x11'),_0x3c6568,_0x43cd0f);_0x8946f8(_0x43cd0f);});});}exports[_0x9876('0x19')]=function(_0x264445){var _0x73a9f7=this;return new Promise(function(_0x523878,_0x1adb6d){return db[_0x9876('0x1a')][_0x9876('0x1b')]({'raw':_0x264445[_0x9876('0x1c')]?_0x264445[_0x9876('0x1c')][_0x9876('0x1d')]===undefined?!![]:![]:!![],'where':_0x264445[_0x9876('0x1c')]?_0x264445[_0x9876('0x1c')][_0x9876('0x1e')]||null:null,'attributes':_0x264445[_0x9876('0x1c')]?_0x264445[_0x9876('0x1c')]['attributes']||null:null,'limit':_0x264445[_0x9876('0x1c')]?_0x264445[_0x9876('0x1c')]['limit']||null:null,'include':_0x264445[_0x9876('0x1c')]?_0x264445[_0x9876('0x1c')][_0x9876('0x1f')]?_[_0x9876('0x20')](_0x264445[_0x9876('0x1c')][_0x9876('0x1f')],function(_0x40d360){return{'model':db[_0x40d360[_0x9876('0x21')]],'as':_0x40d360['as'],'attributes':_0x40d360[_0x9876('0x22')],'include':_0x40d360[_0x9876('0x1f')]?_[_0x9876('0x20')](_0x40d360['include'],function(_0x39bb68){return{'model':db[_0x39bb68[_0x9876('0x21')]],'as':_0x39bb68['as'],'attributes':_0x39bb68['attributes'],'include':_0x39bb68[_0x9876('0x1f')]?_['map'](_0x39bb68['include'],function(_0x134b97){return{'model':db[_0x134b97[_0x9876('0x21')]],'as':_0x134b97['as'],'attributes':_0x134b97[_0x9876('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f8121){logger['info'](_0x9876('0x19'),_0x264445);logger['debug'](_0x9876('0x19'),_0x264445,JSON['stringify'](_0x2f8121));_0x523878(_0x2f8121);})[_0x9876('0x23')](function(_0x37537a){logger[_0x9876('0x14')]('GetChatQueue',_0x37537a[_0x9876('0x16')],_0x264445);_0x1adb6d(_0x73a9f7[_0x9876('0x14')](0x1f4,_0x37537a[_0x9876('0x16')]));});});};exports['ShowChatQueue']=function(_0xf00408){var _0x4d5c4f=this;return new Promise(function(_0x2b34bd,_0x57787c){return db['ChatQueue']['find']({'raw':_0xf00408[_0x9876('0x1c')]?_0xf00408[_0x9876('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xf00408[_0x9876('0x1c')]?_0xf00408[_0x9876('0x1c')][_0x9876('0x1e')]||null:null,'attributes':_0xf00408[_0x9876('0x1c')]?_0xf00408[_0x9876('0x1c')][_0x9876('0x22')]||null:null,'include':_0xf00408[_0x9876('0x1c')]?_0xf00408['options'][_0x9876('0x1f')]?_['map'](_0xf00408[_0x9876('0x1c')][_0x9876('0x1f')],function(_0x9ad012){return{'model':db[_0x9ad012[_0x9876('0x21')]],'as':_0x9ad012['as'],'attributes':_0x9ad012[_0x9876('0x22')],'include':_0x9ad012['include']?_[_0x9876('0x20')](_0x9ad012[_0x9876('0x1f')],function(_0x36c19d){return{'model':db[_0x36c19d['model']],'as':_0x36c19d['as'],'attributes':_0x36c19d[_0x9876('0x22')],'include':_0x36c19d['include']?_[_0x9876('0x20')](_0x36c19d['include'],function(_0x591718){return{'model':db[_0x591718[_0x9876('0x21')]],'as':_0x591718['as'],'attributes':_0x591718['attributes']};}):[]};}):[]};}):[]:[]})[_0x9876('0x10')](function(_0x341bf9){logger['info'](_0x9876('0x24'),_0xf00408);logger[_0x9876('0x12')](_0x9876('0x24'),_0xf00408,JSON[_0x9876('0x25')](_0x341bf9));_0x2b34bd(_0x341bf9);})[_0x9876('0x23')](function(_0x386e1e){logger[_0x9876('0x14')](_0x9876('0x24'),_0x386e1e[_0x9876('0x16')],_0xf00408);_0x57787c(_0x4d5c4f[_0x9876('0x14')](0x1f4,_0x386e1e[_0x9876('0x16')]));});});};
\ No newline at end of file
+var _0x94d2=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowChatQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0xe3f9c3,_0x12473b){var _0x5aa9ac=function(_0x208fc0){while(--_0x208fc0){_0xe3f9c3['push'](_0xe3f9c3['shift']());}};_0x5aa9ac(++_0x12473b);}(_0x94d2,0x1cd));var _0x294d=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0x94d2[_0xd4636c];return _0x5ee17d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x294d('0x0'));var BPromise=require(_0x294d('0x1'));var rs=require(_0x294d('0x2'));var fs=require('fs');var Redis=require(_0x294d('0x3'));var db=require(_0x294d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x294d('0x5'));var config=require(_0x294d('0x6'));var jayson=require(_0x294d('0x7'));var client=jayson[_0x294d('0x8')][_0x294d('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x294d('0xa')],{'host':_0x294d('0xb'),'port':0x18eb});var socket=require(_0x294d('0xc'))(new Redis(config[_0x294d('0xa')]));require(_0x294d('0xd'))['register'](socket);function respondWithRpcPromise(_0x7931bb,_0x297494,_0x53d5f5){return new BPromise(function(_0x20af48,_0x18fde9){return client['request'](_0x7931bb,_0x53d5f5)['then'](function(_0x165330){logger[_0x294d('0xe')](_0x294d('0xf'),_0x297494,'request\x20sent');logger[_0x294d('0x10')](_0x294d('0x11'),_0x297494,_0x294d('0x12'),JSON[_0x294d('0x13')](_0x165330));if(_0x165330['error']){if(_0x165330[_0x294d('0x14')]['code']===0x1f4){logger['error'](_0x294d('0xf'),_0x297494,_0x165330[_0x294d('0x14')][_0x294d('0x15')]);return _0x18fde9(_0x165330[_0x294d('0x14')]['message']);}logger[_0x294d('0x14')]('ChatQueue,\x20%s,\x20%s',_0x297494,_0x165330['error']['message']);return _0x20af48(_0x165330['error'][_0x294d('0x15')]);}else{logger[_0x294d('0xe')](_0x294d('0xf'),_0x297494,_0x294d('0x12'));_0x20af48(_0x165330[_0x294d('0x16')][_0x294d('0x15')]);}})[_0x294d('0x17')](function(_0x9a7c6a){logger['error'](_0x294d('0xf'),_0x297494,_0x9a7c6a);_0x18fde9(_0x9a7c6a);});});}exports[_0x294d('0x18')]=function(_0x578e13){var _0xa9338a=this;return new Promise(function(_0x19cee1,_0x429da3){return db[_0x294d('0x19')][_0x294d('0x1a')]({'raw':_0x578e13[_0x294d('0x1b')]?_0x578e13[_0x294d('0x1b')][_0x294d('0x1c')]===undefined?!![]:![]:!![],'where':_0x578e13[_0x294d('0x1b')]?_0x578e13[_0x294d('0x1b')][_0x294d('0x1d')]||null:null,'attributes':_0x578e13[_0x294d('0x1b')]?_0x578e13[_0x294d('0x1b')][_0x294d('0x1e')]||null:null,'limit':_0x578e13[_0x294d('0x1b')]?_0x578e13['options']['limit']||null:null,'include':_0x578e13[_0x294d('0x1b')]?_0x578e13[_0x294d('0x1b')][_0x294d('0x1f')]?_[_0x294d('0x20')](_0x578e13[_0x294d('0x1b')][_0x294d('0x1f')],function(_0x4da072){return{'model':db[_0x4da072[_0x294d('0x21')]],'as':_0x4da072['as'],'attributes':_0x4da072['attributes'],'include':_0x4da072[_0x294d('0x1f')]?_[_0x294d('0x20')](_0x4da072[_0x294d('0x1f')],function(_0x1f2dd7){return{'model':db[_0x1f2dd7[_0x294d('0x21')]],'as':_0x1f2dd7['as'],'attributes':_0x1f2dd7[_0x294d('0x1e')],'include':_0x1f2dd7[_0x294d('0x1f')]?_['map'](_0x1f2dd7[_0x294d('0x1f')],function(_0x2b2072){return{'model':db[_0x2b2072[_0x294d('0x21')]],'as':_0x2b2072['as'],'attributes':_0x2b2072[_0x294d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x294d('0x22')](function(_0x338cc1){logger[_0x294d('0xe')](_0x294d('0x18'),_0x578e13);logger['debug'](_0x294d('0x18'),_0x578e13,JSON[_0x294d('0x13')](_0x338cc1));_0x19cee1(_0x338cc1);})[_0x294d('0x17')](function(_0x3cf02d){logger['error']('GetChatQueue',_0x3cf02d[_0x294d('0x15')],_0x578e13);_0x429da3(_0xa9338a[_0x294d('0x14')](0x1f4,_0x3cf02d[_0x294d('0x15')]));});});};exports[_0x294d('0x23')]=function(_0x395ed8){var _0x15353d=this;return new Promise(function(_0x1e445f,_0x16c3e1){return db[_0x294d('0x19')]['find']({'raw':_0x395ed8[_0x294d('0x1b')]?_0x395ed8[_0x294d('0x1b')][_0x294d('0x1c')]===undefined?!![]:![]:!![],'where':_0x395ed8['options']?_0x395ed8[_0x294d('0x1b')][_0x294d('0x1d')]||null:null,'attributes':_0x395ed8['options']?_0x395ed8[_0x294d('0x1b')][_0x294d('0x1e')]||null:null,'include':_0x395ed8['options']?_0x395ed8['options'][_0x294d('0x1f')]?_[_0x294d('0x20')](_0x395ed8[_0x294d('0x1b')]['include'],function(_0x37aa78){return{'model':db[_0x37aa78[_0x294d('0x21')]],'as':_0x37aa78['as'],'attributes':_0x37aa78[_0x294d('0x1e')],'include':_0x37aa78[_0x294d('0x1f')]?_[_0x294d('0x20')](_0x37aa78[_0x294d('0x1f')],function(_0x2b70e3){return{'model':db[_0x2b70e3[_0x294d('0x21')]],'as':_0x2b70e3['as'],'attributes':_0x2b70e3[_0x294d('0x1e')],'include':_0x2b70e3[_0x294d('0x1f')]?_[_0x294d('0x20')](_0x2b70e3[_0x294d('0x1f')],function(_0x496941){return{'model':db[_0x496941[_0x294d('0x21')]],'as':_0x496941['as'],'attributes':_0x496941[_0x294d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x294d('0x22')](function(_0x538381){logger[_0x294d('0xe')](_0x294d('0x23'),_0x395ed8);logger[_0x294d('0x10')](_0x294d('0x23'),_0x395ed8,JSON['stringify'](_0x538381));_0x1e445f(_0x538381);})[_0x294d('0x17')](function(_0x22066a){logger[_0x294d('0x14')]('ShowChatQueue',_0x22066a[_0x294d('0x15')],_0x395ed8);_0x16c3e1(_0x15353d[_0x294d('0x14')](0x1f4,_0x22066a[_0x294d('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8d9a302..0e2a4fd 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x72b1,0x16e));var _0x172b=function(_0x30cb8d,_0x57cd7c){_0x30cb8d=_0x30cb8d-0x0;var _0x47747f=_0x72b1[_0x30cb8d];return _0x47747f;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}};
\ No newline at end of file
+var _0x702d=['remove','update','emit','register','length','./chatQueue.events','save'];(function(_0x4a9c4e,_0x18766d){var _0x5c5bc2=function(_0x8b10bb){while(--_0x8b10bb){_0x4a9c4e['push'](_0x4a9c4e['shift']());}};_0x5c5bc2(++_0x18766d);}(_0x702d,0x147));var _0xd702=function(_0x29fb85,_0xa67e8d){_0x29fb85=_0x29fb85-0x0;var _0xf38a5c=_0x702d[_0x29fb85];return _0xf38a5c;};'use strict';var ChatQueueEvents=require(_0xd702('0x0'));var events=[_0xd702('0x1'),_0xd702('0x2'),_0xd702('0x3')];function createListener(_0x37ed5c,_0x5c2b9e){return function(_0x20c11a){_0x5c2b9e[_0xd702('0x4')](_0x37ed5c,_0x20c11a);};}function removeListener(_0x27b260,_0x1c5a32){return function(){ChatQueueEvents['removeListener'](_0x27b260,_0x1c5a32);};}exports[_0xd702('0x5')]=function(_0x544e94){for(var _0x1aecfc=0x0,_0x3a2c03=events[_0xd702('0x6')];_0x1aecfc<_0x3a2c03;_0x1aecfc++){var _0x5af246=events[_0x1aecfc];var _0x12bb75=createListener('chatQueue:'+_0x5af246,_0x544e94);ChatQueueEvents['on'](_0x5af246,_0x12bb75);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index c770cf0..94ca162 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7a3fd,_0xe06535){var _0xa18f70=function(_0x13d791){while(--_0x13d791){_0x7a3fd['push'](_0x7a3fd['shift']());}};_0xa18f70(++_0xe06535);}(_0x008c,0x188));var _0xc008=function(_0x2bc400,_0x27208f){_0x2bc400=_0x2bc400-0x0;var _0x36ab53=_0x008c[_0x2bc400];return _0x36ab53;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x411d5,_0x393fe1){var _0x2295b3=function(_0x4f5e4f){while(--_0x4f5e4f){_0x411d5['push'](_0x411d5['shift']());}};_0x2295b3(++_0x393fe1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 3a95ea4..369400a 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 _0xc715=['moment','sequelize','exports','STRING','DATE'];(function(_0x36c1f2,_0x58de4a){var _0x58d393=function(_0x13b5f3){while(--_0x13b5f3){_0x36c1f2['push'](_0x36c1f2['shift']());}};_0x58d393(++_0x58de4a);}(_0xc715,0x1d6));var _0x5c71=function(_0x3bf4d5,_0x366a37){_0x3bf4d5=_0x3bf4d5-0x0;var _0x48fdea=_0xc715[_0x3bf4d5];return _0x48fdea;};'use strict';var moment=require(_0x5c71('0x0'));var Sequelize=require(_0x5c71('0x1'));module[_0x5c71('0x2')]={'uniqueid':{'type':Sequelize[_0x5c71('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5c71('0x3')]},'joinAt':{'type':Sequelize[_0x5c71('0x4')]},'leaveAt':{'type':Sequelize[_0x5c71('0x4')]},'acceptAt':{'type':Sequelize[_0x5c71('0x4')]},'exitAt':{'type':Sequelize[_0x5c71('0x4')]},'reason':{'type':Sequelize[_0x5c71('0x3')]}};
\ No newline at end of file
+var _0x4813=['sequelize','exports','STRING','DATE','moment'];(function(_0xd9eaf7,_0x4740cd){var _0x473f7a=function(_0x35ffa5){while(--_0x35ffa5){_0xd9eaf7['push'](_0xd9eaf7['shift']());}};_0x473f7a(++_0x4740cd);}(_0x4813,0x14e));var _0x3481=function(_0x496cd5,_0x403984){_0x496cd5=_0x496cd5-0x0;var _0x163059=_0x4813[_0x496cd5];return _0x163059;};'use strict';var moment=require(_0x3481('0x0'));var Sequelize=require(_0x3481('0x1'));module[_0x3481('0x2')]={'uniqueid':{'type':Sequelize[_0x3481('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3481('0x3')]},'joinAt':{'type':Sequelize[_0x3481('0x4')]},'leaveAt':{'type':Sequelize[_0x3481('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3481('0x4')]},'reason':{'type':Sequelize[_0x3481('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index c18cfdd..b950d00 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 _0xe5e0=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','intersection','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x5a2285,_0x3212d1){var _0x48f6ed=function(_0x322127){while(--_0x322127){_0x5a2285['push'](_0x5a2285['shift']());}};_0x48f6ed(++_0x3212d1);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x3452b4,_0x1d0da2){_0x3452b4=_0x3452b4-0x0;var _0x459641=_0xe5e0[_0x3452b4];return _0x459641;};'use strict';var emlformat=require(_0x0e5e('0x0'));var rimraf=require(_0x0e5e('0x1'));var zipdir=require(_0x0e5e('0x2'));var jsonpatch=require(_0x0e5e('0x3'));var rp=require(_0x0e5e('0x4'));var moment=require(_0x0e5e('0x5'));var BPromise=require(_0x0e5e('0x6'));var Mustache=require(_0x0e5e('0x7'));var util=require(_0x0e5e('0x8'));var path=require('path');var sox=require(_0x0e5e('0x9'));var csv=require(_0x0e5e('0xa'));var ejs=require(_0x0e5e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0e5e('0xc'));var squel=require(_0x0e5e('0xd'));var crypto=require(_0x0e5e('0xe'));var jsforce=require(_0x0e5e('0xf'));var deskjs=require(_0x0e5e('0x10'));var toCsv=require(_0x0e5e('0xa'));var querystring=require(_0x0e5e('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e5e('0x12'));var as=require(_0x0e5e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0e5e('0x14'));var utils=require(_0x0e5e('0x15'));var config=require(_0x0e5e('0x16'));var licenseUtil=require(_0x0e5e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275cd5,_0x322cdf){_0x322cdf=_0x322cdf||0xcc;return function(_0x5c0900){if(_0x5c0900){return _0x275cd5[_0x0e5e('0x18')](_0x322cdf);}return _0x275cd5[_0x0e5e('0x19')](_0x322cdf)[_0x0e5e('0x1a')]();};}function respondWithResult(_0x50c0a3,_0x731afc){_0x731afc=_0x731afc||0xc8;return function(_0x2353b3){if(_0x2353b3){return _0x50c0a3[_0x0e5e('0x19')](_0x731afc)[_0x0e5e('0x1b')](_0x2353b3);}};}function respondWithFilteredResult(_0x19d3a1,_0x1ef0be){return function(_0x5dedc5){if(_0x5dedc5){var _0x20a35f=typeof _0x1ef0be[_0x0e5e('0x1c')]===_0x0e5e('0x1d')&&typeof _0x1ef0be[_0x0e5e('0x1e')]===_0x0e5e('0x1d');var _0x550dda=_0x5dedc5[_0x0e5e('0x1f')];var _0x2efa7f=_0x20a35f?0x0:_0x1ef0be['offset'];var _0x29597b=_0x20a35f?_0x5dedc5[_0x0e5e('0x1f')]:_0x1ef0be['offset']+_0x1ef0be[_0x0e5e('0x1e')];var _0x3b80f8;if(_0x29597b>=_0x550dda){_0x29597b=_0x550dda;_0x3b80f8=0xc8;}else{_0x3b80f8=0xce;}_0x19d3a1['status'](_0x3b80f8);return _0x19d3a1[_0x0e5e('0x20')](_0x0e5e('0x21'),_0x2efa7f+'-'+_0x29597b+'/'+_0x550dda)[_0x0e5e('0x1b')](_0x5dedc5);}return null;};}function patchUpdates(_0x56dcc9){return function(_0x4f468f){try{jsonpatch[_0x0e5e('0x22')](_0x4f468f,_0x56dcc9,!![]);}catch(_0x1b0588){return BPromise[_0x0e5e('0x23')](_0x1b0588);}return _0x4f468f[_0x0e5e('0x24')]();};}function saveUpdates(_0x2c3c01,_0x44b8b9){return function(_0x2588fa){if(_0x2588fa){return _0x2588fa[_0x0e5e('0x25')](_0x2c3c01)[_0x0e5e('0x26')](function(_0x33b27e){return _0x33b27e;});}return null;};}function removeEntity(_0x523c30,_0x742ee8){return function(_0x2321f9){if(_0x2321f9){return _0x2321f9[_0x0e5e('0x27')]()[_0x0e5e('0x26')](function(){_0x523c30[_0x0e5e('0x19')](0xcc)[_0x0e5e('0x1a')]();});}};}function handleEntityNotFound(_0x46cbd7,_0x4b53ca){return function(_0x1b19f0){if(!_0x1b19f0){_0x46cbd7['sendStatus'](0x194);}return _0x1b19f0;};}function handleError(_0x2750b0,_0x2f789a){_0x2f789a=_0x2f789a||0x1f4;return function(_0x5e3a60){logger[_0x0e5e('0x28')](_0x5e3a60[_0x0e5e('0x29')]);if(_0x5e3a60[_0x0e5e('0x2a')]){delete _0x5e3a60['name'];}_0x2750b0[_0x0e5e('0x19')](_0x2f789a)['send'](_0x5e3a60);};}exports[_0x0e5e('0x2b')]=function(_0x2d5cc0,_0x149209){var _0x4eb0d6={},_0x38930f={},_0x7a118={'count':0x0,'rows':[]};var _0x37a2d0=_[_0x0e5e('0x2c')](db[_0x0e5e('0x2d')][_0x0e5e('0x2e')],function(_0x3ea522){return{'name':_0x3ea522['fieldName'],'type':_0x3ea522[_0x0e5e('0x2f')][_0x0e5e('0x30')]};});_0x38930f[_0x0e5e('0x31')]=_[_0x0e5e('0x2c')](_0x37a2d0,'name');_0x38930f['query']=_['keys'](_0x2d5cc0['query']);_0x38930f[_0x0e5e('0x32')]=_['intersection'](_0x38930f[_0x0e5e('0x31')],_0x38930f[_0x0e5e('0x33')]);_0x4eb0d6[_0x0e5e('0x34')]=_['intersection'](_0x38930f[_0x0e5e('0x31')],qs['fields'](_0x2d5cc0['query'][_0x0e5e('0x35')]));_0x4eb0d6[_0x0e5e('0x34')]=_0x4eb0d6[_0x0e5e('0x34')][_0x0e5e('0x36')]?_0x4eb0d6[_0x0e5e('0x34')]:_0x38930f['model'];if(!_0x2d5cc0[_0x0e5e('0x33')][_0x0e5e('0x37')](_0x0e5e('0x38'))){_0x4eb0d6[_0x0e5e('0x1e')]=qs[_0x0e5e('0x1e')](_0x2d5cc0[_0x0e5e('0x33')][_0x0e5e('0x1e')]);_0x4eb0d6[_0x0e5e('0x1c')]=qs[_0x0e5e('0x1c')](_0x2d5cc0['query'][_0x0e5e('0x1c')]);}_0x4eb0d6[_0x0e5e('0x39')]=qs[_0x0e5e('0x3a')](_0x2d5cc0[_0x0e5e('0x33')]['sort']);_0x4eb0d6[_0x0e5e('0x3b')]=qs['filters'](_[_0x0e5e('0x3c')](_0x2d5cc0[_0x0e5e('0x33')],_0x38930f[_0x0e5e('0x32')]),_0x37a2d0);if(_0x2d5cc0['query'][_0x0e5e('0x3d')]){_0x4eb0d6[_0x0e5e('0x3b')]=_[_0x0e5e('0x3e')](_0x4eb0d6['where'],{'$or':_['map'](_0x37a2d0,function(_0x392a37){if(_0x392a37[_0x0e5e('0x2f')]!==_0x0e5e('0x3f')){var _0x5e6600={};_0x5e6600[_0x392a37[_0x0e5e('0x2a')]]={'$like':'%'+_0x2d5cc0[_0x0e5e('0x33')][_0x0e5e('0x3d')]+'%'};return _0x5e6600;}})});}_0x4eb0d6=_[_0x0e5e('0x3e')]({},_0x4eb0d6,_0x2d5cc0[_0x0e5e('0x40')]);var _0x5d25f6={'where':_0x4eb0d6[_0x0e5e('0x3b')]};return db[_0x0e5e('0x2d')][_0x0e5e('0x1f')](_0x5d25f6)[_0x0e5e('0x26')](function(_0xb0953f){_0x7a118[_0x0e5e('0x1f')]=_0xb0953f;if(_0x2d5cc0['query'][_0x0e5e('0x41')]){_0x4eb0d6[_0x0e5e('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0e5e('0x43')](_0x4eb0d6);})[_0x0e5e('0x26')](function(_0x5271fb){_0x7a118[_0x0e5e('0x44')]=_0x5271fb;return _0x7a118;})[_0x0e5e('0x26')](respondWithFilteredResult(_0x149209,_0x4eb0d6))['catch'](handleError(_0x149209,null));};exports[_0x0e5e('0x45')]=function(_0x5570b6,_0x1aeaad){var _0x29fd38={'raw':!![],'where':{'id':_0x5570b6[_0x0e5e('0x46')]['id']}},_0x31223b={};_0x31223b[_0x0e5e('0x31')]=_[_0x0e5e('0x47')](db[_0x0e5e('0x2d')][_0x0e5e('0x2e')]);_0x31223b[_0x0e5e('0x33')]=_[_0x0e5e('0x47')](_0x5570b6[_0x0e5e('0x33')]);_0x31223b['filters']=_[_0x0e5e('0x48')](_0x31223b['model'],_0x31223b['query']);_0x29fd38[_0x0e5e('0x34')]=_[_0x0e5e('0x48')](_0x31223b[_0x0e5e('0x31')],qs[_0x0e5e('0x35')](_0x5570b6[_0x0e5e('0x33')][_0x0e5e('0x35')]));_0x29fd38[_0x0e5e('0x34')]=_0x29fd38['attributes'][_0x0e5e('0x36')]?_0x29fd38[_0x0e5e('0x34')]:_0x31223b[_0x0e5e('0x31')];if(_0x5570b6[_0x0e5e('0x33')]['includeAll']){_0x29fd38[_0x0e5e('0x42')]=[{'all':!![]}];}_0x29fd38=_[_0x0e5e('0x3e')]({},_0x29fd38,_0x5570b6[_0x0e5e('0x40')]);return db[_0x0e5e('0x2d')]['find'](_0x29fd38)['then'](handleEntityNotFound(_0x1aeaad,null))['then'](respondWithResult(_0x1aeaad,null))[_0x0e5e('0x49')](handleError(_0x1aeaad,null));};exports['create']=function(_0x15a57c,_0x1d9995){return db['ChatQueueReport'][_0x0e5e('0x4a')](_0x15a57c[_0x0e5e('0x4b')],{})[_0x0e5e('0x26')](respondWithResult(_0x1d9995,0xc9))[_0x0e5e('0x49')](handleError(_0x1d9995,null));};exports[_0x0e5e('0x25')]=function(_0x2eb6d9,_0x13098a){if(_0x2eb6d9[_0x0e5e('0x4b')]['id']){delete _0x2eb6d9[_0x0e5e('0x4b')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x2eb6d9[_0x0e5e('0x46')]['id']}})[_0x0e5e('0x26')](handleEntityNotFound(_0x13098a,null))[_0x0e5e('0x26')](saveUpdates(_0x2eb6d9[_0x0e5e('0x4b')],null))['then'](respondWithResult(_0x13098a,null))[_0x0e5e('0x49')](handleError(_0x13098a,null));};exports[_0x0e5e('0x27')]=function(_0x4cd35a,_0x2b9bc2){return db[_0x0e5e('0x2d')][_0x0e5e('0x4c')]({'where':{'id':_0x4cd35a[_0x0e5e('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b9bc2,null))[_0x0e5e('0x26')](removeEntity(_0x2b9bc2,null))['catch'](handleError(_0x2b9bc2,null));};exports[_0x0e5e('0x4d')]=function(_0x4af255,_0x5b6dcd){return db[_0x0e5e('0x2d')][_0x0e5e('0x4d')]()[_0x0e5e('0x26')](respondWithResult(_0x5b6dcd,null))['catch'](handleError(_0x5b6dcd,null));};
\ No newline at end of file
+var _0x2d2c=['name','index','map','ChatQueueReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll','rows','catch','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x4756a1,_0x3f8d1){_0x4756a1=_0x4756a1-0x0;var _0x177c4f=_0x2d2c[_0x4756a1];return _0x177c4f;};'use strict';var emlformat=require(_0xc2d2('0x0'));var rimraf=require(_0xc2d2('0x1'));var zipdir=require(_0xc2d2('0x2'));var jsonpatch=require(_0xc2d2('0x3'));var rp=require(_0xc2d2('0x4'));var moment=require(_0xc2d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc2d2('0x6'));var util=require('util');var path=require(_0xc2d2('0x7'));var sox=require(_0xc2d2('0x8'));var csv=require(_0xc2d2('0x9'));var ejs=require(_0xc2d2('0xa'));var fs=require('fs');var fs_extra=require(_0xc2d2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc2d2('0xc'));var jsforce=require(_0xc2d2('0xd'));var deskjs=require(_0xc2d2('0xe'));var toCsv=require(_0xc2d2('0x9'));var querystring=require(_0xc2d2('0xf'));var Papa=require(_0xc2d2('0x10'));var Redis=require(_0xc2d2('0x11'));var authService=require(_0xc2d2('0x12'));var qs=require(_0xc2d2('0x13'));var as=require(_0xc2d2('0x14'));var hardwareService=require(_0xc2d2('0x15'));var logger=require(_0xc2d2('0x16'))('api');var utils=require(_0xc2d2('0x17'));var config=require(_0xc2d2('0x18'));var licenseUtil=require(_0xc2d2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273269,_0x738877){_0x738877=_0x738877||0xcc;return function(_0x4c2b12){if(_0x4c2b12){return _0x273269[_0xc2d2('0x1a')](_0x738877);}return _0x273269[_0xc2d2('0x1b')](_0x738877)['end']();};}function respondWithResult(_0xa6f836,_0x4de52a){_0x4de52a=_0x4de52a||0xc8;return function(_0x5a1d24){if(_0x5a1d24){return _0xa6f836[_0xc2d2('0x1b')](_0x4de52a)[_0xc2d2('0x1c')](_0x5a1d24);}};}function respondWithFilteredResult(_0xf6bc66,_0x4006f3){return function(_0x2c42a6){if(_0x2c42a6){var _0x37552b=typeof _0x4006f3[_0xc2d2('0x1d')]===_0xc2d2('0x1e')&&typeof _0x4006f3[_0xc2d2('0x1f')]===_0xc2d2('0x1e');var _0x403d51=_0x2c42a6['count'];var _0x2d4ec4=_0x37552b?0x0:_0x4006f3[_0xc2d2('0x1d')];var _0x34f750=_0x37552b?_0x2c42a6[_0xc2d2('0x20')]:_0x4006f3['offset']+_0x4006f3[_0xc2d2('0x1f')];var _0x18cef7;if(_0x34f750>=_0x403d51){_0x34f750=_0x403d51;_0x18cef7=0xc8;}else{_0x18cef7=0xce;}_0xf6bc66['status'](_0x18cef7);return _0xf6bc66[_0xc2d2('0x21')](_0xc2d2('0x22'),_0x2d4ec4+'-'+_0x34f750+'/'+_0x403d51)[_0xc2d2('0x1c')](_0x2c42a6);}return null;};}function patchUpdates(_0xb14bc3){return function(_0x603323){try{jsonpatch['apply'](_0x603323,_0xb14bc3,!![]);}catch(_0x100d5b){return BPromise[_0xc2d2('0x23')](_0x100d5b);}return _0x603323['save']();};}function saveUpdates(_0x2cac91,_0x4e3cb5){return function(_0x5ecf78){if(_0x5ecf78){return _0x5ecf78['update'](_0x2cac91)[_0xc2d2('0x24')](function(_0x1bdcb5){return _0x1bdcb5;});}return null;};}function removeEntity(_0x7ffb28,_0x4b3449){return function(_0x2dbc46){if(_0x2dbc46){return _0x2dbc46[_0xc2d2('0x25')]()[_0xc2d2('0x24')](function(){_0x7ffb28[_0xc2d2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b201,_0x25e6af){return function(_0xf2ba15){if(!_0xf2ba15){_0x25b201[_0xc2d2('0x1a')](0x194);}return _0xf2ba15;};}function handleError(_0x1a11d2,_0x1c14e5){_0x1c14e5=_0x1c14e5||0x1f4;return function(_0x49e955){logger[_0xc2d2('0x26')](_0x49e955[_0xc2d2('0x27')]);if(_0x49e955[_0xc2d2('0x28')]){delete _0x49e955[_0xc2d2('0x28')];}_0x1a11d2['status'](_0x1c14e5)['send'](_0x49e955);};}exports[_0xc2d2('0x29')]=function(_0x7b75f4,_0x1f3b66){var _0x21ca37={},_0x402337={},_0x460379={'count':0x0,'rows':[]};var _0x4d4af2=_[_0xc2d2('0x2a')](db[_0xc2d2('0x2b')]['rawAttributes'],function(_0x29cae5){return{'name':_0x29cae5[_0xc2d2('0x2c')],'type':_0x29cae5[_0xc2d2('0x2d')][_0xc2d2('0x2e')]};});_0x402337[_0xc2d2('0x2f')]=_['map'](_0x4d4af2,'name');_0x402337[_0xc2d2('0x30')]=_['keys'](_0x7b75f4[_0xc2d2('0x30')]);_0x402337[_0xc2d2('0x31')]=_[_0xc2d2('0x32')](_0x402337[_0xc2d2('0x2f')],_0x402337[_0xc2d2('0x30')]);_0x21ca37['attributes']=_[_0xc2d2('0x32')](_0x402337[_0xc2d2('0x2f')],qs[_0xc2d2('0x33')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x33')]));_0x21ca37[_0xc2d2('0x34')]=_0x21ca37['attributes'][_0xc2d2('0x35')]?_0x21ca37[_0xc2d2('0x34')]:_0x402337['model'];if(!_0x7b75f4[_0xc2d2('0x30')]['hasOwnProperty'](_0xc2d2('0x36'))){_0x21ca37[_0xc2d2('0x1f')]=qs[_0xc2d2('0x1f')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x1f')]);_0x21ca37[_0xc2d2('0x1d')]=qs[_0xc2d2('0x1d')](_0x7b75f4[_0xc2d2('0x30')]['offset']);}_0x21ca37[_0xc2d2('0x37')]=qs[_0xc2d2('0x38')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x38')]);_0x21ca37['where']=qs[_0xc2d2('0x31')](_[_0xc2d2('0x39')](_0x7b75f4[_0xc2d2('0x30')],_0x402337[_0xc2d2('0x31')]),_0x4d4af2);if(_0x7b75f4['query'][_0xc2d2('0x3a')]){_0x21ca37['where']=_[_0xc2d2('0x3b')](_0x21ca37[_0xc2d2('0x3c')],{'$or':_['map'](_0x4d4af2,function(_0xdbdce0){if(_0xdbdce0[_0xc2d2('0x2d')]!==_0xc2d2('0x3d')){var _0x29d04b={};_0x29d04b[_0xdbdce0[_0xc2d2('0x28')]]={'$like':'%'+_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x3a')]+'%'};return _0x29d04b;}})});}_0x21ca37=_[_0xc2d2('0x3b')]({},_0x21ca37,_0x7b75f4[_0xc2d2('0x3e')]);var _0x49d900={'where':_0x21ca37['where']};return db[_0xc2d2('0x2b')][_0xc2d2('0x20')](_0x49d900)['then'](function(_0xfd3ad4){_0x460379[_0xc2d2('0x20')]=_0xfd3ad4;if(_0x7b75f4[_0xc2d2('0x30')]['includeAll']){_0x21ca37['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xc2d2('0x3f')](_0x21ca37);})[_0xc2d2('0x24')](function(_0x4031d0){_0x460379[_0xc2d2('0x40')]=_0x4031d0;return _0x460379;})['then'](respondWithFilteredResult(_0x1f3b66,_0x21ca37))[_0xc2d2('0x41')](handleError(_0x1f3b66,null));};exports['show']=function(_0x582edb,_0x24544e){var _0x2a987a={'raw':!![],'where':{'id':_0x582edb['params']['id']}},_0x386a39={};_0x386a39[_0xc2d2('0x2f')]=_[_0xc2d2('0x42')](db[_0xc2d2('0x2b')]['rawAttributes']);_0x386a39[_0xc2d2('0x30')]=_['keys'](_0x582edb[_0xc2d2('0x30')]);_0x386a39[_0xc2d2('0x31')]=_[_0xc2d2('0x32')](_0x386a39[_0xc2d2('0x2f')],_0x386a39[_0xc2d2('0x30')]);_0x2a987a[_0xc2d2('0x34')]=_['intersection'](_0x386a39[_0xc2d2('0x2f')],qs['fields'](_0x582edb[_0xc2d2('0x30')][_0xc2d2('0x33')]));_0x2a987a[_0xc2d2('0x34')]=_0x2a987a[_0xc2d2('0x34')][_0xc2d2('0x35')]?_0x2a987a['attributes']:_0x386a39[_0xc2d2('0x2f')];if(_0x582edb[_0xc2d2('0x30')]['includeAll']){_0x2a987a['include']=[{'all':!![]}];}_0x2a987a=_['merge']({},_0x2a987a,_0x582edb['options']);return db[_0xc2d2('0x2b')][_0xc2d2('0x43')](_0x2a987a)[_0xc2d2('0x24')](handleEntityNotFound(_0x24544e,null))[_0xc2d2('0x24')](respondWithResult(_0x24544e,null))[_0xc2d2('0x41')](handleError(_0x24544e,null));};exports[_0xc2d2('0x44')]=function(_0x1146cb,_0x3b795a){return db[_0xc2d2('0x2b')][_0xc2d2('0x44')](_0x1146cb[_0xc2d2('0x45')],{})[_0xc2d2('0x24')](respondWithResult(_0x3b795a,0xc9))['catch'](handleError(_0x3b795a,null));};exports[_0xc2d2('0x46')]=function(_0x4181dc,_0x572764){if(_0x4181dc[_0xc2d2('0x45')]['id']){delete _0x4181dc['body']['id'];}return db[_0xc2d2('0x2b')][_0xc2d2('0x43')]({'where':{'id':_0x4181dc[_0xc2d2('0x47')]['id']}})[_0xc2d2('0x24')](handleEntityNotFound(_0x572764,null))['then'](saveUpdates(_0x4181dc[_0xc2d2('0x45')],null))[_0xc2d2('0x24')](respondWithResult(_0x572764,null))[_0xc2d2('0x41')](handleError(_0x572764,null));};exports[_0xc2d2('0x25')]=function(_0x3b61ef,_0x4765f9){return db[_0xc2d2('0x2b')][_0xc2d2('0x43')]({'where':{'id':_0x3b61ef[_0xc2d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x4765f9,null))['then'](removeEntity(_0x4765f9,null))[_0xc2d2('0x41')](handleError(_0x4765f9,null));};exports[_0xc2d2('0x48')]=function(_0x472299,_0x1827c3){return db[_0xc2d2('0x2b')]['describe']()[_0xc2d2('0x24')](respondWithResult(_0x1827c3,null))[_0xc2d2('0x41')](handleError(_0x1827c3,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 1c94378..e16e93e 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0xcd4b0a,_0x1fca76){var _0x2d54a9=function(_0x139208){while(--_0x139208){_0xcd4b0a['push'](_0xcd4b0a['shift']());}};_0x2d54a9(++_0x1fca76);}(_0xb7e7,0x121));var _0x7b7e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xb7e7[_0x186376];return _0x2dbdd9;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x37a0ab,_0x34b900){var _0x13ca1d=function(_0x3c6a41){while(--_0x3c6a41){_0x37a0ab['push'](_0x37a0ab['shift']());}};_0x13ca1d(++_0x34b900);}(_0xb10b,0x12a));var _0xbb10=function(_0x348b29,_0x3be5e9){_0x348b29=_0x348b29-0x0;var _0xc260c5=_0xb10b[_0x348b29];return _0xc260c5;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 9068442..b5a5d72 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 _0xf7e2=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatQueueReport','body','CreateChatQueueReport','debug','UpdateChatQueueReport','options','raw','attributes','lodash','util','bluebird'];(function(_0x2cf5c9,_0x56e270){var _0x162695=function(_0x5952ca){while(--_0x5952ca){_0x2cf5c9['push'](_0x2cf5c9['shift']());}};_0x162695(++_0x56e270);}(_0xf7e2,0x1bd));var _0x2f7e=function(_0x146ac6,_0x1f34bf){_0x146ac6=_0x146ac6-0x0;var _0x2892bd=_0xf7e2[_0x146ac6];return _0x2892bd;};'use strict';var _=require(_0x2f7e('0x0'));var util=require(_0x2f7e('0x1'));var moment=require('moment');var BPromise=require(_0x2f7e('0x2'));var rs=require(_0x2f7e('0x3'));var fs=require('fs');var Redis=require(_0x2f7e('0x4'));var db=require(_0x2f7e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2f7e('0x6'))(_0x2f7e('0x7'));var config=require(_0x2f7e('0x8'));var jayson=require(_0x2f7e('0x9'));var client=jayson[_0x2f7e('0xa')][_0x2f7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd1d1,_0x33aa1d,_0x515cf1){return new BPromise(function(_0x3d9396,_0x2e52a2){return client[_0x2f7e('0xc')](_0x5bd1d1,_0x515cf1)[_0x2f7e('0xd')](function(_0x18eeb4){logger['info'](_0x2f7e('0xe'),_0x33aa1d,_0x2f7e('0xf'));logger['debug'](_0x2f7e('0x10'),_0x33aa1d,_0x2f7e('0xf'),JSON[_0x2f7e('0x11')](_0x18eeb4));if(_0x18eeb4[_0x2f7e('0x12')]){if(_0x18eeb4[_0x2f7e('0x12')][_0x2f7e('0x13')]===0x1f4){logger[_0x2f7e('0x12')](_0x2f7e('0xe'),_0x33aa1d,_0x18eeb4['error']['message']);return _0x2e52a2(_0x18eeb4[_0x2f7e('0x12')]['message']);}logger[_0x2f7e('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x33aa1d,_0x18eeb4[_0x2f7e('0x12')][_0x2f7e('0x14')]);return _0x3d9396(_0x18eeb4['error'][_0x2f7e('0x14')]);}else{logger[_0x2f7e('0x15')](_0x2f7e('0xe'),_0x33aa1d,_0x2f7e('0xf'));_0x3d9396(_0x18eeb4[_0x2f7e('0x16')][_0x2f7e('0x14')]);}})[_0x2f7e('0x17')](function(_0x3a066a){logger[_0x2f7e('0x12')](_0x2f7e('0xe'),_0x33aa1d,_0x3a066a);_0x2e52a2(_0x3a066a);});});}exports['CreateChatQueueReport']=function(_0x4a0ff8){var _0x2c30ea=this;return new Promise(function(_0x19b909,_0x3ee08a){return db[_0x2f7e('0x18')]['create'](_0x4a0ff8[_0x2f7e('0x19')],{'raw':_0x4a0ff8['options']?_0x4a0ff8['options']['raw']===undefined?!![]:![]:!![]})[_0x2f7e('0xd')](function(_0x1b60ad){logger[_0x2f7e('0x15')](_0x2f7e('0x1a'),_0x4a0ff8);logger[_0x2f7e('0x1b')](_0x2f7e('0x1a'),_0x4a0ff8,JSON['stringify'](_0x1b60ad));_0x19b909(_0x1b60ad);})['catch'](function(_0x5dbce6){logger['error'](_0x2f7e('0x1a'),_0x5dbce6[_0x2f7e('0x14')],_0x4a0ff8);_0x3ee08a(_0x2c30ea[_0x2f7e('0x12')](0x1f4,_0x5dbce6[_0x2f7e('0x14')]));});});};exports[_0x2f7e('0x1c')]=function(_0x380176){var _0xe29a6=this;return new Promise(function(_0x283efa,_0x59bbc1){return db[_0x2f7e('0x18')]['update'](_0x380176[_0x2f7e('0x19')],{'raw':_0x380176[_0x2f7e('0x1d')]?_0x380176[_0x2f7e('0x1d')][_0x2f7e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x380176[_0x2f7e('0x1d')]?_0x380176[_0x2f7e('0x1d')]['where']||null:null,'attributes':_0x380176['options']?_0x380176[_0x2f7e('0x1d')][_0x2f7e('0x1f')]||null:null,'limit':_0x380176[_0x2f7e('0x1d')]?_0x380176[_0x2f7e('0x1d')]['limit']||null:null})[_0x2f7e('0xd')](function(_0x489bbf){logger[_0x2f7e('0x15')](_0x2f7e('0x1c'),_0x380176);logger['debug']('UpdateChatQueueReport',_0x380176,JSON[_0x2f7e('0x11')](_0x489bbf));_0x283efa(_0x489bbf);})[_0x2f7e('0x17')](function(_0x50b9a0){logger[_0x2f7e('0x12')](_0x2f7e('0x1c'),_0x50b9a0[_0x2f7e('0x14')],_0x380176);_0x59bbc1(_0xe29a6[_0x2f7e('0x12')](0x1f4,_0x50b9a0[_0x2f7e('0x14')]));});});};
\ No newline at end of file
+var _0x8727=['CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','catch','UpdateChatQueueReport','update','where','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x8727,0x8c));var _0x7872=function(_0xa58a3e,_0x115109){_0xa58a3e=_0xa58a3e-0x0;var _0x4f6cd2=_0x8727[_0xa58a3e];return _0x4f6cd2;};'use strict';var _=require('lodash');var util=require(_0x7872('0x0'));var moment=require(_0x7872('0x1'));var BPromise=require(_0x7872('0x2'));var rs=require(_0x7872('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7872('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7872('0x5'))(_0x7872('0x6'));var config=require(_0x7872('0x7'));var jayson=require(_0x7872('0x8'));var client=jayson['client'][_0x7872('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x130bbf,_0xba7c24,_0x47b40e){return new BPromise(function(_0x12f9bb,_0x2e42e4){return client['request'](_0x130bbf,_0x47b40e)[_0x7872('0xa')](function(_0x1c6983){logger[_0x7872('0xb')](_0x7872('0xc'),_0xba7c24,_0x7872('0xd'));logger[_0x7872('0xe')](_0x7872('0xf'),_0xba7c24,_0x7872('0xd'),JSON['stringify'](_0x1c6983));if(_0x1c6983[_0x7872('0x10')]){if(_0x1c6983[_0x7872('0x10')][_0x7872('0x11')]===0x1f4){logger['error'](_0x7872('0xc'),_0xba7c24,_0x1c6983[_0x7872('0x10')][_0x7872('0x12')]);return _0x2e42e4(_0x1c6983[_0x7872('0x10')][_0x7872('0x12')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xba7c24,_0x1c6983[_0x7872('0x10')][_0x7872('0x12')]);return _0x12f9bb(_0x1c6983['error'][_0x7872('0x12')]);}else{logger[_0x7872('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0xba7c24,_0x7872('0xd'));_0x12f9bb(_0x1c6983[_0x7872('0x13')][_0x7872('0x12')]);}})['catch'](function(_0xa26208){logger['error'](_0x7872('0xc'),_0xba7c24,_0xa26208);_0x2e42e4(_0xa26208);});});}exports[_0x7872('0x14')]=function(_0x438afb){var _0x5c96c9=this;return new Promise(function(_0x4a7c68,_0x5cfd4f){return db[_0x7872('0x15')][_0x7872('0x16')](_0x438afb[_0x7872('0x17')],{'raw':_0x438afb[_0x7872('0x18')]?_0x438afb[_0x7872('0x18')][_0x7872('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0xce0414){logger[_0x7872('0xb')](_0x7872('0x14'),_0x438afb);logger['debug'](_0x7872('0x14'),_0x438afb,JSON[_0x7872('0x1a')](_0xce0414));_0x4a7c68(_0xce0414);})[_0x7872('0x1b')](function(_0x38c97d){logger[_0x7872('0x10')]('CreateChatQueueReport',_0x38c97d['message'],_0x438afb);_0x5cfd4f(_0x5c96c9['error'](0x1f4,_0x38c97d[_0x7872('0x12')]));});});};exports[_0x7872('0x1c')]=function(_0x59638d){var _0x223fa3=this;return new Promise(function(_0x534ef5,_0x369966){return db[_0x7872('0x15')][_0x7872('0x1d')](_0x59638d[_0x7872('0x17')],{'raw':_0x59638d[_0x7872('0x18')]?_0x59638d[_0x7872('0x18')][_0x7872('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59638d[_0x7872('0x18')]?_0x59638d[_0x7872('0x18')][_0x7872('0x1e')]||null:null,'attributes':_0x59638d[_0x7872('0x18')]?_0x59638d[_0x7872('0x18')]['attributes']||null:null,'limit':_0x59638d[_0x7872('0x18')]?_0x59638d['options'][_0x7872('0x1f')]||null:null})[_0x7872('0xa')](function(_0x47a0d4){logger[_0x7872('0xb')](_0x7872('0x1c'),_0x59638d);logger[_0x7872('0xe')](_0x7872('0x1c'),_0x59638d,JSON[_0x7872('0x1a')](_0x47a0d4));_0x534ef5(_0x47a0d4);})['catch'](function(_0xcf13f8){logger[_0x7872('0x10')]('UpdateChatQueueReport',_0xcf13f8[_0x7872('0x12')],_0x59638d);_0x369966(_0x223fa3['error'](0x1f4,_0xcf13f8['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 2ab7e65..2d37667 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 _0x2875=['/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x5cc49e,_0x571829){var _0x5071f4=function(_0xdc5b79){while(--_0xdc5b79){_0x5cc49e['push'](_0x5cc49e['shift']());}};_0x5071f4(++_0x571829);}(_0x2875,0x11e));var _0x5287=function(_0x5f0995,_0x207d8c){_0x5f0995=_0x5f0995-0x0;var _0x2e0334=_0x2875[_0x5f0995];return _0x2e0334;};'use strict';var multer=require(_0x5287('0x0'));var util=require(_0x5287('0x1'));var path=require(_0x5287('0x2'));var timeout=require(_0x5287('0x3'));var express=require(_0x5287('0x4'));var router=express[_0x5287('0x5')]();var fs_extra=require(_0x5287('0x6'));var auth=require(_0x5287('0x7'));var interaction=require(_0x5287('0x8'));var config=require(_0x5287('0x9'));var controller=require('./chatQueueReport.controller');router[_0x5287('0xa')]('/',auth['isAuthenticated'](),controller[_0x5287('0xb')]);router[_0x5287('0xa')](_0x5287('0xc'),auth[_0x5287('0xd')](),controller['describe']);router[_0x5287('0xa')](_0x5287('0xe'),auth[_0x5287('0xd')](),controller['show']);router[_0x5287('0xf')]('/',auth['isAuthenticated'](),controller[_0x5287('0x10')]);router['put'](_0x5287('0xe'),auth[_0x5287('0xd')](),controller['update']);router[_0x5287('0x11')](_0x5287('0xe'),auth[_0x5287('0xd')](),controller[_0x5287('0x12')]);module[_0x5287('0x13')]=router;
\ No newline at end of file
+var _0x94c3=['describe','/:id','post','create','put','update','delete','exports','util','path','express','fs-extra','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index'];(function(_0x3be333,_0x1b4d22){var _0x24670c=function(_0x412883){while(--_0x412883){_0x3be333['push'](_0x3be333['shift']());}};_0x24670c(++_0x1b4d22);}(_0x94c3,0x1d3));var _0x394c=function(_0x2ecbd9,_0x247e5f){_0x2ecbd9=_0x2ecbd9-0x0;var _0x49a198=_0x94c3[_0x2ecbd9];return _0x49a198;};'use strict';var multer=require('multer');var util=require(_0x394c('0x0'));var path=require(_0x394c('0x1'));var timeout=require('connect-timeout');var express=require(_0x394c('0x2'));var router=express['Router']();var fs_extra=require(_0x394c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x394c('0x4'));var config=require('../../config/environment');var controller=require(_0x394c('0x5'));router[_0x394c('0x6')]('/',auth[_0x394c('0x7')](),controller[_0x394c('0x8')]);router[_0x394c('0x6')]('/describe',auth[_0x394c('0x7')](),controller[_0x394c('0x9')]);router[_0x394c('0x6')](_0x394c('0xa'),auth[_0x394c('0x7')](),controller['show']);router[_0x394c('0xb')]('/',auth['isAuthenticated'](),controller[_0x394c('0xc')]);router[_0x394c('0xd')]('/:id',auth[_0x394c('0x7')](),controller[_0x394c('0xe')]);router[_0x394c('0xf')](_0x394c('0xa'),auth[_0x394c('0x7')](),controller['destroy']);module[_0x394c('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 4041d7e..102d37b 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(_0x53273a,_0x5ed978){var _0x3c41db=function(_0x491a57){while(--_0x491a57){_0x53273a['push'](_0x53273a['shift']());}};_0x3c41db(++_0x5ed978);}(_0x008c,0x188));var _0xc008=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0x008c[_0x7b484];return _0x2ae1cf;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x3c0569,_0x11da9f){var _0x142524=function(_0x59a41e){while(--_0x59a41e){_0x3c0569['push'](_0x3c0569['shift']());}};_0x142524(++_0x11da9f);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 1b0aa9f..3bbdc12 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 _0xfe0a=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatTransferReport','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x34d0a4,_0x217ff4){var _0x350ae3=function(_0x2834af){while(--_0x2834af){_0x34d0a4['push'](_0x34d0a4['shift']());}};_0x350ae3(++_0x217ff4);}(_0xfe0a,0x10c));var _0xafe0=function(_0x14f21c,_0x315b28){_0x14f21c=_0x14f21c-0x0;var _0x2b509b=_0xfe0a[_0x14f21c];return _0x2b509b;};'use strict';var emlformat=require(_0xafe0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xafe0('0x1'));var jsonpatch=require(_0xafe0('0x2'));var rp=require(_0xafe0('0x3'));var moment=require('moment');var BPromise=require(_0xafe0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xafe0('0x5'));var sox=require(_0xafe0('0x6'));var csv=require(_0xafe0('0x7'));var ejs=require(_0xafe0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xafe0('0x9'));var crypto=require(_0xafe0('0xa'));var jsforce=require(_0xafe0('0xb'));var deskjs=require(_0xafe0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xafe0('0xd'));var Papa=require('papaparse');var Redis=require(_0xafe0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xafe0('0xf'));var as=require(_0xafe0('0x10'));var hardwareService=require(_0xafe0('0x11'));var logger=require(_0xafe0('0x12'))(_0xafe0('0x13'));var utils=require(_0xafe0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xafe0('0x15'));var db=require(_0xafe0('0x16'))['db'];function respondWithStatusCode(_0x116610,_0x3669d1){_0x3669d1=_0x3669d1||0xcc;return function(_0x4865a4){if(_0x4865a4){return _0x116610[_0xafe0('0x17')](_0x3669d1);}return _0x116610[_0xafe0('0x18')](_0x3669d1)['end']();};}function respondWithResult(_0xd54083,_0x7ae7b9){_0x7ae7b9=_0x7ae7b9||0xc8;return function(_0xcc1418){if(_0xcc1418){return _0xd54083[_0xafe0('0x18')](_0x7ae7b9)[_0xafe0('0x19')](_0xcc1418);}};}function respondWithFilteredResult(_0x80450a,_0x3d950e){return function(_0x18e506){if(_0x18e506){var _0x13e4a5=typeof _0x3d950e[_0xafe0('0x1a')]==='undefined'&&typeof _0x3d950e['limit']===_0xafe0('0x1b');var _0x158138=_0x18e506[_0xafe0('0x1c')];var _0xbc2b87=_0x13e4a5?0x0:_0x3d950e['offset'];var _0x281d1a=_0x13e4a5?_0x18e506['count']:_0x3d950e['offset']+_0x3d950e[_0xafe0('0x1d')];var _0x2b87a7;if(_0x281d1a>=_0x158138){_0x281d1a=_0x158138;_0x2b87a7=0xc8;}else{_0x2b87a7=0xce;}_0x80450a[_0xafe0('0x18')](_0x2b87a7);return _0x80450a['set'](_0xafe0('0x1e'),_0xbc2b87+'-'+_0x281d1a+'/'+_0x158138)[_0xafe0('0x19')](_0x18e506);}return null;};}function patchUpdates(_0x41fc65){return function(_0x2c5d98){try{jsonpatch[_0xafe0('0x1f')](_0x2c5d98,_0x41fc65,!![]);}catch(_0xe33b77){return BPromise[_0xafe0('0x20')](_0xe33b77);}return _0x2c5d98[_0xafe0('0x21')]();};}function saveUpdates(_0x40258a,_0x9e20ae){return function(_0x4375cc){if(_0x4375cc){return _0x4375cc[_0xafe0('0x22')](_0x40258a)[_0xafe0('0x23')](function(_0xe25448){return _0xe25448;});}return null;};}function removeEntity(_0x25d757,_0x519ffb){return function(_0x30ea39){if(_0x30ea39){return _0x30ea39[_0xafe0('0x24')]()['then'](function(){_0x25d757[_0xafe0('0x18')](0xcc)[_0xafe0('0x25')]();});}};}function handleEntityNotFound(_0x44f306,_0x558ea8){return function(_0x402bbf){if(!_0x402bbf){_0x44f306['sendStatus'](0x194);}return _0x402bbf;};}function handleError(_0xdb18,_0x8b897b){_0x8b897b=_0x8b897b||0x1f4;return function(_0x2bc23a){logger[_0xafe0('0x26')](_0x2bc23a[_0xafe0('0x27')]);if(_0x2bc23a[_0xafe0('0x28')]){delete _0x2bc23a[_0xafe0('0x28')];}_0xdb18[_0xafe0('0x18')](_0x8b897b)[_0xafe0('0x29')](_0x2bc23a);};}exports['index']=function(_0x28c58a,_0x36d600){var _0x214912={},_0x3ab9ed={},_0x29fa50={'count':0x0,'rows':[]};var _0xa41a24=_[_0xafe0('0x2a')](db[_0xafe0('0x2b')]['rawAttributes'],function(_0x383bd5){return{'name':_0x383bd5['fieldName'],'type':_0x383bd5[_0xafe0('0x2c')]['key']};});_0x3ab9ed[_0xafe0('0x2d')]=_['map'](_0xa41a24,_0xafe0('0x28'));_0x3ab9ed[_0xafe0('0x2e')]=_[_0xafe0('0x2f')](_0x28c58a['query']);_0x3ab9ed['filters']=_[_0xafe0('0x30')](_0x3ab9ed[_0xafe0('0x2d')],_0x3ab9ed[_0xafe0('0x2e')]);_0x214912[_0xafe0('0x31')]=_[_0xafe0('0x30')](_0x3ab9ed['model'],qs['fields'](_0x28c58a[_0xafe0('0x2e')][_0xafe0('0x32')]));_0x214912[_0xafe0('0x31')]=_0x214912['attributes']['length']?_0x214912[_0xafe0('0x31')]:_0x3ab9ed['model'];if(!_0x28c58a[_0xafe0('0x2e')][_0xafe0('0x33')]('nolimit')){_0x214912[_0xafe0('0x1d')]=qs[_0xafe0('0x1d')](_0x28c58a[_0xafe0('0x2e')][_0xafe0('0x1d')]);_0x214912[_0xafe0('0x1a')]=qs[_0xafe0('0x1a')](_0x28c58a[_0xafe0('0x2e')][_0xafe0('0x1a')]);}_0x214912['order']=qs[_0xafe0('0x34')](_0x28c58a[_0xafe0('0x2e')][_0xafe0('0x34')]);_0x214912[_0xafe0('0x35')]=qs[_0xafe0('0x36')](_[_0xafe0('0x37')](_0x28c58a['query'],_0x3ab9ed[_0xafe0('0x36')]),_0xa41a24);if(_0x28c58a['query'][_0xafe0('0x38')]){_0x214912['where']=_[_0xafe0('0x39')](_0x214912[_0xafe0('0x35')],{'$or':_[_0xafe0('0x2a')](_0xa41a24,function(_0x4acdc9){if(_0x4acdc9['type']!==_0xafe0('0x3a')){var _0xbd73fb={};_0xbd73fb[_0x4acdc9[_0xafe0('0x28')]]={'$like':'%'+_0x28c58a[_0xafe0('0x2e')]['filter']+'%'};return _0xbd73fb;}})});}_0x214912=_[_0xafe0('0x39')]({},_0x214912,_0x28c58a[_0xafe0('0x3b')]);var _0x2488f3={'where':_0x214912['where']};return db[_0xafe0('0x2b')]['count'](_0x2488f3)[_0xafe0('0x23')](function(_0x132907){_0x29fa50['count']=_0x132907;if(_0x28c58a['query'][_0xafe0('0x3c')]){_0x214912['include']=[{'all':!![]}];}return db[_0xafe0('0x2b')][_0xafe0('0x3d')](_0x214912);})[_0xafe0('0x23')](function(_0x12f590){_0x29fa50[_0xafe0('0x3e')]=_0x12f590;return _0x29fa50;})[_0xafe0('0x23')](respondWithFilteredResult(_0x36d600,_0x214912))[_0xafe0('0x3f')](handleError(_0x36d600,null));};exports[_0xafe0('0x40')]=function(_0x206d79,_0x19d5b2){var _0x2a267a={'raw':!![],'where':{'id':_0x206d79['params']['id']}},_0x4e21e7={};_0x4e21e7[_0xafe0('0x2d')]=_['keys'](db[_0xafe0('0x2b')][_0xafe0('0x41')]);_0x4e21e7[_0xafe0('0x2e')]=_[_0xafe0('0x2f')](_0x206d79['query']);_0x4e21e7[_0xafe0('0x36')]=_[_0xafe0('0x30')](_0x4e21e7[_0xafe0('0x2d')],_0x4e21e7[_0xafe0('0x2e')]);_0x2a267a[_0xafe0('0x31')]=_['intersection'](_0x4e21e7[_0xafe0('0x2d')],qs[_0xafe0('0x32')](_0x206d79['query']['fields']));_0x2a267a[_0xafe0('0x31')]=_0x2a267a['attributes']['length']?_0x2a267a[_0xafe0('0x31')]:_0x4e21e7[_0xafe0('0x2d')];if(_0x206d79[_0xafe0('0x2e')][_0xafe0('0x3c')]){_0x2a267a[_0xafe0('0x42')]=[{'all':!![]}];}_0x2a267a=_['merge']({},_0x2a267a,_0x206d79[_0xafe0('0x3b')]);return db['ChatTransferReport'][_0xafe0('0x43')](_0x2a267a)[_0xafe0('0x23')](handleEntityNotFound(_0x19d5b2,null))['then'](respondWithResult(_0x19d5b2,null))[_0xafe0('0x3f')](handleError(_0x19d5b2,null));};exports[_0xafe0('0x44')]=function(_0xd82b5,_0x597ee7){return db['ChatTransferReport'][_0xafe0('0x44')](_0xd82b5['body'],{})[_0xafe0('0x23')](respondWithResult(_0x597ee7,0xc9))['catch'](handleError(_0x597ee7,null));};exports[_0xafe0('0x22')]=function(_0x1eae0c,_0xd5923){if(_0x1eae0c['body']['id']){delete _0x1eae0c[_0xafe0('0x45')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x1eae0c[_0xafe0('0x46')]['id']}})['then'](handleEntityNotFound(_0xd5923,null))[_0xafe0('0x23')](saveUpdates(_0x1eae0c[_0xafe0('0x45')],null))[_0xafe0('0x23')](respondWithResult(_0xd5923,null))[_0xafe0('0x3f')](handleError(_0xd5923,null));};exports[_0xafe0('0x24')]=function(_0x3ffc06,_0x21c629){return db['ChatTransferReport'][_0xafe0('0x43')]({'where':{'id':_0x3ffc06[_0xafe0('0x46')]['id']}})['then'](handleEntityNotFound(_0x21c629,null))[_0xafe0('0x23')](removeEntity(_0x21c629,null))[_0xafe0('0x3f')](handleError(_0x21c629,null));};exports['describe']=function(_0x163f71,_0x139352){return db[_0xafe0('0x2b')]['describe']()[_0xafe0('0x23')](respondWithResult(_0x139352,null))[_0xafe0('0x3f')](handleError(_0x139352,null));};
\ No newline at end of file
+var _0x52f6=['model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','end','error','stack','name','send','index','ChatTransferReport','fieldName','type','key'];(function(_0x38fbc2,_0x54f822){var _0x2ae767=function(_0x172113){while(--_0x172113){_0x38fbc2['push'](_0x38fbc2['shift']());}};_0x2ae767(++_0x54f822);}(_0x52f6,0xf8));var _0x652f=function(_0x441e5d,_0x204cd9){_0x441e5d=_0x441e5d-0x0;var _0x251a60=_0x52f6[_0x441e5d];return _0x251a60;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x652f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x652f('0x1'));var rp=require(_0x652f('0x2'));var moment=require(_0x652f('0x3'));var BPromise=require(_0x652f('0x4'));var Mustache=require('mustache');var util=require(_0x652f('0x5'));var path=require(_0x652f('0x6'));var sox=require(_0x652f('0x7'));var csv=require('to-csv');var ejs=require(_0x652f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x652f('0x9'));var squel=require(_0x652f('0xa'));var crypto=require(_0x652f('0xb'));var jsforce=require(_0x652f('0xc'));var deskjs=require(_0x652f('0xd'));var toCsv=require(_0x652f('0xe'));var querystring=require(_0x652f('0xf'));var Papa=require(_0x652f('0x10'));var Redis=require(_0x652f('0x11'));var authService=require(_0x652f('0x12'));var qs=require(_0x652f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x652f('0x14'));var logger=require(_0x652f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x652f('0x16'));var licenseUtil=require(_0x652f('0x17'));var db=require(_0x652f('0x18'))['db'];function respondWithStatusCode(_0x1aad4b,_0x219f5b){_0x219f5b=_0x219f5b||0xcc;return function(_0xe1da3d){if(_0xe1da3d){return _0x1aad4b[_0x652f('0x19')](_0x219f5b);}return _0x1aad4b[_0x652f('0x1a')](_0x219f5b)['end']();};}function respondWithResult(_0x5be48d,_0xe408eb){_0xe408eb=_0xe408eb||0xc8;return function(_0x5396ce){if(_0x5396ce){return _0x5be48d['status'](_0xe408eb)[_0x652f('0x1b')](_0x5396ce);}};}function respondWithFilteredResult(_0x116723,_0x7aaaed){return function(_0x373591){if(_0x373591){var _0x46aa25=typeof _0x7aaaed[_0x652f('0x1c')]===_0x652f('0x1d')&&typeof _0x7aaaed['limit']===_0x652f('0x1d');var _0x5e2fd4=_0x373591[_0x652f('0x1e')];var _0x13b7be=_0x46aa25?0x0:_0x7aaaed[_0x652f('0x1c')];var _0xefff7c=_0x46aa25?_0x373591[_0x652f('0x1e')]:_0x7aaaed[_0x652f('0x1c')]+_0x7aaaed[_0x652f('0x1f')];var _0x5adea7;if(_0xefff7c>=_0x5e2fd4){_0xefff7c=_0x5e2fd4;_0x5adea7=0xc8;}else{_0x5adea7=0xce;}_0x116723[_0x652f('0x1a')](_0x5adea7);return _0x116723[_0x652f('0x20')](_0x652f('0x21'),_0x13b7be+'-'+_0xefff7c+'/'+_0x5e2fd4)['json'](_0x373591);}return null;};}function patchUpdates(_0x653fe3){return function(_0x267b54){try{jsonpatch['apply'](_0x267b54,_0x653fe3,!![]);}catch(_0x55a85a){return BPromise[_0x652f('0x22')](_0x55a85a);}return _0x267b54[_0x652f('0x23')]();};}function saveUpdates(_0x5b3fe2,_0x534be3){return function(_0x374507){if(_0x374507){return _0x374507[_0x652f('0x24')](_0x5b3fe2)[_0x652f('0x25')](function(_0x3b9cb7){return _0x3b9cb7;});}return null;};}function removeEntity(_0x5b5f62,_0x5947e2){return function(_0x2d401d){if(_0x2d401d){return _0x2d401d['destroy']()[_0x652f('0x25')](function(){_0x5b5f62[_0x652f('0x1a')](0xcc)[_0x652f('0x26')]();});}};}function handleEntityNotFound(_0x304e80,_0x44f363){return function(_0xaa6ae6){if(!_0xaa6ae6){_0x304e80['sendStatus'](0x194);}return _0xaa6ae6;};}function handleError(_0xaba730,_0x54e89d){_0x54e89d=_0x54e89d||0x1f4;return function(_0x4e2d5f){logger[_0x652f('0x27')](_0x4e2d5f[_0x652f('0x28')]);if(_0x4e2d5f['name']){delete _0x4e2d5f[_0x652f('0x29')];}_0xaba730['status'](_0x54e89d)[_0x652f('0x2a')](_0x4e2d5f);};}exports[_0x652f('0x2b')]=function(_0x72ae35,_0x2b989f){var _0x2635d7={},_0x326a21={},_0x280de4={'count':0x0,'rows':[]};var _0x5af914=_['map'](db[_0x652f('0x2c')]['rawAttributes'],function(_0x208a36){return{'name':_0x208a36[_0x652f('0x2d')],'type':_0x208a36[_0x652f('0x2e')][_0x652f('0x2f')]};});_0x326a21[_0x652f('0x30')]=_[_0x652f('0x31')](_0x5af914,_0x652f('0x29'));_0x326a21[_0x652f('0x32')]=_[_0x652f('0x33')](_0x72ae35[_0x652f('0x32')]);_0x326a21[_0x652f('0x34')]=_[_0x652f('0x35')](_0x326a21['model'],_0x326a21[_0x652f('0x32')]);_0x2635d7[_0x652f('0x36')]=_['intersection'](_0x326a21[_0x652f('0x30')],qs[_0x652f('0x37')](_0x72ae35['query'][_0x652f('0x37')]));_0x2635d7[_0x652f('0x36')]=_0x2635d7[_0x652f('0x36')][_0x652f('0x38')]?_0x2635d7[_0x652f('0x36')]:_0x326a21[_0x652f('0x30')];if(!_0x72ae35['query']['hasOwnProperty'](_0x652f('0x39'))){_0x2635d7['limit']=qs[_0x652f('0x1f')](_0x72ae35[_0x652f('0x32')][_0x652f('0x1f')]);_0x2635d7[_0x652f('0x1c')]=qs[_0x652f('0x1c')](_0x72ae35['query'][_0x652f('0x1c')]);}_0x2635d7[_0x652f('0x3a')]=qs['sort'](_0x72ae35[_0x652f('0x32')]['sort']);_0x2635d7[_0x652f('0x3b')]=qs[_0x652f('0x34')](_[_0x652f('0x3c')](_0x72ae35[_0x652f('0x32')],_0x326a21[_0x652f('0x34')]),_0x5af914);if(_0x72ae35[_0x652f('0x32')][_0x652f('0x3d')]){_0x2635d7[_0x652f('0x3b')]=_['merge'](_0x2635d7[_0x652f('0x3b')],{'$or':_['map'](_0x5af914,function(_0x42104e){if(_0x42104e[_0x652f('0x2e')]!==_0x652f('0x3e')){var _0x2cf9c4={};_0x2cf9c4[_0x42104e[_0x652f('0x29')]]={'$like':'%'+_0x72ae35[_0x652f('0x32')][_0x652f('0x3d')]+'%'};return _0x2cf9c4;}})});}_0x2635d7=_['merge']({},_0x2635d7,_0x72ae35[_0x652f('0x3f')]);var _0x2e38ce={'where':_0x2635d7[_0x652f('0x3b')]};return db[_0x652f('0x2c')][_0x652f('0x1e')](_0x2e38ce)[_0x652f('0x25')](function(_0x580e05){_0x280de4[_0x652f('0x1e')]=_0x580e05;if(_0x72ae35['query'][_0x652f('0x40')]){_0x2635d7[_0x652f('0x41')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2635d7);})[_0x652f('0x25')](function(_0x1b4965){_0x280de4[_0x652f('0x42')]=_0x1b4965;return _0x280de4;})[_0x652f('0x25')](respondWithFilteredResult(_0x2b989f,_0x2635d7))[_0x652f('0x43')](handleError(_0x2b989f,null));};exports[_0x652f('0x44')]=function(_0x51785e,_0x14bb29){var _0x1a8480={'raw':!![],'where':{'id':_0x51785e[_0x652f('0x45')]['id']}},_0x5a7d46={};_0x5a7d46[_0x652f('0x30')]=_[_0x652f('0x33')](db['ChatTransferReport']['rawAttributes']);_0x5a7d46[_0x652f('0x32')]=_[_0x652f('0x33')](_0x51785e['query']);_0x5a7d46[_0x652f('0x34')]=_[_0x652f('0x35')](_0x5a7d46[_0x652f('0x30')],_0x5a7d46['query']);_0x1a8480[_0x652f('0x36')]=_[_0x652f('0x35')](_0x5a7d46[_0x652f('0x30')],qs['fields'](_0x51785e['query'][_0x652f('0x37')]));_0x1a8480['attributes']=_0x1a8480[_0x652f('0x36')][_0x652f('0x38')]?_0x1a8480[_0x652f('0x36')]:_0x5a7d46[_0x652f('0x30')];if(_0x51785e[_0x652f('0x32')][_0x652f('0x40')]){_0x1a8480[_0x652f('0x41')]=[{'all':!![]}];}_0x1a8480=_['merge']({},_0x1a8480,_0x51785e['options']);return db[_0x652f('0x2c')][_0x652f('0x46')](_0x1a8480)['then'](handleEntityNotFound(_0x14bb29,null))[_0x652f('0x25')](respondWithResult(_0x14bb29,null))[_0x652f('0x43')](handleError(_0x14bb29,null));};exports['create']=function(_0x33f806,_0x333dea){return db['ChatTransferReport']['create'](_0x33f806['body'],{})[_0x652f('0x25')](respondWithResult(_0x333dea,0xc9))[_0x652f('0x43')](handleError(_0x333dea,null));};exports[_0x652f('0x24')]=function(_0x46e91e,_0x5d22aa){if(_0x46e91e[_0x652f('0x47')]['id']){delete _0x46e91e[_0x652f('0x47')]['id'];}return db['ChatTransferReport'][_0x652f('0x46')]({'where':{'id':_0x46e91e[_0x652f('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d22aa,null))[_0x652f('0x25')](saveUpdates(_0x46e91e[_0x652f('0x47')],null))[_0x652f('0x25')](respondWithResult(_0x5d22aa,null))[_0x652f('0x43')](handleError(_0x5d22aa,null));};exports[_0x652f('0x48')]=function(_0x2d8d3c,_0x1fefe3){return db[_0x652f('0x2c')][_0x652f('0x46')]({'where':{'id':_0x2d8d3c[_0x652f('0x45')]['id']}})[_0x652f('0x25')](handleEntityNotFound(_0x1fefe3,null))[_0x652f('0x25')](removeEntity(_0x1fefe3,null))[_0x652f('0x43')](handleError(_0x1fefe3,null));};exports[_0x652f('0x49')]=function(_0x356eeb,_0x52ea10){return db['ChatTransferReport'][_0x652f('0x49')]()[_0x652f('0x25')](respondWithResult(_0x52ea10,null))['catch'](handleError(_0x52ea10,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index daade68..493e5fd 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 _0xc339=['./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0xc339,0xae));var _0x9c33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc339[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9c33('0x0'));var util=require(_0x9c33('0x1'));var logger=require(_0x9c33('0x2'))(_0x9c33('0x3'));var moment=require('moment');var BPromise=require(_0x9c33('0x4'));var rp=require(_0x9c33('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c33('0x6'));var config=require(_0x9c33('0x7'));var attributes=require(_0x9c33('0x8'));module[_0x9c33('0x9')]=function(_0xaf8460,_0xd6da0b){return _0xaf8460[_0x9c33('0xa')](_0x9c33('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x9c33('0xc'),'fields':[_0x9c33('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0bf=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x250332,_0x40ff3e){var _0xe47c67=function(_0xd79430){while(--_0xd79430){_0x250332['push'](_0x250332['shift']());}};_0xe47c67(++_0x40ff3e);}(_0xa0bf,0x7e));var _0xfa0b=function(_0x57a1b4,_0x4e0e05){_0x57a1b4=_0x57a1b4-0x0;var _0xb9803a=_0xa0bf[_0x57a1b4];return _0xb9803a;};'use strict';var _=require(_0xfa0b('0x0'));var util=require(_0xfa0b('0x1'));var logger=require('../../config/logger')(_0xfa0b('0x2'));var moment=require(_0xfa0b('0x3'));var BPromise=require(_0xfa0b('0x4'));var rp=require(_0xfa0b('0x5'));var fs=require('fs');var path=require(_0xfa0b('0x6'));var rimraf=require(_0xfa0b('0x7'));var config=require(_0xfa0b('0x8'));var attributes=require(_0xfa0b('0x9'));module[_0xfa0b('0xa')]=function(_0x565397,_0x173733){return _0x565397[_0xfa0b('0xb')](_0xfa0b('0xc'),attributes,{'tableName':_0xfa0b('0xd'),'paranoid':![],'indexes':[{'name':_0xfa0b('0xe'),'fields':[_0xfa0b('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index c5650c7..6437ce9 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 _0xd1fe=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x67d4c1,_0x346942){var _0x3ed198=function(_0x166049){while(--_0x166049){_0x67d4c1['push'](_0x67d4c1['shift']());}};_0x3ed198(++_0x346942);}(_0xd1fe,0xdd));var _0xed1f=function(_0x582d5f,_0x2355f1){_0x582d5f=_0x582d5f-0x0;var _0x5ed1b4=_0xd1fe[_0x582d5f];return _0x5ed1b4;};'use strict';var _=require(_0xed1f('0x0'));var util=require(_0xed1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xed1f('0x2'));var fs=require('fs');var Redis=require(_0xed1f('0x3'));var db=require(_0xed1f('0x4'))['db'];var utils=require(_0xed1f('0x5'));var logger=require('../../config/logger')(_0xed1f('0x6'));var config=require(_0xed1f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed1f('0x8')][_0xed1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x792a52,_0x5ef87f,_0x295be6){return new BPromise(function(_0x43c8ff,_0x55ea0b){return client['request'](_0x792a52,_0x295be6)[_0xed1f('0xa')](function(_0x2e100a){logger[_0xed1f('0xb')](_0xed1f('0xc'),_0x5ef87f,_0xed1f('0xd'));logger['debug'](_0xed1f('0xe'),_0x5ef87f,_0xed1f('0xd'),JSON['stringify'](_0x2e100a));if(_0x2e100a['error']){if(_0x2e100a[_0xed1f('0xf')]['code']===0x1f4){logger[_0xed1f('0xf')](_0xed1f('0xc'),_0x5ef87f,_0x2e100a[_0xed1f('0xf')]['message']);return _0x55ea0b(_0x2e100a['error'][_0xed1f('0x10')]);}logger[_0xed1f('0xf')](_0xed1f('0xc'),_0x5ef87f,_0x2e100a[_0xed1f('0xf')][_0xed1f('0x10')]);return _0x43c8ff(_0x2e100a[_0xed1f('0xf')][_0xed1f('0x10')]);}else{logger['info'](_0xed1f('0xc'),_0x5ef87f,_0xed1f('0xd'));_0x43c8ff(_0x2e100a['result'][_0xed1f('0x10')]);}})['catch'](function(_0x4d7b3e){logger[_0xed1f('0xf')](_0xed1f('0xc'),_0x5ef87f,_0x4d7b3e);_0x55ea0b(_0x4d7b3e);});});}
\ No newline at end of file
+var _0xbdcf=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x484487,_0x50a709){var _0x20cff2=function(_0x33d1a4){while(--_0x33d1a4){_0x484487['push'](_0x484487['shift']());}};_0x20cff2(++_0x50a709);}(_0xbdcf,0x130));var _0xfbdc=function(_0x37cc0a,_0x2b3a59){_0x37cc0a=_0x37cc0a-0x0;var _0x37a7fe=_0xbdcf[_0x37cc0a];return _0x37a7fe;};'use strict';var _=require(_0xfbdc('0x0'));var util=require('util');var moment=require(_0xfbdc('0x1'));var BPromise=require(_0xfbdc('0x2'));var rs=require(_0xfbdc('0x3'));var fs=require('fs');var Redis=require(_0xfbdc('0x4'));var db=require(_0xfbdc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfbdc('0x6'));var config=require(_0xfbdc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfbdc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c7cb9,_0x129b60,_0x3510aa){return new BPromise(function(_0xee2c43,_0xf2b5d){return client[_0xfbdc('0x9')](_0x2c7cb9,_0x3510aa)['then'](function(_0x970aa1){logger[_0xfbdc('0xa')](_0xfbdc('0xb'),_0x129b60,_0xfbdc('0xc'));logger[_0xfbdc('0xd')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x129b60,_0xfbdc('0xc'),JSON[_0xfbdc('0xe')](_0x970aa1));if(_0x970aa1[_0xfbdc('0xf')]){if(_0x970aa1[_0xfbdc('0xf')][_0xfbdc('0x10')]===0x1f4){logger[_0xfbdc('0xf')](_0xfbdc('0xb'),_0x129b60,_0x970aa1[_0xfbdc('0xf')][_0xfbdc('0x11')]);return _0xf2b5d(_0x970aa1[_0xfbdc('0xf')][_0xfbdc('0x11')]);}logger['error'](_0xfbdc('0xb'),_0x129b60,_0x970aa1[_0xfbdc('0xf')]['message']);return _0xee2c43(_0x970aa1[_0xfbdc('0xf')][_0xfbdc('0x11')]);}else{logger['info'](_0xfbdc('0xb'),_0x129b60,_0xfbdc('0xc'));_0xee2c43(_0x970aa1['result'][_0xfbdc('0x11')]);}})[_0xfbdc('0x12')](function(_0x3ab590){logger[_0xfbdc('0xf')](_0xfbdc('0xb'),_0x129b60,_0x3ab590);_0xf2b5d(_0x3ab590);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 1a559d5..d0b16c2 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 _0xf206=['create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf206,0x89));var _0x6f20=function(_0x51a130,_0x1be49f){_0x51a130=_0x51a130-0x0;var _0x3b3215=_0xf206[_0x51a130];return _0x3b3215;};'use strict';var multer=require(_0x6f20('0x0'));var util=require('util');var path=require(_0x6f20('0x1'));var timeout=require(_0x6f20('0x2'));var express=require(_0x6f20('0x3'));var router=express[_0x6f20('0x4')]();var fs_extra=require(_0x6f20('0x5'));var auth=require(_0x6f20('0x6'));var interaction=require(_0x6f20('0x7'));var config=require('../../config/environment');var controller=require(_0x6f20('0x8'));router['get']('/',auth[_0x6f20('0x9')](),controller[_0x6f20('0xa')]);router[_0x6f20('0xb')](_0x6f20('0xc'),auth['isAuthenticated'](),controller[_0x6f20('0xd')]);router[_0x6f20('0xb')](_0x6f20('0xe'),auth['isAuthenticated'](),controller[_0x6f20('0xf')]);router[_0x6f20('0x10')]('/',auth[_0x6f20('0x9')](),controller[_0x6f20('0x11')]);router[_0x6f20('0x12')](_0x6f20('0xe'),auth[_0x6f20('0x9')](),controller[_0x6f20('0x13')]);router[_0x6f20('0x14')]('/:id',auth[_0x6f20('0x9')](),controller['destroy']);module[_0x6f20('0x15')]=router;
\ No newline at end of file
+var _0x9b3e=['describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x448422,_0x362248){var _0xcc0afd=function(_0x576b07){while(--_0x576b07){_0x448422['push'](_0x448422['shift']());}};_0xcc0afd(++_0x362248);}(_0x9b3e,0xef));var _0xe9b3=function(_0x1d5013,_0x26c621){_0x1d5013=_0x1d5013-0x0;var _0x2b25e7=_0x9b3e[_0x1d5013];return _0x2b25e7;};'use strict';var multer=require(_0xe9b3('0x0'));var util=require(_0xe9b3('0x1'));var path=require(_0xe9b3('0x2'));var timeout=require(_0xe9b3('0x3'));var express=require(_0xe9b3('0x4'));var router=express[_0xe9b3('0x5')]();var fs_extra=require(_0xe9b3('0x6'));var auth=require(_0xe9b3('0x7'));var interaction=require(_0xe9b3('0x8'));var config=require(_0xe9b3('0x9'));var controller=require('./chatTransferReport.controller');router[_0xe9b3('0xa')]('/',auth[_0xe9b3('0xb')](),controller[_0xe9b3('0xc')]);router[_0xe9b3('0xa')](_0xe9b3('0xd'),auth[_0xe9b3('0xb')](),controller[_0xe9b3('0xe')]);router[_0xe9b3('0xa')](_0xe9b3('0xf'),auth['isAuthenticated'](),controller[_0xe9b3('0x10')]);router[_0xe9b3('0x11')]('/',auth[_0xe9b3('0xb')](),controller[_0xe9b3('0x12')]);router[_0xe9b3('0x13')](_0xe9b3('0xf'),auth[_0xe9b3('0xb')](),controller[_0xe9b3('0x14')]);router[_0xe9b3('0x15')](_0xe9b3('0xf'),auth['isAuthenticated'](),controller[_0xe9b3('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 678c402..1d32879 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 _0x860f=['input','name','text','parse','getDataValue','onlineForm','setDataValue','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','thumb','star','stringify'];(function(_0x4e0a43,_0xd9ba5b){var _0x3f9fd4=function(_0x36d35c){while(--_0x36d35c){_0x4e0a43['push'](_0x4e0a43['shift']());}};_0x3f9fd4(++_0xd9ba5b);}(_0x860f,0x1c7));var _0xf860=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x860f[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0xf860('0x0'));var rs=require('randomstring');module[_0xf860('0x1')]={'name':{'type':Sequelize[_0xf860('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf860('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0x5')},'customerAlias':{'type':Sequelize[_0xf860('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf860('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf860('0x2')],'allowNull':![],'defaultValue':_0xf860('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf860('0x2')],'allowNull':![],'defaultValue':_0xf860('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf860('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xf860('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xf860('0xa')](_0xf860('0xb'),'squared'),'defaultValue':_0xf860('0xb')},'header_online':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0xc')},'start_chat_button':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0xd')},'offline_chat_button':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0xe')},'header_offline':{'type':Sequelize[_0xf860('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xf860('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf860('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xf860('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf860('0x10')]},'closingQuestion':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf860('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x13')},'closingMessage':{'type':Sequelize[_0xf860('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0xe')},'skipMessageButton':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x14')},'conditionAgreement':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x15')},'ratingType':{'type':Sequelize[_0xf860('0xa')]('star',_0xf860('0x16')),'defaultValue':_0xf860('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xf860('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xf860('0x18')]({'items':[{'type':_0xf860('0x19'),'variable':null,'config':{'placeholder':_0xf860('0x1a'),'type':_0xf860('0x1b'),'required':!![]},'props':{'title':_0xf860('0x1a'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf860('0x4'),'type':_0xf860('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xf860('0x1c')](this[_0xf860('0x1d')](_0xf860('0x1e'))):{};},'set':function(_0x1c679f){return this[_0xf860('0x1f')](_0xf860('0x1e'),JSON[_0xf860('0x18')](_0x1c679f));}},'offlineForm':{'type':Sequelize[_0xf860('0x10')],'defaultValue':function(){return JSON[_0xf860('0x18')]({'items':[{'type':_0xf860('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf860('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0xf860('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xf860('0x1d')](_0xf860('0x21'))?JSON[_0xf860('0x1c')](this[_0xf860('0x1d')](_0xf860('0x21'))):{};},'set':function(_0x2ea267){return this['setDataValue']('offlineForm',JSON['stringify'](_0x2ea267));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf860('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xf860('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0x23')},'waitingMessage':{'type':Sequelize[_0xf860('0x2')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf860('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xf860('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0x25')},'skipUnmanaged':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf860('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf860('0x2')]},'notificationTemplate':{'type':Sequelize[_0xf860('0x10')],'defaultValue':function(){return _0xf860('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf860('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xf860('0x28')},'verticalAlignment':{'type':Sequelize[_0xf860('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x29')},'defaultTitle':{'type':Sequelize[_0xf860('0x2')]},'customerAvatar':{'type':Sequelize[_0xf860('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xf860('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf860('0x2')],'allowNull':![],'defaultValue':_0xf860('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf860('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf860('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf860('0x2')],'defaultValue':_0xf860('0x2b')},'systemAvatar':{'type':Sequelize[_0xf860('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf860('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![],'comment':_0xf860('0x2c'),'set':function(_0x4a5269){if(!_0x4a5269)this[_0xf860('0x1f')](_0xf860('0x2d'),null);this[_0xf860('0x1f')](_0xf860('0x2e'),_0x4a5269);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xf860('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf860('0x2')],'defaultValue':function(){return _0xf860('0x2f');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf860('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf860('0x10')]}};
\ No newline at end of file
+var _0x7d6b=['address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','name','text','onlineForm','parse','setDataValue','TEXT','input','Comments','getDataValue','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:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','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}}','exports','STRING'];(function(_0x374735,_0x467847){var _0x26ff88=function(_0x5c877e){while(--_0x5c877e){_0x374735['push'](_0x374735['shift']());}};_0x26ff88(++_0x467847);}(_0x7d6b,0x8e));var _0xb7d6=function(_0xd88aaf,_0x23479a){_0xd88aaf=_0xd88aaf-0x0;var _0x39308e=_0x7d6b[_0xd88aaf];return _0x39308e;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb7d6('0x0')]={'name':{'type':Sequelize[_0xb7d6('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb7d6('0x2')},'description':{'type':Sequelize[_0xb7d6('0x1')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xb7d6('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb7d6('0x3')},'key':{'type':Sequelize[_0xb7d6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x4')},'customerAlias':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb7d6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb7d6('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb7d6('0x1')],'allowNull':![],'defaultValue':_0xb7d6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb7d6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xb7d6('0x9')](_0xb7d6('0xa'),_0xb7d6('0xb')),'defaultValue':_0xb7d6('0xa')},'header_online':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0xc')},'header_offline':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0xd')},'download_transcript':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb7d6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x11')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x12')},'ratingType':{'type':Sequelize[_0xb7d6('0x9')](_0xb7d6('0x13'),_0xb7d6('0x14')),'defaultValue':_0xb7d6('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xb7d6('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xb7d6('0x15')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xb7d6('0x16'),'type':_0xb7d6('0x17'),'required':!![]},'props':{'title':_0xb7d6('0x16'),'helpText':''}},{'type':'input','props':{'title':_0xb7d6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb7d6('0x3'),'type':_0xb7d6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xb7d6('0x18'))?JSON[_0xb7d6('0x19')](this['getDataValue'](_0xb7d6('0x18'))):{};},'set':function(_0x1348cf){return this[_0xb7d6('0x1a')](_0xb7d6('0x18'),JSON[_0xb7d6('0x15')](_0x1348cf));}},'offlineForm':{'type':Sequelize[_0xb7d6('0x1b')],'defaultValue':function(){return JSON[_0xb7d6('0x15')]({'items':[{'type':_0xb7d6('0x1c'),'props':{'title':_0xb7d6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xb7d6('0x3'),'type':_0xb7d6('0x3')},'variable':null},{'type':'textarea','config':{'placeholder':_0xb7d6('0x1d')},'props':{'title':_0xb7d6('0x1d'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xb7d6('0x1e')](_0xb7d6('0x1f'))?JSON[_0xb7d6('0x19')](this[_0xb7d6('0x1e')](_0xb7d6('0x1f'))):{};},'set':function(_0x4f2d7c){return this[_0xb7d6('0x1a')](_0xb7d6('0x1f'),JSON[_0xb7d6('0x15')](_0x4f2d7c));}},'token':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb7d6('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb7d6('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xb7d6('0x20')},'waitingMessage':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x22')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xb7d6('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x24')},'sendUnmanaged':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb7d6('0x1b')]},'showAgentAvatar':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb7d6('0x1b')],'defaultValue':function(){return _0xb7d6('0x25');}},'notificationSound':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb7d6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x27')},'verticalAlignment':{'type':Sequelize[_0xb7d6('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':_0xb7d6('0x28')},'defaultTitle':{'type':Sequelize[_0xb7d6('0x1')]},'customerAvatar':{'type':Sequelize[_0xb7d6('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb7d6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb7d6('0x29'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb7d6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xb7d6('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb7d6('0x7')],'comment':_0xb7d6('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![],'comment':_0xb7d6('0x2b'),'set':function(_0x273cb4){if(!_0x273cb4)this['setDataValue'](_0xb7d6('0x2c'),null);this[_0xb7d6('0x1a')](_0xb7d6('0x2d'),_0x273cb4);}},'vidaooEscalation':{'type':Sequelize[_0xb7d6('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xb7d6('0x1')]},'vidaooTopic':{'type':Sequelize[_0xb7d6('0x1')],'allowNull':![],'defaultValue':_0xb7d6('0x2e')},'vidaooNote':{'type':Sequelize[_0xb7d6('0x1')],'defaultValue':function(){return _0xb7d6('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0xb7d6('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb7d6('0x1b')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 5f3c58b..b8f01cb 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 _0xfa1b=['hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','ChatWebsite','includeAll','include','findAll','rows','show','keys','fields','length','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','params','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','asc','defaults','ListId','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','render','offlineMessageBody','ChatOfflineMessage','mimetype','server','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','originalname','subjectOffline','toPairsIn','Chat','MailAccountId','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','virtual','custom','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','verticalAlignment','color_button','backgroundColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes'];(function(_0xc0b67e,_0x4a5ae3){var _0x46b91f=function(_0xd8a097){while(--_0xd8a097){_0xc0b67e['push'](_0xc0b67e['shift']());}};_0x46b91f(++_0x4a5ae3);}(_0xfa1b,0xe9));var _0xbfa1=function(_0x1f63ed,_0x219297){_0x1f63ed=_0x1f63ed-0x0;var _0x174cfa=_0xfa1b[_0x1f63ed];return _0x174cfa;};'use strict';var emlformat=require(_0xbfa1('0x0'));var rimraf=require(_0xbfa1('0x1'));var zipdir=require(_0xbfa1('0x2'));var jsonpatch=require(_0xbfa1('0x3'));var rp=require(_0xbfa1('0x4'));var moment=require(_0xbfa1('0x5'));var BPromise=require(_0xbfa1('0x6'));var Mustache=require(_0xbfa1('0x7'));var util=require(_0xbfa1('0x8'));var path=require(_0xbfa1('0x9'));var sox=require(_0xbfa1('0xa'));var csv=require('to-csv');var ejs=require(_0xbfa1('0xb'));var fs=require('fs');var fs_extra=require(_0xbfa1('0xc'));var _=require(_0xbfa1('0xd'));var squel=require(_0xbfa1('0xe'));var crypto=require(_0xbfa1('0xf'));var jsforce=require(_0xbfa1('0x10'));var deskjs=require(_0xbfa1('0x11'));var toCsv=require(_0xbfa1('0x12'));var querystring=require(_0xbfa1('0x13'));var Papa=require(_0xbfa1('0x14'));var Redis=require(_0xbfa1('0x15'));var authService=require(_0xbfa1('0x16'));var qs=require('../../components/parsers/qs');var as=require(_0xbfa1('0x17'));var hardwareService=require(_0xbfa1('0x18'));var logger=require(_0xbfa1('0x19'))(_0xbfa1('0x1a'));var utils=require(_0xbfa1('0x1b'));var config=require(_0xbfa1('0x1c'));var licenseUtil=require(_0xbfa1('0x1d'));var db=require(_0xbfa1('0x1e'))['db'];config['redis']=_['defaults'](config[_0xbfa1('0x1f')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfa1('0x1f')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0xbfa1('0x20'));var client=jayson[_0xbfa1('0x21')][_0xbfa1('0x22')]({'port':0x232c});var client9002=jayson[_0xbfa1('0x21')][_0xbfa1('0x22')]({'port':0x232a});var client9003=jayson[_0xbfa1('0x21')][_0xbfa1('0x22')]({'port':0x232b});var client9001=jayson[_0xbfa1('0x21')][_0xbfa1('0x22')]({'port':0x2329});function respondWithRpcPromise(_0x25b7b9,_0x59cd14,_0x31ea04,_0x1eff03){return new BPromise(function(_0x306e42,_0x2c3ca5){var _0x1976d7=_0x1eff03||client;return _0x1976d7['request'](_0x25b7b9,_0x31ea04)[_0xbfa1('0x23')](function(_0x58a6f9){logger[_0xbfa1('0x24')](_0xbfa1('0x25'),_0x59cd14,_0xbfa1('0x26'));logger['debug'](_0xbfa1('0x27'),_0x59cd14,'request\x20sent',JSON[_0xbfa1('0x28')](_0x58a6f9));if(_0x58a6f9[_0xbfa1('0x29')]){if(_0x58a6f9[_0xbfa1('0x29')][_0xbfa1('0x2a')]===0x1f4){logger['error'](_0xbfa1('0x25'),_0x59cd14,_0x58a6f9['error'][_0xbfa1('0x2b')]);return _0x2c3ca5(_0x58a6f9[_0xbfa1('0x29')][_0xbfa1('0x2b')]);}logger[_0xbfa1('0x29')](_0xbfa1('0x25'),_0x59cd14,_0x58a6f9[_0xbfa1('0x29')][_0xbfa1('0x2b')]);return _0x306e42(_0x58a6f9['error'][_0xbfa1('0x2b')]);}else{logger[_0xbfa1('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x59cd14,_0xbfa1('0x26'));_0x306e42(_0x58a6f9[_0xbfa1('0x2c')][_0xbfa1('0x2b')]);}})[_0xbfa1('0x2d')](function(_0x1496a6){logger['error'](_0xbfa1('0x25'),_0x59cd14,_0x1496a6);_0x2c3ca5(_0x1496a6);});});}function respondWithStatusCode(_0x1faa17,_0x346375){_0x346375=_0x346375||0xcc;return function(_0x13d9bb){if(_0x13d9bb){return _0x1faa17['sendStatus'](_0x346375);}return _0x1faa17['status'](_0x346375)['end']();};}function respondWithResult(_0x2c8385,_0x30642d){_0x30642d=_0x30642d||0xc8;return function(_0x5603df){if(_0x5603df){return _0x2c8385['status'](_0x30642d)[_0xbfa1('0x2e')](_0x5603df);}};}function respondWithFilteredResult(_0x4a7dce,_0x88d01e){return function(_0x28eb91){if(_0x28eb91){var _0x95ffc8=typeof _0x88d01e[_0xbfa1('0x2f')]==='undefined'&&typeof _0x88d01e[_0xbfa1('0x30')]===_0xbfa1('0x31');var _0x1a4740=_0x28eb91[_0xbfa1('0x32')];var _0x38d752=_0x95ffc8?0x0:_0x88d01e[_0xbfa1('0x2f')];var _0x6b2574=_0x95ffc8?_0x28eb91[_0xbfa1('0x32')]:_0x88d01e[_0xbfa1('0x2f')]+_0x88d01e[_0xbfa1('0x30')];var _0x5ac586;if(_0x6b2574>=_0x1a4740){_0x6b2574=_0x1a4740;_0x5ac586=0xc8;}else{_0x5ac586=0xce;}_0x4a7dce[_0xbfa1('0x33')](_0x5ac586);return _0x4a7dce['set'](_0xbfa1('0x34'),_0x38d752+'-'+_0x6b2574+'/'+_0x1a4740)[_0xbfa1('0x2e')](_0x28eb91);}return null;};}function patchUpdates(_0x2a94e4){return function(_0x34254f){try{jsonpatch[_0xbfa1('0x35')](_0x34254f,_0x2a94e4,!![]);}catch(_0x36751e){return BPromise[_0xbfa1('0x36')](_0x36751e);}return _0x34254f[_0xbfa1('0x37')]();};}function saveUpdates(_0x1ae2a3,_0x4338e9){return function(_0x671bac){if(_0x671bac){return _0x671bac['update'](_0x1ae2a3)['then'](function(_0x239475){return _0x239475;});}return null;};}function removeEntity(_0xad7c88,_0x5af01d){return function(_0x5276fb){if(_0x5276fb){return _0x5276fb[_0xbfa1('0x38')]()[_0xbfa1('0x23')](function(){var _0x1c4a22=_0x5276fb[_0xbfa1('0x39')]({'plain':!![]});var _0x46118a=_0xbfa1('0x3a');return db[_0xbfa1('0x3b')]['destroy']({'where':{'type':_0x46118a,'resourceId':_0x1c4a22['id']}})['then'](function(){return _0x5276fb;});})[_0xbfa1('0x23')](function(){_0xad7c88[_0xbfa1('0x33')](0xcc)[_0xbfa1('0x3c')]();});}};}function handleEntityNotFound(_0x33936a,_0x56ad1b){return function(_0x8a6a65){if(!_0x8a6a65){_0x33936a[_0xbfa1('0x3d')](0x194);}return _0x8a6a65;};}function handleError(_0x21dce1,_0x479d87){_0x479d87=_0x479d87||0x1f4;return function(_0x333233){logger['error'](_0x333233[_0xbfa1('0x3e')]);if(_0x333233['name']){delete _0x333233[_0xbfa1('0x3f')];}_0x21dce1['status'](_0x479d87)[_0xbfa1('0x40')](_0x333233);};}exports['index']=function(_0x3ac573,_0x49d687){var _0x3347ba={'include':[{'model':db[_0xbfa1('0x41')],'as':_0xbfa1('0x42')}]},_0x212ec1={},_0x3b694c={'count':0x0,'rows':[]};var _0x33bbb7=_['map'](db['ChatWebsite'][_0xbfa1('0x43')],function(_0x50a079){return{'name':_0x50a079[_0xbfa1('0x44')],'type':_0x50a079['type'][_0xbfa1('0x45')]};});_0x212ec1[_0xbfa1('0x46')]=_[_0xbfa1('0x47')](_0x33bbb7,_0xbfa1('0x3f'));_0x212ec1[_0xbfa1('0x48')]=_['keys'](_0x3ac573[_0xbfa1('0x48')]);_0x212ec1[_0xbfa1('0x49')]=_[_0xbfa1('0x4a')](_0x212ec1[_0xbfa1('0x46')],_0x212ec1[_0xbfa1('0x48')]);_0x3347ba[_0xbfa1('0x4b')]=_['intersection'](_0x212ec1[_0xbfa1('0x46')],qs['fields'](_0x3ac573[_0xbfa1('0x48')]['fields']));_0x3347ba[_0xbfa1('0x4b')]=_0x3347ba[_0xbfa1('0x4b')]['length']?_0x3347ba['attributes']:_0x212ec1[_0xbfa1('0x46')];if(!_0x3ac573[_0xbfa1('0x48')][_0xbfa1('0x4c')]('nolimit')){_0x3347ba[_0xbfa1('0x30')]=qs[_0xbfa1('0x30')](_0x3ac573['query']['limit']);_0x3347ba[_0xbfa1('0x2f')]=qs[_0xbfa1('0x2f')](_0x3ac573[_0xbfa1('0x48')][_0xbfa1('0x2f')]);}_0x3347ba[_0xbfa1('0x4d')]=qs[_0xbfa1('0x4e')](_0x3ac573[_0xbfa1('0x48')][_0xbfa1('0x4e')]);_0x3347ba[_0xbfa1('0x4f')]=qs[_0xbfa1('0x49')](_[_0xbfa1('0x50')](_0x3ac573[_0xbfa1('0x48')],_0x212ec1[_0xbfa1('0x49')]),_0x33bbb7);if(_0x3ac573['query'][_0xbfa1('0x51')]){_0x3347ba[_0xbfa1('0x4f')]=_['merge'](_0x3347ba[_0xbfa1('0x4f')],{'$or':_[_0xbfa1('0x47')](_0x33bbb7,function(_0xf2c726){if(_0xf2c726[_0xbfa1('0x52')]!==_0xbfa1('0x53')){var _0x1eaec3={};_0x1eaec3[_0xf2c726[_0xbfa1('0x3f')]]={'$like':'%'+_0x3ac573[_0xbfa1('0x48')][_0xbfa1('0x51')]+'%'};return _0x1eaec3;}})});}_0x3347ba=_[_0xbfa1('0x54')]({},_0x3347ba,_0x3ac573['options']);var _0xcc5ed6={'where':_0x3347ba[_0xbfa1('0x4f')]};return db[_0xbfa1('0x55')]['count'](_0xcc5ed6)[_0xbfa1('0x23')](function(_0x58e78e){_0x3b694c[_0xbfa1('0x32')]=_0x58e78e;if(_0x3ac573[_0xbfa1('0x48')][_0xbfa1('0x56')]){_0x3347ba[_0xbfa1('0x57')]=[{'all':!![]}];}return db[_0xbfa1('0x55')][_0xbfa1('0x58')](_0x3347ba);})[_0xbfa1('0x23')](function(_0xa8b585){_0x3b694c[_0xbfa1('0x59')]=_0xa8b585;return _0x3b694c;})['then'](respondWithFilteredResult(_0x49d687,_0x3347ba))[_0xbfa1('0x2d')](handleError(_0x49d687,null));};exports[_0xbfa1('0x5a')]=function(_0x5f30d9,_0x2c279b){var _0x9a5015={'raw':![],'where':{'id':_0x5f30d9['params']['id']},'include':[{'model':db[_0xbfa1('0x41')],'as':'mandatoryDispositionPause'}]},_0x6f6006={};_0x6f6006['model']=_[_0xbfa1('0x5b')](db[_0xbfa1('0x55')][_0xbfa1('0x43')]);_0x6f6006['query']=_[_0xbfa1('0x5b')](_0x5f30d9[_0xbfa1('0x48')]);_0x6f6006['filters']=_[_0xbfa1('0x4a')](_0x6f6006[_0xbfa1('0x46')],_0x6f6006[_0xbfa1('0x48')]);_0x9a5015[_0xbfa1('0x4b')]=_[_0xbfa1('0x4a')](_0x6f6006['model'],qs['fields'](_0x5f30d9[_0xbfa1('0x48')][_0xbfa1('0x5c')]));_0x9a5015[_0xbfa1('0x4b')]=_0x9a5015[_0xbfa1('0x4b')][_0xbfa1('0x5d')]?_0x9a5015[_0xbfa1('0x4b')]:_0x6f6006[_0xbfa1('0x46')];if(_0x5f30d9[_0xbfa1('0x48')][_0xbfa1('0x56')]){_0x9a5015[_0xbfa1('0x57')]=[{'all':!![]}];}_0x9a5015=_[_0xbfa1('0x54')]({},_0x9a5015,_0x5f30d9[_0xbfa1('0x5e')]);return db[_0xbfa1('0x55')][_0xbfa1('0x5f')](_0x9a5015)['then'](handleEntityNotFound(_0x2c279b,null))[_0xbfa1('0x23')](respondWithResult(_0x2c279b,null))[_0xbfa1('0x2d')](handleError(_0x2c279b,null));};exports[_0xbfa1('0x60')]=function(_0x26febd,_0x12a732){return db[_0xbfa1('0x55')]['create'](_0x26febd[_0xbfa1('0x61')],{})[_0xbfa1('0x23')](function(_0x2e863b){var _0x50b4c7=_0x26febd['user'][_0xbfa1('0x39')]({'plain':!![]});if(!_0x50b4c7)throw new Error(_0xbfa1('0x62'));if(_0x50b4c7['role']===_0xbfa1('0x63')){var _0x1edf51=_0x2e863b['get']({'plain':!![]});var _0x2b8b0d=_0xbfa1('0x3a');return db[_0xbfa1('0x64')][_0xbfa1('0x5f')]({'where':{'name':_0x2b8b0d,'userProfileId':_0x50b4c7[_0xbfa1('0x65')]},'raw':!![]})['then'](function(_0x15ebcf){if(_0x15ebcf&&_0x15ebcf[_0xbfa1('0x66')]===0x0){return db['UserProfileResource'][_0xbfa1('0x60')]({'name':_0x1edf51[_0xbfa1('0x3f')],'resourceId':_0x1edf51['id'],'type':_0x15ebcf[_0xbfa1('0x3f')],'sectionId':_0x15ebcf['id']},{})[_0xbfa1('0x23')](function(){return _0x2e863b;});}else{return _0x2e863b;}})[_0xbfa1('0x2d')](function(_0x560bcc){logger[_0xbfa1('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560bcc);throw _0x560bcc;});}return _0x2e863b;})[_0xbfa1('0x23')](respondWithResult(_0x12a732,0xc9))['catch'](handleError(_0x12a732,null));};exports['update']=function(_0x32a681,_0xc892db){if(_0x32a681[_0xbfa1('0x61')]['id']){delete _0x32a681[_0xbfa1('0x61')]['id'];}return db[_0xbfa1('0x55')]['find']({'where':{'id':_0x32a681['params']['id']},'include':[{'model':db[_0xbfa1('0x41')],'as':'mandatoryDispositionPause'}]})[_0xbfa1('0x23')](handleEntityNotFound(_0xc892db,null))[_0xbfa1('0x23')](saveUpdates(_0x32a681['body'],null))[_0xbfa1('0x23')](respondWithResult(_0xc892db,null))[_0xbfa1('0x2d')](handleError(_0xc892db,null));};exports[_0xbfa1('0x38')]=function(_0x2e7f15,_0x1efe59){return db[_0xbfa1('0x55')]['find']({'where':{'id':_0x2e7f15['params']['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x1efe59,null))[_0xbfa1('0x23')](removeEntity(_0x1efe59,null))['catch'](handleError(_0x1efe59,null));};exports[_0xbfa1('0x67')]=function(_0x32a8f2,_0x38ee4c){return db[_0xbfa1('0x55')][_0xbfa1('0x67')]()[_0xbfa1('0x23')](respondWithResult(_0x38ee4c,null))[_0xbfa1('0x2d')](handleError(_0x38ee4c,null));};exports[_0xbfa1('0x68')]=function(_0x448a4c,_0x171d48,_0x582e5d){if(_0x448a4c[_0xbfa1('0x61')]['id']){delete _0x448a4c[_0xbfa1('0x61')]['id'];}return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x448a4c[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x171d48,null))[_0xbfa1('0x23')](function(_0x4d7cac){if(_0x4d7cac){_0x448a4c[_0xbfa1('0x61')][_0xbfa1('0x6a')]=_0x4d7cac['id'];return db[_0xbfa1('0x6b')]['create'](_0x448a4c['body']);}})[_0xbfa1('0x23')](respondWithResult(_0x171d48,null))[_0xbfa1('0x2d')](handleError(_0x171d48,null));};exports[_0xbfa1('0x6c')]=function(_0x59736f,_0x132b0e,_0x3c6830){var _0x5f5449={'raw':![],'where':{}};var _0x37330c={};var _0x3f001f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbfa1('0x6d')]({'where':{'id':_0x59736f['params']['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x132b0e,null))['then'](function(_0x55916d){if(_0x55916d){_0x37330c['model']=_[_0xbfa1('0x5b')](db[_0xbfa1('0x6b')]['rawAttributes']);_0x37330c[_0xbfa1('0x48')]=_[_0xbfa1('0x5b')](_0x59736f[_0xbfa1('0x48')]);_0x37330c['filters']=_[_0xbfa1('0x4a')](_0x37330c[_0xbfa1('0x46')],_0x37330c[_0xbfa1('0x48')]);_0x5f5449[_0xbfa1('0x4b')]=_[_0xbfa1('0x4a')](_0x37330c[_0xbfa1('0x46')],qs[_0xbfa1('0x5c')](_0x59736f['query']['fields']));_0x5f5449[_0xbfa1('0x4b')]=_0x5f5449[_0xbfa1('0x4b')]['length']?_0x5f5449['attributes']:_0x37330c[_0xbfa1('0x46')];if(!_0x59736f['query'][_0xbfa1('0x4c')](_0xbfa1('0x6e'))){_0x5f5449[_0xbfa1('0x30')]=qs[_0xbfa1('0x30')](_0x59736f[_0xbfa1('0x48')][_0xbfa1('0x30')]);_0x5f5449['offset']=qs[_0xbfa1('0x2f')](_0x59736f['query'][_0xbfa1('0x2f')]);}_0x5f5449[_0xbfa1('0x4d')]=qs['sort'](_0x59736f[_0xbfa1('0x48')][_0xbfa1('0x4e')]);_0x5f5449[_0xbfa1('0x4f')]=qs['filters'](_[_0xbfa1('0x50')](_0x59736f['query'],_0x37330c['filters']));_0x5f5449[_0xbfa1('0x4f')]['ChatWebsiteId']=_0x55916d['id'];if(_0x59736f['query'][_0xbfa1('0x51')]){_0x5f5449[_0xbfa1('0x4f')]=_[_0xbfa1('0x54')](_0x5f5449[_0xbfa1('0x4f')],{'$or':_[_0xbfa1('0x47')](_0x5f5449['attributes'],function(_0x1fac99){var _0x277f05={};_0x277f05[_0x1fac99]={'$like':'%'+_0x59736f['query']['filter']+'%'};return _0x277f05;})});}_0x5f5449=_['merge']({},_0x5f5449,_0x59736f[_0xbfa1('0x5e')]);return db['Disposition'][_0xbfa1('0x32')]({'where':_0x5f5449[_0xbfa1('0x4f')]})[_0xbfa1('0x23')](function(_0x372d9d){_0x3f001f[_0xbfa1('0x32')]=_0x372d9d;if(_0x59736f[_0xbfa1('0x48')]['includeAll']){_0x5f5449[_0xbfa1('0x57')]=[{'all':!![]}];}return db['Disposition'][_0xbfa1('0x58')](_0x5f5449);})[_0xbfa1('0x23')](function(_0x2fa547){_0x3f001f[_0xbfa1('0x59')]=_0x2fa547;return _0x3f001f;});}})['then'](respondWithFilteredResult(_0x132b0e,_0x5f5449))[_0xbfa1('0x2d')](handleError(_0x132b0e,null));};exports[_0xbfa1('0x6f')]=function(_0x10c288,_0x574461,_0x1b43fa){return db[_0xbfa1('0x55')]['find']({'where':{'id':_0x10c288[_0xbfa1('0x69')]['id']}})['then'](handleEntityNotFound(_0x574461,null))['then'](function(_0x4355c9){if(_0x4355c9){return _0x4355c9[_0xbfa1('0x6f')](_0x10c288['query'][_0xbfa1('0x70')]);}})[_0xbfa1('0x23')](respondWithStatusCode(_0x574461,null))['catch'](handleError(_0x574461,null));};exports[_0xbfa1('0x71')]=function(_0x26e7f7,_0x596c03,_0x2bf00e){if(_0x26e7f7[_0xbfa1('0x61')]['id']){delete _0x26e7f7[_0xbfa1('0x61')]['id'];}return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x26e7f7['params']['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x596c03,null))[_0xbfa1('0x23')](function(_0x3221ff){if(_0x3221ff){_0x26e7f7[_0xbfa1('0x61')]['ChatWebsiteId']=_0x3221ff['id'];return db[_0xbfa1('0x72')]['create'](_0x26e7f7[_0xbfa1('0x61')]);}})[_0xbfa1('0x23')](respondWithResult(_0x596c03,null))[_0xbfa1('0x2d')](handleError(_0x596c03,null));};exports[_0xbfa1('0x73')]=function(_0x9cbe85,_0x5616f2,_0x53e395){var _0x595d47={'raw':![],'where':{}};var _0x2da59f={};var _0x61cadc={'count':0x0,'rows':[]};return db[_0xbfa1('0x55')][_0xbfa1('0x6d')]({'where':{'id':_0x9cbe85[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x5616f2,null))[_0xbfa1('0x23')](function(_0x59ef6b){if(_0x59ef6b){_0x2da59f[_0xbfa1('0x46')]=_[_0xbfa1('0x5b')](db['CannedAnswer'][_0xbfa1('0x43')]);_0x2da59f[_0xbfa1('0x48')]=_[_0xbfa1('0x5b')](_0x9cbe85[_0xbfa1('0x48')]);_0x2da59f['filters']=_[_0xbfa1('0x4a')](_0x2da59f[_0xbfa1('0x46')],_0x2da59f[_0xbfa1('0x48')]);_0x595d47[_0xbfa1('0x4b')]=_['intersection'](_0x2da59f[_0xbfa1('0x46')],qs[_0xbfa1('0x5c')](_0x9cbe85['query'][_0xbfa1('0x5c')]));_0x595d47['attributes']=_0x595d47[_0xbfa1('0x4b')][_0xbfa1('0x5d')]?_0x595d47[_0xbfa1('0x4b')]:_0x2da59f[_0xbfa1('0x46')];if(!_0x9cbe85['query'][_0xbfa1('0x4c')]('nolimit')){_0x595d47[_0xbfa1('0x30')]=qs[_0xbfa1('0x30')](_0x9cbe85[_0xbfa1('0x48')][_0xbfa1('0x30')]);_0x595d47[_0xbfa1('0x2f')]=qs[_0xbfa1('0x2f')](_0x9cbe85['query'][_0xbfa1('0x2f')]);}_0x595d47[_0xbfa1('0x4d')]=qs[_0xbfa1('0x4e')](_0x9cbe85[_0xbfa1('0x48')][_0xbfa1('0x4e')]);_0x595d47[_0xbfa1('0x4f')]=qs[_0xbfa1('0x49')](_[_0xbfa1('0x50')](_0x9cbe85[_0xbfa1('0x48')],_0x2da59f['filters']));_0x595d47[_0xbfa1('0x4f')]['ChatWebsiteId']=_0x59ef6b['id'];if(_0x9cbe85[_0xbfa1('0x48')][_0xbfa1('0x51')]){_0x595d47['where']=_[_0xbfa1('0x54')](_0x595d47['where'],{'$or':_[_0xbfa1('0x47')](_0x595d47['attributes'],function(_0x753baa){var _0x1642c1={};_0x1642c1[_0x753baa]={'$like':'%'+_0x9cbe85['query'][_0xbfa1('0x51')]+'%'};return _0x1642c1;})});}_0x595d47=_['merge']({},_0x595d47,_0x9cbe85[_0xbfa1('0x5e')]);return db['CannedAnswer']['count']({'where':_0x595d47['where']})[_0xbfa1('0x23')](function(_0x28dc08){_0x61cadc['count']=_0x28dc08;if(_0x9cbe85['query']['includeAll']){_0x595d47[_0xbfa1('0x57')]=[{'all':!![]}];}return db[_0xbfa1('0x72')]['findAll'](_0x595d47);})[_0xbfa1('0x23')](function(_0x342b25){_0x61cadc[_0xbfa1('0x59')]=_0x342b25;return _0x61cadc;});}})[_0xbfa1('0x23')](respondWithFilteredResult(_0x5616f2,_0x595d47))[_0xbfa1('0x2d')](handleError(_0x5616f2,null));};exports[_0xbfa1('0x74')]=function(_0x14a7cb,_0x23489d,_0xe2bf72){return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x14a7cb[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x23489d,null))[_0xbfa1('0x23')](function(_0x2e5931){if(_0x2e5931){return _0x2e5931['removeAnswers'](_0x14a7cb[_0xbfa1('0x48')]['ids']);}})['then'](respondWithStatusCode(_0x23489d,null))['catch'](handleError(_0x23489d,null));};exports[_0xbfa1('0x75')]=function(_0x3059ba,_0x304aa2,_0x9fea5d){_0x3059ba[_0xbfa1('0x61')]['sitepic']=_0x3059ba[_0xbfa1('0x76')][_0xbfa1('0x77')];return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x3059ba['params']['id']}})['then'](handleEntityNotFound(_0x304aa2,null))['then'](saveUpdates(_0x3059ba[_0xbfa1('0x61')],null))[_0xbfa1('0x23')](respondWithResult(_0x304aa2,null))[_0xbfa1('0x2d')](handleError(_0x304aa2,null));};exports['addAvatar']=function(_0x11336a,_0x415fdb,_0x1b3f12){_0x11336a[_0xbfa1('0x61')][_0xbfa1('0x78')]=_0x11336a['file'][_0xbfa1('0x77')];return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x11336a[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x415fdb,null))[_0xbfa1('0x23')](saveUpdates(_0x11336a[_0xbfa1('0x61')],null))['then'](respondWithResult(_0x415fdb,null))['catch'](handleError(_0x415fdb,null));};exports[_0xbfa1('0x79')]=function(_0x163f7c,_0x3f83ec,_0x2cc377){_0x163f7c[_0xbfa1('0x61')][_0xbfa1('0x7a')]=_0x163f7c[_0xbfa1('0x76')][_0xbfa1('0x77')];return db['ChatWebsite'][_0xbfa1('0x5f')]({'where':{'id':_0x163f7c[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x3f83ec,null))[_0xbfa1('0x23')](saveUpdates(_0x163f7c[_0xbfa1('0x61')],null))['then'](respondWithResult(_0x3f83ec,null))['catch'](handleError(_0x3f83ec,null));};exports['addSystemAvatar']=function(_0x29b90e,_0x24d6f2,_0x4884a6){_0x29b90e[_0xbfa1('0x61')][_0xbfa1('0x7b')]=_0x29b90e['file']['filename'];return db[_0xbfa1('0x55')]['find']({'where':{'id':_0x29b90e[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x24d6f2,null))[_0xbfa1('0x23')](saveUpdates(_0x29b90e[_0xbfa1('0x61')],null))[_0xbfa1('0x23')](respondWithResult(_0x24d6f2,null))[_0xbfa1('0x2d')](handleError(_0x24d6f2,null));};exports[_0xbfa1('0x7c')]=function(_0x558870,_0x51dc96,_0x5c1fee){var _0x3c8427=path['join'](config[_0xbfa1('0x7d')],_0xbfa1('0x7e'));var _0x3ff138={'where':{'id':_0x558870[_0xbfa1('0x69')]['id']},'attributes':['id',_0xbfa1('0x7f')],'raw':!![]};var _0x4ffcba=![];return require('../../config/license/util')[_0xbfa1('0x80')]()['then'](function(_0x359134){if(_0x359134){_0x4ffcba=_0x359134['custom'];}})[_0xbfa1('0x23')](function(){return db['ChatWebsite'][_0xbfa1('0x5f')](_0x3ff138);})[_0xbfa1('0x23')](handleEntityNotFound(_0x51dc96,null))['then'](function(_0x47b43c){if(_0x47b43c){if(!_[_0xbfa1('0x81')](_0x47b43c['sitepic'])){if(fs[_0xbfa1('0x82')](path[_0xbfa1('0x83')](config[_0xbfa1('0x7d')],_0xbfa1('0x84'),_0x47b43c[_0xbfa1('0x7f')]))&&_0x4ffcba){_0x3c8427=path['join'](config['root'],'server/files/images/logos/',_0x47b43c[_0xbfa1('0x7f')]);}}return _0x51dc96[_0xbfa1('0x85')](_0x3c8427);}})[_0xbfa1('0x2d')](handleError(_0x51dc96,null));};exports['getAvatar']=function(_0x51c66f,_0x4720a8,_0x2637de){var _0x22380f=path[_0xbfa1('0x83')](config['root'],_0xbfa1('0x86'));var _0x37950f={'where':{'id':_0x51c66f[_0xbfa1('0x69')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xbfa1('0x55')][_0xbfa1('0x5f')](_0x37950f)[_0xbfa1('0x23')](handleEntityNotFound(_0x4720a8,null))['then'](function(_0x2f0bcc){if(_0x2f0bcc){if(!_['isNil'](_0x2f0bcc[_0xbfa1('0x78')])){if(fs[_0xbfa1('0x82')](path[_0xbfa1('0x83')](config[_0xbfa1('0x7d')],_0xbfa1('0x87'),_0x2f0bcc[_0xbfa1('0x78')]))){_0x22380f=path[_0xbfa1('0x83')](config[_0xbfa1('0x7d')],'server/files/images/avatars/',_0x2f0bcc['agentAvatar']);}}return _0x4720a8[_0xbfa1('0x85')](_0x22380f);}})['catch'](handleError(_0x4720a8,null));};exports[_0xbfa1('0x88')]=function(_0x12dbe4,_0x379d8b,_0x13dc71){var _0x419c20=path[_0xbfa1('0x83')](config[_0xbfa1('0x7d')],'server/files/images/avatars/customer_avatar.png');var _0x5ca8ee={'where':{'id':_0x12dbe4[_0xbfa1('0x69')]['id']},'attributes':['id','customerAvatar',_0xbfa1('0x89')],'raw':!![]};return db[_0xbfa1('0x55')][_0xbfa1('0x5f')](_0x5ca8ee)[_0xbfa1('0x23')](handleEntityNotFound(_0x379d8b,null))[_0xbfa1('0x23')](function(_0x17d268){if(_0x17d268){if(!_[_0xbfa1('0x81')](_0x17d268[_0xbfa1('0x7a')])){if(fs[_0xbfa1('0x82')](path[_0xbfa1('0x83')](config[_0xbfa1('0x7d')],'server/files/images/avatars/',_0x17d268[_0xbfa1('0x7a')]))&&_0x17d268[_0xbfa1('0x89')]){_0x419c20=path[_0xbfa1('0x83')](config['root'],_0xbfa1('0x87'),_0x17d268[_0xbfa1('0x7a')]);}}return _0x379d8b[_0xbfa1('0x85')](_0x419c20);}})[_0xbfa1('0x2d')](handleError(_0x379d8b,null));};exports[_0xbfa1('0x8a')]=function(_0x35494e,_0x465ae9,_0x41d81b){var _0x380690=path[_0xbfa1('0x83')](config['root'],_0xbfa1('0x8b'));var _0x77e4ae={'where':{'id':_0x35494e['params']['id']},'attributes':['id',_0xbfa1('0x7b')],'raw':!![]};return db[_0xbfa1('0x55')][_0xbfa1('0x5f')](_0x77e4ae)[_0xbfa1('0x23')](handleEntityNotFound(_0x465ae9,null))[_0xbfa1('0x23')](function(_0x15e425){if(_0x15e425){if(!_[_0xbfa1('0x81')](_0x15e425[_0xbfa1('0x7b')])){if(fs[_0xbfa1('0x82')](path['join'](config['root'],_0xbfa1('0x87'),_0x15e425[_0xbfa1('0x7b')]))){_0x380690=path[_0xbfa1('0x83')](config[_0xbfa1('0x7d')],_0xbfa1('0x87'),_0x15e425[_0xbfa1('0x7b')]);}}return _0x465ae9[_0xbfa1('0x85')](_0x380690);}})[_0xbfa1('0x2d')](handleError(_0x465ae9,null));};exports[_0xbfa1('0x8c')]=function(_0x2c921b,_0x514213,_0x4e6f85){var _0x325747=require(_0xbfa1('0x8d'));var _0x4b6c67=new _0x325747();var _0xa22eff=_0x4b6c67['setUA'](_0x2c921b['headers']['user-agent'])['getResult']();var _0x35f72f={'body':_0x2c921b[_0xbfa1('0x61')],'channel':'chat'};var _0x14bd26=[];var _0x3d0e30=[];var _0x5419c5={};var _0x6df36e=![];return db[_0xbfa1('0x8e')][_0xbfa1('0x67')]()[_0xbfa1('0x23')](function(_0x4733e6){if(!_0x4733e6){throw new db[(_0xbfa1('0x8f'))][(_0xbfa1('0x90'))](_0xbfa1('0x91'));}_0x14bd26=_[_0xbfa1('0x92')](_[_0xbfa1('0x5b')](_0x4733e6),[_0xbfa1('0x93'),_0xbfa1('0x94')]);_0x3d0e30=_[_0xbfa1('0x92')](_['keys'](_0x4733e6),['createdAt','updatedAt',_0xbfa1('0x95'),'ListId']);if(_0x2c921b[_0xbfa1('0x61')]['id']){delete _0x2c921b[_0xbfa1('0x61')]['id'];}if(_[_0xbfa1('0x81')](_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x96')])){throw new db['Sequelize'][(_0xbfa1('0x90'))](_0xbfa1('0x97'));}if(_[_0xbfa1('0x81')](_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x61')])||_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x61')]===''){throw new db['Sequelize'][(_0xbfa1('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x98')])){throw new db[(_0xbfa1('0x8f'))][(_0xbfa1('0x90'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d0e30);}if(!_[_0xbfa1('0x99')](_0x3d0e30,_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x98')])){throw new db[(_0xbfa1('0x8f'))][(_0xbfa1('0x90'))](_0xbfa1('0x9a')+_0x3d0e30);}_0x5419c5[_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x98')]]=_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x96')];})[_0xbfa1('0x23')](function(){return db[_0xbfa1('0x55')]['find']({'where':{'id':_0x2c921b[_0xbfa1('0x69')]['id']},'include':[{'model':db[_0xbfa1('0x9b')],'as':_0xbfa1('0x9c'),'include':[{'model':db[_0xbfa1('0x8e')],'as':_0xbfa1('0x9d'),'where':_0x5419c5,'limit':0x1,'order':[[_0xbfa1('0x94'),_0xbfa1('0x9e')]]}]},{'model':db[_0xbfa1('0x9f')],'as':_0xbfa1('0xa0')}]});})[_0xbfa1('0x23')](handleEntityNotFound(_0x514213,null))[_0xbfa1('0x23')](function(_0x30a077){if(_0x30a077&&_0x30a077['List']){_0x35f72f[_0xbfa1('0xa1')]=_0x30a077;_0x35f72f[_0xbfa1('0xa2')]=_0x30a077['Applications'];_0x35f72f['list']=_0x30a077[_0xbfa1('0x9c')];_0x35f72f['applications']=_[_0xbfa1('0xa3')](_0x35f72f['applications'],['priority'],[_0xbfa1('0xa4')]);if(_0x35f72f['account'][_0xbfa1('0xa0')]){delete _0x35f72f[_0xbfa1('0xa1')][_0xbfa1('0xa0')];}if(_0x35f72f[_0xbfa1('0xa1')]['List']&&_0x35f72f[_0xbfa1('0xa1')]['List'][_0xbfa1('0x9d')][_0xbfa1('0x5d')]){return _0x35f72f[_0xbfa1('0xa1')][_0xbfa1('0x9c')][_0xbfa1('0x9d')][0x0];}var _0x892f53=_[_0xbfa1('0xa5')](_0x2c921b['body'],{'firstName':_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x96')],'ListId':_0x30a077[_0xbfa1('0xa6')]});_0x892f53[_0x2c921b[_0xbfa1('0x61')]['mapKey']]=_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x96')];return db[_0xbfa1('0x8e')][_0xbfa1('0x60')](_0x892f53,{'fields':_0x14bd26,'raw':!![]});}})[_0xbfa1('0x23')](handleEntityNotFound(_0x514213,null))[_0xbfa1('0x23')](function(_0x1d3008){_0x35f72f[_0xbfa1('0xa7')]=_0x1d3008;var _0x1e2db9=_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xa8')];if(_0x2c921b[_0xbfa1('0xa9')][_0xbfa1('0xaa')]){_0x1e2db9=_0x2c921b[_0xbfa1('0xa9')][_0xbfa1('0xaa')];}else if(_0x2c921b[_0xbfa1('0xa9')][_0xbfa1('0xab')]){_0x1e2db9=_[_0xbfa1('0xac')](_0x2c921b['headers'][_0xbfa1('0xab')][_0xbfa1('0xad')](','));}if(_0x1d3008){var _0x952643={'ContactId':_0x1d3008['id'],'ChatWebsiteId':_0x2c921b[_0xbfa1('0x69')]['id'],'from':(_0x1d3008[_0xbfa1('0xae')]||'')+'\x20'+(_0x1d3008[_0xbfa1('0xaf')]||''),'customerIp':_0x1e2db9,'customerPort':_0x2c921b[_0xbfa1('0xa9')][_0xbfa1('0xb0')]?_0x2c921b[_0xbfa1('0xa9')][_0xbfa1('0xb0')]:null,'referer':_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xb1')],'browserName':_0xa22eff[_0xbfa1('0xb2')][_0xbfa1('0x3f')]&&_0xa22eff[_0xbfa1('0xb2')][_0xbfa1('0xb3')]?util[_0xbfa1('0xb4')](_0xbfa1('0xb5'),_0xa22eff[_0xbfa1('0xb2')][_0xbfa1('0x3f')],_0xa22eff[_0xbfa1('0xb2')]['version']):_0xbfa1('0xb6'),'browserVersion':_0xa22eff[_0xbfa1('0xb2')][_0xbfa1('0xb3')]||_0xbfa1('0xb6'),'osName':util[_0xbfa1('0xb4')](_0xbfa1('0xb5'),_0xa22eff['os']['name'],_0xa22eff['os']['version']),'osVersion':_0xa22eff['os']['version'],'deviceModel':_0xa22eff[_0xbfa1('0xb7')][_0xbfa1('0x46')]&&_0xa22eff[_0xbfa1('0xb7')][_0xbfa1('0xb8')]?util['format'](_0xbfa1('0xb9'),_0xa22eff[_0xbfa1('0xb7')][_0xbfa1('0x46')],_0xa22eff[_0xbfa1('0xb7')][_0xbfa1('0xb8')],_0xa22eff[_0xbfa1('0xb7')][_0xbfa1('0x52')]):null,'deviceVendor':_0xa22eff['device'][_0xbfa1('0xb8')],'deviceType':_0xa22eff[_0xbfa1('0xb7')][_0xbfa1('0x52')],'formData':JSON['stringify'](_0x2c921b[_0xbfa1('0x61')])};var _0x3b70ad={'ChatWebsiteId':_0x2c921b[_0xbfa1('0x69')]['id'],'closed':![]};if(_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xba')]){_0x3b70ad[_0xbfa1('0xba')]=_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xba')];return db[_0xbfa1('0xbb')][_0xbfa1('0x5f')]({'where':_0x3b70ad})[_0xbfa1('0x23')](function(_0x4ab116){if(_0x4ab116){return[_0x4ab116,![]];}_0x952643[_0xbfa1('0xba')]=_0x2c921b['body'][_0xbfa1('0xba')];_0x952643[_0xbfa1('0xbc')]=_0x2c921b[_0xbfa1('0x61')]['externalUrl'];return db[_0xbfa1('0xbb')]['create'](_0x952643)[_0xbfa1('0x23')](function(_0x57c778){return[_0x57c778,!![]];});});}_0x3b70ad['ContactId']=_0x1d3008['id'];if(_0x2c921b['body'][_0xbfa1('0xbd')]&&_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xbd')]['id']){_0x3b70ad['id']=_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xbd')]['id'];return db[_0xbfa1('0xbb')][_0xbfa1('0x5f')]({'where':_0x3b70ad})[_0xbfa1('0x23')](function(_0x833de1){if(_0x833de1){return[_0x833de1,![]];}return db['ChatInteraction']['create'](_0x952643)[_0xbfa1('0x23')](function(_0x5a89e1){return[_0x5a89e1,!![]];});});}return db['ChatInteraction'][_0xbfa1('0x60')](_0x952643)[_0xbfa1('0x23')](function(_0x52f4f1){return[_0x52f4f1,!![]];});}})[_0xbfa1('0xbe')](function(_0x978898,_0x22b8dc){if(_0x978898){_0x6df36e=_0x22b8dc;if(!_0x22b8dc){var _0x3d68d0={'from':(_0x35f72f[_0xbfa1('0xa7')][_0xbfa1('0xae')]||'')+'\x20'+(_0x35f72f[_0xbfa1('0xa7')]['lastName']||'')};if(_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xba')]&&_0x2c921b[_0xbfa1('0x61')]['messageId']&&_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xba')]!=_0x2c921b[_0xbfa1('0x61')]['messageId']){_0x3d68d0[_0xbfa1('0xba')]=_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0xbf')];}return _0x978898['update'](_0x3d68d0);}else{return _0x978898;}}})['then'](function(_0xea342f){_0x35f72f[_0xbfa1('0xbd')]=_0xea342f['get']({'plain':!![]});_0x35f72f[_0xbfa1('0xbd')][_0xbfa1('0xc0')]=_0x6df36e;if(_0x35f72f[_0xbfa1('0xbd')][_0xbfa1('0xc0')]){if(_0x35f72f[_0xbfa1('0xa1')][_0xbfa1('0xc1')]){_0x35f72f[_0xbfa1('0xa2')][_0xbfa1('0xc2')]({'id':0x0,'priority':_0x35f72f[_0xbfa1('0xa2')]['length']+0x1,'app':_0xbfa1('0xc3'),'appdata':_0xbfa1('0xc4'),'interval':_0xbfa1('0xc5')});}}return db['ChatMessage'][_0xbfa1('0x60')]({'body':_0x2c921b[_0xbfa1('0x61')][_0xbfa1('0x61')],'ChatWebsiteId':_0x2c921b[_0xbfa1('0x69')]['id'],'ChatInteractionId':_0xea342f['id'],'direction':'in','ContactId':_0x35f72f[_0xbfa1('0xa7')]['id'],'AttachmentId':_0x2c921b[_0xbfa1('0x61')]['AttachmentId']});})['then'](function(_0x46bd19){_0x35f72f[_0xbfa1('0x2b')]=_0x46bd19;if(_0x35f72f[_0xbfa1('0xbd')][_0xbfa1('0xc6')]){return db[_0xbfa1('0xc7')][_0xbfa1('0x5f')]({'attributes':['id',_0xbfa1('0x3f')],'where':{'id':_0x35f72f[_0xbfa1('0xbd')][_0xbfa1('0xc6')]}})[_0xbfa1('0x23')](function(_0x3542b2){if(_0x3542b2){_0x35f72f[_0xbfa1('0xa2')][_0xbfa1('0xc8')]({'id':0x0,'priority':0x0,'app':_0xbfa1('0xc9'),'appdata':_0x3542b2['name']+','+(_0x35f72f['account'][_0xbfa1('0xca')]||0xa),'interval':_0xbfa1('0xc5')});_0x35f72f['forcedOwnership']=!![];}return respondWithRpcPromise(_0xbfa1('0xcb'),_0xbfa1('0xcc'),_0x35f72f);});}return respondWithRpcPromise('Start','startRouting',_0x35f72f);})['then'](function(_0x56053e){respondWithRpcPromise('EventManager',_0xbfa1('0xcd'),{'event':_0xbfa1('0x8c'),'message':_0x56053e},client9002);return _0x56053e;})['then'](respondWithResult(_0x514213,null))['catch'](handleError(_0x514213,null));};exports['offline']=function(_0x13c82a,_0x42bc1c,_0x30011b){var _0x18a9e3,_0x405105,_0x33d7f4;var _0x1196bc=[];var _0x1089f2=[];var _0x2380f4={};var _0x5e3495=_0x13c82a[_0xbfa1('0xce')]||[];var _0x5aa6a8=[];var _0xe8c3b2;return db['CmContact'][_0xbfa1('0x67')]()[_0xbfa1('0x23')](function(_0x813fab){if(!_0x813fab){throw new db[(_0xbfa1('0x8f'))][(_0xbfa1('0x90'))](_0xbfa1('0x91'));}_0x1089f2=_[_0xbfa1('0x92')](_[_0xbfa1('0x5b')](_0x813fab),[_0xbfa1('0x93'),_0xbfa1('0x94')]);_0x1196bc=_[_0xbfa1('0x92')](_[_0xbfa1('0x5b')](_0x813fab),[_0xbfa1('0x93'),'updatedAt',_0xbfa1('0x95'),_0xbfa1('0xa6')]);if(_0x13c82a['body']['id']){delete _0x13c82a[_0xbfa1('0x61')]['id'];}if(_['isNil'](_0x13c82a[_0xbfa1('0x61')]['from'])){throw _0x42bc1c[_0xbfa1('0x33')](0x1f4)[_0xbfa1('0x40')](new db['Sequelize'][(_0xbfa1('0x90'))](_0xbfa1('0x97')));}if(_['isNil'](_0x13c82a[_0xbfa1('0x61')][_0xbfa1('0x61')])||_0x13c82a[_0xbfa1('0x61')][_0xbfa1('0x61')]===''){throw _0x42bc1c[_0xbfa1('0x33')](0x1f4)['send'](new db[(_0xbfa1('0x8f'))]['ValidationError'](_0xbfa1('0xcf')));}if(_[_0xbfa1('0x81')](_0x13c82a[_0xbfa1('0x61')]['mapKeyOffline'])){throw _0x42bc1c[_0xbfa1('0x33')](0x1f4)[_0xbfa1('0x40')](new db[(_0xbfa1('0x8f'))][(_0xbfa1('0x90'))](_0xbfa1('0xd0')+_0x1196bc));}if(!_[_0xbfa1('0x99')](_0x1196bc,_0x13c82a[_0xbfa1('0x61')][_0xbfa1('0xd1')])){throw _0x42bc1c['status'](0x1f4)[_0xbfa1('0x40')](new db[(_0xbfa1('0x8f'))][(_0xbfa1('0x90'))](_0xbfa1('0xd2')+_0x1196bc));}_0x2380f4[_0x13c82a[_0xbfa1('0x61')]['mapKeyOffline']]=_0x13c82a[_0xbfa1('0x61')]['from'];})[_0xbfa1('0x23')](function(){return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x13c82a['params']['id']},'include':[{'model':db[_0xbfa1('0x9b')],'as':'List'},{'model':db['MailAccount'],'as':_0xbfa1('0xd3')}]});})['then'](handleEntityNotFound(_0x42bc1c,null))[_0xbfa1('0x23')](function(_0x4d0064){if(_0x4d0064&&_0x4d0064[_0xbfa1('0x9c')]){_0x405105=_0x4d0064;var _0x454680=_['defaults'](_0x13c82a['body'],{'firstName':_0x13c82a[_0xbfa1('0x61')][_0xbfa1('0x96')],'phone':_0x13c82a[_0xbfa1('0x61')]['from'],'ListId':_0x4d0064['ListId']});_0x454680[_0x13c82a[_0xbfa1('0x61')][_0xbfa1('0xd1')]]=_0x13c82a[_0xbfa1('0x61')][_0xbfa1('0x96')];return db[_0xbfa1('0x8e')][_0xbfa1('0xd4')]({'where':_0x2380f4,'defaults':_0x454680});}})[_0xbfa1('0xbe')](function(_0x122571){if(_0x122571){_0x33d7f4=_0x122571;var _0x21df66=fs[_0xbfa1('0xd5')](path[_0xbfa1('0x83')](config[_0xbfa1('0x7d')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x4424e4=ejs[_0xbfa1('0xd6')](_0x21df66,{'body':_['toPairs'](_0x13c82a['body'][_0xbfa1('0x61')]),'bodyTitle':_0x405105[_0xbfa1('0xd7')]});return db[_0xbfa1('0xd8')][_0xbfa1('0x60')]({'body':_0x4424e4,'ContactId':_0x122571['id'],'ChatWebsiteId':_0x405105['id']});}})[_0xbfa1('0x23')](function(_0x583804){_0xe8c3b2=_0x583804;if(_0x5e3495[_0xbfa1('0x5d')]){var _0x5a2b57=_0x5e3495[_0xbfa1('0x47')](function(_0x52ddcb){return{'name':_0x52ddcb['originalname'],'basename':_0x52ddcb[_0xbfa1('0x77')],'type':_0x52ddcb[_0xbfa1('0xd9')],'ChatOfflineMessageId':_0x583804['id']};});_0x5aa6a8=_0x5a2b57[_0xbfa1('0x47')](_0x17347f=>{var _0x339c2e={'filename':_0x17347f[_0xbfa1('0x3f')],'path':path['join'](config[_0xbfa1('0x7d')],_0xbfa1('0xda'),_0xbfa1('0xce'),'attachments',_0xbfa1('0xdb'),_0x17347f['basename'])};return _0x339c2e;});if(!_0x405105[_0xbfa1('0xdc')]){return db[_0xbfa1('0xdd')][_0xbfa1('0xde')](function(_0x4e476d){return db[_0xbfa1('0xdf')][_0xbfa1('0xe0')](_0x5a2b57,{'transaction':_0x4e476d});});}}})[_0xbfa1('0x23')](function(){if(_0xe8c3b2){_0x18a9e3=_0xe8c3b2;return db[_0xbfa1('0xd3')][_0xbfa1('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0xbfa1('0xe1')],'as':_0xbfa1('0xe2'),'raw':!![]}]});}})[_0xbfa1('0x23')](function(_0x272cb7){if(_0x272cb7&&_0x272cb7[_0xbfa1('0xe2')]&&_0x405105['forwardOffline']&&_0x405105[_0xbfa1('0xe3')]){var _0x62d20c={'tls':{'rejectUnauthorized':![]}};if(_0x272cb7[_0xbfa1('0xe2')][_0xbfa1('0xe4')]){_0x62d20c['service']=_0x272cb7[_0xbfa1('0xe2')][_0xbfa1('0xe4')];}else{_0x62d20c[_0xbfa1('0xe5')]=_0x272cb7['Smtp'][_0xbfa1('0xe5')];_0x62d20c[_0xbfa1('0xe6')]=_0x272cb7[_0xbfa1('0xe2')]['port'];_0x62d20c[_0xbfa1('0xe7')]=_0x272cb7[_0xbfa1('0xe2')][_0xbfa1('0xe7')];}if(_0x272cb7[_0xbfa1('0xe2')][_0xbfa1('0xe8')]){_0x62d20c[_0xbfa1('0xe9')]={'user':_0x272cb7['Smtp'][_0xbfa1('0x63')],'pass':_0x272cb7[_0xbfa1('0xe2')][_0xbfa1('0xea')]};}return respondWithRpcPromise(_0xbfa1('0xeb'),_0xbfa1('0xec'),{'account':_0x62d20c,'message':{'from':util[_0xbfa1('0xb4')](_0xbfa1('0xed'),_0x272cb7[_0xbfa1('0x3f')],_0x272cb7[_0xbfa1('0xee')]||_0x272cb7[_0xbfa1('0xe2')][_0xbfa1('0x63')]),'to':_0x405105[_0xbfa1('0xe3')],'subject':_0x405105[_0xbfa1('0xef')],'html':_0x18a9e3['body'],'attachments':_0x5aa6a8}},client9003)[_0xbfa1('0x23')](function(){return _0x18a9e3;})[_0xbfa1('0x2d')](function(_0x350a3c){console[_0xbfa1('0x29')](_0x350a3c);});}})[_0xbfa1('0x23')](function(){if(_0x405105&&_0x405105[_0xbfa1('0xdc')]&&_0x405105['MailAccountId']){var _0x653c41=[];if(_0x5e3495['length']){_0x653c41=_0x5e3495['map'](function(_0x457185){return{'name':_0x457185[_0xbfa1('0xf0')],'basename':_0x457185[_0xbfa1('0x77')],'type':_0x457185['mimetype'],'ChatOfflineMessageId':_0xe8c3b2['id']};});}var _0x989c6b;if(!_[_0xbfa1('0x81')](_0x405105[_0xbfa1('0xf1')])){var _0x58d637=_[_0xbfa1('0x47')](_0x13c82a['body'],function(_0x5197d0){return _0x5197d0;});var _0x58c4d9=_[_0xbfa1('0xf2')](_0x58d637)[0x0];var _0x2b9acc=_['mapValues'](_0x58c4d9,function(_0x3af21e){return _0x3af21e;});_0x989c6b=_0x2b9acc[0x1][_0x405105[_0xbfa1('0xf1')]];}var _0xbfe18={'from':_0x33d7f4[_0xbfa1('0xee')],'firstName':_0x33d7f4[_0xbfa1('0xae')],'lastName':_0x33d7f4[_0xbfa1('0xaf')],'mapKey':'email','message':{'from':_0x33d7f4['email'],'to':_0x405105['MailAccount'][_0xbfa1('0xee')],'cc':'','subject':_[_0xbfa1('0x81')](_0x989c6b)?_0x405105['offlineMessageSubject']:_0x989c6b,'messageId':'','sentAt':new Date(),'attach':_0x653c41[_0xbfa1('0x5d')],'attachments':_0x653c41,'originChannel':_0xbfa1('0xf3'),'ChatWebsiteId':_0x405105['id'],'ChatOfflineMessageId':_0x18a9e3['id'],'originTo':_0x405105[_0xbfa1('0xd3')][_0xbfa1('0xee')]},'body':_0x18a9e3[_0xbfa1('0x61')]};var _0x4cfc7e={'account':{'id':_0x405105[_0xbfa1('0xf4')]},'body':_0xbfe18,'log':_0xbfa1('0xf5')};return respondWithRpcPromise(_0xbfa1('0xf5'),_0xbfa1('0xf6'),_0x4cfc7e,client9001)[_0xbfa1('0x23')](function(){return _0x18a9e3;})[_0xbfa1('0x2d')](function(_0xb4c102){console[_0xbfa1('0x29')](_0xb4c102);});}return;})['then'](function(){if(_0x18a9e3){return _0x18a9e3;}})[_0xbfa1('0x23')](respondWithResult(_0x42bc1c,null))[_0xbfa1('0x2d')](function(_0x3b3fd8){console[_0xbfa1('0x29')](_0xbfa1('0x2d'),_0x3b3fd8);for(var _0x438f97 of _0x5e3495){var _0xafc825=path['join'](config['root'],_0xbfa1('0xda'),_0xbfa1('0xce'),_0xbfa1('0xf7'),_0xbfa1('0xdb'),_0x438f97[_0xbfa1('0x77')]);fs_extra['remove'](_0xafc825)[_0xbfa1('0x2d')](function(_0x298f97){console[_0xbfa1('0x29')](_0xbfa1('0xf8'),_0xafc825,_0x298f97);});}});};exports[_0xbfa1('0xf9')]=function(_0x279991,_0x104a80,_0x243bdd){return db[_0xbfa1('0xbb')][_0xbfa1('0x5f')]({'where':{'id':_0x279991[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x104a80,null))['then'](function(_0x4ed2ad){if(_0x4ed2ad){return _0x4ed2ad[_0xbfa1('0xf9')](_0x279991[_0xbfa1('0x61')][_0xbfa1('0x70')],_[_0xbfa1('0xfa')](_0x279991[_0xbfa1('0x61')],[_0xbfa1('0x70'),'id'])||{});}})[_0xbfa1('0x23')](respondWithResult(_0x104a80,null))['catch'](handleError(_0x104a80,null));};exports[_0xbfa1('0xfb')]=function(_0x7d59e1,_0x5e7184,_0x39a6ab){var _0x4ee45c={'raw':![],'where':{}};var _0x5a7e9e={};var _0x36b4bd={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x7d59e1[_0xbfa1('0x69')]['id']}})['then'](handleEntityNotFound(_0x5e7184,null))[_0xbfa1('0x23')](function(_0x4cab93){if(_0x4cab93){_0x5a7e9e[_0xbfa1('0x46')]=_[_0xbfa1('0x5b')](db[_0xbfa1('0xbb')][_0xbfa1('0x43')]);_0x5a7e9e[_0xbfa1('0x48')]=_[_0xbfa1('0x5b')](_0x7d59e1['query']);_0x5a7e9e[_0xbfa1('0x49')]=_['intersection'](_0x5a7e9e['model'],_0x5a7e9e['query']);_0x4ee45c[_0xbfa1('0x4b')]=_['intersection'](_0x5a7e9e[_0xbfa1('0x46')],qs[_0xbfa1('0x5c')](_0x7d59e1['query'][_0xbfa1('0x5c')]));_0x4ee45c[_0xbfa1('0x4b')]=_0x4ee45c[_0xbfa1('0x4b')][_0xbfa1('0x5d')]?_0x4ee45c['attributes']:_0x5a7e9e[_0xbfa1('0x46')];if(!_0x7d59e1[_0xbfa1('0x48')][_0xbfa1('0x4c')](_0xbfa1('0x6e'))){_0x4ee45c[_0xbfa1('0x30')]=qs[_0xbfa1('0x30')](_0x7d59e1[_0xbfa1('0x48')]['limit']);_0x4ee45c[_0xbfa1('0x2f')]=qs['offset'](_0x7d59e1[_0xbfa1('0x48')][_0xbfa1('0x2f')]);}_0x4ee45c[_0xbfa1('0x4d')]=qs[_0xbfa1('0x4e')](_0x7d59e1[_0xbfa1('0x48')][_0xbfa1('0x4e')]);_0x4ee45c['where']=qs['filters'](_[_0xbfa1('0x50')](_0x7d59e1[_0xbfa1('0x48')],_0x5a7e9e[_0xbfa1('0x49')]));_0x4ee45c['where']['ChatWebsiteId']=_0x4cab93['id'];if(_0x7d59e1['query'][_0xbfa1('0x51')]){_0x4ee45c['where']=_[_0xbfa1('0x54')](_0x4ee45c[_0xbfa1('0x4f')],{'$or':_['map'](_0x4ee45c[_0xbfa1('0x4b')],function(_0x35ea44){var _0x240160={};_0x240160[_0x35ea44]={'$like':'%'+_0x7d59e1[_0xbfa1('0x48')]['filter']+'%'};return _0x240160;})});}_0x4ee45c=_[_0xbfa1('0x54')]({},_0x4ee45c,_0x7d59e1[_0xbfa1('0x5e')]);return db[_0xbfa1('0xbb')][_0xbfa1('0x32')]({'where':_0x4ee45c['where']})[_0xbfa1('0x23')](function(_0x54db05){_0x36b4bd[_0xbfa1('0x32')]=_0x54db05;if(_0x7d59e1['query'][_0xbfa1('0x56')]){_0x4ee45c[_0xbfa1('0x57')]=[{'model':db[_0xbfa1('0x8e')],'as':_0xbfa1('0xfc'),'required':![]},{'model':db[_0xbfa1('0xc7')],'as':'Owner','attributes':['name',_0xbfa1('0xfd'),_0xbfa1('0xfe')],'required':![]},{'model':db[_0xbfa1('0xff')],'as':_0xbfa1('0x100'),'attributes':['id',_0xbfa1('0x3f'),_0xbfa1('0x101')],'where':_0x7d59e1[_0xbfa1('0x48')][_0xbfa1('0x102')]?{'id':_0x7d59e1[_0xbfa1('0x48')][_0xbfa1('0x102')]}:undefined,'required':_0x7d59e1[_0xbfa1('0x48')][_0xbfa1('0x102')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x4ee45c);})[_0xbfa1('0x23')](function(_0x303302){_0x36b4bd['rows']=_0x303302;return _0x36b4bd;});}})[_0xbfa1('0x23')](respondWithFilteredResult(_0x5e7184,_0x4ee45c))[_0xbfa1('0x2d')](handleError(_0x5e7184,null));};function iftimePromise(_0x5e76e0,_0x1e12e1){return respondWithRpcPromise(_0xbfa1('0x103'),'getSnippet',{'command':_0x1e12e1[_0xbfa1('0x104')]?util[_0xbfa1('0xb4')](_0xbfa1('0x105'),_0x5e76e0[_0xbfa1('0x106')],_0x1e12e1[_0xbfa1('0x104')]):util[_0xbfa1('0xb4')](_0xbfa1('0x107'),_0x5e76e0[_0xbfa1('0x106')])},client9002)[_0xbfa1('0x23')](function(_0x2c7717){var _0x467363=_0x2c7717&&_0x2c7717[_0xbfa1('0x108')](_0xbfa1('0x109'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1e12e1['id'],_0x5e76e0['id'],_0x5e76e0[_0xbfa1('0x106')],_0x467363?_0xbfa1('0x10a'):_0xbfa1('0x10b'),_0x1e12e1[_0xbfa1('0x104')]?_0x1e12e1[_0xbfa1('0x104')]:_0xbfa1('0x10c'));return _0x467363;})[_0xbfa1('0x2d')](function(_0x60fa96){logger[_0xbfa1('0x29')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1e12e1['id'],_0x5e76e0['id'],_0x5e76e0[_0xbfa1('0x106')],util[_0xbfa1('0x10d')](_0x60fa96,{'showHidden':![],'depth':null}),_0x1e12e1[_0xbfa1('0x104')]?_0x1e12e1[_0xbfa1('0x104')]:'No\x20timezone');return![];});}exports[_0xbfa1('0x10e')]=function(_0x2b2724,_0x4858e6,_0xc390c7){var _0x5cee54=0x0;var _0x4057e2=0x0;var _0x163951=![];var _0x56d6d4;var _0x37015e;return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x2b2724['params']['id']},'include':[{'model':db[_0xbfa1('0x10f')],'as':'Interval','include':[{'model':db[_0xbfa1('0x10f')],'as':_0xbfa1('0x110'),'attributes':['id',_0xbfa1('0x106')],'raw':!![]}]}]})[_0xbfa1('0x23')](handleEntityNotFound(_0x4858e6,null))[_0xbfa1('0x23')](function(_0x2e38ac){if(_0x2e38ac){_0x56d6d4=_0x2e38ac;return _0x2e38ac['getProactiveActions']({'raw':!![]});}})[_0xbfa1('0x23')](function(_0x1b76fd){if(_0x56d6d4){if(_0x1b76fd){_0x37015e=_0x1b76fd;}}return require(_0xbfa1('0x1d'))[_0xbfa1('0x80')]();})[_0xbfa1('0x23')](function(_0x24eead){if(_0x24eead){_0x4057e2=_0x24eead[_0xbfa1('0x111')];_0x163951=_0x24eead[_0xbfa1('0x112')];}})[_0xbfa1('0x23')](function(){return db[_0xbfa1('0xbb')]['count']({'where':{'closed':![]}});})[_0xbfa1('0x23')](function(_0x11e79e){_0x5cee54=_0x11e79e;if(_0x4057e2&&_0x11e79e>_0x4057e2){return db[_0xbfa1('0x113')][_0xbfa1('0x6d')]({'where':{'id':0x1}})['then'](function(_0x46d69b){if(_0x46d69b){_0x46d69b[_0xbfa1('0x114')]('chatLicenseExceeded');}});}})[_0xbfa1('0x23')](function(){if(_0x56d6d4[_0xbfa1('0x10f')]&&_0x56d6d4[_0xbfa1('0x10f')][_0xbfa1('0x110')]){var _0x466dac=[];for(var _0x17674f=0x0;_0x17674f<_0x56d6d4[_0xbfa1('0x10f')][_0xbfa1('0x110')][_0xbfa1('0x5d')];_0x17674f++){var _0x1d0173=_0x56d6d4[_0xbfa1('0x10f')]['Intervals'][_0x17674f]['get']({'plain':!![]});_0x466dac['push'](iftimePromise(_0x1d0173,_0x56d6d4));}return BPromise[_0xbfa1('0x115')](_0x466dac)[_0xbfa1('0x23')](function(_0xc36cf2){return _[_0xbfa1('0x116')](_0xc36cf2);});}else{return!![];}})['then'](function(_0x39b41e){var _0x4974be=fs[_0xbfa1('0xd5')](path[_0xbfa1('0x83')](config['root'],_0xbfa1('0x117')),'utf8');var _0x1eca27={'remote':_0x56d6d4[_0xbfa1('0x118')],'query':querystring['stringify'](_['merge'](_0x56d6d4[_0xbfa1('0x39')]({'plain':!![]}),{'customerIp':_0x2b2724['headers'][_0xbfa1('0xab')]||_0x2b2724[_0xbfa1('0xa9')][_0xbfa1('0x119')]||_0x2b2724[_0xbfa1('0x11a')][_0xbfa1('0x11b')]||_0x2b2724['ip'],'referer':_0x2b2724[_0xbfa1('0xa9')][_0xbfa1('0xb1')],'openedInteractions':_0x5cee54,'maxInteractions':_0x4057e2,'virtual':_0x163951['virtual'],'online':_0x39b41e,'custom':_0x163951}))['replace'](/'/g,'\x5c\x27')};_0x4858e6[_0xbfa1('0x40')](ejs[_0xbfa1('0xd6')](Mustache[_0xbfa1('0xd6')](_0x4974be,_0x1eca27),{'proactiveActions':_0x37015e,'alignment':_0x56d6d4['alignment'],'verticalAlignment':_0x56d6d4[_0xbfa1('0x11c')],'div_color':_0x56d6d4['color'],'text_color':_0x56d6d4['textColor'],'button_color':_0x56d6d4[_0xbfa1('0x11d')],'background_color':_0x56d6d4[_0xbfa1('0x11e')]}));})[_0xbfa1('0x2d')](handleError(_0x4858e6,null));};exports[_0xbfa1('0x11f')]=function(_0xa6b4e1,_0x72ea9a,_0x469a38){return db[_0xbfa1('0x55')][_0xbfa1('0x6d')]({'where':{'id':_0xa6b4e1[_0xbfa1('0x69')]['id']}})['then'](handleEntityNotFound(_0x72ea9a,null))['then'](function(_0x11efa9){if(_0x11efa9){return db[_0xbfa1('0xdd')][_0xbfa1('0xde')](function(_0x6cc3ff){return db['ChatApplication'][_0xbfa1('0x38')]({'where':{'ChatWebsiteId':_0xa6b4e1['params']['id']},'transaction':_0x6cc3ff})[_0xbfa1('0x23')](function(_0x156a2b){var _0x2e5adf=_['map'](_0xa6b4e1[_0xbfa1('0x61')],function(_0x286429){_0x286429[_0xbfa1('0x6a')]=_0xa6b4e1[_0xbfa1('0x69')]['id'];return _0x286429;});return db['ChatApplication'][_0xbfa1('0xe0')](_0x2e5adf,{'transaction':_0x6cc3ff});});})[_0xbfa1('0x23')](function(){return db[_0xbfa1('0x9f')][_0xbfa1('0x120')]({'where':{'ChatWebsiteId':_0xa6b4e1[_0xbfa1('0x69')]['id']},'order':_0xbfa1('0x121')});});}})[_0xbfa1('0x23')](respondWithResult(_0x72ea9a,null))[_0xbfa1('0x2d')](handleError(_0x72ea9a,null));};exports[_0xbfa1('0x122')]=function(_0x57b837,_0x58dfe6,_0xa64f4f){var _0x46726d={};var _0xd3ab16={};var _0x779dc7;var _0x56a89a;return db[_0xbfa1('0x55')][_0xbfa1('0x6d')]({'where':{'id':_0x57b837['params']['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x58dfe6,null))['then'](function(_0x158c16){if(_0x158c16){_0x779dc7=_0x158c16;_0xd3ab16[_0xbfa1('0x46')]=_[_0xbfa1('0x5b')](db['ChatApplication'][_0xbfa1('0x43')]);_0xd3ab16[_0xbfa1('0x48')]=_[_0xbfa1('0x5b')](_0x57b837[_0xbfa1('0x48')]);_0xd3ab16[_0xbfa1('0x49')]=_[_0xbfa1('0x4a')](_0xd3ab16[_0xbfa1('0x46')],_0xd3ab16['query']);_0x46726d[_0xbfa1('0x4b')]=_[_0xbfa1('0x4a')](_0xd3ab16[_0xbfa1('0x46')],qs['fields'](_0x57b837[_0xbfa1('0x48')]['fields']));_0x46726d[_0xbfa1('0x4b')]=_0x46726d[_0xbfa1('0x4b')][_0xbfa1('0x5d')]?_0x46726d[_0xbfa1('0x4b')]:_0xd3ab16['model'];_0x46726d[_0xbfa1('0x4d')]=qs[_0xbfa1('0x4e')](_0x57b837[_0xbfa1('0x48')][_0xbfa1('0x4e')]);_0x46726d[_0xbfa1('0x4f')]=qs[_0xbfa1('0x49')](_[_0xbfa1('0x50')](_0x57b837[_0xbfa1('0x48')],_0xd3ab16['filters']));if(_0x57b837[_0xbfa1('0x48')][_0xbfa1('0x51')]){_0x46726d['where']=_[_0xbfa1('0x54')](_0x46726d[_0xbfa1('0x4f')],{'$or':_[_0xbfa1('0x47')](_0x46726d[_0xbfa1('0x4b')],function(_0x16b06f){var _0x52e6a2={};_0x52e6a2[_0x16b06f]={'$like':'%'+_0x57b837[_0xbfa1('0x48')]['filter']+'%'};return _0x52e6a2;})});}_0x46726d=_[_0xbfa1('0x54')]({},_0x46726d,_0x57b837[_0xbfa1('0x5e')]);return _0x779dc7[_0xbfa1('0x122')](_0x46726d);}})[_0xbfa1('0x23')](function(_0x464422){if(_0x464422){_0x56a89a=_0x464422[_0xbfa1('0x5d')];if(!_0x57b837[_0xbfa1('0x48')][_0xbfa1('0x4c')](_0xbfa1('0x6e'))){_0x46726d[_0xbfa1('0x30')]=qs[_0xbfa1('0x30')](_0x57b837['query'][_0xbfa1('0x30')]);_0x46726d[_0xbfa1('0x2f')]=qs[_0xbfa1('0x2f')](_0x57b837[_0xbfa1('0x48')][_0xbfa1('0x2f')]);}return _0x779dc7[_0xbfa1('0x122')](_0x46726d);}})[_0xbfa1('0x23')](function(_0x551c99){if(_0x551c99){return _0x551c99?{'count':_0x56a89a,'rows':_0x551c99}:null;}})[_0xbfa1('0x23')](respondWithResult(_0x58dfe6,null))['catch'](handleError(_0x58dfe6,null));};exports[_0xbfa1('0x123')]=function(_0x1058b4,_0x3636c2,_0x2db5f5){return db[_0xbfa1('0x124')]['find']({'where':{'id':_0x1058b4[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x3636c2,null))['then'](function(_0x2afbf3){if(_0x2afbf3){return _0x2afbf3['addProactiveActions'](_0x1058b4['body'][_0xbfa1('0x70')],_[_0xbfa1('0xfa')](_0x1058b4[_0xbfa1('0x61')],[_0xbfa1('0x70'),'id'])||{});}})[_0xbfa1('0x23')](respondWithResult(_0x3636c2,null))[_0xbfa1('0x2d')](handleError(_0x3636c2,null));};exports['getProactiveActions']=function(_0x4a7edb,_0x2ed3d6,_0xee0f21){var _0x1506df={};var _0x37d655={};var _0x581a08;var _0x14b45f;return db[_0xbfa1('0x55')][_0xbfa1('0x6d')]({'where':{'id':_0x4a7edb[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x2ed3d6,null))[_0xbfa1('0x23')](function(_0x534675){if(_0x534675){_0x581a08=_0x534675;_0x37d655['model']=_[_0xbfa1('0x5b')](db[_0xbfa1('0x125')][_0xbfa1('0x43')]);_0x37d655[_0xbfa1('0x48')]=_[_0xbfa1('0x5b')](_0x4a7edb[_0xbfa1('0x48')]);_0x37d655[_0xbfa1('0x49')]=_[_0xbfa1('0x4a')](_0x37d655[_0xbfa1('0x46')],_0x37d655['query']);_0x1506df[_0xbfa1('0x4b')]=_[_0xbfa1('0x4a')](_0x37d655['model'],qs[_0xbfa1('0x5c')](_0x4a7edb[_0xbfa1('0x48')]['fields']));_0x1506df['attributes']=_0x1506df[_0xbfa1('0x4b')][_0xbfa1('0x5d')]?_0x1506df['attributes']:_0x37d655[_0xbfa1('0x46')];_0x1506df[_0xbfa1('0x4d')]=qs[_0xbfa1('0x4e')](_0x4a7edb['query'][_0xbfa1('0x4e')]);_0x1506df['where']=qs[_0xbfa1('0x49')](_[_0xbfa1('0x50')](_0x4a7edb[_0xbfa1('0x48')],_0x37d655[_0xbfa1('0x49')]));if(_0x4a7edb[_0xbfa1('0x48')][_0xbfa1('0x51')]){_0x1506df[_0xbfa1('0x4f')]=_[_0xbfa1('0x54')](_0x1506df[_0xbfa1('0x4f')],{'$or':_[_0xbfa1('0x47')](_0x1506df['attributes'],function(_0x5c2033){var _0x4457a5={};_0x4457a5[_0x5c2033]={'$like':'%'+_0x4a7edb['query'][_0xbfa1('0x51')]+'%'};return _0x4457a5;})});}_0x1506df=_[_0xbfa1('0x54')]({},_0x1506df,_0x4a7edb[_0xbfa1('0x5e')]);return _0x581a08[_0xbfa1('0x126')](_0x1506df);}})[_0xbfa1('0x23')](function(_0x296834){if(_0x296834){_0x14b45f=_0x296834[_0xbfa1('0x5d')];if(!_0x4a7edb[_0xbfa1('0x48')]['hasOwnProperty'](_0xbfa1('0x6e'))){_0x1506df[_0xbfa1('0x30')]=qs[_0xbfa1('0x30')](_0x4a7edb[_0xbfa1('0x48')][_0xbfa1('0x30')]);_0x1506df['offset']=qs[_0xbfa1('0x2f')](_0x4a7edb[_0xbfa1('0x48')][_0xbfa1('0x2f')]);}return _0x581a08[_0xbfa1('0x126')](_0x1506df);}})[_0xbfa1('0x23')](function(_0x38a872){if(_0x38a872){return _0x38a872?{'count':_0x14b45f,'rows':_0x38a872}:null;}})[_0xbfa1('0x23')](respondWithResult(_0x2ed3d6,null))[_0xbfa1('0x2d')](handleError(_0x2ed3d6,null));};exports[_0xbfa1('0x127')]=function(_0x2a26c6,_0x5e6c70,_0x5f2b64){var _0x4dd2e8=_0x2a26c6[_0xbfa1('0x48')][_0xbfa1('0x128')]==='false'?'offlineForm':_0xbfa1('0x129');return db[_0xbfa1('0x55')]['find']({'attributes':['id',_0x4dd2e8],'where':{'id':_0x2a26c6[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x5e6c70,null))[_0xbfa1('0x23')](function(_0x57ade5){if(_0x57ade5){var _0x341758=_0x57ade5[_0x4dd2e8];var _0x593eb9=_0x341758&&_0x341758[_0xbfa1('0x12a')]?_0x341758[_0xbfa1('0x12a')]:[];_0x5e6c70[_0xbfa1('0x40')]({'fromKey':_[_0xbfa1('0x81')](_0x341758[_0xbfa1('0x12b')])?undefined:_0x341758[_0xbfa1('0x12b')],'count':_0x593eb9[_0xbfa1('0x5d')],'rows':_0x593eb9});}})['catch'](handleError(_0x5e6c70,null));};exports[_0xbfa1('0x12c')]=function(_0x3ea5ab,_0x4221be,_0xc3583a){var _0x270cde={'raw':![],'where':{}};var _0x43d811={};var _0xee4fc6={'count':0x0,'rows':[]};return db[_0xbfa1('0x55')][_0xbfa1('0x6d')]({'where':{'id':_0x3ea5ab[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x4221be,null))[_0xbfa1('0x23')](function(_0x51f55d){if(_0x51f55d){_0x43d811[_0xbfa1('0x46')]=_[_0xbfa1('0x5b')](db[_0xbfa1('0xd8')][_0xbfa1('0x43')]);_0x43d811['query']=_[_0xbfa1('0x5b')](_0x3ea5ab[_0xbfa1('0x48')]);_0x43d811[_0xbfa1('0x49')]=_[_0xbfa1('0x4a')](_0x43d811[_0xbfa1('0x46')],_0x43d811[_0xbfa1('0x48')]);_0x270cde[_0xbfa1('0x4b')]=_[_0xbfa1('0x4a')](_0x43d811[_0xbfa1('0x46')],qs['fields'](_0x3ea5ab[_0xbfa1('0x48')][_0xbfa1('0x5c')]));_0x270cde[_0xbfa1('0x4b')]=_0x270cde['attributes']['length']?_0x270cde[_0xbfa1('0x4b')]:_0x43d811[_0xbfa1('0x46')];if(!_0x3ea5ab[_0xbfa1('0x48')]['hasOwnProperty'](_0xbfa1('0x6e'))){_0x270cde[_0xbfa1('0x30')]=qs[_0xbfa1('0x30')](_0x3ea5ab[_0xbfa1('0x48')][_0xbfa1('0x30')]);_0x270cde[_0xbfa1('0x2f')]=qs[_0xbfa1('0x2f')](_0x3ea5ab[_0xbfa1('0x48')][_0xbfa1('0x2f')]);}_0x270cde[_0xbfa1('0x4d')]=qs[_0xbfa1('0x4e')](_0x3ea5ab[_0xbfa1('0x48')][_0xbfa1('0x4e')]);_0x270cde[_0xbfa1('0x4f')]=qs[_0xbfa1('0x49')](_[_0xbfa1('0x50')](_0x3ea5ab[_0xbfa1('0x48')],_0x43d811['filters']));_0x270cde['where'][_0xbfa1('0x6a')]=_0x51f55d['id'];if(_0x3ea5ab[_0xbfa1('0x48')][_0xbfa1('0x51')]){_0x270cde['where']=_['merge'](_0x270cde[_0xbfa1('0x4f')],{'$or':_['map'](_0x270cde['attributes'],function(_0xb38fc){var _0x5f2186={};_0x5f2186[_0xb38fc]={'$like':'%'+_0x3ea5ab['query'][_0xbfa1('0x51')]+'%'};return _0x5f2186;})});}_0x270cde=_['merge']({},_0x270cde,_0x3ea5ab[_0xbfa1('0x5e')]);return db[_0xbfa1('0xd8')]['count']({'where':_0x270cde['where']})['then'](function(_0x228916){_0xee4fc6[_0xbfa1('0x32')]=_0x228916;if(_0x3ea5ab[_0xbfa1('0x48')][_0xbfa1('0x56')]){_0x270cde[_0xbfa1('0x57')]=[{'all':!![]}];}else{_0x270cde[_0xbfa1('0x57')]=[{'model':db[_0xbfa1('0x8e')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0xbfa1('0x12d'),'required':![]}];}return db['ChatOfflineMessage'][_0xbfa1('0x58')](_0x270cde);})[_0xbfa1('0x23')](function(_0x337137){_0xee4fc6[_0xbfa1('0x59')]=_0x337137;return _0xee4fc6;});}})['then'](respondWithFilteredResult(_0x4221be,_0x270cde))[_0xbfa1('0x2d')](handleError(_0x4221be,null));};exports[_0xbfa1('0x12e')]=function(_0x213851,_0x54fd01,_0x536146){return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x213851['params']['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x54fd01,null))[_0xbfa1('0x23')](function(_0x1f50a1){if(_0x1f50a1){return _0x1f50a1['addAgents'](_0x213851[_0xbfa1('0x61')][_0xbfa1('0x70')],_['omit'](_0x213851[_0xbfa1('0x61')],['ids','id'])||{})['spread'](function(_0x3fa795){for(var _0x974be3=0x0;_0x974be3<_0x213851[_0xbfa1('0x61')][_0xbfa1('0x70')]['length'];_0x974be3+=0x1){socket[_0xbfa1('0x12f')](_0xbfa1('0x130'),{'UserId':Number(_0x213851['body']['ids'][_0x974be3]),'ChatWebsiteId':Number(_0x213851['params']['id'])});}return _0x3fa795;});}})[_0xbfa1('0x23')](respondWithResult(_0x54fd01,null))['catch'](handleError(_0x54fd01,null));};exports[_0xbfa1('0x131')]=function(_0x241e52,_0x22d8bf,_0x5b0f70){return db[_0xbfa1('0x55')][_0xbfa1('0x5f')]({'where':{'id':_0x241e52[_0xbfa1('0x69')]['id']}})['then'](handleEntityNotFound(_0x22d8bf,null))[_0xbfa1('0x23')](function(_0x21f1ad){if(_0x21f1ad){return _0x21f1ad[_0xbfa1('0x131')](_0x241e52[_0xbfa1('0x48')][_0xbfa1('0x70')])['then'](function(){if(_[_0xbfa1('0x132')](_0x241e52[_0xbfa1('0x48')][_0xbfa1('0x70')])){for(var _0x51cc81=0x0;_0x51cc81<_0x241e52[_0xbfa1('0x48')]['ids'][_0xbfa1('0x5d')];_0x51cc81+=0x1){socket[_0xbfa1('0x12f')](_0xbfa1('0x133'),{'UserId':Number(_0x241e52[_0xbfa1('0x48')][_0xbfa1('0x70')][_0x51cc81]),'ChatWebsiteId':Number(_0x241e52[_0xbfa1('0x69')]['id'])});}}else{socket['emit'](_0xbfa1('0x133'),{'UserId':Number(_0x241e52['query']['ids']),'ChatWebsiteId':Number(_0x241e52[_0xbfa1('0x69')]['id'])});}});}})['then'](respondWithStatusCode(_0x22d8bf,null))['catch'](handleError(_0x22d8bf,null));};exports[_0xbfa1('0x134')]=function(_0x3eaaf1,_0x3be0cb,_0x47a100){var _0x224778={};var _0x1568dd={};var _0x51b0bb;var _0x57da96;return db[_0xbfa1('0x55')][_0xbfa1('0x6d')]({'where':{'id':_0x3eaaf1[_0xbfa1('0x69')]['id']}})[_0xbfa1('0x23')](handleEntityNotFound(_0x3be0cb,null))[_0xbfa1('0x23')](function(_0x2967b0){if(_0x2967b0){_0x51b0bb=_0x2967b0;_0x1568dd[_0xbfa1('0x46')]=_[_0xbfa1('0x5b')](db[_0xbfa1('0xc7')]['rawAttributes']);_0x1568dd[_0xbfa1('0x48')]=_[_0xbfa1('0x5b')](_0x3eaaf1[_0xbfa1('0x48')]);_0x1568dd[_0xbfa1('0x49')]=_[_0xbfa1('0x4a')](_0x1568dd[_0xbfa1('0x46')],_0x1568dd[_0xbfa1('0x48')]);_0x224778[_0xbfa1('0x4b')]=_[_0xbfa1('0x4a')](_0x1568dd[_0xbfa1('0x46')],qs['fields'](_0x3eaaf1[_0xbfa1('0x48')]['fields']));_0x224778['attributes']=_0x224778[_0xbfa1('0x4b')][_0xbfa1('0x5d')]?_0x224778[_0xbfa1('0x4b')]:_0x1568dd[_0xbfa1('0x46')];_0x224778[_0xbfa1('0x4d')]=qs[_0xbfa1('0x4e')](_0x3eaaf1['query'][_0xbfa1('0x4e')]);_0x224778[_0xbfa1('0x4f')]=qs[_0xbfa1('0x49')](_[_0xbfa1('0x50')](_0x3eaaf1[_0xbfa1('0x48')],_0x1568dd['filters']));if(_0x3eaaf1[_0xbfa1('0x48')][_0xbfa1('0x51')]){_0x224778[_0xbfa1('0x4f')]=_[_0xbfa1('0x54')](_0x224778[_0xbfa1('0x4f')],{'$or':_[_0xbfa1('0x47')](_0x224778[_0xbfa1('0x4b')],function(_0x51b7bf){var _0xe5ddf9={};_0xe5ddf9[_0x51b7bf]={'$like':'%'+_0x3eaaf1['query'][_0xbfa1('0x51')]+'%'};return _0xe5ddf9;})});}_0x224778=_['merge']({},_0x224778,_0x3eaaf1['options']);return _0x51b0bb[_0xbfa1('0x134')](_0x224778);}})['then'](function(_0x19e422){if(_0x19e422){_0x57da96=_0x19e422[_0xbfa1('0x5d')];if(!_0x3eaaf1[_0xbfa1('0x48')][_0xbfa1('0x4c')](_0xbfa1('0x6e'))){_0x224778[_0xbfa1('0x30')]=qs[_0xbfa1('0x30')](_0x3eaaf1['query']['limit']);_0x224778[_0xbfa1('0x2f')]=qs['offset'](_0x3eaaf1[_0xbfa1('0x48')][_0xbfa1('0x2f')]);}return _0x51b0bb['getAgents'](_0x224778);}})[_0xbfa1('0x23')](function(_0x3b5da5){if(_0x3b5da5){return _0x3b5da5?{'count':_0x57da96,'rows':_0x3b5da5}:null;}})['then'](respondWithResult(_0x3be0cb,null))[_0xbfa1('0x2d')](handleError(_0x3be0cb,null));};
\ No newline at end of file
+var _0x3888=['getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','include','findAll','rows','params','mandatoryDispositionPause','keys','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','findOne','includeAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','ChatWebsiteId','removeAnswers','ids','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','setUA','headers','getResult','chat','CmContact','describe','Sequelize','ValidationError','difference','createdAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','updatedAt','DESC','ChatApplication','Applications','List','account','applications','list','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','no\x20available\x20attributes','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','forwardOffline','forwardOfflineAddress','service','Smtp','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','lastName','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','Contact','User','internal','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-forwarded-for','connection','remoteAddress','render','alignment','verticalAlignment','backgroundColor','addApplications','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0x3888,0x14e));var _0x8388=function(_0x34ad55,_0x2fb590){_0x34ad55=_0x34ad55-0x0;var _0x4239f9=_0x3888[_0x34ad55];return _0x4239f9;};'use strict';var emlformat=require(_0x8388('0x0'));var rimraf=require(_0x8388('0x1'));var zipdir=require(_0x8388('0x2'));var jsonpatch=require(_0x8388('0x3'));var rp=require(_0x8388('0x4'));var moment=require(_0x8388('0x5'));var BPromise=require(_0x8388('0x6'));var Mustache=require(_0x8388('0x7'));var util=require(_0x8388('0x8'));var path=require(_0x8388('0x9'));var sox=require(_0x8388('0xa'));var csv=require(_0x8388('0xb'));var ejs=require(_0x8388('0xc'));var fs=require('fs');var fs_extra=require(_0x8388('0xd'));var _=require(_0x8388('0xe'));var squel=require(_0x8388('0xf'));var crypto=require(_0x8388('0x10'));var jsforce=require(_0x8388('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x8388('0xb'));var querystring=require(_0x8388('0x12'));var Papa=require('papaparse');var Redis=require(_0x8388('0x13'));var authService=require(_0x8388('0x14'));var qs=require(_0x8388('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8388('0x16'));var logger=require(_0x8388('0x17'))('api');var utils=require(_0x8388('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8388('0x19'))['db'];config[_0x8388('0x1a')]=_[_0x8388('0x1b')](config[_0x8388('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x8388('0x1c'))(new Redis(config[_0x8388('0x1a')]));require(_0x8388('0x1d'))[_0x8388('0x1e')](socket);var jayson=require(_0x8388('0x1f'));var client=jayson['client'][_0x8388('0x20')]({'port':0x232c});var client9002=jayson[_0x8388('0x21')]['http']({'port':0x232a});var client9003=jayson[_0x8388('0x21')]['http']({'port':0x232b});var client9001=jayson[_0x8388('0x21')][_0x8388('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x424e6e,_0x234df2,_0x40d97c,_0x572c8e){return new BPromise(function(_0x58b7e1,_0x4e710a){var _0x3b9841=_0x572c8e||client;return _0x3b9841[_0x8388('0x22')](_0x424e6e,_0x40d97c)[_0x8388('0x23')](function(_0x26c500){logger[_0x8388('0x24')](_0x8388('0x25'),_0x234df2,_0x8388('0x26'));logger[_0x8388('0x27')](_0x8388('0x28'),_0x234df2,_0x8388('0x26'),JSON[_0x8388('0x29')](_0x26c500));if(_0x26c500['error']){if(_0x26c500[_0x8388('0x2a')][_0x8388('0x2b')]===0x1f4){logger['error'](_0x8388('0x25'),_0x234df2,_0x26c500[_0x8388('0x2a')][_0x8388('0x2c')]);return _0x4e710a(_0x26c500[_0x8388('0x2a')]['message']);}logger[_0x8388('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x234df2,_0x26c500[_0x8388('0x2a')][_0x8388('0x2c')]);return _0x58b7e1(_0x26c500['error'][_0x8388('0x2c')]);}else{logger[_0x8388('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x234df2,_0x8388('0x26'));_0x58b7e1(_0x26c500[_0x8388('0x2d')][_0x8388('0x2c')]);}})[_0x8388('0x2e')](function(_0x491d00){logger[_0x8388('0x2a')](_0x8388('0x25'),_0x234df2,_0x491d00);_0x4e710a(_0x491d00);});});}function respondWithStatusCode(_0x2d8ed4,_0xc829a6){_0xc829a6=_0xc829a6||0xcc;return function(_0xa0ee2f){if(_0xa0ee2f){return _0x2d8ed4[_0x8388('0x2f')](_0xc829a6);}return _0x2d8ed4[_0x8388('0x30')](_0xc829a6)[_0x8388('0x31')]();};}function respondWithResult(_0x32e4ae,_0x4b4c1b){_0x4b4c1b=_0x4b4c1b||0xc8;return function(_0x67450f){if(_0x67450f){return _0x32e4ae[_0x8388('0x30')](_0x4b4c1b)[_0x8388('0x32')](_0x67450f);}};}function respondWithFilteredResult(_0x29915a,_0x386006){return function(_0x315b09){if(_0x315b09){var _0x52504b=typeof _0x386006['offset']==='undefined'&&typeof _0x386006[_0x8388('0x33')]===_0x8388('0x34');var _0x59e6cc=_0x315b09['count'];var _0x5a1816=_0x52504b?0x0:_0x386006[_0x8388('0x35')];var _0x4fae55=_0x52504b?_0x315b09[_0x8388('0x36')]:_0x386006[_0x8388('0x35')]+_0x386006[_0x8388('0x33')];var _0x327636;if(_0x4fae55>=_0x59e6cc){_0x4fae55=_0x59e6cc;_0x327636=0xc8;}else{_0x327636=0xce;}_0x29915a[_0x8388('0x30')](_0x327636);return _0x29915a['set'](_0x8388('0x37'),_0x5a1816+'-'+_0x4fae55+'/'+_0x59e6cc)['json'](_0x315b09);}return null;};}function patchUpdates(_0x16670c){return function(_0x11f644){try{jsonpatch[_0x8388('0x38')](_0x11f644,_0x16670c,!![]);}catch(_0x2f818d){return BPromise[_0x8388('0x39')](_0x2f818d);}return _0x11f644[_0x8388('0x3a')]();};}function saveUpdates(_0x4b06f3,_0x4d8d5f){return function(_0x305512){if(_0x305512){return _0x305512[_0x8388('0x3b')](_0x4b06f3)[_0x8388('0x23')](function(_0x4056cd){return _0x4056cd;});}return null;};}function removeEntity(_0x242332,_0xa5401b){return function(_0x124728){if(_0x124728){return _0x124728[_0x8388('0x3c')]()[_0x8388('0x23')](function(){var _0x53dbc3=_0x124728[_0x8388('0x3d')]({'plain':!![]});var _0x2a415f=_0x8388('0x3e');return db[_0x8388('0x3f')][_0x8388('0x3c')]({'where':{'type':_0x2a415f,'resourceId':_0x53dbc3['id']}})[_0x8388('0x23')](function(){return _0x124728;});})[_0x8388('0x23')](function(){_0x242332[_0x8388('0x30')](0xcc)[_0x8388('0x31')]();});}};}function handleEntityNotFound(_0x59dfed,_0x13f7f1){return function(_0x471897){if(!_0x471897){_0x59dfed['sendStatus'](0x194);}return _0x471897;};}function handleError(_0x31b299,_0x17a177){_0x17a177=_0x17a177||0x1f4;return function(_0x102925){logger[_0x8388('0x2a')](_0x102925[_0x8388('0x40')]);if(_0x102925[_0x8388('0x41')]){delete _0x102925['name'];}_0x31b299[_0x8388('0x30')](_0x17a177)[_0x8388('0x42')](_0x102925);};}exports[_0x8388('0x43')]=function(_0x534a88,_0x38d284){var _0x43bad6={'include':[{'model':db[_0x8388('0x44')],'as':'mandatoryDispositionPause'}]},_0x37c6bc={},_0x3fcefd={'count':0x0,'rows':[]};var _0x29ef80=_[_0x8388('0x45')](db[_0x8388('0x46')][_0x8388('0x47')],function(_0x18a13a){return{'name':_0x18a13a[_0x8388('0x48')],'type':_0x18a13a[_0x8388('0x49')][_0x8388('0x4a')]};});_0x37c6bc[_0x8388('0x4b')]=_['map'](_0x29ef80,_0x8388('0x41'));_0x37c6bc['query']=_['keys'](_0x534a88[_0x8388('0x4c')]);_0x37c6bc['filters']=_[_0x8388('0x4d')](_0x37c6bc[_0x8388('0x4b')],_0x37c6bc[_0x8388('0x4c')]);_0x43bad6['attributes']=_['intersection'](_0x37c6bc[_0x8388('0x4b')],qs[_0x8388('0x4e')](_0x534a88[_0x8388('0x4c')][_0x8388('0x4e')]));_0x43bad6[_0x8388('0x4f')]=_0x43bad6[_0x8388('0x4f')][_0x8388('0x50')]?_0x43bad6[_0x8388('0x4f')]:_0x37c6bc[_0x8388('0x4b')];if(!_0x534a88[_0x8388('0x4c')][_0x8388('0x51')](_0x8388('0x52'))){_0x43bad6[_0x8388('0x33')]=qs[_0x8388('0x33')](_0x534a88['query'][_0x8388('0x33')]);_0x43bad6[_0x8388('0x35')]=qs['offset'](_0x534a88[_0x8388('0x4c')][_0x8388('0x35')]);}_0x43bad6[_0x8388('0x53')]=qs[_0x8388('0x54')](_0x534a88['query'][_0x8388('0x54')]);_0x43bad6[_0x8388('0x55')]=qs['filters'](_[_0x8388('0x56')](_0x534a88['query'],_0x37c6bc[_0x8388('0x57')]),_0x29ef80);if(_0x534a88[_0x8388('0x4c')][_0x8388('0x58')]){_0x43bad6['where']=_[_0x8388('0x59')](_0x43bad6[_0x8388('0x55')],{'$or':_[_0x8388('0x45')](_0x29ef80,function(_0x1d4f4e){if(_0x1d4f4e['type']!==_0x8388('0x5a')){var _0x400677={};_0x400677[_0x1d4f4e['name']]={'$like':'%'+_0x534a88[_0x8388('0x4c')][_0x8388('0x58')]+'%'};return _0x400677;}})});}_0x43bad6=_[_0x8388('0x59')]({},_0x43bad6,_0x534a88[_0x8388('0x5b')]);var _0x4721c2={'where':_0x43bad6[_0x8388('0x55')]};return db[_0x8388('0x46')][_0x8388('0x36')](_0x4721c2)[_0x8388('0x23')](function(_0x344044){_0x3fcefd[_0x8388('0x36')]=_0x344044;if(_0x534a88['query']['includeAll']){_0x43bad6[_0x8388('0x5c')]=[{'all':!![]}];}return db[_0x8388('0x46')][_0x8388('0x5d')](_0x43bad6);})[_0x8388('0x23')](function(_0x3fbd03){_0x3fcefd[_0x8388('0x5e')]=_0x3fbd03;return _0x3fcefd;})['then'](respondWithFilteredResult(_0x38d284,_0x43bad6))[_0x8388('0x2e')](handleError(_0x38d284,null));};exports['show']=function(_0x342744,_0x406fc7){var _0x22e1eb={'raw':![],'where':{'id':_0x342744[_0x8388('0x5f')]['id']},'include':[{'model':db[_0x8388('0x44')],'as':_0x8388('0x60')}]},_0x20dc7d={};_0x20dc7d['model']=_['keys'](db[_0x8388('0x46')][_0x8388('0x47')]);_0x20dc7d[_0x8388('0x4c')]=_[_0x8388('0x61')](_0x342744[_0x8388('0x4c')]);_0x20dc7d[_0x8388('0x57')]=_[_0x8388('0x4d')](_0x20dc7d[_0x8388('0x4b')],_0x20dc7d[_0x8388('0x4c')]);_0x22e1eb['attributes']=_[_0x8388('0x4d')](_0x20dc7d[_0x8388('0x4b')],qs['fields'](_0x342744['query'][_0x8388('0x4e')]));_0x22e1eb['attributes']=_0x22e1eb[_0x8388('0x4f')][_0x8388('0x50')]?_0x22e1eb[_0x8388('0x4f')]:_0x20dc7d['model'];if(_0x342744['query']['includeAll']){_0x22e1eb[_0x8388('0x5c')]=[{'all':!![]}];}_0x22e1eb=_[_0x8388('0x59')]({},_0x22e1eb,_0x342744['options']);return db[_0x8388('0x46')][_0x8388('0x62')](_0x22e1eb)[_0x8388('0x23')](handleEntityNotFound(_0x406fc7,null))[_0x8388('0x23')](respondWithResult(_0x406fc7,null))[_0x8388('0x2e')](handleError(_0x406fc7,null));};exports[_0x8388('0x63')]=function(_0xa61e8c,_0x5ca3b5){return db['ChatWebsite'][_0x8388('0x63')](_0xa61e8c[_0x8388('0x64')],{})[_0x8388('0x23')](function(_0x25c7f4){var _0x411b9a=_0xa61e8c[_0x8388('0x65')]['get']({'plain':!![]});if(!_0x411b9a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x411b9a[_0x8388('0x66')]==='user'){var _0x4fd237=_0x25c7f4[_0x8388('0x3d')]({'plain':!![]});var _0x12225e=_0x8388('0x3e');return db[_0x8388('0x67')][_0x8388('0x62')]({'where':{'name':_0x12225e,'userProfileId':_0x411b9a[_0x8388('0x68')]},'raw':!![]})[_0x8388('0x23')](function(_0x5e5c2e){if(_0x5e5c2e&&_0x5e5c2e['autoAssociation']===0x0){return db[_0x8388('0x3f')][_0x8388('0x63')]({'name':_0x4fd237['name'],'resourceId':_0x4fd237['id'],'type':_0x5e5c2e['name'],'sectionId':_0x5e5c2e['id']},{})['then'](function(){return _0x25c7f4;});}else{return _0x25c7f4;}})[_0x8388('0x2e')](function(_0x539049){logger['error'](_0x8388('0x69'),_0x539049);throw _0x539049;});}return _0x25c7f4;})[_0x8388('0x23')](respondWithResult(_0x5ca3b5,0xc9))[_0x8388('0x2e')](handleError(_0x5ca3b5,null));};exports[_0x8388('0x3b')]=function(_0x5092d2,_0x49ae82){if(_0x5092d2[_0x8388('0x64')]['id']){delete _0x5092d2[_0x8388('0x64')]['id'];}return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x5092d2['params']['id']},'include':[{'model':db[_0x8388('0x44')],'as':_0x8388('0x60')}]})[_0x8388('0x23')](handleEntityNotFound(_0x49ae82,null))[_0x8388('0x23')](saveUpdates(_0x5092d2[_0x8388('0x64')],null))['then'](respondWithResult(_0x49ae82,null))['catch'](handleError(_0x49ae82,null));};exports['destroy']=function(_0x3dff75,_0x5ad91e){return db['ChatWebsite'][_0x8388('0x62')]({'where':{'id':_0x3dff75['params']['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x5ad91e,null))[_0x8388('0x23')](removeEntity(_0x5ad91e,null))[_0x8388('0x2e')](handleError(_0x5ad91e,null));};exports['describe']=function(_0xfc329b,_0x58b989){return db[_0x8388('0x46')]['describe']()[_0x8388('0x23')](respondWithResult(_0x58b989,null))[_0x8388('0x2e')](handleError(_0x58b989,null));};exports[_0x8388('0x6a')]=function(_0x11ebfd,_0x55e084,_0x10e0a4){if(_0x11ebfd[_0x8388('0x64')]['id']){delete _0x11ebfd[_0x8388('0x64')]['id'];}return db[_0x8388('0x46')]['find']({'where':{'id':_0x11ebfd[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x55e084,null))['then'](function(_0xd7c306){if(_0xd7c306){_0x11ebfd[_0x8388('0x64')]['ChatWebsiteId']=_0xd7c306['id'];return db[_0x8388('0x6b')][_0x8388('0x63')](_0x11ebfd[_0x8388('0x64')]);}})[_0x8388('0x23')](respondWithResult(_0x55e084,null))['catch'](handleError(_0x55e084,null));};exports[_0x8388('0x6c')]=function(_0x11c32c,_0x59a4a4,_0x4c49fd){var _0x278461={'raw':![],'where':{}};var _0x5f52fc={};var _0x217be8={'count':0x0,'rows':[]};return db[_0x8388('0x46')][_0x8388('0x6d')]({'where':{'id':_0x11c32c[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x59a4a4,null))[_0x8388('0x23')](function(_0x5a2e4e){if(_0x5a2e4e){_0x5f52fc[_0x8388('0x4b')]=_['keys'](db[_0x8388('0x6b')][_0x8388('0x47')]);_0x5f52fc[_0x8388('0x4c')]=_['keys'](_0x11c32c['query']);_0x5f52fc['filters']=_['intersection'](_0x5f52fc[_0x8388('0x4b')],_0x5f52fc['query']);_0x278461[_0x8388('0x4f')]=_[_0x8388('0x4d')](_0x5f52fc['model'],qs['fields'](_0x11c32c[_0x8388('0x4c')][_0x8388('0x4e')]));_0x278461[_0x8388('0x4f')]=_0x278461['attributes'][_0x8388('0x50')]?_0x278461[_0x8388('0x4f')]:_0x5f52fc[_0x8388('0x4b')];if(!_0x11c32c[_0x8388('0x4c')][_0x8388('0x51')](_0x8388('0x52'))){_0x278461['limit']=qs['limit'](_0x11c32c[_0x8388('0x4c')][_0x8388('0x33')]);_0x278461[_0x8388('0x35')]=qs[_0x8388('0x35')](_0x11c32c['query']['offset']);}_0x278461[_0x8388('0x53')]=qs[_0x8388('0x54')](_0x11c32c[_0x8388('0x4c')][_0x8388('0x54')]);_0x278461[_0x8388('0x55')]=qs[_0x8388('0x57')](_['pick'](_0x11c32c[_0x8388('0x4c')],_0x5f52fc[_0x8388('0x57')]));_0x278461[_0x8388('0x55')]['ChatWebsiteId']=_0x5a2e4e['id'];if(_0x11c32c[_0x8388('0x4c')][_0x8388('0x58')]){_0x278461[_0x8388('0x55')]=_[_0x8388('0x59')](_0x278461[_0x8388('0x55')],{'$or':_[_0x8388('0x45')](_0x278461[_0x8388('0x4f')],function(_0x40c55b){var _0x16660d={};_0x16660d[_0x40c55b]={'$like':'%'+_0x11c32c[_0x8388('0x4c')][_0x8388('0x58')]+'%'};return _0x16660d;})});}_0x278461=_[_0x8388('0x59')]({},_0x278461,_0x11c32c[_0x8388('0x5b')]);return db[_0x8388('0x6b')][_0x8388('0x36')]({'where':_0x278461['where']})[_0x8388('0x23')](function(_0x3d3941){_0x217be8[_0x8388('0x36')]=_0x3d3941;if(_0x11c32c[_0x8388('0x4c')][_0x8388('0x6e')]){_0x278461[_0x8388('0x5c')]=[{'all':!![]}];}return db['Disposition'][_0x8388('0x5d')](_0x278461);})['then'](function(_0x4bcbeb){_0x217be8[_0x8388('0x5e')]=_0x4bcbeb;return _0x217be8;});}})[_0x8388('0x23')](respondWithFilteredResult(_0x59a4a4,_0x278461))['catch'](handleError(_0x59a4a4,null));};exports[_0x8388('0x6f')]=function(_0x9f32a2,_0xe33968,_0x4322ef){return db[_0x8388('0x46')]['find']({'where':{'id':_0x9f32a2['params']['id']}})[_0x8388('0x23')](handleEntityNotFound(_0xe33968,null))['then'](function(_0x48f7e9){if(_0x48f7e9){return _0x48f7e9[_0x8388('0x6f')](_0x9f32a2[_0x8388('0x4c')]['ids']);}})[_0x8388('0x23')](respondWithStatusCode(_0xe33968,null))[_0x8388('0x2e')](handleError(_0xe33968,null));};exports[_0x8388('0x70')]=function(_0x3dbb75,_0x494445,_0x23e71d){if(_0x3dbb75['body']['id']){delete _0x3dbb75[_0x8388('0x64')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x3dbb75[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x494445,null))[_0x8388('0x23')](function(_0xcf8574){if(_0xcf8574){_0x3dbb75[_0x8388('0x64')]['ChatWebsiteId']=_0xcf8574['id'];return db['CannedAnswer']['create'](_0x3dbb75['body']);}})['then'](respondWithResult(_0x494445,null))[_0x8388('0x2e')](handleError(_0x494445,null));};exports[_0x8388('0x71')]=function(_0xb7531e,_0x19ceb3,_0x270ef0){var _0x3833d1={'raw':![],'where':{}};var _0x248ea1={};var _0xb23183={'count':0x0,'rows':[]};return db[_0x8388('0x46')][_0x8388('0x6d')]({'where':{'id':_0xb7531e[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x19ceb3,null))[_0x8388('0x23')](function(_0x4ffd9d){if(_0x4ffd9d){_0x248ea1[_0x8388('0x4b')]=_[_0x8388('0x61')](db[_0x8388('0x72')][_0x8388('0x47')]);_0x248ea1[_0x8388('0x4c')]=_[_0x8388('0x61')](_0xb7531e['query']);_0x248ea1['filters']=_['intersection'](_0x248ea1['model'],_0x248ea1[_0x8388('0x4c')]);_0x3833d1[_0x8388('0x4f')]=_[_0x8388('0x4d')](_0x248ea1[_0x8388('0x4b')],qs[_0x8388('0x4e')](_0xb7531e[_0x8388('0x4c')][_0x8388('0x4e')]));_0x3833d1[_0x8388('0x4f')]=_0x3833d1['attributes'][_0x8388('0x50')]?_0x3833d1['attributes']:_0x248ea1[_0x8388('0x4b')];if(!_0xb7531e[_0x8388('0x4c')][_0x8388('0x51')](_0x8388('0x52'))){_0x3833d1[_0x8388('0x33')]=qs[_0x8388('0x33')](_0xb7531e['query'][_0x8388('0x33')]);_0x3833d1[_0x8388('0x35')]=qs[_0x8388('0x35')](_0xb7531e[_0x8388('0x4c')][_0x8388('0x35')]);}_0x3833d1[_0x8388('0x53')]=qs['sort'](_0xb7531e[_0x8388('0x4c')]['sort']);_0x3833d1['where']=qs['filters'](_[_0x8388('0x56')](_0xb7531e[_0x8388('0x4c')],_0x248ea1[_0x8388('0x57')]));_0x3833d1[_0x8388('0x55')][_0x8388('0x73')]=_0x4ffd9d['id'];if(_0xb7531e['query'][_0x8388('0x58')]){_0x3833d1[_0x8388('0x55')]=_['merge'](_0x3833d1[_0x8388('0x55')],{'$or':_[_0x8388('0x45')](_0x3833d1['attributes'],function(_0x436366){var _0x41bcca={};_0x41bcca[_0x436366]={'$like':'%'+_0xb7531e[_0x8388('0x4c')]['filter']+'%'};return _0x41bcca;})});}_0x3833d1=_[_0x8388('0x59')]({},_0x3833d1,_0xb7531e[_0x8388('0x5b')]);return db[_0x8388('0x72')]['count']({'where':_0x3833d1[_0x8388('0x55')]})[_0x8388('0x23')](function(_0x3fb141){_0xb23183[_0x8388('0x36')]=_0x3fb141;if(_0xb7531e[_0x8388('0x4c')][_0x8388('0x6e')]){_0x3833d1[_0x8388('0x5c')]=[{'all':!![]}];}return db[_0x8388('0x72')][_0x8388('0x5d')](_0x3833d1);})[_0x8388('0x23')](function(_0x3678eb){_0xb23183[_0x8388('0x5e')]=_0x3678eb;return _0xb23183;});}})[_0x8388('0x23')](respondWithFilteredResult(_0x19ceb3,_0x3833d1))['catch'](handleError(_0x19ceb3,null));};exports[_0x8388('0x74')]=function(_0x587a10,_0x8fd885,_0x4c73af){return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x587a10[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x8fd885,null))[_0x8388('0x23')](function(_0x55050e){if(_0x55050e){return _0x55050e[_0x8388('0x74')](_0x587a10[_0x8388('0x4c')][_0x8388('0x75')]);}})['then'](respondWithStatusCode(_0x8fd885,null))[_0x8388('0x2e')](handleError(_0x8fd885,null));};exports['addLogo']=function(_0x6a7947,_0x5ad6a1,_0x16e342){_0x6a7947[_0x8388('0x64')]['sitepic']=_0x6a7947[_0x8388('0x76')][_0x8388('0x77')];return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x6a7947['params']['id']}})['then'](handleEntityNotFound(_0x5ad6a1,null))[_0x8388('0x23')](saveUpdates(_0x6a7947[_0x8388('0x64')],null))[_0x8388('0x23')](respondWithResult(_0x5ad6a1,null))['catch'](handleError(_0x5ad6a1,null));};exports[_0x8388('0x78')]=function(_0x22cab3,_0x4d0d99,_0x5bd2ee){_0x22cab3['body']['agentAvatar']=_0x22cab3['file']['filename'];return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x22cab3[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x4d0d99,null))[_0x8388('0x23')](saveUpdates(_0x22cab3[_0x8388('0x64')],null))['then'](respondWithResult(_0x4d0d99,null))[_0x8388('0x2e')](handleError(_0x4d0d99,null));};exports[_0x8388('0x79')]=function(_0x49b78b,_0x19d685,_0x163726){_0x49b78b[_0x8388('0x64')]['customerAvatar']=_0x49b78b[_0x8388('0x76')][_0x8388('0x77')];return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x49b78b[_0x8388('0x5f')]['id']}})['then'](handleEntityNotFound(_0x19d685,null))[_0x8388('0x23')](saveUpdates(_0x49b78b[_0x8388('0x64')],null))[_0x8388('0x23')](respondWithResult(_0x19d685,null))['catch'](handleError(_0x19d685,null));};exports[_0x8388('0x7a')]=function(_0x15b718,_0x35344a,_0x2b1590){_0x15b718['body'][_0x8388('0x7b')]=_0x15b718[_0x8388('0x76')]['filename'];return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x15b718['params']['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x35344a,null))[_0x8388('0x23')](saveUpdates(_0x15b718[_0x8388('0x64')],null))[_0x8388('0x23')](respondWithResult(_0x35344a,null))[_0x8388('0x2e')](handleError(_0x35344a,null));};exports['getLogo']=function(_0x388843,_0x53e7e8,_0x261b04){var _0x467de3=path[_0x8388('0x7c')](config['root'],_0x8388('0x7d'));var _0x34b851={'where':{'id':_0x388843[_0x8388('0x5f')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1bcb0c=![];return require(_0x8388('0x7e'))[_0x8388('0x7f')]()[_0x8388('0x23')](function(_0x50b3e6){if(_0x50b3e6){_0x1bcb0c=_0x50b3e6[_0x8388('0x80')];}})[_0x8388('0x23')](function(){return db['ChatWebsite']['find'](_0x34b851);})[_0x8388('0x23')](handleEntityNotFound(_0x53e7e8,null))['then'](function(_0x36469d){if(_0x36469d){if(!_[_0x8388('0x81')](_0x36469d[_0x8388('0x82')])){if(fs['existsSync'](path[_0x8388('0x7c')](config[_0x8388('0x83')],_0x8388('0x84'),_0x36469d['sitepic']))&&_0x1bcb0c){_0x467de3=path[_0x8388('0x7c')](config[_0x8388('0x83')],_0x8388('0x84'),_0x36469d[_0x8388('0x82')]);}}return _0x53e7e8[_0x8388('0x85')](_0x467de3);}})[_0x8388('0x2e')](handleError(_0x53e7e8,null));};exports[_0x8388('0x86')]=function(_0x4255e3,_0x3413fb,_0x57502d){var _0x5cdfa0=path['join'](config['root'],_0x8388('0x87'));var _0x1e41b1={'where':{'id':_0x4255e3[_0x8388('0x5f')]['id']},'attributes':['id',_0x8388('0x88')],'raw':!![]};return db['ChatWebsite'][_0x8388('0x62')](_0x1e41b1)[_0x8388('0x23')](handleEntityNotFound(_0x3413fb,null))[_0x8388('0x23')](function(_0x31ade1){if(_0x31ade1){if(!_['isNil'](_0x31ade1[_0x8388('0x88')])){if(fs[_0x8388('0x89')](path[_0x8388('0x7c')](config[_0x8388('0x83')],'server/files/images/avatars/',_0x31ade1[_0x8388('0x88')]))){_0x5cdfa0=path[_0x8388('0x7c')](config[_0x8388('0x83')],_0x8388('0x8a'),_0x31ade1[_0x8388('0x88')]);}}return _0x3413fb[_0x8388('0x85')](_0x5cdfa0);}})[_0x8388('0x2e')](handleError(_0x3413fb,null));};exports[_0x8388('0x8b')]=function(_0x440f0a,_0x24d316,_0xf95230){var _0x1e2925=path[_0x8388('0x7c')](config['root'],_0x8388('0x8c'));var _0x256c55={'where':{'id':_0x440f0a['params']['id']},'attributes':['id',_0x8388('0x8d'),'showCustomerAvatar'],'raw':!![]};return db[_0x8388('0x46')][_0x8388('0x62')](_0x256c55)[_0x8388('0x23')](handleEntityNotFound(_0x24d316,null))[_0x8388('0x23')](function(_0x2ef1e0){if(_0x2ef1e0){if(!_[_0x8388('0x81')](_0x2ef1e0[_0x8388('0x8d')])){if(fs[_0x8388('0x89')](path['join'](config[_0x8388('0x83')],_0x8388('0x8a'),_0x2ef1e0[_0x8388('0x8d')]))&&_0x2ef1e0[_0x8388('0x8e')]){_0x1e2925=path[_0x8388('0x7c')](config['root'],_0x8388('0x8a'),_0x2ef1e0[_0x8388('0x8d')]);}}return _0x24d316[_0x8388('0x85')](_0x1e2925);}})[_0x8388('0x2e')](handleError(_0x24d316,null));};exports[_0x8388('0x8f')]=function(_0x1b6290,_0x47ca7a,_0x32ce24){var _0x3e186a=path[_0x8388('0x7c')](config[_0x8388('0x83')],_0x8388('0x90'));var _0x50ffc8={'where':{'id':_0x1b6290[_0x8388('0x5f')]['id']},'attributes':['id',_0x8388('0x7b')],'raw':!![]};return db[_0x8388('0x46')][_0x8388('0x62')](_0x50ffc8)[_0x8388('0x23')](handleEntityNotFound(_0x47ca7a,null))[_0x8388('0x23')](function(_0x581440){if(_0x581440){if(!_[_0x8388('0x81')](_0x581440['systemAvatar'])){if(fs[_0x8388('0x89')](path[_0x8388('0x7c')](config['root'],_0x8388('0x8a'),_0x581440['systemAvatar']))){_0x3e186a=path[_0x8388('0x7c')](config[_0x8388('0x83')],_0x8388('0x8a'),_0x581440['systemAvatar']);}}return _0x47ca7a['download'](_0x3e186a);}})[_0x8388('0x2e')](handleError(_0x47ca7a,null));};exports['notify']=function(_0x46fd80,_0x1f09f0,_0x1c0056){var _0x1c09e4=require('user-agent-parser');var _0x5564d5=new _0x1c09e4();var _0x2b5d93=_0x5564d5[_0x8388('0x91')](_0x46fd80[_0x8388('0x92')]['user-agent'])[_0x8388('0x93')]();var _0x2bf2c8={'body':_0x46fd80[_0x8388('0x64')],'channel':_0x8388('0x94')};var _0x2aa5c5=[];var _0x3916ed=[];var _0x3a4cfa={};var _0x45db28=![];return db[_0x8388('0x95')][_0x8388('0x96')]()[_0x8388('0x23')](function(_0x5237e3){if(!_0x5237e3){throw new db[(_0x8388('0x97'))][(_0x8388('0x98'))]('no\x20available\x20attributes');}_0x2aa5c5=_[_0x8388('0x99')](_[_0x8388('0x61')](_0x5237e3),[_0x8388('0x9a'),'updatedAt']);_0x3916ed=_['difference'](_['keys'](_0x5237e3),[_0x8388('0x9a'),'updatedAt',_0x8388('0x9b'),_0x8388('0x9c')]);if(_0x46fd80['body']['id']){delete _0x46fd80['body']['id'];}if(_[_0x8388('0x81')](_0x46fd80[_0x8388('0x64')]['from'])){throw new db[(_0x8388('0x97'))][(_0x8388('0x98'))](_0x8388('0x9d'));}if(_[_0x8388('0x81')](_0x46fd80[_0x8388('0x64')][_0x8388('0x64')])||_0x46fd80['body']['body']===''){throw new db[(_0x8388('0x97'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x46fd80[_0x8388('0x64')][_0x8388('0x9e')])){throw new db[(_0x8388('0x97'))][(_0x8388('0x98'))](_0x8388('0x9f')+_0x3916ed);}if(!_['includes'](_0x3916ed,_0x46fd80[_0x8388('0x64')][_0x8388('0x9e')])){throw new db[(_0x8388('0x97'))][(_0x8388('0x98'))](_0x8388('0xa0')+_0x3916ed);}_0x3a4cfa[_0x46fd80[_0x8388('0x64')][_0x8388('0x9e')]]=_0x46fd80[_0x8388('0x64')][_0x8388('0xa1')];})[_0x8388('0x23')](function(){return db[_0x8388('0x46')]['find']({'where':{'id':_0x46fd80[_0x8388('0x5f')]['id']},'include':[{'model':db[_0x8388('0xa2')],'as':'List','include':[{'model':db[_0x8388('0x95')],'as':'Contacts','where':_0x3a4cfa,'limit':0x1,'order':[[_0x8388('0xa3'),_0x8388('0xa4')]]}]},{'model':db[_0x8388('0xa5')],'as':_0x8388('0xa6')}]});})[_0x8388('0x23')](handleEntityNotFound(_0x1f09f0,null))['then'](function(_0x3cf240){if(_0x3cf240&&_0x3cf240[_0x8388('0xa7')]){_0x2bf2c8[_0x8388('0xa8')]=_0x3cf240;_0x2bf2c8[_0x8388('0xa9')]=_0x3cf240['Applications'];_0x2bf2c8[_0x8388('0xaa')]=_0x3cf240[_0x8388('0xa7')];_0x2bf2c8['applications']=_['orderBy'](_0x2bf2c8[_0x8388('0xa9')],[_0x8388('0xab')],[_0x8388('0xac')]);if(_0x2bf2c8[_0x8388('0xa8')][_0x8388('0xa6')]){delete _0x2bf2c8[_0x8388('0xa8')][_0x8388('0xa6')];}if(_0x2bf2c8['account'][_0x8388('0xa7')]&&_0x2bf2c8['account']['List'][_0x8388('0xad')][_0x8388('0x50')]){return _0x2bf2c8[_0x8388('0xa8')][_0x8388('0xa7')][_0x8388('0xad')][0x0];}var _0xc34c3a=_[_0x8388('0x1b')](_0x46fd80[_0x8388('0x64')],{'firstName':_0x46fd80['body'][_0x8388('0xa1')],'ListId':_0x3cf240[_0x8388('0x9c')]});_0xc34c3a[_0x46fd80[_0x8388('0x64')][_0x8388('0x9e')]]=_0x46fd80['body'][_0x8388('0xa1')];return db[_0x8388('0x95')][_0x8388('0x63')](_0xc34c3a,{'fields':_0x2aa5c5,'raw':!![]});}})[_0x8388('0x23')](handleEntityNotFound(_0x1f09f0,null))[_0x8388('0x23')](function(_0x4f2416){_0x2bf2c8[_0x8388('0xae')]=_0x4f2416;var _0x46b8aa=_0x46fd80[_0x8388('0x64')][_0x8388('0xaf')];if(_0x46fd80[_0x8388('0x92')][_0x8388('0xb0')]){_0x46b8aa=_0x46fd80[_0x8388('0x92')][_0x8388('0xb0')];}else if(_0x46fd80[_0x8388('0x92')]['x-forwarded-for']){_0x46b8aa=_[_0x8388('0xb1')](_0x46fd80[_0x8388('0x92')]['x-forwarded-for'][_0x8388('0xb2')](','));}if(_0x4f2416){var _0x136a89={'ContactId':_0x4f2416['id'],'ChatWebsiteId':_0x46fd80[_0x8388('0x5f')]['id'],'from':(_0x4f2416[_0x8388('0xb3')]||'')+'\x20'+(_0x4f2416['lastName']||''),'customerIp':_0x46b8aa,'customerPort':_0x46fd80[_0x8388('0x92')][_0x8388('0xb4')]?_0x46fd80[_0x8388('0x92')][_0x8388('0xb4')]:null,'referer':_0x46fd80[_0x8388('0x64')][_0x8388('0xb5')],'browserName':_0x2b5d93[_0x8388('0xb6')][_0x8388('0x41')]&&_0x2b5d93[_0x8388('0xb6')][_0x8388('0xb7')]?util[_0x8388('0xb8')](_0x8388('0xb9'),_0x2b5d93[_0x8388('0xb6')]['name'],_0x2b5d93[_0x8388('0xb6')][_0x8388('0xb7')]):_0x8388('0xba'),'browserVersion':_0x2b5d93[_0x8388('0xb6')][_0x8388('0xb7')]||'unknown','osName':util[_0x8388('0xb8')](_0x8388('0xb9'),_0x2b5d93['os']['name'],_0x2b5d93['os'][_0x8388('0xb7')]),'osVersion':_0x2b5d93['os'][_0x8388('0xb7')],'deviceModel':_0x2b5d93[_0x8388('0xbb')][_0x8388('0x4b')]&&_0x2b5d93[_0x8388('0xbb')][_0x8388('0xbc')]?util['format'](_0x8388('0xbd'),_0x2b5d93[_0x8388('0xbb')][_0x8388('0x4b')],_0x2b5d93[_0x8388('0xbb')][_0x8388('0xbc')],_0x2b5d93[_0x8388('0xbb')][_0x8388('0x49')]):null,'deviceVendor':_0x2b5d93[_0x8388('0xbb')][_0x8388('0xbc')],'deviceType':_0x2b5d93[_0x8388('0xbb')][_0x8388('0x49')],'formData':JSON[_0x8388('0x29')](_0x46fd80[_0x8388('0x64')])};var _0x15889c={'ChatWebsiteId':_0x46fd80[_0x8388('0x5f')]['id'],'closed':![]};if(_0x46fd80['body'][_0x8388('0xbe')]){_0x15889c[_0x8388('0xbe')]=_0x46fd80[_0x8388('0x64')][_0x8388('0xbe')];return db['ChatInteraction'][_0x8388('0x62')]({'where':_0x15889c})[_0x8388('0x23')](function(_0x2f8468){if(_0x2f8468){return[_0x2f8468,![]];}_0x136a89[_0x8388('0xbe')]=_0x46fd80[_0x8388('0x64')][_0x8388('0xbe')];_0x136a89[_0x8388('0xbf')]=_0x46fd80[_0x8388('0x64')][_0x8388('0xbf')];return db[_0x8388('0xc0')]['create'](_0x136a89)[_0x8388('0x23')](function(_0x4ee75f){return[_0x4ee75f,!![]];});});}_0x15889c[_0x8388('0xc1')]=_0x4f2416['id'];if(_0x46fd80[_0x8388('0x64')]['interaction']&&_0x46fd80['body']['interaction']['id']){_0x15889c['id']=_0x46fd80['body'][_0x8388('0xc2')]['id'];return db['ChatInteraction'][_0x8388('0x62')]({'where':_0x15889c})[_0x8388('0x23')](function(_0x19b2df){if(_0x19b2df){return[_0x19b2df,![]];}return db[_0x8388('0xc0')][_0x8388('0x63')](_0x136a89)['then'](function(_0x2d5828){return[_0x2d5828,!![]];});});}return db[_0x8388('0xc0')][_0x8388('0x63')](_0x136a89)[_0x8388('0x23')](function(_0x3fb0a3){return[_0x3fb0a3,!![]];});}})[_0x8388('0xc3')](function(_0x353c8d,_0x1215c5){if(_0x353c8d){_0x45db28=_0x1215c5;if(!_0x1215c5){var _0xa271b3={'from':(_0x2bf2c8['contact']['firstName']||'')+'\x20'+(_0x2bf2c8['contact']['lastName']||'')};if(_0x46fd80[_0x8388('0x64')][_0x8388('0xbe')]&&_0x46fd80['body']['messageId']&&_0x46fd80[_0x8388('0x64')][_0x8388('0xbe')]!=_0x46fd80[_0x8388('0x64')][_0x8388('0xc4')]){_0xa271b3[_0x8388('0xbe')]=_0x46fd80['body'][_0x8388('0xc4')];}return _0x353c8d['update'](_0xa271b3);}else{return _0x353c8d;}}})['then'](function(_0x3d4fc5){_0x2bf2c8[_0x8388('0xc2')]=_0x3d4fc5[_0x8388('0x3d')]({'plain':!![]});_0x2bf2c8[_0x8388('0xc2')]['created']=_0x45db28;if(_0x2bf2c8[_0x8388('0xc2')]['created']){if(_0x2bf2c8[_0x8388('0xa8')]['autoclose']){_0x2bf2c8[_0x8388('0xa9')][_0x8388('0xc5')]({'id':0x0,'priority':_0x2bf2c8[_0x8388('0xa9')]['length']+0x1,'app':_0x8388('0xc6'),'appdata':_0x8388('0xc7'),'interval':_0x8388('0xc8')});}}return db['ChatMessage'][_0x8388('0x63')]({'body':_0x46fd80[_0x8388('0x64')][_0x8388('0x64')],'ChatWebsiteId':_0x46fd80['params']['id'],'ChatInteractionId':_0x3d4fc5['id'],'direction':'in','ContactId':_0x2bf2c8['contact']['id'],'AttachmentId':_0x46fd80['body'][_0x8388('0xc9')]});})[_0x8388('0x23')](function(_0x1fb63e){_0x2bf2c8[_0x8388('0x2c')]=_0x1fb63e;if(_0x2bf2c8['interaction'][_0x8388('0xca')]){return db['User'][_0x8388('0x62')]({'attributes':['id','name'],'where':{'id':_0x2bf2c8[_0x8388('0xc2')]['UserId']}})[_0x8388('0x23')](function(_0x27e9f6){if(_0x27e9f6){_0x2bf2c8['applications'][_0x8388('0xcb')]({'id':0x0,'priority':0x0,'app':_0x8388('0xcc'),'appdata':_0x27e9f6[_0x8388('0x41')]+','+(_0x2bf2c8[_0x8388('0xa8')][_0x8388('0xcd')]||0xa),'interval':_0x8388('0xc8')});_0x2bf2c8[_0x8388('0xce')]=!![];}return respondWithRpcPromise(_0x8388('0xcf'),_0x8388('0xd0'),_0x2bf2c8);});}return respondWithRpcPromise(_0x8388('0xcf'),_0x8388('0xd0'),_0x2bf2c8);})['then'](function(_0x51ec7a){respondWithRpcPromise(_0x8388('0xd1'),_0x8388('0xd1'),{'event':_0x8388('0xd2'),'message':_0x51ec7a},client9002);return _0x51ec7a;})[_0x8388('0x23')](respondWithResult(_0x1f09f0,null))[_0x8388('0x2e')](handleError(_0x1f09f0,null));};exports[_0x8388('0xd3')]=function(_0x5c0df5,_0x41c463,_0x374992){var _0x2b8e47,_0x4ac65a,_0x52d7f4;var _0x4fe98d=[];var _0x3b4676=[];var _0x368fcb={};var _0x13a39e=_0x5c0df5[_0x8388('0xd4')]||[];var _0x491982=[];var _0x5eaeb0;return db[_0x8388('0x95')][_0x8388('0x96')]()[_0x8388('0x23')](function(_0x110356){if(!_0x110356){throw new db[(_0x8388('0x97'))][(_0x8388('0x98'))](_0x8388('0xd5'));}_0x3b4676=_[_0x8388('0x99')](_[_0x8388('0x61')](_0x110356),[_0x8388('0x9a'),'updatedAt']);_0x4fe98d=_[_0x8388('0x99')](_[_0x8388('0x61')](_0x110356),[_0x8388('0x9a'),'updatedAt',_0x8388('0x9b'),'ListId']);if(_0x5c0df5['body']['id']){delete _0x5c0df5['body']['id'];}if(_[_0x8388('0x81')](_0x5c0df5[_0x8388('0x64')]['from'])){throw _0x41c463['status'](0x1f4)[_0x8388('0x42')](new db[(_0x8388('0x97'))]['ValidationError'](_0x8388('0x9d')));}if(_[_0x8388('0x81')](_0x5c0df5[_0x8388('0x64')][_0x8388('0x64')])||_0x5c0df5[_0x8388('0x64')][_0x8388('0x64')]===''){throw _0x41c463[_0x8388('0x30')](0x1f4)[_0x8388('0x42')](new db[(_0x8388('0x97'))][(_0x8388('0x98'))](_0x8388('0xd6')));}if(_['isNil'](_0x5c0df5[_0x8388('0x64')]['mapKeyOffline'])){throw _0x41c463[_0x8388('0x30')](0x1f4)[_0x8388('0x42')](new db[(_0x8388('0x97'))][(_0x8388('0x98'))](_0x8388('0xd7')+_0x4fe98d));}if(!_['includes'](_0x4fe98d,_0x5c0df5['body'][_0x8388('0xd8')])){throw _0x41c463[_0x8388('0x30')](0x1f4)[_0x8388('0x42')](new db[(_0x8388('0x97'))][(_0x8388('0x98'))](_0x8388('0xd9')+_0x4fe98d));}_0x368fcb[_0x5c0df5[_0x8388('0x64')][_0x8388('0xd8')]]=_0x5c0df5[_0x8388('0x64')][_0x8388('0xa1')];})[_0x8388('0x23')](function(){return db['ChatWebsite'][_0x8388('0x62')]({'where':{'id':_0x5c0df5[_0x8388('0x5f')]['id']},'include':[{'model':db[_0x8388('0xa2')],'as':_0x8388('0xa7')},{'model':db[_0x8388('0xda')],'as':_0x8388('0xda')}]});})[_0x8388('0x23')](handleEntityNotFound(_0x41c463,null))['then'](function(_0x3cd0c0){if(_0x3cd0c0&&_0x3cd0c0[_0x8388('0xa7')]){_0x4ac65a=_0x3cd0c0;var _0x2ff8ca=_[_0x8388('0x1b')](_0x5c0df5[_0x8388('0x64')],{'firstName':_0x5c0df5[_0x8388('0x64')][_0x8388('0xa1')],'phone':_0x5c0df5[_0x8388('0x64')]['from'],'ListId':_0x3cd0c0['ListId']});_0x2ff8ca[_0x5c0df5[_0x8388('0x64')][_0x8388('0xd8')]]=_0x5c0df5[_0x8388('0x64')][_0x8388('0xa1')];return db[_0x8388('0x95')][_0x8388('0xdb')]({'where':_0x368fcb,'defaults':_0x2ff8ca});}})[_0x8388('0xc3')](function(_0x46ca6b){if(_0x46ca6b){_0x52d7f4=_0x46ca6b;var _0x5e017e=fs[_0x8388('0xdc')](path[_0x8388('0x7c')](config[_0x8388('0x83')],_0x8388('0xdd')),_0x8388('0xde'));var _0x529890=ejs['render'](_0x5e017e,{'body':_[_0x8388('0xdf')](_0x5c0df5[_0x8388('0x64')][_0x8388('0x64')]),'bodyTitle':_0x4ac65a[_0x8388('0xe0')]});return db[_0x8388('0xe1')][_0x8388('0x63')]({'body':_0x529890,'ContactId':_0x46ca6b['id'],'ChatWebsiteId':_0x4ac65a['id']});}})[_0x8388('0x23')](function(_0x290246){_0x5eaeb0=_0x290246;if(_0x13a39e[_0x8388('0x50')]){var _0x245d7f=_0x13a39e[_0x8388('0x45')](function(_0x24e06b){return{'name':_0x24e06b[_0x8388('0xe2')],'basename':_0x24e06b[_0x8388('0x77')],'type':_0x24e06b[_0x8388('0xe3')],'ChatOfflineMessageId':_0x290246['id']};});_0x491982=_0x245d7f['map'](_0x5763e5=>{var _0x2a2a24={'filename':_0x5763e5[_0x8388('0x41')],'path':path[_0x8388('0x7c')](config['root'],_0x8388('0xe4'),'files',_0x8388('0xe5'),'offline-chat',_0x5763e5[_0x8388('0xe6')])};return _0x2a2a24;});if(!_0x4ac65a[_0x8388('0xe7')]){return db[_0x8388('0xe8')][_0x8388('0xe9')](function(_0x3cf95e){return db[_0x8388('0xea')][_0x8388('0xeb')](_0x245d7f,{'transaction':_0x3cf95e});});}}})[_0x8388('0x23')](function(){if(_0x5eaeb0){_0x2b8e47=_0x5eaeb0;return db[_0x8388('0xda')][_0x8388('0x6d')]({'where':{'active':!![]},'include':[{'model':db[_0x8388('0xec')],'as':'Smtp','raw':!![]}]});}})[_0x8388('0x23')](function(_0x42e67f){if(_0x42e67f&&_0x42e67f['Smtp']&&_0x4ac65a[_0x8388('0xed')]&&_0x4ac65a[_0x8388('0xee')]){var _0x312db9={'tls':{'rejectUnauthorized':![]}};if(_0x42e67f['Smtp'][_0x8388('0xef')]){_0x312db9['service']=_0x42e67f[_0x8388('0xf0')]['service'];}else{_0x312db9['host']=_0x42e67f[_0x8388('0xf0')][_0x8388('0xf1')];_0x312db9['port']=_0x42e67f[_0x8388('0xf0')][_0x8388('0xf2')];_0x312db9[_0x8388('0xf3')]=_0x42e67f[_0x8388('0xf0')][_0x8388('0xf3')];}if(_0x42e67f['Smtp']['authentication']){_0x312db9[_0x8388('0xf4')]={'user':_0x42e67f[_0x8388('0xf0')][_0x8388('0x65')],'pass':_0x42e67f[_0x8388('0xf0')][_0x8388('0xf5')]};}return respondWithRpcPromise(_0x8388('0xf6'),_0x8388('0xf7'),{'account':_0x312db9,'message':{'from':util['format'](_0x8388('0xf8'),_0x42e67f[_0x8388('0x41')],_0x42e67f[_0x8388('0xf9')]||_0x42e67f[_0x8388('0xf0')][_0x8388('0x65')]),'to':_0x4ac65a[_0x8388('0xee')],'subject':_0x4ac65a[_0x8388('0xfa')],'html':_0x2b8e47[_0x8388('0x64')],'attachments':_0x491982}},client9003)['then'](function(){return _0x2b8e47;})[_0x8388('0x2e')](function(_0x23b83d){console[_0x8388('0x2a')](_0x23b83d);});}})[_0x8388('0x23')](function(){if(_0x4ac65a&&_0x4ac65a['openNewInteraction']&&_0x4ac65a[_0x8388('0xfb')]){var _0x39d9cd=[];if(_0x13a39e['length']){_0x39d9cd=_0x13a39e[_0x8388('0x45')](function(_0x262514){return{'name':_0x262514[_0x8388('0xe2')],'basename':_0x262514['filename'],'type':_0x262514['mimetype'],'ChatOfflineMessageId':_0x5eaeb0['id']};});}var _0x1f7f8a;if(!_[_0x8388('0x81')](_0x4ac65a[_0x8388('0xfc')])){var _0x5292c5=_['map'](_0x5c0df5[_0x8388('0x64')],function(_0x203851){return _0x203851;});var _0x26ad93=_[_0x8388('0xfd')](_0x5292c5)[0x0];var _0x530ec3=_[_0x8388('0xfe')](_0x26ad93,function(_0x35f341){return _0x35f341;});_0x1f7f8a=_0x530ec3[0x1][_0x4ac65a[_0x8388('0xfc')]];}var _0x42537f={'from':_0x52d7f4['email'],'firstName':_0x52d7f4[_0x8388('0xb3')],'lastName':_0x52d7f4[_0x8388('0xff')],'mapKey':_0x8388('0xf9'),'message':{'from':_0x52d7f4['email'],'to':_0x4ac65a[_0x8388('0xda')][_0x8388('0xf9')],'cc':'','subject':_[_0x8388('0x81')](_0x1f7f8a)?_0x4ac65a[_0x8388('0xfa')]:_0x1f7f8a,'messageId':'','sentAt':new Date(),'attach':_0x39d9cd[_0x8388('0x50')],'attachments':_0x39d9cd,'originChannel':_0x8388('0x100'),'ChatWebsiteId':_0x4ac65a['id'],'ChatOfflineMessageId':_0x2b8e47['id'],'originTo':_0x4ac65a[_0x8388('0xda')][_0x8388('0xf9')]},'body':_0x2b8e47[_0x8388('0x64')]};var _0x2a6298={'account':{'id':_0x4ac65a[_0x8388('0xfb')]},'body':_0x42537f,'log':_0x8388('0x101')};return respondWithRpcPromise(_0x8388('0x101'),_0x8388('0x102'),_0x2a6298,client9001)[_0x8388('0x23')](function(){return _0x2b8e47;})[_0x8388('0x2e')](function(_0x182fb3){console[_0x8388('0x2a')](_0x182fb3);});}return;})[_0x8388('0x23')](function(){if(_0x2b8e47){return _0x2b8e47;}})[_0x8388('0x23')](respondWithResult(_0x41c463,null))[_0x8388('0x2e')](function(_0x4de218){console[_0x8388('0x2a')](_0x8388('0x2e'),_0x4de218);for(var _0x15c640 of _0x13a39e){var _0x2bd127=path[_0x8388('0x7c')](config[_0x8388('0x83')],_0x8388('0xe4'),'files',_0x8388('0xe5'),'offline-chat',_0x15c640[_0x8388('0x77')]);fs_extra[_0x8388('0x103')](_0x2bd127)['catch'](function(_0x252024){console['error']('Could\x20not\x20remove\x20attachment\x20file',_0x2bd127,_0x252024);});}});};exports[_0x8388('0x104')]=function(_0x111a13,_0x5ab21a,_0x3e1da4){return db['ChatInteraction'][_0x8388('0x62')]({'where':{'id':_0x111a13[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x5ab21a,null))[_0x8388('0x23')](function(_0x16411c){if(_0x16411c){return _0x16411c[_0x8388('0x104')](_0x111a13[_0x8388('0x64')][_0x8388('0x75')],_[_0x8388('0x105')](_0x111a13[_0x8388('0x64')],['ids','id'])||{});}})[_0x8388('0x23')](respondWithResult(_0x5ab21a,null))[_0x8388('0x2e')](handleError(_0x5ab21a,null));};exports['getInteractions']=function(_0x4de571,_0x3153d4,_0xcc34c7){var _0x368aa7={'raw':![],'where':{}};var _0x1a6e97={};var _0x299769={'count':0x0,'rows':[]};return db[_0x8388('0x46')][_0x8388('0x6d')]({'where':{'id':_0x4de571[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x3153d4,null))[_0x8388('0x23')](function(_0x1c3b01){if(_0x1c3b01){_0x1a6e97[_0x8388('0x4b')]=_[_0x8388('0x61')](db[_0x8388('0xc0')][_0x8388('0x47')]);_0x1a6e97['query']=_[_0x8388('0x61')](_0x4de571['query']);_0x1a6e97[_0x8388('0x57')]=_['intersection'](_0x1a6e97[_0x8388('0x4b')],_0x1a6e97[_0x8388('0x4c')]);_0x368aa7[_0x8388('0x4f')]=_[_0x8388('0x4d')](_0x1a6e97[_0x8388('0x4b')],qs[_0x8388('0x4e')](_0x4de571[_0x8388('0x4c')][_0x8388('0x4e')]));_0x368aa7[_0x8388('0x4f')]=_0x368aa7[_0x8388('0x4f')][_0x8388('0x50')]?_0x368aa7[_0x8388('0x4f')]:_0x1a6e97[_0x8388('0x4b')];if(!_0x4de571[_0x8388('0x4c')]['hasOwnProperty'](_0x8388('0x52'))){_0x368aa7[_0x8388('0x33')]=qs[_0x8388('0x33')](_0x4de571[_0x8388('0x4c')][_0x8388('0x33')]);_0x368aa7[_0x8388('0x35')]=qs[_0x8388('0x35')](_0x4de571[_0x8388('0x4c')][_0x8388('0x35')]);}_0x368aa7[_0x8388('0x53')]=qs['sort'](_0x4de571[_0x8388('0x4c')][_0x8388('0x54')]);_0x368aa7[_0x8388('0x55')]=qs[_0x8388('0x57')](_[_0x8388('0x56')](_0x4de571[_0x8388('0x4c')],_0x1a6e97[_0x8388('0x57')]));_0x368aa7['where']['ChatWebsiteId']=_0x1c3b01['id'];if(_0x4de571['query']['filter']){_0x368aa7[_0x8388('0x55')]=_[_0x8388('0x59')](_0x368aa7[_0x8388('0x55')],{'$or':_[_0x8388('0x45')](_0x368aa7[_0x8388('0x4f')],function(_0x439648){var _0x4ac133={};_0x4ac133[_0x439648]={'$like':'%'+_0x4de571['query'][_0x8388('0x58')]+'%'};return _0x4ac133;})});}_0x368aa7=_[_0x8388('0x59')]({},_0x368aa7,_0x4de571[_0x8388('0x5b')]);return db[_0x8388('0xc0')][_0x8388('0x36')]({'where':_0x368aa7[_0x8388('0x55')]})[_0x8388('0x23')](function(_0x22e61e){_0x299769['count']=_0x22e61e;if(_0x4de571['query']['includeAll']){_0x368aa7[_0x8388('0x5c')]=[{'model':db[_0x8388('0x95')],'as':_0x8388('0x106'),'required':![]},{'model':db[_0x8388('0x107')],'as':'Owner','attributes':[_0x8388('0x41'),'fullname',_0x8388('0x108')],'required':![]},{'model':db['Tag'],'as':_0x8388('0x109'),'attributes':['id',_0x8388('0x41'),_0x8388('0x10a')],'where':_0x4de571[_0x8388('0x4c')][_0x8388('0x10b')]?{'id':_0x4de571[_0x8388('0x4c')]['tag']}:undefined,'required':_0x4de571[_0x8388('0x4c')][_0x8388('0x10b')]?!![]:![]}];}return db[_0x8388('0xc0')][_0x8388('0x5d')](_0x368aa7);})['then'](function(_0x59e482){_0x299769['rows']=_0x59e482;return _0x299769;});}})[_0x8388('0x23')](respondWithFilteredResult(_0x3153d4,_0x368aa7))[_0x8388('0x2e')](handleError(_0x3153d4,null));};function iftimePromise(_0x300da9,_0x275f07){return respondWithRpcPromise(_0x8388('0x10c'),_0x8388('0x10d'),{'command':_0x275f07['timezone']?util['format'](_0x8388('0x10e'),_0x300da9[_0x8388('0x10f')],_0x275f07[_0x8388('0x110')]):util[_0x8388('0xb8')](_0x8388('0x111'),_0x300da9[_0x8388('0x10f')])},client9002)[_0x8388('0x23')](function(_0x5905ce){var _0x318456=_0x5905ce&&_0x5905ce[_0x8388('0x112')](_0x8388('0x113'))>=0x0?!![]:![];logger[_0x8388('0x24')](_0x8388('0x114'),_0x275f07['id'],_0x300da9['id'],_0x300da9[_0x8388('0x10f')],_0x318456?_0x8388('0x115'):_0x8388('0x116'),_0x275f07['timezone']?_0x275f07[_0x8388('0x110')]:_0x8388('0x117'));return _0x318456;})['catch'](function(_0x5f2f1){logger[_0x8388('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x275f07['id'],_0x300da9['id'],_0x300da9[_0x8388('0x10f')],util[_0x8388('0x118')](_0x5f2f1,{'showHidden':![],'depth':null}),_0x275f07[_0x8388('0x110')]?_0x275f07[_0x8388('0x110')]:'No\x20timezone');return![];});}exports[_0x8388('0x10d')]=function(_0x1a49fe,_0x576527,_0x393a01){var _0xc933dd=0x0;var _0x842f85=0x0;var _0x2573b9=![];var _0x4daadd;var _0x2fb2e4;return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x1a49fe[_0x8388('0x5f')]['id']},'include':[{'model':db[_0x8388('0x119')],'as':_0x8388('0x119'),'include':[{'model':db[_0x8388('0x119')],'as':_0x8388('0x11a'),'attributes':['id',_0x8388('0x10f')],'raw':!![]}]}]})[_0x8388('0x23')](handleEntityNotFound(_0x576527,null))[_0x8388('0x23')](function(_0x9ae9af){if(_0x9ae9af){_0x4daadd=_0x9ae9af;return _0x9ae9af['getProactiveActions']({'raw':!![]});}})['then'](function(_0x44280e){if(_0x4daadd){if(_0x44280e){_0x2fb2e4=_0x44280e;}}return require(_0x8388('0x7e'))['getLicense']();})['then'](function(_0x5baf2e){if(_0x5baf2e){_0x842f85=_0x5baf2e[_0x8388('0x11b')];_0x2573b9=_0x5baf2e[_0x8388('0x80')];}})[_0x8388('0x23')](function(){return db[_0x8388('0xc0')]['count']({'where':{'closed':![]}});})[_0x8388('0x23')](function(_0x562ecd){_0xc933dd=_0x562ecd;if(_0x842f85&&_0x562ecd>_0x842f85){return db[_0x8388('0x11c')][_0x8388('0x6d')]({'where':{'id':0x1}})[_0x8388('0x23')](function(_0x427929){if(_0x427929){_0x427929[_0x8388('0x11d')](_0x8388('0x11e'));}});}})[_0x8388('0x23')](function(){if(_0x4daadd[_0x8388('0x119')]&&_0x4daadd[_0x8388('0x119')]['Intervals']){var _0x1067c0=[];for(var _0x547437=0x0;_0x547437<_0x4daadd[_0x8388('0x119')][_0x8388('0x11a')][_0x8388('0x50')];_0x547437++){var _0x58ba3c=_0x4daadd[_0x8388('0x119')][_0x8388('0x11a')][_0x547437][_0x8388('0x3d')]({'plain':!![]});_0x1067c0['push'](iftimePromise(_0x58ba3c,_0x4daadd));}return BPromise[_0x8388('0x11f')](_0x1067c0)[_0x8388('0x23')](function(_0x2fa003){return _[_0x8388('0x120')](_0x2fa003);});}else{return!![];}})[_0x8388('0x23')](function(_0x43cd5b){var _0x101989=fs[_0x8388('0xdc')](path[_0x8388('0x7c')](config[_0x8388('0x83')],_0x8388('0x121')),_0x8388('0xde'));var _0x5db9ae={'remote':_0x4daadd[_0x8388('0x122')],'query':querystring['stringify'](_[_0x8388('0x59')](_0x4daadd[_0x8388('0x3d')]({'plain':!![]}),{'customerIp':_0x1a49fe[_0x8388('0x92')][_0x8388('0x123')]||_0x1a49fe[_0x8388('0x92')]['x-real-ip']||_0x1a49fe[_0x8388('0x124')][_0x8388('0x125')]||_0x1a49fe['ip'],'referer':_0x1a49fe[_0x8388('0x92')][_0x8388('0xb5')],'openedInteractions':_0xc933dd,'maxInteractions':_0x842f85,'virtual':_0x2573b9[_0x8388('0x11b')],'online':_0x43cd5b,'custom':_0x2573b9}))['replace'](/'/g,'\x5c\x27')};_0x576527[_0x8388('0x42')](ejs[_0x8388('0x126')](Mustache[_0x8388('0x126')](_0x101989,_0x5db9ae),{'proactiveActions':_0x2fb2e4,'alignment':_0x4daadd[_0x8388('0x127')],'verticalAlignment':_0x4daadd[_0x8388('0x128')],'div_color':_0x4daadd['color'],'text_color':_0x4daadd['textColor'],'button_color':_0x4daadd['color_button'],'background_color':_0x4daadd[_0x8388('0x129')]}));})['catch'](handleError(_0x576527,null));};exports[_0x8388('0x12a')]=function(_0x3cf226,_0x27e081,_0x4abd49){return db[_0x8388('0x46')][_0x8388('0x6d')]({'where':{'id':_0x3cf226[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x27e081,null))['then'](function(_0x35466d){if(_0x35466d){return db[_0x8388('0xe8')][_0x8388('0xe9')](function(_0x410ac0){return db[_0x8388('0xa5')][_0x8388('0x3c')]({'where':{'ChatWebsiteId':_0x3cf226[_0x8388('0x5f')]['id']},'transaction':_0x410ac0})[_0x8388('0x23')](function(_0x1d783f){var _0x42f282=_['map'](_0x3cf226[_0x8388('0x64')],function(_0x2381e8){_0x2381e8['ChatWebsiteId']=_0x3cf226[_0x8388('0x5f')]['id'];return _0x2381e8;});return db[_0x8388('0xa5')][_0x8388('0xeb')](_0x42f282,{'transaction':_0x410ac0});});})[_0x8388('0x23')](function(){return db[_0x8388('0xa5')][_0x8388('0x12b')]({'where':{'ChatWebsiteId':_0x3cf226[_0x8388('0x5f')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x27e081,null))[_0x8388('0x2e')](handleError(_0x27e081,null));};exports[_0x8388('0x12c')]=function(_0x5de8be,_0x101362,_0x10c498){var _0x415c5d={};var _0x4b35c8={};var _0x3ef806;var _0x553167;return db[_0x8388('0x46')]['findOne']({'where':{'id':_0x5de8be['params']['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x101362,null))[_0x8388('0x23')](function(_0x1d8e21){if(_0x1d8e21){_0x3ef806=_0x1d8e21;_0x4b35c8[_0x8388('0x4b')]=_['keys'](db[_0x8388('0xa5')][_0x8388('0x47')]);_0x4b35c8[_0x8388('0x4c')]=_[_0x8388('0x61')](_0x5de8be[_0x8388('0x4c')]);_0x4b35c8[_0x8388('0x57')]=_[_0x8388('0x4d')](_0x4b35c8[_0x8388('0x4b')],_0x4b35c8['query']);_0x415c5d[_0x8388('0x4f')]=_[_0x8388('0x4d')](_0x4b35c8['model'],qs[_0x8388('0x4e')](_0x5de8be[_0x8388('0x4c')][_0x8388('0x4e')]));_0x415c5d['attributes']=_0x415c5d[_0x8388('0x4f')][_0x8388('0x50')]?_0x415c5d['attributes']:_0x4b35c8['model'];_0x415c5d[_0x8388('0x53')]=qs[_0x8388('0x54')](_0x5de8be[_0x8388('0x4c')][_0x8388('0x54')]);_0x415c5d[_0x8388('0x55')]=qs[_0x8388('0x57')](_[_0x8388('0x56')](_0x5de8be['query'],_0x4b35c8['filters']));if(_0x5de8be[_0x8388('0x4c')][_0x8388('0x58')]){_0x415c5d[_0x8388('0x55')]=_['merge'](_0x415c5d[_0x8388('0x55')],{'$or':_['map'](_0x415c5d[_0x8388('0x4f')],function(_0x53fdf2){var _0x5bc10d={};_0x5bc10d[_0x53fdf2]={'$like':'%'+_0x5de8be[_0x8388('0x4c')]['filter']+'%'};return _0x5bc10d;})});}_0x415c5d=_[_0x8388('0x59')]({},_0x415c5d,_0x5de8be[_0x8388('0x5b')]);return _0x3ef806[_0x8388('0x12c')](_0x415c5d);}})['then'](function(_0x22785c){if(_0x22785c){_0x553167=_0x22785c[_0x8388('0x50')];if(!_0x5de8be[_0x8388('0x4c')][_0x8388('0x51')](_0x8388('0x52'))){_0x415c5d[_0x8388('0x33')]=qs['limit'](_0x5de8be[_0x8388('0x4c')][_0x8388('0x33')]);_0x415c5d[_0x8388('0x35')]=qs[_0x8388('0x35')](_0x5de8be[_0x8388('0x4c')][_0x8388('0x35')]);}return _0x3ef806[_0x8388('0x12c')](_0x415c5d);}})['then'](function(_0x2fd198){if(_0x2fd198){return _0x2fd198?{'count':_0x553167,'rows':_0x2fd198}:null;}})[_0x8388('0x23')](respondWithResult(_0x101362,null))[_0x8388('0x2e')](handleError(_0x101362,null));};exports[_0x8388('0x12d')]=function(_0x401c56,_0x58fb14,_0x34f8f3){return db[_0x8388('0x12e')][_0x8388('0x62')]({'where':{'id':_0x401c56['params']['id']}})['then'](handleEntityNotFound(_0x58fb14,null))[_0x8388('0x23')](function(_0x595327){if(_0x595327){return _0x595327[_0x8388('0x12d')](_0x401c56[_0x8388('0x64')][_0x8388('0x75')],_[_0x8388('0x105')](_0x401c56[_0x8388('0x64')],[_0x8388('0x75'),'id'])||{});}})['then'](respondWithResult(_0x58fb14,null))[_0x8388('0x2e')](handleError(_0x58fb14,null));};exports['getProactiveActions']=function(_0x358066,_0x530c57,_0x282d7a){var _0x5cf9d2={};var _0x5e695e={};var _0x10a758;var _0xe28b0f;return db['ChatWebsite'][_0x8388('0x6d')]({'where':{'id':_0x358066['params']['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x530c57,null))[_0x8388('0x23')](function(_0x431847){if(_0x431847){_0x10a758=_0x431847;_0x5e695e['model']=_[_0x8388('0x61')](db[_0x8388('0x12f')][_0x8388('0x47')]);_0x5e695e[_0x8388('0x4c')]=_[_0x8388('0x61')](_0x358066['query']);_0x5e695e[_0x8388('0x57')]=_[_0x8388('0x4d')](_0x5e695e['model'],_0x5e695e[_0x8388('0x4c')]);_0x5cf9d2[_0x8388('0x4f')]=_['intersection'](_0x5e695e[_0x8388('0x4b')],qs[_0x8388('0x4e')](_0x358066[_0x8388('0x4c')]['fields']));_0x5cf9d2[_0x8388('0x4f')]=_0x5cf9d2['attributes']['length']?_0x5cf9d2['attributes']:_0x5e695e['model'];_0x5cf9d2[_0x8388('0x53')]=qs['sort'](_0x358066[_0x8388('0x4c')]['sort']);_0x5cf9d2[_0x8388('0x55')]=qs['filters'](_[_0x8388('0x56')](_0x358066['query'],_0x5e695e[_0x8388('0x57')]));if(_0x358066['query']['filter']){_0x5cf9d2[_0x8388('0x55')]=_[_0x8388('0x59')](_0x5cf9d2[_0x8388('0x55')],{'$or':_[_0x8388('0x45')](_0x5cf9d2[_0x8388('0x4f')],function(_0x54dade){var _0x1137cc={};_0x1137cc[_0x54dade]={'$like':'%'+_0x358066[_0x8388('0x4c')][_0x8388('0x58')]+'%'};return _0x1137cc;})});}_0x5cf9d2=_[_0x8388('0x59')]({},_0x5cf9d2,_0x358066[_0x8388('0x5b')]);return _0x10a758['getProactiveActions'](_0x5cf9d2);}})[_0x8388('0x23')](function(_0x21e069){if(_0x21e069){_0xe28b0f=_0x21e069[_0x8388('0x50')];if(!_0x358066[_0x8388('0x4c')]['hasOwnProperty']('nolimit')){_0x5cf9d2[_0x8388('0x33')]=qs[_0x8388('0x33')](_0x358066[_0x8388('0x4c')][_0x8388('0x33')]);_0x5cf9d2['offset']=qs[_0x8388('0x35')](_0x358066[_0x8388('0x4c')][_0x8388('0x35')]);}return _0x10a758[_0x8388('0x130')](_0x5cf9d2);}})[_0x8388('0x23')](function(_0x37cd32){if(_0x37cd32){return _0x37cd32?{'count':_0xe28b0f,'rows':_0x37cd32}:null;}})[_0x8388('0x23')](respondWithResult(_0x530c57,null))[_0x8388('0x2e')](handleError(_0x530c57,null));};exports[_0x8388('0x131')]=function(_0x4c5751,_0x582b98,_0x84e462){var _0x4779cd=_0x4c5751[_0x8388('0x4c')][_0x8388('0x132')]===_0x8388('0x133')?_0x8388('0x134'):_0x8388('0x135');return db[_0x8388('0x46')][_0x8388('0x62')]({'attributes':['id',_0x4779cd],'where':{'id':_0x4c5751['params']['id']}})['then'](handleEntityNotFound(_0x582b98,null))['then'](function(_0x9d8948){if(_0x9d8948){var _0x116e94=_0x9d8948[_0x4779cd];var _0x19ba0d=_0x116e94&&_0x116e94[_0x8388('0x136')]?_0x116e94['items']:[];_0x582b98['send']({'fromKey':_[_0x8388('0x81')](_0x116e94[_0x8388('0x137')])?undefined:_0x116e94[_0x8388('0x137')],'count':_0x19ba0d[_0x8388('0x50')],'rows':_0x19ba0d});}})[_0x8388('0x2e')](handleError(_0x582b98,null));};exports[_0x8388('0x138')]=function(_0x1c2e1e,_0x59a733,_0x3f3b78){var _0x1237be={'raw':![],'where':{}};var _0xa67328={};var _0x1f2b57={'count':0x0,'rows':[]};return db[_0x8388('0x46')][_0x8388('0x6d')]({'where':{'id':_0x1c2e1e['params']['id']}})[_0x8388('0x23')](handleEntityNotFound(_0x59a733,null))['then'](function(_0x37a20f){if(_0x37a20f){_0xa67328['model']=_[_0x8388('0x61')](db[_0x8388('0xe1')][_0x8388('0x47')]);_0xa67328[_0x8388('0x4c')]=_['keys'](_0x1c2e1e[_0x8388('0x4c')]);_0xa67328[_0x8388('0x57')]=_[_0x8388('0x4d')](_0xa67328[_0x8388('0x4b')],_0xa67328[_0x8388('0x4c')]);_0x1237be['attributes']=_[_0x8388('0x4d')](_0xa67328[_0x8388('0x4b')],qs['fields'](_0x1c2e1e[_0x8388('0x4c')][_0x8388('0x4e')]));_0x1237be[_0x8388('0x4f')]=_0x1237be[_0x8388('0x4f')][_0x8388('0x50')]?_0x1237be[_0x8388('0x4f')]:_0xa67328[_0x8388('0x4b')];if(!_0x1c2e1e['query'][_0x8388('0x51')](_0x8388('0x52'))){_0x1237be[_0x8388('0x33')]=qs[_0x8388('0x33')](_0x1c2e1e['query'][_0x8388('0x33')]);_0x1237be[_0x8388('0x35')]=qs[_0x8388('0x35')](_0x1c2e1e[_0x8388('0x4c')][_0x8388('0x35')]);}_0x1237be[_0x8388('0x53')]=qs[_0x8388('0x54')](_0x1c2e1e[_0x8388('0x4c')][_0x8388('0x54')]);_0x1237be[_0x8388('0x55')]=qs['filters'](_['pick'](_0x1c2e1e['query'],_0xa67328[_0x8388('0x57')]));_0x1237be[_0x8388('0x55')][_0x8388('0x73')]=_0x37a20f['id'];if(_0x1c2e1e[_0x8388('0x4c')][_0x8388('0x58')]){_0x1237be['where']=_[_0x8388('0x59')](_0x1237be['where'],{'$or':_[_0x8388('0x45')](_0x1237be[_0x8388('0x4f')],function(_0x1f056f){var _0x5a626d={};_0x5a626d[_0x1f056f]={'$like':'%'+_0x1c2e1e[_0x8388('0x4c')][_0x8388('0x58')]+'%'};return _0x5a626d;})});}_0x1237be=_[_0x8388('0x59')]({},_0x1237be,_0x1c2e1e['options']);return db[_0x8388('0xe1')][_0x8388('0x36')]({'where':_0x1237be[_0x8388('0x55')]})['then'](function(_0x30d0b9){_0x1f2b57[_0x8388('0x36')]=_0x30d0b9;if(_0x1c2e1e[_0x8388('0x4c')][_0x8388('0x6e')]){_0x1237be[_0x8388('0x5c')]=[{'all':!![]}];}else{_0x1237be[_0x8388('0x5c')]=[{'model':db[_0x8388('0x95')],'as':'Contact','required':![]},{'model':db[_0x8388('0xea')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x8388('0x5d')](_0x1237be);})['then'](function(_0xd2091e){_0x1f2b57[_0x8388('0x5e')]=_0xd2091e;return _0x1f2b57;});}})[_0x8388('0x23')](respondWithFilteredResult(_0x59a733,_0x1237be))[_0x8388('0x2e')](handleError(_0x59a733,null));};exports[_0x8388('0x139')]=function(_0x1fa666,_0x1d7aa6,_0x4cacf0){return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x1fa666['params']['id']}})['then'](handleEntityNotFound(_0x1d7aa6,null))[_0x8388('0x23')](function(_0x2dbcaf){if(_0x2dbcaf){return _0x2dbcaf[_0x8388('0x139')](_0x1fa666[_0x8388('0x64')]['ids'],_['omit'](_0x1fa666['body'],[_0x8388('0x75'),'id'])||{})[_0x8388('0xc3')](function(_0x562629){for(var _0x7a5a65=0x0;_0x7a5a65<_0x1fa666['body'][_0x8388('0x75')][_0x8388('0x50')];_0x7a5a65+=0x1){socket[_0x8388('0x13a')]('userChatWebsite:save',{'UserId':Number(_0x1fa666['body'][_0x8388('0x75')][_0x7a5a65]),'ChatWebsiteId':Number(_0x1fa666['params']['id'])});}return _0x562629;});}})['then'](respondWithResult(_0x1d7aa6,null))[_0x8388('0x2e')](handleError(_0x1d7aa6,null));};exports[_0x8388('0x13b')]=function(_0x3320e4,_0xa1fcc5,_0x12c14e){return db[_0x8388('0x46')][_0x8388('0x62')]({'where':{'id':_0x3320e4[_0x8388('0x5f')]['id']}})[_0x8388('0x23')](handleEntityNotFound(_0xa1fcc5,null))[_0x8388('0x23')](function(_0x492abc){if(_0x492abc){return _0x492abc['removeAgents'](_0x3320e4[_0x8388('0x4c')]['ids'])[_0x8388('0x23')](function(){if(_[_0x8388('0x13c')](_0x3320e4[_0x8388('0x4c')]['ids'])){for(var _0x536eec=0x0;_0x536eec<_0x3320e4[_0x8388('0x4c')]['ids'][_0x8388('0x50')];_0x536eec+=0x1){socket[_0x8388('0x13a')](_0x8388('0x13d'),{'UserId':Number(_0x3320e4['query'][_0x8388('0x75')][_0x536eec]),'ChatWebsiteId':Number(_0x3320e4['params']['id'])});}}else{socket[_0x8388('0x13a')](_0x8388('0x13d'),{'UserId':Number(_0x3320e4['query'][_0x8388('0x75')]),'ChatWebsiteId':Number(_0x3320e4['params']['id'])});}});}})['then'](respondWithStatusCode(_0xa1fcc5,null))[_0x8388('0x2e')](handleError(_0xa1fcc5,null));};exports[_0x8388('0x13e')]=function(_0x2318c7,_0x2a81a7,_0x83effe){var _0x292409={};var _0xd1a9f5={};var _0x242459;var _0x519fc9;return db[_0x8388('0x46')][_0x8388('0x6d')]({'where':{'id':_0x2318c7['params']['id']}})['then'](handleEntityNotFound(_0x2a81a7,null))[_0x8388('0x23')](function(_0x10dfba){if(_0x10dfba){_0x242459=_0x10dfba;_0xd1a9f5[_0x8388('0x4b')]=_[_0x8388('0x61')](db['User'][_0x8388('0x47')]);_0xd1a9f5[_0x8388('0x4c')]=_['keys'](_0x2318c7[_0x8388('0x4c')]);_0xd1a9f5[_0x8388('0x57')]=_['intersection'](_0xd1a9f5['model'],_0xd1a9f5[_0x8388('0x4c')]);_0x292409['attributes']=_[_0x8388('0x4d')](_0xd1a9f5['model'],qs['fields'](_0x2318c7['query']['fields']));_0x292409[_0x8388('0x4f')]=_0x292409[_0x8388('0x4f')][_0x8388('0x50')]?_0x292409[_0x8388('0x4f')]:_0xd1a9f5[_0x8388('0x4b')];_0x292409[_0x8388('0x53')]=qs[_0x8388('0x54')](_0x2318c7[_0x8388('0x4c')][_0x8388('0x54')]);_0x292409[_0x8388('0x55')]=qs[_0x8388('0x57')](_[_0x8388('0x56')](_0x2318c7['query'],_0xd1a9f5[_0x8388('0x57')]));if(_0x2318c7[_0x8388('0x4c')][_0x8388('0x58')]){_0x292409['where']=_[_0x8388('0x59')](_0x292409[_0x8388('0x55')],{'$or':_[_0x8388('0x45')](_0x292409[_0x8388('0x4f')],function(_0x31d9ed){var _0x33fc5e={};_0x33fc5e[_0x31d9ed]={'$like':'%'+_0x2318c7['query'][_0x8388('0x58')]+'%'};return _0x33fc5e;})});}_0x292409=_['merge']({},_0x292409,_0x2318c7[_0x8388('0x5b')]);return _0x242459[_0x8388('0x13e')](_0x292409);}})['then'](function(_0x49874e){if(_0x49874e){_0x519fc9=_0x49874e[_0x8388('0x50')];if(!_0x2318c7['query'][_0x8388('0x51')](_0x8388('0x52'))){_0x292409['limit']=qs[_0x8388('0x33')](_0x2318c7['query']['limit']);_0x292409[_0x8388('0x35')]=qs[_0x8388('0x35')](_0x2318c7[_0x8388('0x4c')][_0x8388('0x35')]);}return _0x242459[_0x8388('0x13e')](_0x292409);}})['then'](function(_0x2d6c98){if(_0x2d6c98){return _0x2d6c98?{'count':_0x519fc9,'rows':_0x2d6c98}:null;}})[_0x8388('0x23')](respondWithResult(_0x2a81a7,null))[_0x8388('0x2e')](handleError(_0x2a81a7,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index ff70d15..b10617a 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 _0x3c7b=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x131f95,_0x52919a){var _0x405fd2=function(_0x2dd12d){while(--_0x2dd12d){_0x131f95['push'](_0x131f95['shift']());}};_0x405fd2(++_0x52919a);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x14d079,_0x4b6d7b){_0x14d079=_0x14d079-0x0;var _0x74dcd=_0x3c7b[_0x14d079];return _0x74dcd;};'use strict';var EventEmitter=require(_0xb3c7('0x0'));var ChatWebsite=require(_0xb3c7('0x1'))['db'][_0xb3c7('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb3c7('0x3')](0x0);var events={'afterCreate':_0xb3c7('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x500bea){return function(_0x5b34ef,_0x234fe5,_0x44c399){ChatWebsiteEvents['emit'](_0x500bea+':'+_0x5b34ef['id'],_0x5b34ef);ChatWebsiteEvents[_0xb3c7('0x5')](_0x500bea,_0x5b34ef);_0x44c399(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb3c7('0x6')](e,emitEvent(event));}}module[_0xb3c7('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x8ef6=['hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x73e5b0,_0x241ec0){var _0x23ed6f=function(_0x12825c){while(--_0x12825c){_0x73e5b0['push'](_0x73e5b0['shift']());}};_0x23ed6f(++_0x241ec0);}(_0x8ef6,0xf2));var _0x68ef=function(_0x569441,_0x4cd9c3){_0x569441=_0x569441-0x0;var _0x13f6b2=_0x8ef6[_0x569441];return _0x13f6b2;};'use strict';var EventEmitter=require(_0x68ef('0x0'));var ChatWebsite=require(_0x68ef('0x1'))['db'][_0x68ef('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x68ef('0x3')](0x0);var events={'afterCreate':_0x68ef('0x4'),'afterUpdate':_0x68ef('0x5'),'afterDestroy':_0x68ef('0x6')};function emitEvent(_0x4a72b8){return function(_0x27d0af,_0x129ce,_0xbab618){ChatWebsiteEvents[_0x68ef('0x7')](_0x4a72b8+':'+_0x27d0af['id'],_0x27d0af);ChatWebsiteEvents['emit'](_0x4a72b8,_0x27d0af);_0xbab618(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x68ef('0x8')](e,emitEvent(event));}}module[_0x68ef('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 1ab5f6d..f2c81ca 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 _0x651a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites'];(function(_0x31930f,_0x4f5869){var _0x3fab66=function(_0x3644b2){while(--_0x3644b2){_0x31930f['push'](_0x31930f['shift']());}};_0x3fab66(++_0x4f5869);}(_0x651a,0xf0));var _0xa651=function(_0x18f82b,_0x3ea7a0){_0x18f82b=_0x18f82b-0x0;var _0x5d8128=_0x651a[_0x18f82b];return _0x5d8128;};'use strict';var _=require(_0xa651('0x0'));var util=require(_0xa651('0x1'));var logger=require(_0xa651('0x2'))(_0xa651('0x3'));var moment=require(_0xa651('0x4'));var BPromise=require(_0xa651('0x5'));var rp=require(_0xa651('0x6'));var fs=require('fs');var path=require(_0xa651('0x7'));var rimraf=require(_0xa651('0x8'));var config=require(_0xa651('0x9'));var attributes=require(_0xa651('0xa'));module[_0xa651('0xb')]=function(_0x4242d6,_0x8ae13){return _0x4242d6[_0xa651('0xc')](_0xa651('0xd'),attributes,{'tableName':_0xa651('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fc4=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x21a848,_0x5ce41a){var _0x5aaf99=function(_0x342593){while(--_0x342593){_0x21a848['push'](_0x21a848['shift']());}};_0x5aaf99(++_0x5ce41a);}(_0x8fc4,0x1c1));var _0x48fc=function(_0x3ad847,_0x275ac7){_0x3ad847=_0x3ad847-0x0;var _0x2120b4=_0x8fc4[_0x3ad847];return _0x2120b4;};'use strict';var _=require(_0x48fc('0x0'));var util=require(_0x48fc('0x1'));var logger=require(_0x48fc('0x2'))(_0x48fc('0x3'));var moment=require(_0x48fc('0x4'));var BPromise=require(_0x48fc('0x5'));var rp=require(_0x48fc('0x6'));var fs=require('fs');var path=require(_0x48fc('0x7'));var rimraf=require(_0x48fc('0x8'));var config=require(_0x48fc('0x9'));var attributes=require(_0x48fc('0xa'));module[_0x48fc('0xb')]=function(_0x5af58d,_0x1a5fcb){return _0x5af58d[_0x48fc('0xc')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index b831990..8a06627 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 _0xdaab=['../../config/utils','../../config/logger','rpc','http','redis','localhost','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','randomstring','ioredis'];(function(_0x30bda8,_0x2a47f4){var _0x187982=function(_0x3c5959){while(--_0x3c5959){_0x30bda8['push'](_0x30bda8['shift']());}};_0x187982(++_0x2a47f4);}(_0xdaab,0xe3));var _0xbdaa=function(_0x230747,_0x26a388){_0x230747=_0x230747-0x0;var _0xfe319b=_0xdaab[_0x230747];return _0xfe319b;};'use strict';var _=require(_0xbdaa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbdaa('0x1'));var rs=require(_0xbdaa('0x2'));var fs=require('fs');var Redis=require(_0xbdaa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdaa('0x4'));var logger=require(_0xbdaa('0x5'))(_0xbdaa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbdaa('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xbdaa('0x8')],{'host':_0xbdaa('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbdaa('0x8')]));require('./chatWebsite.socket')[_0xbdaa('0xa')](socket);function respondWithRpcPromise(_0x3cc253,_0x5940bb,_0xbe71bc){return new BPromise(function(_0x3683be,_0x544a40){return client['request'](_0x3cc253,_0xbe71bc)[_0xbdaa('0xb')](function(_0x57a65e){logger[_0xbdaa('0xc')](_0xbdaa('0xd'),_0x5940bb,_0xbdaa('0xe'));logger[_0xbdaa('0xf')](_0xbdaa('0x10'),_0x5940bb,_0xbdaa('0xe'),JSON[_0xbdaa('0x11')](_0x57a65e));if(_0x57a65e['error']){if(_0x57a65e[_0xbdaa('0x12')][_0xbdaa('0x13')]===0x1f4){logger['error'](_0xbdaa('0xd'),_0x5940bb,_0x57a65e['error'][_0xbdaa('0x14')]);return _0x544a40(_0x57a65e['error'][_0xbdaa('0x14')]);}logger[_0xbdaa('0x12')](_0xbdaa('0xd'),_0x5940bb,_0x57a65e['error']['message']);return _0x3683be(_0x57a65e[_0xbdaa('0x12')]['message']);}else{logger['info'](_0xbdaa('0xd'),_0x5940bb,_0xbdaa('0xe'));_0x3683be(_0x57a65e['result']['message']);}})['catch'](function(_0x2fd096){logger[_0xbdaa('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x5940bb,_0x2fd096);_0x544a40(_0x2fd096);});});}
\ No newline at end of file
+var _0x34f0=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','./chatWebsite.socket','register','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x34f0,0x15e));var _0x034f=function(_0x50b9b5,_0xabece1){_0x50b9b5=_0x50b9b5-0x0;var _0x883384=_0x34f0[_0x50b9b5];return _0x883384;};'use strict';var _=require(_0x034f('0x0'));var util=require(_0x034f('0x1'));var moment=require(_0x034f('0x2'));var BPromise=require(_0x034f('0x3'));var rs=require(_0x034f('0x4'));var fs=require('fs');var Redis=require(_0x034f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x034f('0x6'));var logger=require(_0x034f('0x7'))('rpc');var config=require(_0x034f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x034f('0x9')][_0x034f('0xa')]({'port':0x232a});config['redis']=_[_0x034f('0xb')](config[_0x034f('0xc')],{'host':_0x034f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x034f('0xc')]));require(_0x034f('0xe'))[_0x034f('0xf')](socket);function respondWithRpcPromise(_0x43e246,_0x102278,_0x773a9){return new BPromise(function(_0x481477,_0x4b947b){return client[_0x034f('0x10')](_0x43e246,_0x773a9)['then'](function(_0x55a4d6){logger[_0x034f('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x102278,_0x034f('0x12'));logger[_0x034f('0x13')](_0x034f('0x14'),_0x102278,_0x034f('0x12'),JSON[_0x034f('0x15')](_0x55a4d6));if(_0x55a4d6[_0x034f('0x16')]){if(_0x55a4d6['error'][_0x034f('0x17')]===0x1f4){logger[_0x034f('0x16')](_0x034f('0x18'),_0x102278,_0x55a4d6[_0x034f('0x16')][_0x034f('0x19')]);return _0x4b947b(_0x55a4d6[_0x034f('0x16')][_0x034f('0x19')]);}logger[_0x034f('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x102278,_0x55a4d6[_0x034f('0x16')][_0x034f('0x19')]);return _0x481477(_0x55a4d6[_0x034f('0x16')][_0x034f('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x102278,_0x034f('0x12'));_0x481477(_0x55a4d6['result'][_0x034f('0x19')]);}})[_0x034f('0x1a')](function(_0x59e187){logger[_0x034f('0x16')](_0x034f('0x18'),_0x102278,_0x59e187);_0x4b947b(_0x59e187);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index f890c3d..c207567 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 _0xaed8=['remove','update','emit','removeListener','length','chatWebsite:','save'];(function(_0x16f39a,_0x233f55){var _0xd6a5da=function(_0x179a80){while(--_0x179a80){_0x16f39a['push'](_0x16f39a['shift']());}};_0xd6a5da(++_0x233f55);}(_0xaed8,0x102));var _0x8aed=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0xaed8[_0x4d82ea];return _0x257f4a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x8aed('0x0'),_0x8aed('0x1'),_0x8aed('0x2')];function createListener(_0x3f2364,_0x5924a5){return function(_0x2a6bdd){_0x5924a5[_0x8aed('0x3')](_0x3f2364,_0x2a6bdd);};}function removeListener(_0x9bddfe,_0x146906){return function(){ChatWebsiteEvents[_0x8aed('0x4')](_0x9bddfe,_0x146906);};}exports['register']=function(_0x5c6b9d){for(var _0x2a5084=0x0,_0x5dce12=events[_0x8aed('0x5')];_0x2a5084<_0x5dce12;_0x2a5084++){var _0x1c2ff2=events[_0x2a5084];var _0x28cba8=createListener(_0x8aed('0x6')+_0x1c2ff2,_0x5c6b9d);ChatWebsiteEvents['on'](_0x1c2ff2,_0x28cba8);}};
\ No newline at end of file
+var _0x50f6=['emit','removeListener','register','length','./chatWebsite.events','save','remove','update'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x50f6,0x94));var _0x650f=function(_0x56085e,_0x5c69e9){_0x56085e=_0x56085e-0x0;var _0x4de130=_0x50f6[_0x56085e];return _0x4de130;};'use strict';var ChatWebsiteEvents=require(_0x650f('0x0'));var events=[_0x650f('0x1'),_0x650f('0x2'),_0x650f('0x3')];function createListener(_0xc1b39d,_0xd2b427){return function(_0x3225a1){_0xd2b427[_0x650f('0x4')](_0xc1b39d,_0x3225a1);};}function removeListener(_0x1f7ab2,_0x321533){return function(){ChatWebsiteEvents[_0x650f('0x5')](_0x1f7ab2,_0x321533);};}exports[_0x650f('0x6')]=function(_0x54dce2){for(var _0xb224dc=0x0,_0x5307b2=events[_0x650f('0x7')];_0xb224dc<_0x5307b2;_0xb224dc++){var _0x43b244=events[_0xb224dc];var _0x31226a=createListener('chatWebsite:'+_0x43b244,_0x54dce2);ChatWebsiteEvents['on'](_0x43b244,_0x31226a);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 933c060..2e72194 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 _0x7212=['/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','create','post','/:id/dispositions','diskStorage','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','join','server/files/images/avatars/','format','/:id/avatar','addAvatar','/:id/notify','attachments','offline-chat','replace','any','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','removeDispositions','removeAgents','exports','multer','express','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet'];(function(_0x57904d,_0x58e82f){var _0x105cfc=function(_0x44ba55){while(--_0x44ba55){_0x57904d['push'](_0x57904d['shift']());}};_0x105cfc(++_0x58e82f);}(_0x7212,0x1e3));var _0x2721=function(_0x4f0ee5,_0x4aaec5){_0x4f0ee5=_0x4f0ee5-0x0;var _0x1661dc=_0x7212[_0x4f0ee5];return _0x1661dc;};'use strict';var multer=require(_0x2721('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2721('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2721('0x2'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0x2721('0x3')]('/',auth[_0x2721('0x4')](),controller[_0x2721('0x5')]);router['get'](_0x2721('0x6'),auth[_0x2721('0x4')](),controller[_0x2721('0x7')]);router[_0x2721('0x3')]('/:id',auth['isAuthenticated'](),controller[_0x2721('0x8')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2721('0x9')]);router['get'](_0x2721('0xa'),auth[_0x2721('0x4')](),controller[_0x2721('0xb')]);router[_0x2721('0x3')](_0x2721('0xc'),controller[_0x2721('0xd')]);router['get']('/:id/avatar',controller[_0x2721('0xe')]);router[_0x2721('0x3')](_0x2721('0xf'),controller[_0x2721('0x10')]);router[_0x2721('0x3')](_0x2721('0x11'),controller['getSystemAvatar']);router[_0x2721('0x3')]('/:id/interactions',auth[_0x2721('0x4')](),controller[_0x2721('0x12')]);router[_0x2721('0x3')](_0x2721('0x13'),controller[_0x2721('0x14')]);router[_0x2721('0x3')](_0x2721('0x15'),auth[_0x2721('0x4')](),controller[_0x2721('0x16')]);router[_0x2721('0x3')](_0x2721('0x17'),auth[_0x2721('0x4')](),controller['getProactiveActions']);router[_0x2721('0x3')](_0x2721('0x18'),controller[_0x2721('0x19')]);router[_0x2721('0x3')]('/:id/offline_messages',auth[_0x2721('0x4')](),controller[_0x2721('0x1a')]);router[_0x2721('0x3')](_0x2721('0x1b'),auth['isAuthenticated'](),controller[_0x2721('0x1c')]);router['post']('/',auth[_0x2721('0x4')](),controller[_0x2721('0x1d')]);router[_0x2721('0x1e')](_0x2721('0x1f'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x2721('0x1e')](_0x2721('0xa'),auth[_0x2721('0x4')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x2721('0x20')]({'destination':function(_0x13c101,_0xa2c46d,_0x5e4324){_0x5e4324(null,path['join'](config[_0x2721('0x21')],_0x2721('0x22')));},'filename':function(_0x49dfd9,_0xef2b48,_0x3e7028){_0x3e7028(null,util['format'](_0x2721('0x23'),Date[_0x2721('0x24')](),_0xef2b48[_0x2721('0x25')]));}})});router[_0x2721('0x1e')](_0x2721('0xc'),upload[_0x2721('0x26')](_0x2721('0x27')),controller[_0x2721('0x28')]);var upload=multer({'storage':multer[_0x2721('0x20')]({'destination':function(_0x2ae791,_0x3f56a9,_0x49437c){_0x49437c(null,path[_0x2721('0x29')](config['root'],_0x2721('0x2a')));},'filename':function(_0x33b1ba,_0x1c5e49,_0x1da0cd){_0x1da0cd(null,util[_0x2721('0x2b')]('%s-%s',Date[_0x2721('0x24')](),_0x1c5e49[_0x2721('0x25')]));}})});router[_0x2721('0x1e')](_0x2721('0x2c'),upload[_0x2721('0x26')](_0x2721('0x27')),controller[_0x2721('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2cfe3c,_0x5ad530,_0x27cb59){_0x27cb59(null,path[_0x2721('0x29')](config[_0x2721('0x21')],_0x2721('0x2a')));},'filename':function(_0x581332,_0x442b93,_0xeae5d4){_0xeae5d4(null,util[_0x2721('0x2b')](_0x2721('0x23'),Date[_0x2721('0x24')](),_0x442b93[_0x2721('0x25')]));}})});router[_0x2721('0x1e')](_0x2721('0xf'),upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x2721('0x20')]({'destination':function(_0x3d1f61,_0x9204a7,_0x17214b){_0x17214b(null,path[_0x2721('0x29')](config['root'],_0x2721('0x2a')));},'filename':function(_0x1826ad,_0x25aee9,_0x204831){_0x204831(null,util[_0x2721('0x2b')]('%s-%s',Date[_0x2721('0x24')](),_0x25aee9[_0x2721('0x25')]));}})});router['post'](_0x2721('0x11'),upload[_0x2721('0x26')]('file'),controller['addSystemAvatar']);router['post'](_0x2721('0x2e'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x2721('0x20')]({'destination':function(_0xeb502c,_0x3fd911,_0x46786b){const _0x2e2629=path[_0x2721('0x29')](config[_0x2721('0x21')],'server/files',_0x2721('0x2f'),_0x2721('0x30'));fs_extra['ensureDir'](_0x2e2629,function(){_0x46786b(null,_0x2e2629);});},'filename':function(_0xd59880,_0x2e9eab,_0x2a4f2f){const _0x5333a0=_0x2e9eab['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x20e567=path['extname'](_0x5333a0);const _0x459d9e=Date[_0x2721('0x24')]()+'-'+_0x5333a0[_0x2721('0x31')](_0x20e567,'')+_0x20e567;_0x2a4f2f(null,_0x459d9e);}})});router[_0x2721('0x1e')]('/:id/offline',offlineUploadMulter[_0x2721('0x32')](),controller['offline']);router[_0x2721('0x1e')](_0x2721('0x33'),auth['isAuthenticated'](),controller[_0x2721('0x34')]);router[_0x2721('0x1e')](_0x2721('0x15'),auth[_0x2721('0x4')](),controller[_0x2721('0x35')]);router[_0x2721('0x1e')](_0x2721('0x17'),auth[_0x2721('0x4')](),controller[_0x2721('0x36')]);router[_0x2721('0x1e')]('/:id/users',auth[_0x2721('0x4')](),controller[_0x2721('0x37')]);router[_0x2721('0x38')](_0x2721('0x39'),auth[_0x2721('0x4')](),controller[_0x2721('0x3a')]);router[_0x2721('0x3b')]('/:id',auth[_0x2721('0x4')](),controller['destroy']);router[_0x2721('0x3b')]('/:id/dispositions',auth[_0x2721('0x4')](),controller[_0x2721('0x3c')]);router[_0x2721('0x3b')](_0x2721('0xa'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x2721('0x3b')]('/:id/users',auth[_0x2721('0x4')](),controller[_0x2721('0x3d')]);module[_0x2721('0x3e')]=router;
\ No newline at end of file
+var _0xe03d=['addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','addAnswer','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','join','root','server/files/images/avatars/','now','/:id/avatar','single','addAvatar','diskStorage','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xe03d,0xa1));var _0xde03=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0xe03d[_0x2bcd1f];return _0x2381ca;};'use strict';var multer=require('multer');var util=require(_0xde03('0x0'));var path=require(_0xde03('0x1'));var timeout=require(_0xde03('0x2'));var express=require(_0xde03('0x3'));var router=express[_0xde03('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xde03('0x5'));var interaction=require(_0xde03('0x6'));var config=require(_0xde03('0x7'));var controller=require(_0xde03('0x8'));router['get']('/',auth[_0xde03('0x9')](),controller['index']);router[_0xde03('0xa')](_0xde03('0xb'),auth[_0xde03('0x9')](),controller[_0xde03('0xc')]);router[_0xde03('0xa')](_0xde03('0xd'),auth[_0xde03('0x9')](),controller[_0xde03('0xe')]);router[_0xde03('0xa')](_0xde03('0xf'),auth[_0xde03('0x9')](),controller[_0xde03('0x10')]);router[_0xde03('0xa')](_0xde03('0x11'),auth[_0xde03('0x9')](),controller[_0xde03('0x12')]);router[_0xde03('0xa')](_0xde03('0x13'),controller[_0xde03('0x14')]);router['get']('/:id/avatar',controller['getAvatar']);router[_0xde03('0xa')]('/:id/customer_avatar',controller[_0xde03('0x15')]);router['get'](_0xde03('0x16'),controller[_0xde03('0x17')]);router[_0xde03('0xa')](_0xde03('0x18'),auth[_0xde03('0x9')](),controller[_0xde03('0x19')]);router[_0xde03('0xa')](_0xde03('0x1a'),controller[_0xde03('0x1b')]);router['get'](_0xde03('0x1c'),auth[_0xde03('0x9')](),controller[_0xde03('0x1d')]);router[_0xde03('0xa')](_0xde03('0x1e'),auth[_0xde03('0x9')](),controller[_0xde03('0x1f')]);router[_0xde03('0xa')](_0xde03('0x20'),controller[_0xde03('0x21')]);router[_0xde03('0xa')](_0xde03('0x22'),auth[_0xde03('0x9')](),controller[_0xde03('0x23')]);router[_0xde03('0xa')](_0xde03('0x24'),auth['isAuthenticated'](),controller['getAgents']);router[_0xde03('0x25')]('/',auth['isAuthenticated'](),controller[_0xde03('0x26')]);router[_0xde03('0x25')](_0xde03('0xf'),auth[_0xde03('0x9')](),controller[_0xde03('0x27')]);router['post'](_0xde03('0x11'),auth[_0xde03('0x9')](),controller[_0xde03('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2267e4,_0x26b0d5,_0x64c39d){_0x64c39d(null,path['join'](config['root'],_0xde03('0x29')));},'filename':function(_0x21316d,_0x23f82,_0x3037c6){_0x3037c6(null,util[_0xde03('0x2a')](_0xde03('0x2b'),Date['now'](),_0x23f82[_0xde03('0x2c')]));}})});router[_0xde03('0x25')](_0xde03('0x13'),upload['single'](_0xde03('0x2d')),controller[_0xde03('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x303f95,_0x3dbe54,_0x144251){_0x144251(null,path[_0xde03('0x2f')](config[_0xde03('0x30')],_0xde03('0x31')));},'filename':function(_0x5e8c4e,_0x5cc89a,_0x3f2e98){_0x3f2e98(null,util['format'](_0xde03('0x2b'),Date[_0xde03('0x32')](),_0x5cc89a[_0xde03('0x2c')]));}})});router[_0xde03('0x25')](_0xde03('0x33'),upload[_0xde03('0x34')]('file'),controller[_0xde03('0x35')]);var upload=multer({'storage':multer[_0xde03('0x36')]({'destination':function(_0x4d235c,_0x137666,_0xe851b1){_0xe851b1(null,path[_0xde03('0x2f')](config['root'],_0xde03('0x31')));},'filename':function(_0x462d4d,_0x38d57f,_0x589875){_0x589875(null,util[_0xde03('0x2a')](_0xde03('0x2b'),Date['now'](),_0x38d57f['originalname']));}})});router[_0xde03('0x25')]('/:id/customer_avatar',upload['single'](_0xde03('0x2d')),controller[_0xde03('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53d61f,_0x130f39,_0xd43cad){_0xd43cad(null,path[_0xde03('0x2f')](config[_0xde03('0x30')],_0xde03('0x31')));},'filename':function(_0x12161d,_0x4483f4,_0x22b549){_0x22b549(null,util['format'](_0xde03('0x2b'),Date['now'](),_0x4483f4[_0xde03('0x2c')]));}})});router['post']('/:id/system_avatar',upload[_0xde03('0x34')]('file'),controller['addSystemAvatar']);router[_0xde03('0x25')](_0xde03('0x38'),controller[_0xde03('0x39')]);const offlineUploadMulter=multer({'storage':multer[_0xde03('0x36')]({'destination':function(_0x3e2216,_0x3181e9,_0x4f0afd){const _0x19ba1d=path[_0xde03('0x2f')](config[_0xde03('0x30')],_0xde03('0x3a'),_0xde03('0x3b'),_0xde03('0x3c'));fs_extra[_0xde03('0x3d')](_0x19ba1d,function(){_0x4f0afd(null,_0x19ba1d);});},'filename':function(_0x1725b4,_0x3017f9,_0x9bfad9){const _0x5d4aa4=_0x3017f9[_0xde03('0x2c')][_0xde03('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b3103=path[_0xde03('0x3f')](_0x5d4aa4);const _0x164b6b=Date[_0xde03('0x32')]()+'-'+_0x5d4aa4[_0xde03('0x3e')](_0x5b3103,'')+_0x5b3103;_0x9bfad9(null,_0x164b6b);}})});router[_0xde03('0x25')](_0xde03('0x40'),offlineUploadMulter[_0xde03('0x41')](),controller[_0xde03('0x42')]);router[_0xde03('0x25')](_0xde03('0x18'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xde03('0x25')](_0xde03('0x1c'),auth[_0xde03('0x9')](),controller[_0xde03('0x43')]);router['post'](_0xde03('0x1e'),auth['isAuthenticated'](),controller[_0xde03('0x44')]);router['post'](_0xde03('0x24'),auth[_0xde03('0x9')](),controller[_0xde03('0x45')]);router[_0xde03('0x46')]('/:id',auth[_0xde03('0x9')](),controller[_0xde03('0x47')]);router[_0xde03('0x48')](_0xde03('0xd'),auth[_0xde03('0x9')](),controller[_0xde03('0x49')]);router[_0xde03('0x48')](_0xde03('0xf'),auth[_0xde03('0x9')](),controller[_0xde03('0x4a')]);router[_0xde03('0x48')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0xde03('0x24'),auth[_0xde03('0x9')](),controller['removeAgents']);module[_0xde03('0x4b')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index a5d0995..f451c4f 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 _0x6050=['STRING','ENUM','AmazonAWS','Google','sequelize','exports'];(function(_0x6ca3e0,_0x45acf7){var _0x2f7502=function(_0x2d41d8){while(--_0x2d41d8){_0x6ca3e0['push'](_0x6ca3e0['shift']());}};_0x2f7502(++_0x45acf7);}(_0x6050,0x196));var _0x0605=function(_0x14aea2,_0x441017){_0x14aea2=_0x14aea2-0x0;var _0xaab0b4=_0x6050[_0x14aea2];return _0xaab0b4;};'use strict';var Sequelize=require(_0x0605('0x0'));module[_0x0605('0x1')]={'name':{'type':Sequelize[_0x0605('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x0605('0x3')](_0x0605('0x4'),_0x0605('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x0605('0x2')]}};
\ No newline at end of file
+var _0x6dc0=['Google','sequelize','STRING','ENUM','AmazonAWS'];(function(_0x481730,_0x4283ef){var _0x1c26ae=function(_0x2c1448){while(--_0x2c1448){_0x481730['push'](_0x481730['shift']());}};_0x1c26ae(++_0x4283ef);}(_0x6dc0,0x18c));var _0x06dc=function(_0x50aa4b,_0x77f234){_0x50aa4b=_0x50aa4b-0x0;var _0x20fbd9=_0x6dc0[_0x50aa4b];return _0x20fbd9;};'use strict';var Sequelize=require(_0x06dc('0x0'));module['exports']={'name':{'type':Sequelize[_0x06dc('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x06dc('0x2')](_0x06dc('0x3'),_0x06dc('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x06dc('0x1')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index c4960d8..5272d31 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x58cb22,_0x9c9794){var _0x202197=function(_0x577667){while(--_0x577667){_0x58cb22['push'](_0x58cb22['shift']());}};_0x202197(++_0x9c9794);}(_0x7a54,0x106));var _0x47a5=function(_0x2b05e1,_0x41c8ba){_0x2b05e1=_0x2b05e1-0x0;var _0x4fbb1c=_0x7a54[_0x2b05e1];return _0x4fbb1c;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _0x0b0e=['hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','CloudProvider','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x89e913,_0x2273e2){var _0x1e2d4c=function(_0x2731fd){while(--_0x2731fd){_0x89e913['push'](_0x89e913['shift']());}};_0x1e2d4c(++_0x2273e2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x0b0e[_0x22ffbf];return _0x360c17;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['CloudProvider'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'all':!![]}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x41')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x402a0e){_0x36d137[_0xe0b0('0x42')]=_0x402a0e;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))[_0xe0b0('0x43')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x44')]=function(_0x52ffe4,_0x2aad80){var _0x309bbf={'raw':!![],'where':{'id':_0x52ffe4['params']['id']}},_0x528818={};_0x528818[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db['CloudProvider'][_0xe0b0('0x2b')]);_0x528818[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x52ffe4[_0xe0b0('0x2e')]);_0x528818[_0xe0b0('0x39')]=_['intersection'](_0x528818['model'],_0x528818['query']);_0x309bbf[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x528818['model'],qs[_0xe0b0('0x33')](_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x309bbf[_0xe0b0('0x32')]=_0x309bbf[_0xe0b0('0x32')]['length']?_0x309bbf['attributes']:_0x528818[_0xe0b0('0x31')];if(_0x52ffe4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x309bbf[_0xe0b0('0x45')]=[{'all':!![]}];}_0x309bbf=_[_0xe0b0('0x3b')]({},_0x309bbf,_0x52ffe4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x46')](_0x309bbf)['then'](handleEntityNotFound(_0x2aad80,null))['then'](respondWithResult(_0x2aad80,null))['catch'](handleError(_0x2aad80,null));};exports[_0xe0b0('0x47')]=function(_0x2184d3,_0x2419ce){return db[_0xe0b0('0x2a')]['create'](_0x2184d3[_0xe0b0('0x48')],{})[_0xe0b0('0x23')](respondWithResult(_0x2419ce,0xc9))['catch'](handleError(_0x2419ce,null));};exports['update']=function(_0x2365be,_0x1bc6e0){if(_0x2365be['body']['id']){delete _0x2365be[_0xe0b0('0x48')]['id'];}return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x2365be['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x1bc6e0,null))['then'](saveUpdates(_0x2365be[_0xe0b0('0x48')],null))[_0xe0b0('0x23')](respondWithResult(_0x1bc6e0,null))[_0xe0b0('0x43')](handleError(_0x1bc6e0,null));};exports[_0xe0b0('0x24')]=function(_0x19ee71,_0xf9e694){return db['CloudProvider']['find']({'where':{'id':_0x19ee71[_0xe0b0('0x49')]['id']}})['then'](handleEntityNotFound(_0xf9e694,null))['then'](removeEntity(_0xf9e694,null))[_0xe0b0('0x43')](handleError(_0xf9e694,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index e921ed7..656e0b4 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 _0xffd9=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x2ef1b7,_0x2350bb){var _0x212cd0=function(_0x1bb516){while(--_0x1bb516){_0x2ef1b7['push'](_0x2ef1b7['shift']());}};_0x212cd0(++_0x2350bb);}(_0xffd9,0x19d));var _0x9ffd=function(_0x2d3401,_0x4317d6){_0x2d3401=_0x2d3401-0x0;var _0x50d033=_0xffd9[_0x2d3401];return _0x50d033;};'use strict';var _=require(_0x9ffd('0x0'));var util=require(_0x9ffd('0x1'));var logger=require(_0x9ffd('0x2'))(_0x9ffd('0x3'));var moment=require('moment');var BPromise=require(_0x9ffd('0x4'));var rp=require(_0x9ffd('0x5'));var fs=require('fs');var path=require(_0x9ffd('0x6'));var rimraf=require(_0x9ffd('0x7'));var config=require(_0x9ffd('0x8'));var attributes=require(_0x9ffd('0x9'));module['exports']=function(_0x5d8c52,_0x1c297f){return _0x5d8c52[_0x9ffd('0xa')](_0x9ffd('0xb'),attributes,{'tableName':_0x9ffd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbce8=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util','moment','bluebird'];(function(_0x1b74dc,_0x19e0ad){var _0x25962e=function(_0xfa0749){while(--_0xfa0749){_0x1b74dc['push'](_0x1b74dc['shift']());}};_0x25962e(++_0x19e0ad);}(_0xbce8,0x1ec));var _0x8bce=function(_0x4392af,_0xec5afe){_0x4392af=_0x4392af-0x0;var _0x9fa8eb=_0xbce8[_0x4392af];return _0x9fa8eb;};'use strict';var _=require('lodash');var util=require(_0x8bce('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8bce('0x1'));var BPromise=require(_0x8bce('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bce('0x3'));var rimraf=require(_0x8bce('0x4'));var config=require(_0x8bce('0x5'));var attributes=require(_0x8bce('0x6'));module[_0x8bce('0x7')]=function(_0x2764be,_0x9fedeb){return _0x2764be[_0x8bce('0x8')](_0x8bce('0x9'),attributes,{'tableName':_0x8bce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 269084e..bea9d87 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 _0xcf66=['jayson/promise','client','http','request','then','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc'];(function(_0x4c253b,_0x3205e9){var _0x2f447c=function(_0xddbb70){while(--_0xddbb70){_0x4c253b['push'](_0x4c253b['shift']());}};_0x2f447c(++_0x3205e9);}(_0xcf66,0x71));var _0x6cf6=function(_0x15f580,_0x35dc48){_0x15f580=_0x15f580-0x0;var _0x40a487=_0xcf66[_0x15f580];return _0x40a487;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb082,_0x94c6a9,_0x308d0d){return new BPromise(function(_0x36b892,_0x748c93){return client[_0x6cf6('0xa')](_0x5eb082,_0x308d0d)[_0x6cf6('0xb')](function(_0x5b3827){logger['info']('CloudProvider,\x20%s,\x20%s',_0x94c6a9,_0x6cf6('0xc'));logger['debug'](_0x6cf6('0xd'),_0x94c6a9,_0x6cf6('0xc'),JSON[_0x6cf6('0xe')](_0x5b3827));if(_0x5b3827[_0x6cf6('0xf')]){if(_0x5b3827['error']['code']===0x1f4){logger['error'](_0x6cf6('0x10'),_0x94c6a9,_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);return _0x748c93(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}logger[_0x6cf6('0xf')]('CloudProvider,\x20%s,\x20%s',_0x94c6a9,_0x5b3827[_0x6cf6('0xf')]['message']);return _0x36b892(_0x5b3827[_0x6cf6('0xf')][_0x6cf6('0x11')]);}else{logger['info'](_0x6cf6('0x10'),_0x94c6a9,_0x6cf6('0xc'));_0x36b892(_0x5b3827[_0x6cf6('0x12')][_0x6cf6('0x11')]);}})[_0x6cf6('0x13')](function(_0x2bdb12){logger[_0x6cf6('0xf')](_0x6cf6('0x10'),_0x94c6a9,_0x2bdb12);_0x748c93(_0x2bdb12);});});}
\ No newline at end of file
+var _0x4744=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s'];(function(_0x2cda84,_0x5e433d){var _0x84590e=function(_0x4664b1){while(--_0x4664b1){_0x2cda84['push'](_0x2cda84['shift']());}};_0x84590e(++_0x5e433d);}(_0x4744,0x107));var _0x4474=function(_0x165d3c,_0x582bec){_0x165d3c=_0x165d3c-0x0;var _0x337eff=_0x4744[_0x165d3c];return _0x337eff;};'use strict';var _=require(_0x4474('0x0'));var util=require(_0x4474('0x1'));var moment=require('moment');var BPromise=require(_0x4474('0x2'));var rs=require(_0x4474('0x3'));var fs=require('fs');var Redis=require(_0x4474('0x4'));var db=require(_0x4474('0x5'))['db'];var utils=require(_0x4474('0x6'));var logger=require(_0x4474('0x7'))(_0x4474('0x8'));var config=require(_0x4474('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4474('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc08a4c,_0x3024cd,_0x1dcdf0){return new BPromise(function(_0x387297,_0x247b66){return client[_0x4474('0xb')](_0xc08a4c,_0x1dcdf0)['then'](function(_0x17c4f7){logger[_0x4474('0xc')](_0x4474('0xd'),_0x3024cd,_0x4474('0xe'));logger[_0x4474('0xf')](_0x4474('0x10'),_0x3024cd,_0x4474('0xe'),JSON['stringify'](_0x17c4f7));if(_0x17c4f7['error']){if(_0x17c4f7['error']['code']===0x1f4){logger[_0x4474('0x11')](_0x4474('0xd'),_0x3024cd,_0x17c4f7['error'][_0x4474('0x12')]);return _0x247b66(_0x17c4f7['error'][_0x4474('0x12')]);}logger[_0x4474('0x11')](_0x4474('0xd'),_0x3024cd,_0x17c4f7[_0x4474('0x11')][_0x4474('0x12')]);return _0x387297(_0x17c4f7[_0x4474('0x11')][_0x4474('0x12')]);}else{logger[_0x4474('0xc')](_0x4474('0xd'),_0x3024cd,'request\x20sent');_0x387297(_0x17c4f7[_0x4474('0x13')]['message']);}})['catch'](function(_0x46b79d){logger[_0x4474('0x11')]('CloudProvider,\x20%s,\x20%s',_0x3024cd,_0x46b79d);_0x247b66(_0x46b79d);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 6a1ee33..a654d79 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 _0xcd94=['create','put','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4f11f0,_0xd8b6b9){var _0x495cd9=function(_0x40dfc8){while(--_0x40dfc8){_0x4f11f0['push'](_0x4f11f0['shift']());}};_0x495cd9(++_0xd8b6b9);}(_0xcd94,0x19b));var _0x4cd9=function(_0x3e451f,_0x10500d){_0x3e451f=_0x3e451f-0x0;var _0x57978f=_0xcd94[_0x3e451f];return _0x57978f;};'use strict';var multer=require('multer');var util=require(_0x4cd9('0x0'));var path=require(_0x4cd9('0x1'));var timeout=require(_0x4cd9('0x2'));var express=require(_0x4cd9('0x3'));var router=express[_0x4cd9('0x4')]();var fs_extra=require(_0x4cd9('0x5'));var auth=require(_0x4cd9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4cd9('0x7'));var controller=require(_0x4cd9('0x8'));router[_0x4cd9('0x9')]('/',auth[_0x4cd9('0xa')](),controller[_0x4cd9('0xb')]);router[_0x4cd9('0x9')](_0x4cd9('0xc'),auth[_0x4cd9('0xa')](),controller[_0x4cd9('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4cd9('0xe')]);router[_0x4cd9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x4cd9('0xa')](),controller[_0x4cd9('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x853e=['./cloudProvider.controller','get','index','/:id','isAuthenticated','show','post','create','put','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x853e,0x1ea));var _0xe853=function(_0x96f5e2,_0xfae276){_0x96f5e2=_0x96f5e2-0x0;var _0x22bbe5=_0x853e[_0x96f5e2];return _0x22bbe5;};'use strict';var multer=require('multer');var util=require(_0xe853('0x0'));var path=require('path');var timeout=require(_0xe853('0x1'));var express=require('express');var router=express[_0xe853('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe853('0x3'));var interaction=require(_0xe853('0x4'));var config=require(_0xe853('0x5'));var controller=require(_0xe853('0x6'));router[_0xe853('0x7')]('/',auth['isAuthenticated'](),controller[_0xe853('0x8')]);router[_0xe853('0x7')](_0xe853('0x9'),auth[_0xe853('0xa')](),controller[_0xe853('0xb')]);router[_0xe853('0xc')]('/',auth[_0xe853('0xa')](),controller[_0xe853('0xd')]);router[_0xe853('0xe')](_0xe853('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe853('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xe853('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 161ee49..262f153 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 _0xb844=['STRING','exports'];(function(_0x342929,_0x2276b8){var _0x3e7f17=function(_0x48153e){while(--_0x48153e){_0x342929['push'](_0x342929['shift']());}};_0x3e7f17(++_0x2276b8);}(_0xb844,0x149));var _0x4b84=function(_0x4429d8,_0x1d1923){_0x4429d8=_0x4429d8-0x0;var _0x7246b0=_0xb844[_0x4429d8];return _0x7246b0;};'use strict';var Sequelize=require('sequelize');module[_0x4b84('0x0')]={'name':{'type':Sequelize[_0x4b84('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4b84('0x1')]},'companyId':{'type':Sequelize[_0x4b84('0x1')]},'website':{'type':Sequelize[_0x4b84('0x1')]},'phone':{'type':Sequelize[_0x4b84('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4b84('0x1')]},'street':{'type':Sequelize[_0x4b84('0x1')]},'postalCode':{'type':Sequelize[_0x4b84('0x1')]},'city':{'type':Sequelize[_0x4b84('0x1')]},'country':{'type':Sequelize[_0x4b84('0x1')]},'email':{'type':Sequelize[_0x4b84('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4b84('0x1')]},'sStreet':{'type':Sequelize[_0x4b84('0x1')]},'sPostalCode':{'type':Sequelize[_0x4b84('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x4b84('0x1')]},'description':{'type':Sequelize[_0x4b84('0x1')]}};
\ No newline at end of file
+var _0x9320=['name','sequelize','exports','STRING'];(function(_0x472590,_0x38c69c){var _0x3a43d6=function(_0x2e7e1e){while(--_0x2e7e1e){_0x472590['push'](_0x472590['shift']());}};_0x3a43d6(++_0x38c69c);}(_0x9320,0xfd));var _0x0932=function(_0x26261f,_0x1202db){_0x26261f=_0x26261f-0x0;var _0x4316d0=_0x9320[_0x26261f];return _0x4316d0;};'use strict';var Sequelize=require(_0x0932('0x0'));module[_0x0932('0x1')]={'name':{'type':Sequelize[_0x0932('0x2')],'unique':_0x0932('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0932('0x2')]},'companyId':{'type':Sequelize[_0x0932('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0932('0x2')]},'fax':{'type':Sequelize[_0x0932('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0932('0x2')]},'postalCode':{'type':Sequelize[_0x0932('0x2')]},'city':{'type':Sequelize[_0x0932('0x2')]},'country':{'type':Sequelize[_0x0932('0x2')]},'email':{'type':Sequelize[_0x0932('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0932('0x2')]},'sStreet':{'type':Sequelize[_0x0932('0x2')]},'sPostalCode':{'type':Sequelize[_0x0932('0x2')]},'sCity':{'type':Sequelize[_0x0932('0x2')]},'sCountry':{'type':Sequelize[_0x0932('0x2')]},'description':{'type':Sequelize[_0x0932('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 5555f6b..52a375a 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 _0x32d6=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','json','apply','reject','save','update','destroy','then','get','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','map','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Companies','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','findOne','CmContact','rawAttributes','order','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring'];(function(_0x2b171a,_0x582765){var _0x33acbc=function(_0x97b429){while(--_0x97b429){_0x2b171a['push'](_0x2b171a['shift']());}};_0x33acbc(++_0x582765);}(_0x32d6,0xf8));var _0x632d=function(_0x3a92c3,_0x1b49cf){_0x3a92c3=_0x3a92c3-0x0;var _0x155ce1=_0x32d6[_0x3a92c3];return _0x155ce1;};'use strict';var emlformat=require(_0x632d('0x0'));var rimraf=require(_0x632d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x632d('0x2'));var rp=require(_0x632d('0x3'));var moment=require(_0x632d('0x4'));var BPromise=require(_0x632d('0x5'));var Mustache=require(_0x632d('0x6'));var util=require(_0x632d('0x7'));var path=require(_0x632d('0x8'));var sox=require(_0x632d('0x9'));var csv=require(_0x632d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x632d('0xb'));var _=require(_0x632d('0xc'));var squel=require(_0x632d('0xd'));var crypto=require(_0x632d('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x632d('0xf'));var Papa=require(_0x632d('0x10'));var Redis=require('ioredis');var authService=require(_0x632d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x632d('0x12'));var hardwareService=require(_0x632d('0x13'));var logger=require(_0x632d('0x14'))(_0x632d('0x15'));var utils=require(_0x632d('0x16'));var config=require(_0x632d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x632d('0x18'))['db'];function respondWithStatusCode(_0x517c10,_0x5c2826){_0x5c2826=_0x5c2826||0xcc;return function(_0x2b5da7){if(_0x2b5da7){return _0x517c10[_0x632d('0x19')](_0x5c2826);}return _0x517c10[_0x632d('0x1a')](_0x5c2826)[_0x632d('0x1b')]();};}function respondWithResult(_0x5706e9,_0x5a1b01){_0x5a1b01=_0x5a1b01||0xc8;return function(_0x57e280){if(_0x57e280){return _0x5706e9[_0x632d('0x1a')](_0x5a1b01)['json'](_0x57e280);}};}function respondWithFilteredResult(_0x977a5c,_0x2aa81b){return function(_0x44401b){if(_0x44401b){var _0x228bdd=typeof _0x2aa81b['offset']==='undefined'&&typeof _0x2aa81b['limit']===_0x632d('0x1c');var _0x5903f4=_0x44401b[_0x632d('0x1d')];var _0x10dbf0=_0x228bdd?0x0:_0x2aa81b[_0x632d('0x1e')];var _0x295232=_0x228bdd?_0x44401b[_0x632d('0x1d')]:_0x2aa81b[_0x632d('0x1e')]+_0x2aa81b[_0x632d('0x1f')];var _0x41d0bf;if(_0x295232>=_0x5903f4){_0x295232=_0x5903f4;_0x41d0bf=0xc8;}else{_0x41d0bf=0xce;}_0x977a5c['status'](_0x41d0bf);return _0x977a5c['set']('Content-Range',_0x10dbf0+'-'+_0x295232+'/'+_0x5903f4)[_0x632d('0x20')](_0x44401b);}return null;};}function patchUpdates(_0x3034cb){return function(_0x2b544f){try{jsonpatch[_0x632d('0x21')](_0x2b544f,_0x3034cb,!![]);}catch(_0x2bd70b){return BPromise[_0x632d('0x22')](_0x2bd70b);}return _0x2b544f[_0x632d('0x23')]();};}function saveUpdates(_0x2e13e7,_0x16527e){return function(_0x558111){if(_0x558111){return _0x558111[_0x632d('0x24')](_0x2e13e7)['then'](function(_0x34bd08){return _0x34bd08;});}return null;};}function removeEntity(_0x5293e8,_0x5ee19e){return function(_0x2d33a5){if(_0x2d33a5){return _0x2d33a5[_0x632d('0x25')]()[_0x632d('0x26')](function(){var _0x49bf05=_0x2d33a5[_0x632d('0x27')]({'plain':!![]});var _0x32a058='Companies';return db[_0x632d('0x28')][_0x632d('0x25')]({'where':{'type':_0x32a058,'resourceId':_0x49bf05['id']}})[_0x632d('0x26')](function(){return _0x2d33a5;});})[_0x632d('0x26')](function(){_0x5293e8[_0x632d('0x1a')](0xcc)[_0x632d('0x1b')]();});}};}function handleEntityNotFound(_0x122f16,_0x5c13fc){return function(_0x11198b){if(!_0x11198b){_0x122f16[_0x632d('0x19')](0x194);}return _0x11198b;};}function handleError(_0x349afe,_0x7f4dd){_0x7f4dd=_0x7f4dd||0x1f4;return function(_0x16b751){logger['error'](_0x16b751[_0x632d('0x29')]);if(_0x16b751[_0x632d('0x2a')]){delete _0x16b751[_0x632d('0x2a')];}_0x349afe[_0x632d('0x1a')](_0x7f4dd)[_0x632d('0x2b')](_0x16b751);};}exports[_0x632d('0x2c')]=function(_0x338830,_0x87514){var _0x2879ee={},_0x4b8abc={},_0x4e63c2={'count':0x0,'rows':[]};return db[_0x632d('0x2d')][_0x632d('0x2e')]()[_0x632d('0x26')](function(_0x5af753){_0x4b8abc[_0x632d('0x2f')]=_[_0x632d('0x30')](_0x5af753);_0x4b8abc[_0x632d('0x31')]=_[_0x632d('0x30')](_0x338830['query']);_0x4b8abc[_0x632d('0x32')]=_['intersection'](_0x4b8abc[_0x632d('0x2f')],_0x4b8abc[_0x632d('0x31')]);_0x2879ee[_0x632d('0x33')]=_[_0x632d('0x34')](_0x4b8abc[_0x632d('0x2f')],qs[_0x632d('0x35')](_0x338830[_0x632d('0x31')][_0x632d('0x35')]));_0x2879ee[_0x632d('0x33')]=_0x2879ee[_0x632d('0x33')][_0x632d('0x36')]?_0x2879ee['attributes']:_0x4b8abc[_0x632d('0x2f')];if(!_0x338830[_0x632d('0x31')]['hasOwnProperty'](_0x632d('0x37'))){_0x2879ee[_0x632d('0x1f')]=qs['limit'](_0x338830[_0x632d('0x31')][_0x632d('0x1f')]);_0x2879ee['offset']=qs[_0x632d('0x1e')](_0x338830[_0x632d('0x31')][_0x632d('0x1e')]);}_0x2879ee['order']=qs[_0x632d('0x38')](_0x338830[_0x632d('0x31')][_0x632d('0x38')]);_0x2879ee[_0x632d('0x39')]=qs[_0x632d('0x32')](_[_0x632d('0x3a')](_0x338830[_0x632d('0x31')],_0x4b8abc['filters']),_0x5af753);if(_0x338830['query'][_0x632d('0x3b')]){_0x2879ee['where']=_[_0x632d('0x3c')](_0x2879ee[_0x632d('0x39')],{'$or':_[_0x632d('0x3d')](_0x2879ee['attributes'],function(_0x1772b6){var _0x1543be={};_0x1543be[_0x1772b6]={'$like':'%'+_0x338830[_0x632d('0x31')][_0x632d('0x3b')]+'%'};return _0x1543be;})});}_0x2879ee=_['merge']({},_0x2879ee,_0x338830['options']);var _0x516178={'where':_0x2879ee[_0x632d('0x39')]};return db[_0x632d('0x2d')]['count'](_0x516178)['then'](function(_0x46e20b){_0x4e63c2[_0x632d('0x1d')]=_0x46e20b;if(_0x338830[_0x632d('0x31')][_0x632d('0x3e')]){_0x2879ee[_0x632d('0x3f')]=[{'all':!![]}];}return db[_0x632d('0x2d')][_0x632d('0x40')](_0x2879ee);})[_0x632d('0x26')](function(_0x4bb94b){_0x4e63c2[_0x632d('0x41')]=_0x4bb94b;return _0x4e63c2;})[_0x632d('0x26')](respondWithFilteredResult(_0x87514,_0x2879ee))[_0x632d('0x42')](handleError(_0x87514,null));})[_0x632d('0x42')](handleError(_0x87514,null));};exports[_0x632d('0x43')]=function(_0x167231,_0x133acb){var _0x4a296a={'raw':![],'where':{'id':_0x167231[_0x632d('0x44')]['id']}},_0x5d6b0c={};_0x5d6b0c[_0x632d('0x2f')]=_[_0x632d('0x30')](db['CmCompany']['rawAttributes']);_0x5d6b0c[_0x632d('0x31')]=_['keys'](_0x167231['query']);_0x5d6b0c[_0x632d('0x32')]=_[_0x632d('0x34')](_0x5d6b0c[_0x632d('0x2f')],_0x5d6b0c[_0x632d('0x31')]);_0x4a296a['attributes']=_[_0x632d('0x34')](_0x5d6b0c['model'],qs[_0x632d('0x35')](_0x167231[_0x632d('0x31')]['fields']));_0x4a296a[_0x632d('0x33')]=_0x4a296a[_0x632d('0x33')][_0x632d('0x36')]?_0x4a296a[_0x632d('0x33')]:_0x5d6b0c[_0x632d('0x2f')];if(_0x167231[_0x632d('0x31')][_0x632d('0x3e')]){_0x4a296a[_0x632d('0x3f')]=[{'all':!![]}];}_0x4a296a=_[_0x632d('0x3c')]({},_0x4a296a,_0x167231[_0x632d('0x45')]);return db[_0x632d('0x2d')][_0x632d('0x46')](_0x4a296a)[_0x632d('0x26')](handleEntityNotFound(_0x133acb,null))['then'](respondWithResult(_0x133acb,null))[_0x632d('0x42')](handleError(_0x133acb,null));};exports[_0x632d('0x47')]=function(_0x58892e,_0x5786d5){return db[_0x632d('0x2d')][_0x632d('0x47')](_0x58892e[_0x632d('0x48')],{})['then'](function(_0x41ffa8){var _0x5ef223=_0x58892e['user']['get']({'plain':!![]});if(!_0x5ef223)throw new Error(_0x632d('0x49'));if(_0x5ef223['role']===_0x632d('0x4a')){var _0x501588=_0x41ffa8[_0x632d('0x27')]({'plain':!![]});var _0x271692=_0x632d('0x4b');return db['UserProfileSection'][_0x632d('0x46')]({'where':{'name':_0x271692,'userProfileId':_0x5ef223[_0x632d('0x4c')]},'raw':!![]})[_0x632d('0x26')](function(_0x416b7e){if(_0x416b7e&&_0x416b7e[_0x632d('0x4d')]===0x0){return db['UserProfileResource'][_0x632d('0x47')]({'name':_0x501588[_0x632d('0x2a')],'resourceId':_0x501588['id'],'type':_0x416b7e[_0x632d('0x2a')],'sectionId':_0x416b7e['id']},{})[_0x632d('0x26')](function(){return _0x41ffa8;});}else{return _0x41ffa8;}})[_0x632d('0x42')](function(_0x4adc1d){logger[_0x632d('0x4e')](_0x632d('0x4f'),_0x4adc1d);throw _0x4adc1d;});}return _0x41ffa8;})[_0x632d('0x26')](respondWithResult(_0x5786d5,0xc9))[_0x632d('0x42')](handleError(_0x5786d5,null));};exports[_0x632d('0x24')]=function(_0x286d35,_0x37ca40){if(_0x286d35[_0x632d('0x48')]['id']){delete _0x286d35[_0x632d('0x48')]['id'];}return db[_0x632d('0x2d')]['find']({'where':{'id':_0x286d35['params']['id']}})['then'](handleEntityNotFound(_0x37ca40,null))[_0x632d('0x26')](saveUpdates(_0x286d35[_0x632d('0x48')],null))[_0x632d('0x26')](respondWithResult(_0x37ca40,null))[_0x632d('0x42')](handleError(_0x37ca40,null));};exports[_0x632d('0x25')]=function(_0x35b671,_0x3c1acb){return db[_0x632d('0x2d')][_0x632d('0x46')]({'where':{'id':_0x35b671[_0x632d('0x44')]['id']}})[_0x632d('0x26')](handleEntityNotFound(_0x3c1acb,null))['then'](removeEntity(_0x3c1acb,null))[_0x632d('0x42')](handleError(_0x3c1acb,null));};exports[_0x632d('0x2e')]=function(_0x437619,_0x1d963b){return db[_0x632d('0x2d')][_0x632d('0x2e')]()[_0x632d('0x26')](respondWithResult(_0x1d963b,null))[_0x632d('0x42')](handleError(_0x1d963b,null));};exports[_0x632d('0x50')]=function(_0x1579e8,_0x5d5205,_0x3c71bf){return db['CmContact'][_0x632d('0x46')]({'where':{'id':_0x1579e8[_0x632d('0x44')]['id']}})[_0x632d('0x26')](handleEntityNotFound(_0x5d5205,null))[_0x632d('0x26')](function(_0x322d50){if(_0x322d50){return _0x322d50[_0x632d('0x50')](_0x1579e8['body']['ids'],_['omit'](_0x1579e8[_0x632d('0x48')],[_0x632d('0x51'),'id'])||{});}})[_0x632d('0x26')](respondWithResult(_0x5d5205,null))[_0x632d('0x42')](handleError(_0x5d5205,null));};exports[_0x632d('0x52')]=function(_0x4891cf,_0x19a540,_0x20ab58){var _0x5d9f69={};var _0x5e6bdb={};var _0x3168d4;var _0x5a6fc4;return db[_0x632d('0x2d')][_0x632d('0x53')]({'where':{'id':_0x4891cf[_0x632d('0x44')]['id']}})['then'](handleEntityNotFound(_0x19a540,null))[_0x632d('0x26')](function(_0x4e3d05){if(_0x4e3d05){_0x3168d4=_0x4e3d05;_0x5e6bdb[_0x632d('0x2f')]=_['keys'](db[_0x632d('0x54')][_0x632d('0x55')]);_0x5e6bdb['query']=_[_0x632d('0x30')](_0x4891cf[_0x632d('0x31')]);_0x5e6bdb[_0x632d('0x32')]=_[_0x632d('0x34')](_0x5e6bdb[_0x632d('0x2f')],_0x5e6bdb[_0x632d('0x31')]);_0x5d9f69[_0x632d('0x33')]=_[_0x632d('0x34')](_0x5e6bdb[_0x632d('0x2f')],qs[_0x632d('0x35')](_0x4891cf['query'][_0x632d('0x35')]));_0x5d9f69[_0x632d('0x33')]=_0x5d9f69[_0x632d('0x33')][_0x632d('0x36')]?_0x5d9f69[_0x632d('0x33')]:_0x5e6bdb[_0x632d('0x2f')];_0x5d9f69[_0x632d('0x56')]=qs[_0x632d('0x38')](_0x4891cf['query']['sort']);_0x5d9f69['where']=qs[_0x632d('0x32')](_[_0x632d('0x3a')](_0x4891cf['query'],_0x5e6bdb[_0x632d('0x32')]));if(_0x4891cf[_0x632d('0x31')][_0x632d('0x3b')]){_0x5d9f69[_0x632d('0x39')]=_[_0x632d('0x3c')](_0x5d9f69['where'],{'$or':_[_0x632d('0x3d')](_0x5d9f69[_0x632d('0x33')],function(_0x580163){var _0x4529b7={};_0x4529b7[_0x580163]={'$like':'%'+_0x4891cf[_0x632d('0x31')]['filter']+'%'};return _0x4529b7;})});}_0x5d9f69=_[_0x632d('0x3c')]({},_0x5d9f69,_0x4891cf[_0x632d('0x45')]);return _0x3168d4[_0x632d('0x52')](_0x5d9f69);}})[_0x632d('0x26')](function(_0x3922a2){if(_0x3922a2){_0x5a6fc4=_0x3922a2['length'];if(!_0x4891cf[_0x632d('0x31')][_0x632d('0x57')](_0x632d('0x37'))){_0x5d9f69[_0x632d('0x1f')]=qs[_0x632d('0x1f')](_0x4891cf[_0x632d('0x31')][_0x632d('0x1f')]);_0x5d9f69['offset']=qs[_0x632d('0x1e')](_0x4891cf['query'][_0x632d('0x1e')]);}return _0x3168d4[_0x632d('0x52')](_0x5d9f69);}})[_0x632d('0x26')](function(_0x428afe){if(_0x428afe){return _0x428afe?{'count':_0x5a6fc4,'rows':_0x428afe}:null;}})[_0x632d('0x26')](respondWithResult(_0x19a540,null))['catch'](handleError(_0x19a540,null));};
\ No newline at end of file
+var _0x4a62=['status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','sendStatus','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','include','findAll','catch','show','params','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','map','getContacts','eml-format','rimraf','fast-json-patch','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xa86c5c,_0x4f7e56){var _0x55fe5b=function(_0x155229){while(--_0x155229){_0xa86c5c['push'](_0xa86c5c['shift']());}};_0x55fe5b(++_0x4f7e56);}(_0x4a62,0xeb));var _0x24a6=function(_0x2bdfc2,_0x4d9fe2){_0x2bdfc2=_0x2bdfc2-0x0;var _0x35a654=_0x4a62[_0x2bdfc2];return _0x35a654;};'use strict';var emlformat=require(_0x24a6('0x0'));var rimraf=require(_0x24a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24a6('0x2'));var rp=require('request-promise');var moment=require(_0x24a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x24a6('0x4'));var util=require('util');var path=require('path');var sox=require(_0x24a6('0x5'));var csv=require(_0x24a6('0x6'));var ejs=require(_0x24a6('0x7'));var fs=require('fs');var fs_extra=require(_0x24a6('0x8'));var _=require(_0x24a6('0x9'));var squel=require(_0x24a6('0xa'));var crypto=require('crypto');var jsforce=require(_0x24a6('0xb'));var deskjs=require(_0x24a6('0xc'));var toCsv=require('to-csv');var querystring=require(_0x24a6('0xd'));var Papa=require(_0x24a6('0xe'));var Redis=require(_0x24a6('0xf'));var authService=require(_0x24a6('0x10'));var qs=require(_0x24a6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24a6('0x12'));var logger=require('../../config/logger')(_0x24a6('0x13'));var utils=require(_0x24a6('0x14'));var config=require(_0x24a6('0x15'));var licenseUtil=require(_0x24a6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39eceb,_0x5f505e){_0x5f505e=_0x5f505e||0xcc;return function(_0x38179d){if(_0x38179d){return _0x39eceb['sendStatus'](_0x5f505e);}return _0x39eceb['status'](_0x5f505e)['end']();};}function respondWithResult(_0x126d76,_0x3ff142){_0x3ff142=_0x3ff142||0xc8;return function(_0x430800){if(_0x430800){return _0x126d76[_0x24a6('0x17')](_0x3ff142)[_0x24a6('0x18')](_0x430800);}};}function respondWithFilteredResult(_0x472d86,_0x27733a){return function(_0x215f6f){if(_0x215f6f){var _0x583d5c=typeof _0x27733a['offset']===_0x24a6('0x19')&&typeof _0x27733a[_0x24a6('0x1a')]===_0x24a6('0x19');var _0x31f138=_0x215f6f[_0x24a6('0x1b')];var _0x3baf6b=_0x583d5c?0x0:_0x27733a[_0x24a6('0x1c')];var _0x3d7695=_0x583d5c?_0x215f6f[_0x24a6('0x1b')]:_0x27733a['offset']+_0x27733a[_0x24a6('0x1a')];var _0x1b3777;if(_0x3d7695>=_0x31f138){_0x3d7695=_0x31f138;_0x1b3777=0xc8;}else{_0x1b3777=0xce;}_0x472d86[_0x24a6('0x17')](_0x1b3777);return _0x472d86['set'](_0x24a6('0x1d'),_0x3baf6b+'-'+_0x3d7695+'/'+_0x31f138)[_0x24a6('0x18')](_0x215f6f);}return null;};}function patchUpdates(_0x1f230d){return function(_0x511b8a){try{jsonpatch[_0x24a6('0x1e')](_0x511b8a,_0x1f230d,!![]);}catch(_0x2c4c2b){return BPromise[_0x24a6('0x1f')](_0x2c4c2b);}return _0x511b8a[_0x24a6('0x20')]();};}function saveUpdates(_0x533b5b,_0x5a64c9){return function(_0x5eb94c){if(_0x5eb94c){return _0x5eb94c[_0x24a6('0x21')](_0x533b5b)[_0x24a6('0x22')](function(_0x1a44bb){return _0x1a44bb;});}return null;};}function removeEntity(_0x64ad0c,_0x4feb08){return function(_0x243398){if(_0x243398){return _0x243398[_0x24a6('0x23')]()[_0x24a6('0x22')](function(){var _0x292665=_0x243398[_0x24a6('0x24')]({'plain':!![]});var _0x5320ab=_0x24a6('0x25');return db[_0x24a6('0x26')][_0x24a6('0x23')]({'where':{'type':_0x5320ab,'resourceId':_0x292665['id']}})[_0x24a6('0x22')](function(){return _0x243398;});})[_0x24a6('0x22')](function(){_0x64ad0c[_0x24a6('0x17')](0xcc)[_0x24a6('0x27')]();});}};}function handleEntityNotFound(_0x19b35f,_0x3d0df3){return function(_0x1ecec4){if(!_0x1ecec4){_0x19b35f[_0x24a6('0x28')](0x194);}return _0x1ecec4;};}function handleError(_0x32bad4,_0x5ee263){_0x5ee263=_0x5ee263||0x1f4;return function(_0x4c051b){logger[_0x24a6('0x29')](_0x4c051b[_0x24a6('0x2a')]);if(_0x4c051b[_0x24a6('0x2b')]){delete _0x4c051b[_0x24a6('0x2b')];}_0x32bad4['status'](_0x5ee263)[_0x24a6('0x2c')](_0x4c051b);};}exports[_0x24a6('0x2d')]=function(_0x4a48a5,_0x37c078){var _0x3d0e5f={},_0x41162c={},_0x2172ae={'count':0x0,'rows':[]};return db[_0x24a6('0x2e')][_0x24a6('0x2f')]()['then'](function(_0x21531a){_0x41162c['model']=_[_0x24a6('0x30')](_0x21531a);_0x41162c[_0x24a6('0x31')]=_[_0x24a6('0x30')](_0x4a48a5[_0x24a6('0x31')]);_0x41162c[_0x24a6('0x32')]=_[_0x24a6('0x33')](_0x41162c[_0x24a6('0x34')],_0x41162c['query']);_0x3d0e5f[_0x24a6('0x35')]=_[_0x24a6('0x33')](_0x41162c[_0x24a6('0x34')],qs[_0x24a6('0x36')](_0x4a48a5[_0x24a6('0x31')][_0x24a6('0x36')]));_0x3d0e5f[_0x24a6('0x35')]=_0x3d0e5f[_0x24a6('0x35')][_0x24a6('0x37')]?_0x3d0e5f[_0x24a6('0x35')]:_0x41162c['model'];if(!_0x4a48a5['query'][_0x24a6('0x38')](_0x24a6('0x39'))){_0x3d0e5f[_0x24a6('0x1a')]=qs[_0x24a6('0x1a')](_0x4a48a5['query'][_0x24a6('0x1a')]);_0x3d0e5f[_0x24a6('0x1c')]=qs[_0x24a6('0x1c')](_0x4a48a5['query'][_0x24a6('0x1c')]);}_0x3d0e5f[_0x24a6('0x3a')]=qs[_0x24a6('0x3b')](_0x4a48a5[_0x24a6('0x31')][_0x24a6('0x3b')]);_0x3d0e5f[_0x24a6('0x3c')]=qs[_0x24a6('0x32')](_[_0x24a6('0x3d')](_0x4a48a5[_0x24a6('0x31')],_0x41162c[_0x24a6('0x32')]),_0x21531a);if(_0x4a48a5[_0x24a6('0x31')][_0x24a6('0x3e')]){_0x3d0e5f[_0x24a6('0x3c')]=_[_0x24a6('0x3f')](_0x3d0e5f['where'],{'$or':_['map'](_0x3d0e5f[_0x24a6('0x35')],function(_0x54ca12){var _0x9ffb07={};_0x9ffb07[_0x54ca12]={'$like':'%'+_0x4a48a5['query'][_0x24a6('0x3e')]+'%'};return _0x9ffb07;})});}_0x3d0e5f=_[_0x24a6('0x3f')]({},_0x3d0e5f,_0x4a48a5['options']);var _0x16f210={'where':_0x3d0e5f['where']};return db[_0x24a6('0x2e')][_0x24a6('0x1b')](_0x16f210)[_0x24a6('0x22')](function(_0x4a0291){_0x2172ae[_0x24a6('0x1b')]=_0x4a0291;if(_0x4a48a5[_0x24a6('0x31')]['includeAll']){_0x3d0e5f[_0x24a6('0x40')]=[{'all':!![]}];}return db[_0x24a6('0x2e')][_0x24a6('0x41')](_0x3d0e5f);})[_0x24a6('0x22')](function(_0x29da3f){_0x2172ae['rows']=_0x29da3f;return _0x2172ae;})[_0x24a6('0x22')](respondWithFilteredResult(_0x37c078,_0x3d0e5f))[_0x24a6('0x42')](handleError(_0x37c078,null));})[_0x24a6('0x42')](handleError(_0x37c078,null));};exports[_0x24a6('0x43')]=function(_0x561845,_0x4e6f11){var _0x24e789={'raw':![],'where':{'id':_0x561845[_0x24a6('0x44')]['id']}},_0x342584={};_0x342584[_0x24a6('0x34')]=_[_0x24a6('0x30')](db[_0x24a6('0x2e')][_0x24a6('0x45')]);_0x342584['query']=_[_0x24a6('0x30')](_0x561845[_0x24a6('0x31')]);_0x342584['filters']=_[_0x24a6('0x33')](_0x342584[_0x24a6('0x34')],_0x342584['query']);_0x24e789[_0x24a6('0x35')]=_['intersection'](_0x342584[_0x24a6('0x34')],qs[_0x24a6('0x36')](_0x561845[_0x24a6('0x31')][_0x24a6('0x36')]));_0x24e789[_0x24a6('0x35')]=_0x24e789[_0x24a6('0x35')][_0x24a6('0x37')]?_0x24e789[_0x24a6('0x35')]:_0x342584[_0x24a6('0x34')];if(_0x561845['query'][_0x24a6('0x46')]){_0x24e789['include']=[{'all':!![]}];}_0x24e789=_[_0x24a6('0x3f')]({},_0x24e789,_0x561845[_0x24a6('0x47')]);return db['CmCompany'][_0x24a6('0x48')](_0x24e789)[_0x24a6('0x22')](handleEntityNotFound(_0x4e6f11,null))[_0x24a6('0x22')](respondWithResult(_0x4e6f11,null))[_0x24a6('0x42')](handleError(_0x4e6f11,null));};exports[_0x24a6('0x49')]=function(_0x5c00b0,_0x8b8e77){return db[_0x24a6('0x2e')][_0x24a6('0x49')](_0x5c00b0[_0x24a6('0x4a')],{})[_0x24a6('0x22')](function(_0x4fa08f){var _0x16d232=_0x5c00b0[_0x24a6('0x4b')]['get']({'plain':!![]});if(!_0x16d232)throw new Error(_0x24a6('0x4c'));if(_0x16d232['role']===_0x24a6('0x4b')){var _0x117c23=_0x4fa08f['get']({'plain':!![]});var _0x41af8c=_0x24a6('0x25');return db['UserProfileSection'][_0x24a6('0x48')]({'where':{'name':_0x41af8c,'userProfileId':_0x16d232[_0x24a6('0x4d')]},'raw':!![]})[_0x24a6('0x22')](function(_0x6ef30b){if(_0x6ef30b&&_0x6ef30b[_0x24a6('0x4e')]===0x0){return db[_0x24a6('0x26')][_0x24a6('0x49')]({'name':_0x117c23[_0x24a6('0x2b')],'resourceId':_0x117c23['id'],'type':_0x6ef30b[_0x24a6('0x2b')],'sectionId':_0x6ef30b['id']},{})[_0x24a6('0x22')](function(){return _0x4fa08f;});}else{return _0x4fa08f;}})[_0x24a6('0x42')](function(_0x2dcba8){logger[_0x24a6('0x29')](_0x24a6('0x4f'),_0x2dcba8);throw _0x2dcba8;});}return _0x4fa08f;})[_0x24a6('0x22')](respondWithResult(_0x8b8e77,0xc9))[_0x24a6('0x42')](handleError(_0x8b8e77,null));};exports[_0x24a6('0x21')]=function(_0x3a3873,_0x3b47c7){if(_0x3a3873[_0x24a6('0x4a')]['id']){delete _0x3a3873[_0x24a6('0x4a')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x3a3873[_0x24a6('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b47c7,null))[_0x24a6('0x22')](saveUpdates(_0x3a3873['body'],null))[_0x24a6('0x22')](respondWithResult(_0x3b47c7,null))['catch'](handleError(_0x3b47c7,null));};exports['destroy']=function(_0x240951,_0x369e79){return db['CmCompany'][_0x24a6('0x48')]({'where':{'id':_0x240951[_0x24a6('0x44')]['id']}})[_0x24a6('0x22')](handleEntityNotFound(_0x369e79,null))[_0x24a6('0x22')](removeEntity(_0x369e79,null))[_0x24a6('0x42')](handleError(_0x369e79,null));};exports[_0x24a6('0x2f')]=function(_0x2347d4,_0x48a0b8){return db[_0x24a6('0x2e')][_0x24a6('0x2f')]()[_0x24a6('0x22')](respondWithResult(_0x48a0b8,null))['catch'](handleError(_0x48a0b8,null));};exports['addContacts']=function(_0x5bd768,_0x59f914,_0x42dc0c){return db[_0x24a6('0x50')][_0x24a6('0x48')]({'where':{'id':_0x5bd768[_0x24a6('0x44')]['id']}})[_0x24a6('0x22')](handleEntityNotFound(_0x59f914,null))[_0x24a6('0x22')](function(_0x203e6f){if(_0x203e6f){return _0x203e6f[_0x24a6('0x51')](_0x5bd768[_0x24a6('0x4a')][_0x24a6('0x52')],_[_0x24a6('0x53')](_0x5bd768[_0x24a6('0x4a')],[_0x24a6('0x52'),'id'])||{});}})[_0x24a6('0x22')](respondWithResult(_0x59f914,null))[_0x24a6('0x42')](handleError(_0x59f914,null));};exports['getContacts']=function(_0x24676e,_0x5598cb,_0x38394e){var _0x5b7735={};var _0x532508={};var _0x33ee14;var _0x273c72;return db['CmCompany']['findOne']({'where':{'id':_0x24676e[_0x24a6('0x44')]['id']}})[_0x24a6('0x22')](handleEntityNotFound(_0x5598cb,null))[_0x24a6('0x22')](function(_0x196538){if(_0x196538){_0x33ee14=_0x196538;_0x532508['model']=_[_0x24a6('0x30')](db[_0x24a6('0x50')][_0x24a6('0x45')]);_0x532508[_0x24a6('0x31')]=_[_0x24a6('0x30')](_0x24676e[_0x24a6('0x31')]);_0x532508['filters']=_[_0x24a6('0x33')](_0x532508[_0x24a6('0x34')],_0x532508['query']);_0x5b7735['attributes']=_[_0x24a6('0x33')](_0x532508['model'],qs['fields'](_0x24676e['query'][_0x24a6('0x36')]));_0x5b7735[_0x24a6('0x35')]=_0x5b7735[_0x24a6('0x35')][_0x24a6('0x37')]?_0x5b7735[_0x24a6('0x35')]:_0x532508[_0x24a6('0x34')];_0x5b7735[_0x24a6('0x3a')]=qs[_0x24a6('0x3b')](_0x24676e['query'][_0x24a6('0x3b')]);_0x5b7735[_0x24a6('0x3c')]=qs[_0x24a6('0x32')](_[_0x24a6('0x3d')](_0x24676e[_0x24a6('0x31')],_0x532508['filters']));if(_0x24676e[_0x24a6('0x31')][_0x24a6('0x3e')]){_0x5b7735[_0x24a6('0x3c')]=_['merge'](_0x5b7735[_0x24a6('0x3c')],{'$or':_[_0x24a6('0x54')](_0x5b7735[_0x24a6('0x35')],function(_0x24a641){var _0x5be6ac={};_0x5be6ac[_0x24a641]={'$like':'%'+_0x24676e[_0x24a6('0x31')][_0x24a6('0x3e')]+'%'};return _0x5be6ac;})});}_0x5b7735=_[_0x24a6('0x3f')]({},_0x5b7735,_0x24676e[_0x24a6('0x47')]);return _0x33ee14[_0x24a6('0x55')](_0x5b7735);}})[_0x24a6('0x22')](function(_0x2437e1){if(_0x2437e1){_0x273c72=_0x2437e1['length'];if(!_0x24676e[_0x24a6('0x31')][_0x24a6('0x38')](_0x24a6('0x39'))){_0x5b7735[_0x24a6('0x1a')]=qs[_0x24a6('0x1a')](_0x24676e[_0x24a6('0x31')][_0x24a6('0x1a')]);_0x5b7735['offset']=qs[_0x24a6('0x1c')](_0x24676e[_0x24a6('0x31')][_0x24a6('0x1c')]);}return _0x33ee14[_0x24a6('0x55')](_0x5b7735);}})['then'](function(_0x3c1b49){if(_0x3c1b49){return _0x3c1b49?{'count':_0x273c72,'rows':_0x3c1b49}:null;}})['then'](respondWithResult(_0x5598cb,null))['catch'](handleError(_0x5598cb,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index a764a52..4f65842 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 _0x4763=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','request-promise','path','rimraf'];(function(_0x3afa38,_0x3ee8fd){var _0x20aafa=function(_0x5329d8){while(--_0x5329d8){_0x3afa38['push'](_0x3afa38['shift']());}};_0x20aafa(++_0x3ee8fd);}(_0x4763,0xe2));var _0x3476=function(_0x15c4da,_0x520f2b){_0x15c4da=_0x15c4da-0x0;var _0x12a803=_0x4763[_0x15c4da];return _0x12a803;};'use strict';var _=require(_0x3476('0x0'));var util=require('util');var logger=require(_0x3476('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3476('0x2'));var fs=require('fs');var path=require(_0x3476('0x3'));var rimraf=require(_0x3476('0x4'));var config=require(_0x3476('0x5'));var attributes=require(_0x3476('0x6'));module[_0x3476('0x7')]=function(_0x3f6172,_0x38d712){return _0x3f6172[_0x3476('0x8')](_0x3476('0x9'),attributes,{'tableName':_0x3476('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61f4=['exports','CmCompany','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x153d0c,_0x39ebdf){var _0x3aec27=function(_0x3f4b){while(--_0x3f4b){_0x153d0c['push'](_0x153d0c['shift']());}};_0x3aec27(++_0x39ebdf);}(_0x61f4,0xd3));var _0x461f=function(_0x28702b,_0x3bbf32){_0x28702b=_0x28702b-0x0;var _0xae94ee=_0x61f4[_0x28702b];return _0xae94ee;};'use strict';var _=require('lodash');var util=require(_0x461f('0x0'));var logger=require('../../config/logger')(_0x461f('0x1'));var moment=require(_0x461f('0x2'));var BPromise=require(_0x461f('0x3'));var rp=require(_0x461f('0x4'));var fs=require('fs');var path=require(_0x461f('0x5'));var rimraf=require(_0x461f('0x6'));var config=require(_0x461f('0x7'));var attributes=require(_0x461f('0x8'));module[_0x461f('0x9')]=function(_0x5aa1f1,_0x193e1c){return _0x5aa1f1['define'](_0x461f('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index a575b5b..00976eb 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 _0xa1a6=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then'];(function(_0x415d66,_0x96979f){var _0x8d36f0=function(_0x273d46){while(--_0x273d46){_0x415d66['push'](_0x415d66['shift']());}};_0x8d36f0(++_0x96979f);}(_0xa1a6,0xc5));var _0x6a1a=function(_0x2d3ab3,_0x47d90b){_0x2d3ab3=_0x2d3ab3-0x0;var _0x321f9e=_0xa1a6[_0x2d3ab3];return _0x321f9e;};'use strict';var _=require(_0x6a1a('0x0'));var util=require(_0x6a1a('0x1'));var moment=require(_0x6a1a('0x2'));var BPromise=require(_0x6a1a('0x3'));var rs=require(_0x6a1a('0x4'));var fs=require('fs');var Redis=require(_0x6a1a('0x5'));var db=require(_0x6a1a('0x6'))['db'];var utils=require(_0x6a1a('0x7'));var logger=require(_0x6a1a('0x8'))(_0x6a1a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6a1a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51b39f,_0x488356,_0x26e021){return new BPromise(function(_0x2b6081,_0x1637b8){return client[_0x6a1a('0xb')](_0x51b39f,_0x26e021)[_0x6a1a('0xc')](function(_0x3fbfb6){logger[_0x6a1a('0xd')](_0x6a1a('0xe'),_0x488356,_0x6a1a('0xf'));logger[_0x6a1a('0x10')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x488356,_0x6a1a('0xf'),JSON[_0x6a1a('0x11')](_0x3fbfb6));if(_0x3fbfb6[_0x6a1a('0x12')]){if(_0x3fbfb6[_0x6a1a('0x12')]['code']===0x1f4){logger[_0x6a1a('0x12')](_0x6a1a('0xe'),_0x488356,_0x3fbfb6[_0x6a1a('0x12')][_0x6a1a('0x13')]);return _0x1637b8(_0x3fbfb6[_0x6a1a('0x12')][_0x6a1a('0x13')]);}logger[_0x6a1a('0x12')]('CmCompany,\x20%s,\x20%s',_0x488356,_0x3fbfb6[_0x6a1a('0x12')][_0x6a1a('0x13')]);return _0x2b6081(_0x3fbfb6[_0x6a1a('0x12')][_0x6a1a('0x13')]);}else{logger[_0x6a1a('0xd')](_0x6a1a('0xe'),_0x488356,'request\x20sent');_0x2b6081(_0x3fbfb6['result'][_0x6a1a('0x13')]);}})[_0x6a1a('0x14')](function(_0x2b40e3){logger[_0x6a1a('0x12')](_0x6a1a('0xe'),_0x488356,_0x2b40e3);_0x1637b8(_0x2b40e3);});});}
\ No newline at end of file
+var _0x699e=['stringify','error','code','message','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x54b415,_0x180096){var _0x19d2a3=function(_0x38e585){while(--_0x38e585){_0x54b415['push'](_0x54b415['shift']());}};_0x19d2a3(++_0x180096);}(_0x699e,0xef));var _0xe699=function(_0x1707f1,_0x1b91e5){_0x1707f1=_0x1707f1-0x0;var _0x542a0a=_0x699e[_0x1707f1];return _0x542a0a;};'use strict';var _=require(_0xe699('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe699('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe699('0x2'));var db=require(_0xe699('0x3'))['db'];var utils=require(_0xe699('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe699('0x5'));var jayson=require(_0xe699('0x6'));var client=jayson['client'][_0xe699('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3696ac,_0x539de1,_0x5482f0){return new BPromise(function(_0x2e4b57,_0x1c754a){return client['request'](_0x3696ac,_0x5482f0)['then'](function(_0x1539f4){logger[_0xe699('0x8')](_0xe699('0x9'),_0x539de1,_0xe699('0xa'));logger[_0xe699('0xb')](_0xe699('0xc'),_0x539de1,'request\x20sent',JSON[_0xe699('0xd')](_0x1539f4));if(_0x1539f4[_0xe699('0xe')]){if(_0x1539f4[_0xe699('0xe')][_0xe699('0xf')]===0x1f4){logger[_0xe699('0xe')]('CmCompany,\x20%s,\x20%s',_0x539de1,_0x1539f4[_0xe699('0xe')]['message']);return _0x1c754a(_0x1539f4[_0xe699('0xe')]['message']);}logger[_0xe699('0xe')](_0xe699('0x9'),_0x539de1,_0x1539f4[_0xe699('0xe')]['message']);return _0x2e4b57(_0x1539f4[_0xe699('0xe')]['message']);}else{logger['info'](_0xe699('0x9'),_0x539de1,_0xe699('0xa'));_0x2e4b57(_0x1539f4['result'][_0xe699('0x10')]);}})[_0xe699('0x11')](function(_0x21dd21){logger[_0xe699('0xe')](_0xe699('0x9'),_0x539de1,_0x21dd21);_0x1c754a(_0x21dd21);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 93b5b42..e70a101 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 _0x916a=['show','post','create','/:id/contacts','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x381cd7,_0x5cd931){var _0x42fb4d=function(_0x2ee505){while(--_0x2ee505){_0x381cd7['push'](_0x381cd7['shift']());}};_0x42fb4d(++_0x5cd931);}(_0x916a,0x17a));var _0xa916=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x916a[_0x3a0c4f];return _0x247049;};'use strict';var multer=require(_0xa916('0x0'));var util=require(_0xa916('0x1'));var path=require(_0xa916('0x2'));var timeout=require(_0xa916('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa916('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa916('0x5'));var config=require(_0xa916('0x6'));var controller=require(_0xa916('0x7'));router[_0xa916('0x8')]('/',auth[_0xa916('0x9')](),controller['index']);router[_0xa916('0x8')](_0xa916('0xa'),auth[_0xa916('0x9')](),controller[_0xa916('0xb')]);router[_0xa916('0x8')](_0xa916('0xc'),auth[_0xa916('0x9')](),controller[_0xa916('0xd')]);router[_0xa916('0x8')]('/:id/contacts',auth[_0xa916('0x9')](),controller['getContacts']);router[_0xa916('0xe')]('/',auth[_0xa916('0x9')](),controller[_0xa916('0xf')]);router[_0xa916('0xe')](_0xa916('0x10'),auth[_0xa916('0x9')](),controller[_0xa916('0x11')]);router[_0xa916('0x12')](_0xa916('0xc'),auth[_0xa916('0x9')](),controller[_0xa916('0x13')]);router[_0xa916('0x14')](_0xa916('0xc'),auth[_0xa916('0x9')](),controller[_0xa916('0x15')]);module[_0xa916('0x16')]=router;
\ No newline at end of file
+var _0x95ee=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','put','update','delete','destroy','exports','multer'];(function(_0x55313c,_0x35bd62){var _0x1d23b5=function(_0x224fac){while(--_0x224fac){_0x55313c['push'](_0x55313c['shift']());}};_0x1d23b5(++_0x35bd62);}(_0x95ee,0xce));var _0xe95e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x95ee[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xe95e('0x0'));var util=require(_0xe95e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe95e('0x2'));var router=express[_0xe95e('0x3')]();var fs_extra=require(_0xe95e('0x4'));var auth=require(_0xe95e('0x5'));var interaction=require(_0xe95e('0x6'));var config=require(_0xe95e('0x7'));var controller=require('./cmCompany.controller');router[_0xe95e('0x8')]('/',auth[_0xe95e('0x9')](),controller[_0xe95e('0xa')]);router[_0xe95e('0x8')](_0xe95e('0xb'),auth['isAuthenticated'](),controller[_0xe95e('0xc')]);router['get'](_0xe95e('0xd'),auth[_0xe95e('0x9')](),controller[_0xe95e('0xe')]);router['get'](_0xe95e('0xf'),auth[_0xe95e('0x9')](),controller[_0xe95e('0x10')]);router['post']('/',auth[_0xe95e('0x9')](),controller['create']);router[_0xe95e('0x11')](_0xe95e('0xf'),auth['isAuthenticated'](),controller['addContacts']);router[_0xe95e('0x12')](_0xe95e('0xd'),auth[_0xe95e('0x9')](),controller[_0xe95e('0x13')]);router[_0xe95e('0x14')](_0xe95e('0xd'),auth[_0xe95e('0x9')](),controller[_0xe95e('0x15')]);module[_0xe95e('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 5e503d6..40246f2 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 _0xffff=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x57a50d,_0x2871f8){var _0x1b25b3=function(_0x45691e){while(--_0x45691e){_0x57a50d['push'](_0x57a50d['shift']());}};_0x1b25b3(++_0x2871f8);}(_0xffff,0xf1));var _0xffff=function(_0x427367,_0x3cec17){_0x427367=_0x427367-0x0;var _0x1027b1=_0xffff[_0x427367];return _0x1027b1;};'use strict';var _=require(_0xffff('0x0'));var Sequelize=require(_0xffff('0x1'));module[_0xffff('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xffff('0x3')]},'street':{'type':Sequelize[_0xffff('0x3')]},'postalCode':{'type':Sequelize[_0xffff('0x3')]},'city':{'type':Sequelize[_0xffff('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xffff('0x3')]},'description':{'type':Sequelize[_0xffff('0x4')]},'phone':{'type':Sequelize[_0xffff('0x3')]},'mobile':{'type':Sequelize[_0xffff('0x3')]},'fax':{'type':Sequelize[_0xffff('0x3')]},'email':{'type':Sequelize[_0xffff('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xffff('0x3')]},'fb_data':{'type':Sequelize[_0xffff('0x3')]},'twitter':{'type':Sequelize[_0xffff('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xffff('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xffff('0x3')]},'UserId':{'type':Sequelize[_0xffff('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xffff('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xffff('0x7')],'defaultValue':Sequelize[_0xffff('0x8')]}};
\ No newline at end of file
+var _0x0744=['sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash'];(function(_0x1a9c75,_0xa83750){var _0xb2f37e=function(_0x2b90f6){while(--_0x2b90f6){_0x1a9c75['push'](_0x1a9c75['shift']());}};_0xb2f37e(++_0xa83750);}(_0x0744,0x6f));var _0x4074=function(_0x5755bf,_0x5a50ba){_0x5755bf=_0x5755bf-0x0;var _0x156408=_0x0744[_0x5755bf];return _0x156408;};'use strict';var _=require(_0x4074('0x0'));var Sequelize=require(_0x4074('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4074('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x4074('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x4074('0x2')]},'description':{'type':Sequelize[_0x4074('0x3')]},'phone':{'type':Sequelize[_0x4074('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x4074('0x2')]},'url':{'type':Sequelize[_0x4074('0x2')]},'facebook':{'type':Sequelize[_0x4074('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x4074('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x4074('0x2')]},'viber':{'type':Sequelize[_0x4074('0x2')]},'line':{'type':Sequelize[_0x4074('0x2')]},'wechat':{'type':Sequelize[_0x4074('0x2')]},'telegram':{'type':Sequelize[_0x4074('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x4074('0x4')](0x2)[_0x4074('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4074('0x6')],'defaultValue':Sequelize[_0x4074('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 4255569..c6557ba 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 _0x3fce=['filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','DESC','having','resolve','agent','some','user','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','c.lastName','c.fax','c.email','c.ListId','c.createdAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','params','describe','tags','findAll','columnName','displayName','alias','custom','catch','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','findOrCreate','spread','$and','omit','format','cf_%d','pickBy','id\x20=\x20?','toParam','values','phone','getTags','intersection','options','ids','getHoppers','rawAttributes','nolimit','pick','include','getHopperHistories','ContactId','includeAll','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','0777','child_process','../../components/import/cm/csv','binding_values','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','send','upload','parse','import','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','fork','../../components/import/cm/csv2','stringify','message','pid','error\x20child\x20process','getJourney','chat','sms','openchannel','whatsapp','voice','-createdAt','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','endtime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','startCase','Website','Account','note','disposition','secondDisposition','key','Owner','browserName','customerIp','customerPort','deviceModel','ratingType','ratingValue','referer','mail','subject','threadId','flatten','sortBy','reverse','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','CmContact','keys','startsWith','push','CmCustomField','findOne','trimStart','cf_','all','length','type','query','filters','model','fields','attributes','hasOwnProperty','order','sort','select','field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','Tag','value','split','map','forEach','User','dateOfBirth','fieldType','datetime','castTo','text','start','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?'];(function(_0x4b25a9,_0x42bff1){var _0x1a720e=function(_0x1dcef7){while(--_0x1dcef7){_0x4b25a9['push'](_0x4b25a9['shift']());}};_0x1a720e(++_0x42bff1);}(_0x3fce,0xb8));var _0xe3fc=function(_0x22cd0c,_0x4040b6){_0x22cd0c=_0x22cd0c-0x0;var _0x439eba=_0x3fce[_0x22cd0c];return _0x439eba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe3fc('0x0'));var zipdir=require(_0xe3fc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe3fc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe3fc('0x3'));var util=require(_0xe3fc('0x4'));var path=require(_0xe3fc('0x5'));var sox=require(_0xe3fc('0x6'));var csv=require('to-csv');var ejs=require(_0xe3fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe3fc('0x8'));var squel=require(_0xe3fc('0x9'));var crypto=require(_0xe3fc('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe3fc('0xb'));var querystring=require(_0xe3fc('0xc'));var Papa=require(_0xe3fc('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe3fc('0xe'));var as=require(_0xe3fc('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe3fc('0x10'));var utils=require(_0xe3fc('0x11'));var config=require(_0xe3fc('0x12'));var licenseUtil=require(_0xe3fc('0x13'));var db=require(_0xe3fc('0x14'))['db'];config[_0xe3fc('0x15')]=_[_0xe3fc('0x16')](config[_0xe3fc('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xe3fc('0x17'))(new Redis(config[_0xe3fc('0x15')]));require('./cmContact.socket')[_0xe3fc('0x18')](socket);function respondWithStatusCode(_0xc16dd4,_0x3da18e){_0x3da18e=_0x3da18e||0xcc;return function(_0x580290){if(_0x580290){return _0xc16dd4['sendStatus'](_0x3da18e);}return _0xc16dd4[_0xe3fc('0x19')](_0x3da18e)[_0xe3fc('0x1a')]();};}function respondWithResult(_0x3f1803,_0x27b218){_0x27b218=_0x27b218||0xc8;return function(_0x4801e4){if(_0x4801e4){return _0x3f1803[_0xe3fc('0x19')](_0x27b218)['json'](_0x4801e4);}};}function respondWithFilteredResult(_0x3d770f,_0x295fe3){return function(_0x5762b3){if(_0x5762b3){var _0x41c046=typeof _0x295fe3[_0xe3fc('0x1b')]===_0xe3fc('0x1c')&&typeof _0x295fe3['limit']===_0xe3fc('0x1c');var _0x440031=_0x5762b3[_0xe3fc('0x1d')];var _0x4fbeb3=_0x41c046?0x0:_0x295fe3[_0xe3fc('0x1b')];var _0x1f6390=_0x41c046?_0x5762b3['count']:_0x295fe3['offset']+_0x295fe3[_0xe3fc('0x1e')];var _0x171df4;if(_0x1f6390>=_0x440031){_0x1f6390=_0x440031;_0x171df4=0xc8;}else{_0x171df4=0xce;}_0x3d770f[_0xe3fc('0x19')](_0x171df4);return _0x3d770f[_0xe3fc('0x1f')](_0xe3fc('0x20'),_0x4fbeb3+'-'+_0x1f6390+'/'+_0x440031)[_0xe3fc('0x21')](_0x5762b3);}return null;};}function patchUpdates(_0x2fffd5){return function(_0x48ebac){try{jsonpatch[_0xe3fc('0x22')](_0x48ebac,_0x2fffd5,!![]);}catch(_0x16a248){return BPromise[_0xe3fc('0x23')](_0x16a248);}return _0x48ebac[_0xe3fc('0x24')]();};}function saveUpdates(_0x518d0f,_0x1481d2){return function(_0x554678){if(_0x554678){return _0x554678[_0xe3fc('0x25')](_0x518d0f)[_0xe3fc('0x26')](function(_0x2b0b20){return _0x2b0b20;});}return null;};}function removeEntity(_0x41d26d,_0x3490ea){return function(_0x1f37e9){if(_0x1f37e9){return _0x1f37e9[_0xe3fc('0x27')]()[_0xe3fc('0x26')](function(){_0x41d26d[_0xe3fc('0x19')](0xcc)[_0xe3fc('0x1a')]();});}};}function handleEntityNotFound(_0x3288f1,_0x41ae14){return function(_0x53886e){if(!_0x53886e){_0x3288f1[_0xe3fc('0x28')](0x194);}return _0x53886e;};}function handleError(_0x486f9d,_0x3af2f3){_0x3af2f3=_0x3af2f3||0x1f4;return function(_0x742550){logger[_0xe3fc('0x29')](_0x742550[_0xe3fc('0x2a')]);if(_0x742550[_0xe3fc('0x2b')]){delete _0x742550['name'];}_0x486f9d['status'](_0x3af2f3)['send'](_0x742550);};}exports[_0xe3fc('0x2c')]=function(_0x42c2d3,_0x4ea173){var _0x1f93a9={},_0x3ff64e={},_0x1bbf99={'count':0x0,'rows':[]};return db[_0xe3fc('0x2d')]['describe']()['then'](function(_0x1c59cf){var _0x5a6502=[];for(var _0x3f3571=0x0;_0x3f3571
','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com'];(function(_0x5b3546,_0x168b1a){var _0x5eb84f=function(_0x1ab1ab){while(--_0x1ab1ab){_0x5b3546['push'](_0x5b3546['shift']());}};_0x5eb84f(++_0x168b1a);}(_0xacf4,0xe7));var _0x4acf=function(_0x2b3208,_0x26f23b){_0x2b3208=_0x2b3208-0x0;var _0xde06e1=_0xacf4[_0x2b3208];return _0xde06e1;};'use strict';var _=require('lodash');var moment=require('moment');var random=require(_0x4acf('0x0'));var fs=require('fs');var path=require(_0x4acf('0x1'));var util=require(_0x4acf('0x2'));var tnef=require(_0x4acf('0x3'));var logger=require(_0x4acf('0x4'))(_0x4acf('0x5'));var config=require(_0x4acf('0x6'));function getAddress(_0x5cf22d){var _0x380435=_[_0x4acf('0x7')](_0x5cf22d['value']);return _0x380435&&_0x380435[_0x4acf('0x8')]?_0x380435[_0x4acf('0x8')]:_0x4acf('0x9')+random[_0x4acf('0xa')](0x6)+_0x4acf('0xb');}function getFirstName(_0x50f5f4){var _0x55f61d=_[_0x4acf('0x7')](_0x50f5f4['value']);if(_0x55f61d&&_0x55f61d[_0x4acf('0xc')]){if(_0x55f61d[_0x4acf('0xc')]==_0x55f61d[_0x4acf('0x8')]){return _0x55f61d['name'][_0x4acf('0xd')](0x0,_0x55f61d[_0x4acf('0xc')]['indexOf']('@'));}var _0x5f22d9=_0x55f61d[_0x4acf('0xc')]['split'](/\s+/);return _0x5f22d9['length']>0x1?_0x5f22d9[_0x4acf('0xe')](0x0,-0x1)[_0x4acf('0xf')]('\x20'):_0x55f61d[_0x4acf('0xc')];}return _0x4acf('0x10');}function getLastName(_0x18629e){var _0x1a9949=_[_0x4acf('0x7')](_0x18629e[_0x4acf('0x11')]);if(_0x1a9949&&_0x1a9949[_0x4acf('0xc')]){var _0x312bb5=_0x1a9949[_0x4acf('0xc')]['split'](/\s+/);return _0x312bb5[_0x4acf('0x12')]>0x1?_0x312bb5['pop']():'';}return'';}function getMails(_0x34cec1,_0x4041c8){var _0xccf970='';for(var _0x5d934a=0x0;_0x5d934a<_0x4041c8['value'][_0x4acf('0x12')];_0x5d934a+=0x1){if(_0x4041c8[_0x4acf('0x11')][_0x5d934a][_0x4acf('0x8')]!==_0x34cec1){if(!_['isEmpty'](_0xccf970)){_0xccf970+=',';}_0xccf970+=_0x4041c8[_0x4acf('0x11')][_0x5d934a][_0x4acf('0xc')]||_0x4041c8[_0x4acf('0x11')][_0x5d934a][_0x4acf('0x8')]||'';_0xccf970+='\x20<';_0xccf970+=_0x4041c8[_0x4acf('0x11')][_0x5d934a][_0x4acf('0x8')]?_0x4041c8[_0x4acf('0x11')][_0x5d934a][_0x4acf('0x8')]:_0x4acf('0x9')+random[_0x4acf('0xa')](0x6)+_0x4acf('0xb');_0xccf970+='>';}}return _0xccf970;}function parseEmail(_0x5f0284,_0x28d698,_0x6bd89){if(_0x28d698['html']){var _0x41e5d2=/