From 4feb8e42db16819090cd6cbb8a82252d561c008d Mon Sep 17 00:00:00 2001
From: Andrea Amorese
Date: Mon, 6 Sep 2021 14:40:04 +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 +-
server/api/teamVoicePrefix/index.js | 18 ------------------
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoicePrefix/teamVoicePrefix.rpc.js | 18 ------------------
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 +-
server/api/userVoicePrefix/index.js | 18 ------------------
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoicePrefix/userVoicePrefix.rpc.js | 18 ------------------
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 +-
1155 files changed, 1151 insertions(+), 1223 deletions(-)
delete mode 100644 server/api/teamVoicePrefix/index.js
delete mode 100644 server/api/teamVoicePrefix/teamVoicePrefix.rpc.js
delete mode 100644 server/api/userVoicePrefix/index.js
delete mode 100644 server/api/userVoicePrefix/userVoicePrefix.rpc.js
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index d435e56..69e77db 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-03T14:37:22.620Z",
+ "time": "2021-09-06T12:29:21.798Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index dea3609..2cb94a6 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-03T14:37:22.620Z",
+ "time": "2021-09-06T12:29:21.798Z",
"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 60d8b7a..7b0035a 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 _0x3f8a=['jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'];(function(_0x43d0e7,_0x201b93){var _0x1bfd9c=function(_0x4ffe28){while(--_0x4ffe28){_0x43d0e7['push'](_0x43d0e7['shift']());}};_0x1bfd9c(++_0x201b93);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x271ad2,_0x2c93eb){_0x271ad2=_0x271ad2-0x0;var _0x3ee9e4=_0x3f8a[_0x271ad2];return _0x3ee9e4;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'get':function(_0x23c224){return this['getDataValue'](_0xa3f8('0x3'));}},'action':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xa3f8('0x5'),_0xa3f8('0x6'),_0xa3f8('0x7'),_0xa3f8('0x8'),_0xa3f8('0x9'),_0xa3f8('0xa'),_0xa3f8('0xb'),_0xa3f8('0xc')]],'msg':_0xa3f8('0xd')}},'comment':_0xa3f8('0xd')},'data1':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comment':_0xa3f8('0xe')},'data2':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comment':_0xa3f8('0xf')},'data3':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comments':_0xa3f8('0x10')},'data5':{'type':Sequelize[_0xa3f8('0x4')](0x1000),'comments':_0xa3f8('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0xa3f8('0x12')},'data7':{'type':Sequelize[_0xa3f8('0x13')],'comments':_0xa3f8('0x14')}};
\ No newline at end of file
+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
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 2e288ea..5fc9323 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 _0x4cac=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','body','find','catch','Action','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra'];(function(_0xc86f1a,_0x54d4ba){var _0x513368=function(_0x27e711){while(--_0x27e711){_0xc86f1a['push'](_0xc86f1a['shift']());}};_0x513368(++_0x54d4ba);}(_0x4cac,0x130));var _0xc4ca=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4cac[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xc4ca('0x0'));var rimraf=require(_0xc4ca('0x1'));var zipdir=require(_0xc4ca('0x2'));var jsonpatch=require(_0xc4ca('0x3'));var rp=require('request-promise');var moment=require(_0xc4ca('0x4'));var BPromise=require(_0xc4ca('0x5'));var Mustache=require('mustache');var util=require(_0xc4ca('0x6'));var path=require(_0xc4ca('0x7'));var sox=require('sox');var csv=require(_0xc4ca('0x8'));var ejs=require(_0xc4ca('0x9'));var fs=require('fs');var fs_extra=require(_0xc4ca('0xa'));var _=require(_0xc4ca('0xb'));var squel=require(_0xc4ca('0xc'));var crypto=require(_0xc4ca('0xd'));var jsforce=require(_0xc4ca('0xe'));var deskjs=require(_0xc4ca('0xf'));var toCsv=require(_0xc4ca('0x8'));var querystring=require(_0xc4ca('0x10'));var Papa=require(_0xc4ca('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc4ca('0x12'));var as=require(_0xc4ca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc4ca('0x14'));var utils=require(_0xc4ca('0x15'));var config=require(_0xc4ca('0x16'));var licenseUtil=require(_0xc4ca('0x17'));var db=require(_0xc4ca('0x18'))['db'];function respondWithStatusCode(_0x3ca8d5,_0x2936dd){_0x2936dd=_0x2936dd||0xcc;return function(_0x4549e7){if(_0x4549e7){return _0x3ca8d5[_0xc4ca('0x19')](_0x2936dd);}return _0x3ca8d5['status'](_0x2936dd)[_0xc4ca('0x1a')]();};}function respondWithResult(_0x4b123b,_0x48b468){_0x48b468=_0x48b468||0xc8;return function(_0x3c38ba){if(_0x3c38ba){return _0x4b123b[_0xc4ca('0x1b')](_0x48b468)[_0xc4ca('0x1c')](_0x3c38ba);}};}function respondWithFilteredResult(_0xdade7a,_0x2590a8){return function(_0x282cc1){if(_0x282cc1){var _0x4aa478=typeof _0x2590a8['offset']===_0xc4ca('0x1d')&&typeof _0x2590a8[_0xc4ca('0x1e')]===_0xc4ca('0x1d');var _0x42db90=_0x282cc1[_0xc4ca('0x1f')];var _0x27cb3a=_0x4aa478?0x0:_0x2590a8[_0xc4ca('0x20')];var _0x29ba20=_0x4aa478?_0x282cc1[_0xc4ca('0x1f')]:_0x2590a8[_0xc4ca('0x20')]+_0x2590a8[_0xc4ca('0x1e')];var _0x5e9d7f;if(_0x29ba20>=_0x42db90){_0x29ba20=_0x42db90;_0x5e9d7f=0xc8;}else{_0x5e9d7f=0xce;}_0xdade7a[_0xc4ca('0x1b')](_0x5e9d7f);return _0xdade7a['set'](_0xc4ca('0x21'),_0x27cb3a+'-'+_0x29ba20+'/'+_0x42db90)['json'](_0x282cc1);}return null;};}function patchUpdates(_0x3262a9){return function(_0x1d38e2){try{jsonpatch[_0xc4ca('0x22')](_0x1d38e2,_0x3262a9,!![]);}catch(_0x5befbc){return BPromise[_0xc4ca('0x23')](_0x5befbc);}return _0x1d38e2['save']();};}function saveUpdates(_0x1dc4c6,_0x339f74){return function(_0x499c8e){if(_0x499c8e){return _0x499c8e[_0xc4ca('0x24')](_0x1dc4c6)[_0xc4ca('0x25')](function(_0x2939c4){return _0x2939c4;});}return null;};}function removeEntity(_0x5ac0d1,_0x9d26a4){return function(_0x87037a){if(_0x87037a){return _0x87037a[_0xc4ca('0x26')]()[_0xc4ca('0x25')](function(){_0x5ac0d1[_0xc4ca('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a8c56,_0xd2f14c){return function(_0x5553d0){if(!_0x5553d0){_0x4a8c56[_0xc4ca('0x19')](0x194);}return _0x5553d0;};}function handleError(_0x299fe1,_0x3f8e88){_0x3f8e88=_0x3f8e88||0x1f4;return function(_0x459072){logger[_0xc4ca('0x27')](_0x459072['stack']);if(_0x459072[_0xc4ca('0x28')]){delete _0x459072[_0xc4ca('0x28')];}_0x299fe1[_0xc4ca('0x1b')](_0x3f8e88)['send'](_0x459072);};}exports[_0xc4ca('0x24')]=function(_0x1383ac,_0x56c70e){if(_0x1383ac[_0xc4ca('0x29')]['id']){delete _0x1383ac[_0xc4ca('0x29')]['id'];}return db['Action'][_0xc4ca('0x2a')]({'where':{'id':_0x1383ac['params']['id']}})['then'](handleEntityNotFound(_0x56c70e,null))[_0xc4ca('0x25')](saveUpdates(_0x1383ac[_0xc4ca('0x29')],null))[_0xc4ca('0x25')](respondWithResult(_0x56c70e,null))[_0xc4ca('0x2b')](handleError(_0x56c70e,null));};exports[_0xc4ca('0x26')]=function(_0x396673,_0x5b1b36){return db[_0xc4ca('0x2c')]['find']({'where':{'id':_0x396673['params']['id']}})[_0xc4ca('0x25')](handleEntityNotFound(_0x5b1b36,null))[_0xc4ca('0x25')](removeEntity(_0x5b1b36,null))[_0xc4ca('0x2b')](handleError(_0x5b1b36,null));};
\ No newline at end of file
+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
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 2632309..86f4906 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 _0xf858=['request-promise','path','../../config/environment','./action.attributes','define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x35ded5,_0x4cd999){var _0x1bd1ee=function(_0xae2c9c){while(--_0xae2c9c){_0x35ded5['push'](_0x35ded5['shift']());}};_0x1bd1ee(++_0x4cd999);}(_0xf858,0x13f));var _0x8f85=function(_0x1321cd,_0x4ebce9){_0x1321cd=_0x1321cd-0x0;var _0x4137eb=_0xf858[_0x1321cd];return _0x4137eb;};'use strict';var _=require(_0x8f85('0x0'));var util=require(_0x8f85('0x1'));var logger=require(_0x8f85('0x2'))(_0x8f85('0x3'));var moment=require(_0x8f85('0x4'));var BPromise=require(_0x8f85('0x5'));var rp=require(_0x8f85('0x6'));var fs=require('fs');var path=require(_0x8f85('0x7'));var rimraf=require('rimraf');var config=require(_0x8f85('0x8'));var attributes=require(_0x8f85('0x9'));module['exports']=function(_0x453e90,_0x4f7d8b){return _0x453e90[_0x8f85('0xa')](_0x8f85('0xb'),attributes,{'tableName':_0x8f85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index fc5a8eb..f548fde 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x49b0bf,_0x2c50e9){var _0x4e6b5c=function(_0x2eaf9e){while(--_0x2eaf9e){_0x49b0bf['push'](_0x49b0bf['shift']());}};_0x4e6b5c(++_0x2c50e9);}(_0x5fab,0x177));var _0xb5fa=function(_0x5be892,_0x68238a){_0x5be892=_0x5be892-0x0;var _0x53fc35=_0x5fab[_0x5be892];return _0x53fc35;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
+var _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
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7bf13ff..2d5d7d4 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 _0x580e=['exports','multer','path','fs-extra','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x5b36ac,_0x4767aa){var _0x512bc2=function(_0x312285){while(--_0x312285){_0x5b36ac['push'](_0x5b36ac['shift']());}};_0x512bc2(++_0x4767aa);}(_0x580e,0xfe));var _0xe580=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x580e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe580('0x0'));var util=require('util');var path=require(_0xe580('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe580('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xe580('0x3'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0xe580('0x4')](_0xe580('0x5'),auth[_0xe580('0x6')](),controller[_0xe580('0x7')]);router[_0xe580('0x8')](_0xe580('0x5'),auth[_0xe580('0x6')](),controller[_0xe580('0x9')]);module[_0xe580('0xa')]=router;
\ No newline at end of file
+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
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 70545cb..0623c67 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 _0x4819=['TEXT','exports','STRING'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0x4819,0xcd));var _0x9481=function(_0x25b022,_0x394a08){_0x25b022=_0x25b022-0x0;var _0x2e13a5=_0x4819[_0x25b022];return _0x2e13a5;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'name':{'type':Sequelize[_0x9481('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9481('0x1')]},'parent':{'type':Sequelize[_0x9481('0x1')]},'table':{'type':Sequelize[_0x9481('0x1')]},'conditions':{'type':Sequelize[_0x9481('0x2')]},'joins':{'type':Sequelize[_0x9481('0x2')]}};
\ No newline at end of file
+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
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 026f8b4..5b9947f 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 _0xd07e=['reject','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','catch','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','table','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','select','MetricId','%s.%s\x20=\x20%s.%s','output','fullPath','%s-%s.%s','generate','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','SELECT','run','UNIX_TIMESTAMP(%s)','metric','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','json','undefined','limit','offset','Content-Range','apply'];(function(_0x47d22c,_0x2a8058){var _0x35e7da=function(_0x18bf49){while(--_0x18bf49){_0x47d22c['push'](_0x47d22c['shift']());}};_0x35e7da(++_0x2a8058);}(_0xd07e,0x80));var _0xed07=function(_0x13547d,_0xa3895e){_0x13547d=_0x13547d-0x0;var _0x22c36b=_0xd07e[_0x13547d];return _0x22c36b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed07('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed07('0x1'));var rp=require('request-promise');var moment=require(_0xed07('0x2'));var BPromise=require(_0xed07('0x3'));var Mustache=require('mustache');var util=require(_0xed07('0x4'));var path=require(_0xed07('0x5'));var sox=require(_0xed07('0x6'));var csv=require(_0xed07('0x7'));var ejs=require(_0xed07('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed07('0x9'));var squel=require(_0xed07('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed07('0xb'));var toCsv=require(_0xed07('0x7'));var querystring=require(_0xed07('0xc'));var Papa=require(_0xed07('0xd'));var Redis=require(_0xed07('0xe'));var authService=require(_0xed07('0xf'));var qs=require(_0xed07('0x10'));var as=require(_0xed07('0x11'));var hardwareService=require(_0xed07('0x12'));var logger=require(_0xed07('0x13'))(_0xed07('0x14'));var utils=require('../../config/utils');var config=require(_0xed07('0x15'));var licenseUtil=require(_0xed07('0x16'));var db=require(_0xed07('0x17'))['db'];var dbH=require(_0xed07('0x17'))[_0xed07('0x18')];function respondWithStatusCode(_0x21aa96,_0x1f9b73){_0x1f9b73=_0x1f9b73||0xcc;return function(_0x4e347f){if(_0x4e347f){return _0x21aa96[_0xed07('0x19')](_0x1f9b73);}return _0x21aa96['status'](_0x1f9b73)[_0xed07('0x1a')]();};}function respondWithResult(_0x49b071,_0x5cdad5){_0x5cdad5=_0x5cdad5||0xc8;return function(_0x52c86e){if(_0x52c86e){return _0x49b071[_0xed07('0x1b')](_0x5cdad5)[_0xed07('0x1c')](_0x52c86e);}};}function respondWithFilteredResult(_0x7dee7c,_0x38e6f7){return function(_0x4f41d9){if(_0x4f41d9){var _0x2097f0=typeof _0x38e6f7['offset']===_0xed07('0x1d')&&typeof _0x38e6f7[_0xed07('0x1e')]===_0xed07('0x1d');var _0x61a079=_0x4f41d9['count'];var _0x7a6b29=_0x2097f0?0x0:_0x38e6f7[_0xed07('0x1f')];var _0x315ba9=_0x2097f0?_0x4f41d9['count']:_0x38e6f7['offset']+_0x38e6f7['limit'];var _0x1a8387;if(_0x315ba9>=_0x61a079){_0x315ba9=_0x61a079;_0x1a8387=0xc8;}else{_0x1a8387=0xce;}_0x7dee7c[_0xed07('0x1b')](_0x1a8387);return _0x7dee7c['set'](_0xed07('0x20'),_0x7a6b29+'-'+_0x315ba9+'/'+_0x61a079)[_0xed07('0x1c')](_0x4f41d9);}return null;};}function patchUpdates(_0x11df71){return function(_0x445275){try{jsonpatch[_0xed07('0x21')](_0x445275,_0x11df71,!![]);}catch(_0x10c394){return BPromise[_0xed07('0x22')](_0x10c394);}return _0x445275['save']();};}function saveUpdates(_0x5bb7b6,_0xba74ba){return function(_0x46119f){if(_0x46119f){return _0x46119f[_0xed07('0x23')](_0x5bb7b6)[_0xed07('0x24')](function(_0x4b89c1){return _0x4b89c1;});}return null;};}function removeEntity(_0x25b3e6,_0x16edab){return function(_0x598bea){if(_0x598bea){return _0x598bea[_0xed07('0x25')]()[_0xed07('0x24')](function(){var _0x57d898=_0x598bea['get']({'plain':!![]});var _0x16266b=_0xed07('0x26');return db[_0xed07('0x27')][_0xed07('0x25')]({'where':{'type':_0x16266b,'resourceId':_0x57d898['id']}})[_0xed07('0x24')](function(){return _0x598bea;});})[_0xed07('0x24')](function(){_0x25b3e6[_0xed07('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e4c42,_0x4a6368){return function(_0x2ee303){if(!_0x2ee303){_0x1e4c42[_0xed07('0x19')](0x194);}return _0x2ee303;};}function handleError(_0x143436,_0x1e9113){_0x1e9113=_0x1e9113||0x1f4;return function(_0x7ae630){logger[_0xed07('0x28')](_0x7ae630[_0xed07('0x29')]);if(_0x7ae630[_0xed07('0x2a')]){delete _0x7ae630['name'];}_0x143436[_0xed07('0x1b')](_0x1e9113)[_0xed07('0x2b')](_0x7ae630);};}exports[_0xed07('0x2c')]=function(_0x4d42fe,_0x49e799){var _0x54bc52={},_0x17e264={},_0x51503e={'count':0x0,'rows':[]};var _0x5ab625=_[_0xed07('0x2d')](db[_0xed07('0x2e')][_0xed07('0x2f')],function(_0xfa357e){return{'name':_0xfa357e[_0xed07('0x30')],'type':_0xfa357e['type'][_0xed07('0x31')]};});_0x17e264[_0xed07('0x32')]=_['map'](_0x5ab625,'name');_0x17e264[_0xed07('0x33')]=_[_0xed07('0x34')](_0x4d42fe[_0xed07('0x33')]);_0x17e264['filters']=_[_0xed07('0x35')](_0x17e264[_0xed07('0x32')],_0x17e264[_0xed07('0x33')]);_0x54bc52[_0xed07('0x36')]=_[_0xed07('0x35')](_0x17e264[_0xed07('0x32')],qs[_0xed07('0x37')](_0x4d42fe[_0xed07('0x33')]['fields']));_0x54bc52[_0xed07('0x36')]=_0x54bc52[_0xed07('0x36')][_0xed07('0x38')]?_0x54bc52[_0xed07('0x36')]:_0x17e264[_0xed07('0x32')];if(!_0x4d42fe[_0xed07('0x33')][_0xed07('0x39')](_0xed07('0x3a'))){_0x54bc52['limit']=qs[_0xed07('0x1e')](_0x4d42fe[_0xed07('0x33')][_0xed07('0x1e')]);_0x54bc52[_0xed07('0x1f')]=qs[_0xed07('0x1f')](_0x4d42fe[_0xed07('0x33')][_0xed07('0x1f')]);}_0x54bc52[_0xed07('0x3b')]=qs[_0xed07('0x3c')](_0x4d42fe[_0xed07('0x33')][_0xed07('0x3c')]);_0x54bc52['where']=qs[_0xed07('0x3d')](_[_0xed07('0x3e')](_0x4d42fe[_0xed07('0x33')],_0x17e264[_0xed07('0x3d')]),_0x5ab625);if(_0x4d42fe[_0xed07('0x33')][_0xed07('0x3f')]){_0x54bc52[_0xed07('0x40')]=_[_0xed07('0x41')](_0x54bc52['where'],{'$or':_[_0xed07('0x2d')](_0x5ab625,function(_0x48d230){if(_0x48d230[_0xed07('0x42')]!==_0xed07('0x43')){var _0x3085d0={};_0x3085d0[_0x48d230[_0xed07('0x2a')]]={'$like':'%'+_0x4d42fe[_0xed07('0x33')]['filter']+'%'};return _0x3085d0;}})});}_0x54bc52=_[_0xed07('0x41')]({},_0x54bc52,_0x4d42fe['options']);var _0x1bbcdd={'where':_0x54bc52[_0xed07('0x40')]};return db[_0xed07('0x2e')][_0xed07('0x44')](_0x1bbcdd)[_0xed07('0x24')](function(_0x40967a){_0x51503e['count']=_0x40967a;if(_0x4d42fe[_0xed07('0x33')][_0xed07('0x45')]){_0x54bc52[_0xed07('0x46')]=[{'all':!![]}];}return db[_0xed07('0x2e')][_0xed07('0x47')](_0x54bc52);})[_0xed07('0x24')](function(_0x2e306f){_0x51503e[_0xed07('0x48')]=_0x2e306f;return _0x51503e;})[_0xed07('0x24')](respondWithFilteredResult(_0x49e799,_0x54bc52))['catch'](handleError(_0x49e799,null));};exports[_0xed07('0x49')]=function(_0x305fdc,_0xb5f6ad){var _0xae22b4={'raw':![],'where':{'id':_0x305fdc[_0xed07('0x4a')]['id']}},_0x35e8f6={};_0x35e8f6['model']=_[_0xed07('0x34')](db[_0xed07('0x2e')][_0xed07('0x2f')]);_0x35e8f6[_0xed07('0x33')]=_[_0xed07('0x34')](_0x305fdc[_0xed07('0x33')]);_0x35e8f6[_0xed07('0x3d')]=_['intersection'](_0x35e8f6[_0xed07('0x32')],_0x35e8f6['query']);_0xae22b4[_0xed07('0x36')]=_[_0xed07('0x35')](_0x35e8f6[_0xed07('0x32')],qs[_0xed07('0x37')](_0x305fdc[_0xed07('0x33')][_0xed07('0x37')]));_0xae22b4['attributes']=_0xae22b4[_0xed07('0x36')]['length']?_0xae22b4[_0xed07('0x36')]:_0x35e8f6['model'];if(_0x305fdc['query'][_0xed07('0x45')]){_0xae22b4['include']=[{'all':!![]}];}_0xae22b4=_[_0xed07('0x41')]({},_0xae22b4,_0x305fdc[_0xed07('0x4b')]);return db['AnalyticCustomReport'][_0xed07('0x4c')](_0xae22b4)[_0xed07('0x24')](handleEntityNotFound(_0xb5f6ad,null))[_0xed07('0x24')](respondWithResult(_0xb5f6ad,null))['catch'](handleError(_0xb5f6ad,null));};exports[_0xed07('0x4d')]=function(_0x11f95a,_0x185f07){return db[_0xed07('0x2e')][_0xed07('0x4d')](_0x11f95a[_0xed07('0x4e')],{})[_0xed07('0x24')](function(_0x45e03a){var _0x11d191=_0x11f95a[_0xed07('0x4f')][_0xed07('0x50')]({'plain':!![]});if(!_0x11d191)throw new Error(_0xed07('0x51'));if(_0x11d191['role']===_0xed07('0x4f')){var _0x3567a7=_0x45e03a[_0xed07('0x50')]({'plain':!![]});var _0x2e839a=_0xed07('0x52');return db[_0xed07('0x53')][_0xed07('0x4c')]({'where':{'name':_0x2e839a,'userProfileId':_0x11d191[_0xed07('0x54')]},'raw':!![]})[_0xed07('0x24')](function(_0x1ab2b4){if(_0x1ab2b4&&_0x1ab2b4[_0xed07('0x55')]===0x0){return db[_0xed07('0x27')][_0xed07('0x4d')]({'name':_0x3567a7[_0xed07('0x2a')],'resourceId':_0x3567a7['id'],'type':'CustomReports','sectionId':_0x1ab2b4['id']},{})[_0xed07('0x24')](function(){return _0x45e03a;});}else{return _0x45e03a;}})['catch'](function(_0x373443){logger[_0xed07('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x373443);throw _0x373443;});}return _0x45e03a;})['then'](respondWithResult(_0x185f07,0xc9))['catch'](handleError(_0x185f07,null));};exports[_0xed07('0x23')]=function(_0x12bcfd,_0x255316){if(_0x12bcfd[_0xed07('0x4e')]['id']){delete _0x12bcfd[_0xed07('0x4e')]['id'];}return db[_0xed07('0x2e')][_0xed07('0x4c')]({'where':{'id':_0x12bcfd['params']['id']}})[_0xed07('0x24')](handleEntityNotFound(_0x255316,null))[_0xed07('0x24')](saveUpdates(_0x12bcfd[_0xed07('0x4e')],null))[_0xed07('0x24')](respondWithResult(_0x255316,null))[_0xed07('0x56')](handleError(_0x255316,null));};exports[_0xed07('0x25')]=function(_0x320ade,_0x452278){return db[_0xed07('0x2e')][_0xed07('0x4c')]({'where':{'id':_0x320ade[_0xed07('0x4a')]['id']}})[_0xed07('0x24')](handleEntityNotFound(_0x452278,null))[_0xed07('0x24')](removeEntity(_0x452278,null))[_0xed07('0x56')](handleError(_0x452278,null));};exports[_0xed07('0x57')]=function(_0x5bd6d1,_0x56d830){var _0x30a220=0xa;var _0x5cd790=[_0xed07('0x58'),'left_join',_0xed07('0x59'),_0xed07('0x5a')];var _0x57c844={'SUM':_0xed07('0x5b'),'COUNT':_0xed07('0x5c'),'COUNT DISTINCT':_0xed07('0x5d'),'MAX':_0xed07('0x5e'),'MIN':'MIN(%s)','AVG':_0xed07('0x5f'),'GROUP_CONCAT':_0xed07('0x60'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xed07('0x61')};var _0x549fc3={'SEC_TO_TIME':_0xed07('0x62'),'DATE':_0xed07('0x63'),'HOUR':_0xed07('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4e4db3=function(_0x1cc479){return!_[_0xed07('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xed07('0x66')],_0x1cc479);};var _0xf13ba3=function(_0x2c48e9){if(!_0x2c48e9||!_0x2c48e9[_0xed07('0x67')][_0xed07('0x38')]){return'';}for(var _0x367bf5='(',_0x3e54c5=0x0;_0x3e54c5<_0x2c48e9['rules'][_0xed07('0x38')];_0x3e54c5+=0x1){_0x3e54c5>0x0&&(_0x367bf5+='\x20'+_0x2c48e9[_0xed07('0x68')]+'\x20');_0x367bf5+=_0x2c48e9[_0xed07('0x67')][_0x3e54c5][_0xed07('0x69')]?_0xf13ba3(_0x2c48e9[_0xed07('0x67')][_0x3e54c5][_0xed07('0x69')]):_0x2c48e9[_0xed07('0x67')][_0x3e54c5]['field']+'\x20'+_0x2c48e9['rules'][_0x3e54c5][_0xed07('0x6a')]+(_0x4e4db3(_0x2c48e9[_0xed07('0x67')][_0x3e54c5][_0xed07('0x6a')])?'\x20'+_0x2c48e9[_0xed07('0x67')][_0x3e54c5][_0xed07('0x6b')]:'');}return _0x367bf5+')';};var _0x17a796={'where':{'id':_0x5bd6d1[_0xed07('0x4a')]['id']}},_0x22fde4,_0x45a1ac,_0x36b4f5,_0x587286,_0x1a27a8;_0x17a796=_[_0xed07('0x41')]({},_0x17a796,_0x5bd6d1['options']);return db['AnalyticCustomReport'][_0xed07('0x4c')](_0x17a796)[_0xed07('0x24')](function(_0x582089){if(_0x582089){_0x22fde4=_0x582089;return _0x582089[_0xed07('0x6c')]();}return null;})['then'](function(_0x2c8f12){if(_0x2c8f12){if(!_0x2c8f12['length']){throw new db[(_0xed07('0x6d'))][(_0xed07('0x6e'))](_0xed07('0x6f'),0x193);}_0x45a1ac=_0x2c8f12;return db[_0xed07('0x70')][_0xed07('0x47')]({'raw':!![]});}return null;})[_0xed07('0x24')](function(_0x54875f){if(_0x54875f){_0x36b4f5=_[_0xed07('0x71')](_0x54875f,'id');var _0x4835c4;var _0x1c0d52=squel['select']();_0x1c0d52[_0xed07('0x72')](_0x22fde4['table']);for(var _0x50b8e1=0x0;_0x50b8e1<_0x45a1ac[_0xed07('0x38')];_0x50b8e1+=0x1){_0x4835c4=_0x45a1ac[_0x50b8e1]['MetricId']?_0x36b4f5[_0x45a1ac[_0x50b8e1]['MetricId']]['metric']:_0x45a1ac[_0x50b8e1][_0xed07('0x73')];_0x4835c4=_0x45a1ac[_0x50b8e1][_0xed07('0x74')]?_[_0xed07('0x75')](_0x57c844[_0x45a1ac[_0x50b8e1][_0xed07('0x74')]],'%s',_0x4835c4):_0x4835c4;_0x4835c4=_0x45a1ac[_0x50b8e1]['format']?_[_0xed07('0x75')](_0x549fc3[_0x45a1ac[_0x50b8e1][_0xed07('0x76')]],'%s',_0x4835c4):_0x4835c4;if(_0x45a1ac[_0x50b8e1][_0xed07('0x77')]){_0x1c0d52['group'](_0x4835c4);}_0x45a1ac[_0x50b8e1][_0xed07('0x78')]&&_0x1c0d52['order'](_0x4835c4,_0x45a1ac[_0x50b8e1][_0xed07('0x78')]===_0xed07('0x79')?![]:!![]);_0x1c0d52[_0xed07('0x73')](_0x4835c4,_0x45a1ac[_0x50b8e1][_0xed07('0x7a')]||_0x4835c4);}if(_0x22fde4['joins']){_0x22fde4[_0xed07('0x7b')]=JSON['parse'](_0x22fde4['joins']);for(var _0x463564=0x0;_0x463564<_0x22fde4[_0xed07('0x7b')][_0xed07('0x38')];_0x463564+=0x1){if(_0x22fde4[_0xed07('0x7b')][_0x463564]['type']&&_[_0xed07('0x65')](_0x5cd790,_0x22fde4['joins'][_0x463564][_0xed07('0x42')])&&_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7c')]&&_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7d')]&&_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7e')]){_0x1c0d52[_0x22fde4[_0xed07('0x7b')][_0x463564]['type']](_0x22fde4[_0xed07('0x7b')][_0x463564]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x22fde4[_0xed07('0x7f')],_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7c')],_0x22fde4['joins'][_0x463564][_0xed07('0x7d')],_0x22fde4[_0xed07('0x7b')][_0x463564][_0xed07('0x7e')]));}}}if(_0x22fde4[_0xed07('0x80')]){_0x22fde4['conditions']=JSON[_0xed07('0x81')](_0x22fde4[_0xed07('0x80')]);_0x1c0d52[_0xed07('0x40')](_0xf13ba3(_0x22fde4['conditions'][_0xed07('0x69')]));}_0x1a27a8=_0x1c0d52[_0xed07('0x82')]();_0x1c0d52[_0xed07('0x1e')](_0x30a220);_0x1c0d52[_0xed07('0x1f')](0x0);logger[_0xed07('0x83')](_0xed07('0x84'),_0x1c0d52[_0xed07('0x85')]());return dbH[_0xed07('0x86')][_0xed07('0x33')](_0x1c0d52[_0xed07('0x85')](),{'type':dbH[_0xed07('0x86')][_0xed07('0x87')]['SELECT']});}})[_0xed07('0x24')](respondWithResult(_0x56d830,null))[_0xed07('0x56')](handleError(_0x56d830,null));};function runReport(_0x82d8f8,_0x29bf9d,_0x5b3e14){var _0x5bc9dd=_0x29bf9d[_0xed07('0x2a')];var _0x198f5b=0xa;var _0x3491fb=[_0xed07('0x58'),_0xed07('0x88'),_0xed07('0x59'),_0xed07('0x5a')];var _0x376d01={'SUM':'SUM(%s)','COUNT':_0xed07('0x5c'),'COUNT DISTINCT':_0xed07('0x5d'),'MAX':_0xed07('0x5e'),'MIN':_0xed07('0x89'),'AVG':_0xed07('0x5f'),'GROUP_CONCAT':_0xed07('0x60'),'GROUP_CONCAT ASC':_0xed07('0x8a'),'GROUP_CONCAT DESC':_0xed07('0x61')};var _0x12e130={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xed07('0x63'),'HOUR':_0xed07('0x64'),'ROUND':_0xed07('0x8b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1d0254=function(_0x561473){return!_[_0xed07('0x65')]([_0xed07('0x8c'),_0xed07('0x8d'),'IS\x20EMPTY',_0xed07('0x66')],_0x561473);};var _0x2ae5dd=function(_0x18938e){if(!_0x18938e||!_0x18938e['rules']['length']){return'';}for(var _0x43c4c5='(',_0x183074=0x0;_0x183074<_0x18938e[_0xed07('0x67')]['length'];_0x183074+=0x1){_0x183074>0x0&&(_0x43c4c5+='\x20'+_0x18938e[_0xed07('0x68')]+'\x20');_0x43c4c5+=_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x69')]?_0x2ae5dd(_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x69')]):_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x73')]+'\x20'+_0x18938e['rules'][_0x183074][_0xed07('0x6a')]+(_0x1d0254(_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x6a')])?'\x20'+_0x18938e[_0xed07('0x67')][_0x183074][_0xed07('0x6b')]:'');}return _0x43c4c5+')';};var _0x54be7d={'where':{'id':_0x82d8f8['id']}},_0x5ebdb5,_0x4e8421,_0xe5631f,_0x113cd0,_0x3cfc43;_0x54be7d=_[_0xed07('0x41')]({},_0x54be7d,_0x5b3e14);return db[_0xed07('0x2e')][_0xed07('0x4c')](_0x54be7d)[_0xed07('0x24')](function(_0x4ec1e6){if(_0x4ec1e6){_0x5ebdb5=_0x4ec1e6;return _0x4ec1e6[_0xed07('0x6c')]();}return null;})[_0xed07('0x24')](function(_0x5b9114){if(_0x5b9114){if(!_0x5b9114[_0xed07('0x38')]){throw new db[(_0xed07('0x6d'))][(_0xed07('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4e8421=_0x5b9114;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xed07('0x24')](function(_0x46c608){if(_0x46c608){_0xe5631f=_['keyBy'](_0x46c608,'id');var _0x2c99c2;var _0x3a42b9=squel[_0xed07('0x8e')]();_0x3a42b9[_0xed07('0x72')](_0x5ebdb5[_0xed07('0x7f')]);for(var _0x293b4d=0x0;_0x293b4d<_0x4e8421[_0xed07('0x38')];_0x293b4d+=0x1){_0x2c99c2=_0x4e8421[_0x293b4d][_0xed07('0x8f')]?_0xe5631f[_0x4e8421[_0x293b4d][_0xed07('0x8f')]]['metric']:_0x4e8421[_0x293b4d]['field'];_0x2c99c2=_0x4e8421[_0x293b4d][_0xed07('0x74')]?_['replace'](_0x376d01[_0x4e8421[_0x293b4d]['function']],'%s',_0x2c99c2):_0x2c99c2;_0x2c99c2=_0x4e8421[_0x293b4d][_0xed07('0x76')]?_[_0xed07('0x75')](_0x12e130[_0x4e8421[_0x293b4d][_0xed07('0x76')]],'%s',_0x2c99c2):_0x2c99c2;if(_0x4e8421[_0x293b4d][_0xed07('0x77')]){_0x3a42b9[_0xed07('0x69')](_0x2c99c2);}_0x4e8421[_0x293b4d]['orderBy']&&_0x3a42b9['order'](_0x2c99c2,_0x4e8421[_0x293b4d]['orderBy']===_0xed07('0x79')?![]:!![]);_0x3a42b9['field'](_0x2c99c2,_0x4e8421[_0x293b4d]['alias']||_0x2c99c2);}if(_0x5ebdb5[_0xed07('0x7b')]){_0x5ebdb5[_0xed07('0x7b')]=JSON['parse'](_0x5ebdb5['joins']);for(var _0x5c7a64=0x0;_0x5c7a64<_0x5ebdb5[_0xed07('0x7b')][_0xed07('0x38')];_0x5c7a64+=0x1){if(_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x42')]&&_['includes'](_0x3491fb,_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x42')])&&_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x7c')]&&_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64]['foreignTable']&&_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x7e')]){_0x3a42b9[_0x5ebdb5['joins'][_0x5c7a64][_0xed07('0x42')]](_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64]['foreignTable'],null,util[_0xed07('0x76')](_0xed07('0x90'),_0x5ebdb5['table'],_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x7c')],_0x5ebdb5['joins'][_0x5c7a64]['foreignTable'],_0x5ebdb5[_0xed07('0x7b')][_0x5c7a64][_0xed07('0x7e')]));}}}if(_0x5ebdb5[_0xed07('0x80')]){_0x5ebdb5[_0xed07('0x80')]=JSON[_0xed07('0x81')](_0x5ebdb5[_0xed07('0x80')]);_0x3a42b9[_0xed07('0x40')](_0x2ae5dd(_0x5ebdb5[_0xed07('0x80')][_0xed07('0x69')]));}_0x3cfc43=_0x3a42b9['clone']();_0x3a42b9['limit'](_0x198f5b);_0x3a42b9[_0xed07('0x1f')](0x0);return;}})[_0xed07('0x24')](function(){if(_0x29bf9d[_0xed07('0x91')]==='web'){return null;}var _0x201760=_[_0xed07('0x41')](_0x29bf9d,{'name':_0x29bf9d[_0xed07('0x92')]||_0x29bf9d[_0xed07('0x2a')]||_0x5ebdb5[_0xed07('0x2a')],'basename':_0x5bc9dd,'savename':util['format'](_0xed07('0x93'),_0x29bf9d[_0xed07('0x2a')]||_0x5ebdb5['name'],require('randomstring')[_0xed07('0x94')](0x4),_0x29bf9d['output']||'csv'),'reportId':_0x5ebdb5['id'],'reportType':_0xed07('0x95')});return db[_0xed07('0x96')]['create'](_0x201760,{'raw':!![]});})[_0xed07('0x24')](function(_0x4c23b3){if(_0x5ebdb5['table']==='cdr'){_0x3cfc43[_0xed07('0x40')](_0x5ebdb5['table']+_0xed07('0x97'),_0x29bf9d['startDate'],_0x29bf9d['endDate']);}else{_0x3cfc43[_0xed07('0x40')](_0x5ebdb5[_0xed07('0x7f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x29bf9d['startDate'],_0x29bf9d[_0xed07('0x98')]);}if(_0x4c23b3){logger['info'](_0xed07('0x99'),_0x3cfc43[_0xed07('0x85')]());require(_0xed07('0x9a'))[_0xed07('0x9b')](path[_0xed07('0x58')](__dirname,_0xed07('0x9c'),_0x4c23b3[_0xed07('0x91')]),[_0x4c23b3['id'],_0x3cfc43[_0xed07('0x85')](),path[_0xed07('0x58')](__dirname,'../../files/reports',_0x4c23b3[_0xed07('0x9d')]),_0x5bc9dd]);return _0x4c23b3;}else{var _0x2a5549=squel[_0xed07('0x8e')]();_0x2a5549['from']('('+_0x3cfc43[_0xed07('0x85')]()+')','countTable');_0x2a5549[_0xed07('0x73')]('COUNT(*)',_0xed07('0x44'));_0x3cfc43[_0xed07('0x1e')](_0x29bf9d[_0xed07('0x1e')]||_0x198f5b);_0x3cfc43['offset'](_0x29bf9d[_0xed07('0x1f')]||0x0);return dbH[_0xed07('0x86')][_0xed07('0x33')](_0x2a5549[_0xed07('0x85')](),{'type':dbH[_0xed07('0x86')][_0xed07('0x87')][_0xed07('0x9e')]})['then'](function(_0x456720){if(!_0x456720['length']){_0x113cd0=0x0;}else{_0x113cd0=_0x456720[0x0][_0xed07('0x44')]||0x0;}return dbH[_0xed07('0x86')][_0xed07('0x33')](_0x3cfc43['toString'](),{'type':dbH[_0xed07('0x86')][_0xed07('0x87')]['SELECT']});})[_0xed07('0x24')](function(_0xad4409){return{'rows':_0xad4409||[],'count':_0x113cd0};});}});}exports[_0xed07('0x9f')]=function(_0x292963,_0x1a9e4e){return runReport(_0x292963['params'],_0x292963['query'],_0x292963['options'])[_0xed07('0x24')](respondWithResult(_0x1a9e4e,null))['catch'](handleError(_0x1a9e4e,null));};exports['runReport']=runReport;exports[_0xed07('0x33')]=function(_0x163716,_0x1ce9b6){var _0x3e8b32=0xa;var _0x57bb47=[_0xed07('0x58'),_0xed07('0x88'),'right_join',_0xed07('0x5a')];var _0x2d0556={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xed07('0x5d'),'MAX':_0xed07('0x5e'),'MIN':_0xed07('0x89'),'AVG':_0xed07('0x5f'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xed07('0x8a'),'GROUP_CONCAT DESC':_0xed07('0x61')};var _0x50a62f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xed07('0x63'),'HOUR':_0xed07('0x64'),'ROUND':_0xed07('0x8b'),'UNIX_TIMESTAMP':_0xed07('0xa0')};var _0x5aa118=function(_0x28554e){return!_['includes']([_0xed07('0x8c'),_0xed07('0x8d'),'IS\x20EMPTY',_0xed07('0x66')],_0x28554e);};var _0x3c400a=function(_0x468d64){if(!_0x468d64||!_0x468d64['rules'][_0xed07('0x38')]){return'';}for(var _0x1da1df='(',_0x377259=0x0;_0x377259<_0x468d64['rules'][_0xed07('0x38')];_0x377259+=0x1){_0x377259>0x0&&(_0x1da1df+='\x20'+_0x468d64['operator']+'\x20');_0x1da1df+=_0x468d64['rules'][_0x377259][_0xed07('0x69')]?_0x3c400a(_0x468d64['rules'][_0x377259][_0xed07('0x69')]):_0x468d64[_0xed07('0x67')][_0x377259][_0xed07('0x73')]+'\x20'+_0x468d64[_0xed07('0x67')][_0x377259][_0xed07('0x6a')]+(_0x5aa118(_0x468d64[_0xed07('0x67')][_0x377259][_0xed07('0x6a')])?'\x20'+_0x468d64['rules'][_0x377259][_0xed07('0x6b')]:'');}return _0x1da1df+')';};var _0x4d6f58={'where':{'id':_0x163716['params']['id']}},_0x50c2e0,_0x7ec40c,_0x1f4833,_0xcf40dc,_0x39ef0c;_0x4d6f58=_[_0xed07('0x41')]({},_0x4d6f58,_0x163716['options']);return db[_0xed07('0x2e')]['find'](_0x4d6f58)[_0xed07('0x24')](function(_0x57219a){if(_0x57219a){_0x50c2e0=_0x57219a;return _0x57219a[_0xed07('0x6c')]();}return null;})[_0xed07('0x24')](function(_0xd46710){if(_0xd46710){if(!_0xd46710[_0xed07('0x38')]){throw new db[(_0xed07('0x6d'))][(_0xed07('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x7ec40c=_0xd46710;return db[_0xed07('0x70')]['findAll']({'raw':!![]});}return null;})[_0xed07('0x24')](function(_0x12a782){if(_0x12a782){_0x1f4833=_['keyBy'](_0x12a782,'id');var _0xa50109;var _0x447158=squel[_0xed07('0x8e')]();_0x447158['from'](_0x50c2e0[_0xed07('0x7f')]);for(var _0xc26b71=0x0;_0xc26b71<_0x7ec40c[_0xed07('0x38')];_0xc26b71+=0x1){_0xa50109=_0x7ec40c[_0xc26b71][_0xed07('0x8f')]?_0x1f4833[_0x7ec40c[_0xc26b71]['MetricId']][_0xed07('0xa1')]:_0x7ec40c[_0xc26b71]['field'];_0xa50109=_0x7ec40c[_0xc26b71][_0xed07('0x74')]?_['replace'](_0x2d0556[_0x7ec40c[_0xc26b71][_0xed07('0x74')]],'%s',_0xa50109):_0xa50109;_0xa50109=_0x7ec40c[_0xc26b71][_0xed07('0x76')]?_[_0xed07('0x75')](_0x50a62f[_0x7ec40c[_0xc26b71][_0xed07('0x76')]],'%s',_0xa50109):_0xa50109;if(_0x7ec40c[_0xc26b71][_0xed07('0x77')]){_0x447158['group'](_0xa50109);}_0x7ec40c[_0xc26b71][_0xed07('0x78')]&&_0x447158[_0xed07('0x3b')](_0xa50109,_0x7ec40c[_0xc26b71]['orderBy']==='DESC'?![]:!![]);_0x447158[_0xed07('0x73')](_0xa50109,_0x7ec40c[_0xc26b71][_0xed07('0x7a')]||_0xa50109);}if(_0x50c2e0[_0xed07('0x7b')]){_0x50c2e0[_0xed07('0x7b')]=JSON[_0xed07('0x81')](_0x50c2e0[_0xed07('0x7b')]);for(var _0x59b805=0x0;_0x59b805<_0x50c2e0['joins']['length'];_0x59b805+=0x1){if(_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x42')]&&_[_0xed07('0x65')](_0x57bb47,_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x42')])&&_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7c')]&&_0x50c2e0['joins'][_0x59b805][_0xed07('0x7d')]&&_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7e')]){_0x447158[_0x50c2e0['joins'][_0x59b805][_0xed07('0x42')]](_0x50c2e0[_0xed07('0x7b')][_0x59b805]['foreignTable'],null,util[_0xed07('0x76')](_0xed07('0x90'),_0x50c2e0[_0xed07('0x7f')],_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7c')],_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7d')],_0x50c2e0[_0xed07('0x7b')][_0x59b805][_0xed07('0x7e')]));}}}if(_0x50c2e0['conditions']){_0x50c2e0[_0xed07('0x80')]=JSON[_0xed07('0x81')](_0x50c2e0[_0xed07('0x80')]);_0x447158['where'](_0x3c400a(_0x50c2e0[_0xed07('0x80')][_0xed07('0x69')]));}_0x39ef0c=_0x447158[_0xed07('0x82')]();_0x447158[_0xed07('0x1e')](_0x3e8b32);_0x447158[_0xed07('0x1f')](0x0);logger[_0xed07('0x83')](_0xed07('0x84'),_0x447158[_0xed07('0x85')]());return dbH[_0xed07('0x86')]['query'](_0x447158[_0xed07('0x85')](),{'type':dbH[_0xed07('0x86')]['QueryTypes'][_0xed07('0x9e')]});}})[_0xed07('0x24')](function(){return{'sql':_0x39ef0c[_0xed07('0x85')]()};})[_0xed07('0x24')](respondWithResult(_0x1ce9b6,null))[_0xed07('0x56')](handleError(_0x1ce9b6,null));};
\ No newline at end of file
+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
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 9d93a98..3b8d801 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 _0xc2a4=['../../config/logger','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xc2a4,0x1d2));var _0x4c2a=function(_0x1354ed,_0x45b93d){_0x1354ed=_0x1354ed-0x0;var _0x5e3605=_0xc2a4[_0x1354ed];return _0x5e3605;};'use strict';var _=require(_0x4c2a('0x0'));var util=require(_0x4c2a('0x1'));var logger=require(_0x4c2a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4c2a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c2a('0x4'));var rimraf=require(_0x4c2a('0x5'));var config=require(_0x4c2a('0x6'));var attributes=require(_0x4c2a('0x7'));module[_0x4c2a('0x8')]=function(_0xc91c86,_0x542bcb){return _0xc91c86[_0x4c2a('0x9')](_0x4c2a('0xa'),attributes,{'tableName':_0x4c2a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index b55e466..eb7da2e 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 _0x9d68=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x11d447,_0x5b9c09){var _0x285004=function(_0x32ecab){while(--_0x32ecab){_0x11d447['push'](_0x11d447['shift']());}};_0x285004(++_0x5b9c09);}(_0x9d68,0xd1));var _0x89d6=function(_0x34b5ca,_0x594010){_0x34b5ca=_0x34b5ca-0x0;var _0x2d72c0=_0x9d68[_0x34b5ca];return _0x2d72c0;};'use strict';var _=require(_0x89d6('0x0'));var util=require('util');var moment=require(_0x89d6('0x1'));var BPromise=require(_0x89d6('0x2'));var rs=require(_0x89d6('0x3'));var fs=require('fs');var Redis=require(_0x89d6('0x4'));var db=require(_0x89d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x89d6('0x6'));var config=require(_0x89d6('0x7'));var jayson=require(_0x89d6('0x8'));var client=jayson[_0x89d6('0x9')][_0x89d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33ce6c,_0x2bfdb1,_0x239017){return new BPromise(function(_0x1769eb,_0x2aedf0){return client[_0x89d6('0xb')](_0x33ce6c,_0x239017)[_0x89d6('0xc')](function(_0x32bd5c){logger[_0x89d6('0xd')](_0x89d6('0xe'),_0x2bfdb1,_0x89d6('0xf'));logger[_0x89d6('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2bfdb1,_0x89d6('0xf'),JSON[_0x89d6('0x11')](_0x32bd5c));if(_0x32bd5c[_0x89d6('0x12')]){if(_0x32bd5c['error'][_0x89d6('0x13')]===0x1f4){logger['error'](_0x89d6('0xe'),_0x2bfdb1,_0x32bd5c[_0x89d6('0x12')][_0x89d6('0x14')]);return _0x2aedf0(_0x32bd5c[_0x89d6('0x12')][_0x89d6('0x14')]);}logger[_0x89d6('0x12')](_0x89d6('0xe'),_0x2bfdb1,_0x32bd5c[_0x89d6('0x12')][_0x89d6('0x14')]);return _0x1769eb(_0x32bd5c[_0x89d6('0x12')][_0x89d6('0x14')]);}else{logger[_0x89d6('0xd')](_0x89d6('0xe'),_0x2bfdb1,'request\x20sent');_0x1769eb(_0x32bd5c[_0x89d6('0x15')][_0x89d6('0x14')]);}})[_0x89d6('0x16')](function(_0x350610){logger[_0x89d6('0x12')](_0x89d6('0xe'),_0x2bfdb1,_0x350610);_0x2aedf0(_0x350610);});});}
\ No newline at end of file
+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
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 369e385..839c1d3 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 _0x2c60=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','query','create','put','delete','destroy','exports','multer','util'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x2c60,0xcd));var _0x02c6=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x2c60[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require(_0x02c6('0x0'));var util=require(_0x02c6('0x1'));var path=require(_0x02c6('0x2'));var timeout=require(_0x02c6('0x3'));var express=require(_0x02c6('0x4'));var router=express[_0x02c6('0x5')]();var fs_extra=require(_0x02c6('0x6'));var auth=require(_0x02c6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x02c6('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x02c6('0x9')]);router[_0x02c6('0xa')](_0x02c6('0xb'),auth[_0x02c6('0xc')](),controller[_0x02c6('0xd')]);router[_0x02c6('0xa')](_0x02c6('0xe'),auth[_0x02c6('0xc')](),controller[_0x02c6('0xf')]);router[_0x02c6('0xa')](_0x02c6('0x10'),auth[_0x02c6('0xc')](),controller['run']);router[_0x02c6('0xa')]('/:id/query',auth[_0x02c6('0xc')](),controller[_0x02c6('0x11')]);router['post']('/',auth[_0x02c6('0xc')](),controller[_0x02c6('0x12')]);router[_0x02c6('0x13')](_0x02c6('0xb'),auth[_0x02c6('0xc')](),controller['update']);router[_0x02c6('0x14')](_0x02c6('0xb'),auth['isAuthenticated'](),controller[_0x02c6('0x15')]);module[_0x02c6('0x16')]=router;
\ No newline at end of file
+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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 6e759fe..8f66acb 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 _0x326f=['STRING','TEXT','sequelize'];(function(_0x2c890a,_0x127db2){var _0x301a13=function(_0x1fae7){while(--_0x1fae7){_0x2c890a['push'](_0x2c890a['shift']());}};_0x301a13(++_0x127db2);}(_0x326f,0xd1));var _0xf326=function(_0x5a8133,_0x485c40){_0x5a8133=_0x5a8133-0x0;var _0x4d8801=_0x326f[_0x5a8133];return _0x4d8801;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
+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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 6fa57fe..6e360c4 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(_0x348a50,_0xe211f1){var _0x29beb2=function(_0x1a4036){while(--_0x1a4036){_0x348a50['push'](_0x348a50['shift']());}};_0x29beb2(++_0xe211f1);}(_0x2675,0x75));var _0x5267=function(_0x5853e4,_0x1d5e9a){_0x5853e4=_0x5853e4-0x0;var _0x3228d7=_0x2675[_0x5853e4];return _0x3228d7;};'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 _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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 38c26f0..0345b11 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 _0xe6f3=['request-promise','path','rimraf','../../config/environment','exports','define','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0xbf3a7b,_0x42ada8){var _0x5ad5f8=function(_0x89ee1){while(--_0x89ee1){_0xbf3a7b['push'](_0xbf3a7b['shift']());}};_0x5ad5f8(++_0x42ada8);}(_0xe6f3,0xeb));var _0x3e6f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe6f3[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3e6f('0x0'));var util=require(_0x3e6f('0x1'));var logger=require(_0x3e6f('0x2'))(_0x3e6f('0x3'));var moment=require(_0x3e6f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e6f('0x5'));var fs=require('fs');var path=require(_0x3e6f('0x6'));var rimraf=require(_0x3e6f('0x7'));var config=require(_0x3e6f('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x3e6f('0x9')]=function(_0x222085,_0x1b2524){return _0x222085[_0x3e6f('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x3e6f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index ef7e504..ae86345 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 _0x21e0=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x21e0,0xda));var _0x021e=function(_0x305d5d,_0x41cf20){_0x305d5d=_0x305d5d-0x0;var _0x89e1dd=_0x21e0[_0x305d5d];return _0x89e1dd;};'use strict';var _=require(_0x021e('0x0'));var util=require(_0x021e('0x1'));var moment=require(_0x021e('0x2'));var BPromise=require(_0x021e('0x3'));var rs=require(_0x021e('0x4'));var fs=require('fs');var Redis=require(_0x021e('0x5'));var db=require(_0x021e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x021e('0x7'))(_0x021e('0x8'));var config=require(_0x021e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x021e('0xa')][_0x021e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cfefa,_0x17af04,_0x9bf7f0){return new BPromise(function(_0x149b8b,_0x15e899){return client[_0x021e('0xc')](_0x2cfefa,_0x9bf7f0)[_0x021e('0xd')](function(_0x4a1296){logger['info'](_0x021e('0xe'),_0x17af04,_0x021e('0xf'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x17af04,'request\x20sent',JSON[_0x021e('0x10')](_0x4a1296));if(_0x4a1296[_0x021e('0x11')]){if(_0x4a1296[_0x021e('0x11')][_0x021e('0x12')]===0x1f4){logger[_0x021e('0x11')](_0x021e('0xe'),_0x17af04,_0x4a1296[_0x021e('0x11')][_0x021e('0x13')]);return _0x15e899(_0x4a1296[_0x021e('0x11')][_0x021e('0x13')]);}logger[_0x021e('0x11')](_0x021e('0xe'),_0x17af04,_0x4a1296['error']['message']);return _0x149b8b(_0x4a1296[_0x021e('0x11')][_0x021e('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x17af04,_0x021e('0xf'));_0x149b8b(_0x4a1296[_0x021e('0x14')]['message']);}})['catch'](function(_0x1d8e87){logger[_0x021e('0x11')](_0x021e('0xe'),_0x17af04,_0x1d8e87);_0x15e899(_0x1d8e87);});});}
\ No newline at end of file
+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
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 8c8a28e..64b6e93 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 _0xcf53=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id'];(function(_0x323df1,_0x5b31f4){var _0x312757=function(_0x3bcc55){while(--_0x3bcc55){_0x323df1['push'](_0x323df1['shift']());}};_0x312757(++_0x5b31f4);}(_0xcf53,0x15a));var _0x3cf5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcf53[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x3cf5('0x0'));var util=require(_0x3cf5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3cf5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3cf5('0x3'));var interaction=require(_0x3cf5('0x4'));var config=require(_0x3cf5('0x5'));var controller=require(_0x3cf5('0x6'));router[_0x3cf5('0x7')]('/',auth[_0x3cf5('0x8')](),controller[_0x3cf5('0x9')]);router[_0x3cf5('0x7')](_0x3cf5('0xa'),auth[_0x3cf5('0x8')](),controller[_0x3cf5('0xb')]);router[_0x3cf5('0x7')](_0x3cf5('0xc'),auth['isAuthenticated'](),controller[_0x3cf5('0xd')]);router[_0x3cf5('0x7')](_0x3cf5('0xe'),auth[_0x3cf5('0x8')](),controller[_0x3cf5('0xf')]);router[_0x3cf5('0x7')](_0x3cf5('0x10'),auth[_0x3cf5('0x8')](),controller[_0x3cf5('0x11')]);router[_0x3cf5('0x12')]('/',auth[_0x3cf5('0x8')](),controller[_0x3cf5('0x13')]);router[_0x3cf5('0x14')](_0x3cf5('0xa'),auth[_0x3cf5('0x8')](),controller['update']);router['delete'](_0x3cf5('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+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
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index d1e47b7..f4f518e 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 _0x1e34=['DATE','Loading','manual','scheduled','INTEGER','sequelize','exports','STRING','ENUM','csv','pdf','xlsx'];(function(_0x242b15,_0x546fe1){var _0x40443a=function(_0x4ed34f){while(--_0x4ed34f){_0x242b15['push'](_0x242b15['shift']());}};_0x40443a(++_0x546fe1);}(_0x1e34,0x1d9));var _0x41e3=function(_0x456432,_0x2979c3){_0x456432=_0x456432-0x0;var _0x47706f=_0x1e34[_0x456432];return _0x47706f;};'use strict';var Sequelize=require(_0x41e3('0x0'));var moment=require('moment');module[_0x41e3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x41e3('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x41e3('0x3')](_0x41e3('0x4'),_0x41e3('0x5'),_0x41e3('0x6')),'allowNull':![],'defaultValue':_0x41e3('0x4')},'savename':{'type':Sequelize[_0x41e3('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x41e3('0x7')]},'status':{'type':Sequelize[_0x41e3('0x2')],'defaultValue':_0x41e3('0x8')},'type':{'type':Sequelize[_0x41e3('0x3')](_0x41e3('0x9'),_0x41e3('0xa')),'allowNull':![],'defaultValue':_0x41e3('0x9')},'reportId':{'type':Sequelize[_0x41e3('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x41e3('0x2')]}};
\ No newline at end of file
+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
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index e258c86..f515c67 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 _0x1e6c=['savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports'];(function(_0x4b3512,_0xb29a42){var _0x47d086=function(_0x22710f){while(--_0x22710f){_0x4b3512['push'](_0x4b3512['shift']());}};_0x47d086(++_0xb29a42);}(_0x1e6c,0x137));var _0xc1e6=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0x1e6c[_0x49e584];return _0x58b1be;};'use strict';var emlformat=require(_0xc1e6('0x0'));var rimraf=require(_0xc1e6('0x1'));var zipdir=require(_0xc1e6('0x2'));var jsonpatch=require(_0xc1e6('0x3'));var rp=require(_0xc1e6('0x4'));var moment=require(_0xc1e6('0x5'));var BPromise=require(_0xc1e6('0x6'));var Mustache=require(_0xc1e6('0x7'));var util=require(_0xc1e6('0x8'));var path=require('path');var sox=require(_0xc1e6('0x9'));var csv=require(_0xc1e6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1e6('0xb'));var _=require(_0xc1e6('0xc'));var squel=require(_0xc1e6('0xd'));var crypto=require('crypto');var jsforce=require(_0xc1e6('0xe'));var deskjs=require(_0xc1e6('0xf'));var toCsv=require(_0xc1e6('0xa'));var querystring=require(_0xc1e6('0x10'));var Papa=require(_0xc1e6('0x11'));var Redis=require(_0xc1e6('0x12'));var authService=require(_0xc1e6('0x13'));var qs=require(_0xc1e6('0x14'));var as=require(_0xc1e6('0x15'));var hardwareService=require(_0xc1e6('0x16'));var logger=require('../../config/logger')(_0xc1e6('0x17'));var utils=require(_0xc1e6('0x18'));var config=require(_0xc1e6('0x19'));var licenseUtil=require(_0xc1e6('0x1a'));var db=require(_0xc1e6('0x1b'))['db'];function respondWithStatusCode(_0x339e7a,_0x14af17){_0x14af17=_0x14af17||0xcc;return function(_0xa37d70){if(_0xa37d70){return _0x339e7a[_0xc1e6('0x1c')](_0x14af17);}return _0x339e7a[_0xc1e6('0x1d')](_0x14af17)[_0xc1e6('0x1e')]();};}function respondWithResult(_0x9ec315,_0x17322f){_0x17322f=_0x17322f||0xc8;return function(_0x40f393){if(_0x40f393){return _0x9ec315['status'](_0x17322f)['json'](_0x40f393);}};}function respondWithFilteredResult(_0x5d5744,_0x502f74){return function(_0x3840aa){if(_0x3840aa){var _0x33b168=typeof _0x502f74[_0xc1e6('0x1f')]===_0xc1e6('0x20')&&typeof _0x502f74[_0xc1e6('0x21')]===_0xc1e6('0x20');var _0x193b50=_0x3840aa[_0xc1e6('0x22')];var _0x52f2a8=_0x33b168?0x0:_0x502f74['offset'];var _0x18c973=_0x33b168?_0x3840aa[_0xc1e6('0x22')]:_0x502f74[_0xc1e6('0x1f')]+_0x502f74[_0xc1e6('0x21')];var _0x2feda8;if(_0x18c973>=_0x193b50){_0x18c973=_0x193b50;_0x2feda8=0xc8;}else{_0x2feda8=0xce;}_0x5d5744['status'](_0x2feda8);return _0x5d5744['set'](_0xc1e6('0x23'),_0x52f2a8+'-'+_0x18c973+'/'+_0x193b50)['json'](_0x3840aa);}return null;};}function patchUpdates(_0x3fe2c1){return function(_0x2c7662){try{jsonpatch[_0xc1e6('0x24')](_0x2c7662,_0x3fe2c1,!![]);}catch(_0x187a9b){return BPromise[_0xc1e6('0x25')](_0x187a9b);}return _0x2c7662[_0xc1e6('0x26')]();};}function saveUpdates(_0x29a4e5,_0x19ddf4){return function(_0x1729ed){if(_0x1729ed){return _0x1729ed['update'](_0x29a4e5)[_0xc1e6('0x27')](function(_0x2f1eee){return _0x2f1eee;});}return null;};}function removeEntity(_0x5c51c2,_0x38a43e){return function(_0x166485){if(_0x166485){return _0x166485[_0xc1e6('0x28')]()[_0xc1e6('0x27')](function(){var _0x36bbe8=_0x166485[_0xc1e6('0x29')]({'plain':!![]});var _0x85c465=_0xc1e6('0x2a');return db[_0xc1e6('0x2b')][_0xc1e6('0x28')]({'where':{'type':_0x85c465,'resourceId':_0x36bbe8['id']}})['then'](function(){return _0x166485;});})['then'](function(){_0x5c51c2[_0xc1e6('0x1d')](0xcc)[_0xc1e6('0x1e')]();});}};}function handleEntityNotFound(_0x219a14,_0x21abdd){return function(_0x3e17b5){if(!_0x3e17b5){_0x219a14[_0xc1e6('0x1c')](0x194);}return _0x3e17b5;};}function handleError(_0x57c979,_0x50d157){_0x50d157=_0x50d157||0x1f4;return function(_0x5ab8f1){logger[_0xc1e6('0x2c')](_0x5ab8f1[_0xc1e6('0x2d')]);if(_0x5ab8f1[_0xc1e6('0x2e')]){delete _0x5ab8f1[_0xc1e6('0x2e')];}_0x57c979['status'](_0x50d157)[_0xc1e6('0x2f')](_0x5ab8f1);};}exports[_0xc1e6('0x30')]=function(_0x12a1f2,_0x2468bb){var _0x3e9597={},_0x8db248={},_0x5cf6f3={'count':0x0,'rows':[]};var _0x25e605=_[_0xc1e6('0x31')](db[_0xc1e6('0x32')][_0xc1e6('0x33')],function(_0x17fb5b){return{'name':_0x17fb5b[_0xc1e6('0x34')],'type':_0x17fb5b[_0xc1e6('0x35')][_0xc1e6('0x36')]};});_0x8db248[_0xc1e6('0x37')]=_[_0xc1e6('0x31')](_0x25e605,_0xc1e6('0x2e'));_0x8db248['query']=_[_0xc1e6('0x38')](_0x12a1f2['query']);_0x8db248['filters']=_[_0xc1e6('0x39')](_0x8db248[_0xc1e6('0x37')],_0x8db248[_0xc1e6('0x3a')]);_0x3e9597['attributes']=_[_0xc1e6('0x39')](_0x8db248[_0xc1e6('0x37')],qs[_0xc1e6('0x3b')](_0x12a1f2[_0xc1e6('0x3a')]['fields']));_0x3e9597[_0xc1e6('0x3c')]=_0x3e9597[_0xc1e6('0x3c')][_0xc1e6('0x3d')]?_0x3e9597[_0xc1e6('0x3c')]:_0x8db248[_0xc1e6('0x37')];if(!_0x12a1f2[_0xc1e6('0x3a')]['hasOwnProperty'](_0xc1e6('0x3e'))){_0x3e9597['limit']=qs[_0xc1e6('0x21')](_0x12a1f2['query']['limit']);_0x3e9597[_0xc1e6('0x1f')]=qs[_0xc1e6('0x1f')](_0x12a1f2[_0xc1e6('0x3a')]['offset']);}_0x3e9597[_0xc1e6('0x3f')]=qs[_0xc1e6('0x40')](_0x12a1f2['query']['sort']);_0x3e9597[_0xc1e6('0x41')]=qs[_0xc1e6('0x42')](_['pick'](_0x12a1f2[_0xc1e6('0x3a')],_0x8db248[_0xc1e6('0x42')]),_0x25e605);if(_0x12a1f2[_0xc1e6('0x3a')][_0xc1e6('0x43')]){_0x3e9597[_0xc1e6('0x41')]=_[_0xc1e6('0x44')](_0x3e9597[_0xc1e6('0x41')],{'$or':_['map'](_0x25e605,function(_0x20075e){if(_0x20075e[_0xc1e6('0x35')]!==_0xc1e6('0x45')){var _0x29b1e0={};_0x29b1e0[_0x20075e['name']]={'$like':'%'+_0x12a1f2[_0xc1e6('0x3a')]['filter']+'%'};return _0x29b1e0;}})});}_0x3e9597=_[_0xc1e6('0x44')]({},_0x3e9597,_0x12a1f2[_0xc1e6('0x46')]);var _0x1b90aa={'where':_0x3e9597['where']};return db[_0xc1e6('0x32')]['count'](_0x1b90aa)['then'](function(_0x50afc4){_0x5cf6f3[_0xc1e6('0x22')]=_0x50afc4;if(_0x12a1f2[_0xc1e6('0x3a')][_0xc1e6('0x47')]){_0x3e9597[_0xc1e6('0x48')]=[{'all':!![]}];}return db[_0xc1e6('0x32')][_0xc1e6('0x49')](_0x3e9597);})[_0xc1e6('0x27')](function(_0x4724dd){_0x5cf6f3[_0xc1e6('0x4a')]=_0x4724dd;return _0x5cf6f3;})[_0xc1e6('0x27')](respondWithFilteredResult(_0x2468bb,_0x3e9597))[_0xc1e6('0x4b')](handleError(_0x2468bb,null));};exports[_0xc1e6('0x4c')]=function(_0x57a538,_0x260c1b){var _0x5ab98f={'raw':!![],'where':{'id':_0x57a538[_0xc1e6('0x4d')]['id']}},_0x4ff6dc={};_0x4ff6dc[_0xc1e6('0x37')]=_[_0xc1e6('0x38')](db[_0xc1e6('0x32')][_0xc1e6('0x33')]);_0x4ff6dc['query']=_[_0xc1e6('0x38')](_0x57a538[_0xc1e6('0x3a')]);_0x4ff6dc['filters']=_[_0xc1e6('0x39')](_0x4ff6dc[_0xc1e6('0x37')],_0x4ff6dc[_0xc1e6('0x3a')]);_0x5ab98f[_0xc1e6('0x3c')]=_['intersection'](_0x4ff6dc[_0xc1e6('0x37')],qs[_0xc1e6('0x3b')](_0x57a538[_0xc1e6('0x3a')]['fields']));_0x5ab98f[_0xc1e6('0x3c')]=_0x5ab98f[_0xc1e6('0x3c')]['length']?_0x5ab98f[_0xc1e6('0x3c')]:_0x4ff6dc[_0xc1e6('0x37')];if(_0x57a538[_0xc1e6('0x3a')][_0xc1e6('0x47')]){_0x5ab98f[_0xc1e6('0x48')]=[{'all':!![]}];}_0x5ab98f=_[_0xc1e6('0x44')]({},_0x5ab98f,_0x57a538[_0xc1e6('0x46')]);return db[_0xc1e6('0x32')][_0xc1e6('0x4e')](_0x5ab98f)[_0xc1e6('0x27')](handleEntityNotFound(_0x260c1b,null))[_0xc1e6('0x27')](respondWithResult(_0x260c1b,null))[_0xc1e6('0x4b')](handleError(_0x260c1b,null));};exports[_0xc1e6('0x4f')]=function(_0x318a4e,_0x59e2bd){return db[_0xc1e6('0x32')][_0xc1e6('0x4f')](_0x318a4e[_0xc1e6('0x50')],{})[_0xc1e6('0x27')](function(_0x58cedc){var _0x734d2c=_0x318a4e[_0xc1e6('0x51')]['get']({'plain':!![]});if(!_0x734d2c)throw new Error(_0xc1e6('0x52'));if(_0x734d2c[_0xc1e6('0x53')]===_0xc1e6('0x51')){var _0x37f496=_0x58cedc[_0xc1e6('0x29')]({'plain':!![]});var _0xbe99a0=_0xc1e6('0x2a');return db['UserProfileSection'][_0xc1e6('0x4e')]({'where':{'name':_0xbe99a0,'userProfileId':_0x734d2c[_0xc1e6('0x54')]},'raw':!![]})[_0xc1e6('0x27')](function(_0x59fadd){if(_0x59fadd&&_0x59fadd['autoAssociation']===0x0){return db[_0xc1e6('0x2b')][_0xc1e6('0x4f')]({'name':_0x37f496[_0xc1e6('0x2e')],'resourceId':_0x37f496['id'],'type':_0x59fadd[_0xc1e6('0x2e')],'sectionId':_0x59fadd['id']},{})['then'](function(){return _0x58cedc;});}else{return _0x58cedc;}})[_0xc1e6('0x4b')](function(_0x490b84){logger['error'](_0xc1e6('0x55'),_0x490b84);throw _0x490b84;});}return _0x58cedc;})['then'](respondWithResult(_0x59e2bd,0xc9))['catch'](handleError(_0x59e2bd,null));};exports['update']=function(_0x2383f0,_0x4ddfe9){if(_0x2383f0['body']['id']){delete _0x2383f0[_0xc1e6('0x50')]['id'];}return db[_0xc1e6('0x32')][_0xc1e6('0x4e')]({'where':{'id':_0x2383f0[_0xc1e6('0x4d')]['id']}})[_0xc1e6('0x27')](handleEntityNotFound(_0x4ddfe9,null))[_0xc1e6('0x27')](saveUpdates(_0x2383f0[_0xc1e6('0x50')],null))[_0xc1e6('0x27')](respondWithResult(_0x4ddfe9,null))[_0xc1e6('0x4b')](handleError(_0x4ddfe9,null));};exports[_0xc1e6('0x28')]=function(_0x51507a,_0x56407f){return db[_0xc1e6('0x32')][_0xc1e6('0x4e')]({'where':{'id':_0x51507a[_0xc1e6('0x4d')]['id']}})[_0xc1e6('0x27')](handleEntityNotFound(_0x56407f,null))[_0xc1e6('0x27')](removeEntity(_0x56407f,null))[_0xc1e6('0x4b')](handleError(_0x56407f,null));};exports[_0xc1e6('0x56')]=function(_0x5d8418,_0x10eee2,_0x267375){return db[_0xc1e6('0x32')][_0xc1e6('0x4e')]({'where':{'id':_0x5d8418[_0xc1e6('0x4d')]['id']},'attributes':[_0xc1e6('0x2e'),_0xc1e6('0x57'),'savename',_0xc1e6('0x58')],'raw':!![]})[_0xc1e6('0x27')](handleEntityNotFound(_0x10eee2,null))['then'](function(_0x2e6566){if(_0x2e6566){if(!fs[_0xc1e6('0x59')](path[_0xc1e6('0x5a')](config[_0xc1e6('0x5b')],_0xc1e6('0x5c'),_0x2e6566[_0xc1e6('0x5d')]))){throw new db[(_0xc1e6('0x5e'))][(_0xc1e6('0x5f'))](_0xc1e6('0x60'));}if(_0x5d8418['query'][_0xc1e6('0x61')]){return _0x10eee2[_0xc1e6('0x1c')](0xc8);}return _0x10eee2[_0xc1e6('0x56')](path['join'](config['root'],_0xc1e6('0x5c'),_0x2e6566[_0xc1e6('0x5d')]),util[_0xc1e6('0x62')](_0xc1e6('0x63'),_0x2e6566[_0xc1e6('0x57')]||_0x2e6566[_0xc1e6('0x2e')],_0x2e6566[_0xc1e6('0x58')][_0xc1e6('0x64')]()));}})['catch'](handleError(_0x10eee2,null));};
\ No newline at end of file
+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
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 8d7548e..d81ed2c 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 _0xf34b=['moment','bluebird','request-promise','../../config/environment','exports','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','api'];(function(_0x583a1f,_0x4fb9da){var _0x45f430=function(_0xc90da){while(--_0xc90da){_0x583a1f['push'](_0x583a1f['shift']());}};_0x45f430(++_0x4fb9da);}(_0xf34b,0x13d));var _0xbf34=function(_0x33d129,_0x3bc274){_0x33d129=_0x33d129-0x0;var _0x54093f=_0xf34b[_0x33d129];return _0x54093f;};'use strict';var _=require('lodash');var util=require(_0xbf34('0x0'));var logger=require(_0xbf34('0x1'))(_0xbf34('0x2'));var moment=require(_0xbf34('0x3'));var BPromise=require(_0xbf34('0x4'));var rp=require(_0xbf34('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf34('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0xbf34('0x7')]=function(_0x825092,_0x7a570b){return _0x825092['define'](_0xbf34('0x8'),attributes,{'tableName':_0xbf34('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index a6e2891..f04976f 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 _0xb230=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb230,0x150));var _0x0b23=function(_0xe74d9b,_0x17a86c){_0xe74d9b=_0xe74d9b-0x0;var _0x57c1cc=_0xb230[_0xe74d9b];return _0x57c1cc;};'use strict';var _=require(_0x0b23('0x0'));var util=require(_0x0b23('0x1'));var moment=require(_0x0b23('0x2'));var BPromise=require(_0x0b23('0x3'));var rs=require(_0x0b23('0x4'));var fs=require('fs');var Redis=require(_0x0b23('0x5'));var db=require(_0x0b23('0x6'))['db'];var utils=require(_0x0b23('0x7'));var logger=require(_0x0b23('0x8'))(_0x0b23('0x9'));var config=require('../../config/environment');var jayson=require(_0x0b23('0xa'));var client=jayson[_0x0b23('0xb')][_0x0b23('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x135dd7,_0x2fd92d,_0x2ad939){return new BPromise(function(_0x3a7f46,_0x53e288){return client[_0x0b23('0xd')](_0x135dd7,_0x2ad939)[_0x0b23('0xe')](function(_0x5f3719){logger[_0x0b23('0xf')](_0x0b23('0x10'),_0x2fd92d,_0x0b23('0x11'));logger[_0x0b23('0x12')](_0x0b23('0x13'),_0x2fd92d,'request\x20sent',JSON[_0x0b23('0x14')](_0x5f3719));if(_0x5f3719[_0x0b23('0x15')]){if(_0x5f3719[_0x0b23('0x15')][_0x0b23('0x16')]===0x1f4){logger[_0x0b23('0x15')](_0x0b23('0x10'),_0x2fd92d,_0x5f3719[_0x0b23('0x15')][_0x0b23('0x17')]);return _0x53e288(_0x5f3719[_0x0b23('0x15')][_0x0b23('0x17')]);}logger[_0x0b23('0x15')](_0x0b23('0x10'),_0x2fd92d,_0x5f3719[_0x0b23('0x15')][_0x0b23('0x17')]);return _0x3a7f46(_0x5f3719[_0x0b23('0x15')][_0x0b23('0x17')]);}else{logger['info'](_0x0b23('0x10'),_0x2fd92d,_0x0b23('0x11'));_0x3a7f46(_0x5f3719[_0x0b23('0x18')][_0x0b23('0x17')]);}})['catch'](function(_0x37dd69){logger['error'](_0x0b23('0x10'),_0x2fd92d,_0x37dd69);_0x53e288(_0x37dd69);});});}
\ No newline at end of file
+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
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 52aeff9..8c24e1d 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 _0x0715=['Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id/download','download','post','create','/:id','update','destroy','util','connect-timeout','express'];(function(_0xc74a5e,_0x3170aa){var _0x4bc55b=function(_0xecab7b){while(--_0xecab7b){_0xc74a5e['push'](_0xc74a5e['shift']());}};_0x4bc55b(++_0x3170aa);}(_0x0715,0xa7));var _0x5071=function(_0x417af8,_0x368246){_0x417af8=_0x417af8-0x0;var _0x3f8bf8=_0x0715[_0x417af8];return _0x3f8bf8;};'use strict';var multer=require('multer');var util=require(_0x5071('0x0'));var path=require('path');var timeout=require(_0x5071('0x1'));var express=require(_0x5071('0x2'));var router=express[_0x5071('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5071('0x4'));var interaction=require(_0x5071('0x5'));var config=require('../../config/environment');var controller=require(_0x5071('0x6'));router[_0x5071('0x7')]('/',auth[_0x5071('0x8')](),controller[_0x5071('0x9')]);router['get']('/:id',auth[_0x5071('0x8')](),controller['show']);router[_0x5071('0x7')](_0x5071('0xa'),auth[_0x5071('0x8')](),controller[_0x5071('0xb')]);router[_0x5071('0xc')]('/',auth[_0x5071('0x8')](),controller[_0x5071('0xd')]);router['put'](_0x5071('0xe'),auth['isAuthenticated'](),controller[_0x5071('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5071('0x10')]);module['exports']=router;
\ No newline at end of file
+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
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c8dc4df..47c897d 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 _0x753d=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0xf83302,_0x17aa7a){var _0x5abd74=function(_0x2b8f43){while(--_0x2b8f43){_0xf83302['push'](_0xf83302['shift']());}};_0x5abd74(++_0x17aa7a);}(_0x753d,0x1e4));var _0xd753=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x753d[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xd753('0x0'));module[_0xd753('0x1')]={'field':{'type':Sequelize[_0xd753('0x2')]},'alias':{'type':Sequelize[_0xd753('0x3')]},'function':{'type':Sequelize[_0xd753('0x3')]},'format':{'type':Sequelize[_0xd753('0x3')]},'groupBy':{'type':Sequelize[_0xd753('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd753('0x3')]},'custom':{'type':Sequelize[_0xd753('0x4')],'defaultValue':![]}};
\ No newline at end of file
+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
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 66319c2..e12c789 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 _0x888b=['merge','where','type','VIRTUAL','includeAll','include','findAll','rows','params','options','find','catch','create','body','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','bulkCreate','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter'];(function(_0x237bed,_0x2c9315){var _0x325fbf=function(_0x3e20f3){while(--_0x3e20f3){_0x237bed['push'](_0x237bed['shift']());}};_0x325fbf(++_0x2c9315);}(_0x888b,0x112));var _0xb888=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x888b[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xb888('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb888('0x1'));var jsonpatch=require(_0xb888('0x2'));var rp=require('request-promise');var moment=require(_0xb888('0x3'));var BPromise=require(_0xb888('0x4'));var Mustache=require(_0xb888('0x5'));var util=require(_0xb888('0x6'));var path=require('path');var sox=require(_0xb888('0x7'));var csv=require(_0xb888('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb888('0x9'));var squel=require(_0xb888('0xa'));var crypto=require('crypto');var jsforce=require(_0xb888('0xb'));var deskjs=require(_0xb888('0xc'));var toCsv=require(_0xb888('0x8'));var querystring=require('querystring');var Papa=require(_0xb888('0xd'));var Redis=require(_0xb888('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb888('0xf'));var as=require(_0xb888('0x10'));var hardwareService=require(_0xb888('0x11'));var logger=require(_0xb888('0x12'))(_0xb888('0x13'));var utils=require(_0xb888('0x14'));var config=require(_0xb888('0x15'));var licenseUtil=require(_0xb888('0x16'));var db=require(_0xb888('0x17'))['db'];function respondWithStatusCode(_0x19c938,_0x593ce9){_0x593ce9=_0x593ce9||0xcc;return function(_0x2514f2){if(_0x2514f2){return _0x19c938[_0xb888('0x18')](_0x593ce9);}return _0x19c938[_0xb888('0x19')](_0x593ce9)[_0xb888('0x1a')]();};}function respondWithResult(_0x87c46f,_0x2b0d7a){_0x2b0d7a=_0x2b0d7a||0xc8;return function(_0x1d4036){if(_0x1d4036){return _0x87c46f['status'](_0x2b0d7a)[_0xb888('0x1b')](_0x1d4036);}};}function respondWithFilteredResult(_0x52c8d4,_0x48b7a5){return function(_0x591325){if(_0x591325){var _0xe4741c=typeof _0x48b7a5['offset']==='undefined'&&typeof _0x48b7a5[_0xb888('0x1c')]===_0xb888('0x1d');var _0x167ddc=_0x591325[_0xb888('0x1e')];var _0x33bc02=_0xe4741c?0x0:_0x48b7a5['offset'];var _0x4b0882=_0xe4741c?_0x591325[_0xb888('0x1e')]:_0x48b7a5[_0xb888('0x1f')]+_0x48b7a5[_0xb888('0x1c')];var _0x36e616;if(_0x4b0882>=_0x167ddc){_0x4b0882=_0x167ddc;_0x36e616=0xc8;}else{_0x36e616=0xce;}_0x52c8d4[_0xb888('0x19')](_0x36e616);return _0x52c8d4[_0xb888('0x20')](_0xb888('0x21'),_0x33bc02+'-'+_0x4b0882+'/'+_0x167ddc)[_0xb888('0x1b')](_0x591325);}return null;};}function patchUpdates(_0x224ec9){return function(_0x51d263){try{jsonpatch[_0xb888('0x22')](_0x51d263,_0x224ec9,!![]);}catch(_0x52511d){return BPromise[_0xb888('0x23')](_0x52511d);}return _0x51d263[_0xb888('0x24')]();};}function saveUpdates(_0x308829,_0x1b10a1){return function(_0x542512){if(_0x542512){return _0x542512[_0xb888('0x25')](_0x308829)[_0xb888('0x26')](function(_0x4a1ddd){return _0x4a1ddd;});}return null;};}function removeEntity(_0x263e35,_0x19f24f){return function(_0xae41bf){if(_0xae41bf){return _0xae41bf['destroy']()[_0xb888('0x26')](function(){_0x263e35[_0xb888('0x19')](0xcc)[_0xb888('0x1a')]();});}};}function handleEntityNotFound(_0x595b5e,_0x51b591){return function(_0x53ff37){if(!_0x53ff37){_0x595b5e[_0xb888('0x18')](0x194);}return _0x53ff37;};}function handleError(_0x93e96c,_0x3004e3){_0x3004e3=_0x3004e3||0x1f4;return function(_0x3d3f13){logger[_0xb888('0x27')](_0x3d3f13[_0xb888('0x28')]);if(_0x3d3f13[_0xb888('0x29')]){delete _0x3d3f13['name'];}_0x93e96c[_0xb888('0x19')](_0x3004e3)[_0xb888('0x2a')](_0x3d3f13);};}exports[_0xb888('0x2b')]=function(_0x29c958,_0x11e195){var _0x18e2fd={},_0x3d3415={},_0x5375f5={'count':0x0,'rows':[]};var _0x595bd3=_[_0xb888('0x2c')](db[_0xb888('0x2d')][_0xb888('0x2e')],function(_0x4bc3f0){return{'name':_0x4bc3f0[_0xb888('0x2f')],'type':_0x4bc3f0['type']['key']};});_0x3d3415[_0xb888('0x30')]=_[_0xb888('0x2c')](_0x595bd3,_0xb888('0x29'));_0x3d3415[_0xb888('0x31')]=_[_0xb888('0x32')](_0x29c958['query']);_0x3d3415[_0xb888('0x33')]=_['intersection'](_0x3d3415[_0xb888('0x30')],_0x3d3415['query']);_0x18e2fd[_0xb888('0x34')]=_[_0xb888('0x35')](_0x3d3415[_0xb888('0x30')],qs[_0xb888('0x36')](_0x29c958[_0xb888('0x31')][_0xb888('0x36')]));_0x18e2fd[_0xb888('0x34')]=_0x18e2fd[_0xb888('0x34')][_0xb888('0x37')]?_0x18e2fd[_0xb888('0x34')]:_0x3d3415[_0xb888('0x30')];if(!_0x29c958[_0xb888('0x31')][_0xb888('0x38')](_0xb888('0x39'))){_0x18e2fd[_0xb888('0x1c')]=qs[_0xb888('0x1c')](_0x29c958[_0xb888('0x31')][_0xb888('0x1c')]);_0x18e2fd[_0xb888('0x1f')]=qs[_0xb888('0x1f')](_0x29c958['query'][_0xb888('0x1f')]);}_0x18e2fd[_0xb888('0x3a')]=qs[_0xb888('0x3b')](_0x29c958['query']['sort']);_0x18e2fd['where']=qs[_0xb888('0x33')](_[_0xb888('0x3c')](_0x29c958['query'],_0x3d3415[_0xb888('0x33')]),_0x595bd3);if(_0x29c958[_0xb888('0x31')][_0xb888('0x3d')]){_0x18e2fd['where']=_[_0xb888('0x3e')](_0x18e2fd[_0xb888('0x3f')],{'$or':_['map'](_0x595bd3,function(_0x147da1){if(_0x147da1[_0xb888('0x40')]!==_0xb888('0x41')){var _0x262d50={};_0x262d50[_0x147da1[_0xb888('0x29')]]={'$like':'%'+_0x29c958[_0xb888('0x31')][_0xb888('0x3d')]+'%'};return _0x262d50;}})});}_0x18e2fd=_[_0xb888('0x3e')]({},_0x18e2fd,_0x29c958['options']);var _0x434ced={'where':_0x18e2fd[_0xb888('0x3f')]};return db['AnalyticFieldReport'][_0xb888('0x1e')](_0x434ced)[_0xb888('0x26')](function(_0x2aec97){_0x5375f5[_0xb888('0x1e')]=_0x2aec97;if(_0x29c958[_0xb888('0x31')][_0xb888('0x42')]){_0x18e2fd[_0xb888('0x43')]=[{'all':!![]}];}return db[_0xb888('0x2d')][_0xb888('0x44')](_0x18e2fd);})[_0xb888('0x26')](function(_0x2c83dc){_0x5375f5[_0xb888('0x45')]=_0x2c83dc;return _0x5375f5;})['then'](respondWithFilteredResult(_0x11e195,_0x18e2fd))['catch'](handleError(_0x11e195,null));};exports['show']=function(_0x3dab72,_0x48708b){var _0x1c908={'raw':![],'where':{'id':_0x3dab72[_0xb888('0x46')]['id']}},_0x6b31f1={};_0x6b31f1[_0xb888('0x30')]=_[_0xb888('0x32')](db[_0xb888('0x2d')]['rawAttributes']);_0x6b31f1[_0xb888('0x31')]=_['keys'](_0x3dab72['query']);_0x6b31f1[_0xb888('0x33')]=_[_0xb888('0x35')](_0x6b31f1[_0xb888('0x30')],_0x6b31f1[_0xb888('0x31')]);_0x1c908[_0xb888('0x34')]=_[_0xb888('0x35')](_0x6b31f1[_0xb888('0x30')],qs[_0xb888('0x36')](_0x3dab72['query']['fields']));_0x1c908[_0xb888('0x34')]=_0x1c908[_0xb888('0x34')][_0xb888('0x37')]?_0x1c908[_0xb888('0x34')]:_0x6b31f1[_0xb888('0x30')];if(_0x3dab72[_0xb888('0x31')][_0xb888('0x42')]){_0x1c908['include']=[{'all':!![]}];}_0x1c908=_[_0xb888('0x3e')]({},_0x1c908,_0x3dab72[_0xb888('0x47')]);return db[_0xb888('0x2d')][_0xb888('0x48')](_0x1c908)[_0xb888('0x26')](handleEntityNotFound(_0x48708b,null))[_0xb888('0x26')](respondWithResult(_0x48708b,null))[_0xb888('0x49')](handleError(_0x48708b,null));};exports[_0xb888('0x4a')]=function(_0x627f66,_0x35e037){return db[_0xb888('0x2d')][_0xb888('0x4a')](_0x627f66[_0xb888('0x4b')],{})[_0xb888('0x26')](respondWithResult(_0x35e037,0xc9))['catch'](handleError(_0x35e037,null));};exports['bulkCreate']=function(_0x5d374d,_0x487eef){return db['AnalyticFieldReport']['bulkCreate'](_0x5d374d[_0xb888('0x4b')],{'raw':![],'individualHooks':!![]})[_0xb888('0x26')](respondWithResult(_0x487eef,0xc9))[_0xb888('0x49')](handleError(_0x487eef,null));};exports[_0xb888('0x25')]=function(_0x3481f2,_0x12e169){if(_0x3481f2[_0xb888('0x4b')]['id']){delete _0x3481f2[_0xb888('0x4b')]['id'];}return db[_0xb888('0x2d')][_0xb888('0x48')]({'where':{'id':_0x3481f2[_0xb888('0x46')]['id']}})[_0xb888('0x26')](handleEntityNotFound(_0x12e169,null))[_0xb888('0x26')](saveUpdates(_0x3481f2['body'],null))['then'](respondWithResult(_0x12e169,null))['catch'](handleError(_0x12e169,null));};exports[_0xb888('0x4c')]=function(_0x550ebf,_0x5b0231){return db[_0xb888('0x2d')][_0xb888('0x48')]({'where':{'id':_0x550ebf[_0xb888('0x46')]['id']}})[_0xb888('0x26')](handleEntityNotFound(_0x5b0231,null))[_0xb888('0x26')](removeEntity(_0x5b0231,null))['catch'](handleError(_0x5b0231,null));};exports[_0xb888('0x4d')]=function(_0x5d768b,_0x6bb7a3){return db[_0xb888('0x2d')][_0xb888('0x4c')]({'where':{'id':_0x5d768b[_0xb888('0x31')][_0xb888('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0xb888('0x26')](respondWithResult(_0x6bb7a3,0xcc))[_0xb888('0x49')](handleError(_0x6bb7a3,null));};exports[_0xb888('0x4f')]=function(_0x2d88f1,_0x3c540c,_0x255698){return db[_0xb888('0x50')]['findOne']({'where':{'id':_0x2d88f1[_0xb888('0x46')]['id']}})[_0xb888('0x26')](handleEntityNotFound(_0x3c540c,null))[_0xb888('0x26')](function(_0x34f47b){if(_0x34f47b){return db['sequelize'][_0xb888('0x51')](function(_0x6533a){return db[_0xb888('0x2d')][_0xb888('0x4c')]({'where':{'CustomReportId':_0x2d88f1[_0xb888('0x46')]['id']},'transaction':_0x6533a})[_0xb888('0x26')](function(_0x576bed){var _0x1ec9e4=_[_0xb888('0x2c')](_0x2d88f1['body'],function(_0x39c884){delete _0x39c884['id'];_0x39c884[_0xb888('0x52')]=_0x2d88f1['params']['id'];return _0x39c884;});return db['AnalyticFieldReport'][_0xb888('0x53')](_0x1ec9e4,{'transaction':_0x6533a});});})[_0xb888('0x26')](function(){return db[_0xb888('0x2d')][_0xb888('0x44')]({'where':{'CustomReportId':_0x2d88f1[_0xb888('0x46')]['id']}});});}})['then'](respondWithResult(_0x3c540c,null))['catch'](handleError(_0x3c540c,null));};
\ No newline at end of file
+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
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 0bd7715..206e1c7 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 _0xd2b8=['moment','bluebird','rimraf','../../config/environment','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api'];(function(_0x3f25db,_0x1d3686){var _0x54f29d=function(_0x2963bb){while(--_0x2963bb){_0x3f25db['push'](_0x3f25db['shift']());}};_0x54f29d(++_0x1d3686);}(_0xd2b8,0xa1));var _0x8d2b=function(_0x102470,_0x31195a){_0x102470=_0x102470-0x0;var _0x21fb8b=_0xd2b8[_0x102470];return _0x21fb8b;};'use strict';var _=require(_0x8d2b('0x0'));var util=require(_0x8d2b('0x1'));var logger=require(_0x8d2b('0x2'))(_0x8d2b('0x3'));var moment=require(_0x8d2b('0x4'));var BPromise=require(_0x8d2b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8d2b('0x6'));var config=require(_0x8d2b('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x8d2b('0x8')]=function(_0xdfba21,_0x3f84d5){return _0xdfba21[_0x8d2b('0x9')](_0x8d2b('0xa'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index c441b91..629aaef 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 _0xd839=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x30b5f2,_0x2b8439){var _0x1509a4=function(_0x2ccee7){while(--_0x2ccee7){_0x30b5f2['push'](_0x30b5f2['shift']());}};_0x1509a4(++_0x2b8439);}(_0xd839,0x105));var _0x9d83=function(_0x2e0803,_0x20b12c){_0x2e0803=_0x2e0803-0x0;var _0x3d8c51=_0xd839[_0x2e0803];return _0x3d8c51;};'use strict';var _=require(_0x9d83('0x0'));var util=require(_0x9d83('0x1'));var moment=require(_0x9d83('0x2'));var BPromise=require(_0x9d83('0x3'));var rs=require(_0x9d83('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d83('0x5'))['db'];var utils=require(_0x9d83('0x6'));var logger=require(_0x9d83('0x7'))('rpc');var config=require(_0x9d83('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d83('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x430203,_0x53f9ac,_0x53d02a){return new BPromise(function(_0x353d2b,_0x4d7bf7){return client[_0x9d83('0xa')](_0x430203,_0x53d02a)[_0x9d83('0xb')](function(_0xf043d0){logger[_0x9d83('0xc')](_0x9d83('0xd'),_0x53f9ac,_0x9d83('0xe'));logger[_0x9d83('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x53f9ac,'request\x20sent',JSON[_0x9d83('0x10')](_0xf043d0));if(_0xf043d0[_0x9d83('0x11')]){if(_0xf043d0[_0x9d83('0x11')][_0x9d83('0x12')]===0x1f4){logger[_0x9d83('0x11')](_0x9d83('0xd'),_0x53f9ac,_0xf043d0['error'][_0x9d83('0x13')]);return _0x4d7bf7(_0xf043d0[_0x9d83('0x11')]['message']);}logger[_0x9d83('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x53f9ac,_0xf043d0[_0x9d83('0x11')][_0x9d83('0x13')]);return _0x353d2b(_0xf043d0['error']['message']);}else{logger[_0x9d83('0xc')](_0x9d83('0xd'),_0x53f9ac,_0x9d83('0xe'));_0x353d2b(_0xf043d0[_0x9d83('0x14')][_0x9d83('0x13')]);}})[_0x9d83('0x15')](function(_0x2ef226){logger[_0x9d83('0x11')](_0x9d83('0xd'),_0x53f9ac,_0x2ef226);_0x4d7bf7(_0x2ef226);});});}
\ No newline at end of file
+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
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index ca4791b..74c7d58 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(_0x457b1f,_0x13d5f6){var _0x2a782a=function(_0x28581a){while(--_0x28581a){_0x457b1f['push'](_0x457b1f['shift']());}};_0x2a782a(++_0x13d5f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_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
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 94820a2..ca251f5 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 _0xbf5c=['sequelize','exports','STRING','TEXT'];(function(_0x283b17,_0x53606e){var _0x459e07=function(_0x11884d){while(--_0x11884d){_0x283b17['push'](_0x283b17['shift']());}};_0x459e07(++_0x53606e);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x238a7a,_0x5807fe){_0x238a7a=_0x238a7a-0x0;var _0x5a1038=_0xbf5c[_0x238a7a];return _0x5a1038;};'use strict';var Sequelize=require(_0xcbf5('0x0'));module[_0xcbf5('0x1')]={'name':{'type':Sequelize[_0xcbf5('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xcbf5('0x2')]},'metric':{'type':Sequelize[_0xcbf5('0x3')]},'description':{'type':Sequelize[_0xcbf5('0x2')]}};
\ No newline at end of file
+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
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 7fc87f8..877cea9 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x4ab28f,_0x9619a1){var _0x452c9b=function(_0x570af4){while(--_0x570af4){_0x4ab28f['push'](_0x4ab28f['shift']());}};_0x452c9b(++_0x9619a1);}(_0xe14b,0x93));var _0xbe14=function(_0x36393d,_0x38d9e8){_0x36393d=_0x36393d-0x0;var _0x1fa70a=_0xe14b[_0x36393d];return _0x1fa70a;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
+var _0xe5b3=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_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
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 4527e40..8118890 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 _0x8375=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric'];(function(_0x1f4ef4,_0x525c7a){var _0x2757e9=function(_0x4f1004){while(--_0x4f1004){_0x1f4ef4['push'](_0x1f4ef4['shift']());}};_0x2757e9(++_0x525c7a);}(_0x8375,0xa8));var _0x5837=function(_0x3e65ea,_0x72471f){_0x3e65ea=_0x3e65ea-0x0;var _0x401ae8=_0x8375[_0x3e65ea];return _0x401ae8;};'use strict';var _=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var logger=require(_0x5837('0x2'))('api');var moment=require(_0x5837('0x3'));var BPromise=require(_0x5837('0x4'));var rp=require(_0x5837('0x5'));var fs=require('fs');var path=require(_0x5837('0x6'));var rimraf=require(_0x5837('0x7'));var config=require(_0x5837('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x5837('0x9')]=function(_0x19491e,_0x365da3){return _0x19491e[_0x5837('0xa')](_0x5837('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index ee24d87..81e6198 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 _0xa668=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','lodash','util','moment','bluebird'];(function(_0x3471e1,_0x297aeb){var _0x259194=function(_0x3d3e77){while(--_0x3d3e77){_0x3471e1['push'](_0x3471e1['shift']());}};_0x259194(++_0x297aeb);}(_0xa668,0xec));var _0x8a66=function(_0x32f9cf,_0x307d57){_0x32f9cf=_0x32f9cf-0x0;var _0x24ec66=_0xa668[_0x32f9cf];return _0x24ec66;};'use strict';var _=require(_0x8a66('0x0'));var util=require(_0x8a66('0x1'));var moment=require(_0x8a66('0x2'));var BPromise=require(_0x8a66('0x3'));var rs=require(_0x8a66('0x4'));var fs=require('fs');var Redis=require(_0x8a66('0x5'));var db=require(_0x8a66('0x6'))['db'];var utils=require(_0x8a66('0x7'));var logger=require(_0x8a66('0x8'))('rpc');var config=require(_0x8a66('0x9'));var jayson=require(_0x8a66('0xa'));var client=jayson[_0x8a66('0xb')][_0x8a66('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dd14b,_0x23b514,_0x51dacb){return new BPromise(function(_0x355ad5,_0x504237){return client['request'](_0x1dd14b,_0x51dacb)['then'](function(_0x31170a){logger['info'](_0x8a66('0xd'),_0x23b514,_0x8a66('0xe'));logger[_0x8a66('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x23b514,_0x8a66('0xe'),JSON['stringify'](_0x31170a));if(_0x31170a[_0x8a66('0x10')]){if(_0x31170a['error']['code']===0x1f4){logger[_0x8a66('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x23b514,_0x31170a[_0x8a66('0x10')][_0x8a66('0x11')]);return _0x504237(_0x31170a[_0x8a66('0x10')]['message']);}logger[_0x8a66('0x10')](_0x8a66('0xd'),_0x23b514,_0x31170a[_0x8a66('0x10')][_0x8a66('0x11')]);return _0x355ad5(_0x31170a[_0x8a66('0x10')][_0x8a66('0x11')]);}else{logger[_0x8a66('0x12')](_0x8a66('0xd'),_0x23b514,'request\x20sent');_0x355ad5(_0x31170a[_0x8a66('0x13')][_0x8a66('0x11')]);}})['catch'](function(_0x503f22){logger[_0x8a66('0x10')](_0x8a66('0xd'),_0x23b514,_0x503f22);_0x504237(_0x503f22);});});}
\ No newline at end of file
+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
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 20fc01a..53f3592 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 _0x7217=['Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x433850,_0x5e347c){var _0x4b8501=function(_0xb66cfe){while(--_0xb66cfe){_0x433850['push'](_0x433850['shift']());}};_0x4b8501(++_0x5e347c);}(_0x7217,0x19e));var _0x7721=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x7217[_0x5e3b04];return _0x1fc44d;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
+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
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index c43b52c..f04335d 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 _0x6e2b=['TEXT','sequelize','exports'];(function(_0x4e22e5,_0x5071c6){var _0x178be0=function(_0x461bc6){while(--_0x461bc6){_0x4e22e5['push'](_0x4e22e5['shift']());}};_0x178be0(++_0x5071c6);}(_0x6e2b,0x91));var _0xb6e2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e2b[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb6e2('0x0'));module[_0xb6e2('0x1')]={'tree':{'type':Sequelize[_0xb6e2('0x2')],'allowNull':![]}};
\ No newline at end of file
+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
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 5ff182a..fa8622f 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 _0x0c58=['includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','send','map','AnalyticTreeReport','fieldName','type','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0xad8169,_0x565e9e){var _0x8f61e7=function(_0x5ac70e){while(--_0x5ac70e){_0xad8169['push'](_0xad8169['shift']());}};_0x8f61e7(++_0x565e9e);}(_0x0c58,0x9e));var _0x80c5=function(_0x376246,_0x305977){_0x376246=_0x376246-0x0;var _0x483010=_0x0c58[_0x376246];return _0x483010;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80c5('0x0'));var zipdir=require(_0x80c5('0x1'));var jsonpatch=require(_0x80c5('0x2'));var rp=require(_0x80c5('0x3'));var moment=require('moment');var BPromise=require(_0x80c5('0x4'));var Mustache=require(_0x80c5('0x5'));var util=require(_0x80c5('0x6'));var path=require(_0x80c5('0x7'));var sox=require(_0x80c5('0x8'));var csv=require('to-csv');var ejs=require(_0x80c5('0x9'));var fs=require('fs');var fs_extra=require(_0x80c5('0xa'));var _=require(_0x80c5('0xb'));var squel=require(_0x80c5('0xc'));var crypto=require(_0x80c5('0xd'));var jsforce=require(_0x80c5('0xe'));var deskjs=require(_0x80c5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x80c5('0x10'));var Papa=require(_0x80c5('0x11'));var Redis=require(_0x80c5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80c5('0x13'));var logger=require('../../config/logger')(_0x80c5('0x14'));var utils=require('../../config/utils');var config=require(_0x80c5('0x15'));var licenseUtil=require(_0x80c5('0x16'));var db=require(_0x80c5('0x17'))['db'];function respondWithStatusCode(_0x3aea1b,_0x57b744){_0x57b744=_0x57b744||0xcc;return function(_0x303cda){if(_0x303cda){return _0x3aea1b['sendStatus'](_0x57b744);}return _0x3aea1b[_0x80c5('0x18')](_0x57b744)['end']();};}function respondWithResult(_0x2dd32f,_0x302488){_0x302488=_0x302488||0xc8;return function(_0x3b38eb){if(_0x3b38eb){return _0x2dd32f[_0x80c5('0x18')](_0x302488)['json'](_0x3b38eb);}};}function respondWithFilteredResult(_0x34642e,_0x185014){return function(_0x325727){if(_0x325727){var _0x2775c8=typeof _0x185014[_0x80c5('0x19')]===_0x80c5('0x1a')&&typeof _0x185014['limit']===_0x80c5('0x1a');var _0x516331=_0x325727[_0x80c5('0x1b')];var _0x27839c=_0x2775c8?0x0:_0x185014[_0x80c5('0x19')];var _0x45c1aa=_0x2775c8?_0x325727['count']:_0x185014[_0x80c5('0x19')]+_0x185014[_0x80c5('0x1c')];var _0x5962df;if(_0x45c1aa>=_0x516331){_0x45c1aa=_0x516331;_0x5962df=0xc8;}else{_0x5962df=0xce;}_0x34642e[_0x80c5('0x18')](_0x5962df);return _0x34642e[_0x80c5('0x1d')](_0x80c5('0x1e'),_0x27839c+'-'+_0x45c1aa+'/'+_0x516331)['json'](_0x325727);}return null;};}function patchUpdates(_0x29d606){return function(_0x5b0caf){try{jsonpatch[_0x80c5('0x1f')](_0x5b0caf,_0x29d606,!![]);}catch(_0x2bfadc){return BPromise[_0x80c5('0x20')](_0x2bfadc);}return _0x5b0caf[_0x80c5('0x21')]();};}function saveUpdates(_0xc9c594,_0x5d3dab){return function(_0x4a4b68){if(_0x4a4b68){return _0x4a4b68[_0x80c5('0x22')](_0xc9c594)['then'](function(_0x35822d){return _0x35822d;});}return null;};}function removeEntity(_0x5b749d,_0x49004c){return function(_0x243ef2){if(_0x243ef2){return _0x243ef2[_0x80c5('0x23')]()[_0x80c5('0x24')](function(){_0x5b749d['status'](0xcc)[_0x80c5('0x25')]();});}};}function handleEntityNotFound(_0x4ca865,_0x53cfaf){return function(_0x1d24f9){if(!_0x1d24f9){_0x4ca865['sendStatus'](0x194);}return _0x1d24f9;};}function handleError(_0x341689,_0x1ec328){_0x1ec328=_0x1ec328||0x1f4;return function(_0x56034b){logger[_0x80c5('0x26')](_0x56034b['stack']);if(_0x56034b['name']){delete _0x56034b['name'];}_0x341689[_0x80c5('0x18')](_0x1ec328)[_0x80c5('0x27')](_0x56034b);};}exports['index']=function(_0x5d004d,_0x2cbd81){var _0x1b7890={},_0x4a26ae={},_0x4a7628={'count':0x0,'rows':[]};var _0x39d408=_[_0x80c5('0x28')](db[_0x80c5('0x29')]['rawAttributes'],function(_0x532b94){return{'name':_0x532b94[_0x80c5('0x2a')],'type':_0x532b94[_0x80c5('0x2b')][_0x80c5('0x2c')]};});_0x4a26ae['model']=_['map'](_0x39d408,_0x80c5('0x2d'));_0x4a26ae[_0x80c5('0x2e')]=_[_0x80c5('0x2f')](_0x5d004d[_0x80c5('0x2e')]);_0x4a26ae[_0x80c5('0x30')]=_['intersection'](_0x4a26ae[_0x80c5('0x31')],_0x4a26ae[_0x80c5('0x2e')]);_0x1b7890[_0x80c5('0x32')]=_[_0x80c5('0x33')](_0x4a26ae[_0x80c5('0x31')],qs[_0x80c5('0x34')](_0x5d004d['query'][_0x80c5('0x34')]));_0x1b7890[_0x80c5('0x32')]=_0x1b7890[_0x80c5('0x32')][_0x80c5('0x35')]?_0x1b7890[_0x80c5('0x32')]:_0x4a26ae['model'];if(!_0x5d004d[_0x80c5('0x2e')][_0x80c5('0x36')](_0x80c5('0x37'))){_0x1b7890[_0x80c5('0x1c')]=qs[_0x80c5('0x1c')](_0x5d004d[_0x80c5('0x2e')][_0x80c5('0x1c')]);_0x1b7890[_0x80c5('0x19')]=qs[_0x80c5('0x19')](_0x5d004d['query']['offset']);}_0x1b7890[_0x80c5('0x38')]=qs[_0x80c5('0x39')](_0x5d004d['query'][_0x80c5('0x39')]);_0x1b7890[_0x80c5('0x3a')]=qs['filters'](_[_0x80c5('0x3b')](_0x5d004d[_0x80c5('0x2e')],_0x4a26ae[_0x80c5('0x30')]),_0x39d408);if(_0x5d004d[_0x80c5('0x2e')][_0x80c5('0x3c')]){_0x1b7890[_0x80c5('0x3a')]=_[_0x80c5('0x3d')](_0x1b7890[_0x80c5('0x3a')],{'$or':_[_0x80c5('0x28')](_0x39d408,function(_0x141e56){if(_0x141e56[_0x80c5('0x2b')]!==_0x80c5('0x3e')){var _0x519413={};_0x519413[_0x141e56[_0x80c5('0x2d')]]={'$like':'%'+_0x5d004d[_0x80c5('0x2e')][_0x80c5('0x3c')]+'%'};return _0x519413;}})});}_0x1b7890=_[_0x80c5('0x3d')]({},_0x1b7890,_0x5d004d[_0x80c5('0x3f')]);var _0xee96b5={'where':_0x1b7890[_0x80c5('0x3a')]};return db[_0x80c5('0x29')][_0x80c5('0x1b')](_0xee96b5)['then'](function(_0x85bdc0){_0x4a7628['count']=_0x85bdc0;if(_0x5d004d['query'][_0x80c5('0x40')]){_0x1b7890[_0x80c5('0x41')]=[{'all':!![]}];}return db[_0x80c5('0x29')][_0x80c5('0x42')](_0x1b7890);})[_0x80c5('0x24')](function(_0x47867f){_0x4a7628['rows']=_0x47867f;return _0x4a7628;})[_0x80c5('0x24')](respondWithFilteredResult(_0x2cbd81,_0x1b7890))[_0x80c5('0x43')](handleError(_0x2cbd81,null));};exports[_0x80c5('0x44')]=function(_0x26fc8d,_0x13f35b){var _0x1edaf0={'raw':!![],'where':{'id':_0x26fc8d[_0x80c5('0x45')]['id']}},_0x4a9ccd={};_0x4a9ccd['model']=_[_0x80c5('0x2f')](db[_0x80c5('0x29')][_0x80c5('0x46')]);_0x4a9ccd[_0x80c5('0x2e')]=_[_0x80c5('0x2f')](_0x26fc8d[_0x80c5('0x2e')]);_0x4a9ccd[_0x80c5('0x30')]=_[_0x80c5('0x33')](_0x4a9ccd[_0x80c5('0x31')],_0x4a9ccd['query']);_0x1edaf0[_0x80c5('0x32')]=_['intersection'](_0x4a9ccd['model'],qs[_0x80c5('0x34')](_0x26fc8d['query'][_0x80c5('0x34')]));_0x1edaf0[_0x80c5('0x32')]=_0x1edaf0[_0x80c5('0x32')]['length']?_0x1edaf0[_0x80c5('0x32')]:_0x4a9ccd[_0x80c5('0x31')];if(_0x26fc8d[_0x80c5('0x2e')]['includeAll']){_0x1edaf0[_0x80c5('0x41')]=[{'all':!![]}];}_0x1edaf0=_[_0x80c5('0x3d')]({},_0x1edaf0,_0x26fc8d['options']);return db[_0x80c5('0x29')][_0x80c5('0x47')](_0x1edaf0)['then'](handleEntityNotFound(_0x13f35b,null))[_0x80c5('0x24')](respondWithResult(_0x13f35b,null))[_0x80c5('0x43')](handleError(_0x13f35b,null));};exports[_0x80c5('0x48')]=function(_0x4ad946,_0x1c1ed6){return db[_0x80c5('0x29')]['create'](_0x4ad946[_0x80c5('0x49')],{})[_0x80c5('0x24')](respondWithResult(_0x1c1ed6,0xc9))[_0x80c5('0x43')](handleError(_0x1c1ed6,null));};exports[_0x80c5('0x22')]=function(_0xbb3ab6,_0x38560c){if(_0xbb3ab6[_0x80c5('0x49')]['id']){delete _0xbb3ab6[_0x80c5('0x49')]['id'];}return db[_0x80c5('0x29')][_0x80c5('0x47')]({'where':{'id':_0xbb3ab6['params']['id']}})[_0x80c5('0x24')](handleEntityNotFound(_0x38560c,null))[_0x80c5('0x24')](saveUpdates(_0xbb3ab6['body'],null))[_0x80c5('0x24')](respondWithResult(_0x38560c,null))[_0x80c5('0x43')](handleError(_0x38560c,null));};exports[_0x80c5('0x23')]=function(_0x25d4b0,_0x2f7b90){return db['AnalyticTreeReport'][_0x80c5('0x47')]({'where':{'id':_0x25d4b0[_0x80c5('0x45')]['id']}})[_0x80c5('0x24')](handleEntityNotFound(_0x2f7b90,null))[_0x80c5('0x24')](removeEntity(_0x2f7b90,null))[_0x80c5('0x43')](handleError(_0x2f7b90,null));};
\ No newline at end of file
+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
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 02a7844..9bdf34f 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 _0x7e8d=['./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','api','moment','request-promise','path','rimraf'];(function(_0x72063a,_0x1b012e){var _0x41f179=function(_0x135faf){while(--_0x135faf){_0x72063a['push'](_0x72063a['shift']());}};_0x41f179(++_0x1b012e);}(_0x7e8d,0x190));var _0xd7e8=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0x7e8d[_0x136619];return _0x38c4a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd7e8('0x0'));var moment=require(_0xd7e8('0x1'));var BPromise=require('bluebird');var rp=require(_0xd7e8('0x2'));var fs=require('fs');var path=require(_0xd7e8('0x3'));var rimraf=require(_0xd7e8('0x4'));var config=require('../../config/environment');var attributes=require(_0xd7e8('0x5'));module['exports']=function(_0x48ce40,_0x2361ea){return _0x48ce40[_0xd7e8('0x6')](_0xd7e8('0x7'),attributes,{'tableName':_0xd7e8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 6dd4c86..f2e6ec7 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x326054,_0x4cb01c){var _0x4b3213=function(_0x170961){while(--_0x170961){_0x326054['push'](_0x326054['shift']());}};_0x4b3213(++_0x4cb01c);}(_0x5f2f,0x73));var _0xf5f2=function(_0xead4e,_0x4b7d06){_0xead4e=_0xead4e-0x0;var _0xa7f386=_0x5f2f[_0xead4e];return _0xa7f386;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+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
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index f08880a..e237869 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 _0x7abc=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post'];(function(_0x55fa4b,_0x51bbfc){var _0x49b0cf=function(_0x4dff47){while(--_0x4dff47){_0x55fa4b['push'](_0x55fa4b['shift']());}};_0x49b0cf(++_0x51bbfc);}(_0x7abc,0x181));var _0xc7ab=function(_0x4c207b,_0x59f530){_0x4c207b=_0x4c207b-0x0;var _0x560c4f=_0x7abc[_0x4c207b];return _0x560c4f;};'use strict';var multer=require(_0xc7ab('0x0'));var util=require('util');var path=require(_0xc7ab('0x1'));var timeout=require(_0xc7ab('0x2'));var express=require(_0xc7ab('0x3'));var router=express[_0xc7ab('0x4')]();var fs_extra=require(_0xc7ab('0x5'));var auth=require(_0xc7ab('0x6'));var interaction=require(_0xc7ab('0x7'));var config=require(_0xc7ab('0x8'));var controller=require(_0xc7ab('0x9'));router[_0xc7ab('0xa')]('/',auth[_0xc7ab('0xb')](),controller[_0xc7ab('0xc')]);router[_0xc7ab('0xa')](_0xc7ab('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc7ab('0xe')]('/',auth[_0xc7ab('0xb')](),controller['create']);router[_0xc7ab('0xf')]('/:id',auth[_0xc7ab('0xb')](),controller[_0xc7ab('0x10')]);router[_0xc7ab('0x11')](_0xc7ab('0xd'),auth[_0xc7ab('0xb')](),controller[_0xc7ab('0x12')]);module[_0xc7ab('0x13')]=router;
\ No newline at end of file
+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
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index b906312..dc4c16a 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 _0x5a8c=['sequelize','exports','STRING'];(function(_0x3e5b1e,_0x10a1fc){var _0x265956=function(_0x2c3a03){while(--_0x2c3a03){_0x3e5b1e['push'](_0x3e5b1e['shift']());}};_0x265956(++_0x10a1fc);}(_0x5a8c,0x1da));var _0xc5a8=function(_0xe27948,_0x5bfa16){_0xe27948=_0xe27948-0x0;var _0x44e57b=_0x5a8c[_0xe27948];return _0x44e57b;};'use strict';var Sequelize=require(_0xc5a8('0x0'));module[_0xc5a8('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xc5a8('0x2')]},'type':{'type':Sequelize[_0xc5a8('0x2')]}};
\ No newline at end of file
+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
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index a3fdbb9..62485fc 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 _0x7446=['Content-Range','apply','save','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','find','clone','params','get','omit','createdAt','updatedAt','body','create','update','file','basename','filename','download','ChatOfflineMessageId','join','root','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x326e5e,_0x491c33){var _0x4d0fde=function(_0xcbcedc){while(--_0xcbcedc){_0x326e5e['push'](_0x326e5e['shift']());}};_0x4d0fde(++_0x491c33);}(_0x7446,0x17f));var _0x6744=function(_0x351c0e,_0x172dd0){_0x351c0e=_0x351c0e-0x0;var _0x3ac7f1=_0x7446[_0x351c0e];return _0x3ac7f1;};'use strict';var emlformat=require(_0x6744('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6744('0x1'));var jsonpatch=require(_0x6744('0x2'));var rp=require('request-promise');var moment=require(_0x6744('0x3'));var BPromise=require(_0x6744('0x4'));var Mustache=require(_0x6744('0x5'));var util=require('util');var path=require(_0x6744('0x6'));var sox=require(_0x6744('0x7'));var csv=require('to-csv');var ejs=require(_0x6744('0x8'));var fs=require('fs');var fs_extra=require(_0x6744('0x9'));var _=require('lodash');var squel=require(_0x6744('0xa'));var crypto=require(_0x6744('0xb'));var jsforce=require(_0x6744('0xc'));var deskjs=require(_0x6744('0xd'));var toCsv=require(_0x6744('0xe'));var querystring=require(_0x6744('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6744('0x10'));var qs=require(_0x6744('0x11'));var as=require(_0x6744('0x12'));var hardwareService=require(_0x6744('0x13'));var logger=require('../../config/logger')(_0x6744('0x14'));var utils=require(_0x6744('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6744('0x16'));var db=require(_0x6744('0x17'))['db'];function respondWithStatusCode(_0x32597c,_0x416c62){_0x416c62=_0x416c62||0xcc;return function(_0x139222){if(_0x139222){return _0x32597c[_0x6744('0x18')](_0x416c62);}return _0x32597c[_0x6744('0x19')](_0x416c62)[_0x6744('0x1a')]();};}function respondWithResult(_0x132ed8,_0x25b30e){_0x25b30e=_0x25b30e||0xc8;return function(_0x5e6c22){if(_0x5e6c22){return _0x132ed8[_0x6744('0x19')](_0x25b30e)[_0x6744('0x1b')](_0x5e6c22);}};}function respondWithFilteredResult(_0x38707b,_0x4d7b8d){return function(_0x17a039){if(_0x17a039){var _0x1617fa=typeof _0x4d7b8d[_0x6744('0x1c')]==='undefined'&&typeof _0x4d7b8d['limit']===_0x6744('0x1d');var _0x5f334d=_0x17a039[_0x6744('0x1e')];var _0x50d329=_0x1617fa?0x0:_0x4d7b8d[_0x6744('0x1c')];var _0x3e5e63=_0x1617fa?_0x17a039[_0x6744('0x1e')]:_0x4d7b8d[_0x6744('0x1c')]+_0x4d7b8d[_0x6744('0x1f')];var _0xcf2ce6;if(_0x3e5e63>=_0x5f334d){_0x3e5e63=_0x5f334d;_0xcf2ce6=0xc8;}else{_0xcf2ce6=0xce;}_0x38707b['status'](_0xcf2ce6);return _0x38707b['set'](_0x6744('0x20'),_0x50d329+'-'+_0x3e5e63+'/'+_0x5f334d)['json'](_0x17a039);}return null;};}function patchUpdates(_0x34b8ef){return function(_0x4bfe68){try{jsonpatch[_0x6744('0x21')](_0x4bfe68,_0x34b8ef,!![]);}catch(_0x26f083){return BPromise['reject'](_0x26f083);}return _0x4bfe68[_0x6744('0x22')]();};}function saveUpdates(_0xa8bc4a,_0x32bfb1){return function(_0x121bb6){if(_0x121bb6){return _0x121bb6['update'](_0xa8bc4a)[_0x6744('0x23')](function(_0xc0763e){return _0xc0763e;});}return null;};}function removeEntity(_0x338a79,_0x144d15){return function(_0x3680ca){if(_0x3680ca){return _0x3680ca[_0x6744('0x24')]()[_0x6744('0x23')](function(){_0x338a79[_0x6744('0x19')](0xcc)[_0x6744('0x1a')]();});}};}function handleEntityNotFound(_0x7a5983,_0x538cd4){return function(_0x747afc){if(!_0x747afc){_0x7a5983[_0x6744('0x18')](0x194);}return _0x747afc;};}function handleError(_0x26f352,_0x835999){_0x835999=_0x835999||0x1f4;return function(_0x7e46b3){logger[_0x6744('0x25')](_0x7e46b3[_0x6744('0x26')]);if(_0x7e46b3[_0x6744('0x27')]){delete _0x7e46b3[_0x6744('0x27')];}_0x26f352[_0x6744('0x19')](_0x835999)['send'](_0x7e46b3);};}exports[_0x6744('0x28')]=function(_0x19c7d8,_0x4c6bf1){var _0x522800={},_0xa23129={},_0xb783db={'count':0x0,'rows':[]};var _0x1cef4a=_[_0x6744('0x29')](db[_0x6744('0x2a')][_0x6744('0x2b')],function(_0x427394){return{'name':_0x427394['fieldName'],'type':_0x427394[_0x6744('0x2c')][_0x6744('0x2d')]};});_0xa23129['model']=_[_0x6744('0x29')](_0x1cef4a,_0x6744('0x27'));_0xa23129[_0x6744('0x2e')]=_[_0x6744('0x2f')](_0x19c7d8[_0x6744('0x2e')]);_0xa23129[_0x6744('0x30')]=_[_0x6744('0x31')](_0xa23129[_0x6744('0x32')],_0xa23129['query']);_0x522800['attributes']=_[_0x6744('0x31')](_0xa23129[_0x6744('0x32')],qs[_0x6744('0x33')](_0x19c7d8[_0x6744('0x2e')][_0x6744('0x33')]));_0x522800['attributes']=_0x522800[_0x6744('0x34')][_0x6744('0x35')]?_0x522800[_0x6744('0x34')]:_0xa23129[_0x6744('0x32')];if(!_0x19c7d8[_0x6744('0x2e')]['hasOwnProperty'](_0x6744('0x36'))){_0x522800[_0x6744('0x1f')]=qs[_0x6744('0x1f')](_0x19c7d8[_0x6744('0x2e')][_0x6744('0x1f')]);_0x522800[_0x6744('0x1c')]=qs['offset'](_0x19c7d8[_0x6744('0x2e')]['offset']);}_0x522800[_0x6744('0x37')]=qs[_0x6744('0x38')](_0x19c7d8['query'][_0x6744('0x38')]);_0x522800['where']=qs['filters'](_['pick'](_0x19c7d8['query'],_0xa23129[_0x6744('0x30')]),_0x1cef4a);if(_0x19c7d8[_0x6744('0x2e')][_0x6744('0x39')]){_0x522800[_0x6744('0x3a')]=_['merge'](_0x522800['where'],{'$or':_[_0x6744('0x29')](_0x1cef4a,function(_0x286bf2){if(_0x286bf2[_0x6744('0x2c')]!==_0x6744('0x3b')){var _0x5788b4={};_0x5788b4[_0x286bf2[_0x6744('0x27')]]={'$like':'%'+_0x19c7d8[_0x6744('0x2e')]['filter']+'%'};return _0x5788b4;}})});}_0x522800=_[_0x6744('0x3c')]({},_0x522800,_0x19c7d8[_0x6744('0x3d')]);var _0x46faf2={'where':_0x522800[_0x6744('0x3a')]};return db[_0x6744('0x2a')][_0x6744('0x1e')](_0x46faf2)[_0x6744('0x23')](function(_0x1aff13){_0xb783db[_0x6744('0x1e')]=_0x1aff13;if(_0x19c7d8[_0x6744('0x2e')][_0x6744('0x3e')]){_0x522800[_0x6744('0x3f')]=[{'all':!![]}];}return db[_0x6744('0x2a')][_0x6744('0x40')](_0x522800);})[_0x6744('0x23')](function(_0x1a434a){_0xb783db['rows']=_0x1a434a;return _0xb783db;})[_0x6744('0x23')](respondWithFilteredResult(_0x4c6bf1,_0x522800))[_0x6744('0x41')](handleError(_0x4c6bf1,null));};exports['show']=function(_0x2357a8,_0x288db7){var _0x1d3282={'raw':!![],'where':{'id':_0x2357a8['params']['id']}},_0x19c8e2={};_0x19c8e2['model']=_['keys'](db['Attachment'][_0x6744('0x2b')]);_0x19c8e2['query']=_[_0x6744('0x2f')](_0x2357a8[_0x6744('0x2e')]);_0x19c8e2[_0x6744('0x30')]=_[_0x6744('0x31')](_0x19c8e2['model'],_0x19c8e2[_0x6744('0x2e')]);_0x1d3282[_0x6744('0x34')]=_[_0x6744('0x31')](_0x19c8e2[_0x6744('0x32')],qs[_0x6744('0x33')](_0x2357a8[_0x6744('0x2e')][_0x6744('0x33')]));_0x1d3282['attributes']=_0x1d3282['attributes'][_0x6744('0x35')]?_0x1d3282['attributes']:_0x19c8e2['model'];if(_0x2357a8[_0x6744('0x2e')]['includeAll']){_0x1d3282[_0x6744('0x3f')]=[{'all':!![]}];}_0x1d3282=_['merge']({},_0x1d3282,_0x2357a8[_0x6744('0x3d')]);return db['Attachment'][_0x6744('0x42')](_0x1d3282)['then'](handleEntityNotFound(_0x288db7,null))[_0x6744('0x23')](respondWithResult(_0x288db7,null))[_0x6744('0x41')](handleError(_0x288db7,null));};exports[_0x6744('0x43')]=function(_0x5e1991,_0x2e9954){var _0x1c349f={'where':{'id':_0x5e1991[_0x6744('0x44')]['id']}},_0x30cd47={};_0x30cd47[_0x6744('0x32')]=_[_0x6744('0x2f')](db[_0x6744('0x2a')][_0x6744('0x2b')]);_0x1c349f[_0x6744('0x34')]=_[_0x6744('0x31')](_0x30cd47[_0x6744('0x32')],qs[_0x6744('0x33')](_0x5e1991[_0x6744('0x2e')][_0x6744('0x33')]));_0x1c349f[_0x6744('0x34')]=_0x1c349f['attributes'][_0x6744('0x35')]?_0x1c349f[_0x6744('0x34')]:_0x30cd47[_0x6744('0x32')];if(_0x5e1991['query']['includeAll']){_0x1c349f[_0x6744('0x3f')]=[{'all':!![]}];}_0x1c349f=_['merge']({},_0x1c349f,_0x5e1991[_0x6744('0x3d')]);return db[_0x6744('0x2a')][_0x6744('0x42')](_0x1c349f)[_0x6744('0x23')](handleEntityNotFound(_0x2e9954,null))[_0x6744('0x23')](function(_0x406dc6){if(_0x406dc6){var _0x2a0789=_0x406dc6[_0x6744('0x45')]({'plain':!![]});_0x2a0789=qs[_0x6744('0x46')](_0x2a0789,['id',_0x6744('0x47'),_0x6744('0x48')]);_0x5e1991[_0x6744('0x49')]=_['omit'](_0x5e1991[_0x6744('0x49')],['id',_0x6744('0x47'),_0x6744('0x48')]);return db[_0x6744('0x2a')][_0x6744('0x4a')](_[_0x6744('0x3c')](_0x2a0789,_0x5e1991[_0x6744('0x49')]),{'include':_0x5e1991['query'][_0x6744('0x3e')]?[{'all':!![]}]:undefined});}})[_0x6744('0x23')](respondWithResult(_0x2e9954,0xc9))['catch'](handleError(_0x2e9954,null));};exports[_0x6744('0x4b')]=function(_0x8e8a74,_0x40fb2e){if(_0x8e8a74[_0x6744('0x49')]['id']){delete _0x8e8a74[_0x6744('0x49')]['id'];}return db[_0x6744('0x2a')][_0x6744('0x42')]({'where':{'id':_0x8e8a74['params']['id']}})[_0x6744('0x23')](handleEntityNotFound(_0x40fb2e,null))[_0x6744('0x23')](saveUpdates(_0x8e8a74[_0x6744('0x49')],null))['then'](respondWithResult(_0x40fb2e,null))[_0x6744('0x41')](handleError(_0x40fb2e,null));};exports[_0x6744('0x24')]=function(_0x4354d5,_0x2df817){return db['Attachment'][_0x6744('0x42')]({'where':{'id':_0x4354d5[_0x6744('0x44')]['id']}})[_0x6744('0x23')](handleEntityNotFound(_0x2df817,null))[_0x6744('0x23')](removeEntity(_0x2df817,null))[_0x6744('0x41')](handleError(_0x2df817,null));};exports['create']=function(_0xe1c2e4,_0x452509,_0xddc70c){_0xe1c2e4[_0x6744('0x49')][_0x6744('0x27')]=_0xe1c2e4[_0x6744('0x4c')]['originalname'];_0xe1c2e4['body'][_0x6744('0x4d')]=_0xe1c2e4[_0x6744('0x4c')][_0x6744('0x4e')];_0xe1c2e4[_0x6744('0x49')][_0x6744('0x2c')]=_0xe1c2e4[_0x6744('0x4c')]['mimetype'];return db[_0x6744('0x2a')]['create'](_0xe1c2e4[_0x6744('0x49')])[_0x6744('0x23')](respondWithResult(_0x452509,0xc9))[_0x6744('0x41')](handleError(_0x452509,null));};exports[_0x6744('0x4f')]=function(_0x5f2124,_0x2af54b,_0x408cca){return db[_0x6744('0x2a')]['findOne']({'where':{'id':_0x5f2124[_0x6744('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2af54b,null))[_0x6744('0x23')](function(_0x31dfba){if(_0x31dfba){var _0x5331a6=_0x31dfba[_0x6744('0x50')]!==null;var _0x2df9ab=path[_0x6744('0x51')](config[_0x6744('0x52')],'server/files/attachments/');if(_0x5331a6){_0x2df9ab=path[_0x6744('0x51')](_0x2df9ab,'offline-chat/');}var _0x1f5f39=path['join'](_0x2df9ab,_0x31dfba['basename']);return _0x2af54b[_0x6744('0x4f')](_0x1f5f39);}})[_0x6744('0x41')](handleError(_0x2af54b,null));};
\ No newline at end of file
+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
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index e6fc8c7..7789b90 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 _0x6982=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','Attachment','attachments','util','../../config/logger'];(function(_0x33d97a,_0x2b0786){var _0x4580b7=function(_0xb0b9d4){while(--_0xb0b9d4){_0x33d97a['push'](_0x33d97a['shift']());}};_0x4580b7(++_0x2b0786);}(_0x6982,0x15d));var _0x2698=function(_0x5a8d19,_0x21a494){_0x5a8d19=_0x5a8d19-0x0;var _0x23c925=_0x6982[_0x5a8d19];return _0x23c925;};'use strict';var _=require('lodash');var util=require(_0x2698('0x0'));var logger=require(_0x2698('0x1'))(_0x2698('0x2'));var moment=require(_0x2698('0x3'));var BPromise=require(_0x2698('0x4'));var rp=require(_0x2698('0x5'));var fs=require('fs');var path=require(_0x2698('0x6'));var rimraf=require(_0x2698('0x7'));var config=require(_0x2698('0x8'));var attributes=require(_0x2698('0x9'));module[_0x2698('0xa')]=function(_0x52346a,_0x446e5b){return _0x52346a['define'](_0x2698('0xb'),attributes,{'tableName':_0x2698('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 3181132..2e19925 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 _0xb0d9=['Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateAttachment','Attachment','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','info'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x347528,_0x19e795){_0x347528=_0x347528-0x0;var _0x481de7=_0xb0d9[_0x347528];return _0x481de7;};'use strict';var _=require(_0x9b0d('0x0'));var util=require(_0x9b0d('0x1'));var moment=require(_0x9b0d('0x2'));var BPromise=require(_0x9b0d('0x3'));var rs=require(_0x9b0d('0x4'));var fs=require('fs');var Redis=require(_0x9b0d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b0d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9b0d('0x7'));var client=jayson[_0x9b0d('0x8')][_0x9b0d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x438e0a,_0x2c519d,_0x45c371){return new BPromise(function(_0x32ee67,_0x30cd11){return client[_0x9b0d('0xa')](_0x438e0a,_0x45c371)['then'](function(_0x479a06){logger[_0x9b0d('0xb')](_0x9b0d('0xc'),_0x2c519d,'request\x20sent');logger[_0x9b0d('0xd')](_0x9b0d('0xe'),_0x2c519d,'request\x20sent',JSON[_0x9b0d('0xf')](_0x479a06));if(_0x479a06[_0x9b0d('0x10')]){if(_0x479a06['error'][_0x9b0d('0x11')]===0x1f4){logger['error'](_0x9b0d('0xc'),_0x2c519d,_0x479a06[_0x9b0d('0x10')][_0x9b0d('0x12')]);return _0x30cd11(_0x479a06['error'][_0x9b0d('0x12')]);}logger['error'](_0x9b0d('0xc'),_0x2c519d,_0x479a06[_0x9b0d('0x10')]['message']);return _0x32ee67(_0x479a06[_0x9b0d('0x10')]['message']);}else{logger[_0x9b0d('0xb')](_0x9b0d('0xc'),_0x2c519d,_0x9b0d('0x13'));_0x32ee67(_0x479a06['result'][_0x9b0d('0x12')]);}})[_0x9b0d('0x14')](function(_0x49db91){logger['error']('Attachment,\x20%s,\x20%s',_0x2c519d,_0x49db91);_0x30cd11(_0x49db91);});});}exports[_0x9b0d('0x15')]=function(_0xd8bb89){var _0x41a5e2=this;return new Promise(function(_0x27ee1a,_0x54ccf1){return db[_0x9b0d('0x16')][_0x9b0d('0x17')](_0xd8bb89[_0x9b0d('0x18')],{'raw':_0xd8bb89[_0x9b0d('0x19')]?_0xd8bb89['options'][_0x9b0d('0x1a')]===undefined?!![]:![]:!![]})[_0x9b0d('0x1b')](function(_0xe5fb08){logger[_0x9b0d('0xb')](_0x9b0d('0x15'),_0xd8bb89);logger['debug'](_0x9b0d('0x15'),_0xd8bb89,JSON[_0x9b0d('0xf')](_0xe5fb08));_0x27ee1a(_0xe5fb08);})[_0x9b0d('0x14')](function(_0x14c01b){logger[_0x9b0d('0x10')](_0x9b0d('0x15'),_0x14c01b[_0x9b0d('0x12')],_0xd8bb89);_0x54ccf1(_0x41a5e2[_0x9b0d('0x10')](0x1f4,_0x14c01b[_0x9b0d('0x12')]));});});};
\ No newline at end of file
+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
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 199e745..27771ff 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_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
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index a78a39e..96d93a4 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 _0x53d0=['../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','profile','email','callback','/login','use','clientID','clientSecret','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','passport','passport-google-oauth20','moment','../../mysqldb'];(function(_0x130209,_0x2cc129){var _0x155fb7=function(_0x891a60){while(--_0x891a60){_0x130209['push'](_0x130209['shift']());}};_0x155fb7(++_0x2cc129);}(_0x53d0,0x8c));var _0x053d=function(_0x114c76,_0xc937df){_0x114c76=_0x114c76-0x0;var _0xb5babf=_0x53d0[_0x114c76];return _0xb5babf;};'use strict';var _=require('lodash');var passport=require(_0x053d('0x0'));var GoogleStrategy=require(_0x053d('0x1'))['Strategy'];var moment=require(_0x053d('0x2'));var db=require(_0x053d('0x3'))['db'];var config=require(_0x053d('0x4'));var signToken=require(_0x053d('0x5'))[_0x053d('0x6')];var utils=require(_0x053d('0x7'));exports[_0x053d('0x8')]=passport[_0x053d('0x9')](_0x053d('0xa'),{'failureRedirect':'/login','scope':[_0x053d('0xb'),_0x053d('0xc')],'session':![]});exports[_0x053d('0xd')]=passport['authenticate'](_0x053d('0xa'),{'failureRedirect':_0x053d('0xe'),'session':![]});passport[_0x053d('0xf')](new GoogleStrategy({'clientID':config['google']?config['google'][_0x053d('0x10')]:'id','clientSecret':config[_0x053d('0xa')]?config[_0x053d('0xa')][_0x053d('0x11')]:_0x053d('0x12'),'callbackURL':config[_0x053d('0xa')]?config[_0x053d('0xa')]['callbackURL']:''},function(_0x372a67,_0x1832bf,_0x44a7f9,_0x1768a3){var _0x2a4724,_0x21492e;return db[_0x053d('0x13')][_0x053d('0x14')]({'where':{'id':0x1},'attributes':[_0x053d('0x15'),_0x053d('0x16')],'raw':!![]})[_0x053d('0x17')](function(_0x37ef8b){_0x2a4724=_0x37ef8b;return db['User']['find']({'where':{'email':_[_0x053d('0x18')](_0x44a7f9[_0x053d('0x19')],'value'),'role':{'$or':[_0x053d('0x1a'),_0x053d('0x1b'),_0x053d('0x1c')]}}});})[_0x053d('0x17')](function(_0x22103b){_0x21492e=_0x22103b;if(_0x21492e){if(_0x21492e[_0x053d('0x1d')]){return _0x1768a3(_0x053d('0x1e'));}else if(_0x2a4724[_0x053d('0x16')]>0x0){if(_0x21492e[_0x053d('0x1f')]){if(moment(_0x21492e[_0x053d('0x20')])[_0x053d('0x21')](_0x2a4724['blockDuration'],_0x053d('0x22'))>moment()){return _0x1768a3(_0x053d('0x1e'));}else{return utils['clearBlockUser'](_0x21492e,0x0,![],null)[_0x053d('0x17')](function(){return utils[_0x053d('0x23')](_0x21492e);})[_0x053d('0x17')](function(){return _0x1768a3(null,_0x21492e);});}}else{return utils[_0x053d('0x23')](_0x21492e)['then'](function(){return _0x1768a3(null,_0x21492e);});}}else{return utils[_0x053d('0x23')](_0x21492e)[_0x053d('0x17')](function(){return _0x1768a3(null,_0x21492e);});}}return _0x1768a3(_0x053d('0x1e'));})['catch'](function(_0x2f2ff2){_0x1768a3(_0x2f2ff2);});}));
\ No newline at end of file
+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
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index fb92233..07970ab 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 _0xea52=['isMiddleware','setTokenCookie','exports','passport','Router','login','get','/callback','callback'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xea52,0x162));var _0x2ea5=function(_0x4007b1,_0x206901){_0x4007b1=_0x4007b1-0x0;var _0x108d6c=_0xea52[_0x4007b1];return _0x108d6c;};'use strict';var express=require('express');var passport=require(_0x2ea5('0x0'));var router=express[_0x2ea5('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller[_0x2ea5('0x2')]);router[_0x2ea5('0x3')](_0x2ea5('0x4'),controller[_0x2ea5('0x5')],authService[_0x2ea5('0x6')],userController['login'],authService[_0x2ea5('0x7')]);module[_0x2ea5('0x8')]=router;
\ No newline at end of file
+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
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 86ba300..31a90e8 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 _0x2697=['json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','password','previousPasswords','save','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','name','salt','disabled','blocked','blockedAt','admin','user','then','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','minutes','getLicense','find','email','MailServerOut','Smtp','service','host','port','secure','auth','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x122e3d,_0x37718b){var _0xbb3437=function(_0xf749e){while(--_0xf749e){_0x122e3d['push'](_0x122e3d['shift']());}};_0xbb3437(++_0x37718b);}(_0x2697,0x120));var _0x7269=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0x2697[_0x4df85c];return _0x4e2a61;};'use strict';var util=require('util');var passport=require(_0x7269('0x0'));var LocalStrategy=require(_0x7269('0x1'))[_0x7269('0x2')];var jayson=require(_0x7269('0x3'));var _=require(_0x7269('0x4'));var rs=require('randomstring');var moment=require(_0x7269('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x7269('0x6'));var utils=require(_0x7269('0x7'));var client=jayson[_0x7269('0x8')][_0x7269('0x9')]({'port':0x232b});function localAuthenticate(_0x438f7c,_0x1e47e3,_0x20ddbf,_0x2c968f){var _0x328097,_0x572969;return db[_0x7269('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x7269('0xb'),_0x7269('0xc')],'raw':!![]})['then'](function(_0x3c21f9){_0x328097=_0x3c21f9;return _0x438f7c['findOne']({'attributes':['id',_0x7269('0xd'),'password',_0x7269('0xe'),'role',_0x7269('0xf'),_0x7269('0x10'),_0x7269('0x11'),'loginAttempts'],'where':{'name':_0x1e47e3,'role':{'$or':[_0x7269('0x12'),_0x7269('0x13'),'agent']}}});})[_0x7269('0x14')](function(_0x2de29b){if(!_0x2de29b||_0x2de29b&&_0x2de29b[_0x7269('0xd')]!==_0x1e47e3){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x572969=_0x2de29b;return _0x572969;}})[_0x7269('0x14')](function(){_0x572969[_0x7269('0x15')](_0x20ddbf,function(_0x2d78a0,_0x2c28f8){var _0x26547f=_0x572969[_0x7269('0x16')]+0x1;if(_0x2d78a0){return _0x2c968f(_0x2d78a0);}else if(!_0x2c28f8){if(_0x572969[_0x7269('0xf')]){return _0x2c968f(null,![],{'message':_0x7269('0x17')});}else if(_0x328097['allowedLoginAttempts']>0x0){if(_0x572969[_0x7269('0x10')]){if(_0x328097[_0x7269('0xc')]>0x0){if(moment(_0x572969[_0x7269('0x11')])[_0x7269('0x18')](_0x328097['blockDuration'],'minutes')>moment()){return _0x2c968f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x7269('0x19')](_0x572969,_0x26547f,![],null)[_0x7269('0x14')](function(){return _0x2c968f(null,![],{'message':_0x7269('0x17')});});}}else{return _0x2c968f(null,![],{'message':_0x7269('0x17')});}}else{if(_0x26547f>=_0x328097[_0x7269('0xb')]){return utils[_0x7269('0x19')](_0x572969,0x0,!![],moment())[_0x7269('0x14')](function(){return _0x2c968f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x572969,_0x26547f,![],null)['then'](function(){return _0x2c968f(null,![],{'message':_0x7269('0x17')});});}}}else{return _0x2c968f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x572969[_0x7269('0xf')]){return _0x2c968f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x328097[_0x7269('0xb')]>0x0){if(_0x572969[_0x7269('0x10')]){if(_0x328097['blockDuration']>0x0){if(moment(_0x572969[_0x7269('0x11')])[_0x7269('0x18')](_0x328097['blockDuration'],_0x7269('0x1a'))>moment()){return _0x2c968f(null,![],{'message':_0x7269('0x17')});}else{return utils[_0x7269('0x19')](_0x572969,0x0,![],null)[_0x7269('0x14')](function(){return utils['getLicense'](_0x572969);})[_0x7269('0x14')](function(){return _0x2c968f(null,_0x572969);});}}else{return _0x2c968f(null,![],{'message':_0x7269('0x17')});}}else{return utils[_0x7269('0x19')](_0x572969,0x0,![],null)[_0x7269('0x14')](function(){return utils[_0x7269('0x1b')](_0x572969);})[_0x7269('0x14')](function(){return _0x2c968f(null,_0x572969);})['catch'](function(_0x198b59){return _0x2c968f(null,![],_0x198b59);});}}else{if(_0x572969[_0x7269('0x10')]){return _0x2c968f(null,![],{'message':_0x7269('0x17')});}else{return utils[_0x7269('0x1b')](_0x572969)[_0x7269('0x14')](function(){return _0x2c968f(null,_0x572969);});}}}});})['catch'](function(_0x33c43a){return _0x2c968f(null,![],_0x33c43a);});}function sendServiceMail(_0x470e5c){return db['MailAccount'][_0x7269('0x1c')]({'where':{'service':!![]},'attributes':['id','name',_0x7269('0x1d')],'include':[{'model':db[_0x7269('0x1e')],'as':_0x7269('0x1f')}]})[_0x7269('0x14')](function(_0x468d0b){if(!_0x468d0b){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x43e363={'tls':{'rejectUnauthorized':![]}};if(_0x468d0b[_0x7269('0x1f')][_0x7269('0x20')]){_0x43e363[_0x7269('0x20')]=_0x468d0b['Smtp'][_0x7269('0x20')];}else{_0x43e363[_0x7269('0x21')]=_0x468d0b['Smtp']['host'];_0x43e363[_0x7269('0x22')]=_0x468d0b[_0x7269('0x1f')][_0x7269('0x22')];_0x43e363[_0x7269('0x23')]=_0x468d0b[_0x7269('0x1f')][_0x7269('0x23')];}if(_0x468d0b['Smtp']['authentication']){_0x43e363[_0x7269('0x24')]={'user':_0x468d0b[_0x7269('0x1f')]['user'],'pass':_0x468d0b[_0x7269('0x1f')]['pass']};}var _0x1f244c={'account':_0x43e363,'message':_[_0x7269('0x25')]({'from':util[_0x7269('0x26')](_0x7269('0x27'),_0x468d0b[_0x7269('0xd')],_0x468d0b[_0x7269('0x1d')]||_0x468d0b[_0x7269('0x1f')]['user'])},_0x470e5c)};return client[_0x7269('0x28')](_0x7269('0x29'),_0x1f244c);})['then'](function(_0x747178){if(_0x747178[_0x7269('0x2a')]){throw new Error(util[_0x7269('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x747178[_0x7269('0x2a')][_0x7269('0x2b')]||JSON[_0x7269('0x2c')](_0x747178[_0x7269('0x2a')])));}return!![];});}function handleError(_0x487f25,_0x285274,_0xe5d1b9){return _0x487f25[_0x7269('0x2d')](_0x285274||0x1f4)[_0x7269('0x2e')]({'message':_0xe5d1b9?_0xe5d1b9[_0x7269('0x2b')]||_0xe5d1b9:''});}exports['login']=function(_0x1deb1a,_0x223faf,_0x301a10){passport['authenticate']('local',function(_0x399efe,_0x51a7ba,_0x2873fa){var _0x492a1e=_0x399efe||_0x2873fa;if(_0x492a1e){return handleError(_0x223faf,0x191,_0x492a1e);}if(!_0x51a7ba){return handleError(_0x223faf,0x194,{'message':_0x7269('0x2f')});}else{var _0x4d4a04={'payload':{'id':_0x51a7ba['id'],'role':_0x51a7ba['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4d4a04)[_0x7269('0x14')](function(_0x2265ac){_0x223faf[_0x7269('0x30')]({'id':_0x51a7ba['id'],'token':_0x2265ac,'statusCall':'','isAlreadyLogged':_0x51a7ba[_0x7269('0x31')]});});}})(_0x1deb1a,_0x223faf,_0x301a10);};exports[_0x7269('0x32')]=function(_0x470982,_0x1fd570,_0x1ffa92){if(!_0x470982[_0x7269('0x33')][_0x7269('0x1d')]){return handleError(_0x1fd570,0x1f4,{'message':_0x7269('0x34')});}var _0x4eb641=rs[_0x7269('0x35')]();_0x470982[_0x7269('0x33')][_0x7269('0x1d')]=_0x470982[_0x7269('0x33')][_0x7269('0x1d')][_0x7269('0x36')]()[_0x7269('0x37')]();var _0x2a67c3;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x7269('0xb'),_0x7269('0xc')],'raw':!![]})['then'](function(_0x54676d){_0x2a67c3=_0x54676d;return db['User'][_0x7269('0x1c')]({'where':{'email':_0x470982[_0x7269('0x33')]['email']}});})[_0x7269('0x14')](function(_0x1c4901){if(!_0x1c4901){throw new Error(_0x7269('0x38'));}if(_0x1c4901[_0x7269('0xf')]){throw new Error(_0x7269('0x39'));}if(_0x1c4901['blocked']){if(moment(_0x1c4901['blockedAt'])[_0x7269('0x18')](_0x2a67c3[_0x7269('0xc')],_0x7269('0x1a'))>moment()){throw new Error(_0x7269('0x3a'));}else{_0x1c4901[_0x7269('0x10')]=![];_0x1c4901['blockedAt']=null;}}_0x1c4901[_0x7269('0x3b')]=_0x4eb641;_0x1c4901[_0x7269('0x3c')]=Date['now']()+0x36ee80;return _0x1c4901['save']();})['then'](function(){return sendServiceMail({'to':_0x470982[_0x7269('0x33')][_0x7269('0x1d')],'subject':_0x7269('0x3d'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x7269('0x3e')+_0x7269('0x3f')+_0x470982[_0x7269('0x40')][_0x7269('0x21')]+'/reset/'+_0x4eb641+'\x0a\x0a'+_0x7269('0x41')});})[_0x7269('0x14')](function(){_0x1fd570[_0x7269('0x2d')](0xc8)[_0x7269('0x2e')]({'message':_0x7269('0x42')});})[_0x7269('0x43')](function(_0x80dba9){return handleError(_0x1fd570,0x1f4,_0x80dba9);});};exports[_0x7269('0x44')]=function(_0x5f34d3,_0x23d91b,_0x51de71){return db[_0x7269('0x45')][_0x7269('0x1c')]({'where':{'resetPasswordToken':_0x5f34d3[_0x7269('0x46')][_0x7269('0x47')],'resetPasswordExpires':{'$gt':Date[_0x7269('0x48')]()}}})['then'](function(_0x52b0f0){if(!_0x52b0f0){throw new Error(_0x7269('0x49'));}return db[_0x7269('0xa')]['findOne']({'attributes':['id',_0x7269('0x4a'),_0x7269('0x4b'),_0x7269('0x4c')]})['then'](function(_0x13c173){if(_0x13c173[_0x7269('0x4a')])authService[_0x7269('0x4d')](_0x5f34d3['body']['password']);if(!_0x13c173[_0x7269('0x4b')]||!_0x52b0f0['previousPasswords'])return _0x52b0f0;authService[_0x7269('0x4e')](_0x5f34d3['body'][_0x7269('0x4f')],_0x52b0f0[_0x7269('0x50')],_0x13c173[_0x7269('0x4c')]);return _0x52b0f0;})[_0x7269('0x14')](function(){_0x52b0f0['password']=_0x5f34d3[_0x7269('0x33')]['password'];_0x52b0f0[_0x7269('0x3b')]=null;_0x52b0f0[_0x7269('0x3c')]=null;return _0x52b0f0[_0x7269('0x51')]();});})[_0x7269('0x14')](function(){_0x23d91b[_0x7269('0x2d')](0xc8)[_0x7269('0x2e')]({'message':_0x7269('0x52')});})[_0x7269('0x43')](function(_0x1e5ef1){return handleError(_0x23d91b,0x1f4,_0x1e5ef1);});};passport[_0x7269('0x53')](new LocalStrategy({'usernameField':'name','passwordField':_0x7269('0x4f')},function(_0x101470,_0x1bfc00,_0x1e564c){return localAuthenticate(db[_0x7269('0x45')],_0x101470,_0x1bfc00,_0x1e564c);}));
\ No newline at end of file
+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
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 08e9b90..bb4d9cd 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 _0x655b=['login','/forgot','forgot','/reset/:token','reset','exports','Router','post'];(function(_0x4508d4,_0x25d42f){var _0x220dab=function(_0x1e03e7){while(--_0x1e03e7){_0x4508d4['push'](_0x4508d4['shift']());}};_0x220dab(++_0x25d42f);}(_0x655b,0xfe));var _0xb655=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x655b[_0x5f1391];return _0x50ebe3;};'use strict';var express=require('express');var router=express[_0xb655('0x0')]();var controller=require('./authLocal.controller');router[_0xb655('0x1')]('/',controller[_0xb655('0x2')]);router[_0xb655('0x1')](_0xb655('0x3'),controller[_0xb655('0x4')]);router[_0xb655('0x1')](_0xb655('0x5'),controller[_0xb655('0x6')]);module[_0xb655('0x7')]=router;
\ No newline at end of file
+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
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 491307d..b76e984 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 _0x09c4=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x21a9cf,_0x51f954){var _0x5d4ba7=function(_0x18d186){while(--_0x18d186){_0x21a9cf['push'](_0x21a9cf['shift']());}};_0x5d4ba7(++_0x51f954);}(_0x09c4,0x10d));var _0x409c=function(_0x550e29,_0x4047f){_0x550e29=_0x550e29-0x0;var _0x3515b6=_0x09c4[_0x550e29];return _0x3515b6;};'use strict';var Sequelize=require(_0x409c('0x0'));module[_0x409c('0x1')]={'name':{'type':Sequelize[_0x409c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x409c('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x409c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x409c('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+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
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 132b426..cc75003 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 _0xefb6=['model','query','intersection','attributes','fields','length','nolimit','order','filters','filter','where','include','findAll','rows','catch','show','params','keys','includeAll','merge','options','find','create','body','addConditions','Condition','ids','findOne','sort','pick','hasOwnProperty','getConditions','addActions','Action','omit','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','Automation','rawAttributes','fieldName','type'];(function(_0x3c4505,_0xffe1f8){var _0x18f0cc=function(_0x21a4d4){while(--_0x21a4d4){_0x3c4505['push'](_0x3c4505['shift']());}};_0x18f0cc(++_0xffe1f8);}(_0xefb6,0x1c8));var _0x6efb=function(_0x402c8f,_0x30cc1d){_0x402c8f=_0x402c8f-0x0;var _0x11e809=_0xefb6[_0x402c8f];return _0x11e809;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6efb('0x0'));var zipdir=require(_0x6efb('0x1'));var jsonpatch=require(_0x6efb('0x2'));var rp=require(_0x6efb('0x3'));var moment=require(_0x6efb('0x4'));var BPromise=require(_0x6efb('0x5'));var Mustache=require('mustache');var util=require(_0x6efb('0x6'));var path=require(_0x6efb('0x7'));var sox=require(_0x6efb('0x8'));var csv=require(_0x6efb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6efb('0xa'));var _=require(_0x6efb('0xb'));var squel=require(_0x6efb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6efb('0x9'));var querystring=require('querystring');var Papa=require(_0x6efb('0xd'));var Redis=require(_0x6efb('0xe'));var authService=require(_0x6efb('0xf'));var qs=require(_0x6efb('0x10'));var as=require(_0x6efb('0x11'));var hardwareService=require(_0x6efb('0x12'));var logger=require(_0x6efb('0x13'))(_0x6efb('0x14'));var utils=require(_0x6efb('0x15'));var config=require(_0x6efb('0x16'));var licenseUtil=require(_0x6efb('0x17'));var db=require(_0x6efb('0x18'))['db'];function respondWithStatusCode(_0xbb7e96,_0x334a1e){_0x334a1e=_0x334a1e||0xcc;return function(_0x238e7c){if(_0x238e7c){return _0xbb7e96[_0x6efb('0x19')](_0x334a1e);}return _0xbb7e96[_0x6efb('0x1a')](_0x334a1e)['end']();};}function respondWithResult(_0x3ca387,_0x5c898d){_0x5c898d=_0x5c898d||0xc8;return function(_0x47d405){if(_0x47d405){return _0x3ca387[_0x6efb('0x1a')](_0x5c898d)[_0x6efb('0x1b')](_0x47d405);}};}function respondWithFilteredResult(_0x12274d,_0x27c972){return function(_0x414490){if(_0x414490){var _0x9151f=typeof _0x27c972[_0x6efb('0x1c')]===_0x6efb('0x1d')&&typeof _0x27c972['limit']===_0x6efb('0x1d');var _0x1b6eec=_0x414490[_0x6efb('0x1e')];var _0xec1fb5=_0x9151f?0x0:_0x27c972['offset'];var _0x4f9422=_0x9151f?_0x414490[_0x6efb('0x1e')]:_0x27c972[_0x6efb('0x1c')]+_0x27c972[_0x6efb('0x1f')];var _0x4a2d46;if(_0x4f9422>=_0x1b6eec){_0x4f9422=_0x1b6eec;_0x4a2d46=0xc8;}else{_0x4a2d46=0xce;}_0x12274d[_0x6efb('0x1a')](_0x4a2d46);return _0x12274d[_0x6efb('0x20')]('Content-Range',_0xec1fb5+'-'+_0x4f9422+'/'+_0x1b6eec)[_0x6efb('0x1b')](_0x414490);}return null;};}function patchUpdates(_0x1956a7){return function(_0x38d64e){try{jsonpatch[_0x6efb('0x21')](_0x38d64e,_0x1956a7,!![]);}catch(_0x7185b4){return BPromise[_0x6efb('0x22')](_0x7185b4);}return _0x38d64e[_0x6efb('0x23')]();};}function saveUpdates(_0x26cf2a,_0x201dcf){return function(_0x13cd62){if(_0x13cd62){return _0x13cd62[_0x6efb('0x24')](_0x26cf2a)[_0x6efb('0x25')](function(_0x5bc366){return _0x5bc366;});}return null;};}function removeEntity(_0x4440ff,_0x32ee0e){return function(_0x5766ae){if(_0x5766ae){return _0x5766ae[_0x6efb('0x26')]()['then'](function(){_0x4440ff[_0x6efb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e9dfa,_0x150594){return function(_0x5a517c){if(!_0x5a517c){_0x2e9dfa['sendStatus'](0x194);}return _0x5a517c;};}function handleError(_0x28bf22,_0x105e41){_0x105e41=_0x105e41||0x1f4;return function(_0x24cdca){logger['error'](_0x24cdca[_0x6efb('0x27')]);if(_0x24cdca[_0x6efb('0x28')]){delete _0x24cdca[_0x6efb('0x28')];}_0x28bf22['status'](_0x105e41)[_0x6efb('0x29')](_0x24cdca);};}exports[_0x6efb('0x2a')]=function(_0x53cd1a,_0x3fe231){var _0x4a062e={},_0x1a1aff={},_0x4bf77d={'count':0x0,'rows':[]};var _0x3eb8ec=_[_0x6efb('0x2b')](db[_0x6efb('0x2c')][_0x6efb('0x2d')],function(_0x471d16){return{'name':_0x471d16[_0x6efb('0x2e')],'type':_0x471d16[_0x6efb('0x2f')]['key']};});_0x1a1aff[_0x6efb('0x30')]=_['map'](_0x3eb8ec,_0x6efb('0x28'));_0x1a1aff[_0x6efb('0x31')]=_['keys'](_0x53cd1a[_0x6efb('0x31')]);_0x1a1aff['filters']=_[_0x6efb('0x32')](_0x1a1aff[_0x6efb('0x30')],_0x1a1aff[_0x6efb('0x31')]);_0x4a062e[_0x6efb('0x33')]=_[_0x6efb('0x32')](_0x1a1aff['model'],qs['fields'](_0x53cd1a[_0x6efb('0x31')][_0x6efb('0x34')]));_0x4a062e['attributes']=_0x4a062e[_0x6efb('0x33')][_0x6efb('0x35')]?_0x4a062e[_0x6efb('0x33')]:_0x1a1aff[_0x6efb('0x30')];if(!_0x53cd1a[_0x6efb('0x31')]['hasOwnProperty'](_0x6efb('0x36'))){_0x4a062e[_0x6efb('0x1f')]=qs['limit'](_0x53cd1a['query'][_0x6efb('0x1f')]);_0x4a062e[_0x6efb('0x1c')]=qs[_0x6efb('0x1c')](_0x53cd1a[_0x6efb('0x31')][_0x6efb('0x1c')]);}_0x4a062e[_0x6efb('0x37')]=qs['sort'](_0x53cd1a[_0x6efb('0x31')]['sort']);_0x4a062e['where']=qs[_0x6efb('0x38')](_['pick'](_0x53cd1a[_0x6efb('0x31')],_0x1a1aff['filters']),_0x3eb8ec);if(_0x53cd1a[_0x6efb('0x31')][_0x6efb('0x39')]){_0x4a062e[_0x6efb('0x3a')]=_['merge'](_0x4a062e[_0x6efb('0x3a')],{'$or':_[_0x6efb('0x2b')](_0x3eb8ec,function(_0x3e3731){if(_0x3e3731[_0x6efb('0x2f')]!=='VIRTUAL'){var _0x34b46c={};_0x34b46c[_0x3e3731['name']]={'$like':'%'+_0x53cd1a[_0x6efb('0x31')][_0x6efb('0x39')]+'%'};return _0x34b46c;}})});}_0x4a062e=_['merge']({},_0x4a062e,_0x53cd1a['options']);var _0xd94007={'where':_0x4a062e[_0x6efb('0x3a')]};return db[_0x6efb('0x2c')][_0x6efb('0x1e')](_0xd94007)['then'](function(_0x2dadb1){_0x4bf77d[_0x6efb('0x1e')]=_0x2dadb1;if(_0x53cd1a['query']['includeAll']){_0x4a062e[_0x6efb('0x3b')]=[{'all':!![]}];}return db[_0x6efb('0x2c')][_0x6efb('0x3c')](_0x4a062e);})[_0x6efb('0x25')](function(_0x14bc95){_0x4bf77d[_0x6efb('0x3d')]=_0x14bc95;return _0x4bf77d;})[_0x6efb('0x25')](respondWithFilteredResult(_0x3fe231,_0x4a062e))[_0x6efb('0x3e')](handleError(_0x3fe231,null));};exports[_0x6efb('0x3f')]=function(_0x5e0dc0,_0x201cab){var _0x27e602={'raw':![],'where':{'id':_0x5e0dc0[_0x6efb('0x40')]['id']}},_0x1206c8={};_0x1206c8['model']=_[_0x6efb('0x41')](db[_0x6efb('0x2c')][_0x6efb('0x2d')]);_0x1206c8[_0x6efb('0x31')]=_['keys'](_0x5e0dc0[_0x6efb('0x31')]);_0x1206c8[_0x6efb('0x38')]=_[_0x6efb('0x32')](_0x1206c8[_0x6efb('0x30')],_0x1206c8[_0x6efb('0x31')]);_0x27e602['attributes']=_[_0x6efb('0x32')](_0x1206c8[_0x6efb('0x30')],qs[_0x6efb('0x34')](_0x5e0dc0['query'][_0x6efb('0x34')]));_0x27e602['attributes']=_0x27e602[_0x6efb('0x33')][_0x6efb('0x35')]?_0x27e602[_0x6efb('0x33')]:_0x1206c8[_0x6efb('0x30')];if(_0x5e0dc0['query'][_0x6efb('0x42')]){_0x27e602['include']=[{'all':!![]}];}_0x27e602=_[_0x6efb('0x43')]({},_0x27e602,_0x5e0dc0[_0x6efb('0x44')]);return db[_0x6efb('0x2c')][_0x6efb('0x45')](_0x27e602)[_0x6efb('0x25')](handleEntityNotFound(_0x201cab,null))[_0x6efb('0x25')](respondWithResult(_0x201cab,null))[_0x6efb('0x3e')](handleError(_0x201cab,null));};exports['create']=function(_0x21fb7f,_0x22b314){return db['Automation'][_0x6efb('0x46')](_0x21fb7f[_0x6efb('0x47')],{})['then'](respondWithResult(_0x22b314,0xc9))[_0x6efb('0x3e')](handleError(_0x22b314,null));};exports[_0x6efb('0x24')]=function(_0x5a05ec,_0x59136c){if(_0x5a05ec[_0x6efb('0x47')]['id']){delete _0x5a05ec[_0x6efb('0x47')]['id'];}return db[_0x6efb('0x2c')][_0x6efb('0x45')]({'where':{'id':_0x5a05ec[_0x6efb('0x40')]['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x59136c,null))['then'](saveUpdates(_0x5a05ec[_0x6efb('0x47')],null))[_0x6efb('0x25')](respondWithResult(_0x59136c,null))[_0x6efb('0x3e')](handleError(_0x59136c,null));};exports['destroy']=function(_0x13be93,_0x1f8d9b){return db[_0x6efb('0x2c')][_0x6efb('0x45')]({'where':{'id':_0x13be93['params']['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x1f8d9b,null))[_0x6efb('0x25')](removeEntity(_0x1f8d9b,null))[_0x6efb('0x3e')](handleError(_0x1f8d9b,null));};exports[_0x6efb('0x48')]=function(_0x5af036,_0x54b8be,_0x9de016){return db[_0x6efb('0x49')]['find']({'where':{'id':_0x5af036['params']['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x54b8be,null))[_0x6efb('0x25')](function(_0x295204){if(_0x295204){return _0x295204['addConditions'](_0x5af036[_0x6efb('0x47')][_0x6efb('0x4a')],_['omit'](_0x5af036[_0x6efb('0x47')],['ids','id'])||{});}})[_0x6efb('0x25')](respondWithResult(_0x54b8be,null))[_0x6efb('0x3e')](handleError(_0x54b8be,null));};exports['getConditions']=function(_0x49030e,_0x142055,_0xdde676){var _0x362603={};var _0x35b96d={};var _0x2c82d1;var _0x3c798c;return db[_0x6efb('0x2c')][_0x6efb('0x4b')]({'where':{'id':_0x49030e[_0x6efb('0x40')]['id']}})['then'](handleEntityNotFound(_0x142055,null))['then'](function(_0x2a9233){if(_0x2a9233){_0x2c82d1=_0x2a9233;_0x35b96d['model']=_['keys'](db[_0x6efb('0x49')][_0x6efb('0x2d')]);_0x35b96d[_0x6efb('0x31')]=_[_0x6efb('0x41')](_0x49030e[_0x6efb('0x31')]);_0x35b96d[_0x6efb('0x38')]=_[_0x6efb('0x32')](_0x35b96d[_0x6efb('0x30')],_0x35b96d[_0x6efb('0x31')]);_0x362603['attributes']=_[_0x6efb('0x32')](_0x35b96d['model'],qs[_0x6efb('0x34')](_0x49030e['query'][_0x6efb('0x34')]));_0x362603[_0x6efb('0x33')]=_0x362603[_0x6efb('0x33')][_0x6efb('0x35')]?_0x362603[_0x6efb('0x33')]:_0x35b96d['model'];_0x362603[_0x6efb('0x37')]=qs[_0x6efb('0x4c')](_0x49030e[_0x6efb('0x31')][_0x6efb('0x4c')]);_0x362603[_0x6efb('0x3a')]=qs['filters'](_[_0x6efb('0x4d')](_0x49030e[_0x6efb('0x31')],_0x35b96d['filters']));if(_0x49030e['query'][_0x6efb('0x39')]){_0x362603[_0x6efb('0x3a')]=_[_0x6efb('0x43')](_0x362603[_0x6efb('0x3a')],{'$or':_[_0x6efb('0x2b')](_0x362603[_0x6efb('0x33')],function(_0x5af569){var _0x744cf6={};_0x744cf6[_0x5af569]={'$like':'%'+_0x49030e[_0x6efb('0x31')][_0x6efb('0x39')]+'%'};return _0x744cf6;})});}_0x362603=_[_0x6efb('0x43')]({},_0x362603,_0x49030e['options']);return _0x2c82d1['getConditions'](_0x362603);}})[_0x6efb('0x25')](function(_0x48652f){if(_0x48652f){_0x3c798c=_0x48652f[_0x6efb('0x35')];if(!_0x49030e['query'][_0x6efb('0x4e')](_0x6efb('0x36'))){_0x362603[_0x6efb('0x1f')]=qs[_0x6efb('0x1f')](_0x49030e[_0x6efb('0x31')][_0x6efb('0x1f')]);_0x362603[_0x6efb('0x1c')]=qs[_0x6efb('0x1c')](_0x49030e['query'][_0x6efb('0x1c')]);}return _0x2c82d1[_0x6efb('0x4f')](_0x362603);}})['then'](function(_0x168eaf){if(_0x168eaf){return _0x168eaf?{'count':_0x3c798c,'rows':_0x168eaf}:null;}})[_0x6efb('0x25')](respondWithResult(_0x142055,null))[_0x6efb('0x3e')](handleError(_0x142055,null));};exports[_0x6efb('0x50')]=function(_0x603cc0,_0x5f1cfb,_0x4e0747){return db[_0x6efb('0x51')]['find']({'where':{'id':_0x603cc0[_0x6efb('0x40')]['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x5f1cfb,null))['then'](function(_0x480ced){if(_0x480ced){return _0x480ced[_0x6efb('0x50')](_0x603cc0['body']['ids'],_[_0x6efb('0x52')](_0x603cc0['body'],[_0x6efb('0x4a'),'id'])||{});}})[_0x6efb('0x25')](respondWithResult(_0x5f1cfb,null))[_0x6efb('0x3e')](handleError(_0x5f1cfb,null));};exports[_0x6efb('0x53')]=function(_0x646063,_0x22050c,_0x4f8e72){var _0xa73b4e={};var _0x5201cd={};var _0x1e5c5a;var _0x33ebf7;return db[_0x6efb('0x2c')][_0x6efb('0x4b')]({'where':{'id':_0x646063[_0x6efb('0x40')]['id']}})[_0x6efb('0x25')](handleEntityNotFound(_0x22050c,null))['then'](function(_0x18e94e){if(_0x18e94e){_0x1e5c5a=_0x18e94e;_0x5201cd[_0x6efb('0x30')]=_[_0x6efb('0x41')](db['Action'][_0x6efb('0x2d')]);_0x5201cd[_0x6efb('0x31')]=_[_0x6efb('0x41')](_0x646063[_0x6efb('0x31')]);_0x5201cd[_0x6efb('0x38')]=_['intersection'](_0x5201cd['model'],_0x5201cd['query']);_0xa73b4e['attributes']=_[_0x6efb('0x32')](_0x5201cd[_0x6efb('0x30')],qs[_0x6efb('0x34')](_0x646063[_0x6efb('0x31')][_0x6efb('0x34')]));_0xa73b4e[_0x6efb('0x33')]=_0xa73b4e[_0x6efb('0x33')][_0x6efb('0x35')]?_0xa73b4e[_0x6efb('0x33')]:_0x5201cd['model'];_0xa73b4e[_0x6efb('0x37')]=qs[_0x6efb('0x4c')](_0x646063[_0x6efb('0x31')][_0x6efb('0x4c')]);_0xa73b4e[_0x6efb('0x3a')]=qs[_0x6efb('0x38')](_['pick'](_0x646063[_0x6efb('0x31')],_0x5201cd[_0x6efb('0x38')]));if(_0x646063[_0x6efb('0x31')][_0x6efb('0x39')]){_0xa73b4e[_0x6efb('0x3a')]=_[_0x6efb('0x43')](_0xa73b4e[_0x6efb('0x3a')],{'$or':_[_0x6efb('0x2b')](_0xa73b4e[_0x6efb('0x33')],function(_0x4d0daf){var _0x1e371c={};_0x1e371c[_0x4d0daf]={'$like':'%'+_0x646063[_0x6efb('0x31')][_0x6efb('0x39')]+'%'};return _0x1e371c;})});}_0xa73b4e=_['merge']({},_0xa73b4e,_0x646063[_0x6efb('0x44')]);return _0x1e5c5a[_0x6efb('0x53')](_0xa73b4e);}})[_0x6efb('0x25')](function(_0x215bf7){if(_0x215bf7){_0x33ebf7=_0x215bf7[_0x6efb('0x35')];if(!_0x646063[_0x6efb('0x31')][_0x6efb('0x4e')](_0x6efb('0x36'))){_0xa73b4e[_0x6efb('0x1f')]=qs['limit'](_0x646063['query']['limit']);_0xa73b4e[_0x6efb('0x1c')]=qs[_0x6efb('0x1c')](_0x646063[_0x6efb('0x31')]['offset']);}return _0x1e5c5a[_0x6efb('0x53')](_0xa73b4e);}})['then'](function(_0x4bcc0b){if(_0x4bcc0b){return _0x4bcc0b?{'count':_0x33ebf7,'rows':_0x4bcc0b}:null;}})[_0x6efb('0x25')](respondWithResult(_0x22050c,null))[_0x6efb('0x3e')](handleError(_0x22050c,null));};
\ No newline at end of file
+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
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index bf70cb6..2a0260a 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 _0xfedd=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x30ff0d,_0x385305){var _0x958560=function(_0xfd1229){while(--_0xfd1229){_0x30ff0d['push'](_0x30ff0d['shift']());}};_0x958560(++_0x385305);}(_0xfedd,0x9c));var _0xdfed=function(_0x55490e,_0x23f25c){_0x55490e=_0x55490e-0x0;var _0x4e4708=_0xfedd[_0x55490e];return _0x4e4708;};'use strict';var _=require(_0xdfed('0x0'));var util=require(_0xdfed('0x1'));var logger=require(_0xdfed('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdfed('0x3'));var rp=require(_0xdfed('0x4'));var fs=require('fs');var path=require(_0xdfed('0x5'));var rimraf=require(_0xdfed('0x6'));var config=require(_0xdfed('0x7'));var attributes=require(_0xdfed('0x8'));module[_0xdfed('0x9')]=function(_0x4bc5a9,_0x4c47bd){return _0x4bc5a9[_0xdfed('0xa')](_0xdfed('0xb'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 5266ab8..3a9711e 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 _0xc1d3=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x178dbe,_0x969fba){var _0x2c6ea5=function(_0x3fcac7){while(--_0x3fcac7){_0x178dbe['push'](_0x178dbe['shift']());}};_0x2c6ea5(++_0x969fba);}(_0xc1d3,0x147));var _0x3c1d=function(_0x2ec3c3,_0xc744cd){_0x2ec3c3=_0x2ec3c3-0x0;var _0x5b374a=_0xc1d3[_0x2ec3c3];return _0x5b374a;};'use strict';var _=require(_0x3c1d('0x0'));var util=require(_0x3c1d('0x1'));var moment=require(_0x3c1d('0x2'));var BPromise=require(_0x3c1d('0x3'));var rs=require(_0x3c1d('0x4'));var fs=require('fs');var Redis=require(_0x3c1d('0x5'));var db=require(_0x3c1d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3c1d('0x7'));var config=require(_0x3c1d('0x8'));var jayson=require(_0x3c1d('0x9'));var client=jayson['client'][_0x3c1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36863b,_0x3bef1a,_0x28793c){return new BPromise(function(_0x1796a0,_0x58e08c){return client[_0x3c1d('0xb')](_0x36863b,_0x28793c)[_0x3c1d('0xc')](function(_0x33cb1b){logger[_0x3c1d('0xd')](_0x3c1d('0xe'),_0x3bef1a,_0x3c1d('0xf'));logger[_0x3c1d('0x10')](_0x3c1d('0x11'),_0x3bef1a,'request\x20sent',JSON[_0x3c1d('0x12')](_0x33cb1b));if(_0x33cb1b[_0x3c1d('0x13')]){if(_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x14')]===0x1f4){logger[_0x3c1d('0x13')]('Automation,\x20%s,\x20%s',_0x3bef1a,_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x15')]);return _0x58e08c(_0x33cb1b['error'][_0x3c1d('0x15')]);}logger['error']('Automation,\x20%s,\x20%s',_0x3bef1a,_0x33cb1b['error'][_0x3c1d('0x15')]);return _0x1796a0(_0x33cb1b[_0x3c1d('0x13')][_0x3c1d('0x15')]);}else{logger[_0x3c1d('0xd')](_0x3c1d('0xe'),_0x3bef1a,_0x3c1d('0xf'));_0x1796a0(_0x33cb1b['result']['message']);}})[_0x3c1d('0x16')](function(_0x5ab3b0){logger[_0x3c1d('0x13')](_0x3c1d('0xe'),_0x3bef1a,_0x5ab3b0);_0x58e08c(_0x5ab3b0);});});}
\ No newline at end of file
+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
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index d5b8b42..f6be194 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 _0x9cff=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x9cff,0x1b0));var _0xf9cf=function(_0xa9af46,_0x32ab25){_0xa9af46=_0xa9af46-0x0;var _0x24822d=_0x9cff[_0xa9af46];return _0x24822d;};'use strict';var multer=require('multer');var util=require(_0xf9cf('0x0'));var path=require(_0xf9cf('0x1'));var timeout=require(_0xf9cf('0x2'));var express=require('express');var router=express[_0xf9cf('0x3')]();var fs_extra=require(_0xf9cf('0x4'));var auth=require(_0xf9cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf9cf('0x6'));var controller=require(_0xf9cf('0x7'));router[_0xf9cf('0x8')]('/',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xa')]);router[_0xf9cf('0x8')](_0xf9cf('0xb'),auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xc')]);router[_0xf9cf('0x8')](_0xf9cf('0xd'),auth['isAuthenticated'](),controller[_0xf9cf('0xe')]);router[_0xf9cf('0x8')]('/:id/actions',auth[_0xf9cf('0x9')](),controller['getActions']);router['post']('/',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xf')]);router['post'](_0xf9cf('0xd'),auth['isAuthenticated'](),controller[_0xf9cf('0x10')]);router['post'](_0xf9cf('0x11'),auth['isAuthenticated'](),controller[_0xf9cf('0x12')]);router[_0xf9cf('0x13')](_0xf9cf('0xb'),auth[_0xf9cf('0x9')](),controller[_0xf9cf('0x14')]);router[_0xf9cf('0x15')](_0xf9cf('0xb'),auth['isAuthenticated'](),controller[_0xf9cf('0x16')]);module[_0xf9cf('0x17')]=router;
\ No newline at end of file
+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
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index be9c658..7309277 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 _0x2675=['STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports'];(function(_0x303c0a,_0x1b2e62){var _0x233310=function(_0x358546){while(--_0x358546){_0x303c0a['push'](_0x303c0a['shift']());}};_0x233310(++_0x1b2e62);}(_0x2675,0x1ab));var _0x5267=function(_0x49e066,_0x27e060){_0x49e066=_0x49e066-0x0;var _0x49ba9b=_0x2675[_0x49e066];return _0x49ba9b;};'use strict';var Sequelize=require(_0x5267('0x0'));module[_0x5267('0x1')]={'name':{'type':Sequelize[_0x5267('0x2')],'unique':_0x5267('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5267('0x4')](_0x5267('0x5')),'allowNull':![],'defaultValue':_0x5267('0x5')},'description':{'type':Sequelize[_0x5267('0x2')]},'active':{'type':Sequelize[_0x5267('0x6')],'defaultValue':0x0,'comment':_0x5267('0x7')},'limitCalls':{'type':Sequelize[_0x5267('0x8')](0x4)[_0x5267('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5267('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5267('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x10')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5267('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5267('0x2')],'defaultValue':_0x5267('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5267('0x13'),'never',_0x5267('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5267('0x6')],'defaultValue':0x0,'comment':_0x5267('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x5267('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5267('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x5267('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5267('0x8')](0x9)[_0x5267('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x5267('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5267('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x5267('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5267('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5267('0x8')](0x9)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5267('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x5267('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5267('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5267('0x8')](0x9)[_0x5267('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5267('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5267('0x4')](_0x5267('0x1c'),'ASC'),'defaultValue':_0x5267('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5267('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5267('0x1d')},'dialCutDigit':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5267('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5267('0x8')](0x3)[_0x5267('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5267('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5267('0x8')](0x5)[_0x5267('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5267('0x26')}};
\ No newline at end of file
+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
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index fe20d45..6a9bea5 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 _0x7792=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','stack','name','send','index','map','Campaign','rawAttributes','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','userProfileId','autoAssociation','error','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','NOW()','field','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','insert','fromQuery','ListId','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x460f81,_0x553431){var _0x423f0d=function(_0x267a6b){while(--_0x267a6b){_0x460f81['push'](_0x460f81['shift']());}};_0x423f0d(++_0x553431);}(_0x7792,0x184));var _0x2779=function(_0x229f5e,_0x433f0f){_0x229f5e=_0x229f5e-0x0;var _0x2d62ff=_0x7792[_0x229f5e];return _0x2d62ff;};'use strict';var emlformat=require(_0x2779('0x0'));var rimraf=require(_0x2779('0x1'));var zipdir=require(_0x2779('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2779('0x3'));var moment=require(_0x2779('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2779('0x5'));var util=require(_0x2779('0x6'));var path=require(_0x2779('0x7'));var sox=require(_0x2779('0x8'));var csv=require('to-csv');var ejs=require(_0x2779('0x9'));var fs=require('fs');var fs_extra=require(_0x2779('0xa'));var _=require(_0x2779('0xb'));var squel=require(_0x2779('0xc'));var crypto=require(_0x2779('0xd'));var jsforce=require(_0x2779('0xe'));var deskjs=require(_0x2779('0xf'));var toCsv=require(_0x2779('0x10'));var querystring=require(_0x2779('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2779('0x12'));var qs=require(_0x2779('0x13'));var as=require(_0x2779('0x14'));var hardwareService=require(_0x2779('0x15'));var logger=require('../../config/logger')(_0x2779('0x16'));var utils=require(_0x2779('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2779('0x18'));var db=require(_0x2779('0x19'))['db'];function respondWithStatusCode(_0x285786,_0xd98fe0){_0xd98fe0=_0xd98fe0||0xcc;return function(_0x503fac){if(_0x503fac){return _0x285786[_0x2779('0x1a')](_0xd98fe0);}return _0x285786[_0x2779('0x1b')](_0xd98fe0)['end']();};}function respondWithResult(_0x3e28a1,_0x22122b){_0x22122b=_0x22122b||0xc8;return function(_0x3ac775){if(_0x3ac775){return _0x3e28a1[_0x2779('0x1b')](_0x22122b)[_0x2779('0x1c')](_0x3ac775);}};}function respondWithFilteredResult(_0xdca5d5,_0xffe5b1){return function(_0x1cfd85){if(_0x1cfd85){var _0xb29e28=typeof _0xffe5b1[_0x2779('0x1d')]===_0x2779('0x1e')&&typeof _0xffe5b1[_0x2779('0x1f')]===_0x2779('0x1e');var _0x103498=_0x1cfd85[_0x2779('0x20')];var _0x27ea78=_0xb29e28?0x0:_0xffe5b1[_0x2779('0x1d')];var _0x492fe0=_0xb29e28?_0x1cfd85[_0x2779('0x20')]:_0xffe5b1[_0x2779('0x1d')]+_0xffe5b1[_0x2779('0x1f')];var _0x2786aa;if(_0x492fe0>=_0x103498){_0x492fe0=_0x103498;_0x2786aa=0xc8;}else{_0x2786aa=0xce;}_0xdca5d5['status'](_0x2786aa);return _0xdca5d5[_0x2779('0x21')](_0x2779('0x22'),_0x27ea78+'-'+_0x492fe0+'/'+_0x103498)[_0x2779('0x1c')](_0x1cfd85);}return null;};}function patchUpdates(_0x989416){return function(_0x206644){try{jsonpatch['apply'](_0x206644,_0x989416,!![]);}catch(_0x2ddfd3){return BPromise[_0x2779('0x23')](_0x2ddfd3);}return _0x206644[_0x2779('0x24')]();};}function saveUpdates(_0x441648,_0x6ff722){return function(_0x4d6d5a){if(_0x4d6d5a){return _0x4d6d5a[_0x2779('0x25')](_0x441648)[_0x2779('0x26')](function(_0xdbc38a){return _0xdbc38a;});}return null;};}function removeEntity(_0x45e2da,_0x5a728d){return function(_0x338336){if(_0x338336){return _0x338336[_0x2779('0x27')]()[_0x2779('0x26')](function(){var _0x289af4=_0x338336[_0x2779('0x28')]({'plain':!![]});var _0x10b63e=_0x2779('0x29');return db[_0x2779('0x2a')][_0x2779('0x27')]({'where':{'type':_0x10b63e,'resourceId':_0x289af4['id']}})[_0x2779('0x26')](function(){return _0x338336;});})[_0x2779('0x26')](function(){_0x45e2da[_0x2779('0x1b')](0xcc)[_0x2779('0x2b')]();});}};}function handleEntityNotFound(_0x375a68,_0x327e43){return function(_0x51dced){if(!_0x51dced){_0x375a68['sendStatus'](0x194);}return _0x51dced;};}function handleError(_0x34b4ea,_0x32081c){_0x32081c=_0x32081c||0x1f4;return function(_0x4cf2f4){logger['error'](_0x4cf2f4[_0x2779('0x2c')]);if(_0x4cf2f4[_0x2779('0x2d')]){delete _0x4cf2f4['name'];}_0x34b4ea['status'](_0x32081c)[_0x2779('0x2e')](_0x4cf2f4);};}exports[_0x2779('0x2f')]=function(_0x3ce4cd,_0xaf4276){var _0x3f4f9c={},_0x56a5e2={},_0x26baf7={'count':0x0,'rows':[]};var _0x48b092=_[_0x2779('0x30')](db[_0x2779('0x31')][_0x2779('0x32')],function(_0x35a9bf){return{'name':_0x35a9bf['fieldName'],'type':_0x35a9bf[_0x2779('0x33')]['key']};});_0x56a5e2['model']=_[_0x2779('0x30')](_0x48b092,_0x2779('0x2d'));_0x56a5e2[_0x2779('0x34')]=_['keys'](_0x3ce4cd['query']);_0x56a5e2[_0x2779('0x35')]=_['intersection'](_0x56a5e2[_0x2779('0x36')],_0x56a5e2[_0x2779('0x34')]);_0x3f4f9c[_0x2779('0x37')]=_[_0x2779('0x38')](_0x56a5e2['model'],qs[_0x2779('0x39')](_0x3ce4cd[_0x2779('0x34')][_0x2779('0x39')]));_0x3f4f9c[_0x2779('0x37')]=_0x3f4f9c[_0x2779('0x37')][_0x2779('0x3a')]?_0x3f4f9c[_0x2779('0x37')]:_0x56a5e2[_0x2779('0x36')];if(!_0x3ce4cd[_0x2779('0x34')][_0x2779('0x3b')]('nolimit')){_0x3f4f9c[_0x2779('0x1f')]=qs['limit'](_0x3ce4cd[_0x2779('0x34')][_0x2779('0x1f')]);_0x3f4f9c[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0x3ce4cd[_0x2779('0x34')][_0x2779('0x1d')]);}_0x3f4f9c[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x3ce4cd[_0x2779('0x34')]['sort']);_0x3f4f9c[_0x2779('0x3e')]=qs[_0x2779('0x35')](_[_0x2779('0x3f')](_0x3ce4cd['query'],_0x56a5e2[_0x2779('0x35')]),_0x48b092);if(_0x3ce4cd[_0x2779('0x34')][_0x2779('0x40')]){_0x3f4f9c['where']=_[_0x2779('0x41')](_0x3f4f9c['where'],{'$or':_[_0x2779('0x30')](_0x48b092,function(_0xd03271){if(_0xd03271[_0x2779('0x33')]!=='VIRTUAL'){var _0x4af19a={};_0x4af19a[_0xd03271[_0x2779('0x2d')]]={'$like':'%'+_0x3ce4cd[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x4af19a;}})});}_0x3f4f9c=_[_0x2779('0x41')]({},_0x3f4f9c,_0x3ce4cd['options']);var _0xfe97b4={'where':_0x3f4f9c[_0x2779('0x3e')]};return db['Campaign'][_0x2779('0x20')](_0xfe97b4)[_0x2779('0x26')](function(_0x2a24f8){_0x26baf7[_0x2779('0x20')]=_0x2a24f8;if(_0x3ce4cd[_0x2779('0x34')]['includeAll']){_0x3f4f9c[_0x2779('0x42')]=[{'all':!![]}];}return db[_0x2779('0x31')][_0x2779('0x43')](_0x3f4f9c);})[_0x2779('0x26')](function(_0x1b711c){_0x26baf7[_0x2779('0x44')]=_0x1b711c;return _0x26baf7;})[_0x2779('0x26')](respondWithFilteredResult(_0xaf4276,_0x3f4f9c))[_0x2779('0x45')](handleError(_0xaf4276,null));};exports[_0x2779('0x46')]=function(_0x26ddee,_0x38ced1){var _0x15be23={'raw':![],'where':{'id':_0x26ddee[_0x2779('0x47')]['id']}},_0x6de4c0={};_0x6de4c0[_0x2779('0x36')]=_[_0x2779('0x48')](db[_0x2779('0x31')][_0x2779('0x32')]);_0x6de4c0[_0x2779('0x34')]=_[_0x2779('0x48')](_0x26ddee[_0x2779('0x34')]);_0x6de4c0[_0x2779('0x35')]=_[_0x2779('0x38')](_0x6de4c0[_0x2779('0x36')],_0x6de4c0[_0x2779('0x34')]);_0x15be23['attributes']=_[_0x2779('0x38')](_0x6de4c0[_0x2779('0x36')],qs['fields'](_0x26ddee[_0x2779('0x34')]['fields']));_0x15be23[_0x2779('0x37')]=_0x15be23[_0x2779('0x37')][_0x2779('0x3a')]?_0x15be23[_0x2779('0x37')]:_0x6de4c0[_0x2779('0x36')];if(_0x26ddee[_0x2779('0x34')][_0x2779('0x49')]){_0x15be23[_0x2779('0x42')]=[{'all':!![]}];}_0x15be23=_[_0x2779('0x41')]({},_0x15be23,_0x26ddee[_0x2779('0x4a')]);return db[_0x2779('0x31')][_0x2779('0x4b')](_0x15be23)[_0x2779('0x26')](handleEntityNotFound(_0x38ced1,null))[_0x2779('0x26')](respondWithResult(_0x38ced1,null))[_0x2779('0x45')](handleError(_0x38ced1,null));};exports[_0x2779('0x4c')]=function(_0x381c9c,_0x4bb1ba){return db[_0x2779('0x31')]['create'](_0x381c9c[_0x2779('0x4d')],{})[_0x2779('0x26')](function(_0xdd93ad){var _0x3bb6d2=_0x381c9c[_0x2779('0x4e')]['get']({'plain':!![]});if(!_0x3bb6d2)throw new Error(_0x2779('0x4f'));if(_0x3bb6d2[_0x2779('0x50')]===_0x2779('0x4e')){var _0x11a94f=_0xdd93ad[_0x2779('0x28')]({'plain':!![]});var _0x3c67bf=_0x2779('0x29');return db['UserProfileSection'][_0x2779('0x4b')]({'where':{'name':_0x3c67bf,'userProfileId':_0x3bb6d2['userProfileId']},'raw':!![]})['then'](function(_0x468c25){if(_0x468c25&&_0x468c25['autoAssociation']===0x0){return db[_0x2779('0x2a')][_0x2779('0x4c')]({'name':_0x11a94f[_0x2779('0x2d')],'resourceId':_0x11a94f['id'],'type':_0x468c25['name'],'sectionId':_0x468c25['id']},{})[_0x2779('0x26')](function(){return _0xdd93ad;});}else{return _0xdd93ad;}})[_0x2779('0x45')](function(_0x16dee7){logger['error'](_0x2779('0x51'),_0x16dee7);throw _0x16dee7;});}return _0xdd93ad;})['then'](respondWithResult(_0x4bb1ba,0xc9))[_0x2779('0x45')](handleError(_0x4bb1ba,null));};exports[_0x2779('0x52')]=function(_0x190f4a,_0x10a90a){var _0x282d06={'where':{'id':_0x190f4a[_0x2779('0x47')]['id']}},_0x1f6940={};_0x1f6940[_0x2779('0x36')]=_[_0x2779('0x48')](db[_0x2779('0x31')][_0x2779('0x32')]);_0x282d06['attributes']=_[_0x2779('0x38')](_0x1f6940[_0x2779('0x36')],qs[_0x2779('0x39')](_0x190f4a[_0x2779('0x34')][_0x2779('0x39')]));_0x282d06[_0x2779('0x37')]=_0x282d06[_0x2779('0x37')][_0x2779('0x3a')]?_0x282d06[_0x2779('0x37')]:_0x1f6940[_0x2779('0x36')];if(_0x190f4a[_0x2779('0x34')]['includeAll']){_0x282d06[_0x2779('0x42')]=[{'all':!![]}];}_0x282d06=_[_0x2779('0x41')]({},_0x282d06,_0x190f4a[_0x2779('0x4a')]);return db[_0x2779('0x31')][_0x2779('0x4b')](_0x282d06)[_0x2779('0x26')](handleEntityNotFound(_0x10a90a,null))['then'](function(_0x33924c){if(_0x33924c){var _0x1103ed=_0x33924c[_0x2779('0x28')]({'plain':!![]});_0x1103ed=qs[_0x2779('0x53')](_0x1103ed,['id',_0x2779('0x54'),_0x2779('0x55')]);_0x190f4a[_0x2779('0x4d')]=_[_0x2779('0x53')](_0x190f4a[_0x2779('0x4d')],['id',_0x2779('0x54'),_0x2779('0x55')]);return db['Campaign'][_0x2779('0x4c')](_[_0x2779('0x41')](_0x1103ed,_0x190f4a['body']),{'include':_0x190f4a[_0x2779('0x34')][_0x2779('0x49')]?[{'all':!![]}]:undefined})[_0x2779('0x26')](function(_0x463ba1){var _0x465c4a=_0x190f4a['user']['get']({'plain':!![]});if(!_0x465c4a)throw new Error(_0x2779('0x4f'));if(_0x465c4a[_0x2779('0x50')]===_0x2779('0x4e')){var _0x23f7f1=_0x463ba1['get']({'plain':!![]});var _0x306a8b=_0x2779('0x29');return db[_0x2779('0x56')]['find']({'where':{'name':_0x306a8b,'userProfileId':_0x465c4a[_0x2779('0x57')]},'raw':!![]})['then'](function(_0x28804d){if(_0x28804d&&_0x28804d[_0x2779('0x58')]===0x0){return db['UserProfileResource'][_0x2779('0x4c')]({'name':_0x23f7f1[_0x2779('0x2d')],'resourceId':_0x23f7f1['id'],'type':_0x28804d[_0x2779('0x2d')],'sectionId':_0x28804d['id']},{})[_0x2779('0x26')](function(){return _0x463ba1;});}else{return _0x463ba1;}})['catch'](function(_0x5b19b7){logger[_0x2779('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b19b7);throw _0x5b19b7;});}return _0x463ba1;});}})[_0x2779('0x26')](respondWithResult(_0x10a90a,0xc9))[_0x2779('0x45')](handleError(_0x10a90a,null));};exports['update']=function(_0x2559b8,_0xa02fd0){if(_0x2559b8[_0x2779('0x4d')]['id']){delete _0x2559b8[_0x2779('0x4d')]['id'];}return db[_0x2779('0x31')][_0x2779('0x4b')]({'where':{'id':_0x2559b8[_0x2779('0x47')]['id']}})['then'](handleEntityNotFound(_0xa02fd0,null))[_0x2779('0x26')](saveUpdates(_0x2559b8[_0x2779('0x4d')],null))[_0x2779('0x26')](respondWithResult(_0xa02fd0,null))[_0x2779('0x45')](handleError(_0xa02fd0,null));};exports[_0x2779('0x27')]=function(_0x125de4,_0x382c0f){return db['Campaign']['find']({'where':{'id':_0x125de4[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x382c0f,null))['then'](removeEntity(_0x382c0f,null))['catch'](handleError(_0x382c0f,null));};exports[_0x2779('0x5a')]=function(_0xb8a57b,_0x1479a2,_0x56ba09){var _0x4b3b98={'raw':!![],'where':{}};var _0x2b4252={};var _0x5c5a22={'count':0x0,'rows':[]};return db[_0x2779('0x31')][_0x2779('0x5b')]({'where':{'id':_0xb8a57b['params']['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x1479a2,null))[_0x2779('0x26')](function(_0x1e14ed){if(_0x1e14ed){_0x2b4252[_0x2779('0x36')]=_['keys'](db[_0x2779('0x5c')][_0x2779('0x32')]);_0x2b4252[_0x2779('0x34')]=_['keys'](_0xb8a57b[_0x2779('0x34')]);_0x2b4252[_0x2779('0x35')]=_[_0x2779('0x38')](_0x2b4252[_0x2779('0x36')],_0x2b4252[_0x2779('0x34')]);_0x4b3b98['attributes']=_[_0x2779('0x38')](_0x2b4252['model'],qs[_0x2779('0x39')](_0xb8a57b[_0x2779('0x34')][_0x2779('0x39')]));_0x4b3b98['attributes']=_0x4b3b98[_0x2779('0x37')][_0x2779('0x3a')]?_0x4b3b98[_0x2779('0x37')]:_0x2b4252[_0x2779('0x36')];if(!_0xb8a57b[_0x2779('0x34')][_0x2779('0x3b')]('nolimit')){_0x4b3b98[_0x2779('0x1f')]=qs[_0x2779('0x1f')](_0xb8a57b[_0x2779('0x34')][_0x2779('0x1f')]);_0x4b3b98[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0xb8a57b[_0x2779('0x34')][_0x2779('0x1d')]);}_0x4b3b98['order']=qs['sort'](_0xb8a57b[_0x2779('0x34')][_0x2779('0x3d')]);_0x4b3b98['where']=qs[_0x2779('0x35')](_[_0x2779('0x3f')](_0xb8a57b[_0x2779('0x34')],_0x2b4252[_0x2779('0x35')]));_0x4b3b98[_0x2779('0x3e')][_0x2779('0x5d')]=_0x1e14ed['id'];if(_0xb8a57b[_0x2779('0x34')]['filter']){_0x4b3b98[_0x2779('0x3e')]=_[_0x2779('0x41')](_0x4b3b98[_0x2779('0x3e')],{'$or':_[_0x2779('0x30')](_0x4b3b98[_0x2779('0x37')],function(_0x27873d){var _0x13fc70={};_0x13fc70[_0x27873d]={'$like':'%'+_0xb8a57b[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x13fc70;})});}_0x4b3b98=_[_0x2779('0x41')]({},_0x4b3b98,_0xb8a57b[_0x2779('0x4a')]);return db[_0x2779('0x5c')]['count']({'where':_0x4b3b98[_0x2779('0x3e')]})[_0x2779('0x26')](function(_0x3b5a32){_0x5c5a22[_0x2779('0x20')]=_0x3b5a32;if(_0xb8a57b[_0x2779('0x34')][_0x2779('0x49')]){_0x4b3b98[_0x2779('0x42')]=[{'all':!![]}];}return db[_0x2779('0x5c')][_0x2779('0x43')](_0x4b3b98);})[_0x2779('0x26')](function(_0x4b3719){_0x5c5a22[_0x2779('0x44')]=_0x4b3719;return _0x5c5a22;});}})[_0x2779('0x26')](respondWithFilteredResult(_0x1479a2,_0x4b3b98))[_0x2779('0x45')](handleError(_0x1479a2,null));};exports[_0x2779('0x5e')]=function(_0x579bbd,_0x4f1779,_0x38754f){var _0x178984={'raw':!![],'where':{}};var _0x21d08c={};var _0x3c5f54={'count':0x0,'rows':[]};return db[_0x2779('0x31')]['findOne']({'where':{'id':_0x579bbd[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x4f1779,null))[_0x2779('0x26')](function(_0x4b04e1){if(_0x4b04e1){_0x21d08c['model']=_[_0x2779('0x48')](db[_0x2779('0x5f')]['rawAttributes']);_0x21d08c[_0x2779('0x34')]=_[_0x2779('0x48')](_0x579bbd[_0x2779('0x34')]);_0x21d08c[_0x2779('0x35')]=_[_0x2779('0x38')](_0x21d08c[_0x2779('0x36')],_0x21d08c[_0x2779('0x34')]);_0x178984['attributes']=_[_0x2779('0x38')](_0x21d08c[_0x2779('0x36')],qs[_0x2779('0x39')](_0x579bbd['query'][_0x2779('0x39')]));_0x178984[_0x2779('0x37')]=_0x178984[_0x2779('0x37')][_0x2779('0x3a')]?_0x178984['attributes']:_0x21d08c['model'];if(!_0x579bbd[_0x2779('0x34')]['hasOwnProperty'](_0x2779('0x60'))){_0x178984[_0x2779('0x1f')]=qs['limit'](_0x579bbd[_0x2779('0x34')][_0x2779('0x1f')]);_0x178984[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0x579bbd['query'][_0x2779('0x1d')]);}_0x178984[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x579bbd[_0x2779('0x34')][_0x2779('0x3d')]);_0x178984[_0x2779('0x3e')]=qs['filters'](_[_0x2779('0x3f')](_0x579bbd[_0x2779('0x34')],_0x21d08c[_0x2779('0x35')]));_0x178984[_0x2779('0x3e')][_0x2779('0x5d')]=_0x4b04e1['id'];if(_0x579bbd['query'][_0x2779('0x40')]){_0x178984[_0x2779('0x3e')]=_[_0x2779('0x41')](_0x178984[_0x2779('0x3e')],{'$or':_['map'](_0x178984['attributes'],function(_0x13655f){var _0xa49cdb={};_0xa49cdb[_0x13655f]={'$like':'%'+_0x579bbd[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0xa49cdb;})});}_0x178984=_[_0x2779('0x41')]({},_0x178984,_0x579bbd[_0x2779('0x4a')]);return db[_0x2779('0x5f')][_0x2779('0x20')]({'where':_0x178984[_0x2779('0x3e')]})[_0x2779('0x26')](function(_0x42c715){_0x3c5f54[_0x2779('0x20')]=_0x42c715;if(_0x579bbd[_0x2779('0x34')]['includeAll']){_0x178984['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x178984);})[_0x2779('0x26')](function(_0x2ca465){_0x3c5f54[_0x2779('0x44')]=_0x2ca465;return _0x3c5f54;});}})['then'](respondWithFilteredResult(_0x4f1779,_0x178984))['catch'](handleError(_0x4f1779,null));};exports[_0x2779('0x61')]=function(_0x54a231,_0x9bf0e5,_0x388e64){var _0x2163e2={'raw':!![],'where':{}};var _0x1e4d3c={};var _0x32b16f={'count':0x0,'rows':[]};return db[_0x2779('0x31')][_0x2779('0x5b')]({'where':{'id':_0x54a231[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x9bf0e5,null))[_0x2779('0x26')](function(_0x2c4223){if(_0x2c4223){_0x1e4d3c[_0x2779('0x36')]=_[_0x2779('0x48')](db['CmHopperFinal']['rawAttributes']);_0x1e4d3c['query']=_[_0x2779('0x48')](_0x54a231['query']);_0x1e4d3c[_0x2779('0x35')]=_[_0x2779('0x38')](_0x1e4d3c[_0x2779('0x36')],_0x1e4d3c[_0x2779('0x34')]);_0x2163e2[_0x2779('0x37')]=_[_0x2779('0x38')](_0x1e4d3c['model'],qs[_0x2779('0x39')](_0x54a231[_0x2779('0x34')]['fields']));_0x2163e2[_0x2779('0x37')]=_0x2163e2[_0x2779('0x37')][_0x2779('0x3a')]?_0x2163e2[_0x2779('0x37')]:_0x1e4d3c[_0x2779('0x36')];if(!_0x54a231[_0x2779('0x34')][_0x2779('0x3b')](_0x2779('0x60'))){_0x2163e2[_0x2779('0x1f')]=qs[_0x2779('0x1f')](_0x54a231['query'][_0x2779('0x1f')]);_0x2163e2[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0x54a231[_0x2779('0x34')][_0x2779('0x1d')]);}_0x2163e2[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x54a231['query'][_0x2779('0x3d')]);_0x2163e2[_0x2779('0x3e')]=qs['filters'](_[_0x2779('0x3f')](_0x54a231['query'],_0x1e4d3c['filters']));_0x2163e2[_0x2779('0x3e')][_0x2779('0x5d')]=_0x2c4223['id'];if(_0x54a231[_0x2779('0x34')][_0x2779('0x40')]){_0x2163e2['where']=_[_0x2779('0x41')](_0x2163e2[_0x2779('0x3e')],{'$or':_[_0x2779('0x30')](_0x2163e2['attributes'],function(_0x1c5e83){var _0x2af93a={};_0x2af93a[_0x1c5e83]={'$like':'%'+_0x54a231[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x2af93a;})});}_0x2163e2=_[_0x2779('0x41')]({},_0x2163e2,_0x54a231[_0x2779('0x4a')]);return db['CmHopperFinal'][_0x2779('0x20')]({'where':_0x2163e2[_0x2779('0x3e')]})[_0x2779('0x26')](function(_0xec2725){_0x32b16f['count']=_0xec2725;if(_0x54a231[_0x2779('0x34')]['includeAll']){_0x2163e2[_0x2779('0x42')]=[{'all':!![]}];}return db[_0x2779('0x62')]['findAll'](_0x2163e2);})['then'](function(_0x457072){_0x32b16f[_0x2779('0x44')]=_0x457072;return _0x32b16f;});}})['then'](respondWithFilteredResult(_0x9bf0e5,_0x2163e2))[_0x2779('0x45')](handleError(_0x9bf0e5,null));};exports[_0x2779('0x63')]=function(_0x3f2bae,_0x2906e9,_0x1df165){var _0x5b37a8={'raw':!![],'where':{}};var _0x42b8fd={};var _0x596df3={'count':0x0,'rows':[]};return db[_0x2779('0x31')][_0x2779('0x5b')]({'where':{'id':_0x3f2bae[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x2906e9,null))['then'](function(_0x37c7dd){if(_0x37c7dd){_0x42b8fd[_0x2779('0x36')]=_['keys'](db[_0x2779('0x64')][_0x2779('0x32')]);_0x42b8fd[_0x2779('0x34')]=_['keys'](_0x3f2bae[_0x2779('0x34')]);_0x42b8fd[_0x2779('0x35')]=_[_0x2779('0x38')](_0x42b8fd[_0x2779('0x36')],_0x42b8fd[_0x2779('0x34')]);_0x5b37a8['attributes']=_[_0x2779('0x38')](_0x42b8fd['model'],qs['fields'](_0x3f2bae[_0x2779('0x34')][_0x2779('0x39')]));_0x5b37a8[_0x2779('0x37')]=_0x5b37a8[_0x2779('0x37')][_0x2779('0x3a')]?_0x5b37a8[_0x2779('0x37')]:_0x42b8fd['model'];if(!_0x3f2bae[_0x2779('0x34')][_0x2779('0x3b')]('nolimit')){_0x5b37a8[_0x2779('0x1f')]=qs[_0x2779('0x1f')](_0x3f2bae[_0x2779('0x34')][_0x2779('0x1f')]);_0x5b37a8[_0x2779('0x1d')]=qs[_0x2779('0x1d')](_0x3f2bae[_0x2779('0x34')][_0x2779('0x1d')]);}_0x5b37a8[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x3f2bae[_0x2779('0x34')][_0x2779('0x3d')]);_0x5b37a8[_0x2779('0x3e')]=qs['filters'](_[_0x2779('0x3f')](_0x3f2bae[_0x2779('0x34')],_0x42b8fd[_0x2779('0x35')]));_0x5b37a8[_0x2779('0x3e')][_0x2779('0x5d')]=_0x37c7dd['id'];if(_0x3f2bae[_0x2779('0x34')][_0x2779('0x40')]){_0x5b37a8[_0x2779('0x3e')]=_[_0x2779('0x41')](_0x5b37a8['where'],{'$or':_[_0x2779('0x30')](_0x5b37a8[_0x2779('0x37')],function(_0x3aeef2){var _0x5b2981={};_0x5b2981[_0x3aeef2]={'$like':'%'+_0x3f2bae[_0x2779('0x34')]['filter']+'%'};return _0x5b2981;})});}_0x5b37a8=_[_0x2779('0x41')]({},_0x5b37a8,_0x3f2bae[_0x2779('0x4a')]);return db[_0x2779('0x64')][_0x2779('0x20')]({'where':_0x5b37a8['where']})[_0x2779('0x26')](function(_0x469b33){_0x596df3['count']=_0x469b33;if(_0x3f2bae[_0x2779('0x34')][_0x2779('0x49')]){_0x5b37a8[_0x2779('0x42')]=[{'all':!![]}];}return db[_0x2779('0x64')][_0x2779('0x43')](_0x5b37a8);})[_0x2779('0x26')](function(_0x2e5ebc){_0x596df3['rows']=_0x2e5ebc;return _0x596df3;});}})[_0x2779('0x26')](respondWithFilteredResult(_0x2906e9,_0x5b37a8))['catch'](handleError(_0x2906e9,null));};exports['getLists']=function(_0x11c7ba,_0x583f0e,_0x27a26e){var _0x5a5e41={};var _0x10bafc={};var _0xd42767;var _0x5e21f2;return db['Campaign'][_0x2779('0x5b')]({'where':{'id':_0x11c7ba[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x583f0e,null))[_0x2779('0x26')](function(_0x259b2f){if(_0x259b2f){_0xd42767=_0x259b2f;_0x10bafc[_0x2779('0x36')]=_[_0x2779('0x48')](db[_0x2779('0x65')][_0x2779('0x32')]);_0x10bafc['query']=_[_0x2779('0x48')](_0x11c7ba['query']);_0x10bafc[_0x2779('0x35')]=_[_0x2779('0x38')](_0x10bafc[_0x2779('0x36')],_0x10bafc[_0x2779('0x34')]);_0x5a5e41['attributes']=_[_0x2779('0x38')](_0x10bafc[_0x2779('0x36')],qs[_0x2779('0x39')](_0x11c7ba['query']['fields']));_0x5a5e41[_0x2779('0x37')]=_0x5a5e41['attributes']['length']?_0x5a5e41[_0x2779('0x37')]:_0x10bafc[_0x2779('0x36')];_0x5a5e41['order']=qs['sort'](_0x11c7ba[_0x2779('0x34')][_0x2779('0x3d')]);_0x5a5e41['where']=qs['filters'](_[_0x2779('0x3f')](_0x11c7ba[_0x2779('0x34')],_0x10bafc[_0x2779('0x35')]));if(_0x11c7ba[_0x2779('0x34')][_0x2779('0x40')]){_0x5a5e41[_0x2779('0x3e')]=_['merge'](_0x5a5e41[_0x2779('0x3e')],{'$or':_[_0x2779('0x30')](_0x5a5e41[_0x2779('0x37')],function(_0x568212){var _0x704b83={};_0x704b83[_0x568212]={'$like':'%'+_0x11c7ba[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x704b83;})});}_0x5a5e41=_[_0x2779('0x41')]({},_0x5a5e41,_0x11c7ba[_0x2779('0x4a')]);return _0xd42767[_0x2779('0x66')](_0x5a5e41);}})[_0x2779('0x26')](function(_0x23cfeb){if(_0x23cfeb){_0x5e21f2=_0x23cfeb[_0x2779('0x3a')];if(!_0x11c7ba[_0x2779('0x34')][_0x2779('0x3b')](_0x2779('0x60'))){_0x5a5e41[_0x2779('0x1f')]=qs[_0x2779('0x1f')](_0x11c7ba['query'][_0x2779('0x1f')]);_0x5a5e41[_0x2779('0x1d')]=qs['offset'](_0x11c7ba[_0x2779('0x34')][_0x2779('0x1d')]);}return _0xd42767[_0x2779('0x66')](_0x5a5e41);}})['then'](function(_0x17e53f){if(_0x17e53f){return _0x17e53f?{'count':_0x5e21f2,'rows':_0x17e53f}:null;}})[_0x2779('0x26')](respondWithResult(_0x583f0e,null))[_0x2779('0x45')](handleError(_0x583f0e,null));};exports[_0x2779('0x67')]=function(_0x24451c,_0x23e3e2,_0x1dfccd){var _0x1d1167,_0x47b241;return db[_0x2779('0x31')][_0x2779('0x4b')]({'where':{'id':_0x24451c[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x23e3e2,null))[_0x2779('0x26')](function(_0x409d51){if(_0x409d51){_0x47b241=_0x409d51;return _0x409d51[_0x2779('0x67')](_0x24451c['body'][_0x2779('0x68')],_[_0x2779('0x53')](_0x24451c[_0x2779('0x4d')],[_0x2779('0x68'),'id'])||{});}return null;})[_0x2779('0x69')](function(_0x315141){var _0x4fbf08;_0x1d1167=_0x315141||[];var _0x1b643c=[];if(_0x315141){for(var _0x2cc7b2=0x0;_0x2cc7b2<_0x315141['length'];_0x2cc7b2+=0x1){var _0x464df7=_0x315141[_0x2cc7b2]['get']({'plain':!![]});_0x47b241['dialCheckDuplicateType']=_0x24451c[_0x2779('0x4d')][_0x2779('0x6a')]?_0x24451c['body'][_0x2779('0x6a')]:_0x47b241[_0x2779('0x6a')];switch(_0x47b241['dialCheckDuplicateType']){case'always':_0x4fbf08=squel['insert']()[_0x2779('0x6b')](_0x2779('0x6c'))['fromQuery']([_0x2779('0x6d'),_0x2779('0x6e'),_0x2779('0x6f'),'ListId',_0x2779('0x5d'),'createdAt',_0x2779('0x55')],squel['select']()['field'](_0x2779('0x6d'),_0x2779('0x6d'))['field'](_0x2779('0x70'),'scheduledAt')['field']('id',_0x2779('0x6f'))[_0x2779('0x71')](_0x464df7['CmListId']['toString'](),'ListId')['field'](_0x24451c['params']['id'][_0x2779('0x72')](),_0x2779('0x5d'))[_0x2779('0x71')](_0x2779('0x70'),'createdAt')[_0x2779('0x71')]('NOW()',_0x2779('0x55'))[_0x2779('0x73')](_0x2779('0x74'))[_0x2779('0x3e')](_0x2779('0x75'))[_0x2779('0x3e')]('ListId\x20=\x20?',_0x464df7[_0x2779('0x76')]['toString']())[_0x2779('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x2779('0x3e')](_0x2779('0x77'),squel['select']()[_0x2779('0x71')](_0x2779('0x78'))[_0x2779('0x73')]('cm_hopper_final')[_0x2779('0x3e')](_0x2779('0x79'),_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')]()))['where'](_0x2779('0x77'),squel[_0x2779('0x7a')]()['field'](_0x2779('0x7b'))[_0x2779('0x73')](_0x2779('0x6c'))[_0x2779('0x3e')](_0x2779('0x79'),_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')]())))[_0x2779('0x72')]();break;case'onlyIfOpen':_0x4fbf08=squel[_0x2779('0x7c')]()[_0x2779('0x6b')](_0x2779('0x6c'))[_0x2779('0x7d')]([_0x2779('0x6d'),_0x2779('0x6e'),_0x2779('0x6f'),_0x2779('0x7e'),_0x2779('0x5d'),_0x2779('0x54'),_0x2779('0x55')],squel['select']()[_0x2779('0x71')](_0x2779('0x6d'),_0x2779('0x6d'))[_0x2779('0x71')](_0x2779('0x70'),'scheduledAt')[_0x2779('0x71')]('id',_0x2779('0x6f'))[_0x2779('0x71')](_0x464df7[_0x2779('0x76')]['toString'](),'ListId')[_0x2779('0x71')](_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')](),_0x2779('0x5d'))[_0x2779('0x71')](_0x2779('0x70'),'createdAt')['field']('NOW()',_0x2779('0x55'))['from'](_0x2779('0x74'))[_0x2779('0x3e')]('deletedAt\x20IS\x20NULL')[_0x2779('0x3e')]('ListId\x20=\x20?',_0x464df7['CmListId'][_0x2779('0x72')]())[_0x2779('0x3e')](_0x2779('0x7f'))[_0x2779('0x3e')](_0x2779('0x77'),squel['select']()['field'](_0x2779('0x7b'))[_0x2779('0x73')](_0x2779('0x6c'))[_0x2779('0x3e')](_0x2779('0x79'),_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')]())))[_0x2779('0x72')]();break;default:_0x4fbf08=squel[_0x2779('0x7c')]()['into'](_0x2779('0x6c'))['fromQuery']([_0x2779('0x6d'),'scheduledAt',_0x2779('0x6f'),_0x2779('0x7e'),_0x2779('0x5d'),_0x2779('0x54'),_0x2779('0x55')],squel[_0x2779('0x7a')]()[_0x2779('0x71')]('phone',_0x2779('0x6d'))[_0x2779('0x71')](_0x2779('0x70'),_0x2779('0x6e'))['field']('id',_0x2779('0x6f'))[_0x2779('0x71')](_0x464df7['CmListId'][_0x2779('0x72')](),_0x2779('0x7e'))[_0x2779('0x71')](_0x24451c[_0x2779('0x47')]['id'][_0x2779('0x72')](),_0x2779('0x5d'))[_0x2779('0x71')]('NOW()',_0x2779('0x54'))[_0x2779('0x71')]('NOW()',_0x2779('0x55'))[_0x2779('0x73')](_0x2779('0x74'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x2779('0x80'),_0x464df7['CmListId'][_0x2779('0x72')]())[_0x2779('0x3e')](_0x2779('0x7f')))[_0x2779('0x72')]();}_0x1b643c[_0x2779('0x81')](db[_0x2779('0x82')]['query'](_0x4fbf08));}return BPromise[_0x2779('0x83')](_0x1b643c);}})['then'](function(){return _0x1d1167;})['then'](respondWithResult(_0x23e3e2,null))['catch'](handleError(_0x23e3e2,null));};exports[_0x2779('0x84')]=function(_0x55f2eb,_0x5c4738,_0x29c619){return db[_0x2779('0x31')][_0x2779('0x4b')]({'where':{'id':_0x55f2eb[_0x2779('0x47')]['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x5c4738,null))[_0x2779('0x26')](function(_0x176423){if(_0x176423){return _0x176423[_0x2779('0x84')](_0x55f2eb[_0x2779('0x34')][_0x2779('0x68')]);}})['then'](function(_0x48e793){if(_0x48e793){return db[_0x2779('0x5c')][_0x2779('0x27')]({'where':{'ListId':_0x55f2eb['query'][_0x2779('0x68')],'CampaignId':_0x55f2eb[_0x2779('0x47')]['id']}})[_0x2779('0x26')](function(){return _0x48e793;});}})[_0x2779('0x26')](respondWithStatusCode(_0x5c4738,null))['catch'](handleError(_0x5c4738,null));};exports[_0x2779('0x85')]=function(_0x37ccd1,_0xd7f97e,_0x404c4d){var _0x76886d={};var _0xc8f55f={};var _0x3283e0;var _0x5b3437;return db[_0x2779('0x31')][_0x2779('0x5b')]({'where':{'id':_0x37ccd1['params']['id']}})[_0x2779('0x26')](handleEntityNotFound(_0xd7f97e,null))[_0x2779('0x26')](function(_0x127b37){if(_0x127b37){_0x3283e0=_0x127b37;_0xc8f55f['model']=_[_0x2779('0x48')](db[_0x2779('0x65')][_0x2779('0x32')]);_0xc8f55f['query']=_[_0x2779('0x48')](_0x37ccd1[_0x2779('0x34')]);_0xc8f55f[_0x2779('0x35')]=_['intersection'](_0xc8f55f['model'],_0xc8f55f[_0x2779('0x34')]);_0x76886d[_0x2779('0x37')]=_[_0x2779('0x38')](_0xc8f55f[_0x2779('0x36')],qs[_0x2779('0x39')](_0x37ccd1['query'][_0x2779('0x39')]));_0x76886d['attributes']=_0x76886d[_0x2779('0x37')]['length']?_0x76886d[_0x2779('0x37')]:_0xc8f55f[_0x2779('0x36')];_0x76886d[_0x2779('0x3c')]=qs[_0x2779('0x3d')](_0x37ccd1[_0x2779('0x34')]['sort']);_0x76886d[_0x2779('0x3e')]=qs['filters'](_['pick'](_0x37ccd1[_0x2779('0x34')],_0xc8f55f[_0x2779('0x35')]));if(_0x37ccd1[_0x2779('0x34')][_0x2779('0x40')]){_0x76886d[_0x2779('0x3e')]=_[_0x2779('0x41')](_0x76886d[_0x2779('0x3e')],{'$or':_[_0x2779('0x30')](_0x76886d['attributes'],function(_0x15a51f){var _0x689b92={};_0x689b92[_0x15a51f]={'$like':'%'+_0x37ccd1[_0x2779('0x34')][_0x2779('0x40')]+'%'};return _0x689b92;})});}_0x76886d=_['merge']({},_0x76886d,_0x37ccd1['options']);return _0x3283e0[_0x2779('0x85')](_0x76886d);}})[_0x2779('0x26')](function(_0x2d0a87){if(_0x2d0a87){_0x5b3437=_0x2d0a87[_0x2779('0x3a')];if(!_0x37ccd1[_0x2779('0x34')]['hasOwnProperty'](_0x2779('0x60'))){_0x76886d['limit']=qs[_0x2779('0x1f')](_0x37ccd1[_0x2779('0x34')][_0x2779('0x1f')]);_0x76886d['offset']=qs['offset'](_0x37ccd1['query']['offset']);}return _0x3283e0[_0x2779('0x85')](_0x76886d);}})['then'](function(_0x5a3ec8){if(_0x5a3ec8){return _0x5a3ec8?{'count':_0x5b3437,'rows':_0x5a3ec8}:null;}})['then'](respondWithResult(_0xd7f97e,null))['catch'](handleError(_0xd7f97e,null));};exports['addBlackLists']=function(_0xbf82b1,_0xc6e727,_0x4a8957){var _0x3b9d5e,_0x4ee401;return db[_0x2779('0x31')]['find']({'where':{'id':_0xbf82b1['params']['id']}})[_0x2779('0x26')](handleEntityNotFound(_0xc6e727,null))['then'](function(_0x58841c){if(_0x58841c){_0x4ee401=_0x58841c;return _0x58841c[_0x2779('0x86')](_0xbf82b1[_0x2779('0x4d')]['ids'],_[_0x2779('0x53')](_0xbf82b1[_0x2779('0x4d')],[_0x2779('0x68'),'id'])||{});}return null;})[_0x2779('0x69')](function(_0x5c8203){var _0x5be33e;_0x3b9d5e=_0x5c8203||[];var _0x37c8c7=[];if(_0x5c8203){for(var _0x51c6f5=0x0;_0x51c6f5<_0x5c8203[_0x2779('0x3a')];_0x51c6f5+=0x1){var _0x252b5a=_0x5c8203[_0x51c6f5]['get']({'plain':!![]});_0x5be33e=squel[_0x2779('0x7c')]()[_0x2779('0x6b')]('cm_hopper_black')['fromQuery']([_0x2779('0x6d'),_0x2779('0x6f'),'ListId',_0x2779('0x5d'),_0x2779('0x54'),'updatedAt'],squel[_0x2779('0x7a')]()['field'](_0x2779('0x6d'),'phone')['field']('id',_0x2779('0x6f'))[_0x2779('0x71')](_0x252b5a[_0x2779('0x76')][_0x2779('0x72')](),_0x2779('0x7e'))['field'](_0xbf82b1[_0x2779('0x47')]['id'][_0x2779('0x72')](),_0x2779('0x5d'))[_0x2779('0x71')](_0x2779('0x70'),_0x2779('0x54'))[_0x2779('0x71')](_0x2779('0x70'),_0x2779('0x55'))[_0x2779('0x73')]('cm_contacts')['where'](_0x2779('0x75'))[_0x2779('0x3e')](_0x2779('0x80'),_0x252b5a['CmListId'][_0x2779('0x72')]())['where'](_0x2779('0x7f')))['toString']();_0x37c8c7[_0x2779('0x81')](db[_0x2779('0x82')][_0x2779('0x34')](_0x5be33e));}return BPromise[_0x2779('0x83')](_0x37c8c7);}})[_0x2779('0x26')](function(){return _0x3b9d5e;})[_0x2779('0x26')](respondWithResult(_0xc6e727,null))[_0x2779('0x45')](handleError(_0xc6e727,null));};exports[_0x2779('0x87')]=function(_0x398ce7,_0x4a960d,_0x20753b){return db[_0x2779('0x31')][_0x2779('0x4b')]({'where':{'id':_0x398ce7['params']['id']}})[_0x2779('0x26')](handleEntityNotFound(_0x4a960d,null))[_0x2779('0x26')](function(_0x5eafab){if(_0x5eafab){return _0x5eafab[_0x2779('0x87')](_0x398ce7[_0x2779('0x34')][_0x2779('0x68')]);}})[_0x2779('0x26')](function(_0x34f9fc){if(_0x34f9fc){return db[_0x2779('0x64')][_0x2779('0x27')]({'where':{'ListId':_0x398ce7['query'][_0x2779('0x68')],'CampaignId':_0x398ce7['params']['id']}})[_0x2779('0x26')](function(){return _0x34f9fc;});}})[_0x2779('0x26')](respondWithStatusCode(_0x4a960d,null))['catch'](handleError(_0x4a960d,null));};
\ No newline at end of file
+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
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index c120076..b851e45 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(_0x221927,_0x1cd547){var _0x5c7399=function(_0x19b6ca){while(--_0x19b6ca){_0x221927['push'](_0x221927['shift']());}};_0x5c7399(++_0x1cd547);}(_0x7a54,0x106));var _0x47a5=function(_0x531d6f,_0x4fb825){_0x531d6f=_0x531d6f-0x0;var _0x2bdce7=_0x7a54[_0x531d6f];return _0x2bdce7;};'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(_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
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 3dab695..3f9297a 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 _0xc6d8=['request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','findAll','options','raw','model','attributes','map','include','then','GetCampaign','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x35ec9a,_0x174edd){var _0x491fa3=function(_0x45eea8){while(--_0x45eea8){_0x35ec9a['push'](_0x35ec9a['shift']());}};_0x491fa3(++_0x174edd);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x426cad,_0x45810d){_0x426cad=_0x426cad-0x0;var _0x50c00f=_0xc6d8[_0x426cad];return _0x50c00f;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Campaign,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['GetCampaign']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['Campaign'][_0x8c6d('0x13')]({'raw':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')][_0x8c6d('0x15')]===undefined?!![]:![]:!![],'where':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['where']||null:null,'attributes':_0x3e5495['options']?_0x3e5495[_0x8c6d('0x14')]['attributes']||null:null,'limit':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495['options']['limit']||null:null,'include':_0x3e5495[_0x8c6d('0x14')]?_0x3e5495[_0x8c6d('0x14')]['include']?_['map'](_0x3e5495['options']['include'],function(_0x2a85b5){return{'model':db[_0x2a85b5[_0x8c6d('0x16')]],'as':_0x2a85b5['as'],'attributes':_0x2a85b5[_0x8c6d('0x17')],'include':_0x2a85b5['include']?_[_0x8c6d('0x18')](_0x2a85b5['include'],function(_0x15a9c4){return{'model':db[_0x15a9c4['model']],'as':_0x15a9c4['as'],'attributes':_0x15a9c4[_0x8c6d('0x17')],'include':_0x15a9c4[_0x8c6d('0x19')]?_[_0x8c6d('0x18')](_0x15a9c4[_0x8c6d('0x19')],function(_0x1e6755){return{'model':db[_0x1e6755[_0x8c6d('0x16')]],'as':_0x1e6755['as'],'attributes':_0x1e6755[_0x8c6d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x8c6d('0x1a')](function(_0x3eab38){logger['info']('GetCampaign',_0x3e5495);logger[_0x8c6d('0xd')](_0x8c6d('0x1b'),_0x3e5495,JSON[_0x8c6d('0xf')](_0x3eab38));_0x4c2f8d(_0x3eab38);})[_0x8c6d('0x12')](function(_0x370626){logger[_0x8c6d('0x10')](_0x8c6d('0x1b'),_0x370626[_0x8c6d('0x11')],_0x3e5495);_0x21b8ee(_0x5a22de[_0x8c6d('0x10')](0x1f4,_0x370626[_0x8c6d('0x11')]));});});};
\ No newline at end of file
+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
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 7b1f9bd..1f37205 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 _0x9aee=['../../components/auth/service','../../components/interaction/service','isAuthenticated','/:id','show','get','getHoppers','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addBlackLists','put','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x24a863,_0x255d66){var _0x564910=function(_0x3d59d){while(--_0x3d59d){_0x24a863['push'](_0x24a863['shift']());}};_0x564910(++_0x255d66);}(_0x9aee,0x71));var _0xe9ae=function(_0x515d8c,_0x305407){_0x515d8c=_0x515d8c-0x0;var _0x1297e7=_0x9aee[_0x515d8c];return _0x1297e7;};'use strict';var multer=require(_0xe9ae('0x0'));var util=require(_0xe9ae('0x1'));var path=require(_0xe9ae('0x2'));var timeout=require(_0xe9ae('0x3'));var express=require(_0xe9ae('0x4'));var router=express[_0xe9ae('0x5')]();var fs_extra=require(_0xe9ae('0x6'));var auth=require(_0xe9ae('0x7'));var interaction=require(_0xe9ae('0x8'));var config=require('../../config/environment');var controller=require('./campaign.controller');router['get']('/',auth[_0xe9ae('0x9')](),controller['index']);router['get'](_0xe9ae('0xa'),auth['isAuthenticated'](),controller[_0xe9ae('0xb')]);router[_0xe9ae('0xc')]('/:id/hoppers',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0xd')]);router[_0xe9ae('0xc')]('/:id/hopper_histories',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0xe')]);router[_0xe9ae('0xc')]('/:id/hopper_finals',auth[_0xe9ae('0x9')](),controller['getHopperFinals']);router[_0xe9ae('0xc')](_0xe9ae('0xf'),auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x10')]);router[_0xe9ae('0xc')](_0xe9ae('0x11'),auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x12')]);router['get'](_0xe9ae('0x13'),auth[_0xe9ae('0x9')](),controller['getBlackLists']);router[_0xe9ae('0x14')]('/',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x15')]);router[_0xe9ae('0x14')](_0xe9ae('0x16'),auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x17')]);router[_0xe9ae('0x14')](_0xe9ae('0x11'),auth['isAuthenticated'](),controller['addLists']);router[_0xe9ae('0x14')]('/:id/blacklists',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x18')]);router[_0xe9ae('0x19')](_0xe9ae('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe9ae('0xa'),auth[_0xe9ae('0x9')](),controller['destroy']);router[_0xe9ae('0x1a')]('/:id/lists',auth[_0xe9ae('0x9')](),controller[_0xe9ae('0x1b')]);router[_0xe9ae('0x1a')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xe9ae('0x1c')]);module[_0xe9ae('0x1d')]=router;
\ No newline at end of file
+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
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 485b78e..4f87492 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 _0xe94f=['key','sequelize','exports','STRING','VIRTUAL'];(function(_0x2b9075,_0x25b39c){var _0x256ac2=function(_0x388e28){while(--_0x388e28){_0x2b9075['push'](_0x2b9075['shift']());}};_0x256ac2(++_0x25b39c);}(_0xe94f,0x178));var _0xfe94=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0xe94f[_0x51e79c];return _0x2467be;};'use strict';var Sequelize=require(_0xfe94('0x0'));module[_0xfe94('0x1')]={'key':{'type':Sequelize[_0xfe94('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xfe94('0x2')]},'name':{'type':Sequelize[_0xfe94('0x3')],'get':function(){return this['getDataValue'](_0xfe94('0x4'));}}};
\ No newline at end of file
+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
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1567ddc..393c727 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 _0x29dd=['../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','stack','name','index','map','CannedAnswer','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','includeAll','findAll','rows','catch','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','error','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x29dd,0x13d));var _0xd29d=function(_0x2bea1d,_0xc4d88a){_0x2bea1d=_0x2bea1d-0x0;var _0x22cee5=_0x29dd[_0x2bea1d];return _0x22cee5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd29d('0x0'));var zipdir=require(_0xd29d('0x1'));var jsonpatch=require(_0xd29d('0x2'));var rp=require(_0xd29d('0x3'));var moment=require('moment');var BPromise=require(_0xd29d('0x4'));var Mustache=require(_0xd29d('0x5'));var util=require(_0xd29d('0x6'));var path=require(_0xd29d('0x7'));var sox=require(_0xd29d('0x8'));var csv=require(_0xd29d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd29d('0xa'));var _=require(_0xd29d('0xb'));var squel=require(_0xd29d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd29d('0xd'));var toCsv=require(_0xd29d('0x9'));var querystring=require(_0xd29d('0xe'));var Papa=require(_0xd29d('0xf'));var Redis=require(_0xd29d('0x10'));var authService=require(_0xd29d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd29d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd29d('0x13'));var utils=require(_0xd29d('0x14'));var config=require(_0xd29d('0x15'));var licenseUtil=require(_0xd29d('0x16'));var db=require(_0xd29d('0x17'))['db'];function respondWithStatusCode(_0x5b77cc,_0x212076){_0x212076=_0x212076||0xcc;return function(_0x1c41c9){if(_0x1c41c9){return _0x5b77cc['sendStatus'](_0x212076);}return _0x5b77cc[_0xd29d('0x18')](_0x212076)[_0xd29d('0x19')]();};}function respondWithResult(_0xbf4306,_0x3ae90f){_0x3ae90f=_0x3ae90f||0xc8;return function(_0x5b3727){if(_0x5b3727){return _0xbf4306[_0xd29d('0x18')](_0x3ae90f)[_0xd29d('0x1a')](_0x5b3727);}};}function respondWithFilteredResult(_0x3ddb24,_0x4e9ae1){return function(_0x1f96fb){if(_0x1f96fb){var _0x12855e=typeof _0x4e9ae1[_0xd29d('0x1b')]===_0xd29d('0x1c')&&typeof _0x4e9ae1[_0xd29d('0x1d')]===_0xd29d('0x1c');var _0x587c97=_0x1f96fb[_0xd29d('0x1e')];var _0x1d90ee=_0x12855e?0x0:_0x4e9ae1[_0xd29d('0x1b')];var _0x2e7897=_0x12855e?_0x1f96fb[_0xd29d('0x1e')]:_0x4e9ae1[_0xd29d('0x1b')]+_0x4e9ae1['limit'];var _0x30bdd5;if(_0x2e7897>=_0x587c97){_0x2e7897=_0x587c97;_0x30bdd5=0xc8;}else{_0x30bdd5=0xce;}_0x3ddb24[_0xd29d('0x18')](_0x30bdd5);return _0x3ddb24[_0xd29d('0x1f')](_0xd29d('0x20'),_0x1d90ee+'-'+_0x2e7897+'/'+_0x587c97)[_0xd29d('0x1a')](_0x1f96fb);}return null;};}function patchUpdates(_0x4be369){return function(_0x4558ca){try{jsonpatch[_0xd29d('0x21')](_0x4558ca,_0x4be369,!![]);}catch(_0x4a9541){return BPromise[_0xd29d('0x22')](_0x4a9541);}return _0x4558ca['save']();};}function saveUpdates(_0x1645ee,_0x5c3507){return function(_0x23d78c){if(_0x23d78c){return _0x23d78c[_0xd29d('0x23')](_0x1645ee)[_0xd29d('0x24')](function(_0x1cd80b){return _0x1cd80b;});}return null;};}function removeEntity(_0x352fab,_0x682fd2){return function(_0x367767){if(_0x367767){return _0x367767[_0xd29d('0x25')]()[_0xd29d('0x24')](function(){var _0x4a755b=_0x367767[_0xd29d('0x26')]({'plain':!![]});var _0x2bef3f='CannedAnswers';return db['UserProfileResource'][_0xd29d('0x25')]({'where':{'type':_0x2bef3f,'resourceId':_0x4a755b['id']}})[_0xd29d('0x24')](function(){return _0x367767;});})[_0xd29d('0x24')](function(){_0x352fab[_0xd29d('0x18')](0xcc)[_0xd29d('0x19')]();});}};}function handleEntityNotFound(_0x2ee346,_0x59e7d6){return function(_0x1e4bba){if(!_0x1e4bba){_0x2ee346['sendStatus'](0x194);}return _0x1e4bba;};}function handleError(_0x242517,_0x129bdf){_0x129bdf=_0x129bdf||0x1f4;return function(_0x2f6d82){logger['error'](_0x2f6d82[_0xd29d('0x27')]);if(_0x2f6d82[_0xd29d('0x28')]){delete _0x2f6d82['name'];}_0x242517[_0xd29d('0x18')](_0x129bdf)['send'](_0x2f6d82);};}exports[_0xd29d('0x29')]=function(_0x52421f,_0x41f563){var _0x128d1c={},_0x194fca={},_0x3ea0a8={'count':0x0,'rows':[]};var _0x1ec288=_[_0xd29d('0x2a')](db[_0xd29d('0x2b')][_0xd29d('0x2c')],function(_0x2ca882){return{'name':_0x2ca882['fieldName'],'type':_0x2ca882[_0xd29d('0x2d')]['key']};});_0x194fca[_0xd29d('0x2e')]=_['map'](_0x1ec288,'name');_0x194fca[_0xd29d('0x2f')]=_[_0xd29d('0x30')](_0x52421f['query']);_0x194fca[_0xd29d('0x31')]=_[_0xd29d('0x32')](_0x194fca[_0xd29d('0x2e')],_0x194fca[_0xd29d('0x2f')]);_0x128d1c['attributes']=_[_0xd29d('0x32')](_0x194fca[_0xd29d('0x2e')],qs[_0xd29d('0x33')](_0x52421f[_0xd29d('0x2f')][_0xd29d('0x33')]));_0x128d1c['attributes']=_0x128d1c[_0xd29d('0x34')][_0xd29d('0x35')]?_0x128d1c[_0xd29d('0x34')]:_0x194fca['model'];if(!_0x52421f['query'][_0xd29d('0x36')](_0xd29d('0x37'))){_0x128d1c[_0xd29d('0x1d')]=qs[_0xd29d('0x1d')](_0x52421f['query'][_0xd29d('0x1d')]);_0x128d1c[_0xd29d('0x1b')]=qs[_0xd29d('0x1b')](_0x52421f[_0xd29d('0x2f')][_0xd29d('0x1b')]);}_0x128d1c[_0xd29d('0x38')]=qs[_0xd29d('0x39')](_0x52421f[_0xd29d('0x2f')][_0xd29d('0x39')]);_0x128d1c['where']=qs['filters'](_['pick'](_0x52421f[_0xd29d('0x2f')],_0x194fca[_0xd29d('0x31')]),_0x1ec288);if(_0x52421f[_0xd29d('0x2f')][_0xd29d('0x3a')]){_0x128d1c['where']=_[_0xd29d('0x3b')](_0x128d1c[_0xd29d('0x3c')],{'$or':[{'key':{'$like':'%'+_0x52421f[_0xd29d('0x2f')]['filter']+'%'}},{'value':{'$like':'%'+_0x52421f['query'][_0xd29d('0x3a')]+'%'}}]});}_0x128d1c=_[_0xd29d('0x3b')]({},_0x128d1c,_0x52421f[_0xd29d('0x3d')]);var _0x16469e={'where':_0x128d1c[_0xd29d('0x3c')]};return db['CannedAnswer'][_0xd29d('0x1e')](_0x16469e)[_0xd29d('0x24')](function(_0x2cef3d){_0x3ea0a8[_0xd29d('0x1e')]=_0x2cef3d;if(_0x52421f['query'][_0xd29d('0x3e')]){_0x128d1c['include']=[{'all':!![]}];}return db[_0xd29d('0x2b')][_0xd29d('0x3f')](_0x128d1c);})[_0xd29d('0x24')](function(_0x307fd9){_0x3ea0a8[_0xd29d('0x40')]=_0x307fd9;return _0x3ea0a8;})[_0xd29d('0x24')](respondWithFilteredResult(_0x41f563,_0x128d1c))[_0xd29d('0x41')](handleError(_0x41f563,null));};exports['show']=function(_0x417e7f,_0x14b636){var _0x4ae26d={'raw':!![],'where':{'id':_0x417e7f[_0xd29d('0x42')]['id']}},_0x2e3e4a={};_0x2e3e4a[_0xd29d('0x2e')]=_[_0xd29d('0x30')](db[_0xd29d('0x2b')][_0xd29d('0x2c')]);_0x2e3e4a['query']=_['keys'](_0x417e7f[_0xd29d('0x2f')]);_0x2e3e4a['filters']=_[_0xd29d('0x32')](_0x2e3e4a[_0xd29d('0x2e')],_0x2e3e4a[_0xd29d('0x2f')]);_0x4ae26d['attributes']=_[_0xd29d('0x32')](_0x2e3e4a[_0xd29d('0x2e')],qs['fields'](_0x417e7f[_0xd29d('0x2f')][_0xd29d('0x33')]));_0x4ae26d[_0xd29d('0x34')]=_0x4ae26d[_0xd29d('0x34')]['length']?_0x4ae26d['attributes']:_0x2e3e4a[_0xd29d('0x2e')];if(_0x417e7f[_0xd29d('0x2f')][_0xd29d('0x3e')]){_0x4ae26d[_0xd29d('0x43')]=[{'all':!![]}];}_0x4ae26d=_[_0xd29d('0x3b')]({},_0x4ae26d,_0x417e7f[_0xd29d('0x3d')]);return db[_0xd29d('0x2b')][_0xd29d('0x44')](_0x4ae26d)['then'](handleEntityNotFound(_0x14b636,null))[_0xd29d('0x24')](respondWithResult(_0x14b636,null))['catch'](handleError(_0x14b636,null));};exports[_0xd29d('0x23')]=function(_0x379837,_0x1a533d){if(_0x379837['body']['id']){delete _0x379837[_0xd29d('0x45')]['id'];}return db[_0xd29d('0x2b')][_0xd29d('0x44')]({'where':{'id':_0x379837['params']['id']}})[_0xd29d('0x24')](handleEntityNotFound(_0x1a533d,null))[_0xd29d('0x24')](saveUpdates(_0x379837[_0xd29d('0x45')],null))[_0xd29d('0x24')](respondWithResult(_0x1a533d,null))['catch'](handleError(_0x1a533d,null));};exports['destroy']=function(_0x532817,_0x2999d6){return db[_0xd29d('0x2b')][_0xd29d('0x44')]({'where':{'id':_0x532817[_0xd29d('0x42')]['id']}})[_0xd29d('0x24')](handleEntityNotFound(_0x2999d6,null))[_0xd29d('0x24')](removeEntity(_0x2999d6,null))[_0xd29d('0x41')](handleError(_0x2999d6,null));};exports[_0xd29d('0x46')]=function(_0x4de7f5,_0x4e0465){var _0x386f5d={'key':_0x4de7f5[_0xd29d('0x45')]['key']};if(_0x4de7f5[_0xd29d('0x45')]['MailAccountId']){_0x386f5d[_0xd29d('0x47')]=_0x4de7f5[_0xd29d('0x45')][_0xd29d('0x47')];}else if(_0x4de7f5[_0xd29d('0x45')]['SmsAccountId']){_0x386f5d[_0xd29d('0x48')]=_0x4de7f5['body']['SmsAccountId'];}else if(_0x4de7f5[_0xd29d('0x45')]['OpenchannelAccountId']){_0x386f5d['OpenchannelAccountId']=_0x4de7f5[_0xd29d('0x45')][_0xd29d('0x49')];}else if(_0x4de7f5[_0xd29d('0x45')][_0xd29d('0x4a')]){_0x386f5d[_0xd29d('0x4a')]=_0x4de7f5[_0xd29d('0x45')][_0xd29d('0x4a')];}return db[_0xd29d('0x2b')][_0xd29d('0x44')]({'where':_0x386f5d})[_0xd29d('0x24')](function(_0xa66974){if(_0xa66974){throw new db[(_0xd29d('0x4b'))][(_0xd29d('0x4c'))](_0xd29d('0x4d'));}return db[_0xd29d('0x2b')]['create'](_0x4de7f5[_0xd29d('0x45')]);})['then'](function(_0x46bb3d){var _0x153c11=_0x4de7f5[_0xd29d('0x4e')][_0xd29d('0x26')]({'plain':!![]});if(!_0x153c11)throw new Error(_0xd29d('0x4f'));if(_0x153c11[_0xd29d('0x50')]==='user'){var _0x190b63=_0x46bb3d[_0xd29d('0x26')]({'plain':!![]});return db[_0xd29d('0x51')][_0xd29d('0x44')]({'where':{'name':_0xd29d('0x52'),'userProfileId':_0x153c11[_0xd29d('0x53')]},'raw':!![]})[_0xd29d('0x24')](function(_0x1a50db){if(_0x1a50db&&_0x1a50db['autoAssociation']===0x0){return db['UserProfileResource'][_0xd29d('0x46')]({'name':_0x190b63[_0xd29d('0x28')],'resourceId':_0x190b63['id'],'type':_0x1a50db['name'],'sectionId':_0x1a50db['id']},{})[_0xd29d('0x24')](function(){return _0x46bb3d;});}else{return _0x46bb3d;}})['catch'](function(_0x431120){logger[_0xd29d('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x431120);throw _0x431120;});}return _0x46bb3d;})[_0xd29d('0x24')](respondWithResult(_0x4e0465,0xc9))['catch'](handleError(_0x4e0465,null));};
\ No newline at end of file
+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
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index fc7cbae..c90cb26 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 _0xdc78=['moment','request-promise','path','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x3761c6,_0x2a5f2f){var _0x16ec0b=function(_0x1c04a3){while(--_0x1c04a3){_0x3761c6['push'](_0x3761c6['shift']());}};_0x16ec0b(++_0x2a5f2f);}(_0xdc78,0x14d));var _0x8dc7=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0xdc78[_0x5d860f];return _0x236490;};'use strict';var _=require(_0x8dc7('0x0'));var util=require('util');var logger=require(_0x8dc7('0x1'))(_0x8dc7('0x2'));var moment=require(_0x8dc7('0x3'));var BPromise=require('bluebird');var rp=require(_0x8dc7('0x4'));var fs=require('fs');var path=require(_0x8dc7('0x5'));var rimraf=require('rimraf');var config=require(_0x8dc7('0x6'));var attributes=require(_0x8dc7('0x7'));module['exports']=function(_0x44088c,_0x3ad5db){return _0x44088c[_0x8dc7('0x8')](_0x8dc7('0x9'),attributes,{'tableName':_0x8dc7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8dc7('0xb')});};
\ No newline at end of file
+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
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 4abe925..daf79eb 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(_0x46cece,_0x1729fd){var _0x382eea=function(_0x251d3b){while(--_0x251d3b){_0x46cece['push'](_0x46cece['shift']());}};_0x382eea(++_0x1729fd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_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
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index a4f7334..c9deef4 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 _0xe488=['./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3d3d96,_0x28998e){var _0x2e479a=function(_0x1349ba){while(--_0x1349ba){_0x3d3d96['push'](_0x3d3d96['shift']());}};_0x2e479a(++_0x28998e);}(_0xe488,0x19a));var _0x8e48=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xe488[_0x43aee5];return _0x76d1d0;};'use strict';var multer=require(_0x8e48('0x0'));var util=require(_0x8e48('0x1'));var path=require(_0x8e48('0x2'));var timeout=require('connect-timeout');var express=require(_0x8e48('0x3'));var router=express[_0x8e48('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8e48('0x5'));var interaction=require(_0x8e48('0x6'));var config=require(_0x8e48('0x7'));var controller=require(_0x8e48('0x8'));router[_0x8e48('0x9')]('/',auth[_0x8e48('0xa')](),controller[_0x8e48('0xb')]);router[_0x8e48('0x9')](_0x8e48('0xc'),auth[_0x8e48('0xa')](),controller['show']);router[_0x8e48('0xd')]('/',auth[_0x8e48('0xa')](),controller[_0x8e48('0xe')]);router[_0x8e48('0xf')](_0x8e48('0xc'),auth['isAuthenticated'](),controller[_0x8e48('0x10')]);router[_0x8e48('0x11')](_0x8e48('0xc'),auth[_0x8e48('0xa')](),controller[_0x8e48('0x12')]);module['exports']=router;
\ No newline at end of file
+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
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 07674ba..4dcf6cd 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 _0x6584=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x318abe,_0x48c571){var _0x28f734=function(_0x27bac8){while(--_0x27bac8){_0x318abe['push'](_0x318abe['shift']());}};_0x28f734(++_0x48c571);}(_0x6584,0x175));var _0x4658=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x6584[_0x32b993];return _0x482780;};'use strict';var Sequelize=require(_0x4658('0x0'));module[_0x4658('0x1')]={'calldate':{'type':Sequelize[_0x4658('0x2')],'allowNull':![],'defaultValue':_0x4658('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x4658('0x4')]},'dst':{'type':Sequelize[_0x4658('0x4')]},'dcontext':{'type':Sequelize[_0x4658('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x4658('0x4')]},'lastdata':{'type':Sequelize[_0x4658('0x4')]},'duration':{'type':Sequelize[_0x4658('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x4658('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4658('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4658('0x4')]},'userfield':{'type':Sequelize[_0x4658('0x4')]},'uniqueid':{'type':Sequelize[_0x4658('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x4658('0x4')]},'peeraccount':{'type':Sequelize[_0x4658('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+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
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index ee60b21..7d21124 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 _0xf006=['fieldName','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','destroy','describe','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0xf006,0x146));var _0x6f00=function(_0x50723d,_0x1f48eb){_0x50723d=_0x50723d-0x0;var _0x3a1534=_0xf006[_0x50723d];return _0x3a1534;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f00('0x0'));var jsonpatch=require(_0x6f00('0x1'));var rp=require('request-promise');var moment=require(_0x6f00('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6f00('0x3'));var util=require('util');var path=require('path');var sox=require(_0x6f00('0x4'));var csv=require(_0x6f00('0x5'));var ejs=require(_0x6f00('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f00('0x7'));var squel=require('squel');var crypto=require(_0x6f00('0x8'));var jsforce=require(_0x6f00('0x9'));var deskjs=require(_0x6f00('0xa'));var toCsv=require(_0x6f00('0x5'));var querystring=require(_0x6f00('0xb'));var Papa=require(_0x6f00('0xc'));var Redis=require(_0x6f00('0xd'));var authService=require(_0x6f00('0xe'));var qs=require(_0x6f00('0xf'));var as=require(_0x6f00('0x10'));var hardwareService=require(_0x6f00('0x11'));var logger=require(_0x6f00('0x12'))(_0x6f00('0x13'));var utils=require('../../config/utils');var config=require(_0x6f00('0x14'));var licenseUtil=require(_0x6f00('0x15'));var db=require(_0x6f00('0x16'))['db'];function respondWithStatusCode(_0x36a2ec,_0x289fe9){_0x289fe9=_0x289fe9||0xcc;return function(_0x5e3264){if(_0x5e3264){return _0x36a2ec[_0x6f00('0x17')](_0x289fe9);}return _0x36a2ec['status'](_0x289fe9)[_0x6f00('0x18')]();};}function respondWithResult(_0x5047f5,_0x324e67){_0x324e67=_0x324e67||0xc8;return function(_0x220e68){if(_0x220e68){return _0x5047f5[_0x6f00('0x19')](_0x324e67)[_0x6f00('0x1a')](_0x220e68);}};}function respondWithFilteredResult(_0xa6e7a1,_0x411203){return function(_0x46bc2c){if(_0x46bc2c){var _0x4d8aee=typeof _0x411203[_0x6f00('0x1b')]==='undefined'&&typeof _0x411203[_0x6f00('0x1c')]==='undefined';var _0x534275=_0x46bc2c[_0x6f00('0x1d')];var _0x6cf83f=_0x4d8aee?0x0:_0x411203[_0x6f00('0x1b')];var _0x340f78=_0x4d8aee?_0x46bc2c[_0x6f00('0x1d')]:_0x411203[_0x6f00('0x1b')]+_0x411203[_0x6f00('0x1c')];var _0x295640;if(_0x340f78>=_0x534275){_0x340f78=_0x534275;_0x295640=0xc8;}else{_0x295640=0xce;}_0xa6e7a1[_0x6f00('0x19')](_0x295640);return _0xa6e7a1[_0x6f00('0x1e')](_0x6f00('0x1f'),_0x6cf83f+'-'+_0x340f78+'/'+_0x534275)[_0x6f00('0x1a')](_0x46bc2c);}return null;};}function patchUpdates(_0x4e11de){return function(_0x4f3031){try{jsonpatch['apply'](_0x4f3031,_0x4e11de,!![]);}catch(_0x2a5286){return BPromise[_0x6f00('0x20')](_0x2a5286);}return _0x4f3031[_0x6f00('0x21')]();};}function saveUpdates(_0x57340f,_0xe301e5){return function(_0x9066ff){if(_0x9066ff){return _0x9066ff[_0x6f00('0x22')](_0x57340f)[_0x6f00('0x23')](function(_0x388983){return _0x388983;});}return null;};}function removeEntity(_0x1cbf1c,_0x90d74c){return function(_0x1ea061){if(_0x1ea061){return _0x1ea061['destroy']()[_0x6f00('0x23')](function(){_0x1cbf1c[_0x6f00('0x19')](0xcc)[_0x6f00('0x18')]();});}};}function handleEntityNotFound(_0x4d41ef,_0x37f062){return function(_0x4f7e29){if(!_0x4f7e29){_0x4d41ef[_0x6f00('0x17')](0x194);}return _0x4f7e29;};}function handleError(_0x511293,_0x434735){_0x434735=_0x434735||0x1f4;return function(_0x39375d){logger[_0x6f00('0x24')](_0x39375d[_0x6f00('0x25')]);if(_0x39375d[_0x6f00('0x26')]){delete _0x39375d['name'];}_0x511293[_0x6f00('0x19')](_0x434735)[_0x6f00('0x27')](_0x39375d);};}exports[_0x6f00('0x28')]=function(_0x4366a4,_0x2671fe){var _0x235a86={},_0xff36ce={},_0x451849={'count':0x0,'rows':[]};var _0x22f107=_[_0x6f00('0x29')](db[_0x6f00('0x2a')][_0x6f00('0x2b')],function(_0x29555d){return{'name':_0x29555d[_0x6f00('0x2c')],'type':_0x29555d['type']['key']};});_0xff36ce['model']=_['map'](_0x22f107,'name');_0xff36ce['query']=_[_0x6f00('0x2d')](_0x4366a4['query']);_0xff36ce[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0xff36ce[_0x6f00('0x30')],_0xff36ce[_0x6f00('0x31')]);_0x235a86[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0xff36ce['model'],qs[_0x6f00('0x33')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x33')]));_0x235a86[_0x6f00('0x32')]=_0x235a86[_0x6f00('0x32')]['length']?_0x235a86['attributes']:_0xff36ce['model'];if(!_0x4366a4[_0x6f00('0x31')][_0x6f00('0x34')](_0x6f00('0x35'))){_0x235a86[_0x6f00('0x1c')]=qs[_0x6f00('0x1c')](_0x4366a4['query'][_0x6f00('0x1c')]);_0x235a86[_0x6f00('0x1b')]=qs[_0x6f00('0x1b')](_0x4366a4[_0x6f00('0x31')][_0x6f00('0x1b')]);}_0x235a86[_0x6f00('0x36')]=qs[_0x6f00('0x37')](_0x4366a4['query'][_0x6f00('0x37')]);_0x235a86[_0x6f00('0x38')]=qs[_0x6f00('0x2e')](_['pick'](_0x4366a4[_0x6f00('0x31')],_0xff36ce[_0x6f00('0x2e')]),_0x22f107);if(_0x4366a4[_0x6f00('0x31')]['filter']){_0x235a86[_0x6f00('0x38')]=_['merge'](_0x235a86[_0x6f00('0x38')],{'$or':_['map'](_0x22f107,function(_0x3dc8e3){if(_0x3dc8e3[_0x6f00('0x39')]!==_0x6f00('0x3a')){var _0x896b3f={};_0x896b3f[_0x3dc8e3['name']]={'$like':'%'+_0x4366a4[_0x6f00('0x31')]['filter']+'%'};return _0x896b3f;}})});}_0x235a86=_[_0x6f00('0x3b')]({},_0x235a86,_0x4366a4['options']);var _0x7785e1={'where':_0x235a86[_0x6f00('0x38')]};return db[_0x6f00('0x2a')][_0x6f00('0x1d')](_0x7785e1)['then'](function(_0x53dc8c){_0x451849[_0x6f00('0x1d')]=_0x53dc8c;if(_0x4366a4['query'][_0x6f00('0x3c')]){_0x235a86[_0x6f00('0x3d')]=[{'all':!![]}];}return db['Cdr'][_0x6f00('0x3e')](_0x235a86);})['then'](function(_0x4cac2c){_0x451849[_0x6f00('0x3f')]=_0x4cac2c;return _0x451849;})[_0x6f00('0x23')](respondWithFilteredResult(_0x2671fe,_0x235a86))[_0x6f00('0x40')](handleError(_0x2671fe,null));};exports[_0x6f00('0x41')]=function(_0x56399a,_0x38ee25){var _0x4523f2={'raw':!![],'where':{'id':_0x56399a[_0x6f00('0x42')]['id']}},_0x2bb5aa={};_0x2bb5aa[_0x6f00('0x30')]=_[_0x6f00('0x2d')](db['Cdr'][_0x6f00('0x2b')]);_0x2bb5aa[_0x6f00('0x31')]=_[_0x6f00('0x2d')](_0x56399a[_0x6f00('0x31')]);_0x2bb5aa[_0x6f00('0x2e')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],_0x2bb5aa[_0x6f00('0x31')]);_0x4523f2[_0x6f00('0x32')]=_[_0x6f00('0x2f')](_0x2bb5aa['model'],qs[_0x6f00('0x33')](_0x56399a['query'][_0x6f00('0x33')]));_0x4523f2[_0x6f00('0x32')]=_0x4523f2['attributes'][_0x6f00('0x43')]?_0x4523f2['attributes']:_0x2bb5aa[_0x6f00('0x30')];if(_0x56399a[_0x6f00('0x31')][_0x6f00('0x3c')]){_0x4523f2[_0x6f00('0x3d')]=[{'all':!![]}];}_0x4523f2=_['merge']({},_0x4523f2,_0x56399a[_0x6f00('0x44')]);return db['Cdr'][_0x6f00('0x45')](_0x4523f2)['then'](handleEntityNotFound(_0x38ee25,null))[_0x6f00('0x23')](respondWithResult(_0x38ee25,null))[_0x6f00('0x40')](handleError(_0x38ee25,null));};exports[_0x6f00('0x46')]=function(_0x9b003,_0x470ff3){return db[_0x6f00('0x2a')][_0x6f00('0x46')](_0x9b003[_0x6f00('0x47')],{})['then'](respondWithResult(_0x470ff3,0xc9))[_0x6f00('0x40')](handleError(_0x470ff3,null));};exports['update']=function(_0x265666,_0x31fb17){if(_0x265666[_0x6f00('0x47')]['id']){delete _0x265666['body']['id'];}return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x265666[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x31fb17,null))[_0x6f00('0x23')](saveUpdates(_0x265666['body'],null))[_0x6f00('0x23')](respondWithResult(_0x31fb17,null))['catch'](handleError(_0x31fb17,null));};exports[_0x6f00('0x48')]=function(_0x222b4c,_0x4c6e06){return db['Cdr'][_0x6f00('0x45')]({'where':{'id':_0x222b4c[_0x6f00('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c6e06,null))[_0x6f00('0x23')](removeEntity(_0x4c6e06,null))['catch'](handleError(_0x4c6e06,null));};exports[_0x6f00('0x49')]=function(_0x7f80ed,_0x3100ee){return db[_0x6f00('0x2a')][_0x6f00('0x49')]()[_0x6f00('0x23')](respondWithResult(_0x3100ee,null))[_0x6f00('0x40')](handleError(_0x3100ee,null));};
\ No newline at end of file
+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
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index fa45554..ea592c8 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x51ebc4,_0x2a4d0e){var _0x4dba4d=function(_0x54daaa){while(--_0x54daaa){_0x51ebc4['push'](_0x51ebc4['shift']());}};_0x4dba4d(++_0x2a4d0e);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _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
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 6487303..7be0bf1 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 _0x62b9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','Cdr,\x20%s,\x20%s','result','catch','util','bluebird'];(function(_0x200e46,_0x5acacf){var _0x18467d=function(_0x30e26a){while(--_0x30e26a){_0x200e46['push'](_0x200e46['shift']());}};_0x18467d(++_0x5acacf);}(_0x62b9,0xa9));var _0x962b=function(_0xf0b34,_0x1dd2da){_0xf0b34=_0xf0b34-0x0;var _0x35e678=_0x62b9[_0xf0b34];return _0x35e678;};'use strict';var _=require('lodash');var util=require(_0x962b('0x0'));var moment=require('moment');var BPromise=require(_0x962b('0x1'));var rs=require(_0x962b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x962b('0x3'))['db'];var utils=require(_0x962b('0x4'));var logger=require(_0x962b('0x5'))(_0x962b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46d6c7,_0x46d1d4,_0xd40ced){return new BPromise(function(_0x458254,_0x5be397){return client[_0x962b('0x7')](_0x46d6c7,_0xd40ced)[_0x962b('0x8')](function(_0x1e8c4e){logger[_0x962b('0x9')]('Cdr,\x20%s,\x20%s',_0x46d1d4,_0x962b('0xa'));logger[_0x962b('0xb')](_0x962b('0xc'),_0x46d1d4,_0x962b('0xa'),JSON['stringify'](_0x1e8c4e));if(_0x1e8c4e[_0x962b('0xd')]){if(_0x1e8c4e[_0x962b('0xd')][_0x962b('0xe')]===0x1f4){logger[_0x962b('0xd')]('Cdr,\x20%s,\x20%s',_0x46d1d4,_0x1e8c4e[_0x962b('0xd')]['message']);return _0x5be397(_0x1e8c4e[_0x962b('0xd')][_0x962b('0xf')]);}logger[_0x962b('0xd')](_0x962b('0x10'),_0x46d1d4,_0x1e8c4e[_0x962b('0xd')][_0x962b('0xf')]);return _0x458254(_0x1e8c4e[_0x962b('0xd')][_0x962b('0xf')]);}else{logger[_0x962b('0x9')]('Cdr,\x20%s,\x20%s',_0x46d1d4,_0x962b('0xa'));_0x458254(_0x1e8c4e[_0x962b('0x11')][_0x962b('0xf')]);}})[_0x962b('0x12')](function(_0x28c7bf){logger[_0x962b('0xd')]('Cdr,\x20%s,\x20%s',_0x46d1d4,_0x28c7bf);_0x5be397(_0x28c7bf);});});}
\ No newline at end of file
+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
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index e1cc707..2fac372 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index a79b988..4744653 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 _0xf0e4=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x1fe7fe,_0x41cc8a){var _0x119376=function(_0x4e66d9){while(--_0x4e66d9){_0x1fe7fe['push'](_0x1fe7fe['shift']());}};_0x119376(++_0x41cc8a);}(_0xf0e4,0xb1));var _0x4f0e=function(_0x16268d,_0x340078){_0x16268d=_0x16268d-0x0;var _0x36799c=_0xf0e4[_0x16268d];return _0x36799c;};'use strict';var Sequelize=require(_0x4f0e('0x0'));module[_0x4f0e('0x1')]={'priority':{'type':Sequelize[_0x4f0e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4f0e('0x3')],'allowNull':![],'defaultValue':_0x4f0e('0x4')},'appdata':{'type':Sequelize[_0x4f0e('0x5')]()},'description':{'type':Sequelize[_0x4f0e('0x3')]},'interval':{'type':Sequelize[_0x4f0e('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+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
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index f812e2f..aacd46c 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 _0xe3ed=['Content-Range','apply','reject','save','then','destroy','error','stack','name','params','model','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set'];(function(_0x36c28f,_0x331ff7){var _0x1cda15=function(_0x4a2ff5){while(--_0x4a2ff5){_0x36c28f['push'](_0x36c28f['shift']());}};_0x1cda15(++_0x331ff7);}(_0xe3ed,0x8d));var _0xde3e=function(_0x532880,_0xaf724d){_0x532880=_0x532880-0x0;var _0x418bbe=_0xe3ed[_0x532880];return _0x418bbe;};'use strict';var emlformat=require(_0xde3e('0x0'));var rimraf=require(_0xde3e('0x1'));var zipdir=require(_0xde3e('0x2'));var jsonpatch=require(_0xde3e('0x3'));var rp=require(_0xde3e('0x4'));var moment=require(_0xde3e('0x5'));var BPromise=require(_0xde3e('0x6'));var Mustache=require(_0xde3e('0x7'));var util=require('util');var path=require(_0xde3e('0x8'));var sox=require(_0xde3e('0x9'));var csv=require('to-csv');var ejs=require(_0xde3e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde3e('0xb'));var squel=require(_0xde3e('0xc'));var crypto=require('crypto');var jsforce=require(_0xde3e('0xd'));var deskjs=require(_0xde3e('0xe'));var toCsv=require(_0xde3e('0xf'));var querystring=require(_0xde3e('0x10'));var Papa=require(_0xde3e('0x11'));var Redis=require('ioredis');var authService=require(_0xde3e('0x12'));var qs=require(_0xde3e('0x13'));var as=require(_0xde3e('0x14'));var hardwareService=require(_0xde3e('0x15'));var logger=require('../../config/logger')(_0xde3e('0x16'));var utils=require(_0xde3e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xde3e('0x18'));var db=require(_0xde3e('0x19'))['db'];function respondWithStatusCode(_0x5d0240,_0x22ffc2){_0x22ffc2=_0x22ffc2||0xcc;return function(_0x4e0f23){if(_0x4e0f23){return _0x5d0240[_0xde3e('0x1a')](_0x22ffc2);}return _0x5d0240[_0xde3e('0x1b')](_0x22ffc2)[_0xde3e('0x1c')]();};}function respondWithResult(_0x4fe882,_0x167fa7){_0x167fa7=_0x167fa7||0xc8;return function(_0x1fee7b){if(_0x1fee7b){return _0x4fe882['status'](_0x167fa7)['json'](_0x1fee7b);}};}function respondWithFilteredResult(_0x120077,_0x11db96){return function(_0x6543f7){if(_0x6543f7){var _0x552fc4=typeof _0x11db96['offset']===_0xde3e('0x1d')&&typeof _0x11db96['limit']==='undefined';var _0xc3ee05=_0x6543f7[_0xde3e('0x1e')];var _0x4aa02c=_0x552fc4?0x0:_0x11db96[_0xde3e('0x1f')];var _0x276e83=_0x552fc4?_0x6543f7[_0xde3e('0x1e')]:_0x11db96['offset']+_0x11db96['limit'];var _0x4fa0d2;if(_0x276e83>=_0xc3ee05){_0x276e83=_0xc3ee05;_0x4fa0d2=0xc8;}else{_0x4fa0d2=0xce;}_0x120077[_0xde3e('0x1b')](_0x4fa0d2);return _0x120077[_0xde3e('0x20')](_0xde3e('0x21'),_0x4aa02c+'-'+_0x276e83+'/'+_0xc3ee05)['json'](_0x6543f7);}return null;};}function patchUpdates(_0x2ceb3e){return function(_0x11dd22){try{jsonpatch[_0xde3e('0x22')](_0x11dd22,_0x2ceb3e,!![]);}catch(_0x8c8ace){return BPromise[_0xde3e('0x23')](_0x8c8ace);}return _0x11dd22[_0xde3e('0x24')]();};}function saveUpdates(_0x26c5ca,_0x1eda88){return function(_0x443e8d){if(_0x443e8d){return _0x443e8d['update'](_0x26c5ca)[_0xde3e('0x25')](function(_0x334093){return _0x334093;});}return null;};}function removeEntity(_0x37615f,_0x57df9e){return function(_0x361511){if(_0x361511){return _0x361511[_0xde3e('0x26')]()[_0xde3e('0x25')](function(){_0x37615f['status'](0xcc)[_0xde3e('0x1c')]();});}};}function handleEntityNotFound(_0x78647,_0x1d9432){return function(_0xd795ac){if(!_0xd795ac){_0x78647[_0xde3e('0x1a')](0x194);}return _0xd795ac;};}function handleError(_0x5ec4b6,_0x5313cb){_0x5313cb=_0x5313cb||0x1f4;return function(_0x6c0db0){logger[_0xde3e('0x27')](_0x6c0db0[_0xde3e('0x28')]);if(_0x6c0db0['name']){delete _0x6c0db0[_0xde3e('0x29')];}_0x5ec4b6[_0xde3e('0x1b')](_0x5313cb)['send'](_0x6c0db0);};}exports['show']=function(_0x245fbc,_0x3c83c8){var _0x582c8d={'raw':!![],'where':{'id':_0x245fbc[_0xde3e('0x2a')]['id']}},_0x2e4c62={};_0x2e4c62[_0xde3e('0x2b')]=_['keys'](db['ChatApplication'][_0xde3e('0x2c')]);_0x2e4c62['query']=_['keys'](_0x245fbc[_0xde3e('0x2d')]);_0x2e4c62[_0xde3e('0x2e')]=_[_0xde3e('0x2f')](_0x2e4c62[_0xde3e('0x2b')],_0x2e4c62[_0xde3e('0x2d')]);_0x582c8d[_0xde3e('0x30')]=_[_0xde3e('0x2f')](_0x2e4c62[_0xde3e('0x2b')],qs[_0xde3e('0x31')](_0x245fbc[_0xde3e('0x2d')][_0xde3e('0x31')]));_0x582c8d[_0xde3e('0x30')]=_0x582c8d[_0xde3e('0x30')][_0xde3e('0x32')]?_0x582c8d[_0xde3e('0x30')]:_0x2e4c62[_0xde3e('0x2b')];if(_0x245fbc[_0xde3e('0x2d')]['includeAll']){_0x582c8d[_0xde3e('0x33')]=[{'all':!![]}];}_0x582c8d=_[_0xde3e('0x34')]({},_0x582c8d,_0x245fbc[_0xde3e('0x35')]);return db[_0xde3e('0x36')][_0xde3e('0x37')](_0x582c8d)[_0xde3e('0x25')](handleEntityNotFound(_0x3c83c8,null))[_0xde3e('0x25')](respondWithResult(_0x3c83c8,null))[_0xde3e('0x38')](handleError(_0x3c83c8,null));};exports['update']=function(_0x50f1e3,_0x47793d){if(_0x50f1e3['body']['id']){delete _0x50f1e3['body']['id'];}return db[_0xde3e('0x36')][_0xde3e('0x37')]({'where':{'id':_0x50f1e3[_0xde3e('0x2a')]['id']}})[_0xde3e('0x25')](handleEntityNotFound(_0x47793d,null))[_0xde3e('0x25')](saveUpdates(_0x50f1e3[_0xde3e('0x39')],null))['then'](respondWithResult(_0x47793d,null))['catch'](handleError(_0x47793d,null));};exports[_0xde3e('0x26')]=function(_0x24adee,_0x1ade0c){return db[_0xde3e('0x36')][_0xde3e('0x37')]({'where':{'id':_0x24adee[_0xde3e('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1ade0c,null))[_0xde3e('0x25')](removeEntity(_0x1ade0c,null))['catch'](handleError(_0x1ade0c,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index e56b5bd..0ccadd9 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 _0x4f88=['chat_applications','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication'];(function(_0x1a7536,_0x30c791){var _0x4660d9=function(_0x1db222){while(--_0x1db222){_0x1a7536['push'](_0x1a7536['shift']());}};_0x4660d9(++_0x30c791);}(_0x4f88,0xf3));var _0x84f8=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x4f88[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var logger=require('../../config/logger')(_0x84f8('0x2'));var moment=require(_0x84f8('0x3'));var BPromise=require(_0x84f8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x84f8('0x5'));var config=require(_0x84f8('0x6'));var attributes=require(_0x84f8('0x7'));module[_0x84f8('0x8')]=function(_0x79dcec,_0x1ac0c8){return _0x79dcec['define'](_0x84f8('0x9'),attributes,{'tableName':_0x84f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+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
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index fb497d6..198e432 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 _0xed1d=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xed1d,0x127));var _0xded1=function(_0x3cf76d,_0xb29031){_0x3cf76d=_0x3cf76d-0x0;var _0xb2c522=_0xed1d[_0x3cf76d];return _0xb2c522;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xded1('0x0'));var BPromise=require(_0xded1('0x1'));var rs=require(_0xded1('0x2'));var fs=require('fs');var Redis=require(_0xded1('0x3'));var db=require(_0xded1('0x4'))['db'];var utils=require(_0xded1('0x5'));var logger=require(_0xded1('0x6'))(_0xded1('0x7'));var config=require(_0xded1('0x8'));var jayson=require(_0xded1('0x9'));var client=jayson[_0xded1('0xa')][_0xded1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f79d4,_0x5a4dc6,_0x1aee31){return new BPromise(function(_0x37d971,_0x51febd){return client[_0xded1('0xc')](_0x1f79d4,_0x1aee31)['then'](function(_0x13d98f){logger[_0xded1('0xd')](_0xded1('0xe'),_0x5a4dc6,_0xded1('0xf'));logger[_0xded1('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5a4dc6,_0xded1('0xf'),JSON[_0xded1('0x11')](_0x13d98f));if(_0x13d98f[_0xded1('0x12')]){if(_0x13d98f[_0xded1('0x12')][_0xded1('0x13')]===0x1f4){logger[_0xded1('0x12')](_0xded1('0xe'),_0x5a4dc6,_0x13d98f[_0xded1('0x12')][_0xded1('0x14')]);return _0x51febd(_0x13d98f[_0xded1('0x12')][_0xded1('0x14')]);}logger[_0xded1('0x12')](_0xded1('0xe'),_0x5a4dc6,_0x13d98f[_0xded1('0x12')][_0xded1('0x14')]);return _0x37d971(_0x13d98f[_0xded1('0x12')][_0xded1('0x14')]);}else{logger['info'](_0xded1('0xe'),_0x5a4dc6,'request\x20sent');_0x37d971(_0x13d98f['result'][_0xded1('0x14')]);}})[_0xded1('0x15')](function(_0x556c5e){logger[_0xded1('0x12')]('ChatApplication,\x20%s,\x20%s',_0x5a4dc6,_0x556c5e);_0x51febd(_0x556c5e);});});}
\ No newline at end of file
+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
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3adfa67..b4e40ba 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 _0x665f=['show','put','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated'];(function(_0x572a16,_0x4d5089){var _0x4a0803=function(_0x55b517){while(--_0x55b517){_0x572a16['push'](_0x572a16['shift']());}};_0x4a0803(++_0x4d5089);}(_0x665f,0x1c4));var _0xf665=function(_0xb74774,_0x33681d){_0xb74774=_0xb74774-0x0;var _0x57e076=_0x665f[_0xb74774];return _0x57e076;};'use strict';var multer=require('multer');var util=require(_0xf665('0x0'));var path=require(_0xf665('0x1'));var timeout=require(_0xf665('0x2'));var express=require(_0xf665('0x3'));var router=express['Router']();var fs_extra=require(_0xf665('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf665('0x5'));var config=require('../../config/environment');var controller=require(_0xf665('0x6'));router[_0xf665('0x7')](_0xf665('0x8'),auth[_0xf665('0x9')](),controller[_0xf665('0xa')]);router[_0xf665('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf665('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xf665('0xd')]=router;
\ No newline at end of file
+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
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index b157cee..82b13d2 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 _0x02bd=['sequelize','exports','STRING'];(function(_0x3be174,_0x393350){var _0x5ec09c=function(_0x28a9aa){while(--_0x28a9aa){_0x3be174['push'](_0x3be174['shift']());}};_0x5ec09c(++_0x393350);}(_0x02bd,0x6c));var _0xd02b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x02bd[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xd02b('0x0'));module[_0xd02b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd02b('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+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
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index fd63adc..a00b7a3 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 _0x812e=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','ChatGroup','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','update','describe','getUnread','user','toInteger','addMembers','ids','omit','User','getMembers','nolimit','removeMembers','ChatGroupId','ChatInternalMessage','findOne','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x812e,0x117));var _0xe812=function(_0x5839fa,_0xacd507){_0x5839fa=_0x5839fa-0x0;var _0x5d514e=_0x812e[_0x5839fa];return _0x5d514e;};'use strict';var emlformat=require(_0xe812('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe812('0x1'));var jsonpatch=require(_0xe812('0x2'));var rp=require(_0xe812('0x3'));var moment=require(_0xe812('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe812('0x5'));var util=require('util');var path=require(_0xe812('0x6'));var sox=require(_0xe812('0x7'));var csv=require('to-csv');var ejs=require(_0xe812('0x8'));var fs=require('fs');var fs_extra=require(_0xe812('0x9'));var _=require(_0xe812('0xa'));var squel=require(_0xe812('0xb'));var crypto=require(_0xe812('0xc'));var jsforce=require(_0xe812('0xd'));var deskjs=require(_0xe812('0xe'));var toCsv=require(_0xe812('0xf'));var querystring=require(_0xe812('0x10'));var Papa=require(_0xe812('0x11'));var Redis=require(_0xe812('0x12'));var authService=require(_0xe812('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe812('0x14'));var hardwareService=require(_0xe812('0x15'));var logger=require(_0xe812('0x16'))(_0xe812('0x17'));var utils=require(_0xe812('0x18'));var config=require(_0xe812('0x19'));var licenseUtil=require(_0xe812('0x1a'));var db=require('../../mysqldb')['db'];config[_0xe812('0x1b')]=_[_0xe812('0x1c')](config[_0xe812('0x1b')],{'host':_0xe812('0x1d'),'port':0x18eb});var socket=require(_0xe812('0x1e'))(new Redis(config[_0xe812('0x1b')]));require('./chatGroup.socket')[_0xe812('0x1f')](socket);function respondWithStatusCode(_0x2b0bb6,_0x1f9be0){_0x1f9be0=_0x1f9be0||0xcc;return function(_0x9c4402){if(_0x9c4402){return _0x2b0bb6[_0xe812('0x20')](_0x1f9be0);}return _0x2b0bb6[_0xe812('0x21')](_0x1f9be0)[_0xe812('0x22')]();};}function respondWithResult(_0x3c496e,_0x4ee593){_0x4ee593=_0x4ee593||0xc8;return function(_0x267233){if(_0x267233){return _0x3c496e[_0xe812('0x21')](_0x4ee593)['json'](_0x267233);}};}function respondWithFilteredResult(_0x13b6c6,_0x5ef3dd){return function(_0x1d7e4e){if(_0x1d7e4e){var _0x774e45=typeof _0x5ef3dd[_0xe812('0x23')]===_0xe812('0x24')&&typeof _0x5ef3dd['limit']===_0xe812('0x24');var _0x290d7b=_0x1d7e4e[_0xe812('0x25')];var _0xa8adc8=_0x774e45?0x0:_0x5ef3dd[_0xe812('0x23')];var _0x2427f3=_0x774e45?_0x1d7e4e[_0xe812('0x25')]:_0x5ef3dd['offset']+_0x5ef3dd[_0xe812('0x26')];var _0x3cc7d9;if(_0x2427f3>=_0x290d7b){_0x2427f3=_0x290d7b;_0x3cc7d9=0xc8;}else{_0x3cc7d9=0xce;}_0x13b6c6[_0xe812('0x21')](_0x3cc7d9);return _0x13b6c6[_0xe812('0x27')](_0xe812('0x28'),_0xa8adc8+'-'+_0x2427f3+'/'+_0x290d7b)[_0xe812('0x29')](_0x1d7e4e);}return null;};}function patchUpdates(_0x35e946){return function(_0x1d26a6){try{jsonpatch[_0xe812('0x2a')](_0x1d26a6,_0x35e946,!![]);}catch(_0x553e42){return BPromise[_0xe812('0x2b')](_0x553e42);}return _0x1d26a6[_0xe812('0x2c')]();};}function saveUpdates(_0x35b066,_0x4b4fb1){return function(_0xb76d88){if(_0xb76d88){return _0xb76d88['update'](_0x35b066)[_0xe812('0x2d')](function(_0x1e11b5){return _0x1e11b5;});}return null;};}function removeEntity(_0x580cc3,_0x125fdd){return function(_0x159482){if(_0x159482){return _0x159482[_0xe812('0x2e')]()[_0xe812('0x2d')](function(){_0x580cc3[_0xe812('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44efa7,_0x16bf81){return function(_0x1e0de2){if(!_0x1e0de2){_0x44efa7[_0xe812('0x20')](0x194);}return _0x1e0de2;};}function handleError(_0x5c5ce6,_0x4f65ff){_0x4f65ff=_0x4f65ff||0x1f4;return function(_0x373036){logger[_0xe812('0x2f')](_0x373036[_0xe812('0x30')]);if(_0x373036[_0xe812('0x31')]){delete _0x373036['name'];}_0x5c5ce6[_0xe812('0x21')](_0x4f65ff)[_0xe812('0x32')](_0x373036);};}exports['index']=function(_0xebcad3,_0x478dfc){var _0x240a22={},_0x173721={},_0xc4988c={'count':0x0,'rows':[]};var _0x241bc3=_[_0xe812('0x33')](db[_0xe812('0x34')]['rawAttributes'],function(_0x2d94c4){return{'name':_0x2d94c4[_0xe812('0x35')],'type':_0x2d94c4[_0xe812('0x36')][_0xe812('0x37')]};});_0x173721['model']=_['map'](_0x241bc3,_0xe812('0x31'));_0x173721[_0xe812('0x38')]=_[_0xe812('0x39')](_0xebcad3[_0xe812('0x38')]);_0x173721[_0xe812('0x3a')]=_[_0xe812('0x3b')](_0x173721['model'],_0x173721[_0xe812('0x38')]);_0x240a22[_0xe812('0x3c')]=_[_0xe812('0x3b')](_0x173721['model'],qs[_0xe812('0x3d')](_0xebcad3['query'][_0xe812('0x3d')]));_0x240a22[_0xe812('0x3c')]=_0x240a22['attributes'][_0xe812('0x3e')]?_0x240a22[_0xe812('0x3c')]:_0x173721[_0xe812('0x3f')];if(!_0xebcad3[_0xe812('0x38')][_0xe812('0x40')]('nolimit')){_0x240a22[_0xe812('0x26')]=qs[_0xe812('0x26')](_0xebcad3[_0xe812('0x38')]['limit']);_0x240a22[_0xe812('0x23')]=qs[_0xe812('0x23')](_0xebcad3[_0xe812('0x38')][_0xe812('0x23')]);}_0x240a22['order']=qs[_0xe812('0x41')](_0xebcad3['query'][_0xe812('0x41')]);_0x240a22['where']=qs[_0xe812('0x3a')](_[_0xe812('0x42')](_0xebcad3[_0xe812('0x38')],_0x173721[_0xe812('0x3a')]),_0x241bc3);if(_0xebcad3[_0xe812('0x38')][_0xe812('0x43')]){_0x240a22['where']=_[_0xe812('0x44')](_0x240a22[_0xe812('0x45')],{'$or':_[_0xe812('0x33')](_0x241bc3,function(_0x24860c){if(_0x24860c[_0xe812('0x36')]!==_0xe812('0x46')){var _0x5d20b9={};_0x5d20b9[_0x24860c[_0xe812('0x31')]]={'$like':'%'+_0xebcad3['query'][_0xe812('0x43')]+'%'};return _0x5d20b9;}})});}_0x240a22=_['merge']({},_0x240a22,_0xebcad3['options']);var _0x48155f={'where':_0x240a22[_0xe812('0x45')]};return db[_0xe812('0x34')][_0xe812('0x25')](_0x48155f)[_0xe812('0x2d')](function(_0x53c6d1){_0xc4988c[_0xe812('0x25')]=_0x53c6d1;if(_0xebcad3[_0xe812('0x38')][_0xe812('0x47')]){_0x240a22[_0xe812('0x48')]=[{'all':!![]}];}return db[_0xe812('0x34')][_0xe812('0x49')](_0x240a22);})[_0xe812('0x2d')](function(_0x5b1ebd){_0xc4988c['rows']=_0x5b1ebd;return _0xc4988c;})[_0xe812('0x2d')](respondWithFilteredResult(_0x478dfc,_0x240a22))[_0xe812('0x4a')](handleError(_0x478dfc,null));};exports[_0xe812('0x4b')]=function(_0x89568d,_0x777e3c){var _0x509827={'raw':!![],'where':{'id':_0x89568d[_0xe812('0x4c')]['id']}},_0x1fcba9={};_0x1fcba9[_0xe812('0x3f')]=_[_0xe812('0x39')](db[_0xe812('0x34')]['rawAttributes']);_0x1fcba9['query']=_[_0xe812('0x39')](_0x89568d['query']);_0x1fcba9[_0xe812('0x3a')]=_['intersection'](_0x1fcba9[_0xe812('0x3f')],_0x1fcba9['query']);_0x509827[_0xe812('0x3c')]=_[_0xe812('0x3b')](_0x1fcba9['model'],qs[_0xe812('0x3d')](_0x89568d[_0xe812('0x38')][_0xe812('0x3d')]));_0x509827[_0xe812('0x3c')]=_0x509827[_0xe812('0x3c')]['length']?_0x509827[_0xe812('0x3c')]:_0x1fcba9[_0xe812('0x3f')];if(_0x89568d[_0xe812('0x38')][_0xe812('0x47')]){_0x509827[_0xe812('0x48')]=[{'all':!![]}];}_0x509827=_['merge']({},_0x509827,_0x89568d[_0xe812('0x4d')]);return db[_0xe812('0x34')][_0xe812('0x4e')](_0x509827)[_0xe812('0x2d')](handleEntityNotFound(_0x777e3c,null))[_0xe812('0x2d')](respondWithResult(_0x777e3c,null))['catch'](handleError(_0x777e3c,null));};exports[_0xe812('0x4f')]=function(_0x2b266f,_0x16fe5c){return db[_0xe812('0x34')][_0xe812('0x4f')](_0x2b266f[_0xe812('0x50')],{})[_0xe812('0x2d')](respondWithResult(_0x16fe5c,0xc9))['catch'](handleError(_0x16fe5c,null));};exports[_0xe812('0x51')]=function(_0x1c151b,_0x48eb4d){if(_0x1c151b[_0xe812('0x50')]['id']){delete _0x1c151b[_0xe812('0x50')]['id'];}return db[_0xe812('0x34')][_0xe812('0x4e')]({'where':{'id':_0x1c151b[_0xe812('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48eb4d,null))[_0xe812('0x2d')](saveUpdates(_0x1c151b['body'],null))[_0xe812('0x2d')](respondWithResult(_0x48eb4d,null))[_0xe812('0x4a')](handleError(_0x48eb4d,null));};exports['destroy']=function(_0x3deffd,_0x26052a){return db[_0xe812('0x34')][_0xe812('0x4e')]({'where':{'id':_0x3deffd[_0xe812('0x4c')]['id']}})['then'](handleEntityNotFound(_0x26052a,null))[_0xe812('0x2d')](removeEntity(_0x26052a,null))['catch'](handleError(_0x26052a,null));};exports[_0xe812('0x52')]=function(_0x568791,_0x236187){return db[_0xe812('0x34')][_0xe812('0x52')]()[_0xe812('0x2d')](respondWithResult(_0x236187,null))[_0xe812('0x4a')](handleError(_0x236187,null));};exports[_0xe812('0x53')]=function(_0x1dda33,_0x1c7fce,_0x590b08){return db['ChatInternalMessage'][_0xe812('0x25')]({'where':{'ChatGroupId':_0x1dda33[_0xe812('0x4c')]['id'],'ToId':_0x1dda33[_0xe812('0x54')]['id'],'read':![]}})[_0xe812('0x2d')](function(_0x155b93){return{'id':_[_0xe812('0x55')](_0x1dda33[_0xe812('0x4c')]['id']),'count':_0x155b93};})[_0xe812('0x2d')](respondWithResult(_0x1c7fce,null))[_0xe812('0x4a')](handleError(_0x1c7fce,null));};exports[_0xe812('0x56')]=function(_0x2a1bc6,_0x51c687,_0x46ce96){return db[_0xe812('0x34')][_0xe812('0x4e')]({'where':{'id':_0x2a1bc6['params']['id']}})[_0xe812('0x2d')](handleEntityNotFound(_0x51c687,null))[_0xe812('0x2d')](function(_0x2d194f){if(_0x2d194f){return _0x2d194f[_0xe812('0x56')](_0x2a1bc6[_0xe812('0x50')][_0xe812('0x57')],_[_0xe812('0x58')](_0x2a1bc6['body'],[_0xe812('0x57'),'id'])||{});}})[_0xe812('0x2d')](respondWithResult(_0x51c687,null))[_0xe812('0x4a')](handleError(_0x51c687,null));};exports['getMembers']=function(_0x588e0e,_0x286d80,_0x32c672){var _0x2b4c68={};var _0x32a588={};var _0x1b1de6;var _0x25b584;return db[_0xe812('0x34')]['findOne']({'where':{'id':_0x588e0e[_0xe812('0x4c')]['id']}})[_0xe812('0x2d')](handleEntityNotFound(_0x286d80,null))[_0xe812('0x2d')](function(_0x3420cb){if(_0x3420cb){_0x1b1de6=_0x3420cb;_0x32a588[_0xe812('0x3f')]=_['keys'](db[_0xe812('0x59')]['rawAttributes']);_0x32a588[_0xe812('0x38')]=_[_0xe812('0x39')](_0x588e0e[_0xe812('0x38')]);_0x32a588['filters']=_['intersection'](_0x32a588[_0xe812('0x3f')],_0x32a588[_0xe812('0x38')]);_0x2b4c68[_0xe812('0x3c')]=_[_0xe812('0x3b')](_0x32a588['model'],qs[_0xe812('0x3d')](_0x588e0e[_0xe812('0x38')][_0xe812('0x3d')]));_0x2b4c68[_0xe812('0x3c')]=_0x2b4c68['attributes'][_0xe812('0x3e')]?_0x2b4c68['attributes']:_0x32a588[_0xe812('0x3f')];_0x2b4c68['order']=qs['sort'](_0x588e0e[_0xe812('0x38')]['sort']);_0x2b4c68[_0xe812('0x45')]=qs[_0xe812('0x3a')](_[_0xe812('0x42')](_0x588e0e[_0xe812('0x38')],_0x32a588['filters']));if(_0x588e0e[_0xe812('0x38')][_0xe812('0x43')]){_0x2b4c68[_0xe812('0x45')]=_['merge'](_0x2b4c68[_0xe812('0x45')],{'$or':_[_0xe812('0x33')](_0x2b4c68[_0xe812('0x3c')],function(_0x478a3f){var _0x1716bf={};_0x1716bf[_0x478a3f]={'$like':'%'+_0x588e0e[_0xe812('0x38')][_0xe812('0x43')]+'%'};return _0x1716bf;})});}_0x2b4c68=_[_0xe812('0x44')]({},_0x2b4c68,_0x588e0e[_0xe812('0x4d')]);return _0x1b1de6[_0xe812('0x5a')](_0x2b4c68);}})[_0xe812('0x2d')](function(_0x1df0d0){if(_0x1df0d0){_0x25b584=_0x1df0d0[_0xe812('0x3e')];if(!_0x588e0e[_0xe812('0x38')]['hasOwnProperty'](_0xe812('0x5b'))){_0x2b4c68[_0xe812('0x26')]=qs[_0xe812('0x26')](_0x588e0e[_0xe812('0x38')][_0xe812('0x26')]);_0x2b4c68[_0xe812('0x23')]=qs[_0xe812('0x23')](_0x588e0e[_0xe812('0x38')][_0xe812('0x23')]);}return _0x1b1de6[_0xe812('0x5a')](_0x2b4c68);}})[_0xe812('0x2d')](function(_0x71e7a3){if(_0x71e7a3){return _0x71e7a3?{'count':_0x25b584,'rows':_0x71e7a3}:null;}})['then'](respondWithResult(_0x286d80,null))[_0xe812('0x4a')](handleError(_0x286d80,null));};exports[_0xe812('0x5c')]=function(_0x6a0aba,_0x39dd5b,_0xae2751){return db['ChatGroup']['find']({'where':{'id':_0x6a0aba[_0xe812('0x4c')]['id']}})[_0xe812('0x2d')](handleEntityNotFound(_0x39dd5b,null))[_0xe812('0x2d')](function(_0x35074a){if(_0x35074a){return _0x35074a[_0xe812('0x5c')](_0x6a0aba[_0xe812('0x38')]['ids']);}})[_0xe812('0x2d')](respondWithStatusCode(_0x39dd5b,null))[_0xe812('0x4a')](handleError(_0x39dd5b,null));};exports['addMessage']=function(_0x534234,_0x24c6ea,_0xa3567e){if(_0x534234[_0xe812('0x50')]['id']){delete _0x534234[_0xe812('0x50')]['id'];}return db[_0xe812('0x34')][_0xe812('0x4e')]({'where':{'id':_0x534234[_0xe812('0x4c')]['id']}})['then'](handleEntityNotFound(_0x24c6ea,null))['then'](function(_0x1f1625){if(_0x1f1625){_0x534234[_0xe812('0x50')][_0xe812('0x5d')]=_0x1f1625['id'];return db[_0xe812('0x5e')][_0xe812('0x4f')](_0x534234[_0xe812('0x50')]);}})[_0xe812('0x2d')](respondWithResult(_0x24c6ea,null))['catch'](handleError(_0x24c6ea,null));};exports['getMessages']=function(_0x530d19,_0x4ef0a4,_0x137b55){var _0x1e3e99={};var _0x52cf6b={};var _0x112eb1;var _0x4f4149;return db[_0xe812('0x34')][_0xe812('0x5f')]({'where':{'id':_0x530d19[_0xe812('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ef0a4,null))[_0xe812('0x2d')](function(_0x1a2fcf){if(_0x1a2fcf){_0x112eb1=_0x1a2fcf;_0x52cf6b[_0xe812('0x3f')]=_['keys'](db[_0xe812('0x5e')]['rawAttributes']);_0x52cf6b[_0xe812('0x38')]=_[_0xe812('0x39')](_0x530d19['query']);_0x52cf6b[_0xe812('0x3a')]=_[_0xe812('0x3b')](_0x52cf6b[_0xe812('0x3f')],_0x52cf6b['query']);_0x1e3e99[_0xe812('0x3c')]=_[_0xe812('0x3b')](_0x52cf6b['model'],qs[_0xe812('0x3d')](_0x530d19[_0xe812('0x38')][_0xe812('0x3d')]));_0x1e3e99[_0xe812('0x3c')]=_0x1e3e99['attributes']['length']?_0x1e3e99[_0xe812('0x3c')]:_0x52cf6b[_0xe812('0x3f')];_0x1e3e99[_0xe812('0x60')]=qs[_0xe812('0x41')](_0x530d19['query']['sort']);_0x1e3e99['where']=qs['filters'](_[_0xe812('0x42')](_0x530d19[_0xe812('0x38')],_0x52cf6b[_0xe812('0x3a')]));if(_0x530d19[_0xe812('0x38')]['filter']){_0x1e3e99['where']=_[_0xe812('0x44')](_0x1e3e99[_0xe812('0x45')],{'$or':_['map'](_0x1e3e99[_0xe812('0x3c')],function(_0x99439c){var _0x458c19={};_0x458c19[_0x99439c]={'$like':'%'+_0x530d19[_0xe812('0x38')][_0xe812('0x43')]+'%'};return _0x458c19;})});}if(_0x530d19[_0xe812('0x38')]['$gte']){var _0x3d2d8e=_0x530d19['query'][_0xe812('0x61')][_0xe812('0x62')](',');var _0x44df2e={};_0x44df2e[_0x3d2d8e[0x0]]={'$gte':moment(_0x3d2d8e[0x1])[_0xe812('0x63')](_0xe812('0x64'))};_0x1e3e99['where']=_['merge'](_0x1e3e99[_0xe812('0x45')],_0x44df2e);}_0x1e3e99=_[_0xe812('0x44')]({},_0x1e3e99,_0x530d19[_0xe812('0x4d')]);return _0x112eb1[_0xe812('0x65')](_0x1e3e99);}})['then'](function(_0x294395){if(_0x294395){_0x4f4149=_0x294395[_0xe812('0x3e')];if(!_0x530d19['query'][_0xe812('0x40')](_0xe812('0x5b'))){_0x1e3e99[_0xe812('0x26')]=qs['limit'](_0x530d19[_0xe812('0x38')][_0xe812('0x26')]);_0x1e3e99[_0xe812('0x23')]=qs[_0xe812('0x23')](_0x530d19['query'][_0xe812('0x23')]);}return _0x112eb1[_0xe812('0x65')](_0x1e3e99);}})['then'](function(_0x19969e){if(_0x19969e){return _0x19969e?{'count':_0x4f4149,'rows':_0x19969e}:null;}})[_0xe812('0x2d')](respondWithResult(_0x4ef0a4,null))[_0xe812('0x4a')](handleError(_0x4ef0a4,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 114b4d5..31ace2f 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 _0x8ff4=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xb3ba57,_0x3c90a8){var _0x5ce9d6=function(_0x4d66a9){while(--_0x4d66a9){_0xb3ba57['push'](_0xb3ba57['shift']());}};_0x5ce9d6(++_0x3c90a8);}(_0x8ff4,0x11f));var _0x48ff=function(_0x53be8d,_0x2cb53f){_0x53be8d=_0x53be8d-0x0;var _0x396d2c=_0x8ff4[_0x53be8d];return _0x396d2c;};'use strict';var EventEmitter=require(_0x48ff('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x48ff('0x1')](0x0);var events={'afterCreate':_0x48ff('0x2'),'afterUpdate':'update','afterDestroy':_0x48ff('0x3')};function emitEvent(_0xc4b32e){return function(_0x2e6166,_0x3fa416,_0x46de8a){ChatGroupEvents[_0x48ff('0x4')](_0xc4b32e+':'+_0x2e6166['id'],_0x2e6166);ChatGroupEvents[_0x48ff('0x4')](_0xc4b32e,_0x2e6166);_0x46de8a(null);};}for(var e in events){if(events[_0x48ff('0x5')](e)){var event=events[e];ChatGroup[_0x48ff('0x6')](e,emitEvent(event));}}module[_0x48ff('0x7')]=ChatGroupEvents;
\ No newline at end of file
+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
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 0ee351c..a32ca60 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 _0xa5d7=['rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x505473,_0x358249){var _0x1c466d=function(_0x525a9f){while(--_0x525a9f){_0x505473['push'](_0x505473['shift']());}};_0x1c466d(++_0x358249);}(_0xa5d7,0x94));var _0x7a5d=function(_0xba185f,_0x7c5e61){_0xba185f=_0xba185f-0x0;var _0x50c684=_0xa5d7[_0xba185f];return _0x50c684;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var logger=require(_0x7a5d('0x2'))(_0x7a5d('0x3'));var moment=require(_0x7a5d('0x4'));var BPromise=require(_0x7a5d('0x5'));var rp=require(_0x7a5d('0x6'));var fs=require('fs');var path=require(_0x7a5d('0x7'));var rimraf=require(_0x7a5d('0x8'));var config=require(_0x7a5d('0x9'));var attributes=require(_0x7a5d('0xa'));module['exports']=function(_0x7fa601,_0x27022e){return _0x7fa601[_0x7a5d('0xb')](_0x7a5d('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index b820020..124a8bb 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 _0xc15b=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x50eb38,_0x2ee6ba){var _0x5de7bf=function(_0x3558c7){while(--_0x3558c7){_0x50eb38['push'](_0x50eb38['shift']());}};_0x5de7bf(++_0x2ee6ba);}(_0xc15b,0xe4));var _0xbc15=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xc15b[_0x1a9204];return _0x17ca68;};'use strict';var _=require(_0xbc15('0x0'));var util=require('util');var moment=require(_0xbc15('0x1'));var BPromise=require(_0xbc15('0x2'));var rs=require(_0xbc15('0x3'));var fs=require('fs');var Redis=require(_0xbc15('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc15('0x5'))(_0xbc15('0x6'));var config=require(_0xbc15('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xbc15('0x8')]=_[_0xbc15('0x9')](config[_0xbc15('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbc15('0xa'))['register'](socket);function respondWithRpcPromise(_0x2189d4,_0x42f0b9,_0x359eb9){return new BPromise(function(_0x551a7b,_0x413eda){return client[_0xbc15('0xb')](_0x2189d4,_0x359eb9)['then'](function(_0xc677d5){logger[_0xbc15('0xc')](_0xbc15('0xd'),_0x42f0b9,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x42f0b9,_0xbc15('0xe'),JSON[_0xbc15('0xf')](_0xc677d5));if(_0xc677d5[_0xbc15('0x10')]){if(_0xc677d5[_0xbc15('0x10')][_0xbc15('0x11')]===0x1f4){logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0xc677d5[_0xbc15('0x10')][_0xbc15('0x12')]);return _0x413eda(_0xc677d5[_0xbc15('0x10')][_0xbc15('0x12')]);}logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0xc677d5[_0xbc15('0x10')]['message']);return _0x551a7b(_0xc677d5[_0xbc15('0x10')]['message']);}else{logger[_0xbc15('0xc')](_0xbc15('0xd'),_0x42f0b9,_0xbc15('0xe'));_0x551a7b(_0xc677d5[_0xbc15('0x13')][_0xbc15('0x12')]);}})[_0xbc15('0x14')](function(_0x7e7826){logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0x7e7826);_0x413eda(_0x7e7826);});});}
\ No newline at end of file
+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
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 54db341..07a6f5d 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 _0x299b=['./chatGroup.events','remove','update','emit','removeListener','register','chatGroup:'];(function(_0x20a35e,_0x477112){var _0x52bbe7=function(_0x494529){while(--_0x494529){_0x20a35e['push'](_0x20a35e['shift']());}};_0x52bbe7(++_0x477112);}(_0x299b,0x118));var _0xb299=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x299b[_0x13843f];return _0x1063ae;};'use strict';var ChatGroupEvents=require(_0xb299('0x0'));var events=['save',_0xb299('0x1'),_0xb299('0x2')];function createListener(_0x25aaba,_0x500567){return function(_0x3a10ce){_0x500567[_0xb299('0x3')](_0x25aaba,_0x3a10ce);};}function removeListener(_0x1ca9ec,_0x26139d){return function(){ChatGroupEvents[_0xb299('0x4')](_0x1ca9ec,_0x26139d);};}exports[_0xb299('0x5')]=function(_0x5b3f02){for(var _0x37dc00=0x0,_0x3ed409=events['length'];_0x37dc00<_0x3ed409;_0x37dc00++){var _0x1eb304=events[_0x37dc00];var _0x41edbb=createListener(_0xb299('0x6')+_0x1eb304,_0x5b3f02);ChatGroupEvents['on'](_0x1eb304,_0x41edbb);}};
\ No newline at end of file
+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
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 13ad9d6..9ac41a1 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 _0xe0d8=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','put','delete','destroy','removeMembers','multer'];(function(_0x223a3e,_0x2da798){var _0x582005=function(_0x4adba8){while(--_0x4adba8){_0x223a3e['push'](_0x223a3e['shift']());}};_0x582005(++_0x2da798);}(_0xe0d8,0x185));var _0x8e0d=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0xe0d8[_0x3d4ef1];return _0x409423;};'use strict';var multer=require(_0x8e0d('0x0'));var util=require(_0x8e0d('0x1'));var path=require(_0x8e0d('0x2'));var timeout=require(_0x8e0d('0x3'));var express=require(_0x8e0d('0x4'));var router=express['Router']();var fs_extra=require(_0x8e0d('0x5'));var auth=require(_0x8e0d('0x6'));var interaction=require(_0x8e0d('0x7'));var config=require('../../config/environment');var controller=require(_0x8e0d('0x8'));router[_0x8e0d('0x9')]('/',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0xb')]);router[_0x8e0d('0x9')]('/describe',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0xc')]);router[_0x8e0d('0x9')](_0x8e0d('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x8e0d('0xe'),auth[_0x8e0d('0xa')](),controller[_0x8e0d('0xf')]);router[_0x8e0d('0x9')](_0x8e0d('0x10'),auth['isAuthenticated'](),controller[_0x8e0d('0x11')]);router['get'](_0x8e0d('0x12'),auth[_0x8e0d('0xa')](),controller['getMessages']);router[_0x8e0d('0x13')]('/',auth['isAuthenticated'](),controller[_0x8e0d('0x14')]);router['post']('/:id/members',auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x15')]);router[_0x8e0d('0x13')](_0x8e0d('0x12'),auth['isAuthenticated'](),controller['addMessage']);router[_0x8e0d('0x16')](_0x8e0d('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8e0d('0x17')](_0x8e0d('0xd'),auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x18')]);router[_0x8e0d('0x17')](_0x8e0d('0x10'),auth[_0x8e0d('0xa')](),controller[_0x8e0d('0x19')]);module['exports']=router;
\ No newline at end of file
+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
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 118ad12..e66b440 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 _0x38c9=['long','out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x3d0719,_0x53156d){var _0x1eedfd=function(_0xc07d52){while(--_0xc07d52){_0x3d0719['push'](_0x3d0719['shift']());}};_0x1eedfd(++_0x53156d);}(_0x38c9,0x199));var _0x938c=function(_0x2f4c1c,_0x5a3dd4){_0x2f4c1c=_0x2f4c1c-0x0;var _0x25e0f2=_0x38c9[_0x2f4c1c];return _0x25e0f2;};'use strict';var Sequelize=require(_0x938c('0x0'));module[_0x938c('0x1')]={'closed':{'type':Sequelize[_0x938c('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x938c('0x3')](_0x938c('0x4'),_0x938c('0x5')),'defaultValue':_0x938c('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x938c('0x6')]},'mailTranscript':{'type':Sequelize[_0x938c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x938c('0x8')]},'disposition':{'type':Sequelize[_0x938c('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x938c('0x7')]},'note':{'type':Sequelize[_0x938c('0x7')]},'browserName':{'type':Sequelize[_0x938c('0x7')]},'browserVersion':{'type':Sequelize[_0x938c('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x938c('0x7')]},'deviceVendor':{'type':Sequelize[_0x938c('0x7')]},'deviceType':{'type':Sequelize[_0x938c('0x7')]},'referer':{'type':Sequelize[_0x938c('0x6')]},'customerIp':{'type':Sequelize[_0x938c('0x7')]},'formData':{'type':Sequelize[_0x938c('0x6')](_0x938c('0x9'))},'read1stAt':{'type':Sequelize[_0x938c('0x8')]},'lastMsgAt':{'type':Sequelize[_0x938c('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x938c('0x3')]('in',_0x938c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x938c('0x7')]},'customerPort':{'type':Sequelize[_0x938c('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x938c('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x938c('0x2')],'defaultValue':![]}};
\ No newline at end of file
+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
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d1efeb8..0cad000 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 _0xbaf0=['../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','isNull','vidaooNote','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','mimetype','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','findAll','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','firstName','lastName','Attachment','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x10c988,_0x1a5956){var _0x4a4dcd=function(_0x4d96da){while(--_0x4d96da){_0x10c988['push'](_0x10c988['shift']());}};_0x4a4dcd(++_0x1a5956);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var pdf=require(_0x0baf('0x16'));var hardwareService=require(_0x0baf('0x17'));var logger=require(_0x0baf('0x18'))(_0x0baf('0x19'));var utils=require(_0x0baf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0baf('0x1b'))['db'];config[_0x0baf('0x1c')]=_[_0x0baf('0x1d')](config[_0x0baf('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0x1e'))(new Redis(config['redis']));require(_0x0baf('0x1f'))[_0x0baf('0x20')](socket);var jayson=require(_0x0baf('0x21'));var client=jayson[_0x0baf('0x22')][_0x0baf('0x23')]({'port':0x232b});var client9004=jayson[_0x0baf('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd79d,_0x2312c7,_0x38395b,_0x283408){return new BPromise(function(_0x3d83a3,_0x2cf7da){var _0x288a98=_0x283408||client;return _0x288a98['request'](_0x4cd79d,_0x38395b)[_0x0baf('0x24')](function(_0xfbecec){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x2312c7,_0x0baf('0x27'));logger[_0x0baf('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2312c7,'request\x20sent',JSON[_0x0baf('0x29')](_0xfbecec));if(_0xfbecec[_0x0baf('0x2a')]){if(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2b')]===0x1f4){logger[_0x0baf('0x2a')](_0x0baf('0x26'),_0x2312c7,_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);return _0x2cf7da(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);}logger['error'](_0x0baf('0x26'),_0x2312c7,_0xfbecec['error'][_0x0baf('0x2c')]);return _0x3d83a3(_0xfbecec['error']['message']);}else{logger[_0x0baf('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,'request\x20sent');_0x3d83a3(_0xfbecec[_0x0baf('0x2d')][_0x0baf('0x2c')]);}})[_0x0baf('0x2e')](function(_0x19d9fd){logger[_0x0baf('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,_0x19d9fd);_0x2cf7da(_0x19d9fd);});});}function respondWithStatusCode(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2f')](_0x4681c5);}return _0x448617[_0x0baf('0x30')](_0x4681c5)[_0x0baf('0x31')]();};}function respondWithResult(_0x453525,_0x549fd0){_0x549fd0=_0x549fd0||0xc8;return function(_0x1590b4){if(_0x1590b4){return _0x453525[_0x0baf('0x30')](_0x549fd0)[_0x0baf('0x32')](_0x1590b4);}};}function respondWithFilteredResult(_0x265915,_0x55c715){return function(_0x29dbdf){if(_0x29dbdf){var _0x34a58a=typeof _0x55c715['offset']===_0x0baf('0x33')&&typeof _0x55c715[_0x0baf('0x34')]===_0x0baf('0x33');var _0xb4dbb1=_0x29dbdf[_0x0baf('0x35')];var _0x366924=_0x34a58a?0x0:_0x55c715[_0x0baf('0x36')];var _0x57476f=_0x34a58a?_0x29dbdf[_0x0baf('0x35')]:_0x55c715[_0x0baf('0x36')]+_0x55c715[_0x0baf('0x34')];var _0x3ed995;if(_0x57476f>=_0xb4dbb1){_0x57476f=_0xb4dbb1;_0x3ed995=0xc8;}else{_0x3ed995=0xce;}_0x265915[_0x0baf('0x30')](_0x3ed995);return _0x265915[_0x0baf('0x37')](_0x0baf('0x38'),_0x366924+'-'+_0x57476f+'/'+_0xb4dbb1)[_0x0baf('0x32')](_0x29dbdf);}return null;};}function patchUpdates(_0x59431b){return function(_0x3ded64){try{jsonpatch[_0x0baf('0x39')](_0x3ded64,_0x59431b,!![]);}catch(_0x165d14){return BPromise[_0x0baf('0x3a')](_0x165d14);}return _0x3ded64[_0x0baf('0x3b')]();};}function saveUpdates(_0x57a6bb,_0x2fd426){return function(_0x53ae1d){if(_0x53ae1d){return _0x53ae1d[_0x0baf('0x3c')](_0x57a6bb)[_0x0baf('0x24')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x3d65f2,_0x5300a5){return function(_0x1a2b03){if(_0x1a2b03){return _0x1a2b03[_0x0baf('0x3d')]()['then'](function(){_0x3d65f2[_0x0baf('0x30')](0xcc)[_0x0baf('0x31')]();});}};}function handleEntityNotFound(_0x62a2ed,_0xbaa9a7){return function(_0x1f60bd){if(!_0x1f60bd){_0x62a2ed[_0x0baf('0x2f')](0x194);}return _0x1f60bd;};}function handleError(_0xe03d82,_0x675461){_0x675461=_0x675461||0x1f4;return function(_0x4aa6ed){logger[_0x0baf('0x2a')](_0x4aa6ed[_0x0baf('0x3e')]);if(_0x4aa6ed['name']){delete _0x4aa6ed[_0x0baf('0x3f')];}_0xe03d82['status'](_0x675461)['send'](_0x4aa6ed);};}function getMustacheRender(_0x11bc49,_0x81af83){return Mustache['render'](_0x11bc49,_['merge'](_0x81af83[_0x0baf('0x40')],{'contact':_0x81af83[_0x0baf('0x41')],'message':_0x81af83[_0x0baf('0x2c')],'agent':_0x81af83[_0x0baf('0x42')],'interaction':_0x81af83[_0x0baf('0x43')],'account':_0x81af83[_0x0baf('0x44')]}))||'';}function getInteractionUsers(_0x290464,_0x37c038){return new BPromise(function(_0x631f74,_0x36c6d2){try{if(_0x37c038[_0x290464['id']]){_0x290464[_0x0baf('0x45')]=_[_0x0baf('0x46')](_0x37c038[_0x290464['id']],function(_0x354cb1){return{'id':_0x354cb1['id'],'fullname':_0x354cb1[_0x0baf('0x47')]};});}}catch(_0x53d6b7){_0x36c6d2(_0x53d6b7);}_0x631f74(_0x290464);});}function getInteractionTags(_0x3573ce,_0x1435d5){return new BPromise(function(_0x4f1de9,_0x38006a){try{if(_0x3573ce[_0x0baf('0x48')]){_0x3573ce[_0x0baf('0x49')]=[];_0x3573ce[_0x0baf('0x48')][_0x0baf('0x4a')](',')[_0x0baf('0x4b')](function(_0x57b581){_0x3573ce[_0x0baf('0x49')][_0x0baf('0x4c')](_0x1435d5[_0x57b581]);});}delete _0x3573ce['TagIds'];}catch(_0x35d442){_0x38006a(_0x35d442);}_0x4f1de9(_0x3573ce);});}function updateChatInteraction(_0x412e6f,_0x45c6aa,_0x57903e){return new BPromise(function(_0x504031,_0x193fd3){return getInteractionUsers(_0x412e6f,_0x57903e)[_0x0baf('0x24')](function(_0x301412){return getInteractionTags(_0x301412,_0x45c6aa);})[_0x0baf('0x24')](function(_0x2b6d54){_0x504031(_0x2b6d54);})[_0x0baf('0x2e')](function(_0x33da34){_0x193fd3(_0x33da34);});});}exports[_0x0baf('0x4d')]=function(_0xce1bf0,_0x355033){var _0x56270e={},_0x2a2a7c={},_0x2bc755={'count':0x0,'rows':[]};var _0x1daf1d=_[_0x0baf('0x46')](db[_0x0baf('0x4e')]['rawAttributes'],function(_0x1e7364){return{'name':_0x1e7364[_0x0baf('0x4f')],'type':_0x1e7364[_0x0baf('0x50')][_0x0baf('0x51')]};});_0x2a2a7c[_0x0baf('0x52')]=_['map'](_0x1daf1d,_0x0baf('0x3f'));_0x2a2a7c[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0xce1bf0[_0x0baf('0x53')]);_0x2a2a7c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],_0x2a2a7c['query']);_0x56270e[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],qs['fields'](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]));_0x56270e[_0x0baf('0x57')]=_0x56270e[_0x0baf('0x57')][_0x0baf('0x59')]?_0x56270e[_0x0baf('0x57')]:_0x2a2a7c[_0x0baf('0x52')];if(!_0xce1bf0['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x56270e[_0x0baf('0x34')]=qs[_0x0baf('0x34')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x34')]);_0x56270e[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x56270e[_0x0baf('0x5c')]=qs['sort'](_0xce1bf0['query'][_0x0baf('0x5d')]);_0x56270e[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0xce1bf0[_0x0baf('0x53')],_0x2a2a7c[_0x0baf('0x55')]),_0x1daf1d);var _0x3403d5=[];var _0x4b492c=squel[_0x0baf('0x60')]()[_0x0baf('0x61')]('id')[_0x0baf('0x61')](_0x0baf('0x3f'))[_0x0baf('0x61')](_0x0baf('0x62'))['from'](_0x0baf('0x63'));var _0x5f123c=squel[_0x0baf('0x60')]()['field'](_0x0baf('0x64'))['field'](_0x0baf('0x65'))['field'](_0x0baf('0x66'))[_0x0baf('0x67')](_0x0baf('0x68'),'ui')[_0x0baf('0x69')](_0x0baf('0x6a'),'u','u.id\x20=\x20ui.UserId');var _0x21f179=squel[_0x0baf('0x60')]()[_0x0baf('0x67')](_0x0baf('0x6b'),'i')[_0x0baf('0x69')](_0x0baf('0x6c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0baf('0x69')](_0x0baf('0x6a'),'o',_0x0baf('0x6d'))[_0x0baf('0x69')](_0x0baf('0x6e'),'a',_0x0baf('0x6f'))[_0x0baf('0x69')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x0baf('0x69')](_0x0baf('0x70'),'it',_0x0baf('0x71'))[_0x0baf('0x69')](_0x0baf('0x63'),'t',_0x0baf('0x72'));var _0xaa4293=squel[_0x0baf('0x73')]();var _0x3d9a32=[];var _0x585969=squel[_0x0baf('0x73')]();var _0x268be8;if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]){_0x268be8=as[_0x0baf('0x75')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]);var _0x51d75f=_0x268be8[_0x0baf('0x76')];for(var _0x27f580=0x0;_0x27f580<_0x268be8[_0x0baf('0x77')][_0x0baf('0x59')];_0x27f580++){var _0x1c7d88=_0x268be8[_0x0baf('0x77')][_0x27f580];var _0x14e6d0='i';var _0x12543e=_['find'](_0x1daf1d,[_0x0baf('0x3f'),_0x1c7d88['field']]);if(!_0x12543e){switch(_0x1c7d88[_0x0baf('0x61')]){case'unreadMessages':if(_0x1c7d88['value']==0x1){_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x79'));}else{_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x7a'));}break;case _0x0baf('0x7b'):if(_0x1c7d88[_0x0baf('0x7c')]==='$substring'){if(_0x1c7d88['value'][_0x0baf('0x4a')]('\x20')[_0x0baf('0x59')]>0x1){_0xaa4293[_0x51d75f](_0x0baf('0x7d'),qs[_0x0baf('0x7e')](_0x1c7d88[_0x0baf('0x7f')]),null);}else{var _0x588b88='%'+_0x1c7d88[_0x0baf('0x7f')]+'%';_0xaa4293[_0x51d75f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x588b88,_0x588b88,_0x588b88);}}else{_0x12543e=_['find'](_0x1daf1d,['name',_0x0baf('0x80')]);_0x1c7d88['field']='ContactId';_0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);}break;case _0x0baf('0x84'):var _0x1a0a67=_0x1c7d88[_0x0baf('0x7f')][_0x0baf('0x4a')](',')[_0x0baf('0x46')](function(_0x1273f4){return Number(_0x1273f4);});_0x1a0a67['forEach'](function(_0x42e8ad){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x42e8ad+',%');});_0x3d9a32=_[_0x0baf('0x86')](_0x3d9a32,_0x1a0a67);break;case'User':if(_0x1c7d88[_0x0baf('0x7c')]===_0x0baf('0x87')){_0xaa4293[_0x51d75f](_0x0baf('0x88'),'%'+_0x1c7d88[_0x0baf('0x7f')]+'%',null);}else{_0x12543e=_[_0x0baf('0x89')](_0x1daf1d,[_0x0baf('0x3f'),_0x0baf('0x8a')]);_0x1c7d88['field']='UserId';_0xf45ec3=as['buildExpression'](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}break;case'body':_0xf45ec3=as['buildExpression']('me',null,_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3['value'][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);break;}}else{var _0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}}}else{var _0xfcc697=_(_0xce1bf0['query'])['keys']()['map'](function(_0x493784){return _['some'](_0x1daf1d,[_0x0baf('0x3f'),_0x493784])?_0x493784:undefined;})[_0x0baf('0x8b')]()[_0x0baf('0x7f')]();if(!_[_0x0baf('0x8c')](_0xfcc697)){_0xfcc697['forEach'](function(_0x1be7f2){if(_0x1be7f2===_0x0baf('0x8d')){_0x21f179['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x0baf('0x8e')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]));}else if(_0x1be7f2===_0x0baf('0x8f')){var _0x442e5f=JSON[_0x0baf('0x90')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x91')];var _0x399f40=JSON['parse'](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x92')];_0x21f179['where'](_0x0baf('0x93'),_0x442e5f,_0x399f40);}else{if(_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]==='null'){_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x94'));}else{_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x95'),_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]);}}});}if(_0xce1bf0['query']['read']){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x96')]==0x1){_0x21f179['having'](_0x0baf('0x97'));}else{_0x21f179[_0x0baf('0x78')](_0x0baf('0x98'));}}if(_0xce1bf0['query'][_0x0baf('0x99')]){_0x3d9a32=_[_0x0baf('0x9a')](_0xce1bf0[_0x0baf('0x53')]['tag'])?_0xce1bf0[_0x0baf('0x53')]['tag']:new Array(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x99')]);_0x3d9a32[_0x0baf('0x4b')](function(_0x2f009f){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x2f009f+',%');});}if(_0xce1bf0['query'][_0x0baf('0x9b')]){var _0x57f33c=_0xce1bf0['query'][_0x0baf('0x9b')][_0x0baf('0x9c')]('\x5c','\x5c\x5c')[_0x0baf('0x9c')](/'/g,'\x27\x27');if(qs[_0x0baf('0x9d')](_0x57f33c)){_0xaa4293['or'](_0x0baf('0x9e'),_0x57f33c+'%');}else{_0xaa4293['or'](_0x0baf('0x9f'),qs[_0x0baf('0x7e')](_0x57f33c))['or'](_0x0baf('0xa0'),_0x57f33c+'%');}}}_0x21f179[_0x0baf('0x5e')](_0xaa4293);_0x21f179[_0x0baf('0xa1')](_0x0baf('0xa2'));var _0x2c2f09={'type':db['Sequelize']['QueryTypes'][_0x0baf('0xa3')],'raw':!![]};var _0x322a09=_0x21f179[_0x0baf('0xa4')]();_0x322a09['field']('i.id');_0x322a09[_0x0baf('0x61')](_0x0baf('0xa5'),_0x0baf('0xa6'));if(_0x56270e[_0x0baf('0x5c')]){_0x56270e[_0x0baf('0x5c')][_0x0baf('0x4b')](function(_0x191d35){var _0xa2d315=_0x191d35[0x0]===_0x0baf('0xa7')?_0x191d35[0x0]:'i.'+_0x191d35[0x0];_0x21f179['order'](_0xa2d315,_0x191d35[0x1]===_0x0baf('0xa8')?![]:!![]);});}if(!_[_0x0baf('0x8c')](_0x3d9a32)){_0x21f179[_0x0baf('0x78')](_0x585969);_0x322a09[_0x0baf('0x5e')]('t.id\x20IN\x20?',_0x3d9a32);}BPromise['resolve']()['then'](function(){if(!_0x268be8){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return;_0x322a09['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x21f179[_0x0baf('0x5e')](_0x0baf('0xa9'));return;}if(_0xce1bf0['user'][_0x0baf('0xaa')]!==_0x0baf('0x42'))return;return _0xce1bf0[_0x0baf('0xab')][_0x0baf('0xac')]({'attributes':['id'],'raw':!![]})[_0x0baf('0x24')](function(_0x25081e){if(_[_0x0baf('0x8c')](_0x25081e)){_0x322a09[_0x0baf('0x5e')](_0x0baf('0xad'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xad'));}else{_0x322a09[_0x0baf('0x5e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0baf('0x46')](_0x25081e,'id'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xae'),_[_0x0baf('0x46')](_0x25081e,'id'));}});})[_0x0baf('0x24')](function(){if(_0xce1bf0[_0x0baf('0xab')]['role']===_0x0baf('0x42')&&!_0x268be8&&!_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return[];return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x322a09['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x30eac8){_0x2bc755[_0x0baf('0x35')]=_0x30eac8[_0x0baf('0x59')];if(_0x2bc755[_0x0baf('0x35')]===0x0)return[];return db['sequelize']['query'](_0x4b492c[_0x0baf('0xb0')](),_0x2c2f09)['then'](function(_0x477cd5){_0x3403d5=_['keyBy'](_0x477cd5,'id');_0x2c2f09=_[_0x0baf('0xb1')](_0x2c2f09,{'model':db[_0x0baf('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]){_0x56270e['attributes'][_0x0baf('0x4b')](function(_0x106ffa){_0x21f179[_0x0baf('0x61')]('i.'+_0x106ffa);});}else{_0x21f179['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x21f179['field'](_0x0baf('0xb2'),_0x0baf('0xb3'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xb4'),'Account.mandatoryDisposition');_0x21f179[_0x0baf('0x61')](_0x0baf('0xb5'),_0x0baf('0xa7'));_0x21f179['field'](_0x0baf('0xb6'));_0x21f179[_0x0baf('0x61')]('c.firstName',_0x0baf('0xb7'));_0x21f179['field'](_0x0baf('0xb8'),_0x0baf('0xb9'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xba'),'Contact.email');_0x21f179['field'](_0x0baf('0xbb'),'Contact.phone');_0x21f179[_0x0baf('0x61')](_0x0baf('0xbc'),_0x0baf('0xbd'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xbe'),'Contact.fax');_0x21f179[_0x0baf('0x61')]('o.fullname',_0x0baf('0xbf'));_0x21f179['field'](_0x0baf('0xc0'),'Owner.internal');_0x21f179[_0x0baf('0x61')](_0x0baf('0xc1'),_0x0baf('0x48'));}if(_0x56270e['limit'])_0x21f179['limit'](_0x56270e[_0x0baf('0x34')]);if(_0x56270e[_0x0baf('0x36')])_0x21f179[_0x0baf('0x36')](_0x56270e[_0x0baf('0x36')]);return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x21f179['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x5ee37f){if(_0x5ee37f[_0x0baf('0x59')]>0x0)_0x5f123c['where'](_0x0baf('0xc2'),_[_0x0baf('0x46')](_0x5ee37f,'id'));return db[_0x0baf('0xaf')]['query'](_0x5f123c[_0x0baf('0xb0')](),_0x2c2f09)[_0x0baf('0x24')](function(_0x4879b4){var _0x544498=_[_0x0baf('0xc3')](_0x4879b4,_0x0baf('0xc4'));var _0x20dd04=[];_0x5ee37f[_0x0baf('0x4b')](function(_0x4823a3){_0x20dd04['push'](updateChatInteraction(_0x4823a3,_0x3403d5,_0x544498));});return BPromise[_0x0baf('0xc5')](_0x20dd04);});});})[_0x0baf('0x24')](function(_0x116d52){_0x2bc755[_0x0baf('0xc6')]=_0x116d52;return _0x2bc755;})[_0x0baf('0x24')](respondWithFilteredResult(_0x355033,_0x56270e))[_0x0baf('0x2e')](handleError(_0x355033,null));};exports[_0x0baf('0xc7')]=function(_0xe0b67c,_0x205de6){var _0x2369f0={'raw':![],'where':{'id':_0xe0b67c[_0x0baf('0xc8')]['id']}},_0x58f95c={};_0x58f95c['model']=_[_0x0baf('0x54')](db[_0x0baf('0x4e')][_0x0baf('0xc9')]);_0x58f95c[_0x0baf('0x53')]=_['keys'](_0xe0b67c[_0x0baf('0x53')]);_0x58f95c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],_0x58f95c[_0x0baf('0x53')]);_0x2369f0[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0xe0b67c['query'][_0x0baf('0x58')]));_0x2369f0[_0x0baf('0x57')]=_0x2369f0['attributes'][_0x0baf('0x59')]?_0x2369f0[_0x0baf('0x57')]:_0x58f95c[_0x0baf('0x52')];if(_0xe0b67c[_0x0baf('0x53')][_0x0baf('0xca')]){_0x2369f0[_0x0baf('0xcb')]=[{'all':!![]}];}_0x2369f0=_[_0x0baf('0xb1')]({},_0x2369f0,_0xe0b67c[_0x0baf('0xcc')]);return db[_0x0baf('0x4e')]['find'](_0x2369f0)[_0x0baf('0x24')](handleEntityNotFound(_0x205de6,null))[_0x0baf('0x24')](respondWithResult(_0x205de6,null))[_0x0baf('0x2e')](handleError(_0x205de6,null));};exports[_0x0baf('0xcd')]=function(_0x4328d5,_0x270d69){return db['ChatInteraction'][_0x0baf('0xcd')](_0x4328d5[_0x0baf('0x40')],{})[_0x0baf('0x24')](respondWithResult(_0x270d69,0xc9))['catch'](handleError(_0x270d69,null));};exports['update']=function(_0x5adbd9,_0x1adb84){if(_0x5adbd9[_0x0baf('0x40')]['id']){delete _0x5adbd9['body']['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x5adbd9[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1adb84,null))[_0x0baf('0x24')](saveUpdates(_0x5adbd9[_0x0baf('0x40')],null))['then'](respondWithResult(_0x1adb84,null))[_0x0baf('0x2e')](handleError(_0x1adb84,null));};exports[_0x0baf('0x3d')]=function(_0x25d25e,_0x4494de){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x25d25e[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4494de,null))[_0x0baf('0x24')](removeEntity(_0x4494de,null))[_0x0baf('0x2e')](handleError(_0x4494de,null));};exports[_0x0baf('0xce')]=function(_0x2e1629,_0x275cc4){return db[_0x0baf('0x4e')][_0x0baf('0xce')]()[_0x0baf('0x24')](respondWithResult(_0x275cc4,null))[_0x0baf('0x2e')](handleError(_0x275cc4,null));};exports[_0x0baf('0xcf')]=function(_0x308b3f,_0xae8bc2){var _0x1390cd=_0x308b3f[_0x0baf('0xc8')]['id'];var _0x59dd6c;var _0x57b64b;var _0x1cd215;return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x1390cd}})[_0x0baf('0x24')](function(_0x52e98a){_0x59dd6c=_0x52e98a;return db[_0x0baf('0xd1')][_0x0baf('0xd0')]({'where':{'id':_0x52e98a[_0x0baf('0x8d')]},'attributes':['id',_0x0baf('0xd2'),_0x0baf('0xd3'),_0x0baf('0xd4'),'vidaooNote',_0x0baf('0xd5')],'raw':!![]});})[_0x0baf('0x24')](function(_0x347c39){if(_0x347c39&&_0x347c39['vidaooApiKey']&&_0x347c39[_0x0baf('0xd3')]){_0x57b64b=_0x347c39;var _0x106c6e={'interaction':{'id':_0x1390cd},'agent':{'id':_0x308b3f[_0x0baf('0xab')]['id'],'name':_0x308b3f['user']['name'],'fullname':_0x308b3f['user'][_0x0baf('0x47')],'email':_0x308b3f['user'][_0x0baf('0xd6')]},'contact':_0x308b3f[_0x0baf('0x40')]['contact'],'account':_0x308b3f[_0x0baf('0x40')]['account']};var _0x5737b0={'rejectUnauthorized':![],'method':_0x0baf('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x347c39[_0x0baf('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x308b3f['user']['email']],'buttons':null,'topic':_0x57b64b['vidaooTopic'],'note':_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd9')])?null:getMustacheRender(_0x57b64b[_0x0baf('0xd9')],_0x106c6e),'metadata':null},'redirect':_0x0baf('0xda'),'json':!![]};try{if(!_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd5')])){var _0x20582a=getMustacheRender(_0x57b64b['vidaooMetadata'],_0x106c6e);var _0x36cd08=JSON[_0x0baf('0x90')](_0x20582a);_0x5737b0[_0x0baf('0x40')]['metadata']=_0x36cd08;}}catch(_0x24672f){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5737b0);}else{throw new db[(_0x0baf('0xdb'))]['ValidationError'](_0x0baf('0xdd'));}})[_0x0baf('0x24')](function(_0x57846e){_0x1cd215=_0x57846e;if(_0x1cd215['id']){var _0xd4ed40={'body':_0x1cd215[_0x0baf('0xde')],'ChatWebsiteId':_0x57b64b['id'],'ChatInteractionId':_0x59dd6c['id'],'direction':_0x0baf('0xdf'),'UserId':_0x308b3f[_0x0baf('0xab')]['id']};return db['ChatMessage'][_0x0baf('0xcd')](_0xd4ed40,{});}else{throw new db[(_0x0baf('0xdb'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x0baf('0x24')](function(){return _0x59dd6c[_0x0baf('0xe0')]({'vidaooSessionId':_0x1cd215['id']});})[_0x0baf('0x24')](respondWithResult(_0xae8bc2,null))[_0x0baf('0x2e')](handleError(_0xae8bc2,null));};exports['customUpdate']=function(_0x5571d4,_0x16579f){if(_0x5571d4[_0x0baf('0x40')]['id']){delete _0x5571d4[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x5571d4['params']['id']},'include':[{'model':db[_0x0baf('0xe1')],'as':_0x0baf('0x7b')}]})['then'](handleEntityNotFound(_0x16579f,null))[_0x0baf('0x24')](saveUpdates(_0x5571d4[_0x0baf('0x40')],null))['then'](respondWithResult(_0x16579f,null))[_0x0baf('0x2e')](handleError(_0x16579f,null));};exports[_0x0baf('0xe2')]=function(_0x19457c,_0x1f0b00,_0x2484d4){if(_0x19457c[_0x0baf('0x40')]['id']){delete _0x19457c[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x19457c[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](function(_0x226edd){if(!_0x226edd){logger[_0x0baf('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0baf('0xe2'),0x194,_0x0baf('0xe3'));_0x1f0b00['sendStatus'](0x194);}else{if(_0x226edd[_0x0baf('0x8a')]){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))](_0x0baf('0xe4'));}}return _0x226edd;})['then'](function(_0x3ca1a6){if(_0x3ca1a6){return _0x3ca1a6[_0x0baf('0x3c')]({'closed':_0x19457c[_0x0baf('0x40')][_0x0baf('0xe5')],'disposition':_0x19457c[_0x0baf('0x40')]['disposition']})[_0x0baf('0x24')](function(_0xc5ec1a){return _0xc5ec1a;});}})[_0x0baf('0x24')](function(_0x5d33b4){return respondWithRpcPromise(_0x0baf('0xe6'),_0x0baf('0xe2'),_0x19457c[_0x0baf('0x40')],client9004);})[_0x0baf('0x24')](respondWithResult(_0x1f0b00,null))[_0x0baf('0x2e')](handleError(_0x1f0b00,null));};exports['attachmentUpload']=function(_0x553084,_0x19898e,_0x315ada){_0x553084[_0x0baf('0x40')]['name']=_0x553084[_0x0baf('0xe7')][_0x0baf('0xe8')];_0x553084[_0x0baf('0x40')][_0x0baf('0xe9')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xea')];_0x553084[_0x0baf('0x40')][_0x0baf('0x50')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xeb')];return db['Attachment'][_0x0baf('0xcd')](_0x553084[_0x0baf('0x40')])[_0x0baf('0x24')](respondWithResult(_0x19898e,0xc9))[_0x0baf('0x2e')](handleError(_0x19898e,null));};exports['attachmentDownload']=function(_0x413d0d,_0x3d7667,_0x386928){return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0xc8')]['id']},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null))[_0x0baf('0x24')](function(_0x1e4bf1){if(_0x1e4bf1){if(_0x1e4bf1['closed']){return _0x3d7667[_0x0baf('0x30')](0x193)[_0x0baf('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0x53')][_0x0baf('0xec')]},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null));}})[_0x0baf('0x24')](function(_0xb22125){if(_0xb22125){var _0x37c83a=_0xb22125['ChatOfflineMessageId']!==null;var _0x5deb7b=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0xef'));if(_0x37c83a){_0x5deb7b=path['join'](_0x5deb7b,_0x0baf('0xf0'));}var _0x3a6bf8=path['join'](_0x5deb7b,_0xb22125[_0x0baf('0xe9')]);return _0x3d7667[_0x0baf('0xf1')](_0x3a6bf8);}})['catch'](handleError(_0x3d7667,null));};exports[_0x0baf('0xf2')]=function(_0x9d6974,_0x939365){var _0x4d6ac4=null;var _0x1d86c9=null;var _0x95fe84=null;var _0x2a7138=null;if(_0x9d6974[_0x0baf('0x40')]['id']){delete _0x9d6974[_0x0baf('0x40')]['id'];}if(_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]){_0x2a7138=path['join'](config[_0x0baf('0xee')],'server/files/chat/upload/',util[_0x0baf('0xf4')](_0x0baf('0xf5'),Date['now']()));_0x9d6974['body'][_0x0baf('0xf6')]=_0x2a7138;}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x9d6974['params']['id']},'include':[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'include':[{'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9')}]}]})[_0x0baf('0x24')](handleEntityNotFound(_0x939365,null))[_0x0baf('0x24')](saveUpdates(_0x9d6974[_0x0baf('0x40')],null))[_0x0baf('0x24')](function(_0x5f3691){if(_0x5f3691){_0x4d6ac4=_0x5f3691;return db['ChatWebsite'][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x8d')]}});}})['then'](function(_0x210047){if(_0x210047){_0x95fe84=_0x210047;return db[_0x0baf('0xe1')][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x80')]}});}})[_0x0baf('0x24')](function(_0x8806f9){if(_0x8806f9){_0x1d86c9=_0x8806f9;if(_0x2a7138){var _0x1cb69a=null;for(var _0x4bc31f=0x1;_0x4bc31f<_0x4d6ac4[_0x0baf('0xf8')]['length'];++_0x4bc31f){_0x1cb69a=_0x4d6ac4[_0x0baf('0xf8')][_0x4bc31f];var _0x32abf2=_0x1cb69a['UserId']?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');var _0x4759d5=_0x9d6974[_0x0baf('0x40')][_0x0baf('0xfd')]||util['format']('%s%d','Visitor',_0x1cb69a[_0x0baf('0x80')]);switch(_0x95fe84['agentIdentifier']){case _0x0baf('0xfe'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format']('%s%d',_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');break;case _0x0baf('0xff'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x100')]||_0x1cb69a[_0x0baf('0xf9')][_0x0baf('0x47')]:_0x0baf('0xfc');break;case _0x0baf('0x101'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x47')]:_0x0baf('0xfc');break;default:_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a['UserId']):_0x0baf('0xfc');}var _0xe93008=util[_0x0baf('0xf4')](_0x0baf('0x102'),moment(_0x1cb69a['createdAt'])['format'](_0x0baf('0x103')),_0x1cb69a[_0x0baf('0x104')]==='in'?_0x4759d5:_0x32abf2,_0x1cb69a['body']);if(!_0x1cb69a[_0x0baf('0x105')]){fs[_0x0baf('0x106')](_0x2a7138,_0xe93008);}}return db[_0x0baf('0x107')][_0x0baf('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x0baf('0x108')],'as':'Smtp','raw':!![]}]});}}})[_0x0baf('0x24')](function(_0x1fe362){if(_0x1fe362&&_0x1fe362[_0x0baf('0x109')]&&_0x9d6974[_0x0baf('0x40')]){var _0x51287e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe362[_0x0baf('0x109')]['service']){_0x51287e[_0x0baf('0x10a')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10a')];}else{_0x51287e['host']=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10b')];_0x51287e[_0x0baf('0x10c')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10c')];_0x51287e[_0x0baf('0x10d')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10d')];}if(_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10e')]){_0x51287e[_0x0baf('0x10f')]={'user':_0x1fe362[_0x0baf('0x109')]['user'],'pass':_0x1fe362['Smtp'][_0x0baf('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51287e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1fe362[_0x0baf('0x3f')],_0x1fe362[_0x0baf('0xd6')]||_0x1fe362['Smtp']['user']),'to':_0x9d6974['body']['mailTranscript'],'subject':_0x0baf('0x111'),'text':util['format'](_0x0baf('0x112'),_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]),'attachments':[{'path':_0x2a7138}]}})[_0x0baf('0x24')](function(){return _0x4d6ac4;})[_0x0baf('0x2e')](function(_0x292469){console[_0x0baf('0x2a')](_0x292469);});}else{return _0x4d6ac4;}})[_0x0baf('0x24')](respondWithStatusCode(_0x939365,0xc8))['catch'](handleError(_0x939365,null));};exports['addMessage']=function(_0x2d7ec3,_0x2a4d79,_0x5ebcad){return db[_0x0baf('0xf7')]['find']({'where':{'id':_0x2d7ec3[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x2a4d79,null))['then'](function(_0x4621ba){if(_0x4621ba){return _0x4621ba[_0x0baf('0x113')](_0x2d7ec3[_0x0baf('0x40')][_0x0baf('0x114')],_[_0x0baf('0x115')](_0x2d7ec3[_0x0baf('0x40')],[_0x0baf('0x114'),'id'])||{});}})[_0x0baf('0x24')](respondWithResult(_0x2a4d79,null))[_0x0baf('0x2e')](handleError(_0x2a4d79,null));};exports[_0x0baf('0x116')]=function(_0x425869,_0x4059e1,_0x2c94ff){var _0x738da0={'raw':![],'where':{}};var _0x268a1c={};var _0x34cb32={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x425869[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4059e1,null))[_0x0baf('0x24')](function(_0x39526b){if(_0x39526b){_0x268a1c['model']=_[_0x0baf('0x54')](db['ChatMessage'][_0x0baf('0xc9')]);_0x268a1c['query']=_[_0x0baf('0x54')](_0x425869['query']);_0x268a1c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],_0x268a1c[_0x0baf('0x53')]);_0x738da0['attributes']=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x425869[_0x0baf('0x53')]['fields']));_0x738da0['attributes']=_0x738da0[_0x0baf('0x57')][_0x0baf('0x59')]?_0x738da0[_0x0baf('0x57')]:_0x268a1c[_0x0baf('0x52')];if(!_0x425869['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x738da0[_0x0baf('0x34')]=qs['limit'](_0x425869['query'][_0x0baf('0x34')]);_0x738da0['offset']=qs[_0x0baf('0x36')](_0x425869['query'][_0x0baf('0x36')]);}_0x738da0[_0x0baf('0x5c')]=qs[_0x0baf('0x5d')](_0x425869['query'][_0x0baf('0x5d')]);_0x738da0[_0x0baf('0x5e')]=qs['filters'](_['pick'](_0x425869[_0x0baf('0x53')],_0x268a1c['filters']));_0x738da0[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x39526b['id'];if(_0x425869['query']['filter']){_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],{'$or':_[_0x0baf('0x46')](_0x738da0['attributes'],function(_0x309220){var _0x376eb3={};_0x376eb3[_0x309220]={'$like':'%'+_0x425869['query'][_0x0baf('0x9b')]+'%'};return _0x376eb3;})});}if(_0x425869[_0x0baf('0x53')][_0x0baf('0x91')]){var _0x2ef76b=_0x425869[_0x0baf('0x53')]['$gte'][_0x0baf('0x4a')](',');var _0x4ca9ea={};_0x4ca9ea[_0x2ef76b[0x0]]={'$gte':moment(_0x2ef76b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],_0x4ca9ea);}_0x738da0=_[_0x0baf('0xb1')]({},_0x738da0,_0x425869[_0x0baf('0xcc')]);return db['ChatMessage'][_0x0baf('0x35')]({'where':_0x738da0[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x3d6ece){_0x34cb32[_0x0baf('0x35')]=_0x3d6ece;if(_0x425869[_0x0baf('0x53')][_0x0baf('0xca')]){_0x738da0[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')][_0x0baf('0x117')](_0x738da0);})['then'](function(_0x19727f){_0x34cb32[_0x0baf('0xc6')]=_0x19727f;return _0x34cb32;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x4059e1,_0x738da0))[_0x0baf('0x2e')](handleError(_0x4059e1,null));};exports[_0x0baf('0x118')]=function(_0x57b26e,_0x3a0a2f,_0x5b676d){var _0x298155={'where':{}},_0xff9b69={},_0x5398c6={'count':0x0,'rows':[]};return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x57b26e[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x3a0a2f,null))['then'](function(_0x2edcf9){if(_0x2edcf9){_0xff9b69[_0x0baf('0x52')]=_[_0x0baf('0x54')](db[_0x0baf('0xf7')][_0x0baf('0xc9')]);_0xff9b69[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0x57b26e[_0x0baf('0x53')]);_0xff9b69[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],_0xff9b69[_0x0baf('0x53')]);_0x298155[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x58')]));_0x298155['attributes']=_0x298155[_0x0baf('0x57')][_0x0baf('0x59')]?_0x298155[_0x0baf('0x57')]:_0xff9b69[_0x0baf('0x52')];if(!_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x298155['limit']=qs[_0x0baf('0x34')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x34')]);_0x298155[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x298155['order']=qs[_0x0baf('0x5d')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5d')]);_0x298155[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0x57b26e['query'],_0xff9b69[_0x0baf('0x55')]));_0x298155[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x2edcf9['id'];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]){_0x298155['where']=_['merge'](_0x298155[_0x0baf('0x5e')],{'$or':_[_0x0baf('0x46')](_0x298155[_0x0baf('0x57')],function(_0x2d43ac){var _0x34126b={};_0x34126b[_0x2d43ac]={'$like':'%'+_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]+'%'};return _0x34126b;})});}_0x298155[_0x0baf('0x5e')][_0x0baf('0x105')]=![];if(_0x57b26e[_0x0baf('0x53')]['id']){_0x298155[_0x0baf('0x5e')]['id']={'$gt':_0x57b26e[_0x0baf('0x53')]['id']};}_0x298155=_[_0x0baf('0xb1')]({},_0x298155,_0x57b26e[_0x0baf('0xcc')]);return db[_0x0baf('0xf7')][_0x0baf('0x35')]({'where':_0x298155[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x18d219){_0x5398c6[_0x0baf('0x35')]=_0x18d219;_0x298155[_0x0baf('0xcb')]=[];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x119')]){_0x298155[_0x0baf('0xcb')][_0x0baf('0x4c')]({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id','fullname',_0x0baf('0x100')]});}if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0xca')]){_0x298155[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')]['findAll'](_0x298155);})[_0x0baf('0x24')](function(_0x344fef){_0x5398c6[_0x0baf('0xc6')]=_0x344fef;return _0x5398c6;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x3a0a2f,_0x298155))[_0x0baf('0x2e')](handleError(_0x3a0a2f,null));};exports[_0x0baf('0x11a')]=function(_0x3358f5,_0x237a20,_0x26dd4c){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x3358f5[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x237a20,null))[_0x0baf('0x24')](function(_0x2867b7){if(_0x2867b7){return _0x2867b7[_0x0baf('0x11b')](_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')],_['omit'](_0x3358f5[_0x0baf('0x40')],['ids','id'])||{})['spread'](function(){return db[_0x0baf('0x84')][_0x0baf('0x117')]({'attributes':['id',_0x0baf('0x3f'),'color'],'where':{'id':_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')]}});})[_0x0baf('0x24')](function(_0x24bc8f){socket[_0x0baf('0x11c')](_0x0baf('0x11d'),{'id':Number(_0x3358f5['params']['id']),'tags':_0x24bc8f||[]});return{'id':Number(_0x3358f5[_0x0baf('0xc8')]['id']),'tags':_0x24bc8f||[]};});}})[_0x0baf('0x24')](respondWithResult(_0x237a20,null))[_0x0baf('0x2e')](handleError(_0x237a20,null));};exports[_0x0baf('0x11e')]=function(_0x262063,_0x216897,_0x4c2bae){return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x262063[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x216897,null))['then'](function(_0x56da3e){if(_0x56da3e){return _0x56da3e[_0x0baf('0x11e')](_0x262063[_0x0baf('0x53')][_0x0baf('0x114')]);}})['then'](respondWithStatusCode(_0x216897,null))[_0x0baf('0x2e')](handleError(_0x216897,null));};exports[_0x0baf('0xf1')]=function(_0x51d2aa,_0x26d73d){var _0x20cc18=moment()[_0x0baf('0x11f')]()[_0x0baf('0xb0')]();var _0x3fa8eb=path[_0x0baf('0xed')](config[_0x0baf('0xee')],'server','files',_0x0baf('0x120'));var _0x1bd67f=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x122'),_0x0baf('0x123'));var _0x4316c5=path[_0x0baf('0xed')](_0x3fa8eb,_0x20cc18);var _0x1d5b73=util['format']('transcript-%d-%s.zip',_0x51d2aa[_0x0baf('0xc8')]['id'],_0x20cc18);var _0x2a84f8=path[_0x0baf('0xed')](_0x3fa8eb,_0x1d5b73);var _0x552504=[];_0x552504['push']({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id',_0x0baf('0x47')],'raw':!![]});_0x552504[_0x0baf('0x4c')]({'model':db['CmContact'],'as':_0x0baf('0x7b'),'attributes':['id',_0x0baf('0x124'),_0x0baf('0x125')],'raw':!![]});if(_0x51d2aa[_0x0baf('0x53')][_0x0baf('0x123')]){_0x552504[_0x0baf('0x4c')]({'model':db[_0x0baf('0x126')],'as':_0x0baf('0x126'),'raw':!![]});}var _0x5bbd33=[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'attributes':['id',_0x0baf('0x40'),_0x0baf('0x8f'),_0x0baf('0x104'),_0x0baf('0x105'),'read'],'include':_0x552504}];_0x5bbd33[_0x0baf('0x4c')]({'model':db[_0x0baf('0xd1')],'as':'Account','attributes':['id','name']});_0x5bbd33[_0x0baf('0x4c')]({'model':db['User'],'as':_0x0baf('0x127'),'attributes':['id',_0x0baf('0x47')]});return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x51d2aa['params']['id']},'include':_0x5bbd33})[_0x0baf('0x24')](handleEntityNotFound(_0x26d73d,null))[_0x0baf('0x24')](function(_0x32c2a8){if(_0x32c2a8){var _0x58fea2=_0x32c2a8[_0x0baf('0x128')]({'plain':!![]});fs[_0x0baf('0x129')](_0x4316c5);var _0x5f5d45={'channel':_0x0baf('0x12a'),'account':_0x58fea2['Account'][_0x0baf('0x3f')],'agent':_0x58fea2[_0x0baf('0x127')]?_0x58fea2[_0x0baf('0x127')][_0x0baf('0x47')]:'N.A.','createdAt':moment(_0x58fea2[_0x0baf('0x8f')])[_0x0baf('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0baf('0xb0')](),'closedAt':_0x58fea2[_0x0baf('0xe5')]?moment(_0x58fea2['closedAt'])[_0x0baf('0xf4')](_0x0baf('0x12b'))['toString']():'','disposition':_0x58fea2[_0x0baf('0x12c')],'chatInfo':{'browser':_0x58fea2[_0x0baf('0x12d')],'os':_0x58fea2[_0x0baf('0x12e')],'referer':_0x58fea2[_0x0baf('0x12f')],'customerIp':_0x58fea2[_0x0baf('0x130')],'customerPort':_0x58fea2[_0x0baf('0x131')]?_0x58fea2['customerPort']:_0x0baf('0x132')},'messages':_(_0x58fea2[_0x0baf('0xf8')])[_0x0baf('0x133')]()[_0x0baf('0x9b')]({'secret':![]})[_0x0baf('0x46')](function(_0x1ca912){if(_0x1ca912[_0x0baf('0x126')]){var _0x70e2e=path[_0x0baf('0xed')](_0x1bd67f,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')]);if(fs[_0x0baf('0x134')](_0x70e2e)){fs[_0x0baf('0x135')](_0x70e2e)[_0x0baf('0x136')](fs[_0x0baf('0x137')](path[_0x0baf('0xed')](_0x4316c5,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')])));}}return{'date':moment(_0x1ca912[_0x0baf('0x8f')])[_0x0baf('0xf4')](_0x0baf('0x12b'))[_0x0baf('0xb0')](),'sender':_0x1ca912['direction']===_0x0baf('0xdf')?_0x1ca912[_0x0baf('0xf9')]?_0x1ca912['User']['fullname']:'System':_0x1ca912[_0x0baf('0x7b')]['firstName']+(_0x1ca912['Contact']['lastName']?'\x20'+_0x1ca912[_0x0baf('0x7b')][_0x0baf('0x125')]:''),'body':_0x1ca912[_0x0baf('0x126')]?_0x1ca912['Attachment'][_0x0baf('0xe9')]:_0x1ca912['body'],'direction':_0x1ca912['direction']===_0x0baf('0xdf')?'A':'C','secret':_0x1ca912[_0x0baf('0x105')],'read':_0x1ca912[_0x0baf('0x96')],'attachment':_0x1ca912['Attachment']};})['value']()};return ejs[_0x0baf('0x138')](path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x139'),_0x0baf('0x13a')),{'interaction':_0x5f5d45})['then'](function(_0x4c1f01){var _0x217cd8=path[_0x0baf('0xed')](_0x4316c5,'transcript-'+_0x58fea2['id']+'-'+_0x20cc18+_0x0baf('0x13b'));var _0x223d32={'path':_0x217cd8,'channel':_0x0baf('0x12a'),'interactionId':_0x58fea2['id']};return pdf[_0x0baf('0x13c')](_0x4c1f01,_0x223d32);})['then'](function(){return new BPromise(function(_0xcca408,_0x557ec9){zipdir(_0x4316c5,{'saveTo':_0x2a84f8},function(_0x479231,_0x320409){if(_0x479231)return _0x557ec9(_0x479231);return _0xcca408(_0x320409);});})['then'](function(){return new BPromise(function(_0x4a0f32,_0xc6fc4d){rimraf(_0x4316c5,function(_0x46b904){if(_0x46b904)_0xc6fc4d(_0x46b904);return _0x4a0f32();});});})['then'](function(){return _0x26d73d[_0x0baf('0xf1')](_0x2a84f8,_0x1d5b73,function(_0x2dea20){if(_0x2dea20){console[_0x0baf('0x13d')](_0x0baf('0x13e'),_0x2dea20);}else{fs[_0x0baf('0x13f')](_0x2a84f8);}});});});}else{return _0x26d73d[_0x0baf('0x2f')](0xc8);}})['catch'](handleError(_0x26d73d,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 28d6f88..051b8cb 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 _0x4ecc=['map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','Users'];(function(_0x408753,_0x5176e1){var _0x1ba6f1=function(_0x2ed00d){while(--_0x2ed00d){_0x408753['push'](_0x408753['shift']());}};_0x1ba6f1(++_0x5176e1);}(_0x4ecc,0x177));var _0xc4ec=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x4ecc[_0xca1f0e];return _0x35e4ef;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xc4ec('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xc4ec('0x0'))['db'][_0xc4ec('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc4ec('0x2')](0x0);var events={'afterCreate':_0xc4ec('0x3'),'afterUpdate':_0xc4ec('0x4'),'afterDestroy':_0xc4ec('0x5')};function emitEvent(_0x448c21){return function(_0x4624a4,_0x86ef0d,_0x147f2c){_0x4624a4[_0xc4ec('0x6')]({'attributes':['id'],'raw':!![]})[_0xc4ec('0x7')](function(_0x29e24f){_0x4624a4['setDataValue'](_0xc4ec('0x8'),_0x29e24f[_0xc4ec('0x9')](function(_0x129175){return{'id':_0x129175['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4624a4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3fc874){_0x4624a4['setDataValue'](_0xc4ec('0xa'),_0x3fc874['length']);ChatInteractionEvents[_0xc4ec('0xb')](_0x448c21+':'+_0x4624a4['id'],_0x4624a4);ChatInteractionEvents['emit'](_0x448c21,_0x4624a4);_0x147f2c(null);})[_0xc4ec('0xc')](_0x147f2c(null));};}for(var e in events){if(events[_0xc4ec('0xd')](e)){var event=events[e];ChatInteraction[_0xc4ec('0xe')](e,emitEvent(event));}}module[_0xc4ec('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+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
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 601220b..18f3767 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 _0xc23c=['request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0xc23c,0x187));var _0xcc23=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xc23c[_0x2a9f4];return _0x3c39e0;};'use strict';var _=require(_0xcc23('0x0'));var util=require(_0xcc23('0x1'));var logger=require('../../config/logger')(_0xcc23('0x2'));var moment=require(_0xcc23('0x3'));var BPromise=require(_0xcc23('0x4'));var rp=require(_0xcc23('0x5'));var fs=require('fs');var path=require(_0xcc23('0x6'));var rimraf=require('rimraf');var config=require(_0xcc23('0x7'));var attributes=require(_0xcc23('0x8'));module[_0xcc23('0x9')]=function(_0x5a6a89,_0x2a3791){return _0x5a6a89[_0xcc23('0xa')]('ChatInteraction',attributes,{'tableName':_0xcc23('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x298aed,_0x115710,_0x54d54e){if(_0x298aed[_0xcc23('0xc')](_0xcc23('0xd'))){_0x298aed[_0xcc23('0xe')]=moment()[_0xcc23('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x54d54e(null,_0x298aed);}},'charset':_0xcc23('0x10'),'collate':_0xcc23('0x11')});};
\ No newline at end of file
+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
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 0be062f..60e7e65 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 _0x620f=['spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','ChatInteraction','update','body','options','raw','attributes','limit','UpdateChatInteraction','catch','AddTagsToChatInteraction','omit'];(function(_0xf13d0d,_0x3df04c){var _0x4e55f2=function(_0xe546eb){while(--_0xe546eb){_0xf13d0d['push'](_0xf13d0d['shift']());}};_0x4e55f2(++_0x3df04c);}(_0x620f,0x1af));var _0xf620=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x620f[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xf620('0x0'));var moment=require(_0xf620('0x1'));var BPromise=require(_0xf620('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf620('0x3'));var db=require(_0xf620('0x4'))['db'];var utils=require(_0xf620('0x5'));var logger=require(_0xf620('0x6'))(_0xf620('0x7'));var config=require(_0xf620('0x8'));var jayson=require(_0xf620('0x9'));var client=jayson['client'][_0xf620('0xa')]({'port':0x232a});config[_0xf620('0xb')]=_[_0xf620('0xc')](config[_0xf620('0xb')],{'host':_0xf620('0xd'),'port':0x18eb});var socket=require(_0xf620('0xe'))(new Redis(config[_0xf620('0xb')]));require(_0xf620('0xf'))['register'](socket);function respondWithRpcPromise(_0x5ed84c,_0x1e7b1e,_0x2d059d){return new BPromise(function(_0x8bd8f3,_0x1d627f){return client['request'](_0x5ed84c,_0x2d059d)[_0xf620('0x10')](function(_0x4a462d){logger['info'](_0xf620('0x11'),_0x1e7b1e,_0xf620('0x12'));logger[_0xf620('0x13')](_0xf620('0x14'),_0x1e7b1e,'request\x20sent',JSON[_0xf620('0x15')](_0x4a462d));if(_0x4a462d[_0xf620('0x16')]){if(_0x4a462d[_0xf620('0x16')]['code']===0x1f4){logger[_0xf620('0x16')](_0xf620('0x11'),_0x1e7b1e,_0x4a462d['error'][_0xf620('0x17')]);return _0x1d627f(_0x4a462d[_0xf620('0x16')]['message']);}logger[_0xf620('0x16')](_0xf620('0x11'),_0x1e7b1e,_0x4a462d[_0xf620('0x16')][_0xf620('0x17')]);return _0x8bd8f3(_0x4a462d['error'][_0xf620('0x17')]);}else{logger[_0xf620('0x18')](_0xf620('0x11'),_0x1e7b1e,_0xf620('0x12'));_0x8bd8f3(_0x4a462d[_0xf620('0x19')][_0xf620('0x17')]);}})['catch'](function(_0x1e63b8){logger[_0xf620('0x16')](_0xf620('0x11'),_0x1e7b1e,_0x1e63b8);_0x1d627f(_0x1e63b8);});});}exports['UpdateChatInteraction']=function(_0x1d9be0){var _0x15d6d2=this;return new Promise(function(_0xd20a4c,_0x14a1ed){return db[_0xf620('0x1a')][_0xf620('0x1b')](_0x1d9be0[_0xf620('0x1c')],{'raw':_0x1d9be0['options']?_0x1d9be0[_0xf620('0x1d')][_0xf620('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d9be0[_0xf620('0x1d')]?_0x1d9be0[_0xf620('0x1d')]['where']||null:null,'attributes':_0x1d9be0[_0xf620('0x1d')]?_0x1d9be0['options'][_0xf620('0x1f')]||null:null,'limit':_0x1d9be0['options']?_0x1d9be0['options'][_0xf620('0x20')]||null:null})[_0xf620('0x10')](function(_0x539650){logger[_0xf620('0x18')]('UpdateChatInteraction',_0x1d9be0);logger[_0xf620('0x13')](_0xf620('0x21'),_0x1d9be0,JSON['stringify'](_0x539650));_0xd20a4c(_0x539650);})[_0xf620('0x22')](function(_0x154b82){logger[_0xf620('0x16')]('UpdateChatInteraction',_0x154b82[_0xf620('0x17')],_0x1d9be0);_0x14a1ed(_0x15d6d2[_0xf620('0x16')](0x1f4,_0x154b82['message']));});});};exports[_0xf620('0x23')]=function(_0x11b6bf){return new Promise(function(_0x12ffe4,_0x594806){return db[_0xf620('0x1a')]['find']({'where':_0x11b6bf[_0xf620('0x1d')]?_0x11b6bf['options']['where']||null:null})[_0xf620('0x10')](function(_0xc7bb29){if(_0xc7bb29){return _0xc7bb29['addTags'](_0x11b6bf[_0xf620('0x1c')]['ids'],_[_0xf620('0x24')](_0x11b6bf[_0xf620('0x1c')],['ids','id'])||{});}})[_0xf620('0x25')](function(_0x4e5def){logger[_0xf620('0x18')](_0xf620('0x26'),_0x11b6bf);logger[_0xf620('0x13')](_0xf620('0x26'),_0x11b6bf,JSON[_0xf620('0x15')](_0x4e5def));_0x12ffe4(_0x4e5def);})[_0xf620('0x22')](function(_0x589793){logger[_0xf620('0x16')]('AddTags',_0x589793[_0xf620('0x17')],_0x11b6bf);_0x594806(_this[_0xf620('0x16')](0x1f4,_0x589793['message']));});});};
\ No newline at end of file
+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
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 8044e52..0ca4c17 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 _0x8734=['removeListener','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x2e11d3,_0x26a29a){var _0x3f7f7f=function(_0x3c43f1){while(--_0x3c43f1){_0x2e11d3['push'](_0x2e11d3['shift']());}};_0x3f7f7f(++_0x26a29a);}(_0x8734,0x134));var _0x4873=function(_0x3dfea6,_0x5cd685){_0x3dfea6=_0x3dfea6-0x0;var _0x567aca=_0x8734[_0x3dfea6];return _0x567aca;};'use strict';var ChatInteractionEvents=require(_0x4873('0x0'));var events=['save',_0x4873('0x1'),_0x4873('0x2')];function createListener(_0x270283,_0x354735){return function(_0x4eb8ad){_0x354735[_0x4873('0x3')](_0x270283,_0x4eb8ad);};}function removeListener(_0x5bcb32,_0x1ae455){return function(){ChatInteractionEvents[_0x4873('0x4')](_0x5bcb32,_0x1ae455);};}exports['register']=function(_0xb44024){for(var _0x4b5d88=0x0,_0x5ea436=events['length'];_0x4b5d88<_0x5ea436;_0x4b5d88++){var _0x22ed5c=events[_0x4b5d88];var _0x54fdb5=createListener(_0x4873('0x5')+_0x22ed5c,_0xb44024);ChatInteractionEvents['on'](_0x22ed5c,_0x54fdb5);}};
\ No newline at end of file
+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
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d548562..f7ec1fe 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 _0xf06a=['/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','attachmentUpload','addMessage','tracked','chat','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages'];(function(_0x4f95f8,_0xb73784){var _0x123b8e=function(_0x89ad8f){while(--_0x89ad8f){_0x4f95f8['push'](_0x4f95f8['shift']());}};_0x123b8e(++_0xb73784);}(_0xf06a,0x158));var _0xaf06=function(_0x1b1d3b,_0x5ead4c){_0x1b1d3b=_0x1b1d3b-0x0;var _0x1535bc=_0xf06a[_0x1b1d3b];return _0x1535bc;};'use strict';var multer=require(_0xaf06('0x0'));var util=require('util');var path=require(_0xaf06('0x1'));var timeout=require('connect-timeout');var express=require(_0xaf06('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaf06('0x3'));var interaction=require(_0xaf06('0x4'));var config=require(_0xaf06('0x5'));var controller=require(_0xaf06('0x6'));router[_0xaf06('0x7')]('/',auth[_0xaf06('0x8')](),controller['index']);router['get'](_0xaf06('0x9'),auth[_0xaf06('0x8')](),controller[_0xaf06('0xa')]);router[_0xaf06('0x7')](_0xaf06('0xb'),auth[_0xaf06('0xc')](),controller[_0xaf06('0xd')]);router[_0xaf06('0x7')](_0xaf06('0xe'),auth['isChatInteractionAuthorized'](),controller[_0xaf06('0xf')]);router[_0xaf06('0x7')](_0xaf06('0x10'),auth[_0xaf06('0x8')](),controller[_0xaf06('0x11')]);router[_0xaf06('0x7')](_0xaf06('0x12'),auth[_0xaf06('0xc')](),controller[_0xaf06('0x13')]);router[_0xaf06('0x7')](_0xaf06('0x14'),auth[_0xaf06('0x8')](),controller[_0xaf06('0x15')]);router['post']('/',auth[_0xaf06('0x8')](),controller[_0xaf06('0x16')]);router[_0xaf06('0x17')](_0xaf06('0x18'),auth[_0xaf06('0x8')](),controller[_0xaf06('0x19')]);var upload=multer({'storage':multer[_0xaf06('0x1a')]({'destination':function(_0x3a02e1,_0x58de4c,_0x114eed){_0x114eed(null,path[_0xaf06('0x1b')](config[_0xaf06('0x1c')],_0xaf06('0x1d')));},'filename':function(_0x52012b,_0x155b39,_0x1e2b4d){_0x1e2b4d(null,util['format'](_0xaf06('0x1e'),Date[_0xaf06('0x1f')](),_0x155b39[_0xaf06('0x20')][_0xaf06('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xaf06('0x17')](_0xaf06('0x22'),upload['single']('file'),controller[_0xaf06('0x23')]);router[_0xaf06('0x17')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0xaf06('0x24')]);router['post']('/:id/tags',auth[_0xaf06('0x8')](),interaction[_0xaf06('0x25')](_0xaf06('0x26'),'chatinteraction:addtags'),controller['addTags']);router[_0xaf06('0x27')](_0xaf06('0xb'),auth['isAuthenticated'](),interaction[_0xaf06('0x25')]('chat',_0xaf06('0x28')),controller[_0xaf06('0x29')]);router[_0xaf06('0x27')]('/:id/custom_update',controller[_0xaf06('0x2a')]);router[_0xaf06('0x27')](_0xaf06('0x2b'),auth[_0xaf06('0xc')](),controller[_0xaf06('0x2c')]);router[_0xaf06('0x27')](_0xaf06('0x2d'),controller['close']);router[_0xaf06('0x2e')](_0xaf06('0xb'),auth[_0xaf06('0x8')](),interaction[_0xaf06('0x25')](_0xaf06('0x26'),_0xaf06('0x2f')),controller[_0xaf06('0x30')]);router['delete'](_0xaf06('0x31'),auth['isAuthenticated'](),controller[_0xaf06('0x32')]);module[_0xaf06('0x33')]=router;
\ No newline at end of file
+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
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index a612c52..67adda1 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 _0xd2a3=['exports','medium','BOOLEAN','INTEGER'];(function(_0x20b29c,_0xe22528){var _0x20d81b=function(_0xd63a71){while(--_0xd63a71){_0x20b29c['push'](_0x20b29c['shift']());}};_0x20d81b(++_0xe22528);}(_0xd2a3,0xd4));var _0x3d2a=function(_0x55e0c3,_0x456cf4){_0x55e0c3=_0x55e0c3-0x0;var _0x3ee5d8=_0xd2a3[_0x55e0c3];return _0x3ee5d8;};'use strict';var Sequelize=require('sequelize');module[_0x3d2a('0x0')]={'body':{'type':Sequelize['TEXT'](_0x3d2a('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3d2a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x3d2a('0x3')]}};
\ No newline at end of file
+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
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 8fc6c73..e972037 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 _0x5ed7=['save','update','then','destroy','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','user','internal','online','allowmessenger','showWebBar','sort','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','autoAssociation','isEmpty','resourceId','push','messages','ToId','read','all','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0x5ed7,0x11c));var _0x75ed=function(_0x11abab,_0x1ad3dd){_0x11abab=_0x11abab-0x0;var _0x1e2b7c=_0x5ed7[_0x11abab];return _0x1e2b7c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x75ed('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75ed('0x1'));var moment=require('moment');var BPromise=require(_0x75ed('0x2'));var Mustache=require(_0x75ed('0x3'));var util=require(_0x75ed('0x4'));var path=require(_0x75ed('0x5'));var sox=require(_0x75ed('0x6'));var csv=require(_0x75ed('0x7'));var ejs=require(_0x75ed('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75ed('0x9'));var squel=require('squel');var crypto=require(_0x75ed('0xa'));var jsforce=require(_0x75ed('0xb'));var deskjs=require(_0x75ed('0xc'));var toCsv=require(_0x75ed('0x7'));var querystring=require('querystring');var Papa=require(_0x75ed('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x75ed('0xe'));var as=require(_0x75ed('0xf'));var hardwareService=require(_0x75ed('0x10'));var logger=require('../../config/logger')(_0x75ed('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x75ed('0x12'));var db=require(_0x75ed('0x13'))['db'];config[_0x75ed('0x14')]=_[_0x75ed('0x15')](config[_0x75ed('0x14')],{'host':_0x75ed('0x16'),'port':0x18eb});var socket=require(_0x75ed('0x17'))(new Redis(config['redis']));require(_0x75ed('0x18'))[_0x75ed('0x19')](socket);function respondWithStatusCode(_0x8715e2,_0x3fc968){_0x3fc968=_0x3fc968||0xcc;return function(_0x11a465){if(_0x11a465){return _0x8715e2[_0x75ed('0x1a')](_0x3fc968);}return _0x8715e2[_0x75ed('0x1b')](_0x3fc968)[_0x75ed('0x1c')]();};}function respondWithResult(_0x28caa4,_0x1f4fa1){_0x1f4fa1=_0x1f4fa1||0xc8;return function(_0x422a8a){if(_0x422a8a){return _0x28caa4[_0x75ed('0x1b')](_0x1f4fa1)[_0x75ed('0x1d')](_0x422a8a);}};}function respondWithFilteredResult(_0x32567b,_0x34cb14){return function(_0x9a258c){if(_0x9a258c){var _0xc7ee9f=typeof _0x34cb14[_0x75ed('0x1e')]===_0x75ed('0x1f')&&typeof _0x34cb14[_0x75ed('0x20')]===_0x75ed('0x1f');var _0xb977a3=_0x9a258c[_0x75ed('0x21')];var _0x28a4a2=_0xc7ee9f?0x0:_0x34cb14['offset'];var _0x9a89f3=_0xc7ee9f?_0x9a258c[_0x75ed('0x21')]:_0x34cb14['offset']+_0x34cb14[_0x75ed('0x20')];var _0x1bd8c4;if(_0x9a89f3>=_0xb977a3){_0x9a89f3=_0xb977a3;_0x1bd8c4=0xc8;}else{_0x1bd8c4=0xce;}_0x32567b[_0x75ed('0x1b')](_0x1bd8c4);return _0x32567b['set'](_0x75ed('0x22'),_0x28a4a2+'-'+_0x9a89f3+'/'+_0xb977a3)[_0x75ed('0x1d')](_0x9a258c);}return null;};}function patchUpdates(_0x2d17cd){return function(_0x5bfa16){try{jsonpatch[_0x75ed('0x23')](_0x5bfa16,_0x2d17cd,!![]);}catch(_0x51f886){return BPromise[_0x75ed('0x24')](_0x51f886);}return _0x5bfa16[_0x75ed('0x25')]();};}function saveUpdates(_0x5781ac,_0x23eb8a){return function(_0x359e31){if(_0x359e31){return _0x359e31[_0x75ed('0x26')](_0x5781ac)[_0x75ed('0x27')](function(_0x5a70f8){return _0x5a70f8;});}return null;};}function removeEntity(_0x8cd377,_0x42c93b){return function(_0x477530){if(_0x477530){return _0x477530[_0x75ed('0x28')]()['then'](function(){_0x8cd377['status'](0xcc)[_0x75ed('0x1c')]();});}};}function handleEntityNotFound(_0xffc1d7,_0x26edd5){return function(_0x5efdd1){if(!_0x5efdd1){_0xffc1d7[_0x75ed('0x1a')](0x194);}return _0x5efdd1;};}function handleError(_0x440dea,_0x17785c){_0x17785c=_0x17785c||0x1f4;return function(_0x12cc8d){logger[_0x75ed('0x29')](_0x12cc8d[_0x75ed('0x2a')]);if(_0x12cc8d['name']){delete _0x12cc8d[_0x75ed('0x2b')];}_0x440dea[_0x75ed('0x1b')](_0x17785c)[_0x75ed('0x2c')](_0x12cc8d);};}exports['index']=function(_0x4dc113,_0x18ce30){var _0x331ad3={},_0x581769={},_0x49bab0={'count':0x0,'rows':[]};var _0x259676=_['map'](db[_0x75ed('0x2d')][_0x75ed('0x2e')],function(_0x2a4607){return{'name':_0x2a4607[_0x75ed('0x2f')],'type':_0x2a4607['type'][_0x75ed('0x30')]};});_0x581769['model']=_['map'](_0x259676,_0x75ed('0x2b'));_0x581769[_0x75ed('0x31')]=_[_0x75ed('0x32')](_0x4dc113['query']);_0x581769[_0x75ed('0x33')]=_['intersection'](_0x581769['model'],_0x581769[_0x75ed('0x31')]);_0x331ad3[_0x75ed('0x34')]=_[_0x75ed('0x35')](_0x581769[_0x75ed('0x36')],qs[_0x75ed('0x37')](_0x4dc113[_0x75ed('0x31')]['fields']));_0x331ad3['attributes']=_0x331ad3[_0x75ed('0x34')][_0x75ed('0x38')]?_0x331ad3[_0x75ed('0x34')]:_0x581769[_0x75ed('0x36')];if(!_0x4dc113[_0x75ed('0x31')][_0x75ed('0x39')](_0x75ed('0x3a'))){_0x331ad3[_0x75ed('0x20')]=qs[_0x75ed('0x20')](_0x4dc113['query']['limit']);_0x331ad3['offset']=qs['offset'](_0x4dc113[_0x75ed('0x31')][_0x75ed('0x1e')]);}_0x331ad3[_0x75ed('0x3b')]=qs['sort'](_0x4dc113[_0x75ed('0x31')]['sort']);_0x331ad3[_0x75ed('0x3c')]=qs[_0x75ed('0x33')](_[_0x75ed('0x3d')](_0x4dc113['query'],_0x581769['filters']),_0x259676);if(_0x4dc113['query'][_0x75ed('0x3e')]){_0x331ad3[_0x75ed('0x3c')]=_['merge'](_0x331ad3['where'],{'$or':_[_0x75ed('0x3f')](_0x259676,function(_0x4da6bc){if(_0x4da6bc[_0x75ed('0x40')]!==_0x75ed('0x41')){var _0xce8334={};_0xce8334[_0x4da6bc['name']]={'$like':'%'+_0x4dc113['query'][_0x75ed('0x3e')]+'%'};return _0xce8334;}})});}_0x331ad3=_[_0x75ed('0x42')]({},_0x331ad3,_0x4dc113[_0x75ed('0x43')]);var _0x48cdc7={'where':_0x331ad3[_0x75ed('0x3c')]};return db[_0x75ed('0x2d')][_0x75ed('0x21')](_0x48cdc7)['then'](function(_0x2f7477){_0x49bab0[_0x75ed('0x21')]=_0x2f7477;if(_0x4dc113[_0x75ed('0x31')][_0x75ed('0x44')]){_0x331ad3[_0x75ed('0x45')]=[{'all':!![]}];}return db[_0x75ed('0x2d')][_0x75ed('0x46')](_0x331ad3);})[_0x75ed('0x27')](function(_0x3ed486){_0x49bab0[_0x75ed('0x47')]=_0x3ed486;return _0x49bab0;})[_0x75ed('0x27')](respondWithFilteredResult(_0x18ce30,_0x331ad3))[_0x75ed('0x48')](handleError(_0x18ce30,null));};exports[_0x75ed('0x49')]=function(_0x2a8d7e,_0x5e567d){var _0x5a687e={'raw':!![],'where':{'id':_0x2a8d7e['params']['id']}},_0x44ae7a={};_0x44ae7a[_0x75ed('0x36')]=_[_0x75ed('0x32')](db[_0x75ed('0x2d')][_0x75ed('0x2e')]);_0x44ae7a[_0x75ed('0x31')]=_['keys'](_0x2a8d7e[_0x75ed('0x31')]);_0x44ae7a[_0x75ed('0x33')]=_[_0x75ed('0x35')](_0x44ae7a[_0x75ed('0x36')],_0x44ae7a['query']);_0x5a687e['attributes']=_['intersection'](_0x44ae7a[_0x75ed('0x36')],qs[_0x75ed('0x37')](_0x2a8d7e['query'][_0x75ed('0x37')]));_0x5a687e[_0x75ed('0x34')]=_0x5a687e['attributes'][_0x75ed('0x38')]?_0x5a687e['attributes']:_0x44ae7a['model'];if(_0x2a8d7e[_0x75ed('0x31')]['includeAll']){_0x5a687e[_0x75ed('0x45')]=[{'all':!![]}];}_0x5a687e=_[_0x75ed('0x42')]({},_0x5a687e,_0x2a8d7e['options']);return db[_0x75ed('0x2d')][_0x75ed('0x4a')](_0x5a687e)[_0x75ed('0x27')](handleEntityNotFound(_0x5e567d,null))[_0x75ed('0x27')](respondWithResult(_0x5e567d,null))[_0x75ed('0x48')](handleError(_0x5e567d,null));};exports[_0x75ed('0x4b')]=function(_0xad8e9f,_0x46f1e7){return db[_0x75ed('0x2d')][_0x75ed('0x4b')](_0xad8e9f[_0x75ed('0x4c')],{})['then'](respondWithResult(_0x46f1e7,0xc9))[_0x75ed('0x48')](handleError(_0x46f1e7,null));};exports['update']=function(_0x40a8d1,_0x5c8f9d){if(_0x40a8d1[_0x75ed('0x4c')]['id']){delete _0x40a8d1[_0x75ed('0x4c')]['id'];}return db[_0x75ed('0x2d')][_0x75ed('0x4a')]({'where':{'id':_0x40a8d1[_0x75ed('0x4d')]['id']}})[_0x75ed('0x27')](handleEntityNotFound(_0x5c8f9d,null))['then'](saveUpdates(_0x40a8d1[_0x75ed('0x4c')],null))[_0x75ed('0x27')](respondWithResult(_0x5c8f9d,null))['catch'](handleError(_0x5c8f9d,null));};exports[_0x75ed('0x28')]=function(_0x2bb938,_0x30ce06){return db[_0x75ed('0x2d')][_0x75ed('0x4a')]({'where':{'id':_0x2bb938[_0x75ed('0x4d')]['id']}})['then'](handleEntityNotFound(_0x30ce06,null))['then'](removeEntity(_0x30ce06,null))[_0x75ed('0x48')](handleError(_0x30ce06,null));};exports[_0x75ed('0x4e')]=function(_0x382fa4,_0x3a0dbe){return db[_0x75ed('0x2d')][_0x75ed('0x4e')]()[_0x75ed('0x27')](respondWithResult(_0x3a0dbe,null))[_0x75ed('0x48')](handleError(_0x3a0dbe,null));};function wrapUser(_0xf4f425){return function(_0x27e564){var _0x33174d=_0xf4f425[_0x75ed('0x4f')]({'plain':!![]});_0x33174d['messages']=[];if(_0x27e564){_0x33174d['lastMessageAt']=_0x27e564[_0x75ed('0x50')];_0x33174d[_0x75ed('0x51')]=_0x27e564;}else{_0x33174d[_0x75ed('0x52')]=moment(0x0)[_0x75ed('0x53')](_0x75ed('0x54'));_0x33174d[_0x75ed('0x51')]={};}return _0x33174d;};}exports[_0x75ed('0x55')]=function(_0x5906ca,_0x307b02,_0xbc8294){var _0x3e8040=[];return db['User'][_0x75ed('0x46')]({'where':{'role':[_0x75ed('0x56'),'admin',_0x75ed('0x57')]},'attributes':['id','fullname',_0x75ed('0x2b'),'role','userpic',_0x75ed('0x58'),_0x75ed('0x59'),'lastLoginAt',_0x75ed('0x5a'),_0x75ed('0x5b')],'order':qs[_0x75ed('0x5c')]('-online'),'include':[{'model':db[_0x75ed('0x5d')],'as':_0x75ed('0x5e'),'attributes':['id',_0x75ed('0x2b'),_0x75ed('0x40')],'through':{'attributes':[]}}]})[_0x75ed('0x27')](function(_0x4c80f8){if(_0x4c80f8){var _0x3c757b=_0x5906ca[_0x75ed('0x57')][_0x75ed('0x4f')]({'plain':!![]});if(!_0x3c757b)throw new Error(_0x75ed('0x5f'));if(_0x3c757b[_0x75ed('0x60')]===_0x75ed('0x57')){return db[_0x75ed('0x61')][_0x75ed('0x4a')]({'where':{'name':_0x75ed('0x62'),'userProfileId':_0x3c757b['userProfileId']},'raw':!![]})[_0x75ed('0x27')](function(_0x2e3107){if(_0x2e3107){if(_0x2e3107[_0x75ed('0x63')]===0x0){return db['UserProfileResource'][_0x75ed('0x46')]({'where':{'sectionId':_0x2e3107['id']},'raw':!![]})[_0x75ed('0x27')](function(_0x54fa6f){var _0xf08da=[];if(_[_0x75ed('0x64')](_0x54fa6f)){_0xf08da=_[_0x75ed('0x3e')](_0x4c80f8,function(_0x5b2c7a){if(_0x5b2c7a['role']!=='agent'){return _0x5b2c7a;}});return _0xf08da;}else{for(var _0x5d7331=0x0;_0x5d7331<_0x4c80f8[_0x75ed('0x38')];_0x5d7331++){var _0x5ca16d=_0x4c80f8[_0x5d7331];if(_0x5ca16d['role']===_0x75ed('0x56')){var _0x3901cc=_['find'](_0x54fa6f,function(_0x178511){return _0x178511[_0x75ed('0x65')]===_0x5ca16d['id'];});if(_0x3901cc)_0xf08da[_0x75ed('0x66')](_0x5ca16d);}else{_0xf08da[_0x75ed('0x66')](_0x5ca16d);}}return _0xf08da;}});}else{return _0x4c80f8;}}else{var _0x103958=_[_0x75ed('0x3e')](_0x4c80f8,function(_0x406725){if(_0x406725['role']!==_0x75ed('0x56')){return _0x406725;}});return _0x103958;}});}else{return _0x4c80f8;}}})[_0x75ed('0x27')](function(_0x35b4f3){var _0x39da36=[];if(_0x35b4f3){_0x3e8040=_0x35b4f3;for(var _0x534fcf=0x0;_0x534fcf<_0x35b4f3[_0x75ed('0x38')];_0x534fcf+=0x1){_0x3e8040[_0x534fcf][_0x75ed('0x67')]=[];_0x39da36[_0x75ed('0x66')](db[_0x75ed('0x2d')]['find']({'where':{'FromId':[_0x5906ca[_0x75ed('0x57')]['id'],_0x35b4f3[_0x534fcf]['id']],'ToId':[_0x5906ca[_0x75ed('0x57')]['id'],_0x35b4f3[_0x534fcf]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x75ed('0x68'),_0x75ed('0x69'),_0x75ed('0x4c')],'order':qs[_0x75ed('0x5c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x75ed('0x27')](wrapUser(_0x35b4f3[_0x534fcf])));}return BPromise[_0x75ed('0x6a')](_0x39da36);}return[];})['then'](function(_0x2418cd){return{'rows':_0x2418cd,'count':_0x2418cd['length']};})['then'](respondWithResult(_0x307b02,null))['catch'](handleError(_0x307b02,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 8b9a0df..545263a 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 _0xb1fa=['save','hook','ChatInternalMessage'];(function(_0x3003fc,_0x5ac5de){var _0x22cb43=function(_0x478661){while(--_0x478661){_0x3003fc['push'](_0x3003fc['shift']());}};_0x22cb43(++_0x5ac5de);}(_0xb1fa,0x9e));var _0xab1f=function(_0x2d51ed,_0x40cc5f){_0x2d51ed=_0x2d51ed-0x0;var _0x368cea=_0xb1fa[_0x2d51ed];return _0x368cea;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xab1f('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xab1f('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4fa20a){return function(_0x554576,_0x50e03f,_0x2f3821){ChatInternalMessageEvents['emit'](_0x4fa20a+':'+_0x554576['id'],_0x554576);ChatInternalMessageEvents['emit'](_0x4fa20a,_0x554576);_0x2f3821(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xab1f('0x2')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+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
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 350bfdb..f3c7d6c 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 _0x9797=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x38acab,_0x5db216){var _0x560db8=function(_0x4e3d19){while(--_0x4e3d19){_0x38acab['push'](_0x38acab['shift']());}};_0x560db8(++_0x5db216);}(_0x9797,0xdc));var _0x7979=function(_0x583e98,_0x5534f5){_0x583e98=_0x583e98-0x0;var _0x84cc30=_0x9797[_0x583e98];return _0x84cc30;};'use strict';var _=require(_0x7979('0x0'));var util=require(_0x7979('0x1'));var logger=require('../../config/logger')(_0x7979('0x2'));var moment=require(_0x7979('0x3'));var BPromise=require(_0x7979('0x4'));var rp=require(_0x7979('0x5'));var fs=require('fs');var path=require(_0x7979('0x6'));var rimraf=require(_0x7979('0x7'));var config=require(_0x7979('0x8'));var attributes=require(_0x7979('0x9'));module[_0x7979('0xa')]=function(_0x50c3bd,_0x41351f){return _0x50c3bd[_0x7979('0xb')](_0x7979('0xc'),attributes,{'tableName':_0x7979('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7979('0xe'),'collate':_0x7979('0xf')});};
\ No newline at end of file
+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
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 46eac2d..0723662 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 _0x4390=['error','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1b63f1,_0x2fd7e0){var _0x189093=function(_0x8ec513){while(--_0x8ec513){_0x1b63f1['push'](_0x1b63f1['shift']());}};_0x189093(++_0x2fd7e0);}(_0x4390,0x64));var _0x0439=function(_0x3c8df6,_0x3067a3){_0x3c8df6=_0x3c8df6-0x0;var _0xa73cd6=_0x4390[_0x3c8df6];return _0xa73cd6;};'use strict';var _=require('lodash');var util=require(_0x0439('0x0'));var moment=require(_0x0439('0x1'));var BPromise=require(_0x0439('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0439('0x3'))['db'];var utils=require(_0x0439('0x4'));var logger=require(_0x0439('0x5'))(_0x0439('0x6'));var config=require(_0x0439('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0439('0x8')]['http']({'port':0x232a});config[_0x0439('0x9')]=_[_0x0439('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0439('0xb'))(new Redis(config[_0x0439('0x9')]));require(_0x0439('0xc'))['register'](socket);function respondWithRpcPromise(_0x56a29f,_0x202236,_0x344108){return new BPromise(function(_0x3a0262,_0x15f886){return client[_0x0439('0xd')](_0x56a29f,_0x344108)[_0x0439('0xe')](function(_0xc26b84){logger[_0x0439('0xf')](_0x0439('0x10'),_0x202236,'request\x20sent');logger['debug'](_0x0439('0x11'),_0x202236,_0x0439('0x12'),JSON[_0x0439('0x13')](_0xc26b84));if(_0xc26b84[_0x0439('0x14')]){if(_0xc26b84[_0x0439('0x14')]['code']===0x1f4){logger[_0x0439('0x14')](_0x0439('0x10'),_0x202236,_0xc26b84[_0x0439('0x14')]['message']);return _0x15f886(_0xc26b84[_0x0439('0x14')][_0x0439('0x15')]);}logger[_0x0439('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x202236,_0xc26b84[_0x0439('0x14')]['message']);return _0x3a0262(_0xc26b84[_0x0439('0x14')]['message']);}else{logger[_0x0439('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x202236,_0x0439('0x12'));_0x3a0262(_0xc26b84[_0x0439('0x16')][_0x0439('0x15')]);}})[_0x0439('0x17')](function(_0x40d337){logger[_0x0439('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x202236,_0x40d337);_0x15f886(_0x40d337);});});}
\ No newline at end of file
+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
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 4bf5004..274c1a8 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 _0xec3b=['./chatInternalMessage.events','save','update','removeListener'];(function(_0x3a4574,_0x585526){var _0x13352a=function(_0x398863){while(--_0x398863){_0x3a4574['push'](_0x3a4574['shift']());}};_0x13352a(++_0x585526);}(_0xec3b,0x1f0));var _0xbec3=function(_0x4902e8,_0x1ca53e){_0x4902e8=_0x4902e8-0x0;var _0x4c31fe=_0xec3b[_0x4902e8];return _0x4c31fe;};'use strict';var ChatInternalMessageEvents=require(_0xbec3('0x0'));var events=[_0xbec3('0x1'),'remove',_0xbec3('0x2')];function createListener(_0x4499bb,_0x5758b2){return function(_0x4e3037){_0x5758b2['emit'](_0x4499bb,_0x4e3037);};}function removeListener(_0x285e99,_0x24c42f){return function(){ChatInternalMessageEvents[_0xbec3('0x3')](_0x285e99,_0x24c42f);};}exports['register']=function(_0x5d4141){for(var _0x1c8be2=0x0,_0x34dfa4=events['length'];_0x1c8be2<_0x34dfa4;_0x1c8be2++){var _0xd2d6ff=events[_0x1c8be2];var _0x19229d=createListener('chatInternalMessage:'+_0xd2d6ff,_0x5d4141);ChatInternalMessageEvents['on'](_0xd2d6ff,_0x19229d);}};
\ No newline at end of file
+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
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index cafe564..953fc95 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 _0x0422=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x2df0f0,_0x121f5d){var _0x863c9f=function(_0x245745){while(--_0x245745){_0x2df0f0['push'](_0x2df0f0['shift']());}};_0x863c9f(++_0x121f5d);}(_0x0422,0x1b3));var _0x2042=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x0422[_0x40a825];return _0x273a54;};'use strict';var multer=require(_0x2042('0x0'));var util=require(_0x2042('0x1'));var path=require(_0x2042('0x2'));var timeout=require(_0x2042('0x3'));var express=require(_0x2042('0x4'));var router=express[_0x2042('0x5')]();var fs_extra=require(_0x2042('0x6'));var auth=require(_0x2042('0x7'));var interaction=require(_0x2042('0x8'));var config=require('../../config/environment');var controller=require(_0x2042('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2042('0xa')](_0x2042('0xb'),auth[_0x2042('0xc')](),controller[_0x2042('0xd')]);router['get']('/users',auth[_0x2042('0xc')](),controller['getUsers']);router[_0x2042('0xa')](_0x2042('0xe'),auth[_0x2042('0xc')](),controller[_0x2042('0xf')]);router[_0x2042('0x10')]('/',auth[_0x2042('0xc')](),controller[_0x2042('0x11')]);router[_0x2042('0x12')]('/:id',controller[_0x2042('0x13')]);router[_0x2042('0x14')](_0x2042('0xe'),auth[_0x2042('0xc')](),controller['destroy']);module[_0x2042('0x15')]=router;
\ No newline at end of file
+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
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 1eb5f78..738c7a8 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 _0x9158=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x9158,0x16e));var _0x8915=function(_0x396680,_0x5ac1e5){_0x396680=_0x396680-0x0;var _0x112aae=_0x9158[_0x396680];return _0x112aae;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'body':{'type':Sequelize[_0x8915('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8915('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8915('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8915('0x5')]},'providerName':{'type':Sequelize[_0x8915('0x6')]},'providerResponse':{'type':Sequelize[_0x8915('0x2')]}};
\ No newline at end of file
+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
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 392e701..64cf235 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 _0x8c56=['bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','name','send','ChatMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','update','accept','chat','read','format','UserId','agent','get','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','parse','formData','chat-interactions','ChatInteraction','RejectMessage','EventManager','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8c56,0x7b));var _0x68c5=function(_0x39d90f,_0xee44f){_0x39d90f=_0x39d90f-0x0;var _0x4d5c2c=_0x8c56[_0x39d90f];return _0x4d5c2c;};'use strict';var emlformat=require(_0x68c5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68c5('0x1'));var jsonpatch=require(_0x68c5('0x2'));var rp=require(_0x68c5('0x3'));var moment=require(_0x68c5('0x4'));var BPromise=require(_0x68c5('0x5'));var Mustache=require('mustache');var util=require(_0x68c5('0x6'));var path=require(_0x68c5('0x7'));var sox=require('sox');var csv=require(_0x68c5('0x8'));var ejs=require(_0x68c5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x68c5('0xa'));var squel=require(_0x68c5('0xb'));var crypto=require(_0x68c5('0xc'));var jsforce=require(_0x68c5('0xd'));var deskjs=require(_0x68c5('0xe'));var toCsv=require(_0x68c5('0x8'));var querystring=require(_0x68c5('0xf'));var Papa=require(_0x68c5('0x10'));var Redis=require('ioredis');var authService=require(_0x68c5('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x68c5('0x12'))(_0x68c5('0x13'));var utils=require(_0x68c5('0x14'));var config=require(_0x68c5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x68c5('0x16'))['db'];config[_0x68c5('0x17')]=_[_0x68c5('0x18')](config[_0x68c5('0x17')],{'host':_0x68c5('0x19'),'port':0x18eb});var socket=require(_0x68c5('0x1a'))(new Redis(config[_0x68c5('0x17')]));require(_0x68c5('0x1b'))[_0x68c5('0x1c')](socket);var jayson=require(_0x68c5('0x1d'));var client=jayson[_0x68c5('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x68c5('0x1e')][_0x68c5('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1327e9,_0x1d168d,_0x414007,_0x1ed71a){return new BPromise(function(_0x5ec727,_0x494fc1){var _0x56f96a=_0x1ed71a||client;return _0x56f96a[_0x68c5('0x20')](_0x1327e9,_0x414007)[_0x68c5('0x21')](function(_0x498812){logger[_0x68c5('0x22')]('ChatMessage,\x20%s,\x20%s',_0x1d168d,_0x68c5('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1d168d,'request\x20sent',JSON[_0x68c5('0x24')](_0x498812));if(_0x498812[_0x68c5('0x25')]){if(_0x498812[_0x68c5('0x25')][_0x68c5('0x26')]===0x1f4){logger[_0x68c5('0x25')]('ChatMessage,\x20%s,\x20%s',_0x1d168d,_0x498812[_0x68c5('0x25')][_0x68c5('0x27')]);return _0x494fc1(_0x498812[_0x68c5('0x25')][_0x68c5('0x27')]);}logger[_0x68c5('0x25')]('ChatMessage,\x20%s,\x20%s',_0x1d168d,_0x498812[_0x68c5('0x25')][_0x68c5('0x27')]);return _0x5ec727(_0x498812['error'][_0x68c5('0x27')]);}else{logger[_0x68c5('0x22')](_0x68c5('0x28'),_0x1d168d,_0x68c5('0x23'));_0x5ec727(_0x498812['result'][_0x68c5('0x27')]);}})[_0x68c5('0x29')](function(_0x4153e4){logger[_0x68c5('0x25')](_0x68c5('0x28'),_0x1d168d,_0x4153e4);_0x494fc1(_0x4153e4);});});}function respondWithStatusCode(_0x132771,_0x282000){_0x282000=_0x282000||0xcc;return function(_0x55d832){if(_0x55d832){return _0x132771[_0x68c5('0x2a')](_0x282000);}return _0x132771['status'](_0x282000)[_0x68c5('0x2b')]();};}function respondWithResult(_0x218776,_0x2f6c54){_0x2f6c54=_0x2f6c54||0xc8;return function(_0x42bc6b){if(_0x42bc6b){return _0x218776[_0x68c5('0x2c')](_0x2f6c54)[_0x68c5('0x2d')](_0x42bc6b);}};}function respondWithFilteredResult(_0x359a23,_0x20229d){return function(_0x8d243e){if(_0x8d243e){var _0x1f155c=typeof _0x20229d[_0x68c5('0x2e')]===_0x68c5('0x2f')&&typeof _0x20229d[_0x68c5('0x30')]==='undefined';var _0x2ee639=_0x8d243e[_0x68c5('0x31')];var _0x251b26=_0x1f155c?0x0:_0x20229d[_0x68c5('0x2e')];var _0x58e770=_0x1f155c?_0x8d243e['count']:_0x20229d['offset']+_0x20229d[_0x68c5('0x30')];var _0x57ef7f;if(_0x58e770>=_0x2ee639){_0x58e770=_0x2ee639;_0x57ef7f=0xc8;}else{_0x57ef7f=0xce;}_0x359a23[_0x68c5('0x2c')](_0x57ef7f);return _0x359a23[_0x68c5('0x32')](_0x68c5('0x33'),_0x251b26+'-'+_0x58e770+'/'+_0x2ee639)[_0x68c5('0x2d')](_0x8d243e);}return null;};}function patchUpdates(_0x2b5675){return function(_0x519dcd){try{jsonpatch[_0x68c5('0x34')](_0x519dcd,_0x2b5675,!![]);}catch(_0x5b3f19){return BPromise[_0x68c5('0x35')](_0x5b3f19);}return _0x519dcd[_0x68c5('0x36')]();};}function saveUpdates(_0x4b9804,_0x331d0d){return function(_0x2012cb){if(_0x2012cb){return _0x2012cb['update'](_0x4b9804)[_0x68c5('0x21')](function(_0x462019){return _0x462019;});}return null;};}function removeEntity(_0x1022f5,_0x3f2e89){return function(_0x18aaad){if(_0x18aaad){return _0x18aaad[_0x68c5('0x37')]()[_0x68c5('0x21')](function(){_0x1022f5[_0x68c5('0x2c')](0xcc)[_0x68c5('0x2b')]();});}};}function handleEntityNotFound(_0x4362a8,_0x11fe46){return function(_0x449f91){if(!_0x449f91){_0x4362a8[_0x68c5('0x2a')](0x194);}return _0x449f91;};}function handleError(_0x3da050,_0xc0037b){_0xc0037b=_0xc0037b||0x1f4;return function(_0x3fb261){logger[_0x68c5('0x25')](_0x3fb261['stack']);if(_0x3fb261['name']){delete _0x3fb261[_0x68c5('0x38')];}_0x3da050[_0x68c5('0x2c')](_0xc0037b)[_0x68c5('0x39')](_0x3fb261);};}exports['index']=function(_0x285ee8,_0x20e90e){var _0x57dcb7={},_0xb29df7={},_0x261cb8={'count':0x0,'rows':[]};var _0x13f4ba=_['map'](db[_0x68c5('0x3a')][_0x68c5('0x3b')],function(_0x2f3680){return{'name':_0x2f3680['fieldName'],'type':_0x2f3680[_0x68c5('0x3c')][_0x68c5('0x3d')]};});_0xb29df7[_0x68c5('0x3e')]=_[_0x68c5('0x3f')](_0x13f4ba,_0x68c5('0x38'));_0xb29df7[_0x68c5('0x40')]=_[_0x68c5('0x41')](_0x285ee8[_0x68c5('0x40')]);_0xb29df7[_0x68c5('0x42')]=_[_0x68c5('0x43')](_0xb29df7[_0x68c5('0x3e')],_0xb29df7['query']);_0x57dcb7[_0x68c5('0x44')]=_[_0x68c5('0x43')](_0xb29df7[_0x68c5('0x3e')],qs['fields'](_0x285ee8[_0x68c5('0x40')][_0x68c5('0x45')]));_0x57dcb7[_0x68c5('0x44')]=_0x57dcb7['attributes']['length']?_0x57dcb7[_0x68c5('0x44')]:_0xb29df7[_0x68c5('0x3e')];if(!_0x285ee8[_0x68c5('0x40')][_0x68c5('0x46')](_0x68c5('0x47'))){_0x57dcb7[_0x68c5('0x30')]=qs['limit'](_0x285ee8[_0x68c5('0x40')][_0x68c5('0x30')]);_0x57dcb7[_0x68c5('0x2e')]=qs[_0x68c5('0x2e')](_0x285ee8['query'][_0x68c5('0x2e')]);}_0x57dcb7[_0x68c5('0x48')]=qs[_0x68c5('0x49')](_0x285ee8[_0x68c5('0x40')][_0x68c5('0x49')]);_0x57dcb7['where']=qs['filters'](_['pick'](_0x285ee8[_0x68c5('0x40')],_0xb29df7['filters']),_0x13f4ba);if(_0x285ee8['query']['filter']){_0x57dcb7['where']=_[_0x68c5('0x4a')](_0x57dcb7['where'],{'$or':_[_0x68c5('0x3f')](_0x13f4ba,function(_0x5d418b){if(_0x5d418b[_0x68c5('0x3c')]!==_0x68c5('0x4b')){var _0x38c899={};_0x38c899[_0x5d418b[_0x68c5('0x38')]]={'$like':'%'+_0x285ee8[_0x68c5('0x40')]['filter']+'%'};return _0x38c899;}})});}_0x57dcb7=_[_0x68c5('0x4a')]({},_0x57dcb7,_0x285ee8[_0x68c5('0x4c')]);var _0x2354da={'where':_0x57dcb7['where']};return db['ChatMessage'][_0x68c5('0x31')](_0x2354da)['then'](function(_0x1351c5){_0x261cb8[_0x68c5('0x31')]=_0x1351c5;if(_0x285ee8[_0x68c5('0x40')]['includeAll']){_0x57dcb7[_0x68c5('0x4d')]=[{'all':!![]}];}return db[_0x68c5('0x3a')][_0x68c5('0x4e')](_0x57dcb7);})['then'](function(_0x2da353){_0x261cb8[_0x68c5('0x4f')]=_0x2da353;return _0x261cb8;})[_0x68c5('0x21')](respondWithFilteredResult(_0x20e90e,_0x57dcb7))['catch'](handleError(_0x20e90e,null));};exports[_0x68c5('0x50')]=function(_0x33f6d8,_0x522a2e){var _0xc827e7={'raw':!![],'where':{'id':_0x33f6d8[_0x68c5('0x51')]['id']}},_0x45e64d={};_0x45e64d[_0x68c5('0x3e')]=_[_0x68c5('0x41')](db[_0x68c5('0x3a')][_0x68c5('0x3b')]);_0x45e64d[_0x68c5('0x40')]=_[_0x68c5('0x41')](_0x33f6d8['query']);_0x45e64d['filters']=_[_0x68c5('0x43')](_0x45e64d['model'],_0x45e64d['query']);_0xc827e7[_0x68c5('0x44')]=_[_0x68c5('0x43')](_0x45e64d[_0x68c5('0x3e')],qs['fields'](_0x33f6d8[_0x68c5('0x40')][_0x68c5('0x45')]));_0xc827e7[_0x68c5('0x44')]=_0xc827e7[_0x68c5('0x44')]['length']?_0xc827e7[_0x68c5('0x44')]:_0x45e64d['model'];if(_0x33f6d8[_0x68c5('0x40')][_0x68c5('0x52')]){_0xc827e7[_0x68c5('0x4d')]=[{'all':!![]}];}_0xc827e7=_[_0x68c5('0x4a')]({},_0xc827e7,_0x33f6d8['options']);return db[_0x68c5('0x3a')][_0x68c5('0x53')](_0xc827e7)[_0x68c5('0x21')](handleEntityNotFound(_0x522a2e,null))[_0x68c5('0x21')](respondWithResult(_0x522a2e,null))[_0x68c5('0x29')](handleError(_0x522a2e,null));};exports[_0x68c5('0x54')]=function(_0x79212b,_0x4a962d){return db['ChatMessage']['create'](_0x79212b[_0x68c5('0x55')],{})[_0x68c5('0x21')](respondWithResult(_0x4a962d,0xc9))[_0x68c5('0x29')](handleError(_0x4a962d,null));};exports[_0x68c5('0x56')]=function(_0x5dd14a,_0x4e953a){if(_0x5dd14a['body']['id']){delete _0x5dd14a['body']['id'];}return db[_0x68c5('0x3a')][_0x68c5('0x53')]({'where':{'id':_0x5dd14a[_0x68c5('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e953a,null))[_0x68c5('0x21')](saveUpdates(_0x5dd14a[_0x68c5('0x55')],null))[_0x68c5('0x21')](respondWithResult(_0x4e953a,null))[_0x68c5('0x29')](handleError(_0x4e953a,null));};exports[_0x68c5('0x37')]=function(_0x122ad3,_0x5805e4){return db[_0x68c5('0x3a')][_0x68c5('0x53')]({'where':{'id':_0x122ad3[_0x68c5('0x51')]['id']}})['then'](handleEntityNotFound(_0x5805e4,null))[_0x68c5('0x21')](removeEntity(_0x5805e4,null))[_0x68c5('0x29')](handleError(_0x5805e4,null));};exports['describe']=function(_0x4a21f5,_0x3aa43d){return db[_0x68c5('0x3a')]['describe']()[_0x68c5('0x21')](respondWithResult(_0x3aa43d,null))[_0x68c5('0x29')](handleError(_0x3aa43d,null));};var interaction_log=require(_0x68c5('0x12'))('chat-interactions');exports[_0x68c5('0x57')]=function(_0x1bd9f,_0x3c4284,_0x471320){var _0x423cac={'agent':{},'channel':_0x68c5('0x58')};if(_0x1bd9f[_0x68c5('0x55')]['id']){delete _0x1bd9f['body']['id'];}_0x1bd9f[_0x68c5('0x55')][_0x68c5('0x59')]=!![];_0x1bd9f[_0x68c5('0x55')]['readAt']=moment()[_0x68c5('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1bd9f[_0x68c5('0x55')]['UserId']=_0x1bd9f[_0x68c5('0x55')][_0x68c5('0x5b')]||_0x1bd9f['user']['id'];_0x423cac[_0x68c5('0x5c')]['id']=_0x1bd9f['body'][_0x68c5('0x5b')];return db[_0x68c5('0x3a')][_0x68c5('0x53')]({'where':{'id':_0x1bd9f[_0x68c5('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c4284,null))[_0x68c5('0x21')](saveUpdates(_0x1bd9f[_0x68c5('0x55')],null))[_0x68c5('0x21')](function(_0xb61f2b){if(_0xb61f2b){_0x423cac['message']=_0xb61f2b[_0x68c5('0x5d')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0xb61f2b[_0x68c5('0x5e')]}});}return null;})[_0x68c5('0x21')](handleEntityNotFound(_0x3c4284,null))['then'](function(_0x3beed7){if(_0x3beed7){return _0x3beed7[_0x68c5('0x56')]({'UserId':_0x1bd9f[_0x68c5('0x55')][_0x68c5('0x5b')],'read1stAt':_[_0x68c5('0x5f')](_0x3beed7[_0x68c5('0x60')])?moment()['format'](_0x68c5('0x61')):undefined});}return null;})[_0x68c5('0x21')](function(_0x286190){if(_0x286190){_0x423cac['interaction']=_0x286190[_0x68c5('0x5d')]({'plain':!![]});interaction_log[_0x68c5('0x22')](_0x68c5('0x62'),_0x1bd9f[_0x68c5('0x63')]['id'],_0x1bd9f[_0x68c5('0x63')][_0x68c5('0x38')],_0x1bd9f[_0x68c5('0x63')][_0x68c5('0x64')],_0x423cac[_0x68c5('0x65')]['id'],_0x1bd9f['body']?JSON[_0x68c5('0x24')](_0x1bd9f[_0x68c5('0x55')]):_0x68c5('0x66'));return respondWithRpcPromise(_0x68c5('0x67'),_0x68c5('0x68'),_0x423cac);}return null;})[_0x68c5('0x21')](function(_0x6bd594){var _0x529148=_0x68c5('0x69')+_0x6bd594[_0x68c5('0x27')][_0x68c5('0x6a')];return db[_0x68c5('0x6b')][_0x68c5('0x40')](_0x529148,{'type':db[_0x68c5('0x6c')][_0x68c5('0x6d')][_0x68c5('0x6e')],'raw':!![]})[_0x68c5('0x21')](function(_0x33a06c){return _0x33a06c;});})[_0x68c5('0x21')](function(_0x4bd448){if(_0x4bd448){_0x423cac[_0x68c5('0x27')][_0x68c5('0x6f')]=_0x4bd448[0x0];if(!_0x1bd9f[_0x68c5('0x55')][_0x68c5('0x5b')])return;return db[_0x68c5('0x70')][_0x68c5('0x53')]({'where':{'id':_0x1bd9f['body'][_0x68c5('0x5b')],'role':_0x68c5('0x5c')},'attributes':['id',_0x68c5('0x38'),_0x68c5('0x71'),_0x68c5('0x72'),_0x68c5('0x73')],'raw':!![]});}return null;})[_0x68c5('0x21')](function(_0x569bf8){if(!_0x569bf8)return null;_0x423cac[_0x68c5('0x27')]['agent']=_0x569bf8;return _0x423cac;})[_0x68c5('0x21')](function(_0xa2fa22){if(_0xa2fa22){if(_0x1bd9f[_0x68c5('0x55')]['manual']){_0x423cac[_0x68c5('0x27')][_0x68c5('0x74')]=util[_0x68c5('0x5a')](_0x68c5('0x75'),_0x1bd9f[_0x68c5('0x63')][_0x68c5('0x38')]);_0x423cac[_0x68c5('0x27')][_0x68c5('0x76')]=_0x423cac[_0x68c5('0x76')];_0x423cac[_0x68c5('0x27')][_0x68c5('0x77')]=_0x423cac[_0x68c5('0x76')];_0x423cac['message'][_0x68c5('0x78')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0x68c5('0x4a')](_0x423cac[_0x68c5('0x27')],JSON[_0x68c5('0x79')](_0x423cac[_0x68c5('0x65')][_0x68c5('0x7a')]))},client9002)[_0x68c5('0x21')](function(){return _0x423cac;});}return _0x423cac;}return null;})[_0x68c5('0x21')](respondWithResult(_0x3c4284,null))[_0x68c5('0x29')](handleError(_0x3c4284,null));};var interaction_log=require(_0x68c5('0x12'))(_0x68c5('0x7b'));exports[_0x68c5('0x35')]=function(_0xb6a0f9,_0x350841,_0x17aee8){var _0x35c4a8={'agent':{},'channel':_0x68c5('0x58')};if(_0xb6a0f9['body']['id']){delete _0xb6a0f9[_0x68c5('0x55')]['id'];}_0xb6a0f9[_0x68c5('0x55')][_0x68c5('0x5b')]=_0xb6a0f9['body'][_0x68c5('0x5b')]||_0xb6a0f9['user']['id'];_0x35c4a8[_0x68c5('0x5c')]['id']=_0xb6a0f9[_0x68c5('0x55')][_0x68c5('0x5b')];return db['ChatMessage']['find']({'where':{'id':_0xb6a0f9[_0x68c5('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x350841,null))['then'](function(_0x15d98c){if(_0x15d98c){_0x35c4a8[_0x68c5('0x27')]=_0x15d98c[_0x68c5('0x5d')]({'plain':!![]});return db[_0x68c5('0x7c')][_0x68c5('0x53')]({'where':{'id':_0x15d98c[_0x68c5('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x350841,null))['then'](function(_0xd1dc66){if(_0xd1dc66){_0x35c4a8['interaction']=_0xd1dc66[_0x68c5('0x5d')]({'plain':!![]});interaction_log[_0x68c5('0x22')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xb6a0f9[_0x68c5('0x63')]['id'],_0xb6a0f9[_0x68c5('0x63')]['name'],_0xb6a0f9[_0x68c5('0x63')][_0x68c5('0x64')],_0x35c4a8[_0x68c5('0x65')]['id'],_0xb6a0f9[_0x68c5('0x55')]?JSON[_0x68c5('0x24')](_0xb6a0f9[_0x68c5('0x55')]):'null');return respondWithRpcPromise(_0x68c5('0x7d'),'rejectMessage',_0x35c4a8);}return null;})[_0x68c5('0x21')](function(_0x1cf959){var _0x2a832d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1cf959['message'][_0x68c5('0x6a')];return db[_0x68c5('0x6b')][_0x68c5('0x40')](_0x2a832d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x68c5('0x21')](function(_0x48e00a){return _0x48e00a;});})[_0x68c5('0x21')](function(_0x41baba){if(_0x41baba){_0x35c4a8[_0x68c5('0x27')][_0x68c5('0x6f')]=_0x41baba[0x0];if(!_0xb6a0f9[_0x68c5('0x55')][_0x68c5('0x5b')])return;return db[_0x68c5('0x70')]['find']({'where':{'id':_0xb6a0f9[_0x68c5('0x55')][_0x68c5('0x5b')],'role':'agent'},'attributes':['id',_0x68c5('0x38'),_0x68c5('0x71'),'email',_0x68c5('0x73')],'raw':!![]});}return null;})[_0x68c5('0x21')](function(_0x1d5772){if(!_0x1d5772)return null;_0x35c4a8[_0x68c5('0x27')]['agent']=_0x1d5772;return _0x35c4a8;})['then'](function(_0xf61fba){if(_0xf61fba){_0xf61fba['message']['interface']=util[_0x68c5('0x5a')](_0x68c5('0x75'),_0xb6a0f9[_0x68c5('0x63')][_0x68c5('0x38')]);_0xf61fba[_0x68c5('0x27')]['channel']=_0x35c4a8[_0x68c5('0x76')];_0xf61fba[_0x68c5('0x27')][_0x68c5('0x77')]=_0x35c4a8[_0x68c5('0x76')];_0xf61fba['message'][_0x68c5('0x78')]='reject';respondWithRpcPromise(_0x68c5('0x7e'),_0x68c5('0x7e'),{'event':_0x68c5('0x7f'),'message':_[_0x68c5('0x4a')](_0x35c4a8[_0x68c5('0x27')],JSON['parse'](_0x35c4a8[_0x68c5('0x65')][_0x68c5('0x7a')]))},client9002);return _0x35c4a8;}return null;})[_0x68c5('0x21')](respondWithResult(_0x350841,null))['catch'](handleError(_0x350841,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index a577bc1..cb79133 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 _0xf9eb=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5c588f,_0x425a0d){var _0x19125e=function(_0x325792){while(--_0x325792){_0x5c588f['push'](_0x5c588f['shift']());}};_0x19125e(++_0x425a0d);}(_0xf9eb,0x1a2));var _0xbf9e=function(_0x376e18,_0x4273c6){_0x376e18=_0x376e18-0x0;var _0x247ca1=_0xf9eb[_0x376e18];return _0x247ca1;};'use strict';var EventEmitter=require(_0xbf9e('0x0'));var ChatMessage=require(_0xbf9e('0x1'))['db'][_0xbf9e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbf9e('0x3')](0x0);var events={'afterCreate':_0xbf9e('0x4'),'afterUpdate':_0xbf9e('0x5'),'afterDestroy':_0xbf9e('0x6')};function emitEvent(_0x4c8680){return function(_0x111f7e,_0x5ba57c,_0x566fcf){ChatMessageEvents[_0xbf9e('0x7')](_0x4c8680+':'+_0x111f7e['id'],_0x111f7e);ChatMessageEvents[_0xbf9e('0x7')](_0x4c8680,_0x111f7e);_0x566fcf(null);};}for(var e in events){if(events[_0xbf9e('0x8')](e)){var event=events[e];ChatMessage[_0xbf9e('0x9')](e,emitEvent(event));}}module[_0xbf9e('0xa')]=ChatMessageEvents;
\ No newline at end of file
+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
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index e64e902..c5cb261 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 _0x640e=['../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x34802f,_0x161127){var _0x18e109=function(_0x209311){while(--_0x209311){_0x34802f['push'](_0x34802f['shift']());}};_0x18e109(++_0x161127);}(_0x640e,0xde));var _0xe640=function(_0x209fcd,_0x1ecccc){_0x209fcd=_0x209fcd-0x0;var _0x501d5e=_0x640e[_0x209fcd];return _0x501d5e;};'use strict';var _=require(_0xe640('0x0'));var util=require(_0xe640('0x1'));var logger=require(_0xe640('0x2'))(_0xe640('0x3'));var moment=require(_0xe640('0x4'));var BPromise=require(_0xe640('0x5'));var rp=require(_0xe640('0x6'));var fs=require('fs');var path=require(_0xe640('0x7'));var rimraf=require(_0xe640('0x8'));var config=require(_0xe640('0x9'));var attributes=require(_0xe640('0xa'));module[_0xe640('0xb')]=function(_0x3cb4c2,_0x2412f3){return _0x3cb4c2[_0xe640('0xc')](_0xe640('0xd'),attributes,{'tableName':_0xe640('0xe'),'paranoid':![],'indexes':[{'name':_0xe640('0xf'),'fields':[_0xe640('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b0f3f,_0x28d3a5,_0x596884){var _0x4c26b6=_0x3cb4c2[_0xe640('0x11')];var _0x50df97=_0x3b0f3f[_0xe640('0x12')]({'plain':!![]});if(_0x50df97[_0xe640('0x13')]['toLowerCase']()==='in'||_0x50df97[_0xe640('0x13')][_0xe640('0x14')]()===_0xe640('0x15')&&!_0x50df97[_0xe640('0x16')]&&!_[_0xe640('0x17')](_0x50df97[_0xe640('0x18')])){_0x4c26b6[_0xe640('0x19')]['findOne']({'where':{'id':_0x50df97[_0xe640('0x1a')]}})[_0xe640('0x1b')](function(_0x5b0e16){if(_0x5b0e16){_0x5b0e16[_0xe640('0x1c')]({'lastMsgAt':_0x50df97[_0xe640('0x1d')],'lastMsgDirection':_0x50df97[_0xe640('0x13')][_0xe640('0x14')]()});}})[_0xe640('0x1e')](function(_0x43e209){console[_0xe640('0x1f')](_0x43e209);});}_0x596884();}},'charset':_0xe640('0x20'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+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
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index ab7924e..ab84721 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 _0xdcb8=['register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xdcb8,0x13b));var _0x8dcb=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdcb8[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x8dcb('0x0'));var moment=require(_0x8dcb('0x1'));var BPromise=require('bluebird');var rs=require(_0x8dcb('0x2'));var fs=require('fs');var Redis=require(_0x8dcb('0x3'));var db=require(_0x8dcb('0x4'))['db'];var utils=require(_0x8dcb('0x5'));var logger=require(_0x8dcb('0x6'))(_0x8dcb('0x7'));var config=require('../../config/environment');var jayson=require(_0x8dcb('0x8'));var client=jayson[_0x8dcb('0x9')][_0x8dcb('0xa')]({'port':0x232a});config[_0x8dcb('0xb')]=_[_0x8dcb('0xc')](config[_0x8dcb('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dcb('0xd'))(new Redis(config['redis']));require(_0x8dcb('0xe'))[_0x8dcb('0xf')](socket);function respondWithRpcPromise(_0x4e0494,_0x25916d,_0x49d06d){return new BPromise(function(_0x480639,_0x30b4e2){return client[_0x8dcb('0x10')](_0x4e0494,_0x49d06d)['then'](function(_0x23bfaa){logger[_0x8dcb('0x11')](_0x8dcb('0x12'),_0x25916d,_0x8dcb('0x13'));logger['debug'](_0x8dcb('0x14'),_0x25916d,_0x8dcb('0x13'),JSON['stringify'](_0x23bfaa));if(_0x23bfaa[_0x8dcb('0x15')]){if(_0x23bfaa['error'][_0x8dcb('0x16')]===0x1f4){logger[_0x8dcb('0x15')]('ChatMessage,\x20%s,\x20%s',_0x25916d,_0x23bfaa[_0x8dcb('0x15')][_0x8dcb('0x17')]);return _0x30b4e2(_0x23bfaa[_0x8dcb('0x15')]['message']);}logger[_0x8dcb('0x15')](_0x8dcb('0x12'),_0x25916d,_0x23bfaa[_0x8dcb('0x15')]['message']);return _0x480639(_0x23bfaa['error'][_0x8dcb('0x17')]);}else{logger[_0x8dcb('0x11')](_0x8dcb('0x12'),_0x25916d,'request\x20sent');_0x480639(_0x23bfaa[_0x8dcb('0x18')][_0x8dcb('0x17')]);}})[_0x8dcb('0x19')](function(_0x45f918){logger[_0x8dcb('0x15')](_0x8dcb('0x12'),_0x25916d,_0x45f918);_0x30b4e2(_0x45f918);});});}exports[_0x8dcb('0x1a')]=function(_0x109bca){var _0x103bf0=this;return new Promise(function(_0x1837c6,_0x34df68){return db[_0x8dcb('0x1b')][_0x8dcb('0x1c')](_0x109bca[_0x8dcb('0x1d')],{'raw':_0x109bca[_0x8dcb('0x1e')]?_0x109bca[_0x8dcb('0x1e')][_0x8dcb('0x1f')]===undefined?!![]:![]:!![]})[_0x8dcb('0x20')](function(_0x4925de){logger[_0x8dcb('0x11')](_0x8dcb('0x1a'),_0x109bca);logger['debug'](_0x8dcb('0x1a'),_0x109bca,JSON['stringify'](_0x4925de));_0x1837c6(_0x4925de);})[_0x8dcb('0x19')](function(_0x432028){logger[_0x8dcb('0x15')](_0x8dcb('0x1a'),_0x432028[_0x8dcb('0x17')],_0x109bca);_0x34df68(_0x103bf0[_0x8dcb('0x15')](0x1f4,_0x432028[_0x8dcb('0x17')]));});});};
\ No newline at end of file
+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
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 6a8658d..6f2d584 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 _0x818f=['update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x1974a6,_0xdb12ff){var _0x8f6b8c=function(_0x4655d1){while(--_0x4655d1){_0x1974a6['push'](_0x1974a6['shift']());}};_0x8f6b8c(++_0xdb12ff);}(_0x818f,0x1da));var _0xf818=function(_0x8cc1ce,_0x120de3){_0x8cc1ce=_0x8cc1ce-0x0;var _0x293189=_0x818f[_0x8cc1ce];return _0x293189;};'use strict';var ChatMessageEvents=require(_0xf818('0x0'));var events=[_0xf818('0x1'),_0xf818('0x2'),_0xf818('0x3')];function createListener(_0x121db7,_0x39b430){return function(_0x58f142){_0x39b430[_0xf818('0x4')](_0x121db7,_0x58f142);};}function removeListener(_0xd6c86,_0x2c1bb0){return function(){ChatMessageEvents[_0xf818('0x5')](_0xd6c86,_0x2c1bb0);};}exports[_0xf818('0x6')]=function(_0x41310f){for(var _0x27119b=0x0,_0x42a23e=events[_0xf818('0x7')];_0x27119b<_0x42a23e;_0x27119b++){var _0x55540d=events[_0x27119b];var _0x1dbfc8=createListener(_0xf818('0x8')+_0x55540d,_0x41310f);ChatMessageEvents['on'](_0x55540d,_0x1dbfc8);}};
\ No newline at end of file
+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
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index d153cf9..ece76ff 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 _0xa1d6=['chat','chatmessage:create','create','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','tracked'];(function(_0x56f561,_0x7f75f4){var _0x15ed6f=function(_0xc13416){while(--_0xc13416){_0x56f561['push'](_0x56f561['shift']());}};_0x15ed6f(++_0x7f75f4);}(_0xa1d6,0x10f));var _0x6a1d=function(_0x35ce0e,_0x13f34e){_0x35ce0e=_0x35ce0e-0x0;var _0x17d179=_0xa1d6[_0x35ce0e];return _0x17d179;};'use strict';var multer=require(_0x6a1d('0x0'));var util=require(_0x6a1d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6a1d('0x2'));var router=express[_0x6a1d('0x3')]();var fs_extra=require(_0x6a1d('0x4'));var auth=require(_0x6a1d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6a1d('0x6'));var controller=require('./chatMessage.controller');router[_0x6a1d('0x7')]('/',auth[_0x6a1d('0x8')](),controller['index']);router['get'](_0x6a1d('0x9'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0xa')]);router[_0x6a1d('0x7')](_0x6a1d('0xb'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0xc')]);router[_0x6a1d('0xd')]('/',auth[_0x6a1d('0x8')](),interaction[_0x6a1d('0xe')](_0x6a1d('0xf'),_0x6a1d('0x10')),controller[_0x6a1d('0x11')]);router['put'](_0x6a1d('0xb'),controller['update']);router['put'](_0x6a1d('0x12'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0x13')]);router[_0x6a1d('0x14')](_0x6a1d('0x15'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0x16')]);router[_0x6a1d('0x17')](_0x6a1d('0xb'),auth[_0x6a1d('0x8')](),controller[_0x6a1d('0x18')]);module[_0x6a1d('0x19')]=router;
\ No newline at end of file
+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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 92640e3..553d46b 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 _0x47c8=['exports','TEXT','medium','sequelize'];(function(_0x369cae,_0x45a057){var _0xc7a297=function(_0x1e81bf){while(--_0x1e81bf){_0x369cae['push'](_0x369cae['shift']());}};_0xc7a297(++_0x45a057);}(_0x47c8,0xcf));var _0x847c=function(_0x2f1351,_0xb5203){_0x2f1351=_0x2f1351-0x0;var _0xe88511=_0x47c8[_0x2f1351];return _0xe88511;};'use strict';var Sequelize=require(_0x847c('0x0'));module[_0x847c('0x1')]={'body':{'type':Sequelize[_0x847c('0x2')](_0x847c('0x3')),'allowNull':![]}};
\ No newline at end of file
+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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 7b43f5a..150e32b 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0x11d73e,_0x3f4882){_0x11d73e=_0x11d73e-0x0;var _0xfd3d73=_0x7a54[_0x11d73e];return _0xfd3d73;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index b9c4474..06e8c54 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 _0x74f1=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path'];(function(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0x74f1,0x14a));var _0x174f=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0x74f1[_0x1ee0a1];return _0x1d2d5b;};'use strict';var _=require('lodash');var util=require(_0x174f('0x0'));var logger=require(_0x174f('0x1'))(_0x174f('0x2'));var moment=require(_0x174f('0x3'));var BPromise=require('bluebird');var rp=require(_0x174f('0x4'));var fs=require('fs');var path=require(_0x174f('0x5'));var rimraf=require(_0x174f('0x6'));var config=require(_0x174f('0x7'));var attributes=require(_0x174f('0x8'));module[_0x174f('0x9')]=function(_0xc8fdce,_0x1a4cff){return _0xc8fdce[_0x174f('0xa')]('ChatOfflineMessage',attributes,{'tableName':_0x174f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x174f('0xc'),'collate':_0x174f('0xd')});};
\ No newline at end of file
+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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 64f2b9d..286ff86 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 _0x9ea2=['then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ea2,0x147));var _0x29ea=function(_0x383ea8,_0x5d5797){_0x383ea8=_0x383ea8-0x0;var _0x3736b8=_0x9ea2[_0x383ea8];return _0x3736b8;};'use strict';var _=require(_0x29ea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x29ea('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29ea('0x2'));var db=require(_0x29ea('0x3'))['db'];var utils=require(_0x29ea('0x4'));var logger=require(_0x29ea('0x5'))(_0x29ea('0x6'));var config=require(_0x29ea('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19f3b7,_0x50e60f,_0x36dbd7){return new BPromise(function(_0x25b1aa,_0x724c09){return client[_0x29ea('0x8')](_0x19f3b7,_0x36dbd7)[_0x29ea('0x9')](function(_0x96d254){logger[_0x29ea('0xa')](_0x29ea('0xb'),_0x50e60f,'request\x20sent');logger[_0x29ea('0xc')](_0x29ea('0xd'),_0x50e60f,_0x29ea('0xe'),JSON[_0x29ea('0xf')](_0x96d254));if(_0x96d254['error']){if(_0x96d254['error'][_0x29ea('0x10')]===0x1f4){logger[_0x29ea('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x50e60f,_0x96d254[_0x29ea('0x11')][_0x29ea('0x12')]);return _0x724c09(_0x96d254[_0x29ea('0x11')]['message']);}logger[_0x29ea('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x50e60f,_0x96d254[_0x29ea('0x11')][_0x29ea('0x12')]);return _0x25b1aa(_0x96d254[_0x29ea('0x11')][_0x29ea('0x12')]);}else{logger[_0x29ea('0xa')](_0x29ea('0xb'),_0x50e60f,_0x29ea('0xe'));_0x25b1aa(_0x96d254[_0x29ea('0x13')][_0x29ea('0x12')]);}})[_0x29ea('0x14')](function(_0x303ceb){logger[_0x29ea('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x50e60f,_0x303ceb);_0x724c09(_0x303ceb);});});}
\ No newline at end of file
+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
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 72ef751..90ad2e9 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 _0x1591=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','destroy','exports','path','express','fs-extra','../../components/interaction/service'];(function(_0x16061c,_0xc37b21){var _0x190355=function(_0x3fe799){while(--_0x3fe799){_0x16061c['push'](_0x16061c['shift']());}};_0x190355(++_0xc37b21);}(_0x1591,0x84));var _0x1159=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x1591[_0x5311e8];return _0x582ad8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1159('0x0'));var timeout=require('connect-timeout');var express=require(_0x1159('0x1'));var router=express['Router']();var fs_extra=require(_0x1159('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x1159('0x3'));var config=require(_0x1159('0x4'));var controller=require(_0x1159('0x5'));router[_0x1159('0x6')]('/',auth[_0x1159('0x7')](),controller['index']);router[_0x1159('0x6')](_0x1159('0x8'),auth[_0x1159('0x7')](),controller[_0x1159('0x9')]);router['get'](_0x1159('0xa'),auth[_0x1159('0x7')](),controller[_0x1159('0xb')]);router[_0x1159('0xc')]('/',auth[_0x1159('0x7')](),controller[_0x1159('0xd')]);router['put'](_0x1159('0xa'),auth['isAuthenticated'](),controller[_0x1159('0xe')]);router['delete'](_0x1159('0xa'),auth[_0x1159('0x7')](),controller[_0x1159('0xf')]);module[_0x1159('0x10')]=router;
\ No newline at end of file
+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
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 65f53bf..9127ded 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 _0x086f=['INTEGER','sequelize','exports','STRING','ENUM','mouseOver','timeout'];(function(_0x941f4b,_0x2881e4){var _0x5b4e5b=function(_0x1ab59e){while(--_0x1ab59e){_0x941f4b['push'](_0x941f4b['shift']());}};_0x5b4e5b(++_0x2881e4);}(_0x086f,0xd3));var _0xf086=function(_0x521884,_0x29a522){_0x521884=_0x521884-0x0;var _0x35d60b=_0x086f[_0x521884];return _0x35d60b;};'use strict';var Sequelize=require(_0xf086('0x0'));module[_0xf086('0x1')]={'name':{'type':Sequelize[_0xf086('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf086('0x3')](_0xf086('0x4'),_0xf086('0x5')),'defaultValue':_0xf086('0x4')},'selector':{'type':Sequelize[_0xf086('0x2')]},'timeout':{'type':Sequelize[_0xf086('0x6')]}};
\ No newline at end of file
+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
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index bbad025..5b37605 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 _0x97d5=['catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','filters','attributes','includeAll','include','merge','options','find'];(function(_0x527382,_0x15ba60){var _0x157add=function(_0x452261){while(--_0x452261){_0x527382['push'](_0x527382['shift']());}};_0x157add(++_0x15ba60);}(_0x97d5,0x199));var _0x597d=function(_0x484630,_0x24ca02){_0x484630=_0x484630-0x0;var _0x2e187e=_0x97d5[_0x484630];return _0x2e187e;};'use strict';var emlformat=require(_0x597d('0x0'));var rimraf=require(_0x597d('0x1'));var zipdir=require(_0x597d('0x2'));var jsonpatch=require(_0x597d('0x3'));var rp=require(_0x597d('0x4'));var moment=require(_0x597d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x597d('0x6'));var util=require(_0x597d('0x7'));var path=require(_0x597d('0x8'));var sox=require('sox');var csv=require(_0x597d('0x9'));var ejs=require(_0x597d('0xa'));var fs=require('fs');var fs_extra=require(_0x597d('0xb'));var _=require(_0x597d('0xc'));var squel=require(_0x597d('0xd'));var crypto=require(_0x597d('0xe'));var jsforce=require(_0x597d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x597d('0x9'));var querystring=require(_0x597d('0x10'));var Papa=require('papaparse');var Redis=require(_0x597d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x597d('0x12'));var as=require(_0x597d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x597d('0x14'));var utils=require(_0x597d('0x15'));var config=require(_0x597d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x597d('0x17'))['db'];function respondWithStatusCode(_0x2f464a,_0x355fbd){_0x355fbd=_0x355fbd||0xcc;return function(_0x1664e5){if(_0x1664e5){return _0x2f464a[_0x597d('0x18')](_0x355fbd);}return _0x2f464a[_0x597d('0x19')](_0x355fbd)[_0x597d('0x1a')]();};}function respondWithResult(_0x465ebc,_0x810dce){_0x810dce=_0x810dce||0xc8;return function(_0x11147c){if(_0x11147c){return _0x465ebc[_0x597d('0x19')](_0x810dce)[_0x597d('0x1b')](_0x11147c);}};}function respondWithFilteredResult(_0x290db2,_0x394d1d){return function(_0x4ca1b1){if(_0x4ca1b1){var _0x17b021=typeof _0x394d1d['offset']===_0x597d('0x1c')&&typeof _0x394d1d[_0x597d('0x1d')]==='undefined';var _0x38844b=_0x4ca1b1['count'];var _0x68a5c6=_0x17b021?0x0:_0x394d1d[_0x597d('0x1e')];var _0x525f28=_0x17b021?_0x4ca1b1['count']:_0x394d1d['offset']+_0x394d1d[_0x597d('0x1d')];var _0x32717e;if(_0x525f28>=_0x38844b){_0x525f28=_0x38844b;_0x32717e=0xc8;}else{_0x32717e=0xce;}_0x290db2[_0x597d('0x19')](_0x32717e);return _0x290db2[_0x597d('0x1f')](_0x597d('0x20'),_0x68a5c6+'-'+_0x525f28+'/'+_0x38844b)[_0x597d('0x1b')](_0x4ca1b1);}return null;};}function patchUpdates(_0x4173c9){return function(_0x1f8966){try{jsonpatch[_0x597d('0x21')](_0x1f8966,_0x4173c9,!![]);}catch(_0x349d8a){return BPromise['reject'](_0x349d8a);}return _0x1f8966[_0x597d('0x22')]();};}function saveUpdates(_0x330794,_0x639ac){return function(_0x2d4e7b){if(_0x2d4e7b){return _0x2d4e7b[_0x597d('0x23')](_0x330794)[_0x597d('0x24')](function(_0x529af4){return _0x529af4;});}return null;};}function removeEntity(_0xc6ca7,_0xa0a6da){return function(_0x104476){if(_0x104476){return _0x104476[_0x597d('0x25')]()[_0x597d('0x24')](function(){_0xc6ca7['status'](0xcc)[_0x597d('0x1a')]();});}};}function handleEntityNotFound(_0x8e3c80,_0x1379a2){return function(_0x5a551f){if(!_0x5a551f){_0x8e3c80[_0x597d('0x18')](0x194);}return _0x5a551f;};}function handleError(_0x1713d1,_0x30d783){_0x30d783=_0x30d783||0x1f4;return function(_0x6f424f){logger[_0x597d('0x26')](_0x6f424f[_0x597d('0x27')]);if(_0x6f424f[_0x597d('0x28')]){delete _0x6f424f[_0x597d('0x28')];}_0x1713d1[_0x597d('0x19')](_0x30d783)[_0x597d('0x29')](_0x6f424f);};}exports[_0x597d('0x2a')]=function(_0x249e81,_0x25ffc6){var _0x2fcb0d={'raw':!![],'where':{'id':_0x249e81[_0x597d('0x2b')]['id']}},_0x106b92={};_0x106b92[_0x597d('0x2c')]=_['keys'](db[_0x597d('0x2d')][_0x597d('0x2e')]);_0x106b92['query']=_['keys'](_0x249e81[_0x597d('0x2f')]);_0x106b92[_0x597d('0x30')]=_['intersection'](_0x106b92[_0x597d('0x2c')],_0x106b92[_0x597d('0x2f')]);_0x2fcb0d[_0x597d('0x31')]=_['intersection'](_0x106b92[_0x597d('0x2c')],qs['fields'](_0x249e81[_0x597d('0x2f')]['fields']));_0x2fcb0d['attributes']=_0x2fcb0d['attributes']['length']?_0x2fcb0d['attributes']:_0x106b92[_0x597d('0x2c')];if(_0x249e81[_0x597d('0x2f')][_0x597d('0x32')]){_0x2fcb0d[_0x597d('0x33')]=[{'all':!![]}];}_0x2fcb0d=_[_0x597d('0x34')]({},_0x2fcb0d,_0x249e81[_0x597d('0x35')]);return db[_0x597d('0x2d')][_0x597d('0x36')](_0x2fcb0d)['then'](handleEntityNotFound(_0x25ffc6,null))[_0x597d('0x24')](respondWithResult(_0x25ffc6,null))[_0x597d('0x37')](handleError(_0x25ffc6,null));};exports[_0x597d('0x38')]=function(_0x2d56a1,_0x581541){return db[_0x597d('0x2d')][_0x597d('0x38')](_0x2d56a1[_0x597d('0x39')],{})[_0x597d('0x24')](respondWithResult(_0x581541,0xc9))[_0x597d('0x37')](handleError(_0x581541,null));};exports[_0x597d('0x23')]=function(_0x3807ca,_0x1cf849){if(_0x3807ca[_0x597d('0x39')]['id']){delete _0x3807ca[_0x597d('0x39')]['id'];}return db[_0x597d('0x2d')][_0x597d('0x36')]({'where':{'id':_0x3807ca[_0x597d('0x2b')]['id']}})[_0x597d('0x24')](handleEntityNotFound(_0x1cf849,null))[_0x597d('0x24')](saveUpdates(_0x3807ca[_0x597d('0x39')],null))[_0x597d('0x24')](respondWithResult(_0x1cf849,null))[_0x597d('0x37')](handleError(_0x1cf849,null));};exports[_0x597d('0x25')]=function(_0x13d8ba,_0x5b46cc){return db['ChatProactiveAction'][_0x597d('0x36')]({'where':{'id':_0x13d8ba['params']['id']}})[_0x597d('0x24')](handleEntityNotFound(_0x5b46cc,null))[_0x597d('0x24')](removeEntity(_0x5b46cc,null))['catch'](handleError(_0x5b46cc,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 6922b7d..2dfa5de 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 _0x1216=['exports','define','ChatProactiveAction','lodash','api','moment','bluebird','path','../../config/environment'];(function(_0x89f002,_0x576460){var _0x3e6340=function(_0x1117f4){while(--_0x1117f4){_0x89f002['push'](_0x89f002['shift']());}};_0x3e6340(++_0x576460);}(_0x1216,0x1c5));var _0x6121=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0x1216[_0x243cca];return _0xf94771;};'use strict';var _=require(_0x6121('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6121('0x1'));var moment=require(_0x6121('0x2'));var BPromise=require(_0x6121('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6121('0x4'));var rimraf=require('rimraf');var config=require(_0x6121('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0x6121('0x6')]=function(_0x48f5ab,_0x18c7bf){return _0x48f5ab[_0x6121('0x7')](_0x6121('0x8'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 7e582ea..9f0a916 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 _0x3b42=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x43f631,_0x519107){var _0x241582=function(_0x3f3616){while(--_0x3f3616){_0x43f631['push'](_0x43f631['shift']());}};_0x241582(++_0x519107);}(_0x3b42,0x1a1));var _0x23b4=function(_0x1c2d05,_0x1b5545){_0x1c2d05=_0x1c2d05-0x0;var _0xcc38af=_0x3b42[_0x1c2d05];return _0xcc38af;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x23b4('0x0'));var BPromise=require(_0x23b4('0x1'));var rs=require(_0x23b4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23b4('0x3'))['db'];var utils=require(_0x23b4('0x4'));var logger=require(_0x23b4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x23b4('0x6'));var client=jayson[_0x23b4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15bf82,_0x4fe583,_0x466075){return new BPromise(function(_0xa6a581,_0x381530){return client['request'](_0x15bf82,_0x466075)[_0x23b4('0x8')](function(_0x1451dd){logger[_0x23b4('0x9')](_0x23b4('0xa'),_0x4fe583,_0x23b4('0xb'));logger[_0x23b4('0xc')](_0x23b4('0xd'),_0x4fe583,'request\x20sent',JSON[_0x23b4('0xe')](_0x1451dd));if(_0x1451dd[_0x23b4('0xf')]){if(_0x1451dd[_0x23b4('0xf')][_0x23b4('0x10')]===0x1f4){logger[_0x23b4('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x4fe583,_0x1451dd['error'][_0x23b4('0x11')]);return _0x381530(_0x1451dd[_0x23b4('0xf')]['message']);}logger[_0x23b4('0xf')](_0x23b4('0xa'),_0x4fe583,_0x1451dd[_0x23b4('0xf')][_0x23b4('0x11')]);return _0xa6a581(_0x1451dd['error']['message']);}else{logger[_0x23b4('0x9')](_0x23b4('0xa'),_0x4fe583,_0x23b4('0xb'));_0xa6a581(_0x1451dd[_0x23b4('0x12')][_0x23b4('0x11')]);}})[_0x23b4('0x13')](function(_0x5ea951){logger[_0x23b4('0xf')](_0x23b4('0xa'),_0x4fe583,_0x5ea951);_0x381530(_0x5ea951);});});}
\ No newline at end of file
+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
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index be2f198..a8f121f 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 _0xeda8=['get','/:id','isAuthenticated','show','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x4b8aa8,_0x44d6b8){var _0x1467fe=function(_0x440908){while(--_0x440908){_0x4b8aa8['push'](_0x4b8aa8['shift']());}};_0x1467fe(++_0x44d6b8);}(_0xeda8,0x104));var _0x8eda=function(_0x26631e,_0x52ea53){_0x26631e=_0x26631e-0x0;var _0x19dafd=_0xeda8[_0x26631e];return _0x19dafd;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')](_0x8eda('0xb'),auth[_0x8eda('0xc')](),controller[_0x8eda('0xd')]);router['post']('/',auth[_0x8eda('0xc')](),controller[_0x8eda('0xe')]);router[_0x8eda('0xf')](_0x8eda('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8eda('0xc')](),controller[_0x8eda('0x10')]);module[_0x8eda('0x11')]=router;
\ No newline at end of file
+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
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index fd55b5e..97db6b2 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 _0xb767=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xb767,0x1bf));var _0x7b76=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb767[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x7b76('0x0'));module[_0x7b76('0x1')]={'name':{'type':Sequelize[_0x7b76('0x2')],'unique':_0x7b76('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7b76('0x2')]},'timeout':{'type':Sequelize[_0x7b76('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7b76('0x5')](_0x7b76('0x6'),_0x7b76('0x7'),_0x7b76('0x8'))}};
\ No newline at end of file
+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
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index dbf581c..ab42629 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 _0x4adb=['end','json','undefined','count','offset','limit','set','Content-Range','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','ChatQueue','rows','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','pick','findAll','User','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','getTeams','Team','addTeams','ids','Agents','voicePause','transaction','each','findOrCreate','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','sequelize','isEmpty','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status'];(function(_0x124298,_0x542004){var _0x35ac24=function(_0x49afe8){while(--_0x49afe8){_0x124298['push'](_0x124298['shift']());}};_0x35ac24(++_0x542004);}(_0x4adb,0x105));var _0xb4ad=function(_0x4f44b1,_0x3598cc){_0x4f44b1=_0x4f44b1-0x0;var _0x38ba9e=_0x4adb[_0x4f44b1];return _0x38ba9e;};'use strict';var emlformat=require(_0xb4ad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4ad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4ad('0x2'));var moment=require(_0xb4ad('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb4ad('0x4'));var util=require(_0xb4ad('0x5'));var path=require('path');var sox=require(_0xb4ad('0x6'));var csv=require('to-csv');var ejs=require(_0xb4ad('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb4ad('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb4ad('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xb4ad('0xa'));var querystring=require(_0xb4ad('0xb'));var Papa=require('papaparse');var Redis=require(_0xb4ad('0xc'));var authService=require(_0xb4ad('0xd'));var qs=require(_0xb4ad('0xe'));var as=require(_0xb4ad('0xf'));var hardwareService=require(_0xb4ad('0x10'));var logger=require(_0xb4ad('0x11'))(_0xb4ad('0x12'));var utils=require(_0xb4ad('0x13'));var config=require(_0xb4ad('0x14'));var licenseUtil=require(_0xb4ad('0x15'));var db=require(_0xb4ad('0x16'))['db'];config[_0xb4ad('0x17')]=_[_0xb4ad('0x18')](config[_0xb4ad('0x17')],{'host':_0xb4ad('0x19'),'port':0x18eb});var socket=require(_0xb4ad('0x1a'))(new Redis(config[_0xb4ad('0x17')]));require(_0xb4ad('0x1b'))[_0xb4ad('0x1c')](socket);var jayson=require(_0xb4ad('0x1d'));var client=jayson[_0xb4ad('0x1e')][_0xb4ad('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2400f,_0x3f89f7,_0x1ae24e,_0x278451){return new BPromise(function(_0x2f7824,_0x31f6d3){var _0x2a22a0=_0x278451||client;return _0x2a22a0[_0xb4ad('0x20')](_0x2400f,_0x1ae24e)[_0xb4ad('0x21')](function(_0x1de2cb){logger[_0xb4ad('0x22')](_0xb4ad('0x23'),_0x3f89f7,_0xb4ad('0x24'));logger['debug'](_0xb4ad('0x25'),_0x3f89f7,'request\x20sent',JSON['stringify'](_0x1de2cb));if(_0x1de2cb['error']){if(_0x1de2cb[_0xb4ad('0x26')][_0xb4ad('0x27')]===0x1f4){logger[_0xb4ad('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3f89f7,_0x1de2cb['error'][_0xb4ad('0x28')]);return _0x31f6d3(_0x1de2cb[_0xb4ad('0x26')]['message']);}logger[_0xb4ad('0x26')](_0xb4ad('0x23'),_0x3f89f7,_0x1de2cb[_0xb4ad('0x26')][_0xb4ad('0x28')]);return _0x2f7824(_0x1de2cb['error'][_0xb4ad('0x28')]);}else{logger['info'](_0xb4ad('0x23'),_0x3f89f7,'request\x20sent');_0x2f7824(_0x1de2cb[_0xb4ad('0x29')][_0xb4ad('0x28')]);}})[_0xb4ad('0x2a')](function(_0x515815){logger[_0xb4ad('0x26')]('ChatQueue,\x20%s,\x20%s',_0x3f89f7,_0x515815);_0x31f6d3(_0x515815);});});}function respondWithStatusCode(_0x3fec40,_0x4204b3){_0x4204b3=_0x4204b3||0xcc;return function(_0x359c18){if(_0x359c18){return _0x3fec40[_0xb4ad('0x2b')](_0x4204b3);}return _0x3fec40[_0xb4ad('0x2c')](_0x4204b3)[_0xb4ad('0x2d')]();};}function respondWithResult(_0x4ec5cc,_0x28b5d7){_0x28b5d7=_0x28b5d7||0xc8;return function(_0x757a03){if(_0x757a03){return _0x4ec5cc['status'](_0x28b5d7)[_0xb4ad('0x2e')](_0x757a03);}};}function respondWithFilteredResult(_0xde5ea3,_0x2684fe){return function(_0x4c94d2){if(_0x4c94d2){var _0x280931=typeof _0x2684fe['offset']===_0xb4ad('0x2f')&&typeof _0x2684fe['limit']==='undefined';var _0x235be6=_0x4c94d2['count'];var _0x319a4d=_0x280931?0x0:_0x2684fe['offset'];var _0x457538=_0x280931?_0x4c94d2[_0xb4ad('0x30')]:_0x2684fe[_0xb4ad('0x31')]+_0x2684fe[_0xb4ad('0x32')];var _0x587fc4;if(_0x457538>=_0x235be6){_0x457538=_0x235be6;_0x587fc4=0xc8;}else{_0x587fc4=0xce;}_0xde5ea3[_0xb4ad('0x2c')](_0x587fc4);return _0xde5ea3[_0xb4ad('0x33')](_0xb4ad('0x34'),_0x319a4d+'-'+_0x457538+'/'+_0x235be6)['json'](_0x4c94d2);}return null;};}function patchUpdates(_0x3b6a8c){return function(_0x296880){try{jsonpatch['apply'](_0x296880,_0x3b6a8c,!![]);}catch(_0x56db03){return BPromise[_0xb4ad('0x35')](_0x56db03);}return _0x296880[_0xb4ad('0x36')]();};}function saveUpdates(_0x67ebfd,_0x5c2142){return function(_0x132e6c){if(_0x132e6c){return _0x132e6c[_0xb4ad('0x37')](_0x67ebfd)[_0xb4ad('0x21')](function(_0x35a6af){return _0x35a6af;});}return null;};}function removeEntity(_0x57c7c8,_0x288514){return function(_0x4cbaf8){if(_0x4cbaf8){return _0x4cbaf8[_0xb4ad('0x38')]()['then'](function(){var _0x111ec6=_0x4cbaf8['get']({'plain':!![]});var _0x1d8ff4=_0xb4ad('0x39');return db[_0xb4ad('0x3a')]['destroy']({'where':{'type':_0x1d8ff4,'resourceId':_0x111ec6['id']}})[_0xb4ad('0x21')](function(){return _0x4cbaf8;});})[_0xb4ad('0x21')](function(){_0x57c7c8[_0xb4ad('0x2c')](0xcc)[_0xb4ad('0x2d')]();});}};}function handleEntityNotFound(_0x102b7a,_0xf061bc){return function(_0x3a5d88){if(!_0x3a5d88){_0x102b7a[_0xb4ad('0x2b')](0x194);}return _0x3a5d88;};}function handleError(_0x33b6e9,_0x41a94d){_0x41a94d=_0x41a94d||0x1f4;return function(_0x149103){logger[_0xb4ad('0x26')](_0x149103[_0xb4ad('0x3b')]);if(_0x149103[_0xb4ad('0x3c')]){delete _0x149103[_0xb4ad('0x3c')];}_0x33b6e9[_0xb4ad('0x2c')](_0x41a94d)[_0xb4ad('0x3d')](_0x149103);};}exports[_0xb4ad('0x3e')]=function(_0x8bad9d,_0x5cb5dd){var _0x192b28={},_0x539c8b={},_0x1501ed={'count':0x0,'rows':[]};var _0xb17a47=_['map'](db['ChatQueue']['rawAttributes'],function(_0x51fc96){return{'name':_0x51fc96[_0xb4ad('0x3f')],'type':_0x51fc96[_0xb4ad('0x40')][_0xb4ad('0x41')]};});_0x539c8b['model']=_[_0xb4ad('0x42')](_0xb17a47,_0xb4ad('0x3c'));_0x539c8b[_0xb4ad('0x43')]=_[_0xb4ad('0x44')](_0x8bad9d[_0xb4ad('0x43')]);_0x539c8b['filters']=_[_0xb4ad('0x45')](_0x539c8b['model'],_0x539c8b['query']);_0x192b28['attributes']=_[_0xb4ad('0x45')](_0x539c8b[_0xb4ad('0x46')],qs[_0xb4ad('0x47')](_0x8bad9d[_0xb4ad('0x43')]['fields']));_0x192b28[_0xb4ad('0x48')]=_0x192b28[_0xb4ad('0x48')][_0xb4ad('0x49')]?_0x192b28[_0xb4ad('0x48')]:_0x539c8b[_0xb4ad('0x46')];if(!_0x8bad9d[_0xb4ad('0x43')]['hasOwnProperty'](_0xb4ad('0x4a'))){_0x192b28[_0xb4ad('0x32')]=qs[_0xb4ad('0x32')](_0x8bad9d[_0xb4ad('0x43')][_0xb4ad('0x32')]);_0x192b28[_0xb4ad('0x31')]=qs['offset'](_0x8bad9d['query']['offset']);}_0x192b28['order']=qs['sort'](_0x8bad9d[_0xb4ad('0x43')][_0xb4ad('0x4b')]);_0x192b28[_0xb4ad('0x4c')]=qs[_0xb4ad('0x4d')](_['pick'](_0x8bad9d['query'],_0x539c8b[_0xb4ad('0x4d')]),_0xb17a47);if(_0x8bad9d[_0xb4ad('0x43')]['filter']){_0x192b28[_0xb4ad('0x4c')]=_[_0xb4ad('0x4e')](_0x192b28[_0xb4ad('0x4c')],{'$or':_[_0xb4ad('0x42')](_0xb17a47,function(_0x18d90e){if(_0x18d90e[_0xb4ad('0x40')]!==_0xb4ad('0x4f')){var _0x57df88={};_0x57df88[_0x18d90e[_0xb4ad('0x3c')]]={'$like':'%'+_0x8bad9d[_0xb4ad('0x43')][_0xb4ad('0x50')]+'%'};return _0x57df88;}})});}_0x192b28=_[_0xb4ad('0x4e')]({},_0x192b28,_0x8bad9d[_0xb4ad('0x51')]);var _0x4e7ac2={'where':_0x192b28[_0xb4ad('0x4c')]};return db['ChatQueue']['count'](_0x4e7ac2)['then'](function(_0x4519e9){_0x1501ed[_0xb4ad('0x30')]=_0x4519e9;if(_0x8bad9d[_0xb4ad('0x43')][_0xb4ad('0x52')]){_0x192b28[_0xb4ad('0x53')]=[{'all':!![]}];}return db[_0xb4ad('0x54')]['findAll'](_0x192b28);})[_0xb4ad('0x21')](function(_0x3ee04d){_0x1501ed[_0xb4ad('0x55')]=_0x3ee04d;return _0x1501ed;})['then'](respondWithFilteredResult(_0x5cb5dd,_0x192b28))['catch'](handleError(_0x5cb5dd,null));};exports[_0xb4ad('0x56')]=function(_0x569489,_0x58765b){var _0x37cef5={'raw':!![],'where':{'id':_0x569489[_0xb4ad('0x57')]['id']}},_0x33e338={};_0x33e338[_0xb4ad('0x46')]=_[_0xb4ad('0x44')](db[_0xb4ad('0x54')][_0xb4ad('0x58')]);_0x33e338[_0xb4ad('0x43')]=_['keys'](_0x569489[_0xb4ad('0x43')]);_0x33e338[_0xb4ad('0x4d')]=_['intersection'](_0x33e338[_0xb4ad('0x46')],_0x33e338[_0xb4ad('0x43')]);_0x37cef5[_0xb4ad('0x48')]=_[_0xb4ad('0x45')](_0x33e338[_0xb4ad('0x46')],qs[_0xb4ad('0x47')](_0x569489[_0xb4ad('0x43')][_0xb4ad('0x47')]));_0x37cef5[_0xb4ad('0x48')]=_0x37cef5['attributes'][_0xb4ad('0x49')]?_0x37cef5[_0xb4ad('0x48')]:_0x33e338['model'];if(_0x569489[_0xb4ad('0x43')][_0xb4ad('0x52')]){_0x37cef5[_0xb4ad('0x53')]=[{'all':!![]}];}_0x37cef5=_[_0xb4ad('0x4e')]({},_0x37cef5,_0x569489[_0xb4ad('0x51')]);return db[_0xb4ad('0x54')]['find'](_0x37cef5)[_0xb4ad('0x21')](handleEntityNotFound(_0x58765b,null))[_0xb4ad('0x21')](respondWithResult(_0x58765b,null))[_0xb4ad('0x2a')](handleError(_0x58765b,null));};exports[_0xb4ad('0x59')]=function(_0x283b88,_0x320ab4){return db['ChatQueue'][_0xb4ad('0x59')](_0x283b88[_0xb4ad('0x5a')],{})['then'](function(_0x468686){var _0x4e97d3=_0x283b88[_0xb4ad('0x5b')][_0xb4ad('0x5c')]({'plain':!![]});if(!_0x4e97d3)throw new Error(_0xb4ad('0x5d'));if(_0x4e97d3[_0xb4ad('0x5e')]===_0xb4ad('0x5b')){var _0x5c9d64=_0x468686[_0xb4ad('0x5c')]({'plain':!![]});var _0x5bb9dc=_0xb4ad('0x39');return db[_0xb4ad('0x5f')][_0xb4ad('0x60')]({'where':{'name':_0x5bb9dc,'userProfileId':_0x4e97d3[_0xb4ad('0x61')]},'raw':!![]})[_0xb4ad('0x21')](function(_0x3f2603){if(_0x3f2603&&_0x3f2603[_0xb4ad('0x62')]===0x0){return db[_0xb4ad('0x3a')][_0xb4ad('0x59')]({'name':_0x5c9d64[_0xb4ad('0x3c')],'resourceId':_0x5c9d64['id'],'type':_0x3f2603[_0xb4ad('0x3c')],'sectionId':_0x3f2603['id']},{})[_0xb4ad('0x21')](function(){return _0x468686;});}else{return _0x468686;}})['catch'](function(_0x3f3111){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f3111);throw _0x3f3111;});}return _0x468686;})[_0xb4ad('0x21')](respondWithResult(_0x320ab4,0xc9))[_0xb4ad('0x2a')](handleError(_0x320ab4,null));};exports[_0xb4ad('0x37')]=function(_0x50b3d9,_0x7a3be7){if(_0x50b3d9[_0xb4ad('0x5a')]['id']){delete _0x50b3d9['body']['id'];}return db[_0xb4ad('0x54')][_0xb4ad('0x60')]({'where':{'id':_0x50b3d9[_0xb4ad('0x57')]['id']}})[_0xb4ad('0x21')](handleEntityNotFound(_0x7a3be7,null))['then'](saveUpdates(_0x50b3d9[_0xb4ad('0x5a')],null))[_0xb4ad('0x21')](respondWithResult(_0x7a3be7,null))[_0xb4ad('0x2a')](handleError(_0x7a3be7,null));};exports['destroy']=function(_0x9fac7d,_0x5f2726){return db['ChatQueue'][_0xb4ad('0x60')]({'where':{'id':_0x9fac7d['params']['id']}})[_0xb4ad('0x21')](handleEntityNotFound(_0x5f2726,null))['then'](removeEntity(_0x5f2726,null))[_0xb4ad('0x2a')](handleError(_0x5f2726,null));};exports[_0xb4ad('0x63')]=function(_0x2862e6,_0x3b3d71){return db[_0xb4ad('0x54')][_0xb4ad('0x63')]()[_0xb4ad('0x21')](respondWithResult(_0x3b3d71,null))[_0xb4ad('0x2a')](handleError(_0x3b3d71,null));};exports[_0xb4ad('0x64')]=function(_0x3bbbd5,_0x51b7da,_0x46fdab){var _0x28544f={'raw':!![],'where':{}},_0x54a7e7={},_0x29cd8d;return db[_0xb4ad('0x54')][_0xb4ad('0x65')]({'where':{'id':_0x3bbbd5['params']['id']}})[_0xb4ad('0x21')](handleEntityNotFound(_0x51b7da,null))[_0xb4ad('0x21')](function(_0x33cd37){if(_0x33cd37){_0x29cd8d=_0x33cd37[_0xb4ad('0x5c')]({'plain':!![]});_0x54a7e7[_0xb4ad('0x46')]=_[_0xb4ad('0x44')](db[_0xb4ad('0x66')]['rawAttributes']);_0x54a7e7[_0xb4ad('0x43')]=_[_0xb4ad('0x44')](_0x3bbbd5['query']);_0x54a7e7['filters']=_[_0xb4ad('0x45')](_0x54a7e7['model'],_0x54a7e7[_0xb4ad('0x43')]);_0x28544f[_0xb4ad('0x48')]=_['intersection'](_0x54a7e7[_0xb4ad('0x46')],qs[_0xb4ad('0x47')](_0x3bbbd5[_0xb4ad('0x43')][_0xb4ad('0x47')]));_0x28544f[_0xb4ad('0x48')]=_0x28544f['attributes']['length']?_0x28544f[_0xb4ad('0x48')]:_0x54a7e7[_0xb4ad('0x46')];if(!_0x3bbbd5['query'][_0xb4ad('0x67')](_0xb4ad('0x4a'))){_0x28544f[_0xb4ad('0x32')]=qs[_0xb4ad('0x32')](_0x3bbbd5[_0xb4ad('0x43')][_0xb4ad('0x32')]);_0x28544f[_0xb4ad('0x31')]=qs['offset'](_0x3bbbd5['query']['offset']);}_0x28544f[_0xb4ad('0x68')]=qs['sort'](_0x3bbbd5['query']['sort']);_0x28544f['where']=qs['filters'](_[_0xb4ad('0x69')](_0x3bbbd5[_0xb4ad('0x43')],_0x54a7e7[_0xb4ad('0x4d')]));_0x28544f[_0xb4ad('0x4c')]['ChatQueueId']=_0x33cd37['id'];if(_0x3bbbd5[_0xb4ad('0x43')][_0xb4ad('0x50')]){_0x28544f[_0xb4ad('0x4c')]=_[_0xb4ad('0x4e')](_0x28544f[_0xb4ad('0x4c')],{'$or':_[_0xb4ad('0x42')](_0x28544f['attributes'],function(_0x4cc63d){var _0x2954c2={};_0x2954c2[_0x4cc63d]={'$like':'%'+_0x3bbbd5[_0xb4ad('0x43')][_0xb4ad('0x50')]+'%'};return _0x2954c2;})});}_0x28544f=_[_0xb4ad('0x4e')]({},_0x28544f,_0x3bbbd5[_0xb4ad('0x51')]);return db[_0xb4ad('0x66')][_0xb4ad('0x6a')](_0x28544f);}})[_0xb4ad('0x21')](function(_0x4f2e56){if(_0x4f2e56){return db[_0xb4ad('0x6b')]['findAndCountAll']({'where':{'id':_[_0xb4ad('0x42')](_0x4f2e56,'UserId'),'role':_0xb4ad('0x6c')},'attributes':['id',_0xb4ad('0x3c'),'chatPause',_0xb4ad('0x6d'),_0xb4ad('0x6e')]});}})[_0xb4ad('0x21')](function(_0x5bc72c){if(_0x5bc72c){return{'count':_0x5bc72c['count'],'rows':_[_0xb4ad('0x42')](_0x5bc72c[_0xb4ad('0x55')],function(_0x13359b){return{'membername':_0x13359b['name'],'UserId':_0x13359b['id'],'queue_name':_0x29cd8d[_0xb4ad('0x3c')],'ChatQueueId':_0x29cd8d['id'],'interface':util[_0xb4ad('0x6f')](_0xb4ad('0x70'),_0xb4ad('0x71'),_0x13359b['name']),'penalty':0x0,'paused':_0x13359b[_0xb4ad('0x72')],'createdAt':_0x13359b[_0xb4ad('0x6e')],'updatedAt':_0x13359b[_0xb4ad('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb4ad('0x21')](respondWithFilteredResult(_0x51b7da,_0x28544f))[_0xb4ad('0x2a')](handleError(_0x51b7da,null));};exports[_0xb4ad('0x73')]=function(_0x281537,_0x189910,_0x43271f){var _0x464207={};var _0x315714={};var _0x1ff24c;var _0x32c412;return db[_0xb4ad('0x54')]['findOne']({'where':{'id':_0x281537[_0xb4ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x189910,null))[_0xb4ad('0x21')](function(_0x69559a){if(_0x69559a){_0x1ff24c=_0x69559a;_0x315714[_0xb4ad('0x46')]=_[_0xb4ad('0x44')](db[_0xb4ad('0x74')][_0xb4ad('0x58')]);_0x315714[_0xb4ad('0x43')]=_[_0xb4ad('0x44')](_0x281537[_0xb4ad('0x43')]);_0x315714[_0xb4ad('0x4d')]=_[_0xb4ad('0x45')](_0x315714['model'],_0x315714[_0xb4ad('0x43')]);_0x464207['attributes']=_[_0xb4ad('0x45')](_0x315714[_0xb4ad('0x46')],qs[_0xb4ad('0x47')](_0x281537[_0xb4ad('0x43')][_0xb4ad('0x47')]));_0x464207[_0xb4ad('0x48')]=_0x464207[_0xb4ad('0x48')][_0xb4ad('0x49')]?_0x464207[_0xb4ad('0x48')]:_0x315714[_0xb4ad('0x46')];_0x464207[_0xb4ad('0x68')]=qs[_0xb4ad('0x4b')](_0x281537[_0xb4ad('0x43')]['sort']);_0x464207[_0xb4ad('0x4c')]=qs[_0xb4ad('0x4d')](_[_0xb4ad('0x69')](_0x281537[_0xb4ad('0x43')],_0x315714[_0xb4ad('0x4d')]));if(_0x281537[_0xb4ad('0x43')][_0xb4ad('0x50')]){_0x464207[_0xb4ad('0x4c')]=_[_0xb4ad('0x4e')](_0x464207[_0xb4ad('0x4c')],{'$or':_[_0xb4ad('0x42')](_0x464207[_0xb4ad('0x48')],function(_0x4049e5){var _0x2c9d33={};_0x2c9d33[_0x4049e5]={'$like':'%'+_0x281537[_0xb4ad('0x43')][_0xb4ad('0x50')]+'%'};return _0x2c9d33;})});}_0x464207=_[_0xb4ad('0x4e')]({},_0x464207,_0x281537[_0xb4ad('0x51')]);return _0x1ff24c[_0xb4ad('0x73')](_0x464207);}})[_0xb4ad('0x21')](function(_0x47ae6a){if(_0x47ae6a){_0x32c412=_0x47ae6a[_0xb4ad('0x49')];if(!_0x281537[_0xb4ad('0x43')][_0xb4ad('0x67')](_0xb4ad('0x4a'))){_0x464207[_0xb4ad('0x32')]=qs[_0xb4ad('0x32')](_0x281537[_0xb4ad('0x43')][_0xb4ad('0x32')]);_0x464207['offset']=qs['offset'](_0x281537[_0xb4ad('0x43')][_0xb4ad('0x31')]);}return _0x1ff24c[_0xb4ad('0x73')](_0x464207);}})['then'](function(_0x14ed3d){if(_0x14ed3d){return _0x14ed3d?{'count':_0x32c412,'rows':_0x14ed3d}:null;}})[_0xb4ad('0x21')](respondWithResult(_0x189910,null))['catch'](handleError(_0x189910,null));};exports[_0xb4ad('0x75')]=function(_0x2303b7,_0x4e0e07,_0x5baca3){var _0x1bb472=_0x2303b7[_0xb4ad('0x5a')][_0xb4ad('0x76')];return db[_0xb4ad('0x74')]['findAll']({'where':{'id':_0x1bb472},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb4ad('0x77'),'attributes':['id',_0xb4ad('0x3c'),'online',_0xb4ad('0x78'),'interface'],'raw':!![]}]})[_0xb4ad('0x21')](function(_0x5147a7){if(_0x5147a7){var _0xf4ef09=_['flatMap'](_0x5147a7,function(_0x1407b8){var _0x3202e4=_0x1407b8['get']({'plain':!![]});return _0x3202e4['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x2303b7[_0xb4ad('0x57')]['id']}})['then'](function(_0x302d79){return db['sequelize'][_0xb4ad('0x79')](function(_0x1c1603){return _0x302d79[_0xb4ad('0x75')](_0x1bb472,{'transaction':_0x1c1603})[_0xb4ad('0x21')](function(){return BPromise[_0xb4ad('0x7a')](_0xf4ef09,function(_0x31264a){return db[_0xb4ad('0x66')][_0xb4ad('0x7b')]({'where':{'UserId':_0x31264a['id'],'ChatQueueId':_0x2303b7[_0xb4ad('0x57')]['id']},'transaction':_0x1c1603});});})[_0xb4ad('0x21')](function(){_0xf4ef09[_0xb4ad('0x7c')](function(_0xc52cb8){socket['emit'](_0xb4ad('0x7d'),{'UserId':_0xc52cb8['id'],'ChatQueueId':_0x302d79['id']});});});});});}})[_0xb4ad('0x21')](respondWithStatusCode(_0x4e0e07,null))[_0xb4ad('0x2a')](handleError(_0x4e0e07,null));};exports[_0xb4ad('0x7e')]=function(_0x40b8b0,_0x44cbaa,_0x1ba239){return db[_0xb4ad('0x74')][_0xb4ad('0x6a')]({'where':{'id':_0x40b8b0[_0xb4ad('0x43')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb4ad('0x6b')],'as':_0xb4ad('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x44cbaa,null))[_0xb4ad('0x21')](function(_0x20f493){var _0x26230a=_['map'](_0x20f493,'id');var _0x48ac9b=[];var _0x30ef30=[];var _0x21fd29=squel[_0xb4ad('0x7f')]();_0x21fd29[_0xb4ad('0x80')](_0xb4ad('0x81'))[_0xb4ad('0x82')]('team_has_chat_queues','tq')[_0xb4ad('0x83')](_0xb4ad('0x84'),'ut',_0xb4ad('0x85'))[_0xb4ad('0x4c')](_0xb4ad('0x86'),_0x40b8b0[_0xb4ad('0x57')]['id']);for(var _0x5051de=0x0;_0x5051de<_0x20f493[_0xb4ad('0x49')];_0x5051de+=0x1){let _0x4a7783=_0x20f493[_0x5051de];for(var _0x37c351=0x0;_0x37c351<_0x4a7783[_0xb4ad('0x77')][_0xb4ad('0x49')];_0x37c351+=0x1){let _0x3e0acd=_0x4a7783['Agents'][_0x37c351];var _0x3fbbff=_0x21fd29['clone']();_0x3fbbff[_0xb4ad('0x4c')]('ut.UserId\x20=\x20?',_0x3e0acd['id']);_0x30ef30[_0xb4ad('0x87')](db['sequelize'][_0xb4ad('0x43')](_0x3fbbff[_0xb4ad('0x88')](),{'type':db['sequelize'][_0xb4ad('0x89')][_0xb4ad('0x8a')]})['then'](function(_0x1aeb2a){if(_0x1aeb2a[_0xb4ad('0x49')]===0x1){return _0x3e0acd['id'];}else{var _0x93cc98=_[_0xb4ad('0x8b')](_[_0xb4ad('0x42')](_0x1aeb2a,_0xb4ad('0x8c')),function(_0x27daa4){return _['includes'](_0x26230a,_0x27daa4);});if(_0x93cc98){return _0x3e0acd['id'];}}}));}}return BPromise[_0xb4ad('0x8d')](_0x30ef30)[_0xb4ad('0x21')](function(_0x18106a){_0x48ac9b=_(_0x48ac9b)[_0xb4ad('0x8e')](_0x18106a)['compact']()[_0xb4ad('0x8f')]();return db[_0xb4ad('0x54')]['find']({'where':{'id':_0x40b8b0[_0xb4ad('0x57')]['id']}})[_0xb4ad('0x21')](function(_0x4caeb3){return db[_0xb4ad('0x90')][_0xb4ad('0x79')](function(_0x2fcf95){return _0x4caeb3['removeTeams'](_0x40b8b0[_0xb4ad('0x43')][_0xb4ad('0x76')],{'transaction':_0x2fcf95})[_0xb4ad('0x21')](function(){if(!_[_0xb4ad('0x91')](_0x48ac9b)){return _0x4caeb3['removeAgents'](_0x48ac9b,{'transaction':_0x2fcf95});}})[_0xb4ad('0x21')](function(){_0x48ac9b['forEach'](function(_0x5d7d71){socket[_0xb4ad('0x92')](_0xb4ad('0x93'),{'UserId':_0x5d7d71,'ChatQueueId':_0x4caeb3['id']});});});});});});})[_0xb4ad('0x21')](respondWithStatusCode(_0x44cbaa,null))[_0xb4ad('0x2a')](handleError(_0x44cbaa,null));};exports[_0xb4ad('0x94')]=function(_0x49d7a8,_0x1ad58c,_0x52a709){return db[_0xb4ad('0x54')][_0xb4ad('0x60')]({'where':{'id':_0x49d7a8[_0xb4ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x1ad58c,null))[_0xb4ad('0x21')](function(_0x18c381){if(_0x18c381){return _0x18c381['addAgents'](_0x49d7a8[_0xb4ad('0x5a')]['ids'],_[_0xb4ad('0x95')](_0x49d7a8[_0xb4ad('0x5a')],['ids','id'])||{})[_0xb4ad('0x96')](function(_0x12e8a3){for(var _0x4388d3=0x0;_0x4388d3<_0x49d7a8[_0xb4ad('0x5a')][_0xb4ad('0x76')][_0xb4ad('0x49')];_0x4388d3+=0x1){socket['emit'](_0xb4ad('0x7d'),{'UserId':Number(_0x49d7a8[_0xb4ad('0x5a')][_0xb4ad('0x76')][_0x4388d3]),'ChatQueueId':Number(_0x49d7a8[_0xb4ad('0x57')]['id'])});}return _0x12e8a3;});}})[_0xb4ad('0x21')](respondWithResult(_0x1ad58c,null))[_0xb4ad('0x2a')](handleError(_0x1ad58c,null));};exports[_0xb4ad('0x97')]=function(_0xa02048,_0x13c694,_0x367329){return db[_0xb4ad('0x54')][_0xb4ad('0x60')]({'where':{'id':_0xa02048[_0xb4ad('0x57')]['id']}})['then'](handleEntityNotFound(_0x13c694,null))[_0xb4ad('0x21')](function(_0x300186){if(_0x300186){return _0x300186[_0xb4ad('0x97')](_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')])[_0xb4ad('0x21')](function(){if(_['isArray'](_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')])){for(var _0x490dcf=0x0;_0x490dcf<_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')][_0xb4ad('0x49')];_0x490dcf+=0x1){socket[_0xb4ad('0x92')](_0xb4ad('0x93'),{'UserId':Number(_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')][_0x490dcf]),'ChatQueueId':Number(_0xa02048['params']['id'])});}}else{socket[_0xb4ad('0x92')](_0xb4ad('0x93'),{'UserId':Number(_0xa02048[_0xb4ad('0x43')][_0xb4ad('0x76')]),'ChatQueueId':Number(_0xa02048['params']['id'])});}});}})['then'](respondWithStatusCode(_0x13c694,null))['catch'](handleError(_0x13c694,null));};exports[_0xb4ad('0x98')]=function(_0xc1598c,_0x596d2c,_0x206f53){var _0x56ac1e={};var _0x14605a={};var _0x22dea7;var _0xd3a446;return db[_0xb4ad('0x54')]['findOne']({'where':{'id':_0xc1598c[_0xb4ad('0x57')]['id']}})[_0xb4ad('0x21')](handleEntityNotFound(_0x596d2c,null))[_0xb4ad('0x21')](function(_0x4fa312){if(_0x4fa312){_0x22dea7=_0x4fa312;_0x14605a[_0xb4ad('0x46')]=_[_0xb4ad('0x44')](db[_0xb4ad('0x6b')][_0xb4ad('0x58')]);_0x14605a['query']=_[_0xb4ad('0x44')](_0xc1598c[_0xb4ad('0x43')]);_0x14605a[_0xb4ad('0x4d')]=_['intersection'](_0x14605a[_0xb4ad('0x46')],_0x14605a[_0xb4ad('0x43')]);_0x56ac1e[_0xb4ad('0x48')]=_[_0xb4ad('0x45')](_0x14605a[_0xb4ad('0x46')],qs['fields'](_0xc1598c[_0xb4ad('0x43')][_0xb4ad('0x47')]));_0x56ac1e[_0xb4ad('0x48')]=_0x56ac1e[_0xb4ad('0x48')][_0xb4ad('0x49')]?_0x56ac1e[_0xb4ad('0x48')]:_0x14605a['model'];_0x56ac1e[_0xb4ad('0x68')]=qs['sort'](_0xc1598c[_0xb4ad('0x43')][_0xb4ad('0x4b')]);_0x56ac1e[_0xb4ad('0x4c')]=qs[_0xb4ad('0x4d')](_['pick'](_0xc1598c[_0xb4ad('0x43')],_0x14605a['filters']));if(_0xc1598c['query'][_0xb4ad('0x50')]){_0x56ac1e[_0xb4ad('0x4c')]=_[_0xb4ad('0x4e')](_0x56ac1e[_0xb4ad('0x4c')],{'$or':_['map'](_0x56ac1e[_0xb4ad('0x48')],function(_0x2c6472){var _0x36b259={};_0x36b259[_0x2c6472]={'$like':'%'+_0xc1598c[_0xb4ad('0x43')][_0xb4ad('0x50')]+'%'};return _0x36b259;})});}_0x56ac1e=_[_0xb4ad('0x4e')]({},_0x56ac1e,_0xc1598c[_0xb4ad('0x51')]);return _0x22dea7['getAgents'](_0x56ac1e);}})[_0xb4ad('0x21')](function(_0x6b113f){if(_0x6b113f){_0xd3a446=_0x6b113f[_0xb4ad('0x49')];if(!_0xc1598c['query'][_0xb4ad('0x67')](_0xb4ad('0x4a'))){_0x56ac1e[_0xb4ad('0x32')]=qs[_0xb4ad('0x32')](_0xc1598c['query'][_0xb4ad('0x32')]);_0x56ac1e[_0xb4ad('0x31')]=qs[_0xb4ad('0x31')](_0xc1598c[_0xb4ad('0x43')][_0xb4ad('0x31')]);}return _0x22dea7['getAgents'](_0x56ac1e);}})[_0xb4ad('0x21')](function(_0x211068){if(_0x211068){return _0x211068?{'count':_0xd3a446,'rows':_0x211068}:null;}})[_0xb4ad('0x21')](respondWithResult(_0x596d2c,null))[_0xb4ad('0x2a')](handleError(_0x596d2c,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index c66dfb8..51f0323 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 _0x4e8e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0x5bd4ce,_0x40f4f2){var _0x1bd0f1=function(_0x399c73){while(--_0x399c73){_0x5bd4ce['push'](_0x5bd4ce['shift']());}};_0x1bd0f1(++_0x40f4f2);}(_0x4e8e,0x95));var _0xe4e8=function(_0x255c9a,_0x50c1db){_0x255c9a=_0x255c9a-0x0;var _0x57491d=_0x4e8e[_0x255c9a];return _0x57491d;};'use strict';var EventEmitter=require(_0xe4e8('0x0'));var ChatQueue=require(_0xe4e8('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4e8('0x2'),'afterUpdate':_0xe4e8('0x3'),'afterDestroy':_0xe4e8('0x4')};function emitEvent(_0xb45e41){return function(_0x53cfb5,_0x46c61f,_0x209be6){ChatQueueEvents[_0xe4e8('0x5')](_0xb45e41+':'+_0x53cfb5['id'],_0x53cfb5);ChatQueueEvents['emit'](_0xb45e41,_0x53cfb5);_0x209be6(null);};}for(var e in events){if(events[_0xe4e8('0x6')](e)){var event=events[e];ChatQueue[_0xe4e8('0x7')](e,emitEvent(event));}}module[_0xe4e8('0x8')]=ChatQueueEvents;
\ No newline at end of file
+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
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 2dca84a..27eddce 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 _0xfdf3=['ChatQueue','chat_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0xef4fc0,_0x33cc41){var _0x57dade=function(_0xe75b3e){while(--_0xe75b3e){_0xef4fc0['push'](_0xef4fc0['shift']());}};_0x57dade(++_0x33cc41);}(_0xfdf3,0x176));var _0x3fdf=function(_0x77e70,_0xd75f49){_0x77e70=_0x77e70-0x0;var _0x38f7aa=_0xfdf3[_0x77e70];return _0x38f7aa;};'use strict';var _=require(_0x3fdf('0x0'));var util=require(_0x3fdf('0x1'));var logger=require('../../config/logger')(_0x3fdf('0x2'));var moment=require(_0x3fdf('0x3'));var BPromise=require(_0x3fdf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fdf('0x5'));var rimraf=require(_0x3fdf('0x6'));var config=require(_0x3fdf('0x7'));var attributes=require(_0x3fdf('0x8'));module[_0x3fdf('0x9')]=function(_0xd23d22,_0x30c2a8){return _0xd23d22['define'](_0x3fdf('0xa'),attributes,{'tableName':_0x3fdf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 5895393..33f943c 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 _0x3264=['attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','then','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','catch','ChatQueue','findAll','options','raw','where'];(function(_0x335141,_0x52b910){var _0x4f84da=function(_0x4514ea){while(--_0x4514ea){_0x335141['push'](_0x335141['shift']());}};_0x4f84da(++_0x52b910);}(_0x3264,0x7f));var _0x4326=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x3264[_0x45bf86];return _0x1f02b7;};'use strict';var _=require('lodash');var util=require(_0x4326('0x0'));var moment=require(_0x4326('0x1'));var BPromise=require(_0x4326('0x2'));var rs=require(_0x4326('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4326('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4326('0x5'));var jayson=require(_0x4326('0x6'));var client=jayson[_0x4326('0x7')][_0x4326('0x8')]({'port':0x232a});config['redis']=_[_0x4326('0x9')](config[_0x4326('0xa')],{'host':_0x4326('0xb'),'port':0x18eb});var socket=require(_0x4326('0xc'))(new Redis(config[_0x4326('0xa')]));require(_0x4326('0xd'))[_0x4326('0xe')](socket);function respondWithRpcPromise(_0x5cde0b,_0x58bade,_0x51323a){return new BPromise(function(_0x97d63e,_0x9daa3f){return client[_0x4326('0xf')](_0x5cde0b,_0x51323a)['then'](function(_0x5ac227){logger[_0x4326('0x10')]('ChatQueue,\x20%s,\x20%s',_0x58bade,_0x4326('0x11'));logger[_0x4326('0x12')](_0x4326('0x13'),_0x58bade,'request\x20sent',JSON['stringify'](_0x5ac227));if(_0x5ac227[_0x4326('0x14')]){if(_0x5ac227['error']['code']===0x1f4){logger[_0x4326('0x14')](_0x4326('0x15'),_0x58bade,_0x5ac227[_0x4326('0x14')][_0x4326('0x16')]);return _0x9daa3f(_0x5ac227['error'][_0x4326('0x16')]);}logger[_0x4326('0x14')](_0x4326('0x15'),_0x58bade,_0x5ac227['error'][_0x4326('0x16')]);return _0x97d63e(_0x5ac227[_0x4326('0x14')][_0x4326('0x16')]);}else{logger[_0x4326('0x10')]('ChatQueue,\x20%s,\x20%s',_0x58bade,_0x4326('0x11'));_0x97d63e(_0x5ac227['result'][_0x4326('0x16')]);}})[_0x4326('0x17')](function(_0x35f24b){logger[_0x4326('0x14')](_0x4326('0x15'),_0x58bade,_0x35f24b);_0x9daa3f(_0x35f24b);});});}exports['GetChatQueue']=function(_0x42e4e8){var _0x3d5045=this;return new Promise(function(_0x54e4c4,_0x377a83){return db[_0x4326('0x18')][_0x4326('0x19')]({'raw':_0x42e4e8['options']?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1b')]===undefined?!![]:![]:!![],'where':_0x42e4e8[_0x4326('0x1a')]?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1c')]||null:null,'attributes':_0x42e4e8[_0x4326('0x1a')]?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1d')]||null:null,'limit':_0x42e4e8['options']?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1e')]||null:null,'include':_0x42e4e8['options']?_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1f')]?_[_0x4326('0x20')](_0x42e4e8[_0x4326('0x1a')][_0x4326('0x1f')],function(_0x4b5e63){return{'model':db[_0x4b5e63['model']],'as':_0x4b5e63['as'],'attributes':_0x4b5e63[_0x4326('0x1d')],'include':_0x4b5e63[_0x4326('0x1f')]?_[_0x4326('0x20')](_0x4b5e63[_0x4326('0x1f')],function(_0x4a1de7){return{'model':db[_0x4a1de7[_0x4326('0x21')]],'as':_0x4a1de7['as'],'attributes':_0x4a1de7[_0x4326('0x1d')],'include':_0x4a1de7[_0x4326('0x1f')]?_['map'](_0x4a1de7[_0x4326('0x1f')],function(_0x5a1c44){return{'model':db[_0x5a1c44[_0x4326('0x21')]],'as':_0x5a1c44['as'],'attributes':_0x5a1c44[_0x4326('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c56d5){logger[_0x4326('0x10')](_0x4326('0x22'),_0x42e4e8);logger[_0x4326('0x12')]('GetChatQueue',_0x42e4e8,JSON['stringify'](_0x3c56d5));_0x54e4c4(_0x3c56d5);})['catch'](function(_0x430f06){logger[_0x4326('0x14')](_0x4326('0x22'),_0x430f06[_0x4326('0x16')],_0x42e4e8);_0x377a83(_0x3d5045[_0x4326('0x14')](0x1f4,_0x430f06[_0x4326('0x16')]));});});};exports[_0x4326('0x23')]=function(_0xd54ee0){var _0x2a94e7=this;return new Promise(function(_0x28c48a,_0x49a2d1){return db[_0x4326('0x18')][_0x4326('0x24')]({'raw':_0xd54ee0[_0x4326('0x1a')]?_0xd54ee0[_0x4326('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xd54ee0[_0x4326('0x1a')]?_0xd54ee0[_0x4326('0x1a')][_0x4326('0x1c')]||null:null,'attributes':_0xd54ee0[_0x4326('0x1a')]?_0xd54ee0[_0x4326('0x1a')][_0x4326('0x1d')]||null:null,'include':_0xd54ee0['options']?_0xd54ee0[_0x4326('0x1a')][_0x4326('0x1f')]?_[_0x4326('0x20')](_0xd54ee0[_0x4326('0x1a')][_0x4326('0x1f')],function(_0x2138ed){return{'model':db[_0x2138ed[_0x4326('0x21')]],'as':_0x2138ed['as'],'attributes':_0x2138ed['attributes'],'include':_0x2138ed['include']?_[_0x4326('0x20')](_0x2138ed['include'],function(_0x2d5385){return{'model':db[_0x2d5385[_0x4326('0x21')]],'as':_0x2d5385['as'],'attributes':_0x2d5385[_0x4326('0x1d')],'include':_0x2d5385[_0x4326('0x1f')]?_['map'](_0x2d5385['include'],function(_0x1db617){return{'model':db[_0x1db617[_0x4326('0x21')]],'as':_0x1db617['as'],'attributes':_0x1db617['attributes']};}):[]};}):[]};}):[]:[]})[_0x4326('0x25')](function(_0x1233ad){logger[_0x4326('0x10')](_0x4326('0x23'),_0xd54ee0);logger[_0x4326('0x12')](_0x4326('0x23'),_0xd54ee0,JSON[_0x4326('0x26')](_0x1233ad));_0x28c48a(_0x1233ad);})[_0x4326('0x17')](function(_0x3496ac){logger[_0x4326('0x14')]('ShowChatQueue',_0x3496ac['message'],_0xd54ee0);_0x49a2d1(_0x2a94e7['error'](0x1f4,_0x3496ac[_0x4326('0x16')]));});});};
\ No newline at end of file
+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
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 444b0bb..8d9a302 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 _0x6334=['length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x476718,_0x4fb3c6){var _0x1a2b16=function(_0x5b93b0){while(--_0x5b93b0){_0x476718['push'](_0x476718['shift']());}};_0x1a2b16(++_0x4fb3c6);}(_0x6334,0x119));var _0x4633=function(_0x3ae34a,_0x143082){_0x3ae34a=_0x3ae34a-0x0;var _0x4c9edc=_0x6334[_0x3ae34a];return _0x4c9edc;};'use strict';var ChatQueueEvents=require(_0x4633('0x0'));var events=[_0x4633('0x1'),_0x4633('0x2'),_0x4633('0x3')];function createListener(_0x1e53a0,_0x47254b){return function(_0x5109db){_0x47254b[_0x4633('0x4')](_0x1e53a0,_0x5109db);};}function removeListener(_0x205442,_0x2a2b3c){return function(){ChatQueueEvents[_0x4633('0x5')](_0x205442,_0x2a2b3c);};}exports[_0x4633('0x6')]=function(_0x6493dc){for(var _0x175e14=0x0,_0x4a8997=events[_0x4633('0x7')];_0x175e14<_0x4a8997;_0x175e14++){var _0x56891d=events[_0x175e14];var _0x21af74=createListener(_0x4633('0x8')+_0x56891d,_0x6493dc);ChatQueueEvents['on'](_0x56891d,_0x21af74);}};
\ No newline at end of file
+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
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index c033c15..c770cf0 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 _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x46ae97,_0x1457ea){var _0x4d0c37=function(_0x387581){while(--_0x387581){_0x46ae97['push'](_0x46ae97['shift']());}};_0x4d0c37(++_0x1457ea);}(_0x55ca,0x126));var _0xa55c=function(_0x1877e2,_0x2b76d4){_0x1877e2=_0x1877e2-0x0;var _0x44e96a=_0x55ca[_0x1877e2];return _0x44e96a;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
+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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 0e2cc20..3a95ea4 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 _0x3870=['STRING','DATE','moment','sequelize'];(function(_0x73d817,_0x54eed1){var _0x178cf8=function(_0x3cdf24){while(--_0x3cdf24){_0x73d817['push'](_0x73d817['shift']());}};_0x178cf8(++_0x54eed1);}(_0x3870,0x19e));var _0x0387=function(_0x42a6b9,_0x164483){_0x42a6b9=_0x42a6b9-0x0;var _0x420139=_0x3870[_0x42a6b9];return _0x420139;};'use strict';var moment=require(_0x0387('0x0'));var Sequelize=require(_0x0387('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0387('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0387('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0387('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0387('0x2')]}};
\ No newline at end of file
+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
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index b5cfddc..c18cfdd 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 _0xdd68=['name','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','error','stack'];(function(_0x1f8223,_0x2e2b29){var _0x4aa535=function(_0x338b17){while(--_0x338b17){_0x1f8223['push'](_0x1f8223['shift']());}};_0x4aa535(++_0x2e2b29);}(_0xdd68,0x196));var _0x8dd6=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xdd68[_0x39780c];return _0x53c19b;};'use strict';var emlformat=require(_0x8dd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dd6('0x1'));var jsonpatch=require(_0x8dd6('0x2'));var rp=require(_0x8dd6('0x3'));var moment=require(_0x8dd6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8dd6('0x5'));var util=require(_0x8dd6('0x6'));var path=require('path');var sox=require(_0x8dd6('0x7'));var csv=require(_0x8dd6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8dd6('0x9'));var _=require('lodash');var squel=require(_0x8dd6('0xa'));var crypto=require('crypto');var jsforce=require(_0x8dd6('0xb'));var deskjs=require(_0x8dd6('0xc'));var toCsv=require(_0x8dd6('0x8'));var querystring=require('querystring');var Papa=require(_0x8dd6('0xd'));var Redis=require(_0x8dd6('0xe'));var authService=require(_0x8dd6('0xf'));var qs=require(_0x8dd6('0x10'));var as=require(_0x8dd6('0x11'));var hardwareService=require(_0x8dd6('0x12'));var logger=require(_0x8dd6('0x13'))(_0x8dd6('0x14'));var utils=require(_0x8dd6('0x15'));var config=require(_0x8dd6('0x16'));var licenseUtil=require(_0x8dd6('0x17'));var db=require(_0x8dd6('0x18'))['db'];function respondWithStatusCode(_0x3e7182,_0x59456c){_0x59456c=_0x59456c||0xcc;return function(_0x3bf24f){if(_0x3bf24f){return _0x3e7182[_0x8dd6('0x19')](_0x59456c);}return _0x3e7182[_0x8dd6('0x1a')](_0x59456c)['end']();};}function respondWithResult(_0x5957be,_0x41b21f){_0x41b21f=_0x41b21f||0xc8;return function(_0x4c8ff4){if(_0x4c8ff4){return _0x5957be['status'](_0x41b21f)[_0x8dd6('0x1b')](_0x4c8ff4);}};}function respondWithFilteredResult(_0xd906ee,_0x2e9882){return function(_0x469c11){if(_0x469c11){var _0x124e1d=typeof _0x2e9882[_0x8dd6('0x1c')]===_0x8dd6('0x1d')&&typeof _0x2e9882[_0x8dd6('0x1e')]===_0x8dd6('0x1d');var _0x5496cc=_0x469c11[_0x8dd6('0x1f')];var _0x1f910a=_0x124e1d?0x0:_0x2e9882[_0x8dd6('0x1c')];var _0x168a30=_0x124e1d?_0x469c11[_0x8dd6('0x1f')]:_0x2e9882[_0x8dd6('0x1c')]+_0x2e9882[_0x8dd6('0x1e')];var _0x40f9eb;if(_0x168a30>=_0x5496cc){_0x168a30=_0x5496cc;_0x40f9eb=0xc8;}else{_0x40f9eb=0xce;}_0xd906ee['status'](_0x40f9eb);return _0xd906ee[_0x8dd6('0x20')](_0x8dd6('0x21'),_0x1f910a+'-'+_0x168a30+'/'+_0x5496cc)['json'](_0x469c11);}return null;};}function patchUpdates(_0x40d5a5){return function(_0x107bdd){try{jsonpatch[_0x8dd6('0x22')](_0x107bdd,_0x40d5a5,!![]);}catch(_0x2c67e8){return BPromise['reject'](_0x2c67e8);}return _0x107bdd['save']();};}function saveUpdates(_0x488b47,_0x138216){return function(_0xe6b099){if(_0xe6b099){return _0xe6b099['update'](_0x488b47)[_0x8dd6('0x23')](function(_0x31b588){return _0x31b588;});}return null;};}function removeEntity(_0x29d4c8,_0x1485d4){return function(_0x3a4c9f){if(_0x3a4c9f){return _0x3a4c9f['destroy']()[_0x8dd6('0x23')](function(){_0x29d4c8[_0x8dd6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50f513,_0x1784a9){return function(_0xeeda3){if(!_0xeeda3){_0x50f513['sendStatus'](0x194);}return _0xeeda3;};}function handleError(_0x2d3205,_0x3e05fa){_0x3e05fa=_0x3e05fa||0x1f4;return function(_0x14cce1){logger[_0x8dd6('0x24')](_0x14cce1[_0x8dd6('0x25')]);if(_0x14cce1['name']){delete _0x14cce1[_0x8dd6('0x26')];}_0x2d3205[_0x8dd6('0x1a')](_0x3e05fa)['send'](_0x14cce1);};}exports['index']=function(_0x25eba7,_0x3f4975){var _0x4328c4={},_0x44c282={},_0x2bbe93={'count':0x0,'rows':[]};var _0x3da00d=_[_0x8dd6('0x27')](db[_0x8dd6('0x28')][_0x8dd6('0x29')],function(_0x35c9ae){return{'name':_0x35c9ae[_0x8dd6('0x2a')],'type':_0x35c9ae[_0x8dd6('0x2b')][_0x8dd6('0x2c')]};});_0x44c282[_0x8dd6('0x2d')]=_[_0x8dd6('0x27')](_0x3da00d,_0x8dd6('0x26'));_0x44c282[_0x8dd6('0x2e')]=_[_0x8dd6('0x2f')](_0x25eba7[_0x8dd6('0x2e')]);_0x44c282[_0x8dd6('0x30')]=_[_0x8dd6('0x31')](_0x44c282[_0x8dd6('0x2d')],_0x44c282['query']);_0x4328c4[_0x8dd6('0x32')]=_[_0x8dd6('0x31')](_0x44c282[_0x8dd6('0x2d')],qs[_0x8dd6('0x33')](_0x25eba7['query'][_0x8dd6('0x33')]));_0x4328c4['attributes']=_0x4328c4['attributes'][_0x8dd6('0x34')]?_0x4328c4[_0x8dd6('0x32')]:_0x44c282['model'];if(!_0x25eba7[_0x8dd6('0x2e')][_0x8dd6('0x35')](_0x8dd6('0x36'))){_0x4328c4[_0x8dd6('0x1e')]=qs[_0x8dd6('0x1e')](_0x25eba7['query'][_0x8dd6('0x1e')]);_0x4328c4[_0x8dd6('0x1c')]=qs[_0x8dd6('0x1c')](_0x25eba7[_0x8dd6('0x2e')][_0x8dd6('0x1c')]);}_0x4328c4[_0x8dd6('0x37')]=qs[_0x8dd6('0x38')](_0x25eba7['query'][_0x8dd6('0x38')]);_0x4328c4[_0x8dd6('0x39')]=qs[_0x8dd6('0x30')](_[_0x8dd6('0x3a')](_0x25eba7[_0x8dd6('0x2e')],_0x44c282[_0x8dd6('0x30')]),_0x3da00d);if(_0x25eba7['query'][_0x8dd6('0x3b')]){_0x4328c4[_0x8dd6('0x39')]=_[_0x8dd6('0x3c')](_0x4328c4[_0x8dd6('0x39')],{'$or':_[_0x8dd6('0x27')](_0x3da00d,function(_0x1bf125){if(_0x1bf125[_0x8dd6('0x2b')]!=='VIRTUAL'){var _0x1b3f5d={};_0x1b3f5d[_0x1bf125[_0x8dd6('0x26')]]={'$like':'%'+_0x25eba7[_0x8dd6('0x2e')]['filter']+'%'};return _0x1b3f5d;}})});}_0x4328c4=_[_0x8dd6('0x3c')]({},_0x4328c4,_0x25eba7['options']);var _0x83ec4b={'where':_0x4328c4[_0x8dd6('0x39')]};return db[_0x8dd6('0x28')][_0x8dd6('0x1f')](_0x83ec4b)['then'](function(_0x1fea6d){_0x2bbe93[_0x8dd6('0x1f')]=_0x1fea6d;if(_0x25eba7[_0x8dd6('0x2e')][_0x8dd6('0x3d')]){_0x4328c4[_0x8dd6('0x3e')]=[{'all':!![]}];}return db[_0x8dd6('0x28')][_0x8dd6('0x3f')](_0x4328c4);})[_0x8dd6('0x23')](function(_0x1e1830){_0x2bbe93['rows']=_0x1e1830;return _0x2bbe93;})[_0x8dd6('0x23')](respondWithFilteredResult(_0x3f4975,_0x4328c4))[_0x8dd6('0x40')](handleError(_0x3f4975,null));};exports[_0x8dd6('0x41')]=function(_0x4309a6,_0x22d3b8){var _0x45577e={'raw':!![],'where':{'id':_0x4309a6[_0x8dd6('0x42')]['id']}},_0x31f1d3={};_0x31f1d3[_0x8dd6('0x2d')]=_[_0x8dd6('0x2f')](db['ChatQueueReport'][_0x8dd6('0x29')]);_0x31f1d3['query']=_[_0x8dd6('0x2f')](_0x4309a6[_0x8dd6('0x2e')]);_0x31f1d3['filters']=_[_0x8dd6('0x31')](_0x31f1d3[_0x8dd6('0x2d')],_0x31f1d3[_0x8dd6('0x2e')]);_0x45577e[_0x8dd6('0x32')]=_[_0x8dd6('0x31')](_0x31f1d3[_0x8dd6('0x2d')],qs['fields'](_0x4309a6[_0x8dd6('0x2e')]['fields']));_0x45577e[_0x8dd6('0x32')]=_0x45577e[_0x8dd6('0x32')]['length']?_0x45577e[_0x8dd6('0x32')]:_0x31f1d3['model'];if(_0x4309a6['query'][_0x8dd6('0x3d')]){_0x45577e['include']=[{'all':!![]}];}_0x45577e=_[_0x8dd6('0x3c')]({},_0x45577e,_0x4309a6[_0x8dd6('0x43')]);return db[_0x8dd6('0x28')][_0x8dd6('0x44')](_0x45577e)['then'](handleEntityNotFound(_0x22d3b8,null))[_0x8dd6('0x23')](respondWithResult(_0x22d3b8,null))[_0x8dd6('0x40')](handleError(_0x22d3b8,null));};exports[_0x8dd6('0x45')]=function(_0x22a0b1,_0x701549){return db[_0x8dd6('0x28')][_0x8dd6('0x45')](_0x22a0b1[_0x8dd6('0x46')],{})['then'](respondWithResult(_0x701549,0xc9))[_0x8dd6('0x40')](handleError(_0x701549,null));};exports[_0x8dd6('0x47')]=function(_0x212929,_0x4a1550){if(_0x212929['body']['id']){delete _0x212929[_0x8dd6('0x46')]['id'];}return db[_0x8dd6('0x28')][_0x8dd6('0x44')]({'where':{'id':_0x212929['params']['id']}})[_0x8dd6('0x23')](handleEntityNotFound(_0x4a1550,null))[_0x8dd6('0x23')](saveUpdates(_0x212929['body'],null))['then'](respondWithResult(_0x4a1550,null))['catch'](handleError(_0x4a1550,null));};exports[_0x8dd6('0x48')]=function(_0x513178,_0x1a919a){return db['ChatQueueReport'][_0x8dd6('0x44')]({'where':{'id':_0x513178[_0x8dd6('0x42')]['id']}})[_0x8dd6('0x23')](handleEntityNotFound(_0x1a919a,null))['then'](removeEntity(_0x1a919a,null))[_0x8dd6('0x40')](handleError(_0x1a919a,null));};exports[_0x8dd6('0x49')]=function(_0x4699be,_0x75dfcc){return db[_0x8dd6('0x28')][_0x8dd6('0x49')]()[_0x8dd6('0x23')](respondWithResult(_0x75dfcc,null))[_0x8dd6('0x40')](handleError(_0x75dfcc,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 2f1e0b6..1c94378 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x26bae4,_0x59cb48){var _0xa38b80=function(_0x401077){while(--_0x401077){_0x26bae4['push'](_0x26bae4['shift']());}};_0xa38b80(++_0x59cb48);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 2967576..9068442 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 _0x37e9=['client','http','request','then','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','update','attributes','limit','info','UpdateChatQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x37e9,0x1f4));var _0x937e=function(_0x3db6cb,_0x558f96){_0x3db6cb=_0x3db6cb-0x0;var _0xffd156=_0x37e9[_0x3db6cb];return _0xffd156;};'use strict';var _=require('lodash');var util=require(_0x937e('0x0'));var moment=require(_0x937e('0x1'));var BPromise=require(_0x937e('0x2'));var rs=require(_0x937e('0x3'));var fs=require('fs');var Redis=require(_0x937e('0x4'));var db=require(_0x937e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x937e('0x6'))(_0x937e('0x7'));var config=require(_0x937e('0x8'));var jayson=require(_0x937e('0x9'));var client=jayson[_0x937e('0xa')][_0x937e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a648d,_0x3bc4c4,_0x214b0d){return new BPromise(function(_0x327f70,_0x54a357){return client[_0x937e('0xc')](_0x5a648d,_0x214b0d)[_0x937e('0xd')](function(_0x109aa3){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x3bc4c4,_0x937e('0xe'));logger['debug'](_0x937e('0xf'),_0x3bc4c4,_0x937e('0xe'),JSON[_0x937e('0x10')](_0x109aa3));if(_0x109aa3['error']){if(_0x109aa3[_0x937e('0x11')][_0x937e('0x12')]===0x1f4){logger['error'](_0x937e('0x13'),_0x3bc4c4,_0x109aa3[_0x937e('0x11')][_0x937e('0x14')]);return _0x54a357(_0x109aa3[_0x937e('0x11')][_0x937e('0x14')]);}logger[_0x937e('0x11')](_0x937e('0x13'),_0x3bc4c4,_0x109aa3[_0x937e('0x11')]['message']);return _0x327f70(_0x109aa3[_0x937e('0x11')][_0x937e('0x14')]);}else{logger['info'](_0x937e('0x13'),_0x3bc4c4,_0x937e('0xe'));_0x327f70(_0x109aa3[_0x937e('0x15')][_0x937e('0x14')]);}})[_0x937e('0x16')](function(_0x3b2647){logger[_0x937e('0x11')](_0x937e('0x13'),_0x3bc4c4,_0x3b2647);_0x54a357(_0x3b2647);});});}exports[_0x937e('0x17')]=function(_0xe76e5b){var _0x1a059f=this;return new Promise(function(_0x4ae425,_0x4da5b6){return db[_0x937e('0x18')][_0x937e('0x19')](_0xe76e5b[_0x937e('0x1a')],{'raw':_0xe76e5b[_0x937e('0x1b')]?_0xe76e5b[_0x937e('0x1b')][_0x937e('0x1c')]===undefined?!![]:![]:!![]})[_0x937e('0xd')](function(_0xb3fdfe){logger['info'](_0x937e('0x17'),_0xe76e5b);logger['debug'](_0x937e('0x17'),_0xe76e5b,JSON[_0x937e('0x10')](_0xb3fdfe));_0x4ae425(_0xb3fdfe);})[_0x937e('0x16')](function(_0x35d7ef){logger[_0x937e('0x11')](_0x937e('0x17'),_0x35d7ef[_0x937e('0x14')],_0xe76e5b);_0x4da5b6(_0x1a059f['error'](0x1f4,_0x35d7ef[_0x937e('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2e5a16){var _0x2c7e2c=this;return new Promise(function(_0x3ac0fb,_0x578b72){return db[_0x937e('0x18')][_0x937e('0x1d')](_0x2e5a16[_0x937e('0x1a')],{'raw':_0x2e5a16[_0x937e('0x1b')]?_0x2e5a16[_0x937e('0x1b')][_0x937e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e5a16[_0x937e('0x1b')]?_0x2e5a16[_0x937e('0x1b')]['where']||null:null,'attributes':_0x2e5a16['options']?_0x2e5a16[_0x937e('0x1b')][_0x937e('0x1e')]||null:null,'limit':_0x2e5a16[_0x937e('0x1b')]?_0x2e5a16[_0x937e('0x1b')][_0x937e('0x1f')]||null:null})['then'](function(_0x511fe4){logger[_0x937e('0x20')](_0x937e('0x21'),_0x2e5a16);logger['debug'](_0x937e('0x21'),_0x2e5a16,JSON['stringify'](_0x511fe4));_0x3ac0fb(_0x511fe4);})[_0x937e('0x16')](function(_0x2ee7c3){logger[_0x937e('0x11')]('UpdateChatQueueReport',_0x2ee7c3['message'],_0x2e5a16);_0x578b72(_0x2c7e2c[_0x937e('0x11')](0x1f4,_0x2ee7c3['message']));});});};
\ No newline at end of file
+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
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 7e867fc..2ab7e65 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 _0xedfb=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','isAuthenticated','describe','show','post','create','put','/:id'];(function(_0x18a5a0,_0x55f44a){var _0x4854e9=function(_0x5ec295){while(--_0x5ec295){_0x18a5a0['push'](_0x18a5a0['shift']());}};_0x4854e9(++_0x55f44a);}(_0xedfb,0x192));var _0xbedf=function(_0x3079b9,_0x58d2f4){_0x3079b9=_0x3079b9-0x0;var _0x105101=_0xedfb[_0x3079b9];return _0x105101;};'use strict';var multer=require(_0xbedf('0x0'));var util=require(_0xbedf('0x1'));var path=require(_0xbedf('0x2'));var timeout=require(_0xbedf('0x3'));var express=require(_0xbedf('0x4'));var router=express['Router']();var fs_extra=require(_0xbedf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbedf('0x6'));var config=require(_0xbedf('0x7'));var controller=require(_0xbedf('0x8'));router[_0xbedf('0x9')]('/',auth['isAuthenticated'](),controller[_0xbedf('0xa')]);router[_0xbedf('0x9')]('/describe',auth[_0xbedf('0xb')](),controller[_0xbedf('0xc')]);router['get']('/:id',auth[_0xbedf('0xb')](),controller[_0xbedf('0xd')]);router[_0xbedf('0xe')]('/',auth[_0xbedf('0xb')](),controller[_0xbedf('0xf')]);router[_0xbedf('0x10')](_0xbedf('0x11'),auth[_0xbedf('0xb')](),controller['update']);router[_0xbedf('0x12')](_0xbedf('0x11'),auth[_0xbedf('0xb')](),controller[_0xbedf('0x13')]);module[_0xbedf('0x14')]=router;
\ No newline at end of file
+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
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 11cd549..4041d7e 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3cdfeb,_0x1ff1ad){var _0x23b4e6=function(_0x1c2581){while(--_0x1c2581){_0x3cdfeb['push'](_0x3cdfeb['shift']());}};_0x23b4e6(++_0x1ff1ad);}(_0xf4eb,0xec));var _0xbf4e=function(_0x445068,_0x250944){_0x445068=_0x445068-0x0;var _0x234ca9=_0xf4eb[_0x445068];return _0x234ca9;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+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
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 7ff0412..1b0aa9f 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 _0x6a49=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','json','undefined','limit','count','offset','status','set','apply','reject','save','update','then','destroy','error','stack','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x44e4e1,_0x5637b2){var _0x300cd2=function(_0x189eeb){while(--_0x189eeb){_0x44e4e1['push'](_0x44e4e1['shift']());}};_0x300cd2(++_0x5637b2);}(_0x6a49,0x176));var _0x96a4=function(_0x4fcd39,_0x13594a){_0x4fcd39=_0x4fcd39-0x0;var _0x151cf0=_0x6a49[_0x4fcd39];return _0x151cf0;};'use strict';var emlformat=require(_0x96a4('0x0'));var rimraf=require(_0x96a4('0x1'));var zipdir=require(_0x96a4('0x2'));var jsonpatch=require(_0x96a4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x96a4('0x4'));var Mustache=require('mustache');var util=require(_0x96a4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x96a4('0x6'));var ejs=require(_0x96a4('0x7'));var fs=require('fs');var fs_extra=require(_0x96a4('0x8'));var _=require(_0x96a4('0x9'));var squel=require(_0x96a4('0xa'));var crypto=require(_0x96a4('0xb'));var jsforce=require(_0x96a4('0xc'));var deskjs=require(_0x96a4('0xd'));var toCsv=require(_0x96a4('0x6'));var querystring=require(_0x96a4('0xe'));var Papa=require(_0x96a4('0xf'));var Redis=require(_0x96a4('0x10'));var authService=require(_0x96a4('0x11'));var qs=require(_0x96a4('0x12'));var as=require(_0x96a4('0x13'));var hardwareService=require(_0x96a4('0x14'));var logger=require(_0x96a4('0x15'))(_0x96a4('0x16'));var utils=require(_0x96a4('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f1356,_0x3ec4d3){_0x3ec4d3=_0x3ec4d3||0xcc;return function(_0x52782e){if(_0x52782e){return _0x4f1356[_0x96a4('0x18')](_0x3ec4d3);}return _0x4f1356['status'](_0x3ec4d3)[_0x96a4('0x19')]();};}function respondWithResult(_0x5178ce,_0x396878){_0x396878=_0x396878||0xc8;return function(_0x99a567){if(_0x99a567){return _0x5178ce['status'](_0x396878)[_0x96a4('0x1a')](_0x99a567);}};}function respondWithFilteredResult(_0xa8e3de,_0x382486){return function(_0x1e58bc){if(_0x1e58bc){var _0x59b65a=typeof _0x382486['offset']===_0x96a4('0x1b')&&typeof _0x382486[_0x96a4('0x1c')]===_0x96a4('0x1b');var _0x13bddc=_0x1e58bc['count'];var _0x28237a=_0x59b65a?0x0:_0x382486['offset'];var _0x296752=_0x59b65a?_0x1e58bc[_0x96a4('0x1d')]:_0x382486[_0x96a4('0x1e')]+_0x382486[_0x96a4('0x1c')];var _0xb55b8b;if(_0x296752>=_0x13bddc){_0x296752=_0x13bddc;_0xb55b8b=0xc8;}else{_0xb55b8b=0xce;}_0xa8e3de[_0x96a4('0x1f')](_0xb55b8b);return _0xa8e3de[_0x96a4('0x20')]('Content-Range',_0x28237a+'-'+_0x296752+'/'+_0x13bddc)[_0x96a4('0x1a')](_0x1e58bc);}return null;};}function patchUpdates(_0x3b875e){return function(_0x5597e0){try{jsonpatch[_0x96a4('0x21')](_0x5597e0,_0x3b875e,!![]);}catch(_0x138936){return BPromise[_0x96a4('0x22')](_0x138936);}return _0x5597e0[_0x96a4('0x23')]();};}function saveUpdates(_0x5d1941,_0x5e989c){return function(_0x34efbc){if(_0x34efbc){return _0x34efbc[_0x96a4('0x24')](_0x5d1941)[_0x96a4('0x25')](function(_0x3f026b){return _0x3f026b;});}return null;};}function removeEntity(_0xba7c2f,_0x5a5bbd){return function(_0x5def61){if(_0x5def61){return _0x5def61[_0x96a4('0x26')]()[_0x96a4('0x25')](function(){_0xba7c2f[_0x96a4('0x1f')](0xcc)[_0x96a4('0x19')]();});}};}function handleEntityNotFound(_0x160cd3,_0x3a3990){return function(_0x4bb7d3){if(!_0x4bb7d3){_0x160cd3[_0x96a4('0x18')](0x194);}return _0x4bb7d3;};}function handleError(_0x38ffa4,_0x52e326){_0x52e326=_0x52e326||0x1f4;return function(_0x446197){logger[_0x96a4('0x27')](_0x446197[_0x96a4('0x28')]);if(_0x446197['name']){delete _0x446197['name'];}_0x38ffa4[_0x96a4('0x1f')](_0x52e326)[_0x96a4('0x29')](_0x446197);};}exports[_0x96a4('0x2a')]=function(_0x1a539f,_0x1fba24){var _0x4a797c={},_0x4aad83={},_0x50d2a2={'count':0x0,'rows':[]};var _0x58b022=_[_0x96a4('0x2b')](db[_0x96a4('0x2c')][_0x96a4('0x2d')],function(_0x12fa4c){return{'name':_0x12fa4c[_0x96a4('0x2e')],'type':_0x12fa4c['type'][_0x96a4('0x2f')]};});_0x4aad83[_0x96a4('0x30')]=_['map'](_0x58b022,_0x96a4('0x31'));_0x4aad83[_0x96a4('0x32')]=_[_0x96a4('0x33')](_0x1a539f[_0x96a4('0x32')]);_0x4aad83[_0x96a4('0x34')]=_[_0x96a4('0x35')](_0x4aad83[_0x96a4('0x30')],_0x4aad83[_0x96a4('0x32')]);_0x4a797c[_0x96a4('0x36')]=_[_0x96a4('0x35')](_0x4aad83[_0x96a4('0x30')],qs[_0x96a4('0x37')](_0x1a539f[_0x96a4('0x32')][_0x96a4('0x37')]));_0x4a797c[_0x96a4('0x36')]=_0x4a797c[_0x96a4('0x36')][_0x96a4('0x38')]?_0x4a797c['attributes']:_0x4aad83[_0x96a4('0x30')];if(!_0x1a539f[_0x96a4('0x32')]['hasOwnProperty'](_0x96a4('0x39'))){_0x4a797c[_0x96a4('0x1c')]=qs['limit'](_0x1a539f['query'][_0x96a4('0x1c')]);_0x4a797c['offset']=qs[_0x96a4('0x1e')](_0x1a539f['query']['offset']);}_0x4a797c[_0x96a4('0x3a')]=qs['sort'](_0x1a539f[_0x96a4('0x32')][_0x96a4('0x3b')]);_0x4a797c['where']=qs[_0x96a4('0x34')](_[_0x96a4('0x3c')](_0x1a539f['query'],_0x4aad83[_0x96a4('0x34')]),_0x58b022);if(_0x1a539f[_0x96a4('0x32')][_0x96a4('0x3d')]){_0x4a797c[_0x96a4('0x3e')]=_['merge'](_0x4a797c[_0x96a4('0x3e')],{'$or':_[_0x96a4('0x2b')](_0x58b022,function(_0x5aa2fa){if(_0x5aa2fa[_0x96a4('0x3f')]!==_0x96a4('0x40')){var _0x2fe685={};_0x2fe685[_0x5aa2fa[_0x96a4('0x31')]]={'$like':'%'+_0x1a539f['query'][_0x96a4('0x3d')]+'%'};return _0x2fe685;}})});}_0x4a797c=_[_0x96a4('0x41')]({},_0x4a797c,_0x1a539f[_0x96a4('0x42')]);var _0x273dcb={'where':_0x4a797c['where']};return db[_0x96a4('0x2c')][_0x96a4('0x1d')](_0x273dcb)[_0x96a4('0x25')](function(_0x49737f){_0x50d2a2[_0x96a4('0x1d')]=_0x49737f;if(_0x1a539f['query'][_0x96a4('0x43')]){_0x4a797c[_0x96a4('0x44')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x96a4('0x45')](_0x4a797c);})['then'](function(_0x3858a8){_0x50d2a2['rows']=_0x3858a8;return _0x50d2a2;})[_0x96a4('0x25')](respondWithFilteredResult(_0x1fba24,_0x4a797c))[_0x96a4('0x46')](handleError(_0x1fba24,null));};exports[_0x96a4('0x47')]=function(_0x334149,_0x1a2658){var _0x317a97={'raw':!![],'where':{'id':_0x334149[_0x96a4('0x48')]['id']}},_0x47e8a0={};_0x47e8a0[_0x96a4('0x30')]=_[_0x96a4('0x33')](db[_0x96a4('0x2c')][_0x96a4('0x2d')]);_0x47e8a0['query']=_['keys'](_0x334149[_0x96a4('0x32')]);_0x47e8a0[_0x96a4('0x34')]=_[_0x96a4('0x35')](_0x47e8a0['model'],_0x47e8a0['query']);_0x317a97[_0x96a4('0x36')]=_[_0x96a4('0x35')](_0x47e8a0['model'],qs[_0x96a4('0x37')](_0x334149[_0x96a4('0x32')][_0x96a4('0x37')]));_0x317a97[_0x96a4('0x36')]=_0x317a97[_0x96a4('0x36')][_0x96a4('0x38')]?_0x317a97[_0x96a4('0x36')]:_0x47e8a0[_0x96a4('0x30')];if(_0x334149['query']['includeAll']){_0x317a97[_0x96a4('0x44')]=[{'all':!![]}];}_0x317a97=_['merge']({},_0x317a97,_0x334149[_0x96a4('0x42')]);return db['ChatTransferReport'][_0x96a4('0x49')](_0x317a97)[_0x96a4('0x25')](handleEntityNotFound(_0x1a2658,null))['then'](respondWithResult(_0x1a2658,null))[_0x96a4('0x46')](handleError(_0x1a2658,null));};exports[_0x96a4('0x4a')]=function(_0x52115f,_0x52b87c){return db['ChatTransferReport'][_0x96a4('0x4a')](_0x52115f['body'],{})['then'](respondWithResult(_0x52b87c,0xc9))[_0x96a4('0x46')](handleError(_0x52b87c,null));};exports[_0x96a4('0x24')]=function(_0x50985b,_0x41fb0b){if(_0x50985b[_0x96a4('0x4b')]['id']){delete _0x50985b['body']['id'];}return db[_0x96a4('0x2c')][_0x96a4('0x49')]({'where':{'id':_0x50985b[_0x96a4('0x48')]['id']}})[_0x96a4('0x25')](handleEntityNotFound(_0x41fb0b,null))[_0x96a4('0x25')](saveUpdates(_0x50985b[_0x96a4('0x4b')],null))[_0x96a4('0x25')](respondWithResult(_0x41fb0b,null))[_0x96a4('0x46')](handleError(_0x41fb0b,null));};exports['destroy']=function(_0x4ae79b,_0x1f4c72){return db[_0x96a4('0x2c')]['find']({'where':{'id':_0x4ae79b[_0x96a4('0x48')]['id']}})[_0x96a4('0x25')](handleEntityNotFound(_0x1f4c72,null))[_0x96a4('0x25')](removeEntity(_0x1f4c72,null))['catch'](handleError(_0x1f4c72,null));};exports[_0x96a4('0x4c')]=function(_0x316663,_0x5c79bd){return db[_0x96a4('0x2c')][_0x96a4('0x4c')]()[_0x96a4('0x25')](respondWithResult(_0x5c79bd,null))['catch'](handleError(_0x5c79bd,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 652ce15..daade68 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 _0xbcca=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xbcca,0x1cd));var _0xabcc=function(_0xb1fcde,_0x1a23ea){_0xb1fcde=_0xb1fcde-0x0;var _0x175df2=_0xbcca[_0xb1fcde];return _0x175df2;};'use strict';var _=require(_0xabcc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xabcc('0x1'));var moment=require(_0xabcc('0x2'));var BPromise=require(_0xabcc('0x3'));var rp=require(_0xabcc('0x4'));var fs=require('fs');var path=require(_0xabcc('0x5'));var rimraf=require('rimraf');var config=require(_0xabcc('0x6'));var attributes=require(_0xabcc('0x7'));module[_0xabcc('0x8')]=function(_0x35ffe2,_0x1e3593){return _0x35ffe2[_0xabcc('0x9')](_0xabcc('0xa'),attributes,{'tableName':_0xabcc('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 72222ad..c5650c7 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 _0x7efc=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18b027,_0x4d0486){var _0x19643f=function(_0x36753b){while(--_0x36753b){_0x18b027['push'](_0x18b027['shift']());}};_0x19643f(++_0x4d0486);}(_0x7efc,0x180));var _0xc7ef=function(_0x280c4b,_0xfe785d){_0x280c4b=_0x280c4b-0x0;var _0x2a5e90=_0x7efc[_0x280c4b];return _0x2a5e90;};'use strict';var _=require(_0xc7ef('0x0'));var util=require(_0xc7ef('0x1'));var moment=require(_0xc7ef('0x2'));var BPromise=require(_0xc7ef('0x3'));var rs=require(_0xc7ef('0x4'));var fs=require('fs');var Redis=require(_0xc7ef('0x5'));var db=require(_0xc7ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc7ef('0x7'));var config=require(_0xc7ef('0x8'));var jayson=require(_0xc7ef('0x9'));var client=jayson[_0xc7ef('0xa')][_0xc7ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36fb25,_0x278d32,_0x2729c2){return new BPromise(function(_0x4fc9bf,_0x2a7701){return client['request'](_0x36fb25,_0x2729c2)[_0xc7ef('0xc')](function(_0x3ba427){logger[_0xc7ef('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x278d32,_0xc7ef('0xe'));logger[_0xc7ef('0xf')](_0xc7ef('0x10'),_0x278d32,_0xc7ef('0xe'),JSON[_0xc7ef('0x11')](_0x3ba427));if(_0x3ba427[_0xc7ef('0x12')]){if(_0x3ba427[_0xc7ef('0x12')]['code']===0x1f4){logger['error'](_0xc7ef('0x13'),_0x278d32,_0x3ba427[_0xc7ef('0x12')][_0xc7ef('0x14')]);return _0x2a7701(_0x3ba427[_0xc7ef('0x12')][_0xc7ef('0x14')]);}logger[_0xc7ef('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x278d32,_0x3ba427['error'][_0xc7ef('0x14')]);return _0x4fc9bf(_0x3ba427['error'][_0xc7ef('0x14')]);}else{logger['info'](_0xc7ef('0x13'),_0x278d32,_0xc7ef('0xe'));_0x4fc9bf(_0x3ba427[_0xc7ef('0x15')][_0xc7ef('0x14')]);}})[_0xc7ef('0x16')](function(_0x5563a0){logger[_0xc7ef('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x278d32,_0x5563a0);_0x2a7701(_0x5563a0);});});}
\ No newline at end of file
+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
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 178d7e9..1a559d5 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 _0x8e2b=['index','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x502ed1,_0xd79589){var _0x3dd009=function(_0x41d675){while(--_0x41d675){_0x502ed1['push'](_0x502ed1['shift']());}};_0x3dd009(++_0xd79589);}(_0x8e2b,0x95));var _0xb8e2=function(_0x3e522f,_0x5c7a86){_0x3e522f=_0x3e522f-0x0;var _0x289067=_0x8e2b[_0x3e522f];return _0x289067;};'use strict';var multer=require(_0xb8e2('0x0'));var util=require('util');var path=require(_0xb8e2('0x1'));var timeout=require(_0xb8e2('0x2'));var express=require(_0xb8e2('0x3'));var router=express[_0xb8e2('0x4')]();var fs_extra=require(_0xb8e2('0x5'));var auth=require(_0xb8e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb8e2('0x7'));var controller=require(_0xb8e2('0x8'));router[_0xb8e2('0x9')]('/',auth[_0xb8e2('0xa')](),controller[_0xb8e2('0xb')]);router[_0xb8e2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb8e2('0xc')]);router['get'](_0xb8e2('0xd'),auth[_0xb8e2('0xa')](),controller[_0xb8e2('0xe')]);router[_0xb8e2('0xf')]('/',auth[_0xb8e2('0xa')](),controller[_0xb8e2('0x10')]);router['put'](_0xb8e2('0xd'),auth[_0xb8e2('0xa')](),controller[_0xb8e2('0x11')]);router[_0xb8e2('0x12')](_0xb8e2('0xd'),auth[_0xb8e2('0xa')](),controller[_0xb8e2('0x13')]);module['exports']=router;
\ No newline at end of file
+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
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index eedee10..678c402 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 _0x09b6=['website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','address','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','TEXT','stringify','name','text','email','getDataValue','onlineForm','parse','setDataValue','input','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x17a0a0,_0x1befaa){var _0x4da752=function(_0x429829){while(--_0x429829){_0x17a0a0['push'](_0x17a0a0['shift']());}};_0x4da752(++_0x1befaa);}(_0x09b6,0x121));var _0x609b=function(_0x539533,_0x59b89b){_0x539533=_0x539533-0x0;var _0x3942f3=_0x09b6[_0x539533];return _0x3942f3;};'use strict';var Sequelize=require(_0x609b('0x0'));var rs=require('randomstring');module[_0x609b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'unique':_0x609b('0x3')},'description':{'type':Sequelize[_0x609b('0x2')]},'mapKey':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize[_0x609b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':_0x609b('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':_0x609b('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':_0x609b('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x609b('0x8')](_0x609b('0x9'),_0x609b('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xc')},'header_offline':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xd')},'download_transcript':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x10')},'noteTitle':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x11')},'placeholderMessage':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x12')},'closingMessageButton':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x609b('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x609b('0x8')](_0x609b('0x14'),_0x609b('0x15')),'defaultValue':_0x609b('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x609b('0x16')],'defaultValue':function(){return JSON[_0x609b('0x17')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x609b('0x18'),'type':_0x609b('0x19'),'required':!![]},'props':{'title':_0x609b('0x18'),'helpText':''}},{'type':'input','props':{'title':_0x609b('0x1a'),'helpText':''},'config':{'required':!![],'placeholder':_0x609b('0x1a'),'type':_0x609b('0x1a')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x609b('0x1b')](_0x609b('0x1c'))?JSON[_0x609b('0x1d')](this[_0x609b('0x1b')](_0x609b('0x1c'))):{};},'set':function(_0x23c8c6){return this[_0x609b('0x1e')]('onlineForm',JSON[_0x609b('0x17')](_0x23c8c6));}},'offlineForm':{'type':Sequelize[_0x609b('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x609b('0x1f'),'props':{'title':_0x609b('0x1a'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x609b('0x1a')},'variable':null},{'type':'textarea','config':{'placeholder':_0x609b('0x20')},'props':{'title':_0x609b('0x20'),'helpText':_0x609b('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x609b('0x1b')]('offlineForm')?JSON['parse'](this[_0x609b('0x1b')](_0x609b('0x22'))):{};},'set':function(_0xc5ee97){return this[_0x609b('0x1e')]('offlineForm',JSON[_0x609b('0x17')](_0xc5ee97));}},'token':{'type':Sequelize[_0x609b('0x2')],'defaultValue':function(){return rs[_0x609b('0x23')]();}},'autoclose':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x609b('0x2')]},'forwardOffline':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x609b('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x609b('0x26')},'skipUnmanaged':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x13')},'sendUnmanaged':{'type':Sequelize[_0x609b('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x609b('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x609b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x609b('0x16')],'defaultValue':function(){return _0x609b('0x27');}},'notificationSound':{'type':Sequelize[_0x609b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x28')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x29')},'verticalAlignment':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x2a')},'defaultTitle':{'type':Sequelize[_0x609b('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x609b('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x609b('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x609b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x609b('0x2')],'defaultValue':_0x609b('0x2c')},'systemAvatar':{'type':Sequelize[_0x609b('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x609b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x272290){if(!_0x272290)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x609b('0x1e')](_0x609b('0x2e'),_0x272290);}},'vidaooEscalation':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x609b('0x2')]},'vidaooTopic':{'type':Sequelize[_0x609b('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x609b('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x609b('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+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
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index bf8098c..5f3c58b 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 _0x64cd=['length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','params','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','order','findAll','removeDispositions','ids','CannedAnswer','getAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','firstName','lastName','x-real-port','referer','version','format','%s\x20%s','browser','unknown','device','%s\x20%s\x20%s','type','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','update','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','contact','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','EventManager','notify','offline','files','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','email','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','subjectOffline','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','OFFLINE','No\x20timezone','Interval','getProactiveActions','getLicense','virtual','custom','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remoteAddress','alignment','verticalAlignment','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','offlineForm','onlineForm','fromKey','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatWebsite.socket','register','jayson/promise','client','http','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','apply','then','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64cd,0xe2));var _0xd64c=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x64cd[_0x5519a9];return _0x32f2cc;};'use strict';var emlformat=require(_0xd64c('0x0'));var rimraf=require(_0xd64c('0x1'));var zipdir=require(_0xd64c('0x2'));var jsonpatch=require(_0xd64c('0x3'));var rp=require(_0xd64c('0x4'));var moment=require(_0xd64c('0x5'));var BPromise=require(_0xd64c('0x6'));var Mustache=require('mustache');var util=require(_0xd64c('0x7'));var path=require(_0xd64c('0x8'));var sox=require(_0xd64c('0x9'));var csv=require(_0xd64c('0xa'));var ejs=require(_0xd64c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd64c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd64c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd64c('0xe'));var qs=require(_0xd64c('0xf'));var as=require(_0xd64c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd64c('0x11'));var utils=require('../../config/utils');var config=require(_0xd64c('0x12'));var licenseUtil=require(_0xd64c('0x13'));var db=require(_0xd64c('0x14'))['db'];config[_0xd64c('0x15')]=_[_0xd64c('0x16')](config[_0xd64c('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd64c('0x15')]));require(_0xd64c('0x17'))[_0xd64c('0x18')](socket);var jayson=require(_0xd64c('0x19'));var client=jayson[_0xd64c('0x1a')][_0xd64c('0x1b')]({'port':0x232c});var client9002=jayson[_0xd64c('0x1a')][_0xd64c('0x1b')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xd64c('0x1a')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3af324,_0x70b536,_0x3b9d15,_0x4006e9){return new BPromise(function(_0x4946bb,_0x1392f5){var _0x296f41=_0x4006e9||client;return _0x296f41['request'](_0x3af324,_0x3b9d15)['then'](function(_0x324750){logger[_0xd64c('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x70b536,_0xd64c('0x1d'));logger['debug'](_0xd64c('0x1e'),_0x70b536,_0xd64c('0x1d'),JSON[_0xd64c('0x1f')](_0x324750));if(_0x324750['error']){if(_0x324750[_0xd64c('0x20')][_0xd64c('0x21')]===0x1f4){logger[_0xd64c('0x20')](_0xd64c('0x22'),_0x70b536,_0x324750[_0xd64c('0x20')]['message']);return _0x1392f5(_0x324750[_0xd64c('0x20')]['message']);}logger[_0xd64c('0x20')](_0xd64c('0x22'),_0x70b536,_0x324750[_0xd64c('0x20')][_0xd64c('0x23')]);return _0x4946bb(_0x324750[_0xd64c('0x20')][_0xd64c('0x23')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x70b536,_0xd64c('0x1d'));_0x4946bb(_0x324750[_0xd64c('0x24')][_0xd64c('0x23')]);}})[_0xd64c('0x25')](function(_0xe4bde1){logger[_0xd64c('0x20')](_0xd64c('0x22'),_0x70b536,_0xe4bde1);_0x1392f5(_0xe4bde1);});});}function respondWithStatusCode(_0x4b8fd5,_0x5b9e47){_0x5b9e47=_0x5b9e47||0xcc;return function(_0x278eb2){if(_0x278eb2){return _0x4b8fd5[_0xd64c('0x26')](_0x5b9e47);}return _0x4b8fd5[_0xd64c('0x27')](_0x5b9e47)['end']();};}function respondWithResult(_0xd17fc1,_0x4b523f){_0x4b523f=_0x4b523f||0xc8;return function(_0x43de1f){if(_0x43de1f){return _0xd17fc1['status'](_0x4b523f)[_0xd64c('0x28')](_0x43de1f);}};}function respondWithFilteredResult(_0x4ea696,_0x2119e1){return function(_0x8e5d4a){if(_0x8e5d4a){var _0x27ef7a=typeof _0x2119e1[_0xd64c('0x29')]===_0xd64c('0x2a')&&typeof _0x2119e1[_0xd64c('0x2b')]===_0xd64c('0x2a');var _0x17ed38=_0x8e5d4a[_0xd64c('0x2c')];var _0x1379fa=_0x27ef7a?0x0:_0x2119e1[_0xd64c('0x29')];var _0x3b3f06=_0x27ef7a?_0x8e5d4a['count']:_0x2119e1['offset']+_0x2119e1['limit'];var _0x3a4b10;if(_0x3b3f06>=_0x17ed38){_0x3b3f06=_0x17ed38;_0x3a4b10=0xc8;}else{_0x3a4b10=0xce;}_0x4ea696[_0xd64c('0x27')](_0x3a4b10);return _0x4ea696['set']('Content-Range',_0x1379fa+'-'+_0x3b3f06+'/'+_0x17ed38)['json'](_0x8e5d4a);}return null;};}function patchUpdates(_0x3221c7){return function(_0x212f93){try{jsonpatch[_0xd64c('0x2d')](_0x212f93,_0x3221c7,!![]);}catch(_0xbeaeae){return BPromise['reject'](_0xbeaeae);}return _0x212f93['save']();};}function saveUpdates(_0x39dabd,_0x22070e){return function(_0x872806){if(_0x872806){return _0x872806['update'](_0x39dabd)[_0xd64c('0x2e')](function(_0x2917c3){return _0x2917c3;});}return null;};}function removeEntity(_0x36eebe,_0x5c2b73){return function(_0x40a72a){if(_0x40a72a){return _0x40a72a['destroy']()[_0xd64c('0x2e')](function(){var _0x58b0f2=_0x40a72a[_0xd64c('0x2f')]({'plain':!![]});var _0x41d0a3=_0xd64c('0x30');return db[_0xd64c('0x31')][_0xd64c('0x32')]({'where':{'type':_0x41d0a3,'resourceId':_0x58b0f2['id']}})['then'](function(){return _0x40a72a;});})[_0xd64c('0x2e')](function(){_0x36eebe[_0xd64c('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa46e42,_0x1ec5a7){return function(_0xb4174d){if(!_0xb4174d){_0xa46e42[_0xd64c('0x26')](0x194);}return _0xb4174d;};}function handleError(_0x163932,_0x26600c){_0x26600c=_0x26600c||0x1f4;return function(_0x3be5eb){logger[_0xd64c('0x20')](_0x3be5eb[_0xd64c('0x33')]);if(_0x3be5eb[_0xd64c('0x34')]){delete _0x3be5eb[_0xd64c('0x34')];}_0x163932['status'](_0x26600c)[_0xd64c('0x35')](_0x3be5eb);};}exports[_0xd64c('0x36')]=function(_0x266b78,_0x5c1241){var _0x323fa6={'include':[{'model':db[_0xd64c('0x37')],'as':_0xd64c('0x38')}]},_0x1a1854={},_0x3f98fd={'count':0x0,'rows':[]};var _0x25b429=_[_0xd64c('0x39')](db[_0xd64c('0x3a')][_0xd64c('0x3b')],function(_0xbaa12d){return{'name':_0xbaa12d[_0xd64c('0x3c')],'type':_0xbaa12d['type'][_0xd64c('0x3d')]};});_0x1a1854[_0xd64c('0x3e')]=_[_0xd64c('0x39')](_0x25b429,_0xd64c('0x34'));_0x1a1854[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x266b78[_0xd64c('0x3f')]);_0x1a1854[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x1a1854[_0xd64c('0x3e')],_0x1a1854['query']);_0x323fa6[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x1a1854[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x266b78[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x323fa6['attributes']=_0x323fa6[_0xd64c('0x43')][_0xd64c('0x45')]?_0x323fa6[_0xd64c('0x43')]:_0x1a1854[_0xd64c('0x3e')];if(!_0x266b78[_0xd64c('0x3f')][_0xd64c('0x46')](_0xd64c('0x47'))){_0x323fa6[_0xd64c('0x2b')]=qs[_0xd64c('0x2b')](_0x266b78['query']['limit']);_0x323fa6['offset']=qs[_0xd64c('0x29')](_0x266b78[_0xd64c('0x3f')][_0xd64c('0x29')]);}_0x323fa6['order']=qs[_0xd64c('0x48')](_0x266b78[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x323fa6[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x266b78[_0xd64c('0x3f')],_0x1a1854['filters']),_0x25b429);if(_0x266b78[_0xd64c('0x3f')][_0xd64c('0x4b')]){_0x323fa6[_0xd64c('0x49')]=_['merge'](_0x323fa6[_0xd64c('0x49')],{'$or':_['map'](_0x25b429,function(_0x50ab26){if(_0x50ab26['type']!==_0xd64c('0x4c')){var _0x171a7b={};_0x171a7b[_0x50ab26[_0xd64c('0x34')]]={'$like':'%'+_0x266b78[_0xd64c('0x3f')]['filter']+'%'};return _0x171a7b;}})});}_0x323fa6=_['merge']({},_0x323fa6,_0x266b78[_0xd64c('0x4d')]);var _0x2afa24={'where':_0x323fa6[_0xd64c('0x49')]};return db[_0xd64c('0x3a')][_0xd64c('0x2c')](_0x2afa24)['then'](function(_0x5f1fe9){_0x3f98fd[_0xd64c('0x2c')]=_0x5f1fe9;if(_0x266b78[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x323fa6[_0xd64c('0x4f')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x323fa6);})[_0xd64c('0x2e')](function(_0xc08422){_0x3f98fd[_0xd64c('0x50')]=_0xc08422;return _0x3f98fd;})[_0xd64c('0x2e')](respondWithFilteredResult(_0x5c1241,_0x323fa6))['catch'](handleError(_0x5c1241,null));};exports['show']=function(_0x4b4f13,_0x28d976){var _0x29f368={'raw':![],'where':{'id':_0x4b4f13[_0xd64c('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0xd64c('0x38')}]},_0x445d57={};_0x445d57['model']=_[_0xd64c('0x40')](db[_0xd64c('0x3a')][_0xd64c('0x3b')]);_0x445d57[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x4b4f13[_0xd64c('0x3f')]);_0x445d57['filters']=_['intersection'](_0x445d57[_0xd64c('0x3e')],_0x445d57[_0xd64c('0x3f')]);_0x29f368[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x445d57[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x4b4f13[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x29f368[_0xd64c('0x43')]=_0x29f368['attributes'][_0xd64c('0x45')]?_0x29f368[_0xd64c('0x43')]:_0x445d57[_0xd64c('0x3e')];if(_0x4b4f13[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x29f368[_0xd64c('0x4f')]=[{'all':!![]}];}_0x29f368=_[_0xd64c('0x52')]({},_0x29f368,_0x4b4f13[_0xd64c('0x4d')]);return db[_0xd64c('0x3a')][_0xd64c('0x53')](_0x29f368)[_0xd64c('0x2e')](handleEntityNotFound(_0x28d976,null))['then'](respondWithResult(_0x28d976,null))[_0xd64c('0x25')](handleError(_0x28d976,null));};exports[_0xd64c('0x54')]=function(_0x414ed8,_0x51ff78){return db[_0xd64c('0x3a')][_0xd64c('0x54')](_0x414ed8[_0xd64c('0x55')],{})[_0xd64c('0x2e')](function(_0x2b6114){var _0x4ba468=_0x414ed8[_0xd64c('0x56')][_0xd64c('0x2f')]({'plain':!![]});if(!_0x4ba468)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ba468[_0xd64c('0x57')]===_0xd64c('0x56')){var _0x592d48=_0x2b6114[_0xd64c('0x2f')]({'plain':!![]});var _0x20aa7e=_0xd64c('0x30');return db[_0xd64c('0x58')][_0xd64c('0x53')]({'where':{'name':_0x20aa7e,'userProfileId':_0x4ba468[_0xd64c('0x59')]},'raw':!![]})[_0xd64c('0x2e')](function(_0x250d3f){if(_0x250d3f&&_0x250d3f[_0xd64c('0x5a')]===0x0){return db[_0xd64c('0x31')][_0xd64c('0x54')]({'name':_0x592d48[_0xd64c('0x34')],'resourceId':_0x592d48['id'],'type':_0x250d3f[_0xd64c('0x34')],'sectionId':_0x250d3f['id']},{})['then'](function(){return _0x2b6114;});}else{return _0x2b6114;}})[_0xd64c('0x25')](function(_0x258844){logger[_0xd64c('0x20')](_0xd64c('0x5b'),_0x258844);throw _0x258844;});}return _0x2b6114;})[_0xd64c('0x2e')](respondWithResult(_0x51ff78,0xc9))[_0xd64c('0x25')](handleError(_0x51ff78,null));};exports['update']=function(_0x237280,_0x498ae2){if(_0x237280['body']['id']){delete _0x237280[_0xd64c('0x55')]['id'];}return db[_0xd64c('0x3a')]['find']({'where':{'id':_0x237280[_0xd64c('0x51')]['id']},'include':[{'model':db[_0xd64c('0x37')],'as':_0xd64c('0x38')}]})[_0xd64c('0x2e')](handleEntityNotFound(_0x498ae2,null))[_0xd64c('0x2e')](saveUpdates(_0x237280[_0xd64c('0x55')],null))[_0xd64c('0x2e')](respondWithResult(_0x498ae2,null))[_0xd64c('0x25')](handleError(_0x498ae2,null));};exports['destroy']=function(_0x353b91,_0x146fff){return db['ChatWebsite'][_0xd64c('0x53')]({'where':{'id':_0x353b91['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x146fff,null))[_0xd64c('0x2e')](removeEntity(_0x146fff,null))[_0xd64c('0x25')](handleError(_0x146fff,null));};exports[_0xd64c('0x5c')]=function(_0x15f2fe,_0x46a794){return db[_0xd64c('0x3a')][_0xd64c('0x5c')]()[_0xd64c('0x2e')](respondWithResult(_0x46a794,null))['catch'](handleError(_0x46a794,null));};exports[_0xd64c('0x5d')]=function(_0x403d7e,_0x4f7e09,_0x31efa8){if(_0x403d7e[_0xd64c('0x55')]['id']){delete _0x403d7e[_0xd64c('0x55')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x403d7e[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x4f7e09,null))['then'](function(_0x51053f){if(_0x51053f){_0x403d7e[_0xd64c('0x55')][_0xd64c('0x5e')]=_0x51053f['id'];return db[_0xd64c('0x5f')]['create'](_0x403d7e['body']);}})[_0xd64c('0x2e')](respondWithResult(_0x4f7e09,null))[_0xd64c('0x25')](handleError(_0x4f7e09,null));};exports[_0xd64c('0x60')]=function(_0x585617,_0x703f6c,_0x1ca934){var _0x4ad6de={'raw':![],'where':{}};var _0x2977b3={};var _0x56f4bc={'count':0x0,'rows':[]};return db[_0xd64c('0x3a')][_0xd64c('0x61')]({'where':{'id':_0x585617[_0xd64c('0x51')]['id']}})['then'](handleEntityNotFound(_0x703f6c,null))['then'](function(_0x2878ca){if(_0x2878ca){_0x2977b3[_0xd64c('0x3e')]=_['keys'](db[_0xd64c('0x5f')]['rawAttributes']);_0x2977b3[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x585617[_0xd64c('0x3f')]);_0x2977b3[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x2977b3[_0xd64c('0x3e')],_0x2977b3[_0xd64c('0x3f')]);_0x4ad6de['attributes']=_[_0xd64c('0x42')](_0x2977b3['model'],qs[_0xd64c('0x44')](_0x585617[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x4ad6de[_0xd64c('0x43')]=_0x4ad6de['attributes']['length']?_0x4ad6de['attributes']:_0x2977b3[_0xd64c('0x3e')];if(!_0x585617[_0xd64c('0x3f')][_0xd64c('0x46')](_0xd64c('0x47'))){_0x4ad6de['limit']=qs[_0xd64c('0x2b')](_0x585617[_0xd64c('0x3f')][_0xd64c('0x2b')]);_0x4ad6de[_0xd64c('0x29')]=qs['offset'](_0x585617['query'][_0xd64c('0x29')]);}_0x4ad6de[_0xd64c('0x62')]=qs['sort'](_0x585617[_0xd64c('0x3f')]['sort']);_0x4ad6de[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x585617[_0xd64c('0x3f')],_0x2977b3[_0xd64c('0x41')]));_0x4ad6de['where'][_0xd64c('0x5e')]=_0x2878ca['id'];if(_0x585617[_0xd64c('0x3f')][_0xd64c('0x4b')]){_0x4ad6de[_0xd64c('0x49')]=_['merge'](_0x4ad6de[_0xd64c('0x49')],{'$or':_['map'](_0x4ad6de['attributes'],function(_0x23e94c){var _0xbd581f={};_0xbd581f[_0x23e94c]={'$like':'%'+_0x585617[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0xbd581f;})});}_0x4ad6de=_[_0xd64c('0x52')]({},_0x4ad6de,_0x585617['options']);return db[_0xd64c('0x5f')][_0xd64c('0x2c')]({'where':_0x4ad6de['where']})['then'](function(_0xafa053){_0x56f4bc[_0xd64c('0x2c')]=_0xafa053;if(_0x585617[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x4ad6de['include']=[{'all':!![]}];}return db[_0xd64c('0x5f')][_0xd64c('0x63')](_0x4ad6de);})['then'](function(_0x27ebc4){_0x56f4bc['rows']=_0x27ebc4;return _0x56f4bc;});}})[_0xd64c('0x2e')](respondWithFilteredResult(_0x703f6c,_0x4ad6de))[_0xd64c('0x25')](handleError(_0x703f6c,null));};exports[_0xd64c('0x64')]=function(_0x331593,_0x3aac41,_0x28e45b){return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x331593[_0xd64c('0x51')]['id']}})['then'](handleEntityNotFound(_0x3aac41,null))[_0xd64c('0x2e')](function(_0xe86ba2){if(_0xe86ba2){return _0xe86ba2[_0xd64c('0x64')](_0x331593[_0xd64c('0x3f')][_0xd64c('0x65')]);}})[_0xd64c('0x2e')](respondWithStatusCode(_0x3aac41,null))['catch'](handleError(_0x3aac41,null));};exports['addAnswer']=function(_0x47c618,_0x4eca8a,_0x25a644){if(_0x47c618[_0xd64c('0x55')]['id']){delete _0x47c618[_0xd64c('0x55')]['id'];}return db[_0xd64c('0x3a')]['find']({'where':{'id':_0x47c618[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x4eca8a,null))[_0xd64c('0x2e')](function(_0x6d3616){if(_0x6d3616){_0x47c618[_0xd64c('0x55')][_0xd64c('0x5e')]=_0x6d3616['id'];return db[_0xd64c('0x66')][_0xd64c('0x54')](_0x47c618[_0xd64c('0x55')]);}})[_0xd64c('0x2e')](respondWithResult(_0x4eca8a,null))[_0xd64c('0x25')](handleError(_0x4eca8a,null));};exports[_0xd64c('0x67')]=function(_0x19c8cd,_0x28a517,_0x1be8d3){var _0x32007a={'raw':![],'where':{}};var _0x5b9313={};var _0x28fc09={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x19c8cd[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x28a517,null))[_0xd64c('0x2e')](function(_0x1de2f5){if(_0x1de2f5){_0x5b9313['model']=_['keys'](db[_0xd64c('0x66')][_0xd64c('0x3b')]);_0x5b9313[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x19c8cd[_0xd64c('0x3f')]);_0x5b9313[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x5b9313[_0xd64c('0x3e')],_0x5b9313[_0xd64c('0x3f')]);_0x32007a[_0xd64c('0x43')]=_['intersection'](_0x5b9313['model'],qs[_0xd64c('0x44')](_0x19c8cd[_0xd64c('0x3f')]['fields']));_0x32007a[_0xd64c('0x43')]=_0x32007a['attributes'][_0xd64c('0x45')]?_0x32007a[_0xd64c('0x43')]:_0x5b9313['model'];if(!_0x19c8cd['query']['hasOwnProperty'](_0xd64c('0x47'))){_0x32007a['limit']=qs[_0xd64c('0x2b')](_0x19c8cd[_0xd64c('0x3f')][_0xd64c('0x2b')]);_0x32007a[_0xd64c('0x29')]=qs['offset'](_0x19c8cd[_0xd64c('0x3f')]['offset']);}_0x32007a[_0xd64c('0x62')]=qs['sort'](_0x19c8cd[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x32007a[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x19c8cd['query'],_0x5b9313[_0xd64c('0x41')]));_0x32007a[_0xd64c('0x49')]['ChatWebsiteId']=_0x1de2f5['id'];if(_0x19c8cd['query'][_0xd64c('0x4b')]){_0x32007a[_0xd64c('0x49')]=_[_0xd64c('0x52')](_0x32007a[_0xd64c('0x49')],{'$or':_[_0xd64c('0x39')](_0x32007a['attributes'],function(_0x289235){var _0x1ebe34={};_0x1ebe34[_0x289235]={'$like':'%'+_0x19c8cd[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0x1ebe34;})});}_0x32007a=_[_0xd64c('0x52')]({},_0x32007a,_0x19c8cd[_0xd64c('0x4d')]);return db[_0xd64c('0x66')][_0xd64c('0x2c')]({'where':_0x32007a[_0xd64c('0x49')]})['then'](function(_0x1d012d){_0x28fc09[_0xd64c('0x2c')]=_0x1d012d;if(_0x19c8cd[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x32007a[_0xd64c('0x4f')]=[{'all':!![]}];}return db[_0xd64c('0x66')][_0xd64c('0x63')](_0x32007a);})[_0xd64c('0x2e')](function(_0x12d99a){_0x28fc09[_0xd64c('0x50')]=_0x12d99a;return _0x28fc09;});}})[_0xd64c('0x2e')](respondWithFilteredResult(_0x28a517,_0x32007a))[_0xd64c('0x25')](handleError(_0x28a517,null));};exports['removeAnswers']=function(_0x56e5dd,_0x33e477,_0x2be9d9){return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x56e5dd[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x33e477,null))['then'](function(_0xf5c89b){if(_0xf5c89b){return _0xf5c89b['removeAnswers'](_0x56e5dd[_0xd64c('0x3f')]['ids']);}})[_0xd64c('0x2e')](respondWithStatusCode(_0x33e477,null))[_0xd64c('0x25')](handleError(_0x33e477,null));};exports[_0xd64c('0x68')]=function(_0x1af79f,_0xd39937,_0x3f08c7){_0x1af79f['body'][_0xd64c('0x69')]=_0x1af79f[_0xd64c('0x6a')][_0xd64c('0x6b')];return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x1af79f[_0xd64c('0x51')]['id']}})['then'](handleEntityNotFound(_0xd39937,null))[_0xd64c('0x2e')](saveUpdates(_0x1af79f[_0xd64c('0x55')],null))['then'](respondWithResult(_0xd39937,null))[_0xd64c('0x25')](handleError(_0xd39937,null));};exports[_0xd64c('0x6c')]=function(_0x8b17f,_0x1d5555,_0x5410ac){_0x8b17f[_0xd64c('0x55')][_0xd64c('0x6d')]=_0x8b17f['file'][_0xd64c('0x6b')];return db['ChatWebsite'][_0xd64c('0x53')]({'where':{'id':_0x8b17f[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x1d5555,null))[_0xd64c('0x2e')](saveUpdates(_0x8b17f[_0xd64c('0x55')],null))[_0xd64c('0x2e')](respondWithResult(_0x1d5555,null))[_0xd64c('0x25')](handleError(_0x1d5555,null));};exports[_0xd64c('0x6e')]=function(_0x14db15,_0x226156,_0xc289ad){_0x14db15[_0xd64c('0x55')][_0xd64c('0x6f')]=_0x14db15[_0xd64c('0x6a')][_0xd64c('0x6b')];return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x14db15['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x226156,null))['then'](saveUpdates(_0x14db15[_0xd64c('0x55')],null))[_0xd64c('0x2e')](respondWithResult(_0x226156,null))[_0xd64c('0x25')](handleError(_0x226156,null));};exports['addSystemAvatar']=function(_0x22fde7,_0x35306f,_0x50a142){_0x22fde7[_0xd64c('0x55')][_0xd64c('0x70')]=_0x22fde7[_0xd64c('0x6a')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x22fde7[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x35306f,null))['then'](saveUpdates(_0x22fde7[_0xd64c('0x55')],null))[_0xd64c('0x2e')](respondWithResult(_0x35306f,null))[_0xd64c('0x25')](handleError(_0x35306f,null));};exports[_0xd64c('0x71')]=function(_0x29f6d7,_0x527283,_0x470d94){var _0x33fd8e=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x74'));var _0x1b570b={'where':{'id':_0x29f6d7['params']['id']},'attributes':['id',_0xd64c('0x69')],'raw':!![]};var _0x1b9fa4=![];return require(_0xd64c('0x13'))['getLicense']()[_0xd64c('0x2e')](function(_0x5c11b8){if(_0x5c11b8){_0x1b9fa4=_0x5c11b8['custom'];}})[_0xd64c('0x2e')](function(){return db['ChatWebsite']['find'](_0x1b570b);})[_0xd64c('0x2e')](handleEntityNotFound(_0x527283,null))[_0xd64c('0x2e')](function(_0x2d8da1){if(_0x2d8da1){if(!_[_0xd64c('0x75')](_0x2d8da1[_0xd64c('0x69')])){if(fs[_0xd64c('0x76')](path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x77'),_0x2d8da1[_0xd64c('0x69')]))&&_0x1b9fa4){_0x33fd8e=path['join'](config[_0xd64c('0x73')],_0xd64c('0x77'),_0x2d8da1['sitepic']);}}return _0x527283[_0xd64c('0x78')](_0x33fd8e);}})[_0xd64c('0x25')](handleError(_0x527283,null));};exports[_0xd64c('0x79')]=function(_0x2e4913,_0x2f37a7,_0x3f68f2){var _0x19dc0f=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x7a'));var _0x37810={'where':{'id':_0x2e4913[_0xd64c('0x51')]['id']},'attributes':['id',_0xd64c('0x6d')],'raw':!![]};return db['ChatWebsite'][_0xd64c('0x53')](_0x37810)[_0xd64c('0x2e')](handleEntityNotFound(_0x2f37a7,null))[_0xd64c('0x2e')](function(_0x319cdd){if(_0x319cdd){if(!_[_0xd64c('0x75')](_0x319cdd['agentAvatar'])){if(fs['existsSync'](path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x7b'),_0x319cdd[_0xd64c('0x6d')]))){_0x19dc0f=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x7b'),_0x319cdd[_0xd64c('0x6d')]);}}return _0x2f37a7['download'](_0x19dc0f);}})[_0xd64c('0x25')](handleError(_0x2f37a7,null));};exports[_0xd64c('0x7c')]=function(_0x9a58b,_0x234678,_0x5af6c8){var _0x5ba061=path[_0xd64c('0x72')](config['root'],_0xd64c('0x7d'));var _0x40eb1b={'where':{'id':_0x9a58b[_0xd64c('0x51')]['id']},'attributes':['id','customerAvatar',_0xd64c('0x7e')],'raw':!![]};return db[_0xd64c('0x3a')][_0xd64c('0x53')](_0x40eb1b)[_0xd64c('0x2e')](handleEntityNotFound(_0x234678,null))[_0xd64c('0x2e')](function(_0x4c5829){if(_0x4c5829){if(!_[_0xd64c('0x75')](_0x4c5829[_0xd64c('0x6f')])){if(fs[_0xd64c('0x76')](path[_0xd64c('0x72')](config['root'],_0xd64c('0x7b'),_0x4c5829[_0xd64c('0x6f')]))&&_0x4c5829[_0xd64c('0x7e')]){_0x5ba061=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x7b'),_0x4c5829[_0xd64c('0x6f')]);}}return _0x234678[_0xd64c('0x78')](_0x5ba061);}})[_0xd64c('0x25')](handleError(_0x234678,null));};exports[_0xd64c('0x7f')]=function(_0x22a69c,_0x53a674,_0x32d822){var _0x4baa50=path[_0xd64c('0x72')](config[_0xd64c('0x73')],_0xd64c('0x80'));var _0x11cacb={'where':{'id':_0x22a69c[_0xd64c('0x51')]['id']},'attributes':['id',_0xd64c('0x70')],'raw':!![]};return db[_0xd64c('0x3a')][_0xd64c('0x53')](_0x11cacb)[_0xd64c('0x2e')](handleEntityNotFound(_0x53a674,null))['then'](function(_0xf20ff9){if(_0xf20ff9){if(!_['isNil'](_0xf20ff9[_0xd64c('0x70')])){if(fs[_0xd64c('0x76')](path[_0xd64c('0x72')](config['root'],_0xd64c('0x7b'),_0xf20ff9[_0xd64c('0x70')]))){_0x4baa50=path['join'](config[_0xd64c('0x73')],_0xd64c('0x7b'),_0xf20ff9[_0xd64c('0x70')]);}}return _0x53a674[_0xd64c('0x78')](_0x4baa50);}})['catch'](handleError(_0x53a674,null));};exports['notify']=function(_0x168bd6,_0x5e6b44,_0x4b26f2){var _0xf6300c=require(_0xd64c('0x81'));var _0x173fbc=new _0xf6300c();var _0x1b0f15=_0x173fbc[_0xd64c('0x82')](_0x168bd6['headers'][_0xd64c('0x83')])['getResult']();var _0x2fd0f7={'body':_0x168bd6[_0xd64c('0x55')],'channel':'chat'};var _0x114913=[];var _0x3dd435=[];var _0x4a2102={};var _0x53085c=![];return db[_0xd64c('0x84')][_0xd64c('0x5c')]()[_0xd64c('0x2e')](function(_0x377173){if(!_0x377173){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x87'));}_0x114913=_[_0xd64c('0x88')](_['keys'](_0x377173),['createdAt','updatedAt']);_0x3dd435=_['difference'](_[_0xd64c('0x40')](_0x377173),[_0xd64c('0x89'),_0xd64c('0x8a'),_0xd64c('0x8b'),_0xd64c('0x8c')]);if(_0x168bd6[_0xd64c('0x55')]['id']){delete _0x168bd6[_0xd64c('0x55')]['id'];}if(_['isNil'](_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8d')])){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x168bd6[_0xd64c('0x55')][_0xd64c('0x55')])||_0x168bd6['body'][_0xd64c('0x55')]===''){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x8e'));}if(_[_0xd64c('0x75')](_0x168bd6['body'][_0xd64c('0x8f')])){throw new db[(_0xd64c('0x85'))]['ValidationError'](_0xd64c('0x90')+_0x3dd435);}if(!_['includes'](_0x3dd435,_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8f')])){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x91')+_0x3dd435);}_0x4a2102[_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8f')]]=_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8d')];})[_0xd64c('0x2e')](function(){return db[_0xd64c('0x3a')]['find']({'where':{'id':_0x168bd6[_0xd64c('0x51')]['id']},'include':[{'model':db[_0xd64c('0x92')],'as':_0xd64c('0x93'),'include':[{'model':db[_0xd64c('0x84')],'as':_0xd64c('0x94'),'where':_0x4a2102,'limit':0x1,'order':[[_0xd64c('0x8a'),_0xd64c('0x95')]]}]},{'model':db[_0xd64c('0x96')],'as':_0xd64c('0x97')}]});})[_0xd64c('0x2e')](handleEntityNotFound(_0x5e6b44,null))[_0xd64c('0x2e')](function(_0x1db47e){if(_0x1db47e&&_0x1db47e[_0xd64c('0x93')]){_0x2fd0f7[_0xd64c('0x98')]=_0x1db47e;_0x2fd0f7[_0xd64c('0x99')]=_0x1db47e['Applications'];_0x2fd0f7[_0xd64c('0x9a')]=_0x1db47e['List'];_0x2fd0f7['applications']=_[_0xd64c('0x9b')](_0x2fd0f7[_0xd64c('0x99')],[_0xd64c('0x9c')],[_0xd64c('0x9d')]);if(_0x2fd0f7['account'][_0xd64c('0x97')]){delete _0x2fd0f7[_0xd64c('0x98')][_0xd64c('0x97')];}if(_0x2fd0f7[_0xd64c('0x98')][_0xd64c('0x93')]&&_0x2fd0f7[_0xd64c('0x98')]['List']['Contacts'][_0xd64c('0x45')]){return _0x2fd0f7['account'][_0xd64c('0x93')]['Contacts'][0x0];}var _0x5e3002=_[_0xd64c('0x16')](_0x168bd6[_0xd64c('0x55')],{'firstName':_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8d')],'ListId':_0x1db47e['ListId']});_0x5e3002[_0x168bd6['body'][_0xd64c('0x8f')]]=_0x168bd6[_0xd64c('0x55')][_0xd64c('0x8d')];return db['CmContact']['create'](_0x5e3002,{'fields':_0x114913,'raw':!![]});}})[_0xd64c('0x2e')](handleEntityNotFound(_0x5e6b44,null))['then'](function(_0x3ba1a6){_0x2fd0f7['contact']=_0x3ba1a6;var _0x15a973=_0x168bd6['body'][_0xd64c('0x9e')];if(_0x168bd6['headers'][_0xd64c('0x9f')]){_0x15a973=_0x168bd6[_0xd64c('0xa0')][_0xd64c('0x9f')];}else if(_0x168bd6['headers'][_0xd64c('0xa1')]){_0x15a973=_[_0xd64c('0xa2')](_0x168bd6[_0xd64c('0xa0')]['x-forwarded-for']['split'](','));}if(_0x3ba1a6){var _0x1e420c={'ContactId':_0x3ba1a6['id'],'ChatWebsiteId':_0x168bd6[_0xd64c('0x51')]['id'],'from':(_0x3ba1a6[_0xd64c('0xa3')]||'')+'\x20'+(_0x3ba1a6[_0xd64c('0xa4')]||''),'customerIp':_0x15a973,'customerPort':_0x168bd6[_0xd64c('0xa0')]['x-real-port']?_0x168bd6['headers'][_0xd64c('0xa5')]:null,'referer':_0x168bd6[_0xd64c('0x55')][_0xd64c('0xa6')],'browserName':_0x1b0f15['browser'][_0xd64c('0x34')]&&_0x1b0f15['browser'][_0xd64c('0xa7')]?util[_0xd64c('0xa8')](_0xd64c('0xa9'),_0x1b0f15[_0xd64c('0xaa')]['name'],_0x1b0f15[_0xd64c('0xaa')][_0xd64c('0xa7')]):_0xd64c('0xab'),'browserVersion':_0x1b0f15['browser']['version']||_0xd64c('0xab'),'osName':util['format'](_0xd64c('0xa9'),_0x1b0f15['os'][_0xd64c('0x34')],_0x1b0f15['os'][_0xd64c('0xa7')]),'osVersion':_0x1b0f15['os'][_0xd64c('0xa7')],'deviceModel':_0x1b0f15[_0xd64c('0xac')][_0xd64c('0x3e')]&&_0x1b0f15[_0xd64c('0xac')]['vendor']?util[_0xd64c('0xa8')](_0xd64c('0xad'),_0x1b0f15[_0xd64c('0xac')][_0xd64c('0x3e')],_0x1b0f15[_0xd64c('0xac')]['vendor'],_0x1b0f15[_0xd64c('0xac')][_0xd64c('0xae')]):null,'deviceVendor':_0x1b0f15[_0xd64c('0xac')][_0xd64c('0xaf')],'deviceType':_0x1b0f15[_0xd64c('0xac')][_0xd64c('0xae')],'formData':JSON[_0xd64c('0x1f')](_0x168bd6['body'])};var _0x2c8326={'ChatWebsiteId':_0x168bd6[_0xd64c('0x51')]['id'],'closed':![]};if(_0x168bd6['body'][_0xd64c('0xb0')]){_0x2c8326['threadId']=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb0')];return db['ChatInteraction'][_0xd64c('0x53')]({'where':_0x2c8326})[_0xd64c('0x2e')](function(_0x162f2c){if(_0x162f2c){return[_0x162f2c,![]];}_0x1e420c['threadId']=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb0')];_0x1e420c['externalUrl']=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb1')];return db[_0xd64c('0xb2')][_0xd64c('0x54')](_0x1e420c)[_0xd64c('0x2e')](function(_0x50f922){return[_0x50f922,!![]];});});}_0x2c8326[_0xd64c('0xb3')]=_0x3ba1a6['id'];if(_0x168bd6['body'][_0xd64c('0xb4')]&&_0x168bd6[_0xd64c('0x55')]['interaction']['id']){_0x2c8326['id']=_0x168bd6['body'][_0xd64c('0xb4')]['id'];return db[_0xd64c('0xb2')][_0xd64c('0x53')]({'where':_0x2c8326})[_0xd64c('0x2e')](function(_0x158ddc){if(_0x158ddc){return[_0x158ddc,![]];}return db[_0xd64c('0xb2')][_0xd64c('0x54')](_0x1e420c)[_0xd64c('0x2e')](function(_0x2d24a7){return[_0x2d24a7,!![]];});});}return db[_0xd64c('0xb2')][_0xd64c('0x54')](_0x1e420c)[_0xd64c('0x2e')](function(_0x2fb8bc){return[_0x2fb8bc,!![]];});}})[_0xd64c('0xb5')](function(_0x500d1e,_0x2ecf74){if(_0x500d1e){_0x53085c=_0x2ecf74;if(!_0x2ecf74){var _0x306a65={'from':(_0x2fd0f7['contact'][_0xd64c('0xa3')]||'')+'\x20'+(_0x2fd0f7['contact'][_0xd64c('0xa4')]||'')};if(_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb0')]&&_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb6')]&&_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb0')]!=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb6')]){_0x306a65['threadId']=_0x168bd6[_0xd64c('0x55')][_0xd64c('0xb6')];}return _0x500d1e[_0xd64c('0xb7')](_0x306a65);}else{return _0x500d1e;}}})[_0xd64c('0x2e')](function(_0x23ebaa){_0x2fd0f7[_0xd64c('0xb4')]=_0x23ebaa['get']({'plain':!![]});_0x2fd0f7[_0xd64c('0xb4')]['created']=_0x53085c;if(_0x2fd0f7[_0xd64c('0xb4')][_0xd64c('0xb8')]){if(_0x2fd0f7[_0xd64c('0x98')][_0xd64c('0xb9')]){_0x2fd0f7['applications'][_0xd64c('0xba')]({'id':0x0,'priority':_0x2fd0f7[_0xd64c('0x99')][_0xd64c('0x45')]+0x1,'app':_0xd64c('0xbb'),'appdata':_0xd64c('0xbc'),'interval':_0xd64c('0xbd')});}}return db[_0xd64c('0xbe')][_0xd64c('0x54')]({'body':_0x168bd6[_0xd64c('0x55')][_0xd64c('0x55')],'ChatWebsiteId':_0x168bd6[_0xd64c('0x51')]['id'],'ChatInteractionId':_0x23ebaa['id'],'direction':'in','ContactId':_0x2fd0f7[_0xd64c('0xbf')]['id'],'AttachmentId':_0x168bd6[_0xd64c('0x55')][_0xd64c('0xc0')]});})['then'](function(_0x500105){_0x2fd0f7[_0xd64c('0x23')]=_0x500105;if(_0x2fd0f7['interaction'][_0xd64c('0xc1')]){return db['User'][_0xd64c('0x53')]({'attributes':['id',_0xd64c('0x34')],'where':{'id':_0x2fd0f7['interaction'][_0xd64c('0xc1')]}})[_0xd64c('0x2e')](function(_0x3007d0){if(_0x3007d0){_0x2fd0f7[_0xd64c('0x99')][_0xd64c('0xc2')]({'id':0x0,'priority':0x0,'app':_0xd64c('0xc3'),'appdata':_0x3007d0[_0xd64c('0x34')]+','+(_0x2fd0f7[_0xd64c('0x98')]['waitForTheAssignedAgent']||0xa),'interval':_0xd64c('0xbd')});_0x2fd0f7[_0xd64c('0xc4')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x2fd0f7);});}return respondWithRpcPromise(_0xd64c('0xc5'),'startRouting',_0x2fd0f7);})[_0xd64c('0x2e')](function(_0x5c9aeb){respondWithRpcPromise(_0xd64c('0xc6'),_0xd64c('0xc6'),{'event':_0xd64c('0xc7'),'message':_0x5c9aeb},client9002);return _0x5c9aeb;})[_0xd64c('0x2e')](respondWithResult(_0x5e6b44,null))[_0xd64c('0x25')](handleError(_0x5e6b44,null));};exports[_0xd64c('0xc8')]=function(_0x4d55d6,_0x1fc382,_0x2c42eb){var _0x2caf0c,_0x2c3cb3,_0x1171bc;var _0x326e8f=[];var _0x11be0d=[];var _0x162870={};var _0x465035=_0x4d55d6[_0xd64c('0xc9')]||[];var _0x59e80f=[];var _0x32a600;return db[_0xd64c('0x84')]['describe']()[_0xd64c('0x2e')](function(_0x1c3d0f){if(!_0x1c3d0f){throw new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x87'));}_0x11be0d=_[_0xd64c('0x88')](_[_0xd64c('0x40')](_0x1c3d0f),[_0xd64c('0x89'),_0xd64c('0x8a')]);_0x326e8f=_[_0xd64c('0x88')](_['keys'](_0x1c3d0f),[_0xd64c('0x89'),_0xd64c('0x8a'),_0xd64c('0x8b'),'ListId']);if(_0x4d55d6[_0xd64c('0x55')]['id']){delete _0x4d55d6[_0xd64c('0x55')]['id'];}if(_['isNil'](_0x4d55d6[_0xd64c('0x55')]['from'])){throw _0x1fc382['status'](0x1f4)[_0xd64c('0x35')](new db['Sequelize'][(_0xd64c('0x86'))](_0xd64c('0xca')));}if(_[_0xd64c('0x75')](_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x55')])||_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x55')]===''){throw _0x1fc382[_0xd64c('0x27')](0x1f4)[_0xd64c('0x35')](new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0x8e')));}if(_['isNil'](_0x4d55d6[_0xd64c('0x55')][_0xd64c('0xcb')])){throw _0x1fc382[_0xd64c('0x27')](0x1f4)[_0xd64c('0x35')](new db[(_0xd64c('0x85'))]['ValidationError'](_0xd64c('0xcc')+_0x326e8f));}if(!_[_0xd64c('0xcd')](_0x326e8f,_0x4d55d6['body'][_0xd64c('0xcb')])){throw _0x1fc382[_0xd64c('0x27')](0x1f4)[_0xd64c('0x35')](new db[(_0xd64c('0x85'))][(_0xd64c('0x86'))](_0xd64c('0xce')+_0x326e8f));}_0x162870[_0x4d55d6[_0xd64c('0x55')][_0xd64c('0xcb')]]=_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x8d')];})['then'](function(){return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x4d55d6[_0xd64c('0x51')]['id']},'include':[{'model':db[_0xd64c('0x92')],'as':_0xd64c('0x93')},{'model':db[_0xd64c('0xcf')],'as':_0xd64c('0xcf')}]});})['then'](handleEntityNotFound(_0x1fc382,null))[_0xd64c('0x2e')](function(_0x39c317){if(_0x39c317&&_0x39c317[_0xd64c('0x93')]){_0x2c3cb3=_0x39c317;var _0x35183e=_[_0xd64c('0x16')](_0x4d55d6['body'],{'firstName':_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x8d')],'phone':_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x8d')],'ListId':_0x39c317['ListId']});_0x35183e[_0x4d55d6[_0xd64c('0x55')][_0xd64c('0xcb')]]=_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x8d')];return db[_0xd64c('0x84')]['findOrCreate']({'where':_0x162870,'defaults':_0x35183e});}})[_0xd64c('0xb5')](function(_0xf9cf37){if(_0xf9cf37){_0x1171bc=_0xf9cf37;var _0x516556=fs[_0xd64c('0xd0')](path['join'](config[_0xd64c('0x73')],_0xd64c('0xd1')),_0xd64c('0xd2'));var _0x29bd2b=ejs[_0xd64c('0xd3')](_0x516556,{'body':_[_0xd64c('0xd4')](_0x4d55d6[_0xd64c('0x55')][_0xd64c('0x55')]),'bodyTitle':_0x2c3cb3['offlineMessageBody']});return db[_0xd64c('0xd5')][_0xd64c('0x54')]({'body':_0x29bd2b,'ContactId':_0xf9cf37['id'],'ChatWebsiteId':_0x2c3cb3['id']});}})[_0xd64c('0x2e')](function(_0x26b169){_0x32a600=_0x26b169;if(_0x465035[_0xd64c('0x45')]){var _0xe9a295=_0x465035[_0xd64c('0x39')](function(_0x409f6b){return{'name':_0x409f6b[_0xd64c('0xd6')],'basename':_0x409f6b['filename'],'type':_0x409f6b[_0xd64c('0xd7')],'ChatOfflineMessageId':_0x26b169['id']};});_0x59e80f=_0xe9a295[_0xd64c('0x39')](_0x48e5d6=>{var _0x340a03={'filename':_0x48e5d6[_0xd64c('0x34')],'path':path['join'](config[_0xd64c('0x73')],_0xd64c('0xd8'),_0xd64c('0xc9'),_0xd64c('0xd9'),'offline-chat',_0x48e5d6[_0xd64c('0xda')])};return _0x340a03;});if(!_0x2c3cb3['openNewInteraction']){return db[_0xd64c('0xdb')]['transaction'](function(_0x23b42c){return db[_0xd64c('0xdc')][_0xd64c('0xdd')](_0xe9a295,{'transaction':_0x23b42c});});}}})[_0xd64c('0x2e')](function(){if(_0x32a600){_0x2caf0c=_0x32a600;return db[_0xd64c('0xcf')][_0xd64c('0x61')]({'where':{'active':!![]},'include':[{'model':db[_0xd64c('0xde')],'as':_0xd64c('0xdf'),'raw':!![]}]});}})[_0xd64c('0x2e')](function(_0x698179){if(_0x698179&&_0x698179[_0xd64c('0xdf')]&&_0x2c3cb3[_0xd64c('0xe0')]&&_0x2c3cb3[_0xd64c('0xe1')]){var _0x2e6dd3={'tls':{'rejectUnauthorized':![]}};if(_0x698179['Smtp']['service']){_0x2e6dd3[_0xd64c('0xe2')]=_0x698179[_0xd64c('0xdf')]['service'];}else{_0x2e6dd3[_0xd64c('0xe3')]=_0x698179['Smtp'][_0xd64c('0xe3')];_0x2e6dd3[_0xd64c('0xe4')]=_0x698179[_0xd64c('0xdf')][_0xd64c('0xe4')];_0x2e6dd3[_0xd64c('0xe5')]=_0x698179[_0xd64c('0xdf')]['secure'];}if(_0x698179[_0xd64c('0xdf')][_0xd64c('0xe6')]){_0x2e6dd3[_0xd64c('0xe7')]={'user':_0x698179[_0xd64c('0xdf')][_0xd64c('0x56')],'pass':_0x698179[_0xd64c('0xdf')][_0xd64c('0xe8')]};}return respondWithRpcPromise(_0xd64c('0xe9'),_0xd64c('0xea'),{'account':_0x2e6dd3,'message':{'from':util[_0xd64c('0xa8')]('\x22%s\x22\x20<%s>',_0x698179[_0xd64c('0x34')],_0x698179[_0xd64c('0xeb')]||_0x698179[_0xd64c('0xdf')][_0xd64c('0x56')]),'to':_0x2c3cb3[_0xd64c('0xe1')],'subject':_0x2c3cb3[_0xd64c('0xec')],'html':_0x2caf0c[_0xd64c('0x55')],'attachments':_0x59e80f}},client9003)['then'](function(){return _0x2caf0c;})[_0xd64c('0x25')](function(_0xc3124a){console[_0xd64c('0x20')](_0xc3124a);});}})[_0xd64c('0x2e')](function(){if(_0x2c3cb3&&_0x2c3cb3[_0xd64c('0xed')]&&_0x2c3cb3[_0xd64c('0xee')]){var _0x49ec6b=[];if(_0x465035[_0xd64c('0x45')]){_0x49ec6b=_0x465035['map'](function(_0x12aa65){return{'name':_0x12aa65[_0xd64c('0xd6')],'basename':_0x12aa65[_0xd64c('0x6b')],'type':_0x12aa65[_0xd64c('0xd7')],'ChatOfflineMessageId':_0x32a600['id']};});}var _0xab5dfb;if(!_[_0xd64c('0x75')](_0x2c3cb3['subjectOffline'])){var _0x497631=_['map'](_0x4d55d6[_0xd64c('0x55')],function(_0x3d8e3a){return _0x3d8e3a;});var _0x2a74cd=_[_0xd64c('0xef')](_0x497631)[0x0];var _0x1a8096=_['mapValues'](_0x2a74cd,function(_0x344504){return _0x344504;});_0xab5dfb=_0x1a8096[0x1][_0x2c3cb3[_0xd64c('0xf0')]];}var _0x928eea={'from':_0x1171bc[_0xd64c('0xeb')],'firstName':_0x1171bc[_0xd64c('0xa3')],'lastName':_0x1171bc[_0xd64c('0xa4')],'mapKey':'email','message':{'from':_0x1171bc[_0xd64c('0xeb')],'to':_0x2c3cb3[_0xd64c('0xcf')][_0xd64c('0xeb')],'cc':'','subject':_[_0xd64c('0x75')](_0xab5dfb)?_0x2c3cb3['offlineMessageSubject']:_0xab5dfb,'messageId':'','sentAt':new Date(),'attach':_0x49ec6b[_0xd64c('0x45')],'attachments':_0x49ec6b,'originChannel':'Chat','ChatWebsiteId':_0x2c3cb3['id'],'ChatOfflineMessageId':_0x2caf0c['id'],'originTo':_0x2c3cb3['MailAccount']['email']},'body':_0x2caf0c[_0xd64c('0x55')]};var _0x4f2f66={'account':{'id':_0x2c3cb3[_0xd64c('0xee')]},'body':_0x928eea,'log':_0xd64c('0xf1')};return respondWithRpcPromise(_0xd64c('0xf1'),_0xd64c('0xf2'),_0x4f2f66,client9001)[_0xd64c('0x2e')](function(){return _0x2caf0c;})[_0xd64c('0x25')](function(_0x2b71f6){console[_0xd64c('0x20')](_0x2b71f6);});}return;})[_0xd64c('0x2e')](function(){if(_0x2caf0c){return _0x2caf0c;}})[_0xd64c('0x2e')](respondWithResult(_0x1fc382,null))[_0xd64c('0x25')](function(_0x5750fd){console['error'](_0xd64c('0x25'),_0x5750fd);for(var _0x2031d6 of _0x465035){var _0x17a462=path[_0xd64c('0x72')](config['root'],'server',_0xd64c('0xc9'),_0xd64c('0xd9'),'offline-chat',_0x2031d6[_0xd64c('0x6b')]);fs_extra[_0xd64c('0xf3')](_0x17a462)[_0xd64c('0x25')](function(_0x1eb49f){console[_0xd64c('0x20')](_0xd64c('0xf4'),_0x17a462,_0x1eb49f);});}});};exports[_0xd64c('0xf5')]=function(_0x41b2c7,_0x3b6758,_0x30540c){return db[_0xd64c('0xb2')][_0xd64c('0x53')]({'where':{'id':_0x41b2c7[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x3b6758,null))[_0xd64c('0x2e')](function(_0x302b92){if(_0x302b92){return _0x302b92[_0xd64c('0xf5')](_0x41b2c7[_0xd64c('0x55')][_0xd64c('0x65')],_[_0xd64c('0xf6')](_0x41b2c7['body'],[_0xd64c('0x65'),'id'])||{});}})[_0xd64c('0x2e')](respondWithResult(_0x3b6758,null))[_0xd64c('0x25')](handleError(_0x3b6758,null));};exports[_0xd64c('0xf7')]=function(_0x47ed30,_0x3cac25,_0x2173ee){var _0x4df8a6={'raw':![],'where':{}};var _0x46f897={};var _0x517080={'count':0x0,'rows':[]};return db[_0xd64c('0x3a')][_0xd64c('0x61')]({'where':{'id':_0x47ed30['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x3cac25,null))['then'](function(_0x9a9dd1){if(_0x9a9dd1){_0x46f897['model']=_['keys'](db[_0xd64c('0xb2')][_0xd64c('0x3b')]);_0x46f897[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x47ed30[_0xd64c('0x3f')]);_0x46f897['filters']=_['intersection'](_0x46f897['model'],_0x46f897[_0xd64c('0x3f')]);_0x4df8a6[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x46f897[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x47ed30[_0xd64c('0x3f')]['fields']));_0x4df8a6[_0xd64c('0x43')]=_0x4df8a6[_0xd64c('0x43')]['length']?_0x4df8a6[_0xd64c('0x43')]:_0x46f897['model'];if(!_0x47ed30['query']['hasOwnProperty'](_0xd64c('0x47'))){_0x4df8a6['limit']=qs[_0xd64c('0x2b')](_0x47ed30['query']['limit']);_0x4df8a6[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x47ed30[_0xd64c('0x3f')]['offset']);}_0x4df8a6['order']=qs[_0xd64c('0x48')](_0x47ed30[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x4df8a6[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x47ed30['query'],_0x46f897[_0xd64c('0x41')]));_0x4df8a6['where'][_0xd64c('0x5e')]=_0x9a9dd1['id'];if(_0x47ed30[_0xd64c('0x3f')][_0xd64c('0x4b')]){_0x4df8a6[_0xd64c('0x49')]=_['merge'](_0x4df8a6[_0xd64c('0x49')],{'$or':_[_0xd64c('0x39')](_0x4df8a6[_0xd64c('0x43')],function(_0x4d9e1a){var _0x2c6a9e={};_0x2c6a9e[_0x4d9e1a]={'$like':'%'+_0x47ed30[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0x2c6a9e;})});}_0x4df8a6=_['merge']({},_0x4df8a6,_0x47ed30[_0xd64c('0x4d')]);return db[_0xd64c('0xb2')][_0xd64c('0x2c')]({'where':_0x4df8a6['where']})[_0xd64c('0x2e')](function(_0x1783cc){_0x517080['count']=_0x1783cc;if(_0x47ed30['query'][_0xd64c('0x4e')]){_0x4df8a6[_0xd64c('0x4f')]=[{'model':db[_0xd64c('0x84')],'as':_0xd64c('0xf8'),'required':![]},{'model':db['User'],'as':_0xd64c('0xf9'),'attributes':['name',_0xd64c('0xfa'),_0xd64c('0xfb')],'required':![]},{'model':db[_0xd64c('0xfc')],'as':_0xd64c('0xfd'),'attributes':['id',_0xd64c('0x34'),_0xd64c('0xfe')],'where':_0x47ed30[_0xd64c('0x3f')]['tag']?{'id':_0x47ed30[_0xd64c('0x3f')]['tag']}:undefined,'required':_0x47ed30[_0xd64c('0x3f')]['tag']?!![]:![]}];}return db[_0xd64c('0xb2')][_0xd64c('0x63')](_0x4df8a6);})[_0xd64c('0x2e')](function(_0x12697a){_0x517080[_0xd64c('0x50')]=_0x12697a;return _0x517080;});}})[_0xd64c('0x2e')](respondWithFilteredResult(_0x3cac25,_0x4df8a6))[_0xd64c('0x25')](handleError(_0x3cac25,null));};function iftimePromise(_0x425c5b,_0x14c93e){return respondWithRpcPromise(_0xd64c('0xff'),_0xd64c('0x100'),{'command':_0x14c93e[_0xd64c('0x101')]?util[_0xd64c('0xa8')](_0xd64c('0x102'),_0x425c5b[_0xd64c('0x103')],_0x14c93e[_0xd64c('0x101')]):util['format'](_0xd64c('0x104'),_0x425c5b['interval'])},client9002)['then'](function(_0x5dc790){var _0x1432bf=_0x5dc790&&_0x5dc790['indexOf']('true')>=0x0?!![]:![];logger[_0xd64c('0x1c')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x14c93e['id'],_0x425c5b['id'],_0x425c5b[_0xd64c('0x103')],_0x1432bf?'ONLINE':_0xd64c('0x105'),_0x14c93e[_0xd64c('0x101')]?_0x14c93e[_0xd64c('0x101')]:_0xd64c('0x106'));return _0x1432bf;})[_0xd64c('0x25')](function(_0x358a1b){logger[_0xd64c('0x20')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x14c93e['id'],_0x425c5b['id'],_0x425c5b[_0xd64c('0x103')],util['inspect'](_0x358a1b,{'showHidden':![],'depth':null}),_0x14c93e[_0xd64c('0x101')]?_0x14c93e[_0xd64c('0x101')]:_0xd64c('0x106'));return![];});}exports[_0xd64c('0x100')]=function(_0x19b8ff,_0x5e6255,_0x559b7d){var _0x3e5b6c=0x0;var _0x21fddc=0x0;var _0xd33e07=![];var _0x66e23;var _0x524d23;return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x19b8ff['params']['id']},'include':[{'model':db[_0xd64c('0x107')],'as':_0xd64c('0x107'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xd64c('0x2e')](handleEntityNotFound(_0x5e6255,null))[_0xd64c('0x2e')](function(_0x165059){if(_0x165059){_0x66e23=_0x165059;return _0x165059[_0xd64c('0x108')]({'raw':!![]});}})[_0xd64c('0x2e')](function(_0x51e3e9){if(_0x66e23){if(_0x51e3e9){_0x524d23=_0x51e3e9;}}return require(_0xd64c('0x13'))[_0xd64c('0x109')]();})[_0xd64c('0x2e')](function(_0x5f31df){if(_0x5f31df){_0x21fddc=_0x5f31df[_0xd64c('0x10a')];_0xd33e07=_0x5f31df[_0xd64c('0x10b')];}})[_0xd64c('0x2e')](function(){return db[_0xd64c('0xb2')][_0xd64c('0x2c')]({'where':{'closed':![]}});})[_0xd64c('0x2e')](function(_0x610d2d){_0x3e5b6c=_0x610d2d;if(_0x21fddc&&_0x610d2d>_0x21fddc){return db[_0xd64c('0x10c')][_0xd64c('0x61')]({'where':{'id':0x1}})[_0xd64c('0x2e')](function(_0x57e7b8){if(_0x57e7b8){_0x57e7b8[_0xd64c('0x10d')](_0xd64c('0x10e'));}});}})[_0xd64c('0x2e')](function(){if(_0x66e23[_0xd64c('0x107')]&&_0x66e23[_0xd64c('0x107')]['Intervals']){var _0x2402b3=[];for(var _0x17407c=0x0;_0x17407c<_0x66e23[_0xd64c('0x107')][_0xd64c('0x10f')][_0xd64c('0x45')];_0x17407c++){var _0x532bb4=_0x66e23[_0xd64c('0x107')][_0xd64c('0x10f')][_0x17407c][_0xd64c('0x2f')]({'plain':!![]});_0x2402b3['push'](iftimePromise(_0x532bb4,_0x66e23));}return BPromise[_0xd64c('0x110')](_0x2402b3)[_0xd64c('0x2e')](function(_0x134492){return _[_0xd64c('0x111')](_0x134492);});}else{return!![];}})[_0xd64c('0x2e')](function(_0x4f1f13){var _0x47c0a7=fs[_0xd64c('0xd0')](path['join'](config[_0xd64c('0x73')],_0xd64c('0x112')),_0xd64c('0xd2'));var _0x2900c1={'remote':_0x66e23['remote'],'query':querystring[_0xd64c('0x1f')](_[_0xd64c('0x52')](_0x66e23['get']({'plain':!![]}),{'customerIp':_0x19b8ff[_0xd64c('0xa0')][_0xd64c('0xa1')]||_0x19b8ff[_0xd64c('0xa0')]['x-real-ip']||_0x19b8ff['connection'][_0xd64c('0x113')]||_0x19b8ff['ip'],'referer':_0x19b8ff[_0xd64c('0xa0')][_0xd64c('0xa6')],'openedInteractions':_0x3e5b6c,'maxInteractions':_0x21fddc,'virtual':_0xd33e07[_0xd64c('0x10a')],'online':_0x4f1f13,'custom':_0xd33e07}))['replace'](/'/g,'\x5c\x27')};_0x5e6255[_0xd64c('0x35')](ejs[_0xd64c('0xd3')](Mustache[_0xd64c('0xd3')](_0x47c0a7,_0x2900c1),{'proactiveActions':_0x524d23,'alignment':_0x66e23[_0xd64c('0x114')],'verticalAlignment':_0x66e23[_0xd64c('0x115')],'div_color':_0x66e23[_0xd64c('0xfe')],'text_color':_0x66e23['textColor'],'button_color':_0x66e23['color_button'],'background_color':_0x66e23[_0xd64c('0x116')]}));})[_0xd64c('0x25')](handleError(_0x5e6255,null));};exports[_0xd64c('0x117')]=function(_0x1c496f,_0x293306,_0x530932){return db[_0xd64c('0x3a')][_0xd64c('0x61')]({'where':{'id':_0x1c496f[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x293306,null))[_0xd64c('0x2e')](function(_0x6293e0){if(_0x6293e0){return db[_0xd64c('0xdb')][_0xd64c('0x118')](function(_0x4e11aa){return db[_0xd64c('0x96')][_0xd64c('0x32')]({'where':{'ChatWebsiteId':_0x1c496f['params']['id']},'transaction':_0x4e11aa})[_0xd64c('0x2e')](function(_0x3d4547){var _0x56327e=_[_0xd64c('0x39')](_0x1c496f[_0xd64c('0x55')],function(_0xa5d4e1){_0xa5d4e1[_0xd64c('0x5e')]=_0x1c496f[_0xd64c('0x51')]['id'];return _0xa5d4e1;});return db['ChatApplication']['bulkCreate'](_0x56327e,{'transaction':_0x4e11aa});});})[_0xd64c('0x2e')](function(){return db['ChatApplication'][_0xd64c('0x119')]({'where':{'ChatWebsiteId':_0x1c496f['params']['id']},'order':_0xd64c('0x9c')});});}})[_0xd64c('0x2e')](respondWithResult(_0x293306,null))[_0xd64c('0x25')](handleError(_0x293306,null));};exports[_0xd64c('0x11a')]=function(_0x48d285,_0x413314,_0x5f20fc){var _0x2d87da={};var _0x3c65a7={};var _0x31dbd3;var _0x4192cc;return db['ChatWebsite']['findOne']({'where':{'id':_0x48d285['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x413314,null))[_0xd64c('0x2e')](function(_0x228ba1){if(_0x228ba1){_0x31dbd3=_0x228ba1;_0x3c65a7['model']=_[_0xd64c('0x40')](db['ChatApplication'][_0xd64c('0x3b')]);_0x3c65a7[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x48d285[_0xd64c('0x3f')]);_0x3c65a7['filters']=_['intersection'](_0x3c65a7[_0xd64c('0x3e')],_0x3c65a7['query']);_0x2d87da['attributes']=_[_0xd64c('0x42')](_0x3c65a7[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x48d285[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x2d87da[_0xd64c('0x43')]=_0x2d87da[_0xd64c('0x43')][_0xd64c('0x45')]?_0x2d87da[_0xd64c('0x43')]:_0x3c65a7[_0xd64c('0x3e')];_0x2d87da[_0xd64c('0x62')]=qs[_0xd64c('0x48')](_0x48d285[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x2d87da[_0xd64c('0x49')]=qs['filters'](_['pick'](_0x48d285['query'],_0x3c65a7['filters']));if(_0x48d285['query']['filter']){_0x2d87da[_0xd64c('0x49')]=_[_0xd64c('0x52')](_0x2d87da[_0xd64c('0x49')],{'$or':_[_0xd64c('0x39')](_0x2d87da[_0xd64c('0x43')],function(_0x14437b){var _0x50b8fd={};_0x50b8fd[_0x14437b]={'$like':'%'+_0x48d285['query'][_0xd64c('0x4b')]+'%'};return _0x50b8fd;})});}_0x2d87da=_['merge']({},_0x2d87da,_0x48d285[_0xd64c('0x4d')]);return _0x31dbd3[_0xd64c('0x11a')](_0x2d87da);}})[_0xd64c('0x2e')](function(_0x573494){if(_0x573494){_0x4192cc=_0x573494[_0xd64c('0x45')];if(!_0x48d285['query'][_0xd64c('0x46')](_0xd64c('0x47'))){_0x2d87da[_0xd64c('0x2b')]=qs[_0xd64c('0x2b')](_0x48d285[_0xd64c('0x3f')][_0xd64c('0x2b')]);_0x2d87da[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x48d285[_0xd64c('0x3f')]['offset']);}return _0x31dbd3['getApplications'](_0x2d87da);}})[_0xd64c('0x2e')](function(_0x4dcc6e){if(_0x4dcc6e){return _0x4dcc6e?{'count':_0x4192cc,'rows':_0x4dcc6e}:null;}})['then'](respondWithResult(_0x413314,null))['catch'](handleError(_0x413314,null));};exports[_0xd64c('0x11b')]=function(_0x3389f6,_0x21b7c,_0x4236e8){return db['chatProactiveAction'][_0xd64c('0x53')]({'where':{'id':_0x3389f6[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x21b7c,null))['then'](function(_0xc351a8){if(_0xc351a8){return _0xc351a8[_0xd64c('0x11b')](_0x3389f6['body'][_0xd64c('0x65')],_[_0xd64c('0xf6')](_0x3389f6[_0xd64c('0x55')],[_0xd64c('0x65'),'id'])||{});}})[_0xd64c('0x2e')](respondWithResult(_0x21b7c,null))[_0xd64c('0x25')](handleError(_0x21b7c,null));};exports[_0xd64c('0x108')]=function(_0x4bf270,_0x2bef91,_0x678774){var _0x5e00d9={};var _0x34875a={};var _0x4ce6e2;var _0x2a2020;return db[_0xd64c('0x3a')][_0xd64c('0x61')]({'where':{'id':_0x4bf270[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x2bef91,null))[_0xd64c('0x2e')](function(_0x41e2fd){if(_0x41e2fd){_0x4ce6e2=_0x41e2fd;_0x34875a[_0xd64c('0x3e')]=_[_0xd64c('0x40')](db[_0xd64c('0x11c')][_0xd64c('0x3b')]);_0x34875a[_0xd64c('0x3f')]=_['keys'](_0x4bf270[_0xd64c('0x3f')]);_0x34875a[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x34875a['model'],_0x34875a['query']);_0x5e00d9[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x34875a[_0xd64c('0x3e')],qs['fields'](_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x5e00d9[_0xd64c('0x43')]=_0x5e00d9[_0xd64c('0x43')][_0xd64c('0x45')]?_0x5e00d9['attributes']:_0x34875a['model'];_0x5e00d9[_0xd64c('0x62')]=qs[_0xd64c('0x48')](_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x48')]);_0x5e00d9[_0xd64c('0x49')]=qs['filters'](_[_0xd64c('0x4a')](_0x4bf270[_0xd64c('0x3f')],_0x34875a[_0xd64c('0x41')]));if(_0x4bf270['query'][_0xd64c('0x4b')]){_0x5e00d9[_0xd64c('0x49')]=_[_0xd64c('0x52')](_0x5e00d9[_0xd64c('0x49')],{'$or':_[_0xd64c('0x39')](_0x5e00d9[_0xd64c('0x43')],function(_0x262d25){var _0x335950={};_0x335950[_0x262d25]={'$like':'%'+_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0x335950;})});}_0x5e00d9=_[_0xd64c('0x52')]({},_0x5e00d9,_0x4bf270[_0xd64c('0x4d')]);return _0x4ce6e2[_0xd64c('0x108')](_0x5e00d9);}})[_0xd64c('0x2e')](function(_0x54a125){if(_0x54a125){_0x2a2020=_0x54a125[_0xd64c('0x45')];if(!_0x4bf270['query'][_0xd64c('0x46')](_0xd64c('0x47'))){_0x5e00d9[_0xd64c('0x2b')]=qs[_0xd64c('0x2b')](_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x2b')]);_0x5e00d9[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x4bf270[_0xd64c('0x3f')][_0xd64c('0x29')]);}return _0x4ce6e2['getProactiveActions'](_0x5e00d9);}})[_0xd64c('0x2e')](function(_0x36755e){if(_0x36755e){return _0x36755e?{'count':_0x2a2020,'rows':_0x36755e}:null;}})[_0xd64c('0x2e')](respondWithResult(_0x2bef91,null))[_0xd64c('0x25')](handleError(_0x2bef91,null));};exports['getFields']=function(_0x16ca70,_0x51da11,_0xac1ddc){var _0x79fd2f=_0x16ca70[_0xd64c('0x3f')]['online']==='false'?_0xd64c('0x11d'):_0xd64c('0x11e');return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'attributes':['id',_0x79fd2f],'where':{'id':_0x16ca70[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x51da11,null))[_0xd64c('0x2e')](function(_0x184d2d){if(_0x184d2d){var _0x57ea35=_0x184d2d[_0x79fd2f];var _0x56dbf0=_0x57ea35&&_0x57ea35['items']?_0x57ea35['items']:[];_0x51da11['send']({'fromKey':_[_0xd64c('0x75')](_0x57ea35['fromKey'])?undefined:_0x57ea35[_0xd64c('0x11f')],'count':_0x56dbf0[_0xd64c('0x45')],'rows':_0x56dbf0});}})[_0xd64c('0x25')](handleError(_0x51da11,null));};exports['getOfflineMessages']=function(_0x2292af,_0x46b00a,_0x5d524f){var _0x289f39={'raw':![],'where':{}};var _0x43ab37={};var _0x432b26={'count':0x0,'rows':[]};return db[_0xd64c('0x3a')]['findOne']({'where':{'id':_0x2292af['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x46b00a,null))[_0xd64c('0x2e')](function(_0x39e2a2){if(_0x39e2a2){_0x43ab37[_0xd64c('0x3e')]=_[_0xd64c('0x40')](db['ChatOfflineMessage'][_0xd64c('0x3b')]);_0x43ab37[_0xd64c('0x3f')]=_['keys'](_0x2292af[_0xd64c('0x3f')]);_0x43ab37[_0xd64c('0x41')]=_['intersection'](_0x43ab37[_0xd64c('0x3e')],_0x43ab37[_0xd64c('0x3f')]);_0x289f39[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x43ab37[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x2292af['query'][_0xd64c('0x44')]));_0x289f39['attributes']=_0x289f39[_0xd64c('0x43')]['length']?_0x289f39[_0xd64c('0x43')]:_0x43ab37[_0xd64c('0x3e')];if(!_0x2292af[_0xd64c('0x3f')][_0xd64c('0x46')](_0xd64c('0x47'))){_0x289f39[_0xd64c('0x2b')]=qs[_0xd64c('0x2b')](_0x2292af['query'][_0xd64c('0x2b')]);_0x289f39[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x2292af[_0xd64c('0x3f')][_0xd64c('0x29')]);}_0x289f39[_0xd64c('0x62')]=qs[_0xd64c('0x48')](_0x2292af[_0xd64c('0x3f')]['sort']);_0x289f39[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x2292af[_0xd64c('0x3f')],_0x43ab37[_0xd64c('0x41')]));_0x289f39[_0xd64c('0x49')][_0xd64c('0x5e')]=_0x39e2a2['id'];if(_0x2292af[_0xd64c('0x3f')][_0xd64c('0x4b')]){_0x289f39[_0xd64c('0x49')]=_[_0xd64c('0x52')](_0x289f39['where'],{'$or':_[_0xd64c('0x39')](_0x289f39['attributes'],function(_0x421cd9){var _0x530f6c={};_0x530f6c[_0x421cd9]={'$like':'%'+_0x2292af[_0xd64c('0x3f')]['filter']+'%'};return _0x530f6c;})});}_0x289f39=_[_0xd64c('0x52')]({},_0x289f39,_0x2292af[_0xd64c('0x4d')]);return db[_0xd64c('0xd5')][_0xd64c('0x2c')]({'where':_0x289f39['where']})[_0xd64c('0x2e')](function(_0x2ed3f2){_0x432b26[_0xd64c('0x2c')]=_0x2ed3f2;if(_0x2292af[_0xd64c('0x3f')][_0xd64c('0x4e')]){_0x289f39['include']=[{'all':!![]}];}else{_0x289f39[_0xd64c('0x4f')]=[{'model':db[_0xd64c('0x84')],'as':_0xd64c('0xf8'),'required':![]},{'model':db[_0xd64c('0xdc')],'as':'Attachments','required':![]}];}return db[_0xd64c('0xd5')][_0xd64c('0x63')](_0x289f39);})['then'](function(_0x386cd0){_0x432b26['rows']=_0x386cd0;return _0x432b26;});}})[_0xd64c('0x2e')](respondWithFilteredResult(_0x46b00a,_0x289f39))[_0xd64c('0x25')](handleError(_0x46b00a,null));};exports[_0xd64c('0x120')]=function(_0x4aebf7,_0x2e058e,_0x51a048){return db[_0xd64c('0x3a')][_0xd64c('0x53')]({'where':{'id':_0x4aebf7[_0xd64c('0x51')]['id']}})['then'](handleEntityNotFound(_0x2e058e,null))['then'](function(_0x1879f9){if(_0x1879f9){return _0x1879f9[_0xd64c('0x120')](_0x4aebf7[_0xd64c('0x55')]['ids'],_[_0xd64c('0xf6')](_0x4aebf7[_0xd64c('0x55')],[_0xd64c('0x65'),'id'])||{})[_0xd64c('0xb5')](function(_0x1cd860){for(var _0x2a0ea9=0x0;_0x2a0ea9<_0x4aebf7[_0xd64c('0x55')][_0xd64c('0x65')][_0xd64c('0x45')];_0x2a0ea9+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x4aebf7[_0xd64c('0x55')][_0xd64c('0x65')][_0x2a0ea9]),'ChatWebsiteId':Number(_0x4aebf7[_0xd64c('0x51')]['id'])});}return _0x1cd860;});}})[_0xd64c('0x2e')](respondWithResult(_0x2e058e,null))[_0xd64c('0x25')](handleError(_0x2e058e,null));};exports[_0xd64c('0x121')]=function(_0xa4800d,_0x4c0372,_0x8f8652){return db['ChatWebsite'][_0xd64c('0x53')]({'where':{'id':_0xa4800d[_0xd64c('0x51')]['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x4c0372,null))[_0xd64c('0x2e')](function(_0x4a9930){if(_0x4a9930){return _0x4a9930[_0xd64c('0x121')](_0xa4800d[_0xd64c('0x3f')][_0xd64c('0x65')])[_0xd64c('0x2e')](function(){if(_[_0xd64c('0x122')](_0xa4800d['query']['ids'])){for(var _0x48c04d=0x0;_0x48c04d<_0xa4800d['query'][_0xd64c('0x65')][_0xd64c('0x45')];_0x48c04d+=0x1){socket[_0xd64c('0x123')]('userChatWebsite:remove',{'UserId':Number(_0xa4800d[_0xd64c('0x3f')][_0xd64c('0x65')][_0x48c04d]),'ChatWebsiteId':Number(_0xa4800d[_0xd64c('0x51')]['id'])});}}else{socket[_0xd64c('0x123')](_0xd64c('0x124'),{'UserId':Number(_0xa4800d['query'][_0xd64c('0x65')]),'ChatWebsiteId':Number(_0xa4800d[_0xd64c('0x51')]['id'])});}});}})[_0xd64c('0x2e')](respondWithStatusCode(_0x4c0372,null))[_0xd64c('0x25')](handleError(_0x4c0372,null));};exports[_0xd64c('0x125')]=function(_0x440c1a,_0x13590e,_0x1f6ec8){var _0x4a3e1c={};var _0x103175={};var _0x5c9173;var _0x5d3007;return db[_0xd64c('0x3a')]['findOne']({'where':{'id':_0x440c1a['params']['id']}})[_0xd64c('0x2e')](handleEntityNotFound(_0x13590e,null))[_0xd64c('0x2e')](function(_0x3340ef){if(_0x3340ef){_0x5c9173=_0x3340ef;_0x103175['model']=_[_0xd64c('0x40')](db[_0xd64c('0x126')][_0xd64c('0x3b')]);_0x103175[_0xd64c('0x3f')]=_[_0xd64c('0x40')](_0x440c1a['query']);_0x103175[_0xd64c('0x41')]=_[_0xd64c('0x42')](_0x103175['model'],_0x103175[_0xd64c('0x3f')]);_0x4a3e1c[_0xd64c('0x43')]=_[_0xd64c('0x42')](_0x103175[_0xd64c('0x3e')],qs[_0xd64c('0x44')](_0x440c1a[_0xd64c('0x3f')][_0xd64c('0x44')]));_0x4a3e1c[_0xd64c('0x43')]=_0x4a3e1c[_0xd64c('0x43')][_0xd64c('0x45')]?_0x4a3e1c[_0xd64c('0x43')]:_0x103175[_0xd64c('0x3e')];_0x4a3e1c[_0xd64c('0x62')]=qs[_0xd64c('0x48')](_0x440c1a[_0xd64c('0x3f')]['sort']);_0x4a3e1c[_0xd64c('0x49')]=qs[_0xd64c('0x41')](_[_0xd64c('0x4a')](_0x440c1a[_0xd64c('0x3f')],_0x103175[_0xd64c('0x41')]));if(_0x440c1a['query'][_0xd64c('0x4b')]){_0x4a3e1c[_0xd64c('0x49')]=_['merge'](_0x4a3e1c[_0xd64c('0x49')],{'$or':_['map'](_0x4a3e1c[_0xd64c('0x43')],function(_0x296c0c){var _0x880a58={};_0x880a58[_0x296c0c]={'$like':'%'+_0x440c1a[_0xd64c('0x3f')][_0xd64c('0x4b')]+'%'};return _0x880a58;})});}_0x4a3e1c=_[_0xd64c('0x52')]({},_0x4a3e1c,_0x440c1a[_0xd64c('0x4d')]);return _0x5c9173['getAgents'](_0x4a3e1c);}})[_0xd64c('0x2e')](function(_0x4f9666){if(_0x4f9666){_0x5d3007=_0x4f9666[_0xd64c('0x45')];if(!_0x440c1a['query'][_0xd64c('0x46')](_0xd64c('0x47'))){_0x4a3e1c['limit']=qs[_0xd64c('0x2b')](_0x440c1a['query'][_0xd64c('0x2b')]);_0x4a3e1c[_0xd64c('0x29')]=qs[_0xd64c('0x29')](_0x440c1a[_0xd64c('0x3f')][_0xd64c('0x29')]);}return _0x5c9173[_0xd64c('0x125')](_0x4a3e1c);}})[_0xd64c('0x2e')](function(_0x49d8a2){if(_0x49d8a2){return _0x49d8a2?{'count':_0x5d3007,'rows':_0x49d8a2}:null;}})[_0xd64c('0x2e')](respondWithResult(_0x13590e,null))[_0xd64c('0x25')](handleError(_0x13590e,null));};
\ No newline at end of file
+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
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index a90428c..ff70d15 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 _0xc7b4=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x326863,_0x48bc96){var _0x3cc1e9=function(_0x54cd54){while(--_0x54cd54){_0x326863['push'](_0x326863['shift']());}};_0x3cc1e9(++_0x48bc96);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4c7b('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x4c7b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x4c7b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4c7b('0x3'),'afterDestroy':_0x4c7b('0x4')};function emitEvent(_0x279c21){return function(_0x2a8b1d,_0x109687,_0x5a20ca){ChatWebsiteEvents[_0x4c7b('0x5')](_0x279c21+':'+_0x2a8b1d['id'],_0x2a8b1d);ChatWebsiteEvents[_0x4c7b('0x5')](_0x279c21,_0x2a8b1d);_0x5a20ca(null);};}for(var e in events){if(events[_0x4c7b('0x6')](e)){var event=events[e];ChatWebsite[_0x4c7b('0x7')](e,emitEvent(event));}}module[_0x4c7b('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+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
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index afa2562..1ab5f6d 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 _0x7a92=['chat_websites','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x2f62a5,_0x43985d){var _0x32f3a7=function(_0x487d0b){while(--_0x487d0b){_0x2f62a5['push'](_0x2f62a5['shift']());}};_0x32f3a7(++_0x43985d);}(_0x7a92,0x1e5));var _0x27a9=function(_0x3149da,_0x49d0a3){_0x3149da=_0x3149da-0x0;var _0x180dc3=_0x7a92[_0x3149da];return _0x180dc3;};'use strict';var _=require('lodash');var util=require(_0x27a9('0x0'));var logger=require(_0x27a9('0x1'))('api');var moment=require(_0x27a9('0x2'));var BPromise=require(_0x27a9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x27a9('0x4'));var config=require(_0x27a9('0x5'));var attributes=require(_0x27a9('0x6'));module[_0x27a9('0x7')]=function(_0x1845c4,_0x2083ef){return _0x1845c4[_0x27a9('0x8')](_0x27a9('0x9'),attributes,{'tableName':_0x27a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index b5d997b..b831990 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 _0x1017=['request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','./chatWebsite.socket'];(function(_0x384a44,_0xdc4c20){var _0x314396=function(_0x5dba0c){while(--_0x5dba0c){_0x384a44['push'](_0x384a44['shift']());}};_0x314396(++_0xdc4c20);}(_0x1017,0x1d8));var _0x7101=function(_0x74069a,_0x4f93ee){_0x74069a=_0x74069a-0x0;var _0x2bdc85=_0x1017[_0x74069a];return _0x2bdc85;};'use strict';var _=require(_0x7101('0x0'));var util=require(_0x7101('0x1'));var moment=require('moment');var BPromise=require(_0x7101('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7101('0x3'))['db'];var utils=require(_0x7101('0x4'));var logger=require('../../config/logger')(_0x7101('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7101('0x6')]({'port':0x232a});config[_0x7101('0x7')]=_[_0x7101('0x8')](config[_0x7101('0x7')],{'host':_0x7101('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7101('0xa'))['register'](socket);function respondWithRpcPromise(_0x29abf7,_0x5b3d55,_0x296a9d){return new BPromise(function(_0x486c9e,_0x569952){return client[_0x7101('0xb')](_0x29abf7,_0x296a9d)[_0x7101('0xc')](function(_0xa90941){logger[_0x7101('0xd')](_0x7101('0xe'),_0x5b3d55,'request\x20sent');logger[_0x7101('0xf')](_0x7101('0x10'),_0x5b3d55,_0x7101('0x11'),JSON[_0x7101('0x12')](_0xa90941));if(_0xa90941[_0x7101('0x13')]){if(_0xa90941[_0x7101('0x13')][_0x7101('0x14')]===0x1f4){logger[_0x7101('0x13')](_0x7101('0xe'),_0x5b3d55,_0xa90941[_0x7101('0x13')][_0x7101('0x15')]);return _0x569952(_0xa90941[_0x7101('0x13')][_0x7101('0x15')]);}logger[_0x7101('0x13')](_0x7101('0xe'),_0x5b3d55,_0xa90941['error']['message']);return _0x486c9e(_0xa90941[_0x7101('0x13')][_0x7101('0x15')]);}else{logger[_0x7101('0xd')](_0x7101('0xe'),_0x5b3d55,_0x7101('0x11'));_0x486c9e(_0xa90941['result'][_0x7101('0x15')]);}})[_0x7101('0x16')](function(_0xd5be9b){logger[_0x7101('0x13')](_0x7101('0xe'),_0x5b3d55,_0xd5be9b);_0x569952(_0xd5be9b);});});}
\ No newline at end of file
+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
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 063aea5..f890c3d 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 _0xaddb=['length','chatWebsite:','save','update','emit','removeListener','register'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xaddb,0xc6));var _0xbadd=function(_0x3820b5,_0x504325){_0x3820b5=_0x3820b5-0x0;var _0xb749d2=_0xaddb[_0x3820b5];return _0xb749d2;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xbadd('0x0'),'remove',_0xbadd('0x1')];function createListener(_0x250cd4,_0x34b7f2){return function(_0x6092b6){_0x34b7f2[_0xbadd('0x2')](_0x250cd4,_0x6092b6);};}function removeListener(_0x2edee6,_0x98f5d5){return function(){ChatWebsiteEvents[_0xbadd('0x3')](_0x2edee6,_0x98f5d5);};}exports[_0xbadd('0x4')]=function(_0x2a8b4d){for(var _0x1d26a0=0x0,_0xe1eb9f=events[_0xbadd('0x5')];_0x1d26a0<_0xe1eb9f;_0x1d26a0++){var _0x14fcbf=events[_0x1d26a0];var _0x27f06a=createListener(_0xbadd('0x6')+_0x14fcbf,_0x2a8b4d);ChatWebsiteEvents['on'](_0x14fcbf,_0x27f06a);}};
\ No newline at end of file
+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
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index b4f7245..933c060 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 _0xb071=['getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','join','root','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions'];(function(_0x53df25,_0x2a7f81){var _0x434a1b=function(_0x398750){while(--_0x398750){_0x53df25['push'](_0x53df25['shift']());}};_0x434a1b(++_0x2a7f81);}(_0xb071,0xb9));var _0x1b07=function(_0x2881e2,_0x341293){_0x2881e2=_0x2881e2-0x0;var _0x5c1e1f=_0xb071[_0x2881e2];return _0x5c1e1f;};'use strict';var multer=require(_0x1b07('0x0'));var util=require(_0x1b07('0x1'));var path=require(_0x1b07('0x2'));var timeout=require(_0x1b07('0x3'));var express=require(_0x1b07('0x4'));var router=express[_0x1b07('0x5')]();var fs_extra=require(_0x1b07('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1b07('0x7'));var controller=require(_0x1b07('0x8'));router['get']('/',auth[_0x1b07('0x9')](),controller[_0x1b07('0xa')]);router[_0x1b07('0xb')](_0x1b07('0xc'),auth[_0x1b07('0x9')](),controller[_0x1b07('0xd')]);router[_0x1b07('0xb')](_0x1b07('0xe'),auth[_0x1b07('0x9')](),controller[_0x1b07('0xf')]);router[_0x1b07('0xb')](_0x1b07('0x10'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x11')]);router[_0x1b07('0xb')](_0x1b07('0x12'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x13')]);router[_0x1b07('0xb')](_0x1b07('0x14'),controller[_0x1b07('0x15')]);router[_0x1b07('0xb')]('/:id/avatar',controller[_0x1b07('0x16')]);router[_0x1b07('0xb')](_0x1b07('0x17'),controller[_0x1b07('0x18')]);router[_0x1b07('0xb')](_0x1b07('0x19'),controller[_0x1b07('0x1a')]);router[_0x1b07('0xb')](_0x1b07('0x1b'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x1c')]);router['get']('/:id/snippet',controller[_0x1b07('0x1d')]);router[_0x1b07('0xb')](_0x1b07('0x1e'),auth['isAuthenticated'](),controller[_0x1b07('0x1f')]);router['get'](_0x1b07('0x20'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x21')]);router[_0x1b07('0xb')]('/:id/fields',controller[_0x1b07('0x22')]);router[_0x1b07('0xb')]('/:id/offline_messages',auth[_0x1b07('0x9')](),controller[_0x1b07('0x23')]);router[_0x1b07('0xb')](_0x1b07('0x24'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x25')]);router[_0x1b07('0x26')]('/',auth[_0x1b07('0x9')](),controller[_0x1b07('0x27')]);router['post'](_0x1b07('0x10'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x28')]);router[_0x1b07('0x26')](_0x1b07('0x12'),auth[_0x1b07('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x7d0d04,_0x11915b,_0x2e61d5){_0x2e61d5(null,path[_0x1b07('0x29')](config[_0x1b07('0x2a')],'server/files/images/logos/'));},'filename':function(_0x422715,_0x28da9e,_0xf87018){_0xf87018(null,util[_0x1b07('0x2b')](_0x1b07('0x2c'),Date[_0x1b07('0x2d')](),_0x28da9e[_0x1b07('0x2e')]));}})});router[_0x1b07('0x26')](_0x1b07('0x14'),upload[_0x1b07('0x2f')](_0x1b07('0x30')),controller[_0x1b07('0x31')]);var upload=multer({'storage':multer[_0x1b07('0x32')]({'destination':function(_0x4dff8a,_0x4dbc33,_0x1f5e62){_0x1f5e62(null,path[_0x1b07('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x5cc4f1,_0x121ae1,_0xceb55a){_0xceb55a(null,util[_0x1b07('0x2b')](_0x1b07('0x2c'),Date['now'](),_0x121ae1['originalname']));}})});router[_0x1b07('0x26')]('/:id/avatar',upload[_0x1b07('0x2f')](_0x1b07('0x30')),controller[_0x1b07('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3c461c,_0x101fd1,_0x89254f){_0x89254f(null,path[_0x1b07('0x29')](config[_0x1b07('0x2a')],_0x1b07('0x34')));},'filename':function(_0x1319ef,_0x123d6b,_0x4a9510){_0x4a9510(null,util[_0x1b07('0x2b')](_0x1b07('0x2c'),Date[_0x1b07('0x2d')](),_0x123d6b[_0x1b07('0x2e')]));}})});router['post'](_0x1b07('0x17'),upload[_0x1b07('0x2f')](_0x1b07('0x30')),controller[_0x1b07('0x35')]);var upload=multer({'storage':multer[_0x1b07('0x32')]({'destination':function(_0x26ea11,_0xe47d4d,_0x102a0){_0x102a0(null,path[_0x1b07('0x29')](config[_0x1b07('0x2a')],_0x1b07('0x34')));},'filename':function(_0x19bc0d,_0x314c71,_0x124614){_0x124614(null,util[_0x1b07('0x2b')](_0x1b07('0x2c'),Date[_0x1b07('0x2d')](),_0x314c71['originalname']));}})});router[_0x1b07('0x26')](_0x1b07('0x19'),upload['single'](_0x1b07('0x30')),controller[_0x1b07('0x36')]);router[_0x1b07('0x26')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x40c83f,_0xed8481,_0x50507d){const _0x5cde78=path[_0x1b07('0x29')](config[_0x1b07('0x2a')],_0x1b07('0x37'),'attachments',_0x1b07('0x38'));fs_extra[_0x1b07('0x39')](_0x5cde78,function(){_0x50507d(null,_0x5cde78);});},'filename':function(_0x3e8fa3,_0x13ee3b,_0x47efd1){const _0x26d7c3=_0x13ee3b[_0x1b07('0x2e')][_0x1b07('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x307560=path[_0x1b07('0x3b')](_0x26d7c3);const _0x560697=Date[_0x1b07('0x2d')]()+'-'+_0x26d7c3[_0x1b07('0x3a')](_0x307560,'')+_0x307560;_0x47efd1(null,_0x560697);}})});router[_0x1b07('0x26')](_0x1b07('0x3c'),offlineUploadMulter['any'](),controller[_0x1b07('0x3d')]);router[_0x1b07('0x26')]('/:id/interactions',auth[_0x1b07('0x9')](),controller[_0x1b07('0x3e')]);router[_0x1b07('0x26')](_0x1b07('0x1e'),auth[_0x1b07('0x9')](),controller['addApplications']);router[_0x1b07('0x26')](_0x1b07('0x20'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x3f')]);router[_0x1b07('0x26')]('/:id/users',auth[_0x1b07('0x9')](),controller[_0x1b07('0x40')]);router[_0x1b07('0x41')](_0x1b07('0xe'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x42')]);router[_0x1b07('0x43')]('/:id',auth[_0x1b07('0x9')](),controller['destroy']);router[_0x1b07('0x43')](_0x1b07('0x10'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x44')]);router[_0x1b07('0x43')](_0x1b07('0x12'),auth[_0x1b07('0x9')](),controller[_0x1b07('0x45')]);router[_0x1b07('0x43')](_0x1b07('0x24'),auth['isAuthenticated'](),controller[_0x1b07('0x46')]);module['exports']=router;
\ No newline at end of file
+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
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 54d4ef1..a5d0995 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 _0x8ace=['sequelize','exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x37e498,_0x2df21a){var _0x1ab2e4=function(_0x5f142b){while(--_0x5f142b){_0x37e498['push'](_0x37e498['shift']());}};_0x1ab2e4(++_0x2df21a);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x327c12,_0x2874c9){_0x327c12=_0x327c12-0x0;var _0x4cd602=_0x8ace[_0x327c12];return _0x4cd602;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'name':{'type':Sequelize[_0xe8ac('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe8ac('0x3')](_0xe8ac('0x4'),_0xe8ac('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xe8ac('0x2')]},'data2':{'type':Sequelize[_0xe8ac('0x2')]}};
\ No newline at end of file
+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
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e1fe9ec..c4960d8 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x47ad9a,_0x300d49){var _0x24b4b1=function(_0x4ef3f8){while(--_0x4ef3f8){_0x47ad9a['push'](_0x47ad9a['shift']());}};_0x24b4b1(++_0x300d49);}(_0x2ef3,0xba));var _0x32ef=function(_0x5ad1c6,_0x1dfc41){_0x5ad1c6=_0x5ad1c6-0x0;var _0x1fdb68=_0x2ef3[_0x5ad1c6];return _0x1fdb68;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
+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
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 0aef948..e921ed7 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 _0xd037=['CloudProvider','cloud_providers','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x6f929,_0x1ee1bd){var _0x2402f1=function(_0x895feb){while(--_0x895feb){_0x6f929['push'](_0x6f929['shift']());}};_0x2402f1(++_0x1ee1bd);}(_0xd037,0xb6));var _0x7d03=function(_0x10553b,_0x40493a){_0x10553b=_0x10553b-0x0;var _0x2a4d03=_0xd037[_0x10553b];return _0x2a4d03;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7d03('0x0'))('api');var moment=require(_0x7d03('0x1'));var BPromise=require(_0x7d03('0x2'));var rp=require(_0x7d03('0x3'));var fs=require('fs');var path=require(_0x7d03('0x4'));var rimraf=require(_0x7d03('0x5'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x7d03('0x6')]=function(_0xd71fc,_0x431e54){return _0xd71fc[_0x7d03('0x7')](_0x7d03('0x8'),attributes,{'tableName':_0x7d03('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 2c38b33..269084e 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 _0x4329=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x10be58,_0x41cdad){var _0x14deb3=function(_0x2a5121){while(--_0x2a5121){_0x10be58['push'](_0x10be58['shift']());}};_0x14deb3(++_0x41cdad);}(_0x4329,0x13b));var _0x9432=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x4329[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x9432('0x0'));var util=require(_0x9432('0x1'));var moment=require(_0x9432('0x2'));var BPromise=require(_0x9432('0x3'));var rs=require(_0x9432('0x4'));var fs=require('fs');var Redis=require(_0x9432('0x5'));var db=require(_0x9432('0x6'))['db'];var utils=require(_0x9432('0x7'));var logger=require(_0x9432('0x8'))(_0x9432('0x9'));var config=require(_0x9432('0xa'));var jayson=require(_0x9432('0xb'));var client=jayson[_0x9432('0xc')][_0x9432('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5568ad,_0x376967,_0x5346c3){return new BPromise(function(_0x10509f,_0x4563c4){return client['request'](_0x5568ad,_0x5346c3)[_0x9432('0xe')](function(_0x2b06c7){logger[_0x9432('0xf')](_0x9432('0x10'),_0x376967,_0x9432('0x11'));logger['debug'](_0x9432('0x12'),_0x376967,_0x9432('0x11'),JSON['stringify'](_0x2b06c7));if(_0x2b06c7['error']){if(_0x2b06c7[_0x9432('0x13')][_0x9432('0x14')]===0x1f4){logger[_0x9432('0x13')](_0x9432('0x10'),_0x376967,_0x2b06c7['error'][_0x9432('0x15')]);return _0x4563c4(_0x2b06c7[_0x9432('0x13')][_0x9432('0x15')]);}logger[_0x9432('0x13')](_0x9432('0x10'),_0x376967,_0x2b06c7['error'][_0x9432('0x15')]);return _0x10509f(_0x2b06c7[_0x9432('0x13')]['message']);}else{logger[_0x9432('0xf')](_0x9432('0x10'),_0x376967,'request\x20sent');_0x10509f(_0x2b06c7[_0x9432('0x16')][_0x9432('0x15')]);}})['catch'](function(_0x5c4360){logger['error']('CloudProvider,\x20%s,\x20%s',_0x376967,_0x5c4360);_0x4563c4(_0x5c4360);});});}
\ No newline at end of file
+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
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index a8b5674..6a1ee33 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 _0x0a1c=['show','post','create','put','delete','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id'];(function(_0x2519d0,_0x305dd4){var _0x5656e3=function(_0x5c317a){while(--_0x5c317a){_0x2519d0['push'](_0x2519d0['shift']());}};_0x5656e3(++_0x305dd4);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x0a1c[_0x445101];return _0x3c3d04;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc0a1('0x0'));var timeout=require(_0xc0a1('0x1'));var express=require(_0xc0a1('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc0a1('0x3'));var interaction=require(_0xc0a1('0x4'));var config=require(_0xc0a1('0x5'));var controller=require(_0xc0a1('0x6'));router[_0xc0a1('0x7')]('/',auth[_0xc0a1('0x8')](),controller[_0xc0a1('0x9')]);router[_0xc0a1('0x7')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller[_0xc0a1('0xb')]);router[_0xc0a1('0xc')]('/',auth[_0xc0a1('0x8')](),controller[_0xc0a1('0xd')]);router[_0xc0a1('0xe')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller['update']);router[_0xc0a1('0xf')](_0xc0a1('0xa'),auth[_0xc0a1('0x8')](),controller['destroy']);module[_0xc0a1('0x10')]=router;
\ No newline at end of file
+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
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 3f81763..161ee49 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 _0xe033=['STRING','exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xe033,0x8b));var _0x3e03=function(_0x1f61a3,_0x524e29){_0x1f61a3=_0x1f61a3-0x0;var _0x5c5818=_0xe033[_0x1f61a3];return _0x5c5818;};'use strict';var Sequelize=require('sequelize');module[_0x3e03('0x0')]={'name':{'type':Sequelize[_0x3e03('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3e03('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3e03('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3e03('0x1')]},'sPostalCode':{'type':Sequelize[_0x3e03('0x1')]},'sCity':{'type':Sequelize[_0x3e03('0x1')]},'sCountry':{'type':Sequelize[_0x3e03('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+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
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index c8a059b..5555f6b 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 _0x3c0d=['to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','destroy','get','UserProfileResource','then','error','stack','name','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','nolimit','sort','filters','filter','merge','where','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','order','pick','getContacts','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0xd26750,_0x2c1103){var _0x3e310b=function(_0x28ae2b){while(--_0x28ae2b){_0xd26750['push'](_0xd26750['shift']());}};_0x3e310b(++_0x2c1103);}(_0x3c0d,0x149));var _0xd3c0=function(_0x220b7e,_0x2eed81){_0x220b7e=_0x220b7e-0x0;var _0x4ac073=_0x3c0d[_0x220b7e];return _0x4ac073;};'use strict';var emlformat=require(_0xd3c0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3c0('0x1'));var jsonpatch=require(_0xd3c0('0x2'));var rp=require(_0xd3c0('0x3'));var moment=require('moment');var BPromise=require(_0xd3c0('0x4'));var Mustache=require(_0xd3c0('0x5'));var util=require(_0xd3c0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd3c0('0x7'));var ejs=require(_0xd3c0('0x8'));var fs=require('fs');var fs_extra=require(_0xd3c0('0x9'));var _=require('lodash');var squel=require(_0xd3c0('0xa'));var crypto=require(_0xd3c0('0xb'));var jsforce=require(_0xd3c0('0xc'));var deskjs=require(_0xd3c0('0xd'));var toCsv=require(_0xd3c0('0x7'));var querystring=require(_0xd3c0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd3c0('0xf'));var qs=require(_0xd3c0('0x10'));var as=require(_0xd3c0('0x11'));var hardwareService=require(_0xd3c0('0x12'));var logger=require('../../config/logger')(_0xd3c0('0x13'));var utils=require('../../config/utils');var config=require(_0xd3c0('0x14'));var licenseUtil=require(_0xd3c0('0x15'));var db=require(_0xd3c0('0x16'))['db'];function respondWithStatusCode(_0x52043f,_0x286379){_0x286379=_0x286379||0xcc;return function(_0x3df5c8){if(_0x3df5c8){return _0x52043f[_0xd3c0('0x17')](_0x286379);}return _0x52043f[_0xd3c0('0x18')](_0x286379)[_0xd3c0('0x19')]();};}function respondWithResult(_0x274b98,_0x1a6e53){_0x1a6e53=_0x1a6e53||0xc8;return function(_0xd2bf53){if(_0xd2bf53){return _0x274b98[_0xd3c0('0x18')](_0x1a6e53)[_0xd3c0('0x1a')](_0xd2bf53);}};}function respondWithFilteredResult(_0x458dc4,_0x49f6ab){return function(_0x451235){if(_0x451235){var _0x4fa7d4=typeof _0x49f6ab['offset']===_0xd3c0('0x1b')&&typeof _0x49f6ab[_0xd3c0('0x1c')]===_0xd3c0('0x1b');var _0x567efe=_0x451235[_0xd3c0('0x1d')];var _0x5b09a0=_0x4fa7d4?0x0:_0x49f6ab[_0xd3c0('0x1e')];var _0x3fd7c9=_0x4fa7d4?_0x451235[_0xd3c0('0x1d')]:_0x49f6ab['offset']+_0x49f6ab[_0xd3c0('0x1c')];var _0x486142;if(_0x3fd7c9>=_0x567efe){_0x3fd7c9=_0x567efe;_0x486142=0xc8;}else{_0x486142=0xce;}_0x458dc4['status'](_0x486142);return _0x458dc4[_0xd3c0('0x1f')]('Content-Range',_0x5b09a0+'-'+_0x3fd7c9+'/'+_0x567efe)['json'](_0x451235);}return null;};}function patchUpdates(_0x219592){return function(_0x4d74b8){try{jsonpatch[_0xd3c0('0x20')](_0x4d74b8,_0x219592,!![]);}catch(_0x54a11d){return BPromise[_0xd3c0('0x21')](_0x54a11d);}return _0x4d74b8[_0xd3c0('0x22')]();};}function saveUpdates(_0x3264bd,_0x89c3c2){return function(_0x526b00){if(_0x526b00){return _0x526b00['update'](_0x3264bd)['then'](function(_0x4546fd){return _0x4546fd;});}return null;};}function removeEntity(_0x45b12f,_0x3246da){return function(_0x4653b3){if(_0x4653b3){return _0x4653b3[_0xd3c0('0x23')]()['then'](function(){var _0x4ea830=_0x4653b3[_0xd3c0('0x24')]({'plain':!![]});var _0xa1136e='Companies';return db[_0xd3c0('0x25')][_0xd3c0('0x23')]({'where':{'type':_0xa1136e,'resourceId':_0x4ea830['id']}})[_0xd3c0('0x26')](function(){return _0x4653b3;});})[_0xd3c0('0x26')](function(){_0x45b12f[_0xd3c0('0x18')](0xcc)[_0xd3c0('0x19')]();});}};}function handleEntityNotFound(_0x515f0a,_0x2fb3e8){return function(_0x484f5a){if(!_0x484f5a){_0x515f0a[_0xd3c0('0x17')](0x194);}return _0x484f5a;};}function handleError(_0x185370,_0x4031e6){_0x4031e6=_0x4031e6||0x1f4;return function(_0x525c72){logger[_0xd3c0('0x27')](_0x525c72[_0xd3c0('0x28')]);if(_0x525c72[_0xd3c0('0x29')]){delete _0x525c72[_0xd3c0('0x29')];}_0x185370[_0xd3c0('0x18')](_0x4031e6)['send'](_0x525c72);};}exports[_0xd3c0('0x2a')]=function(_0x2b92ca,_0x3dbbc1){var _0x4e1117={},_0x124228={},_0xeaf45d={'count':0x0,'rows':[]};return db[_0xd3c0('0x2b')][_0xd3c0('0x2c')]()[_0xd3c0('0x26')](function(_0x5500ca){_0x124228[_0xd3c0('0x2d')]=_[_0xd3c0('0x2e')](_0x5500ca);_0x124228[_0xd3c0('0x2f')]=_[_0xd3c0('0x2e')](_0x2b92ca[_0xd3c0('0x2f')]);_0x124228['filters']=_[_0xd3c0('0x30')](_0x124228[_0xd3c0('0x2d')],_0x124228[_0xd3c0('0x2f')]);_0x4e1117[_0xd3c0('0x31')]=_[_0xd3c0('0x30')](_0x124228[_0xd3c0('0x2d')],qs[_0xd3c0('0x32')](_0x2b92ca[_0xd3c0('0x2f')][_0xd3c0('0x32')]));_0x4e1117[_0xd3c0('0x31')]=_0x4e1117['attributes'][_0xd3c0('0x33')]?_0x4e1117[_0xd3c0('0x31')]:_0x124228[_0xd3c0('0x2d')];if(!_0x2b92ca[_0xd3c0('0x2f')]['hasOwnProperty'](_0xd3c0('0x34'))){_0x4e1117['limit']=qs['limit'](_0x2b92ca[_0xd3c0('0x2f')][_0xd3c0('0x1c')]);_0x4e1117[_0xd3c0('0x1e')]=qs['offset'](_0x2b92ca[_0xd3c0('0x2f')][_0xd3c0('0x1e')]);}_0x4e1117['order']=qs[_0xd3c0('0x35')](_0x2b92ca['query'][_0xd3c0('0x35')]);_0x4e1117['where']=qs[_0xd3c0('0x36')](_['pick'](_0x2b92ca[_0xd3c0('0x2f')],_0x124228[_0xd3c0('0x36')]),_0x5500ca);if(_0x2b92ca[_0xd3c0('0x2f')][_0xd3c0('0x37')]){_0x4e1117['where']=_[_0xd3c0('0x38')](_0x4e1117[_0xd3c0('0x39')],{'$or':_[_0xd3c0('0x3a')](_0x4e1117[_0xd3c0('0x31')],function(_0x129261){var _0x3818cc={};_0x3818cc[_0x129261]={'$like':'%'+_0x2b92ca[_0xd3c0('0x2f')]['filter']+'%'};return _0x3818cc;})});}_0x4e1117=_[_0xd3c0('0x38')]({},_0x4e1117,_0x2b92ca[_0xd3c0('0x3b')]);var _0x4738f2={'where':_0x4e1117[_0xd3c0('0x39')]};return db[_0xd3c0('0x2b')][_0xd3c0('0x1d')](_0x4738f2)[_0xd3c0('0x26')](function(_0x337fba){_0xeaf45d['count']=_0x337fba;if(_0x2b92ca['query'][_0xd3c0('0x3c')]){_0x4e1117[_0xd3c0('0x3d')]=[{'all':!![]}];}return db['CmCompany'][_0xd3c0('0x3e')](_0x4e1117);})[_0xd3c0('0x26')](function(_0x34b251){_0xeaf45d['rows']=_0x34b251;return _0xeaf45d;})[_0xd3c0('0x26')](respondWithFilteredResult(_0x3dbbc1,_0x4e1117))[_0xd3c0('0x3f')](handleError(_0x3dbbc1,null));})['catch'](handleError(_0x3dbbc1,null));};exports[_0xd3c0('0x40')]=function(_0x2f6dc6,_0xc846db){var _0x44af89={'raw':![],'where':{'id':_0x2f6dc6[_0xd3c0('0x41')]['id']}},_0x5a2944={};_0x5a2944[_0xd3c0('0x2d')]=_['keys'](db[_0xd3c0('0x2b')][_0xd3c0('0x42')]);_0x5a2944[_0xd3c0('0x2f')]=_[_0xd3c0('0x2e')](_0x2f6dc6['query']);_0x5a2944[_0xd3c0('0x36')]=_[_0xd3c0('0x30')](_0x5a2944[_0xd3c0('0x2d')],_0x5a2944[_0xd3c0('0x2f')]);_0x44af89[_0xd3c0('0x31')]=_[_0xd3c0('0x30')](_0x5a2944[_0xd3c0('0x2d')],qs[_0xd3c0('0x32')](_0x2f6dc6['query'][_0xd3c0('0x32')]));_0x44af89[_0xd3c0('0x31')]=_0x44af89[_0xd3c0('0x31')][_0xd3c0('0x33')]?_0x44af89[_0xd3c0('0x31')]:_0x5a2944[_0xd3c0('0x2d')];if(_0x2f6dc6[_0xd3c0('0x2f')][_0xd3c0('0x3c')]){_0x44af89[_0xd3c0('0x3d')]=[{'all':!![]}];}_0x44af89=_[_0xd3c0('0x38')]({},_0x44af89,_0x2f6dc6[_0xd3c0('0x3b')]);return db['CmCompany'][_0xd3c0('0x43')](_0x44af89)[_0xd3c0('0x26')](handleEntityNotFound(_0xc846db,null))[_0xd3c0('0x26')](respondWithResult(_0xc846db,null))[_0xd3c0('0x3f')](handleError(_0xc846db,null));};exports[_0xd3c0('0x44')]=function(_0x18b1cd,_0x517494){return db['CmCompany']['create'](_0x18b1cd[_0xd3c0('0x45')],{})[_0xd3c0('0x26')](function(_0x54294b){var _0x287db3=_0x18b1cd[_0xd3c0('0x46')][_0xd3c0('0x24')]({'plain':!![]});if(!_0x287db3)throw new Error(_0xd3c0('0x47'));if(_0x287db3[_0xd3c0('0x48')]==='user'){var _0x4b0440=_0x54294b[_0xd3c0('0x24')]({'plain':!![]});var _0x2c64bd=_0xd3c0('0x49');return db[_0xd3c0('0x4a')][_0xd3c0('0x43')]({'where':{'name':_0x2c64bd,'userProfileId':_0x287db3['userProfileId']},'raw':!![]})[_0xd3c0('0x26')](function(_0x32dec3){if(_0x32dec3&&_0x32dec3[_0xd3c0('0x4b')]===0x0){return db[_0xd3c0('0x25')]['create']({'name':_0x4b0440[_0xd3c0('0x29')],'resourceId':_0x4b0440['id'],'type':_0x32dec3['name'],'sectionId':_0x32dec3['id']},{})[_0xd3c0('0x26')](function(){return _0x54294b;});}else{return _0x54294b;}})[_0xd3c0('0x3f')](function(_0x1d565d){logger[_0xd3c0('0x27')](_0xd3c0('0x4c'),_0x1d565d);throw _0x1d565d;});}return _0x54294b;})[_0xd3c0('0x26')](respondWithResult(_0x517494,0xc9))[_0xd3c0('0x3f')](handleError(_0x517494,null));};exports['update']=function(_0x241bbf,_0x3ea555){if(_0x241bbf['body']['id']){delete _0x241bbf[_0xd3c0('0x45')]['id'];}return db[_0xd3c0('0x2b')][_0xd3c0('0x43')]({'where':{'id':_0x241bbf[_0xd3c0('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ea555,null))['then'](saveUpdates(_0x241bbf[_0xd3c0('0x45')],null))[_0xd3c0('0x26')](respondWithResult(_0x3ea555,null))[_0xd3c0('0x3f')](handleError(_0x3ea555,null));};exports[_0xd3c0('0x23')]=function(_0xd88da4,_0x55e3ae){return db[_0xd3c0('0x2b')][_0xd3c0('0x43')]({'where':{'id':_0xd88da4[_0xd3c0('0x41')]['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0x55e3ae,null))[_0xd3c0('0x26')](removeEntity(_0x55e3ae,null))[_0xd3c0('0x3f')](handleError(_0x55e3ae,null));};exports[_0xd3c0('0x2c')]=function(_0x2c5ef0,_0x3eeb34){return db[_0xd3c0('0x2b')][_0xd3c0('0x2c')]()[_0xd3c0('0x26')](respondWithResult(_0x3eeb34,null))[_0xd3c0('0x3f')](handleError(_0x3eeb34,null));};exports[_0xd3c0('0x4d')]=function(_0xc9088a,_0x5ba47d,_0x50787a){return db[_0xd3c0('0x4e')]['find']({'where':{'id':_0xc9088a[_0xd3c0('0x41')]['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0x5ba47d,null))['then'](function(_0x707f07){if(_0x707f07){return _0x707f07[_0xd3c0('0x4d')](_0xc9088a[_0xd3c0('0x45')][_0xd3c0('0x4f')],_['omit'](_0xc9088a[_0xd3c0('0x45')],[_0xd3c0('0x4f'),'id'])||{});}})[_0xd3c0('0x26')](respondWithResult(_0x5ba47d,null))[_0xd3c0('0x3f')](handleError(_0x5ba47d,null));};exports['getContacts']=function(_0x3fd934,_0x2aaa7d,_0x3d9375){var _0x24cdd4={};var _0x16f027={};var _0x44319d;var _0x187e9b;return db[_0xd3c0('0x2b')]['findOne']({'where':{'id':_0x3fd934['params']['id']}})[_0xd3c0('0x26')](handleEntityNotFound(_0x2aaa7d,null))['then'](function(_0x1dfdd3){if(_0x1dfdd3){_0x44319d=_0x1dfdd3;_0x16f027[_0xd3c0('0x2d')]=_['keys'](db[_0xd3c0('0x4e')]['rawAttributes']);_0x16f027['query']=_[_0xd3c0('0x2e')](_0x3fd934['query']);_0x16f027['filters']=_[_0xd3c0('0x30')](_0x16f027['model'],_0x16f027['query']);_0x24cdd4[_0xd3c0('0x31')]=_['intersection'](_0x16f027[_0xd3c0('0x2d')],qs[_0xd3c0('0x32')](_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x32')]));_0x24cdd4['attributes']=_0x24cdd4['attributes'][_0xd3c0('0x33')]?_0x24cdd4[_0xd3c0('0x31')]:_0x16f027[_0xd3c0('0x2d')];_0x24cdd4[_0xd3c0('0x50')]=qs[_0xd3c0('0x35')](_0x3fd934['query'][_0xd3c0('0x35')]);_0x24cdd4['where']=qs[_0xd3c0('0x36')](_[_0xd3c0('0x51')](_0x3fd934['query'],_0x16f027[_0xd3c0('0x36')]));if(_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x37')]){_0x24cdd4[_0xd3c0('0x39')]=_[_0xd3c0('0x38')](_0x24cdd4[_0xd3c0('0x39')],{'$or':_[_0xd3c0('0x3a')](_0x24cdd4[_0xd3c0('0x31')],function(_0x2f6d79){var _0x3cbf1c={};_0x3cbf1c[_0x2f6d79]={'$like':'%'+_0x3fd934['query'][_0xd3c0('0x37')]+'%'};return _0x3cbf1c;})});}_0x24cdd4=_[_0xd3c0('0x38')]({},_0x24cdd4,_0x3fd934[_0xd3c0('0x3b')]);return _0x44319d[_0xd3c0('0x52')](_0x24cdd4);}})[_0xd3c0('0x26')](function(_0x45d558){if(_0x45d558){_0x187e9b=_0x45d558[_0xd3c0('0x33')];if(!_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x53')]('nolimit')){_0x24cdd4[_0xd3c0('0x1c')]=qs[_0xd3c0('0x1c')](_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x1c')]);_0x24cdd4['offset']=qs[_0xd3c0('0x1e')](_0x3fd934[_0xd3c0('0x2f')][_0xd3c0('0x1e')]);}return _0x44319d[_0xd3c0('0x52')](_0x24cdd4);}})[_0xd3c0('0x26')](function(_0x4136de){if(_0x4136de){return _0x4136de?{'count':_0x187e9b,'rows':_0x4136de}:null;}})['then'](respondWithResult(_0x2aaa7d,null))['catch'](handleError(_0x2aaa7d,null));};
\ No newline at end of file
+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
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index d5782d5..a764a52 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 _0x828f=['../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x237398,_0xc0ef22){var _0x5598de=function(_0x3118fa){while(--_0x3118fa){_0x237398['push'](_0x237398['shift']());}};_0x5598de(++_0xc0ef22);}(_0x828f,0x164));var _0xf828=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x828f[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0xf828('0x0'));var util=require(_0xf828('0x1'));var logger=require('../../config/logger')(_0xf828('0x2'));var moment=require(_0xf828('0x3'));var BPromise=require(_0xf828('0x4'));var rp=require(_0xf828('0x5'));var fs=require('fs');var path=require(_0xf828('0x6'));var rimraf=require(_0xf828('0x7'));var config=require(_0xf828('0x8'));var attributes=require(_0xf828('0x9'));module[_0xf828('0xa')]=function(_0x3c539b,_0x6c62e2){return _0x3c539b[_0xf828('0xb')](_0xf828('0xc'),attributes,{'tableName':_0xf828('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+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
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 263157a..a575b5b 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 _0x95b0=['client','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3579ad,_0x31c43d){var _0x33bcad=function(_0x443171){while(--_0x443171){_0x3579ad['push'](_0x3579ad['shift']());}};_0x33bcad(++_0x31c43d);}(_0x95b0,0xbc));var _0x095b=function(_0x545acc,_0x3d188a){_0x545acc=_0x545acc-0x0;var _0x5b5e30=_0x95b0[_0x545acc];return _0x5b5e30;};'use strict';var _=require(_0x095b('0x0'));var util=require(_0x095b('0x1'));var moment=require(_0x095b('0x2'));var BPromise=require(_0x095b('0x3'));var rs=require(_0x095b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x095b('0x5'))['db'];var utils=require(_0x095b('0x6'));var logger=require(_0x095b('0x7'))(_0x095b('0x8'));var config=require(_0x095b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x095b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f3545,_0x4f130d,_0x155354){return new BPromise(function(_0x2890c1,_0x227bd7){return client[_0x095b('0xb')](_0x2f3545,_0x155354)[_0x095b('0xc')](function(_0xab6b1a){logger['info'](_0x095b('0xd'),_0x4f130d,_0x095b('0xe'));logger[_0x095b('0xf')](_0x095b('0x10'),_0x4f130d,_0x095b('0xe'),JSON['stringify'](_0xab6b1a));if(_0xab6b1a['error']){if(_0xab6b1a[_0x095b('0x11')][_0x095b('0x12')]===0x1f4){logger[_0x095b('0x11')](_0x095b('0xd'),_0x4f130d,_0xab6b1a[_0x095b('0x11')][_0x095b('0x13')]);return _0x227bd7(_0xab6b1a[_0x095b('0x11')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x4f130d,_0xab6b1a[_0x095b('0x11')]['message']);return _0x2890c1(_0xab6b1a[_0x095b('0x11')]['message']);}else{logger[_0x095b('0x14')](_0x095b('0xd'),_0x4f130d,'request\x20sent');_0x2890c1(_0xab6b1a['result']['message']);}})[_0x095b('0x15')](function(_0x44c9d8){logger[_0x095b('0x11')](_0x095b('0xd'),_0x4f130d,_0x44c9d8);_0x227bd7(_0x44c9d8);});});}
\ No newline at end of file
+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
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index f557864..93b5b42 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 _0x0fb4=['update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','post','create','addContacts'];(function(_0x56f56d,_0x366e03){var _0x16d690=function(_0x3e99d5){while(--_0x3e99d5){_0x56f56d['push'](_0x56f56d['shift']());}};_0x16d690(++_0x366e03);}(_0x0fb4,0x17e));var _0x40fb=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x0fb4[_0x3c6ae2];return _0x4edda;};'use strict';var multer=require(_0x40fb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x40fb('0x1'));var express=require(_0x40fb('0x2'));var router=express[_0x40fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x40fb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x40fb('0x5'));var controller=require(_0x40fb('0x6'));router[_0x40fb('0x7')]('/',auth[_0x40fb('0x8')](),controller[_0x40fb('0x9')]);router[_0x40fb('0x7')]('/describe',auth[_0x40fb('0x8')](),controller[_0x40fb('0xa')]);router['get'](_0x40fb('0xb'),auth[_0x40fb('0x8')](),controller[_0x40fb('0xc')]);router['get'](_0x40fb('0xd'),auth[_0x40fb('0x8')](),controller['getContacts']);router[_0x40fb('0xe')]('/',auth[_0x40fb('0x8')](),controller[_0x40fb('0xf')]);router['post']('/:id/contacts',auth[_0x40fb('0x8')](),controller[_0x40fb('0x10')]);router['put'](_0x40fb('0xb'),auth[_0x40fb('0x8')](),controller[_0x40fb('0x11')]);router[_0x40fb('0x12')](_0x40fb('0xb'),auth['isAuthenticated'](),controller[_0x40fb('0x13')]);module[_0x40fb('0x14')]=router;
\ No newline at end of file
+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
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 6a58e0e..5e503d6 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 _0xe3ff=['UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x4b9b90,_0x148e57){var _0x137e8d=function(_0x97a4d4){while(--_0x97a4d4){_0x4b9b90['push'](_0x4b9b90['shift']());}};_0x137e8d(++_0x148e57);}(_0xe3ff,0x142));var _0xfe3f=function(_0x48447c,_0x2cd985){_0x48447c=_0x48447c-0x0;var _0x7a4cfd=_0xe3ff[_0x48447c];return _0x7a4cfd;};'use strict';var _=require(_0xfe3f('0x0'));var Sequelize=require(_0xfe3f('0x1'));module[_0xfe3f('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xfe3f('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xfe3f('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xfe3f('0x3')]},'dateOfBirth':{'type':Sequelize[_0xfe3f('0x3')]},'description':{'type':Sequelize[_0xfe3f('0x4')]},'phone':{'type':Sequelize[_0xfe3f('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xfe3f('0x3')]},'email':{'type':Sequelize[_0xfe3f('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xfe3f('0x3')]},'fb_data':{'type':Sequelize[_0xfe3f('0x3')]},'twitter':{'type':Sequelize[_0xfe3f('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xfe3f('0x3')]},'viber':{'type':Sequelize[_0xfe3f('0x3')]},'line':{'type':Sequelize[_0xfe3f('0x3')]},'wechat':{'type':Sequelize[_0xfe3f('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xfe3f('0x5')]},'priority':{'type':Sequelize[_0xfe3f('0x5')](0x2)[_0xfe3f('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xfe3f('0x7')]}};
\ No newline at end of file
+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
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 6f54f06..4255569 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 _0x63fe=['[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','omit','format','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','nolimit','setTags','ids','getHoppers','CmHopper','ContactId','includeAll','getHopperHistories','include','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','chmodSync','child_process','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','pid','file','parse','meta','import','binding','No\x20phone\x20column\x20specified','fork','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','getJourney','mail','chat','sms','openchannel','fax','voice','channel','includes','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','endtime','duration','note','userDisposition','userSecondDisposition','userThirdDisposition','UserId','alias','createdAt','findAndCountAll','startCase','Website','Account','closed','disposition','thirdDisposition','Owner','fullname','browserName','customerIp','customerPort','osName','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','all','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','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','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','error','name','send','index','keys','length','startsWith','cf_','CmCustomField','findOne','trimStart','fieldType','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','select','field','color','tools_tags','from','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','where','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','Tag','split','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','uc.UserId\x20=\x20?','dateOfBirth','castTo','DATE','buildExpression','text','value','start','filter','isNil','Contact','isEmpty','forEach','ListId','c.ListId\x20IN\x20?','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','resolve','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','push','rows','catch','destroy','find','params','describe','tags','displayName','columnName','custom','values','body','findAll','get','mergeWith','join','info'];(function(_0x3e3b81,_0x43adf9){var _0x1301b6=function(_0x2621fb){while(--_0x2621fb){_0x3e3b81['push'](_0x3e3b81['shift']());}};_0x1301b6(++_0x43adf9);}(_0x63fe,0x87));var _0xe63f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x63fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe63f('0x0'));var rimraf=require(_0xe63f('0x1'));var zipdir=require(_0xe63f('0x2'));var jsonpatch=require(_0xe63f('0x3'));var rp=require(_0xe63f('0x4'));var moment=require(_0xe63f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe63f('0x6'));var path=require(_0xe63f('0x7'));var sox=require(_0xe63f('0x8'));var csv=require('to-csv');var ejs=require(_0xe63f('0x9'));var fs=require('fs');var fs_extra=require(_0xe63f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe63f('0xb'));var jsforce=require(_0xe63f('0xc'));var deskjs=require(_0xe63f('0xd'));var toCsv=require(_0xe63f('0xe'));var querystring=require(_0xe63f('0xf'));var Papa=require(_0xe63f('0x10'));var Redis=require(_0xe63f('0x11'));var authService=require(_0xe63f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe63f('0x13'));var hardwareService=require(_0xe63f('0x14'));var logger=require(_0xe63f('0x15'))(_0xe63f('0x16'));var utils=require(_0xe63f('0x17'));var config=require(_0xe63f('0x18'));var licenseUtil=require(_0xe63f('0x19'));var db=require(_0xe63f('0x1a'))['db'];config[_0xe63f('0x1b')]=_[_0xe63f('0x1c')](config[_0xe63f('0x1b')],{'host':_0xe63f('0x1d'),'port':0x18eb});var socket=require(_0xe63f('0x1e'))(new Redis(config[_0xe63f('0x1b')]));require('./cmContact.socket')[_0xe63f('0x1f')](socket);function respondWithStatusCode(_0x647eba,_0x59264a){_0x59264a=_0x59264a||0xcc;return function(_0x22a735){if(_0x22a735){return _0x647eba[_0xe63f('0x20')](_0x59264a);}return _0x647eba[_0xe63f('0x21')](_0x59264a)[_0xe63f('0x22')]();};}function respondWithResult(_0x103636,_0x176cbd){_0x176cbd=_0x176cbd||0xc8;return function(_0xa517be){if(_0xa517be){return _0x103636[_0xe63f('0x21')](_0x176cbd)['json'](_0xa517be);}};}function respondWithFilteredResult(_0x2a3128,_0x1a62d5){return function(_0x2586ae){if(_0x2586ae){var _0x495a10=typeof _0x1a62d5[_0xe63f('0x23')]===_0xe63f('0x24')&&typeof _0x1a62d5['limit']===_0xe63f('0x24');var _0x3ce620=_0x2586ae[_0xe63f('0x25')];var _0x34afe7=_0x495a10?0x0:_0x1a62d5[_0xe63f('0x23')];var _0x5613b7=_0x495a10?_0x2586ae[_0xe63f('0x25')]:_0x1a62d5[_0xe63f('0x23')]+_0x1a62d5[_0xe63f('0x26')];var _0x1fa2dc;if(_0x5613b7>=_0x3ce620){_0x5613b7=_0x3ce620;_0x1fa2dc=0xc8;}else{_0x1fa2dc=0xce;}_0x2a3128[_0xe63f('0x21')](_0x1fa2dc);return _0x2a3128[_0xe63f('0x27')](_0xe63f('0x28'),_0x34afe7+'-'+_0x5613b7+'/'+_0x3ce620)[_0xe63f('0x29')](_0x2586ae);}return null;};}function patchUpdates(_0x10e7f6){return function(_0x30e760){try{jsonpatch['apply'](_0x30e760,_0x10e7f6,!![]);}catch(_0x261cda){return BPromise[_0xe63f('0x2a')](_0x261cda);}return _0x30e760[_0xe63f('0x2b')]();};}function saveUpdates(_0xd60cd9,_0x201813){return function(_0x34f868){if(_0x34f868){return _0x34f868[_0xe63f('0x2c')](_0xd60cd9)[_0xe63f('0x2d')](function(_0x2dca5c){return _0x2dca5c;});}return null;};}function removeEntity(_0x1f88db,_0x3be8a3){return function(_0x3f9b67){if(_0x3f9b67){return _0x3f9b67['destroy']()['then'](function(){_0x1f88db[_0xe63f('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x423483,_0x11301f){return function(_0x3d7e23){if(!_0x3d7e23){_0x423483['sendStatus'](0x194);}return _0x3d7e23;};}function handleError(_0x4768a5,_0x1a701f){_0x1a701f=_0x1a701f||0x1f4;return function(_0x37c5df){logger[_0xe63f('0x2e')](_0x37c5df['stack']);if(_0x37c5df['name']){delete _0x37c5df[_0xe63f('0x2f')];}_0x4768a5[_0xe63f('0x21')](_0x1a701f)[_0xe63f('0x30')](_0x37c5df);};}exports[_0xe63f('0x31')]=function(_0x5d66ba,_0x2a7374){var _0x1b7c04={},_0x304b28={},_0x17f2bf={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0xe63f('0x2d')](function(_0x366dce){var _0x5cf370=[];for(var _0x124f84=0x0;_0x124f84
','Attachments','Title','Data','getHost'];(function(_0x17f389,_0x47acc2){var _0x5b129f=function(_0xfba30a){while(--_0xfba30a){_0x17f389['push'](_0x17f389['shift']());}};_0x5b129f(++_0x47acc2);}(_0xb7ac,0x18a));var _0xcb7a=function(_0x8d6df9,_0x467f7d){_0x8d6df9=_0x8d6df9-0x0;var _0x3ee34d=_0xb7ac[_0x8d6df9];return _0x3ee34d;};'use strict';var _=require(_0xcb7a('0x0'));var moment=require(_0xcb7a('0x1'));var random=require(_0xcb7a('0x2'));var fs=require('fs');var path=require(_0xcb7a('0x3'));var util=require(_0xcb7a('0x4'));var tnef=require('node-tnef');var logger=require(_0xcb7a('0x5'))('email');var config=require(_0xcb7a('0x6'));function getAddress(_0xaa5a21){var _0x50be72=_[_0xcb7a('0x7')](_0xaa5a21[_0xcb7a('0x8')]);return _0x50be72&&_0x50be72[_0xcb7a('0x9')]?_0x50be72['address']:'anonymous'+random[_0xcb7a('0xa')](0x6)+_0xcb7a('0xb');}function getFirstName(_0x555ea7){var _0x2655b5=_[_0xcb7a('0x7')](_0x555ea7[_0xcb7a('0x8')]);if(_0x2655b5&&_0x2655b5[_0xcb7a('0xc')]){if(_0x2655b5[_0xcb7a('0xc')]==_0x2655b5[_0xcb7a('0x9')]){return _0x2655b5['name'][_0xcb7a('0xd')](0x0,_0x2655b5[_0xcb7a('0xc')][_0xcb7a('0xe')]('@'));}var _0x5d84a9=_0x2655b5[_0xcb7a('0xc')][_0xcb7a('0xf')](/\s+/);return _0x5d84a9['length']>0x1?_0x5d84a9[_0xcb7a('0x10')](0x0,-0x1)[_0xcb7a('0x11')]('\x20'):_0x2655b5[_0xcb7a('0xc')];}return _0xcb7a('0x12');}function getLastName(_0x3ec54d){var _0xb8b4f6=_[_0xcb7a('0x7')](_0x3ec54d[_0xcb7a('0x8')]);if(_0xb8b4f6&&_0xb8b4f6[_0xcb7a('0xc')]){var _0x578f9c=_0xb8b4f6[_0xcb7a('0xc')]['split'](/\s+/);return _0x578f9c[_0xcb7a('0x13')]>0x1?_0x578f9c[_0xcb7a('0x14')]():'';}return'';}function getMails(_0x7f1071,_0x37ea19){var _0x53721a='';for(var _0x2bb2e9=0x0;_0x2bb2e9<_0x37ea19[_0xcb7a('0x8')][_0xcb7a('0x13')];_0x2bb2e9+=0x1){if(_0x37ea19[_0xcb7a('0x8')][_0x2bb2e9][_0xcb7a('0x9')]!==_0x7f1071){if(!_[_0xcb7a('0x15')](_0x53721a)){_0x53721a+=',';}_0x53721a+=_0x37ea19[_0xcb7a('0x8')][_0x2bb2e9]['name']||_0x37ea19[_0xcb7a('0x8')][_0x2bb2e9][_0xcb7a('0x9')]||'';_0x53721a+='\x20<';_0x53721a+=_0x37ea19[_0xcb7a('0x8')][_0x2bb2e9][_0xcb7a('0x9')]?_0x37ea19['value'][_0x2bb2e9]['address']:'anonymous'+random[_0xcb7a('0xa')](0x6)+'@xcally.com';_0x53721a+='>';}}return _0x53721a;}function parseEmail(_0x273bbb,_0x112d6e,_0x30c745){if(_0x112d6e[_0xcb7a('0x16')]){var _0x45e54b=/